@massimo-cassandro/minimo 1.4.10 → 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
- > For a complete install of all required modules, use the install script at `./webpack-setup/starter-install.sh`.
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.10",
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",
@@ -17,8 +17,8 @@
17
17
  },
18
18
  "scripts": {
19
19
  "UPD-version": "npx update-version # --config=./dev-utilities.config.mjs",
20
- "upd@m": "npx upd@m",
21
20
  "npm-publish": "npm publish",
21
+ "upd@m": "npx upd@m",
22
22
  "build-tokens": "node ./design-tokens-utilities/build-tokens.mjs --config ./tokens-config.mjs",
23
23
  "check unresolved props": "node ./design-tokens-utilities/check-unresolved-custom-props.mjs --config ./tokens-config.mjs"
24
24
  },
@@ -44,8 +44,8 @@
44
44
  }
45
45
  },
46
46
  "devDependencies": {
47
- "@massimo-cassandro/dev-updater": "^3.0.4",
48
- "@massimo-cassandro/eslint-config": "^3.0.7",
49
- "@massimo-cassandro/stylelint-config": "^2.3.7"
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
  }
@@ -74,7 +74,7 @@ export function unsplashPageJS(settings) {
74
74
  // https://docs.imgix.com/apis/rendering/format/q
75
75
 
76
76
  let url = photo.base_url + (/\?/.test(photo.base_url)? '&' : '?') +
77
- 'fit=crop&crop=focalpoint' + // top, bottom, left, right, faces, focalpoint, edges, and entropy
77
+ 'fit=crop&crop=faces,entropy,edges' + // top, bottom, left, right, faces, focalpoint, edges, and entropy
78
78
  '&q=60' +
79
79
  `&w=${brk.w}&h=${brk.h}` +
80
80
  `&fm=${fmt}`;
package/src/css/table.css CHANGED
@@ -58,6 +58,10 @@
58
58
  line-height: var(--table-cell-line-height);
59
59
  vertical-align: top;
60
60
  text-align: start;
61
+
62
+ .valign-middle & {
63
+ vertical-align: middle;
64
+ }
61
65
  }
62
66
 
63
67
  &.table-bordered {
@@ -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
- 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
- })()
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
 
@@ -44,7 +44,7 @@
44
44
  /* cella unica per indicare l'assenza di record */
45
45
  .empty {
46
46
  /* stylelint-disable-next-line declaration-no-important */
47
- padding: var(--size-sm) !important;
47
+ padding-block: var(--size-sm) !important;
48
48
  font-style: italic;
49
49
  color: var(--text-muted);
50
50
  /* stylelint-disable-next-line declaration-no-important */
@@ -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
  };
@@ -117,12 +118,33 @@ export function parseCols(col_obj){
117
118
  }
118
119
  };
119
120
 
120
- // TODO completare, aggiungere formattazione
121
121
  } else if(col_obj._renderMode === 'numeric') {
122
122
  return {
123
123
 
124
124
  cellClass: 'text-end text-numeric',
125
- headerClass: 'text-end',
125
+ headerClass: 'text-end text-numeric', // NB: usata anche per il footer
126
+ };
127
+
128
+ } else if(col_obj._renderMode === 'euro_no_dec') {
129
+ return {
130
+ render: (value, cell) => {
131
+ // console.log(value);
132
+ if(value == null || isNaN(value)) {
133
+ cell.attributes['data-order'] = '';
134
+ return '\u2014';
135
+
136
+ } else {
137
+ cell.attributes['data-order'] = value;
138
+ return Number(value).toLocaleString('it-IT', {
139
+ minimumFractionDigits: 0,
140
+ maximumFractionDigits: 0,
141
+ useGrouping: 'always',
142
+ });
143
+ }
144
+ },
145
+ cellClass: 'text-nowrap text-end text-numeric',
146
+ headerClass: 'text-nowrap text-end text-numeric', // NB: usata anche per il footer
147
+ type: 'number'
126
148
  };
127
149
 
128
150
  }