@massimo-cassandro/minimo 1.5.8 → 1.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@massimo-cassandro/minimo",
3
- "version": "1.5.8",
3
+ "version": "1.5.10",
4
4
  "description": "Light css framework & utilities",
5
5
  "type": "module",
6
+ "main": "./index.js",
7
+ "exports": {
8
+ ".": "./index.js"
9
+ },
6
10
  "homepage": "https://github.com/massimo-cassandro/minimo#readme",
7
11
  "bugs": {
8
12
  "url": "https://github.com/massimo-cassandro/minimo/issues"
@@ -3,9 +3,10 @@ export const defaults = {
3
3
  // settings to be applied to all dialog types
4
4
  // can be reassigned on single types
5
5
  globals: {
6
+ extra_class: null,
6
7
  onOpen: null,
7
8
  onClose: null,
8
- cssFile: null, // css file to be automatically loaded
9
+ cssFile: null, // css file to be automatically loaded // TODO remove
9
10
  animation: true,
10
11
  showMarks: true,
11
12
  callback: null,
@@ -4,6 +4,7 @@ import {defaults} from './defaults.js';
4
4
  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement
5
5
 
6
6
  // TODO rewrite as async
7
+ // TODO rivedere completamente, riscrivere con domBuilder
7
8
 
8
9
  export default function (params, custom_defaults = {}, marks = default_marks) {
9
10
 
@@ -65,7 +66,7 @@ export default function (params, custom_defaults = {}, marks = default_marks) {
65
66
  const closedByAny = ['success', 'info'].indexOf(params.type) !== -1? ' closedBy="any"' : '';
66
67
 
67
68
  document.body.insertAdjacentHTML('beforeend',
68
- `<dialog class="modal-alert modal-alert-${params.type}${params.animation? ' modal-alert-animated' : ''}"${closedByAny}>
69
+ `<dialog class="modal-alert modal-alert-${params.type}${params.animation? ' modal-alert-animated' : ''} ${params.extra_class??''}"${closedByAny}>
69
70
  <div class="malert-inner">
70
71
  ${params.showMarks? `<div class="malert-mark">${icon}</div>` : ''}
71
72
  <div class="malert-body">