@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
|
@@ -5,7 +5,7 @@ const dom = document.documentElement;
|
|
|
5
5
|
/*-------------------------------------------------*/
|
|
6
6
|
/* C o m p o n e n t */
|
|
7
7
|
/*-------------------------------------------------*/
|
|
8
|
-
export const FButton = (props) => {
|
|
8
|
+
export const FButton = (props, children) => {
|
|
9
9
|
if (!props.styling) {
|
|
10
10
|
props.styling = FButtonStyling.RAISED;
|
|
11
11
|
}
|
|
@@ -16,7 +16,9 @@ export const FButton = (props) => {
|
|
|
16
16
|
(props.styling.toLowerCase() === FButtonStyling.RAISED &&
|
|
17
17
|
props.icon &&
|
|
18
18
|
(props.label === null || props.label === undefined)));
|
|
19
|
-
return (h("div", Object.assign({ class: `f-button
|
|
19
|
+
return (h("div", Object.assign({ class: `f-button ${props.danger ? 'kup-danger' : ''} ${props.fullHeight ? 'kup-full-height' : ''} ${props.fullWidth ? 'kup-full-width' : ''} ${props.info ? 'kup-info' : ''} ${props.large ? 'kup-large' : ''} ${props.pulsating ? 'kup-pulsating' : ''} ${props.shaped ? 'kup-shaped' : ''} ${props.secondary ? 'kup-secondary' : ''} ${props.slim ? 'kup-slim' : ''} ${props.success ? 'kup-success' : ''} ${props.warning ? 'kup-warning' : ''} ${props.wrapperClass ? props.wrapperClass : ''}` }, props.dataSet, { id: props.id, title: props.title }),
|
|
20
|
+
isIconButton ? renderIconButton(props) : renderButton(props),
|
|
21
|
+
children));
|
|
20
22
|
};
|
|
21
23
|
/*-------------------------------------------------*/
|
|
22
24
|
/* M e t h o d s */
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
export const autoAlignComps = ['KUP-DATA-TABLE', 'KUP-TREE'];
|
|
2
|
+
/**
|
|
3
|
+
* Supported cell events.
|
|
4
|
+
*/
|
|
5
|
+
export var FCellEvents;
|
|
6
|
+
(function (FCellEvents) {
|
|
7
|
+
FCellEvents["CLICK"] = "kup-cell-click";
|
|
8
|
+
FCellEvents["INPUT"] = "kup-cell-input";
|
|
9
|
+
FCellEvents["UPDATE"] = "kup-cell-update";
|
|
10
|
+
})(FCellEvents || (FCellEvents = {}));
|
|
11
|
+
/**
|
|
12
|
+
* Supported cell padding.
|
|
13
|
+
*/
|
|
14
|
+
export var FCellPadding;
|
|
15
|
+
(function (FCellPadding) {
|
|
16
|
+
FCellPadding["DENSE"] = "dense";
|
|
17
|
+
FCellPadding["MEDIUM"] = "medium";
|
|
18
|
+
FCellPadding["NONE"] = "";
|
|
19
|
+
FCellPadding["WIDE"] = "wide";
|
|
20
|
+
})(FCellPadding || (FCellPadding = {}));
|
|
21
|
+
/**
|
|
22
|
+
* Supported cell CSS classes.
|
|
23
|
+
*/
|
|
24
|
+
export var FCellClasses;
|
|
25
|
+
(function (FCellClasses) {
|
|
26
|
+
FCellClasses["BG_DANGER"] = "danger-bg";
|
|
27
|
+
FCellClasses["BG_GREEN"] = "green-bg";
|
|
28
|
+
FCellClasses["BG_GREY"] = "grey-bg";
|
|
29
|
+
FCellClasses["BG_ORANGE"] = "orange-bg";
|
|
30
|
+
FCellClasses["BG_PURPLE"] = "purple-bg";
|
|
31
|
+
FCellClasses["BG_SUCCESS"] = "success-bg";
|
|
32
|
+
FCellClasses["BG_TEAL"] = "teal-bg";
|
|
33
|
+
FCellClasses["BG_WARNING"] = "warning-bg";
|
|
34
|
+
FCellClasses["C_BG_DANGER"] = "c-danger-bg";
|
|
35
|
+
FCellClasses["C_BG_GREEN"] = "c-green-bg";
|
|
36
|
+
FCellClasses["C_BG_GREY"] = "c-grey-bg";
|
|
37
|
+
FCellClasses["C_BG_ORANGE"] = "c-orange-bg";
|
|
38
|
+
FCellClasses["C_BG_PURPLE"] = "c-purple-bg";
|
|
39
|
+
FCellClasses["C_BG_SUCCESS"] = "c-success-bg";
|
|
40
|
+
FCellClasses["C_BG_TEAL"] = "c-teal-bg";
|
|
41
|
+
FCellClasses["C_BG_WARNING"] = "c-warning-bg";
|
|
42
|
+
FCellClasses["C_CENTERED"] = "c-centered";
|
|
43
|
+
FCellClasses["C_FITTED"] = "c-fitted";
|
|
44
|
+
FCellClasses["C_PADDED"] = "c-padded";
|
|
45
|
+
FCellClasses["C_PADDED_HOR"] = "c-padded-hor";
|
|
46
|
+
FCellClasses["C_PADDED_VER"] = "c-padded-ver";
|
|
47
|
+
FCellClasses["C_ROUND"] = "c-round";
|
|
48
|
+
FCellClasses["C_RIGHT_ALIGNED"] = "c-right-aligned";
|
|
49
|
+
FCellClasses["C_SHAPED"] = "c-shaped";
|
|
50
|
+
FCellClasses["C_TEXT_VERTICAL"] = "c-vertical-text";
|
|
51
|
+
FCellClasses["CLICKABLE"] = "clickable";
|
|
52
|
+
FCellClasses["HOVER_DISPLAY"] = "display-on-hover";
|
|
53
|
+
FCellClasses["HOVER_EXPAND"] = "expand-on-hover";
|
|
54
|
+
FCellClasses["HOVER_REDUCE"] = "reduce-on-hover";
|
|
55
|
+
FCellClasses["INDICATOR_TOPRIGHT"] = "top-right-indicator";
|
|
56
|
+
FCellClasses["LINK"] = "link";
|
|
57
|
+
FCellClasses["MONOSPACE"] = "monospace";
|
|
58
|
+
FCellClasses["OBJ"] = "obj";
|
|
59
|
+
FCellClasses["SHAPED"] = "shaped";
|
|
60
|
+
FCellClasses["TEXT_DANGER"] = "danger-text";
|
|
61
|
+
FCellClasses["TEXT_INFO"] = "info-text";
|
|
62
|
+
FCellClasses["TEXT_PRIMARY"] = "primary-text";
|
|
63
|
+
FCellClasses["TEXT_PURPLE"] = "purple-text";
|
|
64
|
+
FCellClasses["TEXT_SECONDARY"] = "secondary-text";
|
|
65
|
+
FCellClasses["TEXT_STRONG"] = "strong-text";
|
|
66
|
+
FCellClasses["TEXT_SUCCESS"] = "success-text";
|
|
67
|
+
FCellClasses["TEXT_WARNING"] = "warning-text";
|
|
68
|
+
FCellClasses["UNDERLINED"] = "underlined";
|
|
69
|
+
})(FCellClasses || (FCellClasses = {}));
|
|
70
|
+
/**
|
|
71
|
+
* Supported cell shapes.
|
|
72
|
+
*/
|
|
73
|
+
export var FCellShapes;
|
|
74
|
+
(function (FCellShapes) {
|
|
75
|
+
FCellShapes["AUTOCOMPLETE"] = "ACP";
|
|
76
|
+
FCellShapes["BUTTON_LIST"] = "BTN";
|
|
77
|
+
FCellShapes["CHART"] = "GRA";
|
|
78
|
+
FCellShapes["CHECKBOX"] = "CHK";
|
|
79
|
+
FCellShapes["CHIP"] = "CHI";
|
|
80
|
+
FCellShapes["COLOR_PICKER"] = "CLP";
|
|
81
|
+
FCellShapes["COMBOBOX"] = "CMB";
|
|
82
|
+
FCellShapes["EDITOR"] = "EDT";
|
|
83
|
+
FCellShapes["GAUGE"] = "GAU";
|
|
84
|
+
FCellShapes["IMAGE"] = "IMG";
|
|
85
|
+
FCellShapes["KNOB"] = "KNB";
|
|
86
|
+
FCellShapes["PROGRESS_BAR"] = "PGB";
|
|
87
|
+
FCellShapes["RADIO"] = "RAD";
|
|
88
|
+
FCellShapes["RATING"] = "RTG";
|
|
89
|
+
FCellShapes["TEXT_FIELD"] = "ITX";
|
|
90
|
+
})(FCellShapes || (FCellShapes = {}));
|
|
91
|
+
/**
|
|
92
|
+
* Supported cell types.
|
|
93
|
+
*/
|
|
94
|
+
export var FCellTypes;
|
|
95
|
+
(function (FCellTypes) {
|
|
96
|
+
FCellTypes["AUTOCOMPLETE"] = "autocomplete";
|
|
97
|
+
FCellTypes["BAR"] = "bar";
|
|
98
|
+
FCellTypes["BUTTON"] = "button";
|
|
99
|
+
FCellTypes["BUTTON_LIST"] = "button-list";
|
|
100
|
+
FCellTypes["CHART"] = "chart";
|
|
101
|
+
FCellTypes["CHECKBOX"] = "checkbox";
|
|
102
|
+
FCellTypes["CHIP"] = "chips";
|
|
103
|
+
FCellTypes["COLOR_PICKER"] = "color-picker";
|
|
104
|
+
FCellTypes["COMBOBOX"] = "combobox";
|
|
105
|
+
FCellTypes["DATE"] = "date";
|
|
106
|
+
FCellTypes["DATETIME"] = "datetime";
|
|
107
|
+
FCellTypes["EDITOR"] = "editor";
|
|
108
|
+
FCellTypes["GAUGE"] = "gauge";
|
|
109
|
+
FCellTypes["ICON"] = "icon";
|
|
110
|
+
FCellTypes["IMAGE"] = "image";
|
|
111
|
+
FCellTypes["KNOB"] = "knob";
|
|
112
|
+
FCellTypes["LINK"] = "link";
|
|
113
|
+
FCellTypes["NUMBER"] = "number";
|
|
114
|
+
FCellTypes["PROGRESS_BAR"] = "progress-bar";
|
|
115
|
+
FCellTypes["RADIO"] = "radio";
|
|
116
|
+
FCellTypes["RATING"] = "rating";
|
|
117
|
+
FCellTypes["STRING"] = "string";
|
|
118
|
+
FCellTypes["TIME"] = "time";
|
|
119
|
+
})(FCellTypes || (FCellTypes = {}));
|
|
120
|
+
export const editableTypes = [
|
|
121
|
+
FCellTypes.AUTOCOMPLETE,
|
|
122
|
+
FCellTypes.CHECKBOX,
|
|
123
|
+
FCellTypes.COLOR_PICKER,
|
|
124
|
+
FCellTypes.COMBOBOX,
|
|
125
|
+
FCellTypes.DATE,
|
|
126
|
+
FCellTypes.NUMBER,
|
|
127
|
+
FCellTypes.RATING,
|
|
128
|
+
FCellTypes.STRING,
|
|
129
|
+
FCellTypes.TIME,
|
|
130
|
+
];
|
|
131
|
+
export const kupTypes = [
|
|
132
|
+
FCellTypes.BAR,
|
|
133
|
+
FCellTypes.BUTTON,
|
|
134
|
+
FCellTypes.BUTTON_LIST,
|
|
135
|
+
FCellTypes.CHART,
|
|
136
|
+
FCellTypes.CHIP,
|
|
137
|
+
FCellTypes.COLOR_PICKER,
|
|
138
|
+
FCellTypes.GAUGE,
|
|
139
|
+
FCellTypes.KNOB,
|
|
140
|
+
FCellTypes.PROGRESS_BAR,
|
|
141
|
+
FCellTypes.RADIO,
|
|
142
|
+
FCellTypes.RATING,
|
|
143
|
+
];
|
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { autoAlignComps, editableTypes, FCellClasses, FCellEvents, FCellShapes, FCellTypes, kupTypes, } from './f-cell-declarations';
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
import { getCellValueForDisplay } from '../../utils/cell-utils';
|
|
4
|
+
import { FCheckbox } from '../f-checkbox/f-checkbox';
|
|
5
|
+
import { FTextField } from '../f-text-field/f-text-field';
|
|
6
|
+
import { stringToNumber } from '../../utils/utils';
|
|
7
|
+
import { FImage } from '../f-image/f-image';
|
|
8
|
+
import { FChip } from '../f-chip/f-chip';
|
|
9
|
+
import { KupThemeColorValues } from '../../utils/kup-theme/kup-theme-declarations';
|
|
10
|
+
const dom = document.documentElement;
|
|
11
|
+
/*-------------------------------------------------*/
|
|
12
|
+
/* C o m p o n e n t */
|
|
13
|
+
/*-------------------------------------------------*/
|
|
14
|
+
export const FCell = (props) => {
|
|
15
|
+
const cell = props.cell;
|
|
16
|
+
const column = props.column;
|
|
17
|
+
const row = props.row;
|
|
18
|
+
const shape = props.shape
|
|
19
|
+
? props.shape
|
|
20
|
+
: cell.shape
|
|
21
|
+
? cell.shape
|
|
22
|
+
: column.shape
|
|
23
|
+
? column.shape
|
|
24
|
+
: null;
|
|
25
|
+
const hasObj = !dom.ketchup.objects.isEmptyKupObj(cell.obj);
|
|
26
|
+
const isEditable = cell.isEditable && props.editable ? true : false;
|
|
27
|
+
const valueToDisplay = props.previousValue !== cell.value ? cell.value : '';
|
|
28
|
+
const cellType = getCellType(cell, shape);
|
|
29
|
+
const subcomponentProps = Object.assign({}, cell.data);
|
|
30
|
+
let cssClasses = cell.cssClass
|
|
31
|
+
? cell.cssClass
|
|
32
|
+
: column.cssClass
|
|
33
|
+
? column.cssClass
|
|
34
|
+
: '';
|
|
35
|
+
const classObj = {
|
|
36
|
+
'f-cell': true,
|
|
37
|
+
[FCellClasses.OBJ]: hasObj ? true : false,
|
|
38
|
+
[cellType + '-cell']: true,
|
|
39
|
+
[props.wrapperClass]: props.wrapperClass ? true : false,
|
|
40
|
+
[props.density]: props.density && cellType !== FCellTypes.BAR ? true : false,
|
|
41
|
+
[cssClasses]: cssClasses ? true : false,
|
|
42
|
+
};
|
|
43
|
+
let content = valueToDisplay;
|
|
44
|
+
if (isEditable && editableTypes.includes(cellType)) {
|
|
45
|
+
content = setEditableCell(cellType, classObj, cell, column, props);
|
|
46
|
+
}
|
|
47
|
+
else if (cell.data && kupTypes.includes(cellType)) {
|
|
48
|
+
if (props.setSizes) {
|
|
49
|
+
setCellSizeKup(cellType, subcomponentProps, cell);
|
|
50
|
+
}
|
|
51
|
+
if (!props.renderKup) {
|
|
52
|
+
const lazyClass = 'cell-' + cellType + ' placeholder';
|
|
53
|
+
content = h("span", { class: lazyClass });
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
content = setKupCell(cellType, classObj, subcomponentProps, cell, row, column, props);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if (props.setSizes) {
|
|
61
|
+
setCellSize(cellType, subcomponentProps, cell, props);
|
|
62
|
+
}
|
|
63
|
+
content = setCell(cellType, subcomponentProps, content, classObj, cell, column, props);
|
|
64
|
+
}
|
|
65
|
+
let icon = null;
|
|
66
|
+
if (!isEditable && (column.icon || cell.icon) && content) {
|
|
67
|
+
const fProps = {
|
|
68
|
+
color: `rgba(var(${KupThemeColorValues.TEXT}-rgb), 0.375)`,
|
|
69
|
+
resource: cell.icon ? cell.icon : column.icon,
|
|
70
|
+
sizeX: '1.25em',
|
|
71
|
+
sizeY: '1.25em',
|
|
72
|
+
wrapperClass: 'obj-icon',
|
|
73
|
+
};
|
|
74
|
+
icon = h(FImage, Object.assign({}, fProps));
|
|
75
|
+
}
|
|
76
|
+
let cellTitle = null;
|
|
77
|
+
if (dom.ketchup.debug.isDebug() && hasObj) {
|
|
78
|
+
cellTitle = cell.obj.t + '; ' + cell.obj.p + '; ' + cell.obj.k + ';';
|
|
79
|
+
}
|
|
80
|
+
else if (cell.title != null && cell.title.trim() != '') {
|
|
81
|
+
cellTitle = cell.title;
|
|
82
|
+
}
|
|
83
|
+
let infoEl = null;
|
|
84
|
+
if (cell.info) {
|
|
85
|
+
const info = Object.assign({}, cell.info);
|
|
86
|
+
if (!info.color) {
|
|
87
|
+
info.color = `var(${KupThemeColorValues.INFO})`;
|
|
88
|
+
}
|
|
89
|
+
if (!info.icon) {
|
|
90
|
+
info.icon = 'info';
|
|
91
|
+
}
|
|
92
|
+
const fProps = {
|
|
93
|
+
color: info.color,
|
|
94
|
+
resource: info.icon,
|
|
95
|
+
sizeX: '1.25em',
|
|
96
|
+
sizeY: '1.25em',
|
|
97
|
+
title: info.message ? info.message : '',
|
|
98
|
+
wrapperClass: 'cell-info',
|
|
99
|
+
};
|
|
100
|
+
infoEl = h(FImage, Object.assign({}, fProps));
|
|
101
|
+
}
|
|
102
|
+
return (h("div", { class: classObj, style: cell.style },
|
|
103
|
+
h("div", { class: "f-cell__content", style: cell.styleContent, title: cellTitle },
|
|
104
|
+
props.indents,
|
|
105
|
+
infoEl,
|
|
106
|
+
icon,
|
|
107
|
+
content)));
|
|
108
|
+
};
|
|
109
|
+
function setCellSize(cellType, subcomponentProps, cell, props) {
|
|
110
|
+
switch (cellType) {
|
|
111
|
+
case FCellTypes.CHECKBOX:
|
|
112
|
+
case FCellTypes.ICON:
|
|
113
|
+
if (!subcomponentProps.sizeX) {
|
|
114
|
+
subcomponentProps.sizeX = '18px';
|
|
115
|
+
}
|
|
116
|
+
if (!subcomponentProps.sizeY) {
|
|
117
|
+
subcomponentProps.sizeY = '18px';
|
|
118
|
+
}
|
|
119
|
+
if (cell.style) {
|
|
120
|
+
if (!cell.style.height) {
|
|
121
|
+
cell.style['minHeight'] = subcomponentProps.sizeY;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
cell.style = {
|
|
126
|
+
minHeight: subcomponentProps.sizeY,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
case FCellTypes.IMAGE:
|
|
131
|
+
if (props.component.rootElement.tagName ===
|
|
132
|
+
'KUP-BOX') {
|
|
133
|
+
if (!subcomponentProps.sizeY) {
|
|
134
|
+
subcomponentProps.sizeY = 'auto';
|
|
135
|
+
}
|
|
136
|
+
if (subcomponentProps.fit === undefined) {
|
|
137
|
+
subcomponentProps.fit = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else if (!subcomponentProps.sizeX) {
|
|
141
|
+
subcomponentProps.sizeX = 'auto';
|
|
142
|
+
}
|
|
143
|
+
if (!subcomponentProps.sizeY) {
|
|
144
|
+
subcomponentProps.sizeY = '64px';
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function setCellSizeKup(cellType, subcomponentProps, cell) {
|
|
150
|
+
switch (cellType) {
|
|
151
|
+
case FCellTypes.BAR:
|
|
152
|
+
if (!subcomponentProps.sizeY) {
|
|
153
|
+
subcomponentProps.sizeY = '26px';
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
case FCellTypes.BUTTON:
|
|
157
|
+
let height = '';
|
|
158
|
+
if (subcomponentProps.label) {
|
|
159
|
+
height = '36px';
|
|
160
|
+
}
|
|
161
|
+
if (cell.style) {
|
|
162
|
+
if (!cell.style.height) {
|
|
163
|
+
cell.style['minHeight'] = height;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
cell.style = { minHeight: height };
|
|
168
|
+
}
|
|
169
|
+
break;
|
|
170
|
+
case FCellTypes.CHART:
|
|
171
|
+
if (!subcomponentProps.sizeX) {
|
|
172
|
+
subcomponentProps.sizeX = '100%';
|
|
173
|
+
}
|
|
174
|
+
if (!subcomponentProps.sizeY) {
|
|
175
|
+
subcomponentProps.sizeY = '100%';
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
case FCellTypes.CHIP:
|
|
179
|
+
if (cell.style) {
|
|
180
|
+
if (!cell.style.height) {
|
|
181
|
+
cell.style['minHeight'] = '40px';
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
cell.style = { minHeight: '40px' };
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
case FCellTypes.RADIO:
|
|
189
|
+
if (cell.style) {
|
|
190
|
+
if (!cell.style.height) {
|
|
191
|
+
cell.style['minHeight'] = '40px';
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
cell.style = { minHeight: '40px' };
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function setEditableCell(cellType, classObj, cell, column, props) {
|
|
201
|
+
switch (cellType) {
|
|
202
|
+
case FCellTypes.AUTOCOMPLETE:
|
|
203
|
+
return (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) })));
|
|
204
|
+
case FCellTypes.CHECKBOX:
|
|
205
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
206
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
207
|
+
}
|
|
208
|
+
return (h(FCheckbox, Object.assign({}, cell.data, { onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
|
|
209
|
+
case FCellTypes.COLOR_PICKER:
|
|
210
|
+
return (h("kup-color-picker", Object.assign({}, cell.data, { disabled: false, "onkup-colorpicker-change": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
|
|
211
|
+
case FCellTypes.COMBOBOX:
|
|
212
|
+
return (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) })));
|
|
213
|
+
case FCellTypes.DATE:
|
|
214
|
+
return (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) })));
|
|
215
|
+
case FCellTypes.RATING:
|
|
216
|
+
return (h("kup-rating", Object.assign({}, cell.data, { disabled: false, "onkup-rating-click": (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE) })));
|
|
217
|
+
case FCellTypes.TIME:
|
|
218
|
+
return (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) })));
|
|
219
|
+
case FCellTypes.NUMBER:
|
|
220
|
+
classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
|
|
221
|
+
case FCellTypes.STRING:
|
|
222
|
+
return (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
|
|
223
|
+
? stringToNumber(cell.value).toString()
|
|
224
|
+
: cell.value, onChange: (e) => cellEvent(e, props, cellType, FCellEvents.UPDATE), onInput: (e) => cellEvent(e, props, cellType, FCellEvents.INPUT) })));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function setCell(cellType, subcomponentProps, content, classObj, cell, column, props) {
|
|
228
|
+
switch (cellType) {
|
|
229
|
+
case FCellTypes.AUTOCOMPLETE:
|
|
230
|
+
case FCellTypes.COMBOBOX:
|
|
231
|
+
case FCellTypes.DATE:
|
|
232
|
+
case FCellTypes.DATETIME:
|
|
233
|
+
case FCellTypes.TIME:
|
|
234
|
+
if (content && content != '') {
|
|
235
|
+
const cellValue = getCellValueForDisplay(column, cell);
|
|
236
|
+
return h("div", { class: "f-cell__text" }, cellValue);
|
|
237
|
+
}
|
|
238
|
+
return content;
|
|
239
|
+
case FCellTypes.CHECKBOX:
|
|
240
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
241
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
242
|
+
}
|
|
243
|
+
return (h(FImage, { resource: subcomponentProps.checked
|
|
244
|
+
? 'check_box'
|
|
245
|
+
: 'check_box_outline_blank', sizeX: "18px", sizeY: "18px" }));
|
|
246
|
+
case FCellTypes.EDITOR:
|
|
247
|
+
return h("div", { innerHTML: cell.value });
|
|
248
|
+
case FCellTypes.ICON:
|
|
249
|
+
case FCellTypes.IMAGE:
|
|
250
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
251
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
252
|
+
}
|
|
253
|
+
if (subcomponentProps.badgeData) {
|
|
254
|
+
classObj[FCellClasses.C_PADDED] = true;
|
|
255
|
+
}
|
|
256
|
+
return h(FImage, Object.assign({}, subcomponentProps));
|
|
257
|
+
case FCellTypes.LINK:
|
|
258
|
+
return (h("a", { href: content, target: "_blank" }, cell.value));
|
|
259
|
+
case FCellTypes.NUMBER:
|
|
260
|
+
if (content && content != '') {
|
|
261
|
+
const cellValueNumber = stringToNumber(cell.value);
|
|
262
|
+
const cellValue = getCellValueForDisplay(column, cell);
|
|
263
|
+
if (cellValueNumber < 0) {
|
|
264
|
+
classObj[FCellClasses.TEXT_DANGER] = true;
|
|
265
|
+
}
|
|
266
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
267
|
+
classObj[FCellClasses.C_RIGHT_ALIGNED] = true;
|
|
268
|
+
}
|
|
269
|
+
return h("div", { class: "f-cell__text" }, cellValue);
|
|
270
|
+
}
|
|
271
|
+
return h("div", { class: "f-cell__text" }, content);
|
|
272
|
+
default:
|
|
273
|
+
return h("div", { class: "f-cell__text" }, content);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function setKupCell(cellType, classObj, subcomponentProps, cell, row, column, props) {
|
|
277
|
+
switch (cellType) {
|
|
278
|
+
case FCellTypes.BAR:
|
|
279
|
+
if (!subcomponentProps.data) {
|
|
280
|
+
return h("kup-image", Object.assign({}, subcomponentProps));
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
const barStyle = {
|
|
284
|
+
height: subcomponentProps.sizeY,
|
|
285
|
+
};
|
|
286
|
+
return (h("div", { style: barStyle },
|
|
287
|
+
h(FImage, Object.assign({}, subcomponentProps))));
|
|
288
|
+
}
|
|
289
|
+
case FCellTypes.BUTTON:
|
|
290
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
291
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
292
|
+
}
|
|
293
|
+
return (h("kup-button", Object.assign({}, subcomponentProps, { "onkup-button-click": (e) => cellEvent(e, props, cellType, FCellEvents.CLICK) })));
|
|
294
|
+
case FCellTypes.BUTTON_LIST:
|
|
295
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
296
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
297
|
+
}
|
|
298
|
+
subcomponentProps['data-storage'] = {
|
|
299
|
+
cell: cell,
|
|
300
|
+
row: row,
|
|
301
|
+
column: column,
|
|
302
|
+
};
|
|
303
|
+
return h("kup-button-list", Object.assign({}, subcomponentProps));
|
|
304
|
+
case FCellTypes.CHART:
|
|
305
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
306
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
307
|
+
}
|
|
308
|
+
return h("kup-chart", Object.assign({}, subcomponentProps));
|
|
309
|
+
case FCellTypes.CHIP:
|
|
310
|
+
return h(FChip, Object.assign({}, subcomponentProps));
|
|
311
|
+
case FCellTypes.COLOR_PICKER:
|
|
312
|
+
return (h("kup-color-picker", Object.assign({}, subcomponentProps, { disabled: true })));
|
|
313
|
+
case FCellTypes.GAUGE:
|
|
314
|
+
return (h("kup-gauge", Object.assign({ value: stringToNumber(cell.value), "width-component": "280px" }, subcomponentProps)));
|
|
315
|
+
case FCellTypes.KNOB:
|
|
316
|
+
case FCellTypes.PROGRESS_BAR:
|
|
317
|
+
return h("kup-progress-bar", Object.assign({}, subcomponentProps));
|
|
318
|
+
case FCellTypes.RADIO:
|
|
319
|
+
if (autoAlignComps.includes(props.component.rootElement.tagName)) {
|
|
320
|
+
classObj[FCellClasses.C_CENTERED] = true;
|
|
321
|
+
}
|
|
322
|
+
subcomponentProps['disabled'] = row.readOnly;
|
|
323
|
+
return h("kup-radio", Object.assign({}, subcomponentProps));
|
|
324
|
+
case FCellTypes.RATING:
|
|
325
|
+
return h("kup-rating", Object.assign({}, subcomponentProps, { disabled: true }));
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
function getCellType(cell, shape) {
|
|
329
|
+
const obj = cell.obj;
|
|
330
|
+
if (shape) {
|
|
331
|
+
switch (shape.toUpperCase()) {
|
|
332
|
+
case FCellShapes.AUTOCOMPLETE:
|
|
333
|
+
return FCellTypes.AUTOCOMPLETE;
|
|
334
|
+
case FCellShapes.BUTTON_LIST:
|
|
335
|
+
return FCellTypes.BUTTON_LIST;
|
|
336
|
+
case FCellShapes.CHART:
|
|
337
|
+
return FCellTypes.CHART;
|
|
338
|
+
case FCellShapes.CHECKBOX:
|
|
339
|
+
return FCellTypes.CHECKBOX;
|
|
340
|
+
case FCellShapes.CHIP:
|
|
341
|
+
return FCellTypes.CHIP;
|
|
342
|
+
case FCellShapes.COLOR_PICKER:
|
|
343
|
+
return FCellTypes.COLOR_PICKER;
|
|
344
|
+
case FCellShapes.COMBOBOX:
|
|
345
|
+
return FCellTypes.COMBOBOX;
|
|
346
|
+
case FCellShapes.EDITOR:
|
|
347
|
+
return FCellTypes.EDITOR;
|
|
348
|
+
case FCellShapes.GAUGE:
|
|
349
|
+
return FCellTypes.GAUGE;
|
|
350
|
+
case FCellShapes.IMAGE:
|
|
351
|
+
return FCellTypes.IMAGE;
|
|
352
|
+
case FCellShapes.KNOB:
|
|
353
|
+
return FCellTypes.KNOB;
|
|
354
|
+
case FCellShapes.PROGRESS_BAR:
|
|
355
|
+
return FCellTypes.PROGRESS_BAR;
|
|
356
|
+
case FCellShapes.RADIO:
|
|
357
|
+
return FCellTypes.RADIO;
|
|
358
|
+
case FCellShapes.RATING:
|
|
359
|
+
return FCellTypes.RATING;
|
|
360
|
+
case FCellShapes.TEXT_FIELD:
|
|
361
|
+
return FCellTypes.STRING;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (dom.ketchup.objects.isBar(obj)) {
|
|
365
|
+
return FCellTypes.BAR;
|
|
366
|
+
}
|
|
367
|
+
else if (dom.ketchup.objects.isButton(obj)) {
|
|
368
|
+
return FCellTypes.BUTTON;
|
|
369
|
+
}
|
|
370
|
+
else if (dom.ketchup.objects.isChart(obj)) {
|
|
371
|
+
return FCellTypes.CHART;
|
|
372
|
+
}
|
|
373
|
+
else if (dom.ketchup.objects.isCheckbox(obj)) {
|
|
374
|
+
return FCellTypes.CHECKBOX;
|
|
375
|
+
}
|
|
376
|
+
else if (dom.ketchup.objects.isColor(obj)) {
|
|
377
|
+
return FCellTypes.COLOR_PICKER;
|
|
378
|
+
}
|
|
379
|
+
else if (dom.ketchup.objects.isIcon(obj)) {
|
|
380
|
+
return FCellTypes.ICON;
|
|
381
|
+
}
|
|
382
|
+
else if (dom.ketchup.objects.isImage(obj)) {
|
|
383
|
+
return FCellTypes.IMAGE;
|
|
384
|
+
}
|
|
385
|
+
else if (dom.ketchup.objects.isLink(obj)) {
|
|
386
|
+
return FCellTypes.LINK;
|
|
387
|
+
}
|
|
388
|
+
else if (dom.ketchup.objects.isProgressBar(obj)) {
|
|
389
|
+
return FCellTypes.PROGRESS_BAR;
|
|
390
|
+
}
|
|
391
|
+
else if (dom.ketchup.objects.isRadio(obj)) {
|
|
392
|
+
return FCellTypes.RADIO;
|
|
393
|
+
}
|
|
394
|
+
else if (dom.ketchup.objects.isKupObjList(obj)) {
|
|
395
|
+
return FCellTypes.CHIP;
|
|
396
|
+
}
|
|
397
|
+
else if (dom.ketchup.objects.isNumber(obj)) {
|
|
398
|
+
return FCellTypes.NUMBER;
|
|
399
|
+
}
|
|
400
|
+
else if (dom.ketchup.objects.isDate(obj)) {
|
|
401
|
+
return FCellTypes.DATE;
|
|
402
|
+
}
|
|
403
|
+
else if (dom.ketchup.objects.isTimestamp(obj)) {
|
|
404
|
+
return FCellTypes.DATETIME;
|
|
405
|
+
}
|
|
406
|
+
else if (dom.ketchup.objects.isTime(obj)) {
|
|
407
|
+
return FCellTypes.TIME;
|
|
408
|
+
}
|
|
409
|
+
else if (dom.ketchup.objects.isVoCodver(obj)) {
|
|
410
|
+
return FCellTypes.ICON;
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
return FCellTypes.STRING;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function cellEvent(e, props, cellType, cellEventName) {
|
|
417
|
+
const cell = props.cell;
|
|
418
|
+
const column = props.column;
|
|
419
|
+
const comp = props.component;
|
|
420
|
+
const row = props.row;
|
|
421
|
+
const isInputEvent = !!(e.target.tagName === 'INPUT');
|
|
422
|
+
let value = isInputEvent
|
|
423
|
+
? e.target.value
|
|
424
|
+
: e.detail.value;
|
|
425
|
+
if (cellEventName === FCellEvents.UPDATE) {
|
|
426
|
+
switch (cellType) {
|
|
427
|
+
case FCellTypes.AUTOCOMPLETE:
|
|
428
|
+
case FCellTypes.COMBOBOX:
|
|
429
|
+
case FCellTypes.DATE:
|
|
430
|
+
case FCellTypes.TIME:
|
|
431
|
+
if (cell.data) {
|
|
432
|
+
cell.data['initialValue'] = value;
|
|
433
|
+
}
|
|
434
|
+
break;
|
|
435
|
+
case FCellTypes.CHECKBOX:
|
|
436
|
+
value = value === 'on' ? '0' : '1';
|
|
437
|
+
if (cell.data) {
|
|
438
|
+
cell.data.checked =
|
|
439
|
+
value === '0' ? false : true;
|
|
440
|
+
}
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
if (cell.obj) {
|
|
444
|
+
cell.obj.k = value;
|
|
445
|
+
}
|
|
446
|
+
cell.value = value;
|
|
447
|
+
cell.displayedValue = null;
|
|
448
|
+
cell.displayedValue = getCellValueForDisplay(column, cell);
|
|
449
|
+
}
|
|
450
|
+
if (comp && comp.rootElement) {
|
|
451
|
+
const updateEvent = new CustomEvent(cellEventName, {
|
|
452
|
+
bubbles: true,
|
|
453
|
+
cancelable: true,
|
|
454
|
+
composed: true,
|
|
455
|
+
detail: {
|
|
456
|
+
comp: comp,
|
|
457
|
+
id: comp.rootElement.id,
|
|
458
|
+
cell: cell,
|
|
459
|
+
column: column,
|
|
460
|
+
event: e,
|
|
461
|
+
row: row,
|
|
462
|
+
type: cellType,
|
|
463
|
+
},
|
|
464
|
+
});
|
|
465
|
+
comp.rootElement.dispatchEvent(updateEvent);
|
|
466
|
+
try {
|
|
467
|
+
comp.refresh();
|
|
468
|
+
}
|
|
469
|
+
catch (error) { }
|
|
470
|
+
}
|
|
471
|
+
}
|
|
@@ -12,7 +12,7 @@ export const FCheckbox = (props) => {
|
|
|
12
12
|
'checkbox--disabled': props.disabled ? true : false,
|
|
13
13
|
'checkbox--indeterminate': props.indeterminate ? true : false,
|
|
14
14
|
};
|
|
15
|
-
return (h("div", Object.assign({ class: `f-checkbox
|
|
15
|
+
return (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 }),
|
|
16
16
|
h("div", { class: `form-field ${props.leadingLabel ? 'form-field--align-end' : ''}` },
|
|
17
17
|
h("div", { class: classObj },
|
|
18
18
|
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' })),
|
|
@@ -20,7 +20,7 @@ export const FChip = (props) => {
|
|
|
20
20
|
'chip-set--filter': isFilter ? true : false,
|
|
21
21
|
'chip-set--input': isInput ? true : false,
|
|
22
22
|
};
|
|
23
|
-
return (h("div", Object.assign({ class: `f-chip
|
|
23
|
+
return (h("div", Object.assign({ class: `f-chip ${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 }),
|
|
24
24
|
h("div", { class: classObj, role: "grid" }, createChipList(props, isChoice, isFilter, isInput))));
|
|
25
25
|
};
|
|
26
26
|
/*-------------------------------------------------*/
|
|
@@ -32,7 +32,7 @@ function createChipList(props, isChoice, isFilter, isInput) {
|
|
|
32
32
|
if (props.dataNew && props.dataNew.length > 0) {
|
|
33
33
|
props.data = treeNode2Data(props.dataNew);
|
|
34
34
|
}
|
|
35
|
-
for (let i = 0; i < props.data.length; i++) {
|
|
35
|
+
for (let i = 0; props.data && i < props.data.length; i++) {
|
|
36
36
|
// could happen due to functions that change the data (such as transposition, etc)
|
|
37
37
|
if (!props.data[i]) {
|
|
38
38
|
continue;
|
|
@@ -38,7 +38,7 @@ export const FImage = (props) => {
|
|
|
38
38
|
badgeCollection.push(h("kup-badge", Object.assign({}, props.badgeData[index])));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
return (h("div", Object.assign({ class: `f-image
|
|
41
|
+
return (h("div", Object.assign({ class: `f-image ${props.wrapperClass ? props.wrapperClass : ''} ${props.fit ? 'kup-fit' : ''}` }, props.dataSet, { id: props.id, style: style, title: props.title, onClick: props.onClick }),
|
|
42
42
|
el,
|
|
43
43
|
badgeCollection));
|
|
44
44
|
};
|
|
@@ -55,8 +55,7 @@ function createIcon(props) {
|
|
|
55
55
|
: `var(${KupThemeColorValues.ICON})`,
|
|
56
56
|
};
|
|
57
57
|
if (props.resource.indexOf('--kup') > -1) {
|
|
58
|
-
let themeIcon = props.resource.replace('--
|
|
59
|
-
themeIcon = themeIcon.replace('-icon', '');
|
|
58
|
+
let themeIcon = props.resource.replace('--', '');
|
|
60
59
|
classObj['kup-icon'] = true;
|
|
61
60
|
classObj[themeIcon] = true;
|
|
62
61
|
}
|