@massimo-cassandro/minimo 1.41.3 → 1.41.5
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/README.md +12 -12
- package/charts/src/node-helpers/create-svg-canvas-node.mjs +2 -2
- package/charts/src/node-helpers/svg-text-to-path.js +9 -9
- package/charts/src/rating-display/index.js +1 -1
- package/charts/src/rating-display/ratindDisplayAnimation.js +3 -3
- package/design-tokens/README.md +2 -2
- package/design-tokens/_src/_readme.md +26 -26
- package/dev-tools/README.md +16 -16
- package/dev-tools/create-favicons/README.md +31 -31
- package/dev-tools/create-favicons/src/create-ico.mjs +2 -2
- package/dev-tools/create-favicons/src/default-params.mjs +1 -1
- package/dev-tools/create-favicons/src/init.mjs +1 -1
- package/dev-tools/design-tokens-builder/README.md +102 -102
- package/dev-tools/design-tokens-builder/build-tokens-src/build-source-modes.mjs +85 -73
- package/dev-tools/design-tokens-builder/build-tokens-src/config.mjs +109 -85
- package/dev-tools/design-tokens-builder/build-tokens-src/formats/css.mjs +113 -90
- package/dev-tools/design-tokens-builder/build-tokens-src/formats/json.mjs +107 -95
- package/dev-tools/design-tokens-builder/build-tokens-src/legacy-tokens-parser.mjs +71 -64
- package/dev-tools/design-tokens-builder/build-tokens-src/light-dark.mjs +75 -65
- package/dev-tools/design-tokens-builder/build-tokens-src/merge-css.mjs +113 -102
- package/dev-tools/design-tokens-builder/build-tokens-src/platforms.mjs +36 -30
- package/dev-tools/design-tokens-builder/build-tokens-src/resolve-source-paths.mjs +15 -13
- package/dev-tools/design-tokens-builder/build-tokens-src/source-prefixes.mjs +44 -42
- package/dev-tools/design-tokens-builder/build-tokens-src/source-transforms.mjs +89 -83
- package/dev-tools/design-tokens-builder/build-tokens-src/token-rename-parser.mjs +99 -86
- package/dev-tools/design-tokens-builder/build-tokens-src/transforms.mjs +64 -48
- package/dev-tools/design-tokens-builder/build-tokens.mjs +80 -68
- package/dev-tools/design-tokens-builder/check-unresolved-custom-props.mjs +103 -77
- package/dev-tools/design-tokens-builder/tokens-config-sample.mjs +275 -238
- package/dev-tools/find-orphan-css-classes/find-orphan-css-classes.mjs +2 -2
- package/dev-tools/starter-kit/source_files/app/CLAUDE.md +4 -2
- package/dev-tools/starter-kit/source_files/app/index.css +10 -0
- package/dev-tools/starter-kit/source_files/app/index.js +1 -1
- package/dev-tools/starter-kit/source_files/root/_sf/controller/ImgViewerController.php +3 -3
- package/dev-tools/starter-kit/source_files/root/_sf/controller/ViewerController.php +2 -2
- package/dev-tools/starter-kit/source_files/root/stylelint.config.mjs +1 -1
- package/dev-tools/starter-kit/source_files/root/webpack-config-modules/css-rules.mjs +1 -1
- package/dev-tools/starter-kit/starter-install.sh +2 -2
- package/dev-tools/stylelint-config/README.md +7 -7
- package/dev-tools/svg-icons-tools/README.md +32 -32
- package/dev-tools/svg-icons-tools/src/config-manager.mjs +1 -1
- package/dev-tools/svg-icons-tools/src/default-config.mjs +118 -118
- package/dev-tools/svg-icons-tools/src/jsx-icon-file-builder.mjs +24 -24
- package/dev-tools/svg-icons-tools/src/parse-svg-filename.mjs +3 -3
- package/dev-tools/svg-icons-tools/src/parse-svg-files.mjs +1 -1
- package/dev-tools/svg-icons-tools/src/parse-svg-markup.mjs +4 -4
- package/dev-tools/svg-icons-tools/src/svg-to-jsx.mjs +2 -2
- package/dev-tools/svg-icons-tools/src/svg-to-optimized.mjs +2 -2
- package/dev-tools/svg-icons-tools/src/svg-to-symbols.mjs +2 -2
- package/dev-tools/upd@m/README.md +1 -1
- package/dev-tools/upd@m/index.mjs +1 -1
- package/dev-tools/update-version/README.md +9 -9
- package/index.js +1 -0
- package/package.json +3 -1
- package/snippets/unsplash-browser-app/README.md +1 -1
- package/snippets/unsplash-browser-app/unsplash-utilities.js +9 -9
- package/src/components/autocomplete/README.md +3 -3
- package/src/components/autocomplete/autocomplete-engine.js +75 -63
- package/src/components/autocomplete/check-autocomplete.js +3 -3
- package/src/components/dismiss-alerts.js +3 -3
- package/src/components/form-reset-submit.js +6 -6
- package/src/components/inner-nav/inner-nav.js +2 -2
- package/src/components/modal-alert/modal-alert.js +67 -65
- package/src/components/modal-alert/modal-alert.minimo.tokens.mjs +1 -1
- package/src/components/modal-popup/modal-popup.js +56 -56
- package/src/components/overlay/overlay.js +3 -3
- package/src/components/sf-macro/readme.md +1 -1
- package/src/components/sf-macro/sf-macro.js +27 -23
- package/src/components/slide-up-down-toggle/slide-up-down-toggle.js +83 -79
- package/src/components/slide-up-down-toggle/slide-up-down-toggle.module.css +44 -44
- package/src/components/snackbar/snackbar.js +19 -19
- package/src/components/spinner/spinner.js +3 -3
- package/src/components/unsplash-page/README.md +8 -8
- package/src/components/unsplash-page/fetch-unsplash-data.js +3 -3
- package/src/components/unsplash-page/unsplash-page.js +33 -33
- package/src/components/unsplash-page/unsplash-page.module.css +1 -1
- package/src/css/alerts.css +2 -2
- package/src/css/forms/forms.css +4 -4
- package/src/css/forms/validation.css +1 -1
- package/src/css/margin-padding-media.css +4 -4
- package/src/css/margin-padding.css +4 -4
- package/src/css/reset.css +11 -11
- package/src/icons/read-me.md +1 -1
- package/src/minimo.css +3 -9
- package/src/utilities/better-text-with-places.js +105 -105
- package/src/utilities/better-text.js +42 -35
- package/src/utilities/classnames.js +8 -8
- package/src/utilities/cookies.js +6 -6
- package/src/utilities/create-id.js +3 -3
- package/src/utilities/disable-btns-on-submit.js +2 -2
- package/src/utilities/dom-builder/dom-builder.js +89 -86
- package/src/utilities/dom-builder/domBuilderBasicSetup.js +9 -9
- package/src/utilities/dom-builder/parseDomString.js +23 -23
- package/src/utilities/dom-builder-helpers/README.md +2 -2
- package/src/utilities/dom-builder-helpers/form-tags.js +100 -100
- package/src/utilities/dom-builder-helpers/picture-tag.js +39 -39
- package/src/utilities/enable-submit-btns.js +1 -1
- package/src/utilities/escape-html.js +2 -2
- package/src/utilities/generate-pwd.js +4 -4
- package/src/utilities/linked-dates.js +13 -13
- package/src/utilities/parse-file-size.js +6 -6
- package/src/utilities/random-id.js +3 -3
- package/src/utilities/relative-date.js +40 -40
- package/src/utilities/sentence-case.js +1 -1
- package/src/utilities/strip-tags.js +1 -1
- package/src/utilities/title-case.js +1 -1
- package/src/utilities/truncate-string.js +5 -5
- package/src/utilities/validation-error-class.js +12 -12
- package/src/web-components/json-table/json-table-component.js +123 -121
- package/src/web-components/json-table/json-table-component.module.css +6 -6
- package/src/web-components/json-table/json-table.minimo.tokens.mjs +6 -6
- package/src/web-components/json-table/readme.md +76 -110
- package/src/web-components/json-table/src/cell-content.js +25 -25
- package/src/web-components/json-table/src/content-utils.js +21 -21
- package/src/web-components/json-table/src/data-types.js +32 -32
- package/src/web-components/json-table/src/defaults.js +230 -191
- package/src/web-components/json-table/src/get-data.js +55 -38
- package/src/web-components/json-table/src/icons.js +17 -17
- package/src/web-components/json-table/src/info-section.js +18 -18
- package/src/web-components/json-table/src/main-builder.js +45 -45
- package/src/web-components/json-table/src/pagination.js +32 -32
- package/src/web-components/json-table/src/parse-cols.js +18 -18
- package/src/web-components/json-table/src/parse-rows.js +17 -17
- package/src/web-components/json-table/src/resolve-params.js +53 -41
- package/src/web-components/json-table/src/search.js +13 -13
- package/src/web-components/json-table/src/sorting.js +20 -20
- package/src/web-components/json-table/src/table-body.js +13 -13
- package/src/web-components/json-table/src/table-builder.js +34 -34
- package/src/web-components/json-table/src/table-tfoot.js +8 -8
- package/src/web-components/json-table/src/table-thead.js +21 -21
- package/src/web-components/json-table/src/update-info.js +11 -11
- package/types/classes.d.ts +2 -2
- package/types/global.d.ts +18 -12
|
@@ -6,157 +6,157 @@ import {
|
|
|
6
6
|
} from './icons.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* DOM
|
|
11
|
-
*
|
|
9
|
+
* Contenuto accettato da ogni cella / intestazione / area informativa: testo semplice, stringa HTML, numero,
|
|
10
|
+
* nodo DOM o array domBuilder. `null` viene reso come `renderNullAs`, `undefined` lascia proseguire la
|
|
11
|
+
* pipeline di rendering predefinita (vedi `cell-content.js`).
|
|
12
12
|
* @typedef {string|number|Node|DomBuilderItem[]|null|undefined} CellContent
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* `.svg?inline`
|
|
16
|
+
* Icona / markup usato per i booleani e per i pulsanti di ordinamento e paginazione: una stringa SVG/HTML (ad es. un
|
|
17
|
+
* import `.svg?inline`), un nodo DOM, un elemento domBuilder o una funzione che ne restituisce uno.
|
|
18
18
|
* @typedef {string|Node|DomBuilderItem|(() => string|Node|DomBuilderItem)} IconDef
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* Renderer delle celle di una colonna. Gli argomenti sono posizionali (tutti opzionali) per tenere il caso
|
|
23
|
+
* più semplice (`row => row.name`) il più breve possibile.
|
|
24
24
|
* @callback ColRender
|
|
25
|
-
* @param {Object} row -
|
|
26
|
-
* @param {HTMLTableRowElement} [tr] -
|
|
27
|
-
* @param {HTMLTableCellElement} [td] -
|
|
28
|
-
* @returns {CellContent|void}
|
|
29
|
-
* `null`
|
|
25
|
+
* @param {Object} row - L'oggetto dati della riga corrente
|
|
26
|
+
* @param {HTMLTableRowElement} [tr] - L'elemento `<tr>` della riga corrente
|
|
27
|
+
* @param {HTMLTableCellElement} [td] - L'elemento cella (`<td>` o `<th scope="row">`)
|
|
28
|
+
* @returns {CellContent|void} Contenuto della cella; `undefined` (nessun `return`) ripiega sul rendering del data type,
|
|
29
|
+
* `null` su `renderNullAs`
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Renderer delle celle del footer.
|
|
34
34
|
* @callback TfootRender
|
|
35
|
-
* @param {Object[]} rows -
|
|
36
|
-
* @param {HTMLTableCellElement} [td] -
|
|
35
|
+
* @param {Object[]} rows - L'intero insieme di dati filtrato, oppure solo la pagina corrente quando `updateFooterOnPageChange` è true
|
|
36
|
+
* @param {HTMLTableCellElement} [td] - L'elemento cella del footer
|
|
37
37
|
* @returns {CellContent}
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Definizione di una colonna (elementi di `cols`).
|
|
42
42
|
*
|
|
43
43
|
* @typedef {Object} ColDefinition
|
|
44
|
-
* @property {string} key -
|
|
45
|
-
* @property {CellContent|(() => CellContent)} [title] -
|
|
46
|
-
*
|
|
47
|
-
* @property {string} [dataType] - Data type,
|
|
48
|
-
* @property {string} [type] - Alias
|
|
49
|
-
* @property {ColRender|string|null} [render] -
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* @property {TfootRender|string|null} [tfootRender] -
|
|
53
|
-
* `(rows, td) => content`,
|
|
54
|
-
* `'@max'`, `'@count'`
|
|
55
|
-
* `null`
|
|
56
|
-
* @property {boolean} [rowHeading] -
|
|
57
|
-
* @property {boolean} [searchable] -
|
|
58
|
-
* @property {boolean} [sortable] -
|
|
59
|
-
* @property {*|((row: Object) => *)} [sortValue] -
|
|
60
|
-
*
|
|
61
|
-
* @property {*|((row: Object) => *)} [searchValue] -
|
|
62
|
-
* @property {boolean|((params: JsonTableParams) => boolean)} [condition] -
|
|
63
|
-
* false)
|
|
64
|
-
* @property {string|null} [headerClass] -
|
|
65
|
-
* `headerClass`/`cellClass
|
|
66
|
-
* @property {string|null} [cellClass] -
|
|
44
|
+
* @property {string} key - OBBLIGATORIO: chiave dell'oggetto riga (notazione con punto ammessa per i valori annidati, es. `owner.name`)
|
|
45
|
+
* @property {CellContent|(() => CellContent)} [title] - Contenuto dell'intestazione (testo, HTML, Node, array domBuilder o funzione).
|
|
46
|
+
* Quando la colonna è ordinabile è il testo del pulsante di ordinamento (default: la chiave stessa)
|
|
47
|
+
* @property {string} [dataType] - Data type, una delle chiavi di `dataTypes`. `type` è accettato come alias (default: 'string')
|
|
48
|
+
* @property {string} [type] - Alias di `dataType`
|
|
49
|
+
* @property {ColRender|string|null} [render] - Renderer della cella: una funzione `(row, tr, td) => content` oppure,
|
|
50
|
+
* anche tramite attributo HTML, una stringa in stile mustache in cui i segnaposto `[[key]]` vengono sostituiti con i valori
|
|
51
|
+
* della riga (chiavi annidate ammesse). Sovrascrive il rendering del data type (default: null)
|
|
52
|
+
* @property {TfootRender|string|null} [tfootRender] - Contenuto della cella del footer (solo quando `tfoot` è true): una funzione
|
|
53
|
+
* `(rows, td) => content`, una stringa statica o uno degli aggregati predefiniti `'@sum'`, `'@avg'`, `'@min'`,
|
|
54
|
+
* `'@max'`, `'@count'` calcolati sui valori della colonna e formattati dal data type della colonna.
|
|
55
|
+
* `null` rende una cella vuota (default: null)
|
|
56
|
+
* @property {boolean} [rowHeading] - Se true la cella è un'intestazione di riga (`<th scope="row">`) (default: false)
|
|
57
|
+
* @property {boolean} [searchable] - Abilita la ricerca su questa colonna (default: true)
|
|
58
|
+
* @property {boolean} [sortable] - Abilita l'ordinamento su questa colonna (default: true)
|
|
59
|
+
* @property {*|((row: Object) => *)} [sortValue] - Valore usato per l'ordinamento, oppure funzione `row => value`.
|
|
60
|
+
* Sovrascrive il `sortValue` del data type (default: undefined = data type / valore grezzo)
|
|
61
|
+
* @property {*|((row: Object) => *)} [searchValue] - Come `sortValue`, per la ricerca (default: undefined)
|
|
62
|
+
* @property {boolean|((params: JsonTableParams) => boolean)} [condition] - Se false (o una funzione che restituisce
|
|
63
|
+
* false) la colonna non viene renderizzata affatto (default: true)
|
|
64
|
+
* @property {string|null} [headerClass] - Classe/i del `<th>`, che sostituiscono quelle del data type. Quando è impostato solo uno tra
|
|
65
|
+
* `headerClass`/`cellClass`, l'altro assume lo stesso valore (default: null)
|
|
66
|
+
* @property {string|null} [cellClass] - Classe/i delle celle del body/footer, che sostituiscono quelle del data type (default: null)
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Definizione di un data type (valori di `dataTypes`). Ogni funzione è opzionale.
|
|
71
71
|
*
|
|
72
72
|
* @typedef {Object} DataTypeDefinition
|
|
73
|
-
* @property {string|null} [headerClass] -
|
|
74
|
-
* @property {string|null} [cellClass] -
|
|
75
|
-
* @property {((value: *, row: Object, params: JsonTableParams) => string|null)} [internalCellClass] -
|
|
76
|
-
*
|
|
77
|
-
* @property {(value: *, row: Object|null, params: JsonTableParams) => CellContent} [render] -
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* @property {(value: *, row: Object, params: JsonTableParams) => *} [sortValue] -
|
|
81
|
-
* @property {(value: *, row: Object, params: JsonTableParams) => string} [searchValue] -
|
|
82
|
-
* @property {Partial<ColDefinition>} [colDefaults] -
|
|
83
|
-
*
|
|
84
|
-
* @property {string} [inheritsFrom] -
|
|
73
|
+
* @property {string|null} [headerClass] - Classe/i predefinite del `<th>` (sovrascrivibili tramite `ColDefinition.headerClass`)
|
|
74
|
+
* @property {string|null} [cellClass] - Classe/i predefinite delle celle (sovrascrivibili tramite `ColDefinition.cellClass`)
|
|
75
|
+
* @property {((value: *, row: Object, params: JsonTableParams) => string|null)} [internalCellClass] - Classe/i sempre
|
|
76
|
+
* aggiunte alle celle, indipendentemente da `cellClass` (usata dal tipo `bool` predefinito per gli stili delle icone)
|
|
77
|
+
* @property {(value: *, row: Object|null, params: JsonTableParams) => CellContent} [render] - Renderer della cella; non invocato
|
|
78
|
+
* per i valori `null`/`undefined`, che vengono resi come `renderNullAs`. `row` è null quando la funzione è
|
|
79
|
+
* usata per formattare un aggregato del footer (`tfootRender: '@sum'`, ...)
|
|
80
|
+
* @property {(value: *, row: Object, params: JsonTableParams) => *} [sortValue] - Valore usato per l'ordinamento (default: valore grezzo)
|
|
81
|
+
* @property {(value: *, row: Object, params: JsonTableParams) => string} [searchValue] - Valore usato per la ricerca (default: `String(value)`)
|
|
82
|
+
* @property {Partial<ColDefinition>} [colDefaults] - Default delle colonne imposti da questo tipo (es. `{ sortable: false }`),
|
|
83
|
+
* comunque sovrascrivibili nella definizione della colonna
|
|
84
|
+
* @property {string} [inheritsFrom] - Solo per i tipi personalizzati: chiave del tipo predefinito da estendere
|
|
85
85
|
*/
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
88
|
+
* Nomi di classe del consumer usati dalla struttura generata. Le classi interne di layout (CSS module)
|
|
89
|
+
* vengono sempre applicate in aggiunta a queste.
|
|
90
90
|
*
|
|
91
91
|
* @typedef {Object} JsonTableClasses
|
|
92
|
-
* @property {string|null} [wrapper] -
|
|
93
|
-
* @property {string|null} [infoOuter] -
|
|
94
|
-
* @property {string|null} [info] -
|
|
95
|
-
* @property {string|null} [resultInfo] -
|
|
96
|
-
* @property {string|null} [search] -
|
|
97
|
-
* @property {string|null} [searchInput] -
|
|
98
|
-
* @property {string|null} [tableWrapper] - Div
|
|
99
|
-
* @property {string|null} [table] - `<table>`
|
|
100
|
-
* @property {string|null} [tableFooter] -
|
|
101
|
-
* @property {string|null} [caption] -
|
|
102
|
-
* @property {string|null} [pagination] -
|
|
103
|
-
* @property {string|null} [paginationBtn] -
|
|
104
|
-
* @property {string|null} [sortBtn] -
|
|
105
|
-
* @property {string|null} [empty] -
|
|
106
|
-
* @property {string|null} [textStart] -
|
|
107
|
-
* @property {string|null} [textCenter] -
|
|
108
|
-
* @property {string|null} [textEnd] -
|
|
109
|
-
* @property {string|null} [nowrap] -
|
|
110
|
-
* @property {string|null} [numeric] -
|
|
111
|
-
* @property {string|null} [boolCell] -
|
|
112
|
-
* @property {string|null} [boolTrue] -
|
|
113
|
-
* @property {string|null} [boolFalse] -
|
|
92
|
+
* @property {string|null} [wrapper] - Wrapper principale (`<section>`: sezione info + tabella) (default: null)
|
|
93
|
+
* @property {string|null} [infoOuter] - Contenitore esterno delle info (default: null)
|
|
94
|
+
* @property {string|null} [info] - Contenitore delle info (testo informativo + ricerca) (default: null)
|
|
95
|
+
* @property {string|null} [resultInfo] - Contenitore del testo informativo (default: null)
|
|
96
|
+
* @property {string|null} [search] - Wrapper dell'input di ricerca (default: null)
|
|
97
|
+
* @property {string|null} [searchInput] - Input di ricerca (default: 'form-control form-control-sm')
|
|
98
|
+
* @property {string|null} [tableWrapper] - Div che racchiude la tabella (default: 'table-responsive')
|
|
99
|
+
* @property {string|null} [table] - Elemento `<table>` (default: 'table table-bordered')
|
|
100
|
+
* @property {string|null} [tableFooter] - Barra sotto la tabella che contiene caption e paginazione (default: null)
|
|
101
|
+
* @property {string|null} [caption] - Contenitore della caption dentro la barra del footer della tabella (default: null)
|
|
102
|
+
* @property {string|null} [pagination] - `<nav>` della paginazione (default: null)
|
|
103
|
+
* @property {string|null} [paginationBtn] - Pulsanti di paginazione (default: 'btn-reset')
|
|
104
|
+
* @property {string|null} [sortBtn] - Pulsanti di ordinamento dentro il `<th>` (default: 'btn-reset')
|
|
105
|
+
* @property {string|null} [empty] - L'unica cella mostrata quando non ci sono righe (default: null)
|
|
106
|
+
* @property {string|null} [textStart] - Classe di allineamento inline-start (default: null, le celle di minimo sono allineate all'inizio di default)
|
|
107
|
+
* @property {string|null} [textCenter] - Classe di allineamento al centro (default: 'text-center')
|
|
108
|
+
* @property {string|null} [textEnd] - Classe di allineamento inline-end (default: 'text-end')
|
|
109
|
+
* @property {string|null} [nowrap] - Classe no-wrap (default: 'text-nowrap')
|
|
110
|
+
* @property {string|null} [numeric] - Classe per le cifre tabulari, usata dai tipi numerici (default: 'text-numeric')
|
|
111
|
+
* @property {string|null} [boolCell] - Classe extra di ogni cella `bool` (default: null)
|
|
112
|
+
* @property {string|null} [boolTrue] - Classe extra delle celle `bool` il cui valore è `true` (default: null)
|
|
113
|
+
* @property {string|null} [boolFalse] - Classe extra delle celle `bool` il cui valore è `false` (default: null)
|
|
114
114
|
*/
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
117
|
+
* Testi usati dal componente. Il segnaposto `{page}` delle label di paginazione viene sostituito
|
|
118
|
+
* con il numero di pagina.
|
|
119
119
|
*
|
|
120
120
|
* @typedef {Object} JsonTableLabels
|
|
121
|
-
* @property {string} [loading] -
|
|
122
|
-
* @property {string} [searchPlaceholder] -
|
|
123
|
-
* @property {string} [searchTitle] -
|
|
124
|
-
* @property {string} [searchAriaLabel] -
|
|
125
|
-
* @property {string} [info] -
|
|
121
|
+
* @property {string} [loading] - Placeholder di caricamento (nascosto visivamente) (default: 'Caricamento dati…')
|
|
122
|
+
* @property {string} [searchPlaceholder] - Placeholder dell'input di ricerca (default: 'Cerca...')
|
|
123
|
+
* @property {string} [searchTitle] - `title` dell'input di ricerca (default: 'Cerca nella tabella')
|
|
124
|
+
* @property {string} [searchAriaLabel] - `aria-label` dell'input di ricerca (default: 'Filtra risultati')
|
|
125
|
+
* @property {string} [info] - Template del testo informativo, segnaposto: `{start}`, `{end}`, `{totRec}`, `{filteredRec}`,
|
|
126
126
|
* `{page}`, `{totPages}` (default: 'Stai visualizzando le righe da {start} a {end}, su un totale di {filteredRec} record trovati')
|
|
127
|
-
* @property {string} [noRows] -
|
|
128
|
-
* @property {string} [noResults] -
|
|
129
|
-
* @property {string} [sortAsc] - `aria-label`/`title`
|
|
127
|
+
* @property {string} [noRows] - Testo informativo e contenuto della cella vuota quando l'insieme di dati è vuoto (default: 'Nessun record trovato')
|
|
128
|
+
* @property {string} [noResults] - Come `noRows`, quando una ricerca non restituisce nulla (default: 'Nessun risultato per la ricerca')
|
|
129
|
+
* @property {string} [sortAsc] - `aria-label`/`title` del pulsante di ordinamento quando il prossimo click ordina in modo crescente
|
|
130
130
|
* (default: 'Ordina questa colonna in senso ascendente (A → Z)')
|
|
131
|
-
* @property {string} [sortDesc] -
|
|
132
|
-
* @property {string} [sortNone] -
|
|
133
|
-
* @property {string} [paginationAriaLabel] - `aria-label`
|
|
134
|
-
* @property {string} [prevPage] - `aria-label`/`title`
|
|
135
|
-
* @property {string} [nextPage] -
|
|
136
|
-
* @property {string} [pageTitle] - `aria-label`/`title`
|
|
137
|
-
* @property {string} [currentPage] - `aria-label`/`title`
|
|
131
|
+
* @property {string} [sortDesc] - Come sopra, decrescente (default: 'Ordina questa colonna in senso discendente (Z → A)')
|
|
132
|
+
* @property {string} [sortNone] - Come sopra, rimozione dell'ordinamento (default: 'Rimuovi l’ordinamento a questa colonna')
|
|
133
|
+
* @property {string} [paginationAriaLabel] - `aria-label` del `<nav>` della paginazione (default: 'Navigazione pagine')
|
|
134
|
+
* @property {string} [prevPage] - `aria-label`/`title` del pulsante pagina precedente (default: 'Pagina precedente')
|
|
135
|
+
* @property {string} [nextPage] - Come sopra, pulsante pagina successiva (default: 'Pagina successiva')
|
|
136
|
+
* @property {string} [pageTitle] - `aria-label`/`title` dei pulsanti di pagina (default: 'Vai a pagina {page}')
|
|
137
|
+
* @property {string} [currentPage] - `aria-label`/`title` del pulsante della pagina corrente (default: 'Pagina {page}, corrente')
|
|
138
138
|
*/
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
141
|
+
* Funzione del testo informativo.
|
|
142
142
|
* @callback InfoTextFn
|
|
143
|
-
* @param {number} start -
|
|
144
|
-
* @param {number} end -
|
|
145
|
-
* @param {number} totRec -
|
|
146
|
-
* @param {number} filteredRec -
|
|
147
|
-
* @param {number} page -
|
|
148
|
-
* @param {number} totPages -
|
|
143
|
+
* @param {number} start - Indice (da 1) della prima riga visualizzata
|
|
144
|
+
* @param {number} end - Indice dell'ultima riga visualizzata
|
|
145
|
+
* @param {number} totRec - Numero totale di record (non filtrati)
|
|
146
|
+
* @param {number} filteredRec - Numero di record dopo il filtro
|
|
147
|
+
* @param {number} page - Pagina corrente (da 1)
|
|
148
|
+
* @param {number} totPages - Numero totale di pagine
|
|
149
149
|
* @returns {CellContent}
|
|
150
150
|
*/
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
|
-
*
|
|
153
|
+
* Nomi delle parti predefinite del template.
|
|
154
154
|
* @typedef {'infoSection'|'resultInfo'|'search'|'table'|'caption'|'pagination'} TemplateSlot
|
|
155
155
|
*/
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
158
|
+
* Elemento del template: un elemento domBuilder (i cui `children`/`content` possono contenere altri elementi del template)
|
|
159
|
+
* oppure un segnaposto di slot `{ slot: 'name' }` sostituito da una delle parti predefinite.
|
|
160
160
|
* @typedef {(Omit<DomBuilderItem, 'children'|'content'> & {
|
|
161
161
|
* children?: Array<TemplateItem|string|Node>,
|
|
162
162
|
* content?: DomBuilderItem['content']|TemplateItem[]
|
|
@@ -164,116 +164,153 @@ import {
|
|
|
164
164
|
*/
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
|
-
*
|
|
167
|
+
* Stato di ordinamento / definizione dell'ordinamento iniziale.
|
|
168
168
|
* @typedef {Object} SortDef
|
|
169
|
-
* @property {string} key -
|
|
170
|
-
* @property {'asc'|'desc'} dir -
|
|
169
|
+
* @property {string} key - Chiave della colonna
|
|
170
|
+
* @property {'asc'|'desc'} dir - Direzione
|
|
171
171
|
*/
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
174
|
+
* Nomi dei parametri della query string inviati a `jsonUrl` in modalità server-side (`serverSide: true`).
|
|
175
|
+
* Un valore `null` omette il parametro.
|
|
176
176
|
*
|
|
177
177
|
* @typedef {Object} ServerParams
|
|
178
|
-
* @property {string|null} [page] -
|
|
179
|
-
* @property {string|null} [start] -
|
|
180
|
-
*
|
|
181
|
-
* @property {string|null} [perPage] -
|
|
182
|
-
* @property {string|null} [sort] -
|
|
183
|
-
* @property {string|null} [dir] -
|
|
184
|
-
* @property {string|null} [search] -
|
|
178
|
+
* @property {string|null} [page] - Pagina richiesta, da 1 (default: 'page')
|
|
179
|
+
* @property {string|null} [start] - Indice (da 0) del primo record richiesto, cioè `(page - 1) * perPage`,
|
|
180
|
+
* comodo per le query `LIMIT start, perPage` (default: 'start')
|
|
181
|
+
* @property {string|null} [perPage] - Numero di record per pagina (default: 'perPage')
|
|
182
|
+
* @property {string|null} [sort] - Chiave della colonna ordinata; omesso quando non c'è un ordinamento attivo (default: 'sort')
|
|
183
|
+
* @property {string|null} [dir] - Direzione di ordinamento, `asc`/`desc`; omesso quando non c'è un ordinamento attivo (default: 'dir')
|
|
184
|
+
* @property {string|null} [search] - Termine di ricerca; omesso quando vuoto (default: 'search')
|
|
185
185
|
*/
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
|
-
* `<json-table>`
|
|
188
|
+
* Parametri di `<json-table>` (risolti: ogni chiave ha un valore, vedi `defaults`).
|
|
189
189
|
*
|
|
190
|
-
*
|
|
191
|
-
* (
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
190
|
+
* Ogni parametro può essere impostato come attributo HTML dell'elemento `<json-table>`
|
|
191
|
+
* (i nomi degli attributi non distinguono maiuscole e minuscole, quindi `jsonurl="…"` e `jsonUrl="…"` sono equivalenti)
|
|
192
|
+
* oppure come proprietà dell'oggetto passato a `init()`. I valori che sono funzioni si possono
|
|
193
|
+
* impostare solo tramite `init()`. I parametri oggetto (`classes`, `labels`, `dataTypes`, `serverParams`) vengono
|
|
194
|
+
* uniti ai default, quindi basta passare solo le chiavi da sovrascrivere.
|
|
195
195
|
*
|
|
196
|
-
*
|
|
196
|
+
* Precedenza: `init()` > attributo HTML > `JsonTable.setDefaults()` > default predefinito.
|
|
197
197
|
*
|
|
198
198
|
* @typedef {Object} JsonTableParams
|
|
199
|
-
* @property {boolean} debug -
|
|
200
|
-
* @property {string|null} jsonUrl - URL
|
|
201
|
-
* @property {
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* @property {string}
|
|
206
|
-
*
|
|
207
|
-
* @property {
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* @property {Object
|
|
199
|
+
* @property {boolean} debug - Scrive in console i parametri risolti, le colonne, i dati e gli elementi generati (default: false)
|
|
200
|
+
* @property {string|null} jsonUrl - URL del JSON da recuperare. Ignorato quando `data` è impostato (default: null)
|
|
201
|
+
* @property {boolean} jqDatatableMode - Modalità di compatibilità con il formato server-side di jQuery DataTables: quando è true
|
|
202
|
+
* i default di `jsonDataField`, `totRecField`, `filteredRecField`, `serverSide` e `serverParams` diventano quelli di
|
|
203
|
+
* `jqDatatableModeDefaults`. Restano sovrascrivibili (precedenza: `init()` > attributo HTML > `setDefaults()` > modalità jQuery
|
|
204
|
+
* DataTables > default predefinito) (default: false)
|
|
205
|
+
* @property {string|null} jsonDataField - Chiave del JSON recuperato che contiene l'array delle righe (es. `{ data: [...] }`);
|
|
206
|
+
* `null` o una stringa vuota significa che la radice del JSON è l'array delle righe stesso (default: 'data')
|
|
207
|
+
* @property {string} totRecField - Chiave del JSON recuperato che contiene il numero totale di record (numerico);
|
|
208
|
+
* se mancante o non numerica il totale è la lunghezza dell'array delle righe (default: 'totRec')
|
|
209
|
+
* @property {string} filteredRecField - Solo modalità server-side: chiave del JSON recuperato che contiene il numero di
|
|
210
|
+
* record che corrispondono alla ricerca corrente (numerico); se mancante viene usato il valore di `totRecField` (default: 'filteredRec')
|
|
211
|
+
* @property {Array<Object>|null} data - Righe inline (array di oggetti semplici); ha la precedenza su `jsonUrl`.
|
|
212
|
+
* Come attributo HTML deve essere una stringa JSON, sempre trattata come l'array delle righe stesso
|
|
213
|
+
* (`jsonDataField` viene ignorato) (default: null)
|
|
214
|
+
* @property {ColDefinition[]} cols - OBBLIGATORIO: definizione delle colonne (default: [])
|
|
215
|
+
* @property {Object<string, DataTypeDefinition>} dataTypes - Data type personalizzati, uniti a quelli predefiniti
|
|
212
216
|
* (`string`, `num`, `id`, `perc`, `percDecimal`, `currency`, `euro`, `date`, `datetime`, `bool`, `email`).
|
|
213
|
-
*
|
|
214
|
-
* @property {string|Function|null} caption -
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* @property {boolean} search -
|
|
218
|
-
* @property {number} searchDebounce -
|
|
219
|
-
* @property {number} perPage -
|
|
220
|
-
*
|
|
221
|
-
* @property {number} paginationDelta -
|
|
222
|
-
* @property {boolean} serverSide -
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
* @property {ServerParams} serverParams -
|
|
227
|
-
* @property {SortDef|null} initialSort -
|
|
228
|
-
* @property {boolean} tfoot -
|
|
229
|
-
* server-side
|
|
230
|
-
* @property {boolean} updateFooterOnPageChange -
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* @property {string|InfoTextFn|null} infoText -
|
|
234
|
-
* `{start}`, `{end}`, `{totRec}`, `{filteredRec}`, `{page}`, `{totPages}`)
|
|
235
|
-
* `(start, end, totRec, filteredRec, page, totPages) => content`. `null`
|
|
217
|
+
* Una chiave che corrisponde a un tipo predefinito ne sovrascrive solo le proprietà indicate (default: {})
|
|
218
|
+
* @property {string|Function|null} caption - Caption della tabella, mostrata sotto la tabella (lato iniziale della barra del footer)
|
|
219
|
+
* e collegata alla tabella tramite `aria-labelledby`: una stringa (testo semplice o HTML) oppure, solo tramite `init()`, una funzione
|
|
220
|
+
* che restituisce una stringa o un Node (default: null)
|
|
221
|
+
* @property {boolean} search - Se renderizzare l'input di ricerca (default: true)
|
|
222
|
+
* @property {number} searchDebounce - Ritardo (ms) tra l'ultima pressione di un tasto e l'esecuzione della ricerca (default: 300)
|
|
223
|
+
* @property {number} perPage - Righe per pagina; `0` disattiva la paginazione (tutte le righe in una sola pagina, nessuna
|
|
224
|
+
* navigazione) (default: 25)
|
|
225
|
+
* @property {number} paginationDelta - Numero di pulsanti di pagina mostrati per lato rispetto alla pagina corrente (default: 2)
|
|
226
|
+
* @property {boolean} serverSide - Modalità server-side: paginazione, ordinamento e ricerca sono delegati al server.
|
|
227
|
+
* Ogni cambiamento attiva una nuova richiesta a `jsonUrl` (vedi `serverParams`) e si presume che il JSON contenga solo le
|
|
228
|
+
* righe della pagina richiesta, più `totRecField` e `filteredRecField`. Richiede `jsonUrl`; `tfoot` non è
|
|
229
|
+
* disponibile in questa modalità (default: false)
|
|
230
|
+
* @property {ServerParams} serverParams - Solo modalità server-side: nomi dei parametri della query string (vedi `ServerParams`)
|
|
231
|
+
* @property {SortDef|null} initialSort - Ordinamento applicato al caricamento, es. `{ key: 'name', dir: 'asc' }` (default: null)
|
|
232
|
+
* @property {boolean} tfoot - Se renderizzare il `<tfoot>` (vedi `ColDefinition.tfootRender`); ignorato in
|
|
233
|
+
* modalità server-side (default: false)
|
|
234
|
+
* @property {boolean} updateFooterOnPageChange - Se true, `tfootRender` riceve solo le righe della pagina corrente
|
|
235
|
+
* (subtotali di pagina) e il footer viene aggiornato a ogni cambio di pagina; se false riceve l'intero
|
|
236
|
+
* insieme filtrato e viene aggiornato solo ai cambi di filtro (default: false)
|
|
237
|
+
* @property {string|InfoTextFn|null} infoText - Contenuto dell'area informativa: una stringa in stile mustache (segnaposto
|
|
238
|
+
* `{start}`, `{end}`, `{totRec}`, `{filteredRec}`, `{page}`, `{totPages}`) oppure una funzione
|
|
239
|
+
* `(start, end, totRec, filteredRec, page, totPages) => content`. `null` usa `labels.info` (default: null)
|
|
236
240
|
* @property {TemplateItem[]|((parts: Object<string, DomBuilderItem>, params: JsonTableParams) => TemplateItem[])} template -
|
|
237
|
-
* Layout
|
|
238
|
-
*
|
|
239
|
-
* `caption`
|
|
240
|
-
*
|
|
241
|
+
* Layout del contenuto del wrapper principale, come array domBuilder in cui gli elementi `{ slot: 'name' }` vengono sostituiti dalle
|
|
242
|
+
* parti predefinite `infoSection` (testo informativo + ricerca), `resultInfo`, `search`, `table`, `caption`, `pagination`.
|
|
243
|
+
* `caption` e `pagination` sono inclusi nella parte `table` (barra del footer) a meno che siano collocati esplicitamente.
|
|
244
|
+
* È accettata anche una funzione che riceve le parti e restituisce l'array (solo tramite `init()`)
|
|
241
245
|
* (default: [{ slot: 'infoSection' }, { slot: 'table' }])
|
|
242
|
-
* @property {string} locale - Locale
|
|
243
|
-
* @property {string} currency - ISO 4217
|
|
244
|
-
* @property {Intl.DateTimeFormatOptions} datesLocaleOpts -
|
|
246
|
+
* @property {string} locale - Locale usato per formattare numeri e date e per confrontare le stringhe durante l'ordinamento (default: 'it-IT')
|
|
247
|
+
* @property {string} currency - Codice ISO 4217 usato dal data type `currency` (default: 'EUR')
|
|
248
|
+
* @property {Intl.DateTimeFormatOptions} datesLocaleOpts - Opzioni per la parte data di `date`/`datetime`
|
|
245
249
|
* (default: { year: 'numeric', month: 'short', day: 'numeric' })
|
|
246
|
-
* @property {Intl.DateTimeFormatOptions} timesLocaleOpts -
|
|
250
|
+
* @property {Intl.DateTimeFormatOptions} timesLocaleOpts - Opzioni per la parte oraria di `datetime`
|
|
247
251
|
* (default: { hour12: false, hour: '2-digit', minute: '2-digit' })
|
|
248
|
-
* @property {Intl.NumberFormatOptions} numbersLocaleOpts -
|
|
249
|
-
* @property {Intl.NumberFormatOptions} currPercLocaleOpts -
|
|
250
|
-
*
|
|
251
|
-
* @property {string|null} renderNullAs -
|
|
252
|
-
* @property {string|null} renderZeroAs -
|
|
253
|
-
* @property {string|null} renderNaNAs -
|
|
254
|
-
* @property {IconDef} boolTrueIcon -
|
|
255
|
-
* @property {IconDef} boolFalseIcon -
|
|
256
|
-
* @property {IconDef} sortAscArrowIcon -
|
|
257
|
-
* @property {IconDef} sortDescArrowIcon -
|
|
258
|
-
* @property {IconDef} sortNoneArrowIcon -
|
|
259
|
-
* @property {IconDef} paginationPrevIcon -
|
|
260
|
-
* @property {IconDef} paginationNextIcon -
|
|
252
|
+
* @property {Intl.NumberFormatOptions} numbersLocaleOpts - Opzioni per il tipo `num` (default: { maximumFractionDigits: 2 })
|
|
253
|
+
* @property {Intl.NumberFormatOptions} currPercLocaleOpts - Opzioni per i tipi `currency`/`euro`/`perc`/`percDecimal`
|
|
254
|
+
* (default: { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
255
|
+
* @property {string|null} renderNullAs - Contenuto mostrato per i valori `null`/`undefined` (default: '—')
|
|
256
|
+
* @property {string|null} renderZeroAs - Se non null, contenuto mostrato per i valori numerici uguali a zero (default: null)
|
|
257
|
+
* @property {string|null} renderNaNAs - Contenuto mostrato dai tipi numerici per i valori non numerici (default: '—')
|
|
258
|
+
* @property {IconDef} boolTrueIcon - Icona dei valori `true` nelle colonne `bool` (default: icona `check-bold` di minimo)
|
|
259
|
+
* @property {IconDef} boolFalseIcon - Icona dei valori `false` nelle colonne `bool` (default: icona `x-bold` di minimo)
|
|
260
|
+
* @property {IconDef} sortAscArrowIcon - Icona del pulsante di ordinamento, ordinamento crescente attivo (default: icona `arrow-up` di minimo)
|
|
261
|
+
* @property {IconDef} sortDescArrowIcon - Icona del pulsante di ordinamento, ordinamento decrescente attivo (default: icona `arrow-down` di minimo)
|
|
262
|
+
* @property {IconDef} sortNoneArrowIcon - Icona del pulsante di ordinamento, nessun ordinamento attivo (default: icona `arrows-down-up` di minimo)
|
|
263
|
+
* @property {IconDef} paginationPrevIcon - Icona del pulsante pagina precedente (default: icona `caret-left` di minimo)
|
|
264
|
+
* @property {IconDef} paginationNextIcon - Icona del pulsante pagina successiva (default: icona `caret-right` di minimo)
|
|
261
265
|
* @property {((tr: HTMLTableRowElement, row: Object, params: JsonTableParams) => void)|null} trCallback - Callback
|
|
262
|
-
*
|
|
263
|
-
* @property {string|null} tableId - `id`
|
|
264
|
-
* @property {JsonTableClasses} classes -
|
|
265
|
-
* @property {JsonTableLabels} labels -
|
|
266
|
+
* invocata dopo il rendering di ogni riga del body (default: null)
|
|
267
|
+
* @property {string|null} tableId - Attributo `id` dell'elemento `<table>` (default: null)
|
|
268
|
+
* @property {JsonTableClasses} classes - Nomi di classe del consumer (vedi `JsonTableClasses`)
|
|
269
|
+
* @property {JsonTableLabels} labels - Testi (vedi `JsonTableLabels`)
|
|
266
270
|
*/
|
|
267
271
|
|
|
268
272
|
/**
|
|
269
|
-
*
|
|
270
|
-
* (
|
|
273
|
+
* Nomi dei parametri oggetto il cui valore viene unito in modo superficiale tra le sorgenti
|
|
274
|
+
* (default predefinito ← `setDefaults()` ← attributo HTML ← `init()`) invece di essere sostituito.
|
|
271
275
|
* @type {ReadonlyArray<keyof JsonTableParams>}
|
|
272
276
|
*/
|
|
273
277
|
export const mergedParams = ['classes', 'labels', 'dataTypes', 'serverParams'];
|
|
274
278
|
|
|
275
279
|
/**
|
|
276
|
-
*
|
|
280
|
+
* Default sostitutivi applicati quando `jqDatatableMode` è true (vedi `resolveParams`). Si inseriscono tra i default predefiniti
|
|
281
|
+
* e quelli di `setDefaults()`. `serverParams` viene unito in modo superficiale come di consueto.
|
|
282
|
+
*
|
|
283
|
+
* In questa modalità `buildServerUrl` invia inoltre `draw=1`, `columns[i][name|searchable|orderable]` e, per
|
|
284
|
+
* `order[0][column]`, l'indice della colonna (non la chiave). Resta un solo criterio di ordinamento (`order[0]`).
|
|
285
|
+
*
|
|
286
|
+
* @type {Partial<JsonTableParams>}
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* {
|
|
290
|
+
* jsonDataField: 'data',
|
|
291
|
+
* totRecField: 'recordsTotal',
|
|
292
|
+
* filteredRecField: 'recordsFiltered',
|
|
293
|
+
* serverSide: true,
|
|
294
|
+
* serverParams: { page: null, start: 'start', perPage: 'length', sort: 'order[0][column]', dir: 'order[0][dir]', search: 'search[value]' }
|
|
295
|
+
* }
|
|
296
|
+
*/
|
|
297
|
+
export const jqDatatableModeDefaults = {
|
|
298
|
+
jsonDataField: 'data',
|
|
299
|
+
totRecField: 'recordsTotal',
|
|
300
|
+
filteredRecField: 'recordsFiltered',
|
|
301
|
+
serverSide: true,
|
|
302
|
+
serverParams: {
|
|
303
|
+
page: null,
|
|
304
|
+
start: 'start',
|
|
305
|
+
perPage: 'length',
|
|
306
|
+
sort: 'order[0][column]',
|
|
307
|
+
dir: 'order[0][dir]',
|
|
308
|
+
search: 'search[value]'
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Default predefiniti.
|
|
277
314
|
*
|
|
278
315
|
* @type {JsonTableParams}
|
|
279
316
|
*
|
|
@@ -281,20 +318,21 @@ export const mergedParams = ['classes', 'labels', 'dataTypes', 'serverParams'];
|
|
|
281
318
|
* {
|
|
282
319
|
* debug: false,
|
|
283
320
|
* jsonUrl: null,
|
|
321
|
+
* jqDatatableMode: false, // true → vedi jqDatatableModeDefaults
|
|
284
322
|
* jsonDataField: 'data',
|
|
285
323
|
* totRecField: 'totRec',
|
|
286
324
|
* filteredRecField: 'filteredRec',
|
|
287
325
|
* data: null,
|
|
288
|
-
* cols: [], //
|
|
326
|
+
* cols: [], // obbligatorio
|
|
289
327
|
* dataTypes: {},
|
|
290
328
|
* caption: null,
|
|
291
329
|
* search: true,
|
|
292
330
|
* searchDebounce: 300,
|
|
293
|
-
* perPage: 25, // 0 =
|
|
331
|
+
* perPage: 25, // 0 = nessuna paginazione
|
|
294
332
|
* paginationDelta: 2,
|
|
295
333
|
* serverSide: false,
|
|
296
334
|
* serverParams: { page: 'page', start: 'start', perPage: 'perPage', sort: 'sort', dir: 'dir', search: 'search' },
|
|
297
|
-
* initialSort: null, //
|
|
335
|
+
* initialSort: null, // es. { key: 'name', dir: 'asc' }
|
|
298
336
|
* tfoot: false,
|
|
299
337
|
* updateFooterOnPageChange: false,
|
|
300
338
|
* infoText: null, // → labels.info
|
|
@@ -317,14 +355,15 @@ export const mergedParams = ['classes', 'labels', 'dataTypes', 'serverParams'];
|
|
|
317
355
|
* paginationNextIcon: '<svg …>', // minimo caret-right
|
|
318
356
|
* trCallback: null,
|
|
319
357
|
* tableId: null,
|
|
320
|
-
* classes: { … }, //
|
|
321
|
-
* labels: { … } //
|
|
358
|
+
* classes: { … }, // vedi JsonTableClasses
|
|
359
|
+
* labels: { … } // vedi JsonTableLabels
|
|
322
360
|
* }
|
|
323
361
|
*/
|
|
324
362
|
export const defaults = {
|
|
325
363
|
debug: false,
|
|
326
364
|
|
|
327
365
|
jsonUrl: null,
|
|
366
|
+
jqDatatableMode: false,
|
|
328
367
|
jsonDataField: 'data',
|
|
329
368
|
totRecField: 'totRec',
|
|
330
369
|
filteredRecField: 'filteredRec',
|