@massimo-cassandro/minimo 1.18.4 → 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/README.md +5 -1
- package/design-tokens/{utilities/readme.md → README.md} +26 -16
- 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} +18 -10
- package/design-tokens/utilities/build-tokens-src/config.mjs +5 -0
- package/design-tokens/utilities/build-tokens-src/formats/css.mjs +18 -2
- package/design-tokens/utilities/build-tokens-src/merge-css.mjs +60 -0
- package/design-tokens/utilities/build-tokens.mjs +12 -0
- package/dev-tools/README.md +8 -0
- package/dev-tools/starter-kit/starter-install.sh +46 -26
- 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,67 +0,0 @@
|
|
|
1
|
-
# jsonTable
|
|
2
|
-
|
|
3
|
-
HTML table generator from Ajax or static JSON. It can also add advanced functionality to static tables.
|
|
4
|
-
|
|
5
|
-
> NB: **In this first version, the static json option is disabled**.
|
|
6
|
-
|
|
7
|
-
> NB: **This first release only provides the json-table source code, not the compiled version. To use ikson-tabble you'll need to process the code with your own bundler, which must be able to process SVG files and CSS modules (if you want to use the default css files).**.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
It allows you to create a table from a JSON file or stream, adding some extra features: search, sorting, pagination, etc.
|
|
11
|
-
|
|
12
|
-
It's inspired by [jQuery Datatable](https://datatables.net/), but has far fewer features. However, it's much easier to use, highly customizable, and doesn't require jQuery.
|
|
13
|
-
|
|
14
|
-
In most cases, you simply need to modify the configuration parameters and CSS properties.
|
|
15
|
-
|
|
16
|
-
For more advanced customizations, you'll need to use the code in the `src` directory and customize the various CSS files.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
[Changelog](changelog.txt).
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm i -D @massimo-cassandro/json-table
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Use
|
|
29
|
-
|
|
30
|
-
Create a *JsonTable*:
|
|
31
|
-
|
|
32
|
-
```javascript
|
|
33
|
-
const jt = new JsonTable(table_params, optional_custom_data_types_obj);
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
where: <!-- TODO --> TODO
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
## Use with `data-*` attributes and automatic rendering
|
|
40
|
-
|
|
41
|
-
<!-- TODO --> TODO
|
|
42
|
-
|
|
43
|
-
## Customizing CSS
|
|
44
|
-
You can customize the default CSS setting using custom properties; for more details, see [Custom CSS Properties List](docs/custom-props-list.md).
|
|
45
|
-
|
|
46
|
-
## Generate elements params object
|
|
47
|
-
<!-- TODO --> TODO
|
|
48
|
-
|
|
49
|
-
## Custom events
|
|
50
|
-
|
|
51
|
-
The library dispatches a custom event `jt:ready` on the table container when the instance is ready. The event `detail` property contains an object like `{ jsonTable: instance }`.
|
|
52
|
-
|
|
53
|
-
To make the event easier to catch, the library dispatches it asynchronously using `Promise.resolve().then(...)`. This schedules the dispatch in the microtask queue (that is, the callback runs after the current call stack finishes, but before the next macrotask). As a result, listeners registered immediately after calling `new JsonTable(...)` will still be able to intercept the event.
|
|
54
|
-
|
|
55
|
-
Example — register the listener before instantiation for maximum safety:
|
|
56
|
-
|
|
57
|
-
```javascript
|
|
58
|
-
const container = document.getElementById('mytable');
|
|
59
|
-
container.addEventListener('jt:ready', e => { console.log(e.detail.jsonTable); });
|
|
60
|
-
new JsonTable({ container, ... });
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## Limitations
|
|
65
|
-
|
|
66
|
-
* Only one `tr` element is allowed for `thead`
|
|
67
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# json-table
|
|
2
|
-
|
|
3
|
-
## core
|
|
4
|
-
* meccanismo acquisizione json per grandi quantità di records basato sulla paginazione
|
|
5
|
-
* opzione `condition` per renderizzare o meno una colonna (vedi opzione `hidden` di simple-datatable)
|
|
6
|
-
* in generale ogni elemento (cella) deve acceyyare contenuti in forma di stringa plain text, stringa html, elemento DOM, array domBuilder...
|
|
7
|
-
* possibilità di utilizzare un campo solo a fini di ricerca senza mostrarlo nella tabella
|
|
8
|
-
* possibilità di definire valori per ordinamento e ricerca diversi da quelli effettivamente presenti nel josn. Il default dovrebbe corrispondere a quanto mostrato
|
|
9
|
-
|
|
10
|
-
## altro
|
|
11
|
-
* nei campi di tipo numerico prevedere classi di default text-end e text-numeric o classe ad hoc socrascrivibile
|
|
12
|
-
* footerRender: possibilità di funzioni predefinite per calcoli base (somma, media ecc) di una determinata colonna
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# CSS Custom Properties List
|
|
2
|
-
|
|
3
|
-
List of all CSS custom properties used in css files.
|
|
4
|
-
|
|
5
|
-
If you don't want to use a new CSS, you can use the default one, just by customizing the values of the custom properties.
|
|
6
|
-
|
|
7
|
-
You can set the custom values in the `:root` element, or directly in the json-table wrapper by assigning it a specific class:
|
|
8
|
-
|
|
9
|
-
In the json-table config:
|
|
10
|
-
|
|
11
|
-
```javascript
|
|
12
|
-
new jsonTable({
|
|
13
|
-
container: '...',
|
|
14
|
-
mainWrapperExtraClassName: 'my-custom-classname',
|
|
15
|
-
|
|
16
|
-
/* other config parameters */
|
|
17
|
-
});
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
In your css:
|
|
21
|
-
|
|
22
|
-
```css
|
|
23
|
-
.my-custom-classname {
|
|
24
|
-
--jt-search-input-bg-color: #efefef;
|
|
25
|
-
--jt-search-input-border-color: #666;
|
|
26
|
-
|
|
27
|
-
/* other custom properties */
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## Properties
|
|
34
|
-
| Property | Default value | Description |
|
|
35
|
-
| :--- | :--- | :--- |
|
|
36
|
-
| `--jt-bool-false-color` | `#c00` | color for _false_ boolean values icon |
|
|
37
|
-
| `--jt-bool-icon-size` | `1.3em` | boolean icons size |
|
|
38
|
-
| `--jt-bool-true-color` | `#0a7202` | color for _true_ boolean values icon |
|
|
39
|
-
| `--jt-placeholder-color` | `#999` | color for placeholder text |
|
|
40
|
-
| `--jt-search-input-bg-color` | `transparent` | background color for search input element |
|
|
41
|
-
| `--jt-search-input-border-color` | `#999` | border color for search input element |
|
|
42
|
-
| `--jt-search-input-font-size` | `clamp(.85rem, 6vw, 1rem)` | font size for search input element |
|
|
43
|
-
| `--jt-search-input-padding-x` | `.75rem` | left and right padding for search input element |
|
|
44
|
-
| `--jt-search-input-padding-y` | `.375rem` | top and bottom padding for search input element |
|
|
45
|
-
| `--jt-search-input-text-color` | `currentColor` | text color for search input element |
|
|
46
|
-
| `--jt-table-border-color` | `#999` | table `border-color` |
|
|
47
|
-
| `--jt-table-border-style` | `solid` | table `border-style` |
|
|
48
|
-
| `--jt-table-border-width` | `1px` | table `border-width` |
|
|
49
|
-
| `--jt-table-caption-side` | `bottom` | table `caption-side` (`top` or `bottom`) |
|
|
50
|
-
| `--jt-table-cell-bg-color` | `#fff` | td `background-color` |
|
|
51
|
-
| `--jt-table-cell-border-color` | `#999` | td `border-color` |
|
|
52
|
-
| `--jt-table-cell-border-style` | `solid` | td `border-style` |
|
|
53
|
-
| `--jt-table-cell-border-width` | `1px` | td `border-width` |
|
|
54
|
-
| `--jt-table-cell-padding-x` | `.5rem` | left and right padding for td |
|
|
55
|
-
| `--jt-table-cell-padding-y` | `.5rem` | top and bottom padding for td |
|
|
56
|
-
| `--jt-table-cell-vertical-border-width` | `1px` | td `border-width` for vertical borders |
|
|
57
|
-
| `--jt-table-margin-block` | `1rem` | top and bottom margins for table |
|
|
58
|
-
| `--jt-table-tfoot-cell-bg-color` | `#f4f4f4` | background color for tfoot cells |
|
|
59
|
-
| `--jt-table-tfoot-cell-border-color` | `#666` | border color for tfoot cells (applied to the bottom border of the first tr of tfoot) |
|
|
60
|
-
| `--jt-table-tfoot-cell-border-width` | `3px` | border width for tfoot cells (applied to the bottom border of the first tr of tfoot) |
|
|
61
|
-
| `--jt-table-thead-cell-bg-color` | `#e4e4e4` | background color for thead cells |
|
|
62
|
-
| `--jt-table-thead-cell-border-color` | `#666` | border color for thead cells (applied to the bottom border of the last tr of thead) |
|
|
63
|
-
| `--jt-table-thead-cell-border-width` | `3px` | border width for thead cells (applied to the bottom border of the last tr of thead) |
|
|
64
|
-
| `--jt-wrapper-margin-block` | `1rem` | top and bottom margins for main wrapper element |
|
|
65
|
-
|
|
66
|
-
## Notes
|
|
67
|
-
* `--jt-search-input-*`: you'll need that custom properties only if the `search`
|
|
68
|
-
parameter is set to `true` (default) and the `searchInputClassName`
|
|
69
|
-
(custom classname for search input, default `true`) parameter is not set.
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/* eslint-disable no-console */
|
|
3
|
-
|
|
4
|
-
import * as fs from 'fs';
|
|
5
|
-
import * as path from 'path';
|
|
6
|
-
import { styleText } from 'node:util';
|
|
7
|
-
|
|
8
|
-
// parse all css files and extract all custom properties
|
|
9
|
-
// then create a markdown document adding a description for each property
|
|
10
|
-
|
|
11
|
-
// tke key is a camelCase version of the css property name (without leading --jt-)
|
|
12
|
-
const descriptions = {
|
|
13
|
-
|
|
14
|
-
boolFalseColor : 'color for _false_ boolean values icon',
|
|
15
|
-
boolIconSize : 'boolean icons size',
|
|
16
|
-
boolTrueColor : 'color for _true_ boolean values icon',
|
|
17
|
-
placeholderColor : 'color for placeholder text',
|
|
18
|
-
searchInputBgColor : 'background color for search input element',
|
|
19
|
-
searchInputBorderColor : 'border color for search input element',
|
|
20
|
-
searchInputFontSize : 'font size for search input element',
|
|
21
|
-
searchInputPaddingX : 'left and right padding for search input element',
|
|
22
|
-
searchInputPaddingY : 'top and bottom padding for search input element',
|
|
23
|
-
searchInputTextColor : 'text color for search input element',
|
|
24
|
-
tableBorderColor : 'table `border-color`',
|
|
25
|
-
tableBorderStyle : 'table `border-style`',
|
|
26
|
-
tableBorderWidth : 'table `border-width`',
|
|
27
|
-
tableCaptionSide : 'table `caption-side` (`top` or `bottom`)',
|
|
28
|
-
tableCellBgColor : 'td `background-color`',
|
|
29
|
-
tableCellBorderColor : 'td `border-color`',
|
|
30
|
-
tableCellBorderStyle : 'td `border-style`',
|
|
31
|
-
tableCellBorderWidth : 'td `border-width`',
|
|
32
|
-
tableCellPaddingX : 'left and right padding for td',
|
|
33
|
-
tableCellPaddingY : 'top and bottom padding for td',
|
|
34
|
-
tableCellVerticalBorderWidth : 'td `border-width` for vertical borders',
|
|
35
|
-
tableMarginBlock : 'top and bottom margins for table',
|
|
36
|
-
tableTfootCellBgColor : 'background color for tfoot cells',
|
|
37
|
-
tableTfootCellBorderColor : 'border color for tfoot cells (applied to the bottom border of the first tr of tfoot)',
|
|
38
|
-
tableTfootCellBorderWidth : 'border width for tfoot cells (applied to the bottom border of the first tr of tfoot)',
|
|
39
|
-
tableTheadCellBgColor : 'background color for thead cells',
|
|
40
|
-
tableTheadCellBorderColor : 'border color for thead cells (applied to the bottom border of the last tr of thead)',
|
|
41
|
-
tableTheadCellBorderWidth : 'border width for thead cells (applied to the bottom border of the last tr of thead)',
|
|
42
|
-
wrapperMarginBlock : 'top and bottom margins for main wrapper element',
|
|
43
|
-
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const props = {},
|
|
48
|
-
css_folder = '../src/css',
|
|
49
|
-
target_file = path.resolve(new URL('.', import.meta.url).pathname, '../docs/custom-props-list.md'),
|
|
50
|
-
show_props_list = false // to create the descriptions
|
|
51
|
-
;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
try {
|
|
55
|
-
|
|
56
|
-
fs.readdirSync(css_folder).forEach(file => {
|
|
57
|
-
if(file.endsWith('.css')) {
|
|
58
|
-
const css_content = fs.readFileSync(path.join(css_folder, file), 'utf8'),
|
|
59
|
-
matches = css_content.matchAll(/var\(--jt-(?<name>(.*?))(?:, (?<def>(.*?))\)[ ;])/g);
|
|
60
|
-
|
|
61
|
-
for (const match of matches) {
|
|
62
|
-
if(match?.groups) {
|
|
63
|
-
|
|
64
|
-
if(props[match.groups.name]) {
|
|
65
|
-
if(props[match.groups.name].default !== match.groups.def) {
|
|
66
|
-
throw new Error( `Default values of the same property cannot be different (${match.groups.name})` );
|
|
67
|
-
}
|
|
68
|
-
props[match.groups.name].files.push(file);
|
|
69
|
-
|
|
70
|
-
} else {
|
|
71
|
-
props[match.groups.name] = {
|
|
72
|
-
files: [file],
|
|
73
|
-
default: match.groups.def
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
let descriptionsKeys = '';
|
|
83
|
-
|
|
84
|
-
const table = '## Properties\n' +
|
|
85
|
-
'| Property | Default value | Description |\n' +
|
|
86
|
-
'| :--- | :--- | :--- |\n' +
|
|
87
|
-
Object.keys(props).toSorted((a, b) => a.localeCompare(b)).map(key => {
|
|
88
|
-
|
|
89
|
-
const descrKey = key.replace(/-([a-z])/g, function (part) { return part[1].toUpperCase(); });
|
|
90
|
-
|
|
91
|
-
if(show_props_list) {
|
|
92
|
-
descriptionsKeys +=`${descrKey}: '${descriptions[descrKey]??''}',\n`;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return `| \`--jt-${key}\` | \`${props[key].default}\` | ${descriptions[descrKey] ?? ''} |`;
|
|
96
|
-
}).join('\n')
|
|
97
|
-
;
|
|
98
|
-
|
|
99
|
-
const start_text = fs.readFileSync( './src/custom-props-start.md', 'utf8' ),
|
|
100
|
-
end_text = fs.readFileSync( './src/custom-props-end.md', 'utf8' );
|
|
101
|
-
|
|
102
|
-
fs.writeFileSync( target_file, start_text + '\n\n' + table + '\n\n' + end_text );
|
|
103
|
-
|
|
104
|
-
if(show_props_list) {
|
|
105
|
-
console.log('\n' +styleText(['yellow'], descriptionsKeys) + '\n'); // lista chiavi
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
console.log( '\n' + styleText(['bgGreen'], ' Done ' ) + '\n' );
|
|
109
|
-
|
|
110
|
-
} catch(e) {
|
|
111
|
-
let message = styleText('bgRed', ` ${e} `);
|
|
112
|
-
console.error( '\n' + message + '\n');
|
|
113
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# CSS Custom Properties List
|
|
2
|
-
|
|
3
|
-
List of all CSS custom properties used in css files.
|
|
4
|
-
|
|
5
|
-
If you don't want to use a new CSS, you can use the default one, just by customizing the values of the custom properties.
|
|
6
|
-
|
|
7
|
-
You can set the custom values in the `:root` element, or directly in the json-table wrapper by assigning it a specific class:
|
|
8
|
-
|
|
9
|
-
In the json-table config:
|
|
10
|
-
|
|
11
|
-
```javascript
|
|
12
|
-
new jsonTable({
|
|
13
|
-
container: '...',
|
|
14
|
-
mainWrapperExtraClassName: 'my-custom-classname',
|
|
15
|
-
|
|
16
|
-
/* other config parameters */
|
|
17
|
-
});
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
In your css:
|
|
21
|
-
|
|
22
|
-
```css
|
|
23
|
-
.my-custom-classname {
|
|
24
|
-
--jt-search-input-bg-color: #efefef;
|
|
25
|
-
--jt-search-input-border-color: #666;
|
|
26
|
-
|
|
27
|
-
/* other custom properties */
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
```
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
.icon { /* applied to the td */
|
|
2
|
-
text-align: center;
|
|
3
|
-
|
|
4
|
-
svg {
|
|
5
|
-
position: relative;
|
|
6
|
-
top: -3px;
|
|
7
|
-
width: var(--jt-bool-icon-size, 1.3em);
|
|
8
|
-
aspect-ratio: 1;
|
|
9
|
-
fill: none;
|
|
10
|
-
stroke: currentColor;
|
|
11
|
-
stroke-linecap: round;
|
|
12
|
-
stroke-linejoin: round;
|
|
13
|
-
stroke-width: 8px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&.true {
|
|
17
|
-
color: var(--jt-bool-true-color, #0a7202);
|
|
18
|
-
}
|
|
19
|
-
&.false {
|
|
20
|
-
color: var(--jt-bool-false-color, #c00);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
.info {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
.resultInfo {
|
|
7
|
-
flex: 1;
|
|
8
|
-
}
|
|
9
|
-
.search {
|
|
10
|
-
flex: 0 1 15rem;
|
|
11
|
-
}
|
|
12
|
-
.searchInput {
|
|
13
|
-
display: block;
|
|
14
|
-
width: 100%;
|
|
15
|
-
padding: var(--jt-search-input-padding-y, .375rem) var(--jt-search-input-padding-x, .75rem);
|
|
16
|
-
font-size: var(--jt-search-input-font-size, clamp(.85rem, 6vw, 1rem));
|
|
17
|
-
color: var(--jt-search-input-text-color, currentColor);
|
|
18
|
-
background-color: var(--jt-search-input-bg-color, transparent);
|
|
19
|
-
border: 1px solid var(--jt-search-input-border-color, #999);
|
|
20
|
-
border-radius: .4rem;
|
|
21
|
-
|
|
22
|
-
&:focus {
|
|
23
|
-
outline: 2px solid hsl(192deg 84% 63% / .7);
|
|
24
|
-
}
|
|
25
|
-
&::placeholder {
|
|
26
|
-
color: var(--jt-placeholder-color, #999);
|
|
27
|
-
opacity: 1;
|
|
28
|
-
}
|
|
29
|
-
&[disabled] {
|
|
30
|
-
opacity: .6;
|
|
31
|
-
&::placeholder {
|
|
32
|
-
font-style: italic;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* @media (prefers-color-scheme: dark) {
|
|
37
|
-
border-color: var(--jt -search-input-border-color-dark, #ecede8);
|
|
38
|
-
&:focus {
|
|
39
|
-
outline-color: var(--green-2);
|
|
40
|
-
}
|
|
41
|
-
} */
|
|
42
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/* stylelint-disable selector-max-compound-selectors */
|
|
2
|
-
/* stylelint-disable max-nesting-depth */
|
|
3
|
-
.tableWrapper {
|
|
4
|
-
max-width: 100%;
|
|
5
|
-
overflow-x: auto;
|
|
6
|
-
|
|
7
|
-
/* TODO ombra su scroll vedi pannello staff e https://css-tricks.com/books/greatest-css-tricks/scroll-shadows/ */
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.table {
|
|
12
|
-
width: 100%;
|
|
13
|
-
margin-block: var(--jt-table-margin-block, 1rem);
|
|
14
|
-
caption-side: var(--jt-table-caption-side, bottom);
|
|
15
|
-
border-spacing: 0;
|
|
16
|
-
border-collapse: collapse;
|
|
17
|
-
border-color: var(--jt-table-border-color, #999);
|
|
18
|
-
border-style: var(--jt-table-border-style, solid);
|
|
19
|
-
border-width: var(--jt-table-border-width, 1px);
|
|
20
|
-
|
|
21
|
-
caption {
|
|
22
|
-
padding-block: .2rem;
|
|
23
|
-
margin-block: 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
th, td {
|
|
27
|
-
padding: var(--jt-table-cell-padding-y, .5rem) var(--jt-table-cell-padding-x, .5rem);
|
|
28
|
-
vertical-align: top;
|
|
29
|
-
background-color: var(--jt-table-cell-bg-color, #fff);
|
|
30
|
-
border-color: var(--jt-table-cell-border-color, #999);
|
|
31
|
-
border-style: var(--jt-table-cell-border-style, solid);
|
|
32
|
-
border-bottom-width: var(--jt-table-cell-border-width, 1px);
|
|
33
|
-
|
|
34
|
-
&:not(:last-child) {
|
|
35
|
-
border-right-width: var(--jt-table-cell-vertical-border-width, 1px);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
thead {
|
|
39
|
-
|
|
40
|
-
th, td {
|
|
41
|
-
font-weight: 700;
|
|
42
|
-
vertical-align: bottom;
|
|
43
|
-
background-color: var(--jt-table-thead-cell-bg-color, #e4e4e4);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* currently only one tr is expected for thead, but the pseudo class `:last-child`
|
|
47
|
-
is used anyway, for compatibility with any future developments */
|
|
48
|
-
tr:last-child {
|
|
49
|
-
th, td {
|
|
50
|
-
border-bottom-color: var(--jt-table-thead-cell-border-color, #666);
|
|
51
|
-
border-bottom-width: var(--jt-table-thead-cell-border-width, 4px);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
th {
|
|
55
|
-
/* sort feature is available */
|
|
56
|
-
&.sort {
|
|
57
|
-
> div {
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-flow: row nowrap;
|
|
60
|
-
gap: .5rem;
|
|
61
|
-
align-items: flex-end;
|
|
62
|
-
justify-content: space-between;
|
|
63
|
-
}
|
|
64
|
-
@media (hover: hover) { /* @media (any-hover: hover) { */
|
|
65
|
-
&:has(.sortArrows > span:hover) {
|
|
66
|
-
background-color: var(--jt-table-thead-sort-cell-hover, #ebb8b8);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/* sorting has been activated */
|
|
72
|
-
&.sortingOn {
|
|
73
|
-
border-bottom-color: var(--jt-table-sort-color, #c00);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* sorting ASC activated */
|
|
77
|
-
&.sortingAsc {
|
|
78
|
-
.sortArrowUp {
|
|
79
|
-
color: var(--jt-table-sort-arrow-on, #c00);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/* sorting DESC activated */
|
|
84
|
-
&.sortingDesc {
|
|
85
|
-
color: blue;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/*
|
|
93
|
-
sticky headers don't work if table wrapper is present since it has overflow
|
|
94
|
-
so this feature is added only if table is not wrapped
|
|
95
|
-
*/
|
|
96
|
-
&.stickyHeaders {
|
|
97
|
-
position: relative;
|
|
98
|
-
thead {
|
|
99
|
-
position: sticky;
|
|
100
|
-
top: 0;
|
|
101
|
-
z-index: 1;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
tfoot {
|
|
106
|
-
th, td {
|
|
107
|
-
font-weight: 700;
|
|
108
|
-
background-color: var(--jt-table-tfoot-cell-bg-color, #f4f4f4);
|
|
109
|
-
}
|
|
110
|
-
tr:first-child {
|
|
111
|
-
th, td {
|
|
112
|
-
border-top-color: var(--jt-table-tfoot-cell-border-color, #666);
|
|
113
|
-
border-top-width: var(--jt-table-tfoot-cell-border-width, 3px);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/* sort arrows container */
|
|
120
|
-
.sortArrows {
|
|
121
|
-
display: flex;
|
|
122
|
-
flex: 0;
|
|
123
|
-
flex-flow: column nowrap;
|
|
124
|
-
gap: 4px;
|
|
125
|
-
align-items: center;
|
|
126
|
-
justify-content: center;
|
|
127
|
-
padding-block-end: .2em;
|
|
128
|
-
color: var(--jt-table-sort-arrow-off, #333);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
> span {
|
|
132
|
-
flex: 0;
|
|
133
|
-
@media (hover: hover) { /* @media (any-hover: hover) { */
|
|
134
|
-
&:hover {
|
|
135
|
-
color: var(--jt-table-sort-arrow-hover, #c00);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
svg {
|
|
140
|
-
display: block;
|
|
141
|
-
width: .5em;
|
|
142
|
-
aspect-ratio: 1;
|
|
143
|
-
cursor: pointer;
|
|
144
|
-
fill: currentColor;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
/* inside `.sortArrows` element */
|
|
149
|
-
/* .sortArrowUp {} */
|
|
150
|
-
.sortArrowDn {
|
|
151
|
-
svg {
|
|
152
|
-
rotate: .5turn;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><path d="M48 84c19.882 0 36-16.118 36-36S67.882 12 48 12 12 28.118 12 48s16.118 36 36 36zm16-52L33 63m31 0L33 32"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><path d="m39.9 0-39.9 80h80z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><path d="m64.5 39-22.013 21-10.987-10.5"/><path d="m48 84c19.8823 0 36-16.1177 36-36s-16.1177-36-36-36-36 16.1177-36 36 16.1177 36 36 36z"/></svg>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JsonTable
|
|
3
|
-
* build a table from a static or ajax-imported JSON object.
|
|
4
|
-
*
|
|
5
|
-
* @param {object} params - parametri di configurazione.
|
|
6
|
-
* @author Massimo Cassandro
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { parseParams } from './js/parse-params';
|
|
10
|
-
import { mainBuilder } from './js/main-builder';
|
|
11
|
-
import { infoSection } from './js/info-section';
|
|
12
|
-
import { tableBuilder } from './js/table-builder';
|
|
13
|
-
import { tableHead } from './js/table-head';
|
|
14
|
-
import { tableFoot } from './js/table-foot';
|
|
15
|
-
import { tableRow } from './js/table-row';
|
|
16
|
-
import { setColumClassname } from './js/set-column-classname';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class JsonTable {
|
|
20
|
-
|
|
21
|
-
constructor(custom_params, custom_data_types) {
|
|
22
|
-
this.params = parseParams({
|
|
23
|
-
custom_params: custom_params,
|
|
24
|
-
custom_data_types: custom_data_types,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
if(this.params.debug) {
|
|
28
|
-
/* eslint-disable no-console */
|
|
29
|
-
console.groupCollapsed('JsonTable params');
|
|
30
|
-
console.log(this.params);
|
|
31
|
-
console.groupEnd();
|
|
32
|
-
/* eslint-enable no-console */
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if(this.params.err) {
|
|
37
|
-
// eslint-disable-next-line no-console
|
|
38
|
-
console.error(this.params.err);
|
|
39
|
-
|
|
40
|
-
} else {
|
|
41
|
-
this.build();
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
JsonTable.prototype.build = mainBuilder;
|
|
49
|
-
JsonTable.prototype.infoSection = infoSection;
|
|
50
|
-
JsonTable.prototype.tableBuilder = tableBuilder;
|
|
51
|
-
JsonTable.prototype.tableHead = tableHead;
|
|
52
|
-
JsonTable.prototype.tableFoot = tableFoot;
|
|
53
|
-
JsonTable.prototype.tableRow = tableRow;
|
|
54
|
-
JsonTable.prototype.setColumClassname = setColumClassname;
|
|
55
|
-
|
|
56
|
-
export default JsonTable;
|