@sme.up/ketchup 4.0.0 → 4.2.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/README.md +3 -3
- package/dist/cjs/cell-utils-dc0884a3.js +168 -0
- package/dist/cjs/f-button-2ba74fb5.js +105 -0
- package/dist/cjs/f-cell-fe60a08d.js +731 -0
- package/dist/cjs/f-chip-90d95d22.js +141 -0
- package/dist/cjs/{f-image-5f4f29ca.js → f-image-d3bd4e08.js} +4 -5
- 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 +6 -8
- package/dist/cjs/{kup-autocomplete_29.cjs.entry.js → kup-autocomplete_28.cjs.entry.js} +2580 -3060
- package/dist/cjs/kup-calendar.cjs.entry.js +30 -30
- package/dist/cjs/kup-cell.cjs.entry.js +201 -0
- package/dist/cjs/kup-dash-list.cjs.entry.js +15 -7
- package/dist/cjs/kup-dash_2.cjs.entry.js +104 -62
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -6
- package/dist/cjs/kup-field.cjs.entry.js +3 -5
- package/dist/cjs/kup-iframe.cjs.entry.js +3 -4
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -6
- package/dist/cjs/kup-magic-box.cjs.entry.js +21 -31
- package/dist/cjs/kup-manager-1a2688ca.js +5813 -0
- package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -6
- package/dist/cjs/kup-probe.cjs.entry.js +3 -4
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -3
- package/dist/cjs/kup-snackbar.cjs.entry.js +152 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-2af73538.js → utils-0cc466b9.js} +17 -83
- package/dist/collection/assets/cell.js +51 -0
- package/dist/collection/assets/data-table.js +518 -1
- package/dist/collection/assets/index.js +8 -0
- package/dist/collection/assets/snackbar.js +32 -0
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/kup-accordion/kup-accordion.css +0 -213
- package/dist/collection/components/kup-accordion/kup-accordion.js +15 -16
- package/dist/collection/components/kup-autocomplete/kup-autocomplete-declarations.js +2 -2
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.css +5 -2381
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +83 -111
- package/dist/collection/components/kup-badge/kup-badge.css +1 -35
- package/dist/collection/components/kup-badge/kup-badge.js +13 -14
- package/dist/collection/components/kup-box/kup-box.css +47 -780
- package/dist/collection/components/kup-box/kup-box.js +240 -366
- package/dist/collection/components/kup-button/kup-button.css +0 -333
- package/dist/collection/components/kup-button/kup-button.js +27 -28
- package/dist/collection/components/kup-button-list/kup-button-list.css +0 -332
- package/dist/collection/components/kup-button-list/kup-button-list.js +19 -20
- package/dist/collection/components/kup-calendar/kup-calendar.css +0 -517
- package/dist/collection/components/kup-calendar/kup-calendar.js +47 -45
- package/dist/collection/components/kup-card/builtin/kup-card-builtin.js +20 -0
- package/dist/collection/components/kup-card/builtin/kup-card-calendar.js +458 -0
- package/dist/collection/components/kup-card/builtin/kup-card-clock.js +321 -0
- package/dist/collection/components/kup-card/dialog/kup-card-dialog.js +18 -0
- package/dist/collection/components/kup-card/free/kup-card-free.js +13 -0
- package/dist/collection/components/kup-card/kup-card-declarations.js +19 -0
- package/dist/collection/components/kup-card/kup-card-helper.js +19 -1
- package/dist/collection/components/kup-card/kup-card.css +615 -185
- package/dist/collection/components/kup-card/kup-card.js +94 -34
- package/dist/collection/components/kup-card/standard/kup-card-standard.js +75 -0
- package/dist/collection/components/kup-cell/kup-cell-declarations.js +11 -0
- package/dist/collection/components/kup-cell/kup-cell.css +20 -0
- package/dist/collection/components/kup-cell/kup-cell.js +413 -0
- package/dist/collection/components/kup-chart/kup-chart.js +41 -42
- package/dist/collection/components/kup-checkbox/kup-checkbox.css +0 -214
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +19 -20
- package/dist/collection/components/kup-chip/kup-chip.css +0 -217
- package/dist/collection/components/kup-chip/kup-chip.js +15 -16
- package/dist/collection/components/kup-color-picker/kup-color-picker.css +7 -2380
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +41 -41
- package/dist/collection/components/kup-combobox/kup-combobox-declarations.js +1 -0
- package/dist/collection/components/kup-combobox/kup-combobox.css +5 -2381
- package/dist/collection/components/kup-combobox/kup-combobox.js +68 -28
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +13 -4
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +2 -0
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +61 -102
- package/dist/collection/components/kup-data-table/kup-data-table.css +118 -3232
- package/dist/collection/components/kup-data-table/kup-data-table.js +589 -1089
- package/dist/collection/components/kup-date-picker/kup-date-picker.css +1 -85
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +92 -395
- package/dist/collection/components/kup-drawer/kup-drawer.js +9 -10
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +12 -340
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +56 -45
- package/dist/collection/components/kup-field/kup-field.js +21 -22
- package/dist/collection/components/kup-gauge/kup-gauge.js +17 -18
- package/dist/collection/components/kup-grid/kup-grid.css +2 -1
- package/dist/collection/components/kup-grid/kup-grid.js +13 -14
- package/dist/collection/components/kup-iframe/kup-iframe.js +4 -4
- package/dist/collection/components/kup-image/assets/svg/ketchup.svg +74 -0
- package/dist/collection/components/kup-image/assets/svg/smeup.svg +59 -0
- package/dist/collection/components/kup-image/kup-image.css +0 -32
- package/dist/collection/components/kup-image/kup-image.js +25 -26
- package/dist/collection/components/kup-lazy/kup-lazy.js +17 -18
- package/dist/collection/components/kup-list/kup-list-declarations.js +1 -1
- package/dist/collection/components/kup-list/kup-list.css +4 -260
- package/dist/collection/components/kup-list/kup-list.js +39 -49
- package/dist/collection/components/kup-magic-box/kup-magic-box.css +13 -39
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +29 -38
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +11 -12
- package/dist/collection/components/kup-paginator/kup-paginator.css +0 -332
- package/dist/collection/components/kup-paginator/kup-paginator.js +44 -12
- package/dist/collection/components/kup-probe/kup-probe.js +9 -9
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +21 -22
- package/dist/collection/components/kup-radio/kup-radio.js +17 -18
- package/dist/collection/components/kup-rating/kup-rating.js +15 -16
- package/dist/collection/components/kup-snackbar/kup-snackbar-declarations.js +13 -0
- package/dist/collection/components/kup-snackbar/kup-snackbar.css +75 -0
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +390 -0
- package/dist/collection/components/kup-spinner/kup-spinner.js +23 -24
- package/dist/collection/components/kup-switch/kup-switch.css +0 -156
- package/dist/collection/components/kup-switch/kup-switch.js +17 -18
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.css +0 -199
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +13 -14
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
- package/dist/collection/components/kup-text-field/kup-text-field.css +4 -2371
- package/dist/collection/components/kup-text-field/kup-text-field.js +77 -51
- package/dist/collection/components/kup-time-picker/kup-time-picker.css +7 -0
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +97 -317
- package/dist/collection/components/kup-tooltip/kup-tooltip.js +24 -14
- package/dist/collection/components/kup-tree/kup-tree.css +27 -371
- package/dist/collection/components/kup-tree/kup-tree.js +163 -383
- package/dist/collection/f-components/f-button/f-button.js +4 -2
- package/dist/collection/f-components/f-cell/f-cell-declarations.js +143 -0
- package/dist/collection/f-components/f-cell/f-cell.js +471 -0
- package/dist/collection/f-components/f-checkbox/f-checkbox.js +1 -1
- package/dist/collection/f-components/f-chip/f-chip.js +2 -2
- package/dist/collection/f-components/f-image/f-image.js +2 -3
- package/dist/collection/f-components/f-switch/f-switch.js +1 -1
- package/dist/collection/f-components/f-text-field/f-text-field-mdc.js +1 -1
- package/dist/collection/f-components/f-text-field/f-text-field.js +25 -21
- package/dist/collection/utils/cell-utils.js +18 -222
- package/dist/collection/utils/filters/filters.js +31 -37
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +15 -3
- package/dist/collection/utils/kup-dates/kup-dates.js +14 -2
- package/dist/collection/utils/kup-debug/kup-debug-browser-utils.js +3 -3
- package/dist/collection/utils/kup-debug/kup-debug.js +57 -29
- package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +5 -7
- package/dist/collection/utils/kup-interact/kup-interact-declarations.js +48 -0
- package/dist/collection/utils/kup-interact/kup-interact.js +379 -0
- package/dist/collection/utils/kup-language/kup-language-declarations.js +2 -0
- package/dist/collection/utils/kup-language/kup-language.js +1 -1
- package/dist/collection/utils/kup-manager/kup-manager.js +47 -10
- package/dist/collection/utils/kup-objects/kup-objects.js +9 -33
- package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +60 -62
- package/dist/collection/utils/kup-search/kup-search-declarations.js +1 -0
- package/dist/collection/utils/kup-search/kup-search.js +75 -0
- package/dist/collection/utils/kup-theme/kup-theme-declarations.js +1 -0
- package/dist/collection/utils/kup-theme/kup-theme.js +4 -3
- package/dist/collection/utils/kup-toolbar/kup-toolbar.js +16 -18
- package/dist/collection/utils/utils.js +15 -23
- package/dist/esm/cell-utils-8f512ea9.js +160 -0
- package/dist/esm/f-button-30dbcaa9.js +103 -0
- package/dist/esm/f-cell-95c186c6.js +727 -0
- package/dist/esm/f-chip-c0e9c0ff.js +139 -0
- package/dist/esm/{f-image-68b34fab.js → f-image-3bc8b24f.js} +4 -5
- package/dist/esm/{index-bf2824a6.js → index-e0e67c23.js} +74 -65
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +6 -8
- package/dist/esm/{kup-autocomplete_29.entry.js → kup-autocomplete_28.entry.js} +2379 -2858
- package/dist/esm/kup-calendar.entry.js +10 -10
- package/dist/esm/kup-cell.entry.js +197 -0
- package/dist/esm/kup-dash-list.entry.js +15 -7
- package/dist/esm/kup-dash_2.entry.js +104 -62
- package/dist/esm/kup-drawer.entry.js +4 -6
- package/dist/esm/kup-field.entry.js +3 -5
- package/dist/esm/kup-iframe.entry.js +3 -4
- package/dist/esm/kup-lazy.entry.js +4 -6
- package/dist/esm/kup-magic-box.entry.js +21 -31
- package/dist/esm/kup-manager-7fc234da.js +5800 -0
- package/dist/esm/kup-nav-bar.entry.js +4 -6
- package/dist/esm/kup-probe.entry.js +3 -4
- package/dist/esm/kup-qlik.entry.js +2 -3
- package/dist/esm/kup-snackbar.entry.js +148 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-13dd007a.js → utils-6c73709d.js} +15 -78
- package/dist/ketchup/assets/svg/ketchup.svg +74 -0
- package/dist/ketchup/assets/svg/smeup.svg +59 -0
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-15321eae.js +1 -0
- package/dist/ketchup/p-1baf1205.entry.js +1 -0
- package/dist/ketchup/p-1c6178e4.entry.js +1 -0
- package/dist/ketchup/p-44375e49.js +1 -0
- package/dist/ketchup/p-4dcdbd31.entry.js +45 -0
- package/dist/ketchup/p-5a5f2a53.js +1 -0
- package/dist/ketchup/{p-c7ee1fbc.js → p-61faaa38.js} +2 -2
- package/dist/ketchup/p-62816d0b.entry.js +1 -0
- package/dist/ketchup/p-65adc15b.entry.js +1 -0
- package/dist/ketchup/p-7e23ea7c.entry.js +1 -0
- package/dist/ketchup/p-a378ba56.entry.js +1 -0
- package/dist/ketchup/p-a878016f.entry.js +1 -0
- package/dist/ketchup/p-a96e6e32.entry.js +1 -0
- package/dist/ketchup/p-ad32821e.entry.js +1 -0
- package/dist/ketchup/p-af4a6191.entry.js +1 -0
- package/dist/ketchup/p-c18c7bb0.entry.js +27 -0
- package/dist/ketchup/p-ca0ca27f.entry.js +1 -0
- package/dist/ketchup/p-cb5f4994.js +1 -0
- package/dist/ketchup/p-ccda584a.entry.js +1 -0
- package/dist/ketchup/p-d4aa4922.js +1 -0
- package/dist/ketchup/p-dbb6998b.entry.js +1 -0
- package/dist/ketchup/p-de83f2f6.js +1 -0
- package/dist/ketchup/p-ec3a3db9.js +1 -0
- package/dist/types/components/kup-autocomplete/kup-autocomplete-declarations.d.ts +2 -6
- package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +7 -13
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +13 -4
- package/dist/types/components/kup-box/kup-box.d.ts +13 -6
- package/dist/types/components/kup-card/builtin/kup-card-builtin.d.ts +14 -0
- package/dist/types/components/kup-card/builtin/kup-card-calendar.d.ts +2 -0
- package/dist/types/components/kup-card/builtin/kup-card-clock.d.ts +2 -0
- package/dist/types/components/kup-card/dialog/kup-card-dialog.d.ts +6 -0
- package/dist/types/components/kup-card/free/kup-card-free.d.ts +8 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +74 -0
- package/dist/types/components/kup-card/kup-card.d.ts +12 -3
- package/dist/types/components/kup-card/standard/kup-card-standard.d.ts +6 -0
- package/dist/types/components/kup-cell/kup-cell-declarations.d.ts +10 -0
- package/dist/types/components/kup-cell/kup-cell.d.ts +67 -0
- package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +1 -1
- package/dist/types/components/kup-combobox/kup-combobox-declarations.d.ts +3 -2
- package/dist/types/components/kup-combobox/kup-combobox.d.ts +5 -0
- package/dist/types/components/kup-dash-list/kup-dash-list.d.ts +4 -0
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +20 -36
- package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +1 -15
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +33 -83
- package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +11 -23
- package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +1 -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-paginator/kup-paginator.d.ts +6 -0
- package/dist/types/components/kup-snackbar/kup-snackbar-declarations.d.ts +12 -0
- package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +79 -0
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +2 -1
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
- package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +10 -20
- package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +1 -0
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +4 -4
- package/dist/types/components/kup-tree/kup-tree.d.ts +12 -23
- package/dist/types/components.d.ts +348 -176
- package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +153 -0
- package/dist/types/f-components/f-cell/f-cell.d.ts +3 -0
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
- package/dist/types/f-components/f-text-field/f-text-field-mdc.d.ts +1 -1
- package/dist/types/utils/cell-utils.d.ts +0 -19
- package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +2 -0
- package/dist/types/utils/kup-dates/kup-dates.d.ts +9 -4
- package/dist/types/utils/kup-debug/kup-debug.d.ts +1 -1
- package/dist/types/utils/kup-dynamic-position/kup-dynamic-position-declarations.d.ts +1 -1
- 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-language/kup-language-declarations.d.ts +2 -0
- package/dist/types/utils/kup-language/kup-language.d.ts +1 -1
- package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +28 -8
- package/dist/types/utils/kup-manager/kup-manager.d.ts +18 -5
- package/dist/types/utils/kup-objects/kup-objects.d.ts +1 -7
- package/dist/types/utils/kup-search/kup-search-declarations.d.ts +7 -0
- package/dist/types/utils/kup-search/kup-search.d.ts +20 -0
- package/dist/types/utils/kup-theme/kup-theme-declarations.d.ts +2 -0
- package/dist/types/utils/kup-theme/kup-theme.d.ts +2 -2
- package/dist/types/utils/utils.d.ts +0 -1
- package/package.json +4 -6
- package/dist/cjs/cell-utils-1f89a299.js +0 -1527
- package/dist/cjs/drag-and-drop-4787ff6f.js +0 -281
- package/dist/cjs/f-chip-2d58c8f7.js +0 -239
- package/dist/cjs/kup-grid.cjs.entry.js +0 -130
- package/dist/cjs/kup-manager-59ad8bdc.js +0 -4845
- package/dist/cjs/kup-objects-59ea949c.js +0 -717
- package/dist/collection/assets/images/drag-multiple.js +0 -1
- package/dist/collection/components/kup-editor/kup-editor.css +0 -5
- package/dist/collection/components/kup-editor/kup-editor.js +0 -59
- 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/cell-utils-cb612463.js +0 -1510
- package/dist/esm/drag-and-drop-321cb4ca.js +0 -265
- package/dist/esm/f-chip-125d5dd6.js +0 -236
- package/dist/esm/kup-grid.entry.js +0 -126
- package/dist/esm/kup-manager-e7d7b353.js +0 -4842
- package/dist/esm/kup-objects-d38d2fa2.js +0 -711
- package/dist/ketchup/p-00fe1e3e.js +0 -1
- package/dist/ketchup/p-0320e24e.entry.js +0 -1
- package/dist/ketchup/p-08c7a092.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-64ea7e37.entry.js +0 -1
- package/dist/ketchup/p-7896031c.entry.js +0 -1
- package/dist/ketchup/p-876da4c2.entry.js +0 -1
- package/dist/ketchup/p-8fb9d9b2.entry.js +0 -1
- package/dist/ketchup/p-940ab57a.entry.js +0 -1
- package/dist/ketchup/p-9c858a38.entry.js +0 -1
- package/dist/ketchup/p-a12a5690.entry.js +0 -1
- package/dist/ketchup/p-a5424073.js +0 -1
- package/dist/ketchup/p-b0724035.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-ee89966f.entry.js +0 -27
- 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-editor/kup-editor.d.ts +0 -16
- 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, 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
|
-
import { ItemsDisplayMode } from '../kup-list/kup-list-declarations';
|
|
3
|
+
import { ItemsDisplayMode, } from '../kup-list/kup-list-declarations';
|
|
5
4
|
import { consistencyCheck } from '../kup-list/kup-list-helper';
|
|
6
5
|
import { FTextField } from '../../f-components/f-text-field/f-text-field';
|
|
7
6
|
import { FTextFieldMDC } from '../../f-components/f-text-field/f-text-field-mdc';
|
|
@@ -9,6 +8,7 @@ import { KupComboboxProps, } from './kup-combobox-declarations';
|
|
|
9
8
|
import { KupThemeIconValues } from '../../utils/kup-theme/kup-theme-declarations';
|
|
10
9
|
import { getProps, setProps } from '../../utils/utils';
|
|
11
10
|
import { componentWrapperId } from '../../variables/GenericVariables';
|
|
11
|
+
import { KupDynamicPositionPlacement } from '../../utils/kup-dynamic-position/kup-dynamic-position-declarations';
|
|
12
12
|
export class KupCombobox {
|
|
13
13
|
constructor() {
|
|
14
14
|
/*-------------------------------------------------*/
|
|
@@ -49,6 +49,10 @@ export class KupCombobox {
|
|
|
49
49
|
* Sets how to return the selected item value. Suported values: "code", "description", "both".
|
|
50
50
|
*/
|
|
51
51
|
this.selectMode = ItemsDisplayMode.CODE;
|
|
52
|
+
/**
|
|
53
|
+
* When true shows the drop-down icon, for open list.
|
|
54
|
+
*/
|
|
55
|
+
this.showDropDownIcon = true;
|
|
52
56
|
/*-------------------------------------------------*/
|
|
53
57
|
/* I n t e r n a l V a r i a b l e s */
|
|
54
58
|
/*-------------------------------------------------*/
|
|
@@ -60,9 +64,9 @@ export class KupCombobox {
|
|
|
60
64
|
this.listEl = undefined;
|
|
61
65
|
this.textfieldWrapper = undefined;
|
|
62
66
|
this.textfieldEl = undefined;
|
|
67
|
+
this.clickCb = null;
|
|
63
68
|
}
|
|
64
69
|
onKupBlur() {
|
|
65
|
-
this.closeList();
|
|
66
70
|
this.kupBlur.emit({
|
|
67
71
|
comp: this,
|
|
68
72
|
id: this.rootElement.id,
|
|
@@ -80,7 +84,7 @@ export class KupCombobox {
|
|
|
80
84
|
onKupClick(e) {
|
|
81
85
|
const { target } = e;
|
|
82
86
|
if (this.isSelect) {
|
|
83
|
-
if (this.
|
|
87
|
+
if (this.textfieldWrapper.classList.contains('toggled')) {
|
|
84
88
|
this.closeList();
|
|
85
89
|
}
|
|
86
90
|
else {
|
|
@@ -126,6 +130,9 @@ export class KupCombobox {
|
|
|
126
130
|
onKupItemClick(e) {
|
|
127
131
|
this.consistencyCheck(e);
|
|
128
132
|
this.closeList();
|
|
133
|
+
if (this.textfieldEl) {
|
|
134
|
+
this.textfieldEl.focus();
|
|
135
|
+
}
|
|
129
136
|
this.kupChange.emit({
|
|
130
137
|
comp: this,
|
|
131
138
|
id: this.rootElement.id,
|
|
@@ -236,15 +243,31 @@ export class KupCombobox {
|
|
|
236
243
|
openList() {
|
|
237
244
|
this.textfieldWrapper.classList.add('toggled');
|
|
238
245
|
this.listEl.menuVisible = true;
|
|
239
|
-
this.
|
|
240
|
-
let elStyle = this.listEl.style;
|
|
246
|
+
const elStyle = this.listEl.style;
|
|
241
247
|
elStyle.height = 'auto';
|
|
242
248
|
elStyle.minWidth = this.textfieldWrapper.clientWidth + 'px';
|
|
249
|
+
if (this.kupManager.dynamicPosition.isRegistered(this.listEl)) {
|
|
250
|
+
this.kupManager.dynamicPosition.changeAnchor(this.listEl, this.textfieldWrapper);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this.kupManager.dynamicPosition.register(this.listEl, this.textfieldWrapper, 0, KupDynamicPositionPlacement.AUTO, true);
|
|
254
|
+
}
|
|
255
|
+
this.kupManager.dynamicPosition.start(this.listEl);
|
|
256
|
+
if (!this.clickCb) {
|
|
257
|
+
this.clickCb = {
|
|
258
|
+
cb: () => {
|
|
259
|
+
this.closeList();
|
|
260
|
+
},
|
|
261
|
+
el: this.listEl,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
this.kupManager.addClickCallback(this.clickCb, true);
|
|
243
265
|
}
|
|
244
266
|
closeList() {
|
|
245
267
|
this.textfieldWrapper.classList.remove('toggled');
|
|
246
268
|
this.listEl.menuVisible = false;
|
|
247
269
|
this.kupManager.dynamicPosition.stop(this.listEl);
|
|
270
|
+
this.kupManager.removeClickCallback(this.clickCb);
|
|
248
271
|
}
|
|
249
272
|
isListOpened() {
|
|
250
273
|
return this.listEl.menuVisible == true;
|
|
@@ -255,7 +278,7 @@ export class KupCombobox {
|
|
|
255
278
|
this.displayedValue = ret.displayedValue;
|
|
256
279
|
}
|
|
257
280
|
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)
|
|
281
|
+
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
282
|
}
|
|
260
283
|
/*-------------------------------------------------*/
|
|
261
284
|
/* L i f e c y c l e H o o k s */
|
|
@@ -281,12 +304,11 @@ export class KupCombobox {
|
|
|
281
304
|
componentDidRender() {
|
|
282
305
|
const root = this.rootElement.shadowRoot;
|
|
283
306
|
if (root) {
|
|
284
|
-
const f = root.querySelector('.f-text-field
|
|
307
|
+
const f = root.querySelector('.f-text-field');
|
|
285
308
|
if (f) {
|
|
286
309
|
this.textfieldWrapper = f;
|
|
287
310
|
this.textfieldEl = f.querySelector('input');
|
|
288
311
|
FTextFieldMDC(f);
|
|
289
|
-
this.kupManager.dynamicPosition.register(this.listEl, this.textfieldWrapper);
|
|
290
312
|
}
|
|
291
313
|
}
|
|
292
314
|
this.kupManager.debug.logRender(this, true);
|
|
@@ -294,19 +316,19 @@ export class KupCombobox {
|
|
|
294
316
|
render() {
|
|
295
317
|
const fullHeight = this.rootElement.classList.contains('kup-full-height');
|
|
296
318
|
const fullWidth = this.rootElement.classList.contains('kup-full-width');
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
customStyle ? h("style", null, customStyle) : null,
|
|
319
|
+
return (h(Host, { class: `${fullHeight ? 'kup-full-height' : ''} ${fullWidth ? 'kup-full-width' : ''}`, style: this.elStyle },
|
|
320
|
+
h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)),
|
|
300
321
|
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:
|
|
302
|
-
|
|
322
|
+
h(FTextField, Object.assign({}, this.data['kup-text-field'], { disabled: this.disabled, fullHeight: fullHeight, fullWidth: fullWidth, icon: this.showDropDownIcon
|
|
323
|
+
? KupThemeIconValues.DROPDOWN
|
|
324
|
+
: null, 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
325
|
}
|
|
304
326
|
disconnectedCallback() {
|
|
305
|
-
this.
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
this.kupManager.dynamicPosition.unregister(Array.prototype.slice.call(dynamicPositionElements));
|
|
327
|
+
if (this.listEl) {
|
|
328
|
+
this.kupManager.dynamicPosition.unregister([this.listEl]);
|
|
329
|
+
this.listEl.remove();
|
|
309
330
|
}
|
|
331
|
+
this.kupManager.theme.unregister(this);
|
|
310
332
|
}
|
|
311
333
|
static get is() { return "kup-combobox"; }
|
|
312
334
|
static get encapsulation() { return "shadow"; }
|
|
@@ -329,11 +351,11 @@ export class KupCombobox {
|
|
|
329
351
|
"optional": false,
|
|
330
352
|
"docs": {
|
|
331
353
|
"tags": [{
|
|
332
|
-
"
|
|
333
|
-
"
|
|
354
|
+
"name": "default",
|
|
355
|
+
"text": "\"\""
|
|
334
356
|
}, {
|
|
335
|
-
"
|
|
336
|
-
"
|
|
357
|
+
"name": "see",
|
|
358
|
+
"text": "https://ketchup.smeup.com/ketchup-showcase/#/customization"
|
|
337
359
|
}],
|
|
338
360
|
"text": "Custom style of the component."
|
|
339
361
|
},
|
|
@@ -460,6 +482,24 @@ export class KupCombobox {
|
|
|
460
482
|
"attribute": "select-mode",
|
|
461
483
|
"reflect": false,
|
|
462
484
|
"defaultValue": "ItemsDisplayMode.CODE"
|
|
485
|
+
},
|
|
486
|
+
"showDropDownIcon": {
|
|
487
|
+
"type": "boolean",
|
|
488
|
+
"mutable": false,
|
|
489
|
+
"complexType": {
|
|
490
|
+
"original": "boolean",
|
|
491
|
+
"resolved": "boolean",
|
|
492
|
+
"references": {}
|
|
493
|
+
},
|
|
494
|
+
"required": false,
|
|
495
|
+
"optional": false,
|
|
496
|
+
"docs": {
|
|
497
|
+
"tags": [],
|
|
498
|
+
"text": "When true shows the drop-down icon, for open list."
|
|
499
|
+
},
|
|
500
|
+
"attribute": "show-drop-down-icon",
|
|
501
|
+
"reflect": false,
|
|
502
|
+
"defaultValue": "true"
|
|
463
503
|
}
|
|
464
504
|
}; }
|
|
465
505
|
static get states() { return {
|
|
@@ -613,8 +653,8 @@ export class KupCombobox {
|
|
|
613
653
|
"signature": "(descriptions?: boolean) => Promise<GenericObject>",
|
|
614
654
|
"parameters": [{
|
|
615
655
|
"tags": [{
|
|
616
|
-
"
|
|
617
|
-
"
|
|
656
|
+
"name": "param",
|
|
657
|
+
"text": "descriptions - When provided and true, the result will be the list of props with their description."
|
|
618
658
|
}],
|
|
619
659
|
"text": "- When provided and true, the result will be the list of props with their description."
|
|
620
660
|
}],
|
|
@@ -696,8 +736,8 @@ export class KupCombobox {
|
|
|
696
736
|
"signature": "(props: GenericObject) => Promise<void>",
|
|
697
737
|
"parameters": [{
|
|
698
738
|
"tags": [{
|
|
699
|
-
"
|
|
700
|
-
"
|
|
739
|
+
"name": "param",
|
|
740
|
+
"text": "props - Object containing props that will be set to the component."
|
|
701
741
|
}],
|
|
702
742
|
"text": "- Object containing props that will be set to the component."
|
|
703
743
|
}],
|
|
@@ -725,8 +765,8 @@ export class KupCombobox {
|
|
|
725
765
|
"signature": "(value: string) => Promise<void>",
|
|
726
766
|
"parameters": [{
|
|
727
767
|
"tags": [{
|
|
728
|
-
"
|
|
729
|
-
"
|
|
768
|
+
"name": "param",
|
|
769
|
+
"text": "value - Value to be set."
|
|
730
770
|
}],
|
|
731
771
|
"text": "- Value to be set."
|
|
732
772
|
}],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component, Prop, Event, h } from '@stencil/core';
|
|
2
2
|
import { getCellValueForDisplay } from '../../utils/cell-utils';
|
|
3
|
-
import {
|
|
3
|
+
import { kupManagerInstance, } from '../../utils/kup-manager/kup-manager';
|
|
4
|
+
import { getDecimalSeparator } from '../../utils/utils';
|
|
4
5
|
export class KupDashList {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.layout = '1';
|
|
@@ -12,6 +13,13 @@ export class KupDashList {
|
|
|
12
13
|
this.iconColor = [];
|
|
13
14
|
this.valueColor = [];
|
|
14
15
|
this.textColor = [];
|
|
16
|
+
/*-------------------------------------------------*/
|
|
17
|
+
/* I n t e r n a l V a r i a b l e s */
|
|
18
|
+
/*-------------------------------------------------*/
|
|
19
|
+
/**
|
|
20
|
+
* Instance of the KupManager class.
|
|
21
|
+
*/
|
|
22
|
+
this.kupManager = kupManagerInstance();
|
|
15
23
|
}
|
|
16
24
|
render() {
|
|
17
25
|
let rows = [];
|
|
@@ -69,7 +77,8 @@ export class KupDashList {
|
|
|
69
77
|
if (this.data.columns[6] &&
|
|
70
78
|
r.cells[this.data.columns[6].name].obj.k) {
|
|
71
79
|
newValue =
|
|
72
|
-
newValue +
|
|
80
|
+
newValue +
|
|
81
|
+
getDecimalSeparator(this.kupManager.dates.getLocale());
|
|
73
82
|
}
|
|
74
83
|
valueInt = (h("div", { slot: "value-int", style: valueColor }, newValue));
|
|
75
84
|
}
|
|
@@ -82,7 +91,7 @@ export class KupDashList {
|
|
|
82
91
|
else {
|
|
83
92
|
valueDec = h("div", { slot: "value-dec" });
|
|
84
93
|
}
|
|
85
|
-
const row = (h("kup-dash", { layout: this.layout, fontsize: this.fontsize, index: count, active: this.active },
|
|
94
|
+
const row = (h("kup-dash", { layout: this.layout, fontsize: this.fontsize, index: count, active: this.active, slot: String(count) },
|
|
86
95
|
icon,
|
|
87
96
|
unit,
|
|
88
97
|
descr,
|
|
@@ -94,7 +103,7 @@ export class KupDashList {
|
|
|
94
103
|
});
|
|
95
104
|
return (h("div", null,
|
|
96
105
|
h("link", { href: "https://cdn.materialdesignicons.com/4.5.95/css/materialdesignicons.min.css", rel: "stylesheet", type: "text/css" }),
|
|
97
|
-
h("kup-
|
|
106
|
+
h("kup-grid", { columns: this.columnsNumber, singleLine: this.horizontal, class: `${this.fullWidth ? 'kup-full-width' : ''}` }, rows)));
|
|
98
107
|
}
|
|
99
108
|
static get is() { return "kup-dash-list"; }
|
|
100
109
|
static get encapsulation() { return "shadow"; }
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export var KupDataTableProps;
|
|
6
6
|
(function (KupDataTableProps) {
|
|
7
|
+
KupDataTableProps["autoFillMissingCells"] = "When true and when a row is missing some columns, the missing cells will be autogenerated.";
|
|
7
8
|
KupDataTableProps["customStyle"] = "Custom style of the component.";
|
|
8
9
|
KupDataTableProps["data"] = "The data of the table.";
|
|
9
10
|
KupDataTableProps["density"] = "The density of the rows, defaults at 'medium' and can be also set to 'large' or 'small'.";
|
|
@@ -33,6 +34,7 @@ export var KupDataTableProps;
|
|
|
33
34
|
KupDataTableProps["pageSelected"] = "Current selected page set on component load";
|
|
34
35
|
KupDataTableProps["paginatorPos"] = "Sets the position of the paginator. Available positions: top, bottom or both.";
|
|
35
36
|
KupDataTableProps["removableColumns"] = "Sets the possibility to remove the selected column.";
|
|
37
|
+
KupDataTableProps["resizableColumns"] = "Gives the possibility to resize columns by dragging on their right edge.";
|
|
36
38
|
KupDataTableProps["rowActions"] = "Sets the actions of the rows.";
|
|
37
39
|
KupDataTableProps["rowsPerPage"] = "Sets the number of rows per page to display.";
|
|
38
40
|
KupDataTableProps["scrollOnHover"] = "Activates the scroll on hover function.";
|
|
@@ -1,18 +1,11 @@
|
|
|
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';
|
|
8
7
|
import { KupDebugCategory } from '../../utils/kup-debug/kup-debug-declarations';
|
|
9
|
-
import { KupObjects } from '../../utils/kup-objects/kup-objects';
|
|
10
|
-
import { KupDates } from '../../utils/kup-dates/kup-dates';
|
|
11
8
|
const dom = document.documentElement;
|
|
12
|
-
const kupDates = dom.ketchup ? dom.ketchup.dates : new KupDates();
|
|
13
|
-
const kupObjects = dom.ketchup
|
|
14
|
-
? dom.ketchup.objects
|
|
15
|
-
: new KupObjects();
|
|
16
9
|
export function sortRows(rows = [], sort = []) {
|
|
17
10
|
if (!rows || rows.length === 0) {
|
|
18
11
|
return [];
|
|
@@ -93,9 +86,15 @@ function getSortOnColumn(column = '', sort = []) {
|
|
|
93
86
|
function compareRows(r1, r2, sortObj) {
|
|
94
87
|
const cell1 = r1.cells[sortObj.column];
|
|
95
88
|
const cell2 = r2.cells[sortObj.column];
|
|
96
|
-
if (!cell1
|
|
89
|
+
if (!cell1 && !cell2) {
|
|
97
90
|
return 0;
|
|
98
91
|
}
|
|
92
|
+
if (!cell1) {
|
|
93
|
+
return 1;
|
|
94
|
+
}
|
|
95
|
+
if (!cell2) {
|
|
96
|
+
return -1;
|
|
97
|
+
}
|
|
99
98
|
return compareCell(cell1, cell2, sortObj.sortMode);
|
|
100
99
|
}
|
|
101
100
|
//-------- FILTER FUNCTIONS --------
|
|
@@ -240,7 +239,7 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
|
|
|
240
239
|
const currentTotalValue = groupRow.group.totals[key] || 0;
|
|
241
240
|
const cell = addedRow.cells[key];
|
|
242
241
|
if (cell) {
|
|
243
|
-
let _isNumber =
|
|
242
|
+
let _isNumber = dom.ketchup.objects.isNumber(cell.obj);
|
|
244
243
|
const totalMode = totals[key];
|
|
245
244
|
switch (totalMode) {
|
|
246
245
|
case TotalMode.COUNT:
|
|
@@ -349,18 +348,19 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
|
|
|
349
348
|
parent = parent.group.parent;
|
|
350
349
|
}
|
|
351
350
|
}
|
|
352
|
-
else if (
|
|
351
|
+
else if (dom.ketchup.objects.isDate(cell.obj)) {
|
|
353
352
|
const momentValue = cell.obj
|
|
354
|
-
?
|
|
355
|
-
:
|
|
356
|
-
if (
|
|
357
|
-
const cellValue =
|
|
353
|
+
? dom.ketchup.objects.parseDate(cell.obj)
|
|
354
|
+
: dom.ketchup.dates.toDayjs(cell.value);
|
|
355
|
+
if (dom.ketchup.dates.isValid(momentValue)) {
|
|
356
|
+
const cellValue = dom.ketchup.dates.toDate(momentValue);
|
|
358
357
|
const currentTotalValue = groupRow.group.totals[key];
|
|
359
358
|
if (currentTotalValue) {
|
|
360
359
|
let moments = [];
|
|
361
360
|
moments.push(cellValue);
|
|
362
|
-
moments.push(
|
|
363
|
-
groupRow.group.totals[key] =
|
|
361
|
+
moments.push(dom.ketchup.dates.format(currentTotalValue));
|
|
362
|
+
groupRow.group.totals[key] =
|
|
363
|
+
dom.ketchup.dates.format(dom.ketchup.dates.min(moments));
|
|
364
364
|
}
|
|
365
365
|
else {
|
|
366
366
|
groupRow.group.totals[key] = cellValue;
|
|
@@ -372,8 +372,9 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
|
|
|
372
372
|
if (currentParentMin) {
|
|
373
373
|
let moments = [];
|
|
374
374
|
moments.push(cellValue);
|
|
375
|
-
moments.push(
|
|
376
|
-
parent.group.totals[key] =
|
|
375
|
+
moments.push(dom.ketchup.dates.format(currentParentMin));
|
|
376
|
+
parent.group.totals[key] =
|
|
377
|
+
dom.ketchup.dates.format(dom.ketchup.dates.min(moments));
|
|
377
378
|
}
|
|
378
379
|
else {
|
|
379
380
|
// first round
|
|
@@ -410,18 +411,19 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
|
|
|
410
411
|
parent = parent.group.parent;
|
|
411
412
|
}
|
|
412
413
|
}
|
|
413
|
-
else if (
|
|
414
|
+
else if (dom.ketchup.objects.isDate(cell.obj)) {
|
|
414
415
|
const momentValue = cell.obj
|
|
415
|
-
?
|
|
416
|
-
:
|
|
417
|
-
if (
|
|
418
|
-
const cellValue =
|
|
416
|
+
? dom.ketchup.objects.parseDate(cell.obj)
|
|
417
|
+
: dom.ketchup.dates.toDayjs(cell.value);
|
|
418
|
+
if (dom.ketchup.dates.isValid(momentValue)) {
|
|
419
|
+
const cellValue = dom.ketchup.dates.toDate(momentValue);
|
|
419
420
|
const currentTotalValue = groupRow.group.totals[key];
|
|
420
421
|
if (currentTotalValue) {
|
|
421
422
|
let moments = [];
|
|
422
423
|
moments.push(cellValue);
|
|
423
|
-
moments.push(
|
|
424
|
-
groupRow.group.totals[key] =
|
|
424
|
+
moments.push(dom.ketchup.dates.format(currentTotalValue));
|
|
425
|
+
groupRow.group.totals[key] =
|
|
426
|
+
dom.ketchup.dates.format(dom.ketchup.dates.max(moments));
|
|
425
427
|
}
|
|
426
428
|
else {
|
|
427
429
|
groupRow.group.totals[key] = cellValue;
|
|
@@ -433,8 +435,9 @@ function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
|
|
|
433
435
|
if (currentParentMin) {
|
|
434
436
|
let moments = [];
|
|
435
437
|
moments.push(cellValue);
|
|
436
|
-
moments.push(
|
|
437
|
-
parent.group.totals[key] =
|
|
438
|
+
moments.push(dom.ketchup.dates.format(currentParentMin));
|
|
439
|
+
parent.group.totals[key] =
|
|
440
|
+
dom.ketchup.dates.format(dom.ketchup.dates.max(moments));
|
|
438
441
|
}
|
|
439
442
|
else {
|
|
440
443
|
// first round
|
|
@@ -566,14 +569,16 @@ export function normalizeRows(columns, rows) {
|
|
|
566
569
|
const normalizedrows = Object.assign(rows);
|
|
567
570
|
rows.forEach((row) => {
|
|
568
571
|
columns.forEach((column) => {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
572
|
+
if (row.cells) {
|
|
573
|
+
const cell = row.cells[column.name];
|
|
574
|
+
if (cell && column.obj && !cell.obj) {
|
|
575
|
+
// cell.obj = Object.assign(column.obj);
|
|
576
|
+
cell.obj = {
|
|
577
|
+
t: column.obj.t,
|
|
578
|
+
p: column.obj.p,
|
|
579
|
+
k: cell.value,
|
|
580
|
+
};
|
|
581
|
+
}
|
|
577
582
|
}
|
|
578
583
|
});
|
|
579
584
|
});
|
|
@@ -597,7 +602,7 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
597
602
|
}
|
|
598
603
|
else {
|
|
599
604
|
let distinctObj = {};
|
|
600
|
-
rows.forEach((r) => {
|
|
605
|
+
rows.forEach((r, index, array) => {
|
|
601
606
|
keys.filter((key) => TotalMode.COUNT !== totals[key] &&
|
|
602
607
|
totals[key].indexOf(TotalMode.MATH) != 0).forEach((key) => {
|
|
603
608
|
// getting cell
|
|
@@ -605,7 +610,7 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
605
610
|
if (cell) {
|
|
606
611
|
if (totals[key] === TotalMode.DISTINCT) {
|
|
607
612
|
let cellValue;
|
|
608
|
-
if (
|
|
613
|
+
if (dom.ketchup.objects.isNumber(cell.obj)) {
|
|
609
614
|
cellValue = numeral(stringToNumber(cell.value)).value();
|
|
610
615
|
}
|
|
611
616
|
else {
|
|
@@ -620,14 +625,9 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
620
625
|
else {
|
|
621
626
|
// update the list
|
|
622
627
|
distinctList.push(cellValue);
|
|
623
|
-
if (distinctList.length === rows.length) {
|
|
624
|
-
// last round
|
|
625
|
-
footerRow[key] = new Set(distinctList).size;
|
|
626
|
-
distinctObj[key] = [];
|
|
627
|
-
}
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
else if (
|
|
630
|
+
else if (dom.ketchup.objects.isNumber(cell.obj)) {
|
|
631
631
|
const cellValue = numeral(stringToNumber(cell.value));
|
|
632
632
|
let currentFooterValue = footerRow[key];
|
|
633
633
|
switch (true) {
|
|
@@ -657,20 +657,21 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
657
657
|
}
|
|
658
658
|
// TODO DRY the MIN and MAX functions
|
|
659
659
|
}
|
|
660
|
-
else if (
|
|
660
|
+
else if (dom.ketchup.objects.isDate(cell.obj)) {
|
|
661
661
|
const momentValue = cell.obj
|
|
662
|
-
?
|
|
663
|
-
:
|
|
664
|
-
if (
|
|
665
|
-
const cellValue =
|
|
662
|
+
? dom.ketchup.objects.parseDate(cell.obj)
|
|
663
|
+
: dom.ketchup.dates.toDayjs(cell.value);
|
|
664
|
+
if (dom.ketchup.dates.isValid(momentValue)) {
|
|
665
|
+
const cellValue = dom.ketchup.dates.toDate(momentValue);
|
|
666
666
|
const currentFooterValue = footerRow[key];
|
|
667
667
|
switch (true) {
|
|
668
668
|
case totals[key] === TotalMode.MIN:
|
|
669
669
|
if (currentFooterValue) {
|
|
670
670
|
let moments = [];
|
|
671
671
|
moments.push(cellValue);
|
|
672
|
-
moments.push(
|
|
673
|
-
footerRow[key] =
|
|
672
|
+
moments.push(dom.ketchup.dates.format(currentFooterValue));
|
|
673
|
+
footerRow[key] =
|
|
674
|
+
dom.ketchup.dates.format(dom.ketchup.dates.min(moments));
|
|
674
675
|
}
|
|
675
676
|
else {
|
|
676
677
|
footerRow[key] = cellValue;
|
|
@@ -680,8 +681,9 @@ export function calcTotals(rows = [], totals = {}) {
|
|
|
680
681
|
if (currentFooterValue) {
|
|
681
682
|
let moments = [];
|
|
682
683
|
moments.push(cellValue);
|
|
683
|
-
moments.push(
|
|
684
|
-
footerRow[key] =
|
|
684
|
+
moments.push(dom.ketchup.dates.format(currentFooterValue));
|
|
685
|
+
footerRow[key] =
|
|
686
|
+
dom.ketchup.dates.format(dom.ketchup.dates.max(moments));
|
|
685
687
|
}
|
|
686
688
|
else {
|
|
687
689
|
footerRow[key] = cellValue;
|
|
@@ -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
|
|
@@ -812,52 +820,3 @@ function cloneRowGroup(group) {
|
|
|
812
820
|
};
|
|
813
821
|
return cloned;
|
|
814
822
|
}
|
|
815
|
-
/**
|
|
816
|
-
* Given a cell object, determines if the style object has also a border radius
|
|
817
|
-
* @param cell - The cell to check
|
|
818
|
-
* @returns {boolean} - true if borderRadius is present, false otherwise.
|
|
819
|
-
*/
|
|
820
|
-
export function styleHasBorderRadius(cell) {
|
|
821
|
-
return !!(cell &&
|
|
822
|
-
cell.style &&
|
|
823
|
-
(cell.style.borderRadius || cell.style['border-radius']));
|
|
824
|
-
}
|
|
825
|
-
/**
|
|
826
|
-
* Given a cell object, determines if the style object has also a writing mode
|
|
827
|
-
* @param cell - The cell to check
|
|
828
|
-
* @returns {boolean} - true if writingMode is present, false otherwise.
|
|
829
|
-
*/
|
|
830
|
-
export function styleHasWritingMode(cell) {
|
|
831
|
-
return !!(cell &&
|
|
832
|
-
cell.style &&
|
|
833
|
-
(cell.style.writingMode || cell.style['writing-mode']));
|
|
834
|
-
}
|
|
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
|
-
};
|