@massimo-cassandro/minimo 0.11.9 → 0.12.0
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/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
export { classnames } from './src/utilities/classnames.js';
|
|
4
4
|
export { domBuilder } from './src/utilities/dom-builder/dom-builder.js';
|
|
5
5
|
export { enableSubmitBtns } from './src/utilities/enable-submit-btns.js';
|
|
6
|
+
export { titleCase } from './src/utilities/title-case.js';
|
|
7
|
+
export { sentenceCase } from './src/utilities/sentence-case.js';
|
|
6
8
|
|
|
7
9
|
// components
|
|
8
10
|
export { default as modalAlert } from './src/components/modal-alert/modal-alert.js';
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// imposta un testo in cui ogni parola è minuscola tranne la prima lettera
|
|
2
|
+
export function titleCase(str) {
|
|
3
|
+
|
|
4
|
+
if(str) {
|
|
5
|
+
|
|
6
|
+
let parole = str.toLowerCase().split(' ');
|
|
7
|
+
for (let i = 0; i < parole.length; i++) {
|
|
8
|
+
parole[i] = parole[i].charAt(0).toUpperCase() + parole[i].slice(1);
|
|
9
|
+
}
|
|
10
|
+
str = parole.join(' ');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return str;
|
|
14
|
+
} // end title_case
|
|
@@ -70,7 +70,7 @@ import caretRightIcon from '../../icons/caret-right.svg?inline';
|
|
|
70
70
|
* @param {string} renderNullAs Stringa globale da mostrare al posto di valori null/undefined
|
|
71
71
|
* in tutte le colonne. Può essere sovrascritto per singola
|
|
72
72
|
* colonna con `_renderNullAs`.
|
|
73
|
-
* Default: `
|
|
73
|
+
* Default: `\u2014` (em dash)
|
|
74
74
|
*/
|
|
75
75
|
|
|
76
76
|
|
|
@@ -321,7 +321,7 @@ class SimpleDatatableAdapter extends HTMLElement {
|
|
|
321
321
|
const inlineData = this._getParam('data');
|
|
322
322
|
const jsonUrl = this._getParam('json');
|
|
323
323
|
const cols = this._getParam('cols', []);
|
|
324
|
-
const globalNullAs = this._getParam('renderNullAs', '
|
|
324
|
+
const globalNullAs = this._getParam('renderNullAs', '\u2014');
|
|
325
325
|
|
|
326
326
|
if (inlineData == null && !jsonUrl) {
|
|
327
327
|
if (this._initCalledProgrammatically) {
|
|
@@ -409,9 +409,9 @@ class SimpleDatatableAdapter extends HTMLElement {
|
|
|
409
409
|
? typeof col_item._searchValue === 'function'
|
|
410
410
|
? (col_item._searchValue(row) ?? '')
|
|
411
411
|
: col_item._searchValue.split(' ')
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
412
|
+
.map(path => getNestedValue(row, path.trim()) ?? '')
|
|
413
|
+
.filter(Boolean)
|
|
414
|
+
.join(' ')
|
|
415
415
|
: null;
|
|
416
416
|
|
|
417
417
|
// Se sono definiti _sortValue o _searchValue, restituisce un
|