snice 5.2.0 → 5.2.2
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/adapters/react/SniceProvider.js +1 -1
- package/adapters/react/SniceRouter.js +1 -1
- package/adapters/react/matchRoute.js +1 -1
- package/adapters/react/useRequestHandler.js +1 -1
- package/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/accordion/snice-accordion.min.js +1 -1
- package/dist/cdn/action-bar/snice-action-bar.js +1 -1
- package/dist/cdn/action-bar/snice-action-bar.min.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.min.js +1 -1
- package/dist/cdn/alert/snice-alert.js +1 -1
- package/dist/cdn/alert/snice-alert.min.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.min.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.min.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.min.js +1 -1
- package/dist/cdn/availability/snice-availability.js +1 -1
- package/dist/cdn/availability/snice-availability.min.js +1 -1
- package/dist/cdn/avatar/snice-avatar.js +1 -1
- package/dist/cdn/avatar/snice-avatar.min.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.min.js +1 -1
- package/dist/cdn/badge/snice-badge.js +1 -1
- package/dist/cdn/badge/snice-badge.min.js +1 -1
- package/dist/cdn/banner/snice-banner.js +1 -1
- package/dist/cdn/banner/snice-banner.min.js +1 -1
- package/dist/cdn/binpack/snice-binpack.js +1 -1
- package/dist/cdn/binpack/snice-binpack.min.js +1 -1
- package/dist/cdn/book/snice-book.js +1 -1
- package/dist/cdn/book/snice-book.min.js +1 -1
- package/dist/cdn/booking/snice-booking.js +1 -1
- package/dist/cdn/booking/snice-booking.min.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.min.js +1 -1
- package/dist/cdn/button/snice-button.js +1 -1
- package/dist/cdn/button/snice-button.min.js +1 -1
- package/dist/cdn/calendar/snice-calendar.js +1 -1
- package/dist/cdn/calendar/snice-calendar.min.js +1 -1
- package/dist/cdn/camera/snice-camera.js +1 -1
- package/dist/cdn/camera/snice-camera.min.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.min.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.min.js +1 -1
- package/dist/cdn/card/snice-card.js +1 -1
- package/dist/cdn/card/snice-card.min.js +1 -1
- package/dist/cdn/carousel/snice-carousel.js +1 -1
- package/dist/cdn/carousel/snice-carousel.min.js +1 -1
- package/dist/cdn/cart/snice-cart.js +1 -1
- package/dist/cdn/cart/snice-cart.min.js +1 -1
- package/dist/cdn/chart/snice-chart.js +1 -1
- package/dist/cdn/chart/snice-chart.min.js +1 -1
- package/dist/cdn/chat/README.md +1 -1
- package/dist/cdn/chat/snice-chat.js +3 -3
- package/dist/cdn/chat/snice-chat.js.map +1 -1
- package/dist/cdn/chat/snice-chat.min.js +3 -3
- package/dist/cdn/chat/snice-chat.min.js.map +1 -1
- package/dist/cdn/checkbox/snice-checkbox.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.min.js +1 -1
- package/dist/cdn/chip/snice-chip.js +1 -1
- package/dist/cdn/chip/snice-chip.min.js +1 -1
- package/dist/cdn/code-block/snice-code-block.js +1 -1
- package/dist/cdn/code-block/snice-code-block.min.js +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-display/snice-color-display.min.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.min.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
- package/dist/cdn/comments/snice-comments.js +1 -1
- package/dist/cdn/comments/snice-comments.min.js +1 -1
- package/dist/cdn/countdown/snice-countdown.js +1 -1
- package/dist/cdn/countdown/snice-countdown.min.js +1 -1
- package/dist/cdn/cropper/snice-cropper.js +1 -1
- package/dist/cdn/cropper/snice-cropper.min.js +1 -1
- package/dist/cdn/data-card/snice-data-card.js +1 -1
- package/dist/cdn/data-card/snice-data-card.min.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.min.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.min.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.min.js +1 -1
- package/dist/cdn/diff/snice-diff.js +1 -1
- package/dist/cdn/diff/snice-diff.min.js +1 -1
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/divider/snice-divider.min.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/doc/snice-doc.min.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/draw/snice-draw.min.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/drawer/snice-drawer.min.js +1 -1
- package/dist/cdn/empty-state/README.md +1 -1
- package/dist/cdn/empty-state/snice-empty-state.js +3 -3
- package/dist/cdn/empty-state/snice-empty-state.js.map +1 -1
- package/dist/cdn/empty-state/snice-empty-state.min.js +4 -4
- package/dist/cdn/empty-state/snice-empty-state.min.js.map +1 -1
- package/dist/cdn/estimate/snice-estimate.js +1 -1
- package/dist/cdn/estimate/snice-estimate.min.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.min.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.min.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.min.js +1 -1
- package/dist/cdn/flow/snice-flow.js +1 -1
- package/dist/cdn/flow/snice-flow.min.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.min.js +1 -1
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/funnel/snice-funnel.min.js +1 -1
- package/dist/cdn/gantt/snice-gantt.js +1 -1
- package/dist/cdn/gantt/snice-gantt.min.js +1 -1
- package/dist/cdn/gauge/snice-gauge.js +1 -1
- package/dist/cdn/gauge/snice-gauge.min.js +1 -1
- package/dist/cdn/grid/snice-grid.js +1 -1
- package/dist/cdn/grid/snice-grid.min.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.min.js +1 -1
- package/dist/cdn/image/snice-image.js +1 -1
- package/dist/cdn/image/snice-image.min.js +1 -1
- package/dist/cdn/input/snice-input.js +1 -1
- package/dist/cdn/input/snice-input.min.js +1 -1
- package/dist/cdn/invoice/snice-invoice.js +1 -1
- package/dist/cdn/invoice/snice-invoice.min.js +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/kanban/snice-kanban.min.js +1 -1
- package/dist/cdn/key-value/snice-key-value.js +1 -1
- package/dist/cdn/key-value/snice-key-value.min.js +1 -1
- package/dist/cdn/kpi/snice-kpi.js +1 -1
- package/dist/cdn/kpi/snice-kpi.min.js +1 -1
- package/dist/cdn/layout/snice-layout.js +1 -1
- package/dist/cdn/layout/snice-layout.min.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.min.js +1 -1
- package/dist/cdn/link/snice-link.js +1 -1
- package/dist/cdn/link/snice-link.min.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.min.js +1 -1
- package/dist/cdn/list/README.md +1 -1
- package/dist/cdn/list/snice-list.js +3 -3
- package/dist/cdn/list/snice-list.js.map +1 -1
- package/dist/cdn/list/snice-list.min.js +7 -7
- package/dist/cdn/list/snice-list.min.js.map +1 -1
- package/dist/cdn/location/snice-location.js +1 -1
- package/dist/cdn/location/snice-location.min.js +1 -1
- package/dist/cdn/login/snice-login.js +1 -1
- package/dist/cdn/login/snice-login.min.js +1 -1
- package/dist/cdn/map/snice-map.js +1 -1
- package/dist/cdn/map/snice-map.min.js +1 -1
- package/dist/cdn/markdown/snice-markdown.js +1 -1
- package/dist/cdn/markdown/snice-markdown.min.js +1 -1
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/masonry/snice-masonry.min.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/menu/snice-menu.min.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.min.js +1 -1
- package/dist/cdn/metric-table/snice-metric-table.js +1 -1
- package/dist/cdn/metric-table/snice-metric-table.min.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/modal/snice-modal.min.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/music-player/snice-music-player.min.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/nav/snice-nav.min.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.min.js +1 -1
- package/dist/cdn/notification-center/README.md +1 -1
- package/dist/cdn/notification-center/snice-notification-center.js +3 -3
- package/dist/cdn/notification-center/snice-notification-center.js.map +1 -1
- package/dist/cdn/notification-center/snice-notification-center.min.js +3 -3
- package/dist/cdn/notification-center/snice-notification-center.min.js.map +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.min.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.min.js +1 -1
- package/dist/cdn/pagination/snice-pagination.js +1 -1
- package/dist/cdn/pagination/snice-pagination.min.js +1 -1
- package/dist/cdn/paint/snice-paint.js +1 -1
- package/dist/cdn/paint/snice-paint.min.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.min.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.min.js +1 -1
- package/dist/cdn/popover/snice-popover.js +1 -1
- package/dist/cdn/popover/snice-popover.min.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.min.js +1 -1
- package/dist/cdn/product-card/snice-product-card.js +1 -1
- package/dist/cdn/product-card/snice-product-card.min.js +1 -1
- package/dist/cdn/progress/snice-progress.js +1 -1
- package/dist/cdn/progress/snice-progress.min.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.min.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.min.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.min.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/radio/snice-radio.min.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.min.js +1 -1
- package/dist/cdn/rating/snice-rating.js +1 -1
- package/dist/cdn/rating/snice-rating.min.js +1 -1
- package/dist/cdn/receipt/snice-receipt.js +1 -1
- package/dist/cdn/receipt/snice-receipt.min.js +1 -1
- package/dist/cdn/recipe/snice-recipe.js +1 -1
- package/dist/cdn/recipe/snice-recipe.min.js +1 -1
- package/dist/cdn/runtime/README.md +2 -2
- package/dist/cdn/runtime/snice-runtime.esm.js +161 -236
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +8 -8
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +161 -236
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +8 -8
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +1 -1
- package/dist/cdn/sankey/snice-sankey.min.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.min.js +1 -1
- package/dist/cdn/select/snice-select.js +1 -1
- package/dist/cdn/select/snice-select.min.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.min.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/slider/snice-slider.min.js +1 -1
- package/dist/cdn/sortable/snice-sortable.js +1 -1
- package/dist/cdn/sortable/snice-sortable.min.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.min.js +1 -1
- package/dist/cdn/spinner/snice-spinner.js +1 -1
- package/dist/cdn/spinner/snice-spinner.min.js +1 -1
- package/dist/cdn/split-button/snice-split-button.js +1 -1
- package/dist/cdn/split-button/snice-split-button.min.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.min.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.min.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.min.js +1 -1
- package/dist/cdn/step-input/snice-step-input.js +1 -1
- package/dist/cdn/step-input/snice-step-input.min.js +1 -1
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/stepper/snice-stepper.min.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/switch/snice-switch.min.js +1 -1
- package/dist/cdn/table/README.md +1 -1
- package/dist/cdn/table/snice-table.js +3 -3
- package/dist/cdn/table/snice-table.js.map +1 -1
- package/dist/cdn/table/snice-table.min.js +24 -24
- package/dist/cdn/table/snice-table.min.js.map +1 -1
- package/dist/cdn/tabs/snice-tabs.js +1 -1
- package/dist/cdn/tabs/snice-tabs.min.js +1 -1
- package/dist/cdn/tag/snice-tag.js +1 -1
- package/dist/cdn/tag/snice-tag.min.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.min.js +1 -1
- package/dist/cdn/terminal/snice-terminal.js +1 -1
- package/dist/cdn/terminal/snice-terminal.min.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.min.js +1 -1
- package/dist/cdn/textarea/snice-textarea.js +1 -1
- package/dist/cdn/textarea/snice-textarea.min.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.min.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.min.js +1 -1
- package/dist/cdn/timeline/snice-timeline.js +1 -1
- package/dist/cdn/timeline/snice-timeline.min.js +1 -1
- package/dist/cdn/timer/snice-timer.js +1 -1
- package/dist/cdn/timer/snice-timer.min.js +1 -1
- package/dist/cdn/toast/snice-toast.js +1 -1
- package/dist/cdn/toast/snice-toast.min.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.min.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/tree/snice-tree.min.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/treemap/snice-treemap.min.js +1 -1
- package/dist/cdn/user-card/snice-user-card.js +1 -1
- package/dist/cdn/user-card/snice-user-card.min.js +1 -1
- package/dist/cdn/video-player/snice-video-player.js +1 -1
- package/dist/cdn/video-player/snice-video-player.min.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.min.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.min.js +1 -1
- package/dist/cdn/weather/snice-weather.js +1 -1
- package/dist/cdn/weather/snice-weather.min.js +1 -1
- package/dist/cdn/work-order/snice-work-order.js +1 -1
- package/dist/cdn/work-order/snice-work-order.min.js +1 -1
- package/dist/components/empty-state/snice-empty-state.js +2 -2
- package/dist/components/empty-state/snice-empty-state.js.map +1 -1
- package/dist/context.d.ts +9 -19
- package/dist/index.cjs +158 -233
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +158 -233
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +158 -233
- package/dist/index.iife.js.map +1 -1
- package/dist/react/SniceProvider.js +1 -1
- package/dist/react/SniceRouter.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/matchRoute.js +1 -1
- package/dist/react/useRequestHandler.js +1 -1
- package/dist/symbols.cjs +1 -3
- package/dist/symbols.cjs.map +1 -1
- package/dist/symbols.d.ts +0 -1
- package/dist/symbols.esm.js +2 -3
- package/dist/symbols.esm.js.map +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/api.md +5 -10
- package/docs/ai/architecture.md +5 -3
- package/docs/ai/decorators.md +1 -6
- package/docs/ai/patterns.md +13 -7
- package/docs/elements.md +21 -28
- package/docs/routing.md +10 -19
- package/package.json +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* snice v5.2.
|
|
2
|
+
* snice v5.2.2
|
|
3
3
|
* A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* Released under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be loaded before snice-table.min.js");var SniceTable=function(e,t){"use strict";function i(e,t,i,a,s,n){function l(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,o=a.kind,c="getter"===o?"get":"setter"===o?"set":"value",d=!t&&e?a.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,a.name):{}),u=!1,p=i.length-1;p>=0;p--){var m={};for(var g in a)m[g]="access"===g?{}:a[g];for(var g in a.access)m.access[g]=a.access[g];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");n.push(l(e||null))};var b=(0,i[p])("accessor"===o?{get:h.get,set:h.set}:h[c],m);if("accessor"===o){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(r=l(b.get))&&(h.get=r),(r=l(b.set))&&(h.set=r),(r=l(b.init))&&s.unshift(r)}else(r=l(b))&&("field"===o?s.unshift(r):h[c]=r)}d&&Object.defineProperty(d,a.name,h),u=!0}function a(e,t,i){for(var a=arguments.length>2,s=0;s<t.length;s++)i=a?t[s].call(e,i):t[s].call(e);return a?i:void 0}function s(e,i="icon"){if(!e)return t.html``;if(e.startsWith("img://")){const a=e.slice(6);return t.html`<img class="${i}" src="${a}" alt="" part="icon" />`}if(e.startsWith("text://")){const a=e.slice(7);return t.html`<span class="${i}" part="icon">${a}</span>`}return/^(https?:\/\/|\/|\.\/|\.\.\/|data:)/.test(e)||/^[^:]*\w\.(svg|png|jpe?g|jfif|pjp|gif|webp|avif|jxl|ico|cur|bmp|tiff?|heic|heif|apng)(\?.*)?$/i.test(e)?t.html`<img class="${i}" src="${e}" alt="" part="icon" />`:/^[a-z][a-z0-9_]*$/.test(e)?t.html`<span class="${i} snice-icon-ligature" style="font-family:var(--snice-icon-font,'Material Symbols Outlined'),sans-serif" part="icon">${e}</span>`:t.html`<span class="${i}" part="icon">${e}</span>`}"function"==typeof SuppressedError&&SuppressedError;(()=>{let e,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z,$,A,F,T,L,M,R,j,O,B,I,P,H,V,N,q,_,W,K,Y,U,G,J,X,Z,Q,ee,te,ie,ae,se,ne=[t.element("snice-input",{formAssociated:!0})],le=[],re=HTMLElement,oe=[],ce=[],de=[],he=[],ue=[],pe=[],me=[],ge=[],be=[],ve=[],fe=[],ye=[],we=[],ke=[],xe=[],Se=[],Ce=[],Ee=[],De=[],ze=[],$e=[],Ae=[],Fe=[],Te=[],Le=[],Me=[],Re=[],je=[],Oe=[],Be=[],Ie=[],Pe=[],He=[],Ve=[],Ne=[],qe=[],_e=[],We=[],Ke=[],Ye=[],Ue=[],Ge=[],Je=[],Xe=[],Ze=[],Qe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],pt=[],mt=[],gt=[],bt=[];(class extends re{static{n=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(re[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({})],d=[t.property({})],h=[t.property({})],u=[t.property({attribute:"helper-text"})],p=[t.property({attribute:"error-text"})],m=[t.property({type:Boolean})],g=[t.property({type:Boolean})],b=[t.property({type:Boolean})],v=[t.property({type:Boolean})],f=[t.property({type:Boolean})],y=[t.property({type:Boolean})],w=[t.property({type:Boolean})],k=[t.property({})],x=[t.property({})],S=[t.property({})],C=[t.property({})],E=[t.property({type:Number})],D=[t.property({type:Number})],z=[t.property({})],$=[t.property({})],A=[t.property({})],F=[t.property({attribute:"label-align"})],T=[t.property({type:Boolean})],L=[t.property({attribute:"prefix-icon"})],M=[t.property({attribute:"suffix-icon"})],R=[t.query(".input")],j=[t.query(".clear-button")],O=[t.query(".password-toggle")],B=[t.render()],I=[t.styles()],P=[t.ready()],H=[t.watch("value")],V=[t.watch("invalid")],N=[t.watch("disabled")],q=[t.watch("loading")],_=[t.watch("readonly")],W=[t.watch("placeholder")],K=[t.watch("min")],Y=[t.watch("max")],U=[t.watch("step")],G=[t.watch("maxlength")],J=[t.watch("minlength")],X=[t.watch("pattern")],Z=[t.watch("type")],Q=[t.watch("label")],ee=[t.dispatch("input-input",{bubbles:!0,composed:!0})],te=[t.dispatch("input-change",{bubbles:!0,composed:!0})],ie=[t.dispatch("input-focus",{bubbles:!0,composed:!0})],ae=[t.dispatch("input-blur",{bubbles:!0,composed:!0})],se=[t.dispatch("input-clear",{bubbles:!0,composed:!0})],i(this,null,B,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:s},null,oe),i(this,null,I,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:s},null,oe),i(this,null,P,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:s},null,oe),i(this,null,H,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:s},null,oe),i(this,null,V,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:e=>"handleInvalidChange"in e,get:e=>e.handleInvalidChange},metadata:s},null,oe),i(this,null,N,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:s},null,oe),i(this,null,q,{kind:"method",name:"handleLoadingChange",static:!1,private:!1,access:{has:e=>"handleLoadingChange"in e,get:e=>e.handleLoadingChange},metadata:s},null,oe),i(this,null,_,{kind:"method",name:"handleReadonlyChange",static:!1,private:!1,access:{has:e=>"handleReadonlyChange"in e,get:e=>e.handleReadonlyChange},metadata:s},null,oe),i(this,null,W,{kind:"method",name:"handlePlaceholderChange",static:!1,private:!1,access:{has:e=>"handlePlaceholderChange"in e,get:e=>e.handlePlaceholderChange},metadata:s},null,oe),i(this,null,K,{kind:"method",name:"handleMinChange",static:!1,private:!1,access:{has:e=>"handleMinChange"in e,get:e=>e.handleMinChange},metadata:s},null,oe),i(this,null,Y,{kind:"method",name:"handleMaxChange",static:!1,private:!1,access:{has:e=>"handleMaxChange"in e,get:e=>e.handleMaxChange},metadata:s},null,oe),i(this,null,U,{kind:"method",name:"handleStepChange",static:!1,private:!1,access:{has:e=>"handleStepChange"in e,get:e=>e.handleStepChange},metadata:s},null,oe),i(this,null,G,{kind:"method",name:"handleMaxLengthChange",static:!1,private:!1,access:{has:e=>"handleMaxLengthChange"in e,get:e=>e.handleMaxLengthChange},metadata:s},null,oe),i(this,null,J,{kind:"method",name:"handleMinLengthChange",static:!1,private:!1,access:{has:e=>"handleMinLengthChange"in e,get:e=>e.handleMinLengthChange},metadata:s},null,oe),i(this,null,X,{kind:"method",name:"handlePatternChange",static:!1,private:!1,access:{has:e=>"handlePatternChange"in e,get:e=>e.handlePatternChange},metadata:s},null,oe),i(this,null,Z,{kind:"method",name:"handleTypeChange",static:!1,private:!1,access:{has:e=>"handleTypeChange"in e,get:e=>e.handleTypeChange},metadata:s},null,oe),i(this,null,Q,{kind:"method",name:"handleLabelChange",static:!1,private:!1,access:{has:e=>"handleLabelChange"in e,get:e=>e.handleLabelChange},metadata:s},null,oe),i(this,null,ee,{kind:"method",name:"dispatchInputEvent",static:!1,private:!1,access:{has:e=>"dispatchInputEvent"in e,get:e=>e.dispatchInputEvent},metadata:s},null,oe),i(this,null,te,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:s},null,oe),i(this,null,ie,{kind:"method",name:"dispatchFocusEvent",static:!1,private:!1,access:{has:e=>"dispatchFocusEvent"in e,get:e=>e.dispatchFocusEvent},metadata:s},null,oe),i(this,null,ae,{kind:"method",name:"dispatchBlurEvent",static:!1,private:!1,access:{has:e=>"dispatchBlurEvent"in e,get:e=>e.dispatchBlurEvent},metadata:s},null,oe),i(this,null,se,{kind:"method",name:"dispatchClearEvent",static:!1,private:!1,access:{has:e=>"dispatchClearEvent"in e,get:e=>e.dispatchClearEvent},metadata:s},null,oe),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:s},ce,de),i(null,null,r,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:s},he,ue),i(null,null,o,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:s},pe,me),i(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:s},ge,be),i(null,null,d,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:s},ve,fe),i(null,null,h,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:s},ye,we),i(null,null,u,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:e=>"helperText"in e,get:e=>e.helperText,set:(e,t)=>{e.helperText=t}},metadata:s},ke,xe),i(null,null,p,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:e=>"errorText"in e,get:e=>e.errorText,set:(e,t)=>{e.errorText=t}},metadata:s},Se,Ce),i(null,null,m,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:s},Ee,De),i(null,null,g,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:s},ze,$e),i(null,null,b,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:s},Ae,Fe),i(null,null,v,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:s},Te,Le),i(null,null,f,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:s},Me,Re),i(null,null,y,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:s},je,Oe),i(null,null,w,{kind:"field",name:"password",static:!1,private:!1,access:{has:e=>"password"in e,get:e=>e.password,set:(e,t)=>{e.password=t}},metadata:s},Be,Ie),i(null,null,k,{kind:"field",name:"min",static:!1,private:!1,access:{has:e=>"min"in e,get:e=>e.min,set:(e,t)=>{e.min=t}},metadata:s},Pe,He),i(null,null,x,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:s},Ve,Ne),i(null,null,S,{kind:"field",name:"step",static:!1,private:!1,access:{has:e=>"step"in e,get:e=>e.step,set:(e,t)=>{e.step=t}},metadata:s},qe,_e),i(null,null,C,{kind:"field",name:"pattern",static:!1,private:!1,access:{has:e=>"pattern"in e,get:e=>e.pattern,set:(e,t)=>{e.pattern=t}},metadata:s},We,Ke),i(null,null,E,{kind:"field",name:"maxlength",static:!1,private:!1,access:{has:e=>"maxlength"in e,get:e=>e.maxlength,set:(e,t)=>{e.maxlength=t}},metadata:s},Ye,Ue),i(null,null,D,{kind:"field",name:"minlength",static:!1,private:!1,access:{has:e=>"minlength"in e,get:e=>e.minlength,set:(e,t)=>{e.minlength=t}},metadata:s},Ge,Je),i(null,null,z,{kind:"field",name:"autocomplete",static:!1,private:!1,access:{has:e=>"autocomplete"in e,get:e=>e.autocomplete,set:(e,t)=>{e.autocomplete=t}},metadata:s},Xe,Ze),i(null,null,$,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:s},Qe,et),i(null,null,A,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:s},tt,it),i(null,null,F,{kind:"field",name:"labelAlign",static:!1,private:!1,access:{has:e=>"labelAlign"in e,get:e=>e.labelAlign,set:(e,t)=>{e.labelAlign=t}},metadata:s},at,st),i(null,null,T,{kind:"field",name:"stretch",static:!1,private:!1,access:{has:e=>"stretch"in e,get:e=>e.stretch,set:(e,t)=>{e.stretch=t}},metadata:s},nt,lt),i(null,null,L,{kind:"field",name:"prefixIcon",static:!1,private:!1,access:{has:e=>"prefixIcon"in e,get:e=>e.prefixIcon,set:(e,t)=>{e.prefixIcon=t}},metadata:s},rt,ot),i(null,null,M,{kind:"field",name:"suffixIcon",static:!1,private:!1,access:{has:e=>"suffixIcon"in e,get:e=>e.suffixIcon,set:(e,t)=>{e.suffixIcon=t}},metadata:s},ct,dt),i(null,null,R,{kind:"field",name:"input",static:!1,private:!1,access:{has:e=>"input"in e,get:e=>e.input,set:(e,t)=>{e.input=t}},metadata:s},ht,ut),i(null,null,j,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:s},pt,mt),i(null,null,O,{kind:"field",name:"passwordToggle",static:!1,private:!1,access:{has:e=>"passwordToggle"in e,get:e=>e.passwordToggle,set:(e,t)=>{e.passwordToggle=t}},metadata:s},gt,bt),i(null,e={value:n},ne,{kind:"class",name:n.name,metadata:s},null,le),n=e.value,s&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),a(n,le)}constructor(){super(),this.internals=a(this,oe),this.type=a(this,ce,"text"),this.size=(a(this,de),a(this,he,"medium")),this.variant=(a(this,ue),a(this,pe,"outlined")),this.value=(a(this,me),a(this,ge,"")),this.placeholder=(a(this,be),a(this,ve,"")),this.label=(a(this,fe),a(this,ye,"")),this.helperText=(a(this,we),a(this,ke,"")),this.errorText=(a(this,xe),a(this,Se,"")),this.disabled=(a(this,Ce),a(this,Ee,!1)),this.readonly=(a(this,De),a(this,ze,!1)),this.loading=(a(this,$e),a(this,Ae,!1)),this.required=(a(this,Fe),a(this,Te,!1)),this.invalid=(a(this,Le),a(this,Me,!1)),this.clearable=(a(this,Re),a(this,je,!1)),this.password=(a(this,Oe),a(this,Be,!1)),this.min=(a(this,Ie),a(this,Pe,"")),this.max=(a(this,He),a(this,Ve,"")),this.step=(a(this,Ne),a(this,qe,"")),this.pattern=(a(this,_e),a(this,We,"")),this.maxlength=(a(this,Ke),a(this,Ye,-1)),this.minlength=(a(this,Ue),a(this,Ge,-1)),this.autocomplete=(a(this,Je),a(this,Xe,"")),this.name=(a(this,Ze),a(this,Qe,"")),this.align=(a(this,et),a(this,tt,"")),this.labelAlign=(a(this,it),a(this,at,"left")),this.stretch=(a(this,st),a(this,nt,!1)),this.prefixIcon=(a(this,lt),a(this,rt,"")),this.suffixIcon=(a(this,ot),a(this,ct,"")),this.input=(a(this,dt),a(this,ht,void 0)),this.clearButton=(a(this,ut),a(this,pt,void 0)),this.passwordToggle=(a(this,mt),a(this,gt,void 0)),this.showPassword=(a(this,bt),!1),this.inputId=`snice-input-${Math.random().toString(36).slice(2,10)}`,this.descId=`${this.inputId}-desc`,"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}formResetCallback(){this.value="",this.internals&&this.internals.setFormValue(this.value)}formDisabledCallback(e){this.disabled=e}render(){const e=["input",`input--${this.size}`,`input--${this.variant}`,this.invalid?"input--invalid":"",this.loading?"input--loading":"",this.prefixIcon?"input--with-prefix-icon":"",this.suffixIcon||"password"===this.type&&this.password||this.loading?"input--with-suffix-icon":"",this.clearable?"input--clearable":""].filter(Boolean).join(" "),i=["label",this.required?"label--required":""].filter(Boolean).join(" "),a=["clear-button",this.suffixIcon||"password"===this.type&&this.password?"clear-button--with-suffix":""].filter(Boolean).join(" ");return t.html`
|
|
7
|
+
void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be loaded before snice-table.min.js");var SniceTable=function(e,t){"use strict";function i(e,t,i,a,s,n){function l(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,o=a.kind,c="getter"===o?"get":"setter"===o?"set":"value",d=!t&&e?a.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,a.name):{}),u=!1,p=i.length-1;p>=0;p--){var m={};for(var g in a)m[g]="access"===g?{}:a[g];for(var g in a.access)m.access[g]=a.access[g];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");n.push(l(e||null))};var b=(0,i[p])("accessor"===o?{get:h.get,set:h.set}:h[c],m);if("accessor"===o){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(r=l(b.get))&&(h.get=r),(r=l(b.set))&&(h.set=r),(r=l(b.init))&&s.unshift(r)}else(r=l(b))&&("field"===o?s.unshift(r):h[c]=r)}d&&Object.defineProperty(d,a.name,h),u=!0}function a(e,t,i){for(var a=arguments.length>2,s=0;s<t.length;s++)i=a?t[s].call(e,i):t[s].call(e);return a?i:void 0}function s(e,i="icon"){if(!e)return t.html``;if(e.startsWith("img://")){const a=e.slice(6);return t.html`<img class="${i}" src="${a}" alt="" part="icon" />`}if(e.startsWith("text://")){const a=e.slice(7);return t.html`<span class="${i}" part="icon">${a}</span>`}return/^(https?:\/\/|\/|\.\/|\.\.\/|data:)/.test(e)||/^[^:]*\w\.(svg|png|jpe?g|jfif|pjp|gif|webp|avif|jxl|ico|cur|bmp|tiff?|heic|heif|apng)(\?.*)?$/i.test(e)?t.html`<img class="${i}" src="${e}" alt="" part="icon" />`:/^[a-z][a-z0-9_]*$/.test(e)?t.html`<span class="${i} snice-icon-ligature" style="font-family:var(--snice-icon-font,'Material Symbols Outlined'),sans-serif" part="icon">${e}</span>`:t.html`<span class="${i}" part="icon">${e}</span>`}"function"==typeof SuppressedError&&SuppressedError;(()=>{let e,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z,$,A,F,T,L,M,R,j,O,B,I,P,H,V,N,_,q,W,K,Y,U,G,J,X,Z,Q,ee,te,ie,ae,se,ne=[t.element("snice-input",{formAssociated:!0})],le=[],re=HTMLElement,oe=[],ce=[],de=[],he=[],ue=[],pe=[],me=[],ge=[],be=[],ve=[],fe=[],ye=[],we=[],ke=[],xe=[],Se=[],Ce=[],Ee=[],De=[],ze=[],$e=[],Ae=[],Fe=[],Te=[],Le=[],Me=[],Re=[],je=[],Oe=[],Be=[],Ie=[],Pe=[],He=[],Ve=[],Ne=[],_e=[],qe=[],We=[],Ke=[],Ye=[],Ue=[],Ge=[],Je=[],Xe=[],Ze=[],Qe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],pt=[],mt=[],gt=[],bt=[];(class extends re{static{n=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(re[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({})],d=[t.property({})],h=[t.property({})],u=[t.property({attribute:"helper-text"})],p=[t.property({attribute:"error-text"})],m=[t.property({type:Boolean})],g=[t.property({type:Boolean})],b=[t.property({type:Boolean})],v=[t.property({type:Boolean})],f=[t.property({type:Boolean})],y=[t.property({type:Boolean})],w=[t.property({type:Boolean})],k=[t.property({})],x=[t.property({})],S=[t.property({})],C=[t.property({})],E=[t.property({type:Number})],D=[t.property({type:Number})],z=[t.property({})],$=[t.property({})],A=[t.property({})],F=[t.property({attribute:"label-align"})],T=[t.property({type:Boolean})],L=[t.property({attribute:"prefix-icon"})],M=[t.property({attribute:"suffix-icon"})],R=[t.query(".input")],j=[t.query(".clear-button")],O=[t.query(".password-toggle")],B=[t.render()],I=[t.styles()],P=[t.ready()],H=[t.watch("value")],V=[t.watch("invalid")],N=[t.watch("disabled")],_=[t.watch("loading")],q=[t.watch("readonly")],W=[t.watch("placeholder")],K=[t.watch("min")],Y=[t.watch("max")],U=[t.watch("step")],G=[t.watch("maxlength")],J=[t.watch("minlength")],X=[t.watch("pattern")],Z=[t.watch("type")],Q=[t.watch("label")],ee=[t.dispatch("input-input",{bubbles:!0,composed:!0})],te=[t.dispatch("input-change",{bubbles:!0,composed:!0})],ie=[t.dispatch("input-focus",{bubbles:!0,composed:!0})],ae=[t.dispatch("input-blur",{bubbles:!0,composed:!0})],se=[t.dispatch("input-clear",{bubbles:!0,composed:!0})],i(this,null,B,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:s},null,oe),i(this,null,I,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:s},null,oe),i(this,null,P,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:s},null,oe),i(this,null,H,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:s},null,oe),i(this,null,V,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:e=>"handleInvalidChange"in e,get:e=>e.handleInvalidChange},metadata:s},null,oe),i(this,null,N,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:s},null,oe),i(this,null,_,{kind:"method",name:"handleLoadingChange",static:!1,private:!1,access:{has:e=>"handleLoadingChange"in e,get:e=>e.handleLoadingChange},metadata:s},null,oe),i(this,null,q,{kind:"method",name:"handleReadonlyChange",static:!1,private:!1,access:{has:e=>"handleReadonlyChange"in e,get:e=>e.handleReadonlyChange},metadata:s},null,oe),i(this,null,W,{kind:"method",name:"handlePlaceholderChange",static:!1,private:!1,access:{has:e=>"handlePlaceholderChange"in e,get:e=>e.handlePlaceholderChange},metadata:s},null,oe),i(this,null,K,{kind:"method",name:"handleMinChange",static:!1,private:!1,access:{has:e=>"handleMinChange"in e,get:e=>e.handleMinChange},metadata:s},null,oe),i(this,null,Y,{kind:"method",name:"handleMaxChange",static:!1,private:!1,access:{has:e=>"handleMaxChange"in e,get:e=>e.handleMaxChange},metadata:s},null,oe),i(this,null,U,{kind:"method",name:"handleStepChange",static:!1,private:!1,access:{has:e=>"handleStepChange"in e,get:e=>e.handleStepChange},metadata:s},null,oe),i(this,null,G,{kind:"method",name:"handleMaxLengthChange",static:!1,private:!1,access:{has:e=>"handleMaxLengthChange"in e,get:e=>e.handleMaxLengthChange},metadata:s},null,oe),i(this,null,J,{kind:"method",name:"handleMinLengthChange",static:!1,private:!1,access:{has:e=>"handleMinLengthChange"in e,get:e=>e.handleMinLengthChange},metadata:s},null,oe),i(this,null,X,{kind:"method",name:"handlePatternChange",static:!1,private:!1,access:{has:e=>"handlePatternChange"in e,get:e=>e.handlePatternChange},metadata:s},null,oe),i(this,null,Z,{kind:"method",name:"handleTypeChange",static:!1,private:!1,access:{has:e=>"handleTypeChange"in e,get:e=>e.handleTypeChange},metadata:s},null,oe),i(this,null,Q,{kind:"method",name:"handleLabelChange",static:!1,private:!1,access:{has:e=>"handleLabelChange"in e,get:e=>e.handleLabelChange},metadata:s},null,oe),i(this,null,ee,{kind:"method",name:"dispatchInputEvent",static:!1,private:!1,access:{has:e=>"dispatchInputEvent"in e,get:e=>e.dispatchInputEvent},metadata:s},null,oe),i(this,null,te,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:s},null,oe),i(this,null,ie,{kind:"method",name:"dispatchFocusEvent",static:!1,private:!1,access:{has:e=>"dispatchFocusEvent"in e,get:e=>e.dispatchFocusEvent},metadata:s},null,oe),i(this,null,ae,{kind:"method",name:"dispatchBlurEvent",static:!1,private:!1,access:{has:e=>"dispatchBlurEvent"in e,get:e=>e.dispatchBlurEvent},metadata:s},null,oe),i(this,null,se,{kind:"method",name:"dispatchClearEvent",static:!1,private:!1,access:{has:e=>"dispatchClearEvent"in e,get:e=>e.dispatchClearEvent},metadata:s},null,oe),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:s},ce,de),i(null,null,r,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:s},he,ue),i(null,null,o,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:s},pe,me),i(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:s},ge,be),i(null,null,d,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:s},ve,fe),i(null,null,h,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:s},ye,we),i(null,null,u,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:e=>"helperText"in e,get:e=>e.helperText,set:(e,t)=>{e.helperText=t}},metadata:s},ke,xe),i(null,null,p,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:e=>"errorText"in e,get:e=>e.errorText,set:(e,t)=>{e.errorText=t}},metadata:s},Se,Ce),i(null,null,m,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:s},Ee,De),i(null,null,g,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:s},ze,$e),i(null,null,b,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:s},Ae,Fe),i(null,null,v,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:s},Te,Le),i(null,null,f,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:s},Me,Re),i(null,null,y,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:s},je,Oe),i(null,null,w,{kind:"field",name:"password",static:!1,private:!1,access:{has:e=>"password"in e,get:e=>e.password,set:(e,t)=>{e.password=t}},metadata:s},Be,Ie),i(null,null,k,{kind:"field",name:"min",static:!1,private:!1,access:{has:e=>"min"in e,get:e=>e.min,set:(e,t)=>{e.min=t}},metadata:s},Pe,He),i(null,null,x,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:s},Ve,Ne),i(null,null,S,{kind:"field",name:"step",static:!1,private:!1,access:{has:e=>"step"in e,get:e=>e.step,set:(e,t)=>{e.step=t}},metadata:s},_e,qe),i(null,null,C,{kind:"field",name:"pattern",static:!1,private:!1,access:{has:e=>"pattern"in e,get:e=>e.pattern,set:(e,t)=>{e.pattern=t}},metadata:s},We,Ke),i(null,null,E,{kind:"field",name:"maxlength",static:!1,private:!1,access:{has:e=>"maxlength"in e,get:e=>e.maxlength,set:(e,t)=>{e.maxlength=t}},metadata:s},Ye,Ue),i(null,null,D,{kind:"field",name:"minlength",static:!1,private:!1,access:{has:e=>"minlength"in e,get:e=>e.minlength,set:(e,t)=>{e.minlength=t}},metadata:s},Ge,Je),i(null,null,z,{kind:"field",name:"autocomplete",static:!1,private:!1,access:{has:e=>"autocomplete"in e,get:e=>e.autocomplete,set:(e,t)=>{e.autocomplete=t}},metadata:s},Xe,Ze),i(null,null,$,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:s},Qe,et),i(null,null,A,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:s},tt,it),i(null,null,F,{kind:"field",name:"labelAlign",static:!1,private:!1,access:{has:e=>"labelAlign"in e,get:e=>e.labelAlign,set:(e,t)=>{e.labelAlign=t}},metadata:s},at,st),i(null,null,T,{kind:"field",name:"stretch",static:!1,private:!1,access:{has:e=>"stretch"in e,get:e=>e.stretch,set:(e,t)=>{e.stretch=t}},metadata:s},nt,lt),i(null,null,L,{kind:"field",name:"prefixIcon",static:!1,private:!1,access:{has:e=>"prefixIcon"in e,get:e=>e.prefixIcon,set:(e,t)=>{e.prefixIcon=t}},metadata:s},rt,ot),i(null,null,M,{kind:"field",name:"suffixIcon",static:!1,private:!1,access:{has:e=>"suffixIcon"in e,get:e=>e.suffixIcon,set:(e,t)=>{e.suffixIcon=t}},metadata:s},ct,dt),i(null,null,R,{kind:"field",name:"input",static:!1,private:!1,access:{has:e=>"input"in e,get:e=>e.input,set:(e,t)=>{e.input=t}},metadata:s},ht,ut),i(null,null,j,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:s},pt,mt),i(null,null,O,{kind:"field",name:"passwordToggle",static:!1,private:!1,access:{has:e=>"passwordToggle"in e,get:e=>e.passwordToggle,set:(e,t)=>{e.passwordToggle=t}},metadata:s},gt,bt),i(null,e={value:n},ne,{kind:"class",name:n.name,metadata:s},null,le),n=e.value,s&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),a(n,le)}constructor(){super(),this.internals=a(this,oe),this.type=a(this,ce,"text"),this.size=(a(this,de),a(this,he,"medium")),this.variant=(a(this,ue),a(this,pe,"outlined")),this.value=(a(this,me),a(this,ge,"")),this.placeholder=(a(this,be),a(this,ve,"")),this.label=(a(this,fe),a(this,ye,"")),this.helperText=(a(this,we),a(this,ke,"")),this.errorText=(a(this,xe),a(this,Se,"")),this.disabled=(a(this,Ce),a(this,Ee,!1)),this.readonly=(a(this,De),a(this,ze,!1)),this.loading=(a(this,$e),a(this,Ae,!1)),this.required=(a(this,Fe),a(this,Te,!1)),this.invalid=(a(this,Le),a(this,Me,!1)),this.clearable=(a(this,Re),a(this,je,!1)),this.password=(a(this,Oe),a(this,Be,!1)),this.min=(a(this,Ie),a(this,Pe,"")),this.max=(a(this,He),a(this,Ve,"")),this.step=(a(this,Ne),a(this,_e,"")),this.pattern=(a(this,qe),a(this,We,"")),this.maxlength=(a(this,Ke),a(this,Ye,-1)),this.minlength=(a(this,Ue),a(this,Ge,-1)),this.autocomplete=(a(this,Je),a(this,Xe,"")),this.name=(a(this,Ze),a(this,Qe,"")),this.align=(a(this,et),a(this,tt,"")),this.labelAlign=(a(this,it),a(this,at,"left")),this.stretch=(a(this,st),a(this,nt,!1)),this.prefixIcon=(a(this,lt),a(this,rt,"")),this.suffixIcon=(a(this,ot),a(this,ct,"")),this.input=(a(this,dt),a(this,ht,void 0)),this.clearButton=(a(this,ut),a(this,pt,void 0)),this.passwordToggle=(a(this,mt),a(this,gt,void 0)),this.showPassword=(a(this,bt),!1),this.inputId=`snice-input-${Math.random().toString(36).slice(2,10)}`,this.descId=`${this.inputId}-desc`,"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}formResetCallback(){this.value="",this.internals&&this.internals.setFormValue(this.value)}formDisabledCallback(e){this.disabled=e}render(){const e=["input",`input--${this.size}`,`input--${this.variant}`,this.invalid?"input--invalid":"",this.loading?"input--loading":"",this.prefixIcon?"input--with-prefix-icon":"",this.suffixIcon||"password"===this.type&&this.password||this.loading?"input--with-suffix-icon":"",this.clearable?"input--clearable":""].filter(Boolean).join(" "),i=["label",this.required?"label--required":""].filter(Boolean).join(" "),a=["clear-button",this.suffixIcon||"password"===this.type&&this.password?"clear-button--with-suffix":""].filter(Boolean).join(" ");return t.html`
|
|
8
8
|
<div class="input-wrapper" part="wrapper">
|
|
9
9
|
<if ${this.label}>
|
|
10
10
|
<label class="${i}" part="label" for="${this.inputId}">
|
|
@@ -104,7 +104,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
104
104
|
</default>
|
|
105
105
|
</case>
|
|
106
106
|
</div>
|
|
107
|
-
`}styles(){return t.css`${":host{display:inline-block;width:100%;max-width:100%;box-sizing:border-box;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);color-scheme:light dark}.input-wrapper{position:relative;width:100%;max-width:100%;height:100%;box-sizing:border-box}:host([align]) .input-wrapper{display:flex;flex-direction:column}:host([align=top]) .input-wrapper{justify-content:flex-start}:host([align=center]) .input-wrapper{justify-content:center}:host([align=bottom]) .input-wrapper{justify-content:flex-end}.input-container{position:relative;display:flex;align-items:center;width:100%;max-width:100%;box-sizing:border-box;transition:all var(--snice-transition-fast, 150ms) ease}:host([stretch]) .input-wrapper{display:flex;flex-direction:column}:host([stretch]) .input-container{flex:1}:host([stretch]) .input{height:100%}.input{flex:1;min-width:0;box-sizing:border-box;font-family:inherit;font-size:var(--snice-font-size-md, 1rem);background:var(--snice-color-surface-container-lowest,rgb(248 247 245));color:var(--snice-color-text,rgb(23 23 23));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);transition:border-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease),box-shadow var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease),background-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease);outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input:focus-visible{border-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.input:hover:not(:focus):not(:disabled){border-color:var(--snice-color-border-hover,rgb(204 204 204))}.input:disabled{background:var(--snice-color-surface-container-low,rgb(250 250 250));color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed;opacity:.6}.input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82));opacity:.7}.input--small{padding:.375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.input--medium{padding:.5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:2.5rem}.input--large{padding:.625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.input--outlined{background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226))}.input--filled{background:var(--snice-color-surface-container-low,rgb(250 250 250));border:1px solid transparent;border-bottom-color:var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem) var(--snice-border-radius-md,.25rem) 0 0}.input--filled:focus-visible{background:var(--snice-color-surface-hover,rgb(245 245 245));border-bottom-color:var(--snice-color-primary,rgb(37 99 235))}.input--underlined{background:0 0;border:none;border-bottom:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:0;padding-left:0;padding-right:0;box-shadow:none}.input-container:has(.input--underlined){position:relative}.input-container:has(.input--underlined)::after{content:'';position:absolute;left:50%;right:50%;bottom:-1px;height:2px;background:var(--snice-color-primary,rgb(37 99 235));transition:left .2s var(--snice-ease-out, ease),right .2s var(--snice-ease-out, ease);pointer-events:none}.input-container:has(.input--underlined:focus-visible)::after{left:0;right:0}.input--underlined:focus-visible{border-bottom-color:var(--snice-color-border,rgb(226 226 226));box-shadow:none}.input--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.input--invalid:focus-visible{border-color:var(--snice-color-danger,rgb(220 38 38));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-color-danger-alpha,rgb(220 38 38 / .4)),var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05))}.input::-webkit-calendar-picker-indicator{cursor:pointer;opacity:.7}.input::-webkit-calendar-picker-indicator:hover{opacity:1}.input--with-prefix-icon{padding-left:2.5rem}.input--clearable,.input--with-suffix-icon{padding-right:2.5rem}.input--with-suffix-icon.input--clearable{padding-right:4rem}.label{display:block;margin-bottom:.25rem;font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);line-height:var(--snice-line-height-normal, 1.5);color:var(--snice-color-text,rgb(23 23 23));text-align:left}:host([label-align=center]) .label{text-align:center}:host([label-align=right]) .label{text-align:right}.label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.error-text,.helper-text{display:block;margin-top:.25rem;font-size:var(--snice-font-size-xs, .75rem)}.helper-text{color:var(--snice-color-text-secondary,rgb(82 82 82))}.error-text{color:var(--snice-color-danger,rgb(220 38 38))}.icon-slot{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none;opacity:.7}.icon-slot:empty{display:none}.icon-slot--prefix{left:.625rem}.icon-slot--suffix{right:.625rem}.icon{display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:1.25rem;line-height:1;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:1.25rem;line-height:1}.icon-slot ::slotted(svg){width:1.5rem;height:1.5rem}.icon-slot ::slotted(img){width:1.5rem;height:1.5rem;object-fit:contain}.clear-button{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm,.125rem);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease;opacity:0;visibility:hidden}.clear-button:hover{background:var(--snice-color-surface-hover,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.input-container:hover .clear-button--visible,.input:focus-visible~.clear-button--visible{opacity:1;visibility:visible}.clear-button--with-suffix{right:2rem}.password-toggle{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm,.125rem);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease}.password-toggle:hover{background:var(--snice-color-surface-hover,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.input[type=number]::-webkit-inner-spin-button,.input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input[type=number]{-moz-appearance:textfield}.input[type=search]::-webkit-search-cancel-button,.input[type=search]::-webkit-search-decoration,.input[type=search]::-webkit-search-results-button,.input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.input-container:focus-within{z-index:1}.input--loading{cursor:wait}.spinner{position:absolute;right:.75rem;width:1em;height:1em;pointer-events:none}.input--with-suffix-icon .spinner{right:2.5rem}.spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}"}`}init(){if(this.internals&&this.internals.setFormValue(this.value),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}this.input&&this.invalid&&(this.input.setAttribute("aria-invalid","true"),this.input.classList.add("input--invalid")),this.input&&("number"===this.type&&(this.min&&(this.input.min=this.min),this.max&&(this.input.max=this.max),this.step&&(this.input.step=this.step)),this.maxlength>0&&(this.input.maxLength=this.maxlength),this.minlength>0&&(this.input.minLength=this.minlength),this.pattern&&(this.input.pattern=this.pattern),this.placeholder&&(this.input.placeholder=this.placeholder),this.value&&(this.input.value=this.value),this.input.disabled=this.disabled,this.input.readOnly=this.readonly,this.input.required=this.required)}handleInput(e){const t=e.target;this.value=t.value,this.dispatchInputEvent()}handleChange(e){const t=e.target;this.value=t.value,this.dispatchChangeEvent()}handleFocus(e){this.dispatchFocusEvent()}handleBlur(e){this.dispatchBlurEvent()}handleClear(e){this.clear()}handlePasswordToggle(e){if(this.showPassword=!this.showPassword,this.input&&(this.input.type=this.showPassword?"text":"password"),this.passwordToggle){const e=this.passwordToggle.querySelector(".password-icon--hidden"),t=this.passwordToggle.querySelector(".password-icon--visible");e&&t&&(e.style.display=this.showPassword?"none":"",t.style.display=this.showPassword?"":"none",this.passwordToggle.setAttribute("aria-label",this.showPassword?"Hide password":"Show password"))}}handleValueChange(){if(this.input&&this.input.value!==this.value&&(this.input.value=this.value),this.internals&&this.internals.setFormValue(this.value),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleInvalidChange(){this.input&&(this.input.setAttribute("aria-invalid",String(this.invalid)),this.invalid?this.input.classList.add("input--invalid"):this.input.classList.remove("input--invalid"))}handleDisabledChange(){if(this.input&&(this.input.disabled=this.disabled||this.loading),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleLoadingChange(){if(this.input&&(this.input.disabled=this.disabled||this.loading),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleReadonlyChange(){if(this.input&&(this.input.readOnly=this.readonly),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handlePlaceholderChange(){this.input&&(this.input.placeholder=this.placeholder)}handleMinChange(){this.input&&"number"===this.type&&(this.input.min=this.min)}handleMaxChange(){this.input&&"number"===this.type&&(this.input.max=this.max)}handleStepChange(){this.input&&"number"===this.type&&(this.input.step=this.step)}handleMaxLengthChange(){this.input&&this.maxlength>0&&(this.input.maxLength=this.maxlength)}handleMinLengthChange(){this.input&&this.minlength>0&&(this.input.minLength=this.minlength)}handlePatternChange(){this.input&&(this.input.pattern=this.pattern)}handleTypeChange(){this.input&&"password"!==this.type&&(this.input.type=this.type)}handleLabelChange(){const e=this.shadowRoot?.querySelector(".label");if(e){e.textContent=this.label;const t=e.parentElement;t&&(t.style.display=this.label?"":"none")}}dispatchInputEvent(){return{value:this.value,input:this}}dispatchChangeEvent(){return{value:this.value,input:this}}dispatchFocusEvent(){return{input:this}}dispatchBlurEvent(){return{input:this}}dispatchClearEvent(){return{input:this}}focus(){this.input?.focus()}blur(){this.input?.blur()}select(){this.input?.select()}clear(){this.value="",this.input&&(this.input.value=""),this.dispatchClearEvent(),this.dispatchInputEvent(),this.dispatchChangeEvent(),this.focus()}checkValidity(){return this.input?.checkValidity()??!0}reportValidity(){return this.input?.reportValidity()??!0}setCustomValidity(e){this.input?.setCustomValidity(e)}})})(),(()=>{let e,s,n,l,r,o,c,d,h,u,p=[t.element("snice-option")],m=[],g=HTMLElement,b=[],v=[],f=[],y=[],w=[],k=[],x=[],S=[],C=[],E=[],D=[];(class extends g{static{s=this}static{const z="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({})],d=[t.render()],h=[t.styles()],u=[t.ready()],i(this,null,d,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:z},null,b),i(this,null,h,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:z},null,b),i(this,null,u,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:z},null,b),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:z},v,f),i(null,null,l,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:z},y,w),i(null,null,r,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:z},k,x),i(null,null,o,{kind:"field",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected,set:(e,t)=>{e.selected=t}},metadata:z},S,C),i(null,null,c,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:z},E,D),i(null,e={value:s},p,{kind:"class",name:s.name,metadata:z},null,m),s=e.value,z&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:z}),a(s,m)}render(){return t.html``}styles(){return t.css`:host { display: none; }`}init(){!this.label&&this.textContent&&(this.label=this.textContent.trim()),!this.value&&this.label&&(this.value=this.label)}get optionData(){return{value:this.value,label:this.label||this.textContent?.trim()||this.value,disabled:this.disabled,selected:this.selected,icon:this.icon}}constructor(){super(...arguments),this.value=(a(this,b),a(this,v,"")),this.label=(a(this,f),a(this,y,"")),this.disabled=(a(this,w),a(this,k,!1)),this.selected=(a(this,x),a(this,S,!1)),this.icon=(a(this,C),a(this,E,"")),a(this,D)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z,$,A,F,T,L,M,R,j,O,B,I,P,H,V,N,q,_,W,K,Y,U,G,J,X,Z=[t.element("snice-select",{formAssociated:!0})],Q=[],ee=HTMLElement,te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],pe=[],me=[],ge=[],be=[],ve=[],fe=[],ye=[],we=[],ke=[],xe=[],Se=[],Ce=[],Ee=[],De=[],ze=[],$e=[],Ae=[],Fe=[],Te=[],Le=[],Me=[],Re=[],je=[],Oe=[],Be=[],Ie=[],Pe=[],He=[],Ve=[],Ne=[],qe=[],_e=[],We=[],Ke=[],Ye=[],Ue=[],Ge=[],Je=[],Xe=[],Ze=[],Qe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],pt=[];(class extends ee{static{s=this}static{const mt="function"==typeof Symbol&&Symbol.metadata?Object.create(ee[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean})],l=[t.property({type:Boolean})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({type:Boolean})],d=[t.property({type:Boolean})],h=[t.property({type:Boolean})],u=[t.property({type:Boolean})],p=[t.property({type:Boolean,attribute:"allow-free-text"})],m=[t.property({type:Boolean})],g=[t.property({type:Boolean})],b=[t.property({type:Number,attribute:"search-debounce"})],v=[t.property({type:Boolean})],f=[t.property({})],y=[t.property({})],w=[t.property({})],k=[t.property({})],x=[t.property({attribute:"helper-text"})],S=[t.property({attribute:"error-text"})],C=[t.property({})],E=[t.property({attribute:"max-height"})],D=[t.property({type:Array,attribute:!1})],z=[t.query(".select-trigger")],$=[t.query(".select-dropdown")],A=[t.query(".select-value")],F=[t.query(".select-label")],T=[t.query(".select-search-input")],L=[t.query(".select-options")],M=[t.query(".select-clear")],R=[t.query(".select-arrow")],j=[t.query(".select-search")],O=[t.query(".select-editable-input")],B=[t.queryAll(".select-option")],I=[t.request("select/search")],P=[t.render()],H=[t.styles()],V=[t.ready()],N=[t.reconnect()],q=[t.dispose()],_=[t.watch("value")],W=[t.watch("options")],K=[t.watch("disabled")],Y=[t.watch("loading")],U=[t.watch("open")],G=[t.dispatch("select-change",{bubbles:!0,composed:!0})],J=[t.dispatch("select-open",{bubbles:!0,composed:!0})],X=[t.dispatch("select-close",{bubbles:!0,composed:!0})],i(this,null,I,{kind:"method",name:"performRemoteSearch",static:!1,private:!1,access:{has:e=>"performRemoteSearch"in e,get:e=>e.performRemoteSearch},metadata:mt},null,te),i(this,null,P,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:mt},null,te),i(this,null,H,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:mt},null,te),i(this,null,V,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:mt},null,te),i(this,null,N,{kind:"method",name:"onReconnect",static:!1,private:!1,access:{has:e=>"onReconnect"in e,get:e=>e.onReconnect},metadata:mt},null,te),i(this,null,q,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:mt},null,te),i(this,null,_,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:mt},null,te),i(this,null,W,{kind:"method",name:"handleOptionsPropertyChange",static:!1,private:!1,access:{has:e=>"handleOptionsPropertyChange"in e,get:e=>e.handleOptionsPropertyChange},metadata:mt},null,te),i(this,null,K,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:mt},null,te),i(this,null,Y,{kind:"method",name:"handleLoadingChange",static:!1,private:!1,access:{has:e=>"handleLoadingChange"in e,get:e=>e.handleLoadingChange},metadata:mt},null,te),i(this,null,U,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:e=>"handleOpenChange"in e,get:e=>e.handleOpenChange},metadata:mt},null,te),i(this,null,G,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:mt},null,te),i(this,null,J,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:e=>"dispatchOpenEvent"in e,get:e=>e.dispatchOpenEvent},metadata:mt},null,te),i(this,null,X,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:e=>"dispatchCloseEvent"in e,get:e=>e.dispatchCloseEvent},metadata:mt},null,te),i(null,null,n,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:mt},ie,ae),i(null,null,l,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:mt},se,ne),i(null,null,r,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:mt},le,re),i(null,null,o,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:mt},oe,ce),i(null,null,c,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:mt},de,he),i(null,null,d,{kind:"field",name:"multiple",static:!1,private:!1,access:{has:e=>"multiple"in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:mt},ue,pe),i(null,null,h,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:mt},me,ge),i(null,null,u,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:mt},be,ve),i(null,null,p,{kind:"field",name:"allowFreeText",static:!1,private:!1,access:{has:e=>"allowFreeText"in e,get:e=>e.allowFreeText,set:(e,t)=>{e.allowFreeText=t}},metadata:mt},fe,ye),i(null,null,m,{kind:"field",name:"editable",static:!1,private:!1,access:{has:e=>"editable"in e,get:e=>e.editable,set:(e,t)=>{e.editable=t}},metadata:mt},we,ke),i(null,null,g,{kind:"field",name:"remote",static:!1,private:!1,access:{has:e=>"remote"in e,get:e=>e.remote,set:(e,t)=>{e.remote=t}},metadata:mt},xe,Se),i(null,null,b,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:e=>"searchDebounce"in e,get:e=>e.searchDebounce,set:(e,t)=>{e.searchDebounce=t}},metadata:mt},Ce,Ee),i(null,null,v,{kind:"field",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:mt},De,ze),i(null,null,f,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:mt},$e,Ae),i(null,null,y,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:mt},Fe,Te),i(null,null,w,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:mt},Le,Me),i(null,null,k,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:mt},Re,je),i(null,null,x,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:e=>"helperText"in e,get:e=>e.helperText,set:(e,t)=>{e.helperText=t}},metadata:mt},Oe,Be),i(null,null,S,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:e=>"errorText"in e,get:e=>e.errorText,set:(e,t)=>{e.errorText=t}},metadata:mt},Ie,Pe),i(null,null,C,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:mt},He,Ve),i(null,null,E,{kind:"field",name:"maxHeight",static:!1,private:!1,access:{has:e=>"maxHeight"in e,get:e=>e.maxHeight,set:(e,t)=>{e.maxHeight=t}},metadata:mt},Ne,qe),i(null,null,D,{kind:"field",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:mt},_e,We),i(null,null,z,{kind:"field",name:"trigger",static:!1,private:!1,access:{has:e=>"trigger"in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:mt},Ke,Ye),i(null,null,$,{kind:"field",name:"dropdown",static:!1,private:!1,access:{has:e=>"dropdown"in e,get:e=>e.dropdown,set:(e,t)=>{e.dropdown=t}},metadata:mt},Ue,Ge),i(null,null,A,{kind:"field",name:"valueDisplay",static:!1,private:!1,access:{has:e=>"valueDisplay"in e,get:e=>e.valueDisplay,set:(e,t)=>{e.valueDisplay=t}},metadata:mt},Je,Xe),i(null,null,F,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:e=>"labelElement"in e,get:e=>e.labelElement,set:(e,t)=>{e.labelElement=t}},metadata:mt},Ze,Qe),i(null,null,T,{kind:"field",name:"searchInput",static:!1,private:!1,access:{has:e=>"searchInput"in e,get:e=>e.searchInput,set:(e,t)=>{e.searchInput=t}},metadata:mt},et,tt),i(null,null,L,{kind:"field",name:"optionsList",static:!1,private:!1,access:{has:e=>"optionsList"in e,get:e=>e.optionsList,set:(e,t)=>{e.optionsList=t}},metadata:mt},it,at),i(null,null,M,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:mt},st,nt),i(null,null,R,{kind:"field",name:"arrow",static:!1,private:!1,access:{has:e=>"arrow"in e,get:e=>e.arrow,set:(e,t)=>{e.arrow=t}},metadata:mt},lt,rt),i(null,null,j,{kind:"field",name:"searchContainer",static:!1,private:!1,access:{has:e=>"searchContainer"in e,get:e=>e.searchContainer,set:(e,t)=>{e.searchContainer=t}},metadata:mt},ot,ct),i(null,null,O,{kind:"field",name:"editableInput",static:!1,private:!1,access:{has:e=>"editableInput"in e,get:e=>e.editableInput,set:(e,t)=>{e.editableInput=t}},metadata:mt},dt,ht),i(null,null,B,{kind:"field",name:"optionElements",static:!1,private:!1,access:{has:e=>"optionElements"in e,get:e=>e.optionElements,set:(e,t)=>{e.optionElements=t}},metadata:mt},ut,pt),i(null,e={value:s},Z,{kind:"class",name:s.name,metadata:mt},null,Q),s=e.value,mt&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:mt}),a(s,Q)}constructor(){super(),this.internals=a(this,te),this.disabled=a(this,ie,!1),this.required=(a(this,ae),a(this,se,!1)),this.invalid=(a(this,ne),a(this,le,!1)),this.readonly=(a(this,re),a(this,oe,!1)),this.loading=(a(this,ce),a(this,de,!1)),this.multiple=(a(this,he),a(this,ue,!1)),this.searchable=(a(this,pe),a(this,me,!1)),this.clearable=(a(this,ge),a(this,be,!1)),this.allowFreeText=(a(this,ve),a(this,fe,!1)),this.editable=(a(this,ye),a(this,we,!1)),this.remote=(a(this,ke),a(this,xe,!1)),this.searchDebounce=(a(this,Se),a(this,Ce,300)),this.open=(a(this,Ee),a(this,De,!1)),this.size=(a(this,ze),a(this,$e,"medium")),this.name=(a(this,Ae),a(this,Fe,"")),this.value=(a(this,Te),a(this,Le,"")),this.label=(a(this,Me),a(this,Re,"")),this.helperText=(a(this,je),a(this,Oe,"")),this.errorText=(a(this,Be),a(this,Ie,"")),this.placeholder=(a(this,Pe),a(this,He,"Select an option")),this.descId=(a(this,Ve),`snice-select-desc-${Math.random().toString(36).slice(2,10)}`),this.maxHeight=a(this,Ne,"200px"),this.options=(a(this,qe),a(this,_e,[])),this.childOptions=(a(this,We),[]),this.trigger=a(this,Ke,void 0),this.dropdown=(a(this,Ye),a(this,Ue,void 0)),this.valueDisplay=(a(this,Ge),a(this,Je,void 0)),this.labelElement=(a(this,Xe),a(this,Ze,void 0)),this.searchInput=(a(this,Qe),a(this,et,void 0)),this.optionsList=(a(this,tt),a(this,it,void 0)),this.clearButton=(a(this,at),a(this,st,void 0)),this.arrow=(a(this,nt),a(this,lt,void 0)),this.searchContainer=(a(this,rt),a(this,ot,void 0)),this.editableInput=(a(this,ct),a(this,dt,void 0)),this.optionElements=(a(this,ht),a(this,ut,void 0)),this.filteredOptions=(a(this,pt),[]),this.selectedValues=new Set,this.focusedIndex=-1,this.editableInputValue="",this.remoteSearchTimeout=0,this.remoteSearching=!1,"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}formResetCallback(){this.value="",this.internals&&this.internals.setFormValue(this.value)}formDisabledCallback(e){this.disabled=e}get isOpen(){return this.open}get mergedOptions(){if(this.childOptions.length>0&&this.options.length>0){const e=new Set(this.childOptions.map(e=>e.value));return[...this.childOptions,...this.options.filter(t=>!e.has(t.value))]}return this.childOptions.length>0?this.childOptions:this.options}async*performRemoteSearch(e){this.remoteSearching=!0,this.updateDropdownContent();try{const t={query:e,select:this},i=await(yield t);this.remoteSearching=!1,this.filteredOptions=i||[],this.focusedIndex=-1,this.updateDropdownContent()}catch{this.remoteSearching=!1,this.filteredOptions=[],this.updateDropdownContent()}}scheduleRemoteSearch(e){clearTimeout(this.remoteSearchTimeout),this.remoteSearchTimeout=window.setTimeout(()=>{this.performRemoteSearch(e)},this.searchDebounce)}render(){const e=`select-label select-label--${this.size} ${this.required?"select-label--required":""}`,i=`select-trigger select-trigger--${this.size} ${this.loading?"select-trigger--loading":""} ${this.editable?"select-trigger--editable":""}`,a=!this.searchable||this.editable;return t.html`
|
|
107
|
+
`}styles(){return t.css`${":host{display:inline-block;width:100%;max-width:100%;box-sizing:border-box;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);color-scheme:light dark}.input-wrapper{position:relative;width:100%;max-width:100%;height:100%;box-sizing:border-box}:host([align]) .input-wrapper{display:flex;flex-direction:column}:host([align=top]) .input-wrapper{justify-content:flex-start}:host([align=center]) .input-wrapper{justify-content:center}:host([align=bottom]) .input-wrapper{justify-content:flex-end}.input-container{position:relative;display:flex;align-items:center;width:100%;max-width:100%;box-sizing:border-box;transition:all var(--snice-transition-fast, 150ms) ease}:host([stretch]) .input-wrapper{display:flex;flex-direction:column}:host([stretch]) .input-container{flex:1}:host([stretch]) .input{height:100%}.input{flex:1;min-width:0;box-sizing:border-box;font-family:inherit;font-size:var(--snice-font-size-md, 1rem);background:var(--snice-color-surface-container-lowest,rgb(248 247 245));color:var(--snice-color-text,rgb(23 23 23));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);transition:border-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease),box-shadow var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease),background-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease);outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input:focus-visible{border-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.input:hover:not(:focus):not(:disabled){border-color:var(--snice-color-border-hover,rgb(204 204 204))}.input:disabled{background:var(--snice-color-surface-container-low,rgb(250 250 250));color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed;opacity:.6}.input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82));opacity:.7}.input--small{padding:.375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.input--medium{padding:.5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:2.5rem}.input--large{padding:.625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.input--outlined{background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226))}.input--filled{background:var(--snice-color-surface-container-low,rgb(250 250 250));border:1px solid transparent;border-bottom-color:var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem) var(--snice-border-radius-md,.25rem) 0 0}.input--filled:focus-visible{background:var(--snice-color-surface-hover,rgb(245 245 245));border-bottom-color:var(--snice-color-primary,rgb(37 99 235))}.input--underlined{background:0 0;border:none;border-bottom:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:0;padding-left:0;padding-right:0;box-shadow:none}.input-container:has(.input--underlined){position:relative}.input-container:has(.input--underlined)::after{content:'';position:absolute;left:50%;right:50%;bottom:-1px;height:2px;background:var(--snice-color-primary,rgb(37 99 235));transition:left .2s var(--snice-ease-out, ease),right .2s var(--snice-ease-out, ease);pointer-events:none}.input-container:has(.input--underlined:focus-visible)::after{left:0;right:0}.input--underlined:focus-visible{border-bottom-color:var(--snice-color-border,rgb(226 226 226));box-shadow:none}.input--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.input--invalid:focus-visible{border-color:var(--snice-color-danger,rgb(220 38 38));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-color-danger-alpha,rgb(220 38 38 / .4)),var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05))}.input::-webkit-calendar-picker-indicator{cursor:pointer;opacity:.7}.input::-webkit-calendar-picker-indicator:hover{opacity:1}.input--with-prefix-icon{padding-left:2.5rem}.input--clearable,.input--with-suffix-icon{padding-right:2.5rem}.input--with-suffix-icon.input--clearable{padding-right:4rem}.label{display:block;margin-bottom:.25rem;font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);line-height:var(--snice-line-height-normal, 1.5);color:var(--snice-color-text,rgb(23 23 23));text-align:left}:host([label-align=center]) .label{text-align:center}:host([label-align=right]) .label{text-align:right}.label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.error-text,.helper-text{display:block;margin-top:.25rem;font-size:var(--snice-font-size-xs, .75rem)}.helper-text{color:var(--snice-color-text-secondary,rgb(82 82 82))}.error-text{color:var(--snice-color-danger,rgb(220 38 38))}.icon-slot{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none;opacity:.7}.icon-slot:empty{display:none}.icon-slot--prefix{left:.625rem}.icon-slot--suffix{right:.625rem}.icon{display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:1.25rem;line-height:1;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:1.25rem;line-height:1}.icon-slot ::slotted(svg){width:1.5rem;height:1.5rem}.icon-slot ::slotted(img){width:1.5rem;height:1.5rem;object-fit:contain}.clear-button{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm,.125rem);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease;opacity:0;visibility:hidden}.clear-button:hover{background:var(--snice-color-surface-hover,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.input-container:hover .clear-button--visible,.input:focus-visible~.clear-button--visible{opacity:1;visibility:visible}.clear-button--with-suffix{right:2rem}.password-toggle{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm,.125rem);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease}.password-toggle:hover{background:var(--snice-color-surface-hover,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.input[type=number]::-webkit-inner-spin-button,.input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input[type=number]{-moz-appearance:textfield}.input[type=search]::-webkit-search-cancel-button,.input[type=search]::-webkit-search-decoration,.input[type=search]::-webkit-search-results-button,.input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.input-container:focus-within{z-index:1}.input--loading{cursor:wait}.spinner{position:absolute;right:.75rem;width:1em;height:1em;pointer-events:none}.input--with-suffix-icon .spinner{right:2.5rem}.spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}"}`}init(){if(this.internals&&this.internals.setFormValue(this.value),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}this.input&&this.invalid&&(this.input.setAttribute("aria-invalid","true"),this.input.classList.add("input--invalid")),this.input&&("number"===this.type&&(this.min&&(this.input.min=this.min),this.max&&(this.input.max=this.max),this.step&&(this.input.step=this.step)),this.maxlength>0&&(this.input.maxLength=this.maxlength),this.minlength>0&&(this.input.minLength=this.minlength),this.pattern&&(this.input.pattern=this.pattern),this.placeholder&&(this.input.placeholder=this.placeholder),this.value&&(this.input.value=this.value),this.input.disabled=this.disabled,this.input.readOnly=this.readonly,this.input.required=this.required)}handleInput(e){const t=e.target;this.value=t.value,this.dispatchInputEvent()}handleChange(e){const t=e.target;this.value=t.value,this.dispatchChangeEvent()}handleFocus(e){this.dispatchFocusEvent()}handleBlur(e){this.dispatchBlurEvent()}handleClear(e){this.clear()}handlePasswordToggle(e){if(this.showPassword=!this.showPassword,this.input&&(this.input.type=this.showPassword?"text":"password"),this.passwordToggle){const e=this.passwordToggle.querySelector(".password-icon--hidden"),t=this.passwordToggle.querySelector(".password-icon--visible");e&&t&&(e.style.display=this.showPassword?"none":"",t.style.display=this.showPassword?"":"none",this.passwordToggle.setAttribute("aria-label",this.showPassword?"Hide password":"Show password"))}}handleValueChange(){if(this.input&&this.input.value!==this.value&&(this.input.value=this.value),this.internals&&this.internals.setFormValue(this.value),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleInvalidChange(){this.input&&(this.input.setAttribute("aria-invalid",String(this.invalid)),this.invalid?this.input.classList.add("input--invalid"):this.input.classList.remove("input--invalid"))}handleDisabledChange(){if(this.input&&(this.input.disabled=this.disabled||this.loading),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleLoadingChange(){if(this.input&&(this.input.disabled=this.disabled||this.loading),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleReadonlyChange(){if(this.input&&(this.input.readOnly=this.readonly),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handlePlaceholderChange(){this.input&&(this.input.placeholder=this.placeholder)}handleMinChange(){this.input&&"number"===this.type&&(this.input.min=this.min)}handleMaxChange(){this.input&&"number"===this.type&&(this.input.max=this.max)}handleStepChange(){this.input&&"number"===this.type&&(this.input.step=this.step)}handleMaxLengthChange(){this.input&&this.maxlength>0&&(this.input.maxLength=this.maxlength)}handleMinLengthChange(){this.input&&this.minlength>0&&(this.input.minLength=this.minlength)}handlePatternChange(){this.input&&(this.input.pattern=this.pattern)}handleTypeChange(){this.input&&"password"!==this.type&&(this.input.type=this.type)}handleLabelChange(){const e=this.shadowRoot?.querySelector(".label");if(e){e.textContent=this.label;const t=e.parentElement;t&&(t.style.display=this.label?"":"none")}}dispatchInputEvent(){return{value:this.value,input:this}}dispatchChangeEvent(){return{value:this.value,input:this}}dispatchFocusEvent(){return{input:this}}dispatchBlurEvent(){return{input:this}}dispatchClearEvent(){return{input:this}}focus(){this.input?.focus()}blur(){this.input?.blur()}select(){this.input?.select()}clear(){this.value="",this.input&&(this.input.value=""),this.dispatchClearEvent(),this.dispatchInputEvent(),this.dispatchChangeEvent(),this.focus()}checkValidity(){return this.input?.checkValidity()??!0}reportValidity(){return this.input?.reportValidity()??!0}setCustomValidity(e){this.input?.setCustomValidity(e)}})})(),(()=>{let e,s,n,l,r,o,c,d,h,u,p=[t.element("snice-option")],m=[],g=HTMLElement,b=[],v=[],f=[],y=[],w=[],k=[],x=[],S=[],C=[],E=[],D=[];(class extends g{static{s=this}static{const z="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({})],d=[t.render()],h=[t.styles()],u=[t.ready()],i(this,null,d,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:z},null,b),i(this,null,h,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:z},null,b),i(this,null,u,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:z},null,b),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:z},v,f),i(null,null,l,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:z},y,w),i(null,null,r,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:z},k,x),i(null,null,o,{kind:"field",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected,set:(e,t)=>{e.selected=t}},metadata:z},S,C),i(null,null,c,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:z},E,D),i(null,e={value:s},p,{kind:"class",name:s.name,metadata:z},null,m),s=e.value,z&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:z}),a(s,m)}render(){return t.html``}styles(){return t.css`:host { display: none; }`}init(){!this.label&&this.textContent&&(this.label=this.textContent.trim()),!this.value&&this.label&&(this.value=this.label)}get optionData(){return{value:this.value,label:this.label||this.textContent?.trim()||this.value,disabled:this.disabled,selected:this.selected,icon:this.icon}}constructor(){super(...arguments),this.value=(a(this,b),a(this,v,"")),this.label=(a(this,f),a(this,y,"")),this.disabled=(a(this,w),a(this,k,!1)),this.selected=(a(this,x),a(this,S,!1)),this.icon=(a(this,C),a(this,E,"")),a(this,D)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z,$,A,F,T,L,M,R,j,O,B,I,P,H,V,N,_,q,W,K,Y,U,G,J,X,Z=[t.element("snice-select",{formAssociated:!0})],Q=[],ee=HTMLElement,te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],pe=[],me=[],ge=[],be=[],ve=[],fe=[],ye=[],we=[],ke=[],xe=[],Se=[],Ce=[],Ee=[],De=[],ze=[],$e=[],Ae=[],Fe=[],Te=[],Le=[],Me=[],Re=[],je=[],Oe=[],Be=[],Ie=[],Pe=[],He=[],Ve=[],Ne=[],_e=[],qe=[],We=[],Ke=[],Ye=[],Ue=[],Ge=[],Je=[],Xe=[],Ze=[],Qe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],pt=[];(class extends ee{static{s=this}static{const mt="function"==typeof Symbol&&Symbol.metadata?Object.create(ee[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean})],l=[t.property({type:Boolean})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({type:Boolean})],d=[t.property({type:Boolean})],h=[t.property({type:Boolean})],u=[t.property({type:Boolean})],p=[t.property({type:Boolean,attribute:"allow-free-text"})],m=[t.property({type:Boolean})],g=[t.property({type:Boolean})],b=[t.property({type:Number,attribute:"search-debounce"})],v=[t.property({type:Boolean})],f=[t.property({})],y=[t.property({})],w=[t.property({})],k=[t.property({})],x=[t.property({attribute:"helper-text"})],S=[t.property({attribute:"error-text"})],C=[t.property({})],E=[t.property({attribute:"max-height"})],D=[t.property({type:Array,attribute:!1})],z=[t.query(".select-trigger")],$=[t.query(".select-dropdown")],A=[t.query(".select-value")],F=[t.query(".select-label")],T=[t.query(".select-search-input")],L=[t.query(".select-options")],M=[t.query(".select-clear")],R=[t.query(".select-arrow")],j=[t.query(".select-search")],O=[t.query(".select-editable-input")],B=[t.queryAll(".select-option")],I=[t.request("select/search")],P=[t.render()],H=[t.styles()],V=[t.ready()],N=[t.reconnect()],_=[t.dispose()],q=[t.watch("value")],W=[t.watch("options")],K=[t.watch("disabled")],Y=[t.watch("loading")],U=[t.watch("open")],G=[t.dispatch("select-change",{bubbles:!0,composed:!0})],J=[t.dispatch("select-open",{bubbles:!0,composed:!0})],X=[t.dispatch("select-close",{bubbles:!0,composed:!0})],i(this,null,I,{kind:"method",name:"performRemoteSearch",static:!1,private:!1,access:{has:e=>"performRemoteSearch"in e,get:e=>e.performRemoteSearch},metadata:mt},null,te),i(this,null,P,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:mt},null,te),i(this,null,H,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:mt},null,te),i(this,null,V,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:mt},null,te),i(this,null,N,{kind:"method",name:"onReconnect",static:!1,private:!1,access:{has:e=>"onReconnect"in e,get:e=>e.onReconnect},metadata:mt},null,te),i(this,null,_,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:mt},null,te),i(this,null,q,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:mt},null,te),i(this,null,W,{kind:"method",name:"handleOptionsPropertyChange",static:!1,private:!1,access:{has:e=>"handleOptionsPropertyChange"in e,get:e=>e.handleOptionsPropertyChange},metadata:mt},null,te),i(this,null,K,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:mt},null,te),i(this,null,Y,{kind:"method",name:"handleLoadingChange",static:!1,private:!1,access:{has:e=>"handleLoadingChange"in e,get:e=>e.handleLoadingChange},metadata:mt},null,te),i(this,null,U,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:e=>"handleOpenChange"in e,get:e=>e.handleOpenChange},metadata:mt},null,te),i(this,null,G,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:mt},null,te),i(this,null,J,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:e=>"dispatchOpenEvent"in e,get:e=>e.dispatchOpenEvent},metadata:mt},null,te),i(this,null,X,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:e=>"dispatchCloseEvent"in e,get:e=>e.dispatchCloseEvent},metadata:mt},null,te),i(null,null,n,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:mt},ie,ae),i(null,null,l,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:mt},se,ne),i(null,null,r,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:mt},le,re),i(null,null,o,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:mt},oe,ce),i(null,null,c,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:mt},de,he),i(null,null,d,{kind:"field",name:"multiple",static:!1,private:!1,access:{has:e=>"multiple"in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:mt},ue,pe),i(null,null,h,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:mt},me,ge),i(null,null,u,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:mt},be,ve),i(null,null,p,{kind:"field",name:"allowFreeText",static:!1,private:!1,access:{has:e=>"allowFreeText"in e,get:e=>e.allowFreeText,set:(e,t)=>{e.allowFreeText=t}},metadata:mt},fe,ye),i(null,null,m,{kind:"field",name:"editable",static:!1,private:!1,access:{has:e=>"editable"in e,get:e=>e.editable,set:(e,t)=>{e.editable=t}},metadata:mt},we,ke),i(null,null,g,{kind:"field",name:"remote",static:!1,private:!1,access:{has:e=>"remote"in e,get:e=>e.remote,set:(e,t)=>{e.remote=t}},metadata:mt},xe,Se),i(null,null,b,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:e=>"searchDebounce"in e,get:e=>e.searchDebounce,set:(e,t)=>{e.searchDebounce=t}},metadata:mt},Ce,Ee),i(null,null,v,{kind:"field",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:mt},De,ze),i(null,null,f,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:mt},$e,Ae),i(null,null,y,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:mt},Fe,Te),i(null,null,w,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:mt},Le,Me),i(null,null,k,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:mt},Re,je),i(null,null,x,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:e=>"helperText"in e,get:e=>e.helperText,set:(e,t)=>{e.helperText=t}},metadata:mt},Oe,Be),i(null,null,S,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:e=>"errorText"in e,get:e=>e.errorText,set:(e,t)=>{e.errorText=t}},metadata:mt},Ie,Pe),i(null,null,C,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:mt},He,Ve),i(null,null,E,{kind:"field",name:"maxHeight",static:!1,private:!1,access:{has:e=>"maxHeight"in e,get:e=>e.maxHeight,set:(e,t)=>{e.maxHeight=t}},metadata:mt},Ne,_e),i(null,null,D,{kind:"field",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:mt},qe,We),i(null,null,z,{kind:"field",name:"trigger",static:!1,private:!1,access:{has:e=>"trigger"in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:mt},Ke,Ye),i(null,null,$,{kind:"field",name:"dropdown",static:!1,private:!1,access:{has:e=>"dropdown"in e,get:e=>e.dropdown,set:(e,t)=>{e.dropdown=t}},metadata:mt},Ue,Ge),i(null,null,A,{kind:"field",name:"valueDisplay",static:!1,private:!1,access:{has:e=>"valueDisplay"in e,get:e=>e.valueDisplay,set:(e,t)=>{e.valueDisplay=t}},metadata:mt},Je,Xe),i(null,null,F,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:e=>"labelElement"in e,get:e=>e.labelElement,set:(e,t)=>{e.labelElement=t}},metadata:mt},Ze,Qe),i(null,null,T,{kind:"field",name:"searchInput",static:!1,private:!1,access:{has:e=>"searchInput"in e,get:e=>e.searchInput,set:(e,t)=>{e.searchInput=t}},metadata:mt},et,tt),i(null,null,L,{kind:"field",name:"optionsList",static:!1,private:!1,access:{has:e=>"optionsList"in e,get:e=>e.optionsList,set:(e,t)=>{e.optionsList=t}},metadata:mt},it,at),i(null,null,M,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:mt},st,nt),i(null,null,R,{kind:"field",name:"arrow",static:!1,private:!1,access:{has:e=>"arrow"in e,get:e=>e.arrow,set:(e,t)=>{e.arrow=t}},metadata:mt},lt,rt),i(null,null,j,{kind:"field",name:"searchContainer",static:!1,private:!1,access:{has:e=>"searchContainer"in e,get:e=>e.searchContainer,set:(e,t)=>{e.searchContainer=t}},metadata:mt},ot,ct),i(null,null,O,{kind:"field",name:"editableInput",static:!1,private:!1,access:{has:e=>"editableInput"in e,get:e=>e.editableInput,set:(e,t)=>{e.editableInput=t}},metadata:mt},dt,ht),i(null,null,B,{kind:"field",name:"optionElements",static:!1,private:!1,access:{has:e=>"optionElements"in e,get:e=>e.optionElements,set:(e,t)=>{e.optionElements=t}},metadata:mt},ut,pt),i(null,e={value:s},Z,{kind:"class",name:s.name,metadata:mt},null,Q),s=e.value,mt&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:mt}),a(s,Q)}constructor(){super(),this.internals=a(this,te),this.disabled=a(this,ie,!1),this.required=(a(this,ae),a(this,se,!1)),this.invalid=(a(this,ne),a(this,le,!1)),this.readonly=(a(this,re),a(this,oe,!1)),this.loading=(a(this,ce),a(this,de,!1)),this.multiple=(a(this,he),a(this,ue,!1)),this.searchable=(a(this,pe),a(this,me,!1)),this.clearable=(a(this,ge),a(this,be,!1)),this.allowFreeText=(a(this,ve),a(this,fe,!1)),this.editable=(a(this,ye),a(this,we,!1)),this.remote=(a(this,ke),a(this,xe,!1)),this.searchDebounce=(a(this,Se),a(this,Ce,300)),this.open=(a(this,Ee),a(this,De,!1)),this.size=(a(this,ze),a(this,$e,"medium")),this.name=(a(this,Ae),a(this,Fe,"")),this.value=(a(this,Te),a(this,Le,"")),this.label=(a(this,Me),a(this,Re,"")),this.helperText=(a(this,je),a(this,Oe,"")),this.errorText=(a(this,Be),a(this,Ie,"")),this.placeholder=(a(this,Pe),a(this,He,"Select an option")),this.descId=(a(this,Ve),`snice-select-desc-${Math.random().toString(36).slice(2,10)}`),this.maxHeight=a(this,Ne,"200px"),this.options=(a(this,_e),a(this,qe,[])),this.childOptions=(a(this,We),[]),this.trigger=a(this,Ke,void 0),this.dropdown=(a(this,Ye),a(this,Ue,void 0)),this.valueDisplay=(a(this,Ge),a(this,Je,void 0)),this.labelElement=(a(this,Xe),a(this,Ze,void 0)),this.searchInput=(a(this,Qe),a(this,et,void 0)),this.optionsList=(a(this,tt),a(this,it,void 0)),this.clearButton=(a(this,at),a(this,st,void 0)),this.arrow=(a(this,nt),a(this,lt,void 0)),this.searchContainer=(a(this,rt),a(this,ot,void 0)),this.editableInput=(a(this,ct),a(this,dt,void 0)),this.optionElements=(a(this,ht),a(this,ut,void 0)),this.filteredOptions=(a(this,pt),[]),this.selectedValues=new Set,this.focusedIndex=-1,this.editableInputValue="",this.remoteSearchTimeout=0,this.remoteSearching=!1,"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}formResetCallback(){this.value="",this.internals&&this.internals.setFormValue(this.value)}formDisabledCallback(e){this.disabled=e}get isOpen(){return this.open}get mergedOptions(){if(this.childOptions.length>0&&this.options.length>0){const e=new Set(this.childOptions.map(e=>e.value));return[...this.childOptions,...this.options.filter(t=>!e.has(t.value))]}return this.childOptions.length>0?this.childOptions:this.options}async*performRemoteSearch(e){this.remoteSearching=!0,this.updateDropdownContent();try{const t={query:e,select:this},i=await(yield t);this.remoteSearching=!1,this.filteredOptions=i||[],this.focusedIndex=-1,this.updateDropdownContent()}catch{this.remoteSearching=!1,this.filteredOptions=[],this.updateDropdownContent()}}scheduleRemoteSearch(e){clearTimeout(this.remoteSearchTimeout),this.remoteSearchTimeout=window.setTimeout(()=>{this.performRemoteSearch(e)},this.searchDebounce)}render(){const e=`select-label select-label--${this.size} ${this.required?"select-label--required":""}`,i=`select-trigger select-trigger--${this.size} ${this.loading?"select-trigger--loading":""} ${this.editable?"select-trigger--editable":""}`,a=!this.searchable||this.editable;return t.html`
|
|
108
108
|
<div class="select-wrapper">
|
|
109
109
|
<label class="${e}" part="label" ?hidden="${!this.label}">
|
|
110
110
|
${this.label}
|
|
@@ -209,7 +209,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
209
209
|
<default></default>
|
|
210
210
|
</case>
|
|
211
211
|
</div>
|
|
212
|
-
`}renderOptions(){if(this.remoteSearching)return'\n <div class="select-loading-indicator">\n <span class="select-loading-spinner"></span>\n <span>Searching...</span>\n </div>\n ';const e=this.searchable||this.editable||this.remote?this.filteredOptions:this.mergedOptions;return 0===e.length?`\n <div class="select-no-options">\n <span class="select-no-options-text" data-search="true" ${!(this.searchable||this.editable||this.remote)||this.filteredOptions.length>0?"hidden":""}>No matches found</span>\n <span class="select-no-options-text" data-search="false" ${(this.searchable||this.editable||this.remote)&&0===this.filteredOptions.length?"hidden":""}>No options available</span>\n </div>\n `:e.map((e,t)=>{const i=this.multiple?this.selectedValues.has(e.value):e.value===this.value;return`\n <div class="select-option\n ${i?"select-option--selected":""}\n ${e.disabled?"select-option--disabled":""}\n ${t===this.focusedIndex?"select-option--focused":""}\n ${e.icon?"select-option--has-icon":""}"\n data-value="${e.value}"\n role="option"\n aria-selected="${i}"\n aria-disabled="${e.disabled}"\n part="option">\n <span class="select-option-check" aria-hidden="true" ${this.multiple?"":"hidden"}>\n <span class="select-option-check-mark" ${i?"":"hidden"}>✓</span>\n </span>\n <img class="select-option-icon" src="${e.icon||""}" alt="" ${e.icon?"":"hidden"} />\n <span class="select-option-label">${e.label}</span>\n </div>\n `}).join("")}styles(){return t.css`${":host{display:inline-block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);position:relative;width:100%;max-width:18.75rem}[hidden]{display:none!important}img[src=\"\"]{display:none}.select-wrapper{position:relative;width:100%}.select-label{display:block;margin-bottom:.25rem;font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);line-height:var(--snice-line-height-normal, 1.5);color:var(--snice-color-text,rgb(23 23 23));text-align:left}.select-label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.select-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease;position:relative;text-align:left;font-family:inherit;color:var(--snice-color-text,rgb(23 23 23))}.select-trigger--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.select-trigger--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:var(--snice-select-min-height,2.5rem)}.select-trigger--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.select-trigger:hover:not(.select-trigger--disabled){border-color:var(--snice-color-border-hover,rgb(180 180 180))}.select-trigger:focus-visible{outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px;border-color:var(--snice-color-primary,rgb(37 99 235))}.select-trigger--open{border-color:var(--snice-color-primary,rgb(37 99 235))}.select-trigger--disabled{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:not-allowed;opacity:.6}.select-trigger--readonly{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:default}.select-trigger--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.select-placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-value--single{display:flex;align-items:center;gap:.5rem}.select-value-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-value--multiple{display:flex;gap:.25rem;flex-wrap:wrap}.select-tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--snice-color-primary-subtle,rgb(219 234 254));color:var(--snice-color-primary,rgb(37 99 235));border-radius:var(--snice-border-radius-sm,.125rem);font-size:var(--snice-font-size-xs, .75rem)}.select-tag-icon{width:.75rem;height:.75rem;object-fit:contain;flex-shrink:0}.select-tag-remove{cursor:pointer;padding:0;background:0 0;border:none;color:inherit;font-size:.75rem;line-height:1}.select-tag-remove:hover{opacity:.7}.select-icons{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:.25rem;pointer-events:none;z-index:1}.select-clear{padding:.125rem;background:0 0;border:none;cursor:pointer;color:var(--snice-color-text-secondary,rgb(82 82 82));display:flex;align-items:center;justify-content:center;border-radius:var(--snice-border-radius-sm,.125rem);pointer-events:auto}.select-clear:hover{background:var(--snice-color-surface-container-low,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.select-arrow{transition:transform var(--snice-transition-fast, 150ms) ease;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none}.select-arrow--open{transform:rotate(180deg)}.select-dropdown{position:absolute;top:100%;margin-top:.25rem;left:0;right:0;background:var(--snice-color-surface-container-high,rgb(252 251 249));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);box-shadow:var(--snice-shadow-lg,0 10px 15px -3px rgb(0 0 0 / .1),0 4px 6px -4px rgb(0 0 0 / .1));z-index:1000;opacity:0;transform:translateY(-8px) scaleY(.95);transform-origin:top;pointer-events:none;transition:opacity var(--snice-transition-fast, 150ms) ease,transform var(--snice-transition-fast, 150ms) ease;display:flex;flex-direction:column;overflow:hidden}.select-dropdown--open{opacity:1;transform:translateY(0) scaleY(1);pointer-events:auto}.select-search{padding:.5rem;border-bottom:1px solid var(--snice-color-border,rgb(226 226 226));flex-shrink:0}.select-search-input{width:100%;padding:.375rem .625rem;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-sm,.125rem);font-size:var(--snice-font-size-sm, .875rem);font-family:inherit;color:var(--snice-color-text,rgb(23 23 23));box-sizing:border-box}.select-search-input:focus-visible{outline:0;border-color:var(--snice-color-primary,rgb(37 99 235))}.select-options{max-height:12.5rem;overflow-y:auto;overflow-x:hidden;padding:.25rem;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--snice-color-border,rgb(226 226 226)) var(--snice-color-surface-container-low,rgb(245 245 245))}.select-options::-webkit-scrollbar-track{background:var(--snice-color-surface-container-low,rgb(245 245 245));border-radius:var(--snice-border-radius-md,.25rem);margin:.25rem 0}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);border:2px solid var(--snice-color-surface,rgb(255 255 255))}.select-option{padding:.5rem .75rem;cursor:pointer;border-radius:var(--snice-border-radius-sm,.125rem);transition:background var(--snice-transition-fast, 150ms) ease;display:flex;align-items:center;gap:.5rem}.select-option:hover:not(.select-option--disabled){background:var(--snice-color-surface-container-low,rgb(245 245 245))}.select-option--selected{background:var(--snice-color-primary-subtle,rgb(219 234 254));color:var(--snice-color-primary,rgb(37 99 235));font-weight:var(--snice-font-weight-medium,500)}.select-option--focused{background:var(--snice-color-surface-container-low,rgb(245 245 245));outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:-2px}.select-option--disabled{opacity:.5;cursor:not-allowed}.select-option-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-option-check{width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;flex-shrink:0}.select-option-label{flex:1}.select-no-options{padding:1rem;text-align:center;color:var(--snice-color-text-secondary,rgb(82 82 82));font-size:var(--snice-font-size-sm, .875rem)}.select-native{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.select-options::-webkit-scrollbar{width:6px}.select-options::-webkit-scrollbar-track{background:var(--snice-color-surface-container-low,rgb(245 245 245));border-radius:3px}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border,rgb(226 226 226));border-radius:3px}.select-options::-webkit-scrollbar-thumb:hover{background:var(--snice-color-border-hover,rgb(180 180 180))}.select-trigger--loading{cursor:wait;opacity:.7}.select-spinner{display:inline-block;width:.875rem;height:.875rem;margin-right:.25rem}.select-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.select-freetext-input{flex:1;border:none;outline:0;background:0 0;font-family:inherit;font-size:inherit;color:var(--snice-color-text,rgb(23 23 23));padding:0;min-width:0;width:100%}.select-freetext-input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-editable-container{position:relative;display:flex;align-items:center;width:100%}.select-editable-input{width:100%;box-sizing:border-box;font-family:inherit;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));color:var(--snice-color-text,rgb(23 23 23));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);transition:all var(--snice-transition-fast, 150ms) ease;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.select-editable-input--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.select-editable-input--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:2.5rem}.select-editable-input--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.select-editable-input:hover:not(:disabled){border-color:var(--snice-color-border-hover,rgb(180 180 180))}.select-editable-input:focus-visible{border-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.select-editable-input--open{border-color:var(--snice-color-primary,rgb(37 99 235))}.select-editable-input:disabled{background:var(--snice-color-surface-container-low,rgb(245 245 245));color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed;opacity:.6}.select-editable-input:read-only{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:default}.select-editable-input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82));opacity:.7}.select-editable-arrow{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none;transition:transform var(--snice-transition-fast, 150ms) ease}.select-editable-arrow--open{transform:translateY(-50%) rotate(180deg)}.select-loading-indicator{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.75rem 1rem;color:var(--snice-color-text-secondary,rgb(82 82 82));font-size:var(--snice-font-size-sm, .875rem)}.select-loading-spinner{display:inline-block;width:1rem;height:1rem;flex-shrink:0}.select-loading-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid var(--snice-color-border,rgb(226 226 226));border-top-color:var(--snice-color-primary,rgb(37 99 235));border-radius:50%;animation:.6s linear infinite spin}"}`}init(){this.readOptionsFromChildren(),this.multiple&&this.value&&(this.selectedValues=new Set(this.value.split(",").map(e=>e.trim()))),this.filteredOptions=[...this.mergedOptions],this.internals&&this.internals.setFormValue(this.value),this.editable?(this.syncEditableInputToValue(),this.updateEditableState()):(this.updateTriggerState(),this.updateValueDisplay(),this.updateClearButton()),this.updateDropdownState(),this.updateDropdownContent(),this.observeChildren(),this.setupGlobalListeners()}onReconnect(){this.setupGlobalListeners(),this.observeChildren()}cleanup(){this.removeGlobalListeners(),this.childObserver?.disconnect()}setupGlobalListeners(){this.outsideClickHandler=e=>{if(!this.isOpen)return;e.composedPath().includes(this)||(this.editable&&this.commitEditableValue(),this.closeDropdown())},this.globalKeyHandler=e=>{if(!this.isOpen||this.editable)return;const t=e.composedPath()[0]===this.searchInput;switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":case" ":if(" "===e.key&&t)return;if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.mergedOptions)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}},document.addEventListener("click",this.outsideClickHandler),document.addEventListener("keydown",this.globalKeyHandler)}removeGlobalListeners(){this.outsideClickHandler&&document.removeEventListener("click",this.outsideClickHandler),this.globalKeyHandler&&document.removeEventListener("keydown",this.globalKeyHandler)}observeChildren(){const e=new MutationObserver(e=>{this.handleChildrenChange(e)});e.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),this.childObserver=e}handleChildrenChange(e){e.some(e=>"childList"===e.type||!("attributes"!==e.type||!["value","label","disabled","selected"].includes(e.attributeName))&&"SNICE-OPTION"===e.target.nodeName)&&(this.readOptionsFromChildren(),this.filteredOptions=[...this.mergedOptions],this.editable||(this.updateValueDisplay(),this.updateClearButton()),this.updateDropdownContent())}readOptionsFromChildren(){const e=Array.from(this.querySelectorAll("snice-option"));this.childOptions=e.map(e=>{const t=e;return t.optionData?t.optionData:{value:e.getAttribute("value")||"",label:e.getAttribute("label")||e.textContent?.trim()||"",disabled:e.hasAttribute("disabled"),selected:e.hasAttribute("selected")}})}handleEditableInput(e){const t=e.target;this.editableInputValue=t.value,this.filterEditableOptions(this.editableInputValue),this.isOpen||this.openDropdown()}handleEditableFocus(){this.isOpen||this.readonly||this.openDropdown()}handleEditableBlur(e){setTimeout(()=>{this.isOpen&&(this.commitEditableValue(),this.closeDropdown())},200)}handleEditableClick(){this.isOpen||this.disabled||this.readonly||this.openDropdown()}handleEditableArrowClick(e){e.preventDefault(),e.stopPropagation(),this.disabled||this.readonly||(this.isOpen?this.closeDropdown():(this.openDropdown(),this.editableInput?.focus()))}handleEditableKeydown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this.isOpen?this.focusNextOption():this.openDropdown();break;case"ArrowUp":e.preventDefault(),this.isOpen&&this.focusPreviousOption();break;case"Enter":if(e.preventDefault(),this.isOpen&&this.focusedIndex>=0){const e=this.filteredOptions[this.focusedIndex];e&&!e.disabled&&this.handleEditableOptionSelect(e)}else this.isOpen&&(this.commitEditableValue(),this.closeDropdown());break;case"Escape":this.isOpen&&(this.closeDropdown(),this.syncEditableInputToValue());break;case"Tab":this.isOpen&&(this.commitEditableValue(),this.closeDropdown())}}handleEditableOptionSelect(e){this.value=e.value,this.editableInputValue=e.label,this.editableInput&&(this.editableInput.value=e.label),this.closeDropdown(),this.dispatchChangeEvent(e),this.editableInput?.focus()}commitEditableValue(){if(!this.editableInput)return;const e=this.editableInput.value.trim(),t=this.mergedOptions.find(t=>t.label.toLowerCase()===e.toLowerCase());t?(this.value=t.value,this.editableInputValue=t.label,this.editableInput.value=t.label,this.dispatchChangeEvent(t)):this.allowFreeText&&e?(this.value=e,this.editableInputValue=e,this.dispatchChangeEvent()):this.syncEditableInputToValue()}filterEditableOptions(e){if(this.remote)return void this.scheduleRemoteSearch(e);const t=this.mergedOptions;if(e){const i=e.toLowerCase();this.filteredOptions=t.filter(e=>e.label.toLowerCase().includes(i))}else this.filteredOptions=[...t];this.focusedIndex=-1,this.updateDropdownContent()}syncEditableInputToValue(){if(this.editableInput)if(this.value){const e=this.mergedOptions.find(e=>e.value===this.value);e?(this.editableInput.value=e.label,this.editableInputValue=e.label):this.allowFreeText?(this.editableInput.value=this.value,this.editableInputValue=this.value):(this.editableInput.value="",this.editableInputValue="")}else this.editableInput.value="",this.editableInputValue=""}updateEditableState(){this.editableInput&&(this.editableInput.setAttribute("aria-expanded",String(this.isOpen)),this.editableInput.classList.toggle("select-editable-input--open",this.isOpen))}handleDropdownMousedown(e){this.editable&&e.preventDefault()}handleTriggerOpen(e){["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)&&(e.preventDefault(),this.isOpen||this.openDropdown())}handleSearchKeydown(e){switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.mergedOptions)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}}focusNextOption(){const e=this.searchable||this.editable?this.filteredOptions:this.mergedOptions;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);e[this.focusedIndex]?.disabled;)this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);this.updateOptionFocus()}}focusPreviousOption(){const e=this.searchable||this.editable?this.filteredOptions:this.mergedOptions;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);e[this.focusedIndex]?.disabled;)this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);this.updateOptionFocus()}}updateOptionFocus(){if(this.optionElements){this.optionElements.forEach((e,t)=>{e.classList.toggle("select-option--focused",t===this.focusedIndex)});const e=this.optionElements?.[this.focusedIndex];e&&e.scrollIntoView({block:"nearest"})}}handleClearClick(e){e.preventDefault(),e.stopPropagation(),this.clear()}handleTriggerClick(e){e.target.closest(".select-clear")||(e.stopPropagation(),this.disabled||this.readonly||this.toggleDropdown())}handleOptionsClick(e){const t=e.target;if(t.closest(".select-tag-remove")){e.stopPropagation();const i=t.closest(".select-tag-remove").getAttribute("data-value");return void(i&&this.multiple&&(this.selectedValues.delete(i),this.value=Array.from(this.selectedValues).join(","),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent()))}const i=t.closest(".select-option");if(!i)return;e.stopPropagation();const a=i.getAttribute("data-value");if(!a)return;const s=this.mergedOptions.find(e=>e.value===a);s&&!s.disabled&&(this.editable?this.handleEditableOptionSelect(s):this.handleOptionSelect(s))}handleSearchInput(e){const t=e.target.value;if(this.remote)return void this.scheduleRemoteSearch(t);const i=t.toLowerCase();this.filteredOptions=i?this.mergedOptions.filter(e=>e.label.toLowerCase().includes(i)):[...this.mergedOptions],this.focusedIndex=-1,this.updateDropdownContent()}handleOptionSelect(e){this.multiple?(this.selectedValues.has(e.value)?this.selectedValues.delete(e.value):this.selectedValues.add(e.value),this.value=Array.from(this.selectedValues).join(","),this.updateDropdownContent()):(this.value=e.value,this.closeDropdown()),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent(e)}handleValueChange(){this.multiple&&(this.selectedValues=new Set(this.value?this.value.split(",").map(e=>e.trim()):[])),this.editable?this.syncEditableInputToValue():(this.updateValueDisplay(),this.updateClearButton()),this.internals&&this.internals.setFormValue(this.value)}handleOptionsPropertyChange(){this.filteredOptions=[...this.mergedOptions],this.updateDropdownContent(),this.editable&&this.syncEditableInputToValue()}handleDisabledChange(){this.editable||(this.updateTriggerState(),this.updateClearButton()),this.disabled&&this.isOpen&&this.closeDropdown()}handleLoadingChange(){this.editable||(this.updateTriggerState(),this.updateClearButton()),this.loading&&this.isOpen&&!this.remote&&this.closeDropdown()}handleOpenChange(){if(this.updateDropdownState(),this.editable){if(this.updateEditableState(),this.isOpen)if(this.remote){const e=this.editableInput?.value||"";this.scheduleRemoteSearch(e)}else this.filteredOptions=[...this.mergedOptions],this.focusedIndex=-1,this.updateDropdownContent();this.isOpen||(this.focusedIndex=-1)}else{if(this.updateTriggerState(),this.isOpen&&this.searchable&&this.searchInput&&setTimeout(()=>this.searchInput?.focus(),100),this.isOpen&&this.remote&&this.searchable){const e=this.searchInput?.value||"";this.scheduleRemoteSearch(e)}this.isOpen||(this.focusedIndex=-1,this.searchInput&&(this.searchInput.value="",this.filteredOptions=[...this.mergedOptions],this.updateDropdownContent()))}}updateValueDisplay(){if(!this.valueDisplay)return;const e=this.mergedOptions.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value);if(this.multiple&&e.length>0)this.valueDisplay.innerHTML=`\n <div class="select-value--multiple">\n ${e.map(e=>`\n <span class="select-tag">\n <img class="select-tag-icon" src="${e.icon||""}" alt="" ${e.icon?"":"hidden"} />\n ${e.label}\n <span class="select-tag-remove" data-value="${e.value}" aria-label="Remove ${e.label}" ${this.disabled||this.readonly?"hidden":""}>×</span>\n </span>\n `).join("")}\n </div>\n `;else if(e.length>0){const t=e[0];this.valueDisplay.innerHTML=`\n <div class="select-value--single">\n <img class="select-value-icon" src="${t.icon||""}" alt="" ${t.icon?"":"hidden"} />\n <span>${t.label}</span>\n </div>\n `}else this.valueDisplay.innerHTML=`<span class="select-placeholder">${this.placeholder}</span>`}updateClearButton(){if(!this.clearButton)return;const e=this.mergedOptions.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value),t=this.clearable&&e.length>0&&!this.disabled&&!this.readonly;this.clearButton.style.display=t?"":"none"}updateDropdownContent(){this.optionsList&&(this.optionsList.innerHTML=this.renderOptions())}dispatchChangeEvent(e){return{value:this.multiple?Array.from(this.selectedValues):this.value,option:e,select:this}}dispatchOpenEvent(){return{select:this}}dispatchCloseEvent(){return{select:this}}focus(){this.editable?this.editableInput?.focus():this.trigger?.focus()}blur(){this.editable?this.editableInput?.blur():this.trigger?.blur(),this.isOpen&&this.closeDropdown()}clear(){this.multiple?(this.selectedValues.clear(),this.value=""):this.value="",this.editable?this.syncEditableInputToValue():(this.updateValueDisplay(),this.updateClearButton()),this.dispatchChangeEvent()}openDropdown(){this.isOpen||this.disabled||this.readonly||(this.open=!0,this.dispatchOpenEvent())}closeDropdown(){this.isOpen&&(this.open=!1,this.dispatchCloseEvent())}toggleDropdown(){this.isOpen?this.closeDropdown():this.openDropdown()}selectOption(e){const t=this.mergedOptions.find(t=>t.value===e);t&&!t.disabled&&(this.editable?this.handleEditableOptionSelect(t):this.handleOptionSelect(t))}updateTriggerState(){this.trigger&&(this.trigger.classList.toggle("select-trigger--open",this.isOpen),this.trigger.classList.toggle("select-trigger--disabled",this.disabled),this.trigger.classList.toggle("select-trigger--readonly",this.readonly),this.trigger.classList.toggle("select-trigger--invalid",this.invalid),this.trigger.classList.toggle("select-trigger--loading",this.loading),this.trigger.setAttribute("aria-expanded",String(this.isOpen)),this.trigger.disabled=this.disabled||this.loading)}updateDropdownState(){this.dropdown&&(this.dropdown.classList.toggle("select-dropdown--open",this.isOpen),this.arrow&&this.arrow.classList.toggle("select-arrow--open",this.isOpen))}})})();(()=>{let e,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z=[t.element("snice-button",{formAssociated:!0})],$=[],A=HTMLElement,F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],q=[],_=[],W=[],K=[],Y=[],U=[],G=[],J=[],X=[],Z=[],Q=[],ee=[],te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],pe=[],me=[];(class extends A{static{n=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(A[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Boolean})],d=[t.property({type:Boolean})],h=[t.property({type:Boolean})],u=[t.property({type:Boolean})],p=[t.property({type:Boolean})],m=[t.property({type:String})],g=[t.property({type:String})],b=[t.property({type:String})],v=[t.property({type:String})],f=[t.property({attribute:"icon-placement"})],y=[t.property({attribute:"justify-text"})],w=[t.query('[slot="icon"]',{light:!0})],k=[t.query(".button")],x=[t.query(".spinner")],S=[t.query(".label")],C=[t.query(".icon")],E=[t.render()],D=[t.styles()],i(this,null,E,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:s},null,F),i(this,null,D,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:s},null,F),i(null,null,l,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:s},T,L),i(null,null,r,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:s},M,R),i(null,null,o,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:s},j,O),i(null,null,c,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:s},B,I),i(null,null,d,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:s},P,H),i(null,null,h,{kind:"field",name:"outline",static:!1,private:!1,access:{has:e=>"outline"in e,get:e=>e.outline,set:(e,t)=>{e.outline=t}},metadata:s},V,N),i(null,null,u,{kind:"field",name:"pill",static:!1,private:!1,access:{has:e=>"pill"in e,get:e=>e.pill,set:(e,t)=>{e.pill=t}},metadata:s},q,_),i(null,null,p,{kind:"field",name:"circle",static:!1,private:!1,access:{has:e=>"circle"in e,get:e=>e.circle,set:(e,t)=>{e.circle=t}},metadata:s},W,K),i(null,null,m,{kind:"field",name:"href",static:!1,private:!1,access:{has:e=>"href"in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:s},Y,U),i(null,null,g,{kind:"field",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:s},G,J),i(null,null,b,{kind:"field",name:"download",static:!1,private:!1,access:{has:e=>"download"in e,get:e=>e.download,set:(e,t)=>{e.download=t}},metadata:s},X,Z),i(null,null,v,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:s},Q,ee),i(null,null,f,{kind:"field",name:"iconPlacement",static:!1,private:!1,access:{has:e=>"iconPlacement"in e,get:e=>e.iconPlacement,set:(e,t)=>{e.iconPlacement=t}},metadata:s},te,ie),i(null,null,y,{kind:"field",name:"justifyText",static:!1,private:!1,access:{has:e=>"justifyText"in e,get:e=>e.justifyText,set:(e,t)=>{e.justifyText=t}},metadata:s},ae,se),i(null,null,w,{kind:"field",name:"iconSlotChild",static:!1,private:!1,access:{has:e=>"iconSlotChild"in e,get:e=>e.iconSlotChild,set:(e,t)=>{e.iconSlotChild=t}},metadata:s},ne,le),i(null,null,k,{kind:"field",name:"button",static:!1,private:!1,access:{has:e=>"button"in e,get:e=>e.button,set:(e,t)=>{e.button=t}},metadata:s},re,oe),i(null,null,x,{kind:"field",name:"spinner",static:!1,private:!1,access:{has:e=>"spinner"in e,get:e=>e.spinner,set:(e,t)=>{e.spinner=t}},metadata:s},ce,de),i(null,null,S,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:s},he,ue),i(null,null,C,{kind:"field",name:"iconElement",static:!1,private:!1,access:{has:e=>"iconElement"in e,get:e=>e.iconElement,set:(e,t)=>{e.iconElement=t}},metadata:s},pe,me),i(null,e={value:n},z,{kind:"class",name:n.name,metadata:s},null,$),n=e.value,s&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),a(n,$)}constructor(){super(),this.internals=a(this,F),this.variant=a(this,T,"default"),this.size=(a(this,L),a(this,M,"medium")),this.type=(a(this,R),a(this,j,"button")),this.disabled=(a(this,O),a(this,B,!1)),this.loading=(a(this,I),a(this,P,!1)),this.outline=(a(this,H),a(this,V,!1)),this.pill=(a(this,N),a(this,q,!1)),this.circle=(a(this,_),a(this,W,!1)),this.href=(a(this,K),a(this,Y,"")),this.target=(a(this,U),a(this,G,"")),this.download=(a(this,J),a(this,X,"")),this.icon=(a(this,Z),a(this,Q,"")),this.iconPlacement=(a(this,ee),a(this,te,"start")),this.justifyText=(a(this,ie),a(this,ae,"center")),this.iconSlotChild=(a(this,se),a(this,ne,void 0)),this.button=(a(this,le),a(this,re,void 0)),this.spinner=(a(this,oe),a(this,ce,void 0)),this.label=(a(this,de),a(this,he,void 0)),this.iconElement=(a(this,ue),a(this,pe,void 0)),a(this,me),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}get hasIconSlot(){return!!this.iconSlotChild}render(){const e=this.icon||this.hasIconSlot,i=e&&"start"===this.iconPlacement,a=e&&"end"===this.iconPlacement,n=["button",`button--${this.variant||"default"}`,`button--${this.size||"medium"}`,this.outline?"button--outline":"",this.pill?"button--pill":"",this.circle?"button--circle":"",this.loading?"button--loading":"",this.disabled?"button--disabled":"",e?"button--has-icon":"",e?`button--icon-${this.iconPlacement}`:""].filter(Boolean).join(" ");return t.html`
|
|
212
|
+
`}renderOptions(){if(this.remoteSearching)return'\n <div class="select-loading-indicator">\n <span class="select-loading-spinner"></span>\n <span>Searching...</span>\n </div>\n ';const e=this.searchable||this.editable||this.remote?this.filteredOptions:this.mergedOptions;return 0===e.length?`\n <div class="select-no-options">\n <span class="select-no-options-text" data-search="true" ${!(this.searchable||this.editable||this.remote)||this.filteredOptions.length>0?"hidden":""}>No matches found</span>\n <span class="select-no-options-text" data-search="false" ${(this.searchable||this.editable||this.remote)&&0===this.filteredOptions.length?"hidden":""}>No options available</span>\n </div>\n `:e.map((e,t)=>{const i=this.multiple?this.selectedValues.has(e.value):e.value===this.value;return`\n <div class="select-option\n ${i?"select-option--selected":""}\n ${e.disabled?"select-option--disabled":""}\n ${t===this.focusedIndex?"select-option--focused":""}\n ${e.icon?"select-option--has-icon":""}"\n data-value="${e.value}"\n role="option"\n aria-selected="${i}"\n aria-disabled="${e.disabled}"\n part="option">\n <span class="select-option-check" aria-hidden="true" ${this.multiple?"":"hidden"}>\n <span class="select-option-check-mark" ${i?"":"hidden"}>✓</span>\n </span>\n <img class="select-option-icon" src="${e.icon||""}" alt="" ${e.icon?"":"hidden"} />\n <span class="select-option-label">${e.label}</span>\n </div>\n `}).join("")}styles(){return t.css`${":host{display:inline-block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);position:relative;width:100%;max-width:18.75rem}[hidden]{display:none!important}img[src=\"\"]{display:none}.select-wrapper{position:relative;width:100%}.select-label{display:block;margin-bottom:.25rem;font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);line-height:var(--snice-line-height-normal, 1.5);color:var(--snice-color-text,rgb(23 23 23));text-align:left}.select-label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.select-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease;position:relative;text-align:left;font-family:inherit;color:var(--snice-color-text,rgb(23 23 23))}.select-trigger--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.select-trigger--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:var(--snice-select-min-height,2.5rem)}.select-trigger--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.select-trigger:hover:not(.select-trigger--disabled){border-color:var(--snice-color-border-hover,rgb(180 180 180))}.select-trigger:focus-visible{outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px;border-color:var(--snice-color-primary,rgb(37 99 235))}.select-trigger--open{border-color:var(--snice-color-primary,rgb(37 99 235))}.select-trigger--disabled{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:not-allowed;opacity:.6}.select-trigger--readonly{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:default}.select-trigger--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.select-placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-value--single{display:flex;align-items:center;gap:.5rem}.select-value-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-value--multiple{display:flex;gap:.25rem;flex-wrap:wrap}.select-tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--snice-color-primary-subtle,rgb(219 234 254));color:var(--snice-color-primary,rgb(37 99 235));border-radius:var(--snice-border-radius-sm,.125rem);font-size:var(--snice-font-size-xs, .75rem)}.select-tag-icon{width:.75rem;height:.75rem;object-fit:contain;flex-shrink:0}.select-tag-remove{cursor:pointer;padding:0;background:0 0;border:none;color:inherit;font-size:.75rem;line-height:1}.select-tag-remove:hover{opacity:.7}.select-icons{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:.25rem;pointer-events:none;z-index:1}.select-clear{padding:.125rem;background:0 0;border:none;cursor:pointer;color:var(--snice-color-text-secondary,rgb(82 82 82));display:flex;align-items:center;justify-content:center;border-radius:var(--snice-border-radius-sm,.125rem);pointer-events:auto}.select-clear:hover{background:var(--snice-color-surface-container-low,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.select-arrow{transition:transform var(--snice-transition-fast, 150ms) ease;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none}.select-arrow--open{transform:rotate(180deg)}.select-dropdown{position:absolute;top:100%;margin-top:.25rem;left:0;right:0;background:var(--snice-color-surface-container-high,rgb(252 251 249));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);box-shadow:var(--snice-shadow-lg,0 10px 15px -3px rgb(0 0 0 / .1),0 4px 6px -4px rgb(0 0 0 / .1));z-index:1000;opacity:0;transform:translateY(-8px) scaleY(.95);transform-origin:top;pointer-events:none;transition:opacity var(--snice-transition-fast, 150ms) ease,transform var(--snice-transition-fast, 150ms) ease;display:flex;flex-direction:column;overflow:hidden}.select-dropdown--open{opacity:1;transform:translateY(0) scaleY(1);pointer-events:auto}.select-search{padding:.5rem;border-bottom:1px solid var(--snice-color-border,rgb(226 226 226));flex-shrink:0}.select-search-input{width:100%;padding:.375rem .625rem;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-sm,.125rem);font-size:var(--snice-font-size-sm, .875rem);font-family:inherit;color:var(--snice-color-text,rgb(23 23 23));box-sizing:border-box}.select-search-input:focus-visible{outline:0;border-color:var(--snice-color-primary,rgb(37 99 235))}.select-options{max-height:12.5rem;overflow-y:auto;overflow-x:hidden;padding:.25rem;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--snice-color-border,rgb(226 226 226)) var(--snice-color-surface-container-low,rgb(245 245 245))}.select-options::-webkit-scrollbar-track{background:var(--snice-color-surface-container-low,rgb(245 245 245));border-radius:var(--snice-border-radius-md,.25rem);margin:.25rem 0}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);border:2px solid var(--snice-color-surface,rgb(255 255 255))}.select-option{padding:.5rem .75rem;cursor:pointer;border-radius:var(--snice-border-radius-sm,.125rem);transition:background var(--snice-transition-fast, 150ms) ease;display:flex;align-items:center;gap:.5rem}.select-option:hover:not(.select-option--disabled){background:var(--snice-color-surface-container-low,rgb(245 245 245))}.select-option--selected{background:var(--snice-color-primary-subtle,rgb(219 234 254));color:var(--snice-color-primary,rgb(37 99 235));font-weight:var(--snice-font-weight-medium,500)}.select-option--focused{background:var(--snice-color-surface-container-low,rgb(245 245 245));outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:-2px}.select-option--disabled{opacity:.5;cursor:not-allowed}.select-option-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-option-check{width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;flex-shrink:0}.select-option-label{flex:1}.select-no-options{padding:1rem;text-align:center;color:var(--snice-color-text-secondary,rgb(82 82 82));font-size:var(--snice-font-size-sm, .875rem)}.select-native{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.select-options::-webkit-scrollbar{width:6px}.select-options::-webkit-scrollbar-track{background:var(--snice-color-surface-container-low,rgb(245 245 245));border-radius:3px}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border,rgb(226 226 226));border-radius:3px}.select-options::-webkit-scrollbar-thumb:hover{background:var(--snice-color-border-hover,rgb(180 180 180))}.select-trigger--loading{cursor:wait;opacity:.7}.select-spinner{display:inline-block;width:.875rem;height:.875rem;margin-right:.25rem}.select-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.select-freetext-input{flex:1;border:none;outline:0;background:0 0;font-family:inherit;font-size:inherit;color:var(--snice-color-text,rgb(23 23 23));padding:0;min-width:0;width:100%}.select-freetext-input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-editable-container{position:relative;display:flex;align-items:center;width:100%}.select-editable-input{width:100%;box-sizing:border-box;font-family:inherit;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));color:var(--snice-color-text,rgb(23 23 23));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);transition:all var(--snice-transition-fast, 150ms) ease;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.select-editable-input--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.select-editable-input--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:2.5rem}.select-editable-input--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.select-editable-input:hover:not(:disabled){border-color:var(--snice-color-border-hover,rgb(180 180 180))}.select-editable-input:focus-visible{border-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.select-editable-input--open{border-color:var(--snice-color-primary,rgb(37 99 235))}.select-editable-input:disabled{background:var(--snice-color-surface-container-low,rgb(245 245 245));color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed;opacity:.6}.select-editable-input:read-only{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:default}.select-editable-input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82));opacity:.7}.select-editable-arrow{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none;transition:transform var(--snice-transition-fast, 150ms) ease}.select-editable-arrow--open{transform:translateY(-50%) rotate(180deg)}.select-loading-indicator{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.75rem 1rem;color:var(--snice-color-text-secondary,rgb(82 82 82));font-size:var(--snice-font-size-sm, .875rem)}.select-loading-spinner{display:inline-block;width:1rem;height:1rem;flex-shrink:0}.select-loading-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid var(--snice-color-border,rgb(226 226 226));border-top-color:var(--snice-color-primary,rgb(37 99 235));border-radius:50%;animation:.6s linear infinite spin}"}`}init(){this.readOptionsFromChildren(),this.multiple&&this.value&&(this.selectedValues=new Set(this.value.split(",").map(e=>e.trim()))),this.filteredOptions=[...this.mergedOptions],this.internals&&this.internals.setFormValue(this.value),this.editable?(this.syncEditableInputToValue(),this.updateEditableState()):(this.updateTriggerState(),this.updateValueDisplay(),this.updateClearButton()),this.updateDropdownState(),this.updateDropdownContent(),this.observeChildren(),this.setupGlobalListeners()}onReconnect(){this.setupGlobalListeners(),this.observeChildren()}cleanup(){this.removeGlobalListeners(),this.childObserver?.disconnect()}setupGlobalListeners(){this.outsideClickHandler=e=>{if(!this.isOpen)return;e.composedPath().includes(this)||(this.editable&&this.commitEditableValue(),this.closeDropdown())},this.globalKeyHandler=e=>{if(!this.isOpen||this.editable)return;const t=e.composedPath()[0]===this.searchInput;switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":case" ":if(" "===e.key&&t)return;if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.mergedOptions)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}},document.addEventListener("click",this.outsideClickHandler),document.addEventListener("keydown",this.globalKeyHandler)}removeGlobalListeners(){this.outsideClickHandler&&document.removeEventListener("click",this.outsideClickHandler),this.globalKeyHandler&&document.removeEventListener("keydown",this.globalKeyHandler)}observeChildren(){const e=new MutationObserver(e=>{this.handleChildrenChange(e)});e.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),this.childObserver=e}handleChildrenChange(e){e.some(e=>"childList"===e.type||!("attributes"!==e.type||!["value","label","disabled","selected"].includes(e.attributeName))&&"SNICE-OPTION"===e.target.nodeName)&&(this.readOptionsFromChildren(),this.filteredOptions=[...this.mergedOptions],this.editable||(this.updateValueDisplay(),this.updateClearButton()),this.updateDropdownContent())}readOptionsFromChildren(){const e=Array.from(this.querySelectorAll("snice-option"));this.childOptions=e.map(e=>{const t=e;return t.optionData?t.optionData:{value:e.getAttribute("value")||"",label:e.getAttribute("label")||e.textContent?.trim()||"",disabled:e.hasAttribute("disabled"),selected:e.hasAttribute("selected")}})}handleEditableInput(e){const t=e.target;this.editableInputValue=t.value,this.filterEditableOptions(this.editableInputValue),this.isOpen||this.openDropdown()}handleEditableFocus(){this.isOpen||this.readonly||this.openDropdown()}handleEditableBlur(e){setTimeout(()=>{this.isOpen&&(this.commitEditableValue(),this.closeDropdown())},200)}handleEditableClick(){this.isOpen||this.disabled||this.readonly||this.openDropdown()}handleEditableArrowClick(e){e.preventDefault(),e.stopPropagation(),this.disabled||this.readonly||(this.isOpen?this.closeDropdown():(this.openDropdown(),this.editableInput?.focus()))}handleEditableKeydown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this.isOpen?this.focusNextOption():this.openDropdown();break;case"ArrowUp":e.preventDefault(),this.isOpen&&this.focusPreviousOption();break;case"Enter":if(e.preventDefault(),this.isOpen&&this.focusedIndex>=0){const e=this.filteredOptions[this.focusedIndex];e&&!e.disabled&&this.handleEditableOptionSelect(e)}else this.isOpen&&(this.commitEditableValue(),this.closeDropdown());break;case"Escape":this.isOpen&&(this.closeDropdown(),this.syncEditableInputToValue());break;case"Tab":this.isOpen&&(this.commitEditableValue(),this.closeDropdown())}}handleEditableOptionSelect(e){this.value=e.value,this.editableInputValue=e.label,this.editableInput&&(this.editableInput.value=e.label),this.closeDropdown(),this.dispatchChangeEvent(e),this.editableInput?.focus()}commitEditableValue(){if(!this.editableInput)return;const e=this.editableInput.value.trim(),t=this.mergedOptions.find(t=>t.label.toLowerCase()===e.toLowerCase());t?(this.value=t.value,this.editableInputValue=t.label,this.editableInput.value=t.label,this.dispatchChangeEvent(t)):this.allowFreeText&&e?(this.value=e,this.editableInputValue=e,this.dispatchChangeEvent()):this.syncEditableInputToValue()}filterEditableOptions(e){if(this.remote)return void this.scheduleRemoteSearch(e);const t=this.mergedOptions;if(e){const i=e.toLowerCase();this.filteredOptions=t.filter(e=>e.label.toLowerCase().includes(i))}else this.filteredOptions=[...t];this.focusedIndex=-1,this.updateDropdownContent()}syncEditableInputToValue(){if(this.editableInput)if(this.value){const e=this.mergedOptions.find(e=>e.value===this.value);e?(this.editableInput.value=e.label,this.editableInputValue=e.label):this.allowFreeText?(this.editableInput.value=this.value,this.editableInputValue=this.value):(this.editableInput.value="",this.editableInputValue="")}else this.editableInput.value="",this.editableInputValue=""}updateEditableState(){this.editableInput&&(this.editableInput.setAttribute("aria-expanded",String(this.isOpen)),this.editableInput.classList.toggle("select-editable-input--open",this.isOpen))}handleDropdownMousedown(e){this.editable&&e.preventDefault()}handleTriggerOpen(e){["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)&&(e.preventDefault(),this.isOpen||this.openDropdown())}handleSearchKeydown(e){switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.mergedOptions)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}}focusNextOption(){const e=this.searchable||this.editable?this.filteredOptions:this.mergedOptions;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);e[this.focusedIndex]?.disabled;)this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);this.updateOptionFocus()}}focusPreviousOption(){const e=this.searchable||this.editable?this.filteredOptions:this.mergedOptions;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);e[this.focusedIndex]?.disabled;)this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);this.updateOptionFocus()}}updateOptionFocus(){if(this.optionElements){this.optionElements.forEach((e,t)=>{e.classList.toggle("select-option--focused",t===this.focusedIndex)});const e=this.optionElements?.[this.focusedIndex];e&&e.scrollIntoView({block:"nearest"})}}handleClearClick(e){e.preventDefault(),e.stopPropagation(),this.clear()}handleTriggerClick(e){e.target.closest(".select-clear")||(e.stopPropagation(),this.disabled||this.readonly||this.toggleDropdown())}handleOptionsClick(e){const t=e.target;if(t.closest(".select-tag-remove")){e.stopPropagation();const i=t.closest(".select-tag-remove").getAttribute("data-value");return void(i&&this.multiple&&(this.selectedValues.delete(i),this.value=Array.from(this.selectedValues).join(","),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent()))}const i=t.closest(".select-option");if(!i)return;e.stopPropagation();const a=i.getAttribute("data-value");if(!a)return;const s=this.mergedOptions.find(e=>e.value===a);s&&!s.disabled&&(this.editable?this.handleEditableOptionSelect(s):this.handleOptionSelect(s))}handleSearchInput(e){const t=e.target.value;if(this.remote)return void this.scheduleRemoteSearch(t);const i=t.toLowerCase();this.filteredOptions=i?this.mergedOptions.filter(e=>e.label.toLowerCase().includes(i)):[...this.mergedOptions],this.focusedIndex=-1,this.updateDropdownContent()}handleOptionSelect(e){this.multiple?(this.selectedValues.has(e.value)?this.selectedValues.delete(e.value):this.selectedValues.add(e.value),this.value=Array.from(this.selectedValues).join(","),this.updateDropdownContent()):(this.value=e.value,this.closeDropdown()),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent(e)}handleValueChange(){this.multiple&&(this.selectedValues=new Set(this.value?this.value.split(",").map(e=>e.trim()):[])),this.editable?this.syncEditableInputToValue():(this.updateValueDisplay(),this.updateClearButton()),this.internals&&this.internals.setFormValue(this.value)}handleOptionsPropertyChange(){this.filteredOptions=[...this.mergedOptions],this.updateDropdownContent(),this.editable&&this.syncEditableInputToValue()}handleDisabledChange(){this.editable||(this.updateTriggerState(),this.updateClearButton()),this.disabled&&this.isOpen&&this.closeDropdown()}handleLoadingChange(){this.editable||(this.updateTriggerState(),this.updateClearButton()),this.loading&&this.isOpen&&!this.remote&&this.closeDropdown()}handleOpenChange(){if(this.updateDropdownState(),this.editable){if(this.updateEditableState(),this.isOpen)if(this.remote){const e=this.editableInput?.value||"";this.scheduleRemoteSearch(e)}else this.filteredOptions=[...this.mergedOptions],this.focusedIndex=-1,this.updateDropdownContent();this.isOpen||(this.focusedIndex=-1)}else{if(this.updateTriggerState(),this.isOpen&&this.searchable&&this.searchInput&&setTimeout(()=>this.searchInput?.focus(),100),this.isOpen&&this.remote&&this.searchable){const e=this.searchInput?.value||"";this.scheduleRemoteSearch(e)}this.isOpen||(this.focusedIndex=-1,this.searchInput&&(this.searchInput.value="",this.filteredOptions=[...this.mergedOptions],this.updateDropdownContent()))}}updateValueDisplay(){if(!this.valueDisplay)return;const e=this.mergedOptions.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value);if(this.multiple&&e.length>0)this.valueDisplay.innerHTML=`\n <div class="select-value--multiple">\n ${e.map(e=>`\n <span class="select-tag">\n <img class="select-tag-icon" src="${e.icon||""}" alt="" ${e.icon?"":"hidden"} />\n ${e.label}\n <span class="select-tag-remove" data-value="${e.value}" aria-label="Remove ${e.label}" ${this.disabled||this.readonly?"hidden":""}>×</span>\n </span>\n `).join("")}\n </div>\n `;else if(e.length>0){const t=e[0];this.valueDisplay.innerHTML=`\n <div class="select-value--single">\n <img class="select-value-icon" src="${t.icon||""}" alt="" ${t.icon?"":"hidden"} />\n <span>${t.label}</span>\n </div>\n `}else this.valueDisplay.innerHTML=`<span class="select-placeholder">${this.placeholder}</span>`}updateClearButton(){if(!this.clearButton)return;const e=this.mergedOptions.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value),t=this.clearable&&e.length>0&&!this.disabled&&!this.readonly;this.clearButton.style.display=t?"":"none"}updateDropdownContent(){this.optionsList&&(this.optionsList.innerHTML=this.renderOptions())}dispatchChangeEvent(e){return{value:this.multiple?Array.from(this.selectedValues):this.value,option:e,select:this}}dispatchOpenEvent(){return{select:this}}dispatchCloseEvent(){return{select:this}}focus(){this.editable?this.editableInput?.focus():this.trigger?.focus()}blur(){this.editable?this.editableInput?.blur():this.trigger?.blur(),this.isOpen&&this.closeDropdown()}clear(){this.multiple?(this.selectedValues.clear(),this.value=""):this.value="",this.editable?this.syncEditableInputToValue():(this.updateValueDisplay(),this.updateClearButton()),this.dispatchChangeEvent()}openDropdown(){this.isOpen||this.disabled||this.readonly||(this.open=!0,this.dispatchOpenEvent())}closeDropdown(){this.isOpen&&(this.open=!1,this.dispatchCloseEvent())}toggleDropdown(){this.isOpen?this.closeDropdown():this.openDropdown()}selectOption(e){const t=this.mergedOptions.find(t=>t.value===e);t&&!t.disabled&&(this.editable?this.handleEditableOptionSelect(t):this.handleOptionSelect(t))}updateTriggerState(){this.trigger&&(this.trigger.classList.toggle("select-trigger--open",this.isOpen),this.trigger.classList.toggle("select-trigger--disabled",this.disabled),this.trigger.classList.toggle("select-trigger--readonly",this.readonly),this.trigger.classList.toggle("select-trigger--invalid",this.invalid),this.trigger.classList.toggle("select-trigger--loading",this.loading),this.trigger.setAttribute("aria-expanded",String(this.isOpen)),this.trigger.disabled=this.disabled||this.loading)}updateDropdownState(){this.dropdown&&(this.dropdown.classList.toggle("select-dropdown--open",this.isOpen),this.arrow&&this.arrow.classList.toggle("select-arrow--open",this.isOpen))}})})();(()=>{let e,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z=[t.element("snice-button",{formAssociated:!0})],$=[],A=HTMLElement,F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[],K=[],Y=[],U=[],G=[],J=[],X=[],Z=[],Q=[],ee=[],te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],pe=[],me=[];(class extends A{static{n=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(A[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Boolean})],d=[t.property({type:Boolean})],h=[t.property({type:Boolean})],u=[t.property({type:Boolean})],p=[t.property({type:Boolean})],m=[t.property({type:String})],g=[t.property({type:String})],b=[t.property({type:String})],v=[t.property({type:String})],f=[t.property({attribute:"icon-placement"})],y=[t.property({attribute:"justify-text"})],w=[t.query('[slot="icon"]',{light:!0})],k=[t.query(".button")],x=[t.query(".spinner")],S=[t.query(".label")],C=[t.query(".icon")],E=[t.render()],D=[t.styles()],i(this,null,E,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:s},null,F),i(this,null,D,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:s},null,F),i(null,null,l,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:s},T,L),i(null,null,r,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:s},M,R),i(null,null,o,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:s},j,O),i(null,null,c,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:s},B,I),i(null,null,d,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:s},P,H),i(null,null,h,{kind:"field",name:"outline",static:!1,private:!1,access:{has:e=>"outline"in e,get:e=>e.outline,set:(e,t)=>{e.outline=t}},metadata:s},V,N),i(null,null,u,{kind:"field",name:"pill",static:!1,private:!1,access:{has:e=>"pill"in e,get:e=>e.pill,set:(e,t)=>{e.pill=t}},metadata:s},_,q),i(null,null,p,{kind:"field",name:"circle",static:!1,private:!1,access:{has:e=>"circle"in e,get:e=>e.circle,set:(e,t)=>{e.circle=t}},metadata:s},W,K),i(null,null,m,{kind:"field",name:"href",static:!1,private:!1,access:{has:e=>"href"in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:s},Y,U),i(null,null,g,{kind:"field",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:s},G,J),i(null,null,b,{kind:"field",name:"download",static:!1,private:!1,access:{has:e=>"download"in e,get:e=>e.download,set:(e,t)=>{e.download=t}},metadata:s},X,Z),i(null,null,v,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:s},Q,ee),i(null,null,f,{kind:"field",name:"iconPlacement",static:!1,private:!1,access:{has:e=>"iconPlacement"in e,get:e=>e.iconPlacement,set:(e,t)=>{e.iconPlacement=t}},metadata:s},te,ie),i(null,null,y,{kind:"field",name:"justifyText",static:!1,private:!1,access:{has:e=>"justifyText"in e,get:e=>e.justifyText,set:(e,t)=>{e.justifyText=t}},metadata:s},ae,se),i(null,null,w,{kind:"field",name:"iconSlotChild",static:!1,private:!1,access:{has:e=>"iconSlotChild"in e,get:e=>e.iconSlotChild,set:(e,t)=>{e.iconSlotChild=t}},metadata:s},ne,le),i(null,null,k,{kind:"field",name:"button",static:!1,private:!1,access:{has:e=>"button"in e,get:e=>e.button,set:(e,t)=>{e.button=t}},metadata:s},re,oe),i(null,null,x,{kind:"field",name:"spinner",static:!1,private:!1,access:{has:e=>"spinner"in e,get:e=>e.spinner,set:(e,t)=>{e.spinner=t}},metadata:s},ce,de),i(null,null,S,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:s},he,ue),i(null,null,C,{kind:"field",name:"iconElement",static:!1,private:!1,access:{has:e=>"iconElement"in e,get:e=>e.iconElement,set:(e,t)=>{e.iconElement=t}},metadata:s},pe,me),i(null,e={value:n},z,{kind:"class",name:n.name,metadata:s},null,$),n=e.value,s&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),a(n,$)}constructor(){super(),this.internals=a(this,F),this.variant=a(this,T,"default"),this.size=(a(this,L),a(this,M,"medium")),this.type=(a(this,R),a(this,j,"button")),this.disabled=(a(this,O),a(this,B,!1)),this.loading=(a(this,I),a(this,P,!1)),this.outline=(a(this,H),a(this,V,!1)),this.pill=(a(this,N),a(this,_,!1)),this.circle=(a(this,q),a(this,W,!1)),this.href=(a(this,K),a(this,Y,"")),this.target=(a(this,U),a(this,G,"")),this.download=(a(this,J),a(this,X,"")),this.icon=(a(this,Z),a(this,Q,"")),this.iconPlacement=(a(this,ee),a(this,te,"start")),this.justifyText=(a(this,ie),a(this,ae,"center")),this.iconSlotChild=(a(this,se),a(this,ne,void 0)),this.button=(a(this,le),a(this,re,void 0)),this.spinner=(a(this,oe),a(this,ce,void 0)),this.label=(a(this,de),a(this,he,void 0)),this.iconElement=(a(this,ue),a(this,pe,void 0)),a(this,me),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}get hasIconSlot(){return!!this.iconSlotChild}render(){const e=this.icon||this.hasIconSlot,i=e&&"start"===this.iconPlacement,a=e&&"end"===this.iconPlacement,n=["button",`button--${this.variant||"default"}`,`button--${this.size||"medium"}`,this.outline?"button--outline":"",this.pill?"button--pill":"",this.circle?"button--circle":"",this.loading?"button--loading":"",this.disabled?"button--disabled":"",e?"button--has-icon":"",e?`button--icon-${this.iconPlacement}`:""].filter(Boolean).join(" ");return t.html`
|
|
213
213
|
<button class="${n}" type="${this.type}" ?disabled="${this.disabled}" part="base" @click="${e=>this.handleInternalClick(e)}">
|
|
214
214
|
<span class="spinner" part="spinner"></span>
|
|
215
215
|
<if ${i}>
|
|
@@ -234,7 +234,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
234
234
|
</span>
|
|
235
235
|
</if>
|
|
236
236
|
</button>
|
|
237
|
-
`}handleInternalClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation();if(this.href)if(this.download){const e=document.createElement("a");e.href=this.href,e.download=this.download,e.click()}else this.target?window.open(this.href,this.target):window.location.href=this.href;const t=this.internals?.form||this.closest("form");if(t)switch(this.type){case"submit":t.requestSubmit();break;case"reset":t.reset()}this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}styles(){return t.css`${":host{display:inline-block;position:relative;width:auto;cursor:pointer}:host([disabled]){cursor:not-allowed}:host([justify-text=start]) .button{justify-content:flex-start}:host([justify-text=end]) .button{justify-content:flex-end}:host([justify-text=center]) .button{justify-content:center}.button{display:inline-flex;align-items:center;justify-content:center;width:100%;border:1px solid;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-weight:var(--snice-font-weight-medium,500);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;box-shadow:var(--snice-shadow-xs,0 1px 2px 0 rgb(0 0 0 / .03));transition:color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),background-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),border-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),box-shadow var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),transform 180ms var(--snice-ease-spring, cubic-bezier(.34,1.56,.64,1));cursor:inherit;position:relative}.button::before{content:'';position:absolute;inset:0;border-radius:inherit;background:var(--snice-gradient-convex,none);pointer-events:none}.button:active:not(.button--disabled){transition:color 50ms var(--snice-ease-out, ease),background-color 50ms var(--snice-ease-out, ease),border-color 50ms var(--snice-ease-out, ease),box-shadow 50ms var(--snice-ease-out, ease),transform 80ms var(--snice-ease-out, ease);transform:translateY(0) scale(.97)}.button:focus-visible{outline:0;box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.button--disabled{opacity:.5;cursor:not-allowed;box-shadow:none}.button--small{font-size:var(--snice-font-size-sm, .875rem);height:2rem;padding:0 var(--snice-spacing-sm,.75rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--medium{font-size:var(--snice-font-size-md, 1rem);height:2.5rem;padding:0 var(--snice-spacing-md,1rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--large{font-size:var(--snice-font-size-lg, 1.125rem);height:3rem;padding:0 var(--snice-spacing-lg,1.5rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--default{background-color:var(--snice-color-surface,rgb(255 255 255));color:var(--snice-color-text,rgb(23 23 23));border-color:var(--snice-color-border,rgb(226 226 226))}.button--default:hover:not(.button--disabled){background-color:var(--snice-color-surface-container-low,rgb(250 250 250));border-color:var(--snice-color-border-hover,rgb(204 204 204));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--default:active:not(.button--disabled){background-color:var(--snice-color-surface-container,rgb(248 248 248));border-color:var(--snice-color-border-hover,rgb(204 204 204));box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--primary{background-color:var(--snice-color-primary,rgb(37 99 235));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-primary,rgb(37 99 235))}.button--primary:hover:not(.button--disabled){background-color:var(--snice-color-primary-hover,rgb(29 78 216));border-color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--primary:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--success{background-color:var(--snice-color-success,rgb(22 163 74));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-success,rgb(22 163 74))}.button--success:hover:not(.button--disabled){background-color:var(--snice-color-success-hover,rgb(21 128 61));border-color:var(--snice-color-success-hover,rgb(21 128 61));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--success:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--warning{background-color:var(--snice-color-warning,rgb(202 138 4));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-warning,rgb(202 138 4))}.button--warning:hover:not(.button--disabled){background-color:var(--snice-color-warning-hover,rgb(161 98 7));border-color:var(--snice-color-warning-hover,rgb(161 98 7));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--warning:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-warning,rgb(202 138 4)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-warning,rgb(202 138 4)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--danger{background-color:var(--snice-color-danger,rgb(220 38 38));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-danger,rgb(220 38 38))}.button--danger:hover:not(.button--disabled){background-color:var(--snice-color-danger-hover,rgb(185 28 28));border-color:var(--snice-color-danger-hover,rgb(185 28 28));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--danger:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--text{background-color:transparent;color:var(--snice-color-primary,rgb(37 99 235));border-color:transparent;box-shadow:none}.button--text::before{display:none}.button--text:hover:not(.button--disabled){background-color:var(--snice-color-primary-alpha,rgb(37 99 235 / .1));color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:none;transform:none}.button--text:active:not(.button--disabled){background-color:var(--snice-color-primary-alpha-strong,rgb(37 99 235 / .15));box-shadow:none;transform:none}.button--outline{box-shadow:none}.button--outline::before{display:none}.button--outline.button--default{background-color:transparent;color:var(--snice-color-text,rgb(23 23 23))}.button--outline.button--primary{background-color:transparent;color:var(--snice-color-primary,rgb(37 99 235))}.button--outline.button--success{background-color:transparent;color:var(--snice-color-success,rgb(22 163 74))}.button--outline.button--warning{background-color:transparent;color:var(--snice-color-warning,rgb(202 138 4))}.button--outline.button--danger{background-color:transparent;color:var(--snice-color-danger,rgb(220 38 38))}.button--outline.button--default:hover:not(.button--disabled){background-color:var(--snice-color-surface-hover,rgb(245 245 245));box-shadow:none;transform:none}.button--outline.button--primary:hover:not(.button--disabled){background-color:var(--snice-color-primary-subtle,rgb(239 246 255));color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:none;transform:none}.button--outline.button--success:hover:not(.button--disabled){background-color:var(--snice-color-success-subtle,rgb(220 252 231));color:var(--snice-color-success-hover,rgb(21 128 61));box-shadow:none;transform:none}.button--outline.button--warning:hover:not(.button--disabled){background-color:var(--snice-color-warning-subtle,rgb(254 249 195));color:var(--snice-color-warning-hover,rgb(161 98 7));box-shadow:none;transform:none}.button--outline.button--danger:hover:not(.button--disabled){background-color:var(--snice-color-danger-subtle,rgb(254 226 226));color:var(--snice-color-danger-hover,rgb(185 28 28));box-shadow:none;transform:none}.button--outline:active:not(.button--disabled){background-color:var(--snice-color-primary-subtle-hover,var(--snice-color-surface-active,rgb(235 235 235)));box-shadow:none;transform:none}.button--pill{border-radius:var(--snice-border-radius-pill,9999px)}.button--circle{border-radius:var(--snice-border-radius-circle,50%);width:var(--size);padding:0}.button--small.button--circle{--size:2rem}.button--medium.button--circle{--size:2.5rem}.button--large.button--circle{--size:3rem}.button--loading{position:relative;cursor:wait}.button--loading .label{visibility:hidden}.spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:1em;height:1em}.button--loading .spinner{display:block}.spinner::after{content:'';display:block;width:100%;height:100%;box-sizing:border-box;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.icon-slot{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25em;height:1.25em;line-height:1}.icon-slot:empty{display:none}.icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25em;height:1.25em;line-height:1}.icon img{width:100%;height:100%;object-fit:contain}.icon svg{width:100%;height:100%}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;width:1.25em;height:1.25em;font-size:1.25em;line-height:1}.icon-slot ::slotted(svg){width:1.25em;height:1.25em}.icon-slot ::slotted(img){width:1.25em;height:1.25em;object-fit:contain}.button--icon-start .icon,.button--icon-start .icon-slot{margin-right:.5em}.button--icon-end .icon,.button--icon-end .icon-slot{margin-left:.5em}.button--circle .icon,.button--circle .icon-slot{margin:0;transform:none;width:auto;height:auto}.button--circle .icon-slot ::slotted(*){width:1.25em;height:1.25em;font-size:1.25em;line-height:1;display:flex;align-items:center;justify-content:center}.button--circle .icon-slot ::slotted(svg){width:1.25em;height:1.25em}"}`}setLoading(e){this.loading=e}setDisabled(e){this.disabled=e}setVariant(e){this.variant=e}focus(e){this.button?.focus(e)}blur(){this.button?.blur()}click(){this.button?.click()}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C=[t.element("snice-checkbox",{formAssociated:!0})],E=[],D=HTMLElement,z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],q=[],_=[],W=[],K=[],Y=[],U=[],G=[],J=[],X=[],Z=[],Q=[],ee=[],te=[];(class extends D{static{s=this}static{const ie="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean})],l=[t.property({type:Boolean})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({type:Boolean})],d=[t.property({type:Boolean})],h=[t.property({})],u=[t.property({})],p=[t.property({})],m=[t.property({})],g=[t.query(".checkbox-input")],b=[t.query(".checkbox")],v=[t.query(".checkbox-label")],f=[t.query(".checkbox-wrapper")],y=[t.on("click")],w=[t.render()],k=[t.watch("checked")],x=[t.watch("indeterminate")],S=[t.styles()],i(this,null,y,{kind:"method",name:"handleCheckboxClick",static:!1,private:!1,access:{has:e=>"handleCheckboxClick"in e,get:e=>e.handleCheckboxClick},metadata:ie},null,z),i(this,null,w,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:ie},null,z),i(this,null,k,{kind:"method",name:"handleCheckedChange",static:!1,private:!1,access:{has:e=>"handleCheckedChange"in e,get:e=>e.handleCheckedChange},metadata:ie},null,z),i(this,null,x,{kind:"method",name:"handleIndeterminateChange",static:!1,private:!1,access:{has:e=>"handleIndeterminateChange"in e,get:e=>e.handleIndeterminateChange},metadata:ie},null,z),i(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:ie},null,z),i(null,null,n,{kind:"field",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:ie},$,A),i(null,null,l,{kind:"field",name:"indeterminate",static:!1,private:!1,access:{has:e=>"indeterminate"in e,get:e=>e.indeterminate,set:(e,t)=>{e.indeterminate=t}},metadata:ie},F,T),i(null,null,r,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:ie},L,M),i(null,null,o,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:ie},R,j),i(null,null,c,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:ie},O,B),i(null,null,d,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:ie},I,P),i(null,null,h,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:ie},H,V),i(null,null,u,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:ie},N,q),i(null,null,p,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:ie},_,W),i(null,null,m,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:ie},K,Y),i(null,null,g,{kind:"field",name:"input",static:!1,private:!1,access:{has:e=>"input"in e,get:e=>e.input,set:(e,t)=>{e.input=t}},metadata:ie},U,G),i(null,null,b,{kind:"field",name:"checkbox",static:!1,private:!1,access:{has:e=>"checkbox"in e,get:e=>e.checkbox,set:(e,t)=>{e.checkbox=t}},metadata:ie},J,X),i(null,null,v,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:e=>"labelElement"in e,get:e=>e.labelElement,set:(e,t)=>{e.labelElement=t}},metadata:ie},Z,Q),i(null,null,f,{kind:"field",name:"wrapper",static:!1,private:!1,access:{has:e=>"wrapper"in e,get:e=>e.wrapper,set:(e,t)=>{e.wrapper=t}},metadata:ie},ee,te),i(null,e={value:s},C,{kind:"class",name:s.name,metadata:ie},null,E),s=e.value,ie&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ie}),a(s,E)}constructor(){super(),this.internals=a(this,z),this.checked=a(this,$,!1),this.indeterminate=(a(this,A),a(this,F,!1)),this.disabled=(a(this,T),a(this,L,!1)),this.loading=(a(this,M),a(this,R,!1)),this.required=(a(this,j),a(this,O,!1)),this.invalid=(a(this,B),a(this,I,!1)),this.size=(a(this,P),a(this,H,"medium")),this.name=(a(this,V),a(this,N,"")),this.value=(a(this,q),a(this,_,"on")),this.label=(a(this,W),a(this,K,"")),this.input=(a(this,Y),a(this,U,void 0)),this.checkbox=(a(this,G),a(this,J,void 0)),this.labelElement=(a(this,X),a(this,Z,void 0)),this.wrapper=(a(this,Q),a(this,ee,void 0)),a(this,te),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}formResetCallback(){this.checked=!1,this.internals&&this.internals.setFormValue(null)}formDisabledCallback(e){this.disabled=e}handleCheckboxClick(e){if(this.disabled||this.loading)return;const t=this.shadowRoot?.querySelector('input[type="checkbox"]');t&&e.composedPath().includes(t)||this.toggle()}render(){const e=`checkbox-wrapper${this.disabled?" checkbox-wrapper--disabled":""}${this.loading?" checkbox-wrapper--loading":""}`,i=`checkbox checkbox--${this.size}${this.invalid?" checkbox--invalid":""}${this.indeterminate?" checkbox--indeterminate":""}${this.loading?" checkbox--loading":""}`,a=`checkbox-label checkbox-label--${this.size}${this.required?" checkbox-label--required":""}`;return t.html`
|
|
237
|
+
`}handleInternalClick(e){if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation();if(this.href)if(this.download){const e=document.createElement("a");e.href=this.href,e.download=this.download,e.click()}else this.target?window.open(this.href,this.target):window.location.href=this.href;const t=this.internals?.form||this.closest("form");if(t)switch(this.type){case"submit":t.requestSubmit();break;case"reset":t.reset()}this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}styles(){return t.css`${":host{display:inline-block;position:relative;width:auto;cursor:pointer}:host([disabled]){cursor:not-allowed}:host([justify-text=start]) .button{justify-content:flex-start}:host([justify-text=end]) .button{justify-content:flex-end}:host([justify-text=center]) .button{justify-content:center}.button{display:inline-flex;align-items:center;justify-content:center;width:100%;border:1px solid;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-weight:var(--snice-font-weight-medium,500);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;box-shadow:var(--snice-shadow-xs,0 1px 2px 0 rgb(0 0 0 / .03));transition:color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),background-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),border-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),box-shadow var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),transform 180ms var(--snice-ease-spring, cubic-bezier(.34,1.56,.64,1));cursor:inherit;position:relative}.button::before{content:'';position:absolute;inset:0;border-radius:inherit;background:var(--snice-gradient-convex,none);pointer-events:none}.button:active:not(.button--disabled){transition:color 50ms var(--snice-ease-out, ease),background-color 50ms var(--snice-ease-out, ease),border-color 50ms var(--snice-ease-out, ease),box-shadow 50ms var(--snice-ease-out, ease),transform 80ms var(--snice-ease-out, ease);transform:translateY(0) scale(.97)}.button:focus-visible{outline:0;box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.button--disabled{opacity:.5;cursor:not-allowed;box-shadow:none}.button--small{font-size:var(--snice-font-size-sm, .875rem);height:2rem;padding:0 var(--snice-spacing-sm,.75rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--medium{font-size:var(--snice-font-size-md, 1rem);height:2.5rem;padding:0 var(--snice-spacing-md,1rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--large{font-size:var(--snice-font-size-lg, 1.125rem);height:3rem;padding:0 var(--snice-spacing-lg,1.5rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--default{background-color:var(--snice-color-surface,rgb(255 255 255));color:var(--snice-color-text,rgb(23 23 23));border-color:var(--snice-color-border,rgb(226 226 226))}.button--default:hover:not(.button--disabled){background-color:var(--snice-color-surface-container-low,rgb(250 250 250));border-color:var(--snice-color-border-hover,rgb(204 204 204));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--default:active:not(.button--disabled){background-color:var(--snice-color-surface-container,rgb(248 248 248));border-color:var(--snice-color-border-hover,rgb(204 204 204));box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--primary{background-color:var(--snice-color-primary,rgb(37 99 235));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-primary,rgb(37 99 235))}.button--primary:hover:not(.button--disabled){background-color:var(--snice-color-primary-hover,rgb(29 78 216));border-color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--primary:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--success{background-color:var(--snice-color-success,rgb(22 163 74));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-success,rgb(22 163 74))}.button--success:hover:not(.button--disabled){background-color:var(--snice-color-success-hover,rgb(21 128 61));border-color:var(--snice-color-success-hover,rgb(21 128 61));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--success:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--warning{background-color:var(--snice-color-warning,rgb(202 138 4));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-warning,rgb(202 138 4))}.button--warning:hover:not(.button--disabled){background-color:var(--snice-color-warning-hover,rgb(161 98 7));border-color:var(--snice-color-warning-hover,rgb(161 98 7));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--warning:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-warning,rgb(202 138 4)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-warning,rgb(202 138 4)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--danger{background-color:var(--snice-color-danger,rgb(220 38 38));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-danger,rgb(220 38 38))}.button--danger:hover:not(.button--disabled){background-color:var(--snice-color-danger-hover,rgb(185 28 28));border-color:var(--snice-color-danger-hover,rgb(185 28 28));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--danger:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--text{background-color:transparent;color:var(--snice-color-primary,rgb(37 99 235));border-color:transparent;box-shadow:none}.button--text::before{display:none}.button--text:hover:not(.button--disabled){background-color:var(--snice-color-primary-alpha,rgb(37 99 235 / .1));color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:none;transform:none}.button--text:active:not(.button--disabled){background-color:var(--snice-color-primary-alpha-strong,rgb(37 99 235 / .15));box-shadow:none;transform:none}.button--outline{box-shadow:none}.button--outline::before{display:none}.button--outline.button--default{background-color:transparent;color:var(--snice-color-text,rgb(23 23 23))}.button--outline.button--primary{background-color:transparent;color:var(--snice-color-primary,rgb(37 99 235))}.button--outline.button--success{background-color:transparent;color:var(--snice-color-success,rgb(22 163 74))}.button--outline.button--warning{background-color:transparent;color:var(--snice-color-warning,rgb(202 138 4))}.button--outline.button--danger{background-color:transparent;color:var(--snice-color-danger,rgb(220 38 38))}.button--outline.button--default:hover:not(.button--disabled){background-color:var(--snice-color-surface-hover,rgb(245 245 245));box-shadow:none;transform:none}.button--outline.button--primary:hover:not(.button--disabled){background-color:var(--snice-color-primary-subtle,rgb(239 246 255));color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:none;transform:none}.button--outline.button--success:hover:not(.button--disabled){background-color:var(--snice-color-success-subtle,rgb(220 252 231));color:var(--snice-color-success-hover,rgb(21 128 61));box-shadow:none;transform:none}.button--outline.button--warning:hover:not(.button--disabled){background-color:var(--snice-color-warning-subtle,rgb(254 249 195));color:var(--snice-color-warning-hover,rgb(161 98 7));box-shadow:none;transform:none}.button--outline.button--danger:hover:not(.button--disabled){background-color:var(--snice-color-danger-subtle,rgb(254 226 226));color:var(--snice-color-danger-hover,rgb(185 28 28));box-shadow:none;transform:none}.button--outline:active:not(.button--disabled){background-color:var(--snice-color-primary-subtle-hover,var(--snice-color-surface-active,rgb(235 235 235)));box-shadow:none;transform:none}.button--pill{border-radius:var(--snice-border-radius-pill,9999px)}.button--circle{border-radius:var(--snice-border-radius-circle,50%);width:var(--size);padding:0}.button--small.button--circle{--size:2rem}.button--medium.button--circle{--size:2.5rem}.button--large.button--circle{--size:3rem}.button--loading{position:relative;cursor:wait}.button--loading .label{visibility:hidden}.spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:1em;height:1em}.button--loading .spinner{display:block}.spinner::after{content:'';display:block;width:100%;height:100%;box-sizing:border-box;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.icon-slot{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25em;height:1.25em;line-height:1}.icon-slot:empty{display:none}.icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25em;height:1.25em;line-height:1}.icon img{width:100%;height:100%;object-fit:contain}.icon svg{width:100%;height:100%}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;width:1.25em;height:1.25em;font-size:1.25em;line-height:1}.icon-slot ::slotted(svg){width:1.25em;height:1.25em}.icon-slot ::slotted(img){width:1.25em;height:1.25em;object-fit:contain}.button--icon-start .icon,.button--icon-start .icon-slot{margin-right:.5em}.button--icon-end .icon,.button--icon-end .icon-slot{margin-left:.5em}.button--circle .icon,.button--circle .icon-slot{margin:0;transform:none;width:auto;height:auto}.button--circle .icon-slot ::slotted(*){width:1.25em;height:1.25em;font-size:1.25em;line-height:1;display:flex;align-items:center;justify-content:center}.button--circle .icon-slot ::slotted(svg){width:1.25em;height:1.25em}"}`}setLoading(e){this.loading=e}setDisabled(e){this.disabled=e}setVariant(e){this.variant=e}focus(e){this.button?.focus(e)}blur(){this.button?.blur()}click(){this.button?.click()}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C=[t.element("snice-checkbox",{formAssociated:!0})],E=[],D=HTMLElement,z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[],K=[],Y=[],U=[],G=[],J=[],X=[],Z=[],Q=[],ee=[],te=[];(class extends D{static{s=this}static{const ie="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean})],l=[t.property({type:Boolean})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({type:Boolean})],d=[t.property({type:Boolean})],h=[t.property({})],u=[t.property({})],p=[t.property({})],m=[t.property({})],g=[t.query(".checkbox-input")],b=[t.query(".checkbox")],v=[t.query(".checkbox-label")],f=[t.query(".checkbox-wrapper")],y=[t.on("click")],w=[t.render()],k=[t.watch("checked")],x=[t.watch("indeterminate")],S=[t.styles()],i(this,null,y,{kind:"method",name:"handleCheckboxClick",static:!1,private:!1,access:{has:e=>"handleCheckboxClick"in e,get:e=>e.handleCheckboxClick},metadata:ie},null,z),i(this,null,w,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:ie},null,z),i(this,null,k,{kind:"method",name:"handleCheckedChange",static:!1,private:!1,access:{has:e=>"handleCheckedChange"in e,get:e=>e.handleCheckedChange},metadata:ie},null,z),i(this,null,x,{kind:"method",name:"handleIndeterminateChange",static:!1,private:!1,access:{has:e=>"handleIndeterminateChange"in e,get:e=>e.handleIndeterminateChange},metadata:ie},null,z),i(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:ie},null,z),i(null,null,n,{kind:"field",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:ie},$,A),i(null,null,l,{kind:"field",name:"indeterminate",static:!1,private:!1,access:{has:e=>"indeterminate"in e,get:e=>e.indeterminate,set:(e,t)=>{e.indeterminate=t}},metadata:ie},F,T),i(null,null,r,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:ie},L,M),i(null,null,o,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:ie},R,j),i(null,null,c,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:ie},O,B),i(null,null,d,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:ie},I,P),i(null,null,h,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:ie},H,V),i(null,null,u,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:ie},N,_),i(null,null,p,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:ie},q,W),i(null,null,m,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:ie},K,Y),i(null,null,g,{kind:"field",name:"input",static:!1,private:!1,access:{has:e=>"input"in e,get:e=>e.input,set:(e,t)=>{e.input=t}},metadata:ie},U,G),i(null,null,b,{kind:"field",name:"checkbox",static:!1,private:!1,access:{has:e=>"checkbox"in e,get:e=>e.checkbox,set:(e,t)=>{e.checkbox=t}},metadata:ie},J,X),i(null,null,v,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:e=>"labelElement"in e,get:e=>e.labelElement,set:(e,t)=>{e.labelElement=t}},metadata:ie},Z,Q),i(null,null,f,{kind:"field",name:"wrapper",static:!1,private:!1,access:{has:e=>"wrapper"in e,get:e=>e.wrapper,set:(e,t)=>{e.wrapper=t}},metadata:ie},ee,te),i(null,e={value:s},C,{kind:"class",name:s.name,metadata:ie},null,E),s=e.value,ie&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ie}),a(s,E)}constructor(){super(),this.internals=a(this,z),this.checked=a(this,$,!1),this.indeterminate=(a(this,A),a(this,F,!1)),this.disabled=(a(this,T),a(this,L,!1)),this.loading=(a(this,M),a(this,R,!1)),this.required=(a(this,j),a(this,O,!1)),this.invalid=(a(this,B),a(this,I,!1)),this.size=(a(this,P),a(this,H,"medium")),this.name=(a(this,V),a(this,N,"")),this.value=(a(this,_),a(this,q,"on")),this.label=(a(this,W),a(this,K,"")),this.input=(a(this,Y),a(this,U,void 0)),this.checkbox=(a(this,G),a(this,J,void 0)),this.labelElement=(a(this,X),a(this,Z,void 0)),this.wrapper=(a(this,Q),a(this,ee,void 0)),a(this,te),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}formResetCallback(){this.checked=!1,this.internals&&this.internals.setFormValue(null)}formDisabledCallback(e){this.disabled=e}handleCheckboxClick(e){if(this.disabled||this.loading)return;const t=this.shadowRoot?.querySelector('input[type="checkbox"]');t&&e.composedPath().includes(t)||this.toggle()}render(){const e=`checkbox-wrapper${this.disabled?" checkbox-wrapper--disabled":""}${this.loading?" checkbox-wrapper--loading":""}`,i=`checkbox checkbox--${this.size}${this.invalid?" checkbox--invalid":""}${this.indeterminate?" checkbox--indeterminate":""}${this.loading?" checkbox--loading":""}`,a=`checkbox-label checkbox-label--${this.size}${this.required?" checkbox-label--required":""}`;return t.html`
|
|
238
238
|
<label class="${e}" @change="${e=>this.handleInternalChange(e)}">
|
|
239
239
|
<input
|
|
240
240
|
type="checkbox"
|
|
@@ -270,7 +270,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
270
270
|
</span>
|
|
271
271
|
</if>
|
|
272
272
|
</label>
|
|
273
|
-
`}handleInternalChange(e){const t=e.target;"checkbox"===t.type&&(this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("checkbox-change",{bubbles:!0,composed:!0,detail:{checked:this.checked,indeterminate:this.indeterminate,checkbox:this}})))}handleCheckedChange(){this.input&&(this.input.checked=this.checked)}handleIndeterminateChange(){this.input&&(this.input.indeterminate=this.indeterminate)}styles(){return t.css`${":host{display:inline-flex;align-items:center;align-self:flex-end;min-height:2.5rem;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)}:host([size=small]){min-height:2rem;align-self:center}:host([size=large]){min-height:3rem;align-self:center}:host([compact]){min-height:0;align-self:center}.checkbox-wrapper{display:inline-flex;align-items:center;position:relative;cursor:pointer;user-select:none;min-height:1.25rem}.checkbox-wrapper--disabled{cursor:not-allowed;opacity:.6}.checkbox-input{position:absolute;opacity:0;left:0;top:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:1;pointer-events:all}.checkbox{position:relative;display:inline-flex;align-items:center;justify-content:center;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:2px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-sm,.125rem);transition:all var(--snice-transition-fast, 150ms) ease}.checkbox--small{width:1rem;height:1rem}.checkbox--medium{width:1.25rem;height:1.25rem}.checkbox--large{width:1.5rem;height:1.5rem}.checkbox-input:checked~.checkbox{background:var(--snice-color-primary,rgb(37 99 235));border-color:var(--snice-color-primary,rgb(37 99 235))}.checkbox-input:focus-visible~.checkbox{box-shadow:0 0 0 3px var(--snice-focus-ring-color,rgb(59 130 246 / .5));outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px}.checkbox-input:disabled~.checkbox{background:var(--snice-color-surface-container-low,rgb(250 250 250));border-color:var(--snice-color-border,rgb(226 226 226))}.checkbox-input:disabled:checked~.checkbox{background:var(--snice-color-text-secondary,rgb(82 82 82));border-color:var(--snice-color-text-secondary,rgb(82 82 82))}.checkbox--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-input:checked~.checkbox--invalid{background:var(--snice-color-danger,rgb(220 38 38));border-color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-icon{position:absolute;display:none;color:var(--snice-color-text-inverse,rgb(250 250 250))}.checkbox-input:checked~.checkbox .checkbox-icon--check{display:block}.checkbox--indeterminate .checkbox-icon--check{display:none!important}.checkbox--indeterminate .checkbox-icon--indeterminate{display:block!important}.checkbox--small .checkbox-icon{width:.75rem;height:.75rem}.checkbox--medium .checkbox-icon{width:.875rem;height:.875rem}.checkbox--large .checkbox-icon{width:1.125rem;height:1.125rem}.checkbox-label{margin-left:.5rem;color:var(--snice-color-text,rgb(23 23 23));cursor:pointer}.checkbox-label--small{font-size:var(--snice-font-size-sm, .875rem)}.checkbox-label--medium{font-size:var(--snice-font-size-md, 1rem)}.checkbox-label--large{font-size:var(--snice-font-size-lg, 1.125rem)}.checkbox-wrapper--disabled .checkbox-label{color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed}.checkbox-label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-wrapper:not(.checkbox-wrapper--disabled):hover .checkbox{border-color:var(--snice-color-primary,rgb(37 99 235))}.checkbox-wrapper:not(.checkbox-wrapper--disabled):hover .checkbox-input:checked~.checkbox{background:var(--snice-color-primary-hover,rgb(29 78 216));border-color:var(--snice-color-primary-hover,rgb(29 78 216))}.checkbox-wrapper--loading{cursor:wait;opacity:.7}.checkbox--loading{cursor:wait}.checkbox-spinner{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;pointer-events:none}.checkbox-spinner::after{content:'';display:block;width:.75em;height:.75em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}"}`}focus(){this.input?.focus()}blur(){this.input?.blur()}click(){this.input?.click()}toggle(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("checkbox-change",{bubbles:!0,composed:!0,detail:{checked:this.checked,indeterminate:this.indeterminate,checkbox:this}}))}setIndeterminate(){this.indeterminate=!0,this.checked=!1,this.dispatchEvent(new CustomEvent("checkbox-change",{bubbles:!0,composed:!0,detail:{checked:this.checked,indeterminate:this.indeterminate,checkbox:this}}))}})})();const n='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 18 18 6M6 6l12 12"/></svg>',l='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/><path d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"/></svg>';(()=>{let e,s,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E=[t.element("snice-modal")],D=[],z=HTMLElement,$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],q=[],_=[],W=[],K=[],Y=[],U=[],G=[],J=[],X=[],Z=[];(class extends z{static{s=this}constructor(){super(...arguments),this.open=(a(this,$),a(this,A,!1)),this.size=(a(this,F),a(this,T,"medium")),this.noBackdropDismiss=(a(this,L),a(this,M,!1)),this.noEscapeDismiss=(a(this,R),a(this,j,!1)),this.noFocusTrap=(a(this,O),a(this,B,!1)),this.noCloseButton=(a(this,I),a(this,P,!1)),this.noHeader=(a(this,H),a(this,V,!1)),this.noFooter=(a(this,N),a(this,q,!1)),this.label=(a(this,_),a(this,W,"")),this.modal=(a(this,K),a(this,Y,void 0)),this.panel=(a(this,U),a(this,G,void 0)),this.backdrop=(a(this,J),a(this,X,void 0)),this.previousFocus=(a(this,Z),null),this.lockedBodyScroll=!1,this.headerId=`snice-modal-header-${Math.random().toString(36).slice(2,10)}`}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(z[Symbol.metadata]??null):void 0;l=[t.property({type:Boolean})],r=[t.property({})],o=[t.property({type:Boolean,attribute:"no-backdrop-dismiss"})],c=[t.property({type:Boolean,attribute:"no-escape-dismiss"})],d=[t.property({type:Boolean,attribute:"no-focus-trap"})],h=[t.property({type:Boolean,attribute:"no-close-button"})],u=[t.property({type:Boolean,attribute:"no-header"})],p=[t.property({type:Boolean,attribute:"no-footer"})],m=[t.property({})],g=[t.query(".modal")],b=[t.query(".modal__panel")],v=[t.query(".modal__backdrop")],f=[t.render()],y=[t.styles()],w=[t.ready()],k=[t.dispose()],x=[t.watch("open")],S=[t.dispatch("modal-open",{bubbles:!0,composed:!0})],C=[t.dispatch("modal-close",{bubbles:!0,composed:!0})],i(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,$),i(this,null,y,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,$),i(this,null,w,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,$),i(this,null,k,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:n},null,$),i(this,null,x,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:e=>"handleOpenChange"in e,get:e=>e.handleOpenChange},metadata:n},null,$),i(this,null,S,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:e=>"dispatchOpenEvent"in e,get:e=>e.dispatchOpenEvent},metadata:n},null,$),i(this,null,C,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:e=>"dispatchCloseEvent"in e,get:e=>e.dispatchCloseEvent},metadata:n},null,$),i(null,null,l,{kind:"field",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:n},A,F),i(null,null,r,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:n},T,L),i(null,null,o,{kind:"field",name:"noBackdropDismiss",static:!1,private:!1,access:{has:e=>"noBackdropDismiss"in e,get:e=>e.noBackdropDismiss,set:(e,t)=>{e.noBackdropDismiss=t}},metadata:n},M,R),i(null,null,c,{kind:"field",name:"noEscapeDismiss",static:!1,private:!1,access:{has:e=>"noEscapeDismiss"in e,get:e=>e.noEscapeDismiss,set:(e,t)=>{e.noEscapeDismiss=t}},metadata:n},j,O),i(null,null,d,{kind:"field",name:"noFocusTrap",static:!1,private:!1,access:{has:e=>"noFocusTrap"in e,get:e=>e.noFocusTrap,set:(e,t)=>{e.noFocusTrap=t}},metadata:n},B,I),i(null,null,h,{kind:"field",name:"noCloseButton",static:!1,private:!1,access:{has:e=>"noCloseButton"in e,get:e=>e.noCloseButton,set:(e,t)=>{e.noCloseButton=t}},metadata:n},P,H),i(null,null,u,{kind:"field",name:"noHeader",static:!1,private:!1,access:{has:e=>"noHeader"in e,get:e=>e.noHeader,set:(e,t)=>{e.noHeader=t}},metadata:n},V,N),i(null,null,p,{kind:"field",name:"noFooter",static:!1,private:!1,access:{has:e=>"noFooter"in e,get:e=>e.noFooter,set:(e,t)=>{e.noFooter=t}},metadata:n},q,_),i(null,null,m,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:n},W,K),i(null,null,g,{kind:"field",name:"modal",static:!1,private:!1,access:{has:e=>"modal"in e,get:e=>e.modal,set:(e,t)=>{e.modal=t}},metadata:n},Y,U),i(null,null,b,{kind:"field",name:"panel",static:!1,private:!1,access:{has:e=>"panel"in e,get:e=>e.panel,set:(e,t)=>{e.panel=t}},metadata:n},G,J),i(null,null,v,{kind:"field",name:"backdrop",static:!1,private:!1,access:{has:e=>"backdrop"in e,get:e=>e.backdrop,set:(e,t)=>{e.backdrop=t}},metadata:n},X,Z),i(null,e={value:s},E,{kind:"class",name:s.name,metadata:n},null,D),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),a(s,D)}render(){const e="modal"+(this.open?" modal--open":""),i=`modal__panel modal__panel--${this.size}`,a=this.open?"false":"true",s=!this.label&&!this.noHeader,l=this.label||"Dialog";return t.html`
|
|
273
|
+
`}handleInternalChange(e){const t=e.target;"checkbox"===t.type&&(this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("checkbox-change",{bubbles:!0,composed:!0,detail:{checked:this.checked,indeterminate:this.indeterminate,checkbox:this}})))}handleCheckedChange(){this.input&&(this.input.checked=this.checked)}handleIndeterminateChange(){this.input&&(this.input.indeterminate=this.indeterminate)}styles(){return t.css`${":host{display:inline-flex;align-items:center;align-self:flex-end;min-height:2.5rem;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)}:host([size=small]){min-height:2rem;align-self:center}:host([size=large]){min-height:3rem;align-self:center}:host([compact]){min-height:0;align-self:center}.checkbox-wrapper{display:inline-flex;align-items:center;position:relative;cursor:pointer;user-select:none;min-height:1.25rem}.checkbox-wrapper--disabled{cursor:not-allowed;opacity:.6}.checkbox-input{position:absolute;opacity:0;left:0;top:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:1;pointer-events:all}.checkbox{position:relative;display:inline-flex;align-items:center;justify-content:center;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:2px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-sm,.125rem);transition:all var(--snice-transition-fast, 150ms) ease}.checkbox--small{width:1rem;height:1rem}.checkbox--medium{width:1.25rem;height:1.25rem}.checkbox--large{width:1.5rem;height:1.5rem}.checkbox-input:checked~.checkbox{background:var(--snice-color-primary,rgb(37 99 235));border-color:var(--snice-color-primary,rgb(37 99 235))}.checkbox-input:focus-visible~.checkbox{box-shadow:0 0 0 3px var(--snice-focus-ring-color,rgb(59 130 246 / .5));outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px}.checkbox-input:disabled~.checkbox{background:var(--snice-color-surface-container-low,rgb(250 250 250));border-color:var(--snice-color-border,rgb(226 226 226))}.checkbox-input:disabled:checked~.checkbox{background:var(--snice-color-text-secondary,rgb(82 82 82));border-color:var(--snice-color-text-secondary,rgb(82 82 82))}.checkbox--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-input:checked~.checkbox--invalid{background:var(--snice-color-danger,rgb(220 38 38));border-color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-icon{position:absolute;display:none;color:var(--snice-color-text-inverse,rgb(250 250 250))}.checkbox-input:checked~.checkbox .checkbox-icon--check{display:block}.checkbox--indeterminate .checkbox-icon--check{display:none!important}.checkbox--indeterminate .checkbox-icon--indeterminate{display:block!important}.checkbox--small .checkbox-icon{width:.75rem;height:.75rem}.checkbox--medium .checkbox-icon{width:.875rem;height:.875rem}.checkbox--large .checkbox-icon{width:1.125rem;height:1.125rem}.checkbox-label{margin-left:.5rem;color:var(--snice-color-text,rgb(23 23 23));cursor:pointer}.checkbox-label--small{font-size:var(--snice-font-size-sm, .875rem)}.checkbox-label--medium{font-size:var(--snice-font-size-md, 1rem)}.checkbox-label--large{font-size:var(--snice-font-size-lg, 1.125rem)}.checkbox-wrapper--disabled .checkbox-label{color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed}.checkbox-label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-wrapper:not(.checkbox-wrapper--disabled):hover .checkbox{border-color:var(--snice-color-primary,rgb(37 99 235))}.checkbox-wrapper:not(.checkbox-wrapper--disabled):hover .checkbox-input:checked~.checkbox{background:var(--snice-color-primary-hover,rgb(29 78 216));border-color:var(--snice-color-primary-hover,rgb(29 78 216))}.checkbox-wrapper--loading{cursor:wait;opacity:.7}.checkbox--loading{cursor:wait}.checkbox-spinner{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;pointer-events:none}.checkbox-spinner::after{content:'';display:block;width:.75em;height:.75em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}"}`}focus(){this.input?.focus()}blur(){this.input?.blur()}click(){this.input?.click()}toggle(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("checkbox-change",{bubbles:!0,composed:!0,detail:{checked:this.checked,indeterminate:this.indeterminate,checkbox:this}}))}setIndeterminate(){this.indeterminate=!0,this.checked=!1,this.dispatchEvent(new CustomEvent("checkbox-change",{bubbles:!0,composed:!0,detail:{checked:this.checked,indeterminate:this.indeterminate,checkbox:this}}))}})})();const n='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 18 18 6M6 6l12 12"/></svg>',l='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/><path d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"/></svg>';(()=>{let e,s,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E=[t.element("snice-modal")],D=[],z=HTMLElement,$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[],K=[],Y=[],U=[],G=[],J=[],X=[],Z=[];(class extends z{static{s=this}constructor(){super(...arguments),this.open=(a(this,$),a(this,A,!1)),this.size=(a(this,F),a(this,T,"medium")),this.noBackdropDismiss=(a(this,L),a(this,M,!1)),this.noEscapeDismiss=(a(this,R),a(this,j,!1)),this.noFocusTrap=(a(this,O),a(this,B,!1)),this.noCloseButton=(a(this,I),a(this,P,!1)),this.noHeader=(a(this,H),a(this,V,!1)),this.noFooter=(a(this,N),a(this,_,!1)),this.label=(a(this,q),a(this,W,"")),this.modal=(a(this,K),a(this,Y,void 0)),this.panel=(a(this,U),a(this,G,void 0)),this.backdrop=(a(this,J),a(this,X,void 0)),this.previousFocus=(a(this,Z),null),this.lockedBodyScroll=!1,this.headerId=`snice-modal-header-${Math.random().toString(36).slice(2,10)}`}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(z[Symbol.metadata]??null):void 0;l=[t.property({type:Boolean})],r=[t.property({})],o=[t.property({type:Boolean,attribute:"no-backdrop-dismiss"})],c=[t.property({type:Boolean,attribute:"no-escape-dismiss"})],d=[t.property({type:Boolean,attribute:"no-focus-trap"})],h=[t.property({type:Boolean,attribute:"no-close-button"})],u=[t.property({type:Boolean,attribute:"no-header"})],p=[t.property({type:Boolean,attribute:"no-footer"})],m=[t.property({})],g=[t.query(".modal")],b=[t.query(".modal__panel")],v=[t.query(".modal__backdrop")],f=[t.render()],y=[t.styles()],w=[t.ready()],k=[t.dispose()],x=[t.watch("open")],S=[t.dispatch("modal-open",{bubbles:!0,composed:!0})],C=[t.dispatch("modal-close",{bubbles:!0,composed:!0})],i(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,$),i(this,null,y,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,$),i(this,null,w,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,$),i(this,null,k,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:n},null,$),i(this,null,x,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:e=>"handleOpenChange"in e,get:e=>e.handleOpenChange},metadata:n},null,$),i(this,null,S,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:e=>"dispatchOpenEvent"in e,get:e=>e.dispatchOpenEvent},metadata:n},null,$),i(this,null,C,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:e=>"dispatchCloseEvent"in e,get:e=>e.dispatchCloseEvent},metadata:n},null,$),i(null,null,l,{kind:"field",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:n},A,F),i(null,null,r,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:n},T,L),i(null,null,o,{kind:"field",name:"noBackdropDismiss",static:!1,private:!1,access:{has:e=>"noBackdropDismiss"in e,get:e=>e.noBackdropDismiss,set:(e,t)=>{e.noBackdropDismiss=t}},metadata:n},M,R),i(null,null,c,{kind:"field",name:"noEscapeDismiss",static:!1,private:!1,access:{has:e=>"noEscapeDismiss"in e,get:e=>e.noEscapeDismiss,set:(e,t)=>{e.noEscapeDismiss=t}},metadata:n},j,O),i(null,null,d,{kind:"field",name:"noFocusTrap",static:!1,private:!1,access:{has:e=>"noFocusTrap"in e,get:e=>e.noFocusTrap,set:(e,t)=>{e.noFocusTrap=t}},metadata:n},B,I),i(null,null,h,{kind:"field",name:"noCloseButton",static:!1,private:!1,access:{has:e=>"noCloseButton"in e,get:e=>e.noCloseButton,set:(e,t)=>{e.noCloseButton=t}},metadata:n},P,H),i(null,null,u,{kind:"field",name:"noHeader",static:!1,private:!1,access:{has:e=>"noHeader"in e,get:e=>e.noHeader,set:(e,t)=>{e.noHeader=t}},metadata:n},V,N),i(null,null,p,{kind:"field",name:"noFooter",static:!1,private:!1,access:{has:e=>"noFooter"in e,get:e=>e.noFooter,set:(e,t)=>{e.noFooter=t}},metadata:n},_,q),i(null,null,m,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:n},W,K),i(null,null,g,{kind:"field",name:"modal",static:!1,private:!1,access:{has:e=>"modal"in e,get:e=>e.modal,set:(e,t)=>{e.modal=t}},metadata:n},Y,U),i(null,null,b,{kind:"field",name:"panel",static:!1,private:!1,access:{has:e=>"panel"in e,get:e=>e.panel,set:(e,t)=>{e.panel=t}},metadata:n},G,J),i(null,null,v,{kind:"field",name:"backdrop",static:!1,private:!1,access:{has:e=>"backdrop"in e,get:e=>e.backdrop,set:(e,t)=>{e.backdrop=t}},metadata:n},X,Z),i(null,e={value:s},E,{kind:"class",name:s.name,metadata:n},null,D),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),a(s,D)}render(){const e="modal"+(this.open?" modal--open":""),i=`modal__panel modal__panel--${this.size}`,a=this.open?"false":"true",s=!this.label&&!this.noHeader,l=this.label||"Dialog";return t.html`
|
|
274
274
|
<div class="${e}"
|
|
275
275
|
role="dialog"
|
|
276
276
|
aria-modal="true"
|
|
@@ -333,9 +333,9 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
333
333
|
</when>
|
|
334
334
|
</case>
|
|
335
335
|
</if>
|
|
336
|
-
<slot></slot>
|
|
336
|
+
<div class="empty-state__extra"><slot></slot></div>
|
|
337
337
|
</div>
|
|
338
|
-
`}styles(){return t.css`${":host{display:block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:var(--snice-spacing-2xl,3rem) var(--snice-spacing-xl,2rem);color:var(--snice-color-text-secondary,rgb(82 82 82));animation:snice-empty-in 360ms var(--snice-ease-out,ease) backwards}@keyframes snice-empty-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.empty-state--small{padding:var(--snice-spacing-xl,2rem) var(--snice-spacing-lg,1.5rem)}.empty-state--medium{padding:var(--snice-spacing-2xl,3rem) var(--snice-spacing-xl,2rem)}.empty-state--large{padding:var(--snice-spacing-3xl,4rem) var(--snice-spacing-2xl,2.5rem)}.empty-state__icon-wrapper{display:flex;align-items:center;justify-content:center;margin-bottom:var(--snice-spacing-lg,1.5rem);position:relative;width:calc(var(--snice-font-size-4xl,4rem) * 1.8);height:calc(var(--snice-font-size-4xl,4rem) * 1.8)}.empty-state__icon-wrapper::before{content:'';position:absolute;inset:0;border-radius:50%;border:1px dashed color-mix(in srgb,var(--snice-color-border,#ddd) 70%,transparent);animation:18s linear infinite snice-empty-halo}@keyframes snice-empty-halo{to{transform:rotate(360deg)}}.empty-state__icon{font-size:var(--snice-font-size-4xl, 4rem);opacity:.5;line-height:1}.empty-state__icon-wrapper ::slotted(*){display:flex;align-items:center;justify-content:center;font-size:var(--snice-font-size-4xl, 4rem);opacity:.5;line-height:1}.empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-4xl,4rem);height:var(--snice-font-size-4xl,4rem)}.empty-state__icon-wrapper ::slotted(img){width:var(--snice-font-size-4xl,4rem);height:var(--snice-font-size-4xl,4rem);object-fit:contain}.empty-state--small .empty-state__icon-wrapper{margin-bottom:var(--snice-spacing-md,1rem);width:calc(var(--snice-font-size-3xl,3rem) * 1.8);height:calc(var(--snice-font-size-3xl,3rem) * 1.8)}.empty-state--small .empty-state__icon{font-size:var(--snice-font-size-3xl, 3rem)}.empty-state--small .empty-state__icon-wrapper ::slotted(*){font-size:var(--snice-font-size-3xl, 3rem)}.empty-state--small .empty-state__icon-wrapper ::slotted(img),.empty-state--small .empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-3xl,3rem);height:var(--snice-font-size-3xl,3rem)}.empty-state--large .empty-state__icon-wrapper{margin-bottom:var(--snice-spacing-xl,2rem);width:calc(var(--snice-font-size-5xl,5rem) * 1.8);height:calc(var(--snice-font-size-5xl,5rem) * 1.8)}.empty-state--large .empty-state__icon{font-size:var(--snice-font-size-5xl, 5rem)}.empty-state--large .empty-state__icon-wrapper ::slotted(*){font-size:var(--snice-font-size-5xl, 5rem)}.empty-state--large .empty-state__icon-wrapper ::slotted(img),.empty-state--large .empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-5xl,5rem);height:var(--snice-font-size-5xl,5rem)}.empty-state__title{font-family:var(--snice-font-family-display);font-size:var(--snice-heading-lg, 1.25rem);font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-text,rgb(23 23 23));margin:0 0 var(--snice-spacing-xs,.5rem) 0}.empty-state--small .empty-state__title{font-family:var(--snice-font-family-display);font-size:var(--snice-heading-md, 1.125rem);margin-bottom:var(--snice-spacing-2xs,.375rem)}.empty-state--large .empty-state__title{font-family:var(--snice-font-family-display);font-size:var(--snice-heading-xl, 1.5rem);margin-bottom:var(--snice-spacing-sm,.75rem)}.empty-state__description{font-size:var(--snice-font-size-sm, .875rem);color:var(--snice-color-text-secondary,rgb(82 82 82));margin:0 0 var(--snice-spacing-lg,1.5rem) 0;max-width:32rem;line-height:var(--snice-line-height-normal, 1.5)}.empty-state--small .empty-state__description{font-size:var(--snice-font-size-xs, .8125rem);margin-bottom:var(--snice-spacing-md,1rem)}.empty-state--large .empty-state__description{font-size:var(--snice-font-size-md, 1rem);margin-bottom:var(--snice-spacing-xl,2rem)}.empty-state__action{display:inline-flex;align-items:center;justify-content:center;padding:var(--snice-spacing-xs,.5rem) var(--snice-spacing-md,1rem);font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);color:var(--snice-color-text-inverse,rgb(250 250 250));background:var(--snice-color-primary,rgb(37 99 235));border:none;border-radius:var(--snice-border-radius-md,.375rem);text-decoration:none;cursor:pointer;transition:background var(--snice-transition-fast, 150ms)}.empty-state__action:hover{background:var(--snice-color-primary-hover,rgb(29 78 216))}.empty-state--small .empty-state__action{padding:var(--snice-spacing-2xs,.375rem) var(--snice-spacing-sm,.75rem);font-size:var(--snice-font-size-xs, .8125rem)}.empty-state--large .empty-state__action{padding:var(--snice-spacing-sm,.625rem) var(--snice-spacing-lg,1.25rem);font-size:var(--snice-font-size-md, 1rem)}::slotted(*){margin-top:var(--snice-spacing-md,1rem)}"}`}handleActionClick(e){this.actionHref||e.preventDefault(),this.dispatchActionEvent()}dispatchActionEvent(){return{emptyState:this}}constructor(){super(...arguments),this.size=(a(this,f),a(this,y,"medium")),this.icon=(a(this,w),a(this,k,"📭")),this.title=(a(this,x),a(this,S,"No data")),this.description=(a(this,C),a(this,E,"")),this.actionText=(a(this,D),a(this,z,"")),this.actionHref=(a(this,$),a(this,A,"")),a(this,F)}})})();var r=":host{display:block;width:100%;font-size:.875rem;line-height:1.25rem;color:var(--snice-color-text,rgb(23 23 23))}.cell-content{width:100%;min-height:1.25rem;word-wrap:break-word}:host([align=left]){text-align:left}:host([align=center]){text-align:center}:host([align=right]){text-align:right}:host([type=accounting]),:host([type=currency]),:host([type=fraction]),:host([type=number]),:host([type=percent]),:host([type=scientific]){font-variant-numeric:tabular-nums;text-align:right}:host([type=date]){font-variant-numeric:tabular-nums}:host([type=boolean]){text-align:center;font-size:1rem}.boolean--true{color:var(--snice-color-success,rgb(22 163 74))}.boolean--false{color:var(--snice-color-danger,rgb(220 38 38))}:host([type=rating]){text-align:center}:host([type=sparkline]){text-align:center}.cell-content--text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell-content--text[data-multiline=true]{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.cell-content--date,.cell-content--number{font-feature-settings:'tnum'}:host([type=boolean]) .cell-content{display:flex;align-items:center;justify-content:center}:host([type=rating]) .cell-content{display:flex;align-items:center;justify-content:center;gap:.125rem;container-type:inline-size}:host([type=rating]) snice-rating{--rating-size:clamp(0.55rem, 16cqi, 1rem)}.cell-content--progress{width:100%;min-width:4rem}.cell-content--sparkline{display:flex;align-items:center;justify-content:center;min-width:3rem}:host(.positive){color:var(--snice-color-success,rgb(22 163 74))}:host(.negative){color:var(--snice-color-danger,rgb(220 38 38))}:host(.warning){color:var(--snice-color-warning,rgb(234 179 8));background-color:rgb(254 249 195 / .3)}:host(.danger){color:var(--snice-color-danger,rgb(220 38 38));background-color:rgb(254 226 226 / .3)}:host(.success){color:var(--snice-color-success,rgb(22 163 74));background-color:rgb(220 252 231 / .3)}:host(.info){color:var(--snice-color-primary,rgb(37 99 235));background-color:rgb(219 234 254 / .3)}:host(.date--today){font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-primary,rgb(37 99 235))}:host(.date--past){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.date--future){color:var(--snice-color-success,rgb(22 163 74))}:host(.number--negative.number--negative-red){color:var(--snice-color-danger,rgb(220 38 38))}:host(.number--positive.number--highlighted){color:var(--snice-color-success,rgb(22 163 74));font-weight:var(--snice-font-weight-semibold,600)}:host(.number--zero){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host([truncate]) .cell-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([wrap]) .cell-content{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}:host(:not([value])) .cell-content,:host([value=\"\"]) .cell-content{color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.loading){position:relative;overflow:hidden}:host(.loading) .cell-content{opacity:.6}:host(.loading)::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,var(--snice-color-surface,rgb(255 255 255 / .6)),transparent);animation:1.5s infinite cell-shimmer}@keyframes cell-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}:host(:focus-within){outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:-2px}.cell-content button,.cell-content input,.cell-content select{font-size:inherit;line-height:inherit}.cell-content a{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none}.cell-content a:hover{text-decoration:underline}@media (max-width:768px){:host{font-size:.75rem;line-height:1rem}:host([type=boolean]){font-size:.875rem}}@media (prefers-reduced-motion:reduce){:host(.loading)::after{animation:none}}@media (prefers-contrast:high){:host(.positive){background-color:rgb(220 252 231 / .3)}:host(.negative){background-color:rgb(254 226 226 / .3)}.cell-content a{text-decoration:underline}}@media print{:host{font-size:.75rem}:host(.loading)::after{display:none}.cell-content a{text-decoration:underline}}";(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v=[t.element("snice-cell")],f=[],y=HTMLElement,w=[],k=[],x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[];(class extends y{static{s=this}static{const r="function"==typeof Symbol&&Symbol.metadata?Object.create(y[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],o=[t.property()],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:Object,attribute:!1})],h=[t.query(".cell-content")],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("align")],b=[t.watch("value","column")],i(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:r},null,w),i(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:r},null,w),i(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,w),i(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:r},null,w),i(this,null,b,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:r},null,w),i(null,null,n,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:r},k,x),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:r},S,C),i(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:r},E,D),i(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:r},z,$),i(null,null,d,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:r},A,F),i(null,null,h,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:r},T,L),i(null,e={value:s},v,{kind:"class",name:s.name,metadata:r},null,f),s=e.value,r&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r}),a(s,f)}render(){return t.html`
|
|
338
|
+
`}styles(){return t.css`${":host{display:block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:var(--snice-spacing-2xl,3rem) var(--snice-spacing-xl,2rem);color:var(--snice-color-text-secondary,rgb(82 82 82));animation:snice-empty-in 360ms var(--snice-ease-out,ease) backwards}@keyframes snice-empty-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.empty-state--small{padding:var(--snice-spacing-xl,2rem) var(--snice-spacing-lg,1.5rem)}.empty-state--medium{padding:var(--snice-spacing-2xl,3rem) var(--snice-spacing-xl,2rem)}.empty-state--large{padding:var(--snice-spacing-3xl,4rem) var(--snice-spacing-2xl,2.5rem)}.empty-state__icon-wrapper{display:flex;align-items:center;justify-content:center;margin-bottom:var(--snice-spacing-lg,1.5rem);position:relative;width:calc(var(--snice-font-size-4xl,4rem) * 1.8);height:calc(var(--snice-font-size-4xl,4rem) * 1.8)}.empty-state__icon-wrapper::before{content:'';position:absolute;inset:0;border-radius:50%;border:1px dashed color-mix(in srgb,var(--snice-color-border,#ddd) 70%,transparent);animation:18s linear infinite snice-empty-halo}@keyframes snice-empty-halo{to{transform:rotate(360deg)}}.empty-state__icon{font-size:var(--snice-font-size-4xl, 4rem);opacity:.5;line-height:1}.empty-state__icon-wrapper ::slotted(*){display:flex;align-items:center;justify-content:center;font-size:var(--snice-font-size-4xl, 4rem);opacity:.5;line-height:1}.empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-4xl,4rem);height:var(--snice-font-size-4xl,4rem)}.empty-state__icon-wrapper ::slotted(img){width:var(--snice-font-size-4xl,4rem);height:var(--snice-font-size-4xl,4rem);object-fit:contain}.empty-state--small .empty-state__icon-wrapper{margin-bottom:var(--snice-spacing-md,1rem);width:calc(var(--snice-font-size-3xl,3rem) * 1.8);height:calc(var(--snice-font-size-3xl,3rem) * 1.8)}.empty-state--small .empty-state__icon{font-size:var(--snice-font-size-3xl, 3rem)}.empty-state--small .empty-state__icon-wrapper ::slotted(*){font-size:var(--snice-font-size-3xl, 3rem)}.empty-state--small .empty-state__icon-wrapper ::slotted(img),.empty-state--small .empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-3xl,3rem);height:var(--snice-font-size-3xl,3rem)}.empty-state--large .empty-state__icon-wrapper{margin-bottom:var(--snice-spacing-xl,2rem);width:calc(var(--snice-font-size-5xl,5rem) * 1.8);height:calc(var(--snice-font-size-5xl,5rem) * 1.8)}.empty-state--large .empty-state__icon{font-size:var(--snice-font-size-5xl, 5rem)}.empty-state--large .empty-state__icon-wrapper ::slotted(*){font-size:var(--snice-font-size-5xl, 5rem)}.empty-state--large .empty-state__icon-wrapper ::slotted(img),.empty-state--large .empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-5xl,5rem);height:var(--snice-font-size-5xl,5rem)}.empty-state__title{font-family:var(--snice-font-family-display);font-size:var(--snice-heading-lg, 1.25rem);font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-text,rgb(23 23 23));margin:0 0 var(--snice-spacing-xs,.5rem) 0}.empty-state--small .empty-state__title{font-family:var(--snice-font-family-display);font-size:var(--snice-heading-md, 1.125rem);margin-bottom:var(--snice-spacing-2xs,.375rem)}.empty-state--large .empty-state__title{font-family:var(--snice-font-family-display);font-size:var(--snice-heading-xl, 1.5rem);margin-bottom:var(--snice-spacing-sm,.75rem)}.empty-state__description{font-size:var(--snice-font-size-sm, .875rem);color:var(--snice-color-text-secondary,rgb(82 82 82));margin:0 0 var(--snice-spacing-lg,1.5rem) 0;max-width:32rem;line-height:var(--snice-line-height-normal, 1.5)}.empty-state--small .empty-state__description{font-size:var(--snice-font-size-xs, .8125rem);margin-bottom:var(--snice-spacing-md,1rem)}.empty-state--large .empty-state__description{font-size:var(--snice-font-size-md, 1rem);margin-bottom:var(--snice-spacing-xl,2rem)}.empty-state__action{display:inline-flex;align-items:center;justify-content:center;padding:var(--snice-spacing-xs,.5rem) var(--snice-spacing-md,1rem);font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);color:var(--snice-color-text-inverse,rgb(250 250 250));background:var(--snice-color-primary,rgb(37 99 235));border:none;border-radius:var(--snice-border-radius-md,.375rem);text-decoration:none;cursor:pointer;transition:background var(--snice-transition-fast, 150ms)}.empty-state__action:hover{background:var(--snice-color-primary-hover,rgb(29 78 216))}.empty-state--small .empty-state__action{padding:var(--snice-spacing-2xs,.375rem) var(--snice-spacing-sm,.75rem);font-size:var(--snice-font-size-xs, .8125rem)}.empty-state--large .empty-state__action{padding:var(--snice-spacing-sm,.625rem) var(--snice-spacing-lg,1.25rem);font-size:var(--snice-font-size-md, 1rem)}.empty-state__extra ::slotted(*){margin-top:var(--snice-spacing-md,1rem)}"}`}handleActionClick(e){this.actionHref||e.preventDefault(),this.dispatchActionEvent()}dispatchActionEvent(){return{emptyState:this}}constructor(){super(...arguments),this.size=(a(this,f),a(this,y,"medium")),this.icon=(a(this,w),a(this,k,"📭")),this.title=(a(this,x),a(this,S,"No data")),this.description=(a(this,C),a(this,E,"")),this.actionText=(a(this,D),a(this,z,"")),this.actionHref=(a(this,$),a(this,A,"")),a(this,F)}})})();var r=":host{display:block;width:100%;font-size:.875rem;line-height:1.25rem;color:var(--snice-color-text,rgb(23 23 23))}.cell-content{width:100%;min-height:1.25rem;word-wrap:break-word}:host([align=left]){text-align:left}:host([align=center]){text-align:center}:host([align=right]){text-align:right}:host([type=accounting]),:host([type=currency]),:host([type=fraction]),:host([type=number]),:host([type=percent]),:host([type=scientific]){font-variant-numeric:tabular-nums;text-align:right}:host([type=date]){font-variant-numeric:tabular-nums}:host([type=boolean]){text-align:center;font-size:1rem}.boolean--true{color:var(--snice-color-success,rgb(22 163 74))}.boolean--false{color:var(--snice-color-danger,rgb(220 38 38))}:host([type=rating]){text-align:center}:host([type=sparkline]){text-align:center}.cell-content--text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell-content--text[data-multiline=true]{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.cell-content--date,.cell-content--number{font-feature-settings:'tnum'}:host([type=boolean]) .cell-content{display:flex;align-items:center;justify-content:center}:host([type=rating]) .cell-content{display:flex;align-items:center;justify-content:center;gap:.125rem;container-type:inline-size}:host([type=rating]) snice-rating{--rating-size:clamp(0.55rem, 16cqi, 1rem)}.cell-content--progress{width:100%;min-width:4rem}.cell-content--sparkline{display:flex;align-items:center;justify-content:center;min-width:3rem}:host(.positive){color:var(--snice-color-success,rgb(22 163 74))}:host(.negative){color:var(--snice-color-danger,rgb(220 38 38))}:host(.warning){color:var(--snice-color-warning,rgb(234 179 8));background-color:rgb(254 249 195 / .3)}:host(.danger){color:var(--snice-color-danger,rgb(220 38 38));background-color:rgb(254 226 226 / .3)}:host(.success){color:var(--snice-color-success,rgb(22 163 74));background-color:rgb(220 252 231 / .3)}:host(.info){color:var(--snice-color-primary,rgb(37 99 235));background-color:rgb(219 234 254 / .3)}:host(.date--today){font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-primary,rgb(37 99 235))}:host(.date--past){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.date--future){color:var(--snice-color-success,rgb(22 163 74))}:host(.number--negative.number--negative-red){color:var(--snice-color-danger,rgb(220 38 38))}:host(.number--positive.number--highlighted){color:var(--snice-color-success,rgb(22 163 74));font-weight:var(--snice-font-weight-semibold,600)}:host(.number--zero){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host([truncate]) .cell-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([wrap]) .cell-content{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}:host(:not([value])) .cell-content,:host([value=\"\"]) .cell-content{color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.loading){position:relative;overflow:hidden}:host(.loading) .cell-content{opacity:.6}:host(.loading)::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,var(--snice-color-surface,rgb(255 255 255 / .6)),transparent);animation:1.5s infinite cell-shimmer}@keyframes cell-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}:host(:focus-within){outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:-2px}.cell-content button,.cell-content input,.cell-content select{font-size:inherit;line-height:inherit}.cell-content a{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none}.cell-content a:hover{text-decoration:underline}@media (max-width:768px){:host{font-size:.75rem;line-height:1rem}:host([type=boolean]){font-size:.875rem}}@media (prefers-reduced-motion:reduce){:host(.loading)::after{animation:none}}@media (prefers-contrast:high){:host(.positive){background-color:rgb(220 252 231 / .3)}:host(.negative){background-color:rgb(254 226 226 / .3)}.cell-content a{text-decoration:underline}}@media print{:host{font-size:.75rem}:host(.loading)::after{display:none}.cell-content a{text-decoration:underline}}";(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v=[t.element("snice-cell")],f=[],y=HTMLElement,w=[],k=[],x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[];(class extends y{static{s=this}static{const r="function"==typeof Symbol&&Symbol.metadata?Object.create(y[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],o=[t.property()],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:Object,attribute:!1})],h=[t.query(".cell-content")],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("align")],b=[t.watch("value","column")],i(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:r},null,w),i(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:r},null,w),i(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,w),i(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:r},null,w),i(this,null,b,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:r},null,w),i(null,null,n,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:r},k,x),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:r},S,C),i(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:r},E,D),i(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:r},z,$),i(null,null,d,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:r},A,F),i(null,null,h,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:r},T,L),i(null,e={value:s},v,{kind:"class",name:s.name,metadata:r},null,f),s=e.value,r&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r}),a(s,f)}render(){return t.html`
|
|
339
339
|
<div class="cell-content" part="content">
|
|
340
340
|
${this.formatValue()}
|
|
341
341
|
</div>
|
|
@@ -343,19 +343,19 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
343
343
|
<div class="cell-content cell-content--text" part="content" style="${i}">
|
|
344
344
|
${e}
|
|
345
345
|
</div>
|
|
346
|
-
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatTextContent(),t=this.getTextStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatTextContent(){if(null===this.value||void 0===this.value)return"";let e=String(this.value);return this.column.formatter&&(e=this.column.formatter(this.value,this.rowData)),this.multiline&&(e=e.replace(/\n/g,"<br>")),!this.multiline&&this.column.ellipsis,e}getTextStyles(){let e=[];return this.multiline?(this.column.wrap&&(e.push("white-space: pre-wrap"),e.push("word-wrap: break-word")),this.maxLines&&(e.push("display: -webkit-box"),e.push("-webkit-box-orient: vertical"),e.push(`-webkit-line-clamp: ${this.maxLines}`),e.push("overflow: hidden"))):(e.push("white-space: nowrap"),this.column.ellipsis&&(e.push("overflow: hidden"),e.push("text-overflow: ellipsis"))),e.join("; ")}constructor(){super(...arguments),this.align=(a(this,x),a(this,S,"left")),this.type=(a(this,C),a(this,E,"text")),this.value=(a(this,D),a(this,z,"")),this.column=(a(this,$),a(this,A,{key:"",label:"",type:"text",align:"left"})),this.rowData=(a(this,F),a(this,T,null)),this.contentElement=(a(this,L),a(this,M,void 0)),this.multiline=(a(this,R),a(this,j,!1)),this.maxLines=(a(this,O),a(this,B,void 0)),a(this,I)}})})(),(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S=[t.element("snice-cell-number")],C=[],E=HTMLElement,D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],
|
|
346
|
+
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatTextContent(),t=this.getTextStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatTextContent(){if(null===this.value||void 0===this.value)return"";let e=String(this.value);return this.column.formatter&&(e=this.column.formatter(this.value,this.rowData)),this.multiline&&(e=e.replace(/\n/g,"<br>")),!this.multiline&&this.column.ellipsis,e}getTextStyles(){let e=[];return this.multiline?(this.column.wrap&&(e.push("white-space: pre-wrap"),e.push("word-wrap: break-word")),this.maxLines&&(e.push("display: -webkit-box"),e.push("-webkit-box-orient: vertical"),e.push(`-webkit-line-clamp: ${this.maxLines}`),e.push("overflow: hidden"))):(e.push("white-space: nowrap"),this.column.ellipsis&&(e.push("overflow: hidden"),e.push("text-overflow: ellipsis"))),e.join("; ")}constructor(){super(...arguments),this.align=(a(this,x),a(this,S,"left")),this.type=(a(this,C),a(this,E,"text")),this.value=(a(this,D),a(this,z,"")),this.column=(a(this,$),a(this,A,{key:"",label:"",type:"text",align:"left"})),this.rowData=(a(this,F),a(this,T,null)),this.contentElement=(a(this,L),a(this,M,void 0)),this.multiline=(a(this,R),a(this,j,!1)),this.maxLines=(a(this,O),a(this,B,void 0)),a(this,I)}})})(),(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S=[t.element("snice-cell-number")],C=[],E=HTMLElement,D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[],K=[],Y=[],U=[],G=[],J=[];(class extends E{static{s=this}static{const r="function"==typeof Symbol&&Symbol.metadata?Object.create(E[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],o=[t.property({})],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:Object,attribute:!1})],h=[t.query(".cell-content")],u=[t.property({type:Number})],p=[t.property({type:Boolean,attribute:"thousands-separator"})],m=[t.property({})],g=[t.property({})],b=[t.property({attribute:"negative-style"})],v=[t.property({type:Boolean})],f=[t.render()],y=[t.styles()],w=[t.ready()],k=[t.watch("align")],x=[t.watch("value","column")],i(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:r},null,D),i(this,null,y,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:r},null,D),i(this,null,w,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,D),i(this,null,k,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:r},null,D),i(this,null,x,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:r},null,D),i(null,null,n,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:r},z,$),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:r},A,F),i(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:r},T,L),i(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:r},M,R),i(null,null,d,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:r},j,O),i(null,null,h,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:r},B,I),i(null,null,u,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:r},P,H),i(null,null,p,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:e=>"thousandsSeparator"in e,get:e=>e.thousandsSeparator,set:(e,t)=>{e.thousandsSeparator=t}},metadata:r},V,N),i(null,null,m,{kind:"field",name:"prefix",static:!1,private:!1,access:{has:e=>"prefix"in e,get:e=>e.prefix,set:(e,t)=>{e.prefix=t}},metadata:r},_,q),i(null,null,g,{kind:"field",name:"suffix",static:!1,private:!1,access:{has:e=>"suffix"in e,get:e=>e.suffix,set:(e,t)=>{e.suffix=t}},metadata:r},W,K),i(null,null,b,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:e=>"negativeStyle"in e,get:e=>e.negativeStyle,set:(e,t)=>{e.negativeStyle=t}},metadata:r},Y,U),i(null,null,v,{kind:"field",name:"highlight",static:!1,private:!1,access:{has:e=>"highlight"in e,get:e=>e.highlight,set:(e,t)=>{e.highlight=t}},metadata:r},G,J),i(null,e={value:s},S,{kind:"class",name:s.name,metadata:r},null,C),s=e.value,r&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r}),a(s,C)}render(){const e=this.formatNumberValue(),i=this.getNumberStyles();return t.html`
|
|
347
347
|
<div class="cell-content cell-content--number" part="content" style="${i}">
|
|
348
348
|
${e}
|
|
349
349
|
</div>
|
|
350
|
-
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatNumberValue(),t=this.getNumberStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatNumberValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.numberFormat||{decimals:this.decimals,thousandsSeparator:this.thousandsSeparator,prefix:this.prefix,suffix:this.suffix,negativeStyle:this.negativeStyle},t=Number(this.value);if(isNaN(t))return String(this.value);let i=t.toFixed(e.decimals??this.decimals);if(e.thousandsSeparator??this.thousandsSeparator){const e=i.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i=e.join(".")}if(t<0){const t=e.negativeStyle??this.negativeStyle;"parentheses"===t?i=`(${i.replace("-","")})`:"red"===t&&(i=i.replace("-",""))}const a=e.prefix??this.prefix,s=e.suffix??this.suffix;return a&&(i=a+i),s&&(i+=s),i}getNumberStyles(){const e=Number(this.value);if(this.classList.remove("number--negative","number--positive","number--zero","number--highlighted"),e<0){this.classList.add("number--negative");"red"===(this.column.numberFormat?.negativeStyle??this.negativeStyle)&&this.classList.add("number--negative-red")}else e>0?(this.classList.add("number--positive"),this.highlight&&this.classList.add("number--highlighted")):0===e&&this.classList.add("number--zero");return"text-align: right"}constructor(){super(...arguments),this.align=(a(this,D),a(this,z,"right")),this.type=(a(this,$),a(this,A,"number")),this.value=(a(this,F),a(this,T,"")),this.column=(a(this,L),a(this,M,{key:"",label:"",type:"number",align:"right"})),this.rowData=(a(this,R),a(this,j,null)),this.contentElement=(a(this,O),a(this,B,void 0)),this.decimals=(a(this,I),a(this,P,0)),this.thousandsSeparator=(a(this,H),a(this,V,!1)),this.prefix=(a(this,N),a(this,
|
|
350
|
+
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatNumberValue(),t=this.getNumberStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatNumberValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.numberFormat||{decimals:this.decimals,thousandsSeparator:this.thousandsSeparator,prefix:this.prefix,suffix:this.suffix,negativeStyle:this.negativeStyle},t=Number(this.value);if(isNaN(t))return String(this.value);let i=t.toFixed(e.decimals??this.decimals);if(e.thousandsSeparator??this.thousandsSeparator){const e=i.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i=e.join(".")}if(t<0){const t=e.negativeStyle??this.negativeStyle;"parentheses"===t?i=`(${i.replace("-","")})`:"red"===t&&(i=i.replace("-",""))}const a=e.prefix??this.prefix,s=e.suffix??this.suffix;return a&&(i=a+i),s&&(i+=s),i}getNumberStyles(){const e=Number(this.value);if(this.classList.remove("number--negative","number--positive","number--zero","number--highlighted"),e<0){this.classList.add("number--negative");"red"===(this.column.numberFormat?.negativeStyle??this.negativeStyle)&&this.classList.add("number--negative-red")}else e>0?(this.classList.add("number--positive"),this.highlight&&this.classList.add("number--highlighted")):0===e&&this.classList.add("number--zero");return"text-align: right"}constructor(){super(...arguments),this.align=(a(this,D),a(this,z,"right")),this.type=(a(this,$),a(this,A,"number")),this.value=(a(this,F),a(this,T,"")),this.column=(a(this,L),a(this,M,{key:"",label:"",type:"number",align:"right"})),this.rowData=(a(this,R),a(this,j,null)),this.contentElement=(a(this,O),a(this,B,void 0)),this.decimals=(a(this,I),a(this,P,0)),this.thousandsSeparator=(a(this,H),a(this,V,!1)),this.prefix=(a(this,N),a(this,_,"")),this.suffix=(a(this,q),a(this,W,"")),this.negativeStyle=(a(this,K),a(this,Y,"minus")),this.highlight=(a(this,U),a(this,G,!1)),a(this,J)}})})(),(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x=[t.element("snice-cell-date")],S=[],C=HTMLElement,E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[],K=[],Y=[];(class extends C{static{s=this}static{const r="function"==typeof Symbol&&Symbol.metadata?Object.create(C[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],o=[t.property({})],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:Object,attribute:!1})],h=[t.query(".cell-content")],u=[t.property({attribute:"date-format"})],p=[t.property({attribute:"custom-format"})],m=[t.property({})],g=[t.property({type:Boolean,attribute:"relative-time"})],b=[t.property({type:Boolean,attribute:"show-time"})],v=[t.render()],f=[t.styles()],y=[t.ready()],w=[t.watch("align")],k=[t.watch("value","column")],i(this,null,v,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:r},null,E),i(this,null,f,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:r},null,E),i(this,null,y,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,E),i(this,null,w,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:r},null,E),i(this,null,k,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:r},null,E),i(null,null,n,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:r},D,z),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:r},$,A),i(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:r},F,T),i(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:r},L,M),i(null,null,d,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:r},R,j),i(null,null,h,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:r},O,B),i(null,null,u,{kind:"field",name:"dateFormat",static:!1,private:!1,access:{has:e=>"dateFormat"in e,get:e=>e.dateFormat,set:(e,t)=>{e.dateFormat=t}},metadata:r},I,P),i(null,null,p,{kind:"field",name:"customFormat",static:!1,private:!1,access:{has:e=>"customFormat"in e,get:e=>e.customFormat,set:(e,t)=>{e.customFormat=t}},metadata:r},H,V),i(null,null,m,{kind:"field",name:"locale",static:!1,private:!1,access:{has:e=>"locale"in e,get:e=>e.locale,set:(e,t)=>{e.locale=t}},metadata:r},N,_),i(null,null,g,{kind:"field",name:"relativeTime",static:!1,private:!1,access:{has:e=>"relativeTime"in e,get:e=>e.relativeTime,set:(e,t)=>{e.relativeTime=t}},metadata:r},q,W),i(null,null,b,{kind:"field",name:"showTime",static:!1,private:!1,access:{has:e=>"showTime"in e,get:e=>e.showTime,set:(e,t)=>{e.showTime=t}},metadata:r},K,Y),i(null,e={value:s},x,{kind:"class",name:s.name,metadata:r},null,S),s=e.value,r&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r}),a(s,S)}render(){const e=this.formatDateValue(),i=this.getDateStyles();return t.html`
|
|
351
351
|
<div class="cell-content cell-content--date" part="content" style="${i}">
|
|
352
352
|
${e}
|
|
353
353
|
</div>
|
|
354
|
-
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatDateValue(),t=this.getDateStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatDateValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=new Date(this.value);if(isNaN(e.getTime()))return String(this.value);if(this.relativeTime)return this.formatRelativeTime(e);const t=this.column.dateFormat||{format:this.dateFormat,customFormat:this.customFormat,locale:this.locale};if(t.customFormat||this.customFormat)return this.formatCustomDate(e,t.customFormat||this.customFormat);const i={};switch(t.format??this.dateFormat){case"short":i.dateStyle="short";break;case"medium":i.dateStyle="medium";break;case"long":i.dateStyle="long";break;case"full":i.dateStyle="full"}this.showTime&&(i.timeStyle="short");const a=t.locale??this.locale;return new Intl.DateTimeFormat(a,i).format(e)}formatCustomDate(e,t){const i={YYYY:e.getFullYear().toString(),YY:e.getFullYear().toString().slice(-2),MM:(e.getMonth()+1).toString().padStart(2,"0"),M:(e.getMonth()+1).toString(),DD:e.getDate().toString().padStart(2,"0"),D:e.getDate().toString(),HH:e.getHours().toString().padStart(2,"0"),H:e.getHours().toString(),mm:e.getMinutes().toString().padStart(2,"0"),m:e.getMinutes().toString(),ss:e.getSeconds().toString().padStart(2,"0"),s:e.getSeconds().toString()};let a=t;for(const[e,t]of Object.entries(i))a=a.replace(new RegExp(e,"g"),t);return a}formatRelativeTime(e){const t=(new Date).getTime()-e.getTime(),i=Math.floor(t/1e3),a=Math.floor(i/60),s=Math.floor(a/60),n=Math.floor(s/24);return i<60?"Just now":a<60?`${a} minute${1===a?"":"s"} ago`:s<24?`${s} hour${1===s?"":"s"} ago`:n<7?`${n} day${1===n?"":"s"} ago`:new Intl.DateTimeFormat(this.locale,{dateStyle:"short"}).format(e)}getDateStyles(){const e=new Date(this.value),t=new Date,i=e.toDateString()===t.toDateString(),a=e<t,s=e>t;return this.classList.remove("date--today","date--past","date--future"),i?this.classList.add("date--today"):a?this.classList.add("date--past"):s&&this.classList.add("date--future"),""}constructor(){super(...arguments),this.align=(a(this,E),a(this,D,"left")),this.type=(a(this,z),a(this,$,"date")),this.value=(a(this,A),a(this,F,"")),this.column=(a(this,T),a(this,L,{key:"",label:"",type:"date",align:"left"})),this.rowData=(a(this,M),a(this,R,null)),this.contentElement=(a(this,j),a(this,O,void 0)),this.dateFormat=(a(this,B),a(this,I,"short")),this.customFormat=(a(this,P),a(this,H,void 0)),this.locale=(a(this,V),a(this,N,"en-US")),this.relativeTime=(a(this,
|
|
354
|
+
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatDateValue(),t=this.getDateStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatDateValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=new Date(this.value);if(isNaN(e.getTime()))return String(this.value);if(this.relativeTime)return this.formatRelativeTime(e);const t=this.column.dateFormat||{format:this.dateFormat,customFormat:this.customFormat,locale:this.locale};if(t.customFormat||this.customFormat)return this.formatCustomDate(e,t.customFormat||this.customFormat);const i={};switch(t.format??this.dateFormat){case"short":i.dateStyle="short";break;case"medium":i.dateStyle="medium";break;case"long":i.dateStyle="long";break;case"full":i.dateStyle="full"}this.showTime&&(i.timeStyle="short");const a=t.locale??this.locale;return new Intl.DateTimeFormat(a,i).format(e)}formatCustomDate(e,t){const i={YYYY:e.getFullYear().toString(),YY:e.getFullYear().toString().slice(-2),MM:(e.getMonth()+1).toString().padStart(2,"0"),M:(e.getMonth()+1).toString(),DD:e.getDate().toString().padStart(2,"0"),D:e.getDate().toString(),HH:e.getHours().toString().padStart(2,"0"),H:e.getHours().toString(),mm:e.getMinutes().toString().padStart(2,"0"),m:e.getMinutes().toString(),ss:e.getSeconds().toString().padStart(2,"0"),s:e.getSeconds().toString()};let a=t;for(const[e,t]of Object.entries(i))a=a.replace(new RegExp(e,"g"),t);return a}formatRelativeTime(e){const t=(new Date).getTime()-e.getTime(),i=Math.floor(t/1e3),a=Math.floor(i/60),s=Math.floor(a/60),n=Math.floor(s/24);return i<60?"Just now":a<60?`${a} minute${1===a?"":"s"} ago`:s<24?`${s} hour${1===s?"":"s"} ago`:n<7?`${n} day${1===n?"":"s"} ago`:new Intl.DateTimeFormat(this.locale,{dateStyle:"short"}).format(e)}getDateStyles(){const e=new Date(this.value),t=new Date,i=e.toDateString()===t.toDateString(),a=e<t,s=e>t;return this.classList.remove("date--today","date--past","date--future"),i?this.classList.add("date--today"):a?this.classList.add("date--past"):s&&this.classList.add("date--future"),""}constructor(){super(...arguments),this.align=(a(this,E),a(this,D,"left")),this.type=(a(this,z),a(this,$,"date")),this.value=(a(this,A),a(this,F,"")),this.column=(a(this,T),a(this,L,{key:"",label:"",type:"date",align:"left"})),this.rowData=(a(this,M),a(this,R,null)),this.contentElement=(a(this,j),a(this,O,void 0)),this.dateFormat=(a(this,B),a(this,I,"short")),this.customFormat=(a(this,P),a(this,H,void 0)),this.locale=(a(this,V),a(this,N,"en-US")),this.relativeTime=(a(this,_),a(this,q,!1)),this.showTime=(a(this,W),a(this,K,!1)),a(this,Y)}})})(),(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x=[t.element("snice-cell-boolean")],S=[],C=HTMLElement,E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[],K=[],Y=[];(class extends C{static{s=this}static{const r="function"==typeof Symbol&&Symbol.metadata?Object.create(C[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],o=[t.property({})],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:Object,attribute:!1})],h=[t.query(".cell-content")],u=[t.property({attribute:"true-value"})],p=[t.property({attribute:"false-value"})],m=[t.property({type:Boolean,attribute:"use-symbols"})],g=[t.property({attribute:"true-symbol"})],b=[t.property({attribute:"false-symbol"})],v=[t.render()],f=[t.styles()],y=[t.ready()],w=[t.watch("align")],k=[t.watch("value","column")],i(this,null,v,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:r},null,E),i(this,null,f,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:r},null,E),i(this,null,y,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,E),i(this,null,w,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:r},null,E),i(this,null,k,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:r},null,E),i(null,null,n,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:r},D,z),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:r},$,A),i(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:r},F,T),i(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:r},L,M),i(null,null,d,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:r},R,j),i(null,null,h,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:r},O,B),i(null,null,u,{kind:"field",name:"trueValue",static:!1,private:!1,access:{has:e=>"trueValue"in e,get:e=>e.trueValue,set:(e,t)=>{e.trueValue=t}},metadata:r},I,P),i(null,null,p,{kind:"field",name:"falseValue",static:!1,private:!1,access:{has:e=>"falseValue"in e,get:e=>e.falseValue,set:(e,t)=>{e.falseValue=t}},metadata:r},H,V),i(null,null,m,{kind:"field",name:"useSymbols",static:!1,private:!1,access:{has:e=>"useSymbols"in e,get:e=>e.useSymbols,set:(e,t)=>{e.useSymbols=t}},metadata:r},N,_),i(null,null,g,{kind:"field",name:"trueSymbol",static:!1,private:!1,access:{has:e=>"trueSymbol"in e,get:e=>e.trueSymbol,set:(e,t)=>{e.trueSymbol=t}},metadata:r},q,W),i(null,null,b,{kind:"field",name:"falseSymbol",static:!1,private:!1,access:{has:e=>"falseSymbol"in e,get:e=>e.falseSymbol,set:(e,t)=>{e.falseSymbol=t}},metadata:r},K,Y),i(null,e={value:s},x,{kind:"class",name:s.name,metadata:r},null,S),s=e.value,r&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r}),a(s,S)}render(){const e=this.formatBooleanContent();return t.html`
|
|
355
355
|
<div class="cell-content cell-content--boolean" part="content">
|
|
356
356
|
${t.unsafeHTML(e)}
|
|
357
357
|
</div>
|
|
358
|
-
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatBooleanContent();this.contentElement.innerHTML=e}}formatBooleanContent(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.booleanFormat||{trueValue:this.trueValue,falseValue:this.falseValue,useSymbols:this.useSymbols,trueSymbol:this.trueSymbol,falseSymbol:this.falseSymbol},t=Boolean(this.value);if(e.useSymbols??this.useSymbols){const i=e.trueSymbol??this.trueSymbol,a=e.falseSymbol??this.falseSymbol,s=t?"boolean--true":"boolean--false";if(t&&"svg"===i)return`<span class="${s}"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="square"><polyline points="3.5 8.5 6.5 11.5 12.5 4.5"/></svg></span>`;if(!t&&"svg"===a)return`<span class="${s}"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="square"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></span>`;return`<span class="${s}">${t?i:a}</span>`}return`<span class="${t?"boolean--true":"boolean--false"}">${t?e.trueValue??this.trueValue:e.falseValue??this.falseValue}</span>`}constructor(){super(...arguments),this.align=(a(this,E),a(this,D,"center")),this.type=(a(this,z),a(this,$,"boolean")),this.value=(a(this,A),a(this,F,!1)),this.column=(a(this,T),a(this,L,{key:"",label:"",type:"boolean",align:"center"})),this.rowData=(a(this,M),a(this,R,null)),this.contentElement=(a(this,j),a(this,O,void 0)),this.trueValue=(a(this,B),a(this,I,"true")),this.falseValue=(a(this,P),a(this,H,"false")),this.useSymbols=(a(this,V),a(this,N,!0)),this.trueSymbol=(a(this,
|
|
358
|
+
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatBooleanContent();this.contentElement.innerHTML=e}}formatBooleanContent(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.booleanFormat||{trueValue:this.trueValue,falseValue:this.falseValue,useSymbols:this.useSymbols,trueSymbol:this.trueSymbol,falseSymbol:this.falseSymbol},t=Boolean(this.value);if(e.useSymbols??this.useSymbols){const i=e.trueSymbol??this.trueSymbol,a=e.falseSymbol??this.falseSymbol,s=t?"boolean--true":"boolean--false";if(t&&"svg"===i)return`<span class="${s}"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="square"><polyline points="3.5 8.5 6.5 11.5 12.5 4.5"/></svg></span>`;if(!t&&"svg"===a)return`<span class="${s}"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="square"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></span>`;return`<span class="${s}">${t?i:a}</span>`}return`<span class="${t?"boolean--true":"boolean--false"}">${t?e.trueValue??this.trueValue:e.falseValue??this.falseValue}</span>`}constructor(){super(...arguments),this.align=(a(this,E),a(this,D,"center")),this.type=(a(this,z),a(this,$,"boolean")),this.value=(a(this,A),a(this,F,!1)),this.column=(a(this,T),a(this,L,{key:"",label:"",type:"boolean",align:"center"})),this.rowData=(a(this,M),a(this,R,null)),this.contentElement=(a(this,j),a(this,O,void 0)),this.trueValue=(a(this,B),a(this,I,"true")),this.falseValue=(a(this,P),a(this,H,"false")),this.useSymbols=(a(this,V),a(this,N,!0)),this.trueSymbol=(a(this,_),a(this,q,"svg")),this.falseSymbol=(a(this,W),a(this,K,"svg")),a(this,Y)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m=[t.element("snice-rating")],g=[],b=HTMLElement,v=[],f=[],y=[],w=[],k=[],x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[];(class extends b{static{s=this}static{const F="function"==typeof Symbol&&Symbol.metadata?Object.create(b[Symbol.metadata]??null):void 0;n=[t.property({type:Number})],l=[t.property({type:Number})],r=[t.property()],o=[t.property()],c=[t.property({type:Boolean})],d=[t.property()],h=[t.dispatch("rating-change",{bubbles:!0,composed:!0})],u=[t.render()],p=[t.styles()],i(this,null,h,{kind:"method",name:"emitRatingChange",static:!1,private:!1,access:{has:e=>"emitRatingChange"in e,get:e=>e.emitRatingChange},metadata:F},null,v),i(this,null,u,{kind:"method",name:"template",static:!1,private:!1,access:{has:e=>"template"in e,get:e=>e.template},metadata:F},null,v),i(this,null,p,{kind:"method",name:"componentStyles",static:!1,private:!1,access:{has:e=>"componentStyles"in e,get:e=>e.componentStyles},metadata:F},null,v),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:F},f,y),i(null,null,l,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:F},w,k),i(null,null,r,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:F},x,S),i(null,null,o,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:F},C,E),i(null,null,c,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:F},D,z),i(null,null,d,{kind:"field",name:"precision",static:!1,private:!1,access:{has:e=>"precision"in e,get:e=>e.precision,set:(e,t)=>{e.precision=t}},metadata:F},$,A),i(null,e={value:s},m,{kind:"class",name:s.name,metadata:F},null,g),s=e.value,F&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:F}),a(s,g)}emitRatingChange(){return{value:this.value}}handleClick(e,t){if(!this.readonly){if("half"===this.precision){const i=t.currentTarget.getBoundingClientRect(),a=t.clientX-i.left<i.width/2;this.value=a?e+.5:e+1}else this.value=e+1;this.emitRatingChange()}}handleKeydown(e){if(this.readonly)return;const t="half"===this.precision?.5:1;"ArrowRight"===e.key||"ArrowUp"===e.key?(e.preventDefault(),this.value=Math.min(this.max,this.value+t),this.emitRatingChange()):"ArrowLeft"!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),this.value=Math.max(0,this.value-t),this.emitRatingChange())}getStarFill(e){const t=this.value-e;return t>=1?100:t<=0?0:Math.round(100*t)}template(){const e=Array.from({length:this.max},(e,i)=>{const a=this.getStarFill(i);return t.html`
|
|
359
359
|
<span part="star" class="star"
|
|
360
360
|
role="radio"
|
|
361
361
|
aria-checked="${a>0?"true":"false"}"
|
|
@@ -422,16 +422,16 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
422
422
|
<div class="cell-content cell-content--filesize" part="content">
|
|
423
423
|
${e}
|
|
424
424
|
</div>
|
|
425
|
-
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatFileSize();this.contentElement.innerHTML=e}}formatFileSize(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=Number(this.value);if(isNaN(e))return String(this.value);const t=["B","KB","MB","GB","TB"];let i=e,a=0;for(;i>=1024&&a<t.length-1;)i/=1024,a++;return`${i.toFixed(1)} ${t[a]}`}constructor(){super(...arguments),this.align=(a(this,w),a(this,k,"right")),this.type=(a(this,x),a(this,S,"filesize")),this.value=(a(this,C),a(this,E,0)),this.column=(a(this,D),a(this,z,{key:"",label:"",type:"filesize",align:"right"})),this.rowData=(a(this,$),a(this,A,null)),this.contentElement=(a(this,F),a(this,T,void 0)),a(this,L)}})})(),(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z,$=[t.element("snice-cell-sparkline")],A=[],F=HTMLElement,T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],
|
|
425
|
+
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatFileSize();this.contentElement.innerHTML=e}}formatFileSize(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=Number(this.value);if(isNaN(e))return String(this.value);const t=["B","KB","MB","GB","TB"];let i=e,a=0;for(;i>=1024&&a<t.length-1;)i/=1024,a++;return`${i.toFixed(1)} ${t[a]}`}constructor(){super(...arguments),this.align=(a(this,w),a(this,k,"right")),this.type=(a(this,x),a(this,S,"filesize")),this.value=(a(this,C),a(this,E,0)),this.column=(a(this,D),a(this,z,{key:"",label:"",type:"filesize",align:"right"})),this.rowData=(a(this,$),a(this,A,null)),this.contentElement=(a(this,F),a(this,T,void 0)),a(this,L)}})})(),(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z,$=[t.element("snice-cell-sparkline")],A=[],F=HTMLElement,T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[],K=[],Y=[],U=[],G=[],J=[],X=[],Z=[],Q=[],ee=[],te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[];(class extends F{static{s=this}static{const r="function"==typeof Symbol&&Symbol.metadata?Object.create(F[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],o=[t.property({})],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:Object,attribute:!1})],h=[t.query(".cell-content")],u=[t.property({attribute:"chart-type"})],p=[t.property({})],m=[t.property({type:Number})],g=[t.property({type:Number})],b=[t.property({type:Boolean,attribute:"show-dots"})],v=[t.property({type:Boolean,attribute:"show-baseline"})],f=[t.property({type:Number,attribute:"stroke-width"})],y=[t.property({type:Number,attribute:"min-value"})],w=[t.property({type:Number,attribute:"max-value"})],k=[t.property({type:t.SimpleArray})],x=[t.render()],S=[t.styles()],C=[t.ready()],E=[t.watch("align")],D=[t.watch("value","data","column")],z=[t.watch("value","data","chartType","color","width","height","showDots","showBaseline","strokeWidth","minValue","maxValue")],i(this,null,x,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:r},null,T),i(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:r},null,T),i(this,null,C,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,T),i(this,null,E,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:r},null,T),i(this,null,D,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:r},null,T),i(this,null,z,{kind:"method",name:"updateSparkline",static:!1,private:!1,access:{has:e=>"updateSparkline"in e,get:e=>e.updateSparkline},metadata:r},null,T),i(null,null,n,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:r},L,M),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:r},R,j),i(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:r},O,B),i(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:r},I,P),i(null,null,d,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:r},H,V),i(null,null,h,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:r},N,_),i(null,null,u,{kind:"field",name:"chartType",static:!1,private:!1,access:{has:e=>"chartType"in e,get:e=>e.chartType,set:(e,t)=>{e.chartType=t}},metadata:r},q,W),i(null,null,p,{kind:"field",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:r},K,Y),i(null,null,m,{kind:"field",name:"width",static:!1,private:!1,access:{has:e=>"width"in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:r},U,G),i(null,null,g,{kind:"field",name:"height",static:!1,private:!1,access:{has:e=>"height"in e,get:e=>e.height,set:(e,t)=>{e.height=t}},metadata:r},J,X),i(null,null,b,{kind:"field",name:"showDots",static:!1,private:!1,access:{has:e=>"showDots"in e,get:e=>e.showDots,set:(e,t)=>{e.showDots=t}},metadata:r},Z,Q),i(null,null,v,{kind:"field",name:"showBaseline",static:!1,private:!1,access:{has:e=>"showBaseline"in e,get:e=>e.showBaseline,set:(e,t)=>{e.showBaseline=t}},metadata:r},ee,te),i(null,null,f,{kind:"field",name:"strokeWidth",static:!1,private:!1,access:{has:e=>"strokeWidth"in e,get:e=>e.strokeWidth,set:(e,t)=>{e.strokeWidth=t}},metadata:r},ie,ae),i(null,null,y,{kind:"field",name:"minValue",static:!1,private:!1,access:{has:e=>"minValue"in e,get:e=>e.minValue,set:(e,t)=>{e.minValue=t}},metadata:r},se,ne),i(null,null,w,{kind:"field",name:"maxValue",static:!1,private:!1,access:{has:e=>"maxValue"in e,get:e=>e.maxValue,set:(e,t)=>{e.maxValue=t}},metadata:r},le,re),i(null,null,k,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:r},oe,ce),i(null,e={value:s},$,{kind:"class",name:s.name,metadata:r},null,A),s=e.value,r&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r}),a(s,A)}render(){return t.html`
|
|
426
426
|
<div class="cell-content cell-content--sparkline" part="content">
|
|
427
427
|
${t.unsafeHTML(this.renderSparkline())}
|
|
428
428
|
</div>
|
|
429
|
-
`}styles(){return t.css`${r}`}init(){this.applyAlignment(),this.updateSparkline()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}updateSparkline(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}renderSparkline(){if(!(null!==this.value&&void 0!==this.value||this.data&&0!==this.data.length))return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.parseData();if(0===e.length)return`<span style="color: ${getComputedStyle(this).getPropertyValue("--snice-color-text-secondary").trim()}; font-style: italic;">No data</span>`;const t=this.column.sparklineFormat||{type:this.chartType,color:this.color,width:this.width,height:this.height},i=t.width??this.width,a=t.height??this.height;let s=null;if(this.value&&"object"==typeof this.value&&!Array.isArray(this.value))s=this.value.color||null;else if("string"==typeof this.value&&this.value.startsWith("{"))try{s=JSON.parse(this.value).color||null}catch{}const n=s??t.color??this.color,l=t.type??this.chartType;return this.createCanvas(e,i,a,n,l)}parseData(){if(this.data&&Array.isArray(this.data)&&this.data.length>0)return this.data.map(e=>Number(e)).filter(e=>!isNaN(e));if(Array.isArray(this.value))return this.value.map(e=>Number(e)).filter(e=>!isNaN(e));if(this.value&&"object"==typeof this.value&&!Array.isArray(this.value)&&Array.isArray(this.value.values))return this.value.values.map(e=>Number(e)).filter(e=>!isNaN(e));if("string"==typeof this.value){if(this.value.startsWith("{"))try{const e=JSON.parse(this.value);if(e&&Array.isArray(e.values))return e.values.map(e=>Number(e)).filter(e=>!isNaN(e))}catch{}if(this.value.startsWith("[")&&this.value.endsWith("]"))try{const e=JSON.parse(this.value);if(Array.isArray(e))return e.map(e=>Number(e)).filter(e=>!isNaN(e))}catch{}try{return this.value.split(",").map(e=>Number(e.trim())).filter(e=>!isNaN(e))}catch{return[]}}return[]}createCanvas(e,t,i,a,s){if(0===e.length)return"";const n=document.createElement("canvas");n.width=t,n.height=i;const l=n.getContext("2d");if(!l)return'<div style="color: red;">Canvas not supported</div>';const r=t-4,o=i-4,c=this.minValue??Math.min(...e),d=(this.maxValue??Math.max(...e))-c||1;l.clearRect(0,0,t,i);let h=a;if(a.startsWith("var(")){const e=a.match(/var\(([^)]+)\)/);e&&(h=getComputedStyle(this).getPropertyValue(e[1].split(",")[0].trim()).trim()||"#3b82f6")}if(l.strokeStyle=h,l.fillStyle=h,l.lineWidth=this.strokeWidth,l.lineCap="round",l.lineJoin="round","line"===s||"area"===s){const t=e.map((t,i)=>[2+i/(e.length-1)*r,2+o-(t-c)/d*o]);"area"===s&&(l.beginPath(),l.moveTo(t[0][0],t[0][1]),t.forEach(([e,t])=>l.lineTo(e,t)),l.lineTo(t[t.length-1][0],i-2),l.lineTo(t[0][0],i-2),l.closePath(),l.globalAlpha=.3,l.fill(),l.globalAlpha=1),l.beginPath(),l.moveTo(t[0][0],t[0][1]),t.forEach(([e,t])=>l.lineTo(e,t)),l.stroke(),this.showDots&&t.forEach(([e,t])=>{l.beginPath(),l.arc(e,t,1.5,0,2*Math.PI),l.fill()})}else if("bar"===s){const t=r/e.length*.8,i=r/e.length*.2;e.forEach((e,a)=>{const s=(e-c)/d*o,n=2+a*(t+i),r=2+o-s;l.fillRect(n,r,t,s)})}try{return`<img src="${n.toDataURL("image/png")}" width="${t}" height="${i}" alt="Sparkline chart" style="display: block; vertical-align: middle;">`}catch(e){return console.error("Error creating canvas image:",e),'<div style="color: red;">Canvas error</div>'}}constructor(){super(...arguments),this.align=(a(this,T),a(this,L,"left")),this.type=(a(this,M),a(this,R,"sparkline")),this.value=(a(this,j),a(this,O,"")),this.column=(a(this,B),a(this,I,{key:"",label:"",type:"sparkline",align:"left"})),this.rowData=(a(this,P),a(this,H,null)),this.contentElement=(a(this,V),a(this,N,void 0)),this.chartType=(a(this,
|
|
429
|
+
`}styles(){return t.css`${r}`}init(){this.applyAlignment(),this.updateSparkline()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}updateSparkline(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}renderSparkline(){if(!(null!==this.value&&void 0!==this.value||this.data&&0!==this.data.length))return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.parseData();if(0===e.length)return`<span style="color: ${getComputedStyle(this).getPropertyValue("--snice-color-text-secondary").trim()}; font-style: italic;">No data</span>`;const t=this.column.sparklineFormat||{type:this.chartType,color:this.color,width:this.width,height:this.height},i=t.width??this.width,a=t.height??this.height;let s=null;if(this.value&&"object"==typeof this.value&&!Array.isArray(this.value))s=this.value.color||null;else if("string"==typeof this.value&&this.value.startsWith("{"))try{s=JSON.parse(this.value).color||null}catch{}const n=s??t.color??this.color,l=t.type??this.chartType;return this.createCanvas(e,i,a,n,l)}parseData(){if(this.data&&Array.isArray(this.data)&&this.data.length>0)return this.data.map(e=>Number(e)).filter(e=>!isNaN(e));if(Array.isArray(this.value))return this.value.map(e=>Number(e)).filter(e=>!isNaN(e));if(this.value&&"object"==typeof this.value&&!Array.isArray(this.value)&&Array.isArray(this.value.values))return this.value.values.map(e=>Number(e)).filter(e=>!isNaN(e));if("string"==typeof this.value){if(this.value.startsWith("{"))try{const e=JSON.parse(this.value);if(e&&Array.isArray(e.values))return e.values.map(e=>Number(e)).filter(e=>!isNaN(e))}catch{}if(this.value.startsWith("[")&&this.value.endsWith("]"))try{const e=JSON.parse(this.value);if(Array.isArray(e))return e.map(e=>Number(e)).filter(e=>!isNaN(e))}catch{}try{return this.value.split(",").map(e=>Number(e.trim())).filter(e=>!isNaN(e))}catch{return[]}}return[]}createCanvas(e,t,i,a,s){if(0===e.length)return"";const n=document.createElement("canvas");n.width=t,n.height=i;const l=n.getContext("2d");if(!l)return'<div style="color: red;">Canvas not supported</div>';const r=t-4,o=i-4,c=this.minValue??Math.min(...e),d=(this.maxValue??Math.max(...e))-c||1;l.clearRect(0,0,t,i);let h=a;if(a.startsWith("var(")){const e=a.match(/var\(([^)]+)\)/);e&&(h=getComputedStyle(this).getPropertyValue(e[1].split(",")[0].trim()).trim()||"#3b82f6")}if(l.strokeStyle=h,l.fillStyle=h,l.lineWidth=this.strokeWidth,l.lineCap="round",l.lineJoin="round","line"===s||"area"===s){const t=e.map((t,i)=>[2+i/(e.length-1)*r,2+o-(t-c)/d*o]);"area"===s&&(l.beginPath(),l.moveTo(t[0][0],t[0][1]),t.forEach(([e,t])=>l.lineTo(e,t)),l.lineTo(t[t.length-1][0],i-2),l.lineTo(t[0][0],i-2),l.closePath(),l.globalAlpha=.3,l.fill(),l.globalAlpha=1),l.beginPath(),l.moveTo(t[0][0],t[0][1]),t.forEach(([e,t])=>l.lineTo(e,t)),l.stroke(),this.showDots&&t.forEach(([e,t])=>{l.beginPath(),l.arc(e,t,1.5,0,2*Math.PI),l.fill()})}else if("bar"===s){const t=r/e.length*.8,i=r/e.length*.2;e.forEach((e,a)=>{const s=(e-c)/d*o,n=2+a*(t+i),r=2+o-s;l.fillRect(n,r,t,s)})}try{return`<img src="${n.toDataURL("image/png")}" width="${t}" height="${i}" alt="Sparkline chart" style="display: block; vertical-align: middle;">`}catch(e){return console.error("Error creating canvas image:",e),'<div style="color: red;">Canvas error</div>'}}constructor(){super(...arguments),this.align=(a(this,T),a(this,L,"left")),this.type=(a(this,M),a(this,R,"sparkline")),this.value=(a(this,j),a(this,O,"")),this.column=(a(this,B),a(this,I,{key:"",label:"",type:"sparkline",align:"left"})),this.rowData=(a(this,P),a(this,H,null)),this.contentElement=(a(this,V),a(this,N,void 0)),this.chartType=(a(this,_),a(this,q,"line")),this.color=(a(this,W),a(this,K,"var(--snice-color-primary)")),this.width=(a(this,Y),a(this,U,80)),this.height=(a(this,G),a(this,J,24)),this.showDots=(a(this,X),a(this,Z,!1)),this.showBaseline=(a(this,Q),a(this,ee,!1)),this.strokeWidth=(a(this,te),a(this,ie,1.5)),this.minValue=(a(this,ae),a(this,se,void 0)),this.maxValue=(a(this,ne),a(this,le,void 0)),this.data=(a(this,re),a(this,oe,[])),a(this,ce)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w=[t.element("snice-cell-percentage")],k=[],x=HTMLElement,S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[];(class extends x{static{s=this}static{const q="function"==typeof Symbol&&Symbol.metadata?Object.create(x[Symbol.metadata]??null):void 0;n=[t.property({type:String})],l=[t.property({type:String})],r=[t.property({})],o=[t.property({type:Object,attribute:!1})],c=[t.property({type:Object,attribute:!1})],d=[t.query(".cell-content")],h=[t.property({type:Number})],u=[t.property({type:Boolean})],p=[t.property({type:Number})],m=[t.property({type:Boolean})],g=[t.render()],b=[t.styles()],v=[t.ready()],f=[t.watch("align")],y=[t.watch("value","column")],i(this,null,g,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:q},null,S),i(this,null,b,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:q},null,S),i(this,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:q},null,S),i(this,null,f,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:q},null,S),i(this,null,y,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:q},null,S),i(null,null,n,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:q},C,E),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:q},D,z),i(null,null,r,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:q},$,A),i(null,null,o,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:q},F,T),i(null,null,c,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:q},L,M),i(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:q},R,j),i(null,null,h,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:q},O,B),i(null,null,u,{kind:"field",name:"showTrend",static:!1,private:!1,access:{has:e=>"showTrend"in e,get:e=>e.showTrend,set:(e,t)=>{e.showTrend=t}},metadata:q},I,P),i(null,null,p,{kind:"field",name:"trendValue",static:!1,private:!1,access:{has:e=>"trendValue"in e,get:e=>e.trendValue,set:(e,t)=>{e.trendValue=t}},metadata:q},H,V),i(null,null,m,{kind:"field",name:"colorize",static:!1,private:!1,access:{has:e=>"colorize"in e,get:e=>e.colorize,set:(e,t)=>{e.colorize=t}},metadata:q},N,_),i(null,e={value:s},w,{kind:"class",name:s.name,metadata:q},null,k),s=e.value,q&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q}),a(s,k)}render(){const e=this.formatPercentageValue(),i=this.getTrendArrow(),a=this.getPercentageStyles();return t.html`
|
|
430
430
|
<div class="cell-content cell-content--percentage" part="content" style="${a}">
|
|
431
431
|
${e}
|
|
432
432
|
${this.showTrend&&i?t.unsafeHTML(`<span class="percentage-trend">${i}</span>`):""}
|
|
433
433
|
</div>
|
|
434
|
-
`}styles(){return t.css`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;flex:1;font-size:.875rem;line-height:1.25rem;font-variant-numeric:tabular-nums}.cell-content{width:100%;min-height:1.25rem;word-wrap:break-word;display:flex;align-items:center;justify-content:flex-end;gap:.375rem}.cell-content--percentage{font-feature-settings:'tnum'}.percentage-trend{display:inline-flex;align-items:center;font-size:1rem;margin-left:.25rem}.percentage-trend svg{width:.875rem;height:.875rem}:host(.percentage--positive){color:var(--snice-color-success,rgb(22 163 74))}:host(.percentage--negative){color:var(--snice-color-danger,rgb(220 38 38))}:host(.percentage--zero){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.percentage--trend-up) .percentage-trend{color:var(--snice-color-success,rgb(22 163 74))}:host(.percentage--trend-down) .percentage-trend{color:var(--snice-color-danger,rgb(220 38 38))}:host(.percentage--trend-neutral) .percentage-trend{color:var(--snice-color-text-secondary,rgb(82 82 82))}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.percentage-trend{font-size:.875rem}}@media print{:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem}.percentage-trend{font-size:.875rem}}"}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatPercentageValue(),t=this.getTrendArrow(),i=this.getPercentageStyles(),a=this.showTrend&&t?`<span class="percentage-trend">${t}</span>`:"";this.contentElement.innerHTML=e+a,this.contentElement.setAttribute("style",i)}}formatPercentageValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column?.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column?.percentageFormat||{decimals:this.decimals,showTrend:this.showTrend,trendValue:this.trendValue,colorize:this.colorize},t=Number(this.value);if(isNaN(t))return String(this.value);return`${t.toFixed(e.decimals??this.decimals)}%`}getTrendArrow(){const e=this.column?.percentageFormat?.trendValue??this.trendValue;return null==e?"":e>0?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"/></svg>':e<0?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 6 9 12.75l4.286-4.286a11.948 11.948 0 0 1 4.306 6.43l.776 2.898m0 0 3.182-5.511m-3.182 5.511-5.511-3.181"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4.5 12h15m0 0-6.75-6.75M19.5 12l-6.75 6.75"/></svg>'}getPercentageStyles(){const e=Number(this.value),t=this.column?.percentageFormat?.colorize??this.colorize;this.classList.remove("percentage--positive","percentage--negative","percentage--zero"),t&&(e>0?this.classList.add("percentage--positive"):e<0?this.classList.add("percentage--negative"):0===e&&this.classList.add("percentage--zero"));const i=this.column?.percentageFormat?.trendValue??this.trendValue;return this.classList.remove("percentage--trend-up","percentage--trend-down","percentage--trend-neutral"),null!=i&&(i>0?this.classList.add("percentage--trend-up"):i<0?this.classList.add("percentage--trend-down"):this.classList.add("percentage--trend-neutral")),"text-align: right"}constructor(){super(...arguments),this.align=(a(this,S),a(this,C,"right")),this.type=(a(this,E),a(this,D,"percentage")),this.value=(a(this,z),a(this,$,"")),this.column=(a(this,A),a(this,F,null)),this.rowData=(a(this,T),a(this,L,null)),this.contentElement=(a(this,M),a(this,R,void 0)),this.decimals=(a(this,j),a(this,O,2)),this.showTrend=(a(this,B),a(this,I,!1)),this.trendValue=(a(this,P),a(this,H,null)),this.colorize=(a(this,V),a(this,N,!0)),a(this,
|
|
434
|
+
`}styles(){return t.css`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;flex:1;font-size:.875rem;line-height:1.25rem;font-variant-numeric:tabular-nums}.cell-content{width:100%;min-height:1.25rem;word-wrap:break-word;display:flex;align-items:center;justify-content:flex-end;gap:.375rem}.cell-content--percentage{font-feature-settings:'tnum'}.percentage-trend{display:inline-flex;align-items:center;font-size:1rem;margin-left:.25rem}.percentage-trend svg{width:.875rem;height:.875rem}:host(.percentage--positive){color:var(--snice-color-success,rgb(22 163 74))}:host(.percentage--negative){color:var(--snice-color-danger,rgb(220 38 38))}:host(.percentage--zero){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.percentage--trend-up) .percentage-trend{color:var(--snice-color-success,rgb(22 163 74))}:host(.percentage--trend-down) .percentage-trend{color:var(--snice-color-danger,rgb(220 38 38))}:host(.percentage--trend-neutral) .percentage-trend{color:var(--snice-color-text-secondary,rgb(82 82 82))}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.percentage-trend{font-size:.875rem}}@media print{:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem}.percentage-trend{font-size:.875rem}}"}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatPercentageValue(),t=this.getTrendArrow(),i=this.getPercentageStyles(),a=this.showTrend&&t?`<span class="percentage-trend">${t}</span>`:"";this.contentElement.innerHTML=e+a,this.contentElement.setAttribute("style",i)}}formatPercentageValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column?.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column?.percentageFormat||{decimals:this.decimals,showTrend:this.showTrend,trendValue:this.trendValue,colorize:this.colorize},t=Number(this.value);if(isNaN(t))return String(this.value);return`${t.toFixed(e.decimals??this.decimals)}%`}getTrendArrow(){const e=this.column?.percentageFormat?.trendValue??this.trendValue;return null==e?"":e>0?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"/></svg>':e<0?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 6 9 12.75l4.286-4.286a11.948 11.948 0 0 1 4.306 6.43l.776 2.898m0 0 3.182-5.511m-3.182 5.511-5.511-3.181"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4.5 12h15m0 0-6.75-6.75M19.5 12l-6.75 6.75"/></svg>'}getPercentageStyles(){const e=Number(this.value),t=this.column?.percentageFormat?.colorize??this.colorize;this.classList.remove("percentage--positive","percentage--negative","percentage--zero"),t&&(e>0?this.classList.add("percentage--positive"):e<0?this.classList.add("percentage--negative"):0===e&&this.classList.add("percentage--zero"));const i=this.column?.percentageFormat?.trendValue??this.trendValue;return this.classList.remove("percentage--trend-up","percentage--trend-down","percentage--trend-neutral"),null!=i&&(i>0?this.classList.add("percentage--trend-up"):i<0?this.classList.add("percentage--trend-down"):this.classList.add("percentage--trend-neutral")),"text-align: right"}constructor(){super(...arguments),this.align=(a(this,S),a(this,C,"right")),this.type=(a(this,E),a(this,D,"percentage")),this.value=(a(this,z),a(this,$,"")),this.column=(a(this,A),a(this,F,null)),this.rowData=(a(this,T),a(this,L,null)),this.contentElement=(a(this,M),a(this,R,void 0)),this.decimals=(a(this,j),a(this,O,2)),this.showTrend=(a(this,B),a(this,I,!1)),this.trendValue=(a(this,P),a(this,H,null)),this.colorize=(a(this,V),a(this,N,!0)),a(this,_)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b=[t.element("snice-cell-tag")],v=[],f=HTMLElement,y=[],w=[],k=[],x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[];(class extends f{static{s=this}static{const R="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;n=[t.property({type:Array,attribute:!1})],l=[t.property({type:String})],r=[t.property({type:String})],o=[t.property({type:Object,attribute:!1})],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:String})],h=[t.property({type:String})],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("value","column")],i(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:R},null,y),i(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:R},null,y),i(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:R},null,y),i(this,null,g,{kind:"method",name:"extractTagsFromColumn",static:!1,private:!1,access:{has:e=>"extractTagsFromColumn"in e,get:e=>e.extractTagsFromColumn},metadata:R},null,y),i(null,null,n,{kind:"field",name:"tags",static:!1,private:!1,access:{has:e=>"tags"in e,get:e=>e.tags,set:(e,t)=>{e.tags=t}},metadata:R},w,k),i(null,null,l,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:R},x,S),i(null,null,r,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:R},C,E),i(null,null,o,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:R},D,z),i(null,null,c,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:R},$,A),i(null,null,d,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:R},F,T),i(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:R},L,M),i(null,e={value:s},b,{kind:"class",name:s.name,metadata:R},null,v),s=e.value,R&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:R}),a(s,v)}render(){const e=this.tags.length>0?this.tags:this.parseValue();return t.html`
|
|
435
435
|
<div class="cell-content cell-content--tag" part="content">
|
|
436
436
|
<div class="tags-container">
|
|
437
437
|
${e.map(e=>this.renderTag(e))}
|
|
@@ -467,7 +467,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
467
467
|
${t.unsafeHTML(r)}
|
|
468
468
|
${a?t.html`<span class="action-label">${a}</span>`:""}
|
|
469
469
|
</button>
|
|
470
|
-
`}handleActionClick(e,t){e.stopPropagation(),this.dispatchAction(t)}dispatchAction(e){return{action:e,rowData:this.rowData,column:this.column}}constructor(){super(...arguments),this.actions=(a(this,y),a(this,w,[])),this.column=(a(this,k),a(this,x,null)),this.rowData=(a(this,S),a(this,C,null)),this.value=(a(this,E),a(this,D,"")),this.align=(a(this,z),a(this,$,"left")),this.type=(a(this,A),a(this,F,"actions")),a(this,T)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y=[t.element("snice-cell-link")],w=[],k=HTMLElement,x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[];(class extends k{static{s=this}static{const
|
|
470
|
+
`}handleActionClick(e,t){e.stopPropagation(),this.dispatchAction(t)}dispatchAction(e){return{action:e,rowData:this.rowData,column:this.column}}constructor(){super(...arguments),this.actions=(a(this,y),a(this,w,[])),this.column=(a(this,k),a(this,x,null)),this.rowData=(a(this,S),a(this,C,null)),this.value=(a(this,E),a(this,D,"")),this.align=(a(this,z),a(this,$,"left")),this.type=(a(this,A),a(this,F,"actions")),a(this,T)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y=[t.element("snice-cell-link")],w=[],k=HTMLElement,x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[];(class extends k{static{s=this}static{const _="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;n=[t.property({type:String})],l=[t.property({type:String})],r=[t.property({type:String})],o=[t.property({type:Boolean,attribute:"external"})],c=[t.property({type:String})],d=[t.property({type:String})],h=[t.property({type:Object,attribute:!1})],u=[t.property({type:Object,attribute:!1})],p=[t.property({type:String})],m=[t.property({type:String})],g=[t.render()],b=[t.styles()],v=[t.ready()],f=[t.watch("value","column")],i(this,null,g,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:_},null,x),i(this,null,b,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:_},null,x),i(this,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:_},null,x),i(this,null,f,{kind:"method",name:"updateCellAttributes",static:!1,private:!1,access:{has:e=>"updateCellAttributes"in e,get:e=>e.updateCellAttributes},metadata:_},null,x),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:_},S,C),i(null,null,l,{kind:"field",name:"href",static:!1,private:!1,access:{has:e=>"href"in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:_},E,D),i(null,null,r,{kind:"field",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:_},z,$),i(null,null,o,{kind:"field",name:"external",static:!1,private:!1,access:{has:e=>"external"in e,get:e=>e.external,set:(e,t)=>{e.external=t}},metadata:_},A,F),i(null,null,c,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:_},T,L),i(null,null,d,{kind:"field",name:"text",static:!1,private:!1,access:{has:e=>"text"in e,get:e=>e.text,set:(e,t)=>{e.text=t}},metadata:_},M,R),i(null,null,h,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:_},j,O),i(null,null,u,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:_},B,I),i(null,null,p,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:_},P,H),i(null,null,m,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:_},V,N),i(null,e={value:s},y,{kind:"class",name:s.name,metadata:_},null,w),s=e.value,_&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_}),a(s,w)}render(){const e=this.href||this.value,i=this.text||this.value,a=this.external||"_blank"===this.target||e.startsWith("http"),s=this.icon?`<span class="link-icon">${this.icon}</span>`:"",n=a?'<span class="external-icon">↗</span>':"";return t.html`
|
|
471
471
|
<div class="cell-content cell-content--link" part="content">
|
|
472
472
|
<a
|
|
473
473
|
href="${e}"
|
|
@@ -492,7 +492,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
492
492
|
<div class="cell-content cell-content--email" part="content">
|
|
493
493
|
<span class="email-empty"></span>
|
|
494
494
|
</div>
|
|
495
|
-
`}styles(){return t.css`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.email-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.email-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.email-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.email-link:visited{color:var(--snice-color-secondary,rgb(107 114 128))}.email-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.email-icon{font-size:.75rem}}@media print{.email-link{text-decoration:underline}.email-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.email-icon{display:none}}'}`}init(){this.updateEmailAttributes()}updateEmailAttributes(){if(this.column?.emailFormat){const e=this.column.emailFormat;this.email=e.email||this.value,this.displayText=e.displayText||"",this.showIcon=e.showIcon??!0}}constructor(){super(...arguments),this.value=(a(this,w),a(this,k,"")),this.email=(a(this,x),a(this,S,"")),this.displayText=(a(this,C),a(this,E,"")),this.showIcon=(a(this,D),a(this,z,!0)),this.column=(a(this,$),a(this,A,null)),this.rowData=(a(this,F),a(this,T,null)),this.align=(a(this,L),a(this,M,"left")),this.type=(a(this,R),a(this,j,"email")),a(this,O)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y=[t.element("snice-cell-phone")],w=[],k=HTMLElement,x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[];(class extends k{static{s=this}static{const
|
|
495
|
+
`}styles(){return t.css`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.email-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.email-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.email-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.email-link:visited{color:var(--snice-color-secondary,rgb(107 114 128))}.email-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.email-icon{font-size:.75rem}}@media print{.email-link{text-decoration:underline}.email-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.email-icon{display:none}}'}`}init(){this.updateEmailAttributes()}updateEmailAttributes(){if(this.column?.emailFormat){const e=this.column.emailFormat;this.email=e.email||this.value,this.displayText=e.displayText||"",this.showIcon=e.showIcon??!0}}constructor(){super(...arguments),this.value=(a(this,w),a(this,k,"")),this.email=(a(this,x),a(this,S,"")),this.displayText=(a(this,C),a(this,E,"")),this.showIcon=(a(this,D),a(this,z,!0)),this.column=(a(this,$),a(this,A,null)),this.rowData=(a(this,F),a(this,T,null)),this.align=(a(this,L),a(this,M,"left")),this.type=(a(this,R),a(this,j,"email")),a(this,O)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y=[t.element("snice-cell-phone")],w=[],k=HTMLElement,x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[];(class extends k{static{s=this}static{const _="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;n=[t.property({type:String})],l=[t.property({type:String})],r=[t.property({type:String})],o=[t.property({type:Boolean})],c=[t.property({type:Boolean})],d=[t.property({type:String})],h=[t.property({type:Object,attribute:!1})],u=[t.property({type:Object,attribute:!1})],p=[t.property({type:String})],m=[t.property({type:String})],g=[t.render()],b=[t.styles()],v=[t.ready()],f=[t.watch("value","column")],i(this,null,g,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:_},null,x),i(this,null,b,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:_},null,x),i(this,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:_},null,x),i(this,null,f,{kind:"method",name:"updatePhoneAttributes",static:!1,private:!1,access:{has:e=>"updatePhoneAttributes"in e,get:e=>e.updatePhoneAttributes},metadata:_},null,x),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:_},S,C),i(null,null,l,{kind:"field",name:"phone",static:!1,private:!1,access:{has:e=>"phone"in e,get:e=>e.phone,set:(e,t)=>{e.phone=t}},metadata:_},E,D),i(null,null,r,{kind:"field",name:"displayText",static:!1,private:!1,access:{has:e=>"displayText"in e,get:e=>e.displayText,set:(e,t)=>{e.displayText=t}},metadata:_},z,$),i(null,null,o,{kind:"field",name:"showIcon",static:!1,private:!1,access:{has:e=>"showIcon"in e,get:e=>e.showIcon,set:(e,t)=>{e.showIcon=t}},metadata:_},A,F),i(null,null,c,{kind:"field",name:"format",static:!1,private:!1,access:{has:e=>"format"in e,get:e=>e.format,set:(e,t)=>{e.format=t}},metadata:_},T,L),i(null,null,d,{kind:"field",name:"country",static:!1,private:!1,access:{has:e=>"country"in e,get:e=>e.country,set:(e,t)=>{e.country=t}},metadata:_},M,R),i(null,null,h,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:_},j,O),i(null,null,u,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:_},B,I),i(null,null,p,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:_},P,H),i(null,null,m,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:_},V,N),i(null,e={value:s},y,{kind:"class",name:s.name,metadata:_},null,w),s=e.value,_&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_}),a(s,w)}render(){const e=this.phone||this.value,i=this.displayText||(this.format?this.formatPhoneNumber(e):e),a=this.showIcon?'<span class="phone-icon">📞</span>':"";return e?t.html`
|
|
496
496
|
<div class="cell-content cell-content--phone" part="content">
|
|
497
497
|
${t.unsafeHTML(a)}
|
|
498
498
|
<a href="tel:${e}" class="phone-link" part="link">
|
|
@@ -503,12 +503,12 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
503
503
|
<div class="cell-content cell-content--phone" part="content">
|
|
504
504
|
<span class="phone-empty"></span>
|
|
505
505
|
</div>
|
|
506
|
-
`}styles(){return t.css`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.phone-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.phone-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}.phone-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.phone-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.phone-link:visited{color:var(--snice-color-secondary,rgb(107 114 128))}.phone-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.phone-icon{font-size:.75rem}}@media print{.phone-link{text-decoration:underline}.phone-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.phone-icon{display:none}}'}`}init(){this.updatePhoneAttributes()}updatePhoneAttributes(){if(this.column?.phoneFormat){const e=this.column.phoneFormat;this.phone=e.phone||this.value,this.displayText=e.displayText||"",this.showIcon=e.showIcon??!0,this.format=e.format??!0,this.country=e.country||"US"}}formatPhoneNumber(e){const t=e.replace(/\D/g,"");return"US"===this.country&&10===t.length?`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`:"US"===this.country&&11===t.length&&"1"===t[0]?`+1 (${t.slice(1,4)}) ${t.slice(4,7)}-${t.slice(7)}`:e}constructor(){super(...arguments),this.value=(a(this,x),a(this,S,"")),this.phone=(a(this,C),a(this,E,"")),this.displayText=(a(this,D),a(this,z,"")),this.showIcon=(a(this,$),a(this,A,!0)),this.format=(a(this,F),a(this,T,!0)),this.country=(a(this,L),a(this,M,"US")),this.column=(a(this,R),a(this,j,null)),this.rowData=(a(this,O),a(this,B,null)),this.align=(a(this,I),a(this,P,"left")),this.type=(a(this,H),a(this,V,"phone")),a(this,N)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y=[t.element("snice-cell-color")],w=[],k=HTMLElement,x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[];(class extends k{static{s=this}static{const
|
|
506
|
+
`}styles(){return t.css`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.phone-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.phone-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}.phone-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.phone-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.phone-link:visited{color:var(--snice-color-secondary,rgb(107 114 128))}.phone-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.phone-icon{font-size:.75rem}}@media print{.phone-link{text-decoration:underline}.phone-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.phone-icon{display:none}}'}`}init(){this.updatePhoneAttributes()}updatePhoneAttributes(){if(this.column?.phoneFormat){const e=this.column.phoneFormat;this.phone=e.phone||this.value,this.displayText=e.displayText||"",this.showIcon=e.showIcon??!0,this.format=e.format??!0,this.country=e.country||"US"}}formatPhoneNumber(e){const t=e.replace(/\D/g,"");return"US"===this.country&&10===t.length?`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`:"US"===this.country&&11===t.length&&"1"===t[0]?`+1 (${t.slice(1,4)}) ${t.slice(4,7)}-${t.slice(7)}`:e}constructor(){super(...arguments),this.value=(a(this,x),a(this,S,"")),this.phone=(a(this,C),a(this,E,"")),this.displayText=(a(this,D),a(this,z,"")),this.showIcon=(a(this,$),a(this,A,!0)),this.format=(a(this,F),a(this,T,!0)),this.country=(a(this,L),a(this,M,"US")),this.column=(a(this,R),a(this,j,null)),this.rowData=(a(this,O),a(this,B,null)),this.align=(a(this,I),a(this,P,"left")),this.type=(a(this,H),a(this,V,"phone")),a(this,N)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y=[t.element("snice-cell-color")],w=[],k=HTMLElement,x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[];(class extends k{static{s=this}static{const _="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;n=[t.property({type:String})],l=[t.property({type:String})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({type:Boolean})],d=[t.property({type:String})],h=[t.property({type:Object,attribute:!1})],u=[t.property({type:Object,attribute:!1})],p=[t.property({type:String})],m=[t.property({type:String})],g=[t.render()],b=[t.styles()],v=[t.ready()],f=[t.watch("value","column")],i(this,null,g,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:_},null,x),i(this,null,b,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:_},null,x),i(this,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:_},null,x),i(this,null,f,{kind:"method",name:"updateColorAttributes",static:!1,private:!1,access:{has:e=>"updateColorAttributes"in e,get:e=>e.updateColorAttributes},metadata:_},null,x),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:_},S,C),i(null,null,l,{kind:"field",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:_},E,D),i(null,null,r,{kind:"field",name:"showSwatch",static:!1,private:!1,access:{has:e=>"showSwatch"in e,get:e=>e.showSwatch,set:(e,t)=>{e.showSwatch=t}},metadata:_},z,$),i(null,null,o,{kind:"field",name:"showHex",static:!1,private:!1,access:{has:e=>"showHex"in e,get:e=>e.showHex,set:(e,t)=>{e.showHex=t}},metadata:_},A,F),i(null,null,c,{kind:"field",name:"showRgb",static:!1,private:!1,access:{has:e=>"showRgb"in e,get:e=>e.showRgb,set:(e,t)=>{e.showRgb=t}},metadata:_},T,L),i(null,null,d,{kind:"field",name:"swatchSize",static:!1,private:!1,access:{has:e=>"swatchSize"in e,get:e=>e.swatchSize,set:(e,t)=>{e.swatchSize=t}},metadata:_},M,R),i(null,null,h,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:_},j,O),i(null,null,u,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:_},B,I),i(null,null,p,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:_},P,H),i(null,null,m,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:_},V,N),i(null,e={value:s},y,{kind:"class",name:s.name,metadata:_},null,w),s=e.value,_&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_}),a(s,w)}render(){const e=this.color||this.value,i=this.showSwatch?`<span class="color-swatch color-swatch--${this.swatchSize}" style="background-color: ${e};"></span>`:"";let a="";if(this.showHex&&(a=e),this.showRgb&&e.startsWith("#")){const t=this.hexToRgb(e);a=t?`rgb(${t.r}, ${t.g}, ${t.b})`:e}return t.html`
|
|
507
507
|
<div class="cell-content cell-content--color" part="content">
|
|
508
508
|
${t.unsafeHTML(i)}
|
|
509
509
|
${a?t.html`<span class="color-text">${a}</span>`:""}
|
|
510
510
|
</div>
|
|
511
|
-
`}styles(){return t.css`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.5rem}.color-swatch{border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:.25rem;flex-shrink:0;box-shadow:var(--snice-shadow-xs,0 1px 2px 0 rgb(0 0 0 / .03))}.color-swatch--small{width:1rem;height:1rem}.color-swatch--medium{width:1.5rem;height:1.5rem}.color-swatch--large{width:2rem;height:2rem}.color-text{font-family:monospace;font-size:.875rem;color:var(--snice-color-text,rgb(23 23 23));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.color-swatch--small{width:.875rem;height:.875rem}.color-swatch--medium{width:1.25rem;height:1.25rem}.color-swatch--large{width:1.75rem;height:1.75rem}.color-text{font-size:.75rem}}@media print{.color-swatch{border:2px solid var(--snice-color-text,rgb(23 23 23))}.color-text{font-size:.75rem}}"}`}init(){this.updateColorAttributes()}updateColorAttributes(){if(this.column?.colorFormat){const e=this.column.colorFormat;this.color=e.color||this.value,this.showSwatch=e.showSwatch??!0,this.showHex=e.showHex??!0,this.showRgb=e.showRgb??!1,this.swatchSize=e.swatchSize||"medium"}}hexToRgb(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}constructor(){super(...arguments),this.value=(a(this,x),a(this,S,"")),this.color=(a(this,C),a(this,E,"")),this.showSwatch=(a(this,D),a(this,z,!0)),this.showHex=(a(this,$),a(this,A,!0)),this.showRgb=(a(this,F),a(this,T,!1)),this.swatchSize=(a(this,L),a(this,M,"medium")),this.column=(a(this,R),a(this,j,null)),this.rowData=(a(this,O),a(this,B,null)),this.align=(a(this,I),a(this,P,"left")),this.type=(a(this,H),a(this,V,"color")),a(this,N)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w=[t.element("snice-cell-location")],k=[],x=HTMLElement,S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],
|
|
511
|
+
`}styles(){return t.css`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.5rem}.color-swatch{border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:.25rem;flex-shrink:0;box-shadow:var(--snice-shadow-xs,0 1px 2px 0 rgb(0 0 0 / .03))}.color-swatch--small{width:1rem;height:1rem}.color-swatch--medium{width:1.5rem;height:1.5rem}.color-swatch--large{width:2rem;height:2rem}.color-text{font-family:monospace;font-size:.875rem;color:var(--snice-color-text,rgb(23 23 23));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.color-swatch--small{width:.875rem;height:.875rem}.color-swatch--medium{width:1.25rem;height:1.25rem}.color-swatch--large{width:1.75rem;height:1.75rem}.color-text{font-size:.75rem}}@media print{.color-swatch{border:2px solid var(--snice-color-text,rgb(23 23 23))}.color-text{font-size:.75rem}}"}`}init(){this.updateColorAttributes()}updateColorAttributes(){if(this.column?.colorFormat){const e=this.column.colorFormat;this.color=e.color||this.value,this.showSwatch=e.showSwatch??!0,this.showHex=e.showHex??!0,this.showRgb=e.showRgb??!1,this.swatchSize=e.swatchSize||"medium"}}hexToRgb(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}constructor(){super(...arguments),this.value=(a(this,x),a(this,S,"")),this.color=(a(this,C),a(this,E,"")),this.showSwatch=(a(this,D),a(this,z,!0)),this.showHex=(a(this,$),a(this,A,!0)),this.showRgb=(a(this,F),a(this,T,!1)),this.swatchSize=(a(this,L),a(this,M,"medium")),this.column=(a(this,R),a(this,j,null)),this.rowData=(a(this,O),a(this,B,null)),this.align=(a(this,I),a(this,P,"left")),this.type=(a(this,H),a(this,V,"color")),a(this,N)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w=[t.element("snice-cell-location")],k=[],x=HTMLElement,S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[];(class extends x{static{s=this}static{const K="function"==typeof Symbol&&Symbol.metadata?Object.create(x[Symbol.metadata]??null):void 0;n=[t.property({type:String})],l=[t.property({type:String})],r=[t.property({type:String})],o=[t.property({type:String})],c=[t.property({type:Boolean})],d=[t.property({type:String})],h=[t.property({type:Boolean})],u=[t.property({type:Object,attribute:!1})],p=[t.property({type:Object,attribute:!1})],m=[t.property({type:String})],g=[t.property({type:String})],b=[t.render()],v=[t.styles()],f=[t.ready()],y=[t.watch("value","column")],i(this,null,b,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:K},null,S),i(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:K},null,S),i(this,null,f,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:K},null,S),i(this,null,y,{kind:"method",name:"updateLocationAttributes",static:!1,private:!1,access:{has:e=>"updateLocationAttributes"in e,get:e=>e.updateLocationAttributes},metadata:K},null,S),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:K},C,E),i(null,null,l,{kind:"field",name:"address",static:!1,private:!1,access:{has:e=>"address"in e,get:e=>e.address,set:(e,t)=>{e.address=t}},metadata:K},D,z),i(null,null,r,{kind:"field",name:"latitude",static:!1,private:!1,access:{has:e=>"latitude"in e,get:e=>e.latitude,set:(e,t)=>{e.latitude=t}},metadata:K},$,A),i(null,null,o,{kind:"field",name:"longitude",static:!1,private:!1,access:{has:e=>"longitude"in e,get:e=>e.longitude,set:(e,t)=>{e.longitude=t}},metadata:K},F,T),i(null,null,c,{kind:"field",name:"showMapLink",static:!1,private:!1,access:{has:e=>"showMapLink"in e,get:e=>e.showMapLink,set:(e,t)=>{e.showMapLink=t}},metadata:K},L,M),i(null,null,d,{kind:"field",name:"mapProvider",static:!1,private:!1,access:{has:e=>"mapProvider"in e,get:e=>e.mapProvider,set:(e,t)=>{e.mapProvider=t}},metadata:K},R,j),i(null,null,h,{kind:"field",name:"showIcon",static:!1,private:!1,access:{has:e=>"showIcon"in e,get:e=>e.showIcon,set:(e,t)=>{e.showIcon=t}},metadata:K},O,B),i(null,null,u,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:K},I,P),i(null,null,p,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:K},H,V),i(null,null,m,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:K},N,_),i(null,null,g,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:K},q,W),i(null,e={value:s},w,{kind:"class",name:s.name,metadata:K},null,k),s=e.value,K&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:K}),a(s,k)}render(){const e=this.address||this.value,i=this.showIcon?'<span class="location-icon">📍</span>':"",a=this.getMapLink();if(!e&&!this.latitude&&!this.longitude)return t.html`
|
|
512
512
|
<div class="cell-content cell-content--location" part="content">
|
|
513
513
|
<span class="location-empty"></span>
|
|
514
514
|
</div>
|
|
@@ -519,7 +519,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
519
519
|
${s}
|
|
520
520
|
</a>`:t.html`<span class="location-text">${s}</span>`}
|
|
521
521
|
</div>
|
|
522
|
-
`}styles(){return t.css`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.location-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.location-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.location-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.location-link:visited{color:var(--snice-color-secondary,rgb(107 114 128))}.location-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--snice-color-text,rgb(23 23 23))}.location-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.location-icon{font-size:.75rem}}@media print{.location-link{text-decoration:underline}.location-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.location-icon{display:none}}'}`}init(){this.updateLocationAttributes()}updateLocationAttributes(){if(this.column?.locationFormat){const e=this.column.locationFormat;this.address=e.address||this.value,this.latitude=e.latitude?String(e.latitude):"",this.longitude=e.longitude?String(e.longitude):"",this.showMapLink=e.showMapLink??!0,this.mapProvider=e.mapProvider||"google",this.showIcon=e.showIcon??!0}}getMapLink(){if(!this.showMapLink)return"";const e=this.address||this.value,t=this.latitude,i=this.longitude;switch(this.mapProvider){case"google":return t&&i?`https://www.google.com/maps?q=${t},${i}`:e?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(e)}`:"";case"openstreetmap":return t&&i?`https://www.openstreetmap.org/?mlat=${t}&mlon=${i}&zoom=15`:e?`https://www.openstreetmap.org/search?query=${encodeURIComponent(e)}`:"";case"apple":return t&&i?`https://maps.apple.com/?ll=${t},${i}`:e?`https://maps.apple.com/?address=${encodeURIComponent(e)}`:"";default:return""}}constructor(){super(...arguments),this.value=(a(this,S),a(this,C,"")),this.address=(a(this,E),a(this,D,"")),this.latitude=(a(this,z),a(this,$,"")),this.longitude=(a(this,A),a(this,F,"")),this.showMapLink=(a(this,T),a(this,L,!0)),this.mapProvider=(a(this,M),a(this,R,"google")),this.showIcon=(a(this,j),a(this,O,!0)),this.column=(a(this,B),a(this,I,null)),this.rowData=(a(this,P),a(this,H,null)),this.align=(a(this,V),a(this,N,"left")),this.type=(a(this,
|
|
522
|
+
`}styles(){return t.css`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.location-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.location-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.location-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.location-link:visited{color:var(--snice-color-secondary,rgb(107 114 128))}.location-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--snice-color-text,rgb(23 23 23))}.location-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.location-icon{font-size:.75rem}}@media print{.location-link{text-decoration:underline}.location-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.location-icon{display:none}}'}`}init(){this.updateLocationAttributes()}updateLocationAttributes(){if(this.column?.locationFormat){const e=this.column.locationFormat;this.address=e.address||this.value,this.latitude=e.latitude?String(e.latitude):"",this.longitude=e.longitude?String(e.longitude):"",this.showMapLink=e.showMapLink??!0,this.mapProvider=e.mapProvider||"google",this.showIcon=e.showIcon??!0}}getMapLink(){if(!this.showMapLink)return"";const e=this.address||this.value,t=this.latitude,i=this.longitude;switch(this.mapProvider){case"google":return t&&i?`https://www.google.com/maps?q=${t},${i}`:e?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(e)}`:"";case"openstreetmap":return t&&i?`https://www.openstreetmap.org/?mlat=${t}&mlon=${i}&zoom=15`:e?`https://www.openstreetmap.org/search?query=${encodeURIComponent(e)}`:"";case"apple":return t&&i?`https://maps.apple.com/?ll=${t},${i}`:e?`https://maps.apple.com/?address=${encodeURIComponent(e)}`:"";default:return""}}constructor(){super(...arguments),this.value=(a(this,S),a(this,C,"")),this.address=(a(this,E),a(this,D,"")),this.latitude=(a(this,z),a(this,$,"")),this.longitude=(a(this,A),a(this,F,"")),this.showMapLink=(a(this,T),a(this,L,!0)),this.mapProvider=(a(this,M),a(this,R,"google")),this.showIcon=(a(this,j),a(this,O,!0)),this.column=(a(this,B),a(this,I,null)),this.rowData=(a(this,P),a(this,H,null)),this.align=(a(this,V),a(this,N,"left")),this.type=(a(this,_),a(this,q,"location")),a(this,W)}})})();function o(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(()=>{let e,s,n,l,r,c,d,h,u,p,m,g,b,v,f,y=[t.element("snice-cell-json")],w=[],k=HTMLElement,x=[],S=[],C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[];(class extends k{static{s=this}static{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;n=[t.property({type:String})],l=[t.property({type:Boolean})],r=[t.property({type:Number})],c=[t.property({type:Boolean})],d=[t.property({type:Object,attribute:!1})],h=[t.property({type:Object,attribute:!1})],u=[t.property({type:String})],p=[t.property({type:String})],m=[t.render()],g=[t.styles()],b=[t.ready()],v=[t.watch("value","column")],f=[t.on("click",".json-toggle")],i(this,null,m,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:o},null,x),i(this,null,g,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:o},null,x),i(this,null,b,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:o},null,x),i(this,null,v,{kind:"method",name:"updateJsonAttributes",static:!1,private:!1,access:{has:e=>"updateJsonAttributes"in e,get:e=>e.updateJsonAttributes},metadata:o},null,x),i(this,null,f,{kind:"method",name:"handleToggle",static:!1,private:!1,access:{has:e=>"handleToggle"in e,get:e=>e.handleToggle},metadata:o},null,x),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:o},S,C),i(null,null,l,{kind:"field",name:"collapsed",static:!1,private:!1,access:{has:e=>"collapsed"in e,get:e=>e.collapsed,set:(e,t)=>{e.collapsed=t}},metadata:o},E,D),i(null,null,r,{kind:"field",name:"maxDepth",static:!1,private:!1,access:{has:e=>"maxDepth"in e,get:e=>e.maxDepth,set:(e,t)=>{e.maxDepth=t}},metadata:o},z,$),i(null,null,c,{kind:"field",name:"showToggle",static:!1,private:!1,access:{has:e=>"showToggle"in e,get:e=>e.showToggle,set:(e,t)=>{e.showToggle=t}},metadata:o},A,F),i(null,null,d,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:o},T,L),i(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:o},M,R),i(null,null,u,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:o},j,O),i(null,null,p,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:o},B,I),i(null,e={value:s},y,{kind:"class",name:s.name,metadata:o},null,w),s=e.value,o&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),a(s,w)}render(){const e="string"==typeof this.value?this.tryParseJson(this.value):this.value;if(null==e)return t.html`
|
|
523
523
|
<div class="cell-content cell-content--json" part="content">
|
|
524
524
|
<span class="json-empty">null</span>
|
|
525
525
|
</div>
|
|
@@ -530,11 +530,11 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
530
530
|
${t.unsafeHTML(a)}
|
|
531
531
|
</div>
|
|
532
532
|
</div>
|
|
533
|
-
`}styles(){return t.css`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:auto;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0}.json-toggle{background:0 0;border:none;color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;padding:.125rem .25rem;font-size:.75rem;line-height:1;border-radius:.25rem;transition:background-color .2s;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}.json-toggle svg{width:.75rem;height:.75rem}.json-toggle:hover{background-color:var(--snice-color-surface-hover,rgb(245 245 245))}.json-toggle:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px}.json-viewer{font-family:'Courier New',Consolas,monospace;font-size:.8125rem;overflow:hidden;flex:1}.json-viewer--collapsed{white-space:nowrap;text-overflow:ellipsis}.json-viewer--expanded{white-space:pre-wrap;word-break:break-word}.json-preview{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}.json-object{padding-left:1rem}.json-line{margin:.125rem 0}.json-key{color:var(--snice-color-primary,rgb(37 99 235));font-weight:var(--snice-font-weight-medium,500);margin-right:.25rem}.json-string{color:var(--snice-color-success,rgb(22 163 74))}.json-number{color:var(--snice-color-primary,rgb(59 130 246))}.json-boolean{color:var(--snice-color-warning,rgb(234 179 8))}.json-empty,.json-null,.json-undefined{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.json-viewer{font-size:.75rem}.json-toggle{font-size:.625rem}}@media print{.json-toggle{display:none}.json-viewer--collapsed{white-space:normal}.json-viewer{font-size:.625rem}}"}`}init(){this.updateJsonAttributes()}updateJsonAttributes(){if(this.column?.jsonFormat){const e=this.column.jsonFormat;this.collapsed=e.collapsed??!0,this.maxDepth=e.maxDepth??3,this.showToggle=e.showToggle??!0}}handleToggle(){this.collapsed=!this.collapsed}tryParseJson(e){try{return JSON.parse(e)}catch{return e}}renderCollapsed(e){if("object"==typeof e&&null!==e){if(Array.isArray(e))return`<span class="json-preview">[${e.length} items]</span>`;return`<span class="json-preview">{${Object.keys(e).length} keys}</span>`}return this.renderValue(e)}renderExpanded(e,t=0){if(t>=this.maxDepth)return this.renderCollapsed(e);if("object"==typeof e&&null!==e){if(Array.isArray(e)){return`<div class="json-object">[${e.map((e,i)=>`<div class="json-line"><span class="json-key">${i}:</span> ${this.renderExpanded(e,t+1)}</div>`).join("")}]</div>`}return`<div class="json-object">{${Object.entries(e).map(([e,i])=>{const a=this.renderExpanded(i,t+1);return`<div class="json-line"><span class="json-key">${o(e)}:</span> ${a}</div>`}).join("")}}</div>`}return this.renderValue(e)}renderValue(e){return null===e?'<span class="json-null">null</span>':void 0===e?'<span class="json-undefined">undefined</span>':"boolean"==typeof e?`<span class="json-boolean">${e}</span>`:"number"==typeof e?`<span class="json-number">${e}</span>`:"string"==typeof e?`<span class="json-string">"${o(e)}"</span>`:o(String(e))}constructor(){super(...arguments),this.value=(a(this,x),a(this,S,null)),this.collapsed=(a(this,C),a(this,E,!0)),this.maxDepth=(a(this,D),a(this,z,3)),this.showToggle=(a(this,$),a(this,A,!0)),this.column=(a(this,F),a(this,T,null)),this.rowData=(a(this,L),a(this,M,null)),this.align=(a(this,R),a(this,j,"left")),this.type=(a(this,O),a(this,B,"json")),a(this,I)}})})(),(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C=[t.element("snice-cell-currency")],E=[],D=HTMLElement,z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],
|
|
533
|
+
`}styles(){return t.css`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:auto;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0}.json-toggle{background:0 0;border:none;color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;padding:.125rem .25rem;font-size:.75rem;line-height:1;border-radius:.25rem;transition:background-color .2s;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}.json-toggle svg{width:.75rem;height:.75rem}.json-toggle:hover{background-color:var(--snice-color-surface-hover,rgb(245 245 245))}.json-toggle:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px}.json-viewer{font-family:'Courier New',Consolas,monospace;font-size:.8125rem;overflow:hidden;flex:1}.json-viewer--collapsed{white-space:nowrap;text-overflow:ellipsis}.json-viewer--expanded{white-space:pre-wrap;word-break:break-word}.json-preview{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}.json-object{padding-left:1rem}.json-line{margin:.125rem 0}.json-key{color:var(--snice-color-primary,rgb(37 99 235));font-weight:var(--snice-font-weight-medium,500);margin-right:.25rem}.json-string{color:var(--snice-color-success,rgb(22 163 74))}.json-number{color:var(--snice-color-primary,rgb(59 130 246))}.json-boolean{color:var(--snice-color-warning,rgb(234 179 8))}.json-empty,.json-null,.json-undefined{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.json-viewer{font-size:.75rem}.json-toggle{font-size:.625rem}}@media print{.json-toggle{display:none}.json-viewer--collapsed{white-space:normal}.json-viewer{font-size:.625rem}}"}`}init(){this.updateJsonAttributes()}updateJsonAttributes(){if(this.column?.jsonFormat){const e=this.column.jsonFormat;this.collapsed=e.collapsed??!0,this.maxDepth=e.maxDepth??3,this.showToggle=e.showToggle??!0}}handleToggle(){this.collapsed=!this.collapsed}tryParseJson(e){try{return JSON.parse(e)}catch{return e}}renderCollapsed(e){if("object"==typeof e&&null!==e){if(Array.isArray(e))return`<span class="json-preview">[${e.length} items]</span>`;return`<span class="json-preview">{${Object.keys(e).length} keys}</span>`}return this.renderValue(e)}renderExpanded(e,t=0){if(t>=this.maxDepth)return this.renderCollapsed(e);if("object"==typeof e&&null!==e){if(Array.isArray(e)){return`<div class="json-object">[${e.map((e,i)=>`<div class="json-line"><span class="json-key">${i}:</span> ${this.renderExpanded(e,t+1)}</div>`).join("")}]</div>`}return`<div class="json-object">{${Object.entries(e).map(([e,i])=>{const a=this.renderExpanded(i,t+1);return`<div class="json-line"><span class="json-key">${o(e)}:</span> ${a}</div>`}).join("")}}</div>`}return this.renderValue(e)}renderValue(e){return null===e?'<span class="json-null">null</span>':void 0===e?'<span class="json-undefined">undefined</span>':"boolean"==typeof e?`<span class="json-boolean">${e}</span>`:"number"==typeof e?`<span class="json-number">${e}</span>`:"string"==typeof e?`<span class="json-string">"${o(e)}"</span>`:o(String(e))}constructor(){super(...arguments),this.value=(a(this,x),a(this,S,null)),this.collapsed=(a(this,C),a(this,E,!0)),this.maxDepth=(a(this,D),a(this,z,3)),this.showToggle=(a(this,$),a(this,A,!0)),this.column=(a(this,F),a(this,T,null)),this.rowData=(a(this,L),a(this,M,null)),this.align=(a(this,R),a(this,j,"left")),this.type=(a(this,O),a(this,B,"json")),a(this,I)}})})(),(()=>{let e,s,n,l,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C=[t.element("snice-cell-currency")],E=[],D=HTMLElement,z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[],K=[],Y=[],U=[],G=[],J=[],X=[],Z=[],Q=[];(class extends D{static{s=this}static{const r="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;n=[t.property({type:String})],l=[t.property({type:String})],o=[t.property({})],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:Object,attribute:!1})],h=[t.query(".cell-content")],u=[t.property({type:Number})],p=[t.property({type:Boolean,attribute:"thousands-separator"})],m=[t.property({type:String})],g=[t.property({type:String})],b=[t.property({type:String})],v=[t.property({type:String,attribute:"negative-style"})],f=[t.property({type:Boolean})],y=[t.render()],w=[t.styles()],k=[t.ready()],x=[t.watch("align")],S=[t.watch("value","column")],i(this,null,y,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:r},null,z),i(this,null,w,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:r},null,z),i(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:r},null,z),i(this,null,x,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:r},null,z),i(this,null,S,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:r},null,z),i(null,null,n,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:r},$,A),i(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:r},F,T),i(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:r},L,M),i(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:r},R,j),i(null,null,d,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:r},O,B),i(null,null,h,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:r},I,P),i(null,null,u,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:r},H,V),i(null,null,p,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:e=>"thousandsSeparator"in e,get:e=>e.thousandsSeparator,set:(e,t)=>{e.thousandsSeparator=t}},metadata:r},N,_),i(null,null,m,{kind:"field",name:"currency",static:!1,private:!1,access:{has:e=>"currency"in e,get:e=>e.currency,set:(e,t)=>{e.currency=t}},metadata:r},q,W),i(null,null,g,{kind:"field",name:"currencyDisplay",static:!1,private:!1,access:{has:e=>"currencyDisplay"in e,get:e=>e.currencyDisplay,set:(e,t)=>{e.currencyDisplay=t}},metadata:r},K,Y),i(null,null,b,{kind:"field",name:"locale",static:!1,private:!1,access:{has:e=>"locale"in e,get:e=>e.locale,set:(e,t)=>{e.locale=t}},metadata:r},U,G),i(null,null,v,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:e=>"negativeStyle"in e,get:e=>e.negativeStyle,set:(e,t)=>{e.negativeStyle=t}},metadata:r},J,X),i(null,null,f,{kind:"field",name:"highlight",static:!1,private:!1,access:{has:e=>"highlight"in e,get:e=>e.highlight,set:(e,t)=>{e.highlight=t}},metadata:r},Z,Q),i(null,e={value:s},C,{kind:"class",name:s.name,metadata:r},null,E),s=e.value,r&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:r}),a(s,E)}render(){const e=this.formatCurrencyValue(),i=this.getCurrencyStyles();return t.html`
|
|
534
534
|
<div class="cell-content cell-content--number" part="content" style="${i}">
|
|
535
535
|
${e}
|
|
536
536
|
</div>
|
|
537
|
-
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatCurrencyValue(),t=this.getCurrencyStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatCurrencyValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.currencyFormat||{decimals:this.decimals,currency:this.currency,currencyDisplay:this.currencyDisplay,locale:this.locale,negativeStyle:this.negativeStyle},t=Number(this.value);if(isNaN(t))return String(this.value);try{let i=new Intl.NumberFormat(e.locale||this.locale,{style:"currency",currency:e.currency||this.currency,currencyDisplay:e.currencyDisplay||this.currencyDisplay,minimumFractionDigits:e.decimals??this.decimals,maximumFractionDigits:e.decimals??this.decimals}).format(Math.abs(t));if(t<0){const t=e.negativeStyle??this.negativeStyle;i="parentheses"===t?`(${i})`:`-${i}`}return i}catch(i){let a=t.toFixed(e.decimals??this.decimals);if(this.thousandsSeparator){const e=a.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=e.join(".")}return`$${a}`}}getCurrencyStyles(){const e=Number(this.value);if(this.classList.remove("number--negative","number--positive","number--zero","number--highlighted"),e<0){this.classList.add("number--negative");"red"===(this.column.currencyFormat?.negativeStyle??this.negativeStyle)&&this.classList.add("number--negative-red")}else e>0?(this.classList.add("number--positive"),this.highlight&&this.classList.add("number--highlighted")):0===e&&this.classList.add("number--zero");return"text-align: right"}constructor(){super(...arguments),this.align=(a(this,z),a(this,$,"right")),this.type=(a(this,A),a(this,F,"currency")),this.value=(a(this,T),a(this,L,"")),this.column=(a(this,M),a(this,R,{key:"",label:"",type:"currency",align:"right"})),this.rowData=(a(this,j),a(this,O,null)),this.contentElement=(a(this,B),a(this,I,void 0)),this.decimals=(a(this,P),a(this,H,2)),this.thousandsSeparator=(a(this,V),a(this,N,!0)),this.currency=(a(this,
|
|
537
|
+
`}styles(){return t.css`${r}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatCurrencyValue(),t=this.getCurrencyStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatCurrencyValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.currencyFormat||{decimals:this.decimals,currency:this.currency,currencyDisplay:this.currencyDisplay,locale:this.locale,negativeStyle:this.negativeStyle},t=Number(this.value);if(isNaN(t))return String(this.value);try{let i=new Intl.NumberFormat(e.locale||this.locale,{style:"currency",currency:e.currency||this.currency,currencyDisplay:e.currencyDisplay||this.currencyDisplay,minimumFractionDigits:e.decimals??this.decimals,maximumFractionDigits:e.decimals??this.decimals}).format(Math.abs(t));if(t<0){const t=e.negativeStyle??this.negativeStyle;i="parentheses"===t?`(${i})`:`-${i}`}return i}catch(i){let a=t.toFixed(e.decimals??this.decimals);if(this.thousandsSeparator){const e=a.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=e.join(".")}return`$${a}`}}getCurrencyStyles(){const e=Number(this.value);if(this.classList.remove("number--negative","number--positive","number--zero","number--highlighted"),e<0){this.classList.add("number--negative");"red"===(this.column.currencyFormat?.negativeStyle??this.negativeStyle)&&this.classList.add("number--negative-red")}else e>0?(this.classList.add("number--positive"),this.highlight&&this.classList.add("number--highlighted")):0===e&&this.classList.add("number--zero");return"text-align: right"}constructor(){super(...arguments),this.align=(a(this,z),a(this,$,"right")),this.type=(a(this,A),a(this,F,"currency")),this.value=(a(this,T),a(this,L,"")),this.column=(a(this,M),a(this,R,{key:"",label:"",type:"currency",align:"right"})),this.rowData=(a(this,j),a(this,O,null)),this.contentElement=(a(this,B),a(this,I,void 0)),this.decimals=(a(this,P),a(this,H,2)),this.thousandsSeparator=(a(this,V),a(this,N,!0)),this.currency=(a(this,_),a(this,q,"USD")),this.currencyDisplay=(a(this,W),a(this,K,"symbol")),this.locale=(a(this,Y),a(this,U,"en-US")),this.negativeStyle=(a(this,G),a(this,J,"red")),this.highlight=(a(this,X),a(this,Z,!1)),a(this,Q)}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k=[t.element("snice-cell-image")],x=[],S=HTMLElement,C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[],P=[],H=[],V=[],N=[],_=[],q=[],W=[],K=[],Y=[],U=[];(class extends S{static{s=this}static{const G="function"==typeof Symbol&&Symbol.metadata?Object.create(S[Symbol.metadata]??null):void 0;n=[t.property({type:String})],l=[t.property({type:String})],r=[t.property({type:String})],o=[t.property({type:String})],c=[t.property({type:String})],d=[t.property({type:String})],h=[t.property({type:Boolean})],u=[t.property({type:Object,attribute:!1})],p=[t.property({type:Object,attribute:!1})],m=[t.property({type:String})],g=[t.property({type:String})],b=[t.property({type:Boolean})],v=[t.render()],f=[t.styles()],y=[t.ready()],w=[t.watch("column")],i(this,null,v,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:G},null,C),i(this,null,f,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:G},null,C),i(this,null,y,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:G},null,C),i(this,null,w,{kind:"method",name:"updateImageAttributes",static:!1,private:!1,access:{has:e=>"updateImageAttributes"in e,get:e=>e.updateImageAttributes},metadata:G},null,C),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:G},E,D),i(null,null,l,{kind:"field",name:"src",static:!1,private:!1,access:{has:e=>"src"in e,get:e=>e.src,set:(e,t)=>{e.src=t}},metadata:G},z,$),i(null,null,r,{kind:"field",name:"alt",static:!1,private:!1,access:{has:e=>"alt"in e,get:e=>e.alt,set:(e,t)=>{e.alt=t}},metadata:G},A,F),i(null,null,o,{kind:"field",name:"fallback",static:!1,private:!1,access:{has:e=>"fallback"in e,get:e=>e.fallback,set:(e,t)=>{e.fallback=t}},metadata:G},T,L),i(null,null,c,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:G},M,R),i(null,null,d,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:G},j,O),i(null,null,h,{kind:"field",name:"lazy",static:!1,private:!1,access:{has:e=>"lazy"in e,get:e=>e.lazy,set:(e,t)=>{e.lazy=t}},metadata:G},B,I),i(null,null,u,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:G},P,H),i(null,null,p,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:G},V,N),i(null,null,m,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:G},_,q),i(null,null,g,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:G},W,K),i(null,null,b,{kind:"field",name:"imageError",static:!1,private:!1,access:{has:e=>"imageError"in e,get:e=>e.imageError,set:(e,t)=>{e.imageError=t}},metadata:G},Y,U),i(null,e={value:s},k,{kind:"class",name:s.name,metadata:G},null,x),s=e.value,G&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:G}),a(s,x)}render(){const e=this.src||this.value,i=this.alt||"Image",a=this.lazy?"lazy":"eager",s=`cell-image ${`image--${this.variant}`} ${`image--${this.size}`}`;return this.imageError&&this.fallback?t.html`
|
|
538
538
|
<div class="cell-content cell-content--image" part="content">
|
|
539
539
|
<img src="${this.fallback}" alt="${i}" class="${s}" />
|
|
540
540
|
</div>
|
|
@@ -548,7 +548,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
548
548
|
<span class="cell-image__placeholder-icon" aria-hidden="true">${t.unsafeHTML('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"/></svg>')}</span>
|
|
549
549
|
</div>
|
|
550
550
|
</div>
|
|
551
|
-
`}styles(){return t.css`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center}.cell-image{display:block;object-fit:cover;background-color:rgb(243 244 246)}.image--small{width:1.5rem;height:1.5rem}.image--medium{width:2rem;height:2rem}.image--large{width:3rem;height:3rem}.image--rounded{border-radius:.25rem}.image--square{border-radius:0}.image--circle{border-radius:50%}.cell-image--placeholder{background:linear-gradient(135deg,rgb(229 231 235) 0,rgb(209 213 219) 100%);border:1px solid rgb(209 213 219);position:relative}.cell-image__placeholder-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:inline-flex;align-items:center;justify-content:center;color:var(--snice-color-text-tertiary,rgb(115 115 115));opacity:.55}.cell-image__placeholder-icon svg{width:50%;max-width:1.25rem;height:auto}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}:host(.loading) .cell-image{opacity:.6;animation:1.5s ease-in-out infinite image-pulse}@keyframes image-pulse{0%,100%{opacity:.6}50%{opacity:.3}}@media (max-width:768px){.image--small{width:1.25rem;height:1.25rem}.image--medium{width:1.75rem;height:1.75rem}.image--large{width:2.5rem;height:2.5rem}}@media (prefers-reduced-motion:reduce){:host(.loading) .cell-image{animation:none}}@media print{.cell-image{max-width:2rem;max-height:2rem}}"}`}init(){this.updateImageAttributes()}updateImageAttributes(){if(this.column?.imageFormat){const e=this.column.imageFormat;this.src=e.src||this.value,this.alt=e.alt||"",this.fallback=e.fallback||"",this.variant=e.variant||"rounded",this.size=e.size||"medium",this.lazy=e.lazy??!0}}handleImageError(){this.imageError=!0}constructor(){super(...arguments),this.value=(a(this,C),a(this,E,"")),this.src=(a(this,D),a(this,z,"")),this.alt=(a(this,$),a(this,A,"")),this.fallback=(a(this,F),a(this,T,"")),this.variant=(a(this,L),a(this,M,"rounded")),this.size=(a(this,R),a(this,j,"medium")),this.lazy=(a(this,O),a(this,B,!0)),this.column=(a(this,I),a(this,P,null)),this.rowData=(a(this,H),a(this,V,null)),this.align=(a(this,N),a(this,q,"center")),this.type=(a(this,_),a(this,W,"image")),this.imageError=(a(this,K),a(this,Y,!1)),a(this,U)}})})(),(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z,$,A,F,T,L,M,R,j,O,B,I,P,H,V,N,q,_,W,K,Y,U,G,J,X,Z,Q,ee,te,ie=[t.element("snice-column")],ae=[],se=HTMLElement,ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],pe=[],me=[],ge=[],be=[],ve=[],fe=[],ye=[],we=[],ke=[],xe=[],Se=[],Ce=[],Ee=[],De=[],ze=[],$e=[],Ae=[],Fe=[],Te=[],Le=[],Me=[],Re=[],je=[],Oe=[],Be=[],Ie=[],Pe=[],He=[],Ve=[],Ne=[],qe=[],_e=[],We=[],Ke=[],Ye=[],Ue=[],Ge=[],Je=[],Xe=[],Ze=[],Qe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],pt=[],mt=[],gt=[],bt=[],vt=[],ft=[],yt=[],wt=[],kt=[],xt=[],St=[],Ct=[],Et=[],Dt=[],zt=[],$t=[],At=[],Ft=[],Tt=[],Lt=[],Mt=[],Rt=[],jt=[];(class extends se{static{s=this}constructor(){super(...arguments),this.key=(a(this,ne),a(this,le,"")),this.label=(a(this,re),a(this,oe,"")),this.type=(a(this,ce),a(this,de,"text")),this.align=(a(this,he),a(this,ue,"left")),this.width=(a(this,pe),a(this,me,"")),this.sortable=(a(this,ge),a(this,be,!0)),this.filterable=(a(this,ve),a(this,fe,!0)),this.wrap=(a(this,ye),a(this,we,!1)),this.ellipsis=(a(this,ke),a(this,xe,!0)),this.tooltip=(a(this,Se),a(this,Ce,!1)),this.decimals=(a(this,Ee),a(this,De,void 0)),this.thousandsSeparator=(a(this,ze),a(this,$e,void 0)),this.numberPrefix=(a(this,Ae),a(this,Fe,void 0)),this.numberSuffix=(a(this,Te),a(this,Le,void 0)),this.negativeStyle=(a(this,Me),a(this,Re,void 0)),this.dateFormat=(a(this,je),a(this,Oe,void 0)),this.customDateFormat=(a(this,Be),a(this,Ie,void 0)),this.dateLocale=(a(this,Pe),a(this,He,void 0)),this.trueValue=(a(this,Ve),a(this,Ne,void 0)),this.falseValue=(a(this,qe),a(this,_e,void 0)),this.useSymbols=(a(this,We),a(this,Ke,void 0)),this.trueSymbol=(a(this,Ye),a(this,Ue,void 0)),this.falseSymbol=(a(this,Ge),a(this,Je,void 0)),this.ratingMax=(a(this,Xe),a(this,Ze,void 0)),this.ratingSymbol=(a(this,Qe),a(this,et,void 0)),this.ratingEmptySymbol=(a(this,tt),a(this,it,void 0)),this.ratingColor=(a(this,at),a(this,st,void 0)),this.progressMax=(a(this,nt),a(this,lt,void 0)),this.showPercentage=(a(this,rt),a(this,ot,void 0)),this.progressColor=(a(this,ct),a(this,dt,void 0)),this.progressBgColor=(a(this,ht),a(this,ut,void 0)),this.progressHeight=(a(this,pt),a(this,mt,void 0)),this.sparklineType=(a(this,gt),a(this,bt,void 0)),this.sparklineColor=(a(this,vt),a(this,ft,void 0)),this.sparklineWidth=(a(this,yt),a(this,wt,void 0)),this.sparklineHeight=(a(this,kt),a(this,xt,void 0)),this.cellBgColor=(a(this,St),a(this,Ct,void 0)),this.cellColor=(a(this,Et),a(this,Dt,void 0)),this.cellFontWeight=(a(this,zt),a(this,$t,void 0)),this.cellFontStyle=(a(this,At),a(this,Ft,void 0)),this.cellFontSize=(a(this,Tt),a(this,Lt,void 0)),this.cellTextDecoration=(a(this,Mt),a(this,Rt,void 0)),this.formatter=a(this,jt),this.conditionalFormats=[]}static{const Ot="function"==typeof Symbol&&Symbol.metadata?Object.create(se[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({})],d=[t.property({type:Boolean})],h=[t.property({type:Boolean})],u=[t.property({type:Boolean})],p=[t.property({type:Boolean})],m=[t.property({type:Boolean})],g=[t.property({type:Number,attribute:"decimals"})],b=[t.property({type:Boolean,attribute:"thousands-separator"})],v=[t.property({attribute:"number-prefix"})],f=[t.property({attribute:"number-suffix"})],y=[t.property({attribute:"negative-style"})],w=[t.property({attribute:"date-format"})],k=[t.property({attribute:"custom-date-format"})],x=[t.property({attribute:"date-locale"})],S=[t.property({attribute:"true-value"})],C=[t.property({attribute:"false-value"})],E=[t.property({type:Boolean,attribute:"use-symbols"})],D=[t.property({attribute:"true-symbol"})],z=[t.property({attribute:"false-symbol"})],$=[t.property({type:Number,attribute:"rating-max"})],A=[t.property({attribute:"rating-symbol"})],F=[t.property({attribute:"rating-empty-symbol"})],T=[t.property({attribute:"rating-color"})],L=[t.property({type:Number,attribute:"progress-max"})],M=[t.property({type:Boolean,attribute:"show-percentage"})],R=[t.property({attribute:"progress-color"})],j=[t.property({attribute:"progress-bg-color"})],O=[t.property({attribute:"progress-height"})],B=[t.property({attribute:"sparkline-type"})],I=[t.property({attribute:"sparkline-color"})],P=[t.property({type:Number,attribute:"sparkline-width"})],H=[t.property({type:Number,attribute:"sparkline-height"})],V=[t.property({attribute:"cell-bg-color"})],N=[t.property({attribute:"cell-color"})],q=[t.property({attribute:"cell-font-weight"})],_=[t.property({attribute:"cell-font-style"})],W=[t.property({attribute:"cell-font-size"})],K=[t.property({attribute:"cell-text-decoration"})],Y=[t.render()],U=[t.watch("key","label","type","align","width","sortable","filterable","wrap","ellipsis","tooltip")],G=[t.watch("decimals","thousandsSeparator","numberPrefix","numberSuffix","negativeStyle")],J=[t.watch("dateFormat","customDateFormat","dateLocale")],X=[t.watch("trueValue","falseValue","useSymbols","trueSymbol","falseSymbol")],Z=[t.watch("ratingMax","ratingSymbol","ratingEmptySymbol","ratingColor")],Q=[t.watch("progressMax","showPercentage","progressColor","progressBgColor","progressHeight")],ee=[t.watch("sparklineType","sparklineColor","sparklineWidth","sparklineHeight")],te=[t.watch("cellBgColor","cellColor","cellFontWeight","cellFontStyle","cellFontSize","cellTextDecoration")],i(this,null,Y,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:Ot},null,ne),i(this,null,U,{kind:"method",name:"handleBasicPropsChange",static:!1,private:!1,access:{has:e=>"handleBasicPropsChange"in e,get:e=>e.handleBasicPropsChange},metadata:Ot},null,ne),i(this,null,G,{kind:"method",name:"handleNumberFormatChange",static:!1,private:!1,access:{has:e=>"handleNumberFormatChange"in e,get:e=>e.handleNumberFormatChange},metadata:Ot},null,ne),i(this,null,J,{kind:"method",name:"handleDateFormatChange",static:!1,private:!1,access:{has:e=>"handleDateFormatChange"in e,get:e=>e.handleDateFormatChange},metadata:Ot},null,ne),i(this,null,X,{kind:"method",name:"handleBooleanFormatChange",static:!1,private:!1,access:{has:e=>"handleBooleanFormatChange"in e,get:e=>e.handleBooleanFormatChange},metadata:Ot},null,ne),i(this,null,Z,{kind:"method",name:"handleRatingFormatChange",static:!1,private:!1,access:{has:e=>"handleRatingFormatChange"in e,get:e=>e.handleRatingFormatChange},metadata:Ot},null,ne),i(this,null,Q,{kind:"method",name:"handleProgressFormatChange",static:!1,private:!1,access:{has:e=>"handleProgressFormatChange"in e,get:e=>e.handleProgressFormatChange},metadata:Ot},null,ne),i(this,null,ee,{kind:"method",name:"handleSparklineFormatChange",static:!1,private:!1,access:{has:e=>"handleSparklineFormatChange"in e,get:e=>e.handleSparklineFormatChange},metadata:Ot},null,ne),i(this,null,te,{kind:"method",name:"handleStyleChange",static:!1,private:!1,access:{has:e=>"handleStyleChange"in e,get:e=>e.handleStyleChange},metadata:Ot},null,ne),i(null,null,n,{kind:"field",name:"key",static:!1,private:!1,access:{has:e=>"key"in e,get:e=>e.key,set:(e,t)=>{e.key=t}},metadata:Ot},le,re),i(null,null,l,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:Ot},oe,ce),i(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:Ot},de,he),i(null,null,o,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:Ot},ue,pe),i(null,null,c,{kind:"field",name:"width",static:!1,private:!1,access:{has:e=>"width"in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:Ot},me,ge),i(null,null,d,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:Ot},be,ve),i(null,null,h,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:e=>"filterable"in e,get:e=>e.filterable,set:(e,t)=>{e.filterable=t}},metadata:Ot},fe,ye),i(null,null,u,{kind:"field",name:"wrap",static:!1,private:!1,access:{has:e=>"wrap"in e,get:e=>e.wrap,set:(e,t)=>{e.wrap=t}},metadata:Ot},we,ke),i(null,null,p,{kind:"field",name:"ellipsis",static:!1,private:!1,access:{has:e=>"ellipsis"in e,get:e=>e.ellipsis,set:(e,t)=>{e.ellipsis=t}},metadata:Ot},xe,Se),i(null,null,m,{kind:"field",name:"tooltip",static:!1,private:!1,access:{has:e=>"tooltip"in e,get:e=>e.tooltip,set:(e,t)=>{e.tooltip=t}},metadata:Ot},Ce,Ee),i(null,null,g,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:Ot},De,ze),i(null,null,b,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:e=>"thousandsSeparator"in e,get:e=>e.thousandsSeparator,set:(e,t)=>{e.thousandsSeparator=t}},metadata:Ot},$e,Ae),i(null,null,v,{kind:"field",name:"numberPrefix",static:!1,private:!1,access:{has:e=>"numberPrefix"in e,get:e=>e.numberPrefix,set:(e,t)=>{e.numberPrefix=t}},metadata:Ot},Fe,Te),i(null,null,f,{kind:"field",name:"numberSuffix",static:!1,private:!1,access:{has:e=>"numberSuffix"in e,get:e=>e.numberSuffix,set:(e,t)=>{e.numberSuffix=t}},metadata:Ot},Le,Me),i(null,null,y,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:e=>"negativeStyle"in e,get:e=>e.negativeStyle,set:(e,t)=>{e.negativeStyle=t}},metadata:Ot},Re,je),i(null,null,w,{kind:"field",name:"dateFormat",static:!1,private:!1,access:{has:e=>"dateFormat"in e,get:e=>e.dateFormat,set:(e,t)=>{e.dateFormat=t}},metadata:Ot},Oe,Be),i(null,null,k,{kind:"field",name:"customDateFormat",static:!1,private:!1,access:{has:e=>"customDateFormat"in e,get:e=>e.customDateFormat,set:(e,t)=>{e.customDateFormat=t}},metadata:Ot},Ie,Pe),i(null,null,x,{kind:"field",name:"dateLocale",static:!1,private:!1,access:{has:e=>"dateLocale"in e,get:e=>e.dateLocale,set:(e,t)=>{e.dateLocale=t}},metadata:Ot},He,Ve),i(null,null,S,{kind:"field",name:"trueValue",static:!1,private:!1,access:{has:e=>"trueValue"in e,get:e=>e.trueValue,set:(e,t)=>{e.trueValue=t}},metadata:Ot},Ne,qe),i(null,null,C,{kind:"field",name:"falseValue",static:!1,private:!1,access:{has:e=>"falseValue"in e,get:e=>e.falseValue,set:(e,t)=>{e.falseValue=t}},metadata:Ot},_e,We),i(null,null,E,{kind:"field",name:"useSymbols",static:!1,private:!1,access:{has:e=>"useSymbols"in e,get:e=>e.useSymbols,set:(e,t)=>{e.useSymbols=t}},metadata:Ot},Ke,Ye),i(null,null,D,{kind:"field",name:"trueSymbol",static:!1,private:!1,access:{has:e=>"trueSymbol"in e,get:e=>e.trueSymbol,set:(e,t)=>{e.trueSymbol=t}},metadata:Ot},Ue,Ge),i(null,null,z,{kind:"field",name:"falseSymbol",static:!1,private:!1,access:{has:e=>"falseSymbol"in e,get:e=>e.falseSymbol,set:(e,t)=>{e.falseSymbol=t}},metadata:Ot},Je,Xe),i(null,null,$,{kind:"field",name:"ratingMax",static:!1,private:!1,access:{has:e=>"ratingMax"in e,get:e=>e.ratingMax,set:(e,t)=>{e.ratingMax=t}},metadata:Ot},Ze,Qe),i(null,null,A,{kind:"field",name:"ratingSymbol",static:!1,private:!1,access:{has:e=>"ratingSymbol"in e,get:e=>e.ratingSymbol,set:(e,t)=>{e.ratingSymbol=t}},metadata:Ot},et,tt),i(null,null,F,{kind:"field",name:"ratingEmptySymbol",static:!1,private:!1,access:{has:e=>"ratingEmptySymbol"in e,get:e=>e.ratingEmptySymbol,set:(e,t)=>{e.ratingEmptySymbol=t}},metadata:Ot},it,at),i(null,null,T,{kind:"field",name:"ratingColor",static:!1,private:!1,access:{has:e=>"ratingColor"in e,get:e=>e.ratingColor,set:(e,t)=>{e.ratingColor=t}},metadata:Ot},st,nt),i(null,null,L,{kind:"field",name:"progressMax",static:!1,private:!1,access:{has:e=>"progressMax"in e,get:e=>e.progressMax,set:(e,t)=>{e.progressMax=t}},metadata:Ot},lt,rt),i(null,null,M,{kind:"field",name:"showPercentage",static:!1,private:!1,access:{has:e=>"showPercentage"in e,get:e=>e.showPercentage,set:(e,t)=>{e.showPercentage=t}},metadata:Ot},ot,ct),i(null,null,R,{kind:"field",name:"progressColor",static:!1,private:!1,access:{has:e=>"progressColor"in e,get:e=>e.progressColor,set:(e,t)=>{e.progressColor=t}},metadata:Ot},dt,ht),i(null,null,j,{kind:"field",name:"progressBgColor",static:!1,private:!1,access:{has:e=>"progressBgColor"in e,get:e=>e.progressBgColor,set:(e,t)=>{e.progressBgColor=t}},metadata:Ot},ut,pt),i(null,null,O,{kind:"field",name:"progressHeight",static:!1,private:!1,access:{has:e=>"progressHeight"in e,get:e=>e.progressHeight,set:(e,t)=>{e.progressHeight=t}},metadata:Ot},mt,gt),i(null,null,B,{kind:"field",name:"sparklineType",static:!1,private:!1,access:{has:e=>"sparklineType"in e,get:e=>e.sparklineType,set:(e,t)=>{e.sparklineType=t}},metadata:Ot},bt,vt),i(null,null,I,{kind:"field",name:"sparklineColor",static:!1,private:!1,access:{has:e=>"sparklineColor"in e,get:e=>e.sparklineColor,set:(e,t)=>{e.sparklineColor=t}},metadata:Ot},ft,yt),i(null,null,P,{kind:"field",name:"sparklineWidth",static:!1,private:!1,access:{has:e=>"sparklineWidth"in e,get:e=>e.sparklineWidth,set:(e,t)=>{e.sparklineWidth=t}},metadata:Ot},wt,kt),i(null,null,H,{kind:"field",name:"sparklineHeight",static:!1,private:!1,access:{has:e=>"sparklineHeight"in e,get:e=>e.sparklineHeight,set:(e,t)=>{e.sparklineHeight=t}},metadata:Ot},xt,St),i(null,null,V,{kind:"field",name:"cellBgColor",static:!1,private:!1,access:{has:e=>"cellBgColor"in e,get:e=>e.cellBgColor,set:(e,t)=>{e.cellBgColor=t}},metadata:Ot},Ct,Et),i(null,null,N,{kind:"field",name:"cellColor",static:!1,private:!1,access:{has:e=>"cellColor"in e,get:e=>e.cellColor,set:(e,t)=>{e.cellColor=t}},metadata:Ot},Dt,zt),i(null,null,q,{kind:"field",name:"cellFontWeight",static:!1,private:!1,access:{has:e=>"cellFontWeight"in e,get:e=>e.cellFontWeight,set:(e,t)=>{e.cellFontWeight=t}},metadata:Ot},$t,At),i(null,null,_,{kind:"field",name:"cellFontStyle",static:!1,private:!1,access:{has:e=>"cellFontStyle"in e,get:e=>e.cellFontStyle,set:(e,t)=>{e.cellFontStyle=t}},metadata:Ot},Ft,Tt),i(null,null,W,{kind:"field",name:"cellFontSize",static:!1,private:!1,access:{has:e=>"cellFontSize"in e,get:e=>e.cellFontSize,set:(e,t)=>{e.cellFontSize=t}},metadata:Ot},Lt,Mt),i(null,null,K,{kind:"field",name:"cellTextDecoration",static:!1,private:!1,access:{has:e=>"cellTextDecoration"in e,get:e=>e.cellTextDecoration,set:(e,t)=>{e.cellTextDecoration=t}},metadata:Ot},Rt,jt),i(null,e={value:s},ie,{kind:"class",name:s.name,metadata:Ot},null,ae),s=e.value,Ot&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Ot}),a(s,ae)}render(){return t.html`<slot></slot>`}setFormatter(e){this.formatter=e,this.notifyTableOfChange()}addConditionalFormat(e){this.conditionalFormats.push(e),this.notifyTableOfChange()}removeConditionalFormat(e){this.conditionalFormats.splice(e,1),this.notifyTableOfChange()}clearConditionalFormats(){this.conditionalFormats=[],this.notifyTableOfChange()}getColumnDefinition(){const e={key:this.key,label:this.label,type:this.type,align:this.align,width:this.width,sortable:this.sortable,filterable:this.filterable,wrap:this.wrap,ellipsis:this.ellipsis,tooltip:this.tooltip,formatter:this.formatter,conditionalFormats:this.conditionalFormats};if("number"===this.type||"currency"===this.type||"percent"===this.type||"accounting"===this.type||"scientific"===this.type||"fraction"===this.type){const t={};void 0!==this.decimals&&(t.decimals=this.decimals),void 0!==this.thousandsSeparator&&(t.thousandsSeparator=this.thousandsSeparator),this.numberPrefix&&(t.prefix=this.numberPrefix),this.numberSuffix&&(t.suffix=this.numberSuffix),this.negativeStyle&&(t.negativeStyle=this.negativeStyle),Object.keys(t).length>0&&(e.numberFormat=t)}if("date"===this.type){const t={};this.dateFormat&&(t.format=this.dateFormat),this.customDateFormat&&(t.customFormat=this.customDateFormat),this.dateLocale&&(t.locale=this.dateLocale),Object.keys(t).length>0&&(e.dateFormat=t)}if("boolean"===this.type){const t={};this.trueValue&&(t.trueValue=this.trueValue),this.falseValue&&(t.falseValue=this.falseValue),void 0!==this.useSymbols&&(t.useSymbols=this.useSymbols),this.trueSymbol&&(t.trueSymbol=this.trueSymbol),this.falseSymbol&&(t.falseSymbol=this.falseSymbol),Object.keys(t).length>0&&(e.booleanFormat=t)}if("rating"===this.type){const t={};void 0!==this.ratingMax&&(t.max=this.ratingMax),this.ratingSymbol&&(t.symbol=this.ratingSymbol),this.ratingEmptySymbol&&(t.emptySymbol=this.ratingEmptySymbol),this.ratingColor&&(t.color=this.ratingColor),Object.keys(t).length>0&&(e.ratingFormat=t)}if("progress"===this.type){const t={};void 0!==this.progressMax&&(t.max=this.progressMax),void 0!==this.showPercentage&&(t.showPercentage=this.showPercentage),this.progressColor&&(t.color=this.progressColor),this.progressBgColor&&(t.backgroundColor=this.progressBgColor),this.progressHeight&&(t.height=this.progressHeight),Object.keys(t).length>0&&(e.progressFormat=t)}if("sparkline"===this.type){const t={};this.sparklineType&&(t.type=this.sparklineType),this.sparklineColor&&(t.color=this.sparklineColor),void 0!==this.sparklineWidth&&(t.width=this.sparklineWidth),void 0!==this.sparklineHeight&&(t.height=this.sparklineHeight),Object.keys(t).length>0&&(e.sparklineFormat=t)}const t={};return this.cellBgColor&&(t.backgroundColor=this.cellBgColor),this.cellColor&&(t.color=this.cellColor),this.cellFontWeight&&(t.fontWeight=this.cellFontWeight),this.cellFontStyle&&(t.fontStyle=this.cellFontStyle),this.cellFontSize&&(t.fontSize=this.cellFontSize),this.cellTextDecoration&&(t.textDecoration=this.cellTextDecoration),Object.keys(t).length>0&&(e.style=t),e}handleBasicPropsChange(){this.notifyTableOfChange()}handleNumberFormatChange(){"number"!==this.type&&"currency"!==this.type&&"percent"!==this.type&&"accounting"!==this.type&&"scientific"!==this.type&&"fraction"!==this.type||this.notifyTableOfChange()}handleDateFormatChange(){"date"===this.type&&this.notifyTableOfChange()}handleBooleanFormatChange(){"boolean"===this.type&&this.notifyTableOfChange()}handleRatingFormatChange(){"rating"===this.type&&this.notifyTableOfChange()}handleProgressFormatChange(){"progress"===this.type&&this.notifyTableOfChange()}handleSparklineFormatChange(){"sparkline"===this.type&&this.notifyTableOfChange()}handleStyleChange(){this.notifyTableOfChange()}notifyTableOfChange(){this.dispatchEvent(new CustomEvent("column-changed",{detail:{column:this.getColumnDefinition()},bubbles:!0,composed:!0}))}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k=[t.element("snice-row")],x=[],S=HTMLElement,C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[];(class extends S{static{s=this}static{const P="function"==typeof Symbol&&Symbol.metadata?Object.create(S[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean})],l=[t.property({type:Boolean})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:Number})],h=[t.property({type:Array,attribute:!1})],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("selected")],b=[t.watch("hoverable","clickable","selectable")],v=[t.watch("data","columns")],f=[t.dispatch("row-click",{bubbles:!0,composed:!0})],y=[t.dispatch("row-select",{bubbles:!0,composed:!0})],w=[t.dispatch("row-hover",{bubbles:!0,composed:!0})],i(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:P},null,C),i(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:P},null,C),i(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:P},null,C),i(this,null,g,{kind:"method",name:"updateSelection",static:!1,private:!1,access:{has:e=>"updateSelection"in e,get:e=>e.updateSelection},metadata:P},null,C),i(this,null,b,{kind:"method",name:"updateRowAttributes",static:!1,private:!1,access:{has:e=>"updateRowAttributes"in e,get:e=>e.updateRowAttributes},metadata:P},null,C),i(this,null,v,{kind:"method",name:"updateCells",static:!1,private:!1,access:{has:e=>"updateCells"in e,get:e=>e.updateCells},metadata:P},null,C),i(this,null,f,{kind:"method",name:"dispatchRowClick",static:!1,private:!1,access:{has:e=>"dispatchRowClick"in e,get:e=>e.dispatchRowClick},metadata:P},null,C),i(this,null,y,{kind:"method",name:"dispatchRowSelect",static:!1,private:!1,access:{has:e=>"dispatchRowSelect"in e,get:e=>e.dispatchRowSelect},metadata:P},null,C),i(this,null,w,{kind:"method",name:"dispatchRowHover",static:!1,private:!1,access:{has:e=>"dispatchRowHover"in e,get:e=>e.dispatchRowHover},metadata:P},null,C),i(null,null,n,{kind:"field",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected,set:(e,t)=>{e.selected=t}},metadata:P},E,D),i(null,null,l,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:e=>"hoverable"in e,get:e=>e.hoverable,set:(e,t)=>{e.hoverable=t}},metadata:P},z,$),i(null,null,r,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:e=>"clickable"in e,get:e=>e.clickable,set:(e,t)=>{e.clickable=t}},metadata:P},A,F),i(null,null,o,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:P},T,L),i(null,null,c,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:P},M,R),i(null,null,d,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:P},j,O),i(null,null,h,{kind:"field",name:"columns",static:!1,private:!1,access:{has:e=>"columns"in e,get:e=>e.columns,set:(e,t)=>{e.columns=t}},metadata:P},B,I),i(null,e={value:s},k,{kind:"class",name:s.name,metadata:P},null,x),s=e.value,P&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:P}),a(s,x)}extractDataFromAttributes(){const e={};return this.getAttributeNames().filter(e=>e.startsWith("data-")&&"data-column-index"!==e).forEach(t=>{const i=t.slice(5),a=this.getAttribute(t);null!==a&&(e[i]=a)}),e}render(){return t.html`
|
|
551
|
+
`}styles(){return t.css`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center}.cell-image{display:block;object-fit:cover;background-color:rgb(243 244 246)}.image--small{width:1.5rem;height:1.5rem}.image--medium{width:2rem;height:2rem}.image--large{width:3rem;height:3rem}.image--rounded{border-radius:.25rem}.image--square{border-radius:0}.image--circle{border-radius:50%}.cell-image--placeholder{background:linear-gradient(135deg,rgb(229 231 235) 0,rgb(209 213 219) 100%);border:1px solid rgb(209 213 219);position:relative}.cell-image__placeholder-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:inline-flex;align-items:center;justify-content:center;color:var(--snice-color-text-tertiary,rgb(115 115 115));opacity:.55}.cell-image__placeholder-icon svg{width:50%;max-width:1.25rem;height:auto}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}:host(.loading) .cell-image{opacity:.6;animation:1.5s ease-in-out infinite image-pulse}@keyframes image-pulse{0%,100%{opacity:.6}50%{opacity:.3}}@media (max-width:768px){.image--small{width:1.25rem;height:1.25rem}.image--medium{width:1.75rem;height:1.75rem}.image--large{width:2.5rem;height:2.5rem}}@media (prefers-reduced-motion:reduce){:host(.loading) .cell-image{animation:none}}@media print{.cell-image{max-width:2rem;max-height:2rem}}"}`}init(){this.updateImageAttributes()}updateImageAttributes(){if(this.column?.imageFormat){const e=this.column.imageFormat;this.src=e.src||this.value,this.alt=e.alt||"",this.fallback=e.fallback||"",this.variant=e.variant||"rounded",this.size=e.size||"medium",this.lazy=e.lazy??!0}}handleImageError(){this.imageError=!0}constructor(){super(...arguments),this.value=(a(this,C),a(this,E,"")),this.src=(a(this,D),a(this,z,"")),this.alt=(a(this,$),a(this,A,"")),this.fallback=(a(this,F),a(this,T,"")),this.variant=(a(this,L),a(this,M,"rounded")),this.size=(a(this,R),a(this,j,"medium")),this.lazy=(a(this,O),a(this,B,!0)),this.column=(a(this,I),a(this,P,null)),this.rowData=(a(this,H),a(this,V,null)),this.align=(a(this,N),a(this,_,"center")),this.type=(a(this,q),a(this,W,"image")),this.imageError=(a(this,K),a(this,Y,!1)),a(this,U)}})})(),(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k,x,S,C,E,D,z,$,A,F,T,L,M,R,j,O,B,I,P,H,V,N,_,q,W,K,Y,U,G,J,X,Z,Q,ee,te,ie=[t.element("snice-column")],ae=[],se=HTMLElement,ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],pe=[],me=[],ge=[],be=[],ve=[],fe=[],ye=[],we=[],ke=[],xe=[],Se=[],Ce=[],Ee=[],De=[],ze=[],$e=[],Ae=[],Fe=[],Te=[],Le=[],Me=[],Re=[],je=[],Oe=[],Be=[],Ie=[],Pe=[],He=[],Ve=[],Ne=[],_e=[],qe=[],We=[],Ke=[],Ye=[],Ue=[],Ge=[],Je=[],Xe=[],Ze=[],Qe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],pt=[],mt=[],gt=[],bt=[],vt=[],ft=[],yt=[],wt=[],kt=[],xt=[],St=[],Ct=[],Et=[],Dt=[],zt=[],$t=[],At=[],Ft=[],Tt=[],Lt=[],Mt=[],Rt=[],jt=[];(class extends se{static{s=this}constructor(){super(...arguments),this.key=(a(this,ne),a(this,le,"")),this.label=(a(this,re),a(this,oe,"")),this.type=(a(this,ce),a(this,de,"text")),this.align=(a(this,he),a(this,ue,"left")),this.width=(a(this,pe),a(this,me,"")),this.sortable=(a(this,ge),a(this,be,!0)),this.filterable=(a(this,ve),a(this,fe,!0)),this.wrap=(a(this,ye),a(this,we,!1)),this.ellipsis=(a(this,ke),a(this,xe,!0)),this.tooltip=(a(this,Se),a(this,Ce,!1)),this.decimals=(a(this,Ee),a(this,De,void 0)),this.thousandsSeparator=(a(this,ze),a(this,$e,void 0)),this.numberPrefix=(a(this,Ae),a(this,Fe,void 0)),this.numberSuffix=(a(this,Te),a(this,Le,void 0)),this.negativeStyle=(a(this,Me),a(this,Re,void 0)),this.dateFormat=(a(this,je),a(this,Oe,void 0)),this.customDateFormat=(a(this,Be),a(this,Ie,void 0)),this.dateLocale=(a(this,Pe),a(this,He,void 0)),this.trueValue=(a(this,Ve),a(this,Ne,void 0)),this.falseValue=(a(this,_e),a(this,qe,void 0)),this.useSymbols=(a(this,We),a(this,Ke,void 0)),this.trueSymbol=(a(this,Ye),a(this,Ue,void 0)),this.falseSymbol=(a(this,Ge),a(this,Je,void 0)),this.ratingMax=(a(this,Xe),a(this,Ze,void 0)),this.ratingSymbol=(a(this,Qe),a(this,et,void 0)),this.ratingEmptySymbol=(a(this,tt),a(this,it,void 0)),this.ratingColor=(a(this,at),a(this,st,void 0)),this.progressMax=(a(this,nt),a(this,lt,void 0)),this.showPercentage=(a(this,rt),a(this,ot,void 0)),this.progressColor=(a(this,ct),a(this,dt,void 0)),this.progressBgColor=(a(this,ht),a(this,ut,void 0)),this.progressHeight=(a(this,pt),a(this,mt,void 0)),this.sparklineType=(a(this,gt),a(this,bt,void 0)),this.sparklineColor=(a(this,vt),a(this,ft,void 0)),this.sparklineWidth=(a(this,yt),a(this,wt,void 0)),this.sparklineHeight=(a(this,kt),a(this,xt,void 0)),this.cellBgColor=(a(this,St),a(this,Ct,void 0)),this.cellColor=(a(this,Et),a(this,Dt,void 0)),this.cellFontWeight=(a(this,zt),a(this,$t,void 0)),this.cellFontStyle=(a(this,At),a(this,Ft,void 0)),this.cellFontSize=(a(this,Tt),a(this,Lt,void 0)),this.cellTextDecoration=(a(this,Mt),a(this,Rt,void 0)),this.formatter=a(this,jt),this.conditionalFormats=[]}static{const Ot="function"==typeof Symbol&&Symbol.metadata?Object.create(se[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({})],d=[t.property({type:Boolean})],h=[t.property({type:Boolean})],u=[t.property({type:Boolean})],p=[t.property({type:Boolean})],m=[t.property({type:Boolean})],g=[t.property({type:Number,attribute:"decimals"})],b=[t.property({type:Boolean,attribute:"thousands-separator"})],v=[t.property({attribute:"number-prefix"})],f=[t.property({attribute:"number-suffix"})],y=[t.property({attribute:"negative-style"})],w=[t.property({attribute:"date-format"})],k=[t.property({attribute:"custom-date-format"})],x=[t.property({attribute:"date-locale"})],S=[t.property({attribute:"true-value"})],C=[t.property({attribute:"false-value"})],E=[t.property({type:Boolean,attribute:"use-symbols"})],D=[t.property({attribute:"true-symbol"})],z=[t.property({attribute:"false-symbol"})],$=[t.property({type:Number,attribute:"rating-max"})],A=[t.property({attribute:"rating-symbol"})],F=[t.property({attribute:"rating-empty-symbol"})],T=[t.property({attribute:"rating-color"})],L=[t.property({type:Number,attribute:"progress-max"})],M=[t.property({type:Boolean,attribute:"show-percentage"})],R=[t.property({attribute:"progress-color"})],j=[t.property({attribute:"progress-bg-color"})],O=[t.property({attribute:"progress-height"})],B=[t.property({attribute:"sparkline-type"})],I=[t.property({attribute:"sparkline-color"})],P=[t.property({type:Number,attribute:"sparkline-width"})],H=[t.property({type:Number,attribute:"sparkline-height"})],V=[t.property({attribute:"cell-bg-color"})],N=[t.property({attribute:"cell-color"})],_=[t.property({attribute:"cell-font-weight"})],q=[t.property({attribute:"cell-font-style"})],W=[t.property({attribute:"cell-font-size"})],K=[t.property({attribute:"cell-text-decoration"})],Y=[t.render()],U=[t.watch("key","label","type","align","width","sortable","filterable","wrap","ellipsis","tooltip")],G=[t.watch("decimals","thousandsSeparator","numberPrefix","numberSuffix","negativeStyle")],J=[t.watch("dateFormat","customDateFormat","dateLocale")],X=[t.watch("trueValue","falseValue","useSymbols","trueSymbol","falseSymbol")],Z=[t.watch("ratingMax","ratingSymbol","ratingEmptySymbol","ratingColor")],Q=[t.watch("progressMax","showPercentage","progressColor","progressBgColor","progressHeight")],ee=[t.watch("sparklineType","sparklineColor","sparklineWidth","sparklineHeight")],te=[t.watch("cellBgColor","cellColor","cellFontWeight","cellFontStyle","cellFontSize","cellTextDecoration")],i(this,null,Y,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:Ot},null,ne),i(this,null,U,{kind:"method",name:"handleBasicPropsChange",static:!1,private:!1,access:{has:e=>"handleBasicPropsChange"in e,get:e=>e.handleBasicPropsChange},metadata:Ot},null,ne),i(this,null,G,{kind:"method",name:"handleNumberFormatChange",static:!1,private:!1,access:{has:e=>"handleNumberFormatChange"in e,get:e=>e.handleNumberFormatChange},metadata:Ot},null,ne),i(this,null,J,{kind:"method",name:"handleDateFormatChange",static:!1,private:!1,access:{has:e=>"handleDateFormatChange"in e,get:e=>e.handleDateFormatChange},metadata:Ot},null,ne),i(this,null,X,{kind:"method",name:"handleBooleanFormatChange",static:!1,private:!1,access:{has:e=>"handleBooleanFormatChange"in e,get:e=>e.handleBooleanFormatChange},metadata:Ot},null,ne),i(this,null,Z,{kind:"method",name:"handleRatingFormatChange",static:!1,private:!1,access:{has:e=>"handleRatingFormatChange"in e,get:e=>e.handleRatingFormatChange},metadata:Ot},null,ne),i(this,null,Q,{kind:"method",name:"handleProgressFormatChange",static:!1,private:!1,access:{has:e=>"handleProgressFormatChange"in e,get:e=>e.handleProgressFormatChange},metadata:Ot},null,ne),i(this,null,ee,{kind:"method",name:"handleSparklineFormatChange",static:!1,private:!1,access:{has:e=>"handleSparklineFormatChange"in e,get:e=>e.handleSparklineFormatChange},metadata:Ot},null,ne),i(this,null,te,{kind:"method",name:"handleStyleChange",static:!1,private:!1,access:{has:e=>"handleStyleChange"in e,get:e=>e.handleStyleChange},metadata:Ot},null,ne),i(null,null,n,{kind:"field",name:"key",static:!1,private:!1,access:{has:e=>"key"in e,get:e=>e.key,set:(e,t)=>{e.key=t}},metadata:Ot},le,re),i(null,null,l,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:Ot},oe,ce),i(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:Ot},de,he),i(null,null,o,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:Ot},ue,pe),i(null,null,c,{kind:"field",name:"width",static:!1,private:!1,access:{has:e=>"width"in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:Ot},me,ge),i(null,null,d,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:Ot},be,ve),i(null,null,h,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:e=>"filterable"in e,get:e=>e.filterable,set:(e,t)=>{e.filterable=t}},metadata:Ot},fe,ye),i(null,null,u,{kind:"field",name:"wrap",static:!1,private:!1,access:{has:e=>"wrap"in e,get:e=>e.wrap,set:(e,t)=>{e.wrap=t}},metadata:Ot},we,ke),i(null,null,p,{kind:"field",name:"ellipsis",static:!1,private:!1,access:{has:e=>"ellipsis"in e,get:e=>e.ellipsis,set:(e,t)=>{e.ellipsis=t}},metadata:Ot},xe,Se),i(null,null,m,{kind:"field",name:"tooltip",static:!1,private:!1,access:{has:e=>"tooltip"in e,get:e=>e.tooltip,set:(e,t)=>{e.tooltip=t}},metadata:Ot},Ce,Ee),i(null,null,g,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:Ot},De,ze),i(null,null,b,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:e=>"thousandsSeparator"in e,get:e=>e.thousandsSeparator,set:(e,t)=>{e.thousandsSeparator=t}},metadata:Ot},$e,Ae),i(null,null,v,{kind:"field",name:"numberPrefix",static:!1,private:!1,access:{has:e=>"numberPrefix"in e,get:e=>e.numberPrefix,set:(e,t)=>{e.numberPrefix=t}},metadata:Ot},Fe,Te),i(null,null,f,{kind:"field",name:"numberSuffix",static:!1,private:!1,access:{has:e=>"numberSuffix"in e,get:e=>e.numberSuffix,set:(e,t)=>{e.numberSuffix=t}},metadata:Ot},Le,Me),i(null,null,y,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:e=>"negativeStyle"in e,get:e=>e.negativeStyle,set:(e,t)=>{e.negativeStyle=t}},metadata:Ot},Re,je),i(null,null,w,{kind:"field",name:"dateFormat",static:!1,private:!1,access:{has:e=>"dateFormat"in e,get:e=>e.dateFormat,set:(e,t)=>{e.dateFormat=t}},metadata:Ot},Oe,Be),i(null,null,k,{kind:"field",name:"customDateFormat",static:!1,private:!1,access:{has:e=>"customDateFormat"in e,get:e=>e.customDateFormat,set:(e,t)=>{e.customDateFormat=t}},metadata:Ot},Ie,Pe),i(null,null,x,{kind:"field",name:"dateLocale",static:!1,private:!1,access:{has:e=>"dateLocale"in e,get:e=>e.dateLocale,set:(e,t)=>{e.dateLocale=t}},metadata:Ot},He,Ve),i(null,null,S,{kind:"field",name:"trueValue",static:!1,private:!1,access:{has:e=>"trueValue"in e,get:e=>e.trueValue,set:(e,t)=>{e.trueValue=t}},metadata:Ot},Ne,_e),i(null,null,C,{kind:"field",name:"falseValue",static:!1,private:!1,access:{has:e=>"falseValue"in e,get:e=>e.falseValue,set:(e,t)=>{e.falseValue=t}},metadata:Ot},qe,We),i(null,null,E,{kind:"field",name:"useSymbols",static:!1,private:!1,access:{has:e=>"useSymbols"in e,get:e=>e.useSymbols,set:(e,t)=>{e.useSymbols=t}},metadata:Ot},Ke,Ye),i(null,null,D,{kind:"field",name:"trueSymbol",static:!1,private:!1,access:{has:e=>"trueSymbol"in e,get:e=>e.trueSymbol,set:(e,t)=>{e.trueSymbol=t}},metadata:Ot},Ue,Ge),i(null,null,z,{kind:"field",name:"falseSymbol",static:!1,private:!1,access:{has:e=>"falseSymbol"in e,get:e=>e.falseSymbol,set:(e,t)=>{e.falseSymbol=t}},metadata:Ot},Je,Xe),i(null,null,$,{kind:"field",name:"ratingMax",static:!1,private:!1,access:{has:e=>"ratingMax"in e,get:e=>e.ratingMax,set:(e,t)=>{e.ratingMax=t}},metadata:Ot},Ze,Qe),i(null,null,A,{kind:"field",name:"ratingSymbol",static:!1,private:!1,access:{has:e=>"ratingSymbol"in e,get:e=>e.ratingSymbol,set:(e,t)=>{e.ratingSymbol=t}},metadata:Ot},et,tt),i(null,null,F,{kind:"field",name:"ratingEmptySymbol",static:!1,private:!1,access:{has:e=>"ratingEmptySymbol"in e,get:e=>e.ratingEmptySymbol,set:(e,t)=>{e.ratingEmptySymbol=t}},metadata:Ot},it,at),i(null,null,T,{kind:"field",name:"ratingColor",static:!1,private:!1,access:{has:e=>"ratingColor"in e,get:e=>e.ratingColor,set:(e,t)=>{e.ratingColor=t}},metadata:Ot},st,nt),i(null,null,L,{kind:"field",name:"progressMax",static:!1,private:!1,access:{has:e=>"progressMax"in e,get:e=>e.progressMax,set:(e,t)=>{e.progressMax=t}},metadata:Ot},lt,rt),i(null,null,M,{kind:"field",name:"showPercentage",static:!1,private:!1,access:{has:e=>"showPercentage"in e,get:e=>e.showPercentage,set:(e,t)=>{e.showPercentage=t}},metadata:Ot},ot,ct),i(null,null,R,{kind:"field",name:"progressColor",static:!1,private:!1,access:{has:e=>"progressColor"in e,get:e=>e.progressColor,set:(e,t)=>{e.progressColor=t}},metadata:Ot},dt,ht),i(null,null,j,{kind:"field",name:"progressBgColor",static:!1,private:!1,access:{has:e=>"progressBgColor"in e,get:e=>e.progressBgColor,set:(e,t)=>{e.progressBgColor=t}},metadata:Ot},ut,pt),i(null,null,O,{kind:"field",name:"progressHeight",static:!1,private:!1,access:{has:e=>"progressHeight"in e,get:e=>e.progressHeight,set:(e,t)=>{e.progressHeight=t}},metadata:Ot},mt,gt),i(null,null,B,{kind:"field",name:"sparklineType",static:!1,private:!1,access:{has:e=>"sparklineType"in e,get:e=>e.sparklineType,set:(e,t)=>{e.sparklineType=t}},metadata:Ot},bt,vt),i(null,null,I,{kind:"field",name:"sparklineColor",static:!1,private:!1,access:{has:e=>"sparklineColor"in e,get:e=>e.sparklineColor,set:(e,t)=>{e.sparklineColor=t}},metadata:Ot},ft,yt),i(null,null,P,{kind:"field",name:"sparklineWidth",static:!1,private:!1,access:{has:e=>"sparklineWidth"in e,get:e=>e.sparklineWidth,set:(e,t)=>{e.sparklineWidth=t}},metadata:Ot},wt,kt),i(null,null,H,{kind:"field",name:"sparklineHeight",static:!1,private:!1,access:{has:e=>"sparklineHeight"in e,get:e=>e.sparklineHeight,set:(e,t)=>{e.sparklineHeight=t}},metadata:Ot},xt,St),i(null,null,V,{kind:"field",name:"cellBgColor",static:!1,private:!1,access:{has:e=>"cellBgColor"in e,get:e=>e.cellBgColor,set:(e,t)=>{e.cellBgColor=t}},metadata:Ot},Ct,Et),i(null,null,N,{kind:"field",name:"cellColor",static:!1,private:!1,access:{has:e=>"cellColor"in e,get:e=>e.cellColor,set:(e,t)=>{e.cellColor=t}},metadata:Ot},Dt,zt),i(null,null,_,{kind:"field",name:"cellFontWeight",static:!1,private:!1,access:{has:e=>"cellFontWeight"in e,get:e=>e.cellFontWeight,set:(e,t)=>{e.cellFontWeight=t}},metadata:Ot},$t,At),i(null,null,q,{kind:"field",name:"cellFontStyle",static:!1,private:!1,access:{has:e=>"cellFontStyle"in e,get:e=>e.cellFontStyle,set:(e,t)=>{e.cellFontStyle=t}},metadata:Ot},Ft,Tt),i(null,null,W,{kind:"field",name:"cellFontSize",static:!1,private:!1,access:{has:e=>"cellFontSize"in e,get:e=>e.cellFontSize,set:(e,t)=>{e.cellFontSize=t}},metadata:Ot},Lt,Mt),i(null,null,K,{kind:"field",name:"cellTextDecoration",static:!1,private:!1,access:{has:e=>"cellTextDecoration"in e,get:e=>e.cellTextDecoration,set:(e,t)=>{e.cellTextDecoration=t}},metadata:Ot},Rt,jt),i(null,e={value:s},ie,{kind:"class",name:s.name,metadata:Ot},null,ae),s=e.value,Ot&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Ot}),a(s,ae)}render(){return t.html`<slot></slot>`}setFormatter(e){this.formatter=e,this.notifyTableOfChange()}addConditionalFormat(e){this.conditionalFormats.push(e),this.notifyTableOfChange()}removeConditionalFormat(e){this.conditionalFormats.splice(e,1),this.notifyTableOfChange()}clearConditionalFormats(){this.conditionalFormats=[],this.notifyTableOfChange()}getColumnDefinition(){const e={key:this.key,label:this.label,type:this.type,align:this.align,width:this.width,sortable:this.sortable,filterable:this.filterable,wrap:this.wrap,ellipsis:this.ellipsis,tooltip:this.tooltip,formatter:this.formatter,conditionalFormats:this.conditionalFormats};if("number"===this.type||"currency"===this.type||"percent"===this.type||"accounting"===this.type||"scientific"===this.type||"fraction"===this.type){const t={};void 0!==this.decimals&&(t.decimals=this.decimals),void 0!==this.thousandsSeparator&&(t.thousandsSeparator=this.thousandsSeparator),this.numberPrefix&&(t.prefix=this.numberPrefix),this.numberSuffix&&(t.suffix=this.numberSuffix),this.negativeStyle&&(t.negativeStyle=this.negativeStyle),Object.keys(t).length>0&&(e.numberFormat=t)}if("date"===this.type){const t={};this.dateFormat&&(t.format=this.dateFormat),this.customDateFormat&&(t.customFormat=this.customDateFormat),this.dateLocale&&(t.locale=this.dateLocale),Object.keys(t).length>0&&(e.dateFormat=t)}if("boolean"===this.type){const t={};this.trueValue&&(t.trueValue=this.trueValue),this.falseValue&&(t.falseValue=this.falseValue),void 0!==this.useSymbols&&(t.useSymbols=this.useSymbols),this.trueSymbol&&(t.trueSymbol=this.trueSymbol),this.falseSymbol&&(t.falseSymbol=this.falseSymbol),Object.keys(t).length>0&&(e.booleanFormat=t)}if("rating"===this.type){const t={};void 0!==this.ratingMax&&(t.max=this.ratingMax),this.ratingSymbol&&(t.symbol=this.ratingSymbol),this.ratingEmptySymbol&&(t.emptySymbol=this.ratingEmptySymbol),this.ratingColor&&(t.color=this.ratingColor),Object.keys(t).length>0&&(e.ratingFormat=t)}if("progress"===this.type){const t={};void 0!==this.progressMax&&(t.max=this.progressMax),void 0!==this.showPercentage&&(t.showPercentage=this.showPercentage),this.progressColor&&(t.color=this.progressColor),this.progressBgColor&&(t.backgroundColor=this.progressBgColor),this.progressHeight&&(t.height=this.progressHeight),Object.keys(t).length>0&&(e.progressFormat=t)}if("sparkline"===this.type){const t={};this.sparklineType&&(t.type=this.sparklineType),this.sparklineColor&&(t.color=this.sparklineColor),void 0!==this.sparklineWidth&&(t.width=this.sparklineWidth),void 0!==this.sparklineHeight&&(t.height=this.sparklineHeight),Object.keys(t).length>0&&(e.sparklineFormat=t)}const t={};return this.cellBgColor&&(t.backgroundColor=this.cellBgColor),this.cellColor&&(t.color=this.cellColor),this.cellFontWeight&&(t.fontWeight=this.cellFontWeight),this.cellFontStyle&&(t.fontStyle=this.cellFontStyle),this.cellFontSize&&(t.fontSize=this.cellFontSize),this.cellTextDecoration&&(t.textDecoration=this.cellTextDecoration),Object.keys(t).length>0&&(e.style=t),e}handleBasicPropsChange(){this.notifyTableOfChange()}handleNumberFormatChange(){"number"!==this.type&&"currency"!==this.type&&"percent"!==this.type&&"accounting"!==this.type&&"scientific"!==this.type&&"fraction"!==this.type||this.notifyTableOfChange()}handleDateFormatChange(){"date"===this.type&&this.notifyTableOfChange()}handleBooleanFormatChange(){"boolean"===this.type&&this.notifyTableOfChange()}handleRatingFormatChange(){"rating"===this.type&&this.notifyTableOfChange()}handleProgressFormatChange(){"progress"===this.type&&this.notifyTableOfChange()}handleSparklineFormatChange(){"sparkline"===this.type&&this.notifyTableOfChange()}handleStyleChange(){this.notifyTableOfChange()}notifyTableOfChange(){this.dispatchEvent(new CustomEvent("column-changed",{detail:{column:this.getColumnDefinition()},bubbles:!0,composed:!0}))}})})();(()=>{let e,s,n,l,r,o,c,d,h,u,p,m,g,b,v,f,y,w,k=[t.element("snice-row")],x=[],S=HTMLElement,C=[],E=[],D=[],z=[],$=[],A=[],F=[],T=[],L=[],M=[],R=[],j=[],O=[],B=[],I=[];(class extends S{static{s=this}static{const P="function"==typeof Symbol&&Symbol.metadata?Object.create(S[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean})],l=[t.property({type:Boolean})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({type:Object,attribute:!1})],d=[t.property({type:Number})],h=[t.property({type:Array,attribute:!1})],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("selected")],b=[t.watch("hoverable","clickable","selectable")],v=[t.watch("data","columns")],f=[t.dispatch("row-click",{bubbles:!0,composed:!0})],y=[t.dispatch("row-select",{bubbles:!0,composed:!0})],w=[t.dispatch("row-hover",{bubbles:!0,composed:!0})],i(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:P},null,C),i(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:P},null,C),i(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:P},null,C),i(this,null,g,{kind:"method",name:"updateSelection",static:!1,private:!1,access:{has:e=>"updateSelection"in e,get:e=>e.updateSelection},metadata:P},null,C),i(this,null,b,{kind:"method",name:"updateRowAttributes",static:!1,private:!1,access:{has:e=>"updateRowAttributes"in e,get:e=>e.updateRowAttributes},metadata:P},null,C),i(this,null,v,{kind:"method",name:"updateCells",static:!1,private:!1,access:{has:e=>"updateCells"in e,get:e=>e.updateCells},metadata:P},null,C),i(this,null,f,{kind:"method",name:"dispatchRowClick",static:!1,private:!1,access:{has:e=>"dispatchRowClick"in e,get:e=>e.dispatchRowClick},metadata:P},null,C),i(this,null,y,{kind:"method",name:"dispatchRowSelect",static:!1,private:!1,access:{has:e=>"dispatchRowSelect"in e,get:e=>e.dispatchRowSelect},metadata:P},null,C),i(this,null,w,{kind:"method",name:"dispatchRowHover",static:!1,private:!1,access:{has:e=>"dispatchRowHover"in e,get:e=>e.dispatchRowHover},metadata:P},null,C),i(null,null,n,{kind:"field",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected,set:(e,t)=>{e.selected=t}},metadata:P},E,D),i(null,null,l,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:e=>"hoverable"in e,get:e=>e.hoverable,set:(e,t)=>{e.hoverable=t}},metadata:P},z,$),i(null,null,r,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:e=>"clickable"in e,get:e=>e.clickable,set:(e,t)=>{e.clickable=t}},metadata:P},A,F),i(null,null,o,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:P},T,L),i(null,null,c,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:P},M,R),i(null,null,d,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:P},j,O),i(null,null,h,{kind:"field",name:"columns",static:!1,private:!1,access:{has:e=>"columns"in e,get:e=>e.columns,set:(e,t)=>{e.columns=t}},metadata:P},B,I),i(null,e={value:s},k,{kind:"class",name:s.name,metadata:P},null,x),s=e.value,P&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:P}),a(s,x)}extractDataFromAttributes(){const e={};return this.getAttributeNames().filter(e=>e.startsWith("data-")&&"data-column-index"!==e).forEach(t=>{const i=t.slice(5),a=this.getAttribute(t);null!==a&&(e[i]=a)}),e}render(){return t.html`
|
|
552
552
|
<div class="row-container" part="container" @click=${e=>this.handleRowClick(e)} @keydown=${e=>this.handleKeyDown(e)}>
|
|
553
553
|
<if ${this.selectable}>
|
|
554
554
|
${this.renderCheckbox()}
|
|
@@ -576,7 +576,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
|
|
|
576
576
|
<div class="cell cell--${e.type}" part="cell" style="${this.getCellStyles(e)}">
|
|
577
577
|
${t.unsafeHTML(`<${a}\n type="${e.type}"\n align="${e.align||"left"}"\n data-column-index="${i}"\n ></${a}>`)}
|
|
578
578
|
</div>
|
|
579
|
-
`}getCellComponent(e){switch(e){case"text":return"snice-cell-text";case"number":case"accounting":case"scientific":case"fraction":return"snice-cell-number";case"date":return"snice-cell-date";case"boolean":return"snice-cell-boolean";case"sparkline":return"snice-cell-sparkline";case"rating":return"snice-cell-rating";case"progress":return"snice-cell-progress";case"duration":return"snice-cell-duration";case"filesize":return"snice-cell-filesize";case"link":case"url":return"snice-cell-link";case"actions":return"snice-cell-actions";case"tag":case"tags":case"badge":case"badges":return"snice-cell-tag";case"image":case"avatar":case"thumbnail":return"snice-cell-image";case"email":return"snice-cell-email";case"phone":case"tel":case"telephone":return"snice-cell-phone";case"status":return"snice-cell-status";case"color":return"snice-cell-color";case"json":case"object":return"snice-cell-json";case"currency":case"money":return"snice-cell-currency";case"percent":case"percentage":return"snice-cell-percentage";case"location":case"address":case"coordinates":return"snice-cell-location";default:return"snice-cell"}}getCellStyles(e){let t=[];return e.width&&(t.push(`width: ${e.width}`),t.push(`min-width: ${e.width}`),t.push(`max-width: ${e.width}`)),e.align&&t.push(`text-align: ${e.align}`),t.join("; ")}escapeHtml(e){if(null==e)return"";const t=String(e),i=document.createElement("div");return i.textContent=t,i.innerHTML}toggleSelection(){this.selected=!this.selected,this.dispatchRowSelect()}dispatchRowClick(){return{data:this.data,index:this.index,element:this}}dispatchRowSelect(){return{selected:this.selected,data:this.data,index:this.index,element:this}}dispatchRowHover(){return{data:this.data,index:this.index,element:this}}select(){this.selected=!0,this.dispatchRowSelect()}deselect(){this.selected=!1,this.dispatchRowSelect()}focusRow(){super.focus(),this.scrollIntoView({behavior:"smooth",block:"nearest"})}getCellValue(e){return this.data[e]}setCellValue(e,t){this.data={...this.data,[e]:t},this.updateCells()}getCellElement(e){const t=this.columns.find(t=>t.key===e);if(!t)return null;const i=this.columns.indexOf(t);return this.shadowRoot?.querySelector(`[data-column-index="${i}"]`)||null}highlight(e=2e3){this.classList.add("row--highlighted"),setTimeout(()=>{this.classList.remove("row--highlighted")},e)}constructor(){super(...arguments),this.selected=(a(this,C),a(this,E,!1)),this.hoverable=(a(this,D),a(this,z,!0)),this.clickable=(a(this,$),a(this,A,!1)),this.selectable=(a(this,F),a(this,T,!1)),this.data=(a(this,L),a(this,M,{})),this.index=(a(this,R),a(this,j,0)),this.columns=(a(this,O),a(this,B,[])),a(this,I)}})})();class c{constructor(){this.rafId=0,this.lastStartIndex=-1,this.lastEndIndex=-1,this.enabled=!1,this.topSpacer=document.createElement("tr"),this.topSpacer.className="virtual-spacer virtual-spacer--top",this.topSpacer.style.display="table-row",this.bottomSpacer=document.createElement("tr"),this.bottomSpacer.className="virtual-spacer virtual-spacer--bottom",this.bottomSpacer.style.display="table-row",this.contentContainer=document.createElement("tbody"),this.options={},this.scrollHandler=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>this.update())}}attach(e){this.options=e,this.enabled=!0,this.options.scrollContainer.addEventListener("scroll",this.scrollHandler,{passive:!0}),window.addEventListener("resize",this.scrollHandler,{passive:!0}),this.update()}detach(){this.enabled=!1,this.options.scrollContainer?.removeEventListener("scroll",this.scrollHandler),window.removeEventListener("resize",this.scrollHandler),cancelAnimationFrame(this.rafId)}setTotalRows(e){this.options.totalRows=e,this.lastStartIndex=-1,this.update()}refresh(){this.lastStartIndex=-1,this.lastEndIndex=-1,this.update()}update(){if(!this.enabled||!this.options.scrollContainer)return;const{rowHeight:e,bufferPx:t,totalRows:i,scrollContainer:a,renderRange:s}=this.options,n=a.scrollTop,l=a.clientHeight,r=i*e,o=Math.max(0,n-t),c=Math.min(r,n+l+t),d=Math.floor(o/e),h=Math.min(i,Math.ceil(c/e));if(d===this.lastStartIndex&&h===this.lastEndIndex)return;this.lastStartIndex=d,this.lastEndIndex=h;const u=d*e,p=Math.max(0,(i-h)*e);this.topSpacer.style.height=`${u}px`,this.bottomSpacer.style.height=`${p}px`;const m=s(d,h),g=this.options.scrollContainer.querySelector("tbody");if(g){if(g.innerHTML="",u>0){const e=document.createElement("td");e.colSpan=999,e.style.height=`${u}px`,e.style.padding="0",e.style.border="none",this.topSpacer.innerHTML="",this.topSpacer.appendChild(e),g.appendChild(this.topSpacer)}if(g.appendChild(m),p>0){const e=document.createElement("td");e.colSpan=999,e.style.height=`${p}px`,e.style.padding="0",e.style.border="none",this.bottomSpacer.innerHTML="",this.bottomSpacer.appendChild(e),g.appendChild(this.bottomSpacer)}}}getVisibleRange(){return{start:this.lastStartIndex,end:this.lastEndIndex}}scrollToRow(e){if(!this.options.scrollContainer)return;const t=e*this.options.rowHeight;this.options.scrollContainer.scrollTop=t}getScrollPosition(){const e=this.options.scrollContainer;return{top:e?.scrollTop??0,left:e?.scrollLeft??0}}isEnabled(){return this.enabled}}class d{constructor(){this.states=new Map,this.groups=[],this.resizeStartX=0,this.resizeStartWidth=0,this.resizingKey=null,this.resizeOverlay=null,this.tableElement=null}initialize(e,t){this.tableElement=t,e.forEach((e,t)=>{const i=this.states.get(e.key);this.states.set(e.key,{key:e.key,width:i?.width??this.parseWidth(e.width)??150,flex:e.flex,minWidth:e.minWidth??50,maxWidth:e.maxWidth??1/0,visible:i?.visible??!0,pinned:i?.pinned??(e.pinned||!1),order:i?.order??t,resizable:!1!==e.resizable,reorderable:!1!==e.reorderable,hideable:!1!==e.hideable,pinnable:!1!==e.pinnable})})}parseWidth(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}getVisibleColumns(){return Array.from(this.states.values()).filter(e=>e.visible).sort((e,t)=>e.order-t.order)}getAllStates(){return Array.from(this.states.values()).sort((e,t)=>e.order-t.order)}getPinnedLeft(){return this.getVisibleColumns().filter(e=>"left"===e.pinned)}getPinnedRight(){return this.getVisibleColumns().filter(e=>"right"===e.pinned)}getUnpinned(){return this.getVisibleColumns().filter(e=>!e.pinned)}computeFlexWidths(e){const t=this.getVisibleColumns(),i=new Map;let a=0;const s=[];for(const e of t)e.flex&&e.flex>0?s.push(e):(a+=e.width,i.set(e.key,e.width));const n=Math.max(0,e-a),l=s.reduce((e,t)=>e+(t.flex||1),0);for(const e of s){const t=(e.flex||1)/l*n,a=Math.max(e.minWidth,Math.min(e.maxWidth,t));i.set(e.key,a)}return i}applyWidths(e,t){e.querySelectorAll("th[data-key]").forEach(e=>{const i=e.getAttribute("data-key");i&&t.has(i)&&(e.style.width=`${t.get(i)}px`)})}startResize(e,t){const i=this.states.get(e);if(!i||!i.resizable)return;this.resizingKey=e,this.resizeStartX=t,this.resizeStartWidth=i.width,this.resizeOverlay=document.createElement("div"),this.resizeOverlay.style.cssText="position:fixed;inset:0;z-index:99999;cursor:col-resize;",document.body.appendChild(this.resizeOverlay);const a=t=>{t.preventDefault();const a=t.clientX-this.resizeStartX,s=Math.max(i.minWidth,Math.min(i.maxWidth,this.resizeStartWidth+a));i.width=s,i.flex=void 0;const n=this.tableElement?.shadowRoot;if(n){const t=n.querySelector(`th[data-key="${e}"]`);t&&(t.style.width=`${s}px`);n.querySelectorAll(`td[data-key="${e}"]`).forEach(e=>e.style.width=`${s}px`)}this.tableElement?.dispatchEvent(new CustomEvent("column-resize",{detail:{key:e,width:s},bubbles:!0,composed:!0}))},s=()=>{this.resizingKey=null,this.resizeOverlay?.remove(),this.resizeOverlay=null,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),this.tableElement?.dispatchEvent(new CustomEvent("column-resize-end",{detail:{key:e,width:i.width},bubbles:!0,composed:!0}))};document.addEventListener("mousemove",a),document.addEventListener("mouseup",s)}autoSizeColumn(e,t){const i=this.states.get(e);if(!i)return;const a=this.tableElement?.shadowRoot?.querySelector(`th[data-key="${e}"]`);let s=a?a.scrollWidth:0;t.querySelectorAll(`td[data-key="${e}"]`).forEach(e=>{s=Math.max(s,e.scrollWidth)}),i.width=Math.max(i.minWidth,Math.min(i.maxWidth,s+16)),i.flex=void 0}autoSizeAll(e){for(const t of this.states.keys())this.autoSizeColumn(t,e)}setColumnVisible(e,t){const i=this.states.get(e);i&&i.hideable&&(i.visible=t)}showAllColumns(){for(const e of this.states.values())e.visible=!0}hideAllColumns(){for(const e of this.states.values())e.hideable&&(e.visible=!1)}getVisibilityModel(){const e={};for(const[t,i]of this.states)e[t]=i.visible;return e}moveColumn(e,t){const i=this.states.get(e);if(!i||!i.reorderable||i.pinned)return;const a=this.getVisibleColumns(),s=a.findIndex(t=>t.key===e);-1!==s&&s!==t&&(a.splice(s,1),a.splice(t,0,i),a.forEach((e,t)=>{e.order=t}))}pinColumn(e,t){const i=this.states.get(e);i&&i.pinnable&&(i.pinned=t)}unpinColumn(e){const t=this.states.get(e);t&&(t.pinned=!1)}setColumnGroups(e){this.groups=e}getColumnGroups(){return this.groups}renderGroupHeaders(){return 0===this.groups.length?"":this.groups.map(e=>{const t=e.children.filter(e=>this.states.get(e)?.visible).length;return 0===t?"":`<th colspan="${t}" class="column-group-header ${e.headerClass||""}">${e.label}</th>`}).join("")}isResizing(){return null!==this.resizingKey}getState(e){return this.states.get(e)}getPinnedLeftOffsets(){const e=new Map;let t=0;for(const i of this.getPinnedLeft())e.set(i.key,t),t+=i.width;return e}getPinnedRightOffsets(){const e=new Map,t=this.getPinnedRight();let i=0;for(let a=t.length-1;a>=0;a--)e.set(t[a].key,i),i+=t[a].width;return e}}const h=[{value:"contains",label:"contains",requiresValue:!0},{value:"notContains",label:"does not contain",requiresValue:!0},{value:"equals",label:"equals",requiresValue:!0},{value:"notEquals",label:"does not equal",requiresValue:!0},{value:"startsWith",label:"starts with",requiresValue:!0},{value:"endsWith",label:"ends with",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],u=[{value:"eq",label:"=",requiresValue:!0},{value:"neq",label:"≠",requiresValue:!0},{value:"gt",label:">",requiresValue:!0},{value:"gte",label:"≥",requiresValue:!0},{value:"lt",label:"<",requiresValue:!0},{value:"lte",label:"≤",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],p=[{value:"is",label:"is",requiresValue:!0},{value:"isNot",label:"is not",requiresValue:!0},{value:"before",label:"before",requiresValue:!0},{value:"onOrBefore",label:"on or before",requiresValue:!0},{value:"after",label:"after",requiresValue:!0},{value:"onOrAfter",label:"on or after",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],m=[{value:"isTrue",label:"is true",requiresValue:!1},{value:"isFalse",label:"is false",requiresValue:!1}];class g{constructor(){this.model={filters:[],logic:"and"},this.headerFilters=new Map}getOperatorsForType(e){switch(e){case"number":case"currency":case"rating":case"progress":case"filesize":case"duration":case"percent":case"percentage":return u;case"date":return p;case"boolean":return m;default:return h}}setFilterModel(e){this.model=e}getFilterModel(){return{...this.model}}setColumnFilter(e,t,i){const a=this.model.filters.findIndex(t=>t.column===e);a>=0?this.model.filters[a]={column:e,operator:t,value:i}:this.model.filters.push({column:e,operator:t,value:i})}removeColumnFilter(e){this.model.filters=this.model.filters.filter(t=>t.column!==e)}clearAllFilters(){this.model.filters=[],this.model.quickFilter=void 0,this.model.logic="and",this.headerFilters.clear()}setQuickFilter(e){this.model.quickFilter=e||void 0}setHeaderFilter(e,t){t?this.headerFilters.set(e,t):this.headerFilters.delete(e)}getHeaderFilter(e){return this.headerFilters.get(e)||""}setFilterLogic(e){this.model.logic=e}hasActiveFilters(){return this.model.filters.length>0||!!this.model.quickFilter||this.headerFilters.size>0}hasColumnFilter(e){return this.model.filters.some(t=>t.column===e)||this.headerFilters.has(e)}getActiveFilterCount(){return this.model.filters.length+this.headerFilters.size+(this.model.quickFilter?1:0)}applyFilters(e,t){let i=e;this.model.filters.length>0&&(i=i.filter(e=>{const t=this.model.filters.map(t=>this.evaluateFilter(t,e));return"and"===this.model.logic?t.every(Boolean):t.some(Boolean)}));for(const[e,t]of this.headerFilters){const a=t.toLowerCase();i=i.filter(t=>{const i=t[e];return null!=i&&String(i).toLowerCase().includes(a)})}if(this.model.quickFilter){const e=this.model.quickFilter.toLowerCase().split(/\s+/).filter(Boolean),a=t.map(e=>e.key),s=this.model.quickFilterLogic||"and";i=i.filter(t=>{const i=e=>a.some(i=>{const a=t[i];return null!=a&&String(a).toLowerCase().includes(e)});return"and"===s?e.every(i):e.some(i)})}return i}evaluateFilter(e,t){const i=t[e.column],a=e.value;switch(e.operator){case"contains":return null!=i&&String(i).toLowerCase().includes(String(a).toLowerCase());case"notContains":return null==i||!String(i).toLowerCase().includes(String(a).toLowerCase());case"equals":return String(i??"").toLowerCase()===String(a).toLowerCase();case"notEquals":return String(i??"").toLowerCase()!==String(a).toLowerCase();case"startsWith":return null!=i&&String(i).toLowerCase().startsWith(String(a).toLowerCase());case"endsWith":return null!=i&&String(i).toLowerCase().endsWith(String(a).toLowerCase());case"isEmpty":return null==i||""===i;case"isNotEmpty":return null!=i&&""!==i;case"eq":return Number(i)===Number(a);case"neq":return Number(i)!==Number(a);case"gt":return Number(i)>Number(a);case"gte":return Number(i)>=Number(a);case"lt":return Number(i)<Number(a);case"lte":return Number(i)<=Number(a);case"is":return new Date(i).toDateString()===new Date(a).toDateString();case"isNot":return new Date(i).toDateString()!==new Date(a).toDateString();case"before":return new Date(i)<new Date(a);case"onOrBefore":return new Date(i)<=new Date(a);case"after":return new Date(i)>new Date(a);case"onOrAfter":return new Date(i)>=new Date(a);case"isTrue":return!0===i||"true"===i||1===i;case"isFalse":return!1===i||"false"===i||0===i||null==i;default:return!0}}toServerParams(){return{filters:this.model.filters,filterLogic:this.model.logic,quickFilter:this.model.quickFilter,headerFilters:Object.fromEntries(this.headerFilters)}}}class b{constructor(){this.cellState=null,this.rowState=null,this.pipelines=new Map,this.validators=new Map,this.editableColumns=new Set,this.editabilityCheck=null,this.tableElement=null,this.mode="cell"}attach(e){this.tableElement=e}setEditableColumns(e){this.editableColumns=new Set(e)}setEditabilityCheck(e){this.editabilityCheck=e}setEditMode(e){this.mode=e}setPipeline(e,t){this.pipelines.set(e,t)}setValidation(e,t){this.validators.set(e,t)}isCellEditable(e,t){return!!this.editableColumns.has(t)&&(!this.editabilityCheck||this.editabilityCheck(e,t))}getDisplayValue(e,t,i){const a=this.pipelines.get(e);let s=t;return a?.valueGetter&&(s=a.valueGetter(s,i)),a?.valueFormatter?a.valueFormatter(s,i):null==s?"":String(s)}getSortValue(e,t,i){const a=this.pipelines.get(e);return a?.valueGetter?a.valueGetter(t,i):t}getEditorType(e){switch(e){case"number":case"currency":case"rating":case"progress":return"number";case"date":return"date";case"boolean":return"boolean";default:return"text"}}startCellEdit(e,t,i,a){return this.isCellEditable(a,t)?(this.cellState?.isEditing&&this.cancelCellEdit(),this.cellState={rowIndex:e,columnKey:t,originalValue:i,currentValue:i,editorType:this.getEditorType(t),error:null,isEditing:!0},this.cellState):null}updateCellValue(e){this.cellState&&(this.cellState.currentValue=e,this.cellState.error=null)}async commitCellEdit(){if(!this.cellState?.isEditing)return null;const{columnKey:e,currentValue:t,rowIndex:i}=this.cellState,a=this.pipelines.get(e);let s=t;a?.valueParser&&(s=a.valueParser(String(t),{}));const n=this.validators.get(e);if(n){const e=await n.validate(s,{});if(e)return this.cellState.error=e,e}return a?.valueSetter&&(s=a.valueSetter(s,{})),this.tableElement?.dispatchEvent(new CustomEvent("cell-edit-commit",{detail:{rowIndex:i,columnKey:e,oldValue:this.cellState.originalValue,newValue:s},bubbles:!0,composed:!0})),this.cellState.isEditing=!1,this.cellState=null,null}cancelCellEdit(){this.cellState?.isEditing&&(this.tableElement?.dispatchEvent(new CustomEvent("cell-edit-cancel",{detail:{rowIndex:this.cellState.rowIndex,columnKey:this.cellState.columnKey},bubbles:!0,composed:!0})),this.cellState.isEditing=!1,this.cellState=null)}getCellEditState(){return this.cellState}startRowEdit(e,t){return this.rowState?.isEditing&&this.cancelRowEdit(),this.rowState={rowIndex:e,originalRow:{...t},editedRow:{...t},errors:new Map,isEditing:!0},this.rowState}updateRowField(e,t){this.rowState&&(this.rowState.editedRow[e]=t,this.rowState.errors.delete(e))}async commitRowEdit(){if(!this.rowState?.isEditing)return null;const e=new Map;for(const t of this.editableColumns){const i=this.validators.get(t);if(i){const a=this.rowState.editedRow[t],s=await i.validate(a,this.rowState.editedRow);s&&e.set(t,s)}}if(e.size>0)return this.rowState.errors=e,e;const t={...this.rowState.editedRow};for(const[e,i]of this.pipelines)i.valueSetter&&e in t&&(t[e]=i.valueSetter(t[e],t));return this.tableElement?.dispatchEvent(new CustomEvent("row-edit-commit",{detail:{rowIndex:this.rowState.rowIndex,oldRow:this.rowState.originalRow,newRow:t},bubbles:!0,composed:!0})),this.rowState.isEditing=!1,this.rowState=null,null}cancelRowEdit(){this.rowState?.isEditing&&(this.tableElement?.dispatchEvent(new CustomEvent("row-edit-cancel",{detail:{rowIndex:this.rowState.rowIndex},bubbles:!0,composed:!0})),this.rowState.isEditing=!1,this.rowState=null)}getRowEditState(){return this.rowState}isEditing(){return(this.cellState?.isEditing||this.rowState?.isEditing)??!1}createEditor(e,t,i){switch(e){case"number":{const e=document.createElement("input");return e.type="number",e.value=null==t?"":String(t),e.className="table-editor-input",e}case"date":{const e=document.createElement("input");return e.type="date",e.value=t||"",e.className="table-editor-input",e}case"boolean":{const e=document.createElement("input");return e.type="checkbox",e.checked=!!t,e.className="table-editor-checkbox",e}case"select":{const e=document.createElement("select");return e.className="table-editor-select",(i?.selectOptions||[]).forEach(i=>{const a=document.createElement("option");a.value=i.value,a.textContent=i.label,i.value===String(t)&&(a.selected=!0),e.appendChild(a)}),e}default:{const e=document.createElement("input");return e.type="text",e.value=null==t?"":String(t),e.className="table-editor-input",e}}}}class v{constructor(){this.focusedRow=-1,this.focusedCol=0,this.attached=!1,this.options={},this.keyHandler=e=>this.handleKeyDown(e)}attach(e){this.options=e;const t=this.getTable();t&&(t.setAttribute("role","grid"),t.setAttribute("tabindex","0"),t.addEventListener("keydown",this.keyHandler),this.attached=!0,this.applyARIA())}detach(){const e=this.getTable();e&&e.removeEventListener("keydown",this.keyHandler),this.attached=!1}getTable(){return this.options.shadowRoot?.querySelector("table")??null}applyARIA(){const e=this.getTable();if(!e)return;e.setAttribute("aria-rowcount",String(this.options.totalRows+1)),e.setAttribute("aria-colcount",String(this.options.totalColumns));const t=e.querySelector("thead tr");if(t){t.setAttribute("role","row"),t.setAttribute("aria-rowindex","1");t.querySelectorAll("th").forEach((e,t)=>{if(e.setAttribute("role","columnheader"),e.setAttribute("aria-colindex",String(t+1)),e.classList.contains("sortable")){const t=e.querySelector(".sort-indicator.active");if(t){const i=t.textContent?.trim()||"";i.includes("▲")?e.setAttribute("aria-sort","ascending"):i.includes("▼")&&e.setAttribute("aria-sort","descending")}else e.setAttribute("aria-sort","none")}})}e.querySelectorAll("tbody tr:not(.virtual-spacer)").forEach((e,t)=>{e.setAttribute("role","row"),e.setAttribute("aria-rowindex",String(t+2));"true"===e.getAttribute("data-selected")?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected");e.querySelectorAll("td").forEach((e,t)=>{e.setAttribute("role","gridcell"),e.setAttribute("aria-colindex",String(t+1))})}),this.updateFocusIndicator()}setFocus(e,t){this.focusedRow=e,this.focusedCol=t,this.updateFocusIndicator()}getFocus(){return{row:this.focusedRow,col:this.focusedCol}}updateFocusIndicator(){const e=this.getTable();if(!e)return;e.querySelectorAll("[data-grid-focus]").forEach(e=>{e.removeAttribute("data-grid-focus"),e.removeAttribute("tabindex")});let t=null;if(-1===this.focusedRow){t=e.querySelectorAll("thead th")[this.focusedCol]}else{const i=e.querySelectorAll("tbody tr:not(.virtual-spacer)")[this.focusedRow];if(i){t=i.querySelectorAll("td")[this.focusedCol]}}t&&(t.setAttribute("data-grid-focus","true"),t.setAttribute("tabindex","0"))}handleKeyDown(e){if(this.options.isEditing())return;const{totalRows:t,totalColumns:i}=this.options;switch(e.key){case"ArrowDown":e.preventDefault(),this.focusedRow=Math.min(t-1,this.focusedRow+1),this.updateFocusIndicator(),this.scrollIntoView();break;case"ArrowUp":e.preventDefault(),this.focusedRow=Math.max(-1,this.focusedRow-1),this.updateFocusIndicator(),this.scrollIntoView();break;case"ArrowRight":e.preventDefault(),this.focusedCol=Math.min(i-1,this.focusedCol+1),this.updateFocusIndicator();break;case"ArrowLeft":e.preventDefault(),this.focusedCol=Math.max(0,this.focusedCol-1),this.updateFocusIndicator();break;case"Home":e.preventDefault(),e.ctrlKey?(this.focusedRow=-1,this.focusedCol=0):this.focusedCol=0,this.updateFocusIndicator(),this.scrollIntoView();break;case"End":e.preventDefault(),e.ctrlKey?(this.focusedRow=t-1,this.focusedCol=i-1):this.focusedCol=i-1,this.updateFocusIndicator(),this.scrollIntoView();break;case"PageDown":e.preventDefault(),this.focusedRow=Math.min(t-1,this.focusedRow+10),this.updateFocusIndicator(),this.scrollIntoView();break;case"PageUp":e.preventDefault(),this.focusedRow=Math.max(0,this.focusedRow-10),this.updateFocusIndicator(),this.scrollIntoView();break;case" ":this.focusedRow>=0&&(e.preventDefault(),e.shiftKey&&this.options.onSelectionToggle?.(this.focusedRow));break;case"Enter":if(this.focusedRow>=0&&this.focusedCol>=0){e.preventDefault();const t=this.getTable(),i=t?.querySelectorAll("tbody tr:not(.virtual-spacer)"),a=i?.[this.focusedRow],s=a?.querySelectorAll("td"),n=s?.[this.focusedCol],l=n?.getAttribute("data-key")||"";this.options.onCellActivate?.(this.focusedRow,l)}break;case"a":(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.options.onSelectAll?.())}}scrollIntoView(){const e=this.getTable();if(!e)return;const t=e.querySelector("[data-grid-focus]");t&&(t.scrollIntoView({block:"nearest",inline:"nearest"}),t.focus({preventScroll:!0}))}isAttached(){return this.attached}}class f{exportCSV(e,t,i={}){const{delimiter:a=",",filename:s="export.csv",includeHeaders:n=!0,columns:l,utf8BOM:r=!0}=i;let o=t.filter(e=>!1!==e.exportable);l&&(o=o.filter(e=>l.includes(e.key)));const c=[];n&&c.push(o.map(e=>this.escapeCSV(e.label,a)).join(a));for(const t of e){const e=o.map(e=>{const i=t[e.key];return this.escapeCSV(null==i?"":String(i),a)});c.push(e.join(a))}const d=c.join("\n"),h=new Blob([(r?"\ufeff":"")+d],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(h),p=document.createElement("a");p.href=u,p.download=s,p.style.display="none",document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(u)}print(e,t={}){const{hideFooter:i=!1,hideToolbar:a=!1,pageStyles:s=""}=t,n=window.open("","_blank");if(!n)return;const l=e.shadowRoot;if(!l)return;const r=l.querySelector("table");if(!r)return;const o=`\n <!DOCTYPE html>\n <html>\n <head>\n <title>Print</title>\n <style>\n body { font-family: system-ui, -apple-system, sans-serif; margin: 1rem; }\n table { width: 100%; border-collapse: collapse; }\n th, td { padding: 8px 12px; border: 1px solid #ddd; text-align: left; }\n th { background: #f5f5f5; font-weight: 600; }\n ${i?".pagination { display: none; }":""}\n ${a?".table-controls { display: none; }":""}\n @media print {\n body { margin: 0; }\n table { page-break-inside: auto; }\n tr { page-break-inside: avoid; }\n }\n ${s}\n </style>\n </head>\n <body>\n ${r.outerHTML}\n </body>\n </html>\n `;n.document.write(o),n.document.close(),n.onload=()=>{n.print(),n.close()}}async copyToClipboard(e,t,i,a={}){const{delimiter:s="\t"}=a,n=i.length>0?i.map(t=>e[t]).filter(Boolean):e;if(0===n.length)return!1;const l=n.map(e=>t.map(t=>{const i=e[t.key];return null==i?"":String(i)}).join(s)).join("\n");try{return await navigator.clipboard.writeText(l),!0}catch{const e=document.createElement("textarea");e.value=l,e.style.cssText="position:fixed;left:-9999px;",document.body.appendChild(e),e.select();const t=document.execCommand("copy");return document.body.removeChild(e),t}}escapeCSV(e,t){return e.includes(t)||e.includes('"')||e.includes("\n")||e.includes("\r")?`"${e.replace(/"/g,'""')}"`:e}}class y{constructor(){this.expandedRows=new Set,this.options=null,this.tableElement=null}attach(e,t){this.tableElement=e,this.options=t}isExpanded(e){return this.expandedRows.has(e)}toggle(e){this.expandedRows.has(e)?this.collapse(e):this.expand(e)}expand(e){this.expandedRows.add(e),this.tableElement?.dispatchEvent(new CustomEvent("row-expand",{detail:{rowIndex:e},bubbles:!0,composed:!0}))}collapse(e){this.expandedRows.delete(e),this.tableElement?.dispatchEvent(new CustomEvent("row-collapse",{detail:{rowIndex:e},bubbles:!0,composed:!0}))}expandAll(e){for(let t=0;t<e;t++)this.expandedRows.add(t)}collapseAll(){this.expandedRows.clear()}getExpandedRows(){return new Set(this.expandedRows)}createToggleButton(e){const t=this.isExpanded(e),i=document.createElement("button");return i.type="button",i.className="detail-toggle"+(t?" detail-toggle--expanded":""),i.setAttribute("aria-expanded",String(t)),i.setAttribute("aria-label",t?"Collapse row":"Expand row"),i.innerHTML='<svg class="detail-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.addEventListener("click",t=>{t.stopPropagation(),this.toggle(e),this.tableElement?.dispatchEvent(new CustomEvent("detail-toggle",{detail:{rowIndex:e,expanded:this.isExpanded(e)},bubbles:!0,composed:!0}))}),i}createDetailRow(e,t,i){if(!this.options||!this.isExpanded(t))return null;const a=document.createElement("tr");a.className="detail-row",a.setAttribute("data-detail-for",String(t));const s=document.createElement("td");s.colSpan=i,s.className="detail-cell",s.style.padding="0",s.style.border="none";const n=document.createElement("div");n.className="detail-content";const l=document.createElement("div");l.className="detail-content-inner";const r=this.options.getDetailContent(e,t);return"string"==typeof r?l.innerHTML=r:r instanceof HTMLElement&&l.appendChild(r),n.appendChild(l),s.appendChild(n),requestAnimationFrame(()=>{const e=l.scrollHeight;n.style.setProperty("--detail-max-height",`${e}px`),n.classList.add("detail-content--open")}),a.appendChild(s),a}isEnabled(){return null!==this.options}}class w{constructor(){this.container=null,this.options={},this.tableElement=null,this.filterEngine=null,this.filterPanel=null,this.filterPanelOpen=!1,this.filters=[],this.logic="and",this.pendingDebounces=[],this.onSearch=null,this.onSortColumn=null,this.onSetSortModel=null,this.onFilterColumn=null,this.onRemoveFilter=null,this.onClearFilters=null,this.onSetFilterModel=null,this.onExportCSV=null,this.onFullscreen=null}attach(e,t,i={}){this.tableElement=e,this.container=t,this.options=i,this.render()}setFilterEngine(e){this.filterEngine=e}render(){if(!this.container)return;this.container.innerHTML="";const e=document.createElement("div");e.className="tt-wrap",e.appendChild(this.styleTag());const t=document.createElement("div");if(t.className="table-toolbar",t.setAttribute("part","toolbar"),!1!==this.options.showSearch){const e=document.createElement("snice-input");let i;e.type="search",e.placeholder=this.options.searchPlaceholder||"Search...",e.size="small",e.prefixIcon="search",e.clearable=!0,e.className="toolbar-search",e.addEventListener("input",()=>{clearTimeout(i),i=window.setTimeout(()=>this.onSearch?.(e.value),300)}),t.appendChild(e)}const i=document.createElement("div");if(i.className="toolbar-actions",this.options.showExport){const e=this.mkBtn("Export CSV",'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"/></svg>');e.addEventListener("click",()=>this.onExportCSV?.()),i.appendChild(e)}const a=this.mkBtn("Fullscreen",'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"/></svg>');a.addEventListener("click",()=>this.onFullscreen?.()),i.appendChild(a),t.appendChild(i),e.appendChild(t),this.filterPanel=document.createElement("div"),this.filterPanel.className="tt-filter-panel",this.filterPanel.hidden=!this.filterPanelOpen,e.appendChild(this.filterPanel),this.container.appendChild(e)}openFilterModal(e){const t=this.ensureEngine();if(!this.filterPanelOpen){const e=t.getFilterModel();this.filters=e.filters.map(e=>({...e})),this.logic=e.logic||"and"}if(e){const i=(this.tableElement?.columns||[]).find(t=>t.key===e),a=t.getOperatorsForType(i?.type||"text");i&&a[0]&&!this.filters.some(t=>t.column===e)&&this.filters.push({column:e,operator:a[0].value,value:""})}this.filterPanelOpen||(this.filterPanelOpen=!0,this.filterPanel&&(this.filterPanel.hidden=!1)),this.renderFilterPanel()}closeFilterPanel(){this.cancelPendingDebounces(),this.filterPanelOpen=!1,this.filterPanel&&(this.filterPanel.hidden=!0)}ensureEngine(){return this.filterEngine||(this.filterEngine=new g),this.filterEngine}cancelPendingDebounces(){for(const e of this.pendingDebounces)clearTimeout(e);this.pendingDebounces=[]}renderFilterPanel(){if(!this.filterPanel)return;this.cancelPendingDebounces();const e=this.ensureEngine(),t=this.tableElement?.columns||[];if(0===this.filters.length){const t=e.getFilterModel();this.filters=[...t.filters],this.logic=t.logic||"and"}this.filterPanel.innerHTML="",this.filterPanel.appendChild(this.styleTag());const i=document.createElement("div");i.className="tt-filter-inner";const a=document.createElement("button");a.type="button",a.className="tt-filter-corner-close",a.setAttribute("aria-label","Close filter panel"),a.setAttribute("title","Close"),a.innerHTML=n,a.addEventListener("click",()=>this.closeFilterPanel()),i.appendChild(a);const s=document.createElement("div");s.className="tt-filter-rows",i.appendChild(s);const l=()=>{const i=this.filters.filter(i=>{const a=t.find(e=>e.key===i.column),s=a?.type||"text",n=e.getOperatorsForType(s).find(e=>e.value===i.operator);return!!n&&(!1===n.requiresValue||null!==i.value&&""!==i.value)});this.onSetFilterModel?.(i,this.logic)},r=(i,a)=>{const s=document.createElement("div");s.className="tt-filter-row";const r=document.createElement("button");r.type="button",r.className="tt-filter-x",r.setAttribute("aria-label","Remove filter"),r.innerHTML=n,r.addEventListener("click",()=>{this.filters.splice(a,1),0===this.filters.length?this.onClearFilters?.():l(),this.renderFilterPanel()}),s.appendChild(r);const o=document.createElement("snice-select");o.size="small",o.searchable=t.length>8,o.maxHeight="200px",o.options=t.map(e=>({value:e.key,label:e.label||e.key})),o.value=i.column,o.style.width="11rem",s.appendChild(o);const c=document.createElement("snice-select");c.size="small",c.maxHeight="200px",c.style.width="8rem",s.appendChild(c);const d=document.createElement("span");d.className="tt-filter-val-wrap";const h=document.createElement("snice-input");h.size="small",h.placeholder="Value",h.style.width="11rem",null!=i.value&&(h.value=String(i.value)),d.appendChild(h),s.appendChild(d);const u=()=>{const a=t.find(e=>e.key===o.value),s=a?.type||"text",n=e.getOperatorsForType(s);c.options=n.map(e=>({value:e.value,label:e.label})),n.some(e=>e.value===i.operator)?c.value=i.operator:c.value="",h.type=(e=>{switch(e){case"number":case"currency":case"rating":case"progress":case"filesize":case"duration":case"percent":case"percentage":return"number";case"date":return"date";default:return"text"}})(s),p()},p=()=>{const i=t.find(e=>e.key===o.value),a=i?.type||"text",s=e.getOperatorsForType(a).find(e=>e.value===c.value);d.style.display=!1===s?.requiresValue?"none":""};let m;return o.addEventListener("change",()=>{i.column=o.value,u(),l()}),c.addEventListener("change",()=>{i.operator=c.value,p(),l()}),h.addEventListener("input",()=>{clearTimeout(m),m=window.setTimeout(()=>{this.pendingDebounces=this.pendingDebounces.filter(e=>e!==m),i.value=h.value,l()},250),this.pendingDebounces.push(m)}),h.addEventListener("keydown",e=>{"Enter"===e.key&&(i.value=h.value,l())}),u(),s};if(this.filters.length>1){const e=document.createElement("div");e.className="tt-filter-logicbar";const t=document.createElement("span");t.className="tt-filter-logicbar-label",t.textContent="Match";const a=document.createElement("snice-select");a.size="small",a.options=[{value:"and",label:"All filters (AND)"},{value:"or",label:"Any filter (OR)"}],a.value=this.logic,a.style.width="11rem",a.addEventListener("change",()=>{this.logic=a.value,l()}),e.appendChild(t),e.appendChild(a),i.insertBefore(e,s)}if(0===this.filters.length){const e=document.createElement("div");e.className="tt-filter-empty",e.textContent="No filters applied",s.appendChild(e)}else this.filters.forEach((e,t)=>s.appendChild(r(e,t)));const o=document.createElement("div");o.className="tt-filter-footer";const c=document.createElement("button");if(c.type="button",c.className="tt-filter-add",c.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4.5v15m7.5-7.5h-15"/></svg><span>Add filter</span>',c.addEventListener("click",()=>{const i=t[0];if(!i)return;const a=e.getOperatorsForType(i.type||"text");a[0]&&(this.filters.push({column:i.key,operator:a[0].value,value:""}),this.renderFilterPanel())}),o.appendChild(c),this.filters.length>0){const e=document.createElement("button");e.type="button",e.className="tt-filter-clear",e.textContent="Clear all",e.addEventListener("click",()=>{this.cancelPendingDebounces(),this.filters=[],this.logic="and",this.onClearFilters?.(),this.renderFilterPanel()}),o.appendChild(e)}i.appendChild(o),this.filterPanel.appendChild(i)}mkBtn(e,t){const i=document.createElement("button");return i.className="toolbar-btn",i.setAttribute("aria-label",e),i.setAttribute("title",e),i.innerHTML=t,i}styleTag(){const e=document.createElement("style");return e.textContent=k,e}setActiveFilterCount(e){}isAttached(){return null!==this.container}}const k="\n .tt-wrap { display: flex; flex-direction: column; }\n\n .tt-filter-panel {\n border-bottom: 1px solid var(--snice-color-border, rgb(226 226 226));\n background: var(--snice-color-surface-container-low, rgb(250 250 250));\n }\n .tt-filter-inner {\n padding: 0.75rem 0.875rem;\n padding-right: 2.5rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n position: relative;\n }\n .tt-filter-corner-close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n width: 1.75rem;\n height: 1.75rem;\n border: none;\n background: none;\n cursor: pointer;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n border-radius: var(--snice-border-radius-md, 0.25rem);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n line-height: 0;\n z-index: 1;\n }\n .tt-filter-corner-close:hover {\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n color: var(--snice-color-text, rgb(23 23 23));\n }\n .tt-filter-corner-close svg {\n width: 1rem;\n height: 1rem;\n }\n .tt-filter-logicbar {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n .tt-filter-logicbar-label {\n font-size: 0.75rem;\n font-weight: 500;\n color: var(--snice-color-text-secondary, rgb(82 82 82));\n flex: 0 0 auto;\n }\n .tt-filter-rows {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n }\n .tt-filter-empty {\n padding: 0.625rem 0.5rem;\n font-size: 0.8125rem;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n font-style: italic;\n }\n .tt-filter-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-wrap: nowrap;\n }\n .tt-filter-x {\n border: none;\n background: none;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n cursor: pointer;\n border-radius: var(--snice-border-radius-md, 0.25rem);\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n line-height: 0;\n }\n .tt-filter-x svg {\n width: 1rem;\n height: 1rem;\n }\n .tt-filter-x:hover {\n color: var(--snice-color-danger, rgb(220 38 38));\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n }\n .tt-filter-val-wrap { display: inline-flex; flex: 1 1 auto; min-width: 0; }\n .tt-filter-val-wrap snice-input { width: 100%; }\n .tt-filter-footer {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n margin-top: 0.125rem;\n }\n .tt-filter-add,\n .tt-filter-clear {\n border: none;\n background: none;\n font-family: inherit;\n font-size: 0.8125rem;\n cursor: pointer;\n padding: 0.375rem 0.625rem;\n border-radius: var(--snice-border-radius-md, 0.25rem);\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n line-height: 1;\n }\n .tt-filter-add svg,\n .tt-filter-clear svg {\n width: 0.875rem;\n height: 0.875rem;\n }\n .tt-filter-add { color: var(--snice-color-primary, rgb(37 99 235)); font-weight: 500; }\n .tt-filter-add:hover { background: var(--snice-color-primary-subtle, rgb(219 234 254 / 0.4)); }\n .tt-filter-clear { color: var(--snice-color-text-tertiary, rgb(115 115 115)); margin-left: auto; }\n .tt-filter-clear:hover {\n color: var(--snice-color-danger, rgb(220 38 38));\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n }\n";class x{constructor(){this.options=null,this.expandedKeys=new Set,this.flatRows=[],this.enabled=!1,this.defaultDepth=0}attach(e){this.options=e,this.enabled=!0,void 0!==e.defaultExpansionDepth&&e.defaultExpansionDepth>=0&&(this.defaultDepth=e.defaultExpansionDepth)}isEnabled(){return this.enabled}processData(e){if(!this.options)return[];const t=new Map;for(const i of e){const e=this.options.getPath(i),a=e.join("/");t.set(a,{data:i,children:new Set,depth:e.length-1,isGap:!1});for(let i=1;i<e.length;i++){const a=e.slice(0,i),s=a.join("/");t.has(s)||t.set(s,{data:{[this.options.groupColumn||"name"]:a[a.length-1]},children:new Set,depth:i-1,isGap:!0})}if(e.length>1){const i=e.slice(0,-1).join("/"),s=t.get(i);s&&s.children.add(a)}}const i=[];for(const[e,a]of t)0===a.depth&&i.push(e);if(i.sort(),0===this.expandedKeys.size&&this.defaultDepth>0)for(const[e,i]of t)i.depth<this.defaultDepth&&i.children.size>0&&this.expandedKeys.add(e);this.flatRows=[];const a=e=>{const i=t.get(e);if(!i)return;const s=i.children.size>0,n=this.expandedKeys.has(e);if(this.flatRows.push({path:e.split("/"),data:i.data,depth:i.depth,hasChildren:s,expanded:n,key:e,isGap:i.isGap}),n){const e=Array.from(i.children).sort();for(const t of e)a(t)}};for(const e of i)a(e);return this.flatRows}getFlatRows(){return this.flatRows}toggle(e){this.expandedKeys.has(e)?this.expandedKeys.delete(e):this.expandedKeys.add(e)}expand(e){this.expandedKeys.add(e)}collapse(e){this.expandedKeys.delete(e)}expandAll(e){if(this.options)for(const t of e){const e=this.options.getPath(t);for(let t=1;t<=e.length;t++)this.expandedKeys.add(e.slice(0,t).join("/"))}}collapseAll(){this.expandedKeys.clear()}isExpanded(e){return this.expandedKeys.has(e)}createToggle(e){const t=document.createElement("span");if(t.className="tree-indent",t.style.paddingLeft=1.5*e.depth+"rem",e.hasChildren){const i=document.createElement("button");i.type="button",i.className="tree-toggle"+(e.expanded?" tree-toggle--expanded":""),i.innerHTML='<svg class="tree-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.setAttribute("aria-expanded",String(e.expanded)),i.addEventListener("click",t=>{t.stopPropagation(),this.toggle(e.key),i.dispatchEvent(new CustomEvent("tree-toggle",{detail:{key:e.key,expanded:this.isExpanded(e.key)},bubbles:!0,composed:!0}))}),t.appendChild(i)}else{const e=document.createElement("span");e.className="tree-spacer",t.appendChild(e)}return t}getGroupColumn(){return this.options?.groupColumn||""}}class S{constructor(){this.menuEl=null,this.activeColumn=null,this.tableElement=null,this.outsideClickHandler=null,this.onSortAsc=null,this.onSortDesc=null,this.onFilter=null,this.onHide=null,this.onPinLeft=null,this.onPinRight=null,this.onUnpin=null,this.onAutoSize=null}attach(e){this.tableElement=e}show(e,t,i,a){this.hide(),this.activeColumn=e;const s=document.createElement("div");s.className="table-column-menu",s.style.left=`${t}px`,s.style.top=`${i}px`;const r=[];!1!==a?.sortable&&(r.push({label:"Sort Ascending",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19.5v-15m0 0-6.75 6.75M12 4.5l6.75 6.75"/></svg>',action:"sort-asc"}),r.push({label:"Sort Descending",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4.5v15m0 0 6.75-6.75M12 19.5l-6.75-6.75"/></svg>',action:"sort-desc"}),r.push({label:"",action:"",separator:!0})),!1!==a?.filterable&&r.push({label:"Filter...",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"/></svg>',action:"filter"}),!1!==a?.hideable&&r.push({label:"Hide Column",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"/></svg>',action:"hide"}),!1!==a?.pinnable&&(a?.pinned?r.push({label:"Unpin",icon:n,action:"unpin"}):(r.push({label:"Pin Left",icon:l,action:"pin-left"}),r.push({label:"Pin Right",icon:l,action:"pin-right"}))),r.push({label:"",action:"",separator:!0}),r.push({label:"Auto-size",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"/></svg>',action:"autosize"});for(const e of r){if(e.separator){const e=document.createElement("div");e.className="column-menu-separator",s.appendChild(e);continue}const t=document.createElement("button");t.type="button",t.className="column-menu-item",t.innerHTML=`${e.icon?`<span class="column-menu-icon">${e.icon}</span>`:""}<span>${e.label}</span>`,t.addEventListener("click",()=>{this.handleAction(e.action),this.hide()}),e.disabled&&(t.disabled=!0),s.appendChild(t)}const o=this.tableElement?.shadowRoot;o?o.appendChild(s):document.body.appendChild(s),this.menuEl=s,setTimeout(()=>{this.outsideClickHandler=e=>{e.composedPath().includes(s)||this.hide()},document.addEventListener("click",this.outsideClickHandler,{capture:!0})},0);const c=e=>{"Escape"===e.key&&(this.hide(),document.removeEventListener("keydown",c))};document.addEventListener("keydown",c)}handleAction(e){if(this.activeColumn)switch(e){case"sort-asc":this.onSortAsc?.(this.activeColumn);break;case"sort-desc":this.onSortDesc?.(this.activeColumn);break;case"filter":this.onFilter?.(this.activeColumn);break;case"hide":this.onHide?.(this.activeColumn);break;case"pin-left":this.onPinLeft?.(this.activeColumn);break;case"pin-right":this.onPinRight?.(this.activeColumn);break;case"unpin":this.onUnpin?.(this.activeColumn);break;case"autosize":this.onAutoSize?.(this.activeColumn)}}hide(){this.menuEl&&(this.menuEl.remove(),this.menuEl=null),this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,{capture:!0}),this.outsideClickHandler=null),this.activeColumn=null}isOpen(){return null!==this.menuEl}}class C{constructor(){this.enabled=!1,this.tableElement=null,this.dragSourceIndex=-1,this.dropTargetIndex=-1,this.dropIndicator=null}attach(e){this.tableElement=e,this.enabled=!0}isEnabled(){return this.enabled}makeRowDraggable(e,t,i=!0){i&&(e.draggable=!0,e.addEventListener("dragstart",i=>{this.dragSourceIndex=t,e.style.opacity="0.5",i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",String(t))}),e.addEventListener("dragend",()=>{e.style.opacity="1",this.removeDropIndicator(),this.dragSourceIndex=-1}),e.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",this.dropTargetIndex=t,this.showDropIndicator(e)}),e.addEventListener("dragleave",()=>{this.removeDropIndicator()}),e.addEventListener("drop",e=>{e.preventDefault(),this.removeDropIndicator(),-1!==this.dragSourceIndex&&this.dragSourceIndex!==t&&this.tableElement?.dispatchEvent(new CustomEvent("row-reorder",{detail:{fromIndex:this.dragSourceIndex,toIndex:t},bubbles:!0,composed:!0})),this.dragSourceIndex=-1}))}createDragHandle(){const e=document.createElement("td");return e.className="drag-handle-cell",e.textContent="⠗",e.setAttribute("aria-label","Drag to reorder"),e}showDropIndicator(e){this.removeDropIndicator(),this.dropIndicator=document.createElement("div"),this.dropIndicator.className="drop-indicator";const t=e.getBoundingClientRect(),i=e.parentElement?.getBoundingClientRect();if(i){const a=this.dropTargetIndex>this.dragSourceIndex?t.bottom-i.top:t.top-i.top;this.dropIndicator.style.top=`${a}px`,e.parentElement.style.position="relative",e.parentElement.appendChild(this.dropIndicator)}}removeDropIndicator(){this.dropIndicator?.remove(),this.dropIndicator=null}}class E{constructor(){this.enabled=!1,this.tableElement=null,this.dragSourceKey=null}attach(e){this.tableElement=e,this.enabled=!0}isEnabled(){return this.enabled}makeHeaderDraggable(e,t,i=!0){i&&(e.draggable=!0,e.addEventListener("dragstart",i=>{this.dragSourceKey=t,e.style.opacity="0.5",i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",t)}),e.addEventListener("dragend",()=>{e.style.opacity="1",this.dragSourceKey=null}),e.addEventListener("dragover",i=>{this.dragSourceKey&&this.dragSourceKey!==t&&(i.preventDefault(),i.dataTransfer.dropEffect="move",e.style.borderLeft="2px solid var(--snice-color-primary, rgb(37 99 235))")}),e.addEventListener("dragleave",()=>{e.style.borderLeft=""}),e.addEventListener("drop",i=>{i.preventDefault(),e.style.borderLeft="",this.dragSourceKey&&this.dragSourceKey!==t&&this.tableElement?.dispatchEvent(new CustomEvent("column-reorder",{detail:{fromKey:this.dragSourceKey,toKey:t},bubbles:!0,composed:!0})),this.dragSourceKey=null}))}}let D=(()=>{let e,s,n,l,r,o,h,u,p,m,k,D,z,$,A,F,T,L,M,R,j,O,B,I,P,H,V,N,q,_,W,K,Y,U,G,J,X,Z,Q,ee,te,ie,ae,se,ne,le,re,oe,ce,de,he,ue,pe,me,ge,be,ve,fe,ye,we,ke,xe,Se,Ce=[t.element("snice-table")],Ee=[],De=HTMLElement,ze=[],$e=[],Ae=[],Fe=[],Te=[],Le=[],Me=[],Re=[],je=[],Oe=[],Be=[],Ie=[],Pe=[],He=[],Ve=[],Ne=[],qe=[],_e=[],We=[],Ke=[],Ye=[],Ue=[],Ge=[],Je=[],Xe=[],Ze=[],Qe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],pt=[],mt=[],gt=[],bt=[],vt=[],ft=[],yt=[],wt=[],kt=[],xt=[],St=[],Ct=[],Et=[],Dt=[],zt=[],$t=[],At=[],Ft=[],Tt=[],Lt=[],Mt=[],Rt=[],jt=[],Ot=[],Bt=[],It=[],Pt=[],Ht=[],Vt=[],Nt=[],qt=[],_t=[],Wt=[],Kt=[],Yt=[],Ut=[],Gt=[];return class extends De{static{s=this}constructor(){super(...arguments),this.striped=(a(this,ze),a(this,$e,!1)),this.searchable=(a(this,Ae),a(this,Fe,!1)),this.filterable=(a(this,Te),a(this,Le,!1)),this.sortable=(a(this,Me),a(this,Re,!1)),this.selectable=(a(this,je),a(this,Oe,!1)),this.hoverable=(a(this,Be),a(this,Ie,!0)),this.clickable=(a(this,Pe),a(this,He,!1)),this.list=(a(this,Ve),a(this,Ne,!1)),this.pagination=(a(this,qe),a(this,_e,!1)),this.paginationMode=(a(this,We),a(this,Ke,"client")),this.pageSize=(a(this,Ye),a(this,Ue,10)),this.currentPage=(a(this,Ge),a(this,Je,1)),this.totalItems=(a(this,Xe),a(this,Ze,0)),this.pageSizes=(a(this,Qe),a(this,et,[10,25,50,100])),this.searchDebounce=(a(this,tt),a(this,it,500)),this.columns=(a(this,at),[]),this.data=[],this.mode=a(this,st,"local"),this.currentSort=(a(this,nt),a(this,lt,[])),this.searchText=(a(this,rt),""),this.selector=a(this,ot,""),this.selectorOptions=(a(this,ct),a(this,dt,[])),this.loading=(a(this,ht),a(this,ut,!1)),this.virtualize=(a(this,pt),a(this,mt,!1)),this.rowHeight=(a(this,gt),a(this,bt,48)),this.virtualBuffer=(a(this,vt),a(this,ft,200)),this.columnResize=(a(this,yt),a(this,wt,!1)),this.editable=(a(this,kt),a(this,xt,!1)),this.editMode=(a(this,St),a(this,Ct,"cell")),this.density=(a(this,Et),a(this,Dt,"standard")),this.headerFilters=(a(this,zt),a(this,$t,!1)),this.quickFilter=(a(this,At),a(this,Ft,!1)),this.rowReorder=(a(this,Tt),a(this,Lt,!1)),this.columnReorder=(a(this,Mt),a(this,Rt,!1)),this.columnMenu=(a(this,jt),a(this,Ot,!1)),this.lazyLoad=(a(this,Bt),a(this,It,!1)),this.lazyLoadThreshold=(a(this,Pt),a(this,Ht,200)),this.selectedRows=(a(this,Vt),a(this,Nt,[])),this.virtualizer=(a(this,qt),new c),this.columnManager=new d,this.filterEngine=new g,this.editor=new b,this.keyboard=new v,this.exporter=new f,this.masterDetail=new y,this.toolbar=new w,this.treeData=new x,this.columnMenuManager=new S,this.rowDnD=new C,this.columnDnD=new E,this.pinnedTopRows=[],this.pinnedBottomRows=[],this.lazyLoadHandler=null,this.rowHeightCallback=null,this.table=a(this,_t,void 0),this.thead=(a(this,Wt),a(this,Kt,void 0)),this.tbody=(a(this,Yt),a(this,Ut,void 0)),this.unsortedData=(a(this,Gt),[]),this.dataRequestTimeout=null,this.fsExitHandler=null,this.toggleFullscreen=async()=>{if(this.classList.contains("table-fullscreen")){if(this.classList.remove("table-fullscreen"),document.fullscreenElement===this)try{await document.exitFullscreen()}catch{}this.fsExitHandler&&(document.removeEventListener("fullscreenchange",this.fsExitHandler),this.fsExitHandler=null)}else{this.classList.add("table-fullscreen");try{"function"==typeof this.requestFullscreen&&await this.requestFullscreen()}catch{}this.fsExitHandler=()=>{document.fullscreenElement!==this&&(this.classList.remove("table-fullscreen"),this.fsExitHandler&&(document.removeEventListener("fullscreenchange",this.fsExitHandler),this.fsExitHandler=null))},document.addEventListener("fullscreenchange",this.fsExitHandler)}},this.handleClick=e=>{const t=e.target,i=t.closest("th.sortable");if(i){const e=i.getAttribute("data-key");return void(e&&this.toggleSort(e,!0))}const a=t.closest("tbody tr");if(a){if(t.matches('input[type="checkbox"], button, a, .interactive, snice-checkbox, snice-button, snice-input, snice-select'))return;const e=parseInt(a.getAttribute("data-index")||"0"),i=this.data[e];if(this.selectable){const t=this.selectedRows.includes(e);this.selectedRows=t?this.selectedRows.filter(t=>t!==e):[...this.selectedRows,e],this.updateRowSelectionState(),this.updateSelectAllState(),this.dispatchRowSelectionChanged(e,!t)}this.clickable&&this.dispatchEvent(new CustomEvent("row-clicked",{detail:{rowData:i,rowIndex:e}}))}},this.handleChange=e=>{const t=e.target;if(t.matches("snice-checkbox.row-select")){const e=t,i=parseInt(e.getAttribute("data-row-index")||"0");return e.checked?this.selectedRows.includes(i)||(this.selectedRows=[...this.selectedRows,i]):this.selectedRows=this.selectedRows.filter(e=>e!==i),this.updateRowSelectionState(),this.updateSelectAllState(),void this.dispatchRowSelectionChanged(i,e.checked)}if(t.matches("snice-checkbox.select-all")){const e=t;if(e.checked){const e=this.getFilteredData();this.selectedRows=e.map(e=>this.data.indexOf(e))}else this.selectedRows=[];this.updateRowSelectionState(),this.dispatchSelectAllChanged(e.checked)}},this.onAttached=()=>{"remote"===this.mode&&(this.getTableConfig(),this.getTableData())},this.searchDebounceTimeout=null,this.handleSearchInput=e=>{const t=e.target;this.searchText=t.value,this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},this.searchDebounce)},this.selectorDebounceTimeout=null,this.handleSelectorChange=e=>{this.selector=Array.isArray(e.detail.value)?e.detail.value.join(","):e.detail.value,this.selectorDebounceTimeout&&clearTimeout(this.selectorDebounceTimeout),this.selectorDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},150)},this.selectabilityCheck=null,this.listViewRenderer=null}static{const c="function"==typeof Symbol&&Symbol.metadata?Object.create(De[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean,attribute:"striped"})],l=[t.property({type:Boolean,attribute:"searchable"})],r=[t.property({type:Boolean,attribute:"filterable"})],o=[t.property({type:Boolean,attribute:"sortable"})],h=[t.property({type:Boolean,attribute:"selectable"})],u=[t.property({type:Boolean,attribute:"hoverable"})],p=[t.property({type:Boolean,attribute:"clickable"})],m=[t.property({type:Boolean,attribute:"list"})],k=[t.property({type:Boolean,attribute:"pagination"})],D=[t.property({attribute:"pagination-mode"})],z=[t.property({type:Number,attribute:"page-size"})],$=[t.property({type:Number,attribute:"current-page"})],A=[t.property({type:Number,attribute:"total-items"})],F=[t.property({type:Array,attribute:!1})],T=[t.property({type:Number,attribute:"search-debounce"})],L=[t.property()],M=[t.property({type:Array,attribute:!1})],R=[t.property({type:String,attribute:"selector"})],j=[t.property({type:Array,attribute:!1})],O=[t.property({type:Boolean,attribute:"loading"})],B=[t.property({type:Boolean,attribute:"virtualize"})],I=[t.property({type:Number,attribute:"row-height"})],P=[t.property({type:Number,attribute:"virtual-buffer"})],H=[t.property({type:Boolean,attribute:"column-resize"})],V=[t.property({type:Boolean,attribute:"editable"})],N=[t.property({attribute:"edit-mode"})],q=[t.property({attribute:"density"})],_=[t.property({type:Boolean,attribute:"header-filters"})],W=[t.property({type:Boolean,attribute:"quick-filter"})],K=[t.property({type:Boolean,attribute:"row-reorder"})],Y=[t.property({type:Boolean,attribute:"column-reorder"})],U=[t.property({type:Boolean,attribute:"column-menu"})],G=[t.property({type:Boolean,attribute:"lazy-load"})],J=[t.property({type:Number,attribute:"lazy-load-threshold"})],X=[t.property({type:Array,attribute:!1})],Z=[t.query("table")],Q=[t.query("thead")],ee=[t.query("tbody")],te=[t.request("table/config")],ie=[t.request("table/data")],ae=[t.styles()],se=[t.render()],ne=[t.ready()],le=[t.watch("selectorOptions")],re=[t.watch("sortable")],oe=[t.watch("selectable")],ce=[t.watch("columns")],de=[t.watch("data","loading")],he=[t.watch("selectedRows")],ue=[t.watch("currentSort")],pe=[t.watch("searchable","filterable")],me=[t.dispatch("page-change",{bubbles:!0,composed:!0})],ge=[t.dispatch("table-row-selection-changed",{bubbles:!0,composed:!0})],be=[t.dispatch("table-select-all-changed",{bubbles:!0,composed:!0})],ve=[t.dispatch("sort-change",{bubbles:!0,composed:!0})],fe=[t.dispatch("filter-change",{bubbles:!0,composed:!0})],ye=[t.dispatch("column-visibility-change",{bubbles:!0,composed:!0})],we=[t.dispatch("column-pin-change",{bubbles:!0,composed:!0})],ke=[t.dispatch("column-order-change",{bubbles:!0,composed:!0})],xe=[t.dispatch("density-change",{bubbles:!0,composed:!0})],Se=[t.dispose()],i(this,null,te,{kind:"method",name:"getTableConfig",static:!1,private:!1,access:{has:e=>"getTableConfig"in e,get:e=>e.getTableConfig},metadata:c},null,ze),i(this,null,ie,{kind:"method",name:"getTableData",static:!1,private:!1,access:{has:e=>"getTableData"in e,get:e=>e.getTableData},metadata:c},null,ze),i(this,null,ae,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:c},null,ze),i(this,null,se,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:c},null,ze),i(this,null,ne,{kind:"method",name:"initialize",static:!1,private:!1,access:{has:e=>"initialize"in e,get:e=>e.initialize},metadata:c},null,ze),i(this,null,le,{kind:"method",name:"handleSelectorOptionsChange",static:!1,private:!1,access:{has:e=>"handleSelectorOptionsChange"in e,get:e=>e.handleSelectorOptionsChange},metadata:c},null,ze),i(this,null,re,{kind:"method",name:"handleSortableChange",static:!1,private:!1,access:{has:e=>"handleSortableChange"in e,get:e=>e.handleSortableChange},metadata:c},null,ze),i(this,null,oe,{kind:"method",name:"handleSelectableChange",static:!1,private:!1,access:{has:e=>"handleSelectableChange"in e,get:e=>e.handleSelectableChange},metadata:c},null,ze),i(this,null,ce,{kind:"method",name:"handleColumnsChange",static:!1,private:!1,access:{has:e=>"handleColumnsChange"in e,get:e=>e.handleColumnsChange},metadata:c},null,ze),i(this,null,de,{kind:"method",name:"handleDataChange",static:!1,private:!1,access:{has:e=>"handleDataChange"in e,get:e=>e.handleDataChange},metadata:c},null,ze),i(this,null,he,{kind:"method",name:"handleSelectedRowsChange",static:!1,private:!1,access:{has:e=>"handleSelectedRowsChange"in e,get:e=>e.handleSelectedRowsChange},metadata:c},null,ze),i(this,null,ue,{kind:"method",name:"handleSortChange",static:!1,private:!1,access:{has:e=>"handleSortChange"in e,get:e=>e.handleSortChange},metadata:c},null,ze),i(this,null,pe,{kind:"method",name:"handleControlsChange",static:!1,private:!1,access:{has:e=>"handleControlsChange"in e,get:e=>e.handleControlsChange},metadata:c},null,ze),i(this,null,me,{kind:"method",name:"dispatchPageChange",static:!1,private:!1,access:{has:e=>"dispatchPageChange"in e,get:e=>e.dispatchPageChange},metadata:c},null,ze),i(this,null,ge,{kind:"method",name:"dispatchRowSelectionChanged",static:!1,private:!1,access:{has:e=>"dispatchRowSelectionChanged"in e,get:e=>e.dispatchRowSelectionChanged},metadata:c},null,ze),i(this,null,be,{kind:"method",name:"dispatchSelectAllChanged",static:!1,private:!1,access:{has:e=>"dispatchSelectAllChanged"in e,get:e=>e.dispatchSelectAllChanged},metadata:c},null,ze),i(this,null,ve,{kind:"method",name:"dispatchSortChange",static:!1,private:!1,access:{has:e=>"dispatchSortChange"in e,get:e=>e.dispatchSortChange},metadata:c},null,ze),i(this,null,fe,{kind:"method",name:"dispatchFilterChange",static:!1,private:!1,access:{has:e=>"dispatchFilterChange"in e,get:e=>e.dispatchFilterChange},metadata:c},null,ze),i(this,null,ye,{kind:"method",name:"dispatchColumnVisibilityChange",static:!1,private:!1,access:{has:e=>"dispatchColumnVisibilityChange"in e,get:e=>e.dispatchColumnVisibilityChange},metadata:c},null,ze),i(this,null,we,{kind:"method",name:"dispatchColumnPinChange",static:!1,private:!1,access:{has:e=>"dispatchColumnPinChange"in e,get:e=>e.dispatchColumnPinChange},metadata:c},null,ze),i(this,null,ke,{kind:"method",name:"dispatchColumnOrderChange",static:!1,private:!1,access:{has:e=>"dispatchColumnOrderChange"in e,get:e=>e.dispatchColumnOrderChange},metadata:c},null,ze),i(this,null,xe,{kind:"method",name:"dispatchDensityChange",static:!1,private:!1,access:{has:e=>"dispatchDensityChange"in e,get:e=>e.dispatchDensityChange},metadata:c},null,ze),i(this,null,Se,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:c},null,ze),i(null,null,n,{kind:"field",name:"striped",static:!1,private:!1,access:{has:e=>"striped"in e,get:e=>e.striped,set:(e,t)=>{e.striped=t}},metadata:c},$e,Ae),i(null,null,l,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:c},Fe,Te),i(null,null,r,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:e=>"filterable"in e,get:e=>e.filterable,set:(e,t)=>{e.filterable=t}},metadata:c},Le,Me),i(null,null,o,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:c},Re,je),i(null,null,h,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:c},Oe,Be),i(null,null,u,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:e=>"hoverable"in e,get:e=>e.hoverable,set:(e,t)=>{e.hoverable=t}},metadata:c},Ie,Pe),i(null,null,p,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:e=>"clickable"in e,get:e=>e.clickable,set:(e,t)=>{e.clickable=t}},metadata:c},He,Ve),i(null,null,m,{kind:"field",name:"list",static:!1,private:!1,access:{has:e=>"list"in e,get:e=>e.list,set:(e,t)=>{e.list=t}},metadata:c},Ne,qe),i(null,null,k,{kind:"field",name:"pagination",static:!1,private:!1,access:{has:e=>"pagination"in e,get:e=>e.pagination,set:(e,t)=>{e.pagination=t}},metadata:c},_e,We),i(null,null,D,{kind:"field",name:"paginationMode",static:!1,private:!1,access:{has:e=>"paginationMode"in e,get:e=>e.paginationMode,set:(e,t)=>{e.paginationMode=t}},metadata:c},Ke,Ye),i(null,null,z,{kind:"field",name:"pageSize",static:!1,private:!1,access:{has:e=>"pageSize"in e,get:e=>e.pageSize,set:(e,t)=>{e.pageSize=t}},metadata:c},Ue,Ge),i(null,null,$,{kind:"field",name:"currentPage",static:!1,private:!1,access:{has:e=>"currentPage"in e,get:e=>e.currentPage,set:(e,t)=>{e.currentPage=t}},metadata:c},Je,Xe),i(null,null,A,{kind:"field",name:"totalItems",static:!1,private:!1,access:{has:e=>"totalItems"in e,get:e=>e.totalItems,set:(e,t)=>{e.totalItems=t}},metadata:c},Ze,Qe),i(null,null,F,{kind:"field",name:"pageSizes",static:!1,private:!1,access:{has:e=>"pageSizes"in e,get:e=>e.pageSizes,set:(e,t)=>{e.pageSizes=t}},metadata:c},et,tt),i(null,null,T,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:e=>"searchDebounce"in e,get:e=>e.searchDebounce,set:(e,t)=>{e.searchDebounce=t}},metadata:c},it,at),i(null,null,L,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,t)=>{e.mode=t}},metadata:c},st,nt),i(null,null,M,{kind:"field",name:"currentSort",static:!1,private:!1,access:{has:e=>"currentSort"in e,get:e=>e.currentSort,set:(e,t)=>{e.currentSort=t}},metadata:c},lt,rt),i(null,null,R,{kind:"field",name:"selector",static:!1,private:!1,access:{has:e=>"selector"in e,get:e=>e.selector,set:(e,t)=>{e.selector=t}},metadata:c},ot,ct),i(null,null,j,{kind:"field",name:"selectorOptions",static:!1,private:!1,access:{has:e=>"selectorOptions"in e,get:e=>e.selectorOptions,set:(e,t)=>{e.selectorOptions=t}},metadata:c},dt,ht),i(null,null,O,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:c},ut,pt),i(null,null,B,{kind:"field",name:"virtualize",static:!1,private:!1,access:{has:e=>"virtualize"in e,get:e=>e.virtualize,set:(e,t)=>{e.virtualize=t}},metadata:c},mt,gt),i(null,null,I,{kind:"field",name:"rowHeight",static:!1,private:!1,access:{has:e=>"rowHeight"in e,get:e=>e.rowHeight,set:(e,t)=>{e.rowHeight=t}},metadata:c},bt,vt),i(null,null,P,{kind:"field",name:"virtualBuffer",static:!1,private:!1,access:{has:e=>"virtualBuffer"in e,get:e=>e.virtualBuffer,set:(e,t)=>{e.virtualBuffer=t}},metadata:c},ft,yt),i(null,null,H,{kind:"field",name:"columnResize",static:!1,private:!1,access:{has:e=>"columnResize"in e,get:e=>e.columnResize,set:(e,t)=>{e.columnResize=t}},metadata:c},wt,kt),i(null,null,V,{kind:"field",name:"editable",static:!1,private:!1,access:{has:e=>"editable"in e,get:e=>e.editable,set:(e,t)=>{e.editable=t}},metadata:c},xt,St),i(null,null,N,{kind:"field",name:"editMode",static:!1,private:!1,access:{has:e=>"editMode"in e,get:e=>e.editMode,set:(e,t)=>{e.editMode=t}},metadata:c},Ct,Et),i(null,null,q,{kind:"field",name:"density",static:!1,private:!1,access:{has:e=>"density"in e,get:e=>e.density,set:(e,t)=>{e.density=t}},metadata:c},Dt,zt),i(null,null,_,{kind:"field",name:"headerFilters",static:!1,private:!1,access:{has:e=>"headerFilters"in e,get:e=>e.headerFilters,set:(e,t)=>{e.headerFilters=t}},metadata:c},$t,At),i(null,null,W,{kind:"field",name:"quickFilter",static:!1,private:!1,access:{has:e=>"quickFilter"in e,get:e=>e.quickFilter,set:(e,t)=>{e.quickFilter=t}},metadata:c},Ft,Tt),i(null,null,K,{kind:"field",name:"rowReorder",static:!1,private:!1,access:{has:e=>"rowReorder"in e,get:e=>e.rowReorder,set:(e,t)=>{e.rowReorder=t}},metadata:c},Lt,Mt),i(null,null,Y,{kind:"field",name:"columnReorder",static:!1,private:!1,access:{has:e=>"columnReorder"in e,get:e=>e.columnReorder,set:(e,t)=>{e.columnReorder=t}},metadata:c},Rt,jt),i(null,null,U,{kind:"field",name:"columnMenu",static:!1,private:!1,access:{has:e=>"columnMenu"in e,get:e=>e.columnMenu,set:(e,t)=>{e.columnMenu=t}},metadata:c},Ot,Bt),i(null,null,G,{kind:"field",name:"lazyLoad",static:!1,private:!1,access:{has:e=>"lazyLoad"in e,get:e=>e.lazyLoad,set:(e,t)=>{e.lazyLoad=t}},metadata:c},It,Pt),i(null,null,J,{kind:"field",name:"lazyLoadThreshold",static:!1,private:!1,access:{has:e=>"lazyLoadThreshold"in e,get:e=>e.lazyLoadThreshold,set:(e,t)=>{e.lazyLoadThreshold=t}},metadata:c},Ht,Vt),i(null,null,X,{kind:"field",name:"selectedRows",static:!1,private:!1,access:{has:e=>"selectedRows"in e,get:e=>e.selectedRows,set:(e,t)=>{e.selectedRows=t}},metadata:c},Nt,qt),i(null,null,Z,{kind:"field",name:"table",static:!1,private:!1,access:{has:e=>"table"in e,get:e=>e.table,set:(e,t)=>{e.table=t}},metadata:c},_t,Wt),i(null,null,Q,{kind:"field",name:"thead",static:!1,private:!1,access:{has:e=>"thead"in e,get:e=>e.thead,set:(e,t)=>{e.thead=t}},metadata:c},Kt,Yt),i(null,null,ee,{kind:"field",name:"tbody",static:!1,private:!1,access:{has:e=>"tbody"in e,get:e=>e.tbody,set:(e,t)=>{e.tbody=t}},metadata:c},Ut,Gt),i(null,e={value:s},Ce,{kind:"class",name:s.name,metadata:c},null,Ee),s=e.value,c&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c}),a(s,Ee)}setData(e){this.unsortedData=[...e],this.data=e,this.render()}setColumns(e){this.columns=e,this.render()}async*getTableConfig(){const e=await(yield{});return this.columns=e.columns||[],this.selectorOptions=e.selectorOptions||[],await new Promise(e=>requestAnimationFrame(e)),this.renderHeader(),this.renderControls(),e}async*getTableData(){this.loading=!0,this.selectedRows=[];try{const e={search:this.searchText,sort:this.currentSort,filter:this.filterEngine.getFilterModel(),selector:this.selector};this.pagination&&(e.page=this.currentPage,e.pageSize=this.pageSize);const t=await(yield e);return this.data=t.data||[],void 0!==t.totalItems&&(this.totalItems=t.totalItems),this.loading=!1,await new Promise(e=>requestAnimationFrame(e)),this.renderBody(),t}catch(e){console.error("Error loading table data:",e),this.loading=!1}}debouncedDataRequest(){this.loading||(this.loading=!0),this.dataRequestTimeout&&clearTimeout(this.dataRequestTimeout),this.dataRequestTimeout=setTimeout(()=>{this.getTableData(),this.dataRequestTimeout=null},150)}styles(){return t.css`
|
|
579
|
+
`}getCellComponent(e){switch(e){case"text":return"snice-cell-text";case"number":case"accounting":case"scientific":case"fraction":return"snice-cell-number";case"date":return"snice-cell-date";case"boolean":return"snice-cell-boolean";case"sparkline":return"snice-cell-sparkline";case"rating":return"snice-cell-rating";case"progress":return"snice-cell-progress";case"duration":return"snice-cell-duration";case"filesize":return"snice-cell-filesize";case"link":case"url":return"snice-cell-link";case"actions":return"snice-cell-actions";case"tag":case"tags":case"badge":case"badges":return"snice-cell-tag";case"image":case"avatar":case"thumbnail":return"snice-cell-image";case"email":return"snice-cell-email";case"phone":case"tel":case"telephone":return"snice-cell-phone";case"status":return"snice-cell-status";case"color":return"snice-cell-color";case"json":case"object":return"snice-cell-json";case"currency":case"money":return"snice-cell-currency";case"percent":case"percentage":return"snice-cell-percentage";case"location":case"address":case"coordinates":return"snice-cell-location";default:return"snice-cell"}}getCellStyles(e){let t=[];return e.width&&(t.push(`width: ${e.width}`),t.push(`min-width: ${e.width}`),t.push(`max-width: ${e.width}`)),e.align&&t.push(`text-align: ${e.align}`),t.join("; ")}escapeHtml(e){if(null==e)return"";const t=String(e),i=document.createElement("div");return i.textContent=t,i.innerHTML}toggleSelection(){this.selected=!this.selected,this.dispatchRowSelect()}dispatchRowClick(){return{data:this.data,index:this.index,element:this}}dispatchRowSelect(){return{selected:this.selected,data:this.data,index:this.index,element:this}}dispatchRowHover(){return{data:this.data,index:this.index,element:this}}select(){this.selected=!0,this.dispatchRowSelect()}deselect(){this.selected=!1,this.dispatchRowSelect()}focusRow(){super.focus(),this.scrollIntoView({behavior:"smooth",block:"nearest"})}getCellValue(e){return this.data[e]}setCellValue(e,t){this.data={...this.data,[e]:t},this.updateCells()}getCellElement(e){const t=this.columns.find(t=>t.key===e);if(!t)return null;const i=this.columns.indexOf(t);return this.shadowRoot?.querySelector(`[data-column-index="${i}"]`)||null}highlight(e=2e3){this.classList.add("row--highlighted"),setTimeout(()=>{this.classList.remove("row--highlighted")},e)}constructor(){super(...arguments),this.selected=(a(this,C),a(this,E,!1)),this.hoverable=(a(this,D),a(this,z,!0)),this.clickable=(a(this,$),a(this,A,!1)),this.selectable=(a(this,F),a(this,T,!1)),this.data=(a(this,L),a(this,M,{})),this.index=(a(this,R),a(this,j,0)),this.columns=(a(this,O),a(this,B,[])),a(this,I)}})})();class c{constructor(){this.rafId=0,this.lastStartIndex=-1,this.lastEndIndex=-1,this.enabled=!1,this.topSpacer=document.createElement("tr"),this.topSpacer.className="virtual-spacer virtual-spacer--top",this.topSpacer.style.display="table-row",this.bottomSpacer=document.createElement("tr"),this.bottomSpacer.className="virtual-spacer virtual-spacer--bottom",this.bottomSpacer.style.display="table-row",this.contentContainer=document.createElement("tbody"),this.options={},this.scrollHandler=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>this.update())}}attach(e){this.options=e,this.enabled=!0,this.options.scrollContainer.addEventListener("scroll",this.scrollHandler,{passive:!0}),window.addEventListener("resize",this.scrollHandler,{passive:!0}),this.update()}detach(){this.enabled=!1,this.options.scrollContainer?.removeEventListener("scroll",this.scrollHandler),window.removeEventListener("resize",this.scrollHandler),cancelAnimationFrame(this.rafId)}setTotalRows(e){this.options.totalRows=e,this.lastStartIndex=-1,this.update()}refresh(){this.lastStartIndex=-1,this.lastEndIndex=-1,this.update()}update(){if(!this.enabled||!this.options.scrollContainer)return;const{rowHeight:e,bufferPx:t,totalRows:i,scrollContainer:a,renderRange:s}=this.options,n=a.scrollTop,l=a.clientHeight,r=i*e,o=Math.max(0,n-t),c=Math.min(r,n+l+t),d=Math.floor(o/e),h=Math.min(i,Math.ceil(c/e));if(d===this.lastStartIndex&&h===this.lastEndIndex)return;this.lastStartIndex=d,this.lastEndIndex=h;const u=d*e,p=Math.max(0,(i-h)*e);this.topSpacer.style.height=`${u}px`,this.bottomSpacer.style.height=`${p}px`;const m=s(d,h),g=this.options.scrollContainer.querySelector("tbody");if(g){if(g.innerHTML="",u>0){const e=document.createElement("td");e.colSpan=999,e.style.height=`${u}px`,e.style.padding="0",e.style.border="none",this.topSpacer.innerHTML="",this.topSpacer.appendChild(e),g.appendChild(this.topSpacer)}if(g.appendChild(m),p>0){const e=document.createElement("td");e.colSpan=999,e.style.height=`${p}px`,e.style.padding="0",e.style.border="none",this.bottomSpacer.innerHTML="",this.bottomSpacer.appendChild(e),g.appendChild(this.bottomSpacer)}}}getVisibleRange(){return{start:this.lastStartIndex,end:this.lastEndIndex}}scrollToRow(e){if(!this.options.scrollContainer)return;const t=e*this.options.rowHeight;this.options.scrollContainer.scrollTop=t}getScrollPosition(){const e=this.options.scrollContainer;return{top:e?.scrollTop??0,left:e?.scrollLeft??0}}isEnabled(){return this.enabled}}class d{constructor(){this.states=new Map,this.groups=[],this.resizeStartX=0,this.resizeStartWidth=0,this.resizingKey=null,this.resizeOverlay=null,this.tableElement=null}initialize(e,t){this.tableElement=t,e.forEach((e,t)=>{const i=this.states.get(e.key);this.states.set(e.key,{key:e.key,width:i?.width??this.parseWidth(e.width)??150,flex:e.flex,minWidth:e.minWidth??50,maxWidth:e.maxWidth??1/0,visible:i?.visible??!0,pinned:i?.pinned??(e.pinned||!1),order:i?.order??t,resizable:!1!==e.resizable,reorderable:!1!==e.reorderable,hideable:!1!==e.hideable,pinnable:!1!==e.pinnable})})}parseWidth(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}getVisibleColumns(){return Array.from(this.states.values()).filter(e=>e.visible).sort((e,t)=>e.order-t.order)}getAllStates(){return Array.from(this.states.values()).sort((e,t)=>e.order-t.order)}getPinnedLeft(){return this.getVisibleColumns().filter(e=>"left"===e.pinned)}getPinnedRight(){return this.getVisibleColumns().filter(e=>"right"===e.pinned)}getUnpinned(){return this.getVisibleColumns().filter(e=>!e.pinned)}computeFlexWidths(e){const t=this.getVisibleColumns(),i=new Map;let a=0;const s=[];for(const e of t)e.flex&&e.flex>0?s.push(e):(a+=e.width,i.set(e.key,e.width));const n=Math.max(0,e-a),l=s.reduce((e,t)=>e+(t.flex||1),0);for(const e of s){const t=(e.flex||1)/l*n,a=Math.max(e.minWidth,Math.min(e.maxWidth,t));i.set(e.key,a)}return i}applyWidths(e,t){e.querySelectorAll("th[data-key]").forEach(e=>{const i=e.getAttribute("data-key");i&&t.has(i)&&(e.style.width=`${t.get(i)}px`)})}startResize(e,t){const i=this.states.get(e);if(!i||!i.resizable)return;this.resizingKey=e,this.resizeStartX=t,this.resizeStartWidth=i.width,this.resizeOverlay=document.createElement("div"),this.resizeOverlay.style.cssText="position:fixed;inset:0;z-index:99999;cursor:col-resize;",document.body.appendChild(this.resizeOverlay);const a=t=>{t.preventDefault();const a=t.clientX-this.resizeStartX,s=Math.max(i.minWidth,Math.min(i.maxWidth,this.resizeStartWidth+a));i.width=s,i.flex=void 0;const n=this.tableElement?.shadowRoot;if(n){const t=n.querySelector(`th[data-key="${e}"]`);t&&(t.style.width=`${s}px`);n.querySelectorAll(`td[data-key="${e}"]`).forEach(e=>e.style.width=`${s}px`)}this.tableElement?.dispatchEvent(new CustomEvent("column-resize",{detail:{key:e,width:s},bubbles:!0,composed:!0}))},s=()=>{this.resizingKey=null,this.resizeOverlay?.remove(),this.resizeOverlay=null,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),this.tableElement?.dispatchEvent(new CustomEvent("column-resize-end",{detail:{key:e,width:i.width},bubbles:!0,composed:!0}))};document.addEventListener("mousemove",a),document.addEventListener("mouseup",s)}autoSizeColumn(e,t){const i=this.states.get(e);if(!i)return;const a=this.tableElement?.shadowRoot?.querySelector(`th[data-key="${e}"]`);let s=a?a.scrollWidth:0;t.querySelectorAll(`td[data-key="${e}"]`).forEach(e=>{s=Math.max(s,e.scrollWidth)}),i.width=Math.max(i.minWidth,Math.min(i.maxWidth,s+16)),i.flex=void 0}autoSizeAll(e){for(const t of this.states.keys())this.autoSizeColumn(t,e)}setColumnVisible(e,t){const i=this.states.get(e);i&&i.hideable&&(i.visible=t)}showAllColumns(){for(const e of this.states.values())e.visible=!0}hideAllColumns(){for(const e of this.states.values())e.hideable&&(e.visible=!1)}getVisibilityModel(){const e={};for(const[t,i]of this.states)e[t]=i.visible;return e}moveColumn(e,t){const i=this.states.get(e);if(!i||!i.reorderable||i.pinned)return;const a=this.getVisibleColumns(),s=a.findIndex(t=>t.key===e);-1!==s&&s!==t&&(a.splice(s,1),a.splice(t,0,i),a.forEach((e,t)=>{e.order=t}))}pinColumn(e,t){const i=this.states.get(e);i&&i.pinnable&&(i.pinned=t)}unpinColumn(e){const t=this.states.get(e);t&&(t.pinned=!1)}setColumnGroups(e){this.groups=e}getColumnGroups(){return this.groups}renderGroupHeaders(){return 0===this.groups.length?"":this.groups.map(e=>{const t=e.children.filter(e=>this.states.get(e)?.visible).length;return 0===t?"":`<th colspan="${t}" class="column-group-header ${e.headerClass||""}">${e.label}</th>`}).join("")}isResizing(){return null!==this.resizingKey}getState(e){return this.states.get(e)}getPinnedLeftOffsets(){const e=new Map;let t=0;for(const i of this.getPinnedLeft())e.set(i.key,t),t+=i.width;return e}getPinnedRightOffsets(){const e=new Map,t=this.getPinnedRight();let i=0;for(let a=t.length-1;a>=0;a--)e.set(t[a].key,i),i+=t[a].width;return e}}const h=[{value:"contains",label:"contains",requiresValue:!0},{value:"notContains",label:"does not contain",requiresValue:!0},{value:"equals",label:"equals",requiresValue:!0},{value:"notEquals",label:"does not equal",requiresValue:!0},{value:"startsWith",label:"starts with",requiresValue:!0},{value:"endsWith",label:"ends with",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],u=[{value:"eq",label:"=",requiresValue:!0},{value:"neq",label:"≠",requiresValue:!0},{value:"gt",label:">",requiresValue:!0},{value:"gte",label:"≥",requiresValue:!0},{value:"lt",label:"<",requiresValue:!0},{value:"lte",label:"≤",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],p=[{value:"is",label:"is",requiresValue:!0},{value:"isNot",label:"is not",requiresValue:!0},{value:"before",label:"before",requiresValue:!0},{value:"onOrBefore",label:"on or before",requiresValue:!0},{value:"after",label:"after",requiresValue:!0},{value:"onOrAfter",label:"on or after",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],m=[{value:"isTrue",label:"is true",requiresValue:!1},{value:"isFalse",label:"is false",requiresValue:!1}];class g{constructor(){this.model={filters:[],logic:"and"},this.headerFilters=new Map}getOperatorsForType(e){switch(e){case"number":case"currency":case"rating":case"progress":case"filesize":case"duration":case"percent":case"percentage":return u;case"date":return p;case"boolean":return m;default:return h}}setFilterModel(e){this.model=e}getFilterModel(){return{...this.model}}setColumnFilter(e,t,i){const a=this.model.filters.findIndex(t=>t.column===e);a>=0?this.model.filters[a]={column:e,operator:t,value:i}:this.model.filters.push({column:e,operator:t,value:i})}removeColumnFilter(e){this.model.filters=this.model.filters.filter(t=>t.column!==e)}clearAllFilters(){this.model.filters=[],this.model.quickFilter=void 0,this.model.logic="and",this.headerFilters.clear()}setQuickFilter(e){this.model.quickFilter=e||void 0}setHeaderFilter(e,t){t?this.headerFilters.set(e,t):this.headerFilters.delete(e)}getHeaderFilter(e){return this.headerFilters.get(e)||""}setFilterLogic(e){this.model.logic=e}hasActiveFilters(){return this.model.filters.length>0||!!this.model.quickFilter||this.headerFilters.size>0}hasColumnFilter(e){return this.model.filters.some(t=>t.column===e)||this.headerFilters.has(e)}getActiveFilterCount(){return this.model.filters.length+this.headerFilters.size+(this.model.quickFilter?1:0)}applyFilters(e,t){let i=e;this.model.filters.length>0&&(i=i.filter(e=>{const t=this.model.filters.map(t=>this.evaluateFilter(t,e));return"and"===this.model.logic?t.every(Boolean):t.some(Boolean)}));for(const[e,t]of this.headerFilters){const a=t.toLowerCase();i=i.filter(t=>{const i=t[e];return null!=i&&String(i).toLowerCase().includes(a)})}if(this.model.quickFilter){const e=this.model.quickFilter.toLowerCase().split(/\s+/).filter(Boolean),a=t.map(e=>e.key),s=this.model.quickFilterLogic||"and";i=i.filter(t=>{const i=e=>a.some(i=>{const a=t[i];return null!=a&&String(a).toLowerCase().includes(e)});return"and"===s?e.every(i):e.some(i)})}return i}evaluateFilter(e,t){const i=t[e.column],a=e.value;switch(e.operator){case"contains":return null!=i&&String(i).toLowerCase().includes(String(a).toLowerCase());case"notContains":return null==i||!String(i).toLowerCase().includes(String(a).toLowerCase());case"equals":return String(i??"").toLowerCase()===String(a).toLowerCase();case"notEquals":return String(i??"").toLowerCase()!==String(a).toLowerCase();case"startsWith":return null!=i&&String(i).toLowerCase().startsWith(String(a).toLowerCase());case"endsWith":return null!=i&&String(i).toLowerCase().endsWith(String(a).toLowerCase());case"isEmpty":return null==i||""===i;case"isNotEmpty":return null!=i&&""!==i;case"eq":return Number(i)===Number(a);case"neq":return Number(i)!==Number(a);case"gt":return Number(i)>Number(a);case"gte":return Number(i)>=Number(a);case"lt":return Number(i)<Number(a);case"lte":return Number(i)<=Number(a);case"is":return new Date(i).toDateString()===new Date(a).toDateString();case"isNot":return new Date(i).toDateString()!==new Date(a).toDateString();case"before":return new Date(i)<new Date(a);case"onOrBefore":return new Date(i)<=new Date(a);case"after":return new Date(i)>new Date(a);case"onOrAfter":return new Date(i)>=new Date(a);case"isTrue":return!0===i||"true"===i||1===i;case"isFalse":return!1===i||"false"===i||0===i||null==i;default:return!0}}toServerParams(){return{filters:this.model.filters,filterLogic:this.model.logic,quickFilter:this.model.quickFilter,headerFilters:Object.fromEntries(this.headerFilters)}}}class b{constructor(){this.cellState=null,this.rowState=null,this.pipelines=new Map,this.validators=new Map,this.editableColumns=new Set,this.editabilityCheck=null,this.tableElement=null,this.mode="cell"}attach(e){this.tableElement=e}setEditableColumns(e){this.editableColumns=new Set(e)}setEditabilityCheck(e){this.editabilityCheck=e}setEditMode(e){this.mode=e}setPipeline(e,t){this.pipelines.set(e,t)}setValidation(e,t){this.validators.set(e,t)}isCellEditable(e,t){return!!this.editableColumns.has(t)&&(!this.editabilityCheck||this.editabilityCheck(e,t))}getDisplayValue(e,t,i){const a=this.pipelines.get(e);let s=t;return a?.valueGetter&&(s=a.valueGetter(s,i)),a?.valueFormatter?a.valueFormatter(s,i):null==s?"":String(s)}getSortValue(e,t,i){const a=this.pipelines.get(e);return a?.valueGetter?a.valueGetter(t,i):t}getEditorType(e){switch(e){case"number":case"currency":case"rating":case"progress":return"number";case"date":return"date";case"boolean":return"boolean";default:return"text"}}startCellEdit(e,t,i,a){return this.isCellEditable(a,t)?(this.cellState?.isEditing&&this.cancelCellEdit(),this.cellState={rowIndex:e,columnKey:t,originalValue:i,currentValue:i,editorType:this.getEditorType(t),error:null,isEditing:!0},this.cellState):null}updateCellValue(e){this.cellState&&(this.cellState.currentValue=e,this.cellState.error=null)}async commitCellEdit(){if(!this.cellState?.isEditing)return null;const{columnKey:e,currentValue:t,rowIndex:i}=this.cellState,a=this.pipelines.get(e);let s=t;a?.valueParser&&(s=a.valueParser(String(t),{}));const n=this.validators.get(e);if(n){const e=await n.validate(s,{});if(e)return this.cellState.error=e,e}return a?.valueSetter&&(s=a.valueSetter(s,{})),this.tableElement?.dispatchEvent(new CustomEvent("cell-edit-commit",{detail:{rowIndex:i,columnKey:e,oldValue:this.cellState.originalValue,newValue:s},bubbles:!0,composed:!0})),this.cellState.isEditing=!1,this.cellState=null,null}cancelCellEdit(){this.cellState?.isEditing&&(this.tableElement?.dispatchEvent(new CustomEvent("cell-edit-cancel",{detail:{rowIndex:this.cellState.rowIndex,columnKey:this.cellState.columnKey},bubbles:!0,composed:!0})),this.cellState.isEditing=!1,this.cellState=null)}getCellEditState(){return this.cellState}startRowEdit(e,t){return this.rowState?.isEditing&&this.cancelRowEdit(),this.rowState={rowIndex:e,originalRow:{...t},editedRow:{...t},errors:new Map,isEditing:!0},this.rowState}updateRowField(e,t){this.rowState&&(this.rowState.editedRow[e]=t,this.rowState.errors.delete(e))}async commitRowEdit(){if(!this.rowState?.isEditing)return null;const e=new Map;for(const t of this.editableColumns){const i=this.validators.get(t);if(i){const a=this.rowState.editedRow[t],s=await i.validate(a,this.rowState.editedRow);s&&e.set(t,s)}}if(e.size>0)return this.rowState.errors=e,e;const t={...this.rowState.editedRow};for(const[e,i]of this.pipelines)i.valueSetter&&e in t&&(t[e]=i.valueSetter(t[e],t));return this.tableElement?.dispatchEvent(new CustomEvent("row-edit-commit",{detail:{rowIndex:this.rowState.rowIndex,oldRow:this.rowState.originalRow,newRow:t},bubbles:!0,composed:!0})),this.rowState.isEditing=!1,this.rowState=null,null}cancelRowEdit(){this.rowState?.isEditing&&(this.tableElement?.dispatchEvent(new CustomEvent("row-edit-cancel",{detail:{rowIndex:this.rowState.rowIndex},bubbles:!0,composed:!0})),this.rowState.isEditing=!1,this.rowState=null)}getRowEditState(){return this.rowState}isEditing(){return(this.cellState?.isEditing||this.rowState?.isEditing)??!1}createEditor(e,t,i){switch(e){case"number":{const e=document.createElement("input");return e.type="number",e.value=null==t?"":String(t),e.className="table-editor-input",e}case"date":{const e=document.createElement("input");return e.type="date",e.value=t||"",e.className="table-editor-input",e}case"boolean":{const e=document.createElement("input");return e.type="checkbox",e.checked=!!t,e.className="table-editor-checkbox",e}case"select":{const e=document.createElement("select");return e.className="table-editor-select",(i?.selectOptions||[]).forEach(i=>{const a=document.createElement("option");a.value=i.value,a.textContent=i.label,i.value===String(t)&&(a.selected=!0),e.appendChild(a)}),e}default:{const e=document.createElement("input");return e.type="text",e.value=null==t?"":String(t),e.className="table-editor-input",e}}}}class v{constructor(){this.focusedRow=-1,this.focusedCol=0,this.attached=!1,this.options={},this.keyHandler=e=>this.handleKeyDown(e)}attach(e){this.options=e;const t=this.getTable();t&&(t.setAttribute("role","grid"),t.setAttribute("tabindex","0"),t.addEventListener("keydown",this.keyHandler),this.attached=!0,this.applyARIA())}detach(){const e=this.getTable();e&&e.removeEventListener("keydown",this.keyHandler),this.attached=!1}getTable(){return this.options.shadowRoot?.querySelector("table")??null}applyARIA(){const e=this.getTable();if(!e)return;e.setAttribute("aria-rowcount",String(this.options.totalRows+1)),e.setAttribute("aria-colcount",String(this.options.totalColumns));const t=e.querySelector("thead tr");if(t){t.setAttribute("role","row"),t.setAttribute("aria-rowindex","1");t.querySelectorAll("th").forEach((e,t)=>{if(e.setAttribute("role","columnheader"),e.setAttribute("aria-colindex",String(t+1)),e.classList.contains("sortable")){const t=e.querySelector(".sort-indicator.active");if(t){const i=t.textContent?.trim()||"";i.includes("▲")?e.setAttribute("aria-sort","ascending"):i.includes("▼")&&e.setAttribute("aria-sort","descending")}else e.setAttribute("aria-sort","none")}})}e.querySelectorAll("tbody tr:not(.virtual-spacer)").forEach((e,t)=>{e.setAttribute("role","row"),e.setAttribute("aria-rowindex",String(t+2));"true"===e.getAttribute("data-selected")?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected");e.querySelectorAll("td").forEach((e,t)=>{e.setAttribute("role","gridcell"),e.setAttribute("aria-colindex",String(t+1))})}),this.updateFocusIndicator()}setFocus(e,t){this.focusedRow=e,this.focusedCol=t,this.updateFocusIndicator()}getFocus(){return{row:this.focusedRow,col:this.focusedCol}}updateFocusIndicator(){const e=this.getTable();if(!e)return;e.querySelectorAll("[data-grid-focus]").forEach(e=>{e.removeAttribute("data-grid-focus"),e.removeAttribute("tabindex")});let t=null;if(-1===this.focusedRow){t=e.querySelectorAll("thead th")[this.focusedCol]}else{const i=e.querySelectorAll("tbody tr:not(.virtual-spacer)")[this.focusedRow];if(i){t=i.querySelectorAll("td")[this.focusedCol]}}t&&(t.setAttribute("data-grid-focus","true"),t.setAttribute("tabindex","0"))}handleKeyDown(e){if(this.options.isEditing())return;const{totalRows:t,totalColumns:i}=this.options;switch(e.key){case"ArrowDown":e.preventDefault(),this.focusedRow=Math.min(t-1,this.focusedRow+1),this.updateFocusIndicator(),this.scrollIntoView();break;case"ArrowUp":e.preventDefault(),this.focusedRow=Math.max(-1,this.focusedRow-1),this.updateFocusIndicator(),this.scrollIntoView();break;case"ArrowRight":e.preventDefault(),this.focusedCol=Math.min(i-1,this.focusedCol+1),this.updateFocusIndicator();break;case"ArrowLeft":e.preventDefault(),this.focusedCol=Math.max(0,this.focusedCol-1),this.updateFocusIndicator();break;case"Home":e.preventDefault(),e.ctrlKey?(this.focusedRow=-1,this.focusedCol=0):this.focusedCol=0,this.updateFocusIndicator(),this.scrollIntoView();break;case"End":e.preventDefault(),e.ctrlKey?(this.focusedRow=t-1,this.focusedCol=i-1):this.focusedCol=i-1,this.updateFocusIndicator(),this.scrollIntoView();break;case"PageDown":e.preventDefault(),this.focusedRow=Math.min(t-1,this.focusedRow+10),this.updateFocusIndicator(),this.scrollIntoView();break;case"PageUp":e.preventDefault(),this.focusedRow=Math.max(0,this.focusedRow-10),this.updateFocusIndicator(),this.scrollIntoView();break;case" ":this.focusedRow>=0&&(e.preventDefault(),e.shiftKey&&this.options.onSelectionToggle?.(this.focusedRow));break;case"Enter":if(this.focusedRow>=0&&this.focusedCol>=0){e.preventDefault();const t=this.getTable(),i=t?.querySelectorAll("tbody tr:not(.virtual-spacer)"),a=i?.[this.focusedRow],s=a?.querySelectorAll("td"),n=s?.[this.focusedCol],l=n?.getAttribute("data-key")||"";this.options.onCellActivate?.(this.focusedRow,l)}break;case"a":(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.options.onSelectAll?.())}}scrollIntoView(){const e=this.getTable();if(!e)return;const t=e.querySelector("[data-grid-focus]");t&&(t.scrollIntoView({block:"nearest",inline:"nearest"}),t.focus({preventScroll:!0}))}isAttached(){return this.attached}}class f{exportCSV(e,t,i={}){const{delimiter:a=",",filename:s="export.csv",includeHeaders:n=!0,columns:l,utf8BOM:r=!0}=i;let o=t.filter(e=>!1!==e.exportable);l&&(o=o.filter(e=>l.includes(e.key)));const c=[];n&&c.push(o.map(e=>this.escapeCSV(e.label,a)).join(a));for(const t of e){const e=o.map(e=>{const i=t[e.key];return this.escapeCSV(null==i?"":String(i),a)});c.push(e.join(a))}const d=c.join("\n"),h=new Blob([(r?"\ufeff":"")+d],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(h),p=document.createElement("a");p.href=u,p.download=s,p.style.display="none",document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(u)}print(e,t={}){const{hideFooter:i=!1,hideToolbar:a=!1,pageStyles:s=""}=t,n=window.open("","_blank");if(!n)return;const l=e.shadowRoot;if(!l)return;const r=l.querySelector("table");if(!r)return;const o=`\n <!DOCTYPE html>\n <html>\n <head>\n <title>Print</title>\n <style>\n body { font-family: system-ui, -apple-system, sans-serif; margin: 1rem; }\n table { width: 100%; border-collapse: collapse; }\n th, td { padding: 8px 12px; border: 1px solid #ddd; text-align: left; }\n th { background: #f5f5f5; font-weight: 600; }\n ${i?".pagination { display: none; }":""}\n ${a?".table-controls { display: none; }":""}\n @media print {\n body { margin: 0; }\n table { page-break-inside: auto; }\n tr { page-break-inside: avoid; }\n }\n ${s}\n </style>\n </head>\n <body>\n ${r.outerHTML}\n </body>\n </html>\n `;n.document.write(o),n.document.close(),n.onload=()=>{n.print(),n.close()}}async copyToClipboard(e,t,i,a={}){const{delimiter:s="\t"}=a,n=i.length>0?i.map(t=>e[t]).filter(Boolean):e;if(0===n.length)return!1;const l=n.map(e=>t.map(t=>{const i=e[t.key];return null==i?"":String(i)}).join(s)).join("\n");try{return await navigator.clipboard.writeText(l),!0}catch{const e=document.createElement("textarea");e.value=l,e.style.cssText="position:fixed;left:-9999px;",document.body.appendChild(e),e.select();const t=document.execCommand("copy");return document.body.removeChild(e),t}}escapeCSV(e,t){return e.includes(t)||e.includes('"')||e.includes("\n")||e.includes("\r")?`"${e.replace(/"/g,'""')}"`:e}}class y{constructor(){this.expandedRows=new Set,this.options=null,this.tableElement=null}attach(e,t){this.tableElement=e,this.options=t}isExpanded(e){return this.expandedRows.has(e)}toggle(e){this.expandedRows.has(e)?this.collapse(e):this.expand(e)}expand(e){this.expandedRows.add(e),this.tableElement?.dispatchEvent(new CustomEvent("row-expand",{detail:{rowIndex:e},bubbles:!0,composed:!0}))}collapse(e){this.expandedRows.delete(e),this.tableElement?.dispatchEvent(new CustomEvent("row-collapse",{detail:{rowIndex:e},bubbles:!0,composed:!0}))}expandAll(e){for(let t=0;t<e;t++)this.expandedRows.add(t)}collapseAll(){this.expandedRows.clear()}getExpandedRows(){return new Set(this.expandedRows)}createToggleButton(e){const t=this.isExpanded(e),i=document.createElement("button");return i.type="button",i.className="detail-toggle"+(t?" detail-toggle--expanded":""),i.setAttribute("aria-expanded",String(t)),i.setAttribute("aria-label",t?"Collapse row":"Expand row"),i.innerHTML='<svg class="detail-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.addEventListener("click",t=>{t.stopPropagation(),this.toggle(e),this.tableElement?.dispatchEvent(new CustomEvent("detail-toggle",{detail:{rowIndex:e,expanded:this.isExpanded(e)},bubbles:!0,composed:!0}))}),i}createDetailRow(e,t,i){if(!this.options||!this.isExpanded(t))return null;const a=document.createElement("tr");a.className="detail-row",a.setAttribute("data-detail-for",String(t));const s=document.createElement("td");s.colSpan=i,s.className="detail-cell",s.style.padding="0",s.style.border="none";const n=document.createElement("div");n.className="detail-content";const l=document.createElement("div");l.className="detail-content-inner";const r=this.options.getDetailContent(e,t);return"string"==typeof r?l.innerHTML=r:r instanceof HTMLElement&&l.appendChild(r),n.appendChild(l),s.appendChild(n),requestAnimationFrame(()=>{const e=l.scrollHeight;n.style.setProperty("--detail-max-height",`${e}px`),n.classList.add("detail-content--open")}),a.appendChild(s),a}isEnabled(){return null!==this.options}}class w{constructor(){this.container=null,this.options={},this.tableElement=null,this.filterEngine=null,this.filterPanel=null,this.filterPanelOpen=!1,this.filters=[],this.logic="and",this.pendingDebounces=[],this.onSearch=null,this.onSortColumn=null,this.onSetSortModel=null,this.onFilterColumn=null,this.onRemoveFilter=null,this.onClearFilters=null,this.onSetFilterModel=null,this.onExportCSV=null,this.onFullscreen=null}attach(e,t,i={}){this.tableElement=e,this.container=t,this.options=i,this.render()}setFilterEngine(e){this.filterEngine=e}render(){if(!this.container)return;this.container.innerHTML="";const e=document.createElement("div");e.className="tt-wrap",e.appendChild(this.styleTag());const t=document.createElement("div");if(t.className="table-toolbar",t.setAttribute("part","toolbar"),!1!==this.options.showSearch){const e=document.createElement("snice-input");let i;e.type="search",e.placeholder=this.options.searchPlaceholder||"Search...",e.size="small",e.prefixIcon="search",e.clearable=!0,e.className="toolbar-search",e.addEventListener("input",()=>{clearTimeout(i),i=window.setTimeout(()=>this.onSearch?.(e.value),300)}),t.appendChild(e)}const i=document.createElement("div");if(i.className="toolbar-actions",this.options.showExport){const e=this.mkBtn("Export CSV",'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"/></svg>');e.addEventListener("click",()=>this.onExportCSV?.()),i.appendChild(e)}const a=this.mkBtn("Fullscreen",'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"/></svg>');a.addEventListener("click",()=>this.onFullscreen?.()),i.appendChild(a),t.appendChild(i),e.appendChild(t),this.filterPanel=document.createElement("div"),this.filterPanel.className="tt-filter-panel",this.filterPanel.hidden=!this.filterPanelOpen,e.appendChild(this.filterPanel),this.container.appendChild(e)}openFilterModal(e){const t=this.ensureEngine();if(!this.filterPanelOpen){const e=t.getFilterModel();this.filters=e.filters.map(e=>({...e})),this.logic=e.logic||"and"}if(e){const i=(this.tableElement?.columns||[]).find(t=>t.key===e),a=t.getOperatorsForType(i?.type||"text");i&&a[0]&&!this.filters.some(t=>t.column===e)&&this.filters.push({column:e,operator:a[0].value,value:""})}this.filterPanelOpen||(this.filterPanelOpen=!0,this.filterPanel&&(this.filterPanel.hidden=!1)),this.renderFilterPanel()}closeFilterPanel(){this.cancelPendingDebounces(),this.filterPanelOpen=!1,this.filterPanel&&(this.filterPanel.hidden=!0)}ensureEngine(){return this.filterEngine||(this.filterEngine=new g),this.filterEngine}cancelPendingDebounces(){for(const e of this.pendingDebounces)clearTimeout(e);this.pendingDebounces=[]}renderFilterPanel(){if(!this.filterPanel)return;this.cancelPendingDebounces();const e=this.ensureEngine(),t=this.tableElement?.columns||[];if(0===this.filters.length){const t=e.getFilterModel();this.filters=[...t.filters],this.logic=t.logic||"and"}this.filterPanel.innerHTML="",this.filterPanel.appendChild(this.styleTag());const i=document.createElement("div");i.className="tt-filter-inner";const a=document.createElement("button");a.type="button",a.className="tt-filter-corner-close",a.setAttribute("aria-label","Close filter panel"),a.setAttribute("title","Close"),a.innerHTML=n,a.addEventListener("click",()=>this.closeFilterPanel()),i.appendChild(a);const s=document.createElement("div");s.className="tt-filter-rows",i.appendChild(s);const l=()=>{const i=this.filters.filter(i=>{const a=t.find(e=>e.key===i.column),s=a?.type||"text",n=e.getOperatorsForType(s).find(e=>e.value===i.operator);return!!n&&(!1===n.requiresValue||null!==i.value&&""!==i.value)});this.onSetFilterModel?.(i,this.logic)},r=(i,a)=>{const s=document.createElement("div");s.className="tt-filter-row";const r=document.createElement("button");r.type="button",r.className="tt-filter-x",r.setAttribute("aria-label","Remove filter"),r.innerHTML=n,r.addEventListener("click",()=>{this.filters.splice(a,1),0===this.filters.length?this.onClearFilters?.():l(),this.renderFilterPanel()}),s.appendChild(r);const o=document.createElement("snice-select");o.size="small",o.searchable=t.length>8,o.maxHeight="200px",o.options=t.map(e=>({value:e.key,label:e.label||e.key})),o.value=i.column,o.style.width="11rem",s.appendChild(o);const c=document.createElement("snice-select");c.size="small",c.maxHeight="200px",c.style.width="8rem",s.appendChild(c);const d=document.createElement("span");d.className="tt-filter-val-wrap";const h=document.createElement("snice-input");h.size="small",h.placeholder="Value",h.style.width="11rem",null!=i.value&&(h.value=String(i.value)),d.appendChild(h),s.appendChild(d);const u=()=>{const a=t.find(e=>e.key===o.value),s=a?.type||"text",n=e.getOperatorsForType(s);c.options=n.map(e=>({value:e.value,label:e.label})),n.some(e=>e.value===i.operator)?c.value=i.operator:c.value="",h.type=(e=>{switch(e){case"number":case"currency":case"rating":case"progress":case"filesize":case"duration":case"percent":case"percentage":return"number";case"date":return"date";default:return"text"}})(s),p()},p=()=>{const i=t.find(e=>e.key===o.value),a=i?.type||"text",s=e.getOperatorsForType(a).find(e=>e.value===c.value);d.style.display=!1===s?.requiresValue?"none":""};let m;return o.addEventListener("change",()=>{i.column=o.value,u(),l()}),c.addEventListener("change",()=>{i.operator=c.value,p(),l()}),h.addEventListener("input",()=>{clearTimeout(m),m=window.setTimeout(()=>{this.pendingDebounces=this.pendingDebounces.filter(e=>e!==m),i.value=h.value,l()},250),this.pendingDebounces.push(m)}),h.addEventListener("keydown",e=>{"Enter"===e.key&&(i.value=h.value,l())}),u(),s};if(this.filters.length>1){const e=document.createElement("div");e.className="tt-filter-logicbar";const t=document.createElement("span");t.className="tt-filter-logicbar-label",t.textContent="Match";const a=document.createElement("snice-select");a.size="small",a.options=[{value:"and",label:"All filters (AND)"},{value:"or",label:"Any filter (OR)"}],a.value=this.logic,a.style.width="11rem",a.addEventListener("change",()=>{this.logic=a.value,l()}),e.appendChild(t),e.appendChild(a),i.insertBefore(e,s)}if(0===this.filters.length){const e=document.createElement("div");e.className="tt-filter-empty",e.textContent="No filters applied",s.appendChild(e)}else this.filters.forEach((e,t)=>s.appendChild(r(e,t)));const o=document.createElement("div");o.className="tt-filter-footer";const c=document.createElement("button");if(c.type="button",c.className="tt-filter-add",c.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4.5v15m7.5-7.5h-15"/></svg><span>Add filter</span>',c.addEventListener("click",()=>{const i=t[0];if(!i)return;const a=e.getOperatorsForType(i.type||"text");a[0]&&(this.filters.push({column:i.key,operator:a[0].value,value:""}),this.renderFilterPanel())}),o.appendChild(c),this.filters.length>0){const e=document.createElement("button");e.type="button",e.className="tt-filter-clear",e.textContent="Clear all",e.addEventListener("click",()=>{this.cancelPendingDebounces(),this.filters=[],this.logic="and",this.onClearFilters?.(),this.renderFilterPanel()}),o.appendChild(e)}i.appendChild(o),this.filterPanel.appendChild(i)}mkBtn(e,t){const i=document.createElement("button");return i.className="toolbar-btn",i.setAttribute("aria-label",e),i.setAttribute("title",e),i.innerHTML=t,i}styleTag(){const e=document.createElement("style");return e.textContent=k,e}setActiveFilterCount(e){}isAttached(){return null!==this.container}}const k="\n .tt-wrap { display: flex; flex-direction: column; }\n\n .tt-filter-panel {\n border-bottom: 1px solid var(--snice-color-border, rgb(226 226 226));\n background: var(--snice-color-surface-container-low, rgb(250 250 250));\n }\n .tt-filter-inner {\n padding: 0.75rem 0.875rem;\n padding-right: 2.5rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n position: relative;\n }\n .tt-filter-corner-close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n width: 1.75rem;\n height: 1.75rem;\n border: none;\n background: none;\n cursor: pointer;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n border-radius: var(--snice-border-radius-md, 0.25rem);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n line-height: 0;\n z-index: 1;\n }\n .tt-filter-corner-close:hover {\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n color: var(--snice-color-text, rgb(23 23 23));\n }\n .tt-filter-corner-close svg {\n width: 1rem;\n height: 1rem;\n }\n .tt-filter-logicbar {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n .tt-filter-logicbar-label {\n font-size: 0.75rem;\n font-weight: 500;\n color: var(--snice-color-text-secondary, rgb(82 82 82));\n flex: 0 0 auto;\n }\n .tt-filter-rows {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n }\n .tt-filter-empty {\n padding: 0.625rem 0.5rem;\n font-size: 0.8125rem;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n font-style: italic;\n }\n .tt-filter-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-wrap: nowrap;\n }\n .tt-filter-x {\n border: none;\n background: none;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n cursor: pointer;\n border-radius: var(--snice-border-radius-md, 0.25rem);\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n line-height: 0;\n }\n .tt-filter-x svg {\n width: 1rem;\n height: 1rem;\n }\n .tt-filter-x:hover {\n color: var(--snice-color-danger, rgb(220 38 38));\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n }\n .tt-filter-val-wrap { display: inline-flex; flex: 1 1 auto; min-width: 0; }\n .tt-filter-val-wrap snice-input { width: 100%; }\n .tt-filter-footer {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n margin-top: 0.125rem;\n }\n .tt-filter-add,\n .tt-filter-clear {\n border: none;\n background: none;\n font-family: inherit;\n font-size: 0.8125rem;\n cursor: pointer;\n padding: 0.375rem 0.625rem;\n border-radius: var(--snice-border-radius-md, 0.25rem);\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n line-height: 1;\n }\n .tt-filter-add svg,\n .tt-filter-clear svg {\n width: 0.875rem;\n height: 0.875rem;\n }\n .tt-filter-add { color: var(--snice-color-primary, rgb(37 99 235)); font-weight: 500; }\n .tt-filter-add:hover { background: var(--snice-color-primary-subtle, rgb(219 234 254 / 0.4)); }\n .tt-filter-clear { color: var(--snice-color-text-tertiary, rgb(115 115 115)); margin-left: auto; }\n .tt-filter-clear:hover {\n color: var(--snice-color-danger, rgb(220 38 38));\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n }\n";class x{constructor(){this.options=null,this.expandedKeys=new Set,this.flatRows=[],this.enabled=!1,this.defaultDepth=0}attach(e){this.options=e,this.enabled=!0,void 0!==e.defaultExpansionDepth&&e.defaultExpansionDepth>=0&&(this.defaultDepth=e.defaultExpansionDepth)}isEnabled(){return this.enabled}processData(e){if(!this.options)return[];const t=new Map;for(const i of e){const e=this.options.getPath(i),a=e.join("/");t.set(a,{data:i,children:new Set,depth:e.length-1,isGap:!1});for(let i=1;i<e.length;i++){const a=e.slice(0,i),s=a.join("/");t.has(s)||t.set(s,{data:{[this.options.groupColumn||"name"]:a[a.length-1]},children:new Set,depth:i-1,isGap:!0})}if(e.length>1){const i=e.slice(0,-1).join("/"),s=t.get(i);s&&s.children.add(a)}}const i=[];for(const[e,a]of t)0===a.depth&&i.push(e);if(i.sort(),0===this.expandedKeys.size&&this.defaultDepth>0)for(const[e,i]of t)i.depth<this.defaultDepth&&i.children.size>0&&this.expandedKeys.add(e);this.flatRows=[];const a=e=>{const i=t.get(e);if(!i)return;const s=i.children.size>0,n=this.expandedKeys.has(e);if(this.flatRows.push({path:e.split("/"),data:i.data,depth:i.depth,hasChildren:s,expanded:n,key:e,isGap:i.isGap}),n){const e=Array.from(i.children).sort();for(const t of e)a(t)}};for(const e of i)a(e);return this.flatRows}getFlatRows(){return this.flatRows}toggle(e){this.expandedKeys.has(e)?this.expandedKeys.delete(e):this.expandedKeys.add(e)}expand(e){this.expandedKeys.add(e)}collapse(e){this.expandedKeys.delete(e)}expandAll(e){if(this.options)for(const t of e){const e=this.options.getPath(t);for(let t=1;t<=e.length;t++)this.expandedKeys.add(e.slice(0,t).join("/"))}}collapseAll(){this.expandedKeys.clear()}isExpanded(e){return this.expandedKeys.has(e)}createToggle(e){const t=document.createElement("span");if(t.className="tree-indent",t.style.paddingLeft=1.5*e.depth+"rem",e.hasChildren){const i=document.createElement("button");i.type="button",i.className="tree-toggle"+(e.expanded?" tree-toggle--expanded":""),i.innerHTML='<svg class="tree-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.setAttribute("aria-expanded",String(e.expanded)),i.addEventListener("click",t=>{t.stopPropagation(),this.toggle(e.key),i.dispatchEvent(new CustomEvent("tree-toggle",{detail:{key:e.key,expanded:this.isExpanded(e.key)},bubbles:!0,composed:!0}))}),t.appendChild(i)}else{const e=document.createElement("span");e.className="tree-spacer",t.appendChild(e)}return t}getGroupColumn(){return this.options?.groupColumn||""}}class S{constructor(){this.menuEl=null,this.activeColumn=null,this.tableElement=null,this.outsideClickHandler=null,this.onSortAsc=null,this.onSortDesc=null,this.onFilter=null,this.onHide=null,this.onPinLeft=null,this.onPinRight=null,this.onUnpin=null,this.onAutoSize=null}attach(e){this.tableElement=e}show(e,t,i,a){this.hide(),this.activeColumn=e;const s=document.createElement("div");s.className="table-column-menu",s.style.left=`${t}px`,s.style.top=`${i}px`;const r=[];!1!==a?.sortable&&(r.push({label:"Sort Ascending",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19.5v-15m0 0-6.75 6.75M12 4.5l6.75 6.75"/></svg>',action:"sort-asc"}),r.push({label:"Sort Descending",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4.5v15m0 0 6.75-6.75M12 19.5l-6.75-6.75"/></svg>',action:"sort-desc"}),r.push({label:"",action:"",separator:!0})),!1!==a?.filterable&&r.push({label:"Filter...",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"/></svg>',action:"filter"}),!1!==a?.hideable&&r.push({label:"Hide Column",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"/></svg>',action:"hide"}),!1!==a?.pinnable&&(a?.pinned?r.push({label:"Unpin",icon:n,action:"unpin"}):(r.push({label:"Pin Left",icon:l,action:"pin-left"}),r.push({label:"Pin Right",icon:l,action:"pin-right"}))),r.push({label:"",action:"",separator:!0}),r.push({label:"Auto-size",icon:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"/></svg>',action:"autosize"});for(const e of r){if(e.separator){const e=document.createElement("div");e.className="column-menu-separator",s.appendChild(e);continue}const t=document.createElement("button");t.type="button",t.className="column-menu-item",t.innerHTML=`${e.icon?`<span class="column-menu-icon">${e.icon}</span>`:""}<span>${e.label}</span>`,t.addEventListener("click",()=>{this.handleAction(e.action),this.hide()}),e.disabled&&(t.disabled=!0),s.appendChild(t)}const o=this.tableElement?.shadowRoot;o?o.appendChild(s):document.body.appendChild(s),this.menuEl=s,setTimeout(()=>{this.outsideClickHandler=e=>{e.composedPath().includes(s)||this.hide()},document.addEventListener("click",this.outsideClickHandler,{capture:!0})},0);const c=e=>{"Escape"===e.key&&(this.hide(),document.removeEventListener("keydown",c))};document.addEventListener("keydown",c)}handleAction(e){if(this.activeColumn)switch(e){case"sort-asc":this.onSortAsc?.(this.activeColumn);break;case"sort-desc":this.onSortDesc?.(this.activeColumn);break;case"filter":this.onFilter?.(this.activeColumn);break;case"hide":this.onHide?.(this.activeColumn);break;case"pin-left":this.onPinLeft?.(this.activeColumn);break;case"pin-right":this.onPinRight?.(this.activeColumn);break;case"unpin":this.onUnpin?.(this.activeColumn);break;case"autosize":this.onAutoSize?.(this.activeColumn)}}hide(){this.menuEl&&(this.menuEl.remove(),this.menuEl=null),this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,{capture:!0}),this.outsideClickHandler=null),this.activeColumn=null}isOpen(){return null!==this.menuEl}}class C{constructor(){this.enabled=!1,this.tableElement=null,this.dragSourceIndex=-1,this.dropTargetIndex=-1,this.dropIndicator=null}attach(e){this.tableElement=e,this.enabled=!0}isEnabled(){return this.enabled}makeRowDraggable(e,t,i=!0){i&&(e.draggable=!0,e.addEventListener("dragstart",i=>{this.dragSourceIndex=t,e.style.opacity="0.5",i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",String(t))}),e.addEventListener("dragend",()=>{e.style.opacity="1",this.removeDropIndicator(),this.dragSourceIndex=-1}),e.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",this.dropTargetIndex=t,this.showDropIndicator(e)}),e.addEventListener("dragleave",()=>{this.removeDropIndicator()}),e.addEventListener("drop",e=>{e.preventDefault(),this.removeDropIndicator(),-1!==this.dragSourceIndex&&this.dragSourceIndex!==t&&this.tableElement?.dispatchEvent(new CustomEvent("row-reorder",{detail:{fromIndex:this.dragSourceIndex,toIndex:t},bubbles:!0,composed:!0})),this.dragSourceIndex=-1}))}createDragHandle(){const e=document.createElement("td");return e.className="drag-handle-cell",e.textContent="⠗",e.setAttribute("aria-label","Drag to reorder"),e}showDropIndicator(e){this.removeDropIndicator(),this.dropIndicator=document.createElement("div"),this.dropIndicator.className="drop-indicator";const t=e.getBoundingClientRect(),i=e.parentElement?.getBoundingClientRect();if(i){const a=this.dropTargetIndex>this.dragSourceIndex?t.bottom-i.top:t.top-i.top;this.dropIndicator.style.top=`${a}px`,e.parentElement.style.position="relative",e.parentElement.appendChild(this.dropIndicator)}}removeDropIndicator(){this.dropIndicator?.remove(),this.dropIndicator=null}}class E{constructor(){this.enabled=!1,this.tableElement=null,this.dragSourceKey=null}attach(e){this.tableElement=e,this.enabled=!0}isEnabled(){return this.enabled}makeHeaderDraggable(e,t,i=!0){i&&(e.draggable=!0,e.addEventListener("dragstart",i=>{this.dragSourceKey=t,e.style.opacity="0.5",i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",t)}),e.addEventListener("dragend",()=>{e.style.opacity="1",this.dragSourceKey=null}),e.addEventListener("dragover",i=>{this.dragSourceKey&&this.dragSourceKey!==t&&(i.preventDefault(),i.dataTransfer.dropEffect="move",e.style.borderLeft="2px solid var(--snice-color-primary, rgb(37 99 235))")}),e.addEventListener("dragleave",()=>{e.style.borderLeft=""}),e.addEventListener("drop",i=>{i.preventDefault(),e.style.borderLeft="",this.dragSourceKey&&this.dragSourceKey!==t&&this.tableElement?.dispatchEvent(new CustomEvent("column-reorder",{detail:{fromKey:this.dragSourceKey,toKey:t},bubbles:!0,composed:!0})),this.dragSourceKey=null}))}}let D=(()=>{let e,s,n,l,r,o,h,u,p,m,k,D,z,$,A,F,T,L,M,R,j,O,B,I,P,H,V,N,_,q,W,K,Y,U,G,J,X,Z,Q,ee,te,ie,ae,se,ne,le,re,oe,ce,de,he,ue,pe,me,ge,be,ve,fe,ye,we,ke,xe,Se,Ce=[t.element("snice-table")],Ee=[],De=HTMLElement,ze=[],$e=[],Ae=[],Fe=[],Te=[],Le=[],Me=[],Re=[],je=[],Oe=[],Be=[],Ie=[],Pe=[],He=[],Ve=[],Ne=[],_e=[],qe=[],We=[],Ke=[],Ye=[],Ue=[],Ge=[],Je=[],Xe=[],Ze=[],Qe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],pt=[],mt=[],gt=[],bt=[],vt=[],ft=[],yt=[],wt=[],kt=[],xt=[],St=[],Ct=[],Et=[],Dt=[],zt=[],$t=[],At=[],Ft=[],Tt=[],Lt=[],Mt=[],Rt=[],jt=[],Ot=[],Bt=[],It=[],Pt=[],Ht=[],Vt=[],Nt=[],_t=[],qt=[],Wt=[],Kt=[],Yt=[],Ut=[],Gt=[];return class extends De{static{s=this}constructor(){super(...arguments),this.striped=(a(this,ze),a(this,$e,!1)),this.searchable=(a(this,Ae),a(this,Fe,!1)),this.filterable=(a(this,Te),a(this,Le,!1)),this.sortable=(a(this,Me),a(this,Re,!1)),this.selectable=(a(this,je),a(this,Oe,!1)),this.hoverable=(a(this,Be),a(this,Ie,!0)),this.clickable=(a(this,Pe),a(this,He,!1)),this.list=(a(this,Ve),a(this,Ne,!1)),this.pagination=(a(this,_e),a(this,qe,!1)),this.paginationMode=(a(this,We),a(this,Ke,"client")),this.pageSize=(a(this,Ye),a(this,Ue,10)),this.currentPage=(a(this,Ge),a(this,Je,1)),this.totalItems=(a(this,Xe),a(this,Ze,0)),this.pageSizes=(a(this,Qe),a(this,et,[10,25,50,100])),this.searchDebounce=(a(this,tt),a(this,it,500)),this.columns=(a(this,at),[]),this.data=[],this.mode=a(this,st,"local"),this.currentSort=(a(this,nt),a(this,lt,[])),this.searchText=(a(this,rt),""),this.selector=a(this,ot,""),this.selectorOptions=(a(this,ct),a(this,dt,[])),this.loading=(a(this,ht),a(this,ut,!1)),this.virtualize=(a(this,pt),a(this,mt,!1)),this.rowHeight=(a(this,gt),a(this,bt,48)),this.virtualBuffer=(a(this,vt),a(this,ft,200)),this.columnResize=(a(this,yt),a(this,wt,!1)),this.editable=(a(this,kt),a(this,xt,!1)),this.editMode=(a(this,St),a(this,Ct,"cell")),this.density=(a(this,Et),a(this,Dt,"standard")),this.headerFilters=(a(this,zt),a(this,$t,!1)),this.quickFilter=(a(this,At),a(this,Ft,!1)),this.rowReorder=(a(this,Tt),a(this,Lt,!1)),this.columnReorder=(a(this,Mt),a(this,Rt,!1)),this.columnMenu=(a(this,jt),a(this,Ot,!1)),this.lazyLoad=(a(this,Bt),a(this,It,!1)),this.lazyLoadThreshold=(a(this,Pt),a(this,Ht,200)),this.selectedRows=(a(this,Vt),a(this,Nt,[])),this.virtualizer=(a(this,_t),new c),this.columnManager=new d,this.filterEngine=new g,this.editor=new b,this.keyboard=new v,this.exporter=new f,this.masterDetail=new y,this.toolbar=new w,this.treeData=new x,this.columnMenuManager=new S,this.rowDnD=new C,this.columnDnD=new E,this.pinnedTopRows=[],this.pinnedBottomRows=[],this.lazyLoadHandler=null,this.rowHeightCallback=null,this.table=a(this,qt,void 0),this.thead=(a(this,Wt),a(this,Kt,void 0)),this.tbody=(a(this,Yt),a(this,Ut,void 0)),this.unsortedData=(a(this,Gt),[]),this.dataRequestTimeout=null,this.fsExitHandler=null,this.toggleFullscreen=async()=>{if(this.classList.contains("table-fullscreen")){if(this.classList.remove("table-fullscreen"),document.fullscreenElement===this)try{await document.exitFullscreen()}catch{}this.fsExitHandler&&(document.removeEventListener("fullscreenchange",this.fsExitHandler),this.fsExitHandler=null)}else{this.classList.add("table-fullscreen");try{"function"==typeof this.requestFullscreen&&await this.requestFullscreen()}catch{}this.fsExitHandler=()=>{document.fullscreenElement!==this&&(this.classList.remove("table-fullscreen"),this.fsExitHandler&&(document.removeEventListener("fullscreenchange",this.fsExitHandler),this.fsExitHandler=null))},document.addEventListener("fullscreenchange",this.fsExitHandler)}},this.handleClick=e=>{const t=e.target,i=t.closest("th.sortable");if(i){const e=i.getAttribute("data-key");return void(e&&this.toggleSort(e,!0))}const a=t.closest("tbody tr");if(a){if(t.matches('input[type="checkbox"], button, a, .interactive, snice-checkbox, snice-button, snice-input, snice-select'))return;const e=parseInt(a.getAttribute("data-index")||"0"),i=this.data[e];if(this.selectable){const t=this.selectedRows.includes(e);this.selectedRows=t?this.selectedRows.filter(t=>t!==e):[...this.selectedRows,e],this.updateRowSelectionState(),this.updateSelectAllState(),this.dispatchRowSelectionChanged(e,!t)}this.clickable&&this.dispatchEvent(new CustomEvent("row-clicked",{detail:{rowData:i,rowIndex:e}}))}},this.handleChange=e=>{const t=e.target;if(t.matches("snice-checkbox.row-select")){const e=t,i=parseInt(e.getAttribute("data-row-index")||"0");return e.checked?this.selectedRows.includes(i)||(this.selectedRows=[...this.selectedRows,i]):this.selectedRows=this.selectedRows.filter(e=>e!==i),this.updateRowSelectionState(),this.updateSelectAllState(),void this.dispatchRowSelectionChanged(i,e.checked)}if(t.matches("snice-checkbox.select-all")){const e=t;if(e.checked){const e=this.getFilteredData();this.selectedRows=e.map(e=>this.data.indexOf(e))}else this.selectedRows=[];this.updateRowSelectionState(),this.dispatchSelectAllChanged(e.checked)}},this.onAttached=()=>{"remote"===this.mode&&(this.getTableConfig(),this.getTableData())},this.searchDebounceTimeout=null,this.handleSearchInput=e=>{const t=e.target;this.searchText=t.value,this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},this.searchDebounce)},this.selectorDebounceTimeout=null,this.handleSelectorChange=e=>{this.selector=Array.isArray(e.detail.value)?e.detail.value.join(","):e.detail.value,this.selectorDebounceTimeout&&clearTimeout(this.selectorDebounceTimeout),this.selectorDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},150)},this.selectabilityCheck=null,this.listViewRenderer=null}static{const c="function"==typeof Symbol&&Symbol.metadata?Object.create(De[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean,attribute:"striped"})],l=[t.property({type:Boolean,attribute:"searchable"})],r=[t.property({type:Boolean,attribute:"filterable"})],o=[t.property({type:Boolean,attribute:"sortable"})],h=[t.property({type:Boolean,attribute:"selectable"})],u=[t.property({type:Boolean,attribute:"hoverable"})],p=[t.property({type:Boolean,attribute:"clickable"})],m=[t.property({type:Boolean,attribute:"list"})],k=[t.property({type:Boolean,attribute:"pagination"})],D=[t.property({attribute:"pagination-mode"})],z=[t.property({type:Number,attribute:"page-size"})],$=[t.property({type:Number,attribute:"current-page"})],A=[t.property({type:Number,attribute:"total-items"})],F=[t.property({type:Array,attribute:!1})],T=[t.property({type:Number,attribute:"search-debounce"})],L=[t.property()],M=[t.property({type:Array,attribute:!1})],R=[t.property({type:String,attribute:"selector"})],j=[t.property({type:Array,attribute:!1})],O=[t.property({type:Boolean,attribute:"loading"})],B=[t.property({type:Boolean,attribute:"virtualize"})],I=[t.property({type:Number,attribute:"row-height"})],P=[t.property({type:Number,attribute:"virtual-buffer"})],H=[t.property({type:Boolean,attribute:"column-resize"})],V=[t.property({type:Boolean,attribute:"editable"})],N=[t.property({attribute:"edit-mode"})],_=[t.property({attribute:"density"})],q=[t.property({type:Boolean,attribute:"header-filters"})],W=[t.property({type:Boolean,attribute:"quick-filter"})],K=[t.property({type:Boolean,attribute:"row-reorder"})],Y=[t.property({type:Boolean,attribute:"column-reorder"})],U=[t.property({type:Boolean,attribute:"column-menu"})],G=[t.property({type:Boolean,attribute:"lazy-load"})],J=[t.property({type:Number,attribute:"lazy-load-threshold"})],X=[t.property({type:Array,attribute:!1})],Z=[t.query("table")],Q=[t.query("thead")],ee=[t.query("tbody")],te=[t.request("table/config")],ie=[t.request("table/data")],ae=[t.styles()],se=[t.render()],ne=[t.ready()],le=[t.watch("selectorOptions")],re=[t.watch("sortable")],oe=[t.watch("selectable")],ce=[t.watch("columns")],de=[t.watch("data","loading")],he=[t.watch("selectedRows")],ue=[t.watch("currentSort")],pe=[t.watch("searchable","filterable")],me=[t.dispatch("page-change",{bubbles:!0,composed:!0})],ge=[t.dispatch("table-row-selection-changed",{bubbles:!0,composed:!0})],be=[t.dispatch("table-select-all-changed",{bubbles:!0,composed:!0})],ve=[t.dispatch("sort-change",{bubbles:!0,composed:!0})],fe=[t.dispatch("filter-change",{bubbles:!0,composed:!0})],ye=[t.dispatch("column-visibility-change",{bubbles:!0,composed:!0})],we=[t.dispatch("column-pin-change",{bubbles:!0,composed:!0})],ke=[t.dispatch("column-order-change",{bubbles:!0,composed:!0})],xe=[t.dispatch("density-change",{bubbles:!0,composed:!0})],Se=[t.dispose()],i(this,null,te,{kind:"method",name:"getTableConfig",static:!1,private:!1,access:{has:e=>"getTableConfig"in e,get:e=>e.getTableConfig},metadata:c},null,ze),i(this,null,ie,{kind:"method",name:"getTableData",static:!1,private:!1,access:{has:e=>"getTableData"in e,get:e=>e.getTableData},metadata:c},null,ze),i(this,null,ae,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:c},null,ze),i(this,null,se,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:c},null,ze),i(this,null,ne,{kind:"method",name:"initialize",static:!1,private:!1,access:{has:e=>"initialize"in e,get:e=>e.initialize},metadata:c},null,ze),i(this,null,le,{kind:"method",name:"handleSelectorOptionsChange",static:!1,private:!1,access:{has:e=>"handleSelectorOptionsChange"in e,get:e=>e.handleSelectorOptionsChange},metadata:c},null,ze),i(this,null,re,{kind:"method",name:"handleSortableChange",static:!1,private:!1,access:{has:e=>"handleSortableChange"in e,get:e=>e.handleSortableChange},metadata:c},null,ze),i(this,null,oe,{kind:"method",name:"handleSelectableChange",static:!1,private:!1,access:{has:e=>"handleSelectableChange"in e,get:e=>e.handleSelectableChange},metadata:c},null,ze),i(this,null,ce,{kind:"method",name:"handleColumnsChange",static:!1,private:!1,access:{has:e=>"handleColumnsChange"in e,get:e=>e.handleColumnsChange},metadata:c},null,ze),i(this,null,de,{kind:"method",name:"handleDataChange",static:!1,private:!1,access:{has:e=>"handleDataChange"in e,get:e=>e.handleDataChange},metadata:c},null,ze),i(this,null,he,{kind:"method",name:"handleSelectedRowsChange",static:!1,private:!1,access:{has:e=>"handleSelectedRowsChange"in e,get:e=>e.handleSelectedRowsChange},metadata:c},null,ze),i(this,null,ue,{kind:"method",name:"handleSortChange",static:!1,private:!1,access:{has:e=>"handleSortChange"in e,get:e=>e.handleSortChange},metadata:c},null,ze),i(this,null,pe,{kind:"method",name:"handleControlsChange",static:!1,private:!1,access:{has:e=>"handleControlsChange"in e,get:e=>e.handleControlsChange},metadata:c},null,ze),i(this,null,me,{kind:"method",name:"dispatchPageChange",static:!1,private:!1,access:{has:e=>"dispatchPageChange"in e,get:e=>e.dispatchPageChange},metadata:c},null,ze),i(this,null,ge,{kind:"method",name:"dispatchRowSelectionChanged",static:!1,private:!1,access:{has:e=>"dispatchRowSelectionChanged"in e,get:e=>e.dispatchRowSelectionChanged},metadata:c},null,ze),i(this,null,be,{kind:"method",name:"dispatchSelectAllChanged",static:!1,private:!1,access:{has:e=>"dispatchSelectAllChanged"in e,get:e=>e.dispatchSelectAllChanged},metadata:c},null,ze),i(this,null,ve,{kind:"method",name:"dispatchSortChange",static:!1,private:!1,access:{has:e=>"dispatchSortChange"in e,get:e=>e.dispatchSortChange},metadata:c},null,ze),i(this,null,fe,{kind:"method",name:"dispatchFilterChange",static:!1,private:!1,access:{has:e=>"dispatchFilterChange"in e,get:e=>e.dispatchFilterChange},metadata:c},null,ze),i(this,null,ye,{kind:"method",name:"dispatchColumnVisibilityChange",static:!1,private:!1,access:{has:e=>"dispatchColumnVisibilityChange"in e,get:e=>e.dispatchColumnVisibilityChange},metadata:c},null,ze),i(this,null,we,{kind:"method",name:"dispatchColumnPinChange",static:!1,private:!1,access:{has:e=>"dispatchColumnPinChange"in e,get:e=>e.dispatchColumnPinChange},metadata:c},null,ze),i(this,null,ke,{kind:"method",name:"dispatchColumnOrderChange",static:!1,private:!1,access:{has:e=>"dispatchColumnOrderChange"in e,get:e=>e.dispatchColumnOrderChange},metadata:c},null,ze),i(this,null,xe,{kind:"method",name:"dispatchDensityChange",static:!1,private:!1,access:{has:e=>"dispatchDensityChange"in e,get:e=>e.dispatchDensityChange},metadata:c},null,ze),i(this,null,Se,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:c},null,ze),i(null,null,n,{kind:"field",name:"striped",static:!1,private:!1,access:{has:e=>"striped"in e,get:e=>e.striped,set:(e,t)=>{e.striped=t}},metadata:c},$e,Ae),i(null,null,l,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:c},Fe,Te),i(null,null,r,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:e=>"filterable"in e,get:e=>e.filterable,set:(e,t)=>{e.filterable=t}},metadata:c},Le,Me),i(null,null,o,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:c},Re,je),i(null,null,h,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:c},Oe,Be),i(null,null,u,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:e=>"hoverable"in e,get:e=>e.hoverable,set:(e,t)=>{e.hoverable=t}},metadata:c},Ie,Pe),i(null,null,p,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:e=>"clickable"in e,get:e=>e.clickable,set:(e,t)=>{e.clickable=t}},metadata:c},He,Ve),i(null,null,m,{kind:"field",name:"list",static:!1,private:!1,access:{has:e=>"list"in e,get:e=>e.list,set:(e,t)=>{e.list=t}},metadata:c},Ne,_e),i(null,null,k,{kind:"field",name:"pagination",static:!1,private:!1,access:{has:e=>"pagination"in e,get:e=>e.pagination,set:(e,t)=>{e.pagination=t}},metadata:c},qe,We),i(null,null,D,{kind:"field",name:"paginationMode",static:!1,private:!1,access:{has:e=>"paginationMode"in e,get:e=>e.paginationMode,set:(e,t)=>{e.paginationMode=t}},metadata:c},Ke,Ye),i(null,null,z,{kind:"field",name:"pageSize",static:!1,private:!1,access:{has:e=>"pageSize"in e,get:e=>e.pageSize,set:(e,t)=>{e.pageSize=t}},metadata:c},Ue,Ge),i(null,null,$,{kind:"field",name:"currentPage",static:!1,private:!1,access:{has:e=>"currentPage"in e,get:e=>e.currentPage,set:(e,t)=>{e.currentPage=t}},metadata:c},Je,Xe),i(null,null,A,{kind:"field",name:"totalItems",static:!1,private:!1,access:{has:e=>"totalItems"in e,get:e=>e.totalItems,set:(e,t)=>{e.totalItems=t}},metadata:c},Ze,Qe),i(null,null,F,{kind:"field",name:"pageSizes",static:!1,private:!1,access:{has:e=>"pageSizes"in e,get:e=>e.pageSizes,set:(e,t)=>{e.pageSizes=t}},metadata:c},et,tt),i(null,null,T,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:e=>"searchDebounce"in e,get:e=>e.searchDebounce,set:(e,t)=>{e.searchDebounce=t}},metadata:c},it,at),i(null,null,L,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,t)=>{e.mode=t}},metadata:c},st,nt),i(null,null,M,{kind:"field",name:"currentSort",static:!1,private:!1,access:{has:e=>"currentSort"in e,get:e=>e.currentSort,set:(e,t)=>{e.currentSort=t}},metadata:c},lt,rt),i(null,null,R,{kind:"field",name:"selector",static:!1,private:!1,access:{has:e=>"selector"in e,get:e=>e.selector,set:(e,t)=>{e.selector=t}},metadata:c},ot,ct),i(null,null,j,{kind:"field",name:"selectorOptions",static:!1,private:!1,access:{has:e=>"selectorOptions"in e,get:e=>e.selectorOptions,set:(e,t)=>{e.selectorOptions=t}},metadata:c},dt,ht),i(null,null,O,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:c},ut,pt),i(null,null,B,{kind:"field",name:"virtualize",static:!1,private:!1,access:{has:e=>"virtualize"in e,get:e=>e.virtualize,set:(e,t)=>{e.virtualize=t}},metadata:c},mt,gt),i(null,null,I,{kind:"field",name:"rowHeight",static:!1,private:!1,access:{has:e=>"rowHeight"in e,get:e=>e.rowHeight,set:(e,t)=>{e.rowHeight=t}},metadata:c},bt,vt),i(null,null,P,{kind:"field",name:"virtualBuffer",static:!1,private:!1,access:{has:e=>"virtualBuffer"in e,get:e=>e.virtualBuffer,set:(e,t)=>{e.virtualBuffer=t}},metadata:c},ft,yt),i(null,null,H,{kind:"field",name:"columnResize",static:!1,private:!1,access:{has:e=>"columnResize"in e,get:e=>e.columnResize,set:(e,t)=>{e.columnResize=t}},metadata:c},wt,kt),i(null,null,V,{kind:"field",name:"editable",static:!1,private:!1,access:{has:e=>"editable"in e,get:e=>e.editable,set:(e,t)=>{e.editable=t}},metadata:c},xt,St),i(null,null,N,{kind:"field",name:"editMode",static:!1,private:!1,access:{has:e=>"editMode"in e,get:e=>e.editMode,set:(e,t)=>{e.editMode=t}},metadata:c},Ct,Et),i(null,null,_,{kind:"field",name:"density",static:!1,private:!1,access:{has:e=>"density"in e,get:e=>e.density,set:(e,t)=>{e.density=t}},metadata:c},Dt,zt),i(null,null,q,{kind:"field",name:"headerFilters",static:!1,private:!1,access:{has:e=>"headerFilters"in e,get:e=>e.headerFilters,set:(e,t)=>{e.headerFilters=t}},metadata:c},$t,At),i(null,null,W,{kind:"field",name:"quickFilter",static:!1,private:!1,access:{has:e=>"quickFilter"in e,get:e=>e.quickFilter,set:(e,t)=>{e.quickFilter=t}},metadata:c},Ft,Tt),i(null,null,K,{kind:"field",name:"rowReorder",static:!1,private:!1,access:{has:e=>"rowReorder"in e,get:e=>e.rowReorder,set:(e,t)=>{e.rowReorder=t}},metadata:c},Lt,Mt),i(null,null,Y,{kind:"field",name:"columnReorder",static:!1,private:!1,access:{has:e=>"columnReorder"in e,get:e=>e.columnReorder,set:(e,t)=>{e.columnReorder=t}},metadata:c},Rt,jt),i(null,null,U,{kind:"field",name:"columnMenu",static:!1,private:!1,access:{has:e=>"columnMenu"in e,get:e=>e.columnMenu,set:(e,t)=>{e.columnMenu=t}},metadata:c},Ot,Bt),i(null,null,G,{kind:"field",name:"lazyLoad",static:!1,private:!1,access:{has:e=>"lazyLoad"in e,get:e=>e.lazyLoad,set:(e,t)=>{e.lazyLoad=t}},metadata:c},It,Pt),i(null,null,J,{kind:"field",name:"lazyLoadThreshold",static:!1,private:!1,access:{has:e=>"lazyLoadThreshold"in e,get:e=>e.lazyLoadThreshold,set:(e,t)=>{e.lazyLoadThreshold=t}},metadata:c},Ht,Vt),i(null,null,X,{kind:"field",name:"selectedRows",static:!1,private:!1,access:{has:e=>"selectedRows"in e,get:e=>e.selectedRows,set:(e,t)=>{e.selectedRows=t}},metadata:c},Nt,_t),i(null,null,Z,{kind:"field",name:"table",static:!1,private:!1,access:{has:e=>"table"in e,get:e=>e.table,set:(e,t)=>{e.table=t}},metadata:c},qt,Wt),i(null,null,Q,{kind:"field",name:"thead",static:!1,private:!1,access:{has:e=>"thead"in e,get:e=>e.thead,set:(e,t)=>{e.thead=t}},metadata:c},Kt,Yt),i(null,null,ee,{kind:"field",name:"tbody",static:!1,private:!1,access:{has:e=>"tbody"in e,get:e=>e.tbody,set:(e,t)=>{e.tbody=t}},metadata:c},Ut,Gt),i(null,e={value:s},Ce,{kind:"class",name:s.name,metadata:c},null,Ee),s=e.value,c&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c}),a(s,Ee)}setData(e){this.unsortedData=[...e],this.data=e,this.render()}setColumns(e){this.columns=e,this.render()}async*getTableConfig(){const e=await(yield{});return this.columns=e.columns||[],this.selectorOptions=e.selectorOptions||[],await new Promise(e=>requestAnimationFrame(e)),this.renderHeader(),this.renderControls(),e}async*getTableData(){this.loading=!0,this.selectedRows=[];try{const e={search:this.searchText,sort:this.currentSort,filter:this.filterEngine.getFilterModel(),selector:this.selector};this.pagination&&(e.page=this.currentPage,e.pageSize=this.pageSize);const t=await(yield e);return this.data=t.data||[],void 0!==t.totalItems&&(this.totalItems=t.totalItems),this.loading=!1,await new Promise(e=>requestAnimationFrame(e)),this.renderBody(),t}catch(e){console.error("Error loading table data:",e),this.loading=!1}}debouncedDataRequest(){this.loading||(this.loading=!0),this.dataRequestTimeout&&clearTimeout(this.dataRequestTimeout),this.dataRequestTimeout=setTimeout(()=>{this.getTableData(),this.dataRequestTimeout=null},150)}styles(){return t.css`
|
|
580
580
|
:host {
|
|
581
581
|
display: block;
|
|
582
582
|
position: relative;
|