@sme.up/ketchup 9.2.0 → 9.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.
- package/dist/cjs/bar.helpers-f46a5a83.js +372 -0
- package/dist/cjs/f-button-4bef0f8e.js +105 -0
- package/dist/cjs/{f-button-declarations-3fd791a8.js → f-button-declarations-51ef6d9a.js} +5 -5
- package/dist/cjs/f-cell-5e0a400e.js +670 -0
- package/dist/cjs/f-checkbox-41864e53.js +29 -0
- package/dist/cjs/f-chip-9159b2a5.js +133 -0
- package/dist/cjs/f-image-b9074ea8.js +115 -0
- package/dist/cjs/f-paginator-utils-bfa0fa70.js +1577 -0
- package/dist/cjs/f-text-field-bd197af7.js +216 -0
- package/dist/cjs/{f-text-field-mdc-4fda9705.js → f-text-field-mdc-08a06162.js} +19 -19
- package/dist/cjs/{index-d8e5eb5f.js → index-8f2f4159.js} +27 -7
- package/dist/cjs/index.cjs.js +4 -3
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +182 -181
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +14562 -14561
- package/dist/cjs/kup-box.cjs.entry.js +1231 -1230
- package/dist/cjs/kup-calendar.cjs.entry.js +376 -375
- package/dist/cjs/kup-card-list.cjs.entry.js +233 -232
- package/dist/cjs/kup-cell.cjs.entry.js +153 -152
- package/dist/cjs/kup-custom-task-list-header_4.cjs.entry.js +1317 -0
- package/dist/cjs/kup-dashboard.cjs.entry.js +369 -368
- package/dist/cjs/kup-dates-0e59b05d.js +782 -0
- package/dist/cjs/kup-drawer.cjs.entry.js +122 -121
- package/dist/cjs/kup-echart.cjs.entry.js +1192 -1191
- package/dist/cjs/kup-family-tree.cjs.entry.js +400 -399
- package/dist/cjs/kup-gantt_10.cjs.entry.js +1076 -0
- package/dist/cjs/kup-grid.cjs.entry.js +82 -81
- package/dist/cjs/kup-iframe.cjs.entry.js +80 -79
- package/dist/cjs/kup-image-list.cjs.entry.js +224 -223
- package/dist/cjs/kup-lazy.cjs.entry.js +162 -161
- package/dist/cjs/kup-magic-box.cjs.entry.js +270 -269
- package/dist/cjs/{kup-manager-7334c396.js → kup-manager-5106d5c6.js} +5771 -6516
- package/dist/cjs/kup-nav-bar.cjs.entry.js +110 -109
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +352 -351
- package/dist/cjs/kup-photo-frame.cjs.entry.js +126 -125
- package/dist/cjs/kup-planner-declarations-d3dec885.js +93 -0
- package/dist/cjs/kup-planner-renderer-helper-c2394940.js +410 -0
- package/dist/cjs/kup-planner-renderer.cjs.entry.js +278 -0
- package/dist/cjs/kup-planner-time-formatter-a74e70f0.js +93 -0
- package/dist/cjs/kup-planner.cjs.entry.js +718 -13596
- package/dist/cjs/kup-probe.cjs.entry.js +228 -227
- package/dist/cjs/kup-qlik.cjs.entry.js +126 -125
- package/dist/cjs/kup-snackbar.cjs.entry.js +102 -101
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/index.js +16 -0
- package/dist/collection/assets/planner-example-1.js +6337 -0
- package/dist/collection/assets/planner-example-2.js +5650 -0
- package/dist/collection/assets/planner-example-3.js +6548 -0
- package/dist/collection/assets/planner-example-4.js +28473 -0
- package/dist/collection/assets/planner.js +3255 -4900
- package/dist/collection/collection-manifest.json +16 -1
- package/dist/collection/components/kup-accordion/kup-accordion-declarations.js +3 -3
- package/dist/collection/components/kup-accordion/kup-accordion.js +423 -423
- package/dist/collection/components/kup-autocomplete/kup-autocomplete-declarations.js +14 -14
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +882 -882
- package/dist/collection/components/kup-badge/kup-badge-declarations.js +3 -3
- package/dist/collection/components/kup-badge/kup-badge.js +262 -262
- package/dist/collection/components/kup-box/kup-box-declarations.js +26 -26
- package/dist/collection/components/kup-box/kup-box-state.js +13 -13
- package/dist/collection/components/kup-box/kup-box.js +2069 -2069
- package/dist/collection/components/kup-button/kup-button-declarations.js +11 -11
- package/dist/collection/components/kup-button/kup-button.js +560 -560
- package/dist/collection/components/kup-button-list/kup-button-list-declarations.js +6 -6
- package/dist/collection/components/kup-button-list/kup-button-list.e2e.js +141 -141
- package/dist/collection/components/kup-button-list/kup-button-list.js +497 -497
- package/dist/collection/components/kup-calendar/kup-calendar-declarations.js +17 -17
- package/dist/collection/components/kup-calendar/kup-calendar.js +681 -681
- package/dist/collection/components/kup-card/box/kup-card-box.js +161 -161
- package/dist/collection/components/kup-card/built-in/kup-card-built-in.js +6 -6
- package/dist/collection/components/kup-card/built-in/kup-card-calendar.js +324 -324
- package/dist/collection/components/kup-card/built-in/kup-card-clock.js +250 -250
- package/dist/collection/components/kup-card/built-in/kup-card-column-drop-menu.js +141 -141
- package/dist/collection/components/kup-card/built-in/kup-card-message-box.js +3 -3
- package/dist/collection/components/kup-card/built-in/kup-card-numeric.js +98 -98
- package/dist/collection/components/kup-card/collapsible/kup-card-collapsible.js +44 -44
- package/dist/collection/components/kup-card/dialog/kup-card-dialog.js +135 -135
- package/dist/collection/components/kup-card/free/kup-card-free.js +6 -6
- package/dist/collection/components/kup-card/kup-card-declarations.js +53 -53
- package/dist/collection/components/kup-card/kup-card-helper.js +155 -155
- package/dist/collection/components/kup-card/kup-card.js +767 -767
- package/dist/collection/components/kup-card/scalable/kup-card-scalable.js +174 -174
- package/dist/collection/components/kup-card/standard/kup-card-standard.js +474 -474
- package/dist/collection/components/kup-card-list/kup-card-list-declarations.js +16 -16
- package/dist/collection/components/kup-card-list/kup-card-list.js +676 -676
- package/dist/collection/components/kup-cell/kup-cell-declarations.js +4 -4
- package/dist/collection/components/kup-cell/kup-cell.js +382 -382
- package/dist/collection/components/kup-chart/kup-chart-builder.js +80 -80
- package/dist/collection/components/kup-chart/kup-chart-declarations.js +36 -36
- package/dist/collection/components/kup-chart/kup-chart.js +1043 -1043
- package/dist/collection/components/kup-checkbox/kup-checkbox-declarations.js +6 -6
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +417 -417
- package/dist/collection/components/kup-chip/kup-chip-declarations.js +5 -5
- package/dist/collection/components/kup-chip/kup-chip.js +538 -538
- package/dist/collection/components/kup-color-picker/kup-color-picker-declarations.js +5 -5
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +511 -511
- package/dist/collection/components/kup-combobox/kup-combobox-declarations.js +8 -8
- package/dist/collection/components/kup-combobox/kup-combobox.js +796 -796
- package/dist/collection/components/kup-dashboard/kup-dashboard-declarations.js +3 -3
- package/dist/collection/components/kup-dashboard/kup-dashboard.js +562 -562
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +95 -95
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +729 -729
- package/dist/collection/components/kup-data-table/kup-data-table-state.js +33 -33
- package/dist/collection/components/kup-data-table/kup-data-table.js +5398 -5398
- package/dist/collection/components/kup-date-picker/kup-date-picker-declarations.js +8 -8
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +796 -796
- package/dist/collection/components/kup-dialog/kup-dialog-declarations.js +7 -7
- package/dist/collection/components/kup-dialog/kup-dialog.js +451 -451
- package/dist/collection/components/kup-drawer/kup-drawer-declarations.js +2 -2
- package/dist/collection/components/kup-drawer/kup-drawer.e2e.js +6 -6
- package/dist/collection/components/kup-drawer/kup-drawer.js +374 -374
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button-declarations.js +11 -11
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +776 -776
- package/dist/collection/components/kup-echart/kup-echart-declarations.js +40 -40
- package/dist/collection/components/kup-echart/kup-echart.js +1606 -1606
- package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +8 -8
- package/dist/collection/components/kup-family-tree/kup-family-tree.js +789 -789
- package/dist/collection/components/kup-form/kup-form-declarations.js +16 -16
- package/dist/collection/components/kup-form/kup-form.js +694 -694
- package/dist/collection/components/kup-gauge/kup-gauge-declarations.js +19 -19
- package/dist/collection/components/kup-gauge/kup-gauge.js +730 -730
- package/dist/collection/components/kup-grid/kup-grid-declarations.js +3 -3
- package/dist/collection/components/kup-grid/kup-grid.js +238 -238
- package/dist/collection/components/kup-iframe/kup-iframe-declarations.js +3 -3
- package/dist/collection/components/kup-iframe/kup-iframe.js +268 -268
- package/dist/collection/components/kup-image/canvas/kup-image-canvas-declarations.js +167 -167
- package/dist/collection/components/kup-image/canvas/kup-image-canvas-helper.js +16 -16
- package/dist/collection/components/kup-image/canvas/kup-image-canvas.js +221 -221
- package/dist/collection/components/kup-image/kup-image-declarations.js +9 -9
- package/dist/collection/components/kup-image/kup-image.js +471 -471
- package/dist/collection/components/kup-image-list/kup-image-list-declarations.js +3 -3
- package/dist/collection/components/kup-image-list/kup-image-list-state.js +7 -7
- package/dist/collection/components/kup-image-list/kup-image-list.js +502 -502
- package/dist/collection/components/kup-lazy/kup-lazy-declarations.js +7 -7
- package/dist/collection/components/kup-lazy/kup-lazy.js +417 -417
- package/dist/collection/components/kup-list/kup-list-declarations.js +18 -18
- package/dist/collection/components/kup-list/kup-list-helper.js +105 -105
- package/dist/collection/components/kup-list/kup-list.js +914 -914
- package/dist/collection/components/kup-magic-box/kup-magic-box-declarations.js +10 -10
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +405 -405
- package/dist/collection/components/kup-nav-bar/kup-nav-bar-declarations.js +7 -7
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +304 -304
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker-declarations.js +9 -9
- package/dist/collection/components/kup-numeric-picker/kup-numeric-picker.js +847 -847
- package/dist/collection/components/kup-photo-frame/kup-photo-frame-declarations.js +3 -3
- package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +359 -359
- package/dist/collection/components/kup-planner/kup-planner-declarations.js +69 -66
- package/dist/collection/components/kup-planner/kup-planner-helper.js +39 -39
- package/dist/collection/components/kup-planner/kup-planner-state.js +14 -14
- package/dist/collection/components/kup-planner/kup-planner.css +4 -482
- package/dist/collection/components/kup-planner/kup-planner.js +1777 -1675
- package/dist/collection/components/kup-planner/utils/custom-task-list-header.js +117 -0
- package/dist/collection/components/kup-planner/utils/custom-task-list-header.module.css +79 -0
- package/dist/collection/components/kup-planner/utils/custom-task-list-table.js +280 -0
- package/dist/collection/components/kup-planner/utils/custom-tool-tip.js +5 -0
- package/dist/collection/components/kup-planner/utils/gantt-table.module.css +88 -0
- package/dist/collection/components/kup-planner/utils/helpers/bar.helpers.js +328 -0
- package/dist/collection/components/kup-planner/utils/helpers/other.helpers.js +48 -0
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.css +40 -0
- package/dist/collection/components/kup-planner/utils/kup-gantt/kup-gantt.js +2302 -0
- package/dist/collection/components/kup-planner/utils/kup-gantt-calendar/kup-gantt-calendar.css +31 -0
- package/dist/collection/components/kup-planner/utils/kup-gantt-calendar/kup-gantt-calendar.js +466 -0
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.css +60 -0
- package/dist/collection/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.js +1186 -0
- package/dist/collection/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.css +36 -0
- package/dist/collection/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.js +177 -0
- package/dist/collection/components/kup-planner/utils/kup-planner-adapted-types.js +1 -0
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer-helper.js +396 -0
- package/dist/collection/components/kup-planner/utils/kup-planner-renderer.js +321 -0
- package/dist/collection/components/kup-planner/utils/kup-planner-time-formatter.js +87 -0
- package/dist/collection/components/kup-planner/utils/kup-switcher/kup-switcher.css +30 -0
- package/dist/collection/components/kup-planner/utils/kup-switcher/kup-switcher.js +49 -0
- package/dist/collection/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.js +215 -0
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-header.js +112 -0
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list-table.js +226 -0
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list.css +67 -0
- package/dist/collection/components/kup-planner/utils/kup-task-list/kup-task-list.js +638 -0
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-standard-tooltip.js +82 -0
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-tooltip.css +30 -0
- package/dist/collection/components/kup-planner/utils/kup-tooltip/kup-tooltip.js +362 -0
- package/dist/collection/components/kup-planner/utils/kup-vertical-scroll/kup-vertical-scroll.css +31 -0
- package/dist/collection/components/kup-planner/utils/kup-vertical-scroll/kup-vertical-scroll.js +170 -0
- package/dist/collection/components/kup-probe/kup-probe.js +335 -335
- package/dist/collection/components/kup-progress-bar/kup-progress-bar-declarations.js +7 -7
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +346 -346
- package/dist/collection/components/kup-qlik/kup-qlik.js +311 -311
- package/dist/collection/components/kup-radio/kup-radio-declarations.js +5 -5
- package/dist/collection/components/kup-radio/kup-radio.js +392 -392
- package/dist/collection/components/kup-rating/kup-rating-declarations.js +4 -4
- package/dist/collection/components/kup-rating/kup-rating.js +296 -296
- package/dist/collection/components/kup-snackbar/kup-snackbar-declarations.js +5 -5
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +380 -380
- package/dist/collection/components/kup-spinner/kup-spinner-declarations.js +8 -8
- package/dist/collection/components/kup-spinner/kup-spinner.js +449 -449
- package/dist/collection/components/kup-state/mock-store.js +10 -10
- package/dist/collection/components/kup-switch/kup-switch-declarations.js +5 -5
- package/dist/collection/components/kup-switch/kup-switch.js +387 -387
- package/dist/collection/components/kup-tab-bar/kup-tab-bar-declarations.js +3 -3
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +423 -423
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +30 -30
- package/dist/collection/components/kup-text-field/kup-text-field.js +1220 -1220
- package/dist/collection/components/kup-time-picker/kup-time-picker-declarations.js +7 -7
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +914 -914
- package/dist/collection/components/kup-tree/kup-tree-declarations.js +28 -28
- package/dist/collection/components/kup-tree/kup-tree-faker.js +233 -233
- package/dist/collection/components/kup-tree/kup-tree-state.js +13 -13
- package/dist/collection/components/kup-tree/kup-tree.js +2424 -2424
- package/dist/collection/f-components/f-button/f-button-declarations.js +5 -5
- package/dist/collection/f-components/f-button/f-button.js +76 -76
- package/dist/collection/f-components/f-cell/f-cell-declarations.js +125 -125
- package/dist/collection/f-components/f-cell/f-cell.js +407 -407
- package/dist/collection/f-components/f-checkbox/f-checkbox.js +10 -10
- package/dist/collection/f-components/f-chip/f-chip-declarations.js +4 -4
- package/dist/collection/f-components/f-chip/f-chip.js +82 -82
- package/dist/collection/f-components/f-image/f-image-declarations.js +1 -1
- package/dist/collection/f-components/f-image/f-image.js +79 -79
- package/dist/collection/f-components/f-paginator/f-paginator-declarations.js +2 -2
- package/dist/collection/f-components/f-paginator/f-paginator-utils.js +21 -21
- package/dist/collection/f-components/f-paginator/f-paginator.js +65 -65
- package/dist/collection/f-components/f-progress-bar/f-progress-bar.js +70 -70
- package/dist/collection/f-components/f-radio/f-radio.js +21 -21
- package/dist/collection/f-components/f-rating/f-rating.js +17 -17
- package/dist/collection/f-components/f-switch/f-switch.js +6 -6
- package/dist/collection/f-components/f-text-field/f-text-field-mdc.js +19 -19
- package/dist/collection/f-components/f-text-field/f-text-field.js +165 -165
- package/dist/collection/index.js +1 -1
- package/dist/collection/managers/kup-data/kup-data-cell-helper.js +47 -47
- package/dist/collection/managers/kup-data/kup-data-column-helper.js +220 -220
- package/dist/collection/managers/kup-data/kup-data-declarations.js +4 -4
- package/dist/collection/managers/kup-data/kup-data-node-helper.js +107 -107
- package/dist/collection/managers/kup-data/kup-data-row-helper.js +11 -11
- package/dist/collection/managers/kup-data/kup-data.js +468 -468
- package/dist/collection/managers/kup-dates/kup-dates-declarations.js +19 -19
- package/dist/collection/managers/kup-dates/kup-dates.js +637 -605
- package/dist/collection/managers/kup-debug/kup-debug-declarations.js +8 -8
- package/dist/collection/managers/kup-debug/kup-debug.js +626 -626
- package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position-declarations.js +9 -9
- package/dist/collection/managers/kup-dynamic-position/kup-dynamic-position.js +232 -232
- package/dist/collection/managers/kup-interact/kup-interact-declarations.js +11 -11
- package/dist/collection/managers/kup-interact/kup-interact.js +374 -374
- package/dist/collection/managers/kup-language/kup-language-declarations.js +127 -127
- package/dist/collection/managers/kup-language/kup-language.js +132 -132
- package/dist/collection/managers/kup-manager/kup-manager.js +257 -257
- package/dist/collection/managers/kup-math/kup-math-declarations.js +7 -7
- package/dist/collection/managers/kup-math/kup-math-helper.js +19 -19
- package/dist/collection/managers/kup-math/kup-math.js +374 -374
- package/dist/collection/managers/kup-objects/kup-objects.js +379 -379
- package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +4 -4
- package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +301 -301
- package/dist/collection/managers/kup-search/kup-search.js +65 -65
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +134 -134
- package/dist/collection/managers/kup-theme/kup-theme.js +696 -696
- package/dist/collection/managers/kup-toolbar/kup-toolbar-declarations.js +3 -3
- package/dist/collection/managers/kup-toolbar/kup-toolbar.js +93 -93
- package/dist/collection/managers/kup-tooltip/kup-tooltip.js +198 -198
- package/dist/collection/types/GenericTypes.js +47 -47
- package/dist/collection/utils/cell-utils.js +115 -115
- package/dist/collection/utils/filters/filters-column-menu.js +339 -339
- package/dist/collection/utils/filters/filters-declarations.js +4 -4
- package/dist/collection/utils/filters/filters-rows.js +215 -215
- package/dist/collection/utils/filters/filters-tree-items.js +96 -96
- package/dist/collection/utils/filters/filters.js +257 -257
- package/dist/collection/utils/kup-column-menu/kup-column-menu-declarations.js +14 -14
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +710 -710
- package/dist/collection/utils/utils.js +37 -37
- package/dist/components/custom-task-list-header.js +44 -0
- package/dist/components/custom-task-list-table.js +121 -0
- package/dist/components/index.js +1 -1
- package/dist/components/kup-accordion.d.ts +2 -2
- package/dist/components/kup-accordion.js +331 -331
- package/dist/components/kup-autocomplete.d.ts +2 -2
- package/dist/components/kup-autocomplete2.js +21534 -21533
- package/dist/components/kup-badge.d.ts +2 -2
- package/dist/components/kup-box.d.ts +2 -2
- package/dist/components/kup-box2.js +1416 -1416
- package/dist/components/kup-button-list.d.ts +2 -2
- package/dist/components/kup-button.d.ts +2 -2
- package/dist/components/kup-calendar.d.ts +2 -2
- package/dist/components/kup-calendar.js +534 -533
- package/dist/components/kup-card-list.d.ts +2 -2
- package/dist/components/kup-card-list.js +401 -401
- package/dist/components/kup-card.d.ts +2 -2
- package/dist/components/kup-cell.d.ts +2 -2
- package/dist/components/kup-cell.js +303 -303
- package/dist/components/kup-chart.d.ts +2 -2
- package/dist/components/kup-checkbox.d.ts +2 -2
- package/dist/components/kup-chip.d.ts +2 -2
- package/dist/components/kup-color-picker.d.ts +2 -2
- package/dist/components/kup-combobox.d.ts +2 -2
- package/dist/components/kup-custom-task-list-header.d.ts +11 -0
- package/dist/components/kup-custom-task-list-header.js +6 -0
- package/dist/components/kup-custom-task-list-table.d.ts +11 -0
- package/dist/components/kup-custom-task-list-table.js +6 -0
- package/dist/components/kup-dashboard.d.ts +2 -2
- package/dist/components/kup-dashboard.js +520 -520
- package/dist/components/kup-data-table.d.ts +2 -2
- package/dist/components/kup-date-picker.d.ts +2 -2
- package/dist/components/kup-dates.js +777 -0
- package/dist/components/kup-dialog.d.ts +2 -2
- package/dist/components/kup-drawer.d.ts +2 -2
- package/dist/components/kup-drawer.js +278 -278
- package/dist/components/kup-dropdown-button.d.ts +2 -2
- package/dist/components/kup-echart.d.ts +2 -2
- package/dist/components/kup-echart2.js +1358 -1358
- package/dist/components/kup-family-tree.d.ts +2 -2
- package/dist/components/kup-family-tree.js +564 -564
- package/dist/components/kup-form.d.ts +2 -2
- package/dist/components/kup-gantt-calendar.d.ts +11 -0
- package/dist/components/kup-gantt-calendar.js +6 -0
- package/dist/components/kup-gantt-calendar2.js +323 -0
- package/dist/components/kup-gantt.d.ts +11 -0
- package/dist/components/kup-gantt.js +6 -0
- package/dist/components/kup-gantt2.js +822 -0
- package/dist/components/kup-gauge.d.ts +2 -2
- package/dist/components/kup-grid-renderer.d.ts +11 -0
- package/dist/components/kup-grid-renderer.js +6 -0
- package/dist/components/kup-grid-renderer2.js +1416 -0
- package/dist/components/kup-grid.d.ts +2 -2
- package/dist/components/kup-grid2.js +236 -236
- package/dist/components/kup-horizontal-scroll.d.ts +11 -0
- package/dist/components/kup-horizontal-scroll.js +6 -0
- package/dist/components/kup-horizontal-scroll2.js +77 -0
- package/dist/components/kup-iframe.d.ts +2 -2
- package/dist/components/kup-iframe.js +234 -234
- package/dist/components/kup-image-list.d.ts +2 -2
- package/dist/components/kup-image-list.js +377 -377
- package/dist/components/kup-image.d.ts +2 -2
- package/dist/components/kup-lazy.d.ts +2 -2
- package/dist/components/kup-lazy.js +319 -319
- package/dist/components/kup-list.d.ts +2 -2
- package/dist/components/kup-magic-box.d.ts +2 -2
- package/dist/components/kup-magic-box.js +432 -432
- package/dist/components/kup-manager.js +5748 -6491
- package/dist/components/kup-nav-bar.d.ts +2 -2
- package/dist/components/kup-nav-bar.js +263 -263
- package/dist/components/kup-numeric-picker.d.ts +2 -2
- package/dist/components/kup-numeric-picker.js +514 -514
- package/dist/components/kup-photo-frame.d.ts +2 -2
- package/dist/components/kup-photo-frame.js +281 -281
- package/dist/components/kup-planner-renderer-helper.js +399 -0
- package/dist/components/kup-planner-renderer.d.ts +11 -0
- package/dist/components/kup-planner-renderer.js +6 -0
- package/dist/components/kup-planner-renderer2.js +390 -0
- package/dist/components/kup-planner.d.ts +2 -2
- package/dist/components/kup-planner.js +1005 -13792
- package/dist/components/kup-probe.d.ts +2 -2
- package/dist/components/kup-probe.js +379 -379
- package/dist/components/kup-progress-bar.d.ts +2 -2
- package/dist/components/kup-qlik.d.ts +2 -2
- package/dist/components/kup-qlik.js +282 -282
- package/dist/components/kup-radio.d.ts +2 -2
- package/dist/components/kup-rating.d.ts +2 -2
- package/dist/components/kup-snackbar.d.ts +2 -2
- package/dist/components/kup-snackbar.js +257 -257
- package/dist/components/kup-spinner.d.ts +2 -2
- package/dist/components/kup-standard-tooltip.d.ts +11 -0
- package/dist/components/kup-standard-tooltip.js +6 -0
- package/dist/components/kup-standard-tooltip2.js +37 -0
- package/dist/components/kup-switch.d.ts +2 -2
- package/dist/components/kup-switcher.d.ts +11 -0
- package/dist/components/kup-switcher.js +6 -0
- package/dist/components/kup-switcher2.js +36 -0
- package/dist/components/kup-tab-bar.d.ts +2 -2
- package/dist/components/kup-task-gantt.d.ts +11 -0
- package/dist/components/kup-task-gantt.js +6 -0
- package/dist/components/kup-task-gantt2.js +91 -0
- package/dist/components/kup-task-list-header.d.ts +11 -0
- package/dist/components/kup-task-list-header.js +6 -0
- package/dist/components/kup-task-list-header2.js +55 -0
- package/dist/components/kup-task-list-table.d.ts +11 -0
- package/dist/components/kup-task-list-table.js +6 -0
- package/dist/components/kup-task-list-table2.js +79 -0
- package/dist/components/kup-task-list.d.ts +11 -0
- package/dist/components/kup-task-list.js +6 -0
- package/dist/components/kup-task-list2.js +260 -0
- package/dist/components/kup-text-field.d.ts +2 -2
- package/dist/components/kup-time-picker.d.ts +2 -2
- package/dist/components/kup-tooltip.d.ts +11 -0
- package/dist/components/kup-tooltip.js +6 -0
- package/dist/components/kup-tooltip2.js +127 -0
- package/dist/components/kup-tree.d.ts +2 -2
- package/dist/components/kup-vertical-scroll.d.ts +11 -0
- package/dist/components/kup-vertical-scroll.js +6 -0
- package/dist/components/kup-vertical-scroll2.js +77 -0
- package/dist/esm/bar.helpers-0898efb9.js +363 -0
- package/dist/esm/f-button-4d7a0b09.js +103 -0
- package/dist/esm/{f-button-declarations-8a009df1.js → f-button-declarations-9bdc6f26.js} +5 -5
- package/dist/esm/f-cell-0bf956b8.js +664 -0
- package/dist/esm/f-checkbox-43481de2.js +27 -0
- package/dist/esm/f-chip-91249dc2.js +131 -0
- package/dist/esm/f-image-d666df65.js +113 -0
- package/dist/esm/f-paginator-utils-b5be40ee.js +1564 -0
- package/dist/esm/f-text-field-00a4d490.js +214 -0
- package/dist/esm/{f-text-field-mdc-1143cf21.js → f-text-field-mdc-c88bf688.js} +19 -19
- package/dist/esm/{index-99c17b08.js → index-59f83f91.js} +27 -8
- package/dist/esm/index.js +4 -3
- package/dist/esm/ketchup.js +4 -4
- package/dist/esm/kup-accordion.entry.js +182 -181
- package/dist/esm/kup-autocomplete_27.entry.js +14562 -14561
- package/dist/esm/kup-box.entry.js +1231 -1230
- package/dist/esm/kup-calendar.entry.js +376 -375
- package/dist/esm/kup-card-list.entry.js +233 -232
- package/dist/esm/kup-cell.entry.js +153 -152
- package/dist/esm/kup-custom-task-list-header_4.entry.js +1310 -0
- package/dist/esm/kup-dashboard.entry.js +369 -368
- package/dist/esm/kup-dates-15f89ea2.js +777 -0
- package/dist/esm/kup-drawer.entry.js +122 -121
- package/dist/esm/kup-echart.entry.js +1192 -1191
- package/dist/esm/kup-family-tree.entry.js +400 -399
- package/dist/esm/kup-gantt_10.entry.js +1063 -0
- package/dist/esm/kup-grid.entry.js +82 -81
- package/dist/esm/kup-iframe.entry.js +80 -79
- package/dist/esm/kup-image-list.entry.js +224 -223
- package/dist/esm/kup-lazy.entry.js +162 -161
- package/dist/esm/kup-magic-box.entry.js +270 -269
- package/dist/esm/{kup-manager-9a9d2dbb.js → kup-manager-7f0372fb.js} +5749 -6492
- package/dist/esm/kup-nav-bar.entry.js +110 -109
- package/dist/esm/kup-numeric-picker.entry.js +352 -351
- package/dist/esm/kup-photo-frame.entry.js +126 -125
- package/dist/esm/kup-planner-declarations-b9345758.js +88 -0
- package/dist/esm/kup-planner-renderer-helper-2143d119.js +399 -0
- package/dist/esm/kup-planner-renderer.entry.js +274 -0
- package/dist/esm/kup-planner-time-formatter-a68e05ba.js +89 -0
- package/dist/esm/kup-planner.entry.js +718 -13596
- package/dist/esm/kup-probe.entry.js +228 -227
- package/dist/esm/kup-qlik.entry.js +126 -125
- package/dist/esm/kup-snackbar.entry.js +102 -101
- package/dist/esm/loader.js +3 -3
- package/dist/ketchup/index.esm.js +1 -1
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-01401fba.entry.js +1 -0
- package/dist/ketchup/p-01a0b54c.js +1 -0
- package/dist/ketchup/p-1180f9e0.entry.js +1 -0
- package/dist/ketchup/p-16c23ab7.entry.js +1 -0
- package/dist/ketchup/p-19be646f.entry.js +1 -0
- package/dist/ketchup/p-1e77ddec.js +1 -0
- package/dist/ketchup/p-1ecff2b9.entry.js +1 -0
- package/dist/ketchup/{p-ea56edbe.js → p-28dcc98b.js} +1 -1
- package/dist/ketchup/p-31a3eb96.entry.js +1 -0
- package/dist/ketchup/{p-34e4a985.js → p-378bbbcf.js} +1 -1
- package/dist/ketchup/p-3ba32190.entry.js +1 -0
- package/dist/ketchup/{p-f1f82eef.entry.js → p-466d3604.entry.js} +1 -1
- package/dist/ketchup/p-491c3cd0.entry.js +1 -0
- package/dist/ketchup/p-613ef7fa.entry.js +1 -0
- package/dist/ketchup/{p-4e696daf.js → p-6d51125a.js} +1 -1
- package/dist/ketchup/p-71acfd3c.entry.js +1 -0
- package/dist/ketchup/p-8c3ad5ef.entry.js +1 -0
- package/dist/ketchup/p-8c835b19.entry.js +1 -0
- package/dist/ketchup/{p-6a7df3d2.js → p-8e04781a.js} +1 -1
- package/dist/ketchup/p-8e3b6de8.js +1 -0
- package/dist/ketchup/p-91ee68b1.js +29 -0
- package/dist/ketchup/p-924b841b.js +1 -0
- package/dist/ketchup/p-96678597.entry.js +1 -0
- package/dist/ketchup/p-9fdd98be.entry.js +1 -0
- package/dist/ketchup/p-abdbd35e.entry.js +1 -0
- package/dist/ketchup/p-b07ffd18.entry.js +16 -0
- package/dist/ketchup/p-b51b1000.entry.js +1 -0
- package/dist/ketchup/p-bbc121a2.entry.js +1 -0
- package/dist/ketchup/p-bfa85d01.js +1 -0
- package/dist/ketchup/p-c23731ca.js +1 -0
- package/dist/ketchup/p-cd9a4274.js +2 -0
- package/dist/ketchup/p-d5a9924b.entry.js +1 -0
- package/dist/ketchup/p-d6aa3b78.entry.js +1 -0
- package/dist/ketchup/p-e4657f9b.entry.js +9 -0
- package/dist/ketchup/p-e841c2ae.js +1 -0
- package/dist/ketchup/p-e8f5b996.entry.js +1 -0
- package/dist/ketchup/p-f0b3d110.entry.js +1 -0
- package/dist/ketchup/{p-7a876328.js → p-f51dbf68.js} +1 -1
- package/dist/ketchup/p-f5b5b35d.entry.js +1 -0
- package/dist/types/components/kup-accordion/kup-accordion-declarations.d.ts +5 -5
- package/dist/types/components/kup-accordion/kup-accordion.d.ts +75 -75
- package/dist/types/components/kup-autocomplete/kup-autocomplete-declarations.d.ts +18 -18
- package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +113 -113
- package/dist/types/components/kup-badge/kup-badge-declarations.d.ts +3 -3
- package/dist/types/components/kup-badge/kup-badge.d.ts +47 -47
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +70 -70
- package/dist/types/components/kup-box/kup-box-state.d.ts +7 -7
- package/dist/types/components/kup-box/kup-box.d.ts +262 -262
- package/dist/types/components/kup-button/kup-button-declarations.d.ts +12 -12
- package/dist/types/components/kup-button/kup-button.d.ts +105 -105
- package/dist/types/components/kup-button-list/kup-button-list-declarations.d.ts +11 -11
- package/dist/types/components/kup-button-list/kup-button-list.d.ts +75 -75
- package/dist/types/components/kup-calendar/kup-calendar-declarations.d.ts +32 -32
- package/dist/types/components/kup-calendar/kup-calendar.d.ts +100 -100
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +123 -123
- package/dist/types/components/kup-card/kup-card.d.ts +154 -154
- package/dist/types/components/kup-card-list/kup-card-list-declarations.d.ts +20 -20
- package/dist/types/components/kup-card-list/kup-card-list.d.ts +107 -107
- package/dist/types/components/kup-cell/kup-cell-declarations.d.ts +4 -4
- package/dist/types/components/kup-cell/kup-cell.d.ts +62 -62
- package/dist/types/components/kup-chart/kup-chart-builder.d.ts +2 -2
- package/dist/types/components/kup-chart/kup-chart-declarations.d.ts +99 -99
- package/dist/types/components/kup-chart/kup-chart.d.ts +164 -164
- package/dist/types/components/kup-checkbox/kup-checkbox-declarations.d.ts +8 -8
- package/dist/types/components/kup-checkbox/kup-checkbox.d.ts +80 -80
- package/dist/types/components/kup-chip/kup-chip-declarations.d.ts +8 -8
- package/dist/types/components/kup-chip/kup-chip.d.ts +82 -82
- package/dist/types/components/kup-color-picker/kup-color-picker-declarations.d.ts +6 -6
- package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +83 -83
- package/dist/types/components/kup-combobox/kup-combobox-declarations.d.ts +12 -12
- package/dist/types/components/kup-combobox/kup-combobox.d.ts +89 -89
- package/dist/types/components/kup-dashboard/kup-dashboard-declarations.d.ts +28 -28
- package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +74 -74
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +156 -156
- package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +2 -2
- package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +31 -31
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +441 -441
- package/dist/types/components/kup-date-picker/kup-date-picker-declarations.d.ts +9 -9
- package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +105 -105
- package/dist/types/components/kup-dialog/kup-dialog-declarations.d.ts +12 -12
- package/dist/types/components/kup-dialog/kup-dialog.d.ts +72 -72
- package/dist/types/components/kup-drawer/kup-drawer-declarations.d.ts +2 -2
- package/dist/types/components/kup-drawer/kup-drawer.d.ts +70 -70
- package/dist/types/components/kup-dropdown-button/kup-dropdown-button-declarations.d.ts +12 -12
- package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +154 -154
- package/dist/types/components/kup-echart/kup-echart-declarations.d.ts +48 -48
- package/dist/types/components/kup-echart/kup-echart.d.ts +103 -103
- package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +20 -20
- package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +82 -82
- package/dist/types/components/kup-form/kup-form-declarations.d.ts +40 -40
- package/dist/types/components/kup-form/kup-form.d.ts +78 -78
- package/dist/types/components/kup-gauge/kup-gauge-declarations.d.ts +19 -19
- package/dist/types/components/kup-gauge/kup-gauge.d.ts +144 -144
- package/dist/types/components/kup-grid/kup-grid-declarations.d.ts +3 -3
- package/dist/types/components/kup-grid/kup-grid.d.ts +45 -45
- package/dist/types/components/kup-iframe/kup-iframe-declarations.d.ts +3 -3
- package/dist/types/components/kup-iframe/kup-iframe.d.ts +45 -45
- package/dist/types/components/kup-image/canvas/kup-image-canvas-declarations.d.ts +19 -19
- package/dist/types/components/kup-image/canvas/kup-image-canvas.d.ts +25 -25
- package/dist/types/components/kup-image/kup-image-declarations.d.ts +10 -10
- package/dist/types/components/kup-image/kup-image.d.ts +96 -96
- package/dist/types/components/kup-image-list/kup-image-list-declarations.d.ts +4 -4
- package/dist/types/components/kup-image-list/kup-image-list-state.d.ts +3 -3
- package/dist/types/components/kup-image-list/kup-image-list.d.ts +64 -64
- package/dist/types/components/kup-lazy/kup-lazy-declarations.d.ts +7 -7
- package/dist/types/components/kup-lazy/kup-lazy.d.ts +73 -73
- package/dist/types/components/kup-list/kup-list-declarations.d.ts +23 -23
- package/dist/types/components/kup-list/kup-list.d.ts +122 -122
- package/dist/types/components/kup-magic-box/kup-magic-box-declarations.d.ts +10 -10
- package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +60 -60
- package/dist/types/components/kup-nav-bar/kup-nav-bar-declarations.d.ts +7 -7
- package/dist/types/components/kup-nav-bar/kup-nav-bar.d.ts +60 -60
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker-declarations.d.ts +10 -10
- package/dist/types/components/kup-numeric-picker/kup-numeric-picker.d.ts +116 -116
- package/dist/types/components/kup-photo-frame/kup-photo-frame-declarations.d.ts +3 -3
- package/dist/types/components/kup-photo-frame/kup-photo-frame.d.ts +57 -57
- package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +592 -96
- package/dist/types/components/kup-planner/kup-planner-state.d.ts +9 -9
- package/dist/types/components/kup-planner/kup-planner.d.ts +269 -259
- package/dist/types/components/kup-planner/utils/custom-task-list-header.d.ts +8 -0
- package/dist/types/components/kup-planner/utils/custom-task-list-table.d.ts +14 -0
- package/dist/types/components/kup-planner/utils/custom-tool-tip.d.ts +2 -0
- package/dist/types/components/kup-planner/utils/helpers/bar.helpers.d.ts +33 -0
- package/dist/types/components/kup-planner/utils/helpers/other.helpers.d.ts +6 -0
- package/dist/types/components/kup-planner/utils/kup-gantt/kup-gantt.d.ts +127 -0
- package/dist/types/components/kup-planner/utils/kup-gantt-calendar/kup-gantt-calendar.d.ts +27 -0
- package/dist/types/components/kup-planner/utils/kup-grid-renderer/kup-grid-renderer.d.ts +59 -0
- package/dist/types/components/kup-planner/utils/kup-horizontal-scroll/kup-horizontal-scroll.d.ts +17 -0
- package/dist/types/components/kup-planner/utils/kup-planner-adapted-types.d.ts +28 -0
- package/dist/types/components/kup-planner/utils/kup-planner-renderer-helper.d.ts +36 -0
- package/dist/types/components/kup-planner/utils/kup-planner-renderer.d.ts +33 -0
- package/dist/types/components/kup-planner/utils/kup-planner-time-formatter.d.ts +20 -0
- package/dist/types/components/kup-planner/utils/kup-switcher/kup-switcher.d.ts +5 -0
- package/dist/types/components/kup-planner/utils/kup-task-gantt/kup-task-gantt.d.ts +20 -0
- package/dist/types/components/kup-planner/utils/kup-task-list/kup-task-list-header.d.ts +7 -0
- package/dist/types/components/kup-planner/utils/kup-task-list/kup-task-list-table.d.ts +16 -0
- package/dist/types/components/kup-planner/utils/kup-task-list/kup-task-list.d.ts +40 -0
- package/dist/types/components/kup-planner/utils/kup-tooltip/kup-standard-tooltip.d.ts +7 -0
- package/dist/types/components/kup-planner/utils/kup-tooltip/kup-tooltip.d.ts +26 -0
- package/dist/types/components/kup-planner/utils/kup-vertical-scroll/kup-vertical-scroll.d.ts +16 -0
- package/dist/types/components/kup-probe/kup-probe.d.ts +70 -70
- package/dist/types/components/kup-progress-bar/kup-progress-bar-declarations.d.ts +7 -7
- package/dist/types/components/kup-progress-bar/kup-progress-bar.d.ts +65 -65
- package/dist/types/components/kup-qlik/kup-qlik-declarations.d.ts +13 -13
- package/dist/types/components/kup-qlik/kup-qlik.d.ts +96 -96
- package/dist/types/components/kup-radio/kup-radio-declarations.d.ts +6 -6
- package/dist/types/components/kup-radio/kup-radio.d.ts +75 -75
- package/dist/types/components/kup-rating/kup-rating-declarations.d.ts +5 -5
- package/dist/types/components/kup-rating/kup-rating.d.ts +52 -52
- package/dist/types/components/kup-snackbar/kup-snackbar-declarations.d.ts +5 -5
- package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +78 -78
- package/dist/types/components/kup-spinner/kup-spinner-declarations.d.ts +8 -8
- package/dist/types/components/kup-spinner/kup-spinner.d.ts +75 -75
- package/dist/types/components/kup-state/kup-state.d.ts +1 -1
- package/dist/types/components/kup-state/kup-store.d.ts +2 -2
- package/dist/types/components/kup-state/mock-store.d.ts +5 -5
- package/dist/types/components/kup-switch/kup-switch-declarations.d.ts +6 -6
- package/dist/types/components/kup-switch/kup-switch.d.ts +75 -75
- package/dist/types/components/kup-tab-bar/kup-tab-bar-declarations.d.ts +6 -6
- package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +72 -72
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +31 -31
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +258 -258
- package/dist/types/components/kup-time-picker/kup-time-picker-declarations.d.ts +8 -8
- package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +120 -120
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +56 -56
- package/dist/types/components/kup-tree/kup-tree-faker.d.ts +15 -15
- package/dist/types/components/kup-tree/kup-tree-state.d.ts +9 -9
- package/dist/types/components/kup-tree/kup-tree.d.ts +351 -351
- package/dist/types/components.d.ts +637 -4
- package/dist/types/f-components/f-button/f-button-declarations.d.ts +24 -24
- package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +117 -117
- package/dist/types/f-components/f-checkbox/f-checkbox-declarations.d.ts +9 -9
- package/dist/types/f-components/f-chip/f-chip-declarations.d.ts +12 -12
- package/dist/types/f-components/f-image/f-image-declarations.d.ts +14 -14
- package/dist/types/f-components/f-paginator/f-paginator-declarations.d.ts +12 -12
- package/dist/types/f-components/f-progress-bar/f-progress-bar-declarations.d.ts +10 -10
- package/dist/types/f-components/f-radio/f-radio-declarations.d.ts +11 -11
- package/dist/types/f-components/f-rating/f-rating-declarations.d.ts +4 -4
- package/dist/types/f-components/f-switch/f-switch-declarations.d.ts +8 -8
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +38 -38
- package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +3 -3
- package/dist/types/managers/kup-data/kup-data-declarations.d.ts +88 -88
- package/dist/types/managers/kup-data/kup-data.d.ts +76 -76
- package/dist/types/managers/kup-dates/kup-dates-declarations.d.ts +19 -19
- package/dist/types/managers/kup-dates/kup-dates.d.ts +217 -192
- package/dist/types/managers/kup-debug/kup-debug-declarations.d.ts +18 -18
- package/dist/types/managers/kup-debug/kup-debug.d.ts +87 -87
- package/dist/types/managers/kup-dynamic-position/kup-dynamic-position-declarations.d.ts +19 -19
- package/dist/types/managers/kup-dynamic-position/kup-dynamic-position.d.ts +53 -53
- package/dist/types/managers/kup-interact/kup-interact-declarations.d.ts +37 -37
- package/dist/types/managers/kup-interact/kup-interact.d.ts +95 -95
- package/dist/types/managers/kup-language/kup-language-declarations.d.ts +133 -133
- package/dist/types/managers/kup-language/kup-language.d.ts +44 -44
- package/dist/types/managers/kup-manager/kup-manager-declarations.d.ts +63 -63
- package/dist/types/managers/kup-manager/kup-manager.d.ts +67 -67
- package/dist/types/managers/kup-math/kup-math-declarations.d.ts +16 -16
- package/dist/types/managers/kup-math/kup-math-helper.d.ts +1 -1
- package/dist/types/managers/kup-math/kup-math.d.ts +132 -132
- package/dist/types/managers/kup-objects/kup-objects-declarations.d.ts +4 -4
- package/dist/types/managers/kup-objects/kup-objects.d.ts +201 -201
- package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +16 -16
- package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +55 -55
- package/dist/types/managers/kup-search/kup-search-declarations.d.ts +1 -1
- package/dist/types/managers/kup-search/kup-search.d.ts +13 -13
- package/dist/types/managers/kup-theme/kup-theme-declarations.d.ts +99 -99
- package/dist/types/managers/kup-theme/kup-theme.d.ts +119 -119
- package/dist/types/managers/kup-toolbar/kup-toolbar-declarations.d.ts +3 -3
- package/dist/types/managers/kup-toolbar/kup-toolbar.d.ts +32 -32
- package/dist/types/managers/kup-tooltip/kup-tooltip-declarations.d.ts +4 -4
- package/dist/types/managers/kup-tooltip/kup-tooltip.d.ts +43 -43
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/dist/types/types/GenericTypes.d.ts +74 -74
- package/dist/types/utils/filters/filters-column-menu.d.ts +86 -86
- package/dist/types/utils/filters/filters-declarations.d.ts +13 -13
- package/dist/types/utils/filters/filters-rows.d.ts +17 -17
- package/dist/types/utils/filters/filters-tree-items.d.ts +7 -7
- package/dist/types/utils/filters/filters.d.ts +62 -62
- package/dist/types/utils/kup-column-menu/kup-column-menu-declarations.d.ts +14 -14
- package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +126 -126
- package/package.json +12 -16
- package/dist/cjs/f-button-9ccadd52.js +0 -105
- package/dist/cjs/f-cell-3130506f.js +0 -670
- package/dist/cjs/f-checkbox-9d2635d9.js +0 -29
- package/dist/cjs/f-chip-beb7af58.js +0 -133
- package/dist/cjs/f-image-66a3c3c1.js +0 -115
- package/dist/cjs/f-paginator-utils-c475e07f.js +0 -1576
- package/dist/cjs/f-text-field-c74856ff.js +0 -216
- package/dist/esm/f-button-0bce6587.js +0 -103
- package/dist/esm/f-cell-88d375e1.js +0 -664
- package/dist/esm/f-checkbox-31219c42.js +0 -27
- package/dist/esm/f-chip-ef0d4130.js +0 -131
- package/dist/esm/f-image-727453df.js +0 -113
- package/dist/esm/f-paginator-utils-4524e41c.js +0 -1563
- package/dist/esm/f-text-field-7b4d622c.js +0 -214
- package/dist/ketchup/p-042e1ed0.entry.js +0 -1
- package/dist/ketchup/p-0dc763af.entry.js +0 -1
- package/dist/ketchup/p-1ae879af.entry.js +0 -1
- package/dist/ketchup/p-1db0c862.entry.js +0 -1
- package/dist/ketchup/p-20458088.js +0 -30
- package/dist/ketchup/p-20c1a69f.entry.js +0 -1
- package/dist/ketchup/p-267dd24a.entry.js +0 -9
- package/dist/ketchup/p-2849af6f.js +0 -1
- package/dist/ketchup/p-30938d5a.entry.js +0 -1
- package/dist/ketchup/p-4067c71b.js +0 -2
- package/dist/ketchup/p-61f71872.entry.js +0 -1
- package/dist/ketchup/p-6b33f5de.entry.js +0 -1
- package/dist/ketchup/p-7f64b612.entry.js +0 -1
- package/dist/ketchup/p-90db42e6.entry.js +0 -1
- package/dist/ketchup/p-9cc1c76b.entry.js +0 -1
- package/dist/ketchup/p-9d3d8690.js +0 -1
- package/dist/ketchup/p-b4ba27da.entry.js +0 -1
- package/dist/ketchup/p-c046fd1c.entry.js +0 -1
- package/dist/ketchup/p-c120043a.entry.js +0 -1
- package/dist/ketchup/p-d520d757.entry.js +0 -1
- package/dist/ketchup/p-e9bc0749.entry.js +0 -1
- package/dist/ketchup/p-edd88921.entry.js +0 -1
- package/dist/ketchup/p-f67ee60f.entry.js +0 -25
- package/dist/ketchup/p-f6844304.entry.js +0 -1
- package/dist/ketchup/p-f8213d22.entry.js +0 -1
- /package/dist/ketchup/{p-cd2af1a6.js → p-b3577066.js} +0 -0
- /package/dist/ketchup/{p-b00f3575.js → p-c634eb82.js} +0 -0
|
@@ -0,0 +1,1577 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const kupManager = require('./kup-manager-5106d5c6.js');
|
|
4
|
+
const kupDates = require('./kup-dates-0e59b05d.js');
|
|
5
|
+
const index = require('./index-8f2f4159.js');
|
|
6
|
+
const fButton = require('./f-button-4bef0f8e.js');
|
|
7
|
+
const fButtonDeclarations = require('./f-button-declarations-51ef6d9a.js');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Filtering algorithms related to column menus.
|
|
11
|
+
* @module FiltersColumnMenu
|
|
12
|
+
* @todo Should contain EVERY column-specific filtering method.
|
|
13
|
+
*/
|
|
14
|
+
class FiltersColumnMenu extends kupManager.Filters {
|
|
15
|
+
/**
|
|
16
|
+
* Gets the value of the filter prop.
|
|
17
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
18
|
+
* @param {string} column - Name of the column.
|
|
19
|
+
* @returns {string} Value of the filter.
|
|
20
|
+
*/
|
|
21
|
+
getTextFilterValue(filters = {}, column) {
|
|
22
|
+
return this._getTextFilterValue(filters, column, false);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Gets the value of the filter prop, set temporarly.
|
|
26
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
27
|
+
* @param {string} column - Name of the column.
|
|
28
|
+
* @returns {string} Value of the filter.
|
|
29
|
+
*/
|
|
30
|
+
getTextFilterValueTmp(filters = {}, column) {
|
|
31
|
+
return this._getTextFilterValue(filters, column, true);
|
|
32
|
+
}
|
|
33
|
+
_getTextFilterValue(filters = {}, column, tmp) {
|
|
34
|
+
let value = '';
|
|
35
|
+
if (filters == null) {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
let filter = filters[column];
|
|
39
|
+
if (filter == null) {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
value = tmp ? filter.textFieldTmp : filter.textField;
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns whether a column has filters or not.
|
|
47
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
48
|
+
* @param {KupDataColumn} column - Name of the column.
|
|
49
|
+
* @returns {boolean} True when a given column has filters.
|
|
50
|
+
*/
|
|
51
|
+
hasFiltersForColumn(filters = {}, column) {
|
|
52
|
+
return this._hasFiltersForColumn(filters, column, false);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Returns whether a column has filters or not.
|
|
56
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
57
|
+
* @param {KupDataColumn} column - Name of the column.
|
|
58
|
+
* @returns {boolean} True when a given column has filters.
|
|
59
|
+
*/
|
|
60
|
+
hasFiltersForColumnTmp(filters = {}, column) {
|
|
61
|
+
return this._hasFiltersForColumn(filters, column, true);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Returns whether a column has filters or not.
|
|
65
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
66
|
+
* @param {KupDataColumn} column - Name of the column.
|
|
67
|
+
* @returns {boolean} True when a given column has filters.
|
|
68
|
+
*/
|
|
69
|
+
_hasFiltersForColumn(filters = {}, column, tmp) {
|
|
70
|
+
if (!column) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
let textfield = this._getTextFilterValue(filters, column.name, tmp);
|
|
74
|
+
if (textfield != null && textfield.trim() != '') {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if (this._hasIntervalTextFieldFilterValues(filters, column, tmp)) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
let checkboxes = this.getCheckBoxFilterValues(filters, column.name);
|
|
81
|
+
if (checkboxes == null || checkboxes.length < 1) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Returns the values of column menu's checkboxes.
|
|
88
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
89
|
+
* @param {string} column - Name of the column.
|
|
90
|
+
* @returns {Array<string>} Array of checkboxes values.
|
|
91
|
+
*/
|
|
92
|
+
getCheckBoxFilterValues(filters = {}, column) {
|
|
93
|
+
let values = [];
|
|
94
|
+
if (filters == null) {
|
|
95
|
+
return values;
|
|
96
|
+
}
|
|
97
|
+
let filter = filters[column];
|
|
98
|
+
if (filter == null) {
|
|
99
|
+
return values;
|
|
100
|
+
}
|
|
101
|
+
if (filter.checkBoxes == null) {
|
|
102
|
+
return values;
|
|
103
|
+
}
|
|
104
|
+
values = filter.checkBoxes;
|
|
105
|
+
return values;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns whether a text field should be a date or time picker.
|
|
109
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
110
|
+
* @param {KupDataColumn} column - Name of the column.
|
|
111
|
+
* @returns {boolean} True when the text field is a date or time picker.
|
|
112
|
+
*/
|
|
113
|
+
hasIntervalTextFieldFilterValues(filters = {}, column) {
|
|
114
|
+
return this._hasIntervalTextFieldFilterValues(filters, column, false);
|
|
115
|
+
}
|
|
116
|
+
hasIntervalTextFieldFilterValuesTmp(filters = {}, column) {
|
|
117
|
+
return this._hasIntervalTextFieldFilterValues(filters, column, true);
|
|
118
|
+
}
|
|
119
|
+
_hasIntervalTextFieldFilterValues(filters = {}, column, tmp) {
|
|
120
|
+
if (column == null) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
if (!this.isColumnFiltrableByInterval(column)) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
let intervalFrom = this._getIntervalTextFieldFilterValue(filters, column.name, kupManager.FilterInterval.FROM, tmp);
|
|
127
|
+
if (intervalFrom != null && intervalFrom.trim() != '') {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
let intervalTo = this._getIntervalTextFieldFilterValue(filters, column.name, kupManager.FilterInterval.TO, tmp);
|
|
131
|
+
if (intervalTo != null && intervalTo.trim() != '') {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Triggers when a new filter checkbox becomes checked.
|
|
138
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
139
|
+
* @param {string} column - Name of the column.
|
|
140
|
+
* @param {ValueDisplayedValue} newFilter - Added filter.
|
|
141
|
+
*/
|
|
142
|
+
addCheckboxFilter(filters = {}, column, newFilterItem) {
|
|
143
|
+
if (filters == null) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
let filter = filters[column];
|
|
147
|
+
if (filter == null) {
|
|
148
|
+
filter = {
|
|
149
|
+
textField: '',
|
|
150
|
+
textFieldTmp: '',
|
|
151
|
+
checkBoxes: [],
|
|
152
|
+
interval: null,
|
|
153
|
+
intervalTmp: null,
|
|
154
|
+
};
|
|
155
|
+
filters[column] = filter;
|
|
156
|
+
}
|
|
157
|
+
if (filter.checkBoxes == null) {
|
|
158
|
+
filter.checkBoxes = [];
|
|
159
|
+
}
|
|
160
|
+
if (newFilterItem == null || newFilterItem.value == null) {
|
|
161
|
+
filter.checkBoxes = [];
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
if (!kupManager.Filters.valuesArrayContainsValue(filter.checkBoxes, newFilterItem.value)) {
|
|
165
|
+
filter.checkBoxes[filter.checkBoxes.length] = newFilterItem;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Triggers when a filter checkbox becomes unchecked.
|
|
171
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
172
|
+
* @param {string} column - Name of the column.
|
|
173
|
+
* @param {string} remFilter - Removed filter.
|
|
174
|
+
*/
|
|
175
|
+
removeCheckboxFilter(filters = {}, column, remFilter) {
|
|
176
|
+
if (filters == null || remFilter == null) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
let filter = filters[column];
|
|
180
|
+
if (filter == null) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (filter.checkBoxes == null) {
|
|
184
|
+
filter.checkBoxes = [];
|
|
185
|
+
}
|
|
186
|
+
let index = kupManager.Filters.indexOfValueInValuesArray(filter.checkBoxes, remFilter);
|
|
187
|
+
if (index >= 0) {
|
|
188
|
+
let chs = [];
|
|
189
|
+
for (let i = 0; i < filter.checkBoxes.length; i++) {
|
|
190
|
+
if (i != index) {
|
|
191
|
+
chs[chs.length] = filter.checkBoxes[i];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
filter.checkBoxes = [...chs];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
isColumnFiltrableByInterval(column) {
|
|
198
|
+
return this.isObjFiltrableByInterval(column.obj);
|
|
199
|
+
}
|
|
200
|
+
getIntervalTextFieldFilterValues(filters = {}, column) {
|
|
201
|
+
return this._getIntervalTextFieldFilterValues(filters, column, false);
|
|
202
|
+
}
|
|
203
|
+
getIntervalTextFieldFilterValuesTmp(filters = {}, column) {
|
|
204
|
+
return this._getIntervalTextFieldFilterValues(filters, column, true);
|
|
205
|
+
}
|
|
206
|
+
_getIntervalTextFieldFilterValues(filters = {}, column, tmp) {
|
|
207
|
+
if (!this._hasIntervalTextFieldFilterValues(filters, column, tmp)) {
|
|
208
|
+
return ['', ''];
|
|
209
|
+
}
|
|
210
|
+
let values = [
|
|
211
|
+
this._getIntervalTextFieldFilterValue(filters, column.name, kupManager.FilterInterval.FROM, tmp),
|
|
212
|
+
this._getIntervalTextFieldFilterValue(filters, column.name, kupManager.FilterInterval.TO, tmp),
|
|
213
|
+
];
|
|
214
|
+
return values;
|
|
215
|
+
}
|
|
216
|
+
getIntervalTextFieldFilterValue(filters = {}, column, index) {
|
|
217
|
+
return this._getIntervalTextFieldFilterValue(filters, column, index, false);
|
|
218
|
+
}
|
|
219
|
+
getIntervalTextFieldFilterValueTmp(filters = {}, column, index) {
|
|
220
|
+
return this._getIntervalTextFieldFilterValue(filters, column, index, true);
|
|
221
|
+
}
|
|
222
|
+
_getIntervalTextFieldFilterValue(filters = {}, column, index, tmp) {
|
|
223
|
+
let value = '';
|
|
224
|
+
if (filters == null) {
|
|
225
|
+
return value;
|
|
226
|
+
}
|
|
227
|
+
let filter = filters[column];
|
|
228
|
+
if (filter == null) {
|
|
229
|
+
return value;
|
|
230
|
+
}
|
|
231
|
+
if (tmp && filter.intervalTmp == null) {
|
|
232
|
+
return value;
|
|
233
|
+
}
|
|
234
|
+
if (!tmp && filter.interval == null) {
|
|
235
|
+
return value;
|
|
236
|
+
}
|
|
237
|
+
value = tmp ? filter.intervalTmp[index] : filter.interval[index];
|
|
238
|
+
return value;
|
|
239
|
+
}
|
|
240
|
+
setTextFieldFilterValue(filters = {}, column, newFilter) {
|
|
241
|
+
this._setTextFieldFilterValue(filters, column, newFilter, true);
|
|
242
|
+
}
|
|
243
|
+
_setTextFieldFilterValue(filters = {}, column, newFilter, tmp) {
|
|
244
|
+
if (filters == null) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
let filter = filters[column];
|
|
248
|
+
if (filter == null) {
|
|
249
|
+
filter = {
|
|
250
|
+
textField: '',
|
|
251
|
+
textFieldTmp: '',
|
|
252
|
+
checkBoxes: [],
|
|
253
|
+
interval: null,
|
|
254
|
+
intervalTmp: null,
|
|
255
|
+
};
|
|
256
|
+
filters[column] = filter;
|
|
257
|
+
}
|
|
258
|
+
if (tmp) {
|
|
259
|
+
filter.textFieldTmp =
|
|
260
|
+
newFilter != null ? newFilter.trim() : newFilter;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
filter.textField = newFilter != null ? newFilter.trim() : newFilter;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
setIntervalTextFieldFilterValue(filters = {}, column, newFilter, index) {
|
|
267
|
+
this._setIntervalTextFieldFilterValue(filters, column, newFilter, index, true);
|
|
268
|
+
}
|
|
269
|
+
_setIntervalTextFieldFilterValue(filters = {}, column, newFilter, index, tmp) {
|
|
270
|
+
if (filters == null) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
let filter = filters[column];
|
|
274
|
+
if (filter == null) {
|
|
275
|
+
filter = {
|
|
276
|
+
textField: '',
|
|
277
|
+
textFieldTmp: '',
|
|
278
|
+
checkBoxes: [],
|
|
279
|
+
interval: null,
|
|
280
|
+
intervalTmp: null,
|
|
281
|
+
};
|
|
282
|
+
filters[column] = filter;
|
|
283
|
+
}
|
|
284
|
+
if (filter.interval == null) {
|
|
285
|
+
filter.interval = [];
|
|
286
|
+
filter.interval.push('', '');
|
|
287
|
+
}
|
|
288
|
+
if (filter.intervalTmp == null) {
|
|
289
|
+
filter.intervalTmp = [];
|
|
290
|
+
filter.intervalTmp.push('', '');
|
|
291
|
+
}
|
|
292
|
+
if (tmp) {
|
|
293
|
+
filter.intervalTmp[index] =
|
|
294
|
+
newFilter != null ? newFilter.trim() : newFilter;
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
filter.interval[index] =
|
|
298
|
+
newFilter != null ? newFilter.trim() : newFilter;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
saveTextualFilters(filters = {}, column) {
|
|
302
|
+
this._setTextFieldFilterValue(filters, column, this.getTextFilterValueTmp(filters, column), false);
|
|
303
|
+
this._setIntervalTextFieldFilterValue(filters, column, this.getIntervalTextFieldFilterValueTmp(filters, column, kupManager.FilterInterval.FROM), kupManager.FilterInterval.FROM, false);
|
|
304
|
+
this._setIntervalTextFieldFilterValue(filters, column, this.getIntervalTextFieldFilterValueTmp(filters, column, kupManager.FilterInterval.TO), kupManager.FilterInterval.TO, false);
|
|
305
|
+
}
|
|
306
|
+
resetTextualFilters(filters = {}, column) {
|
|
307
|
+
this._setTextFieldFilterValue(filters, column, this.getTextFilterValue(filters, column), true);
|
|
308
|
+
this._setIntervalTextFieldFilterValue(filters, column, this.getIntervalTextFieldFilterValue(filters, column, kupManager.FilterInterval.FROM), kupManager.FilterInterval.FROM, true);
|
|
309
|
+
this._setIntervalTextFieldFilterValue(filters, column, this.getIntervalTextFieldFilterValue(filters, column, kupManager.FilterInterval.TO), kupManager.FilterInterval.TO, true);
|
|
310
|
+
}
|
|
311
|
+
getFilterValueForTooltip(filters = {}, column) {
|
|
312
|
+
let txtFilter = this.getTextFilterValue(filters, column.name);
|
|
313
|
+
let interval = this.getIntervalTextFieldFilterValues(filters, column);
|
|
314
|
+
let chkFilters = this.getCheckBoxFilterValues(filters, column.name);
|
|
315
|
+
let separator = '';
|
|
316
|
+
let txtFiterRis = kupManager.getValueForDisplay(txtFilter, column.obj, column.decimals);
|
|
317
|
+
if (txtFilter != '') {
|
|
318
|
+
separator = ' AND ';
|
|
319
|
+
}
|
|
320
|
+
if (interval[kupManager.FilterInterval.FROM] != '') {
|
|
321
|
+
txtFiterRis +=
|
|
322
|
+
separator +
|
|
323
|
+
'(>= ' +
|
|
324
|
+
kupManager.getValueForDisplay(interval[kupManager.FilterInterval.FROM], column.obj, column.decimals) +
|
|
325
|
+
')';
|
|
326
|
+
separator = ' AND ';
|
|
327
|
+
}
|
|
328
|
+
if (interval[kupManager.FilterInterval.TO] != '') {
|
|
329
|
+
txtFiterRis +=
|
|
330
|
+
separator +
|
|
331
|
+
'(<= ' +
|
|
332
|
+
kupManager.getValueForDisplay(interval[kupManager.FilterInterval.TO], column.obj, column.decimals) +
|
|
333
|
+
')';
|
|
334
|
+
separator = ' AND ';
|
|
335
|
+
}
|
|
336
|
+
separator = '';
|
|
337
|
+
let ris = '';
|
|
338
|
+
chkFilters.forEach((f) => {
|
|
339
|
+
ris += separator + kupManager.getValueForDisplay2(f, column);
|
|
340
|
+
separator = ' OR ';
|
|
341
|
+
});
|
|
342
|
+
if (ris != '') {
|
|
343
|
+
ris = '(' + ris + ')';
|
|
344
|
+
if (txtFiterRis != '') {
|
|
345
|
+
ris = ' AND ' + ris;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
ris = txtFiterRis + ris;
|
|
349
|
+
return ris;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Triggers when a filter must be removed, for column.
|
|
353
|
+
* @param {GenericFilter} filters - Filters of the component.
|
|
354
|
+
* @param {string} column - Name of the column.
|
|
355
|
+
*/
|
|
356
|
+
removeFilter(filters = {}, column) {
|
|
357
|
+
filters[column] = {
|
|
358
|
+
textField: '',
|
|
359
|
+
textFieldTmp: '',
|
|
360
|
+
checkBoxes: [],
|
|
361
|
+
interval: null,
|
|
362
|
+
intervalTmp: null,
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Props of the kup-tree component.
|
|
369
|
+
* Used to export every prop in an object.
|
|
370
|
+
*/
|
|
371
|
+
exports.KupTreeProps = void 0;
|
|
372
|
+
(function (KupTreeProps) {
|
|
373
|
+
KupTreeProps["asAccordion"] = "When enabled, the first level of depth will give an accordion look to nodes.";
|
|
374
|
+
KupTreeProps["columns"] = "The columns of the tree when tree visualization is active.";
|
|
375
|
+
KupTreeProps["customStyle"] = "Custom style of the component.";
|
|
376
|
+
KupTreeProps["data"] = "The json data used to populate the tree view: the basic, always visible tree nodes.";
|
|
377
|
+
KupTreeProps["density"] = "The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.";
|
|
378
|
+
KupTreeProps["dynamicExpansionCallback"] = "Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.";
|
|
379
|
+
KupTreeProps["enableExtraColumns"] = "Enables adding extra columns.";
|
|
380
|
+
KupTreeProps["expanded"] = "Flag: the nodes of the whole tree must be already expanded upon loading. Disabled nodes do NOT get expanded.";
|
|
381
|
+
KupTreeProps["expansionMode"] = "Behavior of nodes' expansion: it can be chosen between expanding a node by clicking on the dropdown icon, or by clicking on the whole node.";
|
|
382
|
+
KupTreeProps["filters"] = "List of filters set by the user.";
|
|
383
|
+
KupTreeProps["globalFilter"] = "When set to true it activates the global filter.";
|
|
384
|
+
KupTreeProps["globalFilterValue"] = "The value of the global filter.";
|
|
385
|
+
KupTreeProps["globalFilterMode"] = "The mode of the global filter.";
|
|
386
|
+
KupTreeProps["removableColumns"] = "Sets the possibility to remove the selected column.";
|
|
387
|
+
KupTreeProps["preventXScroll"] = "Experimental feature: when active, the tree will try to prevent horizontal overflowing elements by setting a width on the content of the table cells. It works only on cells of the main column.";
|
|
388
|
+
KupTreeProps["ripple"] = "When enabled displays Material's ripple effect on nodes (only when no columns are displayed).";
|
|
389
|
+
KupTreeProps["scrollOnHover"] = "Activates the scroll on hover function.";
|
|
390
|
+
KupTreeProps["showColumns"] = "Shows the tree data as a table.";
|
|
391
|
+
KupTreeProps["showFilters"] = "When set to true enables the column filters.";
|
|
392
|
+
KupTreeProps["showFooter"] = "When set to true shows the footer.";
|
|
393
|
+
KupTreeProps["showHeader"] = "Flag: shows the header of the tree when the tree is displayed as a table.";
|
|
394
|
+
KupTreeProps["showIcons"] = "Shows the icons of the nodes.";
|
|
395
|
+
KupTreeProps["stateId"] = "";
|
|
396
|
+
KupTreeProps["store"] = "";
|
|
397
|
+
KupTreeProps["totals"] = "Defines the current totals options.";
|
|
398
|
+
KupTreeProps["useDynamicExpansion"] = "When the component must use the dynamic expansion feature to open its nodes, it means that not all the nodes of the tree have been passed inside the data property. Therefore, when expanding a node, the tree must emit an event (or run a given callback) and wait for the child nodes to be downloaded from the server.";
|
|
399
|
+
})(exports.KupTreeProps || (exports.KupTreeProps = {}));
|
|
400
|
+
/**
|
|
401
|
+
* The name of the constant used by the tree component to identify the main tree in column menu
|
|
402
|
+
* @constant
|
|
403
|
+
*/
|
|
404
|
+
const treeMainColumnName = 'TREE_COLUMN';
|
|
405
|
+
exports.KupTreeExpansionMode = void 0;
|
|
406
|
+
(function (KupTreeExpansionMode) {
|
|
407
|
+
KupTreeExpansionMode["DROPDOWN"] = "dropdown";
|
|
408
|
+
KupTreeExpansionMode["NODE"] = "node";
|
|
409
|
+
})(exports.KupTreeExpansionMode || (exports.KupTreeExpansionMode = {}));
|
|
410
|
+
|
|
411
|
+
const dom$3 = document.documentElement;
|
|
412
|
+
const kupObjects = dom$3.ketchup
|
|
413
|
+
? dom$3.ketchup.objects
|
|
414
|
+
: new kupManager.KupObjects();
|
|
415
|
+
const kupData = dom$3.ketchup ? dom$3.ketchup.data : new kupManager.KupData();
|
|
416
|
+
/**
|
|
417
|
+
* Filtering algorithms related to data-table rows.
|
|
418
|
+
* @module FiltersRows
|
|
419
|
+
* @todo Should contain EVERY row-specific filtering method.
|
|
420
|
+
*/
|
|
421
|
+
class FiltersRows extends kupManager.Filters {
|
|
422
|
+
isFilterCompliantForCell(cellValue, filterValue, interval) {
|
|
423
|
+
if (!cellValue) {
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
return this.isFilterCompliantForSimpleValue(cellValue.value, cellValue.obj, filterValue, interval);
|
|
427
|
+
}
|
|
428
|
+
isFilterCompliantForCellObj(cellValue, filterValue, interval) {
|
|
429
|
+
if (!cellValue) {
|
|
430
|
+
return false;
|
|
431
|
+
}
|
|
432
|
+
if (!cellValue.obj) {
|
|
433
|
+
return false;
|
|
434
|
+
}
|
|
435
|
+
return this.isFilterCompliantForSimpleValue(cellValue.obj.k, cellValue.obj, filterValue, interval);
|
|
436
|
+
}
|
|
437
|
+
isRowCompliant(r, filters = {}, globalFilter = '', isUsingGlobalFilter = false, columns = [], columnFilters) {
|
|
438
|
+
return this.areCellsCompliant(r.cells, filters, globalFilter, isUsingGlobalFilter, columns, columnFilters);
|
|
439
|
+
}
|
|
440
|
+
areCellsCompliant(cells, filters = {}, globalFilter = '', isUsingGlobalFilter = false, columns = [], columnFilters) {
|
|
441
|
+
if (isUsingGlobalFilter) {
|
|
442
|
+
let retValue = true;
|
|
443
|
+
// There are no columns -> display element
|
|
444
|
+
if (columns && columns != null && columns.length > 0) {
|
|
445
|
+
retValue = false;
|
|
446
|
+
let _filterIsNegative = this.filterIsNegative(globalFilter);
|
|
447
|
+
// Search among all visible columns for the global filter
|
|
448
|
+
for (let i = 0; i < columns.length; i++) {
|
|
449
|
+
if (columns[i].visible == false) {
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
const cell = cells[columns[i].name];
|
|
453
|
+
if (cell == null) {
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
retValue = this.isFilterCompliantForValue(cell.value, globalFilter);
|
|
457
|
+
let displayedValue = kupManager.getCellValueForDisplay(columns[i], cell);
|
|
458
|
+
if (displayedValue != cell.value) {
|
|
459
|
+
retValue =
|
|
460
|
+
retValue ||
|
|
461
|
+
this.isFilterCompliantForValue(displayedValue, globalFilter);
|
|
462
|
+
}
|
|
463
|
+
if (retValue == true && !_filterIsNegative) {
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
if (retValue == false && _filterIsNegative) {
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (!retValue) {
|
|
472
|
+
return false;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if (columnFilters == null) {
|
|
476
|
+
columnFilters = new FiltersColumnMenu();
|
|
477
|
+
}
|
|
478
|
+
// There are no filters to check -> the element is valid
|
|
479
|
+
if (!this.hasFilters(filters, columns, columnFilters)) {
|
|
480
|
+
return true;
|
|
481
|
+
}
|
|
482
|
+
let keys = Object.keys(filters);
|
|
483
|
+
// Filters
|
|
484
|
+
for (let i = 0; i < keys.length; i++) {
|
|
485
|
+
let key = keys[i];
|
|
486
|
+
const cell = cells[key];
|
|
487
|
+
if (!cell) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
let filterValue = columnFilters.getTextFilterValue(filters, key);
|
|
491
|
+
let interval = columnFilters.getIntervalTextFieldFilterValues(filters, kupManager.getColumnByName(columns, key));
|
|
492
|
+
const _filterIsNegative = this.filterIsNegative(filterValue);
|
|
493
|
+
let b1 = this.isFilterCompliantForCell(cell, filterValue, interval);
|
|
494
|
+
let b2 = _filterIsNegative;
|
|
495
|
+
if (!kupObjects.isNumber(cell.obj) &&
|
|
496
|
+
!kupObjects.isDate(cell.obj) &&
|
|
497
|
+
!kupObjects.isTime(cell.obj) &&
|
|
498
|
+
!kupObjects.isTimestamp(cell.obj)) {
|
|
499
|
+
b2 = this.isFilterCompliantForCellObj(cell, filterValue, interval);
|
|
500
|
+
}
|
|
501
|
+
if (_filterIsNegative) {
|
|
502
|
+
if (!b1 || !b2) {
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
if (!b1 && !b2) {
|
|
508
|
+
return false;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
let filterValues = columnFilters.getCheckBoxFilterValues(filters, key);
|
|
512
|
+
if (filterValues.length == 0) {
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
let retValue = false;
|
|
516
|
+
for (let i = 0; i < filterValues.length; i++) {
|
|
517
|
+
let fv = filterValues[i];
|
|
518
|
+
if (fv == null || fv.value == null) {
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
if (cell.value != null) {
|
|
522
|
+
if (cell.value.toLowerCase().trim() ==
|
|
523
|
+
fv.value.toLowerCase().trim()) {
|
|
524
|
+
retValue = true;
|
|
525
|
+
break;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
if (cell.obj != null) {
|
|
529
|
+
if (cell.obj.k.toLowerCase().trim() ==
|
|
530
|
+
fv.value.toLowerCase().trim()) {
|
|
531
|
+
retValue = true;
|
|
532
|
+
break;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
if (!retValue) {
|
|
537
|
+
return false;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
542
|
+
hasFilters(filters = {}, columns, columnFilters) {
|
|
543
|
+
if (filters == null) {
|
|
544
|
+
return false;
|
|
545
|
+
}
|
|
546
|
+
let keys = Object.keys(filters);
|
|
547
|
+
if (keys == null || keys.length < 1) {
|
|
548
|
+
return false;
|
|
549
|
+
}
|
|
550
|
+
if (columnFilters == null) {
|
|
551
|
+
columnFilters = new FiltersColumnMenu();
|
|
552
|
+
}
|
|
553
|
+
for (let i = 0; i < keys.length; i++) {
|
|
554
|
+
let key = keys[i];
|
|
555
|
+
let col = null;
|
|
556
|
+
if (key === treeMainColumnName) {
|
|
557
|
+
col = {
|
|
558
|
+
name: treeMainColumnName,
|
|
559
|
+
title: '',
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
col = kupManager.getColumnByName(columns, key);
|
|
564
|
+
}
|
|
565
|
+
if (columnFilters.hasFiltersForColumn(filters, col)) {
|
|
566
|
+
return true;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
return false;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Filters the rows data of a data-table component according to the parameters
|
|
573
|
+
*
|
|
574
|
+
* @param rows - The data of the rows to filter.
|
|
575
|
+
* @param filters - The the filters for each column.
|
|
576
|
+
* @param globalFilter - A global filter applied to all columns.
|
|
577
|
+
* @param columns - The colmns on which the filter will take effect.
|
|
578
|
+
* @todo This function can be improved in its speed by a refactor in which from two different cycles of execution for
|
|
579
|
+
* single filters and global filter, all controls on a single column are done in a single cycle.
|
|
580
|
+
*/
|
|
581
|
+
filterRows(rows = [], filters = {}, globalFilter = '', columns = [], columnFilters) {
|
|
582
|
+
if (!rows || rows == null) {
|
|
583
|
+
return [];
|
|
584
|
+
}
|
|
585
|
+
// There are rows to filter
|
|
586
|
+
let filteredRows = [];
|
|
587
|
+
const isUsingGlobalFilter = !!(globalFilter && columns);
|
|
588
|
+
if (this.hasFilters(filters, columns, columnFilters) ||
|
|
589
|
+
isUsingGlobalFilter) {
|
|
590
|
+
for (let i = 0; i < rows.length; i++) {
|
|
591
|
+
let r = rows[i];
|
|
592
|
+
if ((r.id && r.id.indexOf('insert_') > -1) ||
|
|
593
|
+
this.isRowCompliant(r, filters, globalFilter, isUsingGlobalFilter, columns, columnFilters)) {
|
|
594
|
+
filteredRows[filteredRows.length] = r;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
filteredRows = [...rows];
|
|
600
|
+
}
|
|
601
|
+
return filteredRows;
|
|
602
|
+
}
|
|
603
|
+
getColumnValues(comp, column, globalFilterValue, columnFilters) {
|
|
604
|
+
let values = new Array();
|
|
605
|
+
if (columnFilters == null) {
|
|
606
|
+
columnFilters = new FiltersColumnMenu();
|
|
607
|
+
}
|
|
608
|
+
let value = columnFilters.getTextFilterValueTmp(comp.filters, column.name);
|
|
609
|
+
let interval = columnFilters.getIntervalTextFieldFilterValuesTmp(comp.filters, column);
|
|
610
|
+
let checkboxes = columnFilters.getCheckBoxFilterValues(comp.filters, column.name);
|
|
611
|
+
if (column.valuesForFilter != null &&
|
|
612
|
+
column.valuesForFilter.length > 0) {
|
|
613
|
+
column.valuesForFilter.forEach((element) => {
|
|
614
|
+
let v = element;
|
|
615
|
+
if (kupManager.Filters.valuesArrayContainsValue(checkboxes, v) ||
|
|
616
|
+
value == '' ||
|
|
617
|
+
columnFilters.isFilterCompliantForSimpleValue(v, column.obj, value, interval)) {
|
|
618
|
+
values.push({
|
|
619
|
+
value: v,
|
|
620
|
+
displayedValue: kupManager.getValueForDisplay(v, column.obj, column.decimals),
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
return values;
|
|
625
|
+
}
|
|
626
|
+
/** è necessario estrarre i valori della colonna di tutte le righe
|
|
627
|
+
* filtrate SENZA il filtro della colonna stessa corrente */
|
|
628
|
+
let tmpFilters = Object.assign({}, comp.filters);
|
|
629
|
+
tmpFilters[column.name] = {
|
|
630
|
+
textField: value,
|
|
631
|
+
textFieldTmp: value,
|
|
632
|
+
checkBoxes: [],
|
|
633
|
+
interval: interval,
|
|
634
|
+
intervalTmp: interval,
|
|
635
|
+
};
|
|
636
|
+
let tmpRows = this.filterRows(comp.getRows(), tmpFilters, globalFilterValue, comp.getVisibleColumns(), columnFilters);
|
|
637
|
+
for (let i = 0; i < checkboxes.length; i++) {
|
|
638
|
+
values.push(checkboxes[i]);
|
|
639
|
+
}
|
|
640
|
+
return kupData.cell.getUnivocalValue({ rows: tmpRows }, column, true);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
const dom$2 = document.documentElement;
|
|
645
|
+
function sortRows(rows = [], sort = []) {
|
|
646
|
+
if (!rows || rows.length === 0) {
|
|
647
|
+
return [];
|
|
648
|
+
}
|
|
649
|
+
// check if row is group
|
|
650
|
+
if (rows[0].group) {
|
|
651
|
+
return sortGroupRows(rows, sort);
|
|
652
|
+
}
|
|
653
|
+
// sorting rows
|
|
654
|
+
if (!sort || sort.length === 0) {
|
|
655
|
+
// no sort -> return rows as they are
|
|
656
|
+
return rows;
|
|
657
|
+
}
|
|
658
|
+
// check multiple sort
|
|
659
|
+
const isMultiSort = sort.length > 1;
|
|
660
|
+
// sorting rows
|
|
661
|
+
return rows.slice(0).sort((r1, r2) => {
|
|
662
|
+
if (isMultiSort) {
|
|
663
|
+
for (let i = 0; i < sort.length; i++) {
|
|
664
|
+
const compare = compareRows(r1, r2, sort[i]);
|
|
665
|
+
if (compare !== 0) {
|
|
666
|
+
// not same row
|
|
667
|
+
return compare;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
// same row
|
|
671
|
+
return 0;
|
|
672
|
+
}
|
|
673
|
+
else {
|
|
674
|
+
return compareRows(r1, r2, sort[0]);
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
function sortGroupRows(rows = [], sort = []) {
|
|
679
|
+
if (!rows || rows.length === 0) {
|
|
680
|
+
return [];
|
|
681
|
+
}
|
|
682
|
+
// getting columm group
|
|
683
|
+
const groupColumn = rows[0].group.column;
|
|
684
|
+
// check if column is in sort
|
|
685
|
+
let sortObject = getSortOnColumn(groupColumn, sort);
|
|
686
|
+
if (!sortObject) {
|
|
687
|
+
sortObject = {
|
|
688
|
+
column: groupColumn,
|
|
689
|
+
sortMode: kupManager.SortMode.A,
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
// sorting rows
|
|
693
|
+
rows.sort((r1, r2) => {
|
|
694
|
+
// creating fake cells
|
|
695
|
+
const cell1 = {
|
|
696
|
+
obj: r1.group.obj,
|
|
697
|
+
value: r1.group.id,
|
|
698
|
+
};
|
|
699
|
+
const cell2 = {
|
|
700
|
+
obj: r2.group.obj,
|
|
701
|
+
value: r2.group.id,
|
|
702
|
+
};
|
|
703
|
+
return kupManager.compareCell(cell1, cell2, sortObject.sortMode);
|
|
704
|
+
});
|
|
705
|
+
// sorting children
|
|
706
|
+
rows.forEach((row) => {
|
|
707
|
+
row.group.children = sortRows(row.group.children, sort);
|
|
708
|
+
});
|
|
709
|
+
return rows;
|
|
710
|
+
}
|
|
711
|
+
function getSortOnColumn(column = '', sort = []) {
|
|
712
|
+
if (!column || !sort || sort.length === 0) {
|
|
713
|
+
return null;
|
|
714
|
+
}
|
|
715
|
+
for (let sortObject of sort) {
|
|
716
|
+
if (sortObject.column === column) {
|
|
717
|
+
return sortObject;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
return null;
|
|
721
|
+
}
|
|
722
|
+
function compareRows(r1, r2, sortObj) {
|
|
723
|
+
const cell1 = r1.cells[sortObj.column];
|
|
724
|
+
const cell2 = r2.cells[sortObj.column];
|
|
725
|
+
if (!cell1 && !cell2) {
|
|
726
|
+
return 0;
|
|
727
|
+
}
|
|
728
|
+
if (!cell1) {
|
|
729
|
+
return 1;
|
|
730
|
+
}
|
|
731
|
+
if (!cell2) {
|
|
732
|
+
return -1;
|
|
733
|
+
}
|
|
734
|
+
return kupManager.compareCell(cell1, cell2, sortObj.sortMode);
|
|
735
|
+
}
|
|
736
|
+
//-------- FILTER FUNCTIONS --------
|
|
737
|
+
/**
|
|
738
|
+
* Filters the rows data of a data-table component according to the parameters
|
|
739
|
+
*
|
|
740
|
+
* @param rows - The data of the rows to filter.
|
|
741
|
+
* @param filters - The the filters for each column.
|
|
742
|
+
* @param globalFilter - A global filter applied to all columns.
|
|
743
|
+
* @param columns - The colmns on which the filter will take effect.
|
|
744
|
+
* @todo This function can be improved in its speed by a refactor in which from two different cycles of execution for
|
|
745
|
+
* single filters and global filter, all controls on a single column are done in a single cycle.
|
|
746
|
+
*/
|
|
747
|
+
function filterRows(rows = [], filters = {}, globalFilter = '', columns = [], columnFilters, filtersRows) {
|
|
748
|
+
if (filtersRows == null) {
|
|
749
|
+
filtersRows = new FiltersRows();
|
|
750
|
+
}
|
|
751
|
+
return filtersRows.filterRows(rows, filters, globalFilter, columns, columnFilters);
|
|
752
|
+
}
|
|
753
|
+
function groupRows(columns = [], rows = [], groups = [], totals = {}) {
|
|
754
|
+
if (!rows) {
|
|
755
|
+
return [];
|
|
756
|
+
}
|
|
757
|
+
if (!groups || groups.length === 0 || !columns || columns.length === 0) {
|
|
758
|
+
return rows;
|
|
759
|
+
}
|
|
760
|
+
// Keeps label of the valid columns
|
|
761
|
+
const columnLabels = {};
|
|
762
|
+
// remove invalid groups and store column labels
|
|
763
|
+
const validGroups = groups.filter(({ column }) => {
|
|
764
|
+
for (let { name, title } of columns) {
|
|
765
|
+
if (name === column) {
|
|
766
|
+
// Store label of the columns
|
|
767
|
+
columnLabels[name] = title;
|
|
768
|
+
return true;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
return false;
|
|
772
|
+
});
|
|
773
|
+
if (validGroups.length === 0) {
|
|
774
|
+
// no valid groups
|
|
775
|
+
return rows;
|
|
776
|
+
}
|
|
777
|
+
// creating root
|
|
778
|
+
const groupRows = [];
|
|
779
|
+
// obj used to calculate the group distinct value
|
|
780
|
+
let distinctObj = {};
|
|
781
|
+
rows.forEach((row) => {
|
|
782
|
+
// getting column name from first group
|
|
783
|
+
const columnName = validGroups[0].column;
|
|
784
|
+
// getting row value
|
|
785
|
+
const cell = row.cells[columnName];
|
|
786
|
+
if (cell) {
|
|
787
|
+
const column = kupManager.getColumnByName(columns, columnName);
|
|
788
|
+
const cellValueForDisplay = kupManager.getCellValueForDisplay(column, cell);
|
|
789
|
+
const cellValue = cell.value;
|
|
790
|
+
let groupRow = null;
|
|
791
|
+
// check in already in groupedRow
|
|
792
|
+
for (let currentGroupRow of groupRows) {
|
|
793
|
+
if (currentGroupRow.group.label === cellValueForDisplay) {
|
|
794
|
+
groupRow = currentGroupRow;
|
|
795
|
+
break;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
if (groupRow === null) {
|
|
799
|
+
// create group row
|
|
800
|
+
groupRow = {
|
|
801
|
+
group: {
|
|
802
|
+
id: cellValue,
|
|
803
|
+
parent: null,
|
|
804
|
+
column: columnName,
|
|
805
|
+
columnLabel: columnLabels[columnName],
|
|
806
|
+
expanded: false,
|
|
807
|
+
label: cellValueForDisplay,
|
|
808
|
+
children: [],
|
|
809
|
+
obj: cell.obj,
|
|
810
|
+
totals: {},
|
|
811
|
+
},
|
|
812
|
+
cells: {},
|
|
813
|
+
};
|
|
814
|
+
// add group to list
|
|
815
|
+
groupRows.push(groupRow);
|
|
816
|
+
}
|
|
817
|
+
for (let i = 1; i < validGroups.length; i++) {
|
|
818
|
+
const group = validGroups[i];
|
|
819
|
+
// getting cell value
|
|
820
|
+
const tempCell = row.cells[group.column];
|
|
821
|
+
if (tempCell) {
|
|
822
|
+
const column = kupManager.getColumnByName(columns, group.column);
|
|
823
|
+
const tempCellValueForDisplay = kupManager.getCellValueForDisplay(column, tempCell);
|
|
824
|
+
const tempCellValue = tempCell.value;
|
|
825
|
+
// check if group already exists
|
|
826
|
+
let tempGroupingRow = null;
|
|
827
|
+
for (let j = 0; j < groupRow.group.children.length; j++) {
|
|
828
|
+
const childGroup = groupRow.group.children[j];
|
|
829
|
+
const groupLabel = childGroup.group.label;
|
|
830
|
+
if (groupLabel === tempCellValueForDisplay) {
|
|
831
|
+
tempGroupingRow = childGroup;
|
|
832
|
+
break;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
if (!tempGroupingRow) {
|
|
836
|
+
tempGroupingRow = {
|
|
837
|
+
cells: {},
|
|
838
|
+
group: {
|
|
839
|
+
id: tempCellValue,
|
|
840
|
+
parent: groupRow,
|
|
841
|
+
column: group.column,
|
|
842
|
+
columnLabel: columnLabels[group.column],
|
|
843
|
+
children: [],
|
|
844
|
+
expanded: false,
|
|
845
|
+
label: tempCellValueForDisplay,
|
|
846
|
+
totals: {},
|
|
847
|
+
obj: tempCell.obj,
|
|
848
|
+
},
|
|
849
|
+
};
|
|
850
|
+
adjustGroupId(tempGroupingRow);
|
|
851
|
+
groupRow.group.children.push(tempGroupingRow);
|
|
852
|
+
}
|
|
853
|
+
groupRow = tempGroupingRow;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
// adding row
|
|
857
|
+
groupRow.group.children.push(row);
|
|
858
|
+
updateGroupTotal(groupRow, totals, row, distinctObj);
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
adjustGroupsDistinct(groupRows, totals, distinctObj);
|
|
862
|
+
adjustGroupsAverageOrFormula(groupRows, kupManager.TotalMode.AVERAGE, totals);
|
|
863
|
+
adjustGroupsAverageOrFormula(groupRows, kupManager.TotalMode.MATH, totals);
|
|
864
|
+
return groupRows;
|
|
865
|
+
}
|
|
866
|
+
function updateGroupTotal(groupRow, totals, addedRow, distinctObj) {
|
|
867
|
+
if (!groupRow || !totals) {
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
const keys = Object.keys(totals);
|
|
871
|
+
if (keys.length === 0) {
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
keys.forEach((key) => {
|
|
875
|
+
const cell = addedRow.cells[key];
|
|
876
|
+
if (cell) {
|
|
877
|
+
const _isNumber = dom$2.ketchup.objects.isNumber(cell.obj);
|
|
878
|
+
const totalMode = totals[key];
|
|
879
|
+
switch (totalMode) {
|
|
880
|
+
case kupManager.TotalMode.COUNT:
|
|
881
|
+
let currentTotalValue = groupRow.group.totals[key] || 0;
|
|
882
|
+
groupRow.group.totals[key] = ++currentTotalValue;
|
|
883
|
+
// updating parents
|
|
884
|
+
let parent = groupRow.group.parent;
|
|
885
|
+
while (parent != null) {
|
|
886
|
+
let currentParentCount = parent.group.totals[key] || 0;
|
|
887
|
+
parent.group.totals[key] = ++currentParentCount;
|
|
888
|
+
parent = parent.group.parent;
|
|
889
|
+
}
|
|
890
|
+
break;
|
|
891
|
+
case kupManager.TotalMode.DISTINCT:
|
|
892
|
+
let cellValue;
|
|
893
|
+
if (_isNumber) {
|
|
894
|
+
cellValue = dom$2.ketchup.math.numberify(dom$2.ketchup.math.numberifySafe(cell.value));
|
|
895
|
+
}
|
|
896
|
+
else {
|
|
897
|
+
cellValue = cell.value;
|
|
898
|
+
}
|
|
899
|
+
let distinctGroup = distinctObj[groupRow.group.id];
|
|
900
|
+
if (!distinctGroup) {
|
|
901
|
+
distinctObj[groupRow.group.id] = {};
|
|
902
|
+
distinctObj[groupRow.group.id][key] = [];
|
|
903
|
+
distinctObj[groupRow.group.id][key].push(cellValue);
|
|
904
|
+
}
|
|
905
|
+
else {
|
|
906
|
+
let distinctList = distinctObj[groupRow.group.id][key];
|
|
907
|
+
if (!distinctList) {
|
|
908
|
+
// first round
|
|
909
|
+
distinctObj[groupRow.group.id][key] = [];
|
|
910
|
+
distinctObj[groupRow.group.id][key].push(cellValue);
|
|
911
|
+
}
|
|
912
|
+
else {
|
|
913
|
+
// update the list
|
|
914
|
+
distinctList.push(cellValue);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
// updating parents
|
|
918
|
+
let distinctParent = groupRow.group.parent;
|
|
919
|
+
while (distinctParent != null) {
|
|
920
|
+
// get parent value
|
|
921
|
+
let distinctGroupParent = distinctObj[distinctParent.group.id];
|
|
922
|
+
if (!distinctGroupParent) {
|
|
923
|
+
distinctObj[distinctParent.group.id] = {};
|
|
924
|
+
distinctObj[distinctParent.group.id][key] = [];
|
|
925
|
+
distinctObj[distinctParent.group.id][key].push(cellValue);
|
|
926
|
+
}
|
|
927
|
+
else {
|
|
928
|
+
let distinctParentList = distinctObj[distinctParent.group.id][key];
|
|
929
|
+
if (!distinctParentList) {
|
|
930
|
+
// first round
|
|
931
|
+
distinctObj[distinctParent.group.id][key] = [];
|
|
932
|
+
distinctObj[distinctParent.group.id][key].push(cellValue);
|
|
933
|
+
}
|
|
934
|
+
else {
|
|
935
|
+
// update the list
|
|
936
|
+
distinctParentList.push(cellValue);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
// continue
|
|
940
|
+
distinctParent = distinctParent.group.parent;
|
|
941
|
+
}
|
|
942
|
+
break;
|
|
943
|
+
case kupManager.TotalMode.SUM:
|
|
944
|
+
case kupManager.TotalMode.AVERAGE:
|
|
945
|
+
if (_isNumber && cell.value) {
|
|
946
|
+
const cellValue = dom$2.ketchup.math.numberify(dom$2.ketchup.math.numberifySafe(cell.value));
|
|
947
|
+
const currentTotalValue = groupRow.group.totals[key] || 0;
|
|
948
|
+
groupRow.group.totals[key] =
|
|
949
|
+
cellValue + currentTotalValue;
|
|
950
|
+
// updating parents
|
|
951
|
+
let parent = groupRow.group.parent;
|
|
952
|
+
while (parent != null) {
|
|
953
|
+
const currentParentSum = dom$2.ketchup.math.numberify(parent.group.totals[key] || 0);
|
|
954
|
+
parent.group.totals[key] =
|
|
955
|
+
cellValue + currentParentSum;
|
|
956
|
+
parent = parent.group.parent;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
break;
|
|
960
|
+
// TODO DRY the MIN and MAX functions
|
|
961
|
+
case kupManager.TotalMode.MIN:
|
|
962
|
+
if (_isNumber && cell.value) {
|
|
963
|
+
const currentMinValue = groupRow.group.totals[key];
|
|
964
|
+
const cellValue = dom$2.ketchup.math.numberify(dom$2.ketchup.math.numberifySafe(cell.value));
|
|
965
|
+
if (currentMinValue) {
|
|
966
|
+
groupRow.group.totals[key] = Math.min(currentMinValue, cellValue);
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
// first round
|
|
970
|
+
groupRow.group.totals[key] = cellValue;
|
|
971
|
+
}
|
|
972
|
+
// updating parents
|
|
973
|
+
let parent = groupRow.group.parent;
|
|
974
|
+
while (parent != null) {
|
|
975
|
+
const currentParentMin = parent.group.totals[key];
|
|
976
|
+
if (currentParentMin) {
|
|
977
|
+
parent.group.totals[key] = Math.min(currentParentMin, cellValue);
|
|
978
|
+
}
|
|
979
|
+
else {
|
|
980
|
+
// first round
|
|
981
|
+
parent.group.totals[key] = cellValue;
|
|
982
|
+
}
|
|
983
|
+
parent = parent.group.parent;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
else if (cell.value &&
|
|
987
|
+
dom$2.ketchup.objects.isDate(cell.obj)) {
|
|
988
|
+
const cellValue = dom$2.ketchup.dates.toDayjs(cell.value);
|
|
989
|
+
if (dom$2.ketchup.dates.isValid(cellValue)) {
|
|
990
|
+
const currentMinValue = groupRow.group.totals[key];
|
|
991
|
+
if (currentMinValue) {
|
|
992
|
+
let moments = [];
|
|
993
|
+
moments.push(cellValue);
|
|
994
|
+
moments.push(dom$2.ketchup.dates.toDayjs(currentMinValue));
|
|
995
|
+
groupRow.group.totals[key] =
|
|
996
|
+
dom$2.ketchup.dates.format(dom$2.ketchup.dates.min(moments), kupDates.KupDatesFormats.ISO_DATE);
|
|
997
|
+
}
|
|
998
|
+
else {
|
|
999
|
+
groupRow.group.totals[key] =
|
|
1000
|
+
dom$2.ketchup.dates.format(cellValue, kupDates.KupDatesFormats.ISO_DATE);
|
|
1001
|
+
}
|
|
1002
|
+
// updating parents
|
|
1003
|
+
let parent = groupRow.group.parent;
|
|
1004
|
+
while (parent != null) {
|
|
1005
|
+
const currentParentMin = parent.group.totals[key];
|
|
1006
|
+
if (currentParentMin) {
|
|
1007
|
+
let moments = [];
|
|
1008
|
+
moments.push(cellValue);
|
|
1009
|
+
moments.push(dom$2.ketchup.dates.toDayjs(currentParentMin));
|
|
1010
|
+
parent.group.totals[key] =
|
|
1011
|
+
dom$2.ketchup.dates.format(dom$2.ketchup.dates.min(moments), kupDates.KupDatesFormats.ISO_DATE);
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
// first round
|
|
1015
|
+
parent.group.totals[key] =
|
|
1016
|
+
dom$2.ketchup.dates.format(cellValue, kupDates.KupDatesFormats.ISO_DATE);
|
|
1017
|
+
}
|
|
1018
|
+
parent = parent.group.parent;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
break;
|
|
1023
|
+
// TODO DRY the MIN and MAX functions
|
|
1024
|
+
case kupManager.TotalMode.MAX:
|
|
1025
|
+
if (_isNumber && cell.value) {
|
|
1026
|
+
const currentMaxValue = groupRow.group.totals[key];
|
|
1027
|
+
const cellValue = dom$2.ketchup.math.numberify(dom$2.ketchup.math.numberifySafe(cell.value));
|
|
1028
|
+
if (currentMaxValue) {
|
|
1029
|
+
groupRow.group.totals[key] = Math.max(currentMaxValue, cellValue);
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
// first round
|
|
1033
|
+
groupRow.group.totals[key] = cellValue;
|
|
1034
|
+
}
|
|
1035
|
+
// updating parents
|
|
1036
|
+
let parent = groupRow.group.parent;
|
|
1037
|
+
while (parent != null) {
|
|
1038
|
+
const currentParentMax = parent.group.totals[key];
|
|
1039
|
+
if (currentParentMax) {
|
|
1040
|
+
parent.group.totals[key] = Math.max(currentParentMax, cellValue);
|
|
1041
|
+
}
|
|
1042
|
+
else {
|
|
1043
|
+
// first round
|
|
1044
|
+
parent.group.totals[key] = cellValue;
|
|
1045
|
+
}
|
|
1046
|
+
parent = parent.group.parent;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
else if (cell.value &&
|
|
1050
|
+
dom$2.ketchup.objects.isDate(cell.obj)) {
|
|
1051
|
+
const cellValue = dom$2.ketchup.dates.toDayjs(cell.value);
|
|
1052
|
+
if (dom$2.ketchup.dates.isValid(cellValue)) {
|
|
1053
|
+
const currentMaxValue = groupRow.group.totals[key];
|
|
1054
|
+
if (currentMaxValue) {
|
|
1055
|
+
let moments = [];
|
|
1056
|
+
moments.push(cellValue);
|
|
1057
|
+
moments.push(dom$2.ketchup.dates.toDayjs(currentMaxValue));
|
|
1058
|
+
groupRow.group.totals[key] =
|
|
1059
|
+
dom$2.ketchup.dates.format(dom$2.ketchup.dates.max(moments), kupDates.KupDatesFormats.ISO_DATE);
|
|
1060
|
+
}
|
|
1061
|
+
else {
|
|
1062
|
+
groupRow.group.totals[key] =
|
|
1063
|
+
dom$2.ketchup.dates.format(cellValue, kupDates.KupDatesFormats.ISO_DATE);
|
|
1064
|
+
}
|
|
1065
|
+
// updating parents
|
|
1066
|
+
let parent = groupRow.group.parent;
|
|
1067
|
+
while (parent != null) {
|
|
1068
|
+
const currentParentMax = parent.group.totals[key];
|
|
1069
|
+
if (currentParentMax) {
|
|
1070
|
+
let moments = [];
|
|
1071
|
+
moments.push(cellValue);
|
|
1072
|
+
moments.push(dom$2.ketchup.dates.toDayjs(currentParentMax));
|
|
1073
|
+
parent.group.totals[key] =
|
|
1074
|
+
dom$2.ketchup.dates.format(dom$2.ketchup.dates.max(moments), kupDates.KupDatesFormats.ISO_DATE);
|
|
1075
|
+
}
|
|
1076
|
+
else {
|
|
1077
|
+
// first round
|
|
1078
|
+
parent.group.totals[key] =
|
|
1079
|
+
dom$2.ketchup.dates.format(cellValue, kupDates.KupDatesFormats.ISO_DATE);
|
|
1080
|
+
}
|
|
1081
|
+
parent = parent.group.parent;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
break;
|
|
1086
|
+
default: {
|
|
1087
|
+
if (totalMode.indexOf(kupManager.TotalMode.MATH) != 0) {
|
|
1088
|
+
console.warn(`invalid total mode: ${totalMode}`);
|
|
1089
|
+
}
|
|
1090
|
+
break;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
function adjustGroupsDistinct(groupRows, totals, distinctObj) {
|
|
1097
|
+
if (!groupRows || !totals) {
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1100
|
+
const keys = Object.keys(totals);
|
|
1101
|
+
if (groupRows.length === 0 || !groupRows[0].group || keys.length === 0) {
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
let toAdjustKeys = keys.filter((key) => kupManager.TotalMode.DISTINCT === totals[key]);
|
|
1105
|
+
if (toAdjustKeys.length > 0) {
|
|
1106
|
+
groupRows
|
|
1107
|
+
.filter((groupRow) => groupRow.group.children.length > 0)
|
|
1108
|
+
.forEach((groupRow) => adjustGroupDistinct(groupRow, toAdjustKeys, distinctObj));
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
function adjustGroupsAverageOrFormula(groupRows, type, totals) {
|
|
1112
|
+
if (!groupRows || !totals) {
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
const keys = Object.keys(totals);
|
|
1116
|
+
if (groupRows.length === 0 || !groupRows[0].group || keys.length === 0) {
|
|
1117
|
+
return;
|
|
1118
|
+
}
|
|
1119
|
+
let toAdjustKeys;
|
|
1120
|
+
if (type == kupManager.TotalMode.AVERAGE) {
|
|
1121
|
+
toAdjustKeys = keys.filter((key) => kupManager.TotalMode.AVERAGE === totals[key]);
|
|
1122
|
+
}
|
|
1123
|
+
if (type == kupManager.TotalMode.MATH) {
|
|
1124
|
+
toAdjustKeys = keys.filter((key) => totals[key].indexOf(kupManager.TotalMode.MATH) == 0);
|
|
1125
|
+
}
|
|
1126
|
+
if (toAdjustKeys.length > 0) {
|
|
1127
|
+
groupRows
|
|
1128
|
+
.filter((groupRow) => groupRow.group.children.length > 0)
|
|
1129
|
+
.forEach((groupRow) => adjustGroupAverageOrFormula(groupRow, type, toAdjustKeys, totals));
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
function adjustGroupDistinct(groupRow, toAdjustKeys, distinctObj) {
|
|
1133
|
+
const children = groupRow.group.children;
|
|
1134
|
+
if (children.length === 0) {
|
|
1135
|
+
return;
|
|
1136
|
+
}
|
|
1137
|
+
if (children[0].group) {
|
|
1138
|
+
children.forEach((child) => {
|
|
1139
|
+
adjustGroupDistinct(child, toAdjustKeys, distinctObj);
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
toAdjustKeys.forEach((key) => {
|
|
1143
|
+
const distinctList = distinctObj[groupRow.group.id][key];
|
|
1144
|
+
groupRow.group.totals[key] = new Set(distinctList).size;
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* @returns number of 'leaf' of group
|
|
1149
|
+
*/
|
|
1150
|
+
function adjustGroupAverageOrFormula(row, type, toAdjustKeys, totals) {
|
|
1151
|
+
const children = row.group.children;
|
|
1152
|
+
if (children.length === 0) {
|
|
1153
|
+
return 0;
|
|
1154
|
+
}
|
|
1155
|
+
let numberOfLeaf = 0;
|
|
1156
|
+
// check if child is a grouping row
|
|
1157
|
+
if (children[0].group) {
|
|
1158
|
+
children.forEach((child) => {
|
|
1159
|
+
numberOfLeaf += adjustGroupAverageOrFormula(child, type, toAdjustKeys, totals);
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
else {
|
|
1163
|
+
numberOfLeaf = children.length;
|
|
1164
|
+
}
|
|
1165
|
+
// adjust average/formulas
|
|
1166
|
+
toAdjustKeys.forEach((key) => {
|
|
1167
|
+
if (type == kupManager.TotalMode.AVERAGE) {
|
|
1168
|
+
row.group.totals[key] = row.group.totals[key] / numberOfLeaf;
|
|
1169
|
+
}
|
|
1170
|
+
if (type == kupManager.TotalMode.MATH) {
|
|
1171
|
+
let formula = totals[key].substring(kupManager.TotalMode.MATH.length);
|
|
1172
|
+
row.group.totals[key] = dom$2.ketchup.math.formulas.custom(formula, row.group.totals);
|
|
1173
|
+
}
|
|
1174
|
+
});
|
|
1175
|
+
return numberOfLeaf;
|
|
1176
|
+
}
|
|
1177
|
+
function normalizeRows(columns, rows) {
|
|
1178
|
+
if (rows) {
|
|
1179
|
+
const normalizedrows = Object.assign(rows);
|
|
1180
|
+
rows.forEach((row) => {
|
|
1181
|
+
columns.forEach((column) => {
|
|
1182
|
+
if (row.cells) {
|
|
1183
|
+
const cell = row.cells[column.name];
|
|
1184
|
+
if (cell && column.obj && !cell.obj) {
|
|
1185
|
+
// cell.obj = Object.assign(column.obj);
|
|
1186
|
+
cell.obj = {
|
|
1187
|
+
t: column.obj.t,
|
|
1188
|
+
p: column.obj.p,
|
|
1189
|
+
k: cell.value,
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
});
|
|
1194
|
+
});
|
|
1195
|
+
return normalizedrows;
|
|
1196
|
+
}
|
|
1197
|
+
else {
|
|
1198
|
+
return undefined;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
function calcTotals(rows = [], totals = {}) {
|
|
1202
|
+
if (dom$2.ketchup.objects.isEmptyJsObject(rows) ||
|
|
1203
|
+
dom$2.ketchup.objects.isEmptyJsObject(totals)) {
|
|
1204
|
+
return {};
|
|
1205
|
+
}
|
|
1206
|
+
const keys = Object.keys(totals);
|
|
1207
|
+
const footerRow = {};
|
|
1208
|
+
const dateColumns = new Array();
|
|
1209
|
+
// if there are only COUNT, no need to loop on rows
|
|
1210
|
+
let onlyCount = keys.length === 0 ||
|
|
1211
|
+
keys.every((key) => totals[key] === kupManager.TotalMode.COUNT);
|
|
1212
|
+
if (onlyCount) {
|
|
1213
|
+
keys.forEach((columnName) => (footerRow[columnName] = rows.length));
|
|
1214
|
+
}
|
|
1215
|
+
else {
|
|
1216
|
+
let distinctObj = {};
|
|
1217
|
+
rows.forEach((r, index, array) => {
|
|
1218
|
+
keys.filter((key) => kupManager.TotalMode.COUNT !== totals[key] &&
|
|
1219
|
+
totals[key].indexOf(kupManager.TotalMode.MATH) != 0).forEach((key) => {
|
|
1220
|
+
// getting cell
|
|
1221
|
+
const cell = r.cells[key];
|
|
1222
|
+
if (cell) {
|
|
1223
|
+
if (totals[key] === kupManager.TotalMode.DISTINCT) {
|
|
1224
|
+
let cellValue;
|
|
1225
|
+
if (dom$2.ketchup.objects.isNumber(cell.obj)) {
|
|
1226
|
+
cellValue = dom$2.ketchup.math.numberify(dom$2.ketchup.math.numberifySafe(cell.value));
|
|
1227
|
+
}
|
|
1228
|
+
else {
|
|
1229
|
+
cellValue = cell.value;
|
|
1230
|
+
}
|
|
1231
|
+
let distinctList = distinctObj[key];
|
|
1232
|
+
if (!distinctList) {
|
|
1233
|
+
// first round
|
|
1234
|
+
distinctObj[key] = [];
|
|
1235
|
+
distinctObj[key].push(cellValue);
|
|
1236
|
+
}
|
|
1237
|
+
else {
|
|
1238
|
+
// update the list
|
|
1239
|
+
distinctList.push(cellValue);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
else if (dom$2.ketchup.objects.isNumber(cell.obj)) {
|
|
1243
|
+
const cellValue = dom$2.ketchup.math.numberify(dom$2.ketchup.math.numberifySafe(cell.value));
|
|
1244
|
+
let currentFooterValue = footerRow[key];
|
|
1245
|
+
switch (true) {
|
|
1246
|
+
// TODO DRY the MIN and MAX functions
|
|
1247
|
+
case totals[key] === kupManager.TotalMode.MIN:
|
|
1248
|
+
if (currentFooterValue) {
|
|
1249
|
+
footerRow[key] = Math.min(currentFooterValue, cellValue);
|
|
1250
|
+
}
|
|
1251
|
+
else {
|
|
1252
|
+
footerRow[key] = cellValue;
|
|
1253
|
+
}
|
|
1254
|
+
break;
|
|
1255
|
+
case totals[key] === kupManager.TotalMode.MAX:
|
|
1256
|
+
if (currentFooterValue) {
|
|
1257
|
+
footerRow[key] = Math.max(currentFooterValue, cellValue);
|
|
1258
|
+
}
|
|
1259
|
+
else {
|
|
1260
|
+
footerRow[key] = cellValue;
|
|
1261
|
+
}
|
|
1262
|
+
break;
|
|
1263
|
+
default:
|
|
1264
|
+
// SUM
|
|
1265
|
+
currentFooterValue = footerRow[key] || 0;
|
|
1266
|
+
footerRow[key] =
|
|
1267
|
+
cellValue +
|
|
1268
|
+
dom$2.ketchup.math.numberify(currentFooterValue);
|
|
1269
|
+
}
|
|
1270
|
+
// TODO DRY the MIN and MAX functions
|
|
1271
|
+
}
|
|
1272
|
+
else if (dom$2.ketchup.objects.isDate(cell.obj)) {
|
|
1273
|
+
if (dateColumns.indexOf(key) == -1) {
|
|
1274
|
+
dateColumns.push(key);
|
|
1275
|
+
}
|
|
1276
|
+
const momentValue = dom$2.ketchup.dates.toDayjs(cell.value);
|
|
1277
|
+
if (dom$2.ketchup.dates.isValid(momentValue)) {
|
|
1278
|
+
const cellValue = dom$2.ketchup.dates.toDate(momentValue);
|
|
1279
|
+
const currentFooterValue = footerRow[key]
|
|
1280
|
+
? dom$2.ketchup.dates.toDate(dom$2.ketchup.dates.toDayjs(footerRow[key]))
|
|
1281
|
+
: null;
|
|
1282
|
+
switch (true) {
|
|
1283
|
+
case totals[key] === kupManager.TotalMode.MIN:
|
|
1284
|
+
if (currentFooterValue) {
|
|
1285
|
+
let moments = [];
|
|
1286
|
+
moments.push(cellValue);
|
|
1287
|
+
moments.push(currentFooterValue);
|
|
1288
|
+
footerRow[key] =
|
|
1289
|
+
dom$2.ketchup.dates.format(dom$2.ketchup.dates.min(moments), kupDates.KupDatesFormats.ISO_DATE);
|
|
1290
|
+
}
|
|
1291
|
+
else {
|
|
1292
|
+
footerRow[key] =
|
|
1293
|
+
dom$2.ketchup.dates.format(cellValue, kupDates.KupDatesFormats.ISO_DATE);
|
|
1294
|
+
}
|
|
1295
|
+
break;
|
|
1296
|
+
case totals[key] === kupManager.TotalMode.MAX:
|
|
1297
|
+
if (currentFooterValue) {
|
|
1298
|
+
let moments = [];
|
|
1299
|
+
moments.push(cellValue);
|
|
1300
|
+
moments.push(currentFooterValue);
|
|
1301
|
+
footerRow[key] =
|
|
1302
|
+
dom$2.ketchup.dates.format(dom$2.ketchup.dates.max(moments), kupDates.KupDatesFormats.ISO_DATE);
|
|
1303
|
+
}
|
|
1304
|
+
else {
|
|
1305
|
+
footerRow[key] =
|
|
1306
|
+
dom$2.ketchup.dates.format(cellValue, kupDates.KupDatesFormats.ISO_DATE);
|
|
1307
|
+
}
|
|
1308
|
+
break;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
if (index === array.length - 1 &&
|
|
1314
|
+
totals[key] === kupManager.TotalMode.DISTINCT) {
|
|
1315
|
+
// last round
|
|
1316
|
+
footerRow[key] = new Set(distinctObj[key]).size;
|
|
1317
|
+
distinctObj[key] = [];
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
// fixing MATH, AVERAGE and COUNT
|
|
1323
|
+
for (let key of keys) {
|
|
1324
|
+
switch (true) {
|
|
1325
|
+
case totals[key] === kupManager.TotalMode.AVERAGE:
|
|
1326
|
+
const sum = footerRow[key];
|
|
1327
|
+
if (sum && rows.length > 0) {
|
|
1328
|
+
footerRow[key] = sum / rows.length;
|
|
1329
|
+
}
|
|
1330
|
+
break;
|
|
1331
|
+
case totals[key] === kupManager.TotalMode.COUNT:
|
|
1332
|
+
footerRow[key] = rows.length;
|
|
1333
|
+
break;
|
|
1334
|
+
case totals[key].indexOf(kupManager.TotalMode.MATH) == 0:
|
|
1335
|
+
footerRow[key] = dom$2.ketchup.math.formulas.custom(totals[key].substring(kupManager.TotalMode.MATH.length), footerRow);
|
|
1336
|
+
break;
|
|
1337
|
+
}
|
|
1338
|
+
if (footerRow[key]) {
|
|
1339
|
+
if (dateColumns.indexOf(key) != -1) {
|
|
1340
|
+
footerRow[key] = dom$2.ketchup.dates.format(footerRow[key]);
|
|
1341
|
+
}
|
|
1342
|
+
else if (dom$2.ketchup.math.isNumber(footerRow[key])) {
|
|
1343
|
+
footerRow[key] = +footerRow[key].toFixed(2);
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
return footerRow;
|
|
1348
|
+
}
|
|
1349
|
+
function adjustGroupId(row) {
|
|
1350
|
+
if (!row.group) {
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1353
|
+
let groupID = row.group.id;
|
|
1354
|
+
let parentRow = row.group.parent;
|
|
1355
|
+
while (parentRow !== null) {
|
|
1356
|
+
groupID = `${parentRow.group.id};${groupID}`;
|
|
1357
|
+
parentRow = parentRow.group.parent;
|
|
1358
|
+
}
|
|
1359
|
+
row.group.id = groupID;
|
|
1360
|
+
}
|
|
1361
|
+
function paginateRows(rows, currentPage, rowsPerPage, areGrouped) {
|
|
1362
|
+
const start = currentPage * rowsPerPage - rowsPerPage;
|
|
1363
|
+
const end = start + Number(rowsPerPage);
|
|
1364
|
+
if (areGrouped == false) {
|
|
1365
|
+
return rows.slice(start, end);
|
|
1366
|
+
}
|
|
1367
|
+
let pagRows = [];
|
|
1368
|
+
_paginateRows(rows, pagRows, start, Number(rowsPerPage), 0);
|
|
1369
|
+
return pagRows;
|
|
1370
|
+
}
|
|
1371
|
+
function _paginateRows(rows, pagRows, start, rowsPerPage, ci) {
|
|
1372
|
+
let added = false;
|
|
1373
|
+
for (let i = 0; i < rows.length; i++) {
|
|
1374
|
+
let originalRow = rows[i];
|
|
1375
|
+
let row = cloneRow(rows[i]);
|
|
1376
|
+
if (originalRow.group != null &&
|
|
1377
|
+
originalRow.group.children != null &&
|
|
1378
|
+
originalRow.group.children.length > 0) {
|
|
1379
|
+
row.group.children = [];
|
|
1380
|
+
let retValue = _paginateRows(originalRow.group.children, row.group.children, start, rowsPerPage, ci);
|
|
1381
|
+
ci = retValue.ci;
|
|
1382
|
+
added = retValue.added;
|
|
1383
|
+
if (added == true) {
|
|
1384
|
+
pagRows[pagRows.length] = row;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
else {
|
|
1388
|
+
if (ci >= start) {
|
|
1389
|
+
pagRows[pagRows.length] = row;
|
|
1390
|
+
added = true;
|
|
1391
|
+
}
|
|
1392
|
+
ci++;
|
|
1393
|
+
}
|
|
1394
|
+
if (ci >= start + rowsPerPage) {
|
|
1395
|
+
break;
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
return { ci: ci, added: added };
|
|
1399
|
+
}
|
|
1400
|
+
function cloneRow(row) {
|
|
1401
|
+
if (row == null) {
|
|
1402
|
+
return null;
|
|
1403
|
+
}
|
|
1404
|
+
else {
|
|
1405
|
+
return {
|
|
1406
|
+
id: row.id,
|
|
1407
|
+
cells: Object.assign({}, row.cells),
|
|
1408
|
+
actions: row.actions ? [...row.actions] : null,
|
|
1409
|
+
group: cloneRowGroup(row.group),
|
|
1410
|
+
clonedFrom: row,
|
|
1411
|
+
readOnly: row.readOnly,
|
|
1412
|
+
cssClass: row.cssClass,
|
|
1413
|
+
};
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
function cloneRows(rows) {
|
|
1417
|
+
if (rows == null) {
|
|
1418
|
+
return null;
|
|
1419
|
+
}
|
|
1420
|
+
let cloned = [];
|
|
1421
|
+
for (let i = 0; i < rows.length; i++) {
|
|
1422
|
+
cloned[cloned.length] = cloneRow(rows[i]);
|
|
1423
|
+
}
|
|
1424
|
+
return cloned;
|
|
1425
|
+
}
|
|
1426
|
+
function cloneRowGroup(group) {
|
|
1427
|
+
if (group == null) {
|
|
1428
|
+
return null;
|
|
1429
|
+
}
|
|
1430
|
+
let cloned = {
|
|
1431
|
+
id: group.id,
|
|
1432
|
+
parent: Object.assign({}, group.parent),
|
|
1433
|
+
column: group.column,
|
|
1434
|
+
columnLabel: group.columnLabel,
|
|
1435
|
+
expanded: group.expanded,
|
|
1436
|
+
label: group.label,
|
|
1437
|
+
children: cloneRows(group.children),
|
|
1438
|
+
obj: Object.assign({}, group.obj),
|
|
1439
|
+
totals: Object.assign({}, group.totals),
|
|
1440
|
+
};
|
|
1441
|
+
return cloned;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
exports.FPaginatorMode = void 0;
|
|
1445
|
+
(function (FPaginatorMode) {
|
|
1446
|
+
FPaginatorMode["SIMPLE"] = "simple";
|
|
1447
|
+
FPaginatorMode["FULL"] = "full";
|
|
1448
|
+
})(exports.FPaginatorMode || (exports.FPaginatorMode = {}));
|
|
1449
|
+
|
|
1450
|
+
const dom$1 = document.documentElement;
|
|
1451
|
+
/*-------------------------------------------------*/
|
|
1452
|
+
/* C o m p o n e n t */
|
|
1453
|
+
/*-------------------------------------------------*/
|
|
1454
|
+
const FPaginator = (props) => {
|
|
1455
|
+
const maxNumberOfPage = Math.ceil(props.max / props.perPage);
|
|
1456
|
+
const pageItems = getPageItems(props, maxNumberOfPage);
|
|
1457
|
+
const rowsPerPageItems = getRowsItems(props);
|
|
1458
|
+
const dataPageSelector = {
|
|
1459
|
+
'kup-list': {
|
|
1460
|
+
data: pageItems,
|
|
1461
|
+
},
|
|
1462
|
+
'kup-text-field': {
|
|
1463
|
+
label: dom$1.ketchup.language.translate(kupManager.KupLanguagePage.PAGE),
|
|
1464
|
+
helper: dom$1.ketchup.language.translate(kupManager.KupLanguagePage.TOTAL) +
|
|
1465
|
+
`: ${maxNumberOfPage}`,
|
|
1466
|
+
helperWhenFocused: true,
|
|
1467
|
+
inputType: 'number',
|
|
1468
|
+
max: maxNumberOfPage,
|
|
1469
|
+
min: 1,
|
|
1470
|
+
},
|
|
1471
|
+
};
|
|
1472
|
+
const dataRowsSelector = {
|
|
1473
|
+
'kup-list': {
|
|
1474
|
+
data: rowsPerPageItems,
|
|
1475
|
+
},
|
|
1476
|
+
'kup-text-field': {
|
|
1477
|
+
label: dom$1.ketchup.language.translate(kupManager.KupLanguageRow.ROWS) +
|
|
1478
|
+
' / ' +
|
|
1479
|
+
dom$1.ketchup.language.translate(kupManager.KupLanguagePage.PAGE),
|
|
1480
|
+
helper: dom$1.ketchup.language.translate(kupManager.KupLanguageRow.TOTAL) +
|
|
1481
|
+
`: ${props.max}`,
|
|
1482
|
+
helperWhenFocused: true,
|
|
1483
|
+
inputType: 'number',
|
|
1484
|
+
max: props.max,
|
|
1485
|
+
min: 1,
|
|
1486
|
+
},
|
|
1487
|
+
};
|
|
1488
|
+
return (index.h("div", Object.assign({ class: `f-paginator ${props.mode ? props.mode : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
|
|
1489
|
+
props.mode !== exports.FPaginatorMode.SIMPLE ? (index.h(fButton.FButton, { icon: "chevron_left", disabled: isPrevPageDisabled(props), onClick: props.onPrevPage, wrapperClass: "prev-page" })) : null,
|
|
1490
|
+
index.h("kup-combobox", { class: "page-selector", data: dataPageSelector, initialValue: props.currentPage.toString(), "onkup-combobox-change": props.onPageChange }),
|
|
1491
|
+
props.mode !== exports.FPaginatorMode.SIMPLE ? (index.h(fButton.FButton, { icon: "chevron_right", disabled: isNextPageDisabled(props), onClick: props.onNextPage, wrapperClass: "next-page" })) : null,
|
|
1492
|
+
index.h("kup-combobox", { class: "rows-selector", data: dataRowsSelector, initialValue: props.perPage.toString(), "onkup-combobox-change": props.onRowsChange }),
|
|
1493
|
+
props.onLoadMore ? (index.h(fButton.FButton, { icon: "plus", onClick: props.onLoadMore, label: dom$1.ketchup.language.translate(kupManager.KupLanguageGeneric.LOAD_MORE), styling: fButtonDeclarations.FButtonStyling.FLAT, wrapperClass: "load-more-button" })) : null));
|
|
1494
|
+
};
|
|
1495
|
+
function getPageItems(props, maxNumberOfPage) {
|
|
1496
|
+
const pageItems = [];
|
|
1497
|
+
for (let i = 1; i <= maxNumberOfPage; i++) {
|
|
1498
|
+
const selected = i == props.currentPage;
|
|
1499
|
+
pageItems.push({
|
|
1500
|
+
id: i.toString(),
|
|
1501
|
+
selected: selected,
|
|
1502
|
+
value: i.toString(),
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
return pageItems;
|
|
1506
|
+
}
|
|
1507
|
+
function getRowsItems(props) {
|
|
1508
|
+
const rowsPerPageItems = [];
|
|
1509
|
+
let i = props.perPage;
|
|
1510
|
+
if (i === 0) {
|
|
1511
|
+
return rowsPerPageItems;
|
|
1512
|
+
}
|
|
1513
|
+
while (i < props.max) {
|
|
1514
|
+
const selected = i == props.perPage;
|
|
1515
|
+
rowsPerPageItems.push({
|
|
1516
|
+
id: i.toString(),
|
|
1517
|
+
selected: selected,
|
|
1518
|
+
value: i.toString(),
|
|
1519
|
+
});
|
|
1520
|
+
i = i * 2;
|
|
1521
|
+
}
|
|
1522
|
+
const selected = props.max == props.perPage;
|
|
1523
|
+
rowsPerPageItems.push({
|
|
1524
|
+
id: props.max.toString(),
|
|
1525
|
+
selected: selected,
|
|
1526
|
+
value: props.max.toString(),
|
|
1527
|
+
});
|
|
1528
|
+
return rowsPerPageItems;
|
|
1529
|
+
}
|
|
1530
|
+
function isNextPageDisabled(props) {
|
|
1531
|
+
return props.currentPage * props.perPage >= props.max;
|
|
1532
|
+
}
|
|
1533
|
+
function isPrevPageDisabled(props) {
|
|
1534
|
+
return props.currentPage == 1;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
const dom = document.documentElement;
|
|
1538
|
+
function pageChange(pageNumber, max, perPage) {
|
|
1539
|
+
if (dom.ketchup.math.isNumber(pageNumber)) {
|
|
1540
|
+
const numberOfPages = Math.ceil(max / perPage);
|
|
1541
|
+
let tmpNewPage = pageNumber;
|
|
1542
|
+
if (tmpNewPage > numberOfPages) {
|
|
1543
|
+
tmpNewPage = numberOfPages;
|
|
1544
|
+
}
|
|
1545
|
+
if (tmpNewPage < 1) {
|
|
1546
|
+
tmpNewPage = 1;
|
|
1547
|
+
}
|
|
1548
|
+
return tmpNewPage;
|
|
1549
|
+
}
|
|
1550
|
+
return null;
|
|
1551
|
+
}
|
|
1552
|
+
function rowsPerPageChange(rowsNumber, max) {
|
|
1553
|
+
if (dom.ketchup.math.isNumber(rowsNumber)) {
|
|
1554
|
+
let tmpRowsPerPage = rowsNumber;
|
|
1555
|
+
if (tmpRowsPerPage > max) {
|
|
1556
|
+
tmpRowsPerPage = max;
|
|
1557
|
+
}
|
|
1558
|
+
if (tmpRowsPerPage < 1) {
|
|
1559
|
+
tmpRowsPerPage = 1;
|
|
1560
|
+
}
|
|
1561
|
+
return tmpRowsPerPage;
|
|
1562
|
+
}
|
|
1563
|
+
return null;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
exports.FPaginator = FPaginator;
|
|
1567
|
+
exports.FiltersColumnMenu = FiltersColumnMenu;
|
|
1568
|
+
exports.FiltersRows = FiltersRows;
|
|
1569
|
+
exports.calcTotals = calcTotals;
|
|
1570
|
+
exports.filterRows = filterRows;
|
|
1571
|
+
exports.groupRows = groupRows;
|
|
1572
|
+
exports.normalizeRows = normalizeRows;
|
|
1573
|
+
exports.pageChange = pageChange;
|
|
1574
|
+
exports.paginateRows = paginateRows;
|
|
1575
|
+
exports.rowsPerPageChange = rowsPerPageChange;
|
|
1576
|
+
exports.sortRows = sortRows;
|
|
1577
|
+
exports.treeMainColumnName = treeMainColumnName;
|