pwix:modal-info
What is it ?
This is a Bootstrap-based Meteor package which displays standard informations about an object:
- maybe a name as a (centered) title
- created at
- created by
- last updated at
- last updated by
- identifier
Configuration
None at the moment.
What does it provide ?
A global object
ModalInfo
Methods
ModalInfo.i18n.namespace()
Returns the i18n namespace of the package.
Blaze components
miButton
Just a button which will triggers the dialog opening with the attached object.
Known parameters are:
-
enabled
: whether the button should be enabled, defaulting to true, or a function which will receive these same parameters, and must return such a true|false value -
classButton
: the classes to be set on the button instead of thebtn-sm btn-primary
default -
stampFormat
: the strftime format to be used to display the date, defaulting to theIntl.DateTimeFormat()
format corresponding to the current locale -
titleButton
: the title attached to the button, defaulting to 'Informations about <name>' -
titleDialog
: the title of the to-be-opened dialog, defaulting to 'Informations' -
name
: the name to be displayed at the top of the object informations, defaulting to nothing -
object
: (mandatory) the object to be displayed, or a function which returns such an object.
Please note that all the parameters will always be passed to the Modal.run()
function, and then to the miPanel
template. We are so able to add here as many pwix:modal
parameters as you want.
miPanel
The display panel as an independant component. You are so able to integrate it into your own page.
Known parameters are:
-
name: the name to be displayed at the top of the object informations, defaulting to nothing
-
object: (mandatory) the object to be displayed, or a function which returns such an object.
The function has following prototype: async fn( <Object>) : Object
, and is called with the current data context.
This package relies on pwix:accounts-tools
to get the email address (resp. the username) of the creator/last updator of the provided object.
NPM peer dependencies
Starting with v 1.1.0, and in accordance with advices from the Meteor Guide, we no more hardcode NPM dependencies in the Npm.depends
clause of the package.js
.
Instead we check npm versions of installed packages at runtime, on server startup, in development environment.
Dependencies as of v 1.7.0:
'strftime': '^0.10.0'
Each of these dependencies should be installed at application level:
meteor npm install <package> --save
Translations
New and updated translations are willingly accepted, and more than welcome. Just be kind enough to submit a PR on the Github repository.
P. Wieser
- Last updated on 2024, Jul. 1st