@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.
Files changed (165) hide show
  1. package/design-tokens/README.md +195 -0
  2. package/design-tokens/tokens/src/components/unsplash-page/unsplash-page.minimo.tokens.jsonc +69 -31
  3. package/design-tokens/{utilities/tokens-config-sample.mjs → tokens-config-sample.mjs} +10 -10
  4. package/dev-tools/starter-kit/starter-install.sh +1 -1
  5. package/package.json +6 -2
  6. package/snippets/error-pages/error-pages.js +3 -2
  7. package/src/components/unsplash-page/unsplash-page.minimo.tokens.mjs +78 -39
  8. package/src/components/unsplash-page/unsplash-page.module.css +25 -6
  9. package/src/custom-properties.css +8 -1
  10. package/src/minimo.css +1 -1
  11. package/src/web-components/s-datatable-component/s-datatable-component.js +4 -1
  12. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/index.js +0 -92
  13. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/hbars.js +0 -356
  14. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/pie.js +0 -245
  15. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/radial-bars.js +0 -177
  16. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/rating-display.js +0 -835
  17. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-assi.js +0 -212
  18. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/costruzione-linee.js +0 -101
  19. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/defaults.js +0 -185
  20. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/display-current.js +0 -27
  21. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/grid-areas.js +0 -129
  22. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/parse-opts.js +0 -64
  23. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile-src/paths-setup.js +0 -73
  24. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/settimanale-mensile.js +0 -126
  25. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/charts/signal-bars.js +0 -290
  26. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/src/week-utils.js +0 -122
  27. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/hbars-test.js +0 -52
  28. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/mcn-test.js +0 -74
  29. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/pie-test.js +0 -16
  30. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/radial-bars-test.js +0 -48
  31. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-dati-settimanale.js +0 -426
  32. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/settimanale-mensile-test.js +0 -260
  33. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/browser-test/src/signal-bars-test.js +0 -64
  34. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/node-test.mjs +0 -86
  35. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/hBars-node-test.mjs +0 -40
  36. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/lines-node-test.mjs +0 -73
  37. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/mcn-node-test.mjs +0 -64
  38. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/pie-node-test.mjs +0 -12
  39. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/radialsBar-node-test.mjs +0 -44
  40. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/settimanale-mensile-node-test.mjs +0 -258
  41. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/node-test/src/signalBars-node-test.mjs +0 -36
  42. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/test-readme.md +0 -24
  43. package/charts/TODO charts/1a-vers DA RIFATTORIZZARE/test/textToPath-test.mjs +0 -14
  44. package/charts/TODO charts/???/InfoBox.js +0 -456
  45. package/charts/TODO charts/???/README-upg OLD/342/206/222NEW.md" +0 -53
  46. package/charts/TODO charts/???/README.md +0 -1
  47. package/charts/TODO charts/???/TODO.md +0 -39
  48. package/charts/TODO charts/???/base-cfg.js +0 -66
  49. package/charts/TODO charts/???/rating-displayOLD.js +0 -837
  50. package/charts/TODO charts/docs/TODO.md +0 -1
  51. package/charts/TODO charts/docs/costruzione display rating.md +0 -145
  52. package/charts/TODO charts/test/node-test.mjs +0 -92
  53. package/charts/TODO charts/test/test-readme.md +0 -23
  54. package/charts/TODO charts/test/test-src/rating-display-extra-test.js +0 -132
  55. package/charts/TODO charts/test/test-src/rating-display-test.js +0 -155
  56. package/charts/TODO charts/test/textToPath-test.mjs +0 -14
  57. package/charts/TODO.md +0 -7
  58. package/charts/src/node-helpers/TODO.md +0 -2
  59. package/dev-tools/starter-kit/TODO.md +0 -135
  60. package/src/components/TODO form-multiselect/form-multiselect.css +0 -40
  61. package/src/components/TODO form-multiselect/form-multiselect.js +0 -83
  62. package/src/components/TODO vanilla-cookie-consent/cookie-consent.css +0 -20
  63. package/src/components/TODO vanilla-cookie-consent/cookie-consent.js +0 -76
  64. package/src/components/TODO vanilla-cookie-consent/render-cookie-list.js +0 -32
  65. package/src/components/TODO vanilla-cookie-consent/src/cookie-list.js +0 -85
  66. package/src/components/TODO vanilla-cookie-consent/src/it-translation.js +0 -38
  67. package/src/components/TODO vanilla-cookie-consent/src/run-analytics.js +0 -54
  68. package/src/components/TODO vanilla-cookie-consent/src/run-recaptcha.js +0 -71
  69. package/src/components/autocomplete/TODO.md +0 -4
  70. package/src/web-components/TODO json-table/README.md +0 -67
  71. package/src/web-components/TODO json-table/TODO.md +0 -12
  72. package/src/web-components/TODO json-table/_work/OLD/docs/custom-props-list.md +0 -69
  73. package/src/web-components/TODO json-table/_work/OLD/script/create-css-custom-props-doc.mjs +0 -113
  74. package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-end.md +0 -4
  75. package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-start.md +0 -30
  76. package/src/web-components/TODO json-table/_work/OLD/src/css/icons.module.css +0 -22
  77. package/src/web-components/TODO json-table/_work/OLD/src/css/info.module.css +0 -42
  78. package/src/web-components/TODO json-table/_work/OLD/src/css/main-wrapper.module.css +0 -4
  79. package/src/web-components/TODO json-table/_work/OLD/src/css/table.module.css +0 -154
  80. package/src/web-components/TODO json-table/_work/OLD/src/css/utility.module.css +0 -9
  81. package/src/web-components/TODO json-table/_work/OLD/src/icons/false.svg +0 -1
  82. package/src/web-components/TODO json-table/_work/OLD/src/icons/search-arrows.svg +0 -1
  83. package/src/web-components/TODO json-table/_work/OLD/src/icons/true.svg +0 -1
  84. package/src/web-components/TODO json-table/_work/OLD/src/index.js +0 -56
  85. package/src/web-components/TODO json-table/_work/OLD/src/js/default-columns-data-types.js +0 -172
  86. package/src/web-components/TODO json-table/_work/OLD/src/js/defaults.js +0 -156
  87. package/src/web-components/TODO json-table/_work/OLD/src/js/info-section.js +0 -31
  88. package/src/web-components/TODO json-table/_work/OLD/src/js/listeners.js +0 -17
  89. package/src/web-components/TODO json-table/_work/OLD/src/js/main-builder.js +0 -26
  90. package/src/web-components/TODO json-table/_work/OLD/src/js/parse-params.js +0 -121
  91. package/src/web-components/TODO json-table/_work/OLD/src/js/set-column-classname.js +0 -22
  92. package/src/web-components/TODO json-table/_work/OLD/src/js/table-builder.js +0 -64
  93. package/src/web-components/TODO json-table/_work/OLD/src/js/table-foot.js +0 -8
  94. package/src/web-components/TODO json-table/_work/OLD/src/js/table-head.js +0 -47
  95. package/src/web-components/TODO json-table/_work/OLD/src/js/table-row.js +0 -83
  96. package/src/web-components/TODO json-table/_work/OLD/src/js/utilities.js +0 -5
  97. package/src/web-components/TODO json-table/_work/__json-table-react/index.js +0 -4
  98. package/src/web-components/TODO json-table/_work/__json-table-react/src/build-page-array.js +0 -73
  99. package/src/web-components/TODO json-table/_work/__json-table-react/src/columns-data-types.js +0 -73
  100. package/src/web-components/TODO json-table/_work/__json-table-react/src/defaults.js +0 -50
  101. package/src/web-components/TODO json-table/_work/__json-table-react/src/download-excel.js +0 -156
  102. package/src/web-components/TODO json-table/_work/__json-table-react/src/set-className.js +0 -19
  103. package/src/web-components/TODO json-table/_work/__json-table-react/src/set-download-filename.js +0 -17
  104. package/src/web-components/TODO json-table/_work/__json-table-react/src/table-to-csv.js +0 -48
  105. package/src/web-components/TODO json-table/_work/archived/table-to-csv.js +0 -48
  106. package/src/web-components/TODO json-table/_work/arrow.svg +0 -3
  107. package/src/web-components/TODO json-table/_work/da decidere/get-cell-data.js +0 -18
  108. package/src/web-components/TODO json-table/_work/download-button.js +0 -29
  109. package/src/web-components/TODO json-table/_work/download-excel.js +0 -155
  110. package/src/web-components/TODO json-table/_work/pagination-array-builder.js +0 -73
  111. package/src/web-components/TODO json-table/_work/pagination.js +0 -37
  112. package/src/web-components/TODO json-table/_work/set-download-filename.js +0 -19
  113. package/src/web-components/TODO json-table/_work/table-info.js +0 -24
  114. package/src/web-components/TODO json-table/demo/README.md +0 -66
  115. package/src/web-components/TODO json-table/demo/assets/link-simple.svg +0 -1
  116. package/src/web-components/TODO json-table/demo/demo-data/json-static-table-demo-data.js +0 -512
  117. package/src/web-components/TODO json-table/demo/demo.css +0 -32
  118. package/src/web-components/TODO json-table/demo/demo.js +0 -24
  119. package/src/web-components/TODO json-table/demo/js/demo-ajax-table.js +0 -165
  120. package/src/web-components/TODO json-table/demo/js/demo-static-table.js +0 -180
  121. package/src/web-components/TODO json-table/demo/webpack-modules/css-rules.mjs +0 -122
  122. package/src/web-components/TODO json-table/demo/webpack-modules/get-jsConfig-aliases.mjs +0 -33
  123. package/src/web-components/TODO json-table/demo/webpack-modules/svg-rules.mjs +0 -108
  124. package/src/web-components/TODO json-table/demo/webpack-modules/svgo.config.mjs +0 -26
  125. package/src/web-components/TODO json-table/demo/webpack.config.mjs +0 -333
  126. package/src/web-components/TODO json-table/docs/custom-props-list.md +0 -74
  127. package/src/web-components/TODO json-table/docs-builder/create-css-custom-props-doc.mjs +0 -157
  128. package/src/web-components/TODO json-table/docs-builder/src/custom-props-end.md +0 -6
  129. package/src/web-components/TODO json-table/docs-builder/src/custom-props-start.md +0 -29
  130. package/src/web-components/TODO json-table/src/TODO.md +0 -1
  131. package/src/web-components/TODO json-table/src/__json-table-react/build-page-array.js +0 -73
  132. package/src/web-components/TODO json-table/src/__json-table-react/columns-data-types.js +0 -73
  133. package/src/web-components/TODO json-table/src/__json-table-react/defaults.js +0 -50
  134. package/src/web-components/TODO json-table/src/__json-table-react/download-excel.js +0 -156
  135. package/src/web-components/TODO json-table/src/__json-table-react/set-className.js +0 -19
  136. package/src/web-components/TODO json-table/src/__json-table-react/set-download-filename.js +0 -17
  137. package/src/web-components/TODO json-table/src/__json-table-react/table-to-csv.js +0 -48
  138. package/src/web-components/TODO json-table/src/css/custom-media.css +0 -16
  139. package/src/web-components/TODO json-table/src/css/icons.module.css +0 -22
  140. package/src/web-components/TODO json-table/src/css/info-section.module.css +0 -78
  141. package/src/web-components/TODO json-table/src/css/main-builder.module.css +0 -6
  142. package/src/web-components/TODO json-table/src/css/table.module.css +0 -172
  143. package/src/web-components/TODO json-table/src/css/utility.module.css +0 -9
  144. package/src/web-components/TODO json-table/src/icons/arrow-down-bold.svg +0 -1
  145. package/src/web-components/TODO json-table/src/icons/false.svg +0 -1
  146. package/src/web-components/TODO json-table/src/icons/true.svg +0 -1
  147. package/src/web-components/TODO json-table/src/index.js +0 -125
  148. package/src/web-components/TODO json-table/src/js/default-columns-data-types.js +0 -172
  149. package/src/web-components/TODO json-table/src/js/defaults.js +0 -510
  150. package/src/web-components/TODO json-table/src/js/get-ajax-data.js +0 -72
  151. package/src/web-components/TODO json-table/src/js/info-section.js +0 -39
  152. package/src/web-components/TODO json-table/src/js/init-ajax-table.js +0 -30
  153. package/src/web-components/TODO json-table/src/js/init-static-table.js +0 -18
  154. package/src/web-components/TODO json-table/src/js/main-builder.js +0 -87
  155. package/src/web-components/TODO json-table/src/js/parse-data-row.js +0 -123
  156. package/src/web-components/TODO json-table/src/js/parse-params.js +0 -118
  157. package/src/web-components/TODO json-table/src/js/set-search-listener.js +0 -62
  158. package/src/web-components/TODO json-table/src/js/set-sort-listeners.js +0 -115
  159. package/src/web-components/TODO json-table/src/js/static-data-sorting.js +0 -23
  160. package/src/web-components/TODO json-table/src/js/table-builder.js +0 -45
  161. package/src/web-components/TODO json-table/src/js/table-row.js +0 -43
  162. package/src/web-components/TODO json-table/src/js/table-tfoot.js +0 -9
  163. package/src/web-components/TODO json-table/src/js/table-thead.js +0 -91
  164. package/src/web-components/TODO json-table/src/js/update-info.js +0 -42
  165. package/src/web-components/TODO json-table/src/js/utilities.js +0 -5
@@ -1,125 +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 './css/custom-media.css';
10
-
11
- import { initStaticTable } from './js/init-static-table.js';
12
- import { initAjaxTable } from './js/init-ajax-table.js';
13
- import { getAjaxData } from './js/get-ajax-data.js';
14
-
15
- import { parseParams } from './js/parse-params.js';
16
- import { parseDataRow } from './js/parse-data-row.js';
17
- import { mainBuilder } from './js/main-builder.js';
18
- import { infoSection } from './js/info-section.js';
19
- import { tableBuilder } from './js/table-builder.js';
20
- import { tableThead } from './js/table-thead.js';
21
- import { tableTfoot } from './js/table-tfoot.js';
22
- import { tableRow } from './js/table-row.js';
23
- import { updateInfo } from './js/update-info.js';
24
- import { setSearchListener } from './js/set-search-listener.js';
25
- import { setSortListeners } from './js/set-sort-listeners.js';
26
- // import { staticDataSorting } from './js/static-data-sorting.js';
27
-
28
- class JsonTable {
29
-
30
- constructor(custom_params, custom_data_types) {
31
- this.params = parseParams({
32
- custom_params: custom_params,
33
- custom_data_types: custom_data_types,
34
- });
35
-
36
- if(this.params.err) {
37
- // eslint-disable-next-line no-console
38
- console.error(this.params.err);
39
-
40
- } else {
41
-
42
- this.appInit();
43
- }
44
-
45
- }
46
-
47
- async appInit() {
48
-
49
- if(this.params.ajax === false) {
50
- this.initStaticTable();
51
-
52
- } else {
53
- await this.initAjaxTable();
54
- }
55
-
56
- // Add aria attributes to icons
57
- // and convert all icon variables to DOM nodes (if they aren't)
58
- const div = document.createElement('div');
59
- [
60
- 'boolTrueIcon',
61
- 'boolFalseIcon',
62
- 'sortArrowIcon'
63
- ].forEach(icon => {
64
- if(this.params[icon] instanceof Element) {
65
- div.replaceChildren(this.params[icon]);
66
- } else {
67
- div.innerHTML = this.params[icon] || 'missing icon';
68
- }
69
-
70
- div.querySelector('svg').setAttribute('aria-hidden', true);
71
-
72
- this.params[icon] = div.firstElementChild;
73
-
74
- });
75
- div.remove();
76
-
77
- this.mainBuilder();
78
-
79
- if(this.params.debug) {
80
- /* eslint-disable no-console */
81
- console.groupCollapsed('JsonTable params & elements');
82
- console.log('this.params');
83
- console.log(this.params);
84
- console.log('generated elements (this.params.elements)');
85
- console.log(this.params.elements);
86
- console.log('this.parsedData (static table only)');
87
- console.log(this.parsedData?? 'n/a');
88
- console.groupEnd();
89
- /* eslint-enable no-console */
90
- }
91
- }
92
- }
93
-
94
- JsonTable.prototype.initStaticTable = initStaticTable;
95
- JsonTable.prototype.initAjaxTable = initAjaxTable;
96
- JsonTable.prototype.getAjaxData = getAjaxData;
97
- JsonTable.prototype.parseDataRow = parseDataRow;
98
- JsonTable.prototype.mainBuilder = mainBuilder;
99
- JsonTable.prototype.infoSection = infoSection;
100
- JsonTable.prototype.tableBuilder = tableBuilder;
101
- JsonTable.prototype.tableThead = tableThead;
102
- JsonTable.prototype.tableTfoot = tableTfoot;
103
- JsonTable.prototype.tableRow = tableRow;
104
- JsonTable.prototype.updateInfo = updateInfo;
105
- JsonTable.prototype.setSearchListener = setSearchListener;
106
- JsonTable.prototype.setSortListeners = setSortListeners;
107
- // JsonTable.prototype.staticDataSorting = staticDataSorting;
108
-
109
- export default JsonTable;
110
-
111
-
112
- // TODO opzione per acquisire i dati dal markup di una tabella
113
- // TODO local storage per opzioni di ordinamento e ricerca
114
- // TODO Alternativa excel : https://gitlab.com/catamphetamine/write-excel-file ??
115
- // TODO jsdoc
116
- // TODO opzione per usare parametri più semplici non compatibili con dt
117
- // TODO add parse cell method (unificare tipi con static Table)
118
- // TODO versione con css separato?
119
-
120
- // TODO see:
121
- // https://www.raymondcamden.com/2022/05/23/building-table-sorting-and-pagination-in-a-web-component
122
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table?retiredLocale=it#table_sorting
123
- // https://pencilandpaper.io/articles/user-experience/ux-pattern-analysis-enterprise-data-tables/
124
- // https://medium.com/design-with-figma/the-ultimate-guide-to-designing-data-tables-7db29713a85a
125
- // https://medium.com/nextux/design-better-data-tables-4ecc99d23356
@@ -1,172 +0,0 @@
1
- /**
2
- * data types default settings
3
- *
4
- * standard render function and classnames for each data type
5
- * each of the them can be overridden in the columns definition
6
- * the formatClassName is used to add a class to the tbody cells for formatting purposes
7
- *
8
- * default data types can be expanded with custom values when instatiating the JsonTable class
9
- *
10
- * @param {Object} params - the global params object. For clarity, render functions
11
- * use a `global_params` argument, instead of `params`, but it's the same thing
12
- * @param {Object} datatypes - the default datatypes object
13
- * @param {String} datatypes.className - default className for the data type
14
- * @param {Function} datatypes.parse - parse function, to normalize/process data before rendering,
15
- * its argument is the complete data row, and must be applied to the column definition
16
- * (not with this function)
17
- * @param {Function} datatypes.render - render function
18
- * @param {Function} datatypes.sortValueParser - the value used for sorting (static table only). If not defined, the raw value is used
19
- * @param {Function} datatypes.searchValueParser - the value used for searching (static table only). If not defined, the raw value is used
20
- * @param {Object} datatypes.colDefaultsOverrides - Object with default values for the columns.
21
- * They override the default values in the `columns_default` object for the columns with the given dataType
22
- * @returns {Object} - the default datatypes object
23
- */
24
-
25
- import * as styles from '../css/utility.module.css';
26
- import * as iconsStyles from '../css/icons.module.css';
27
-
28
- export function defaultDataTypes(params) {
29
-
30
- const inlineEndAlignClassName = params.inlineEndAlignClassName?? styles.endAlign
31
- // ,centerAlignClassName = params.centerAlignClassName?? styles.centerAlign
32
- ,nowrapClassName = params.nowrapClassName?? styles.nowrap
33
-
34
- ,date_datetime_datatype = isDatetime => {
35
-
36
- const parseDateString = d => {
37
- let date;
38
- if(!d) {
39
- date = null;
40
-
41
- // allow using date objects (like the ones returned by symfony)
42
- // like `{'date': '2022-12-02 06:18:55', 'timezone_type': 3, 'timezone': 'Europe/Berlin' }`
43
- // added for compatibility reasons
44
- // ENHANCEMENT parse timezones
45
- } else if(typeof d === 'object' && Object.hasOwn(d, 'date')) {
46
-
47
- date = new Date(d.date);
48
-
49
- } else {
50
- date = new Date(d);
51
- }
52
- return date;
53
- };
54
-
55
- return {
56
- className: inlineEndAlignClassName + (params.datesNowrap? ` ${nowrapClassName}` : ''),
57
-
58
- sortValueParser: (d/* , global_params */) => parseDateString(d)?.toISOString()?? '',
59
- searchValueParser: (d, global_params) => {
60
- // normalize the date string
61
- const date = parseDateString(d);
62
- if (date) {
63
- return date.toLocaleString(global_params.locale, {
64
- ...global_params.datesLocaleOpts,
65
- ...(isDatetime? global_params.timesLocaleOpts : {})
66
- });
67
- } else {
68
- return '';
69
- }
70
- },
71
-
72
- render: (d, global_params) => {
73
-
74
- // normalize the date string
75
- const date = parseDateString(d);
76
-
77
- if(date) {
78
- const dateISO = date.toISOString();
79
- return `<time datetime="${isDatetime? dateISO : dateISO.substring(0,10)}">` +
80
- date.toLocaleString(global_params.locale, global_params.datesLocaleOpts) +
81
- (isDatetime?
82
- '\u00A0' +
83
- '<small>' +
84
- date.toLocaleString(global_params.locale, global_params.timesLocaleOpts) +
85
- '</small>'
86
- : '') +
87
- '</time>';
88
-
89
- } else {
90
- return '';
91
- }
92
- },
93
- // force some columns default values (`columns_default` variable) for this dataType.
94
- // All of these values can in turn be overridden in the column definition.
95
- colDefaultsOverrides: {
96
- tfoot: false, // avoid rendering this value inside the tfoot element
97
- }
98
- }; // end of returned object
99
- } // end date_datetime_datatype
100
-
101
- ,parseNum = (val) => {
102
- const num = +(val?? 0);
103
- if(isNaN(num) && params.isNaNChar !== false) {
104
- return params.isNaNChar;
105
- } else {
106
- return num;
107
- }
108
- }
109
- ;
110
-
111
- const datatypes = {
112
-
113
- string: {}, // default type
114
-
115
- date: date_datetime_datatype(false),
116
- datetime: date_datetime_datatype(true),
117
-
118
- num: {
119
- className : inlineEndAlignClassName,
120
- sortValueParser : val => parseNum(val),
121
- searchValueParser : val => parseNum(val),
122
- render : (val, global_params) => {
123
- const num = parseNum(val);
124
- return isNaN(num)? num : num.toLocaleString(global_params.locale, global_params.numbersLocaleOpts);
125
- }
126
- },
127
- perc: {
128
- className : inlineEndAlignClassName,
129
- sortValueParser : val => parseNum(val),
130
- searchValueParser : val => parseNum(val),
131
- render : (val, global_params) => {
132
- const num = parseNum(val);
133
- return isNaN(num)? num : num.toLocaleString(global_params.locale, global_params.currPercLocaleOpts) + '\u202F<small>%</small>';
134
- }
135
- },
136
- percDecimal: {
137
- className : inlineEndAlignClassName,
138
- sortValueParser : val => parseNum(val),
139
- searchValueParser : val => parseNum(val),
140
- render : (val, global_params) => {
141
- const num = parseNum(val);
142
- return isNaN(num)? num : (num * 100).toLocaleString(global_params.locale, global_params.currPercLocaleOpts) + '\u202F<small>%</small>';
143
- }
144
- },
145
- euro: {
146
- className : inlineEndAlignClassName,
147
- sortValueParser : val => parseNum(val),
148
- searchValueParser : val => parseNum(val),
149
- render : (val, global_params) => {
150
- const num = parseNum(val);
151
- return isNaN(num)? num : '<small>\u20AC</small>\u202F' + num.toLocaleString(global_params.locale, global_params.currPercLocaleOpts);
152
- }
153
- },
154
-
155
- bool: {
156
- // NB: `true` and `false` classes are added by the `table-row.js` script
157
- className : params.boolValuesClassName?? iconsStyles.icon,
158
- render : (val, global_params) => val === true? global_params.boolTrueIcon : (val === false? global_params.boolFalseIcon : ''),
159
-
160
- // force some columns default values (`columns_default` variable) for this dataType.
161
- // All of these values can in turn be overridden in the column definition.
162
- colDefaultsOverrides: {
163
- tfoot : false, // avoid rendering this value inside the tfoot element
164
- searchable : false, // disable searching
165
- sortable : false // disable sorting
166
- }
167
- }
168
-
169
- };
170
-
171
- return datatypes;
172
- }