@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
|
@@ -0,0 +1,731 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-0416afab.js');
|
|
4
|
+
const cellUtils = require('./cell-utils-dc0884a3.js');
|
|
5
|
+
const kupManager = require('./kup-manager-1a2688ca.js');
|
|
6
|
+
const utils = require('./utils-0cc466b9.js');
|
|
7
|
+
const fImage = require('./f-image-d3bd4e08.js');
|
|
8
|
+
const fChip = require('./f-chip-90d95d22.js');
|
|
9
|
+
|
|
10
|
+
/*-------------------------------------------------*/
|
|
11
|
+
/* C o m p o n e n t */
|
|
12
|
+
/*-------------------------------------------------*/
|
|
13
|
+
const FTextField = (props, children) => {
|
|
14
|
+
return (index.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 }),
|
|
15
|
+
props.leadingLabel || props.trailingLabel ? (index.h("div", { class: `mdc-form-field ${props.leadingLabel ? 'mdc-form-field--align-end' : ''}` }, [
|
|
16
|
+
setContent(props),
|
|
17
|
+
setHelper(props),
|
|
18
|
+
index.h("label", null, props.label),
|
|
19
|
+
])) : ([setContent(props), setHelper(props)]),
|
|
20
|
+
children));
|
|
21
|
+
};
|
|
22
|
+
/*-------------------------------------------------*/
|
|
23
|
+
/* M e t h o d s */
|
|
24
|
+
/*-------------------------------------------------*/
|
|
25
|
+
function setContent(props) {
|
|
26
|
+
const isOutlined = props.textArea || props.outlined;
|
|
27
|
+
let labelEl;
|
|
28
|
+
let iconEl;
|
|
29
|
+
if (props.label && !props.leadingLabel && !props.trailingLabel) {
|
|
30
|
+
labelEl = (index.h("label", { class: "mdc-floating-label", htmlFor: "kup-input" }, props.label));
|
|
31
|
+
}
|
|
32
|
+
if (props.icon) {
|
|
33
|
+
let iconStyle;
|
|
34
|
+
let iconClass = '';
|
|
35
|
+
if (Object.values(kupManager.KupThemeIconValues).indexOf(props.icon) > -1) {
|
|
36
|
+
iconClass = props.icon.replace('--', '');
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
let svg = `url('${index.getAssetPath(`./assets/svg/${props.icon}.svg`)}') no-repeat center`;
|
|
40
|
+
iconStyle = {
|
|
41
|
+
mask: svg,
|
|
42
|
+
webkitMask: svg,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
iconEl = (index.h("span", { tabindex: "0", style: iconStyle, onClick: props.onIconClick, class: `mdc-text-field__icon kup-icon action ${iconClass}` }));
|
|
46
|
+
}
|
|
47
|
+
const classObj = {
|
|
48
|
+
'is-clearable': props.isClearable,
|
|
49
|
+
'mdc-text-field': true,
|
|
50
|
+
'mdc-text-field--disabled': props.disabled,
|
|
51
|
+
'mdc-text-field--filled': !props.fullWidth && !isOutlined,
|
|
52
|
+
'mdc-text-field--no-label': !props.label,
|
|
53
|
+
'mdc-text-field--fullwidth': props.fullWidth,
|
|
54
|
+
'mdc-text-field--outlined': isOutlined,
|
|
55
|
+
'mdc-text-field--textarea': props.textArea,
|
|
56
|
+
'mdc-text-field--with-leading-icon': props.icon && !props.trailingIcon,
|
|
57
|
+
'mdc-text-field--with-trailing-icon': props.icon && props.trailingIcon,
|
|
58
|
+
};
|
|
59
|
+
return (index.h("div", { class: classObj },
|
|
60
|
+
props.textArea && props.maxLength ? (index.h("div", { class: "mdc-text-field-character-counter" },
|
|
61
|
+
"'0 / ' + ",
|
|
62
|
+
props.maxLength)) : undefined,
|
|
63
|
+
!props.trailingIcon ? iconEl : undefined,
|
|
64
|
+
props.textArea ? (index.h("span", { class: "mdc-text-field__resizer" },
|
|
65
|
+
index.h("textarea", { class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown }))) : (index.h("input", { type: props.inputType ? props.inputType : 'text', step: props.step, min: props.min, max: props.max, class: "mdc-text-field__input", disabled: props.disabled, readOnly: props.readOnly, placeholder: props.fullWidth ? props.label : undefined, maxlength: props.maxLength, value: props.value, onBlur: props.onBlur, onClick: props.onClick, onChange: props.onChange, onFocus: props.onFocus, onInput: props.onInput, onKeyDown: props.onKeyDown })),
|
|
66
|
+
props.isClearable ? (index.h("span", { tabindex: "1", class: `mdc-text-field__icon kup-icon ${kupManager.KupThemeIconValues.CLEAR.replace('--', '')}`, onClick: props.onClearIconClick })) : undefined,
|
|
67
|
+
props.trailingIcon ? iconEl : undefined,
|
|
68
|
+
!props.fullWidth && !isOutlined ? labelEl : undefined,
|
|
69
|
+
isOutlined ? (index.h("div", { class: "mdc-notched-outline" },
|
|
70
|
+
index.h("div", { class: "mdc-notched-outline__leading" }),
|
|
71
|
+
index.h("div", { class: "mdc-notched-outline__notch" }, labelEl),
|
|
72
|
+
index.h("div", { class: "mdc-notched-outline__trailing" }))) : (index.h("span", { class: "mdc-line-ripple" }))));
|
|
73
|
+
}
|
|
74
|
+
function setHelper(props) {
|
|
75
|
+
if (props.helperEnabled) {
|
|
76
|
+
if (props.helper) {
|
|
77
|
+
const classObj = {
|
|
78
|
+
'mdc-text-field-helper-text': true,
|
|
79
|
+
'mdc-text-field-helper-text--persistent': !props.helperWhenFocused,
|
|
80
|
+
};
|
|
81
|
+
return (index.h("div", { class: "mdc-text-field-helper-line" },
|
|
82
|
+
index.h("div", { class: classObj }, props.helper),
|
|
83
|
+
props.maxLength && !props.textArea ? (index.h("div", { class: "mdc-text-field-character-counter" },
|
|
84
|
+
"'0 / ' + ",
|
|
85
|
+
props.maxLength.toString())) : undefined));
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
if (props.maxLength && !props.textArea) {
|
|
89
|
+
return (index.h("div", { class: "mdc-text-field-helper-line" },
|
|
90
|
+
index.h("div", { class: "mdc-text-field-character-counter" },
|
|
91
|
+
"'0 / ' + ",
|
|
92
|
+
props.maxLength)));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const autoAlignComps = ['KUP-DATA-TABLE', 'KUP-TREE'];
|
|
99
|
+
/**
|
|
100
|
+
* Supported cell events.
|
|
101
|
+
*/
|
|
102
|
+
var FCellEvents;
|
|
103
|
+
(function (FCellEvents) {
|
|
104
|
+
FCellEvents["CLICK"] = "kup-cell-click";
|
|
105
|
+
FCellEvents["INPUT"] = "kup-cell-input";
|
|
106
|
+
FCellEvents["UPDATE"] = "kup-cell-update";
|
|
107
|
+
})(FCellEvents || (FCellEvents = {}));
|
|
108
|
+
/**
|
|
109
|
+
* Supported cell padding.
|
|
110
|
+
*/
|
|
111
|
+
exports.FCellPadding = void 0;
|
|
112
|
+
(function (FCellPadding) {
|
|
113
|
+
FCellPadding["DENSE"] = "dense";
|
|
114
|
+
FCellPadding["MEDIUM"] = "medium";
|
|
115
|
+
FCellPadding["NONE"] = "";
|
|
116
|
+
FCellPadding["WIDE"] = "wide";
|
|
117
|
+
})(exports.FCellPadding || (exports.FCellPadding = {}));
|
|
118
|
+
/**
|
|
119
|
+
* Supported cell CSS classes.
|
|
120
|
+
*/
|
|
121
|
+
var FCellClasses;
|
|
122
|
+
(function (FCellClasses) {
|
|
123
|
+
FCellClasses["BG_DANGER"] = "danger-bg";
|
|
124
|
+
FCellClasses["BG_GREEN"] = "green-bg";
|
|
125
|
+
FCellClasses["BG_GREY"] = "grey-bg";
|
|
126
|
+
FCellClasses["BG_ORANGE"] = "orange-bg";
|
|
127
|
+
FCellClasses["BG_PURPLE"] = "purple-bg";
|
|
128
|
+
FCellClasses["BG_SUCCESS"] = "success-bg";
|
|
129
|
+
FCellClasses["BG_TEAL"] = "teal-bg";
|
|
130
|
+
FCellClasses["BG_WARNING"] = "warning-bg";
|
|
131
|
+
FCellClasses["C_BG_DANGER"] = "c-danger-bg";
|
|
132
|
+
FCellClasses["C_BG_GREEN"] = "c-green-bg";
|
|
133
|
+
FCellClasses["C_BG_GREY"] = "c-grey-bg";
|
|
134
|
+
FCellClasses["C_BG_ORANGE"] = "c-orange-bg";
|
|
135
|
+
FCellClasses["C_BG_PURPLE"] = "c-purple-bg";
|
|
136
|
+
FCellClasses["C_BG_SUCCESS"] = "c-success-bg";
|
|
137
|
+
FCellClasses["C_BG_TEAL"] = "c-teal-bg";
|
|
138
|
+
FCellClasses["C_BG_WARNING"] = "c-warning-bg";
|
|
139
|
+
FCellClasses["C_CENTERED"] = "c-centered";
|
|
140
|
+
FCellClasses["C_FITTED"] = "c-fitted";
|
|
141
|
+
FCellClasses["C_PADDED"] = "c-padded";
|
|
142
|
+
FCellClasses["C_PADDED_HOR"] = "c-padded-hor";
|
|
143
|
+
FCellClasses["C_PADDED_VER"] = "c-padded-ver";
|
|
144
|
+
FCellClasses["C_ROUND"] = "c-round";
|
|
145
|
+
FCellClasses["C_RIGHT_ALIGNED"] = "c-right-aligned";
|
|
146
|
+
FCellClasses["C_SHAPED"] = "c-shaped";
|
|
147
|
+
FCellClasses["C_TEXT_VERTICAL"] = "c-vertical-text";
|
|
148
|
+
FCellClasses["CLICKABLE"] = "clickable";
|
|
149
|
+
FCellClasses["HOVER_DISPLAY"] = "display-on-hover";
|
|
150
|
+
FCellClasses["HOVER_EXPAND"] = "expand-on-hover";
|
|
151
|
+
FCellClasses["HOVER_REDUCE"] = "reduce-on-hover";
|
|
152
|
+
FCellClasses["INDICATOR_TOPRIGHT"] = "top-right-indicator";
|
|
153
|
+
FCellClasses["LINK"] = "link";
|
|
154
|
+
FCellClasses["MONOSPACE"] = "monospace";
|
|
155
|
+
FCellClasses["OBJ"] = "obj";
|
|
156
|
+
FCellClasses["SHAPED"] = "shaped";
|
|
157
|
+
FCellClasses["TEXT_DANGER"] = "danger-text";
|
|
158
|
+
FCellClasses["TEXT_INFO"] = "info-text";
|
|
159
|
+
FCellClasses["TEXT_PRIMARY"] = "primary-text";
|
|
160
|
+
FCellClasses["TEXT_PURPLE"] = "purple-text";
|
|
161
|
+
FCellClasses["TEXT_SECONDARY"] = "secondary-text";
|
|
162
|
+
FCellClasses["TEXT_STRONG"] = "strong-text";
|
|
163
|
+
FCellClasses["TEXT_SUCCESS"] = "success-text";
|
|
164
|
+
FCellClasses["TEXT_WARNING"] = "warning-text";
|
|
165
|
+
FCellClasses["UNDERLINED"] = "underlined";
|
|
166
|
+
})(FCellClasses || (FCellClasses = {}));
|
|
167
|
+
/**
|
|
168
|
+
* Supported cell shapes.
|
|
169
|
+
*/
|
|
170
|
+
var FCellShapes;
|
|
171
|
+
(function (FCellShapes) {
|
|
172
|
+
FCellShapes["AUTOCOMPLETE"] = "ACP";
|
|
173
|
+
FCellShapes["BUTTON_LIST"] = "BTN";
|
|
174
|
+
FCellShapes["CHART"] = "GRA";
|
|
175
|
+
FCellShapes["CHECKBOX"] = "CHK";
|
|
176
|
+
FCellShapes["CHIP"] = "CHI";
|
|
177
|
+
FCellShapes["COLOR_PICKER"] = "CLP";
|
|
178
|
+
FCellShapes["COMBOBOX"] = "CMB";
|
|
179
|
+
FCellShapes["EDITOR"] = "EDT";
|
|
180
|
+
FCellShapes["GAUGE"] = "GAU";
|
|
181
|
+
FCellShapes["IMAGE"] = "IMG";
|
|
182
|
+
FCellShapes["KNOB"] = "KNB";
|
|
183
|
+
FCellShapes["PROGRESS_BAR"] = "PGB";
|
|
184
|
+
FCellShapes["RADIO"] = "RAD";
|
|
185
|
+
FCellShapes["RATING"] = "RTG";
|
|
186
|
+
FCellShapes["TEXT_FIELD"] = "ITX";
|
|
187
|
+
})(FCellShapes || (FCellShapes = {}));
|
|
188
|
+
/**
|
|
189
|
+
* Supported cell types.
|
|
190
|
+
*/
|
|
191
|
+
var FCellTypes;
|
|
192
|
+
(function (FCellTypes) {
|
|
193
|
+
FCellTypes["AUTOCOMPLETE"] = "autocomplete";
|
|
194
|
+
FCellTypes["BAR"] = "bar";
|
|
195
|
+
FCellTypes["BUTTON"] = "button";
|
|
196
|
+
FCellTypes["BUTTON_LIST"] = "button-list";
|
|
197
|
+
FCellTypes["CHART"] = "chart";
|
|
198
|
+
FCellTypes["CHECKBOX"] = "checkbox";
|
|
199
|
+
FCellTypes["CHIP"] = "chips";
|
|
200
|
+
FCellTypes["COLOR_PICKER"] = "color-picker";
|
|
201
|
+
FCellTypes["COMBOBOX"] = "combobox";
|
|
202
|
+
FCellTypes["DATE"] = "date";
|
|
203
|
+
FCellTypes["DATETIME"] = "datetime";
|
|
204
|
+
FCellTypes["EDITOR"] = "editor";
|
|
205
|
+
FCellTypes["GAUGE"] = "gauge";
|
|
206
|
+
FCellTypes["ICON"] = "icon";
|
|
207
|
+
FCellTypes["IMAGE"] = "image";
|
|
208
|
+
FCellTypes["KNOB"] = "knob";
|
|
209
|
+
FCellTypes["LINK"] = "link";
|
|
210
|
+
FCellTypes["NUMBER"] = "number";
|
|
211
|
+
FCellTypes["PROGRESS_BAR"] = "progress-bar";
|
|
212
|
+
FCellTypes["RADIO"] = "radio";
|
|
213
|
+
FCellTypes["RATING"] = "rating";
|
|
214
|
+
FCellTypes["STRING"] = "string";
|
|
215
|
+
FCellTypes["TIME"] = "time";
|
|
216
|
+
})(FCellTypes || (FCellTypes = {}));
|
|
217
|
+
const editableTypes = [
|
|
218
|
+
FCellTypes.AUTOCOMPLETE,
|
|
219
|
+
FCellTypes.CHECKBOX,
|
|
220
|
+
FCellTypes.COLOR_PICKER,
|
|
221
|
+
FCellTypes.COMBOBOX,
|
|
222
|
+
FCellTypes.DATE,
|
|
223
|
+
FCellTypes.NUMBER,
|
|
224
|
+
FCellTypes.RATING,
|
|
225
|
+
FCellTypes.STRING,
|
|
226
|
+
FCellTypes.TIME,
|
|
227
|
+
];
|
|
228
|
+
const kupTypes = [
|
|
229
|
+
FCellTypes.BAR,
|
|
230
|
+
FCellTypes.BUTTON,
|
|
231
|
+
FCellTypes.BUTTON_LIST,
|
|
232
|
+
FCellTypes.CHART,
|
|
233
|
+
FCellTypes.CHIP,
|
|
234
|
+
FCellTypes.COLOR_PICKER,
|
|
235
|
+
FCellTypes.GAUGE,
|
|
236
|
+
FCellTypes.KNOB,
|
|
237
|
+
FCellTypes.PROGRESS_BAR,
|
|
238
|
+
FCellTypes.RADIO,
|
|
239
|
+
FCellTypes.RATING,
|
|
240
|
+
];
|
|
241
|
+
|
|
242
|
+
/*-------------------------------------------------*/
|
|
243
|
+
/* C o m p o n e n t */
|
|
244
|
+
/*-------------------------------------------------*/
|
|
245
|
+
const FCheckbox = (props) => {
|
|
246
|
+
const indeterminateAttr = {
|
|
247
|
+
'data-indeterminate': props.indeterminate ? true : false,
|
|
248
|
+
};
|
|
249
|
+
const classObj = {
|
|
250
|
+
checkbox: true,
|
|
251
|
+
'checkbox--checked': props.checked && !props.indeterminate ? true : false,
|
|
252
|
+
'checkbox--disabled': props.disabled ? true : false,
|
|
253
|
+
'checkbox--indeterminate': props.indeterminate ? true : false,
|
|
254
|
+
};
|
|
255
|
+
return (index.h("div", Object.assign({ class: `f-checkbox ${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 }),
|
|
256
|
+
index.h("div", { class: `form-field ${props.leadingLabel ? 'form-field--align-end' : ''}` },
|
|
257
|
+
index.h("div", { class: classObj },
|
|
258
|
+
index.h("input", Object.assign({ type: "checkbox", class: "checkbox__native-control", checked: props.checked, disabled: props.disabled, onBlur: props.onBlur, onChange: props.onChange, onFocus: props.onFocus }, indeterminateAttr, { value: props.checked ? 'on' : 'off' })),
|
|
259
|
+
index.h("div", { class: "checkbox__background", onClick: props.onChange },
|
|
260
|
+
index.h("svg", { class: "checkbox__checkmark", viewBox: "0 0 24 24" },
|
|
261
|
+
index.h("path", { class: "checkbox__checkmark-path", fill: "none", d: "M1.73,12.91 8.1,19.28 22.79,4.59" })),
|
|
262
|
+
index.h("div", { class: "checkbox__mixedmark" }))),
|
|
263
|
+
props.label ? index.h("label", null, props.label) : undefined)));
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
const dom = document.documentElement;
|
|
267
|
+
/*-------------------------------------------------*/
|
|
268
|
+
/* C o m p o n e n t */
|
|
269
|
+
/*-------------------------------------------------*/
|
|
270
|
+
const FCell = (props) => {
|
|
271
|
+
const cell = props.cell;
|
|
272
|
+
const column = props.column;
|
|
273
|
+
const row = props.row;
|
|
274
|
+
const shape = props.shape
|
|
275
|
+
? props.shape
|
|
276
|
+
: cell.shape
|
|
277
|
+
? cell.shape
|
|
278
|
+
: column.shape
|
|
279
|
+
? column.shape
|
|
280
|
+
: null;
|
|
281
|
+
const hasObj = !dom.ketchup.objects.isEmptyKupObj(cell.obj);
|
|
282
|
+
const isEditable = cell.isEditable && props.editable ? true : false;
|
|
283
|
+
const valueToDisplay = props.previousValue !== cell.value ? cell.value : '';
|
|
284
|
+
const cellType = getCellType(cell, shape);
|
|
285
|
+
const subcomponentProps = Object.assign({}, cell.data);
|
|
286
|
+
let cssClasses = cell.cssClass
|
|
287
|
+
? cell.cssClass
|
|
288
|
+
: column.cssClass
|
|
289
|
+
? column.cssClass
|
|
290
|
+
: '';
|
|
291
|
+
const classObj = {
|
|
292
|
+
'f-cell': true,
|
|
293
|
+
[FCellClasses.OBJ]: hasObj ? true : false,
|
|
294
|
+
[cellType + '-cell']: true,
|
|
295
|
+
[props.wrapperClass]: props.wrapperClass ? true : false,
|
|
296
|
+
[props.density]: props.density && cellType !== FCellTypes.BAR ? true : false,
|
|
297
|
+
[cssClasses]: cssClasses ? true : false,
|
|
298
|
+
};
|
|
299
|
+
let content = valueToDisplay;
|
|
300
|
+
if (isEditable && editableTypes.includes(cellType)) {
|
|
301
|
+
content = setEditableCell(cellType, classObj, cell, column, props);
|
|
302
|
+
}
|
|
303
|
+
else if (cell.data && kupTypes.includes(cellType)) {
|
|
304
|
+
if (props.setSizes) {
|
|
305
|
+
setCellSizeKup(cellType, subcomponentProps, cell);
|
|
306
|
+
}
|
|
307
|
+
if (!props.renderKup) {
|
|
308
|
+
const lazyClass = 'cell-' + cellType + ' placeholder';
|
|
309
|
+
content = index.h("span", { class: lazyClass });
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
content = setKupCell(cellType, classObj, subcomponentProps, cell, row, column, props);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
if (props.setSizes) {
|
|
317
|
+
setCellSize(cellType, subcomponentProps, cell, props);
|
|
318
|
+
}
|
|
319
|
+
content = setCell(cellType, subcomponentProps, content, classObj, cell, column, props);
|
|
320
|
+
}
|
|
321
|
+
let icon = null;
|
|
322
|
+
if (!isEditable && (column.icon || cell.icon) && content) {
|
|
323
|
+
const fProps = {
|
|
324
|
+
color: `rgba(var(${kupManager.KupThemeColorValues.TEXT}-rgb), 0.375)`,
|
|
325
|
+
resource: cell.icon ? cell.icon : column.icon,
|
|
326
|
+
sizeX: '1.25em',
|
|
327
|
+
sizeY: '1.25em',
|
|
328
|
+
wrapperClass: 'obj-icon',
|
|
329
|
+
};
|
|
330
|
+
icon = index.h(fImage.FImage, Object.assign({}, fProps));
|
|
331
|
+
}
|
|
332
|
+
let cellTitle = null;
|
|
333
|
+
if (dom.ketchup.debug.isDebug() && hasObj) {
|
|
334
|
+
cellTitle = cell.obj.t + '; ' + cell.obj.p + '; ' + cell.obj.k + ';';
|
|
335
|
+
}
|
|
336
|
+
else if (cell.title != null && cell.title.trim() != '') {
|
|
337
|
+
cellTitle = cell.title;
|
|
338
|
+
}
|
|
339
|
+
let infoEl = null;
|
|
340
|
+
if (cell.info) {
|
|
341
|
+
const info = Object.assign({}, cell.info);
|
|
342
|
+
if (!info.color) {
|
|
343
|
+
info.color = `var(${kupManager.KupThemeColorValues.INFO})`;
|
|
344
|
+
}
|
|
345
|
+
if (!info.icon) {
|
|
346
|
+
info.icon = 'info';
|
|
347
|
+
}
|
|
348
|
+
const fProps = {
|
|
349
|
+
color: info.color,
|
|
350
|
+
resource: info.icon,
|
|
351
|
+
sizeX: '1.25em',
|
|
352
|
+
sizeY: '1.25em',
|
|
353
|
+
title: info.message ? info.message : '',
|
|
354
|
+
wrapperClass: 'cell-info',
|
|
355
|
+
};
|
|
356
|
+
infoEl = index.h(fImage.FImage, Object.assign({}, fProps));
|
|
357
|
+
}
|
|
358
|
+
return (index.h("div", { class: classObj, style: cell.style },
|
|
359
|
+
index.h("div", { class: "f-cell__content", style: cell.styleContent, title: cellTitle },
|
|
360
|
+
props.indents,
|
|
361
|
+
infoEl,
|
|
362
|
+
icon,
|
|
363
|
+
content)));
|
|
364
|
+
};
|
|
365
|
+
function setCellSize(cellType, subcomponentProps, cell, props) {
|
|
366
|
+
switch (cellType) {
|
|
367
|
+
case FCellTypes.CHECKBOX:
|
|
368
|
+
case FCellTypes.ICON:
|
|
369
|
+
if (!subcomponentProps.sizeX) {
|
|
370
|
+
subcomponentProps.sizeX = '18px';
|
|
371
|
+
}
|
|
372
|
+
if (!subcomponentProps.sizeY) {
|
|
373
|
+
subcomponentProps.sizeY = '18px';
|
|
374
|
+
}
|
|
375
|
+
if (cell.style) {
|
|
376
|
+
if (!cell.style.height) {
|
|
377
|
+
cell.style['minHeight'] = subcomponentProps.sizeY;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
cell.style = {
|
|
382
|
+
minHeight: subcomponentProps.sizeY,
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
break;
|
|
386
|
+
case FCellTypes.IMAGE:
|
|
387
|
+
if (props.component.rootElement.tagName ===
|
|
388
|
+
'KUP-BOX') {
|
|
389
|
+
if (!subcomponentProps.sizeY) {
|
|
390
|
+
subcomponentProps.sizeY = 'auto';
|
|
391
|
+
}
|
|
392
|
+
if (subcomponentProps.fit === undefined) {
|
|
393
|
+
subcomponentProps.fit = true;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
else if (!subcomponentProps.sizeX) {
|
|
397
|
+
subcomponentProps.sizeX = 'auto';
|
|
398
|
+
}
|
|
399
|
+
if (!subcomponentProps.sizeY) {
|
|
400
|
+
subcomponentProps.sizeY = '64px';
|
|
401
|
+
}
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function setCellSizeKup(cellType, subcomponentProps, cell) {
|
|
406
|
+
switch (cellType) {
|
|
407
|
+
case FCellTypes.BAR:
|
|
408
|
+
if (!subcomponentProps.sizeY) {
|
|
409
|
+
subcomponentProps.sizeY = '26px';
|
|
410
|
+
}
|
|
411
|
+
break;
|
|
412
|
+
case FCellTypes.BUTTON:
|
|
413
|
+
let height = '';
|
|
414
|
+
if (subcomponentProps.label) {
|
|
415
|
+
height = '36px';
|
|
416
|
+
}
|
|
417
|
+
if (cell.style) {
|
|
418
|
+
if (!cell.style.height) {
|
|
419
|
+
cell.style['minHeight'] = height;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
cell.style = { minHeight: height };
|
|
424
|
+
}
|
|
425
|
+
break;
|
|
426
|
+
case FCellTypes.CHART:
|
|
427
|
+
if (!subcomponentProps.sizeX) {
|
|
428
|
+
subcomponentProps.sizeX = '100%';
|
|
429
|
+
}
|
|
430
|
+
if (!subcomponentProps.sizeY) {
|
|
431
|
+
subcomponentProps.sizeY = '100%';
|
|
432
|
+
}
|
|
433
|
+
break;
|
|
434
|
+
case FCellTypes.CHIP:
|
|
435
|
+
if (cell.style) {
|
|
436
|
+
if (!cell.style.height) {
|
|
437
|
+
cell.style['minHeight'] = '40px';
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
cell.style = { minHeight: '40px' };
|
|
442
|
+
}
|
|
443
|
+
break;
|
|
444
|
+
case FCellTypes.RADIO:
|
|
445
|
+
if (cell.style) {
|
|
446
|
+
if (!cell.style.height) {
|
|
447
|
+
cell.style['minHeight'] = '40px';
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
cell.style = { minHeight: '40px' };
|
|
452
|
+
}
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
function setEditableCell(cellType, classObj, cell, column, props) {
|
|
457
|
+
switch (cellType) {
|
|
458
|
+
case FCellTypes.AUTOCOMPLETE:
|
|
459
|
+
return (index.h("kup-autocomplete", Object.assign({}, cell.data, { class: "kup-full-width", "onkup-autocomplete-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-autocomplete-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
|
|
460
|
+
case FCellTypes.CHECKBOX:
|
|
461
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
462
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
463
|
+
}
|
|
464
|
+
return (index.h(FCheckbox, Object.assign({}, cell.data, { onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
|
|
465
|
+
case FCellTypes.COLOR_PICKER:
|
|
466
|
+
return (index.h("kup-color-picker", Object.assign({}, cell.data, { disabled: false, "onkup-colorpicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
|
|
467
|
+
case FCellTypes.COMBOBOX:
|
|
468
|
+
return (index.h("kup-combobox", Object.assign({}, cell.data, { class: "kup-full-width", "onkup-combobox-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-combobox-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
|
|
469
|
+
case FCellTypes.DATE:
|
|
470
|
+
return (index.h("kup-date-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: "kup-full-width", "onkup-datepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-datepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
|
|
471
|
+
case FCellTypes.RATING:
|
|
472
|
+
return (index.h("kup-rating", Object.assign({}, cell.data, { disabled: false, "onkup-rating-click": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
|
|
473
|
+
case FCellTypes.TIME:
|
|
474
|
+
return (index.h("kup-time-picker", Object.assign({ initialValue: cell.value }, cell.data, { class: "kup-full-width", "onkup-timepicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), "onkup-timepicker-input": (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
|
|
475
|
+
case FCellTypes.NUMBER:
|
|
476
|
+
classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
|
|
477
|
+
case FCellTypes.STRING:
|
|
478
|
+
return (index.h(FTextField, Object.assign({}, cell.data, { icon: cell.icon ? cell.icon : column.icon ? column.icon : null, fullWidth: true, inputType: cellType === FCellTypes.NUMBER ? 'number' : null, value: cellType === FCellTypes.NUMBER
|
|
479
|
+
? utils.stringToNumber(cell.value).toString()
|
|
480
|
+
: cell.value, onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), onInput: (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
function setCell(cellType, subcomponentProps, content, classObj, cell, column, props) {
|
|
484
|
+
switch (cellType) {
|
|
485
|
+
case FCellTypes.AUTOCOMPLETE:
|
|
486
|
+
case FCellTypes.COMBOBOX:
|
|
487
|
+
case FCellTypes.DATE:
|
|
488
|
+
case FCellTypes.DATETIME:
|
|
489
|
+
case FCellTypes.TIME:
|
|
490
|
+
if (content && content != '') {
|
|
491
|
+
const cellValue = cellUtils.getCellValueForDisplay(column, cell);
|
|
492
|
+
return index.h("div", { class: "f-cell__text" }, cellValue);
|
|
493
|
+
}
|
|
494
|
+
return content;
|
|
495
|
+
case FCellTypes.CHECKBOX:
|
|
496
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
497
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
498
|
+
}
|
|
499
|
+
return (index.h(fImage.FImage, { resource: subcomponentProps.checked
|
|
500
|
+
? 'check_box'
|
|
501
|
+
: 'check_box_outline_blank', sizeX: "18px", sizeY: "18px" }));
|
|
502
|
+
case FCellTypes.EDITOR:
|
|
503
|
+
return index.h("div", { innerHTML: cell.value });
|
|
504
|
+
case FCellTypes.ICON:
|
|
505
|
+
case FCellTypes.IMAGE:
|
|
506
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
507
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
508
|
+
}
|
|
509
|
+
if (subcomponentProps.badgeData) {
|
|
510
|
+
classObj[FCellClasses.C_PADDED] = true;
|
|
511
|
+
}
|
|
512
|
+
return index.h(fImage.FImage, Object.assign({}, subcomponentProps));
|
|
513
|
+
case FCellTypes.LINK:
|
|
514
|
+
return (index.h("a", { href: content, target: "_blank" }, cell.value));
|
|
515
|
+
case FCellTypes.NUMBER:
|
|
516
|
+
if (content && content != '') {
|
|
517
|
+
const cellValueNumber = utils.stringToNumber(cell.value);
|
|
518
|
+
const cellValue = cellUtils.getCellValueForDisplay(column, cell);
|
|
519
|
+
if (cellValueNumber < 0) {
|
|
520
|
+
classObj[FCellClasses.TEXT_DANGER] = true;
|
|
521
|
+
}
|
|
522
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
523
|
+
classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
|
|
524
|
+
}
|
|
525
|
+
return index.h("div", { class: "f-cell__text" }, cellValue);
|
|
526
|
+
}
|
|
527
|
+
return index.h("div", { class: "f-cell__text" }, content);
|
|
528
|
+
default:
|
|
529
|
+
return index.h("div", { class: "f-cell__text" }, content);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function setKupCell(cellType, classObj, subcomponentProps, cell, row, column, props) {
|
|
533
|
+
switch (cellType) {
|
|
534
|
+
case FCellTypes.BAR:
|
|
535
|
+
if (!subcomponentProps.data) {
|
|
536
|
+
return index.h("kup-image", Object.assign({}, subcomponentProps));
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
const barStyle = {
|
|
540
|
+
height: subcomponentProps.sizeY,
|
|
541
|
+
};
|
|
542
|
+
return (index.h("div", { style: barStyle },
|
|
543
|
+
index.h(fImage.FImage, Object.assign({}, subcomponentProps))));
|
|
544
|
+
}
|
|
545
|
+
case FCellTypes.BUTTON:
|
|
546
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
547
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
548
|
+
}
|
|
549
|
+
return (index.h("kup-button", Object.assign({}, subcomponentProps, { "onkup-button-click": (e) => cellEvent(e, props, cellType, FCellEvents.CLICK) })));
|
|
550
|
+
case FCellTypes.BUTTON_LIST:
|
|
551
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
552
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
553
|
+
}
|
|
554
|
+
subcomponentProps['data-storage'] = {
|
|
555
|
+
cell: cell,
|
|
556
|
+
row: row,
|
|
557
|
+
column: column,
|
|
558
|
+
};
|
|
559
|
+
return index.h("kup-button-list", Object.assign({}, subcomponentProps));
|
|
560
|
+
case FCellTypes.CHART:
|
|
561
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
562
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
563
|
+
}
|
|
564
|
+
return index.h("kup-chart", Object.assign({}, subcomponentProps));
|
|
565
|
+
case FCellTypes.CHIP:
|
|
566
|
+
return index.h(fChip.FChip, Object.assign({}, subcomponentProps));
|
|
567
|
+
case FCellTypes.COLOR_PICKER:
|
|
568
|
+
return (index.h("kup-color-picker", Object.assign({}, subcomponentProps, { disabled: true })));
|
|
569
|
+
case FCellTypes.GAUGE:
|
|
570
|
+
return (index.h("kup-gauge", Object.assign({ value: utils.stringToNumber(cell.value), "width-component": "280px" }, subcomponentProps)));
|
|
571
|
+
case FCellTypes.KNOB:
|
|
572
|
+
case FCellTypes.PROGRESS_BAR:
|
|
573
|
+
return index.h("kup-progress-bar", Object.assign({}, subcomponentProps));
|
|
574
|
+
case FCellTypes.RADIO:
|
|
575
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
576
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
577
|
+
}
|
|
578
|
+
subcomponentProps['disabled'] = row.readOnly;
|
|
579
|
+
return index.h("kup-radio", Object.assign({}, subcomponentProps));
|
|
580
|
+
case FCellTypes.RATING:
|
|
581
|
+
return index.h("kup-rating", Object.assign({}, subcomponentProps, { disabled: true }));
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
function getCellType(cell, shape) {
|
|
585
|
+
const obj = cell.obj;
|
|
586
|
+
if (shape) {
|
|
587
|
+
switch (shape.toUpperCase()) {
|
|
588
|
+
case FCellShapes.AUTOCOMPLETE:
|
|
589
|
+
return FCellTypes.AUTOCOMPLETE;
|
|
590
|
+
case FCellShapes.BUTTON_LIST:
|
|
591
|
+
return FCellTypes.BUTTON_LIST;
|
|
592
|
+
case FCellShapes.CHART:
|
|
593
|
+
return FCellTypes.CHART;
|
|
594
|
+
case FCellShapes.CHECKBOX:
|
|
595
|
+
return FCellTypes.CHECKBOX;
|
|
596
|
+
case FCellShapes.CHIP:
|
|
597
|
+
return FCellTypes.CHIP;
|
|
598
|
+
case FCellShapes.COLOR_PICKER:
|
|
599
|
+
return FCellTypes.COLOR_PICKER;
|
|
600
|
+
case FCellShapes.COMBOBOX:
|
|
601
|
+
return FCellTypes.COMBOBOX;
|
|
602
|
+
case FCellShapes.EDITOR:
|
|
603
|
+
return FCellTypes.EDITOR;
|
|
604
|
+
case FCellShapes.GAUGE:
|
|
605
|
+
return FCellTypes.GAUGE;
|
|
606
|
+
case FCellShapes.IMAGE:
|
|
607
|
+
return FCellTypes.IMAGE;
|
|
608
|
+
case FCellShapes.KNOB:
|
|
609
|
+
return FCellTypes.KNOB;
|
|
610
|
+
case FCellShapes.PROGRESS_BAR:
|
|
611
|
+
return FCellTypes.PROGRESS_BAR;
|
|
612
|
+
case FCellShapes.RADIO:
|
|
613
|
+
return FCellTypes.RADIO;
|
|
614
|
+
case FCellShapes.RATING:
|
|
615
|
+
return FCellTypes.RATING;
|
|
616
|
+
case FCellShapes.TEXT_FIELD:
|
|
617
|
+
return FCellTypes.STRING;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
if (dom.ketchup.objects.isBar(obj)) {
|
|
621
|
+
return FCellTypes.BAR;
|
|
622
|
+
}
|
|
623
|
+
else if (dom.ketchup.objects.isButton(obj)) {
|
|
624
|
+
return FCellTypes.BUTTON;
|
|
625
|
+
}
|
|
626
|
+
else if (dom.ketchup.objects.isChart(obj)) {
|
|
627
|
+
return FCellTypes.CHART;
|
|
628
|
+
}
|
|
629
|
+
else if (dom.ketchup.objects.isCheckbox(obj)) {
|
|
630
|
+
return FCellTypes.CHECKBOX;
|
|
631
|
+
}
|
|
632
|
+
else if (dom.ketchup.objects.isColor(obj)) {
|
|
633
|
+
return FCellTypes.COLOR_PICKER;
|
|
634
|
+
}
|
|
635
|
+
else if (dom.ketchup.objects.isIcon(obj)) {
|
|
636
|
+
return FCellTypes.ICON;
|
|
637
|
+
}
|
|
638
|
+
else if (dom.ketchup.objects.isImage(obj)) {
|
|
639
|
+
return FCellTypes.IMAGE;
|
|
640
|
+
}
|
|
641
|
+
else if (dom.ketchup.objects.isLink(obj)) {
|
|
642
|
+
return FCellTypes.LINK;
|
|
643
|
+
}
|
|
644
|
+
else if (dom.ketchup.objects.isProgressBar(obj)) {
|
|
645
|
+
return FCellTypes.PROGRESS_BAR;
|
|
646
|
+
}
|
|
647
|
+
else if (dom.ketchup.objects.isRadio(obj)) {
|
|
648
|
+
return FCellTypes.RADIO;
|
|
649
|
+
}
|
|
650
|
+
else if (dom.ketchup.objects.isKupObjList(obj)) {
|
|
651
|
+
return FCellTypes.CHIP;
|
|
652
|
+
}
|
|
653
|
+
else if (dom.ketchup.objects.isNumber(obj)) {
|
|
654
|
+
return FCellTypes.NUMBER;
|
|
655
|
+
}
|
|
656
|
+
else if (dom.ketchup.objects.isDate(obj)) {
|
|
657
|
+
return FCellTypes.DATE;
|
|
658
|
+
}
|
|
659
|
+
else if (dom.ketchup.objects.isTimestamp(obj)) {
|
|
660
|
+
return FCellTypes.DATETIME;
|
|
661
|
+
}
|
|
662
|
+
else if (dom.ketchup.objects.isTime(obj)) {
|
|
663
|
+
return FCellTypes.TIME;
|
|
664
|
+
}
|
|
665
|
+
else if (dom.ketchup.objects.isVoCodver(obj)) {
|
|
666
|
+
return FCellTypes.ICON;
|
|
667
|
+
}
|
|
668
|
+
else {
|
|
669
|
+
return FCellTypes.STRING;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
function cellEvent(e, props, cellType, cellEventName) {
|
|
673
|
+
const cell = props.cell;
|
|
674
|
+
const column = props.column;
|
|
675
|
+
const comp = props.component;
|
|
676
|
+
const row = props.row;
|
|
677
|
+
const isInputEvent = !!(e.target.tagName === 'INPUT');
|
|
678
|
+
let value = isInputEvent
|
|
679
|
+
? e.target.value
|
|
680
|
+
: e.detail.value;
|
|
681
|
+
if (cellEventName === FCellEvents.UPDATE) {
|
|
682
|
+
switch (cellType) {
|
|
683
|
+
case FCellTypes.AUTOCOMPLETE:
|
|
684
|
+
case FCellTypes.COMBOBOX:
|
|
685
|
+
case FCellTypes.DATE:
|
|
686
|
+
case FCellTypes.TIME:
|
|
687
|
+
if (cell.data) {
|
|
688
|
+
cell.data['initialValue'] = value;
|
|
689
|
+
}
|
|
690
|
+
break;
|
|
691
|
+
case FCellTypes.CHECKBOX:
|
|
692
|
+
value = value === 'on' ? '0' : '1';
|
|
693
|
+
if (cell.data) {
|
|
694
|
+
cell.data.checked =
|
|
695
|
+
value === '0' ? false : true;
|
|
696
|
+
}
|
|
697
|
+
break;
|
|
698
|
+
}
|
|
699
|
+
if (cell.obj) {
|
|
700
|
+
cell.obj.k = value;
|
|
701
|
+
}
|
|
702
|
+
cell.value = value;
|
|
703
|
+
cell.displayedValue = null;
|
|
704
|
+
cell.displayedValue = cellUtils.getCellValueForDisplay(column, cell);
|
|
705
|
+
}
|
|
706
|
+
if (comp && comp.rootElement) {
|
|
707
|
+
const updateEvent = new CustomEvent(cellEventName, {
|
|
708
|
+
bubbles: true,
|
|
709
|
+
cancelable: true,
|
|
710
|
+
composed: true,
|
|
711
|
+
detail: {
|
|
712
|
+
comp: comp,
|
|
713
|
+
id: comp.rootElement.id,
|
|
714
|
+
cell: cell,
|
|
715
|
+
column: column,
|
|
716
|
+
event: e,
|
|
717
|
+
row: row,
|
|
718
|
+
type: cellType,
|
|
719
|
+
},
|
|
720
|
+
});
|
|
721
|
+
comp.rootElement.dispatchEvent(updateEvent);
|
|
722
|
+
try {
|
|
723
|
+
comp.refresh();
|
|
724
|
+
}
|
|
725
|
+
catch (error) { }
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
exports.FCell = FCell;
|
|
730
|
+
exports.FCheckbox = FCheckbox;
|
|
731
|
+
exports.FTextField = FTextField;
|