@sme.up/ketchup 6.2.0 → 6.3.0

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 (160) hide show
  1. package/dist/cjs/{f-button-5b69d882.js → f-button-94cb5f35.js} +2 -2
  2. package/dist/cjs/{f-cell-3a740c48.js → f-cell-76830a0d.js} +12 -14
  3. package/dist/cjs/{f-checkbox-57443ca3.js → f-checkbox-cd977193.js} +1 -1
  4. package/dist/cjs/{f-chip-02e83f82.js → f-chip-68d45fd3.js} +3 -3
  5. package/dist/cjs/{f-image-2a61ece2.js → f-image-0e71df7e.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-09126bdd.js → f-paginator-utils-46689c0a.js} +80 -403
  7. package/dist/cjs/{f-text-field-9ee20a67.js → f-text-field-b4229cef.js} +11 -3
  8. package/dist/cjs/{index-06b131ea.js → index-31125378.js} +9 -4
  9. package/dist/cjs/ketchup.cjs.js +3 -3
  10. package/dist/cjs/kup-accordion.cjs.entry.js +5 -6
  11. package/dist/cjs/kup-autocomplete_25.cjs.entry.js +116 -111
  12. package/dist/cjs/kup-box.cjs.entry.js +15 -17
  13. package/dist/cjs/kup-calendar.cjs.entry.js +9 -11
  14. package/dist/cjs/kup-cell.cjs.entry.js +9 -11
  15. package/dist/cjs/kup-dash-list.cjs.entry.js +5 -7
  16. package/dist/cjs/kup-dash_2.cjs.entry.js +4 -5
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +76 -17
  18. package/dist/cjs/kup-drawer.cjs.entry.js +4 -5
  19. package/dist/cjs/kup-echart.cjs.entry.js +17 -19
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +140 -64
  21. package/dist/cjs/kup-form.cjs.entry.js +10 -12
  22. package/dist/cjs/kup-iframe.cjs.entry.js +4 -5
  23. package/dist/cjs/kup-image-list.cjs.entry.js +10 -12
  24. package/dist/cjs/kup-lazy.cjs.entry.js +4 -5
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +5 -6
  26. package/dist/cjs/{kup-manager-02acbb37.js → kup-manager-7c514a30.js} +1400 -369
  27. package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -5
  28. package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
  29. package/dist/cjs/kup-photo-frame.cjs.entry.js +4 -5
  30. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +6 -7
  33. package/dist/cjs/loader.cjs.js +3 -3
  34. package/dist/collection/assets/dashboard.js +48 -0
  35. package/dist/collection/assets/family-tree.js +236 -19
  36. package/dist/collection/assets/index.js +4 -0
  37. package/dist/collection/assets/kupinteract.js +68 -0
  38. package/dist/collection/collection-manifest.json +5 -5
  39. package/dist/collection/components/kup-dashboard/kup-dashboard.css +7 -0
  40. package/dist/collection/components/kup-dashboard/kup-dashboard.js +67 -7
  41. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
  42. package/dist/collection/components/kup-echart/kup-echart.js +9 -9
  43. package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +3 -1
  44. package/dist/collection/components/kup-family-tree/kup-family-tree.css +79 -9
  45. package/dist/collection/components/kup-family-tree/kup-family-tree.js +253 -65
  46. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
  47. package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
  48. package/dist/collection/f-components/f-text-field/f-text-field.js +9 -1
  49. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +48 -15
  50. package/dist/collection/managers/kup-data/kup-data.js +5 -5
  51. package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
  52. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +2 -0
  53. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +131 -45
  54. package/dist/collection/utils/filters/filters-rows.js +4 -23
  55. package/dist/collection/utils/filters/filters-tree-items.js +2 -1
  56. package/dist/esm/{f-button-fd44ef70.js → f-button-cd948e50.js} +2 -2
  57. package/dist/esm/{f-cell-7b159a22.js → f-cell-474dd282.js} +6 -8
  58. package/dist/esm/{f-checkbox-c51c4a75.js → f-checkbox-e06cf07b.js} +1 -1
  59. package/dist/esm/{f-chip-c2e4c522.js → f-chip-d6f2eb94.js} +3 -3
  60. package/dist/esm/{f-image-2ab4b9aa.js → f-image-914a03ef.js} +2 -2
  61. package/dist/esm/{f-paginator-utils-ef537d82.js → f-paginator-utils-a4a52732.js} +44 -366
  62. package/dist/esm/{f-text-field-41c575eb.js → f-text-field-76341fe3.js} +11 -3
  63. package/dist/esm/{index-ad6ab214.js → index-e41330a5.js} +9 -4
  64. package/dist/esm/ketchup.js +3 -3
  65. package/dist/esm/kup-accordion.entry.js +3 -4
  66. package/dist/esm/kup-autocomplete_25.entry.js +17 -12
  67. package/dist/esm/kup-box.entry.js +9 -11
  68. package/dist/esm/kup-calendar.entry.js +5 -7
  69. package/dist/esm/kup-cell.entry.js +7 -9
  70. package/dist/esm/kup-dash-list.entry.js +2 -4
  71. package/dist/esm/kup-dash_2.entry.js +2 -3
  72. package/dist/esm/kup-dashboard.entry.js +74 -15
  73. package/dist/esm/kup-drawer.entry.js +2 -3
  74. package/dist/esm/kup-echart.entry.js +11 -13
  75. package/dist/esm/kup-family-tree.entry.js +138 -62
  76. package/dist/esm/kup-form.entry.js +7 -9
  77. package/dist/esm/kup-iframe.entry.js +2 -3
  78. package/dist/esm/kup-image-list.entry.js +8 -10
  79. package/dist/esm/kup-lazy.entry.js +2 -3
  80. package/dist/esm/kup-magic-box.entry.js +3 -4
  81. package/dist/esm/{kup-manager-22a475e6.js → kup-manager-86f440c7.js} +1379 -370
  82. package/dist/esm/kup-nav-bar.entry.js +2 -3
  83. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  84. package/dist/esm/kup-photo-frame.entry.js +2 -3
  85. package/dist/esm/kup-probe.entry.js +2 -2
  86. package/dist/esm/kup-qlik.entry.js +2 -2
  87. package/dist/esm/kup-snackbar.entry.js +4 -5
  88. package/dist/esm/loader.js +3 -3
  89. package/dist/ketchup/ketchup.esm.js +1 -1
  90. package/dist/ketchup/p-00e1133d.entry.js +9 -0
  91. package/dist/ketchup/p-066f344a.entry.js +1 -0
  92. package/dist/ketchup/p-0c6e0647.entry.js +1 -0
  93. package/dist/ketchup/p-151f7c17.entry.js +27 -0
  94. package/dist/ketchup/p-1e9c03b0.entry.js +1 -0
  95. package/dist/ketchup/{p-fc2b1229.js → p-21ea11cb.js} +3 -3
  96. package/dist/ketchup/{p-1959f835.entry.js → p-2f4e6c50.entry.js} +1 -1
  97. package/dist/ketchup/p-3586f59c.js +1 -0
  98. package/dist/ketchup/p-359fd90d.entry.js +1 -0
  99. package/dist/ketchup/{p-38d7584e.js → p-389fd0bf.js} +1 -1
  100. package/dist/ketchup/{p-cd5cfa7c.js → p-5552f156.js} +1 -1
  101. package/dist/ketchup/{p-264b1b19.entry.js → p-77aff9c1.entry.js} +1 -1
  102. package/dist/ketchup/{p-e9366aaf.entry.js → p-7cfdf53c.entry.js} +4 -4
  103. package/dist/ketchup/p-853a5178.entry.js +1 -0
  104. package/dist/ketchup/{p-edae3076.js → p-8673bd4e.js} +1 -1
  105. package/dist/ketchup/p-8b55b786.entry.js +1 -0
  106. package/dist/ketchup/p-95f5834b.entry.js +1 -0
  107. package/dist/ketchup/p-a2c595c4.js +1 -0
  108. package/dist/ketchup/p-ae91f27e.entry.js +1 -0
  109. package/dist/ketchup/{p-928c5c36.js → p-af664379.js} +1 -1
  110. package/dist/ketchup/p-b0b3989b.js +2 -0
  111. package/dist/ketchup/p-b3b65a61.entry.js +1 -0
  112. package/dist/ketchup/p-bc306a53.entry.js +1 -0
  113. package/dist/ketchup/{p-42080355.entry.js → p-c3783b77.entry.js} +1 -1
  114. package/dist/ketchup/{p-dc62a30f.js → p-cd4fc3fb.js} +1 -1
  115. package/dist/ketchup/p-cee76b14.entry.js +1 -0
  116. package/dist/ketchup/p-cfaea29b.entry.js +1 -0
  117. package/dist/ketchup/p-d2f51e7b.entry.js +1 -0
  118. package/dist/ketchup/p-df8e6a4d.entry.js +1 -0
  119. package/dist/ketchup/p-e60a1170.entry.js +1 -0
  120. package/dist/ketchup/p-e9a1ba04.entry.js +1 -0
  121. package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +6 -1
  122. package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +7 -3
  123. package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +26 -5
  124. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
  125. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  126. package/dist/types/components.d.ts +49 -7
  127. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  128. package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
  129. package/dist/types/managers/kup-data/kup-data.d.ts +2 -1
  130. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +9 -1
  131. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +7 -5
  132. package/dist/types/utils/filters/filters-rows.d.ts +0 -2
  133. package/package.json +2 -2
  134. package/dist/cjs/cell-utils-fe64a28c.js +0 -168
  135. package/dist/cjs/utils-4b208b48.js +0 -447
  136. package/dist/esm/cell-utils-cb5d4149.js +0 -160
  137. package/dist/esm/utils-2c1f4122.js +0 -428
  138. package/dist/ketchup/p-06c6cc68.js +0 -1
  139. package/dist/ketchup/p-0dacd4bc.entry.js +0 -1
  140. package/dist/ketchup/p-1c44dc62.entry.js +0 -1
  141. package/dist/ketchup/p-4bc9f98b.entry.js +0 -1
  142. package/dist/ketchup/p-578583db.entry.js +0 -1
  143. package/dist/ketchup/p-5866d507.entry.js +0 -1
  144. package/dist/ketchup/p-61059e9d.entry.js +0 -9
  145. package/dist/ketchup/p-664be494.entry.js +0 -1
  146. package/dist/ketchup/p-67cd575d.entry.js +0 -1
  147. package/dist/ketchup/p-682a367a.js +0 -1
  148. package/dist/ketchup/p-6ccf7eb2.entry.js +0 -1
  149. package/dist/ketchup/p-7230ab97.entry.js +0 -1
  150. package/dist/ketchup/p-752b4cef.entry.js +0 -1
  151. package/dist/ketchup/p-7de3e7ac.entry.js +0 -1
  152. package/dist/ketchup/p-9b36497d.entry.js +0 -1
  153. package/dist/ketchup/p-b982d137.entry.js +0 -1
  154. package/dist/ketchup/p-c0219e5e.js +0 -1
  155. package/dist/ketchup/p-c55fd0a7.entry.js +0 -1
  156. package/dist/ketchup/p-d154b3a0.entry.js +0 -1
  157. package/dist/ketchup/p-d2affb6f.entry.js +0 -27
  158. package/dist/ketchup/p-d3b542b3.js +0 -2
  159. package/dist/ketchup/p-d6c12c6c.js +0 -1
  160. package/dist/ketchup/p-da0eab60.entry.js +0 -1
@@ -1,322 +1,8 @@
1
- import { W as KupTagNames, d as KupDatesFormats, r as KupDatesNormalize, s as KupObjects, M as SortMode, T as TotalMode, X as KupLanguagePage, n as KupLanguageRow, h as KupLanguageGeneric } from './kup-manager-22a475e6.js';
2
- import { b as isValidFormattedStringTime, f as formattedStringToCustomUnformattedStringTime, j as formattedStringToDefaultUnformattedStringTimestamp, k as isValidFormattedStringNumber, l as formattedStringToUnformattedStringNumber, m as unformattedStringNumberToNumber, h as stringToNumber, o as isNumber } from './utils-2c1f4122.js';
3
- import { b as getValueForDisplay, a as getValueForDisplay2, c as getCellValueForDisplay, g as getColumnByName, d as compareValues, e as compareCell } from './cell-utils-cb5d4149.js';
4
- import { h } from './index-ad6ab214.js';
5
- import { F as FButton } from './f-button-fd44ef70.js';
1
+ import { F as Filters, H as FilterInterval, C as getValueForDisplay, B as getValueForDisplay2, ad as getCellValueForDisplay, t as getColumnByName, x as KupObjects, ae as KupData, af as compareCell, T as TotalMode, ag as stringToNumber, e as KupDatesFormats, ah as isNumber, _ as SortMode, ai as KupLanguagePage, p as KupLanguageRow, j as KupLanguageGeneric } from './kup-manager-86f440c7.js';
2
+ import { h } from './index-e41330a5.js';
3
+ import { F as FButton } from './f-button-cd948e50.js';
6
4
  import { F as FButtonStyling } from './f-button-declarations-b1b4cac4.js';
7
5
 
8
- /**
9
- * Interface for ranged filters.
10
- */
11
- var FilterInterval;
12
- (function (FilterInterval) {
13
- FilterInterval[FilterInterval["FROM"] = 0] = "FROM";
14
- FilterInterval[FilterInterval["TO"] = 1] = "TO";
15
- })(FilterInterval || (FilterInterval = {}));
16
- /**
17
- * This regular expressions returns a match like this one:
18
- * if the string does not match is null, otherwise the indexes are equal to the object below:
19
- *
20
- * @property {string} 0 - The entire match of the regexp; is equal to the cellValue.
21
- * @property {string} 1 - Either !' or ' it's the start of the regexp.
22
- * @property {string} 2 - Either % or null: means the string must start with the given string.
23
- * @property {string} 3 - Either "" or a string with a length.
24
- * @property {string} 4 - Either % or null: means the string must finish with the given string.
25
- * @property {string} 5 - Always equal to ': it's the end of the filter.
26
- */
27
- const FILTER_ANALIZER = /^('|!')(%){0,1}(.*?)(%){0,1}(')$/;
28
- var KupGlobalFilterMode;
29
- (function (KupGlobalFilterMode) {
30
- KupGlobalFilterMode["SIMPLE"] = "simple";
31
- KupGlobalFilterMode["HIGHLIGHT"] = "highlight";
32
- })(KupGlobalFilterMode || (KupGlobalFilterMode = {}));
33
-
34
- const dom$3 = document.documentElement;
35
- /**
36
- * Filtering algorithms.
37
- * @module Filters
38
- * @todo Should contain EVERY filtering method in common between filtering types (i.e.: global filters and column menu filters).
39
- */
40
- class Filters {
41
- /**
42
- * Function used to check whether the component is a KupTree or KupDataTable.
43
- * @param {KupDataTable | KupTree} comp - Component using the column menu.
44
- * @returns {comp is KupTree} Returns true when the component is KupTree.
45
- */
46
- static isTree(comp) {
47
- return comp.rootElement.tagName === KupTagNames.TREE;
48
- }
49
- isObjFiltrableByInterval(obj) {
50
- if (dom$3.ketchup.objects.isDate(obj)) {
51
- return true;
52
- }
53
- if (dom$3.ketchup.objects.isTime(obj)) {
54
- return true;
55
- }
56
- if (dom$3.ketchup.objects.isTimestamp(obj)) {
57
- return true;
58
- }
59
- if (dom$3.ketchup.objects.isNumber(obj)) {
60
- return true;
61
- }
62
- return false;
63
- }
64
- normalizeValue(value, smeupObj) {
65
- let newValue = value != null ? value.trim() : value;
66
- if (newValue == null || newValue == '' || smeupObj == null) {
67
- return newValue;
68
- }
69
- if (dom$3.ketchup.objects.isDate(smeupObj)) {
70
- if (dom$3.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE)) {
71
- return newValue;
72
- }
73
- if (dom$3.ketchup.dates.isValid(value)) {
74
- return dom$3.ketchup.dates.format(dom$3.ketchup.dates.normalize(value, KupDatesNormalize.DATE), KupDatesFormats.ISO_DATE);
75
- }
76
- }
77
- else if (dom$3.ketchup.objects.isTime(smeupObj)) {
78
- let manageSeconds = dom$3.ketchup.objects.isTimeWithSeconds(smeupObj);
79
- if (dom$3.ketchup.dates.isValid(value, manageSeconds
80
- ? KupDatesFormats.ISO_TIME
81
- : KupDatesFormats.ISO_TIME_WITHOUT_SECONDS)) {
82
- return newValue;
83
- }
84
- if (isValidFormattedStringTime(value, manageSeconds)) {
85
- return formattedStringToCustomUnformattedStringTime(value, manageSeconds
86
- ? KupDatesFormats.ISO_TIME
87
- : KupDatesFormats.ISO_TIME_WITHOUT_SECONDS, manageSeconds);
88
- }
89
- }
90
- else if (dom$3.ketchup.objects.isTimestamp(smeupObj)) {
91
- if (dom$3.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE_TIME)) {
92
- return newValue;
93
- }
94
- if (isValidFormattedStringTime(value, true)) {
95
- return formattedStringToDefaultUnformattedStringTimestamp(value);
96
- }
97
- }
98
- else if (dom$3.ketchup.objects.isNumber(smeupObj)) {
99
- if (isValidFormattedStringNumber(value, smeupObj ? smeupObj.p : '')) {
100
- return formattedStringToUnformattedStringNumber(value, smeupObj ? smeupObj.p : '');
101
- }
102
- }
103
- return newValue;
104
- }
105
- /**
106
- * Given a filter value, check if is a negative filter
107
- * @param filterValue the filter value to use for check
108
- */
109
- filterIsNegative(filterValue) {
110
- const analyzedFilter = filterValue.match(FILTER_ANALIZER);
111
- const filterIsNegative = analyzedFilter
112
- ? analyzedFilter[1].indexOf('!') >= 0
113
- : false;
114
- return filterIsNegative;
115
- }
116
- /**
117
- * Given a value and a filter value, returns if that value matches the filter.
118
- *
119
- * Web filters can also be expressions: by putting strings between single quotes (') it's possible to activate filter expressions.
120
- * Valid syntax:
121
- * 'filter' = search for exact phrase;
122
- * '' = match when value is empty;
123
- * 'filter%' = match when a string starts with "filter";
124
- * '%filter' = match when a string ends with "filter";
125
- * '%filter%' = match when a string contains "filter".
126
- *
127
- * It is also possible to negate the expression by prepending "!" in front of the expression.
128
- * For example: !'' = value in the cell must not be empty.
129
- *
130
- * With no expression set, the filter is by default set to '%filter%'.
131
- *
132
- * @param value - The current value to check.
133
- * @param filterValue - The value of the current filter.
134
- * @returns false if value or filterValue are empty;
135
- true if value contains filterValue;
136
- true if value matches special filter created on filterValue;
137
- false otherwise.
138
- */
139
- isFilterCompliantForValue(value, filterValue) {
140
- if (value == null) {
141
- return false;
142
- }
143
- if (filterValue == null) {
144
- return false;
145
- }
146
- const _filterIsNegative = this.filterIsNegative(filterValue);
147
- // checks if the value of the filter is contained inside value of the object
148
- // Or is if the filter is a special filter to be matched.
149
- if (value.toLowerCase().includes(filterValue.toLowerCase()) ||
150
- this.matchSpecialFilter(value.toLowerCase(), filterValue.toLowerCase().match(FILTER_ANALIZER), true)) {
151
- // the element matches the field filter
152
- if (_filterIsNegative) {
153
- return false;
154
- }
155
- return true;
156
- }
157
- if (_filterIsNegative) {
158
- return true;
159
- }
160
- return false;
161
- }
162
- /**
163
- * Given a value and a filter value, returns if that value matches the filter.
164
- *
165
- * Web filters can also be expressions: by putting strings between single quotes (') it's possible to activate filter expressions.
166
- * Valid syntax:
167
- * 'filter' = search for exact phrase;
168
- * '' = match when value is empty;
169
- * 'filter%' = match when a string starts with "filter";
170
- * '%filter' = match when a string ends with "filter";
171
- * '%filter%' = match when a string contains "filter".
172
- *
173
- * It is also possible to negate the expression by prepending "!" in front of the expression.
174
- * For example: !'' = value in the cell must not be empty.
175
- *
176
- * With no expression set, the filter is by default set to '%filter%'.
177
- *
178
- * @param value - The current value to check.
179
- * @param parsedFilter - The value of the current filter.
180
- * @param ignoreNegativeFlag = false - When set to true, the matcher will ignore the (!) operator; useful for global filter.
181
- * @returns True if the filter is empty and the value of the cell is empty, false otherwise.
182
- */
183
- matchSpecialFilter(value, parsedFilter, ignoreNegativeFlag = false) {
184
- if (parsedFilter != null) {
185
- // endsWith and startWith are not supported by IE 11
186
- // Check here https://www.w3schools.com/jsref/jsref_endswith.asp
187
- const toRet = (parsedFilter[3] === '' && !value.trim()) ||
188
- (!parsedFilter[2] &&
189
- parsedFilter[4] &&
190
- value.startsWith(parsedFilter[3])) ||
191
- (parsedFilter[2] &&
192
- !parsedFilter[4] &&
193
- value.endsWith(parsedFilter[3])) ||
194
- (!parsedFilter[2] &&
195
- !parsedFilter[4] &&
196
- value === parsedFilter[3]) ||
197
- (parsedFilter[2] &&
198
- parsedFilter[4] &&
199
- value.indexOf(parsedFilter[3]) >= 0);
200
- return !ignoreNegativeFlag
201
- ? parsedFilter[1].indexOf('!') < 0
202
- ? toRet
203
- : !toRet
204
- : toRet;
205
- }
206
- return false;
207
- }
208
- isFilterCompliantForSimpleValue(valueToCheck, obj, filterValue, interval) {
209
- if (valueToCheck == null) {
210
- return false;
211
- }
212
- filterValue = this.normalizeValue(filterValue, obj);
213
- let value = valueToCheck;
214
- let from = '';
215
- let to = '';
216
- if (interval != null) {
217
- from = interval[FilterInterval.FROM];
218
- to = interval[FilterInterval.TO];
219
- }
220
- let checkByRegularExpression = true;
221
- if (dom$3.ketchup.objects.isNumber(obj)) {
222
- value = unformattedStringNumberToNumber(value, obj ? obj.p : '');
223
- let valueNumber = stringToNumber(value);
224
- if (from != '') {
225
- if (isNumber(from)) {
226
- checkByRegularExpression = false;
227
- let fromNumber = stringToNumber(from);
228
- if (valueNumber < fromNumber) {
229
- return false;
230
- }
231
- }
232
- else {
233
- filterValue = from;
234
- }
235
- }
236
- if (to != '') {
237
- if (isNumber(to)) {
238
- checkByRegularExpression = false;
239
- let toNumber = stringToNumber(to);
240
- if (valueNumber > toNumber) {
241
- return false;
242
- }
243
- }
244
- else {
245
- filterValue = to;
246
- }
247
- }
248
- }
249
- if (dom$3.ketchup.objects.isDate(obj) ||
250
- dom$3.ketchup.objects.isTime(obj) ||
251
- dom$3.ketchup.objects.isTimestamp(obj)) {
252
- let valueDate = null;
253
- let defaultFormat = KupDatesFormats.ISO_DATE;
254
- if (dom$3.ketchup.objects.isDate(obj)) {
255
- defaultFormat = KupDatesFormats.ISO_DATE;
256
- }
257
- else if (dom$3.ketchup.objects.isTime(obj)) {
258
- defaultFormat = dom$3.ketchup.objects.isTimeWithSeconds(obj)
259
- ? KupDatesFormats.ISO_TIME
260
- : KupDatesFormats.ISO_TIME_WITHOUT_SECONDS;
261
- }
262
- else if (dom$3.ketchup.objects.isTimestamp(obj)) {
263
- defaultFormat = KupDatesFormats.ISO_DATE_TIME;
264
- }
265
- if (dom$3.ketchup.dates.isValid(value, defaultFormat, true)) {
266
- valueDate = dom$3.ketchup.dates.toDate(value, defaultFormat);
267
- }
268
- if (from != '') {
269
- if (valueDate != null &&
270
- dom$3.ketchup.dates.isValid(from, defaultFormat, true)) {
271
- checkByRegularExpression = false;
272
- let fromDate = dom$3.ketchup.dates.toDate(from, defaultFormat);
273
- if (valueDate < fromDate) {
274
- return false;
275
- }
276
- }
277
- else {
278
- filterValue = from;
279
- }
280
- }
281
- if (to != '') {
282
- if (valueDate != null &&
283
- dom$3.ketchup.dates.isValid(to, defaultFormat, true)) {
284
- checkByRegularExpression = false;
285
- let toDate = dom$3.ketchup.dates.toDate(to, defaultFormat);
286
- if (valueDate > toDate) {
287
- return false;
288
- }
289
- }
290
- else {
291
- filterValue = to;
292
- }
293
- }
294
- if (!dom$3.ketchup.dates.isValid(filterValue, defaultFormat) &&
295
- !dom$3.ketchup.dates.isValid(filterValue)) {
296
- value = dom$3.ketchup.dates.format(value);
297
- }
298
- }
299
- if (checkByRegularExpression) {
300
- return this.isFilterCompliantForValue(value, filterValue);
301
- }
302
- return true;
303
- }
304
- static valuesArrayContainsValue(values, value) {
305
- return Filters.indexOfValueInValuesArray(values, value) >= 0;
306
- }
307
- static indexOfValueInValuesArray(values, value) {
308
- if (values == null || values.length < 1) {
309
- return -1;
310
- }
311
- for (let i = 0; i < values.length; i++) {
312
- if (values[i].value == value) {
313
- return i;
314
- }
315
- }
316
- return -1;
317
- }
318
- }
319
-
320
6
  /**
321
7
  * Filtering algorithms related to column menus.
322
8
  * @module FiltersColumnMenu
@@ -725,6 +411,7 @@ const dom$2 = document.documentElement;
725
411
  const kupObjects = dom$2.ketchup
726
412
  ? dom$2.ketchup.objects
727
413
  : new KupObjects();
414
+ const kupData = dom$2.ketchup ? dom$2.ketchup.data : new KupData();
728
415
  /**
729
416
  * Filtering algorithms related to data-table rows.
730
417
  * @module FiltersRows
@@ -948,27 +635,7 @@ class FiltersRows extends Filters {
948
635
  for (let i = 0; i < checkboxes.length; i++) {
949
636
  values.push(checkboxes[i]);
950
637
  }
951
- this.extractColumnValues(tmpRows, column, values);
952
- values.sort((n1, n2) => {
953
- return compareValues(null, getValueForDisplay2(n1, column), null, getValueForDisplay2(n2, column), SortMode.A);
954
- });
955
- return values;
956
- }
957
- extractColumnValues(rows, column, values) {
958
- /** il valore delle righe attualmente filtrate, formattato */
959
- rows.forEach((row) => this.addColumnValueFromRow(values, column, row.cells[column.name]));
960
- return values;
961
- }
962
- addColumnValueFromRow(values, column, cell) {
963
- if (cell) {
964
- let item = {
965
- value: cell.value,
966
- displayedValue: getCellValueForDisplay(column, cell),
967
- };
968
- if (!Filters.valuesArrayContainsValue(values, cell.value)) {
969
- values.push(item);
970
- }
971
- }
638
+ return kupData.cell.getValue({ rows: tmpRows }, column, true);
972
639
  }
973
640
  }
974
641
 
@@ -1537,8 +1204,9 @@ function calcTotals(rows = [], totals = {}) {
1537
1204
  }
1538
1205
  const keys = Object.keys(totals);
1539
1206
  const footerRow = {};
1207
+ const dateColumns = new Array();
1540
1208
  // if there are only COUNT, no need to loop on rows
1541
- let onlyCount = keys.length === 0 &&
1209
+ let onlyCount = keys.length === 0 ||
1542
1210
  keys.every((key) => totals[key] === TotalMode.COUNT);
1543
1211
  if (onlyCount) {
1544
1212
  keys.forEach((columnName) => (footerRow[columnName] = rows.length));
@@ -1601,35 +1269,40 @@ function calcTotals(rows = [], totals = {}) {
1601
1269
  // TODO DRY the MIN and MAX functions
1602
1270
  }
1603
1271
  else if (dom$1.ketchup.objects.isDate(cell.obj)) {
1604
- const momentValue = cell.obj
1605
- ? dom$1.ketchup.objects.parseDate(cell.obj)
1606
- : dom$1.ketchup.dates.toDayjs(cell.value);
1272
+ if (dateColumns.indexOf(key) == -1) {
1273
+ dateColumns.push(key);
1274
+ }
1275
+ const momentValue = dom$1.ketchup.dates.toDayjs(cell.value);
1607
1276
  if (dom$1.ketchup.dates.isValid(momentValue)) {
1608
1277
  const cellValue = dom$1.ketchup.dates.toDate(momentValue);
1609
- const currentFooterValue = footerRow[key];
1278
+ const currentFooterValue = footerRow[key]
1279
+ ? dom$1.ketchup.dates.toDate(dom$1.ketchup.dates.toDayjs(footerRow[key]))
1280
+ : null;
1610
1281
  switch (true) {
1611
1282
  case totals[key] === TotalMode.MIN:
1612
1283
  if (currentFooterValue) {
1613
1284
  let moments = [];
1614
1285
  moments.push(cellValue);
1615
- moments.push(dom$1.ketchup.dates.format(currentFooterValue));
1286
+ moments.push(currentFooterValue);
1616
1287
  footerRow[key] =
1617
- dom$1.ketchup.dates.format(dom$1.ketchup.dates.min(moments));
1288
+ dom$1.ketchup.dates.format(dom$1.ketchup.dates.min(moments), KupDatesFormats.ISO_DATE);
1618
1289
  }
1619
1290
  else {
1620
- footerRow[key] = cellValue;
1291
+ footerRow[key] =
1292
+ dom$1.ketchup.dates.format(cellValue, KupDatesFormats.ISO_DATE);
1621
1293
  }
1622
1294
  break;
1623
1295
  case totals[key] === TotalMode.MAX:
1624
1296
  if (currentFooterValue) {
1625
1297
  let moments = [];
1626
1298
  moments.push(cellValue);
1627
- moments.push(dom$1.ketchup.dates.format(currentFooterValue));
1299
+ moments.push(currentFooterValue);
1628
1300
  footerRow[key] =
1629
- dom$1.ketchup.dates.format(dom$1.ketchup.dates.max(moments));
1301
+ dom$1.ketchup.dates.format(dom$1.ketchup.dates.max(moments), KupDatesFormats.ISO_DATE);
1630
1302
  }
1631
1303
  else {
1632
- footerRow[key] = cellValue;
1304
+ footerRow[key] =
1305
+ dom$1.ketchup.dates.format(cellValue, KupDatesFormats.ISO_DATE);
1633
1306
  }
1634
1307
  break;
1635
1308
  }
@@ -1644,23 +1317,28 @@ function calcTotals(rows = [], totals = {}) {
1644
1317
  }
1645
1318
  });
1646
1319
  });
1647
- // fixing MATH, AVERAGE and COUNT
1648
- for (let key of keys) {
1649
- switch (true) {
1650
- case totals[key] === TotalMode.AVERAGE:
1651
- const sum = footerRow[key];
1652
- if (sum && rows.length > 0) {
1653
- footerRow[key] = sum / rows.length;
1654
- }
1655
- break;
1656
- case totals[key] === TotalMode.COUNT:
1657
- footerRow[key] = rows.length;
1658
- break;
1659
- case totals[key].indexOf(TotalMode.MATH) == 0:
1660
- footerRow[key] = dom$1.ketchup.math.formulas.custom(totals[key].substring(TotalMode.MATH.length), footerRow);
1661
- break;
1320
+ }
1321
+ // fixing MATH, AVERAGE and COUNT
1322
+ for (let key of keys) {
1323
+ switch (true) {
1324
+ case totals[key] === TotalMode.AVERAGE:
1325
+ const sum = footerRow[key];
1326
+ if (sum && rows.length > 0) {
1327
+ footerRow[key] = sum / rows.length;
1328
+ }
1329
+ break;
1330
+ case totals[key] === TotalMode.COUNT:
1331
+ footerRow[key] = rows.length;
1332
+ break;
1333
+ case totals[key].indexOf(TotalMode.MATH) == 0:
1334
+ footerRow[key] = dom$1.ketchup.math.formulas.custom(totals[key].substring(TotalMode.MATH.length), footerRow);
1335
+ break;
1336
+ }
1337
+ if (footerRow[key]) {
1338
+ if (dateColumns.indexOf(key) != -1) {
1339
+ footerRow[key] = dom$1.ketchup.dates.format(footerRow[key]);
1662
1340
  }
1663
- if (footerRow[key]) {
1341
+ else if (isNumber(footerRow[key])) {
1664
1342
  footerRow[key] = +footerRow[key].toFixed(2);
1665
1343
  }
1666
1344
  }
@@ -1881,4 +1559,4 @@ function rowsPerPageChange(rowsNumber, max) {
1881
1559
  return null;
1882
1560
  }
1883
1561
 
1884
- export { FiltersColumnMenu as F, KupTreeExpansionMode as K, FiltersRows as a, Filters as b, FilterInterval as c, calcTotals as d, FPaginator as e, filterRows as f, groupRows as g, pageChange as h, KupGlobalFilterMode as i, KupTreeProps as j, FPaginatorMode as k, normalizeRows as n, paginateRows as p, rowsPerPageChange as r, sortRows as s, treeMainColumnName as t };
1562
+ export { FiltersColumnMenu as F, KupTreeExpansionMode as K, FiltersRows as a, FPaginator as b, calcTotals as c, pageChange as d, KupTreeProps as e, filterRows as f, groupRows as g, FPaginatorMode as h, normalizeRows as n, paginateRows as p, rowsPerPageChange as r, sortRows as s, treeMainColumnName as t };
@@ -1,5 +1,5 @@
1
- import { h, a as getAssetPath } from './index-ad6ab214.js';
2
- import { K as KupThemeIconValues } from './kup-manager-22a475e6.js';
1
+ import { h, a as getAssetPath } from './index-e41330a5.js';
2
+ import { K as KupThemeIconValues } from './kup-manager-86f440c7.js';
3
3
 
4
4
  /*-------------------------------------------------*/
5
5
  /* C o m p o n e n t */
@@ -56,7 +56,15 @@ function setContent(props) {
56
56
  props.maxLength)) : undefined,
57
57
  !props.trailingIcon ? iconEl : undefined,
58
58
  props.textArea ? (h("span", { class: "mdc-text-field__resizer" },
59
- h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, name: props.name, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth ? props.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
59
+ h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, name: props.name, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth ? props.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onChange: (e) => {
60
+ if (props.decimals !== null &&
61
+ props.inputType === 'number') {
62
+ e.target.value = parseFloat(e.target.value).toFixed(props.decimals);
63
+ }
64
+ if (props.onChange) {
65
+ props.onChange(e);
66
+ }
67
+ }, onClick: props.onClick, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
60
68
  props.isClearable ? (h("span", { class: `mdc-text-field__icon kup-icon ${KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
61
69
  props.trailingIcon ? iconEl : undefined,
62
70
  !props.fullWidth && !isOutlined ? labelEl : undefined,
@@ -16,10 +16,10 @@ const plt = {
16
16
  ce: (eventName, opts) => new CustomEvent(eventName, opts),
17
17
  };
18
18
  const promiseResolve = (v) => Promise.resolve(v);
19
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
19
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
20
20
  try {
21
21
  new CSSStyleSheet();
22
- return typeof new CSSStyleSheet().replace === 'function';
22
+ return typeof new CSSStyleSheet().replaceSync === 'function';
23
23
  }
24
24
  catch (e) { }
25
25
  return false;
@@ -78,9 +78,14 @@ const uniqueTime = (key, measureText) => {
78
78
  const rootAppliedStyles = new WeakMap();
79
79
  const registerStyle = (scopeId, cssText, allowCS) => {
80
80
  let style = styles.get(scopeId);
81
- if (supportsConstructibleStylesheets && allowCS) {
81
+ if (supportsConstructableStylesheets && allowCS) {
82
82
  style = (style || new CSSStyleSheet());
83
- style.replace(cssText);
83
+ if (typeof style === 'string') {
84
+ style = cssText;
85
+ }
86
+ else {
87
+ style.replaceSync(cssText);
88
+ }
84
89
  }
85
90
  else {
86
91
  style = cssText;