@sme.up/ketchup 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/cell-utils-dc0884a3.js +168 -0
- package/dist/cjs/f-button-2ba74fb5.js +105 -0
- package/dist/cjs/f-cell-fe60a08d.js +731 -0
- package/dist/cjs/f-chip-90d95d22.js +141 -0
- package/dist/cjs/{f-image-5f4f29ca.js → f-image-d3bd4e08.js} +4 -5
- package/dist/cjs/{index-3c471303.js → index-0416afab.js} +73 -64
- package/dist/cjs/ketchup.cjs.js +3 -3
- package/dist/cjs/kup-accordion.cjs.entry.js +6 -8
- package/dist/cjs/{kup-autocomplete_29.cjs.entry.js → kup-autocomplete_28.cjs.entry.js} +2580 -3060
- package/dist/cjs/kup-calendar.cjs.entry.js +30 -30
- package/dist/cjs/kup-cell.cjs.entry.js +201 -0
- package/dist/cjs/kup-dash-list.cjs.entry.js +15 -7
- package/dist/cjs/kup-dash_2.cjs.entry.js +104 -62
- package/dist/cjs/kup-drawer.cjs.entry.js +4 -6
- package/dist/cjs/kup-field.cjs.entry.js +3 -5
- package/dist/cjs/kup-iframe.cjs.entry.js +3 -4
- package/dist/cjs/kup-lazy.cjs.entry.js +4 -6
- package/dist/cjs/kup-magic-box.cjs.entry.js +21 -31
- package/dist/cjs/kup-manager-1a2688ca.js +5813 -0
- package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -6
- package/dist/cjs/kup-probe.cjs.entry.js +3 -4
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -3
- package/dist/cjs/kup-snackbar.cjs.entry.js +152 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{utils-2af73538.js → utils-0cc466b9.js} +17 -83
- package/dist/collection/assets/cell.js +51 -0
- package/dist/collection/assets/data-table.js +518 -1
- package/dist/collection/assets/index.js +8 -0
- package/dist/collection/assets/snackbar.js +32 -0
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/kup-accordion/kup-accordion.css +0 -213
- package/dist/collection/components/kup-accordion/kup-accordion.js +15 -16
- package/dist/collection/components/kup-autocomplete/kup-autocomplete-declarations.js +2 -2
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.css +5 -2381
- package/dist/collection/components/kup-autocomplete/kup-autocomplete.js +83 -111
- package/dist/collection/components/kup-badge/kup-badge.css +1 -35
- package/dist/collection/components/kup-badge/kup-badge.js +13 -14
- package/dist/collection/components/kup-box/kup-box.css +47 -780
- package/dist/collection/components/kup-box/kup-box.js +240 -366
- package/dist/collection/components/kup-button/kup-button.css +0 -333
- package/dist/collection/components/kup-button/kup-button.js +27 -28
- package/dist/collection/components/kup-button-list/kup-button-list.css +0 -332
- package/dist/collection/components/kup-button-list/kup-button-list.js +19 -20
- package/dist/collection/components/kup-calendar/kup-calendar.css +0 -517
- package/dist/collection/components/kup-calendar/kup-calendar.js +47 -45
- package/dist/collection/components/kup-card/builtin/kup-card-builtin.js +20 -0
- package/dist/collection/components/kup-card/builtin/kup-card-calendar.js +458 -0
- package/dist/collection/components/kup-card/builtin/kup-card-clock.js +321 -0
- package/dist/collection/components/kup-card/dialog/kup-card-dialog.js +18 -0
- package/dist/collection/components/kup-card/free/kup-card-free.js +13 -0
- package/dist/collection/components/kup-card/kup-card-declarations.js +19 -0
- package/dist/collection/components/kup-card/kup-card-helper.js +19 -1
- package/dist/collection/components/kup-card/kup-card.css +615 -185
- package/dist/collection/components/kup-card/kup-card.js +94 -34
- package/dist/collection/components/kup-card/standard/kup-card-standard.js +75 -0
- package/dist/collection/components/kup-cell/kup-cell-declarations.js +11 -0
- package/dist/collection/components/kup-cell/kup-cell.css +20 -0
- package/dist/collection/components/kup-cell/kup-cell.js +413 -0
- package/dist/collection/components/kup-chart/kup-chart.js +41 -42
- package/dist/collection/components/kup-checkbox/kup-checkbox.css +0 -214
- package/dist/collection/components/kup-checkbox/kup-checkbox.js +19 -20
- package/dist/collection/components/kup-chip/kup-chip.css +0 -217
- package/dist/collection/components/kup-chip/kup-chip.js +15 -16
- package/dist/collection/components/kup-color-picker/kup-color-picker.css +7 -2380
- package/dist/collection/components/kup-color-picker/kup-color-picker.js +41 -41
- package/dist/collection/components/kup-combobox/kup-combobox-declarations.js +1 -0
- package/dist/collection/components/kup-combobox/kup-combobox.css +5 -2381
- package/dist/collection/components/kup-combobox/kup-combobox.js +68 -28
- package/dist/collection/components/kup-dash-list/kup-dash-list.js +13 -4
- package/dist/collection/components/kup-data-table/kup-data-table-declarations.js +2 -0
- package/dist/collection/components/kup-data-table/kup-data-table-helper.js +61 -102
- package/dist/collection/components/kup-data-table/kup-data-table.css +118 -3232
- package/dist/collection/components/kup-data-table/kup-data-table.js +589 -1089
- package/dist/collection/components/kup-date-picker/kup-date-picker.css +1 -85
- package/dist/collection/components/kup-date-picker/kup-date-picker.js +92 -395
- package/dist/collection/components/kup-drawer/kup-drawer.js +9 -10
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.css +12 -340
- package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +56 -45
- package/dist/collection/components/kup-field/kup-field.js +21 -22
- package/dist/collection/components/kup-gauge/kup-gauge.js +17 -18
- package/dist/collection/components/kup-grid/kup-grid.css +2 -1
- package/dist/collection/components/kup-grid/kup-grid.js +13 -14
- package/dist/collection/components/kup-iframe/kup-iframe.js +4 -4
- package/dist/collection/components/kup-image/assets/svg/ketchup.svg +74 -0
- package/dist/collection/components/kup-image/assets/svg/smeup.svg +59 -0
- package/dist/collection/components/kup-image/kup-image.css +0 -32
- package/dist/collection/components/kup-image/kup-image.js +25 -26
- package/dist/collection/components/kup-lazy/kup-lazy.js +17 -18
- package/dist/collection/components/kup-list/kup-list-declarations.js +1 -1
- package/dist/collection/components/kup-list/kup-list.css +4 -260
- package/dist/collection/components/kup-list/kup-list.js +39 -49
- package/dist/collection/components/kup-magic-box/kup-magic-box.css +13 -39
- package/dist/collection/components/kup-magic-box/kup-magic-box.js +29 -38
- package/dist/collection/components/kup-nav-bar/kup-nav-bar.js +11 -12
- package/dist/collection/components/kup-paginator/kup-paginator.css +0 -332
- package/dist/collection/components/kup-paginator/kup-paginator.js +44 -12
- package/dist/collection/components/kup-probe/kup-probe.js +9 -9
- package/dist/collection/components/kup-progress-bar/kup-progress-bar.js +21 -22
- package/dist/collection/components/kup-radio/kup-radio.js +17 -18
- package/dist/collection/components/kup-rating/kup-rating.js +15 -16
- package/dist/collection/components/kup-snackbar/kup-snackbar-declarations.js +13 -0
- package/dist/collection/components/kup-snackbar/kup-snackbar.css +75 -0
- package/dist/collection/components/kup-snackbar/kup-snackbar.js +390 -0
- package/dist/collection/components/kup-spinner/kup-spinner.js +23 -24
- package/dist/collection/components/kup-switch/kup-switch.css +0 -156
- package/dist/collection/components/kup-switch/kup-switch.js +17 -18
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.css +0 -199
- package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +13 -14
- package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
- package/dist/collection/components/kup-text-field/kup-text-field.css +4 -2371
- package/dist/collection/components/kup-text-field/kup-text-field.js +77 -51
- package/dist/collection/components/kup-time-picker/kup-time-picker.css +7 -0
- package/dist/collection/components/kup-time-picker/kup-time-picker.js +97 -317
- package/dist/collection/components/kup-tooltip/kup-tooltip.js +24 -14
- package/dist/collection/components/kup-tree/kup-tree.css +27 -371
- package/dist/collection/components/kup-tree/kup-tree.js +163 -383
- package/dist/collection/f-components/f-button/f-button.js +4 -2
- package/dist/collection/f-components/f-cell/f-cell-declarations.js +143 -0
- package/dist/collection/f-components/f-cell/f-cell.js +471 -0
- package/dist/collection/f-components/f-checkbox/f-checkbox.js +1 -1
- package/dist/collection/f-components/f-chip/f-chip.js +2 -2
- package/dist/collection/f-components/f-image/f-image.js +2 -3
- package/dist/collection/f-components/f-switch/f-switch.js +1 -1
- package/dist/collection/f-components/f-text-field/f-text-field-mdc.js +1 -1
- package/dist/collection/f-components/f-text-field/f-text-field.js +25 -21
- package/dist/collection/utils/cell-utils.js +18 -222
- package/dist/collection/utils/filters/filters.js +31 -37
- package/dist/collection/utils/kup-column-menu/kup-column-menu.js +15 -3
- package/dist/collection/utils/kup-dates/kup-dates.js +14 -2
- package/dist/collection/utils/kup-debug/kup-debug-browser-utils.js +3 -3
- package/dist/collection/utils/kup-debug/kup-debug.js +57 -29
- package/dist/collection/utils/kup-dynamic-position/kup-dynamic-position.js +5 -7
- package/dist/collection/utils/kup-interact/kup-interact-declarations.js +48 -0
- package/dist/collection/utils/kup-interact/kup-interact.js +379 -0
- package/dist/collection/utils/kup-language/kup-language-declarations.js +2 -0
- package/dist/collection/utils/kup-language/kup-language.js +1 -1
- package/dist/collection/utils/kup-manager/kup-manager.js +47 -10
- package/dist/collection/utils/kup-objects/kup-objects.js +9 -33
- package/dist/collection/utils/kup-scroll-on-hover/kup-scroll-on-hover.js +60 -62
- package/dist/collection/utils/kup-search/kup-search-declarations.js +1 -0
- package/dist/collection/utils/kup-search/kup-search.js +75 -0
- package/dist/collection/utils/kup-theme/kup-theme-declarations.js +1 -0
- package/dist/collection/utils/kup-theme/kup-theme.js +4 -3
- package/dist/collection/utils/kup-toolbar/kup-toolbar.js +16 -18
- package/dist/collection/utils/utils.js +15 -23
- package/dist/esm/cell-utils-8f512ea9.js +160 -0
- package/dist/esm/f-button-30dbcaa9.js +103 -0
- package/dist/esm/f-cell-95c186c6.js +727 -0
- package/dist/esm/f-chip-c0e9c0ff.js +139 -0
- package/dist/esm/{f-image-68b34fab.js → f-image-3bc8b24f.js} +4 -5
- package/dist/esm/{index-bf2824a6.js → index-e0e67c23.js} +74 -65
- package/dist/esm/ketchup.js +3 -3
- package/dist/esm/kup-accordion.entry.js +6 -8
- package/dist/esm/{kup-autocomplete_29.entry.js → kup-autocomplete_28.entry.js} +2379 -2858
- package/dist/esm/kup-calendar.entry.js +10 -10
- package/dist/esm/kup-cell.entry.js +197 -0
- package/dist/esm/kup-dash-list.entry.js +15 -7
- package/dist/esm/kup-dash_2.entry.js +104 -62
- package/dist/esm/kup-drawer.entry.js +4 -6
- package/dist/esm/kup-field.entry.js +3 -5
- package/dist/esm/kup-iframe.entry.js +3 -4
- package/dist/esm/kup-lazy.entry.js +4 -6
- package/dist/esm/kup-magic-box.entry.js +21 -31
- package/dist/esm/kup-manager-7fc234da.js +5800 -0
- package/dist/esm/kup-nav-bar.entry.js +4 -6
- package/dist/esm/kup-probe.entry.js +3 -4
- package/dist/esm/kup-qlik.entry.js +2 -3
- package/dist/esm/kup-snackbar.entry.js +148 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-13dd007a.js → utils-6c73709d.js} +15 -78
- package/dist/ketchup/assets/svg/ketchup.svg +74 -0
- package/dist/ketchup/assets/svg/smeup.svg +59 -0
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-15321eae.js +1 -0
- package/dist/ketchup/p-1baf1205.entry.js +1 -0
- package/dist/ketchup/p-1c6178e4.entry.js +1 -0
- package/dist/ketchup/p-44375e49.js +1 -0
- package/dist/ketchup/p-4dcdbd31.entry.js +45 -0
- package/dist/ketchup/p-5a5f2a53.js +1 -0
- package/dist/ketchup/{p-c7ee1fbc.js → p-61faaa38.js} +2 -2
- package/dist/ketchup/p-62816d0b.entry.js +1 -0
- package/dist/ketchup/p-65adc15b.entry.js +1 -0
- package/dist/ketchup/p-7e23ea7c.entry.js +1 -0
- package/dist/ketchup/p-a378ba56.entry.js +1 -0
- package/dist/ketchup/p-a878016f.entry.js +1 -0
- package/dist/ketchup/p-a96e6e32.entry.js +1 -0
- package/dist/ketchup/p-ad32821e.entry.js +1 -0
- package/dist/ketchup/p-af4a6191.entry.js +1 -0
- package/dist/ketchup/p-c18c7bb0.entry.js +27 -0
- package/dist/ketchup/p-ca0ca27f.entry.js +1 -0
- package/dist/ketchup/p-cb5f4994.js +1 -0
- package/dist/ketchup/p-ccda584a.entry.js +1 -0
- package/dist/ketchup/p-d4aa4922.js +1 -0
- package/dist/ketchup/p-dbb6998b.entry.js +1 -0
- package/dist/ketchup/p-de83f2f6.js +1 -0
- package/dist/ketchup/p-ec3a3db9.js +1 -0
- package/dist/types/components/kup-autocomplete/kup-autocomplete-declarations.d.ts +2 -6
- package/dist/types/components/kup-autocomplete/kup-autocomplete.d.ts +7 -13
- package/dist/types/components/kup-box/kup-box-declarations.d.ts +13 -4
- package/dist/types/components/kup-box/kup-box.d.ts +13 -6
- package/dist/types/components/kup-card/builtin/kup-card-builtin.d.ts +14 -0
- package/dist/types/components/kup-card/builtin/kup-card-calendar.d.ts +2 -0
- package/dist/types/components/kup-card/builtin/kup-card-clock.d.ts +2 -0
- package/dist/types/components/kup-card/dialog/kup-card-dialog.d.ts +6 -0
- package/dist/types/components/kup-card/free/kup-card-free.d.ts +8 -0
- package/dist/types/components/kup-card/kup-card-declarations.d.ts +74 -0
- package/dist/types/components/kup-card/kup-card.d.ts +12 -3
- package/dist/types/components/kup-card/standard/kup-card-standard.d.ts +6 -0
- package/dist/types/components/kup-cell/kup-cell-declarations.d.ts +10 -0
- package/dist/types/components/kup-cell/kup-cell.d.ts +67 -0
- package/dist/types/components/kup-color-picker/kup-color-picker.d.ts +1 -1
- package/dist/types/components/kup-combobox/kup-combobox-declarations.d.ts +3 -2
- package/dist/types/components/kup-combobox/kup-combobox.d.ts +5 -0
- package/dist/types/components/kup-dash-list/kup-dash-list.d.ts +4 -0
- package/dist/types/components/kup-data-table/kup-data-table-declarations.d.ts +20 -36
- package/dist/types/components/kup-data-table/kup-data-table-helper.d.ts +1 -15
- package/dist/types/components/kup-data-table/kup-data-table.d.ts +33 -83
- package/dist/types/components/kup-date-picker/kup-date-picker.d.ts +11 -23
- package/dist/types/components/kup-dropdown-button/kup-dropdown-button.d.ts +1 -4
- package/dist/types/components/kup-list/kup-list-declarations.d.ts +1 -1
- package/dist/types/components/kup-list/kup-list.d.ts +2 -3
- package/dist/types/components/kup-magic-box/kup-magic-box.d.ts +1 -0
- package/dist/types/components/kup-paginator/kup-paginator.d.ts +6 -0
- package/dist/types/components/kup-snackbar/kup-snackbar-declarations.d.ts +12 -0
- package/dist/types/components/kup-snackbar/kup-snackbar.d.ts +79 -0
- package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +2 -1
- package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
- package/dist/types/components/kup-time-picker/kup-time-picker.d.ts +10 -20
- package/dist/types/components/kup-tooltip/kup-tooltip.d.ts +1 -0
- package/dist/types/components/kup-tree/kup-tree-declarations.d.ts +4 -4
- package/dist/types/components/kup-tree/kup-tree.d.ts +12 -23
- package/dist/types/components.d.ts +348 -176
- package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +153 -0
- package/dist/types/f-components/f-cell/f-cell.d.ts +3 -0
- package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
- package/dist/types/f-components/f-text-field/f-text-field-mdc.d.ts +1 -1
- package/dist/types/utils/cell-utils.d.ts +0 -19
- package/dist/types/utils/kup-column-menu/kup-column-menu.d.ts +2 -0
- package/dist/types/utils/kup-dates/kup-dates.d.ts +9 -4
- package/dist/types/utils/kup-debug/kup-debug.d.ts +1 -1
- package/dist/types/utils/kup-dynamic-position/kup-dynamic-position-declarations.d.ts +1 -1
- package/dist/types/utils/kup-dynamic-position/kup-dynamic-position.d.ts +2 -2
- package/dist/types/utils/kup-interact/kup-interact-declarations.d.ts +127 -0
- package/dist/types/utils/kup-interact/kup-interact.d.ts +93 -0
- package/dist/types/utils/kup-language/kup-language-declarations.d.ts +2 -0
- package/dist/types/utils/kup-language/kup-language.d.ts +1 -1
- package/dist/types/utils/kup-manager/kup-manager-declarations.d.ts +28 -8
- package/dist/types/utils/kup-manager/kup-manager.d.ts +18 -5
- package/dist/types/utils/kup-objects/kup-objects.d.ts +1 -7
- package/dist/types/utils/kup-search/kup-search-declarations.d.ts +7 -0
- package/dist/types/utils/kup-search/kup-search.d.ts +20 -0
- package/dist/types/utils/kup-theme/kup-theme-declarations.d.ts +2 -0
- package/dist/types/utils/kup-theme/kup-theme.d.ts +2 -2
- package/dist/types/utils/utils.d.ts +0 -1
- package/package.json +4 -6
- package/dist/cjs/cell-utils-1f89a299.js +0 -1527
- package/dist/cjs/drag-and-drop-4787ff6f.js +0 -281
- package/dist/cjs/f-chip-2d58c8f7.js +0 -239
- package/dist/cjs/kup-grid.cjs.entry.js +0 -130
- package/dist/cjs/kup-manager-59ad8bdc.js +0 -4845
- package/dist/cjs/kup-objects-59ea949c.js +0 -717
- package/dist/collection/assets/images/drag-multiple.js +0 -1
- package/dist/collection/components/kup-editor/kup-editor.css +0 -5
- package/dist/collection/components/kup-editor/kup-editor.js +0 -59
- package/dist/collection/components/kup-layout/kup-layout.css +0 -53
- package/dist/collection/components/kup-layout/kup-layout.js +0 -156
- package/dist/collection/utils/drag-and-drop.js +0 -109
- package/dist/collection/utils/kup-dialog/kup-dialog-declarations.js +0 -36
- package/dist/collection/utils/kup-dialog/kup-dialog.js +0 -310
- package/dist/esm/cell-utils-cb612463.js +0 -1510
- package/dist/esm/drag-and-drop-321cb4ca.js +0 -265
- package/dist/esm/f-chip-125d5dd6.js +0 -236
- package/dist/esm/kup-grid.entry.js +0 -126
- package/dist/esm/kup-manager-e7d7b353.js +0 -4842
- package/dist/esm/kup-objects-d38d2fa2.js +0 -711
- package/dist/ketchup/p-00fe1e3e.js +0 -1
- package/dist/ketchup/p-0320e24e.entry.js +0 -1
- package/dist/ketchup/p-08c7a092.js +0 -1
- package/dist/ketchup/p-1165f4ea.entry.js +0 -1
- package/dist/ketchup/p-170d3cba.js +0 -1
- package/dist/ketchup/p-18cb3ba3.js +0 -1
- package/dist/ketchup/p-23541a97.entry.js +0 -45
- package/dist/ketchup/p-64ea7e37.entry.js +0 -1
- package/dist/ketchup/p-7896031c.entry.js +0 -1
- package/dist/ketchup/p-876da4c2.entry.js +0 -1
- package/dist/ketchup/p-8fb9d9b2.entry.js +0 -1
- package/dist/ketchup/p-940ab57a.entry.js +0 -1
- package/dist/ketchup/p-9c858a38.entry.js +0 -1
- package/dist/ketchup/p-a12a5690.entry.js +0 -1
- package/dist/ketchup/p-a5424073.js +0 -1
- package/dist/ketchup/p-b0724035.entry.js +0 -1
- package/dist/ketchup/p-b14e77f0.js +0 -1
- package/dist/ketchup/p-d24cfdea.entry.js +0 -1
- package/dist/ketchup/p-ee89966f.entry.js +0 -27
- package/dist/ketchup/p-fcd2fd8f.js +0 -1
- package/dist/ketchup/p-fce3b9d8.entry.js +0 -1
- package/dist/types/assets/images/drag-multiple.d.ts +0 -1
- package/dist/types/components/kup-editor/kup-editor.d.ts +0 -16
- package/dist/types/components/kup-layout/kup-layout.d.ts +0 -25
- package/dist/types/utils/drag-and-drop.d.ts +0 -53
- package/dist/types/utils/kup-dialog/kup-dialog-declarations.d.ts +0 -43
- package/dist/types/utils/kup-dialog/kup-dialog.d.ts +0 -50
|
@@ -8,7 +8,7 @@ export const FSwitch = (props) => {
|
|
|
8
8
|
'switch--checked': props.checked,
|
|
9
9
|
'switch--disabled': props.disabled,
|
|
10
10
|
};
|
|
11
|
-
return (h("div", Object.assign({ class: `f-switch
|
|
11
|
+
return (h("div", Object.assign({ class: `f-switch ${props.danger ? 'kup-danger' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
|
|
12
12
|
h("div", { class: `form-field ${props.leadingLabel ? 'form-field--align-end' : ''}` },
|
|
13
13
|
h("div", { class: `switch ${props.checked ? 'switch--checked' : ''} ${props.disabled ? 'switch--disabled' : ''}` },
|
|
14
14
|
h("div", { class: "switch__track" }),
|
|
@@ -2,7 +2,7 @@ import { MDCTextField, MDCTextFieldCharacterCounter, MDCTextFieldHelperText, MDC
|
|
|
2
2
|
import { MDCFormField } from '@material/form-field';
|
|
3
3
|
/**
|
|
4
4
|
* Instantiates Material Design text field component.
|
|
5
|
-
* @param el - Must be the f-component wrapper (.f-text-field
|
|
5
|
+
* @param el - Must be the f-component wrapper (.f-text-field)
|
|
6
6
|
* @see https://material-components.github.io/material-components-web-catalog/#/component/text-field
|
|
7
7
|
*/
|
|
8
8
|
export function FTextFieldMDC(el) {
|
|
@@ -3,12 +3,14 @@ import { KupThemeIconValues } from '../../utils/kup-theme/kup-theme-declarations
|
|
|
3
3
|
/*-------------------------------------------------*/
|
|
4
4
|
/* C o m p o n e n t */
|
|
5
5
|
/*-------------------------------------------------*/
|
|
6
|
-
export const FTextField = (props) => {
|
|
7
|
-
return (h("div", Object.assign({ class: `f-text-field
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
export const FTextField = (props, children) => {
|
|
7
|
+
return (h("div", Object.assign({ class: `f-text-field ${props.danger ? 'kup-danger' : ''} ${props.fullHeight ? 'kup-full-height' : ''} ${props.fullWidth ? 'kup-full-width' : ''} ${props.info ? 'kup-info' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.shaped ? 'kup-shaped' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
|
|
8
|
+
props.leadingLabel || props.trailingLabel ? (h("div", { class: `mdc-form-field ${props.leadingLabel ? 'mdc-form-field--align-end' : ''}` }, [
|
|
9
|
+
setContent(props),
|
|
10
|
+
setHelper(props),
|
|
11
|
+
h("label", null, props.label),
|
|
12
|
+
])) : ([setContent(props), setHelper(props)]),
|
|
13
|
+
children));
|
|
12
14
|
};
|
|
13
15
|
/*-------------------------------------------------*/
|
|
14
16
|
/* M e t h o d s */
|
|
@@ -63,23 +65,25 @@ function setContent(props) {
|
|
|
63
65
|
h("div", { class: "mdc-notched-outline__trailing" }))) : (h("span", { class: "mdc-line-ripple" }))));
|
|
64
66
|
}
|
|
65
67
|
function setHelper(props) {
|
|
66
|
-
if (props.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
h("div", { class: classObj }, props.helper),
|
|
73
|
-
props.maxLength && !props.textArea ? (h("div", { class: "mdc-text-field-character-counter" },
|
|
74
|
-
"'0 / ' + ",
|
|
75
|
-
props.maxLength.toString())) : undefined));
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
if (props.maxLength && !props.textArea) {
|
|
68
|
+
if (props.helperEnabled) {
|
|
69
|
+
if (props.helper) {
|
|
70
|
+
const classObj = {
|
|
71
|
+
'mdc-text-field-helper-text': true,
|
|
72
|
+
'mdc-text-field-helper-text--persistent': !props.helperWhenFocused,
|
|
73
|
+
};
|
|
79
74
|
return (h("div", { class: "mdc-text-field-helper-line" },
|
|
80
|
-
h("div", { class:
|
|
75
|
+
h("div", { class: classObj }, props.helper),
|
|
76
|
+
props.maxLength && !props.textArea ? (h("div", { class: "mdc-text-field-character-counter" },
|
|
81
77
|
"'0 / ' + ",
|
|
82
|
-
props.maxLength)));
|
|
78
|
+
props.maxLength.toString())) : undefined));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
if (props.maxLength && !props.textArea) {
|
|
82
|
+
return (h("div", { class: "mdc-text-field-helper-line" },
|
|
83
|
+
h("div", { class: "mdc-text-field-character-counter" },
|
|
84
|
+
"'0 / ' + ",
|
|
85
|
+
props.maxLength)));
|
|
86
|
+
}
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
}
|
|
@@ -1,214 +1,10 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
1
|
import numeral from 'numeral';
|
|
3
2
|
import { stringToNumber, unformattedStringToFormattedStringNumber, unformattedStringToFormattedStringTime, unformattedStringToFormattedStringTimestamp, } from './utils';
|
|
4
|
-
import { KupObjects } from './kup-objects/kup-objects';
|
|
5
|
-
import { KupDates } from './kup-dates/kup-dates';
|
|
6
3
|
import { KupDatesFormats } from './kup-dates/kup-dates-declarations';
|
|
7
4
|
const dom = document.documentElement;
|
|
8
|
-
const kupDates = dom.ketchup ? dom.ketchup.dates : new KupDates();
|
|
9
|
-
const kupObjects = dom.ketchup
|
|
10
|
-
? dom.ketchup.objects
|
|
11
|
-
: new KupObjects();
|
|
12
5
|
// -------------
|
|
13
6
|
// COMMONS
|
|
14
7
|
// -------------
|
|
15
|
-
export function getShape(cell, boxObject) {
|
|
16
|
-
let prop = get(cell, 'shape', null);
|
|
17
|
-
if (!prop && boxObject) {
|
|
18
|
-
prop = get(boxObject, 'shape', null);
|
|
19
|
-
}
|
|
20
|
-
return prop ? prop.toUpperCase() : null;
|
|
21
|
-
}
|
|
22
|
-
export function getValue(cell, boxObject) {
|
|
23
|
-
let prop = get(cell, 'value', null);
|
|
24
|
-
if (!prop) {
|
|
25
|
-
prop = get(boxObject, 'value', null);
|
|
26
|
-
}
|
|
27
|
-
return prop;
|
|
28
|
-
}
|
|
29
|
-
export function getFromConfig(cell, boxObject, propName) {
|
|
30
|
-
let prop = null;
|
|
31
|
-
if (cell && cell.data) {
|
|
32
|
-
prop = get(cell.data, propName, null);
|
|
33
|
-
}
|
|
34
|
-
if (!prop && boxObject && boxObject.config) {
|
|
35
|
-
prop = get(boxObject.config, propName, null);
|
|
36
|
-
}
|
|
37
|
-
return prop;
|
|
38
|
-
}
|
|
39
|
-
// -------------
|
|
40
|
-
// PROGRESS BAR
|
|
41
|
-
// -------------
|
|
42
|
-
export function isProgressBar(cell, boxObject) {
|
|
43
|
-
let shape = getShape(cell, boxObject);
|
|
44
|
-
return ('PGB' === shape ||
|
|
45
|
-
(!shape && cell && cell.obj && kupObjects.isProgressBar(cell.obj)));
|
|
46
|
-
}
|
|
47
|
-
// -------------
|
|
48
|
-
// CHIP
|
|
49
|
-
// -------------
|
|
50
|
-
export function isChip(cell, boxObject) {
|
|
51
|
-
let shape = getShape(cell, boxObject);
|
|
52
|
-
return ('CHI' === shape ||
|
|
53
|
-
(!shape && cell && cell.obj && kupObjects.isKupObjList(cell.obj)));
|
|
54
|
-
}
|
|
55
|
-
// -------------
|
|
56
|
-
// IMAGE
|
|
57
|
-
// -------------
|
|
58
|
-
export function isImage(cell, boxObject) {
|
|
59
|
-
let shape = getShape(cell, boxObject);
|
|
60
|
-
return ('IMG' === shape ||
|
|
61
|
-
(!shape && cell && cell.obj && kupObjects.isImage(cell.obj)));
|
|
62
|
-
}
|
|
63
|
-
// -------------
|
|
64
|
-
// COMBO
|
|
65
|
-
// -------------
|
|
66
|
-
export function isCombo(cell, boxObject) {
|
|
67
|
-
let shape = getShape(cell, boxObject);
|
|
68
|
-
return 'CMB' === shape;
|
|
69
|
-
}
|
|
70
|
-
// -------------
|
|
71
|
-
// AUTOCOMPLETE
|
|
72
|
-
// -------------
|
|
73
|
-
export function isAutocomplete(cell, boxObject) {
|
|
74
|
-
let shape = getShape(cell, boxObject);
|
|
75
|
-
return 'ACP' === shape;
|
|
76
|
-
}
|
|
77
|
-
// -------------
|
|
78
|
-
// INPUT TEXT
|
|
79
|
-
// -------------
|
|
80
|
-
export function isInputText(cell, boxObject) {
|
|
81
|
-
let shape = getShape(cell, boxObject);
|
|
82
|
-
return 'ITX' === shape || !shape;
|
|
83
|
-
}
|
|
84
|
-
// -------------
|
|
85
|
-
// INPUT EDITOR
|
|
86
|
-
// -------------
|
|
87
|
-
export function isEditor(cell, boxObject) {
|
|
88
|
-
let shape = getShape(cell, boxObject);
|
|
89
|
-
return 'EDT' === shape;
|
|
90
|
-
}
|
|
91
|
-
// -------------
|
|
92
|
-
// RATING
|
|
93
|
-
// -------------
|
|
94
|
-
export function isRating(cell, boxObject) {
|
|
95
|
-
let shape = getShape(cell, boxObject);
|
|
96
|
-
return 'RTG' === shape;
|
|
97
|
-
}
|
|
98
|
-
// -------------
|
|
99
|
-
// COLOR
|
|
100
|
-
// -------------
|
|
101
|
-
export function isColor(cell, boxObject) {
|
|
102
|
-
let shape = getShape(cell, boxObject);
|
|
103
|
-
return ('CLP' === shape ||
|
|
104
|
-
(!shape && cell && cell.obj && kupObjects.isColor(cell.obj)));
|
|
105
|
-
}
|
|
106
|
-
// -------------
|
|
107
|
-
// CHART
|
|
108
|
-
// -------------
|
|
109
|
-
export function isChart(cell, boxObject) {
|
|
110
|
-
let shape = getShape(cell, boxObject);
|
|
111
|
-
return ('GRA' === shape ||
|
|
112
|
-
(!shape && cell && cell.obj && kupObjects.isChart(cell.obj)));
|
|
113
|
-
}
|
|
114
|
-
// -------------
|
|
115
|
-
// RADIO
|
|
116
|
-
// -------------
|
|
117
|
-
export function isRadio(cell, boxObject) {
|
|
118
|
-
let shape = getShape(cell, boxObject);
|
|
119
|
-
return ('RAD' === shape ||
|
|
120
|
-
(!shape && cell && cell.obj && kupObjects.isRadio(cell.obj)));
|
|
121
|
-
}
|
|
122
|
-
// -------------
|
|
123
|
-
// GAUGE
|
|
124
|
-
// -------------
|
|
125
|
-
export function isGauge(cell, boxObject) {
|
|
126
|
-
let shape = getShape(cell, boxObject);
|
|
127
|
-
return 'GAU' === shape;
|
|
128
|
-
}
|
|
129
|
-
// -------------
|
|
130
|
-
// KNOB
|
|
131
|
-
// -------------
|
|
132
|
-
export function isKnob(cell, boxObject) {
|
|
133
|
-
let shape = getShape(cell, boxObject);
|
|
134
|
-
return 'KNB' === shape;
|
|
135
|
-
}
|
|
136
|
-
// -------------
|
|
137
|
-
// BUTTON-LIST
|
|
138
|
-
// -------------
|
|
139
|
-
export function isButtonList(cell) {
|
|
140
|
-
let shape = getShape(cell);
|
|
141
|
-
return shape === 'BTN';
|
|
142
|
-
}
|
|
143
|
-
export function getCellType(cell) {
|
|
144
|
-
let obj = cell.obj;
|
|
145
|
-
if (isButtonList(cell)) {
|
|
146
|
-
return 'btn';
|
|
147
|
-
}
|
|
148
|
-
else if (kupObjects.isBar(obj)) {
|
|
149
|
-
return 'bar';
|
|
150
|
-
}
|
|
151
|
-
else if (kupObjects.isButton(obj)) {
|
|
152
|
-
return 'button';
|
|
153
|
-
}
|
|
154
|
-
else if (kupObjects.isChart(obj)) {
|
|
155
|
-
return 'chart';
|
|
156
|
-
}
|
|
157
|
-
else if (kupObjects.isCheckbox(obj)) {
|
|
158
|
-
return 'checkbox';
|
|
159
|
-
}
|
|
160
|
-
else if (isColor(cell, null)) {
|
|
161
|
-
return 'color-picker';
|
|
162
|
-
}
|
|
163
|
-
else if (isGauge(cell, null)) {
|
|
164
|
-
return 'gauge';
|
|
165
|
-
}
|
|
166
|
-
else if (isKnob(cell, null)) {
|
|
167
|
-
return 'knob';
|
|
168
|
-
}
|
|
169
|
-
else if (kupObjects.isIcon(obj)) {
|
|
170
|
-
return 'icon';
|
|
171
|
-
}
|
|
172
|
-
else if (isImage(cell, null)) {
|
|
173
|
-
return 'image';
|
|
174
|
-
}
|
|
175
|
-
else if (kupObjects.isLink(obj)) {
|
|
176
|
-
return 'link';
|
|
177
|
-
}
|
|
178
|
-
else if (isProgressBar(cell, null)) {
|
|
179
|
-
return 'progress-bar';
|
|
180
|
-
}
|
|
181
|
-
else if (isRadio(cell, null)) {
|
|
182
|
-
return 'radio';
|
|
183
|
-
}
|
|
184
|
-
else if (isRating(cell, null)) {
|
|
185
|
-
return 'rating';
|
|
186
|
-
}
|
|
187
|
-
else if (isChip(cell, null)) {
|
|
188
|
-
return 'chips';
|
|
189
|
-
}
|
|
190
|
-
else if (kupObjects.isNumber(obj)) {
|
|
191
|
-
return 'number';
|
|
192
|
-
}
|
|
193
|
-
else if (kupObjects.isDate(obj)) {
|
|
194
|
-
return 'date';
|
|
195
|
-
}
|
|
196
|
-
else if (kupObjects.isTimestamp(obj)) {
|
|
197
|
-
return 'datetime';
|
|
198
|
-
}
|
|
199
|
-
else if (kupObjects.isTime(obj)) {
|
|
200
|
-
return 'time';
|
|
201
|
-
}
|
|
202
|
-
else if (kupObjects.isTextField(obj)) {
|
|
203
|
-
return 'text-field';
|
|
204
|
-
}
|
|
205
|
-
else if (kupObjects.isVoCodver(obj)) {
|
|
206
|
-
return 'icon';
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
return 'string';
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
8
|
export function getCellValueForDisplay(column, cell) {
|
|
213
9
|
if (cell != null) {
|
|
214
10
|
if (cell.displayedValue != null) {
|
|
@@ -247,17 +43,17 @@ export function getValueForDisplay(value, obj, decimals) {
|
|
|
247
43
|
if (value == null || value.trim() == '') {
|
|
248
44
|
return value;
|
|
249
45
|
}
|
|
250
|
-
if (
|
|
46
|
+
if (dom.ketchup.objects.isNumber(obj)) {
|
|
251
47
|
return unformattedStringToFormattedStringNumber(value, decimals ? decimals : -1, obj ? obj.p : '');
|
|
252
48
|
}
|
|
253
|
-
if (
|
|
254
|
-
|
|
255
|
-
return
|
|
49
|
+
if (dom.ketchup.objects.isDate(obj) &&
|
|
50
|
+
dom.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE)) {
|
|
51
|
+
return dom.ketchup.dates.format(value);
|
|
256
52
|
}
|
|
257
|
-
if (
|
|
258
|
-
return unformattedStringToFormattedStringTime(value,
|
|
53
|
+
if (dom.ketchup.objects.isTime(obj)) {
|
|
54
|
+
return unformattedStringToFormattedStringTime(value, dom.ketchup.objects.isTimeWithSeconds(obj), obj.t + obj.p);
|
|
259
55
|
}
|
|
260
|
-
if (
|
|
56
|
+
if (dom.ketchup.objects.isTimestamp(obj)) {
|
|
261
57
|
return unformattedStringToFormattedStringTimestamp(value);
|
|
262
58
|
}
|
|
263
59
|
return value;
|
|
@@ -302,26 +98,26 @@ export function compareValues(obj1, value1, obj2, value2, sortMode) {
|
|
|
302
98
|
}
|
|
303
99
|
let v1 = s1;
|
|
304
100
|
let v2 = s2;
|
|
305
|
-
if (
|
|
101
|
+
if (dom.ketchup.objects.isNumber(obj1)) {
|
|
306
102
|
v1 = stringToNumber(s1);
|
|
307
103
|
v2 = stringToNumber(s2);
|
|
308
104
|
}
|
|
309
|
-
else if (
|
|
310
|
-
v1 =
|
|
311
|
-
v2 =
|
|
105
|
+
else if (dom.ketchup.objects.isDate(obj1)) {
|
|
106
|
+
v1 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s1, KupDatesFormats.ISO_DATE));
|
|
107
|
+
v2 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s2, KupDatesFormats.ISO_DATE));
|
|
312
108
|
}
|
|
313
|
-
else if (
|
|
314
|
-
let manageSeconds =
|
|
315
|
-
v1 =
|
|
109
|
+
else if (dom.ketchup.objects.isTime(obj1)) {
|
|
110
|
+
let manageSeconds = dom.ketchup.objects.isTimeWithSeconds(obj1);
|
|
111
|
+
v1 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s1, manageSeconds
|
|
316
112
|
? KupDatesFormats.ISO_TIME
|
|
317
113
|
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS));
|
|
318
|
-
v2 =
|
|
114
|
+
v2 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s2, manageSeconds
|
|
319
115
|
? KupDatesFormats.ISO_TIME
|
|
320
116
|
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS));
|
|
321
117
|
}
|
|
322
|
-
else if (
|
|
323
|
-
v1 =
|
|
324
|
-
v2 =
|
|
118
|
+
else if (dom.ketchup.objects.isTimestamp(obj1)) {
|
|
119
|
+
v1 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s1, KupDatesFormats.ISO_DATE_TIME));
|
|
120
|
+
v2 = dom.ketchup.dates.toDate(dom.ketchup.dates.format(s2, KupDatesFormats.ISO_DATE_TIME));
|
|
325
121
|
}
|
|
326
122
|
if (v1 > v2) {
|
|
327
123
|
return sm * 1;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { KupDates } from '../kup-dates/kup-dates';
|
|
2
1
|
import { KupDatesFormats, KupDatesNormalize, } from '../kup-dates/kup-dates-declarations';
|
|
3
|
-
import { KupObjects } from '../kup-objects/kup-objects';
|
|
4
2
|
import { formattedStringToCustomUnformattedStringTime, formattedStringToDefaultUnformattedStringTimestamp, formattedStringToUnformattedStringNumber, isValidFormattedStringNumber, isValidFormattedStringTime, stringToNumber, unformattedStringNumberToNumber, isNumber as isNumberThisString, } from '../utils';
|
|
5
3
|
import { FilterInterval, FILTER_ANALIZER, } from './filters-declarations';
|
|
6
4
|
const dom = document.documentElement;
|
|
7
|
-
const kupDates = dom.ketchup ? dom.ketchup.dates : new KupDates();
|
|
8
|
-
const kupObjects = dom.ketchup
|
|
9
|
-
? dom.ketchup.objects
|
|
10
|
-
: new KupObjects();
|
|
11
5
|
/**
|
|
12
6
|
* Filtering algorithms.
|
|
13
7
|
* @module Filters
|
|
@@ -23,16 +17,16 @@ export class Filters {
|
|
|
23
17
|
return comp.rootElement.tagName === 'KUP-TREE';
|
|
24
18
|
}
|
|
25
19
|
isObjFiltrableByInterval(obj) {
|
|
26
|
-
if (
|
|
20
|
+
if (dom.ketchup.objects.isDate(obj)) {
|
|
27
21
|
return true;
|
|
28
22
|
}
|
|
29
|
-
if (
|
|
23
|
+
if (dom.ketchup.objects.isTime(obj)) {
|
|
30
24
|
return true;
|
|
31
25
|
}
|
|
32
|
-
if (
|
|
26
|
+
if (dom.ketchup.objects.isTimestamp(obj)) {
|
|
33
27
|
return true;
|
|
34
28
|
}
|
|
35
|
-
if (
|
|
29
|
+
if (dom.ketchup.objects.isNumber(obj)) {
|
|
36
30
|
return true;
|
|
37
31
|
}
|
|
38
32
|
return false;
|
|
@@ -42,17 +36,17 @@ export class Filters {
|
|
|
42
36
|
if (newValue == null || newValue == '' || smeupObj == null) {
|
|
43
37
|
return newValue;
|
|
44
38
|
}
|
|
45
|
-
if (
|
|
46
|
-
if (
|
|
39
|
+
if (dom.ketchup.objects.isDate(smeupObj)) {
|
|
40
|
+
if (dom.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE)) {
|
|
47
41
|
return newValue;
|
|
48
42
|
}
|
|
49
|
-
if (
|
|
50
|
-
return
|
|
43
|
+
if (dom.ketchup.dates.isValid(value)) {
|
|
44
|
+
return dom.ketchup.dates.format(dom.ketchup.dates.normalize(value, KupDatesNormalize.DATE), KupDatesFormats.ISO_DATE);
|
|
51
45
|
}
|
|
52
46
|
}
|
|
53
|
-
else if (
|
|
54
|
-
let manageSeconds =
|
|
55
|
-
if (
|
|
47
|
+
else if (dom.ketchup.objects.isTime(smeupObj)) {
|
|
48
|
+
let manageSeconds = dom.ketchup.objects.isTimeWithSeconds(smeupObj);
|
|
49
|
+
if (dom.ketchup.dates.isValid(value, manageSeconds
|
|
56
50
|
? KupDatesFormats.ISO_TIME
|
|
57
51
|
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS)) {
|
|
58
52
|
return newValue;
|
|
@@ -63,15 +57,15 @@ export class Filters {
|
|
|
63
57
|
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS, manageSeconds);
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
|
-
else if (
|
|
67
|
-
if (
|
|
60
|
+
else if (dom.ketchup.objects.isTimestamp(smeupObj)) {
|
|
61
|
+
if (dom.ketchup.dates.isValid(value, KupDatesFormats.ISO_DATE_TIME)) {
|
|
68
62
|
return newValue;
|
|
69
63
|
}
|
|
70
64
|
if (isValidFormattedStringTime(value, true)) {
|
|
71
65
|
return formattedStringToDefaultUnformattedStringTimestamp(value);
|
|
72
66
|
}
|
|
73
67
|
}
|
|
74
|
-
else if (
|
|
68
|
+
else if (dom.ketchup.objects.isNumber(smeupObj)) {
|
|
75
69
|
if (isValidFormattedStringNumber(value, smeupObj ? smeupObj.p : '')) {
|
|
76
70
|
return formattedStringToUnformattedStringNumber(value, smeupObj ? smeupObj.p : '');
|
|
77
71
|
}
|
|
@@ -194,7 +188,7 @@ export class Filters {
|
|
|
194
188
|
to = interval[FilterInterval.TO];
|
|
195
189
|
}
|
|
196
190
|
let checkByRegularExpression = true;
|
|
197
|
-
if (
|
|
191
|
+
if (dom.ketchup.objects.isNumber(obj)) {
|
|
198
192
|
value = unformattedStringNumberToNumber(value, obj ? obj.p : '');
|
|
199
193
|
let valueNumber = stringToNumber(value);
|
|
200
194
|
if (from != '') {
|
|
@@ -222,30 +216,30 @@ export class Filters {
|
|
|
222
216
|
}
|
|
223
217
|
}
|
|
224
218
|
}
|
|
225
|
-
if (
|
|
226
|
-
|
|
227
|
-
|
|
219
|
+
if (dom.ketchup.objects.isDate(obj) ||
|
|
220
|
+
dom.ketchup.objects.isTime(obj) ||
|
|
221
|
+
dom.ketchup.objects.isTimestamp(obj)) {
|
|
228
222
|
let valueDate = null;
|
|
229
223
|
let defaultFormat = KupDatesFormats.ISO_DATE;
|
|
230
|
-
if (
|
|
224
|
+
if (dom.ketchup.objects.isDate(obj)) {
|
|
231
225
|
defaultFormat = KupDatesFormats.ISO_DATE;
|
|
232
226
|
}
|
|
233
|
-
else if (
|
|
234
|
-
defaultFormat =
|
|
227
|
+
else if (dom.ketchup.objects.isTime(obj)) {
|
|
228
|
+
defaultFormat = dom.ketchup.objects.isTimeWithSeconds(obj)
|
|
235
229
|
? KupDatesFormats.ISO_TIME
|
|
236
230
|
: KupDatesFormats.ISO_TIME_WITHOUT_SECONDS;
|
|
237
231
|
}
|
|
238
|
-
else if (
|
|
232
|
+
else if (dom.ketchup.objects.isTimestamp(obj)) {
|
|
239
233
|
defaultFormat = KupDatesFormats.ISO_DATE_TIME;
|
|
240
234
|
}
|
|
241
|
-
if (
|
|
242
|
-
valueDate =
|
|
235
|
+
if (dom.ketchup.dates.isValid(value, defaultFormat, true)) {
|
|
236
|
+
valueDate = dom.ketchup.dates.toDate(value, defaultFormat);
|
|
243
237
|
}
|
|
244
238
|
if (from != '') {
|
|
245
239
|
if (valueDate != null &&
|
|
246
|
-
|
|
240
|
+
dom.ketchup.dates.isValid(from, defaultFormat, true)) {
|
|
247
241
|
checkByRegularExpression = false;
|
|
248
|
-
let fromDate =
|
|
242
|
+
let fromDate = dom.ketchup.dates.toDate(from, defaultFormat);
|
|
249
243
|
if (valueDate < fromDate) {
|
|
250
244
|
return false;
|
|
251
245
|
}
|
|
@@ -256,9 +250,9 @@ export class Filters {
|
|
|
256
250
|
}
|
|
257
251
|
if (to != '') {
|
|
258
252
|
if (valueDate != null &&
|
|
259
|
-
|
|
253
|
+
dom.ketchup.dates.isValid(to, defaultFormat, true)) {
|
|
260
254
|
checkByRegularExpression = false;
|
|
261
|
-
let toDate =
|
|
255
|
+
let toDate = dom.ketchup.dates.toDate(to, defaultFormat);
|
|
262
256
|
if (valueDate > toDate) {
|
|
263
257
|
return false;
|
|
264
258
|
}
|
|
@@ -267,9 +261,9 @@ export class Filters {
|
|
|
267
261
|
filterValue = to;
|
|
268
262
|
}
|
|
269
263
|
}
|
|
270
|
-
if (!
|
|
271
|
-
!
|
|
272
|
-
value =
|
|
264
|
+
if (!dom.ketchup.dates.isValid(filterValue, defaultFormat) &&
|
|
265
|
+
!dom.ketchup.dates.isValid(filterValue)) {
|
|
266
|
+
value = dom.ketchup.dates.format(value);
|
|
273
267
|
}
|
|
274
268
|
}
|
|
275
269
|
if (checkByRegularExpression) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KupDynamicPositionPlacement } from '../kup-dynamic-position/kup-dynamic-position-declarations';
|
|
1
|
+
import { KupDynamicPositionPlacement, } from '../kup-dynamic-position/kup-dynamic-position-declarations';
|
|
2
2
|
import { treeMainColumnName } from '../../components/kup-tree/kup-tree-declarations';
|
|
3
3
|
import { unsetTooltip } from '../helpers';
|
|
4
4
|
import { FiltersColumnMenu } from '../filters/filters-column-menu';
|
|
@@ -18,6 +18,7 @@ const dom = document.documentElement;
|
|
|
18
18
|
*/
|
|
19
19
|
export class KupColumnMenu {
|
|
20
20
|
constructor() {
|
|
21
|
+
this.clickCb = null;
|
|
21
22
|
this.filtersColumnMenuInstance = new FiltersColumnMenu();
|
|
22
23
|
this.filtersRowsInstance = new FiltersRows();
|
|
23
24
|
}
|
|
@@ -39,6 +40,8 @@ export class KupColumnMenu {
|
|
|
39
40
|
*/
|
|
40
41
|
close(card) {
|
|
41
42
|
card.menuVisible = false;
|
|
43
|
+
dom.ketchup.removeClickCallback(this.clickCb);
|
|
44
|
+
dom.ketchup.dynamicPosition.stop(card);
|
|
42
45
|
}
|
|
43
46
|
/**
|
|
44
47
|
* Function called to reposition the column menu card to the appropriate column.
|
|
@@ -56,6 +59,15 @@ export class KupColumnMenu {
|
|
|
56
59
|
else {
|
|
57
60
|
dom.ketchup.dynamicPosition.register(card, wrapper, 0, KupDynamicPositionPlacement.BOTTOM, true);
|
|
58
61
|
}
|
|
62
|
+
if (!this.clickCb) {
|
|
63
|
+
this.clickCb = {
|
|
64
|
+
cb: () => {
|
|
65
|
+
this.close(card);
|
|
66
|
+
},
|
|
67
|
+
el: card,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
dom.ketchup.addClickCallback(this.clickCb, true);
|
|
59
71
|
dom.ketchup.dynamicPosition.start(card);
|
|
60
72
|
card.menuVisible = true;
|
|
61
73
|
}
|
|
@@ -263,7 +275,7 @@ export class KupColumnMenu {
|
|
|
263
275
|
prepSwitch(comp, column) {
|
|
264
276
|
const props = [];
|
|
265
277
|
if (!FiltersColumnMenu.isTree(comp)) {
|
|
266
|
-
if (!dom.ketchup.objects.
|
|
278
|
+
if (!dom.ketchup.objects.isEmptyKupObj(column.obj)) {
|
|
267
279
|
props.push({
|
|
268
280
|
'data-storage': {
|
|
269
281
|
columnName: column.name,
|
|
@@ -538,7 +550,7 @@ export class KupColumnMenu {
|
|
|
538
550
|
eventHandlers(cardEvent, comp) {
|
|
539
551
|
const card = cardEvent.detail.card
|
|
540
552
|
? cardEvent.detail.card
|
|
541
|
-
: cardEvent.detail.comp;
|
|
553
|
+
: cardEvent.detail.comp.rootElement;
|
|
542
554
|
const compEvent = cardEvent.detail.event;
|
|
543
555
|
const compID = compEvent.detail.id;
|
|
544
556
|
const subcomp = compEvent.target;
|
|
@@ -8,7 +8,7 @@ import 'dayjs/locale/it';
|
|
|
8
8
|
import 'dayjs/locale/pl';
|
|
9
9
|
import 'dayjs/locale/ru';
|
|
10
10
|
import 'dayjs/locale/zh';
|
|
11
|
-
import { KupDatesNormalize } from './kup-dates-declarations';
|
|
11
|
+
import { KupDatesLocales, KupDatesNormalize } from './kup-dates-declarations';
|
|
12
12
|
/**
|
|
13
13
|
* Handles operations and formatting of dates.
|
|
14
14
|
* @module KupDates
|
|
@@ -41,7 +41,9 @@ export class KupDates {
|
|
|
41
41
|
if (!navLangs || !navLangs.length) {
|
|
42
42
|
return 'en';
|
|
43
43
|
}
|
|
44
|
-
this.locale = navLangs[0]
|
|
44
|
+
this.locale = navLangs[0]
|
|
45
|
+
.split('-')[0]
|
|
46
|
+
.toLowerCase();
|
|
45
47
|
}
|
|
46
48
|
dayjs.locale(this.locale);
|
|
47
49
|
document.dispatchEvent(new CustomEvent('kup-dates-localechange'));
|
|
@@ -53,6 +55,16 @@ export class KupDates {
|
|
|
53
55
|
getLocale() {
|
|
54
56
|
return this.locale;
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Gets the available locales.
|
|
60
|
+
* @returns {Array<KupDatesLocales>} Array of locales' names.
|
|
61
|
+
*/
|
|
62
|
+
getLocales() {
|
|
63
|
+
const items = Object.keys(KupDatesLocales)
|
|
64
|
+
.map((key) => KupDatesLocales[key])
|
|
65
|
+
.filter((value) => typeof value === 'string');
|
|
66
|
+
return items;
|
|
67
|
+
}
|
|
56
68
|
/**
|
|
57
69
|
* Formats the given date.
|
|
58
70
|
* @param {dayjs.ConfigType} input - Date to be formatted.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Copy/paste the code below inside Google Chrome Dev Tools console, then run logCSS() with the following arguments:
|
|
5
5
|
//
|
|
6
|
-
// 1) String - CSS selector of your
|
|
6
|
+
// 1) String - CSS selector of your Ketchup component, for example "kup-data-table#my-table"
|
|
7
7
|
// 2) Boolean - Whether you want a detailed log or not
|
|
8
8
|
//
|
|
9
9
|
// Note: detailedLog will inflate time because of console.logs, useful to check individual entries only.
|
|
@@ -92,11 +92,11 @@ function logCSS(selector, detailedLog) {
|
|
|
92
92
|
console.log('Total time estimated: ' + (end - start) + 'ms.');
|
|
93
93
|
}
|
|
94
94
|
//
|
|
95
|
-
// Check how many event listeners are defined on a
|
|
95
|
+
// Check how many event listeners are defined on a Ketchup component and its children.
|
|
96
96
|
//
|
|
97
97
|
// Copy/paste the code below inside Google Chrome Dev Tools console, then run logEvents() with the following arguments:
|
|
98
98
|
//
|
|
99
|
-
// 1) String - CSS selector of your
|
|
99
|
+
// 1) String - CSS selector of your Ketchup component, for example "kup-data-table#my-table"
|
|
100
100
|
// 2) Boolean - Whether you want a detailed log or not
|
|
101
101
|
//
|
|
102
102
|
function logEvents(selector, detailedLog) {
|