snice 2.1.4 → 2.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/dist/components/accordion/snice-accordion-item.d.ts +25 -0
- package/dist/components/accordion/snice-accordion-item.js +255 -0
- package/dist/components/accordion/snice-accordion-item.js.map +1 -0
- package/dist/components/accordion/snice-accordion.d.ts +28 -0
- package/dist/components/accordion/snice-accordion.js +206 -0
- package/dist/components/accordion/snice-accordion.js.map +1 -0
- package/dist/components/accordion/snice-accordion.types.d.ts +29 -0
- package/dist/components/alert/snice-alert.d.ts +26 -0
- package/dist/components/alert/snice-alert.js +180 -0
- package/dist/components/alert/snice-alert.js.map +1 -0
- package/{components/alert/snice-alert.types.ts → dist/components/alert/snice-alert.types.d.ts} +8 -9
- package/dist/components/avatar/snice-avatar.d.ts +24 -0
- package/dist/components/avatar/snice-avatar.js +180 -0
- package/dist/components/avatar/snice-avatar.js.map +1 -0
- package/dist/components/avatar/snice-avatar.types.d.ts +12 -0
- package/dist/components/badge/snice-badge.d.ts +25 -0
- package/dist/components/badge/snice-badge.js +169 -0
- package/dist/components/badge/snice-badge.js.map +1 -0
- package/{components/badge/snice-badge.types.ts → dist/components/badge/snice-badge.types.d.ts} +11 -12
- package/dist/components/breadcrumbs/snice-breadcrumbs.d.ts +27 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +214 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.types.d.ts +23 -0
- package/dist/components/breadcrumbs/snice-crumb.d.ts +9 -0
- package/dist/components/breadcrumbs/snice-crumb.js +63 -0
- package/dist/components/breadcrumbs/snice-crumb.js.map +1 -0
- package/dist/components/button/snice-button.d.ts +32 -0
- package/dist/components/button/snice-button.js +232 -0
- package/dist/components/button/snice-button.js.map +1 -0
- package/dist/components/button/snice-button.types.d.ts +23 -0
- package/dist/components/card/snice-card.d.ts +19 -0
- package/dist/components/card/snice-card.js +136 -0
- package/dist/components/card/snice-card.js.map +1 -0
- package/{components/card/snice-card.types.ts → dist/components/card/snice-card.types.d.ts} +6 -7
- package/dist/components/checkbox/snice-checkbox.d.ts +34 -0
- package/dist/components/checkbox/snice-checkbox.js +286 -0
- package/dist/components/checkbox/snice-checkbox.js.map +1 -0
- package/dist/components/checkbox/snice-checkbox.types.d.ts +20 -0
- package/dist/components/chip/snice-chip.d.ts +28 -0
- package/dist/components/chip/snice-chip.js +199 -0
- package/dist/components/chip/snice-chip.js.map +1 -0
- package/dist/components/chip/snice-chip.types.d.ts +14 -0
- package/dist/components/date-picker/snice-date-picker.d.ts +82 -0
- package/dist/components/date-picker/snice-date-picker.js +847 -0
- package/dist/components/date-picker/snice-date-picker.js.map +1 -0
- package/dist/components/date-picker/snice-date-picker.types.d.ts +71 -0
- package/dist/components/divider/snice-divider.d.ts +17 -0
- package/dist/components/divider/snice-divider.js +122 -0
- package/dist/components/divider/snice-divider.js.map +1 -0
- package/{components/divider/snice-divider.types.ts → dist/components/divider/snice-divider.types.d.ts} +9 -10
- package/dist/components/drawer/snice-drawer.d.ts +37 -0
- package/dist/components/drawer/snice-drawer.js +337 -0
- package/dist/components/drawer/snice-drawer.js.map +1 -0
- package/dist/components/drawer/snice-drawer.types.d.ts +16 -0
- package/dist/components/input/snice-input.d.ts +65 -0
- package/dist/components/input/snice-input.js +567 -0
- package/dist/components/input/snice-input.js.map +1 -0
- package/dist/components/input/snice-input.types.d.ts +53 -0
- package/dist/components/layout/snice-layout-blog.d.ts +4 -0
- package/dist/components/layout/snice-layout-blog.js +67 -0
- package/dist/components/layout/snice-layout-blog.js.map +1 -0
- package/dist/components/layout/snice-layout-card.d.ts +6 -0
- package/dist/components/layout/snice-layout-card.js +64 -0
- package/dist/components/layout/snice-layout-card.js.map +1 -0
- package/dist/components/layout/snice-layout-centered.d.ts +5 -0
- package/dist/components/layout/snice-layout-centered.js +48 -0
- package/dist/components/layout/snice-layout-centered.js.map +1 -0
- package/dist/components/layout/snice-layout-dashboard.d.ts +4 -0
- package/dist/components/layout/snice-layout-dashboard.js +64 -0
- package/dist/components/layout/snice-layout-dashboard.js.map +1 -0
- package/dist/components/layout/snice-layout-fullscreen.d.ts +5 -0
- package/dist/components/layout/snice-layout-fullscreen.js +60 -0
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -0
- package/dist/components/layout/snice-layout-landing.d.ts +4 -0
- package/dist/components/layout/snice-layout-landing.js +66 -0
- package/dist/components/layout/snice-layout-landing.js.map +1 -0
- package/dist/components/layout/snice-layout-minimal.d.ts +4 -0
- package/dist/components/layout/snice-layout-minimal.js +38 -0
- package/dist/components/layout/snice-layout-minimal.js.map +1 -0
- package/dist/components/layout/snice-layout-sidebar.d.ts +5 -0
- package/dist/components/layout/snice-layout-sidebar.js +74 -0
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -0
- package/dist/components/layout/snice-layout-split.d.ts +6 -0
- package/dist/components/layout/snice-layout-split.js +58 -0
- package/dist/components/layout/snice-layout-split.js.map +1 -0
- package/dist/components/layout/snice-layout.d.ts +4 -0
- package/dist/components/layout/snice-layout.js +54 -0
- package/dist/components/layout/snice-layout.js.map +1 -0
- package/{components/layout/snice-layout.types.ts → dist/components/layout/snice-layout.types.d.ts} +1 -3
- package/dist/components/login/snice-login.d.ts +44 -0
- package/dist/components/login/snice-login.js +382 -0
- package/dist/components/login/snice-login.js.map +1 -0
- package/dist/components/login/snice-login.types.d.ts +26 -0
- package/dist/components/modal/snice-modal.d.ts +32 -0
- package/dist/components/modal/snice-modal.js +280 -0
- package/dist/components/modal/snice-modal.js.map +1 -0
- package/dist/components/modal/snice-modal.types.d.ts +18 -0
- package/dist/components/pagination/snice-pagination.d.ts +26 -0
- package/dist/components/pagination/snice-pagination.js +373 -0
- package/dist/components/pagination/snice-pagination.js.map +1 -0
- package/dist/components/pagination/snice-pagination.types.d.ts +18 -0
- package/dist/components/progress/snice-progress.d.ts +35 -0
- package/dist/components/progress/snice-progress.js +305 -0
- package/dist/components/progress/snice-progress.js.map +1 -0
- package/dist/components/progress/snice-progress.types.d.ts +18 -0
- package/dist/components/radio/snice-radio.d.ts +33 -0
- package/dist/components/radio/snice-radio.js +279 -0
- package/dist/components/radio/snice-radio.js.map +1 -0
- package/dist/components/radio/snice-radio.types.d.ts +19 -0
- package/dist/components/select/snice-option.d.ts +17 -0
- package/dist/components/select/snice-option.js +88 -0
- package/dist/components/select/snice-option.js.map +1 -0
- package/{components/select/snice-option.types.ts → dist/components/select/snice-option.types.d.ts} +8 -8
- package/dist/components/select/snice-select.d.ts +89 -0
- package/dist/components/select/snice-select.js +864 -0
- package/dist/components/select/snice-select.js.map +1 -0
- package/dist/components/select/snice-select.types.d.ts +49 -0
- package/dist/components/skeleton/snice-skeleton.d.ts +16 -0
- package/dist/components/skeleton/snice-skeleton.js +166 -0
- package/dist/components/skeleton/snice-skeleton.js.map +1 -0
- package/{components/skeleton/snice-skeleton.types.ts → dist/components/skeleton/snice-skeleton.types.d.ts} +7 -8
- package/dist/components/snice-cell-C8aBfN72.js +4 -0
- package/dist/components/snice-cell-C8aBfN72.js.map +1 -0
- package/dist/components/switch/snice-switch.d.ts +38 -0
- package/dist/components/switch/snice-switch.js +305 -0
- package/dist/components/switch/snice-switch.js.map +1 -0
- package/dist/components/switch/snice-switch.types.d.ts +21 -0
- package/dist/components/symbols.d.ts +1 -0
- package/dist/components/symbols.js +22 -0
- package/dist/components/symbols.js.map +1 -0
- package/dist/components/table/snice-cell-boolean.d.ts +21 -0
- package/dist/components/table/snice-cell-boolean.js +164 -0
- package/dist/components/table/snice-cell-boolean.js.map +1 -0
- package/dist/components/table/snice-cell-date.d.ts +24 -0
- package/dist/components/table/snice-cell-date.js +253 -0
- package/dist/components/table/snice-cell-date.js.map +1 -0
- package/dist/components/table/snice-cell-duration.d.ts +16 -0
- package/dist/components/table/snice-cell-duration.js +130 -0
- package/dist/components/table/snice-cell-duration.js.map +1 -0
- package/dist/components/table/snice-cell-filesize.d.ts +16 -0
- package/dist/components/table/snice-cell-filesize.js +126 -0
- package/dist/components/table/snice-cell-filesize.js.map +1 -0
- package/dist/components/table/snice-cell-number.d.ts +23 -0
- package/dist/components/table/snice-cell-number.js +215 -0
- package/dist/components/table/snice-cell-number.js.map +1 -0
- package/dist/components/table/snice-cell-progress.d.ts +17 -0
- package/dist/components/table/snice-cell-progress.js +121 -0
- package/dist/components/table/snice-cell-progress.js.map +1 -0
- package/dist/components/table/snice-cell-rating.d.ts +17 -0
- package/dist/components/table/snice-cell-rating.js +120 -0
- package/dist/components/table/snice-cell-rating.js.map +1 -0
- package/dist/components/table/snice-cell-sparkline.d.ts +29 -0
- package/dist/components/table/snice-cell-sparkline.js +306 -0
- package/dist/components/table/snice-cell-sparkline.js.map +1 -0
- package/dist/components/table/snice-cell-text.d.ts +19 -0
- package/dist/components/table/snice-cell-text.js +161 -0
- package/dist/components/table/snice-cell-text.js.map +1 -0
- package/dist/components/table/snice-cell.d.ts +32 -0
- package/dist/components/table/snice-cell.js +458 -0
- package/dist/components/table/snice-cell.js.map +1 -0
- package/dist/components/table/snice-column.d.ts +62 -0
- package/dist/components/table/snice-column.js +506 -0
- package/dist/components/table/snice-column.js.map +1 -0
- package/dist/components/table/snice-header.d.ts +33 -0
- package/dist/components/table/snice-header.js +289 -0
- package/dist/components/table/snice-header.js.map +1 -0
- package/dist/components/table/snice-progress.d.ts +10 -0
- package/dist/components/table/snice-progress.js +105 -0
- package/dist/components/table/snice-progress.js.map +1 -0
- package/dist/components/table/snice-rating.d.ts +9 -0
- package/dist/components/table/snice-rating.js +81 -0
- package/dist/components/table/snice-rating.js.map +1 -0
- package/dist/components/table/snice-row.d.ts +43 -0
- package/dist/components/table/snice-row.js +353 -0
- package/dist/components/table/snice-row.js.map +1 -0
- package/dist/components/table/snice-table.d.ts +69 -0
- package/dist/components/table/snice-table.js +792 -0
- package/dist/components/table/snice-table.js.map +1 -0
- package/dist/components/table/snice-table.types.d.ts +137 -0
- package/dist/components/tabs/snice-tab-panel.d.ts +12 -0
- package/dist/components/tabs/snice-tab-panel.js +87 -0
- package/dist/components/tabs/snice-tab-panel.js.map +1 -0
- package/dist/components/tabs/snice-tab.d.ts +13 -0
- package/dist/components/tabs/snice-tab.js +98 -0
- package/dist/components/tabs/snice-tab.js.map +1 -0
- package/dist/components/tabs/snice-tabs.d.ts +34 -0
- package/dist/components/tabs/snice-tabs.js +375 -0
- package/dist/components/tabs/snice-tabs.js.map +1 -0
- package/dist/components/tabs/snice-tabs.types.d.ts +23 -0
- package/dist/components/toast/snice-toast-container.d.ts +25 -0
- package/dist/components/toast/snice-toast-container.js +252 -0
- package/dist/components/toast/snice-toast-container.js.map +1 -0
- package/dist/components/toast/snice-toast.d.ts +23 -0
- package/dist/components/toast/snice-toast.js +321 -0
- package/dist/components/toast/snice-toast.js.map +1 -0
- package/dist/components/toast/snice-toast.types.d.ts +30 -0
- package/dist/components/tooltip/snice-tooltip.d.ts +50 -0
- package/dist/components/tooltip/snice-tooltip.js +644 -0
- package/dist/components/tooltip/snice-tooltip.js.map +1 -0
- package/dist/components/tooltip/snice-tooltip.types.d.ts +18 -0
- package/dist/components/transitions.d.ts +11 -0
- package/dist/components/transitions.js +72 -0
- package/dist/components/transitions.js.map +1 -0
- package/dist/index.cjs +16 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.cjs.min.map +1 -1
- package/dist/index.esm.js +16 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +3 -3
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +16 -20
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +3 -3
- package/dist/index.iife.min.js.map +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.esm.js +1 -1
- package/package.json +10 -6
- package/components/accordion/demo.html +0 -403
- package/components/accordion/snice-accordion-item.css +0 -85
- package/components/accordion/snice-accordion-item.ts +0 -226
- package/components/accordion/snice-accordion.css +0 -31
- package/components/accordion/snice-accordion.ts +0 -182
- package/components/accordion/snice-accordion.types.ts +0 -32
- package/components/alert/demo.html +0 -445
- package/components/alert/snice-alert.css +0 -195
- package/components/alert/snice-alert.ts +0 -141
- package/components/avatar/demo.html +0 -598
- package/components/avatar/snice-avatar.css +0 -131
- package/components/avatar/snice-avatar.ts +0 -136
- package/components/avatar/snice-avatar.types.ts +0 -13
- package/components/badge/demo.html +0 -523
- package/components/badge/snice-badge.css +0 -161
- package/components/badge/snice-badge.ts +0 -117
- package/components/breadcrumbs/demo.html +0 -404
- package/components/breadcrumbs/snice-breadcrumbs.css +0 -133
- package/components/breadcrumbs/snice-breadcrumbs.ts +0 -191
- package/components/breadcrumbs/snice-breadcrumbs.types.ts +0 -26
- package/components/breadcrumbs/snice-crumb.ts +0 -26
- package/components/button/demo.html +0 -42
- package/components/button/snice-button.css +0 -230
- package/components/button/snice-button.ts +0 -169
- package/components/button/snice-button.types.ts +0 -25
- package/components/card/demo.html +0 -525
- package/components/card/snice-card.css +0 -140
- package/components/card/snice-card.ts +0 -102
- package/components/checkbox/demo.html +0 -253
- package/components/checkbox/snice-checkbox.css +0 -164
- package/components/checkbox/snice-checkbox.ts +0 -223
- package/components/checkbox/snice-checkbox.types.ts +0 -22
- package/components/chip/demo.html +0 -383
- package/components/chip/snice-chip.css +0 -195
- package/components/chip/snice-chip.ts +0 -139
- package/components/chip/snice-chip.types.ts +0 -15
- package/components/date-picker/README.md +0 -233
- package/components/date-picker/demo.html +0 -191
- package/components/date-picker/snice-date-picker.css +0 -330
- package/components/date-picker/snice-date-picker.ts +0 -777
- package/components/date-picker/snice-date-picker.types.ts +0 -83
- package/components/divider/demo.html +0 -233
- package/components/divider/snice-divider.css +0 -155
- package/components/divider/snice-divider.ts +0 -69
- package/components/drawer/demo.html +0 -328
- package/components/drawer/snice-drawer.css +0 -476
- package/components/drawer/snice-drawer.ts +0 -287
- package/components/drawer/snice-drawer.types.ts +0 -17
- package/components/global.d.ts +0 -14
- package/components/input/demo.html +0 -303
- package/components/input/snice-input.css +0 -257
- package/components/input/snice-input.ts +0 -442
- package/components/input/snice-input.types.ts +0 -59
- package/components/input/test.html +0 -77
- package/components/layout/README.md +0 -260
- package/components/layout/demo.html +0 -538
- package/components/layout/snice-layout-blog.css +0 -129
- package/components/layout/snice-layout-blog.ts +0 -48
- package/components/layout/snice-layout-card.css +0 -104
- package/components/layout/snice-layout-card.ts +0 -35
- package/components/layout/snice-layout-centered.css +0 -51
- package/components/layout/snice-layout-centered.ts +0 -22
- package/components/layout/snice-layout-dashboard.css +0 -98
- package/components/layout/snice-layout-dashboard.ts +0 -45
- package/components/layout/snice-layout-fullscreen.css +0 -72
- package/components/layout/snice-layout-fullscreen.ts +0 -34
- package/components/layout/snice-layout-landing.css +0 -92
- package/components/layout/snice-layout-landing.ts +0 -47
- package/components/layout/snice-layout-minimal.css +0 -16
- package/components/layout/snice-layout-minimal.ts +0 -19
- package/components/layout/snice-layout-sidebar.css +0 -117
- package/components/layout/snice-layout-sidebar.ts +0 -48
- package/components/layout/snice-layout-split.css +0 -103
- package/components/layout/snice-layout-split.ts +0 -29
- package/components/layout/snice-layout.css +0 -72
- package/components/layout/snice-layout.ts +0 -35
- package/components/login/demo-auth-controller.ts +0 -185
- package/components/login/demo.html +0 -470
- package/components/login/snice-login.css +0 -204
- package/components/login/snice-login.ts +0 -326
- package/components/login/snice-login.types.ts +0 -29
- package/components/modal/demo.html +0 -291
- package/components/modal/snice-modal.css +0 -203
- package/components/modal/snice-modal.ts +0 -233
- package/components/modal/snice-modal.types.ts +0 -21
- package/components/pagination/demo.html +0 -395
- package/components/pagination/snice-pagination.ts +0 -333
- package/components/pagination/snice-pagination.types.ts +0 -21
- package/components/progress/demo.html +0 -510
- package/components/progress/snice-progress.css +0 -267
- package/components/progress/snice-progress.ts +0 -247
- package/components/progress/snice-progress.types.ts +0 -19
- package/components/radio/demo.html +0 -287
- package/components/radio/snice-radio.css +0 -171
- package/components/radio/snice-radio.ts +0 -218
- package/components/radio/snice-radio.types.ts +0 -21
- package/components/select/demo.html +0 -511
- package/components/select/snice-option.ts +0 -52
- package/components/select/snice-select.css +0 -392
- package/components/select/snice-select.ts +0 -796
- package/components/select/snice-select.types.ts +0 -55
- package/components/skeleton/demo.html +0 -514
- package/components/skeleton/snice-skeleton.css +0 -109
- package/components/skeleton/snice-skeleton.ts +0 -126
- package/components/switch/demo.html +0 -284
- package/components/switch/snice-switch.css +0 -221
- package/components/switch/snice-switch.ts +0 -229
- package/components/switch/snice-switch.types.ts +0 -23
- package/components/symbols.ts +0 -23
- package/components/table/demo-table-controller.ts +0 -100
- package/components/table/demo.html +0 -480
- package/components/table/snice-cell-boolean.ts +0 -112
- package/components/table/snice-cell-date.ts +0 -210
- package/components/table/snice-cell-duration.ts +0 -91
- package/components/table/snice-cell-filesize.ts +0 -90
- package/components/table/snice-cell-number.ts +0 -165
- package/components/table/snice-cell-progress.ts +0 -83
- package/components/table/snice-cell-rating.ts +0 -82
- package/components/table/snice-cell-sparkline.ts +0 -253
- package/components/table/snice-cell-text.ts +0 -125
- package/components/table/snice-cell.css +0 -296
- package/components/table/snice-cell.ts +0 -473
- package/components/table/snice-column.ts +0 -353
- package/components/table/snice-header.css +0 -243
- package/components/table/snice-header.ts +0 -261
- package/components/table/snice-progress.ts +0 -66
- package/components/table/snice-rating.ts +0 -45
- package/components/table/snice-row.css +0 -255
- package/components/table/snice-row.ts +0 -331
- package/components/table/snice-table.css +0 -241
- package/components/table/snice-table.ts +0 -737
- package/components/table/snice-table.types.ts +0 -158
- package/components/tabs/demo.html +0 -487
- package/components/tabs/snice-tab-panel.css +0 -264
- package/components/tabs/snice-tab-panel.ts +0 -47
- package/components/tabs/snice-tab.css +0 -96
- package/components/tabs/snice-tab.ts +0 -65
- package/components/tabs/snice-tabs.css +0 -189
- package/components/tabs/snice-tabs.ts +0 -332
- package/components/tabs/snice-tabs.types.ts +0 -28
- package/components/theme/theme.css +0 -234
- package/components/toast/demo.html +0 -329
- package/components/toast/snice-toast-container.ts +0 -256
- package/components/toast/snice-toast.css +0 -213
- package/components/toast/snice-toast.ts +0 -276
- package/components/toast/snice-toast.types.ts +0 -35
- package/components/tooltip/demo.html +0 -350
- package/components/tooltip/snice-tooltip-portal.css +0 -79
- package/components/tooltip/snice-tooltip.css +0 -117
- package/components/tooltip/snice-tooltip.ts +0 -612
- package/components/tooltip/snice-tooltip.types.ts +0 -32
- package/components/transitions.ts +0 -94
- package/components/tsconfig.json +0 -18
|
@@ -0,0 +1,792 @@
|
|
|
1
|
+
import { __runInitializers, __esDecorate } from 'tslib';
|
|
2
|
+
import { element, property, query, request, watch, on, dispatch } from 'snice';
|
|
3
|
+
import '../input/snice-input.js';
|
|
4
|
+
import '../select/snice-select.js';
|
|
5
|
+
import './snice-cell.js';
|
|
6
|
+
import './snice-cell-text.js';
|
|
7
|
+
import './snice-cell-number.js';
|
|
8
|
+
import './snice-cell-date.js';
|
|
9
|
+
import './snice-cell-boolean.js';
|
|
10
|
+
import './snice-cell-rating.js';
|
|
11
|
+
import './snice-cell-progress.js';
|
|
12
|
+
import './snice-cell-duration.js';
|
|
13
|
+
import './snice-cell-filesize.js';
|
|
14
|
+
import './snice-cell-sparkline.js';
|
|
15
|
+
import '../select/snice-option.js';
|
|
16
|
+
import '../snice-cell-C8aBfN72.js';
|
|
17
|
+
import './snice-rating.js';
|
|
18
|
+
import './snice-progress.js';
|
|
19
|
+
|
|
20
|
+
let SniceTable = (() => {
|
|
21
|
+
let _classDecorators = [element('snice-table')];
|
|
22
|
+
let _classDescriptor;
|
|
23
|
+
let _classExtraInitializers = [];
|
|
24
|
+
let _classThis;
|
|
25
|
+
let _classSuper = HTMLElement;
|
|
26
|
+
let _instanceExtraInitializers = [];
|
|
27
|
+
let _striped_decorators;
|
|
28
|
+
let _striped_initializers = [];
|
|
29
|
+
let _striped_extraInitializers = [];
|
|
30
|
+
let _searchable_decorators;
|
|
31
|
+
let _searchable_initializers = [];
|
|
32
|
+
let _searchable_extraInitializers = [];
|
|
33
|
+
let _sortable_decorators;
|
|
34
|
+
let _sortable_initializers = [];
|
|
35
|
+
let _sortable_extraInitializers = [];
|
|
36
|
+
let _selectable_decorators;
|
|
37
|
+
let _selectable_initializers = [];
|
|
38
|
+
let _selectable_extraInitializers = [];
|
|
39
|
+
let _hoverable_decorators;
|
|
40
|
+
let _hoverable_initializers = [];
|
|
41
|
+
let _hoverable_extraInitializers = [];
|
|
42
|
+
let _clickable_decorators;
|
|
43
|
+
let _clickable_initializers = [];
|
|
44
|
+
let _clickable_extraInitializers = [];
|
|
45
|
+
let _columns_decorators;
|
|
46
|
+
let _columns_initializers = [];
|
|
47
|
+
let _columns_extraInitializers = [];
|
|
48
|
+
let _data_decorators;
|
|
49
|
+
let _data_initializers = [];
|
|
50
|
+
let _data_extraInitializers = [];
|
|
51
|
+
let _currentSort_decorators;
|
|
52
|
+
let _currentSort_initializers = [];
|
|
53
|
+
let _currentSort_extraInitializers = [];
|
|
54
|
+
let _searchText_decorators;
|
|
55
|
+
let _searchText_initializers = [];
|
|
56
|
+
let _searchText_extraInitializers = [];
|
|
57
|
+
let _selector_decorators;
|
|
58
|
+
let _selector_initializers = [];
|
|
59
|
+
let _selector_extraInitializers = [];
|
|
60
|
+
let _selectorOptions_decorators;
|
|
61
|
+
let _selectorOptions_initializers = [];
|
|
62
|
+
let _selectorOptions_extraInitializers = [];
|
|
63
|
+
let _loading_decorators;
|
|
64
|
+
let _loading_initializers = [];
|
|
65
|
+
let _loading_extraInitializers = [];
|
|
66
|
+
let _selectedRows_decorators;
|
|
67
|
+
let _selectedRows_initializers = [];
|
|
68
|
+
let _selectedRows_extraInitializers = [];
|
|
69
|
+
let _table_decorators;
|
|
70
|
+
let _table_initializers = [];
|
|
71
|
+
let _table_extraInitializers = [];
|
|
72
|
+
let _thead_decorators;
|
|
73
|
+
let _thead_initializers = [];
|
|
74
|
+
let _thead_extraInitializers = [];
|
|
75
|
+
let _tbody_decorators;
|
|
76
|
+
let _tbody_initializers = [];
|
|
77
|
+
let _tbody_extraInitializers = [];
|
|
78
|
+
let _getTableConfig_decorators;
|
|
79
|
+
let _getTableData_decorators;
|
|
80
|
+
let _handleSelectorOptionsChange_decorators;
|
|
81
|
+
let _handleSortableChange_decorators;
|
|
82
|
+
let _handleSelectableChange_decorators;
|
|
83
|
+
let _handleColumnsChange_decorators;
|
|
84
|
+
let _handleDataChange_decorators;
|
|
85
|
+
let _handleSelectedRowsChange_decorators;
|
|
86
|
+
let _handleSortChange_decorators;
|
|
87
|
+
let _handleSort_decorators;
|
|
88
|
+
let _handleRowSelect_decorators;
|
|
89
|
+
let _handleSelectAll_decorators;
|
|
90
|
+
let _handleRowClick_decorators;
|
|
91
|
+
let _onAttached_decorators;
|
|
92
|
+
let _handleSearchChange_decorators;
|
|
93
|
+
let _handleSelectorChange_decorators;
|
|
94
|
+
let _dispatchRowSelectionChanged_decorators;
|
|
95
|
+
let _dispatchSelectAllChanged_decorators;
|
|
96
|
+
(class extends _classSuper {
|
|
97
|
+
static { _classThis = this; }
|
|
98
|
+
constructor() {
|
|
99
|
+
super(...arguments);
|
|
100
|
+
this.striped = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _striped_initializers, false));
|
|
101
|
+
this.searchable = (__runInitializers(this, _striped_extraInitializers), __runInitializers(this, _searchable_initializers, false));
|
|
102
|
+
this.sortable = (__runInitializers(this, _searchable_extraInitializers), __runInitializers(this, _sortable_initializers, false));
|
|
103
|
+
this.selectable = (__runInitializers(this, _sortable_extraInitializers), __runInitializers(this, _selectable_initializers, false));
|
|
104
|
+
this.hoverable = (__runInitializers(this, _selectable_extraInitializers), __runInitializers(this, _hoverable_initializers, true));
|
|
105
|
+
this.clickable = (__runInitializers(this, _hoverable_extraInitializers), __runInitializers(this, _clickable_initializers, false));
|
|
106
|
+
this.columns = (__runInitializers(this, _clickable_extraInitializers), __runInitializers(this, _columns_initializers, []));
|
|
107
|
+
this.data = (__runInitializers(this, _columns_extraInitializers), __runInitializers(this, _data_initializers, []));
|
|
108
|
+
this.currentSort = (__runInitializers(this, _data_extraInitializers), __runInitializers(this, _currentSort_initializers, []));
|
|
109
|
+
this.searchText = (__runInitializers(this, _currentSort_extraInitializers), __runInitializers(this, _searchText_initializers, ''));
|
|
110
|
+
this.selector = (__runInitializers(this, _searchText_extraInitializers), __runInitializers(this, _selector_initializers, ''));
|
|
111
|
+
this.selectorOptions = (__runInitializers(this, _selector_extraInitializers), __runInitializers(this, _selectorOptions_initializers, []));
|
|
112
|
+
this.loading = (__runInitializers(this, _selectorOptions_extraInitializers), __runInitializers(this, _loading_initializers, false));
|
|
113
|
+
this.selectedRows = (__runInitializers(this, _loading_extraInitializers), __runInitializers(this, _selectedRows_initializers, []));
|
|
114
|
+
this.table = (__runInitializers(this, _selectedRows_extraInitializers), __runInitializers(this, _table_initializers, void 0));
|
|
115
|
+
this.thead = (__runInitializers(this, _table_extraInitializers), __runInitializers(this, _thead_initializers, void 0));
|
|
116
|
+
this.tbody = (__runInitializers(this, _thead_extraInitializers), __runInitializers(this, _tbody_initializers, void 0));
|
|
117
|
+
this.dataRequestTimeout = (__runInitializers(this, _tbody_extraInitializers), null);
|
|
118
|
+
}
|
|
119
|
+
static {
|
|
120
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
121
|
+
_striped_decorators = [property({ type: Boolean, reflect: true, attribute: 'striped' })];
|
|
122
|
+
_searchable_decorators = [property({ type: Boolean, reflect: true, attribute: 'searchable' })];
|
|
123
|
+
_sortable_decorators = [property({ type: Boolean, reflect: true, attribute: 'sortable' })];
|
|
124
|
+
_selectable_decorators = [property({ type: Boolean, reflect: true, attribute: 'selectable' })];
|
|
125
|
+
_hoverable_decorators = [property({ type: Boolean, reflect: true, attribute: 'hoverable' })];
|
|
126
|
+
_clickable_decorators = [property({ type: Boolean, reflect: true, attribute: 'clickable' })];
|
|
127
|
+
_columns_decorators = [property({ type: Array, attribute: 'columns' })];
|
|
128
|
+
_data_decorators = [property({ type: Array, attribute: 'data' })];
|
|
129
|
+
_currentSort_decorators = [property({ type: Array, attribute: 'current-sort' })];
|
|
130
|
+
_searchText_decorators = [property({ type: String, attribute: 'search-text' })];
|
|
131
|
+
_selector_decorators = [property({ type: String, attribute: 'selector' })];
|
|
132
|
+
_selectorOptions_decorators = [property({ type: Array, attribute: 'selector-options' })];
|
|
133
|
+
_loading_decorators = [property({ type: Boolean, reflect: true, attribute: 'loading' })];
|
|
134
|
+
_selectedRows_decorators = [property({ type: Array, attribute: 'selected-rows' })];
|
|
135
|
+
_table_decorators = [query('table')];
|
|
136
|
+
_thead_decorators = [query('thead')];
|
|
137
|
+
_tbody_decorators = [query('tbody')];
|
|
138
|
+
_getTableConfig_decorators = [request('@snice/table/config')];
|
|
139
|
+
_getTableData_decorators = [request('@snice/table/data')];
|
|
140
|
+
_handleSelectorOptionsChange_decorators = [watch('selector-options')];
|
|
141
|
+
_handleSortableChange_decorators = [watch('sortable')];
|
|
142
|
+
_handleSelectableChange_decorators = [watch('selectable')];
|
|
143
|
+
_handleColumnsChange_decorators = [watch('columns')];
|
|
144
|
+
_handleDataChange_decorators = [watch('data', 'loading')];
|
|
145
|
+
_handleSelectedRowsChange_decorators = [watch('selected-rows')];
|
|
146
|
+
_handleSortChange_decorators = [watch('current-sort')];
|
|
147
|
+
_handleSort_decorators = [on('click', 'th.sortable')];
|
|
148
|
+
_handleRowSelect_decorators = [on('change', '.row-select')];
|
|
149
|
+
_handleSelectAll_decorators = [on('change', '.select-all')];
|
|
150
|
+
_handleRowClick_decorators = [on('click', 'tbody tr')];
|
|
151
|
+
_onAttached_decorators = [on('@snice/controller-attached')];
|
|
152
|
+
_handleSearchChange_decorators = [on('input', '.search-input', { debounce: 500 })];
|
|
153
|
+
_handleSelectorChange_decorators = [on('@snice/select/change', '.selector-input', { debounce: 150 })];
|
|
154
|
+
_dispatchRowSelectionChanged_decorators = [dispatch('@snice/table/row-selection-changed', { bubbles: true, composed: true })];
|
|
155
|
+
_dispatchSelectAllChanged_decorators = [dispatch('@snice/table/select-all-changed', { bubbles: true, composed: true })];
|
|
156
|
+
__esDecorate(this, null, _getTableConfig_decorators, { kind: "method", name: "getTableConfig", static: false, private: false, access: { has: obj => "getTableConfig" in obj, get: obj => obj.getTableConfig }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
157
|
+
__esDecorate(this, null, _getTableData_decorators, { kind: "method", name: "getTableData", static: false, private: false, access: { has: obj => "getTableData" in obj, get: obj => obj.getTableData }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
158
|
+
__esDecorate(this, null, _handleSelectorOptionsChange_decorators, { kind: "method", name: "handleSelectorOptionsChange", static: false, private: false, access: { has: obj => "handleSelectorOptionsChange" in obj, get: obj => obj.handleSelectorOptionsChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
159
|
+
__esDecorate(this, null, _handleSortableChange_decorators, { kind: "method", name: "handleSortableChange", static: false, private: false, access: { has: obj => "handleSortableChange" in obj, get: obj => obj.handleSortableChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
160
|
+
__esDecorate(this, null, _handleSelectableChange_decorators, { kind: "method", name: "handleSelectableChange", static: false, private: false, access: { has: obj => "handleSelectableChange" in obj, get: obj => obj.handleSelectableChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
161
|
+
__esDecorate(this, null, _handleColumnsChange_decorators, { kind: "method", name: "handleColumnsChange", static: false, private: false, access: { has: obj => "handleColumnsChange" in obj, get: obj => obj.handleColumnsChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
162
|
+
__esDecorate(this, null, _handleDataChange_decorators, { kind: "method", name: "handleDataChange", static: false, private: false, access: { has: obj => "handleDataChange" in obj, get: obj => obj.handleDataChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
163
|
+
__esDecorate(this, null, _handleSelectedRowsChange_decorators, { kind: "method", name: "handleSelectedRowsChange", static: false, private: false, access: { has: obj => "handleSelectedRowsChange" in obj, get: obj => obj.handleSelectedRowsChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
164
|
+
__esDecorate(this, null, _handleSortChange_decorators, { kind: "method", name: "handleSortChange", static: false, private: false, access: { has: obj => "handleSortChange" in obj, get: obj => obj.handleSortChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
165
|
+
__esDecorate(this, null, _handleSort_decorators, { kind: "method", name: "handleSort", static: false, private: false, access: { has: obj => "handleSort" in obj, get: obj => obj.handleSort }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
166
|
+
__esDecorate(this, null, _handleRowSelect_decorators, { kind: "method", name: "handleRowSelect", static: false, private: false, access: { has: obj => "handleRowSelect" in obj, get: obj => obj.handleRowSelect }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
167
|
+
__esDecorate(this, null, _handleSelectAll_decorators, { kind: "method", name: "handleSelectAll", static: false, private: false, access: { has: obj => "handleSelectAll" in obj, get: obj => obj.handleSelectAll }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
168
|
+
__esDecorate(this, null, _handleRowClick_decorators, { kind: "method", name: "handleRowClick", static: false, private: false, access: { has: obj => "handleRowClick" in obj, get: obj => obj.handleRowClick }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
169
|
+
__esDecorate(this, null, _onAttached_decorators, { kind: "method", name: "onAttached", static: false, private: false, access: { has: obj => "onAttached" in obj, get: obj => obj.onAttached }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
170
|
+
__esDecorate(this, null, _handleSearchChange_decorators, { kind: "method", name: "handleSearchChange", static: false, private: false, access: { has: obj => "handleSearchChange" in obj, get: obj => obj.handleSearchChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
171
|
+
__esDecorate(this, null, _handleSelectorChange_decorators, { kind: "method", name: "handleSelectorChange", static: false, private: false, access: { has: obj => "handleSelectorChange" in obj, get: obj => obj.handleSelectorChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
172
|
+
__esDecorate(this, null, _dispatchRowSelectionChanged_decorators, { kind: "method", name: "dispatchRowSelectionChanged", static: false, private: false, access: { has: obj => "dispatchRowSelectionChanged" in obj, get: obj => obj.dispatchRowSelectionChanged }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
173
|
+
__esDecorate(this, null, _dispatchSelectAllChanged_decorators, { kind: "method", name: "dispatchSelectAllChanged", static: false, private: false, access: { has: obj => "dispatchSelectAllChanged" in obj, get: obj => obj.dispatchSelectAllChanged }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
174
|
+
__esDecorate(null, null, _striped_decorators, { kind: "field", name: "striped", static: false, private: false, access: { has: obj => "striped" in obj, get: obj => obj.striped, set: (obj, value) => { obj.striped = value; } }, metadata: _metadata }, _striped_initializers, _striped_extraInitializers);
|
|
175
|
+
__esDecorate(null, null, _searchable_decorators, { kind: "field", name: "searchable", static: false, private: false, access: { has: obj => "searchable" in obj, get: obj => obj.searchable, set: (obj, value) => { obj.searchable = value; } }, metadata: _metadata }, _searchable_initializers, _searchable_extraInitializers);
|
|
176
|
+
__esDecorate(null, null, _sortable_decorators, { kind: "field", name: "sortable", static: false, private: false, access: { has: obj => "sortable" in obj, get: obj => obj.sortable, set: (obj, value) => { obj.sortable = value; } }, metadata: _metadata }, _sortable_initializers, _sortable_extraInitializers);
|
|
177
|
+
__esDecorate(null, null, _selectable_decorators, { kind: "field", name: "selectable", static: false, private: false, access: { has: obj => "selectable" in obj, get: obj => obj.selectable, set: (obj, value) => { obj.selectable = value; } }, metadata: _metadata }, _selectable_initializers, _selectable_extraInitializers);
|
|
178
|
+
__esDecorate(null, null, _hoverable_decorators, { kind: "field", name: "hoverable", static: false, private: false, access: { has: obj => "hoverable" in obj, get: obj => obj.hoverable, set: (obj, value) => { obj.hoverable = value; } }, metadata: _metadata }, _hoverable_initializers, _hoverable_extraInitializers);
|
|
179
|
+
__esDecorate(null, null, _clickable_decorators, { kind: "field", name: "clickable", static: false, private: false, access: { has: obj => "clickable" in obj, get: obj => obj.clickable, set: (obj, value) => { obj.clickable = value; } }, metadata: _metadata }, _clickable_initializers, _clickable_extraInitializers);
|
|
180
|
+
__esDecorate(null, null, _columns_decorators, { kind: "field", name: "columns", static: false, private: false, access: { has: obj => "columns" in obj, get: obj => obj.columns, set: (obj, value) => { obj.columns = value; } }, metadata: _metadata }, _columns_initializers, _columns_extraInitializers);
|
|
181
|
+
__esDecorate(null, null, _data_decorators, { kind: "field", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _data_extraInitializers);
|
|
182
|
+
__esDecorate(null, null, _currentSort_decorators, { kind: "field", name: "currentSort", static: false, private: false, access: { has: obj => "currentSort" in obj, get: obj => obj.currentSort, set: (obj, value) => { obj.currentSort = value; } }, metadata: _metadata }, _currentSort_initializers, _currentSort_extraInitializers);
|
|
183
|
+
__esDecorate(null, null, _searchText_decorators, { kind: "field", name: "searchText", static: false, private: false, access: { has: obj => "searchText" in obj, get: obj => obj.searchText, set: (obj, value) => { obj.searchText = value; } }, metadata: _metadata }, _searchText_initializers, _searchText_extraInitializers);
|
|
184
|
+
__esDecorate(null, null, _selector_decorators, { kind: "field", name: "selector", static: false, private: false, access: { has: obj => "selector" in obj, get: obj => obj.selector, set: (obj, value) => { obj.selector = value; } }, metadata: _metadata }, _selector_initializers, _selector_extraInitializers);
|
|
185
|
+
__esDecorate(null, null, _selectorOptions_decorators, { kind: "field", name: "selectorOptions", static: false, private: false, access: { has: obj => "selectorOptions" in obj, get: obj => obj.selectorOptions, set: (obj, value) => { obj.selectorOptions = value; } }, metadata: _metadata }, _selectorOptions_initializers, _selectorOptions_extraInitializers);
|
|
186
|
+
__esDecorate(null, null, _loading_decorators, { kind: "field", name: "loading", static: false, private: false, access: { has: obj => "loading" in obj, get: obj => obj.loading, set: (obj, value) => { obj.loading = value; } }, metadata: _metadata }, _loading_initializers, _loading_extraInitializers);
|
|
187
|
+
__esDecorate(null, null, _selectedRows_decorators, { kind: "field", name: "selectedRows", static: false, private: false, access: { has: obj => "selectedRows" in obj, get: obj => obj.selectedRows, set: (obj, value) => { obj.selectedRows = value; } }, metadata: _metadata }, _selectedRows_initializers, _selectedRows_extraInitializers);
|
|
188
|
+
__esDecorate(null, null, _table_decorators, { kind: "field", name: "table", static: false, private: false, access: { has: obj => "table" in obj, get: obj => obj.table, set: (obj, value) => { obj.table = value; } }, metadata: _metadata }, _table_initializers, _table_extraInitializers);
|
|
189
|
+
__esDecorate(null, null, _thead_decorators, { kind: "field", name: "thead", static: false, private: false, access: { has: obj => "thead" in obj, get: obj => obj.thead, set: (obj, value) => { obj.thead = value; } }, metadata: _metadata }, _thead_initializers, _thead_extraInitializers);
|
|
190
|
+
__esDecorate(null, null, _tbody_decorators, { kind: "field", name: "tbody", static: false, private: false, access: { has: obj => "tbody" in obj, get: obj => obj.tbody, set: (obj, value) => { obj.tbody = value; } }, metadata: _metadata }, _tbody_initializers, _tbody_extraInitializers);
|
|
191
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
192
|
+
_classThis = _classDescriptor.value;
|
|
193
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
194
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
195
|
+
}
|
|
196
|
+
async *getTableConfig() {
|
|
197
|
+
const config = await (yield {});
|
|
198
|
+
this.columns = config.columns || [];
|
|
199
|
+
this.selectorOptions = config.selectorOptions || [];
|
|
200
|
+
this.render();
|
|
201
|
+
return config;
|
|
202
|
+
}
|
|
203
|
+
async *getTableData() {
|
|
204
|
+
this.loading = true;
|
|
205
|
+
this.selectedRows = []; // Clear selections when loading new data
|
|
206
|
+
try {
|
|
207
|
+
const params = {
|
|
208
|
+
search: this.searchText,
|
|
209
|
+
sort: this.currentSort,
|
|
210
|
+
selector: this.selector
|
|
211
|
+
};
|
|
212
|
+
console.log('Requesting table data with params:', params);
|
|
213
|
+
const response = await (yield params);
|
|
214
|
+
console.log('Received table data response:', response);
|
|
215
|
+
this.data = response.data || [];
|
|
216
|
+
this.loading = false;
|
|
217
|
+
this.render();
|
|
218
|
+
return response;
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
console.error('Error loading table data:', error);
|
|
222
|
+
this.data = [];
|
|
223
|
+
this.loading = false;
|
|
224
|
+
this.render();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
debouncedDataRequest() {
|
|
228
|
+
// Set loading immediately for instant feedback
|
|
229
|
+
if (!this.loading) {
|
|
230
|
+
this.loading = true;
|
|
231
|
+
}
|
|
232
|
+
if (this.dataRequestTimeout) {
|
|
233
|
+
clearTimeout(this.dataRequestTimeout);
|
|
234
|
+
}
|
|
235
|
+
this.dataRequestTimeout = setTimeout(() => {
|
|
236
|
+
this.getTableData();
|
|
237
|
+
this.dataRequestTimeout = null;
|
|
238
|
+
}, 500);
|
|
239
|
+
}
|
|
240
|
+
css() {
|
|
241
|
+
return /*css*/ `
|
|
242
|
+
:host {
|
|
243
|
+
display: block;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.snice-table {
|
|
247
|
+
border-collapse: collapse;
|
|
248
|
+
width: 100%;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
table {
|
|
252
|
+
width: 100%;
|
|
253
|
+
border-collapse: separate;
|
|
254
|
+
border-spacing: 0;
|
|
255
|
+
border-radius: var(--snice-border-radius-lg);
|
|
256
|
+
overflow: hidden;
|
|
257
|
+
border: 1px solid var(--snice-color-border);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
th, td {
|
|
261
|
+
padding: var(--snice-spacing-sm);
|
|
262
|
+
border: 1px solid var(--snice-color-border);
|
|
263
|
+
text-align: left;
|
|
264
|
+
color: var(--snice-color-text);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
th {
|
|
268
|
+
background-color: var(--snice-color-background-secondary);
|
|
269
|
+
color: var(--snice-color-text);
|
|
270
|
+
font-weight: var(--snice-font-weight-semibold);
|
|
271
|
+
border-bottom: 2px solid var(--snice-color-border);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
th.sortable {
|
|
275
|
+
cursor: pointer;
|
|
276
|
+
user-select: none;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
th.sortable:hover {
|
|
280
|
+
background-color: var(--snice-color-background-tertiary);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Row styling */
|
|
284
|
+
:host([striped]) tbody tr:nth-child(even) {
|
|
285
|
+
background-color: var(--snice-color-background-secondary);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
:host([hoverable]) tbody tr:hover {
|
|
289
|
+
background-color: var(--snice-color-background-tertiary);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
:host([clickable]) tbody tr {
|
|
293
|
+
cursor: pointer;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
:host([selectable]) tbody tr {
|
|
297
|
+
cursor: pointer;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
tbody tr[data-selected="true"] {
|
|
301
|
+
background-color: var(--snice-color-background-tertiary);
|
|
302
|
+
border-left: 3px solid var(--snice-color-primary);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
tbody tr[data-selected="true"]:hover {
|
|
306
|
+
background-color: var(--snice-color-background-tertiary);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
[part="header"] {
|
|
310
|
+
background-color: var(--snice-color-background);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
[part="body"] {
|
|
314
|
+
background-color: var(--snice-table-body-bg, --snice-color-background);
|
|
315
|
+
display: block;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.table-controls {
|
|
319
|
+
display: flex;
|
|
320
|
+
gap: var(--snice-spacing-md);
|
|
321
|
+
align-items: center;
|
|
322
|
+
flex-wrap: wrap;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
:host(:not([searchable])) .search-input {
|
|
326
|
+
display: none;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
:host(.selector-options-empty) .selector-input {
|
|
330
|
+
display: none;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.search-input {
|
|
334
|
+
min-width: 200px;
|
|
335
|
+
flex: 1;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.selector-input {
|
|
339
|
+
min-width: 150px;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* Sort indicators */
|
|
343
|
+
.sort-header {
|
|
344
|
+
display: flex;
|
|
345
|
+
align-items: center;
|
|
346
|
+
gap: var(--snice-spacing-xs);
|
|
347
|
+
justify-content: space-between;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
.sort-indicator {
|
|
352
|
+
display: flex;
|
|
353
|
+
flex-direction: column;
|
|
354
|
+
font-size: 0.7em;
|
|
355
|
+
line-height: 1;
|
|
356
|
+
opacity: 0.3;
|
|
357
|
+
transition: opacity var(--snice-transition-fast);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.sort-indicator.active {
|
|
361
|
+
opacity: 1;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.sort-order {
|
|
365
|
+
font-size: 0.6em;
|
|
366
|
+
background: var(--snice-color-primary);
|
|
367
|
+
color: var(--snice-color-text-inverse);
|
|
368
|
+
border-radius: var(--snice-border-radius-sm);
|
|
369
|
+
padding: 1px 3px;
|
|
370
|
+
min-width: 12px;
|
|
371
|
+
text-align: center;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/* Loading fade */
|
|
375
|
+
tbody {
|
|
376
|
+
transition: opacity var(--snice-transition-normal);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
:host([loading]) tbody {
|
|
380
|
+
opacity: 0.5;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.no-data {
|
|
384
|
+
text-align: center;
|
|
385
|
+
padding: var(--snice-spacing-lg);
|
|
386
|
+
color: var(--snice-color-text-secondary);
|
|
387
|
+
}
|
|
388
|
+
`;
|
|
389
|
+
}
|
|
390
|
+
html() {
|
|
391
|
+
return /*html*/ `
|
|
392
|
+
<div class="snice-table">
|
|
393
|
+
${this.renderControls()}
|
|
394
|
+
<table>
|
|
395
|
+
<thead></thead>
|
|
396
|
+
<tbody></tbody>
|
|
397
|
+
</table>
|
|
398
|
+
</div>
|
|
399
|
+
`;
|
|
400
|
+
}
|
|
401
|
+
renderControls() {
|
|
402
|
+
return /*html*/ `
|
|
403
|
+
<div class="table-controls" part="controls">
|
|
404
|
+
<snice-input
|
|
405
|
+
class="search-input"
|
|
406
|
+
type="search"
|
|
407
|
+
placeholder="Search..."
|
|
408
|
+
value="${this.searchText}"
|
|
409
|
+
size="medium"
|
|
410
|
+
></snice-input>
|
|
411
|
+
<snice-select
|
|
412
|
+
class="selector-input"
|
|
413
|
+
multiple
|
|
414
|
+
searchable
|
|
415
|
+
clearable
|
|
416
|
+
placeholder="Filter..."
|
|
417
|
+
size="medium"
|
|
418
|
+
>
|
|
419
|
+
${this.selectorOptions.map(opt => `<snice-option value="${opt.value}">${opt.label}</snice-option>`).join('')}
|
|
420
|
+
</snice-select>
|
|
421
|
+
</div>
|
|
422
|
+
`;
|
|
423
|
+
}
|
|
424
|
+
render() {
|
|
425
|
+
console.log('render() called');
|
|
426
|
+
this.renderHeader();
|
|
427
|
+
this.renderBody();
|
|
428
|
+
}
|
|
429
|
+
handleSelectorOptionsChange() {
|
|
430
|
+
// Update CSS class to show/hide selector
|
|
431
|
+
if (this.selectorOptions.length === 0) {
|
|
432
|
+
this.classList.add('selector-options-empty');
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
this.classList.remove('selector-options-empty');
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
handleSortableChange() {
|
|
439
|
+
this.renderHeader(); // Re-render header to show/hide sort indicators
|
|
440
|
+
}
|
|
441
|
+
handleSelectableChange() {
|
|
442
|
+
this.render(); // Re-render both header and body for checkbox columns
|
|
443
|
+
}
|
|
444
|
+
handleColumnsChange() {
|
|
445
|
+
this.renderHeader();
|
|
446
|
+
}
|
|
447
|
+
handleDataChange() {
|
|
448
|
+
this.renderBody();
|
|
449
|
+
}
|
|
450
|
+
handleSelectedRowsChange() {
|
|
451
|
+
this.updateRowSelectionState();
|
|
452
|
+
this.updateSelectAllState();
|
|
453
|
+
}
|
|
454
|
+
handleSortChange() {
|
|
455
|
+
this.renderHeader();
|
|
456
|
+
}
|
|
457
|
+
renderHeader() {
|
|
458
|
+
if (!this.thead)
|
|
459
|
+
return;
|
|
460
|
+
const headerRow = document.createElement('tr');
|
|
461
|
+
if (this.selectable) {
|
|
462
|
+
const selectCell = document.createElement('th');
|
|
463
|
+
const allSelected = this.selectedRows.length === this.data.length && this.data.length > 0;
|
|
464
|
+
const someSelected = this.selectedRows.length > 0 && this.selectedRows.length < this.data.length;
|
|
465
|
+
selectCell.innerHTML = `<input type="checkbox" class="select-all" ${allSelected ? 'checked' : ''} />`;
|
|
466
|
+
headerRow.appendChild(selectCell);
|
|
467
|
+
// Set indeterminate after insertion
|
|
468
|
+
setTimeout(() => {
|
|
469
|
+
const checkbox = selectCell.querySelector('.select-all');
|
|
470
|
+
if (checkbox) {
|
|
471
|
+
checkbox.indeterminate = someSelected;
|
|
472
|
+
}
|
|
473
|
+
}, 0);
|
|
474
|
+
}
|
|
475
|
+
this.columns.forEach(column => {
|
|
476
|
+
const th = document.createElement('th');
|
|
477
|
+
th.setAttribute('data-key', column.key);
|
|
478
|
+
if (this.sortable && column.sortable !== false) {
|
|
479
|
+
th.classList.add('sortable');
|
|
480
|
+
th.setAttribute('role', 'button');
|
|
481
|
+
th.innerHTML = this.renderSortableHeader(column);
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
th.textContent = column.label;
|
|
485
|
+
}
|
|
486
|
+
headerRow.appendChild(th);
|
|
487
|
+
});
|
|
488
|
+
this.thead.innerHTML = '';
|
|
489
|
+
this.thead.appendChild(headerRow);
|
|
490
|
+
}
|
|
491
|
+
renderSortableHeader(column) {
|
|
492
|
+
const sortItem = this.currentSort.find(s => s.column === column.key);
|
|
493
|
+
const sortIndex = this.currentSort.findIndex(s => s.column === column.key);
|
|
494
|
+
const isActive = !!sortItem;
|
|
495
|
+
let indicator = '▲▼'; // Default unsorted state
|
|
496
|
+
let orderNumber = '';
|
|
497
|
+
if (sortItem) {
|
|
498
|
+
if (sortItem.direction === 'asc') {
|
|
499
|
+
indicator = '▲';
|
|
500
|
+
}
|
|
501
|
+
else if (sortItem.direction === 'desc') {
|
|
502
|
+
indicator = '▼';
|
|
503
|
+
}
|
|
504
|
+
if (this.currentSort.length > 1) {
|
|
505
|
+
orderNumber = `<span class="sort-order">${sortIndex + 1}</span>`;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return `
|
|
509
|
+
<div class="sort-header">
|
|
510
|
+
<span>${column.label}</span>
|
|
511
|
+
<div class="sort-indicator ${isActive ? 'active' : ''}">
|
|
512
|
+
${indicator}
|
|
513
|
+
${orderNumber}
|
|
514
|
+
</div>
|
|
515
|
+
</div>
|
|
516
|
+
`;
|
|
517
|
+
}
|
|
518
|
+
renderBody() {
|
|
519
|
+
if (!this.tbody)
|
|
520
|
+
return;
|
|
521
|
+
console.log('renderBody called with data:', this.data.length, 'columns:', this.columns.length, 'loading:', this.loading);
|
|
522
|
+
this.tbody.innerHTML = '';
|
|
523
|
+
if (this.data.length === 0 && this.columns.length > 0) {
|
|
524
|
+
if (this.loading) {
|
|
525
|
+
// Show loading spinner
|
|
526
|
+
const tr = document.createElement('tr');
|
|
527
|
+
const td = document.createElement('td');
|
|
528
|
+
const colSpan = this.columns.length + (this.selectable ? 1 : 0);
|
|
529
|
+
td.colSpan = colSpan;
|
|
530
|
+
td.className = 'no-data';
|
|
531
|
+
td.innerHTML = '<snice-progress variant="circular" indeterminate size="small"></snice-progress>';
|
|
532
|
+
tr.appendChild(td);
|
|
533
|
+
this.tbody.appendChild(tr);
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
// Show "No Data" message
|
|
538
|
+
const tr = document.createElement('tr');
|
|
539
|
+
const td = document.createElement('td');
|
|
540
|
+
const colSpan = this.columns.length + (this.selectable ? 1 : 0);
|
|
541
|
+
td.colSpan = colSpan;
|
|
542
|
+
td.className = 'no-data';
|
|
543
|
+
td.textContent = 'No Data';
|
|
544
|
+
tr.appendChild(td);
|
|
545
|
+
this.tbody.appendChild(tr);
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
this.data.forEach((rowData, index) => {
|
|
550
|
+
const tr = document.createElement('tr');
|
|
551
|
+
tr.setAttribute('data-index', String(index));
|
|
552
|
+
// Set row selection state
|
|
553
|
+
const isSelected = this.selectedRows.includes(index);
|
|
554
|
+
tr.setAttribute('data-selected', String(isSelected));
|
|
555
|
+
if (this.selectable) {
|
|
556
|
+
const selectCell = document.createElement('td');
|
|
557
|
+
selectCell.innerHTML = `<input type="checkbox" class="row-select" ${isSelected ? 'checked' : ''} data-row-index="${index}" />`;
|
|
558
|
+
tr.appendChild(selectCell);
|
|
559
|
+
}
|
|
560
|
+
this.columns.forEach(column => {
|
|
561
|
+
const td = document.createElement('td');
|
|
562
|
+
const value = rowData[column.key];
|
|
563
|
+
// Create cell component as HTML string
|
|
564
|
+
const cellTagName = this.getCellTagName(column.type);
|
|
565
|
+
const attributes = this.getCellAttributes(column, value);
|
|
566
|
+
td.innerHTML = `<${cellTagName} ${attributes}></${cellTagName}>`;
|
|
567
|
+
tr.appendChild(td);
|
|
568
|
+
});
|
|
569
|
+
this.tbody.appendChild(tr);
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
getCellAttributes(column, value) {
|
|
573
|
+
const attributes = [
|
|
574
|
+
`type="${column.type}"`,
|
|
575
|
+
`align="${column.align || 'left'}"`,
|
|
576
|
+
`value="${String(value || '').replace(/"/g, '"')}"`,
|
|
577
|
+
`in-table="true"`
|
|
578
|
+
];
|
|
579
|
+
// Add type-specific attributes
|
|
580
|
+
if (column.type === 'number' || column.type === 'currency') {
|
|
581
|
+
if (column.decimals !== undefined)
|
|
582
|
+
attributes.push(`decimals="${column.decimals}"`);
|
|
583
|
+
if (column.thousandsSeparator)
|
|
584
|
+
attributes.push(`thousands-separator="true"`);
|
|
585
|
+
if (column.prefix)
|
|
586
|
+
attributes.push(`prefix="${column.prefix}"`);
|
|
587
|
+
if (column.suffix)
|
|
588
|
+
attributes.push(`suffix="${column.suffix}"`);
|
|
589
|
+
}
|
|
590
|
+
if (column.type === 'date') {
|
|
591
|
+
if (column.dateFormat)
|
|
592
|
+
attributes.push(`date-format="${column.dateFormat}"`);
|
|
593
|
+
}
|
|
594
|
+
if (column.type === 'boolean') {
|
|
595
|
+
if (column.useSymbols)
|
|
596
|
+
attributes.push(`use-symbols="true"`);
|
|
597
|
+
if (column.trueSymbol)
|
|
598
|
+
attributes.push(`true-symbol="${column.trueSymbol}"`);
|
|
599
|
+
if (column.falseSymbol)
|
|
600
|
+
attributes.push(`false-symbol="${column.falseSymbol}"`);
|
|
601
|
+
if (column.trueValue)
|
|
602
|
+
attributes.push(`true-value="${column.trueValue}"`);
|
|
603
|
+
if (column.falseValue)
|
|
604
|
+
attributes.push(`false-value="${column.falseValue}"`);
|
|
605
|
+
}
|
|
606
|
+
return attributes.join(' ');
|
|
607
|
+
}
|
|
608
|
+
getCellTagName(type) {
|
|
609
|
+
switch (type) {
|
|
610
|
+
case 'text':
|
|
611
|
+
return 'snice-cell-text';
|
|
612
|
+
case 'number':
|
|
613
|
+
case 'currency':
|
|
614
|
+
return 'snice-cell-number';
|
|
615
|
+
case 'date':
|
|
616
|
+
return 'snice-cell-date';
|
|
617
|
+
case 'boolean':
|
|
618
|
+
return 'snice-cell-boolean';
|
|
619
|
+
case 'rating':
|
|
620
|
+
return 'snice-cell-rating';
|
|
621
|
+
case 'progress':
|
|
622
|
+
return 'snice-cell-progress';
|
|
623
|
+
case 'duration':
|
|
624
|
+
return 'snice-cell-duration';
|
|
625
|
+
case 'filesize':
|
|
626
|
+
return 'snice-cell-filesize';
|
|
627
|
+
case 'sparkline':
|
|
628
|
+
return 'snice-cell-sparkline';
|
|
629
|
+
default:
|
|
630
|
+
return 'snice-cell';
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
handleSort(e) {
|
|
634
|
+
const th = e.target.closest('th.sortable');
|
|
635
|
+
if (!th)
|
|
636
|
+
return;
|
|
637
|
+
const columnKey = th.getAttribute('data-key');
|
|
638
|
+
if (columnKey) {
|
|
639
|
+
console.log('Sorting column:', columnKey);
|
|
640
|
+
this.toggleSort(columnKey, true); // Always multi-sort
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
handleRowSelect(e) {
|
|
644
|
+
const checkbox = e.target;
|
|
645
|
+
const rowIndex = parseInt(checkbox.getAttribute('data-row-index') || '0');
|
|
646
|
+
if (checkbox.checked) {
|
|
647
|
+
if (!this.selectedRows.includes(rowIndex)) {
|
|
648
|
+
this.selectedRows = [...this.selectedRows, rowIndex];
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
else {
|
|
652
|
+
this.selectedRows = this.selectedRows.filter(i => i !== rowIndex);
|
|
653
|
+
}
|
|
654
|
+
this.updateRowSelectionState();
|
|
655
|
+
this.updateSelectAllState();
|
|
656
|
+
this.dispatchRowSelectionChanged(rowIndex, checkbox.checked);
|
|
657
|
+
}
|
|
658
|
+
handleSelectAll(e) {
|
|
659
|
+
const checkbox = e.target;
|
|
660
|
+
if (checkbox.checked) {
|
|
661
|
+
this.selectedRows = this.data.map((_, index) => index);
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
this.selectedRows = [];
|
|
665
|
+
}
|
|
666
|
+
this.updateRowSelectionState();
|
|
667
|
+
this.dispatchSelectAllChanged(checkbox.checked);
|
|
668
|
+
}
|
|
669
|
+
handleRowClick(e) {
|
|
670
|
+
const tr = e.target.closest('tr');
|
|
671
|
+
if (!tr)
|
|
672
|
+
return;
|
|
673
|
+
const target = e.target;
|
|
674
|
+
// Don't trigger if clicking on checkbox or other interactive elements
|
|
675
|
+
if (target.matches('input[type="checkbox"], button, a, .interactive')) {
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
const rowIndex = parseInt(tr.getAttribute('data-index') || '0');
|
|
679
|
+
const rowData = this.data[rowIndex];
|
|
680
|
+
// Handle row selection if selectable
|
|
681
|
+
if (this.selectable) {
|
|
682
|
+
const isCurrentlySelected = this.selectedRows.includes(rowIndex);
|
|
683
|
+
if (isCurrentlySelected) {
|
|
684
|
+
this.selectedRows = this.selectedRows.filter(i => i !== rowIndex);
|
|
685
|
+
}
|
|
686
|
+
else {
|
|
687
|
+
this.selectedRows = [...this.selectedRows, rowIndex];
|
|
688
|
+
}
|
|
689
|
+
this.updateRowSelectionState();
|
|
690
|
+
this.updateSelectAllState();
|
|
691
|
+
this.dispatchRowSelectionChanged(rowIndex, !isCurrentlySelected);
|
|
692
|
+
}
|
|
693
|
+
// Handle clickable row event
|
|
694
|
+
if (this.clickable) {
|
|
695
|
+
this.dispatchEvent(new CustomEvent('row-clicked', {
|
|
696
|
+
detail: { rowData, rowIndex }
|
|
697
|
+
}));
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
onAttached() {
|
|
701
|
+
console.log('Controller attached, loading config and data...');
|
|
702
|
+
this.getTableConfig();
|
|
703
|
+
this.getTableData();
|
|
704
|
+
}
|
|
705
|
+
handleSearchChange(e) {
|
|
706
|
+
const input = e.target;
|
|
707
|
+
this.searchText = input.value;
|
|
708
|
+
this.debouncedDataRequest();
|
|
709
|
+
}
|
|
710
|
+
handleSelectorChange(e) {
|
|
711
|
+
this.selector = Array.isArray(e.detail.value) ? e.detail.value.join(',') : e.detail.value;
|
|
712
|
+
this.debouncedDataRequest();
|
|
713
|
+
}
|
|
714
|
+
updateRowSelectionState() {
|
|
715
|
+
if (!this.tbody)
|
|
716
|
+
return;
|
|
717
|
+
const rows = this.tbody.querySelectorAll('tr');
|
|
718
|
+
rows.forEach((row, index) => {
|
|
719
|
+
const isSelected = this.selectedRows.includes(index);
|
|
720
|
+
row.setAttribute('data-selected', String(isSelected));
|
|
721
|
+
const checkbox = row.querySelector('.row-select');
|
|
722
|
+
if (checkbox) {
|
|
723
|
+
checkbox.checked = isSelected;
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
updateSelectAllState() {
|
|
728
|
+
const selectAllCheckbox = this.thead?.querySelector('.select-all');
|
|
729
|
+
if (!selectAllCheckbox)
|
|
730
|
+
return;
|
|
731
|
+
const allSelected = this.selectedRows.length === this.data.length;
|
|
732
|
+
const someSelected = this.selectedRows.length > 0 && this.selectedRows.length < this.data.length;
|
|
733
|
+
selectAllCheckbox.checked = allSelected;
|
|
734
|
+
selectAllCheckbox.indeterminate = someSelected;
|
|
735
|
+
}
|
|
736
|
+
toggleSort(columnKey, multiSort = false) {
|
|
737
|
+
console.log('toggleSort called:', { columnKey, multiSort, currentSort: this.currentSort });
|
|
738
|
+
if (!multiSort) {
|
|
739
|
+
// Single column sort - clear all other sorts
|
|
740
|
+
const existingSort = this.currentSort.find(s => s.column === columnKey);
|
|
741
|
+
if (!existingSort) {
|
|
742
|
+
this.currentSort = [{ column: columnKey, direction: 'asc' }];
|
|
743
|
+
}
|
|
744
|
+
else if (existingSort.direction === 'asc') {
|
|
745
|
+
this.currentSort = [{ column: columnKey, direction: 'desc' }];
|
|
746
|
+
}
|
|
747
|
+
else {
|
|
748
|
+
this.currentSort = [];
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
// Multi column sort - modify existing or add new
|
|
753
|
+
const existingSortIndex = this.currentSort.findIndex(s => s.column === columnKey);
|
|
754
|
+
if (existingSortIndex === -1) {
|
|
755
|
+
// Add new sort
|
|
756
|
+
this.currentSort = [...this.currentSort, { column: columnKey, direction: 'asc' }];
|
|
757
|
+
}
|
|
758
|
+
else {
|
|
759
|
+
const existingSort = this.currentSort[existingSortIndex];
|
|
760
|
+
if (existingSort.direction === 'asc') {
|
|
761
|
+
// Change to desc - create new array to trigger reactivity
|
|
762
|
+
this.currentSort = this.currentSort.map((sort, index) => index === existingSortIndex ? { ...sort, direction: 'desc' } : sort);
|
|
763
|
+
}
|
|
764
|
+
else {
|
|
765
|
+
// Remove this sort
|
|
766
|
+
this.currentSort = this.currentSort.filter(s => s.column !== columnKey);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
console.log('New sort state:', this.currentSort);
|
|
771
|
+
this.renderHeader(); // Update sort indicators immediately
|
|
772
|
+
this.debouncedDataRequest(); // Show loading immediately, debounce the actual request
|
|
773
|
+
}
|
|
774
|
+
dispatchRowSelectionChanged(rowIndex, selected) {
|
|
775
|
+
return {
|
|
776
|
+
selectedRows: this.selectedRows,
|
|
777
|
+
rowIndex,
|
|
778
|
+
selected
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
dispatchSelectAllChanged(allSelected) {
|
|
782
|
+
return {
|
|
783
|
+
selectedRows: this.selectedRows,
|
|
784
|
+
allSelected
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
return _classThis;
|
|
789
|
+
})();
|
|
790
|
+
|
|
791
|
+
export { SniceTable };
|
|
792
|
+
//# sourceMappingURL=snice-table.js.map
|