@massimo-cassandro/minimo 1.19.0 → 1.19.1
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/design-tokens/README.md +195 -0
- package/design-tokens/tokens/src/components/unsplash-page/unsplash-page.minimo.tokens.jsonc +69 -31
- package/design-tokens/{utilities/tokens-config-sample.mjs → tokens-config-sample.mjs} +10 -10
- package/dev-tools/starter-kit/starter-install.sh +1 -1
- package/package.json +6 -2
- package/snippets/error-pages/error-pages.js +3 -2
- package/src/components/unsplash-page/unsplash-page.minimo.tokens.mjs +78 -39
- package/src/components/unsplash-page/unsplash-page.module.css +25 -6
- package/src/custom-properties.css +8 -1
- package/src/minimo.css +1 -1
- package/src/web-components/s-datatable-component/s-datatable-component.js +4 -1
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/index.js +0 -92
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/hbars.js +0 -356
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/pie.js +0 -245
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/radial-bars.js +0 -177
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/rating-display.js +0 -835
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-assi.js +0 -212
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-linee.js +0 -101
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/defaults.js +0 -185
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/display-current.js +0 -27
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/grid-areas.js +0 -129
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/parse-opts.js +0 -64
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/paths-setup.js +0 -73
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile.js +0 -126
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/signal-bars.js +0 -290
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/week-utils.js +0 -122
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/hbars-test.js +0 -52
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/mcn-test.js +0 -74
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/pie-test.js +0 -16
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/radial-bars-test.js +0 -48
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-dati-settimanale.js +0 -426
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-test.js +0 -260
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/signal-bars-test.js +0 -64
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/node-test.mjs +0 -86
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/hBars-node-test.mjs +0 -40
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/lines-node-test.mjs +0 -73
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/mcn-node-test.mjs +0 -64
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/pie-node-test.mjs +0 -12
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/radialsBar-node-test.mjs +0 -44
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/settimanale-mensile-node-test.mjs +0 -258
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/signalBars-node-test.mjs +0 -36
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/test-readme.md +0 -24
- package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/textToPath-test.mjs +0 -14
- package/charts/TODO charts/???/InfoBox.js +0 -456
- package/charts/TODO charts/???/README-upg OLD/342/206/222NEW.md" +0 -53
- package/charts/TODO charts/???/README.md +0 -1
- package/charts/TODO charts/???/TODO.md +0 -39
- package/charts/TODO charts/???/base-cfg.js +0 -66
- package/charts/TODO charts/???/rating-displayOLD.js +0 -837
- package/charts/TODO charts/docs/TODO.md +0 -1
- package/charts/TODO charts/docs/costruzione display rating.md +0 -145
- package/charts/TODO charts/test/node-test.mjs +0 -92
- package/charts/TODO charts/test/test-readme.md +0 -23
- package/charts/TODO charts/test/test-src/rating-display-extra-test.js +0 -132
- package/charts/TODO charts/test/test-src/rating-display-test.js +0 -155
- package/charts/TODO charts/test/textToPath-test.mjs +0 -14
- package/charts/TODO.md +0 -7
- package/charts/src/node-helpers/TODO.md +0 -2
- package/dev-tools/starter-kit/TODO.md +0 -135
- package/src/components/TODO form-multiselect/form-multiselect.css +0 -40
- package/src/components/TODO form-multiselect/form-multiselect.js +0 -83
- package/src/components/TODO vanilla-cookie-consent/cookie-consent.css +0 -20
- package/src/components/TODO vanilla-cookie-consent/cookie-consent.js +0 -76
- package/src/components/TODO vanilla-cookie-consent/render-cookie-list.js +0 -32
- package/src/components/TODO vanilla-cookie-consent/src/cookie-list.js +0 -85
- package/src/components/TODO vanilla-cookie-consent/src/it-translation.js +0 -38
- package/src/components/TODO vanilla-cookie-consent/src/run-analytics.js +0 -54
- package/src/components/TODO vanilla-cookie-consent/src/run-recaptcha.js +0 -71
- package/src/components/autocomplete/TODO.md +0 -4
- package/src/web-components/TODO json-table/README.md +0 -67
- package/src/web-components/TODO json-table/TODO.md +0 -12
- package/src/web-components/TODO json-table/_work/OLD/docs/custom-props-list.md +0 -69
- package/src/web-components/TODO json-table/_work/OLD/script/create-css-custom-props-doc.mjs +0 -113
- package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-end.md +0 -4
- package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-start.md +0 -30
- package/src/web-components/TODO json-table/_work/OLD/src/css/icons.module.css +0 -22
- package/src/web-components/TODO json-table/_work/OLD/src/css/info.module.css +0 -42
- package/src/web-components/TODO json-table/_work/OLD/src/css/main-wrapper.module.css +0 -4
- package/src/web-components/TODO json-table/_work/OLD/src/css/table.module.css +0 -154
- package/src/web-components/TODO json-table/_work/OLD/src/css/utility.module.css +0 -9
- package/src/web-components/TODO json-table/_work/OLD/src/icons/false.svg +0 -1
- package/src/web-components/TODO json-table/_work/OLD/src/icons/search-arrows.svg +0 -1
- package/src/web-components/TODO json-table/_work/OLD/src/icons/true.svg +0 -1
- package/src/web-components/TODO json-table/_work/OLD/src/index.js +0 -56
- package/src/web-components/TODO json-table/_work/OLD/src/js/default-columns-data-types.js +0 -172
- package/src/web-components/TODO json-table/_work/OLD/src/js/defaults.js +0 -156
- package/src/web-components/TODO json-table/_work/OLD/src/js/info-section.js +0 -31
- package/src/web-components/TODO json-table/_work/OLD/src/js/listeners.js +0 -17
- package/src/web-components/TODO json-table/_work/OLD/src/js/main-builder.js +0 -26
- package/src/web-components/TODO json-table/_work/OLD/src/js/parse-params.js +0 -121
- package/src/web-components/TODO json-table/_work/OLD/src/js/set-column-classname.js +0 -22
- package/src/web-components/TODO json-table/_work/OLD/src/js/table-builder.js +0 -64
- package/src/web-components/TODO json-table/_work/OLD/src/js/table-foot.js +0 -8
- package/src/web-components/TODO json-table/_work/OLD/src/js/table-head.js +0 -47
- package/src/web-components/TODO json-table/_work/OLD/src/js/table-row.js +0 -83
- package/src/web-components/TODO json-table/_work/OLD/src/js/utilities.js +0 -5
- package/src/web-components/TODO json-table/_work/__json-table-react/index.js +0 -4
- package/src/web-components/TODO json-table/_work/__json-table-react/src/build-page-array.js +0 -73
- package/src/web-components/TODO json-table/_work/__json-table-react/src/columns-data-types.js +0 -73
- package/src/web-components/TODO json-table/_work/__json-table-react/src/defaults.js +0 -50
- package/src/web-components/TODO json-table/_work/__json-table-react/src/download-excel.js +0 -156
- package/src/web-components/TODO json-table/_work/__json-table-react/src/set-className.js +0 -19
- package/src/web-components/TODO json-table/_work/__json-table-react/src/set-download-filename.js +0 -17
- package/src/web-components/TODO json-table/_work/__json-table-react/src/table-to-csv.js +0 -48
- package/src/web-components/TODO json-table/_work/archived/table-to-csv.js +0 -48
- package/src/web-components/TODO json-table/_work/arrow.svg +0 -3
- package/src/web-components/TODO json-table/_work/da decidere/get-cell-data.js +0 -18
- package/src/web-components/TODO json-table/_work/download-button.js +0 -29
- package/src/web-components/TODO json-table/_work/download-excel.js +0 -155
- package/src/web-components/TODO json-table/_work/pagination-array-builder.js +0 -73
- package/src/web-components/TODO json-table/_work/pagination.js +0 -37
- package/src/web-components/TODO json-table/_work/set-download-filename.js +0 -19
- package/src/web-components/TODO json-table/_work/table-info.js +0 -24
- package/src/web-components/TODO json-table/demo/README.md +0 -66
- package/src/web-components/TODO json-table/demo/assets/link-simple.svg +0 -1
- package/src/web-components/TODO json-table/demo/demo-data/json-static-table-demo-data.js +0 -512
- package/src/web-components/TODO json-table/demo/demo.css +0 -32
- package/src/web-components/TODO json-table/demo/demo.js +0 -24
- package/src/web-components/TODO json-table/demo/js/demo-ajax-table.js +0 -165
- package/src/web-components/TODO json-table/demo/js/demo-static-table.js +0 -180
- package/src/web-components/TODO json-table/demo/webpack-modules/css-rules.mjs +0 -122
- package/src/web-components/TODO json-table/demo/webpack-modules/get-jsConfig-aliases.mjs +0 -33
- package/src/web-components/TODO json-table/demo/webpack-modules/svg-rules.mjs +0 -108
- package/src/web-components/TODO json-table/demo/webpack-modules/svgo.config.mjs +0 -26
- package/src/web-components/TODO json-table/demo/webpack.config.mjs +0 -333
- package/src/web-components/TODO json-table/docs/custom-props-list.md +0 -74
- package/src/web-components/TODO json-table/docs-builder/create-css-custom-props-doc.mjs +0 -157
- package/src/web-components/TODO json-table/docs-builder/src/custom-props-end.md +0 -6
- package/src/web-components/TODO json-table/docs-builder/src/custom-props-start.md +0 -29
- package/src/web-components/TODO json-table/src/TODO.md +0 -1
- package/src/web-components/TODO json-table/src/__json-table-react/build-page-array.js +0 -73
- package/src/web-components/TODO json-table/src/__json-table-react/columns-data-types.js +0 -73
- package/src/web-components/TODO json-table/src/__json-table-react/defaults.js +0 -50
- package/src/web-components/TODO json-table/src/__json-table-react/download-excel.js +0 -156
- package/src/web-components/TODO json-table/src/__json-table-react/set-className.js +0 -19
- package/src/web-components/TODO json-table/src/__json-table-react/set-download-filename.js +0 -17
- package/src/web-components/TODO json-table/src/__json-table-react/table-to-csv.js +0 -48
- package/src/web-components/TODO json-table/src/css/custom-media.css +0 -16
- package/src/web-components/TODO json-table/src/css/icons.module.css +0 -22
- package/src/web-components/TODO json-table/src/css/info-section.module.css +0 -78
- package/src/web-components/TODO json-table/src/css/main-builder.module.css +0 -6
- package/src/web-components/TODO json-table/src/css/table.module.css +0 -172
- package/src/web-components/TODO json-table/src/css/utility.module.css +0 -9
- package/src/web-components/TODO json-table/src/icons/arrow-down-bold.svg +0 -1
- package/src/web-components/TODO json-table/src/icons/false.svg +0 -1
- package/src/web-components/TODO json-table/src/icons/true.svg +0 -1
- package/src/web-components/TODO json-table/src/index.js +0 -125
- package/src/web-components/TODO json-table/src/js/default-columns-data-types.js +0 -172
- package/src/web-components/TODO json-table/src/js/defaults.js +0 -510
- package/src/web-components/TODO json-table/src/js/get-ajax-data.js +0 -72
- package/src/web-components/TODO json-table/src/js/info-section.js +0 -39
- package/src/web-components/TODO json-table/src/js/init-ajax-table.js +0 -30
- package/src/web-components/TODO json-table/src/js/init-static-table.js +0 -18
- package/src/web-components/TODO json-table/src/js/main-builder.js +0 -87
- package/src/web-components/TODO json-table/src/js/parse-data-row.js +0 -123
- package/src/web-components/TODO json-table/src/js/parse-params.js +0 -118
- package/src/web-components/TODO json-table/src/js/set-search-listener.js +0 -62
- package/src/web-components/TODO json-table/src/js/set-sort-listeners.js +0 -115
- package/src/web-components/TODO json-table/src/js/static-data-sorting.js +0 -23
- package/src/web-components/TODO json-table/src/js/table-builder.js +0 -45
- package/src/web-components/TODO json-table/src/js/table-row.js +0 -43
- package/src/web-components/TODO json-table/src/js/table-tfoot.js +0 -9
- package/src/web-components/TODO json-table/src/js/table-thead.js +0 -91
- package/src/web-components/TODO json-table/src/js/update-info.js +0 -42
- package/src/web-components/TODO json-table/src/js/utilities.js +0 -5
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import jsonTable from '@src/index.js';
|
|
3
|
-
|
|
4
|
-
const container = document.getElementById('ajax-table-demo');
|
|
5
|
-
|
|
6
|
-
// Register listener BEFORE instantiation so it can catch the event
|
|
7
|
-
// TODO verificare funzionamento
|
|
8
|
-
container.addEventListener('jt:ready', e => {
|
|
9
|
-
console.log('Static table ready');
|
|
10
|
-
console.log(e.detail);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
new jsonTable(
|
|
14
|
-
// params
|
|
15
|
-
{
|
|
16
|
-
debug: true,
|
|
17
|
-
container: container,
|
|
18
|
-
useZeroAltChar: false,
|
|
19
|
-
|
|
20
|
-
// true: => use the standard parameters (similar to datatable ones), object: customize parameters
|
|
21
|
-
// see ajax_config_default in `src/js/defaults.js`
|
|
22
|
-
ajax: {
|
|
23
|
-
|
|
24
|
-
// https://github.com/typicode/json-server
|
|
25
|
-
urlParams: {
|
|
26
|
-
startItem: `_page`,
|
|
27
|
-
perPage : '_per_page',
|
|
28
|
-
// TODO search param
|
|
29
|
-
// search : 'search[value]',
|
|
30
|
-
// TODO columns + order
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
// Config for returned object keys: uses default
|
|
34
|
-
// jsonKeys: {}
|
|
35
|
-
},
|
|
36
|
-
ajaxUrl: 'http://localhost:3004',
|
|
37
|
-
|
|
38
|
-
addRowIndex: true,
|
|
39
|
-
searchInputClassName: 'form-control',
|
|
40
|
-
infoExtraClassName: 'border border-secondary rounded p-2', // some classes from the used framework (bootstrap)
|
|
41
|
-
tableClassName: 'table table-striped table-hover table-bordered',
|
|
42
|
-
defaultSorting: {date: 'asc', perc: 'desc'},
|
|
43
|
-
|
|
44
|
-
// add a red background to each number cell whose content is a number and less than 3000
|
|
45
|
-
trCallback: (tr/* , row_data, params */) => {
|
|
46
|
-
|
|
47
|
-
tr.querySelectorAll('td').forEach(cell => {
|
|
48
|
-
|
|
49
|
-
const raw_value = +cell.dataset.raw;
|
|
50
|
-
if(!isNaN(raw_value) && raw_value < 3000 && cell.dataset.type === 'num') {
|
|
51
|
-
cell.classList.add('text-bg-danger');
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
caption: 'Ajax table demo',
|
|
57
|
-
|
|
58
|
-
// using some bootstrap classes
|
|
59
|
-
// tableClassName: 'table table-striped table-hover table-bordered', // overrides the default class
|
|
60
|
-
inlineEndAlignClassName : 'text-end',
|
|
61
|
-
nowrapClassName : 'text-nowrap',
|
|
62
|
-
|
|
63
|
-
columns: [
|
|
64
|
-
{
|
|
65
|
-
title : 'ID',
|
|
66
|
-
key : 'id',
|
|
67
|
-
// dataType : 'string', // dataType can be omitted if it's `string`
|
|
68
|
-
className : 'small text-center',
|
|
69
|
-
rowHeading : true,
|
|
70
|
-
tfoot : false // avoid rendering these values inside the tfoot element
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
title : 'Boolean',
|
|
74
|
-
key : 'bool',
|
|
75
|
-
dataType : 'bool',
|
|
76
|
-
// parse : row => !!row.isActive // if the original data contains other values besides true or false and you need to force them all to boolean
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
title : 'Boolean (customized)',
|
|
80
|
-
key : 'boolCustomized',
|
|
81
|
-
dataType : 'boolWithNull' // custom dataType, see below
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
title : 'Text column',
|
|
85
|
-
key : 'text',
|
|
86
|
-
dataType : 'string'
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
title : 'Number #1',
|
|
90
|
-
key : 'number1',
|
|
91
|
-
dataType : 'num',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
title : 'Number #2',
|
|
95
|
-
key : 'number2',
|
|
96
|
-
dataType : 'num',
|
|
97
|
-
render : cell_data => { // custom render function
|
|
98
|
-
const [int, dec] = cell_data.toFixed(2).split('.');
|
|
99
|
-
return `${int}.<small>${dec}</small>`;
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
key : 'sum',
|
|
104
|
-
title : 'Sum #1 + #2',
|
|
105
|
-
dataType : 'num',
|
|
106
|
-
parse : (row) => row.number1 + row.number2 // parsed value
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
title : 'Date',
|
|
110
|
-
key : 'date',
|
|
111
|
-
dataType : 'date'
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
title : 'Datetime (obj)',
|
|
115
|
-
key : 'sfDatetime',
|
|
116
|
-
dataType : 'datetime',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
title : 'Perc',
|
|
120
|
-
key : 'perc',
|
|
121
|
-
dataType : 'perc'
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
title : 'Perc. (dec.)',
|
|
125
|
-
key : 'percDecimal',
|
|
126
|
-
dataType : 'percDecimal'
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
title : 'Perc. (dec.)',
|
|
130
|
-
key : 'euro',
|
|
131
|
-
dataType : 'euro'
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
],
|
|
135
|
-
|
|
136
|
-
}, // end params
|
|
137
|
-
|
|
138
|
-
// custom dataTypes
|
|
139
|
-
{
|
|
140
|
-
// redefine the default `string` dataType
|
|
141
|
-
string: {
|
|
142
|
-
// inheritsFrom: 'string', // inherits properties from the default dataType, if needed
|
|
143
|
-
className: 'fst-italic' // from bootstrap css
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
// new dataType
|
|
147
|
-
// similar to the default dataType `bool`, but also renders null values with a different style
|
|
148
|
-
// SVG icons are replaced with text symbols
|
|
149
|
-
boolWithNull: {
|
|
150
|
-
inheritsFrom : 'bool', // inherits properties from the default dataType, if needed
|
|
151
|
-
className : 'text-center', // from bootstrap css
|
|
152
|
-
|
|
153
|
-
render : function (val /* , params */) { // you can access the global params object if you need
|
|
154
|
-
if(val == null) {
|
|
155
|
-
return '<span class="text-bg-warning py-1 px-3 small rounded">null</span>';
|
|
156
|
-
|
|
157
|
-
} else {
|
|
158
|
-
return val
|
|
159
|
-
? '<span class="text-success lead">✓</span>'
|
|
160
|
-
: '<span class="text-danger lead">✕</span>';
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
} // end custom dataTypes
|
|
165
|
-
);
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import jsonTable from '@src/index.js';
|
|
3
|
-
import static_demo_data from '../demo-data/json-static-table-demo-data.js';
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
data:
|
|
7
|
-
[
|
|
8
|
-
{
|
|
9
|
-
'id': 350,
|
|
10
|
-
'isActive': true,
|
|
11
|
-
'number1': 1081.55,
|
|
12
|
-
'number2': 4411.51,
|
|
13
|
-
'date': '2017-06-20',
|
|
14
|
-
'datetime': '2015-02-21T01:23:49',
|
|
15
|
-
'text': 'sit officia in',
|
|
16
|
-
'perc': 42.33,
|
|
17
|
-
'percDecimal': 0.19,
|
|
18
|
-
'euro': 879.21
|
|
19
|
-
},
|
|
20
|
-
]
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
// Register listener BEFORE instantiation so it can catch the event
|
|
24
|
-
const container = document.getElementById('static-table-demo');
|
|
25
|
-
container.addEventListener('jt:ready', e => {
|
|
26
|
-
console.log('Static table ready');
|
|
27
|
-
console.log(e.detail);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
new jsonTable(
|
|
31
|
-
// params
|
|
32
|
-
{
|
|
33
|
-
debug: true,
|
|
34
|
-
container: container,
|
|
35
|
-
useZeroAltChar: false,
|
|
36
|
-
ajax: false,
|
|
37
|
-
data: static_demo_data,
|
|
38
|
-
addRowIndex: true,
|
|
39
|
-
searchInputClassName: 'form-control',
|
|
40
|
-
infoExtraClassName: 'border border-secondary rounded p-2', // some classes from the used framework (bootstrap)
|
|
41
|
-
tableClassName: 'table table-striped table-hover table-bordered',
|
|
42
|
-
defaultSorting: {date: 'asc', perc: 'desc'},
|
|
43
|
-
|
|
44
|
-
// add a red background to each number cell whose content is a number and less than 3000
|
|
45
|
-
trCallback: (tr/* , row_data, params */) => {
|
|
46
|
-
|
|
47
|
-
tr.querySelectorAll('td').forEach(cell => {
|
|
48
|
-
|
|
49
|
-
const raw_value = +cell.dataset.raw;
|
|
50
|
-
if(!isNaN(raw_value) && raw_value < 3000 && cell.dataset.type === 'num') {
|
|
51
|
-
cell.classList.add('text-bg-danger');
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
caption: 'Static table demo',
|
|
57
|
-
|
|
58
|
-
// using some bootstrap classes
|
|
59
|
-
// tableClassName: 'table table-striped table-hover table-bordered', // overrides the default class
|
|
60
|
-
inlineEndAlignClassName : 'text-end',
|
|
61
|
-
nowrapClassName : 'text-nowrap',
|
|
62
|
-
|
|
63
|
-
columns: [
|
|
64
|
-
{
|
|
65
|
-
title : 'ID',
|
|
66
|
-
key : 'id',
|
|
67
|
-
// dataType : 'string', // dataType can be omitted if it's `string`
|
|
68
|
-
className : 'small text-center',
|
|
69
|
-
rowHeading : true,
|
|
70
|
-
tfoot : false // avoid rendering these values inside the tfoot element
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
title : 'Boolean',
|
|
74
|
-
key : 'bool',
|
|
75
|
-
dataType : 'bool',
|
|
76
|
-
// parse : row => !!row.isActive // if the original data contains other values besides true or false and you need to force them all to boolean
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
title : 'Boolean (customized)',
|
|
80
|
-
key : 'boolCustomized',
|
|
81
|
-
dataType : 'boolWithNull' // custom dataType, see below
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
title : 'Text column',
|
|
85
|
-
key : 'text',
|
|
86
|
-
dataType : 'string'
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
title : 'Number #1',
|
|
90
|
-
key : 'number1',
|
|
91
|
-
dataType : 'num',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
title : 'Number #2',
|
|
95
|
-
key : 'number2',
|
|
96
|
-
dataType : 'num',
|
|
97
|
-
render : cell_data => { // custom render function
|
|
98
|
-
const [int, dec] = cell_data.toFixed(2).split('.');
|
|
99
|
-
return `${int}.<small>${dec}</small>`;
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
key : 'sum',
|
|
104
|
-
title : 'Sum #1 + #2',
|
|
105
|
-
dataType : 'num',
|
|
106
|
-
parse : (row) => row.number1 + row.number2 // parsed value
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
title : 'Date',
|
|
110
|
-
key : 'date',
|
|
111
|
-
dataType : 'date'
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
title : 'Datetime (obj)',
|
|
115
|
-
key : 'sfDatetime',
|
|
116
|
-
dataType : 'datetime',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
title : 'Perc',
|
|
120
|
-
key : 'perc',
|
|
121
|
-
dataType : 'perc'
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
title : 'Perc. (dec.)',
|
|
125
|
-
key : 'percDecimal',
|
|
126
|
-
dataType : 'percDecimal'
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
title : 'Perc. (dec.)',
|
|
130
|
-
key : 'euro',
|
|
131
|
-
dataType : 'euro'
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
],
|
|
135
|
-
footerData: [
|
|
136
|
-
{
|
|
137
|
-
'id': 'this will not be rendered, sice the the `tfoot` option in `columns` is set to false',
|
|
138
|
-
'isActive': null,
|
|
139
|
-
'number1': static_demo_data.reduce((prev, curr) => prev + curr.number1, 0),
|
|
140
|
-
'number2': static_demo_data.reduce((prev, curr) => prev + curr.number2, 0),
|
|
141
|
-
'sum:': static_demo_data.reduce((prev, curr) => prev + curr.number1 + curr.number2, 0),
|
|
142
|
-
'date': null,
|
|
143
|
-
'datetime': null,
|
|
144
|
-
'text': null,
|
|
145
|
-
'perc': null,
|
|
146
|
-
'percDecimal': null,
|
|
147
|
-
'euro': static_demo_data.reduce((prev, curr) => prev + curr.euro, 0),
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
]
|
|
151
|
-
}, // end params
|
|
152
|
-
|
|
153
|
-
// custom dataTypes
|
|
154
|
-
{
|
|
155
|
-
// redefine the default `string` dataType
|
|
156
|
-
string: {
|
|
157
|
-
// inheritsFrom: 'string', // inherits properties from the default dataType, if needed
|
|
158
|
-
className: 'fst-italic' // from bootstrap css
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
// new dataType
|
|
162
|
-
// similar to the default dataType `bool`, but also renders null values with a different style
|
|
163
|
-
// SVG icons are replaced with text symbols
|
|
164
|
-
boolWithNull: {
|
|
165
|
-
inheritsFrom : 'bool', // inherits properties from the default dataType, if needed
|
|
166
|
-
className : 'text-center', // from bootstrap css
|
|
167
|
-
|
|
168
|
-
render : function (val /* , params */) { // you can access the global params object if you need
|
|
169
|
-
if(val == null) {
|
|
170
|
-
return '<span class="text-bg-warning py-1 px-3 small rounded">null</span>';
|
|
171
|
-
|
|
172
|
-
} else {
|
|
173
|
-
return val
|
|
174
|
-
? '<span class="text-success lead">✓</span>'
|
|
175
|
-
: '<span class="text-danger lead">✕</span>';
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
} // end custom dataTypes
|
|
180
|
-
);
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
2
|
-
|
|
3
|
-
export function cssRules({
|
|
4
|
-
isDevelopment = false,
|
|
5
|
-
useSass = false,
|
|
6
|
-
inlineCssInDevMode = true
|
|
7
|
-
}) {
|
|
8
|
-
const configOptions = { isDevelopment, useSass, inlineCssInDevMode };
|
|
9
|
-
|
|
10
|
-
return [
|
|
11
|
-
// CSS modules
|
|
12
|
-
{
|
|
13
|
-
test: /\.module\.(sass|scss|css)$/i,
|
|
14
|
-
oneOf: [
|
|
15
|
-
// inserimento critical css con tag style al momento della build
|
|
16
|
-
{
|
|
17
|
-
test: /\.critical\.module\./i,
|
|
18
|
-
use: css_loaders({ ...configOptions, critical: true, css_modules: true }),
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
// inserimento css con tag style nel runtime
|
|
22
|
-
{
|
|
23
|
-
resourceQuery: /inline/,
|
|
24
|
-
use: css_loaders({ ...configOptions, inline: true, css_modules: true }),
|
|
25
|
-
},
|
|
26
|
-
// comportamento standard
|
|
27
|
-
{
|
|
28
|
-
use: css_loaders({ ...configOptions, css_modules: true }),
|
|
29
|
-
},
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
// CSS standard
|
|
33
|
-
{
|
|
34
|
-
test: /\.(sass|scss|css)$/i,
|
|
35
|
-
exclude: /\.module\.(sass|scss|css)$/i,
|
|
36
|
-
sideEffects: true,
|
|
37
|
-
oneOf: [
|
|
38
|
-
{
|
|
39
|
-
test: /\.critical\.(sass|scss|css)$/i,
|
|
40
|
-
use: css_loaders({ ...configOptions, critical: true }),
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
resourceQuery: /inline/,
|
|
44
|
-
use: css_loaders({ ...configOptions, inline: true }),
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
use: css_loaders({ ...configOptions }),
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function css_loaders({
|
|
56
|
-
isDevelopment = false,
|
|
57
|
-
useSass = false,
|
|
58
|
-
inlineCssInDevMode = true,
|
|
59
|
-
css_modules = false,
|
|
60
|
-
critical = false, // Iniezione statica nell'HTML
|
|
61
|
-
inline = false // Iniezione dinamica via JS
|
|
62
|
-
}) {
|
|
63
|
-
|
|
64
|
-
let mainLoader;
|
|
65
|
-
|
|
66
|
-
if (inline) {
|
|
67
|
-
// usa style-loader per la query string ?inline
|
|
68
|
-
mainLoader = {
|
|
69
|
-
loader: 'style-loader',
|
|
70
|
-
options: { injectType: 'singletonStyleTag' }
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
} else if (critical) {
|
|
74
|
-
// usa MiniCssExtractPlugin per permettere al plugin HTML di leggerlo
|
|
75
|
-
mainLoader = MiniCssExtractPlugin.loader;
|
|
76
|
-
|
|
77
|
-
} else {
|
|
78
|
-
// compartamento stabdard
|
|
79
|
-
mainLoader = (isDevelopment && inlineCssInDevMode)
|
|
80
|
-
? { loader: 'style-loader', options: { injectType: 'singletonStyleTag' } }
|
|
81
|
-
: MiniCssExtractPlugin.loader;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return [
|
|
86
|
-
mainLoader,
|
|
87
|
-
|
|
88
|
-
{
|
|
89
|
-
loader: 'css-loader',
|
|
90
|
-
options: {
|
|
91
|
-
modules: css_modules
|
|
92
|
-
? {
|
|
93
|
-
auto: true,
|
|
94
|
-
localIdentName: isDevelopment ? '[local]_[hash:base64:6]' : '[hash:base64]',
|
|
95
|
-
exportLocalsConvention: 'as-is',
|
|
96
|
-
}
|
|
97
|
-
: false,
|
|
98
|
-
sourceMap: isDevelopment,
|
|
99
|
-
importLoaders: useSass ? 2 : 1,
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
loader: 'postcss-loader',
|
|
104
|
-
options: {
|
|
105
|
-
postcssOptions: { sourceMap: isDevelopment }
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
...(useSass
|
|
109
|
-
? [ {
|
|
110
|
-
loader: 'sass-loader',
|
|
111
|
-
options: {
|
|
112
|
-
sourceMap: isDevelopment,
|
|
113
|
-
sassOptions: {
|
|
114
|
-
quietDeps: true,
|
|
115
|
-
silenceDeprecations: [ 'legacy-js-api', 'mixed-decls', 'color-functions', 'global-builtin', 'import' ],
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
} ]
|
|
119
|
-
: []
|
|
120
|
-
)
|
|
121
|
-
];
|
|
122
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Funzione per ottenere gli alias direttamente leggendo il file jsconfig.json
|
|
6
|
-
* @param {string} jsconfigAbsPath - Il percorso assoluto del file jsconfig.json
|
|
7
|
-
* @returns {Record<string, string>}
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export function getJsConfigAliases(jsconfigAbsPath) {
|
|
11
|
-
|
|
12
|
-
const baseDir = path.dirname(jsconfigAbsPath);
|
|
13
|
-
|
|
14
|
-
const fileContent = fs.readFileSync(jsconfigAbsPath, 'utf-8');
|
|
15
|
-
const jsconfig = JSON.parse(fileContent);
|
|
16
|
-
|
|
17
|
-
const aliases = {};
|
|
18
|
-
const paths = jsconfig.compilerOptions?.paths || {};
|
|
19
|
-
|
|
20
|
-
for (const item in paths) {
|
|
21
|
-
// Rimuove la wildcard /* alla fine della chiave (alias)
|
|
22
|
-
const key = item.replace(/(\/\*)$/, '');
|
|
23
|
-
|
|
24
|
-
// Prende il primo valore (path) e rimuove la wildcard /*
|
|
25
|
-
const targetPath = paths[item][0].replace(/(\/\*)$/, '');
|
|
26
|
-
|
|
27
|
-
const absolutePath = path.resolve(baseDir, targetPath);
|
|
28
|
-
|
|
29
|
-
aliases[key] = absolutePath;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return aliases;
|
|
33
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Funzione per definire le regole per SVG
|
|
3
|
-
* @returns {import('webpack').RuleSetRule[]}
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import { fileURLToPath } from 'url';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export function svgRules({
|
|
12
|
-
useSvgo = true,
|
|
13
|
-
useSvgr = false,
|
|
14
|
-
svgoConfig = null,
|
|
15
|
-
favicons_path_regexp = null,
|
|
16
|
-
}) {
|
|
17
|
-
|
|
18
|
-
const this_filename = fileURLToPath(import.meta.url)
|
|
19
|
-
,this_dirname = path.dirname(this_filename);
|
|
20
|
-
|
|
21
|
-
if(svgoConfig == null) {
|
|
22
|
-
useSvgo = false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return [{
|
|
26
|
-
test: /(\.svg)$/i,
|
|
27
|
-
exclude: favicons_path_regexp?? undefined,
|
|
28
|
-
oneOf: [
|
|
29
|
-
// 1. svg inline dataUri per css (con `?cssInline`)
|
|
30
|
-
{
|
|
31
|
-
resourceQuery: /cssInline/, // ex inline-dataURI
|
|
32
|
-
type: 'asset/source',
|
|
33
|
-
use: [
|
|
34
|
-
// Loader di ottimizzazione SVGO
|
|
35
|
-
...(useSvgo? [ {
|
|
36
|
-
loader: 'svgo-loader',
|
|
37
|
-
options: svgoConfig,
|
|
38
|
-
} ] : []),
|
|
39
|
-
|
|
40
|
-
// Loader wrapper per Data URI compatto (Mini-SVG-Data-URI-Loader)
|
|
41
|
-
{
|
|
42
|
-
loader: path.resolve(this_dirname, './mini-svg-data-uri-loader.cjs'),
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
// as react component -> https://react-svgr.com/docs/webpack/
|
|
48
|
-
...(useSvgr
|
|
49
|
-
? [{
|
|
50
|
-
resourceQuery: /react/,
|
|
51
|
-
issuer: /\.[jt]sx?$/,
|
|
52
|
-
use: [
|
|
53
|
-
{
|
|
54
|
-
loader: '@svgr/webpack',
|
|
55
|
-
options: {
|
|
56
|
-
...(useSvgo
|
|
57
|
-
? {
|
|
58
|
-
svgo: true, // false: Disable SVGO inside SVGR if svgo-loader already ran
|
|
59
|
-
svgoConfig: svgoConfig,
|
|
60
|
-
}
|
|
61
|
-
: {
|
|
62
|
-
svgo: false
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
)
|
|
66
|
-
// Altre opzioni utili di SVGR
|
|
67
|
-
// titleProp: true,
|
|
68
|
-
// ref: true,
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
// {
|
|
72
|
-
// loader: 'svgo-loader',
|
|
73
|
-
// options: svgoConfig,
|
|
74
|
-
// },
|
|
75
|
-
],
|
|
76
|
-
}]
|
|
77
|
-
: []
|
|
78
|
-
),
|
|
79
|
-
|
|
80
|
-
// svg inline (con `?inline`)
|
|
81
|
-
{
|
|
82
|
-
resourceQuery: /inline/,
|
|
83
|
-
type: 'asset/source',
|
|
84
|
-
// Ottimizzazione SVGO
|
|
85
|
-
use: useSvgo ? [ { loader: 'svgo-loader', options: svgoConfig } ] : [],
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
// svg file (copy image files to build folder)
|
|
89
|
-
{
|
|
90
|
-
type: 'asset/resource',
|
|
91
|
-
exclude: [ /cssInline/, /inline/ ],
|
|
92
|
-
sideEffects: true,
|
|
93
|
-
generator: {
|
|
94
|
-
filename: 'imgs/[name].[contenthash][ext]'
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
// TODO presumibilmente errore sui file già ottimizzati
|
|
98
|
-
// Ottimizzazione SVGO
|
|
99
|
-
// use: useSvgo ? [
|
|
100
|
-
// {
|
|
101
|
-
// loader: 'svgo-loader',
|
|
102
|
-
// options: svgoConfig,
|
|
103
|
-
// },
|
|
104
|
-
// ] : []
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}];
|
|
108
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// svgo.config.js
|
|
2
|
-
import addViewBox from 'svgo-add-viewbox';
|
|
3
|
-
|
|
4
|
-
// https://svgo.dev/docs/plugins/
|
|
5
|
-
export default {
|
|
6
|
-
multipass: true,
|
|
7
|
-
plugins: [
|
|
8
|
-
'removeDoctype'
|
|
9
|
-
, { ...addViewBox, params: { overwrite: false } }
|
|
10
|
-
, { name: 'cleanupIds', params: { remove: true, minify: true } }
|
|
11
|
-
, 'removeComments'
|
|
12
|
-
, 'removeTitle'
|
|
13
|
-
, 'removeDimensions'
|
|
14
|
-
, 'collapseGroups'
|
|
15
|
-
, { name: 'cleanupNumericValues', params: { floatPrecision: 4 } }
|
|
16
|
-
, { name: 'convertColors', params: { names2hex: true, rgb2hex: true } }
|
|
17
|
-
, 'removeStyleElement'
|
|
18
|
-
, 'removeEmptyContainers'
|
|
19
|
-
, { name: 'removeAttrs', params: { attrs: ['(filter|fill|stroke|class|style|data.*)'/* , 'svg:(width|height)' */] } }
|
|
20
|
-
// , { name: 'removeAttrs', params: { attrs: [ '(filter|fill|stroke|fill-rule|clip-rule|stroke-linecap|stroke-linejoin|stroke-width|transform|style|class|data.*)', 'svg:(width|height)' ] } }
|
|
21
|
-
, 'removeUselessDefs',
|
|
22
|
-
//, { name: 'addAttributesToSVGElement0, params: {attribute: "#{$attr}"}}
|
|
23
|
-
// , { name: 'addClassesToSVGElement', params: { className: 'line-icon' } }
|
|
24
|
-
'removeUselessStrokeAndFill',
|
|
25
|
-
]
|
|
26
|
-
};
|