@sme.up/ketchup 4.0.0 → 4.1.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.
- package/dist/cjs/{cell-utils-1f89a299.js → cell-utils-841a7769.js} +2 -2
- package/dist/cjs/{f-chip-2d58c8f7.js → f-chip-b9f489ff.js} +7 -5
- package/dist/cjs/{f-image-5f4f29ca.js → f-image-0c3e6aa7.js} +3 -4
- package/dist/cjs/{index-3c471303.js → index-0416afab.js} +73 -64
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +5 -5
- package/dist/cjs/kup-autocomplete_29.cjs.entry.js +1014 -1103
- package/dist/cjs/kup-calendar.cjs.entry.js +8 -8
- package/dist/cjs/kup-dash-list.cjs.entry.js +6 -6
- package/dist/cjs/kup-dash_2.cjs.entry.js +106 -62
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -4
- package/dist/cjs/kup-field.cjs.entry.js +3 -3
- package/dist/cjs/kup-iframe.cjs.entry.js +4 -4
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -4
- package/dist/cjs/kup-magic-box.cjs.entry.js +21 -30
- package/dist/cjs/{kup-manager-59ad8bdc.js → kup-manager-828bd598.js} +599 -519
- package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -4
- package/dist/cjs/{kup-objects-59ea949c.js → kup-objects-89f38d6a.js} +7 -29
- package/dist/cjs/kup-probe.cjs.entry.js +3 -3
- package/dist/cjs/kup-qlik.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-2af73538.js → utils-5192ee20.js} +1 -1
- package/dist/collection/assets/data-table.js +1 -0
- package/dist/collection/collection-manifest.json +2 -3
- package/dist/collection/components/kup-accordion/kup-accordion.js +14 -14
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.css +9 -0
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +20 -23
- package/dist/collection/components/kup-badge/kup-badge.js +12 -12
- package/dist/collection/components/kup-box/kup-box.css +30 -30
- package/dist/collection/components/kup-box/kup-box.js +181 -171
- package/dist/collection/components/kup-button/kup-button.css +8 -5
- package/dist/collection/components/kup-button/kup-button.js +26 -26
- package/dist/collection/components/kup-button-list/kup-button-list.css +8 -5
- package/dist/collection/components/kup-button-list/kup-button-list.js +18 -18
- package/dist/collection/components/kup-calendar/kup-calendar.css +8 -6
- package/dist/collection/components/kup-calendar/kup-calendar.js +30 -30
- package/dist/collection/components/kup-card/kup-card-helper.js +2 -1
- package/dist/collection/components/kup-card/kup-card.css +20 -1
- package/dist/collection/components/kup-card/kup-card.js +26 -26
- package/dist/collection/components/kup-chart/kup-chart.js +40 -40
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +18 -18
- package/dist/collection/components/kup-chip/kup-chip.css +0 -1
- package/dist/collection/components/kup-chip/kup-chip.js +14 -14
- package/dist/collection/components/kup-color-picker/kup-color-picker.css +6 -9
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +32 -40
- package/dist/collection/components/kup-combobox/kup-combobox.css +9 -0
- package/dist/collection/components/kup-combobox/kup-combobox.js +20 -23
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +2 -2
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +1 -0
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +25 -46
- package/dist/collection/components/kup-data-table/kup-data-table.css +83 -87
- package/dist/collection/components/kup-data-table/kup-data-table.js +364 -531
- package/dist/collection/components/kup-date-picker/kup-date-picker.css +2373 -5
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +72 -104
- package/dist/collection/components/kup-drawer/kup-drawer.js +8 -8
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +13 -5
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +38 -43
- package/dist/collection/components/kup-field/kup-field.js +20 -20
- package/dist/collection/components/kup-gauge/kup-gauge.js +16 -16
- package/dist/collection/components/kup-grid/kup-grid.css +2 -1
- package/dist/collection/components/kup-grid/kup-grid.js +12 -12
- package/dist/collection/components/kup-iframe/kup-iframe.js +4 -4
- package/dist/collection/components/kup-image/kup-image.js +24 -24
- package/dist/collection/components/kup-lazy/kup-lazy.js +16 -16
- package/dist/collection/components/kup-list/kup-list-declarations.js +1 -1
- package/dist/collection/components/kup-list/kup-list.css +4 -0
- package/dist/collection/components/kup-list/kup-list.js +38 -47
- package/dist/collection/components/kup-magic-box/kup-magic-box.css +11 -6
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +27 -36
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +10 -10
- package/dist/collection/components/kup-paginator/kup-paginator.css +8 -5
- package/dist/collection/components/kup-probe/kup-probe.js +8 -8
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +20 -20
- package/dist/collection/components/kup-radio/kup-radio.js +16 -16
- package/dist/collection/components/kup-rating/kup-rating.js +14 -14
- package/dist/collection/components/kup-spinner/kup-spinner.js +22 -22
- package/dist/collection/components/kup-switch/kup-switch.js +16 -16
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +12 -12
- package/dist/collection/components/kup-text-field/kup-text-field.js +48 -48
- package/dist/collection/components/kup-time-picker/kup-time-picker.css +2376 -0
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +50 -83
- package/dist/collection/components/kup-tooltip/kup-tooltip.js +18 -12
- package/dist/collection/components/kup-tree/kup-tree.css +10 -10
- package/dist/collection/components/kup-tree/kup-tree.js +96 -66
- package/dist/collection/f-components/f-button/f-button.js +4 -2
- package/dist/collection/f-components/f-image/f-image.js +1 -2
- package/dist/collection/f-components/f-text-field/f-text-field.js +8 -6
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +11 -3
- package/dist/collection/utils/kup-debug/kup-debug.js +25 -27
- package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +3 -5
- package/dist/collection/utils/kup-interact/kup-interact-declarations.js +48 -0
- package/dist/collection/utils/kup-interact/kup-interact.js +362 -0
- package/dist/collection/utils/kup-manager/kup-manager.js +18 -6
- package/dist/collection/utils/kup-objects/kup-objects.js +7 -29
- package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +60 -62
- package/dist/collection/utils/kup-toolbar/kup-toolbar.js +16 -18
- package/dist/esm/{cell-utils-cb612463.js → cell-utils-de384721.js} +2 -2
- package/dist/esm/{f-chip-125d5dd6.js → f-chip-d585b63e.js} +7 -5
- package/dist/esm/{f-image-68b34fab.js → f-image-23548d00.js} +3 -4
- package/dist/esm/{index-bf2824a6.js → index-51694018.js} +73 -64
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +5 -5
- package/dist/esm/kup-autocomplete_29.entry.js +818 -907
- package/dist/esm/kup-calendar.entry.js +8 -8
- package/dist/esm/kup-dash-list.entry.js +6 -6
- package/dist/esm/kup-dash_2.entry.js +106 -62
- package/dist/esm/kup-drawer.entry.js +4 -4
- package/dist/esm/kup-field.entry.js +3 -3
- package/dist/esm/kup-iframe.entry.js +4 -4
- package/dist/esm/kup-lazy.entry.js +4 -4
- package/dist/esm/kup-magic-box.entry.js +21 -30
- package/dist/esm/{kup-manager-e7d7b353.js → kup-manager-583f2815.js} +595 -520
- package/dist/esm/kup-nav-bar.entry.js +4 -4
- package/dist/esm/{kup-objects-d38d2fa2.js → kup-objects-5968aefd.js} +7 -29
- package/dist/esm/kup-probe.entry.js +3 -3
- package/dist/esm/kup-qlik.entry.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-13dd007a.js → utils-a1dd14c3.js} +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-64ea7e37.entry.js → p-0e91c9c9.entry.js} +1 -1
- package/dist/ketchup/{p-0320e24e.entry.js → p-0f2b6a24.entry.js} +1 -1
- package/dist/ketchup/{p-a5424073.js → p-361d9431.js} +1 -1
- package/dist/ketchup/p-565785ce.js +1 -0
- package/dist/ketchup/{p-7896031c.entry.js → p-57eb45ac.entry.js} +1 -1
- package/dist/ketchup/{p-08c7a092.js → p-6f5d8830.js} +1 -1
- package/dist/ketchup/{p-9c858a38.entry.js → p-802d8906.entry.js} +1 -1
- package/dist/ketchup/p-850b9e67.entry.js +1 -0
- package/dist/ketchup/{p-a12a5690.entry.js → p-88a5787a.entry.js} +1 -1
- package/dist/ketchup/p-8ed2b7bf.entry.js +1 -0
- package/dist/ketchup/{p-ee89966f.entry.js → p-90a0c2b7.entry.js} +2 -2
- package/dist/ketchup/{p-876da4c2.entry.js → p-94c0dd8c.entry.js} +1 -1
- package/dist/ketchup/p-9ec3c377.entry.js +45 -0
- package/dist/ketchup/p-b30f34d8.js +1 -0
- package/dist/ketchup/p-b6a47512.entry.js +1 -0
- package/dist/ketchup/p-bfaf8a82.js +1 -0
- package/dist/ketchup/{p-940ab57a.entry.js → p-ca0ebdcc.entry.js} +1 -1
- package/dist/ketchup/p-d5a3a4ed.js +1 -0
- package/dist/ketchup/{p-c7ee1fbc.js → p-ee7b190c.js} +1 -1
- package/dist/ketchup/{p-b0724035.entry.js → p-f6b54fa1.entry.js} +1 -1
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +11 -2
- package/dist/types/components/kup-box/kup-box.d.ts +8 -4
- package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +0 -1
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +12 -4
- package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +0 -2
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +16 -49
- package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +11 -14
- package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +0 -4
- package/dist/types/components/kup-list/kup-list-declarations.d.ts +1 -1
- package/dist/types/components/kup-list/kup-list.d.ts +2 -3
- package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +1 -0
- package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +7 -11
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +4 -4
- package/dist/types/components/kup-tree/kup-tree.d.ts +3 -0
- package/dist/types/components.d.ts +84 -121
- package/dist/types/utils/kup-dynamic-position/kup-dynamic-position.d.ts +2 -2
- package/dist/types/utils/kup-interact/kup-interact-declarations.d.ts +127 -0
- package/dist/types/utils/kup-interact/kup-interact.d.ts +93 -0
- package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +21 -4
- package/dist/types/utils/kup-manager/kup-manager.d.ts +2 -2
- package/dist/types/utils/kup-objects/kup-objects.d.ts +1 -7
- package/package.json +3 -3
- package/dist/cjs/drag-and-drop-4787ff6f.js +0 -281
- package/dist/cjs/kup-grid.cjs.entry.js +0 -130
- package/dist/collection/assets/images/drag-multiple.js +0 -1
- package/dist/collection/components/kup-layout/kup-layout.css +0 -53
- package/dist/collection/components/kup-layout/kup-layout.js +0 -156
- package/dist/collection/utils/drag-and-drop.js +0 -109
- package/dist/collection/utils/kup-dialog/kup-dialog-declarations.js +0 -36
- package/dist/collection/utils/kup-dialog/kup-dialog.js +0 -310
- package/dist/esm/drag-and-drop-321cb4ca.js +0 -265
- package/dist/esm/kup-grid.entry.js +0 -126
- package/dist/ketchup/p-00fe1e3e.js +0 -1
- package/dist/ketchup/p-1165f4ea.entry.js +0 -1
- package/dist/ketchup/p-170d3cba.js +0 -1
- package/dist/ketchup/p-18cb3ba3.js +0 -1
- package/dist/ketchup/p-23541a97.entry.js +0 -45
- package/dist/ketchup/p-8fb9d9b2.entry.js +0 -1
- package/dist/ketchup/p-b14e77f0.js +0 -1
- package/dist/ketchup/p-d24cfdea.entry.js +0 -1
- package/dist/ketchup/p-fcd2fd8f.js +0 -1
- package/dist/ketchup/p-fce3b9d8.entry.js +0 -1
- package/dist/types/assets/images/drag-multiple.d.ts +0 -1
- package/dist/types/components/kup-layout/kup-layout.d.ts +0 -25
- package/dist/types/utils/drag-and-drop.d.ts +0 -53
- package/dist/types/utils/kup-dialog/kup-dialog-declarations.d.ts +0 -43
- package/dist/types/utils/kup-dialog/kup-dialog.d.ts +0 -50
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Component, Element, Event, forceUpdate, h, Host, Method, Prop, State, } from '@stencil/core';
|
|
2
2
|
import Picker from 'vanilla-picker';
|
|
3
3
|
import { kupManagerInstance, } from '../../utils/kup-manager/kup-manager';
|
|
4
|
-
import { kupDynamicPositionAttribute, } from '../../utils/kup-dynamic-position/kup-dynamic-position-declarations';
|
|
5
4
|
import { KupColorPickerProps, } from './kup-color-picker-declarations';
|
|
6
5
|
import { KupLanguageGeneric } from '../../utils/kup-language/kup-language-declarations';
|
|
7
6
|
import { getProps, setProps } from '../../utils/utils';
|
|
@@ -163,32 +162,29 @@ export class KupColorPicker {
|
|
|
163
162
|
componentDidLoad() {
|
|
164
163
|
const root = this.rootElement.shadowRoot;
|
|
165
164
|
if (root) {
|
|
165
|
+
const that = this;
|
|
166
166
|
this.picker = new Picker({
|
|
167
167
|
alpha: false,
|
|
168
168
|
color: this.value,
|
|
169
169
|
parent: this.anchorEl,
|
|
170
170
|
});
|
|
171
|
-
this.picker['kupColorPicker'] = this;
|
|
172
171
|
this.picker['onClose'] = function (color) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
id: colorPicker.rootElement.id,
|
|
179
|
-
value: colorPicker.value,
|
|
172
|
+
that.setValue(color.hex.substr(0, 7));
|
|
173
|
+
that.kupChange.emit({
|
|
174
|
+
comp: that,
|
|
175
|
+
id: that.rootElement.id,
|
|
176
|
+
value: that.value,
|
|
180
177
|
});
|
|
181
178
|
};
|
|
182
179
|
this.picker['onOpen'] = function () {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
180
|
+
that.rootElement.style.setProperty('--kup_colorpicker_picker_width', that.textfieldEl.clientWidth + 'px');
|
|
181
|
+
that.kupManager.utilities.pointerDownCallbacks.add({
|
|
182
|
+
cb: () => {
|
|
183
|
+
that.picker.closeHandler(null);
|
|
184
|
+
},
|
|
185
|
+
onlyOnce: true,
|
|
186
|
+
el: that.picker['domElement'],
|
|
187
|
+
});
|
|
192
188
|
};
|
|
193
189
|
}
|
|
194
190
|
this.kupManager.debug.logLoad(this, true);
|
|
@@ -230,10 +226,6 @@ export class KupColorPicker {
|
|
|
230
226
|
disconnectedCallback() {
|
|
231
227
|
this.kupManager.language.unregister(this);
|
|
232
228
|
this.kupManager.theme.unregister(this);
|
|
233
|
-
const dynamicPositionElements = this.rootElement.shadowRoot.querySelectorAll('[' + kupDynamicPositionAttribute + ']');
|
|
234
|
-
if (dynamicPositionElements.length > 0) {
|
|
235
|
-
this.kupManager.dynamicPosition.unregister(Array.prototype.slice.call(dynamicPositionElements));
|
|
236
|
-
}
|
|
237
229
|
}
|
|
238
230
|
static get is() { return "kup-color-picker"; }
|
|
239
231
|
static get encapsulation() { return "shadow"; }
|
|
@@ -256,11 +248,11 @@ export class KupColorPicker {
|
|
|
256
248
|
"optional": false,
|
|
257
249
|
"docs": {
|
|
258
250
|
"tags": [{
|
|
259
|
-
"
|
|
260
|
-
"
|
|
251
|
+
"name": "default",
|
|
252
|
+
"text": "\"\""
|
|
261
253
|
}, {
|
|
262
|
-
"
|
|
263
|
-
"
|
|
254
|
+
"name": "see",
|
|
255
|
+
"text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
|
|
264
256
|
}],
|
|
265
257
|
"text": "Custom style of the component."
|
|
266
258
|
},
|
|
@@ -284,8 +276,8 @@ export class KupColorPicker {
|
|
|
284
276
|
"optional": false,
|
|
285
277
|
"docs": {
|
|
286
278
|
"tags": [{
|
|
287
|
-
"
|
|
288
|
-
"
|
|
279
|
+
"name": "default",
|
|
280
|
+
"text": "null"
|
|
289
281
|
}],
|
|
290
282
|
"text": "Props of the text field."
|
|
291
283
|
},
|
|
@@ -303,8 +295,8 @@ export class KupColorPicker {
|
|
|
303
295
|
"optional": false,
|
|
304
296
|
"docs": {
|
|
305
297
|
"tags": [{
|
|
306
|
-
"
|
|
307
|
-
"
|
|
298
|
+
"name": "default",
|
|
299
|
+
"text": "false"
|
|
308
300
|
}],
|
|
309
301
|
"text": "Defaults at false. When set to true, the component is disabled."
|
|
310
302
|
},
|
|
@@ -324,8 +316,8 @@ export class KupColorPicker {
|
|
|
324
316
|
"optional": false,
|
|
325
317
|
"docs": {
|
|
326
318
|
"tags": [{
|
|
327
|
-
"
|
|
328
|
-
"
|
|
319
|
+
"name": "default",
|
|
320
|
+
"text": "\"\""
|
|
329
321
|
}],
|
|
330
322
|
"text": "Sets the initial value of the component. Can be css color name, hex code or rgb code (sample: \"red\" or rgb(255, 0, 0) or \"#FF0000\" )."
|
|
331
323
|
},
|
|
@@ -345,8 +337,8 @@ export class KupColorPicker {
|
|
|
345
337
|
"optional": false,
|
|
346
338
|
"docs": {
|
|
347
339
|
"tags": [{
|
|
348
|
-
"
|
|
349
|
-
"
|
|
340
|
+
"name": "default",
|
|
341
|
+
"text": "false"
|
|
350
342
|
}],
|
|
351
343
|
"text": "When true, the component's text field will be replaced by a swatch."
|
|
352
344
|
},
|
|
@@ -385,8 +377,8 @@ export class KupColorPicker {
|
|
|
385
377
|
"signature": "(descriptions?: boolean) => Promise<GenericObject>",
|
|
386
378
|
"parameters": [{
|
|
387
379
|
"tags": [{
|
|
388
|
-
"
|
|
389
|
-
"
|
|
380
|
+
"name": "param",
|
|
381
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
390
382
|
}],
|
|
391
383
|
"text": "- When provided and true, the result will be the list of props with their description."
|
|
392
384
|
}],
|
|
@@ -452,8 +444,8 @@ export class KupColorPicker {
|
|
|
452
444
|
"signature": "(props: GenericObject) => Promise<void>",
|
|
453
445
|
"parameters": [{
|
|
454
446
|
"tags": [{
|
|
455
|
-
"
|
|
456
|
-
"
|
|
447
|
+
"name": "param",
|
|
448
|
+
"text": "props - Object containing props that will be set to the component."
|
|
457
449
|
}],
|
|
458
450
|
"text": "- Object containing props that will be set to the component."
|
|
459
451
|
}],
|
|
@@ -481,8 +473,8 @@ export class KupColorPicker {
|
|
|
481
473
|
"signature": "(value: string) => Promise<void>",
|
|
482
474
|
"parameters": [{
|
|
483
475
|
"tags": [{
|
|
484
|
-
"
|
|
485
|
-
"
|
|
476
|
+
"name": "param",
|
|
477
|
+
"text": "value - Value to be set."
|
|
486
478
|
}],
|
|
487
479
|
"text": "- Value to be set."
|
|
488
480
|
}],
|
|
@@ -2397,6 +2397,15 @@
|
|
|
2397
2397
|
mask: var(--kup-dropdown-icon);
|
|
2398
2398
|
}
|
|
2399
2399
|
|
|
2400
|
+
.f-text-field--wrapper {
|
|
2401
|
+
position: relative;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
kup-list {
|
|
2405
|
+
position: absolute;
|
|
2406
|
+
z-index: 1;
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2400
2409
|
/*-------------------------------------------------*/
|
|
2401
2410
|
/* C o m p o n e n t C l a s s e s */
|
|
2402
2411
|
/*-------------------------------------------------*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Component, Event, Element, forceUpdate, h, Host, Listen, Method, Prop, State, } from '@stencil/core';
|
|
2
|
-
import { kupDynamicPositionAttribute, } from '../../utils/kup-dynamic-position/kup-dynamic-position-declarations';
|
|
3
2
|
import { kupManagerInstance, } from '../../utils/kup-manager/kup-manager';
|
|
4
3
|
import { ItemsDisplayMode } from '../kup-list/kup-list-declarations';
|
|
5
4
|
import { consistencyCheck } from '../kup-list/kup-list-helper';
|
|
@@ -62,7 +61,6 @@ export class KupCombobox {
|
|
|
62
61
|
this.textfieldEl = undefined;
|
|
63
62
|
}
|
|
64
63
|
onKupBlur() {
|
|
65
|
-
this.closeList();
|
|
66
64
|
this.kupBlur.emit({
|
|
67
65
|
comp: this,
|
|
68
66
|
id: this.rootElement.id,
|
|
@@ -236,15 +234,20 @@ export class KupCombobox {
|
|
|
236
234
|
openList() {
|
|
237
235
|
this.textfieldWrapper.classList.add('toggled');
|
|
238
236
|
this.listEl.menuVisible = true;
|
|
239
|
-
this.kupManager.dynamicPosition.start(this.listEl);
|
|
240
237
|
let elStyle = this.listEl.style;
|
|
241
238
|
elStyle.height = 'auto';
|
|
242
239
|
elStyle.minWidth = this.textfieldWrapper.clientWidth + 'px';
|
|
240
|
+
this.kupManager.utilities.pointerDownCallbacks.add({
|
|
241
|
+
cb: () => {
|
|
242
|
+
this.closeList();
|
|
243
|
+
},
|
|
244
|
+
onlyOnce: true,
|
|
245
|
+
el: this.listEl,
|
|
246
|
+
});
|
|
243
247
|
}
|
|
244
248
|
closeList() {
|
|
245
249
|
this.textfieldWrapper.classList.remove('toggled');
|
|
246
250
|
this.listEl.menuVisible = false;
|
|
247
|
-
this.kupManager.dynamicPosition.stop(this.listEl);
|
|
248
251
|
}
|
|
249
252
|
isListOpened() {
|
|
250
253
|
return this.listEl.menuVisible == true;
|
|
@@ -255,7 +258,7 @@ export class KupCombobox {
|
|
|
255
258
|
this.displayedValue = ret.displayedValue;
|
|
256
259
|
}
|
|
257
260
|
prepList() {
|
|
258
|
-
return (h("kup-list", Object.assign({}, this.data['kup-list'], { displayMode: this.displayMode, "is-menu": true, "onkup-list-click": (e) => this.onKupItemClick(e), ref: (el) => (this.listEl = el)
|
|
261
|
+
return (h("kup-list", Object.assign({}, this.data['kup-list'], { displayMode: this.displayMode, "is-menu": true, "onkup-list-click": (e) => this.onKupItemClick(e), ref: (el) => (this.listEl = el) })));
|
|
259
262
|
}
|
|
260
263
|
/*-------------------------------------------------*/
|
|
261
264
|
/* L i f e c y c l e H o o k s */
|
|
@@ -286,7 +289,6 @@ export class KupCombobox {
|
|
|
286
289
|
this.textfieldWrapper = f;
|
|
287
290
|
this.textfieldEl = f.querySelector('input');
|
|
288
291
|
FTextFieldMDC(f);
|
|
289
|
-
this.kupManager.dynamicPosition.register(this.listEl, this.textfieldWrapper);
|
|
290
292
|
}
|
|
291
293
|
}
|
|
292
294
|
this.kupManager.debug.logRender(this, true);
|
|
@@ -295,18 +297,13 @@ export class KupCombobox {
|
|
|
295
297
|
const fullHeight = this.rootElement.classList.contains('kup-full-height');
|
|
296
298
|
const fullWidth = this.rootElement.classList.contains('kup-full-width');
|
|
297
299
|
const customStyle = this.kupManager.theme.setCustomStyle(this.rootElement);
|
|
298
|
-
return (h(Host, { class: `${fullHeight ? 'kup-full-height' : ''} ${fullWidth ? 'kup-full-width' : ''}`,
|
|
300
|
+
return (h(Host, { class: `${fullHeight ? 'kup-full-height' : ''} ${fullWidth ? 'kup-full-width' : ''}`, style: this.elStyle },
|
|
299
301
|
customStyle ? h("style", null, customStyle) : null,
|
|
300
302
|
h("div", { id: componentWrapperId, style: this.elStyle },
|
|
301
|
-
h(FTextField, Object.assign({}, this.data['kup-text-field'], { disabled: this.disabled, fullHeight: fullHeight, fullWidth: fullWidth, icon: KupThemeIconValues.DROPDOWN, readOnly: this.isSelect, trailingIcon: true, value: this.displayedValue, onChange: (e) => this.onKupChange(e), onClick: (e) => this.onKupClick(e), onFocus: (e) => this.onKupFocus(e), onInput: (e) => this.onKupInput(e), onIconClick: (e) => this.onKupIconClick(e) }))
|
|
302
|
-
this.prepList())));
|
|
303
|
+
h(FTextField, Object.assign({}, this.data['kup-text-field'], { disabled: this.disabled, fullHeight: fullHeight, fullWidth: fullWidth, icon: KupThemeIconValues.DROPDOWN, readOnly: this.isSelect, trailingIcon: true, value: this.displayedValue, onBlur: () => this.onKupBlur(), onChange: (e) => this.onKupChange(e), onClick: (e) => this.onKupClick(e), onFocus: (e) => this.onKupFocus(e), onInput: (e) => this.onKupInput(e), onIconClick: (e) => this.onKupIconClick(e) }), this.prepList()))));
|
|
303
304
|
}
|
|
304
305
|
disconnectedCallback() {
|
|
305
306
|
this.kupManager.theme.unregister(this);
|
|
306
|
-
const dynamicPositionElements = this.rootElement.shadowRoot.querySelectorAll('[' + kupDynamicPositionAttribute + ']');
|
|
307
|
-
if (dynamicPositionElements.length > 0) {
|
|
308
|
-
this.kupManager.dynamicPosition.unregister(Array.prototype.slice.call(dynamicPositionElements));
|
|
309
|
-
}
|
|
310
307
|
}
|
|
311
308
|
static get is() { return "kup-combobox"; }
|
|
312
309
|
static get encapsulation() { return "shadow"; }
|
|
@@ -329,11 +326,11 @@ export class KupCombobox {
|
|
|
329
326
|
"optional": false,
|
|
330
327
|
"docs": {
|
|
331
328
|
"tags": [{
|
|
332
|
-
"
|
|
333
|
-
"
|
|
329
|
+
"name": "default",
|
|
330
|
+
"text": "\"\""
|
|
334
331
|
}, {
|
|
335
|
-
"
|
|
336
|
-
"
|
|
332
|
+
"name": "see",
|
|
333
|
+
"text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
|
|
337
334
|
}],
|
|
338
335
|
"text": "Custom style of the component."
|
|
339
336
|
},
|
|
@@ -613,8 +610,8 @@ export class KupCombobox {
|
|
|
613
610
|
"signature": "(descriptions?: boolean) => Promise<GenericObject>",
|
|
614
611
|
"parameters": [{
|
|
615
612
|
"tags": [{
|
|
616
|
-
"
|
|
617
|
-
"
|
|
613
|
+
"name": "param",
|
|
614
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
618
615
|
}],
|
|
619
616
|
"text": "- When provided and true, the result will be the list of props with their description."
|
|
620
617
|
}],
|
|
@@ -696,8 +693,8 @@ export class KupCombobox {
|
|
|
696
693
|
"signature": "(props: GenericObject) => Promise<void>",
|
|
697
694
|
"parameters": [{
|
|
698
695
|
"tags": [{
|
|
699
|
-
"
|
|
700
|
-
"
|
|
696
|
+
"name": "param",
|
|
697
|
+
"text": "props - Object containing props that will be set to the component."
|
|
701
698
|
}],
|
|
702
699
|
"text": "- Object containing props that will be set to the component."
|
|
703
700
|
}],
|
|
@@ -725,8 +722,8 @@ export class KupCombobox {
|
|
|
725
722
|
"signature": "(value: string) => Promise<void>",
|
|
726
723
|
"parameters": [{
|
|
727
724
|
"tags": [{
|
|
728
|
-
"
|
|
729
|
-
"
|
|
725
|
+
"name": "param",
|
|
726
|
+
"text": "value - Value to be set."
|
|
730
727
|
}],
|
|
731
728
|
"text": "- Value to be set."
|
|
732
729
|
}],
|
|
@@ -82,7 +82,7 @@ export class KupDashList {
|
|
|
82
82
|
else {
|
|
83
83
|
valueDec = h("div", { slot: "value-dec" });
|
|
84
84
|
}
|
|
85
|
-
const row = (h("kup-dash", { layout: this.layout, fontsize: this.fontsize, index: count, active: this.active },
|
|
85
|
+
const row = (h("kup-dash", { layout: this.layout, fontsize: this.fontsize, index: count, active: this.active, slot: String(count) },
|
|
86
86
|
icon,
|
|
87
87
|
unit,
|
|
88
88
|
descr,
|
|
@@ -94,7 +94,7 @@ export class KupDashList {
|
|
|
94
94
|
});
|
|
95
95
|
return (h("div", null,
|
|
96
96
|
h("link", { href: "https://cdn.materialdesignicons.com/4.5.95/css/materialdesignicons.min.css", rel: "stylesheet", type: "text/css" }),
|
|
97
|
-
h("kup-
|
|
97
|
+
h("kup-grid", { columns: this.columnsNumber, singleLine: this.horizontal, class: `${this.fullWidth ? 'kup-full-width' : ''}` }, rows)));
|
|
98
98
|
}
|
|
99
99
|
static get is() { return "kup-dash-list"; }
|
|
100
100
|
static get encapsulation() { return "shadow"; }
|
|
@@ -33,6 +33,7 @@ export var KupDataTableProps;
|
|
|
33
33
|
KupDataTableProps["pageSelected"] = "Current selected page set on component load";
|
|
34
34
|
KupDataTableProps["paginatorPos"] = "Sets the position of the paginator. Available positions: top, bottom or both.";
|
|
35
35
|
KupDataTableProps["removableColumns"] = "Sets the possibility to remove the selected column.";
|
|
36
|
+
KupDataTableProps["resizableColumns"] = "Gives the possibility to resize columns by dragging on their right edge.";
|
|
36
37
|
KupDataTableProps["rowActions"] = "Sets the actions of the rows.";
|
|
37
38
|
KupDataTableProps["rowsPerPage"] = "Sets the number of rows per page to display.";
|
|
38
39
|
KupDataTableProps["scrollOnHover"] = "Activates the scroll on hover function.";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import numeral from 'numeral';
|
|
2
|
-
import { SortMode, TotalMode,
|
|
2
|
+
import { SortMode, TotalMode, } from './kup-data-table-declarations';
|
|
3
3
|
import { isEmpty, stringToNumber } from '../../utils/utils';
|
|
4
|
-
import { setDragDropPayload } from '../../utils/drag-and-drop';
|
|
5
4
|
import { getCellValueForDisplay, getColumnByName, compareCell, } from '../../utils/cell-utils';
|
|
6
5
|
import { FiltersRows } from '../../utils/filters/filters-rows';
|
|
7
6
|
import { kupManagerInstance } from '../../utils/kup-manager/kup-manager';
|
|
@@ -93,9 +92,15 @@ function getSortOnColumn(column = '', sort = []) {
|
|
|
93
92
|
function compareRows(r1, r2, sortObj) {
|
|
94
93
|
const cell1 = r1.cells[sortObj.column];
|
|
95
94
|
const cell2 = r2.cells[sortObj.column];
|
|
96
|
-
if (!cell1
|
|
95
|
+
if (!cell1 && !cell2) {
|
|
97
96
|
return 0;
|
|
98
97
|
}
|
|
98
|
+
if (!cell1) {
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
if (!cell2) {
|
|
102
|
+
return -1;
|
|
103
|
+
}
|
|
99
104
|
return compareCell(cell1, cell2, sortObj.sortMode);
|
|
100
105
|
}
|
|
101
106
|
//-------- FILTER FUNCTIONS --------
|
|
@@ -566,14 +571,16 @@ export function normalizeRows(columns, rows) {
|
|
|
566
571
|
const normalizedrows = Object.assign(rows);
|
|
567
572
|
rows.forEach((row) => {
|
|
568
573
|
columns.forEach((column) => {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
574
|
+
if (row.cells) {
|
|
575
|
+
const cell = row.cells[column.name];
|
|
576
|
+
if (cell && column.obj && !cell.obj) {
|
|
577
|
+
// cell.obj = Object.assign(column.obj);
|
|
578
|
+
cell.obj = {
|
|
579
|
+
t: column.obj.t,
|
|
580
|
+
p: column.obj.p,
|
|
581
|
+
k: cell.value,
|
|
582
|
+
};
|
|
583
|
+
}
|
|
577
584
|
}
|
|
578
585
|
});
|
|
579
586
|
});
|
|
@@ -597,7 +604,7 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
597
604
|
}
|
|
598
605
|
else {
|
|
599
606
|
let distinctObj = {};
|
|
600
|
-
rows.forEach((r) => {
|
|
607
|
+
rows.forEach((r, index, array) => {
|
|
601
608
|
keys.filter((key) => TotalMode.COUNT !== totals[key] &&
|
|
602
609
|
totals[key].indexOf(TotalMode.MATH) != 0).forEach((key) => {
|
|
603
610
|
// getting cell
|
|
@@ -620,11 +627,6 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
620
627
|
else {
|
|
621
628
|
// update the list
|
|
622
629
|
distinctList.push(cellValue);
|
|
623
|
-
if (distinctList.length === rows.length) {
|
|
624
|
-
// last round
|
|
625
|
-
footerRow[key] = new Set(distinctList).size;
|
|
626
|
-
distinctObj[key] = [];
|
|
627
|
-
}
|
|
628
630
|
}
|
|
629
631
|
}
|
|
630
632
|
else if (kupObjects.isNumber(cell.obj)) {
|
|
@@ -693,6 +695,12 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
693
695
|
}
|
|
694
696
|
}
|
|
695
697
|
}
|
|
698
|
+
if (index === array.length - 1 &&
|
|
699
|
+
totals[key] === TotalMode.DISTINCT) {
|
|
700
|
+
// last round
|
|
701
|
+
footerRow[key] = new Set(distinctObj[key]).size;
|
|
702
|
+
distinctObj[key] = [];
|
|
703
|
+
}
|
|
696
704
|
});
|
|
697
705
|
});
|
|
698
706
|
// fixing MATH, AVERAGE and COUNT
|
|
@@ -832,32 +840,3 @@ export function styleHasWritingMode(cell) {
|
|
|
832
840
|
cell.style &&
|
|
833
841
|
(cell.style.writingMode || cell.style['writing-mode']));
|
|
834
842
|
}
|
|
835
|
-
export const dropHandlersCell = {
|
|
836
|
-
onDragLeave: (e) => {
|
|
837
|
-
// console.log('onDragLeave', e);
|
|
838
|
-
if (e.dataTransfer.types.indexOf(KupDataTableRowDragType) >= 0) {
|
|
839
|
-
e.target
|
|
840
|
-
.closest('tr')
|
|
841
|
-
.classList.remove('selected');
|
|
842
|
-
}
|
|
843
|
-
},
|
|
844
|
-
onDragOver: (e) => {
|
|
845
|
-
// console.log('onDragOver', e);
|
|
846
|
-
if (e.dataTransfer.types.indexOf(KupDataTableRowDragType) >= 0) {
|
|
847
|
-
let overElement = e.target;
|
|
848
|
-
if (overElement.tagName !== 'TD') {
|
|
849
|
-
overElement = overElement.closest('td');
|
|
850
|
-
}
|
|
851
|
-
overElement = overElement.closest('tr');
|
|
852
|
-
overElement.classList.add('selected');
|
|
853
|
-
// TODO do it without using the element but with data like id, etc.
|
|
854
|
-
setDragDropPayload({
|
|
855
|
-
overElement,
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
return true;
|
|
859
|
-
},
|
|
860
|
-
onDrop: (_e) => {
|
|
861
|
-
return KupDataTableRowDragType;
|
|
862
|
-
},
|
|
863
|
-
};
|