@nuraly/lumenui 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nuralyui.bundle.js +23024 -17355
- package/dist/nuralyui.bundle.js.gz +0 -0
- package/dist/src/components/alert/alert.component.d.ts +8 -5
- package/dist/src/components/alert/alert.component.js +24 -20
- package/dist/src/components/alert/alert.style.d.ts +0 -7
- package/dist/src/components/alert/alert.style.js +48 -90
- package/dist/src/components/alert/bundle.js +82 -108
- package/dist/src/components/alert/bundle.js.gz +0 -0
- package/dist/src/components/badge/badge.component.d.ts +9 -8
- package/dist/src/components/badge/badge.component.js +17 -14
- package/dist/src/components/badge/badge.style.d.ts +0 -7
- package/dist/src/components/badge/badge.style.js +49 -107
- package/dist/src/components/badge/bundle.js +81 -119
- package/dist/src/components/badge/bundle.js.gz +0 -0
- package/dist/src/components/breadcrumb/breadcrumb.component.d.ts +8 -10
- package/dist/src/components/breadcrumb/breadcrumb.component.js +16 -15
- package/dist/src/components/breadcrumb/breadcrumb.style.d.ts +0 -7
- package/dist/src/components/breadcrumb/breadcrumb.style.js +42 -60
- package/dist/src/components/breadcrumb/bundle.js +96 -93
- package/dist/src/components/breadcrumb/bundle.js.gz +0 -0
- package/dist/src/components/button/bundle.js +221 -470
- package/dist/src/components/button/bundle.js.gz +0 -0
- package/dist/src/components/button/button.component.d.ts +2 -1
- package/dist/src/components/button/button.component.js +6 -6
- package/dist/src/components/button/button.style.d.ts +0 -7
- package/dist/src/components/button/button.style.js +167 -433
- package/dist/src/components/canvas/base-canvas.component.d.ts +2 -1
- package/dist/src/components/canvas/base-canvas.component.js +1 -0
- package/dist/src/components/canvas/bundle.js +16919 -9595
- package/dist/src/components/canvas/bundle.js.gz +0 -0
- package/dist/src/components/canvas/canvas.constants.d.ts +1 -1
- package/dist/src/components/canvas/canvas.constants.js +1 -1
- package/dist/src/components/canvas/chatbot-panel.style.js +31 -31
- package/dist/src/components/canvas/index.d.ts +2 -0
- package/dist/src/components/canvas/index.js +3 -0
- package/dist/src/components/canvas/whiteboard-canvas.component.d.ts +3 -1
- package/dist/src/components/canvas/whiteboard-canvas.component.js +19 -1
- package/dist/src/components/canvas/whiteboard-canvas.style.js +159 -138
- package/dist/src/components/canvas/whiteboard-node.component.d.ts +2 -1
- package/dist/src/components/canvas/whiteboard-node.component.js +2 -1
- package/dist/src/components/canvas/whiteboard-node.style.js +44 -44
- package/dist/src/components/canvas/workflow-canvas-only.d.ts +4 -0
- package/dist/src/components/canvas/workflow-canvas-only.js +5 -0
- package/dist/src/components/canvas/workflow-canvas.component.d.ts +3 -1
- package/dist/src/components/canvas/workflow-canvas.component.js +24 -2
- package/dist/src/components/canvas/workflow-canvas.style.js +776 -648
- package/dist/src/components/canvas/workflow-canvas.types.d.ts +113 -4
- package/dist/src/components/canvas/workflow-canvas.types.js +646 -3
- package/dist/src/components/canvas/workflow-node.component.d.ts +3 -2
- package/dist/src/components/canvas/workflow-node.component.js +5 -5
- package/dist/src/components/canvas/workflow-node.style.js +183 -181
- package/dist/src/components/card/bundle.js +43 -35
- package/dist/src/components/card/bundle.js.gz +0 -0
- package/dist/src/components/card/card.component.d.ts +6 -1
- package/dist/src/components/card/card.component.js +8 -2
- package/dist/src/components/card/card.style.js +26 -30
- package/dist/src/components/carousel/bundle.js +8 -8
- package/dist/src/components/carousel/bundle.js.gz +0 -0
- package/dist/src/components/carousel/carousel.component.d.ts +12 -0
- package/dist/src/components/carousel/carousel.component.js +16 -4
- package/dist/src/components/chatbot/bundle.js +422 -406
- package/dist/src/components/chatbot/bundle.js.gz +0 -0
- package/dist/src/components/chatbot/chatbot.component.d.ts +2 -1
- package/dist/src/components/chatbot/chatbot.component.js +1 -0
- package/dist/src/components/chatbot/chatbot.style.js +277 -277
- package/dist/src/components/checkbox/bundle.js +86 -245
- package/dist/src/components/checkbox/bundle.js.gz +0 -0
- package/dist/src/components/checkbox/checkbox.component.d.ts +5 -2
- package/dist/src/components/checkbox/checkbox.component.js +11 -13
- package/dist/src/components/checkbox/checkbox.style.js +56 -231
- package/dist/src/components/code-editor/bundle.js +151 -25
- package/dist/src/components/code-editor/bundle.js.gz +0 -0
- package/dist/src/components/code-editor/code-editor.component.d.ts +18 -56
- package/dist/src/components/code-editor/code-editor.component.js +141 -394
- package/dist/src/components/code-editor/code-editor.style.js +139 -15
- package/dist/src/components/collapse/bundle.js +97 -84
- package/dist/src/components/collapse/bundle.js.gz +0 -0
- package/dist/src/components/collapse/collapse.component.d.ts +7 -1
- package/dist/src/components/collapse/collapse.component.js +11 -2
- package/dist/src/components/collapse/collapse.style.js +60 -60
- package/dist/src/components/colorpicker/bundle.js +85 -48
- package/dist/src/components/colorpicker/bundle.js.gz +0 -0
- package/dist/src/components/colorpicker/color-holder.component.d.ts +2 -4
- package/dist/src/components/colorpicker/color-holder.component.js +5 -6
- package/dist/src/components/colorpicker/color-holder.style.js +11 -11
- package/dist/src/components/colorpicker/color-picker.component.d.ts +2 -1
- package/dist/src/components/colorpicker/color-picker.component.js +1 -0
- package/dist/src/components/colorpicker/color-picker.style.js +12 -12
- package/dist/src/components/colorpicker/default-color-sets.component.d.ts +2 -2
- package/dist/src/components/colorpicker/default-color-sets.component.js +4 -3
- package/dist/src/components/colorpicker/default-color-sets.style.js +5 -5
- package/dist/src/components/container/bundle.js +24 -14
- package/dist/src/components/container/bundle.js.gz +0 -0
- package/dist/src/components/container/container.component.d.ts +4 -1
- package/dist/src/components/container/container.component.js +7 -5
- package/dist/src/components/container/container.style.js +9 -9
- package/dist/src/components/datepicker/bundle.js +193 -177
- package/dist/src/components/datepicker/bundle.js.gz +0 -0
- package/dist/src/components/datepicker/datepicker.component.d.ts +2 -1
- package/dist/src/components/datepicker/datepicker.component.js +1 -0
- package/dist/src/components/datepicker/datepicker.style.js +65 -65
- package/dist/src/components/datepicker/datepicker.style.variables.js +91 -91
- package/dist/src/components/db-connection-select/bundle.js +7 -6
- package/dist/src/components/db-connection-select/bundle.js.gz +0 -0
- package/dist/src/components/db-connection-select/db-connection-select.component.d.ts +3 -0
- package/dist/src/components/db-connection-select/db-connection-select.component.js +4 -0
- package/dist/src/components/divider/bundle.js +61 -35
- package/dist/src/components/divider/bundle.js.gz +0 -0
- package/dist/src/components/divider/divider.component.d.ts +4 -6
- package/dist/src/components/divider/divider.component.js +10 -14
- package/dist/src/components/divider/divider.style.js +41 -31
- package/dist/src/components/document/bundle.js +50 -48
- package/dist/src/components/document/bundle.js.gz +0 -0
- package/dist/src/components/document/document.component.d.ts +12 -1
- package/dist/src/components/document/document.component.js +18 -6
- package/dist/src/components/document/document.style.js +21 -36
- package/dist/src/components/dropdown/bundle.js +117 -101
- package/dist/src/components/dropdown/bundle.js.gz +0 -0
- package/dist/src/components/dropdown/dropdown.component.d.ts +2 -1
- package/dist/src/components/dropdown/dropdown.component.js +1 -0
- package/dist/src/components/dropdown/dropdown.style.js +68 -68
- package/dist/src/components/file-upload/bundle.js +82 -76
- package/dist/src/components/file-upload/bundle.js.gz +0 -0
- package/dist/src/components/file-upload/file-upload.component.d.ts +2 -1
- package/dist/src/components/file-upload/file-upload.component.js +1 -0
- package/dist/src/components/file-upload/styles.js +59 -59
- package/dist/src/components/flex/bundle.js +18 -8
- package/dist/src/components/flex/bundle.js.gz +0 -0
- package/dist/src/components/flex/flex.component.d.ts +4 -1
- package/dist/src/components/flex/flex.component.js +7 -4
- package/dist/src/components/flex/flex.style.js +2 -2
- package/dist/src/components/form/bundle.js +22 -10
- package/dist/src/components/form/bundle.js.gz +0 -0
- package/dist/src/components/form/form.component.d.ts +4 -1
- package/dist/src/components/form/form.component.js +5 -1
- package/dist/src/components/form/form.style.js +2 -2
- package/dist/src/components/grid/bundle.js +26 -14
- package/dist/src/components/grid/bundle.js.gz +0 -0
- package/dist/src/components/grid/col.component.d.ts +4 -1
- package/dist/src/components/grid/col.component.js +4 -1
- package/dist/src/components/grid/col.style.js +2 -2
- package/dist/src/components/grid/row.component.d.ts +4 -1
- package/dist/src/components/grid/row.component.js +4 -1
- package/dist/src/components/grid/row.style.js +2 -2
- package/dist/src/components/icon/bundle.js +78 -252
- package/dist/src/components/icon/bundle.js.gz +0 -0
- package/dist/src/components/icon/icon-paths.d.ts +2 -0
- package/dist/src/components/icon/icon-paths.js +141 -0
- package/dist/src/components/icon/icon.component.d.ts +10 -12
- package/dist/src/components/icon/icon.component.js +42 -93
- package/dist/src/components/icon/icon.style.js +42 -130
- package/dist/src/components/icon/icon.variables.js +9 -9
- package/dist/src/components/iconpicker/bundle.js +859 -1511
- package/dist/src/components/iconpicker/bundle.js.gz +0 -0
- package/dist/src/components/iconpicker/icon-picker.component.d.ts +2 -1
- package/dist/src/components/iconpicker/icon-picker.component.js +1 -0
- package/dist/src/components/iconpicker/icon-picker.style.js +13 -13
- package/dist/src/components/image/bundle.js +43 -33
- package/dist/src/components/image/bundle.js.gz +0 -0
- package/dist/src/components/image/image.component.d.ts +10 -1
- package/dist/src/components/image/image.component.js +13 -3
- package/dist/src/components/image/image.style.js +19 -26
- package/dist/src/components/input/bundle.js +420 -644
- package/dist/src/components/input/bundle.js.gz +0 -0
- package/dist/src/components/input/input.component.d.ts +16 -3
- package/dist/src/components/input/input.component.js +43 -27
- package/dist/src/components/input/input.style.d.ts +1 -1
- package/dist/src/components/input/input.style.js +331 -634
- package/dist/src/components/kv-secret-select/bundle.js +2 -1
- package/dist/src/components/kv-secret-select/bundle.js.gz +0 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.d.ts +3 -0
- package/dist/src/components/kv-secret-select/kv-secret-select.component.js +4 -0
- package/dist/src/components/label/bundle.js +37 -60
- package/dist/src/components/label/bundle.js.gz +0 -0
- package/dist/src/components/label/label.component.d.ts +8 -4
- package/dist/src/components/label/label.component.js +9 -14
- package/dist/src/components/label/label.style.js +17 -25
- package/dist/src/components/label/label.style.variables.js +18 -18
- package/dist/src/components/layout/bundle.js +86 -70
- package/dist/src/components/layout/bundle.js.gz +0 -0
- package/dist/src/components/layout/content.component.d.ts +2 -1
- package/dist/src/components/layout/content.component.js +2 -1
- package/dist/src/components/layout/content.style.js +3 -3
- package/dist/src/components/layout/footer.component.d.ts +2 -1
- package/dist/src/components/layout/footer.component.js +3 -2
- package/dist/src/components/layout/footer.style.js +7 -7
- package/dist/src/components/layout/header.component.d.ts +2 -1
- package/dist/src/components/layout/header.component.js +3 -2
- package/dist/src/components/layout/header.style.js +7 -7
- package/dist/src/components/layout/layout.component.d.ts +4 -7
- package/dist/src/components/layout/layout.component.js +9 -22
- package/dist/src/components/layout/layout.style.js +1 -1
- package/dist/src/components/layout/sider.component.d.ts +3 -1
- package/dist/src/components/layout/sider.component.js +3 -1
- package/dist/src/components/layout/sider.style.js +29 -29
- package/dist/src/components/menu/bundle.js +135 -125
- package/dist/src/components/menu/bundle.js.gz +0 -0
- package/dist/src/components/menu/menu.component.d.ts +2 -1
- package/dist/src/components/menu/menu.component.js +1 -0
- package/dist/src/components/menu/menu.style.js +87 -87
- package/dist/src/components/modal/bundle.js +105 -96
- package/dist/src/components/modal/bundle.js.gz +0 -0
- package/dist/src/components/modal/modal.component.d.ts +2 -1
- package/dist/src/components/modal/modal.component.js +1 -0
- package/dist/src/components/modal/modal.style.js +69 -71
- package/dist/src/components/panel/bundle.js +190 -391
- package/dist/src/components/panel/bundle.js.gz +0 -0
- package/dist/src/components/panel/panel.component.d.ts +2 -1
- package/dist/src/components/panel/panel.component.js +1 -0
- package/dist/src/components/panel/panel.style.js +65 -65
- package/dist/src/components/popconfirm/bundle.js +107 -93
- package/dist/src/components/popconfirm/bundle.js.gz +0 -0
- package/dist/src/components/popconfirm/popconfirm-manager.component.d.ts +2 -1
- package/dist/src/components/popconfirm/popconfirm-manager.component.js +1 -0
- package/dist/src/components/popconfirm/popconfirm-manager.style.js +16 -16
- package/dist/src/components/popconfirm/popconfirm.component.d.ts +2 -1
- package/dist/src/components/popconfirm/popconfirm.component.js +9 -5
- package/dist/src/components/popconfirm/popconfirm.style.js +43 -43
- package/dist/src/components/radio/bundle.js +56 -86
- package/dist/src/components/radio/bundle.js.gz +0 -0
- package/dist/src/components/radio/radio.component.d.ts +8 -2
- package/dist/src/components/radio/radio.component.js +17 -9
- package/dist/src/components/radio/radio.style.js +30 -77
- package/dist/src/components/radio-group/bundle.js +125 -89
- package/dist/src/components/radio-group/bundle.js.gz +0 -0
- package/dist/src/components/radio-group/radio-group.component.d.ts +5 -1
- package/dist/src/components/radio-group/radio-group.component.js +18 -10
- package/dist/src/components/radio-group/radio-group.style.js +44 -44
- package/dist/src/components/select/bundle.js +260 -367
- package/dist/src/components/select/bundle.js.gz +0 -0
- package/dist/src/components/select/select.component.d.ts +12 -17
- package/dist/src/components/select/select.component.js +35 -35
- package/dist/src/components/select/select.style.js +184 -324
- package/dist/src/components/skeleton/bundle.js +82 -162
- package/dist/src/components/skeleton/bundle.js.gz +0 -0
- package/dist/src/components/skeleton/skeleton.component.d.ts +10 -5
- package/dist/src/components/skeleton/skeleton.component.js +20 -7
- package/dist/src/components/skeleton/skeleton.style.js +34 -133
- package/dist/src/components/slider-input/bundle.js +89 -88
- package/dist/src/components/slider-input/bundle.js.gz +0 -0
- package/dist/src/components/slider-input/slider-input.component.d.ts +11 -0
- package/dist/src/components/slider-input/slider-input.component.js +20 -8
- package/dist/src/components/slider-input/slider-input.style.js +47 -47
- package/dist/src/components/slider-input/slider-input.style.variables.js +32 -32
- package/dist/src/components/table/bundle.js +149 -128
- package/dist/src/components/table/bundle.js.gz +0 -0
- package/dist/src/components/table/table.component.d.ts +2 -1
- package/dist/src/components/table/table.component.js +1 -0
- package/dist/src/components/table/table.style.js +79 -79
- package/dist/src/components/tabs/bundle.js +462 -663
- package/dist/src/components/tabs/bundle.js.gz +0 -0
- package/dist/src/components/tabs/tabs.component.d.ts +6 -1
- package/dist/src/components/tabs/tabs.component.js +8 -1
- package/dist/src/components/tabs/tabs.style.js +200 -201
- package/dist/src/components/tag/bundle.js +44 -36
- package/dist/src/components/tag/bundle.js.gz +0 -0
- package/dist/src/components/tag/tag.component.d.ts +7 -6
- package/dist/src/components/tag/tag.component.js +10 -19
- package/dist/src/components/tag/tag.style.js +20 -24
- package/dist/src/components/textarea/bundle.js +131 -94
- package/dist/src/components/textarea/bundle.js.gz +0 -0
- package/dist/src/components/textarea/textarea.component.d.ts +7 -1
- package/dist/src/components/textarea/textarea.component.js +10 -3
- package/dist/src/components/textarea/textarea.style.d.ts +1 -13
- package/dist/src/components/textarea/textarea.style.js +79 -91
- package/dist/src/components/timeline/bundle.js +71 -134
- package/dist/src/components/timeline/bundle.js.gz +0 -0
- package/dist/src/components/timeline/timeline.component.d.ts +9 -6
- package/dist/src/components/timeline/timeline.component.js +16 -13
- package/dist/src/components/timeline/timeline.style.d.ts +0 -7
- package/dist/src/components/timeline/timeline.style.js +41 -122
- package/dist/src/components/timepicker/bundle.js +196 -166
- package/dist/src/components/timepicker/bundle.js.gz +0 -0
- package/dist/src/components/timepicker/timepicker.component.d.ts +2 -1
- package/dist/src/components/timepicker/timepicker.component.js +1 -0
- package/dist/src/components/timepicker/timepicker.style.js +42 -42
- package/dist/src/components/timepicker/timepicker.style.variables.js +91 -91
- package/dist/src/components/toast/bundle.js +97 -81
- package/dist/src/components/toast/bundle.js.gz +0 -0
- package/dist/src/components/toast/toast.component.d.ts +2 -1
- package/dist/src/components/toast/toast.component.js +1 -0
- package/dist/src/components/toast/toast.style.js +62 -62
- package/dist/src/components/tooltips/bundle.js +10 -10
- package/dist/src/components/tooltips/bundle.js.gz +0 -0
- package/dist/src/components/tooltips/tooltips.component.d.ts +8 -0
- package/dist/src/components/tooltips/tooltips.component.js +9 -1
- package/dist/src/components/tooltips/tooltips.style.js +6 -6
- package/dist/src/components/video/bundle.js +47 -36
- package/dist/src/components/video/bundle.js.gz +0 -0
- package/dist/src/components/video/video.component.d.ts +12 -1
- package/dist/src/components/video/video.component.js +18 -6
- package/dist/src/components/video/video.style.js +18 -24
- package/package.json +25 -12
- package/packages/common/dist/VERSIONS.md +2 -2
- package/packages/common/dist/shared/base-mixin.d.ts +21 -19
- package/packages/common/dist/shared/base-mixin.d.ts.map +1 -1
- package/packages/common/dist/shared/base-mixin.js +102 -18
- package/packages/common/dist/shared/base-mixin.js.map +1 -1
- package/packages/common/dist/shared/index.d.ts +1 -0
- package/packages/common/dist/shared/index.d.ts.map +1 -1
- package/packages/common/dist/shared/index.js +2 -0
- package/packages/common/dist/shared/index.js.map +1 -1
- package/packages/common/dist/shared/style-injector.d.ts +11 -0
- package/packages/common/dist/shared/style-injector.d.ts.map +1 -0
- package/packages/common/dist/shared/style-injector.js +53 -0
- package/packages/common/dist/shared/style-injector.js.map +1 -0
- package/packages/common/dist/shared/theme-mixin.d.ts +2 -24
- package/packages/common/dist/shared/theme-mixin.d.ts.map +1 -1
- package/packages/common/dist/shared/theme-mixin.js +5 -38
- package/packages/common/dist/shared/theme-mixin.js.map +1 -1
- package/packages/themes/dist/default.css +0 -10
- package/packages/themes/dist/package.json +1 -1
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property as
|
|
1
|
+
import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property as o,state as s,query as r,customElement as a}from"lit/decorators.js";import{repeat as l}from"lit/directives/repeat.js";import{choose as c}from"lit/directives/choose.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
5
|
+
* SPDX-License-Identifier: MIT
|
|
6
|
+
*/const d=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,e,i;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(e=this.designSystemObserver)||void 0===e||e.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t,e;const i=(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme");return i||((null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get currentDesignSystem(){var t;const e=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===e?e:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver(()=>{this.requestUpdate()}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver(()=>{this.requestUpdate()}),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}},h=()=>{var t;return void 0!==globalThis.litElementVersions||"undefined"!=typeof process&&"development"===(null===(t=process.env)||void 0===t?void 0:t.NODE_ENV)||"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},p=t=>class extends t{constructor(){super(...arguments),this.requiredComponents=[]}validateDependencies(){if(h())for(const t of this.requiredComponents)if(!this.isComponentAvailable(t))throw new Error(`Required component "${t}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}. Example: import '@nuralyui/${t}';`)}validateDependenciesWithHandler(t){if(!h())return!0;let e=!0;for(const i of this.requiredComponents)if(!this.isComponentAvailable(i)){e=!1;const n=new Error(`Required component "${i}" is not registered. Please import and register the component before using ${this.tagName.toLowerCase()}.`);t?t(i,n):console.error(n.message)}return e}isComponentAvailable(t){return!!customElements.get(t)}getMissingDependencies(){return this.requiredComponents.filter(t=>!this.isComponentAvailable(t))}areDependenciesAvailable(){return this.requiredComponents.every(t=>this.isComponentAvailable(t))}addRequiredComponent(t){this.requiredComponents.includes(t)||this.requiredComponents.push(t)}removeRequiredComponent(t){const e=this.requiredComponents.indexOf(t);e>-1&&this.requiredComponents.splice(e,1)}},f=t=>class extends t{dispatchCustomEvent(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}dispatchEventWithMetadata(t,e){var i;const n=Object.assign(Object.assign({},e),{timestamp:Date.now(),componentName:(null===(i=this.tagName)||void 0===i?void 0:i.toLowerCase())||"unknown"});this.dispatchCustomEvent(t,n)}dispatchInputEvent(t,e){const i=Object.assign({target:e.target||this,value:e.value,originalEvent:e.originalEvent},e);this.dispatchCustomEvent(t,i)}dispatchFocusEvent(t,e){const i=Object.assign({target:e.target||this,value:e.value,focused:e.focused,cursorPosition:e.cursorPosition,selectedText:e.selectedText},e);this.dispatchCustomEvent(t,i)}dispatchValidationEvent(t,e){var i;const n=Object.assign({target:e.target||this,value:e.value,isValid:null!==(i=e.isValid)&&void 0!==i&&i,error:e.error},e);this.dispatchCustomEvent(t,n)}dispatchActionEvent(t,e){const i=Object.assign({target:e.target||this,action:e.action,previousValue:e.previousValue,newValue:e.newValue},e);this.dispatchCustomEvent(t,i)}isReadonlyKeyAllowed(t){if(t.ctrlKey||t.metaKey){return["KeyA","KeyC"].includes(t.code)}return["Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(t.key)}isActivationKey(t){return"Enter"===t.key||" "===t.key}},u=new Set,g=new Map;
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
10
|
+
* SPDX-License-Identifier: MIT
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
15
|
+
* SPDX-License-Identifier: MIT
|
|
16
|
+
*/
|
|
17
|
+
const m=t=>{class e extends t{constructor(){super(...arguments),this.t=null}createRenderRoot(){return this.constructor.useShadowDom?super.createRenderRoot():this}connectedCallback(){const t=this.constructor.useShadowDom;if(!t&&null===this.t)for(this.t=[];this.firstChild;)this.t.push(this.removeChild(this.firstChild));if(super.connectedCallback(),!t){const t=this.constructor,e=this.tagName.toLowerCase(),i=t.styles;if(i){const t=x(i);t&&function(t,e,i){var n;if(!g.has(t)){const i=new CSSStyleSheet;i.replaceSync(e),g.set(t,i)}const o=g.get(t),s=`doc:${t}`;if(u.has(s)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,o],u.add(s)),i){let e=i;for(;e;){const i=e.getRootNode();if(!(i instanceof ShadowRoot))break;{const s=`shadow:${((null===(n=i.host)||void 0===n?void 0:n.tagName)||"").toLowerCase()}:${t}`;u.has(s)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,o],u.add(s)),e=i.host}}}}(e,t,this)}}}get lightChildren(){return this.t?this.t.filter(t=>!(t instanceof Element&&t.hasAttribute("slot"))):[]}lightChildrenNamed(t){return this.t?this.t.filter(e=>e instanceof Element&&e.getAttribute("slot")===t):[]}}return e.useShadowDom=!1,e};function x(t){return Array.isArray(t)?t.map(t=>x(t)).filter(Boolean).join("\n"):t&&"string"==typeof t.cssText?t.cssText:"string"==typeof t?t:""}var b=t`
|
|
2
18
|
:host {
|
|
3
19
|
display: block;
|
|
4
20
|
width: 100%;
|
|
5
|
-
font-family:
|
|
6
|
-
color:
|
|
7
|
-
background-color:
|
|
21
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
22
|
+
color: #161616;
|
|
23
|
+
background-color: #ffffff;
|
|
8
24
|
}
|
|
9
25
|
|
|
10
26
|
/* Filter Container Styles */
|
|
@@ -12,7 +28,7 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
12
28
|
display: flex;
|
|
13
29
|
justify-content: flex-end;
|
|
14
30
|
width: 100%;
|
|
15
|
-
padding:
|
|
31
|
+
padding: 0.5rem 0;
|
|
16
32
|
position: relative;
|
|
17
33
|
margin-bottom: 5px;
|
|
18
34
|
}
|
|
@@ -22,13 +38,13 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
22
38
|
padding-left: 30px;
|
|
23
39
|
width: 100%;
|
|
24
40
|
box-sizing: border-box;
|
|
25
|
-
background-color:
|
|
26
|
-
color:
|
|
41
|
+
background-color: #ffffff;
|
|
42
|
+
color: #000000;
|
|
27
43
|
}
|
|
28
44
|
|
|
29
45
|
.filter-container input:focus {
|
|
30
46
|
outline-style: none;
|
|
31
|
-
border: 1px solid
|
|
47
|
+
border: 1px solid #1890ff;
|
|
32
48
|
}
|
|
33
49
|
|
|
34
50
|
.filter-container .icon-container {
|
|
@@ -48,12 +64,12 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
48
64
|
|
|
49
65
|
/* Actions Bar Styles */
|
|
50
66
|
.actions-container {
|
|
51
|
-
background-color:
|
|
67
|
+
background-color: #0f62fe;
|
|
52
68
|
padding: 10px;
|
|
53
69
|
box-sizing: border-box;
|
|
54
70
|
display: flex;
|
|
55
71
|
justify-content: space-between;
|
|
56
|
-
color:
|
|
72
|
+
color: #ffffff;
|
|
57
73
|
}
|
|
58
74
|
|
|
59
75
|
/* Fixed Header Styles */
|
|
@@ -68,26 +84,26 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
68
84
|
}
|
|
69
85
|
|
|
70
86
|
.table-content-wrapper.fixed-header thead {
|
|
71
|
-
background-color:
|
|
87
|
+
background-color: #fafafa;
|
|
72
88
|
}
|
|
73
89
|
|
|
74
90
|
.table-content-wrapper.fixed-header thead th {
|
|
75
91
|
position: sticky;
|
|
76
92
|
top: 0;
|
|
77
93
|
z-index: 10;
|
|
78
|
-
background-color:
|
|
79
|
-
border-bottom:
|
|
94
|
+
background-color: #fafafa;
|
|
95
|
+
border-bottom: 1px solid #f0f0f0;
|
|
80
96
|
}
|
|
81
97
|
|
|
82
98
|
.table-content-wrapper.fixed-header thead tr {
|
|
83
|
-
box-shadow: 0 1px 0 0
|
|
99
|
+
box-shadow: 0 1px 0 0 #f0f0f0;
|
|
84
100
|
}
|
|
85
101
|
|
|
86
102
|
.actions-container button {
|
|
87
103
|
cursor: pointer;
|
|
88
104
|
border: none;
|
|
89
|
-
color:
|
|
90
|
-
background-color:
|
|
105
|
+
color: #ffffff;
|
|
106
|
+
background-color: #0f62fe;
|
|
91
107
|
}
|
|
92
108
|
|
|
93
109
|
.actions-container[data-size='small'] {
|
|
@@ -109,8 +125,8 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
109
125
|
input[type='checkbox'][data-indeterminate='true']::after {
|
|
110
126
|
width: 13px;
|
|
111
127
|
height: 13px;
|
|
112
|
-
background-color:
|
|
113
|
-
color:
|
|
128
|
+
background-color: #161616;
|
|
129
|
+
color: #ffffff;
|
|
114
130
|
display: flex;
|
|
115
131
|
justify-content: center;
|
|
116
132
|
align-items: center;
|
|
@@ -121,20 +137,20 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
121
137
|
table {
|
|
122
138
|
width: 100%;
|
|
123
139
|
border-spacing: 0px;
|
|
124
|
-
color:
|
|
140
|
+
color: #161616;
|
|
125
141
|
}
|
|
126
142
|
|
|
127
143
|
td {
|
|
128
144
|
text-align: center;
|
|
129
|
-
border-bottom:
|
|
130
|
-
padding:
|
|
131
|
-
font-size:
|
|
145
|
+
border-bottom: 1px solid #f0f0f0;
|
|
146
|
+
padding: 10px;
|
|
147
|
+
font-size: 14px;
|
|
132
148
|
}
|
|
133
149
|
|
|
134
150
|
th {
|
|
135
151
|
cursor: pointer;
|
|
136
|
-
padding:
|
|
137
|
-
font-size:
|
|
152
|
+
padding: 10px;
|
|
153
|
+
font-size: 14px;
|
|
138
154
|
}
|
|
139
155
|
|
|
140
156
|
th span {
|
|
@@ -147,15 +163,15 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
147
163
|
display: flex;
|
|
148
164
|
justify-content: center;
|
|
149
165
|
align-items: center;
|
|
150
|
-
--nuraly-icon-color:
|
|
166
|
+
--nuraly-icon-color: #161616;
|
|
151
167
|
}
|
|
152
168
|
|
|
153
169
|
tbody tr {
|
|
154
|
-
background-color:
|
|
170
|
+
background-color: #ffffff;
|
|
155
171
|
}
|
|
156
172
|
|
|
157
173
|
tbody tr:hover {
|
|
158
|
-
background-color:
|
|
174
|
+
background-color: #f5f5f5;
|
|
159
175
|
}
|
|
160
176
|
|
|
161
177
|
tbody tr.clickable {
|
|
@@ -163,29 +179,29 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
163
179
|
}
|
|
164
180
|
|
|
165
181
|
thead tr {
|
|
166
|
-
background-color:
|
|
182
|
+
background-color: #fafafa;
|
|
167
183
|
}
|
|
168
184
|
|
|
169
185
|
tbody tr:has(input:checked) {
|
|
170
|
-
background-color:
|
|
186
|
+
background-color: #e6f7ff;
|
|
171
187
|
}
|
|
172
188
|
|
|
173
189
|
input,
|
|
174
190
|
.expand-icon {
|
|
175
191
|
cursor: pointer;
|
|
176
|
-
accent-color:
|
|
192
|
+
accent-color: #1890ff;
|
|
177
193
|
}
|
|
178
194
|
|
|
179
195
|
/* Size Variants for Table Content */
|
|
180
196
|
:host([size='small']) td,
|
|
181
197
|
:host([size='small']) th {
|
|
182
|
-
padding:
|
|
198
|
+
padding: 8px 16px;
|
|
183
199
|
font-size: 12px;
|
|
184
200
|
}
|
|
185
201
|
|
|
186
202
|
:host([size='large']) td,
|
|
187
203
|
:host([size='large']) th {
|
|
188
|
-
padding:
|
|
204
|
+
padding: 15px;
|
|
189
205
|
font-size: 16px;
|
|
190
206
|
}
|
|
191
207
|
|
|
@@ -194,8 +210,8 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
194
210
|
display: flex;
|
|
195
211
|
justify-content: space-between;
|
|
196
212
|
align-items: center;
|
|
197
|
-
background-color:
|
|
198
|
-
color:
|
|
213
|
+
background-color: #ffffff;
|
|
214
|
+
color: #161616;
|
|
199
215
|
}
|
|
200
216
|
|
|
201
217
|
.pagination-container .left-content {
|
|
@@ -204,7 +220,7 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
204
220
|
}
|
|
205
221
|
|
|
206
222
|
.pagination-container .left-content .items-details {
|
|
207
|
-
border-left:
|
|
223
|
+
border-left: 1px solid #e0e0e0;
|
|
208
224
|
padding: 10px;
|
|
209
225
|
}
|
|
210
226
|
|
|
@@ -216,29 +232,29 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
216
232
|
}
|
|
217
233
|
|
|
218
234
|
.pagination-container .left-content .select-details label {
|
|
219
|
-
font-size:
|
|
220
|
-
color:
|
|
235
|
+
font-size: 14px;
|
|
236
|
+
color: #000000;
|
|
221
237
|
white-space: nowrap;
|
|
222
238
|
}
|
|
223
239
|
|
|
224
240
|
.pagination-container .left-content .select-details nr-select {
|
|
225
241
|
min-width: 60px;
|
|
226
242
|
max-width: 80px;
|
|
227
|
-
--select-border-color:
|
|
228
|
-
--select-background:
|
|
229
|
-
--select-text-color:
|
|
243
|
+
--select-border-color: #d9d9d9;
|
|
244
|
+
--select-background: #fafafa;
|
|
245
|
+
--select-text-color: #000000;
|
|
230
246
|
}
|
|
231
247
|
|
|
232
248
|
.pagination-container .right-content {
|
|
233
249
|
display: flex;
|
|
234
250
|
align-items: center;
|
|
235
|
-
border-left:
|
|
251
|
+
border-left: 1px solid #e0e0e0;
|
|
236
252
|
}
|
|
237
253
|
|
|
238
254
|
.pagination-container .right-content .icon-container {
|
|
239
255
|
display: flex;
|
|
240
256
|
align-items: center;
|
|
241
|
-
border-left:
|
|
257
|
+
border-left: 1px solid #e0e0e0;
|
|
242
258
|
}
|
|
243
259
|
|
|
244
260
|
.pagination-container .right-content .page-details {
|
|
@@ -248,11 +264,11 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
248
264
|
.pagination-container .icon-container .left-arrow,
|
|
249
265
|
.pagination-container .icon-container .right-arrow {
|
|
250
266
|
padding: 10px;
|
|
251
|
-
--nuraly-icon-color:
|
|
267
|
+
--nuraly-icon-color: #161616;
|
|
252
268
|
}
|
|
253
269
|
|
|
254
270
|
.pagination-container .icon-container .left-arrow {
|
|
255
|
-
border-right:
|
|
271
|
+
border-right: 1px solid #e0e0e0;
|
|
256
272
|
}
|
|
257
273
|
|
|
258
274
|
.pagination-container nr-icon[data-enabled='false'] {
|
|
@@ -339,7 +355,7 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
339
355
|
}
|
|
340
356
|
|
|
341
357
|
.filter-trigger:hover {
|
|
342
|
-
background-color:
|
|
358
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
343
359
|
}
|
|
344
360
|
|
|
345
361
|
.filter-icon {
|
|
@@ -350,7 +366,7 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
350
366
|
}
|
|
351
367
|
|
|
352
368
|
.filter-icon.has-filter {
|
|
353
|
-
color:
|
|
369
|
+
color: #1890ff;
|
|
354
370
|
}
|
|
355
371
|
|
|
356
372
|
.filter-indicator {
|
|
@@ -360,15 +376,15 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
360
376
|
width: 6px;
|
|
361
377
|
height: 6px;
|
|
362
378
|
border-radius: 50%;
|
|
363
|
-
background-color:
|
|
379
|
+
background-color: #1890ff;
|
|
364
380
|
}
|
|
365
381
|
|
|
366
382
|
.column-filter-dropdown {
|
|
367
383
|
position: absolute;
|
|
368
384
|
top: calc(100% + 4px);
|
|
369
385
|
right: 0;
|
|
370
|
-
background:
|
|
371
|
-
border: 1px solid
|
|
386
|
+
background: #ffffff;
|
|
387
|
+
border: 1px solid #f0f0f0;
|
|
372
388
|
border-radius: 4px;
|
|
373
389
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
374
390
|
z-index: 100;
|
|
@@ -384,7 +400,7 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
384
400
|
|
|
385
401
|
.column-filter-input {
|
|
386
402
|
padding: 8px;
|
|
387
|
-
border: 1px solid
|
|
403
|
+
border: 1px solid #d9d9d9;
|
|
388
404
|
border-radius: 4px;
|
|
389
405
|
font-size: 14px;
|
|
390
406
|
width: 100%;
|
|
@@ -393,7 +409,7 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
393
409
|
|
|
394
410
|
.column-filter-input:focus {
|
|
395
411
|
outline: none;
|
|
396
|
-
border-color:
|
|
412
|
+
border-color: #1890ff;
|
|
397
413
|
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
398
414
|
}
|
|
399
415
|
|
|
@@ -405,58 +421,58 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
405
421
|
display: flex;
|
|
406
422
|
align-items: center;
|
|
407
423
|
justify-content: center;
|
|
408
|
-
color:
|
|
424
|
+
color: #000;
|
|
409
425
|
align-self: flex-end;
|
|
410
426
|
}
|
|
411
427
|
|
|
412
428
|
.column-filter-clear:hover {
|
|
413
|
-
color:
|
|
429
|
+
color: #1890ff;
|
|
414
430
|
}
|
|
415
431
|
|
|
416
432
|
/* Fixed Columns Styles */
|
|
417
433
|
th.fixed-column,
|
|
418
434
|
td.fixed-column {
|
|
419
435
|
position: sticky;
|
|
420
|
-
background-color:
|
|
436
|
+
background-color: #ffffff;
|
|
421
437
|
}
|
|
422
438
|
|
|
423
439
|
/* Fixed columns in header - highest priority */
|
|
424
440
|
thead th.fixed-column {
|
|
425
441
|
z-index: 20;
|
|
426
|
-
background-color:
|
|
442
|
+
background-color: #fafafa;
|
|
427
443
|
}
|
|
428
444
|
|
|
429
445
|
/* When table has fixed header, fixed columns in header need even higher z-index */
|
|
430
446
|
.table-content-wrapper.fixed-header thead th.fixed-column {
|
|
431
447
|
z-index: 25;
|
|
432
|
-
background-color:
|
|
448
|
+
background-color: #fafafa;
|
|
433
449
|
}
|
|
434
450
|
|
|
435
451
|
/* Fixed columns in body */
|
|
436
452
|
tbody td.fixed-column {
|
|
437
453
|
z-index: 8;
|
|
438
|
-
background-color:
|
|
454
|
+
background-color: #ffffff;
|
|
439
455
|
}
|
|
440
456
|
|
|
441
457
|
/* Ensure fixed columns in tbody have proper background */
|
|
442
458
|
tbody tr td.fixed-column {
|
|
443
|
-
background-color:
|
|
459
|
+
background-color: #ffffff;
|
|
444
460
|
}
|
|
445
461
|
|
|
446
462
|
tbody tr:hover td.fixed-column {
|
|
447
|
-
background-color:
|
|
463
|
+
background-color: #f5f5f5;
|
|
448
464
|
}
|
|
449
465
|
|
|
450
466
|
th.fixed-column-left,
|
|
451
467
|
td.fixed-column-left {
|
|
452
468
|
left: 0;
|
|
453
|
-
border-right: 1px solid
|
|
469
|
+
border-right: 1px solid #f0f0f0;
|
|
454
470
|
}
|
|
455
471
|
|
|
456
472
|
th.fixed-column-right,
|
|
457
473
|
td.fixed-column-right {
|
|
458
474
|
right: 0;
|
|
459
|
-
border-left: 1px solid
|
|
475
|
+
border-left: 1px solid #f0f0f0;
|
|
460
476
|
}
|
|
461
477
|
|
|
462
478
|
/* Shadow effect for fixed columns */
|
|
@@ -506,8 +522,8 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
506
522
|
}
|
|
507
523
|
|
|
508
524
|
.skeleton-cell {
|
|
509
|
-
padding:
|
|
510
|
-
border-bottom: 1px solid
|
|
525
|
+
padding: 0.75rem 1rem;
|
|
526
|
+
border-bottom: 1px solid #f0f0f0;
|
|
511
527
|
}
|
|
512
528
|
|
|
513
529
|
.skeleton-cell.selection-skeleton {
|
|
@@ -554,27 +570,27 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
554
570
|
|
|
555
571
|
/* Spinner Loading */
|
|
556
572
|
.loading-row {
|
|
557
|
-
background-color:
|
|
573
|
+
background-color: #ffffff;
|
|
558
574
|
}
|
|
559
575
|
|
|
560
576
|
.loading-cell {
|
|
561
|
-
padding:
|
|
577
|
+
padding: 2rem 1rem;
|
|
562
578
|
text-align: center;
|
|
563
|
-
border-bottom: 1px solid
|
|
579
|
+
border-bottom: 1px solid #f0f0f0;
|
|
564
580
|
}
|
|
565
581
|
|
|
566
582
|
.loading-spinner-container {
|
|
567
583
|
display: flex;
|
|
568
584
|
flex-direction: column;
|
|
569
585
|
align-items: center;
|
|
570
|
-
gap:
|
|
586
|
+
gap: 1rem;
|
|
571
587
|
}
|
|
572
588
|
|
|
573
589
|
.loading-spinner {
|
|
574
590
|
width: 40px;
|
|
575
591
|
height: 40px;
|
|
576
|
-
border: 4px solid
|
|
577
|
-
border-top-color:
|
|
592
|
+
border: 4px solid #f0f0f0;
|
|
593
|
+
border-top-color: #7c3aed;
|
|
578
594
|
border-radius: 50%;
|
|
579
595
|
animation: spinner-rotate 0.8s linear infinite;
|
|
580
596
|
}
|
|
@@ -590,23 +606,23 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
590
606
|
|
|
591
607
|
.loading-text {
|
|
592
608
|
margin: 0;
|
|
593
|
-
color:
|
|
609
|
+
color: #525252;
|
|
594
610
|
font-size: 14px;
|
|
595
611
|
}
|
|
596
612
|
|
|
597
613
|
/* Empty State Styles */
|
|
598
614
|
.empty-row {
|
|
599
|
-
background:
|
|
615
|
+
background: #ffffff;
|
|
600
616
|
}
|
|
601
617
|
|
|
602
618
|
.empty-row:hover {
|
|
603
|
-
background:
|
|
619
|
+
background: #ffffff;
|
|
604
620
|
}
|
|
605
621
|
|
|
606
622
|
.empty-cell {
|
|
607
623
|
padding: 64px 24px;
|
|
608
624
|
text-align: center;
|
|
609
|
-
border-bottom: 1px solid
|
|
625
|
+
border-bottom: 1px solid #f0f0f0;
|
|
610
626
|
}
|
|
611
627
|
|
|
612
628
|
.empty-state {
|
|
@@ -619,7 +635,7 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
619
635
|
.empty-icon {
|
|
620
636
|
width: 64px;
|
|
621
637
|
height: 64px;
|
|
622
|
-
color:
|
|
638
|
+
color: #bfbfbf;
|
|
623
639
|
display: flex;
|
|
624
640
|
align-items: center;
|
|
625
641
|
justify-content: center;
|
|
@@ -636,7 +652,7 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
636
652
|
|
|
637
653
|
.empty-text {
|
|
638
654
|
margin: 0;
|
|
639
|
-
color:
|
|
655
|
+
color: #525252;
|
|
640
656
|
font-size: 14px;
|
|
641
657
|
line-height: 1.5;
|
|
642
658
|
}
|
|
@@ -650,12 +666,12 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
650
666
|
}
|
|
651
667
|
|
|
652
668
|
.expand-icon:hover {
|
|
653
|
-
background-color:
|
|
669
|
+
background-color: #f5f5f5;
|
|
654
670
|
}
|
|
655
671
|
|
|
656
672
|
.expand-icon:focus {
|
|
657
|
-
background-color:
|
|
658
|
-
box-shadow: inset 0 0 0 2px
|
|
673
|
+
background-color: #f5f5f5;
|
|
674
|
+
box-shadow: inset 0 0 0 2px #7c3aed;
|
|
659
675
|
}
|
|
660
676
|
|
|
661
677
|
.expand-icon nr-icon {
|
|
@@ -683,8 +699,8 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
683
699
|
|
|
684
700
|
.expansion-content {
|
|
685
701
|
padding: 16px;
|
|
686
|
-
background-color:
|
|
687
|
-
border-top: 1px solid
|
|
702
|
+
background-color: #fafafa;
|
|
703
|
+
border-top: 1px solid #e0e0e0;
|
|
688
704
|
}
|
|
689
705
|
|
|
690
706
|
@keyframes slideDown {
|
|
@@ -703,44 +719,49 @@ import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property
|
|
|
703
719
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
704
720
|
* SPDX-License-Identifier: MIT
|
|
705
721
|
*/
|
|
706
|
-
class
|
|
722
|
+
class v{constructor(t){this._host=t,t.addController(this)}get host(){return this._host}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}requestUpdate(){try{this._host.requestUpdate()}catch(t){this.handleError(t,"requestUpdate")}}dispatchEvent(t){try{return this._host.dispatchEvent(t)}catch(t){return this.handleError(t,"dispatchEvent"),!1}}handleError(t,e){console.error(`[${this.constructor.name}] Error in ${e}:`,t);try{this._host.dispatchEvent(new CustomEvent("nr-controller-error",{detail:{error:t.message,context:e,controller:this.constructor.name},bubbles:!0,composed:!0}))}catch(t){}}safeExecute(t,e,i){try{return t()}catch(t){return this.handleError(t,e),i}}debounce(t,e){let i;const n=(...n)=>{void 0!==i&&clearTimeout(i),i=setTimeout(()=>{i=void 0,t.apply(this,n)},e)};return n.cancel=()=>{void 0!==i&&(clearTimeout(i),i=void 0)},n}}
|
|
723
|
+
/**
|
|
724
|
+
* @license
|
|
725
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
726
|
+
* SPDX-License-Identifier: MIT
|
|
727
|
+
*/class w extends v{}
|
|
707
728
|
/**
|
|
708
729
|
* @license
|
|
709
730
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
710
731
|
* SPDX-License-Identifier: MIT
|
|
711
|
-
*/class
|
|
732
|
+
*/class y extends w{initSelection(){this.host.selectionMode&&(this.host.selectedItems=new Array(this.host.rows.length).fill(!1))}handleCheckAll(t){try{const e=(this.host.currentPage-1)*this.host.selectedItemPerPage,i=Math.min(e+this.host.selectedItemPerPage,this.host.selectedItems.length),n=[...this.host.selectedItems];for(let o=e;o<i;o++)n[o]=!t;this.host.selectedItems=n;const o=this.host.rowsCopy.filter((t,e)=>this.host.selectedItems[e]);this.dispatchEvent(new CustomEvent("onSelect",{bubbles:!0,composed:!0,detail:{value:o}})),this.requestUpdate()}catch(t){this.handleError(t,"handleCheckAll")}}handleCheckOne(t,e){try{const i=t+(this.host.currentPage-1)*this.host.selectedItemPerPage;this.host.selectedItems[i]=e,this.host.selectedItems=[...this.host.selectedItems];const n=this.host.rowsCopy.filter((t,e)=>this.host.selectedItems[e]);this.dispatchEvent(new CustomEvent("nr-select",{bubbles:!0,composed:!0,detail:{value:n}})),this.requestUpdate()}catch(t){this.handleError(t,"handleCheckOne")}}handleSelectOne(t){try{const e=this.host.selectedItems.findIndex(t=>t);e>-1&&(this.host.selectedItems[e]=!1);const i=t+(this.host.currentPage-1)*this.host.selectedItemPerPage;this.host.selectedItems[i]=!0,this.host.selectedItems=[...this.host.selectedItems];const n=this.host.rowsCopy.filter((t,e)=>this.host.selectedItems[e]);this.dispatchEvent(new CustomEvent("nr-select",{bubbles:!0,composed:!0,detail:{value:n}})),this.requestUpdate()}catch(t){this.handleError(t,"handleSelectOne")}}cancelSelection(){try{this.host.selectedItems=this.host.selectedItems.map(()=>!1),this.dispatchEvent(new CustomEvent("nr-select",{bubbles:!0,composed:!0,detail:{value:[]}})),this.requestUpdate()}catch(t){this.handleError(t,"cancelSelection")}}hasSelection(){return this.host.selectedItems.some(t=>t)}getSelectedCount(){return this.host.selectedItems.filter(t=>t).length}}
|
|
712
733
|
/**
|
|
713
734
|
* @license
|
|
714
735
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
715
736
|
* SPDX-License-Identifier: MIT
|
|
716
|
-
*/class
|
|
737
|
+
*/class $ extends w{initPagination(){try{this.host.serverSide?(this.host.displayedRows=[...this.host.rows],this.host.currentPage=this.host.rows.length>0?1:0):(this.host.displayedRows=this.host.rowsCopy.slice(0,this.host.selectedItemPerPage),this.host.currentPage=this.host.rowsCopy.length>0?1:0),this.requestUpdate()}catch(t){this.handleError(t,"initPagination")}}handleItemPerPageChange(t){try{this.host.selectedItemPerPage=t,this.host.currentPage=1,this.host.serverSide?(this.dispatchEvent(new CustomEvent("onPaginate",{bubbles:!0,composed:!0,detail:{page:1,limit:t,offset:0}})),this.requestUpdate()):this.initPagination()}catch(t){this.handleError(t,"handleItemPerPageChange")}}handlePageChange(t){try{this.host.currentPage=t;const e=(t-1)*this.host.selectedItemPerPage,i=e+this.host.selectedItemPerPage;this.host.serverSide||(this.host.displayedRows=this.host.rowsCopy.slice(e,i)),this.dispatchEvent(new CustomEvent("onPaginate",{bubbles:!0,composed:!0,detail:{page:this.host.currentPage,limit:this.host.selectedItemPerPage,offset:e}})),this.requestUpdate()}catch(t){this.handleError(t,"handlePageChange")}}getTotalPages(){const t=this.host.serverSide?this.host.totalCount:this.host.rowsCopy.length;return Math.ceil(t/this.host.selectedItemPerPage)}hasNextPage(){return this.host.currentPage<this.getTotalPages()}hasPreviousPage(){return this.host.currentPage>1}}
|
|
717
738
|
/**
|
|
718
739
|
* @license
|
|
719
740
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
720
741
|
* SPDX-License-Identifier: MIT
|
|
721
|
-
*/class
|
|
742
|
+
*/class k extends w{handleSortOrderChange(t){try{t!==this.host.sortAttribute.index?(this.host.sortAttribute.index=t,this.host.sortAttribute.order="ascending"):"default"===this.host.sortAttribute.order?this.host.sortAttribute.order="ascending":"ascending"===this.host.sortAttribute.order?this.host.sortAttribute.order="descending":this.host.sortAttribute.order="default",this.host.sortAttribute=Object.assign({},this.host.sortAttribute),this.requestUpdate()}catch(t){this.handleError(t,"handleSortOrderChange")}}sort(){try{if(!this.host.rowsCopy.length)return;const t="default"===this.host.sortAttribute.order?0:"ascending"===this.host.sortAttribute.order?1:-1;this.host.rowsCopy.sort((e,i)=>{const n=this.host.headers[this.host.sortAttribute.index].key,o=JSON.stringify(e[n]),s=JSON.stringify(i[n]);return(o<s?-1:o>s?1:0)*t}),this.dispatchEvent(new CustomEvent("onSort",{bubbles:!0,composed:!0,detail:{value:this.host.rowsCopy}})),this.requestUpdate()}catch(t){this.handleError(t,"sort")}}resetSort(){try{this.host.rowsCopy.sort((t,e)=>{const i=this.host.rows.findIndex(e=>JSON.stringify(e)===JSON.stringify(t)),n=this.host.rows.findIndex(t=>JSON.stringify(t)===JSON.stringify(e));return i>n?1:i<n?-1:0}),this.requestUpdate()}catch(t){this.handleError(t,"resetSort")}}isSortActive(){return this.host.sortAttribute.index>-1}isSortDefault(){return"default"===this.host.sortAttribute.order}}
|
|
722
743
|
/**
|
|
723
744
|
* @license
|
|
724
745
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
725
746
|
* SPDX-License-Identifier: MIT
|
|
726
|
-
*/class
|
|
747
|
+
*/class C extends w{handleSearch(t){try{t.trim().length>0?(this.host.activeSearch=!0,this.host.rowsCopy=this.host.rows.filter(e=>Object.values(e).some(e=>JSON.stringify(e).includes(t))),this.dispatchEvent(new CustomEvent("onSearch",{bubbles:!0,composed:!0,detail:{value:this.host.rowsCopy}}))):this.clearSearch(),this.requestUpdate()}catch(t){this.handleError(t,"handleSearch")}}clearSearch(){try{this.host.activeSearch=!1,this.requestUpdate()}catch(t){this.handleError(t,"clearSearch")}}isSearchActive(){return this.host.activeSearch}getFilteredCount(){return this.host.rowsCopy.length}applyColumnFilter(t,e){try{""===e||null==e?this.host.columnFilters.delete(t):this.host.columnFilters.set(t,e),this.filterRows(),this.requestUpdate()}catch(t){this.handleError(t,"applyColumnFilter")}}clearColumnFilter(t){try{this.host.columnFilters.delete(t),this.filterRows(),this.requestUpdate()}catch(t){this.handleError(t,"clearColumnFilter")}}clearAllColumnFilters(){try{this.host.columnFilters.clear(),this.filterRows(),this.requestUpdate()}catch(t){this.handleError(t,"clearAllColumnFilters")}}toggleColumnFilterDropdown(t){try{this.host.activeFilterColumn=this.host.activeFilterColumn===t?null:t,this.requestUpdate()}catch(t){this.handleError(t,"toggleColumnFilterDropdown")}}filterRows(){var t;let e=[...this.host.rows];this.host.columnFilters.size>0&&(e=e.filter(t=>Array.from(this.host.columnFilters.entries()).every(([e,i])=>{const n=t[e];if(null==n)return!1;const o=String(n).toLowerCase(),s=String(i).toLowerCase();return o.includes(s)}))),this.host.activeSearch&&this.host.filterValue&&(e=e.filter(t=>Object.values(t).some(t=>JSON.stringify(t).toLowerCase().includes(this.host.filterValue.toLowerCase())))),this.host.rowsCopy=e,this.host.activeSearch=this.host.columnFilters.size>0||(null===(t=this.host.filterValue)||void 0===t?void 0:t.length)>0}}function S(t,e,i){let n=0;i&&(n+=50);for(let i=0;i<e;i++)if("left"===t[i].fixed){const e=t[i].width;n+="number"==typeof e?e:Number.parseInt(String(e))||150}return n}function z(t){const e=[];return t.fixed&&(e.push("fixed-column"),e.push(`fixed-column-${t.fixed}`)),e.join(" ")}function P(t){const n=t.headers.some(t=>"left"===t.fixed),o=n?"fixed-column fixed-column-left":"";return e`
|
|
727
748
|
<table>
|
|
728
749
|
<thead>
|
|
729
750
|
<tr>
|
|
730
|
-
${t.expandable||t.expansionRenderer||t.selectionMode?e`<th class="${
|
|
751
|
+
${t.expandable||t.expansionRenderer||t.selectionMode?e`<th class="${o}" style="${n?"left: 0; width: 50px; min-width: 50px;":""}">
|
|
731
752
|
${"multiple"===t.selectionMode?e`<nr-checkbox
|
|
732
753
|
id="global-check"
|
|
733
754
|
@nr-change=${t.onCheckAll}
|
|
734
755
|
></nr-checkbox>`:i}
|
|
735
756
|
</th>`:i}
|
|
736
|
-
${
|
|
757
|
+
${l(t.headers,(n,o)=>{const s=z(n),r=t.expandable||t.expansionRenderer||t.selectionMode,a="left"===n.fixed?S(t.headers,o,!!r):void 0,l=n.width?"number"==typeof n.width?`${n.width}px`:n.width:void 0;return e`
|
|
737
758
|
${t.expandable!==n.key?e`<th
|
|
738
|
-
class="${[n.filterable?"filterable":"",
|
|
739
|
-
style="${void 0!==
|
|
759
|
+
class="${[n.filterable?"filterable":"",s].filter(Boolean).join(" ")}"
|
|
760
|
+
style="${void 0!==a?`left: ${a}px;`:""} ${l?`width: ${l}; min-width: ${l};`:""}">
|
|
740
761
|
<div class="th-content">
|
|
741
|
-
<span class="th-text" @click=${()=>t.onUpdateSort(
|
|
762
|
+
<span class="th-text" @click=${()=>t.onUpdateSort(o)}>
|
|
742
763
|
${n.name}
|
|
743
|
-
${
|
|
764
|
+
${o===t.sortAttribute.index?c(t.sortAttribute.order,[["default",()=>e`<nr-icon name="arrow-up-down" size="small"></nr-icon>`],["ascending",()=>e`<nr-icon name="arrow-up" size="small"></nr-icon>`],["descending",()=>e`<nr-icon name="arrow-down" size="small"></nr-icon>`]]):e`<nr-icon name="arrow-up-down" size="small"></nr-icon>`}
|
|
744
765
|
</span>
|
|
745
766
|
${n.filterable&&n.filterConfig?e`
|
|
746
767
|
<div class="filter-wrapper">
|
|
@@ -748,51 +769,51 @@ class f extends c{}
|
|
|
748
769
|
class="filter-trigger"
|
|
749
770
|
@click=${e=>{e.stopPropagation(),t.onToggleColumnFilter(n.key)}}
|
|
750
771
|
>
|
|
751
|
-
${t.activeFilterColumn,n.key,
|
|
752
|
-
<span class="filter-icon ${
|
|
772
|
+
${t.activeFilterColumn,n.key,d=t.columnFilters.has(n.key),e`
|
|
773
|
+
<span class="filter-icon ${d?"has-filter":""}">
|
|
753
774
|
<nr-icon name="filter" size="small"></nr-icon>
|
|
754
|
-
${
|
|
775
|
+
${d?e`<span class="filter-indicator"></span>`:i}
|
|
755
776
|
</span>
|
|
756
777
|
`}
|
|
757
778
|
</button>
|
|
758
|
-
${t.activeFilterColumn===n.key?function(t){const{filterConfig:n,currentValue:
|
|
779
|
+
${t.activeFilterColumn===n.key?function(t){const{filterConfig:n,currentValue:o,onFilterChange:s,onClearFilter:r}=t;return e`
|
|
759
780
|
<div class="column-filter-dropdown">
|
|
760
781
|
<div class="column-filter-content">
|
|
761
782
|
${"select"===n.type?e`
|
|
762
783
|
<nr-select
|
|
763
784
|
.options=${n.options||[]}
|
|
764
|
-
.value=${
|
|
785
|
+
.value=${o||""}
|
|
765
786
|
placeholder=${n.placeholder||"Filter..."}
|
|
766
|
-
@nr-change=${t=>
|
|
787
|
+
@nr-change=${t=>s(t.detail.value)}
|
|
767
788
|
></nr-select>
|
|
768
789
|
`:"number"===n.type?e`
|
|
769
790
|
<input
|
|
770
791
|
type="number"
|
|
771
792
|
class="column-filter-input"
|
|
772
793
|
placeholder=${n.placeholder||"Filter by number..."}
|
|
773
|
-
.value=${
|
|
774
|
-
@input=${t=>
|
|
794
|
+
.value=${o||""}
|
|
795
|
+
@input=${t=>s(t.target.value)}
|
|
775
796
|
/>
|
|
776
797
|
`:"date"===n.type?e`
|
|
777
798
|
<input
|
|
778
799
|
type="date"
|
|
779
800
|
class="column-filter-input"
|
|
780
801
|
placeholder=${n.placeholder||"Filter by date..."}
|
|
781
|
-
.value=${
|
|
782
|
-
@input=${t=>
|
|
802
|
+
.value=${o||""}
|
|
803
|
+
@input=${t=>s(t.target.value)}
|
|
783
804
|
/>
|
|
784
805
|
`:e`
|
|
785
806
|
<input
|
|
786
807
|
type="text"
|
|
787
808
|
class="column-filter-input"
|
|
788
809
|
placeholder=${n.placeholder||"Filter..."}
|
|
789
|
-
.value=${
|
|
790
|
-
@input=${t=>
|
|
810
|
+
.value=${o||""}
|
|
811
|
+
@input=${t=>s(t.target.value)}
|
|
791
812
|
/>
|
|
792
813
|
`}
|
|
793
814
|
|
|
794
|
-
${
|
|
795
|
-
<button class="column-filter-clear" @click=${
|
|
815
|
+
${o?e`
|
|
816
|
+
<button class="column-filter-clear" @click=${r}>
|
|
796
817
|
<nr-icon name="x" size="small"></nr-icon>
|
|
797
818
|
</button>
|
|
798
819
|
`:i}
|
|
@@ -803,7 +824,7 @@ class f extends c{}
|
|
|
803
824
|
`:i}
|
|
804
825
|
</div>
|
|
805
826
|
</th>`:i}
|
|
806
|
-
`;var
|
|
827
|
+
`;var d;
|
|
807
828
|
/**
|
|
808
829
|
* @license
|
|
809
830
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
@@ -860,44 +881,44 @@ class f extends c{}
|
|
|
860
881
|
</div>
|
|
861
882
|
</td>
|
|
862
883
|
</tr>
|
|
863
|
-
`}(t.host):
|
|
864
|
-
<tr class="${t.clickable?"clickable":""}" @click=${()=>{var e;return null===(e=t.onRowClick)||void 0===e?void 0:e.call(t,r
|
|
865
|
-
${!t.expandable&&!t.expansionRenderer||t.selectionMode?t.selectionMode?
|
|
884
|
+
`}(t.host):l(t.rows,(s,r)=>e`
|
|
885
|
+
<tr class="${t.clickable?"clickable":""}" @click=${()=>{var e;return null===(e=t.onRowClick)||void 0===e?void 0:e.call(t,s,r)}}>
|
|
886
|
+
${!t.expandable&&!t.expansionRenderer||t.selectionMode?t.selectionMode?c(t.selectionMode,[["multiple",()=>e`<td class="${o}" style="${n?"left: 0; width: 50px; min-width: 50px;":""}">
|
|
866
887
|
<nr-checkbox
|
|
867
|
-
@nr-change=${e=>t.onCheckOne(e,
|
|
868
|
-
.checked=${t.selectedItems[
|
|
888
|
+
@nr-change=${e=>t.onCheckOne(e,r)}
|
|
889
|
+
.checked=${t.selectedItems[r+(t.currentPage-1)*t.itemPerPage]}
|
|
869
890
|
></nr-checkbox>
|
|
870
|
-
</td>`],["single",()=>e`<td class="${
|
|
891
|
+
</td>`],["single",()=>e`<td class="${o}" style="${n?"left: 0; width: 50px; min-width: 50px;":""}">
|
|
871
892
|
<nr-radio
|
|
872
893
|
name="table-row-selection"
|
|
873
|
-
value="${
|
|
874
|
-
@nr-change=${()=>t.onSelectOne(
|
|
875
|
-
.checked=${t.selectedItems[
|
|
894
|
+
value="${r}"
|
|
895
|
+
@nr-change=${()=>t.onSelectOne(r)}
|
|
896
|
+
.checked=${t.selectedItems[r+(t.currentPage-1)*t.itemPerPage]}
|
|
876
897
|
></nr-radio>
|
|
877
898
|
</td>`]]):i:e`
|
|
878
899
|
<td
|
|
879
|
-
@click=${()=>t.onShowExpandedContent(
|
|
880
|
-
@keydown=${e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.onShowExpandedContent(
|
|
900
|
+
@click=${()=>t.onShowExpandedContent(r)}
|
|
901
|
+
@keydown=${e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.onShowExpandedContent(r))}}
|
|
881
902
|
tabindex="0"
|
|
882
903
|
role="button"
|
|
883
|
-
aria-expanded="${t.expand[
|
|
884
|
-
aria-label="${t.expand[
|
|
885
|
-
class="expand-icon ${t.expand[
|
|
904
|
+
aria-expanded="${t.expand[r]}"
|
|
905
|
+
aria-label="${t.expand[r]?"Collapse row":"Expand row"}"
|
|
906
|
+
class="expand-icon ${t.expand[r]?"expanded":""} ${o}"
|
|
886
907
|
style="${n?"left: 0; width: 50px; min-width: 50px;":""}">
|
|
887
908
|
<nr-icon name="chevron-down" size="small"></nr-icon>
|
|
888
909
|
</td>
|
|
889
910
|
`}
|
|
890
|
-
${
|
|
891
|
-
class="${
|
|
911
|
+
${l(t.headers,(n,o)=>{const a=z(n),l=t.expandable||t.expansionRenderer||t.selectionMode,c="left"===n.fixed?S(t.headers,o,!!l):void 0,d=n.width?"number"==typeof n.width?`${n.width}px`:n.width:void 0,h=s[n.key],p=n.render?n.render(h,s,r):h;return e`${t.expandable!==n.key?e`<td
|
|
912
|
+
class="${a}"
|
|
892
913
|
style="${void 0!==c?`left: ${c}px;`:""} ${d?`width: ${d}; min-width: ${d};`:""}">
|
|
893
914
|
${p}
|
|
894
915
|
</td>`:i}`})}
|
|
895
916
|
</tr>
|
|
896
|
-
${t.expand[
|
|
917
|
+
${t.expand[r]?e`
|
|
897
918
|
<tr class="expansion-row expanded">
|
|
898
919
|
<td colspan=${t.headers.length+(t.expandable||t.expansionRenderer||t.selectionMode?1:0)}>
|
|
899
920
|
<div class="expansion-content">
|
|
900
|
-
${t.expansionRenderer?t.expansionRenderer(r
|
|
921
|
+
${t.expansionRenderer?t.expansionRenderer(s,r):t.expandable?s[t.expandable]:i}
|
|
901
922
|
</div>
|
|
902
923
|
</td>
|
|
903
924
|
</tr>
|
|
@@ -911,7 +932,7 @@ class f extends c{}
|
|
|
911
932
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
912
933
|
* SPDX-License-Identifier: MIT
|
|
913
934
|
*/
|
|
914
|
-
var
|
|
935
|
+
var E=function(t,e,i,n){for(var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};let F=class extends((t=>p(d(f(m(t)))))(n)){constructor(){super(...arguments),this.rows=[],this.size="normal",this.withFilter=!1,this.fixedHeader=!1,this.loading=!1,this.emptyText="No data available",this.serverSide=!1,this.totalCount=0,this.clickable=!1,this.pageSize=5,this.itemPerPage=[5,10,15,20],this.selectedItemPerPage=5,this.displayedRows=[],this.selectedItems=[],this.rowsCopy=[],this.activeSearch=!1,this.sortAttribute={index:-1,order:"default"},this.expand=[],this.showFilterInput=!1,this.filterValue="",this.columnFilters=new Map,this.activeFilterColumn=null,this.requiredComponents=["nr-select","nr-icon","nr-checkbox","nr-radio"],this.selectionController=new y(this),this.paginationController=new $(this),this.sortController=new k(this),this.filterController=new C(this)}connectedCallback(){super.connectedCallback(),this.selectionController.initSelection(),this.pageSize&&this.itemPerPage.includes(this.pageSize)&&(this.selectedItemPerPage=this.pageSize)}updated(t){var e,i;if(this.globalCheck&&(t.has("selectedItems")||t.has("currentPage")||t.has("displayedRows"))){const t=this.globalCheck,e=(this.currentPage-1)*this.selectedItemPerPage,i=Math.min(e+this.displayedRows.length,this.selectedItems.length),n=this.selectedItems.slice(e,i);n.length>0&&n.every(t=>t)?(t.checked=!0,t.indeterminate=!1):n.some(t=>t)?(t.checked=!1,t.indeterminate=!0):(t.checked=!1,t.indeterminate=!1)}this.showFilterInput&&t.has("showFilterInput")&&(null===(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("input"))||void 0===i||i.focus())}willUpdate(t){t.has("rows")&&(this.expand=new Array(this.rows.length).fill(!1)),this.serverSide?t.has("rows")&&(this.displayedRows=[...this.rows],!this.currentPage&&this.rows.length>0&&(this.currentPage=1)):(t.has("sortAttribute")&&this.sortController.isSortActive()&&(this._initPagination(),this.selectionController.initSelection()),t.has("rowsCopy")&&this.filterController.isSearchActive()&&this._initPagination(),(t.has("activeSearch")||t.has("rows"))&&(this.filterController.isSearchActive()||(this.rowsCopy=[...this.rows],this._initPagination())))}_initPagination(){this.sortController.isSortActive()&&(this.sortController.isSortDefault()?this.sortController.resetSort():this.sortController.sort()),this.paginationController.initPagination()}_handleItemPerPage(t){const e=t.detail.value||t.detail.selectedItemPerPage;this.paginationController.handleItemPerPageChange(Number(e))}_handleUpdatePage(t){this.paginationController.handlePageChange(t.detail.page)}_handleCheckAll(t){this.selectionController.handleCheckAll(t.detail.isEveryItemChecked)}_handleCheckOne(t){this.selectionController.handleCheckOne(t.detail.index,t.detail.value)}_handleSelectOne(t){this.selectionController.handleSelectOne(t.detail.index)}_handleCancelSelection(){this.selectionController.cancelSelection()}_handleSearch(t){this.filterController.handleSearch(t.detail.value)}_handleSortOrder(t){this.sortController.handleSortOrderChange(t.detail.index)}_showExpandedContent(t){this.expand[t]=!this.expand[t],this.requestUpdate()}_toggleFilterInput(){this.showFilterInput=!this.showFilterInput}_handleFilterInputChange(t){this.filterValue=t.target.value,this.filterController.handleSearch(this.filterValue)}render(){var t,n;const o=this.serverSide?this.totalCount:this.rowsCopy.length,s=Math.ceil(o/this.selectedItemPerPage),r=this.currentPage>0?this.currentPage*this.selectedItemPerPage-this.selectedItemPerPage+1:0,a=this.currentPage*this.selectedItemPerPage<=o?this.currentPage*this.selectedItemPerPage:o,l=a<o,c=r>1;return e`
|
|
915
936
|
${this.selectionMode&&!this.withFilter&&this.selectionController.hasSelection()?(d={selectedItems:this.selectionController.getSelectedCount(),size:this.size,onCancelSelection:()=>this._handleCancelSelection()},e`
|
|
916
937
|
<div class="actions-container" data-size="${d.size}">
|
|
917
938
|
<span>${d.selectedItems} selected</span>
|
|
@@ -942,7 +963,7 @@ var w=function(t,e,i,n){for(var a,r=arguments.length,o=r<3?e:null===n?n=Object.g
|
|
|
942
963
|
<div class="table-content-wrapper ${this.fixedHeader?"fixed-header":""}"
|
|
943
964
|
style="${(null===(t=this.scrollConfig)||void 0===t?void 0:t.y)?`${this.fixedHeader?"height":"max-height"}: ${"number"==typeof this.scrollConfig.y?this.scrollConfig.y+"px":this.scrollConfig.y};`:""}
|
|
944
965
|
${(null===(n=this.scrollConfig)||void 0===n?void 0:n.x)?`${this.fixedHeader?"width":"max-width"}: ${"number"==typeof this.scrollConfig.x?this.scrollConfig.x+"px":this.scrollConfig.x};`:""}">
|
|
945
|
-
${
|
|
966
|
+
${P({headers:this.headers,rows:this.displayedRows,expandable:this.expandable&&!this.selectionMode?this.expandable:void 0,expansionRenderer:this.selectionMode?void 0:this.expansionRenderer,selectionMode:this.selectionMode&&!this.withFilter?this.selectionMode:void 0,selectedItems:this.selectedItems,currentPage:this.currentPage,itemPerPage:this.selectedItemPerPage,sortAttribute:this.sortAttribute,expand:this.expand,columnFilters:this.columnFilters,activeFilterColumn:this.activeFilterColumn,loading:this.loading,host:this,clickable:this.clickable,onCheckAll:()=>{const t=(this.currentPage-1)*this.selectedItemPerPage,e=Math.min(t+this.selectedItemPerPage,this.selectedItems.length),i=this.selectedItems.slice(t,e),n=i.every(t=>t)&&i.length>0;this._handleCheckAll({detail:{isEveryItemChecked:n}})},onCheckOne:(t,e)=>this._handleCheckOne({detail:{index:e,value:t.detail.checked}}),onSelectOne:t=>this._handleSelectOne({detail:{index:t}}),onUpdateSort:t=>this._handleSortOrder({detail:{index:t}}),onShowExpandedContent:t=>this._showExpandedContent(t),onToggleColumnFilter:t=>this.filterController.toggleColumnFilterDropdown(t),onApplyColumnFilter:(t,e)=>this.filterController.applyColumnFilter(t,e),onClearColumnFilter:t=>this.filterController.clearColumnFilter(t),onRowClick:(t,e)=>{this.clickable&&this.dispatchEvent(new CustomEvent("nr-row-click",{detail:{row:t,index:e},bubbles:!0,composed:!0}))}})}
|
|
946
967
|
</div>
|
|
947
968
|
|
|
948
969
|
${function(t){const n=t.itemPerPage.map(t=>({label:String(t),value:String(t)}));return e`
|
|
@@ -983,5 +1004,5 @@ var w=function(t,e,i,n){for(var a,r=arguments.length,o=r<3?e:null===n?n=Object.g
|
|
|
983
1004
|
</span>
|
|
984
1005
|
</div>
|
|
985
1006
|
</div>
|
|
986
|
-
`}({numberOfItems:
|
|
987
|
-
`;var d}};
|
|
1007
|
+
`}({numberOfItems:o,itemPerPage:this.itemPerPage,selectedItemPerPage:this.selectedItemPerPage,currentPage:this.currentPage,size:this.size,numberOfPages:s,fromItem:r,toItem:a,enableNext:l,enablePrevious:c,onItemPerPageChange:t=>this._handleItemPerPage(t),onNextPage:()=>{this.currentPage++,this._handleUpdatePage({detail:{page:this.currentPage}})},onPreviousPage:()=>{this.currentPage--,this._handleUpdatePage({detail:{page:this.currentPage}})}})}
|
|
1008
|
+
`;var d}};F.useShadowDom=!0,F.styles=b,E([o({type:Array})],F.prototype,"headers",void 0),E([o({type:Array})],F.prototype,"rows",void 0),E([o({type:String})],F.prototype,"size",void 0),E([o({type:Boolean})],F.prototype,"withFilter",void 0),E([o({type:String})],F.prototype,"expandable",void 0),E([o({attribute:!1})],F.prototype,"expansionRenderer",void 0),E([o({type:String})],F.prototype,"selectionMode",void 0),E([o({type:Boolean})],F.prototype,"fixedHeader",void 0),E([o({type:Object})],F.prototype,"scrollConfig",void 0),E([o({type:Boolean})],F.prototype,"loading",void 0),E([o({type:String})],F.prototype,"emptyText",void 0),E([o({type:String})],F.prototype,"emptyIcon",void 0),E([o({type:Boolean})],F.prototype,"serverSide",void 0),E([o({type:Number})],F.prototype,"totalCount",void 0),E([o({type:Boolean})],F.prototype,"clickable",void 0),E([o({type:Number})],F.prototype,"pageSize",void 0),E([s()],F.prototype,"itemPerPage",void 0),E([s()],F.prototype,"selectedItemPerPage",void 0),E([s()],F.prototype,"displayedRows",void 0),E([s()],F.prototype,"selectedItems",void 0),E([s()],F.prototype,"currentPage",void 0),E([s()],F.prototype,"rowsCopy",void 0),E([s()],F.prototype,"activeSearch",void 0),E([s()],F.prototype,"sortAttribute",void 0),E([s()],F.prototype,"expand",void 0),E([s()],F.prototype,"showFilterInput",void 0),E([s()],F.prototype,"filterValue",void 0),E([s()],F.prototype,"columnFilters",void 0),E([s()],F.prototype,"activeFilterColumn",void 0),E([r("#global-check")],F.prototype,"globalCheck",void 0),F=E([a("nr-table")],F);export{F as HyTable};
|