@massimo-cassandro/minimo 1.4.11 → 1.4.12
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
CHANGED
|
@@ -6,11 +6,21 @@ My light framework + utilities
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm i @massimo-cassandro/minimo
|
|
9
|
+
|
|
10
|
+
# optional:
|
|
11
|
+
npm i -D @massimo-cassandro/eslint-config
|
|
12
|
+
npm i -D @massimo-cassandro/stylelint-config
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
> Note: **minimo** is designed to be used with WebPack using the configuration you can find in the [webpack-setup folder](./webpack-setup/) of this repository. If changes are made (for example, to how SVG files are imported), things may not work as expected.
|
|
12
16
|
>
|
|
13
|
-
|
|
17
|
+
|
|
18
|
+
For a complete install of all required webpack modules, use the install script at `./webpack-setup/starter-install.sh` launching:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
zsh ./node_modules/@massimo-cassandro/minimo/webpack-setup/starter-install.sh
|
|
22
|
+
```
|
|
23
|
+
|
|
14
24
|
|
|
15
25
|
---
|
|
16
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@massimo-cassandro/minimo",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.12",
|
|
4
4
|
"description": "Light css framework & utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://github.com/massimo-cassandro/minimo#readme",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@massimo-cassandro/dev-updater": "^3.0.
|
|
48
|
-
"@massimo-cassandro/eslint-config": "^3.0.
|
|
49
|
-
"@massimo-cassandro/stylelint-config": "^2.3.
|
|
47
|
+
"@massimo-cassandro/dev-updater": "^3.0.6",
|
|
48
|
+
"@massimo-cassandro/eslint-config": "^3.0.9",
|
|
49
|
+
"@massimo-cassandro/stylelint-config": "^2.3.9"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
package/src/css/table.css
CHANGED
|
@@ -36,6 +36,9 @@ export function parseDomString(domString) {
|
|
|
36
36
|
// /(?: +(?<content>.*))?$/.source // content
|
|
37
37
|
// );
|
|
38
38
|
|
|
39
|
+
|
|
40
|
+
// FIX non funziona se la stringa contine id e classi in quest'ordine: <TAG>.<CLASSE>#<ID>, se l'id è prima della classe, funziona
|
|
41
|
+
|
|
39
42
|
const regex = new RegExp(
|
|
40
43
|
/^([a-zA-Z][a-zA-Z0-9-]*)?/.source + // tag (accetta anche nomi di web components)
|
|
41
44
|
/(?:#([a-zA-Z0-9_-]+))?/.source + // id
|
|
@@ -579,14 +579,14 @@ class SimpleDatatableAdapter extends HTMLElement {
|
|
|
579
579
|
// Per colonne con type 'number' o 'date' il valore viene lasciato invariato.
|
|
580
580
|
const sortValue = col_item._sortValue
|
|
581
581
|
? (() => {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
582
|
+
const raw = typeof col_item._sortValue === 'function'
|
|
583
|
+
? (col_item._sortValue(row) ?? '')
|
|
584
|
+
: (getNestedValue(row, col_item._sortValue) ?? '');
|
|
585
|
+
const colType = col_item.type ?? 'string';
|
|
586
|
+
return (colType === 'string' && typeof raw === 'number')
|
|
587
|
+
? String(raw)
|
|
588
|
+
: raw;
|
|
589
|
+
})()
|
|
590
590
|
: null;
|
|
591
591
|
|
|
592
592
|
|
|
@@ -51,11 +51,12 @@ export function parseCols(col_obj){
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
// campi booleani
|
|
54
|
-
} else if (col_obj.type === 'boolean') {
|
|
54
|
+
} else if (col_obj.type === 'boolean' || col_obj._renderMode === 'bool_true_only') {
|
|
55
55
|
// TODO caso in cui il valore è null nel caso si voglia differenziarlo da false
|
|
56
56
|
|
|
57
57
|
return {
|
|
58
58
|
...col_obj,
|
|
59
|
+
type: 'boolean',
|
|
59
60
|
cellClass: styles.hasIcon,
|
|
60
61
|
headerClass: 'text-center',
|
|
61
62
|
render: (value, td) => {
|
|
@@ -65,7 +66,7 @@ export function parseCols(col_obj){
|
|
|
65
66
|
return checkIcon;
|
|
66
67
|
} else {
|
|
67
68
|
td.attributes.class = classnames(td.attributes.class, 'text-danger');
|
|
68
|
-
return xIcon;
|
|
69
|
+
return col_obj._renderMode === 'bool_true_only'? '' : xIcon;
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
};
|
|
@@ -121,13 +122,13 @@ export function parseCols(col_obj){
|
|
|
121
122
|
return {
|
|
122
123
|
|
|
123
124
|
cellClass: 'text-end text-numeric',
|
|
124
|
-
headerClass: 'text-end',
|
|
125
|
+
headerClass: 'text-end text-numeric', // NB: usata anche per il footer
|
|
125
126
|
};
|
|
126
127
|
|
|
127
128
|
} else if(col_obj._renderMode === 'euro_no_dec') {
|
|
128
129
|
return {
|
|
129
130
|
render: (value, cell) => {
|
|
130
|
-
console.log(value);
|
|
131
|
+
// console.log(value);
|
|
131
132
|
if(value == null || isNaN(value)) {
|
|
132
133
|
cell.attributes['data-order'] = '';
|
|
133
134
|
return '\u2014';
|
|
@@ -142,7 +143,7 @@ export function parseCols(col_obj){
|
|
|
142
143
|
}
|
|
143
144
|
},
|
|
144
145
|
cellClass: 'text-nowrap text-end text-numeric',
|
|
145
|
-
headerClass: 'text-end',
|
|
146
|
+
headerClass: 'text-nowrap text-end text-numeric', // NB: usata anche per il footer
|
|
146
147
|
type: 'number'
|
|
147
148
|
};
|
|
148
149
|
|