@sme.up/ketchup 6.2.0 → 6.4.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 (183) hide show
  1. package/dist/cjs/{f-button-5b69d882.js → f-button-826a470e.js} +4 -4
  2. package/dist/cjs/{f-cell-3a740c48.js → f-cell-2d5bcf0c.js} +13 -15
  3. package/dist/cjs/{f-checkbox-57443ca3.js → f-checkbox-cd977193.js} +1 -1
  4. package/dist/cjs/{f-chip-02e83f82.js → f-chip-2fd3363e.js} +3 -3
  5. package/dist/cjs/{f-image-2a61ece2.js → f-image-0f17d599.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-09126bdd.js → f-paginator-utils-946b579d.js} +80 -403
  7. package/dist/cjs/{f-text-field-9ee20a67.js → f-text-field-d243e4d8.js} +13 -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 +129 -115
  12. package/dist/cjs/kup-box.cjs.entry.js +20 -20
  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 +42 -34
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +140 -64
  21. package/dist/cjs/kup-form.cjs.entry.js +21 -15
  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 +5 -6
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +5 -6
  26. package/dist/cjs/{kup-manager-02acbb37.js → kup-manager-a8eecc60.js} +1419 -375
  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/form.js +41 -0
  37. package/dist/collection/assets/index.js +4 -0
  38. package/dist/collection/assets/kupinteract.js +68 -0
  39. package/dist/collection/collection-manifest.json +5 -5
  40. package/dist/collection/components/kup-box/kup-box.js +5 -3
  41. package/dist/collection/components/kup-button/kup-button-declarations.js +1 -0
  42. package/dist/collection/components/kup-button/kup-button.js +27 -0
  43. package/dist/collection/components/kup-dashboard/kup-dashboard.css +7 -0
  44. package/dist/collection/components/kup-dashboard/kup-dashboard.js +67 -7
  45. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
  46. package/dist/collection/components/kup-data-table/kup-data-table.js +3 -1
  47. package/dist/collection/components/kup-echart/kup-echart.js +34 -24
  48. package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +3 -1
  49. package/dist/collection/components/kup-family-tree/kup-family-tree.css +79 -9
  50. package/dist/collection/components/kup-family-tree/kup-family-tree.js +253 -65
  51. package/dist/collection/components/kup-form/kup-form-declarations.js +1 -0
  52. package/dist/collection/components/kup-form/kup-form.css +8 -0
  53. package/dist/collection/components/kup-form/kup-form.js +31 -2
  54. package/dist/collection/components/kup-image/assets/svg/azure.svg +1 -0
  55. package/dist/collection/components/kup-lazy/kup-lazy.css +8 -2
  56. package/dist/collection/components/kup-progress-bar/kup-progress-bar.css +1 -0
  57. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
  58. package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
  59. package/dist/collection/f-components/f-button/f-button.js +2 -2
  60. package/dist/collection/f-components/f-cell/f-cell.js +1 -1
  61. package/dist/collection/f-components/f-text-field/f-text-field.js +11 -1
  62. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +49 -15
  63. package/dist/collection/managers/kup-data/kup-data.js +9 -11
  64. package/dist/collection/managers/kup-dates/kup-dates.js +14 -0
  65. package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
  66. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +2 -0
  67. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +131 -45
  68. package/dist/collection/utils/filters/filters-rows.js +4 -23
  69. package/dist/collection/utils/filters/filters-tree-items.js +4 -3
  70. package/dist/esm/{f-button-fd44ef70.js → f-button-2d0a5f21.js} +4 -4
  71. package/dist/esm/{f-cell-7b159a22.js → f-cell-ee7d7b5c.js} +7 -9
  72. package/dist/esm/{f-checkbox-c51c4a75.js → f-checkbox-e06cf07b.js} +1 -1
  73. package/dist/esm/{f-chip-c2e4c522.js → f-chip-0d29f91f.js} +3 -3
  74. package/dist/esm/{f-image-2ab4b9aa.js → f-image-ab131d59.js} +2 -2
  75. package/dist/esm/{f-paginator-utils-ef537d82.js → f-paginator-utils-aa52af0f.js} +44 -366
  76. package/dist/esm/{f-text-field-41c575eb.js → f-text-field-0729b19f.js} +13 -3
  77. package/dist/esm/{index-ad6ab214.js → index-e41330a5.js} +9 -4
  78. package/dist/esm/ketchup.js +3 -3
  79. package/dist/esm/kup-accordion.entry.js +3 -4
  80. package/dist/esm/kup-autocomplete_25.entry.js +30 -16
  81. package/dist/esm/kup-box.entry.js +14 -14
  82. package/dist/esm/kup-calendar.entry.js +5 -7
  83. package/dist/esm/kup-cell.entry.js +7 -9
  84. package/dist/esm/kup-dash-list.entry.js +2 -4
  85. package/dist/esm/kup-dash_2.entry.js +2 -3
  86. package/dist/esm/kup-dashboard.entry.js +74 -15
  87. package/dist/esm/kup-drawer.entry.js +2 -3
  88. package/dist/esm/kup-echart.entry.js +36 -28
  89. package/dist/esm/kup-family-tree.entry.js +138 -62
  90. package/dist/esm/kup-form.entry.js +18 -12
  91. package/dist/esm/kup-iframe.entry.js +2 -3
  92. package/dist/esm/kup-image-list.entry.js +8 -10
  93. package/dist/esm/kup-lazy.entry.js +3 -4
  94. package/dist/esm/kup-magic-box.entry.js +3 -4
  95. package/dist/esm/{kup-manager-22a475e6.js → kup-manager-13b4f989.js} +1398 -376
  96. package/dist/esm/kup-nav-bar.entry.js +2 -3
  97. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  98. package/dist/esm/kup-photo-frame.entry.js +2 -3
  99. package/dist/esm/kup-probe.entry.js +2 -2
  100. package/dist/esm/kup-qlik.entry.js +2 -2
  101. package/dist/esm/kup-snackbar.entry.js +4 -5
  102. package/dist/esm/loader.js +3 -3
  103. package/dist/ketchup/assets/svg/azure.svg +1 -0
  104. package/dist/ketchup/ketchup.esm.js +1 -1
  105. package/dist/ketchup/p-0986ad5d.js +1 -0
  106. package/dist/ketchup/{p-38d7584e.js → p-0cf10db0.js} +1 -1
  107. package/dist/ketchup/p-13666119.entry.js +27 -0
  108. package/dist/ketchup/p-18b68e86.entry.js +1 -0
  109. package/dist/ketchup/{p-1959f835.entry.js → p-28d514d0.entry.js} +1 -1
  110. package/dist/ketchup/p-2ffdbee1.entry.js +1 -0
  111. package/dist/ketchup/p-3dcfffbe.entry.js +1 -0
  112. package/dist/ketchup/p-3fe35411.entry.js +1 -0
  113. package/dist/ketchup/{p-cd5cfa7c.js → p-5552f156.js} +1 -1
  114. package/dist/ketchup/p-5f51009b.entry.js +1 -0
  115. package/dist/ketchup/{p-264b1b19.entry.js → p-816f0938.entry.js} +1 -1
  116. package/dist/ketchup/p-83c214d7.entry.js +1 -0
  117. package/dist/ketchup/p-84957bbf.entry.js +1 -0
  118. package/dist/ketchup/p-86795579.entry.js +1 -0
  119. package/dist/ketchup/p-8f85b8bb.entry.js +9 -0
  120. package/dist/ketchup/p-982d3e3a.entry.js +1 -0
  121. package/dist/ketchup/{p-e9366aaf.entry.js → p-adcfcd4f.entry.js} +4 -4
  122. package/dist/ketchup/p-b0b3989b.js +2 -0
  123. package/dist/ketchup/{p-dc62a30f.js → p-b705be3b.js} +1 -1
  124. package/dist/ketchup/{p-fc2b1229.js → p-b8c921ee.js} +3 -3
  125. package/dist/ketchup/{p-edae3076.js → p-bfe88b03.js} +1 -1
  126. package/dist/ketchup/p-d7091875.entry.js +1 -0
  127. package/dist/ketchup/p-d8656956.entry.js +1 -0
  128. package/dist/ketchup/p-dc69549c.entry.js +1 -0
  129. package/dist/ketchup/p-e01fa411.entry.js +1 -0
  130. package/dist/ketchup/p-e0f659c9.entry.js +1 -0
  131. package/dist/ketchup/p-e1d82570.entry.js +1 -0
  132. package/dist/ketchup/p-e21c744a.js +1 -0
  133. package/dist/ketchup/p-e5a9d60a.entry.js +1 -0
  134. package/dist/ketchup/p-f50cbed9.js +1 -0
  135. package/dist/ketchup/{p-42080355.entry.js → p-fa9f161a.entry.js} +1 -1
  136. package/dist/types/components/kup-box/kup-box-declarations.d.ts +1 -0
  137. package/dist/types/components/kup-button/kup-button-declarations.d.ts +1 -0
  138. package/dist/types/components/kup-button/kup-button.d.ts +5 -0
  139. package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +6 -1
  140. package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +7 -3
  141. package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +26 -5
  142. package/dist/types/components/kup-form/kup-form-declarations.d.ts +1 -0
  143. package/dist/types/components/kup-form/kup-form.d.ts +5 -0
  144. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
  145. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  146. package/dist/types/components.d.ts +69 -7
  147. package/dist/types/f-components/f-button/f-button-declarations.d.ts +1 -0
  148. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  149. package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
  150. package/dist/types/managers/kup-data/kup-data.d.ts +3 -1
  151. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +9 -1
  152. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +7 -5
  153. package/dist/types/utils/filters/filters-rows.d.ts +0 -2
  154. package/dist/types/utils/filters/filters-tree-items.d.ts +1 -1
  155. package/package.json +2 -2
  156. package/dist/cjs/cell-utils-fe64a28c.js +0 -168
  157. package/dist/cjs/utils-4b208b48.js +0 -447
  158. package/dist/esm/cell-utils-cb5d4149.js +0 -160
  159. package/dist/esm/utils-2c1f4122.js +0 -428
  160. package/dist/ketchup/p-06c6cc68.js +0 -1
  161. package/dist/ketchup/p-0dacd4bc.entry.js +0 -1
  162. package/dist/ketchup/p-1c44dc62.entry.js +0 -1
  163. package/dist/ketchup/p-4bc9f98b.entry.js +0 -1
  164. package/dist/ketchup/p-578583db.entry.js +0 -1
  165. package/dist/ketchup/p-5866d507.entry.js +0 -1
  166. package/dist/ketchup/p-61059e9d.entry.js +0 -9
  167. package/dist/ketchup/p-664be494.entry.js +0 -1
  168. package/dist/ketchup/p-67cd575d.entry.js +0 -1
  169. package/dist/ketchup/p-682a367a.js +0 -1
  170. package/dist/ketchup/p-6ccf7eb2.entry.js +0 -1
  171. package/dist/ketchup/p-7230ab97.entry.js +0 -1
  172. package/dist/ketchup/p-752b4cef.entry.js +0 -1
  173. package/dist/ketchup/p-7de3e7ac.entry.js +0 -1
  174. package/dist/ketchup/p-928c5c36.js +0 -1
  175. package/dist/ketchup/p-9b36497d.entry.js +0 -1
  176. package/dist/ketchup/p-b982d137.entry.js +0 -1
  177. package/dist/ketchup/p-c0219e5e.js +0 -1
  178. package/dist/ketchup/p-c55fd0a7.entry.js +0 -1
  179. package/dist/ketchup/p-d154b3a0.entry.js +0 -1
  180. package/dist/ketchup/p-d2affb6f.entry.js +0 -27
  181. package/dist/ketchup/p-d3b542b3.js +0 -2
  182. package/dist/ketchup/p-d6c12c6c.js +0 -1
  183. package/dist/ketchup/p-da0eab60.entry.js +0 -1
@@ -1,447 +0,0 @@
1
- 'use strict';
2
-
3
- const kupManager = require('./kup-manager-02acbb37.js');
4
-
5
- const dom = document.documentElement;
6
- exports.DateTimeFormatOptionsMonth = void 0;
7
- (function (DateTimeFormatOptionsMonth) {
8
- DateTimeFormatOptionsMonth["NUMERIC"] = "numeric";
9
- DateTimeFormatOptionsMonth["DIGIT2"] = "2-digit";
10
- DateTimeFormatOptionsMonth["LONG"] = "long";
11
- DateTimeFormatOptionsMonth["SHORT"] = "short";
12
- DateTimeFormatOptionsMonth["NARROW"] = "narrow";
13
- })(exports.DateTimeFormatOptionsMonth || (exports.DateTimeFormatOptionsMonth = {}));
14
- function identify(array) {
15
- if (array) {
16
- for (let i = 0; i < array.length; i++) {
17
- array[i].id = i.toString();
18
- }
19
- }
20
- }
21
- function getSeparator(locale, separatorType) {
22
- const numberWithGroupAndDecimalSeparator = 1000.1;
23
- return Intl.NumberFormat(locale)
24
- .formatToParts(numberWithGroupAndDecimalSeparator)
25
- .find((part) => part.type === separatorType).value;
26
- }
27
- function getCurrentTimeFormatFromBrowserLocale(manageSeconds) {
28
- const options = {
29
- hour: '2-digit',
30
- minute: '2-digit',
31
- hour12: false,
32
- };
33
- if (manageSeconds == true) {
34
- options.second = '2-digit';
35
- }
36
- const formatObj = new Intl.DateTimeFormat(dom.ketchup.dates.getLocale() + '-u-hc-h23', options).formatToParts(new Date());
37
- let timeFormat = formatObj
38
- .map((obj) => {
39
- switch (obj.type) {
40
- case 'hour':
41
- return 'HH';
42
- case 'minute':
43
- return 'mm';
44
- case 'second':
45
- return 'ss';
46
- default:
47
- return obj.value;
48
- }
49
- })
50
- .join('');
51
- return timeFormat;
52
- }
53
- /**
54
- * @param value number as string, formatted by actual browser locale
55
- * @param type - type of number for calculate suffix
56
- * @returns true if number string in input is a valid number
57
- */
58
- function isValidFormattedStringNumber(value, type) {
59
- if (value == null || value.trim() == '') {
60
- return false;
61
- }
62
- let tmpStr = formattedStringToUnformattedStringNumber(value, type);
63
- if (isNumber(tmpStr)) {
64
- return true;
65
- }
66
- return false;
67
- }
68
- function isNumber(value) {
69
- //return typeof value === 'number';
70
- return !isNaN(value);
71
- }
72
- /**
73
- * @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
74
- * @returns number
75
- **/
76
- function stringToNumber(input) {
77
- if (!input || input == null || input.trim() == '') {
78
- input = '0';
79
- }
80
- return dom.ketchup.math.numberify(input);
81
- }
82
- /**
83
- * @param input number
84
- * @param decimals number of significant decimal digits for output
85
- * @returns number as string, formatted by actual browser locale
86
- **/
87
- function numberToString(input, decimals) {
88
- if (input == null) {
89
- return '';
90
- }
91
- return _numberToString(input, decimals, dom.ketchup.dates.getLocale(), true);
92
- }
93
- /**
94
- * @param type - type of number for calculate suffix
95
- * @returns suffix for number, by type
96
- **/
97
- function getNumericValueSuffixByType(type) {
98
- type = type.toUpperCase();
99
- let nstr = '';
100
- if (type == 'P') {
101
- nstr = ' %';
102
- }
103
- else if (type == 'VE') {
104
- nstr = ' €';
105
- }
106
- else if (type == 'VL') {
107
- nstr = ' £';
108
- }
109
- else if (type == 'VV') {
110
- nstr = ' $';
111
- }
112
- return nstr;
113
- }
114
- /**
115
- * @param input number
116
- * @param decimals number of significant decimal digits for output
117
- * @param type - type of number for calculate suffix
118
- * @returns number as string, formatted by actual browser locale, with suffix by type
119
- **/
120
- function numberToFormattedStringNumber(input, decimals, type) {
121
- if (input == null || isNaN(input)) {
122
- return '';
123
- }
124
- let nstr = numberToString(input, decimals);
125
- nstr = nstr + getNumericValueSuffixByType(type);
126
- return nstr;
127
- }
128
- /**
129
- * @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers)
130
- * @param decimals number of significant decimal digits for output
131
- * @param type - type of number for calculate suffix
132
- * @returns number as string, formatted by actual browser locale, with suffix by type
133
- **/
134
- function unformattedStringToFormattedStringNumber(input, decimals, type) {
135
- return numberToFormattedStringNumber(stringToNumber(input), decimals, type);
136
- }
137
- /**
138
- * @param input number as string, formatted by actual browser locale
139
- * @param type - type of number for calculate suffix
140
- * @returns number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
141
- **/
142
- function formattedStringToUnformattedStringNumber(input, type) {
143
- return numberStringToNumberString(input, type, getDecimalSeparator(dom.ketchup.dates.getLocale()));
144
- }
145
- /**
146
- * @param input number as string, formatted by locale US, decimal separator . (like java decimal numbers), with group separator
147
- * @param type - type of number for calculate suffix
148
- * @returns number as string, formatted by locale US, decimal separator . (like java decimal numbers), without group separator
149
- **/
150
- function unformattedStringNumberToNumber(input, type) {
151
- return numberStringToNumberString(input, type, '.');
152
- }
153
- function numberStringToNumberString(input, type, decFmt) {
154
- if (input == null || input.trim() == '') {
155
- return '';
156
- }
157
- let originalInputValue = input;
158
- let suffix = getNumericValueSuffixByType(type);
159
- if (suffix != '') {
160
- input = input.replace(suffix, '');
161
- }
162
- let regExpr = null;
163
- if (decFmt == '.') {
164
- regExpr = /,/g;
165
- }
166
- else {
167
- regExpr = /\./g;
168
- }
169
- input = input.replace(regExpr, '');
170
- if (decFmt != '.') {
171
- input = input.replace(/,/g, '.');
172
- }
173
- if (dom.ketchup.math.numberify(input) == null ||
174
- isNaN(dom.ketchup.math.numberify(input))) {
175
- return originalInputValue;
176
- }
177
- let unf = stringToNumber(input);
178
- return _numberToString(unf, -1, 'en-US', false);
179
- }
180
- function getDecimalSeparator(locale) {
181
- return getSeparator(locale, 'decimal');
182
- }
183
- function countDecimals(value) {
184
- if (Math.floor(value) === value)
185
- return 0;
186
- let stringValue = value.toString().split('.')[1];
187
- if (stringValue) {
188
- return stringValue.length ? stringValue.length : 0;
189
- }
190
- else {
191
- return 0;
192
- }
193
- }
194
- function _numberToString(input, decimals, locale, useGrouping) {
195
- if (input == null) {
196
- input = 0;
197
- }
198
- if (decimals == null || decimals == -1) {
199
- decimals = countDecimals(input);
200
- }
201
- let n = Number(input);
202
- let f = decimals > -1
203
- ? {
204
- minimumFractionDigits: decimals,
205
- maximumFractionDigits: decimals,
206
- useGrouping: useGrouping,
207
- }
208
- : { useGrouping: useGrouping };
209
- return n.toLocaleString(locale, f);
210
- }
211
- /**
212
- * @param time time as Date object
213
- * @param manageSeconds flag to set seconds managing
214
- * @return time as string, formatted
215
- **/
216
- function formatTime(time, manageSeconds) {
217
- const options = {
218
- hour: '2-digit',
219
- minute: '2-digit',
220
- hour12: false,
221
- };
222
- if (manageSeconds == true) {
223
- options.second = '2-digit';
224
- }
225
- return time.toLocaleTimeString(dom.ketchup.dates.getLocale() + '-u-hc-h23', options);
226
- }
227
- /**
228
- * @param value time string, formatted by actual browser locale
229
- * @returns true if time string in input is a valid time
230
- */
231
- function isValidFormattedStringTime(value, manageSeconds) {
232
- let format = getCurrentTimeFormatFromBrowserLocale(manageSeconds);
233
- return dom.ketchup.dates.isValid(value, format, true);
234
- }
235
- /**
236
- * @param value date/time as string, formatted by actual browser locale
237
- * @returns date/time as string, formatted ISO
238
- **/
239
- function formattedStringToDefaultUnformattedStringTimestamp(value) {
240
- return formattedStringToCustomUnformattedStringTime(value, kupManager.KupDatesFormats.ISO_DATE_TIME, true);
241
- }
242
- /**
243
- * @param value time as string, formatted by actual browser locale
244
- * @param outputFormat time format to return
245
- * @param manageSeconds flag to set seconds managing
246
- * @returns time as string, formatted
247
- **/
248
- function formattedStringToCustomUnformattedStringTime(value, outputFormat, manageSeconds) {
249
- let inputFormat = getCurrentTimeFormatFromBrowserLocale(manageSeconds);
250
- if (dom.ketchup.dates.isValid(value, inputFormat)) {
251
- return dom.ketchup.dates.format(dom.ketchup.dates.normalize(value, kupManager.KupDatesNormalize.TIME), outputFormat);
252
- }
253
- else {
254
- return '';
255
- }
256
- }
257
- /**
258
- * @param value time as string, formatted ISO
259
- * @param manageSeconds flag to set seconds managing
260
- * @param valueTimeFormat time format (default ISO)
261
- * @param customedFormat time format from smeupObject
262
- * @returns time as string, formatted by actual browser locale
263
- **/
264
- function unformattedStringToFormattedStringTime(value, manageSeconds, customedFormat) {
265
- const options = {
266
- hour: '2-digit',
267
- minute: '2-digit',
268
- hour12: false,
269
- };
270
- if (manageSeconds == true) {
271
- options.second = '2-digit';
272
- }
273
- let date = dom.ketchup.dates.toDate(dom.ketchup.dates.normalize(value, kupManager.KupDatesNormalize.TIME));
274
- return formatByCustomedOutputTimeFormat(value, date, options, customedFormat);
275
- }
276
- function formatByCustomedOutputTimeFormat(valueStr, date, options, customedFormat) {
277
- if (customedFormat == null) {
278
- return date.toLocaleTimeString(dom.ketchup.dates.getLocale() + '-u-hc-h23', options);
279
- }
280
- switch (customedFormat) {
281
- case 'I13': {
282
- //hh:mm
283
- break;
284
- }
285
- case 'I12': {
286
- //hh:mm:ss
287
- break;
288
- }
289
- case 'I11': {
290
- //???
291
- //hh:dddd
292
- //return moment(date).format('HH:DDDD');
293
- return valueStr;
294
- }
295
- case 'I14': {
296
- //???
297
- //sssss
298
- //return moment(date).format('SSSSS');
299
- return valueStr;
300
- }
301
- case 'I1H': {
302
- //???
303
- //Ora,Cen/Min HH,xx
304
- return valueStr;
305
- }
306
- case 'I1M': {
307
- //???
308
- //Min,Cen/Sec MMMM,xx
309
- return valueStr;
310
- }
311
- case 'I21': {
312
- //???
313
- //Giorni,(4 decim)
314
- return valueStr;
315
- }
316
- case 'I22': {
317
- //???
318
- //Ore,(4 decim)
319
- return valueStr;
320
- }
321
- case 'I23': {
322
- //???
323
- //Minuti,(4 decim)
324
- return valueStr;
325
- }
326
- case 'I24': {
327
- //???
328
- //Secondi
329
- return valueStr;
330
- }
331
- case 'I2H': {
332
- //???
333
- //Ora,Cen/Min HHHH,xx
334
- return valueStr;
335
- }
336
- case 'I2D': {
337
- //???
338
- //Ore Minuti Secondi HHMMS
339
- return valueStr;
340
- }
341
- case 'I2M': {
342
- //???
343
- //Min,Cen/Sec MMMM,xx
344
- return valueStr;
345
- }
346
- }
347
- return date.toLocaleTimeString(dom.ketchup.dates.getLocale() + '-u-hc-h23', options);
348
- }
349
- /**
350
- * @param value date/time as string, formatted ISO
351
- * @param valueDateFormat date/time format (default ISO)
352
- * @returns date/time as string, formatted by actual browser locale
353
- **/
354
- function unformattedStringToFormattedStringTimestamp(value) {
355
- const options = {
356
- day: '2-digit',
357
- month: '2-digit',
358
- year: 'numeric',
359
- hour: '2-digit',
360
- minute: '2-digit',
361
- second: '2-digit',
362
- hour12: false,
363
- };
364
- let date = dom.ketchup.dates.toDate(dom.ketchup.dates.normalize(value, kupManager.KupDatesNormalize.TIMESTAMP));
365
- return date.toLocaleString(dom.ketchup.dates.getLocale() + '-u-hc-h23', options);
366
- }
367
- function getMonthAsStringByLocale(month, format) {
368
- if (month == null) {
369
- return '';
370
- }
371
- const dateTmp = new Date();
372
- dateTmp.setDate(1);
373
- dateTmp.setMonth(month - 1);
374
- const options = {
375
- month: format,
376
- };
377
- const dateTimeFormat = new Intl.DateTimeFormat(dom.ketchup.dates.getLocale(), options);
378
- return dateTimeFormat.format(dateTmp);
379
- }
380
- function getMonthsAsStringByLocale(format) {
381
- if (format == null || format.trim() == '') {
382
- format = exports.DateTimeFormatOptionsMonth.LONG;
383
- }
384
- var months = [];
385
- for (var i = 0; i < 12; i++) {
386
- months[i] = getMonthAsStringByLocale(i + 1, format);
387
- }
388
- return months;
389
- }
390
- /**
391
- * Used to retrieve component's props values.
392
- * @param {any} comp - Component calling this function.
393
- * @param {GenericObject} list - Prop list, specific for each component.
394
- * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
395
- * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
396
- */
397
- function getProps(comp, list, descriptions) {
398
- let props = {};
399
- if (descriptions) {
400
- props = list;
401
- }
402
- else {
403
- for (const key in list) {
404
- if (Object.prototype.hasOwnProperty.call(list, key)) {
405
- props[key] = comp[key];
406
- }
407
- }
408
- }
409
- return props;
410
- }
411
- /**
412
- * Sets the props to the component.
413
- * @param {any} comp - Component calling this function.
414
- * @param {GenericObject} list - Prop list, specific for each component.
415
- * @param {GenericObject} props - Prop to be set.
416
- */
417
- function setProps(comp, list, props) {
418
- for (const key in props) {
419
- // If key is a custom prop it will be set on the component (i.e.: "data", "customStyle", ecc.)
420
- if (list[key]) {
421
- comp[key] = props[key];
422
- }
423
- else {
424
- // Otherwise, it will be set on its HTML element (i.e.: "id", "style", ecc.)
425
- comp.rootElement[key] = props[key];
426
- }
427
- }
428
- }
429
-
430
- exports.formatTime = formatTime;
431
- exports.formattedStringToCustomUnformattedStringTime = formattedStringToCustomUnformattedStringTime;
432
- exports.formattedStringToDefaultUnformattedStringTimestamp = formattedStringToDefaultUnformattedStringTimestamp;
433
- exports.formattedStringToUnformattedStringNumber = formattedStringToUnformattedStringNumber;
434
- exports.getDecimalSeparator = getDecimalSeparator;
435
- exports.getMonthsAsStringByLocale = getMonthsAsStringByLocale;
436
- exports.getProps = getProps;
437
- exports.identify = identify;
438
- exports.isNumber = isNumber;
439
- exports.isValidFormattedStringNumber = isValidFormattedStringNumber;
440
- exports.isValidFormattedStringTime = isValidFormattedStringTime;
441
- exports.numberToFormattedStringNumber = numberToFormattedStringNumber;
442
- exports.setProps = setProps;
443
- exports.stringToNumber = stringToNumber;
444
- exports.unformattedStringNumberToNumber = unformattedStringNumberToNumber;
445
- exports.unformattedStringToFormattedStringNumber = unformattedStringToFormattedStringNumber;
446
- exports.unformattedStringToFormattedStringTime = unformattedStringToFormattedStringTime;
447
- exports.unformattedStringToFormattedStringTimestamp = unformattedStringToFormattedStringTimestamp;
@@ -1,160 +0,0 @@
1
- import { u as unformattedStringToFormattedStringNumber, d as unformattedStringToFormattedStringTime, e as unformattedStringToFormattedStringTimestamp, h as stringToNumber } from './utils-2c1f4122.js';
2
- import { d as KupDatesFormats } from './kup-manager-22a475e6.js';
3
-
4
- const dom = document.documentElement;
5
- // -------------
6
- // COMMONS
7
- // -------------
8
- function getCellValueForDisplay(column, cell) {
9
- if (cell != null) {
10
- if (cell.displayedValue != null) {
11
- return cell.displayedValue;
12
- }
13
- }
14
- let formattedValue = _getCellValueForDisplay(cell.value, column, cell);
15
- if (cell != null) {
16
- cell.displayedValue = formattedValue;
17
- }
18
- return formattedValue;
19
- }
20
- function getValueForDisplay2(values, column) {
21
- if (values == null) {
22
- return '';
23
- }
24
- if (values.displayedValue == null || values.displayedValue.trim() == '') {
25
- values.displayedValue = _getCellValueForDisplay(values.value, column, null);
26
- }
27
- return values.displayedValue;
28
- }
29
- function formatToNumber(cell) {
30
- if (cell.obj) {
31
- return dom.ketchup.math.numberify(cell.obj.k);
32
- }
33
- return dom.ketchup.math.numberify(cell.value);
34
- }
35
- function _getCellValueForDisplay(value, column, cell) {
36
- let obj = column != null ? column.obj : null;
37
- if (cell != null) {
38
- obj = cell.obj ? cell.obj : obj;
39
- }
40
- return getValueForDisplay(value, obj, column != null ? column.decimals : null);
41
- }
42
- function getValueForDisplay(value, obj, decimals) {
43
- if (value == null || value.trim() == '') {
44
- return value;
45
- }
46
- if (dom.ketchup.objects.isNumber(obj)) {
47
- return unformattedStringToFormattedStringNumber(value, decimals ? decimals : -1, obj ? obj.p : '');
48
- }
49
- if (dom.ketchup.objects.isDate(obj) &&
50
- dom.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE)) {
51
- return dom.ketchup.dates.format(value);
52
- }
53
- if (dom.ketchup.objects.isTime(obj)) {
54
- return unformattedStringToFormattedStringTime(value, dom.ketchup.objects.isTimeWithSeconds(obj), obj.t + obj.p);
55
- }
56
- if (dom.ketchup.objects.isTimestamp(obj)) {
57
- return unformattedStringToFormattedStringTimestamp(value);
58
- }
59
- return value;
60
- }
61
- function getColumnByName(columns, name) {
62
- if (columns == null) {
63
- return null;
64
- }
65
- for (let column of columns) {
66
- if (column.name === name) {
67
- return column;
68
- }
69
- }
70
- return null;
71
- }
72
- function compareCell(cell1, cell2, sortMode) {
73
- return compareValues(cell1.obj, cell1.value, cell2.obj, cell2.value, sortMode);
74
- }
75
- function compareValues(obj1, value1, obj2, value2, sortMode) {
76
- const sm = sortMode === 'A' ? 1 : -1;
77
- if (obj1 == null || obj2 == null) {
78
- return sm * localCompareAsInJava(value1, value2);
79
- }
80
- // If either the type or the parameter of the current object are not equal.
81
- if (!(obj1.t === obj2.t && obj1.p === obj2.p)) {
82
- let compare = localCompareAsInJava(obj1.t, obj2.t);
83
- if (compare === 0) {
84
- compare = localCompareAsInJava(obj1.p, obj2.p);
85
- }
86
- return compare * sm;
87
- }
88
- let s1 = value1;
89
- let s2 = value2;
90
- if (s1 == s2) {
91
- return 0;
92
- }
93
- if (s1 == '') {
94
- return sm * -1;
95
- }
96
- if (s2 == '') {
97
- return sm * 1;
98
- }
99
- let v1 = s1;
100
- let v2 = s2;
101
- if (dom.ketchup.objects.isNumber(obj1)) {
102
- v1 = stringToNumber(s1);
103
- v2 = stringToNumber(s2);
104
- }
105
- else if (dom.ketchup.objects.isDate(obj1)) {
106
- v1 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s1, KupDatesFormats.ISO_DATE));
107
- v2 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s2, KupDatesFormats.ISO_DATE));
108
- }
109
- else if (dom.ketchup.objects.isTime(obj1)) {
110
- let manageSeconds = dom.ketchup.objects.isTimeWithSeconds(obj1);
111
- v1 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s1, manageSeconds
112
- ? KupDatesFormats.ISO_TIME
113
- : KupDatesFormats.ISO_TIME_WITHOUT_SECONDS));
114
- v2 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s2, manageSeconds
115
- ? KupDatesFormats.ISO_TIME
116
- : KupDatesFormats.ISO_TIME_WITHOUT_SECONDS));
117
- }
118
- else if (dom.ketchup.objects.isTimestamp(obj1)) {
119
- v1 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s1, KupDatesFormats.ISO_DATE_TIME));
120
- v2 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s2, KupDatesFormats.ISO_DATE_TIME));
121
- }
122
- if (v1 > v2) {
123
- return sm * 1;
124
- }
125
- if (v1 < v2) {
126
- return sm * -1;
127
- }
128
- return 0;
129
- }
130
- /**
131
- * Given two strings to compare, the functions decides which string comes before the other or if they are equal.
132
- * This is meant as a replacement for the JavaScript function localCompare() which produces a slightly different result from
133
- * the Java version of compareTo().
134
- *
135
- * Re-implemented from java source method compareTo() of java.lang.String
136
- * @param t1 firstString the first string to be compared
137
- * @param t2 anotherString the another string to be compared to the first one
138
- * @returns the value 0 if the anotherString is equal to
139
- * firstString; a value less than 0 if firstString
140
- * is lexicographically less than the anotherString; and a
141
- * value greater than 0 if firstString is
142
- * lexicographically greater than the anotherString.
143
- */
144
- function localCompareAsInJava(t1, t2) {
145
- let t1Length = t1 == null ? 0 : t1.length;
146
- let t2Length = t2 == null ? 0 : t2.length;
147
- const lim = Math.min(t1Length, t2Length);
148
- let k = 0;
149
- while (k < lim) {
150
- const c1 = t1[k];
151
- const c2 = t2[k];
152
- if (c1 !== c2) {
153
- return c1.charCodeAt(0) - c2.charCodeAt(0);
154
- }
155
- k++;
156
- }
157
- return t1Length - t2Length;
158
- }
159
-
160
- export { getValueForDisplay2 as a, getValueForDisplay as b, getCellValueForDisplay as c, compareValues as d, compareCell as e, formatToNumber as f, getColumnByName as g };