snice 4.14.0 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapters/react/doc.d.ts +1 -0
- package/adapters/react/doc.d.ts.map +1 -1
- package/adapters/react/doc.js +1 -1
- package/adapters/react/doc.js.map +1 -1
- package/adapters/react/doc.tsx +2 -1
- package/adapters/react/input.d.ts +3 -0
- package/adapters/react/input.d.ts.map +1 -1
- package/adapters/react/input.js +1 -1
- package/adapters/react/input.js.map +1 -1
- package/adapters/react/input.tsx +4 -1
- package/adapters/react/modal.d.ts +2 -0
- package/adapters/react/modal.d.ts.map +1 -1
- package/adapters/react/modal.js +1 -1
- package/adapters/react/modal.js.map +1 -1
- package/adapters/react/modal.tsx +3 -1
- package/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/accordion/snice-accordion.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/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.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/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/book/README.md +2 -2
- package/dist/cdn/book/snice-book.js +29 -8
- package/dist/cdn/book/snice-book.js.map +1 -1
- package/dist/cdn/book/snice-book.min.js +3 -3
- package/dist/cdn/book/snice-book.min.js.map +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/chart/snice-chart.js +1 -1
- package/dist/cdn/chart/snice-chart.min.js +1 -1
- package/dist/cdn/chat/snice-chat.js +1 -1
- package/dist/cdn/chat/snice-chat.min.js +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 +4 -4
- package/dist/cdn/code-block/snice-code-block.js.map +1 -1
- package/dist/cdn/code-block/snice-code-block.min.js +2 -2
- package/dist/cdn/code-block/snice-code-block.min.js.map +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/date-picker/README.md +1 -1
- package/dist/cdn/date-picker/snice-date-picker.js +49 -39
- package/dist/cdn/date-picker/snice-date-picker.js.map +1 -1
- package/dist/cdn/date-picker/snice-date-picker.min.js +4 -4
- package/dist/cdn/date-picker/snice-date-picker.min.js.map +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/README.md +2 -2
- package/dist/cdn/doc/snice-doc.js +221 -35
- package/dist/cdn/doc/snice-doc.js.map +1 -1
- package/dist/cdn/doc/snice-doc.min.js +2 -2
- package/dist/cdn/doc/snice-doc.min.js.map +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/snice-empty-state.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.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/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/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/README.md +2 -2
- package/dist/cdn/input/snice-input.js +21 -3
- package/dist/cdn/input/snice-input.js.map +1 -1
- package/dist/cdn/input/snice-input.min.js +3 -3
- package/dist/cdn/input/snice-input.min.js.map +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/kanban/snice-kanban.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/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 +2 -2
- package/dist/cdn/link-preview/snice-link-preview.js.map +1 -1
- package/dist/cdn/link-preview/snice-link-preview.min.js +2 -2
- package/dist/cdn/link-preview/snice-link-preview.min.js.map +1 -1
- package/dist/cdn/list/snice-list.js +4 -4
- package/dist/cdn/list/snice-list.js.map +1 -1
- package/dist/cdn/list/snice-list.min.js +2 -2
- 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 +2 -2
- package/dist/cdn/menu/snice-menu.js.map +1 -1
- package/dist/cdn/menu/snice-menu.min.js +2 -2
- package/dist/cdn/menu/snice-menu.min.js.map +1 -1
- package/dist/cdn/modal/README.md +2 -2
- package/dist/cdn/modal/snice-modal.js +34 -18
- package/dist/cdn/modal/snice-modal.js.map +1 -1
- package/dist/cdn/modal/snice-modal.min.js +24 -20
- package/dist/cdn/modal/snice-modal.min.js.map +1 -1
- package/dist/cdn/music-player/README.md +2 -2
- package/dist/cdn/music-player/snice-music-player.js +8 -1
- package/dist/cdn/music-player/snice-music-player.js.map +1 -1
- package/dist/cdn/music-player/snice-music-player.min.js +3 -3
- package/dist/cdn/music-player/snice-music-player.min.js.map +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/snice-notification-center.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.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/podcast-player/snice-podcast-player.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.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/progress/snice-progress.js +1 -1
- package/dist/cdn/progress/snice-progress.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/README.md +2 -2
- package/dist/cdn/radio/snice-radio.js +23 -3
- package/dist/cdn/radio/snice-radio.js.map +1 -1
- package/dist/cdn/radio/snice-radio.min.js +3 -3
- package/dist/cdn/radio/snice-radio.min.js.map +1 -1
- package/dist/cdn/rating/snice-rating.js +1 -1
- package/dist/cdn/rating/snice-rating.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 +513 -46
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +6 -6
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +6420 -5951
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +18 -18
- 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/select/README.md +2 -2
- package/dist/cdn/select/snice-select.js +46 -92
- package/dist/cdn/select/snice-select.js.map +1 -1
- package/dist/cdn/select/snice-select.min.js +5 -13
- package/dist/cdn/select/snice-select.min.js.map +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-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/spreadsheet/snice-spreadsheet.js +1 -1
- package/dist/cdn/spreadsheet/snice-spreadsheet.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/README.md +1 -1
- package/dist/cdn/switch/snice-switch.js +33 -23
- package/dist/cdn/switch/snice-switch.js.map +1 -1
- package/dist/cdn/switch/snice-switch.min.js +3 -3
- package/dist/cdn/switch/snice-switch.min.js.map +1 -1
- package/dist/cdn/table/README.md +2 -2
- package/dist/cdn/table/snice-table.js +2876 -111
- package/dist/cdn/table/snice-table.js.map +1 -1
- package/dist/cdn/table/snice-table.min.js +187 -47
- 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-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-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/README.md +1 -1
- package/dist/cdn/toast/snice-toast.js +3 -3
- package/dist/cdn/toast/snice-toast.js.map +1 -1
- package/dist/cdn/toast/snice-toast.min.js +2 -2
- package/dist/cdn/toast/snice-toast.min.js.map +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/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/components/book/snice-book.d.ts +2 -0
- package/dist/components/book/snice-book.js +28 -7
- package/dist/components/book/snice-book.js.map +1 -1
- package/dist/components/book/snice-book.types.d.ts +7 -0
- package/dist/components/code-block/snice-code-block.js +3 -3
- package/dist/components/code-block/snice-code-block.js.map +1 -1
- package/dist/components/code-block/snice-code-block.types.d.ts +3 -3
- package/dist/components/date-picker/snice-date-picker.d.ts +2 -0
- package/dist/components/date-picker/snice-date-picker.js +49 -39
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/doc/snice-doc.d.ts +20 -0
- package/dist/components/doc/snice-doc.js +220 -34
- package/dist/components/doc/snice-doc.js.map +1 -1
- package/dist/components/input/snice-input.d.ts +3 -0
- package/dist/components/input/snice-input.js +20 -2
- package/dist/components/input/snice-input.js.map +1 -1
- package/dist/components/input/snice-input.types.d.ts +3 -0
- package/dist/components/link-preview/snice-link-preview.js +1 -1
- package/dist/components/link-preview/snice-link-preview.js.map +1 -1
- package/dist/components/list/snice-list.js +3 -3
- package/dist/components/list/snice-list.js.map +1 -1
- package/dist/components/menu/snice-menu.js +1 -1
- package/dist/components/menu/snice-menu.js.map +1 -1
- package/dist/components/modal/snice-modal.d.ts +2 -0
- package/dist/components/modal/snice-modal.js +33 -17
- package/dist/components/modal/snice-modal.js.map +1 -1
- package/dist/components/modal/snice-modal.types.d.ts +2 -0
- package/dist/components/music-player/snice-music-player.d.ts +1 -0
- package/dist/components/music-player/snice-music-player.js +7 -0
- package/dist/components/music-player/snice-music-player.js.map +1 -1
- package/dist/components/notification-center/snice-notification-center.d.ts +1 -1
- package/dist/components/notification-center/snice-notification-center.js.map +1 -1
- package/dist/components/notification-center/snice-notification-center.types.d.ts +1 -0
- package/dist/components/radio/snice-radio.d.ts +1 -0
- package/dist/components/radio/snice-radio.js +22 -2
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-select.d.ts +2 -4
- package/dist/components/select/snice-select.js +46 -92
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/switch/snice-switch.d.ts +2 -0
- package/dist/components/switch/snice-switch.js +32 -22
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +2 -0
- package/dist/components/table/snice-table.js +17 -3
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/toast/snice-toast-container.js +2 -2
- package/dist/components/toast/snice-toast-container.js.map +1 -1
- package/dist/index.cjs +512 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +511 -44
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +512 -43
- package/dist/index.iife.js.map +1 -1
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/tooltip-observer.d.ts +11 -0
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/DEVELOPMENT.md +1 -1
- package/docs/ai/api.md +14 -10
- package/docs/ai/architecture.md +18 -5
- package/docs/ai/components/app-tiles.md +1 -1
- package/docs/ai/components/book.md +5 -6
- package/docs/ai/components/camera-annotate.md +3 -3
- package/docs/ai/components/candlestick.md +3 -3
- package/docs/ai/components/chart.md +1 -1
- package/docs/ai/components/code-block.md +3 -3
- package/docs/ai/components/doc.md +26 -15
- package/docs/ai/components/file-gallery.md +1 -1
- package/docs/ai/components/input.md +10 -0
- package/docs/ai/components/link-preview.md +1 -1
- package/docs/ai/components/list.md +2 -2
- package/docs/ai/components/markdown.md +13 -6
- package/docs/ai/components/modal.md +2 -0
- package/docs/ai/components/music-player.md +3 -2
- package/docs/ai/components/network-graph.md +5 -5
- package/docs/ai/components/notification-center.md +1 -0
- package/docs/ai/components/pdf-viewer.md +1 -1
- package/docs/ai/components/radio.md +2 -2
- package/docs/ai/components/sankey.md +3 -3
- package/docs/ai/components/select.md +1 -1
- package/docs/ai/components/tooltip.md +54 -0
- package/docs/ai/decorators.md +4 -4
- package/docs/code-block.md +4 -4
- package/docs/components/app-tiles.md +1 -1
- package/docs/components/book.md +3 -4
- package/docs/components/button.md +2 -2
- package/docs/components/camera-annotate.md +6 -6
- package/docs/components/candlestick.md +6 -6
- package/docs/components/chart.md +4 -6
- package/docs/components/checkbox.md +3 -3
- package/docs/components/chip.md +4 -4
- package/docs/components/code-block.md +4 -3
- package/docs/components/doc.md +99 -58
- package/docs/components/file-gallery.md +25 -3
- package/docs/components/input.md +20 -0
- package/docs/components/kpi.md +2 -3
- package/docs/components/link-preview.md +2 -2
- package/docs/components/list.md +3 -3
- package/docs/components/markdown.md +14 -36
- package/docs/components/modal.md +2 -0
- package/docs/components/music-player.md +3 -2
- package/docs/components/network-graph.md +7 -7
- package/docs/components/notification-center.md +1 -0
- package/docs/components/pdf-viewer.md +1 -1
- package/docs/components/sankey.md +6 -6
- package/docs/components/switch.md +1 -1
- package/docs/components/table.md +2 -2
- package/docs/components/tooltip.md +133 -0
- package/docs/controllers.md +3 -14
- package/docs/elements.md +0 -1
- package/docs/events.md +3 -0
- package/docs/request-response.md +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* snice v4.
|
|
2
|
+
* snice v4.15.0
|
|
3
3
|
* Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -112,7 +112,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
112
112
|
return snice.html `<span class="${className}" part="icon">${icon}</span>`;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
var cssContent$
|
|
115
|
+
var cssContent$e = ":host{display:inline-block;width:100%;max-width:100%;box-sizing:border-box;font-family:var(--snice-font-family);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) 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);background:var(--snice-color-background-input,rgb(248 247 245));color:var(--snice-color-text);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-md);box-shadow:var(--snice-shadow-inset-sm);transition:all var(--snice-transition-fast) ease;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input:focus{border-color:var(--snice-color-primary);box-shadow:0 0 0 var(--snice-focus-ring-width) var(--snice-focus-ring-color),var(--snice-shadow-sm)}.input:disabled{background:var(--snice-color-background-secondary);color:var(--snice-color-text-secondary);cursor:not-allowed;opacity:.6}.input::placeholder{color:var(--snice-color-text-secondary);opacity:.7}.input--small{padding:.375rem .625rem;font-size:var(--snice-font-size-sm)}.input--medium{padding:.5rem .75rem;font-size:var(--snice-font-size-md)}.input--large{padding:.625rem .875rem;font-size:var(--snice-font-size-lg)}.input--outlined{background:var(--snice-color-background-input,rgb(248 247 245));border:1px solid var(--snice-color-border)}.input--filled{background:var(--snice-color-background-secondary);border:1px solid transparent;border-bottom-color:var(--snice-color-border);border-radius:var(--snice-border-radius-md) var(--snice-border-radius-md) 0 0}.input--filled:focus{background:var(--snice-color-background-hover);border-bottom-color:var(--snice-color-primary)}.input--underlined{background:0 0;border:none;border-bottom:1px solid var(--snice-color-border);border-radius:0;padding-left:0;padding-right:0}.input--underlined:focus{border-bottom-color:var(--snice-color-primary);box-shadow:none}.input--invalid{border-color:var(--snice-color-danger)}.input--invalid:focus{border-color:var(--snice-color-danger);box-shadow:0 0 0 var(--snice-focus-ring-width) var(--snice-color-danger-alpha,hsl(var(--snice-color-red-500) / .4)),var(--snice-shadow-sm)}.input::-webkit-calendar-picker-indicator{cursor:pointer;opacity:.7}.input::-webkit-calendar-picker-indicator:hover{opacity:1}.input--with-prefix-icon{padding-left:2.25rem}.input--clearable,.input--with-suffix-icon{padding-right:2.25rem}.input--with-suffix-icon.input--clearable{padding-right:3.75rem}.label{display:block;margin-bottom:.375rem;font-size:var(--snice-font-size-sm);font-weight:500;color:var(--snice-color-text);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)}.error-text,.helper-text{display:block;margin-top:.25rem;font-size:var(--snice-font-size-xs);min-height:1.125rem}.helper-text{color:var(--snice-color-text-secondary)}.error-text{color:var(--snice-color-danger)}.icon-slot{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:var(--snice-color-text-secondary);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.25rem;height:1.25rem;color:var(--snice-color-text-secondary);pointer-events:none}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;font-size:1.25rem;line-height:1}.icon-slot ::slotted(svg){width:1.25rem;height:1.25rem}.icon-slot ::slotted(img){width:1.25rem;height:1.25rem;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);color:var(--snice-color-text-secondary);cursor:pointer;transition:all var(--snice-transition-fast) ease;opacity:0;visibility:hidden}.clear-button:hover{background:var(--snice-color-background-hover);color:var(--snice-color-text)}.input-container:hover .clear-button--visible,.input:focus~.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);color:var(--snice-color-text-secondary);cursor:pointer;transition:all var(--snice-transition-fast) ease}.password-toggle:hover{background:var(--snice-color-background-hover);color:var(--snice-color-text)}.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)}}";
|
|
116
116
|
|
|
117
117
|
(() => {
|
|
118
118
|
let _classDecorators = [snice.element('snice-input', { formAssociated: true })];
|
|
@@ -190,6 +190,15 @@ var SniceTable = (function (exports, snice) {
|
|
|
190
190
|
let _name_decorators;
|
|
191
191
|
let _name_initializers = [];
|
|
192
192
|
let _name_extraInitializers = [];
|
|
193
|
+
let _align_decorators;
|
|
194
|
+
let _align_initializers = [];
|
|
195
|
+
let _align_extraInitializers = [];
|
|
196
|
+
let _labelAlign_decorators;
|
|
197
|
+
let _labelAlign_initializers = [];
|
|
198
|
+
let _labelAlign_extraInitializers = [];
|
|
199
|
+
let _stretch_decorators;
|
|
200
|
+
let _stretch_initializers = [];
|
|
201
|
+
let _stretch_extraInitializers = [];
|
|
193
202
|
let _prefixIcon_decorators;
|
|
194
203
|
let _prefixIcon_initializers = [];
|
|
195
204
|
let _prefixIcon_extraInitializers = [];
|
|
@@ -254,6 +263,9 @@ var SniceTable = (function (exports, snice) {
|
|
|
254
263
|
_minlength_decorators = [snice.property({ type: Number, })];
|
|
255
264
|
_autocomplete_decorators = [snice.property({})];
|
|
256
265
|
_name_decorators = [snice.property({})];
|
|
266
|
+
_align_decorators = [snice.property({})];
|
|
267
|
+
_labelAlign_decorators = [snice.property({ attribute: 'label-align', })];
|
|
268
|
+
_stretch_decorators = [snice.property({ type: Boolean, })];
|
|
257
269
|
_prefixIcon_decorators = [snice.property({ attribute: 'prefix-icon', })];
|
|
258
270
|
_suffixIcon_decorators = [snice.property({ attribute: 'suffix-icon', })];
|
|
259
271
|
_input_decorators = [snice.query('.input')];
|
|
@@ -326,6 +338,9 @@ var SniceTable = (function (exports, snice) {
|
|
|
326
338
|
__esDecorate(null, null, _minlength_decorators, { kind: "field", name: "minlength", static: false, private: false, access: { has: obj => "minlength" in obj, get: obj => obj.minlength, set: (obj, value) => { obj.minlength = value; } }, metadata: _metadata }, _minlength_initializers, _minlength_extraInitializers);
|
|
327
339
|
__esDecorate(null, null, _autocomplete_decorators, { kind: "field", name: "autocomplete", static: false, private: false, access: { has: obj => "autocomplete" in obj, get: obj => obj.autocomplete, set: (obj, value) => { obj.autocomplete = value; } }, metadata: _metadata }, _autocomplete_initializers, _autocomplete_extraInitializers);
|
|
328
340
|
__esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
341
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
342
|
+
__esDecorate(null, null, _labelAlign_decorators, { kind: "field", name: "labelAlign", static: false, private: false, access: { has: obj => "labelAlign" in obj, get: obj => obj.labelAlign, set: (obj, value) => { obj.labelAlign = value; } }, metadata: _metadata }, _labelAlign_initializers, _labelAlign_extraInitializers);
|
|
343
|
+
__esDecorate(null, null, _stretch_decorators, { kind: "field", name: "stretch", static: false, private: false, access: { has: obj => "stretch" in obj, get: obj => obj.stretch, set: (obj, value) => { obj.stretch = value; } }, metadata: _metadata }, _stretch_initializers, _stretch_extraInitializers);
|
|
329
344
|
__esDecorate(null, null, _prefixIcon_decorators, { kind: "field", name: "prefixIcon", static: false, private: false, access: { has: obj => "prefixIcon" in obj, get: obj => obj.prefixIcon, set: (obj, value) => { obj.prefixIcon = value; } }, metadata: _metadata }, _prefixIcon_initializers, _prefixIcon_extraInitializers);
|
|
330
345
|
__esDecorate(null, null, _suffixIcon_decorators, { kind: "field", name: "suffixIcon", static: false, private: false, access: { has: obj => "suffixIcon" in obj, get: obj => obj.suffixIcon, set: (obj, value) => { obj.suffixIcon = value; } }, metadata: _metadata }, _suffixIcon_initializers, _suffixIcon_extraInitializers);
|
|
331
346
|
__esDecorate(null, null, _input_decorators, { kind: "field", name: "input", static: false, private: false, access: { has: obj => "input" in obj, get: obj => obj.input, set: (obj, value) => { obj.input = value; } }, metadata: _metadata }, _input_initializers, _input_extraInitializers);
|
|
@@ -362,7 +377,10 @@ var SniceTable = (function (exports, snice) {
|
|
|
362
377
|
this.minlength = (__runInitializers(this, _maxlength_extraInitializers), __runInitializers(this, _minlength_initializers, -1));
|
|
363
378
|
this.autocomplete = (__runInitializers(this, _minlength_extraInitializers), __runInitializers(this, _autocomplete_initializers, ''));
|
|
364
379
|
this.name = (__runInitializers(this, _autocomplete_extraInitializers), __runInitializers(this, _name_initializers, ''));
|
|
365
|
-
this.
|
|
380
|
+
this.align = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _align_initializers, ''));
|
|
381
|
+
this.labelAlign = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _labelAlign_initializers, 'left'));
|
|
382
|
+
this.stretch = (__runInitializers(this, _labelAlign_extraInitializers), __runInitializers(this, _stretch_initializers, false));
|
|
383
|
+
this.prefixIcon = (__runInitializers(this, _stretch_extraInitializers), __runInitializers(this, _prefixIcon_initializers, ''));
|
|
366
384
|
this.suffixIcon = (__runInitializers(this, _prefixIcon_extraInitializers), __runInitializers(this, _suffixIcon_initializers, ''));
|
|
367
385
|
this.input = (__runInitializers(this, _suffixIcon_extraInitializers), __runInitializers(this, _input_initializers, void 0));
|
|
368
386
|
this.clearButton = (__runInitializers(this, _input_extraInitializers), __runInitializers(this, _clearButton_initializers, void 0));
|
|
@@ -486,7 +504,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
486
504
|
`;
|
|
487
505
|
}
|
|
488
506
|
styles() {
|
|
489
|
-
return snice.css /*css*/ `${cssContent$
|
|
507
|
+
return snice.css /*css*/ `${cssContent$e}`;
|
|
490
508
|
}
|
|
491
509
|
init() {
|
|
492
510
|
// Set initial form value
|
|
@@ -816,10 +834,10 @@ var SniceTable = (function (exports, snice) {
|
|
|
816
834
|
return _classThis;
|
|
817
835
|
})();
|
|
818
836
|
|
|
819
|
-
var cssContent$
|
|
837
|
+
var cssContent$d = ":host{display:inline-block;font-family:var(--snice-font-family);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;color:var(--snice-color-text);font-weight:500}.select-label--small{font-size:var(--snice-font-size-sm)}.select-label--medium{font-size:var(--snice-font-size-md)}.select-label--large{font-size:var(--snice-font-size-lg)}.select-label--required::after{content:' *';color:var(--snice-color-danger)}.select-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;background:var(--snice-color-background-input);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-md);cursor:pointer;transition:all var(--snice-transition-fast) ease;position:relative;text-align:left;font-family:inherit;color:var(--snice-color-text)}.select-trigger--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm);min-height:2rem}.select-trigger--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md);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);min-height:3rem}.select-trigger:hover:not(.select-trigger--disabled){border-color:var(--snice-color-border-hover)}.select-trigger:focus-visible{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-color:var(--snice-color-primary)}.select-trigger--open{border-color:var(--snice-color-primary)}.select-trigger--disabled{background:var(--snice-color-background-secondary);cursor:not-allowed;opacity:.6}.select-trigger--readonly{background:var(--snice-color-background-secondary);cursor:default}.select-trigger--invalid{border-color:var(--snice-color-danger)}.select-placeholder{color:var(--snice-color-text-secondary)}.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-light);color:var(--snice-color-primary);border-radius:var(--snice-border-radius-sm);font-size:var(--snice-font-size-xs)}.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:2px;background:0 0;border:none;cursor:pointer;color:var(--snice-color-text-secondary);display:flex;align-items:center;justify-content:center;border-radius:var(--snice-border-radius-sm);pointer-events:auto}.select-clear:hover{background:var(--snice-color-background-secondary);color:var(--snice-color-text)}.select-arrow{transition:transform var(--snice-transition-fast) ease;color:var(--snice-color-text-secondary);pointer-events:none}.select-arrow--open{transform:rotate(180deg)}.select-dropdown{position:absolute;top:100%;margin-top:4px;left:0;right:0;background:var(--snice-color-background-element);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-md);box-shadow:var(--snice-shadow-lg);z-index:1000;opacity:0;transform:translateY(-8px) scaleY(.95);transform-origin:top;pointer-events:none;transition:opacity var(--snice-transition-fast) ease,transform var(--snice-transition-fast) ease;display:flex;flex-direction:column;overflow:hidden}.select-dropdown--open{opacity:1;transform:translateY(0) scaleY(1);pointer-events:auto}.select-search{padding:8px;border-bottom:1px solid var(--snice-color-border);flex-shrink:0}.select-search-input{width:100%;padding:6px 10px;background:var(--snice-color-background-input);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-sm);font-size:var(--snice-font-size-sm);font-family:inherit;color:var(--snice-color-text);box-sizing:border-box}.select-search-input:focus{outline:0;border-color:var(--snice-color-primary)}.select-options{max-height:200px;overflow-y:auto;overflow-x:hidden;padding:4px;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--snice-color-border) var(--snice-color-background-secondary)}.select-options::-webkit-scrollbar-track{background:var(--snice-color-background-secondary);margin:4px 0}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border);border:2px solid var(--snice-color-background)}.select-option{padding:8px 12px;cursor:pointer;border-radius:var(--snice-border-radius-sm);transition:background var(--snice-transition-fast) ease;display:flex;align-items:center;gap:8px}.select-option:hover:not(.select-option--disabled){background:var(--snice-color-background-secondary)}.select-option--selected{background:var(--snice-color-primary-light);color:var(--snice-color-primary);font-weight:500}.select-option--focused{background:var(--snice-color-background-secondary);outline:2px solid var(--snice-color-primary);outline-offset:-2px}.select-option--disabled{opacity:.5;cursor:not-allowed}.select-option-icon{width:16px;height:16px;object-fit:contain;flex-shrink:0}.select-option-check{width:16px;height:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.select-option-label{flex:1}.select-no-options{padding:16px;text-align:center;color:var(--snice-color-text-secondary);font-size:var(--snice-font-size-sm)}.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-background-secondary);border-radius:3px}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border);border-radius:3px}.select-options::-webkit-scrollbar-thumb:hover{background:var(--snice-color-border-hover)}.select-trigger--loading{cursor:wait;opacity:.7}.select-spinner{display:inline-block;width:14px;height:14px;margin-right:4px}.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)}}";
|
|
820
838
|
|
|
821
839
|
(() => {
|
|
822
|
-
let _classDecorators = [snice.element('snice-select')];
|
|
840
|
+
let _classDecorators = [snice.element('snice-select', { formAssociated: true })];
|
|
823
841
|
let _classDescriptor;
|
|
824
842
|
let _classExtraInitializers = [];
|
|
825
843
|
let _classThis;
|
|
@@ -888,9 +906,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
888
906
|
let _optionsList_decorators;
|
|
889
907
|
let _optionsList_initializers = [];
|
|
890
908
|
let _optionsList_extraInitializers = [];
|
|
891
|
-
let _nativeSelect_decorators;
|
|
892
|
-
let _nativeSelect_initializers = [];
|
|
893
|
-
let _nativeSelect_extraInitializers = [];
|
|
894
909
|
let _clearButton_decorators;
|
|
895
910
|
let _clearButton_initializers = [];
|
|
896
911
|
let _clearButton_extraInitializers = [];
|
|
@@ -911,46 +926,11 @@ var SniceTable = (function (exports, snice) {
|
|
|
911
926
|
let _handleDisabledChange_decorators;
|
|
912
927
|
let _handleLoadingChange_decorators;
|
|
913
928
|
let _handleOpenChange_decorators;
|
|
914
|
-
let _handleNativeSelectAttributeChange_decorators;
|
|
915
929
|
let _dispatchChangeEvent_decorators;
|
|
916
930
|
let _dispatchOpenEvent_decorators;
|
|
917
931
|
let _dispatchCloseEvent_decorators;
|
|
918
932
|
(class extends _classSuper {
|
|
919
933
|
static { _classThis = this; }
|
|
920
|
-
constructor() {
|
|
921
|
-
super(...arguments);
|
|
922
|
-
this.disabled = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _disabled_initializers, false));
|
|
923
|
-
this.required = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _required_initializers, false));
|
|
924
|
-
this.invalid = (__runInitializers(this, _required_extraInitializers), __runInitializers(this, _invalid_initializers, false));
|
|
925
|
-
this.readonly = (__runInitializers(this, _invalid_extraInitializers), __runInitializers(this, _readonly_initializers, false));
|
|
926
|
-
this.loading = (__runInitializers(this, _readonly_extraInitializers), __runInitializers(this, _loading_initializers, false));
|
|
927
|
-
this.multiple = (__runInitializers(this, _loading_extraInitializers), __runInitializers(this, _multiple_initializers, false));
|
|
928
|
-
this.searchable = (__runInitializers(this, _multiple_extraInitializers), __runInitializers(this, _searchable_initializers, false));
|
|
929
|
-
this.clearable = (__runInitializers(this, _searchable_extraInitializers), __runInitializers(this, _clearable_initializers, false));
|
|
930
|
-
this.open = (__runInitializers(this, _clearable_extraInitializers), __runInitializers(this, _open_initializers, false));
|
|
931
|
-
this.size = (__runInitializers(this, _open_extraInitializers), __runInitializers(this, _size_initializers, 'medium'));
|
|
932
|
-
this.name = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _name_initializers, ''));
|
|
933
|
-
this.value = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
934
|
-
this.label = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _label_initializers, ''));
|
|
935
|
-
this.placeholder = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _placeholder_initializers, 'Select an option'));
|
|
936
|
-
this.maxHeight = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _maxHeight_initializers, '200px'));
|
|
937
|
-
// Options will be read from child snice-option elements
|
|
938
|
-
this.options = (__runInitializers(this, _maxHeight_extraInitializers), []);
|
|
939
|
-
this.trigger = __runInitializers(this, _trigger_initializers, void 0);
|
|
940
|
-
this.dropdown = (__runInitializers(this, _trigger_extraInitializers), __runInitializers(this, _dropdown_initializers, void 0));
|
|
941
|
-
this.valueDisplay = (__runInitializers(this, _dropdown_extraInitializers), __runInitializers(this, _valueDisplay_initializers, void 0));
|
|
942
|
-
this.labelElement = (__runInitializers(this, _valueDisplay_extraInitializers), __runInitializers(this, _labelElement_initializers, void 0));
|
|
943
|
-
this.searchInput = (__runInitializers(this, _labelElement_extraInitializers), __runInitializers(this, _searchInput_initializers, void 0));
|
|
944
|
-
this.optionsList = (__runInitializers(this, _searchInput_extraInitializers), __runInitializers(this, _optionsList_initializers, void 0));
|
|
945
|
-
this.nativeSelect = (__runInitializers(this, _optionsList_extraInitializers), __runInitializers(this, _nativeSelect_initializers, void 0));
|
|
946
|
-
this.clearButton = (__runInitializers(this, _nativeSelect_extraInitializers), __runInitializers(this, _clearButton_initializers, void 0));
|
|
947
|
-
this.arrow = (__runInitializers(this, _clearButton_extraInitializers), __runInitializers(this, _arrow_initializers, void 0));
|
|
948
|
-
this.searchContainer = (__runInitializers(this, _arrow_extraInitializers), __runInitializers(this, _searchContainer_initializers, void 0));
|
|
949
|
-
this.optionElements = (__runInitializers(this, _searchContainer_extraInitializers), __runInitializers(this, _optionElements_initializers, void 0));
|
|
950
|
-
this.filteredOptions = (__runInitializers(this, _optionElements_extraInitializers), []);
|
|
951
|
-
this.selectedValues = new Set();
|
|
952
|
-
this.focusedIndex = -1;
|
|
953
|
-
}
|
|
954
934
|
static {
|
|
955
935
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
956
936
|
_disabled_decorators = [snice.property({ type: Boolean, })];
|
|
@@ -974,7 +954,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
974
954
|
_labelElement_decorators = [snice.query('.select-label')];
|
|
975
955
|
_searchInput_decorators = [snice.query('.select-search-input')];
|
|
976
956
|
_optionsList_decorators = [snice.query('.select-options')];
|
|
977
|
-
_nativeSelect_decorators = [snice.query('.select-native')];
|
|
978
957
|
_clearButton_decorators = [snice.query('.select-clear')];
|
|
979
958
|
_arrow_decorators = [snice.query('.select-arrow')];
|
|
980
959
|
_searchContainer_decorators = [snice.query('.select-search')];
|
|
@@ -987,7 +966,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
987
966
|
_handleDisabledChange_decorators = [snice.watch('disabled')];
|
|
988
967
|
_handleLoadingChange_decorators = [snice.watch('loading')];
|
|
989
968
|
_handleOpenChange_decorators = [snice.watch('open')];
|
|
990
|
-
_handleNativeSelectAttributeChange_decorators = [snice.watch('multiple', 'name')];
|
|
991
969
|
_dispatchChangeEvent_decorators = [snice.dispatch('select-change', { bubbles: true, composed: true })];
|
|
992
970
|
_dispatchOpenEvent_decorators = [snice.dispatch('select-open', { bubbles: true, composed: true })];
|
|
993
971
|
_dispatchCloseEvent_decorators = [snice.dispatch('select-close', { bubbles: true, composed: true })];
|
|
@@ -999,7 +977,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
999
977
|
__esDecorate(this, null, _handleDisabledChange_decorators, { kind: "method", name: "handleDisabledChange", static: false, private: false, access: { has: obj => "handleDisabledChange" in obj, get: obj => obj.handleDisabledChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
1000
978
|
__esDecorate(this, null, _handleLoadingChange_decorators, { kind: "method", name: "handleLoadingChange", static: false, private: false, access: { has: obj => "handleLoadingChange" in obj, get: obj => obj.handleLoadingChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
1001
979
|
__esDecorate(this, null, _handleOpenChange_decorators, { kind: "method", name: "handleOpenChange", static: false, private: false, access: { has: obj => "handleOpenChange" in obj, get: obj => obj.handleOpenChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
1002
|
-
__esDecorate(this, null, _handleNativeSelectAttributeChange_decorators, { kind: "method", name: "handleNativeSelectAttributeChange", static: false, private: false, access: { has: obj => "handleNativeSelectAttributeChange" in obj, get: obj => obj.handleNativeSelectAttributeChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
1003
980
|
__esDecorate(this, null, _dispatchChangeEvent_decorators, { kind: "method", name: "dispatchChangeEvent", static: false, private: false, access: { has: obj => "dispatchChangeEvent" in obj, get: obj => obj.dispatchChangeEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
1004
981
|
__esDecorate(this, null, _dispatchOpenEvent_decorators, { kind: "method", name: "dispatchOpenEvent", static: false, private: false, access: { has: obj => "dispatchOpenEvent" in obj, get: obj => obj.dispatchOpenEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
1005
982
|
__esDecorate(this, null, _dispatchCloseEvent_decorators, { kind: "method", name: "dispatchCloseEvent", static: false, private: false, access: { has: obj => "dispatchCloseEvent" in obj, get: obj => obj.dispatchCloseEvent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -1024,7 +1001,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
1024
1001
|
__esDecorate(null, null, _labelElement_decorators, { kind: "field", name: "labelElement", static: false, private: false, access: { has: obj => "labelElement" in obj, get: obj => obj.labelElement, set: (obj, value) => { obj.labelElement = value; } }, metadata: _metadata }, _labelElement_initializers, _labelElement_extraInitializers);
|
|
1025
1002
|
__esDecorate(null, null, _searchInput_decorators, { kind: "field", name: "searchInput", static: false, private: false, access: { has: obj => "searchInput" in obj, get: obj => obj.searchInput, set: (obj, value) => { obj.searchInput = value; } }, metadata: _metadata }, _searchInput_initializers, _searchInput_extraInitializers);
|
|
1026
1003
|
__esDecorate(null, null, _optionsList_decorators, { kind: "field", name: "optionsList", static: false, private: false, access: { has: obj => "optionsList" in obj, get: obj => obj.optionsList, set: (obj, value) => { obj.optionsList = value; } }, metadata: _metadata }, _optionsList_initializers, _optionsList_extraInitializers);
|
|
1027
|
-
__esDecorate(null, null, _nativeSelect_decorators, { kind: "field", name: "nativeSelect", static: false, private: false, access: { has: obj => "nativeSelect" in obj, get: obj => obj.nativeSelect, set: (obj, value) => { obj.nativeSelect = value; } }, metadata: _metadata }, _nativeSelect_initializers, _nativeSelect_extraInitializers);
|
|
1028
1004
|
__esDecorate(null, null, _clearButton_decorators, { kind: "field", name: "clearButton", static: false, private: false, access: { has: obj => "clearButton" in obj, get: obj => obj.clearButton, set: (obj, value) => { obj.clearButton = value; } }, metadata: _metadata }, _clearButton_initializers, _clearButton_extraInitializers);
|
|
1029
1005
|
__esDecorate(null, null, _arrow_decorators, { kind: "field", name: "arrow", static: false, private: false, access: { has: obj => "arrow" in obj, get: obj => obj.arrow, set: (obj, value) => { obj.arrow = value; } }, metadata: _metadata }, _arrow_initializers, _arrow_extraInitializers);
|
|
1030
1006
|
__esDecorate(null, null, _searchContainer_decorators, { kind: "field", name: "searchContainer", static: false, private: false, access: { has: obj => "searchContainer" in obj, get: obj => obj.searchContainer, set: (obj, value) => { obj.searchContainer = value; } }, metadata: _metadata }, _searchContainer_initializers, _searchContainer_extraInitializers);
|
|
@@ -1034,6 +1010,43 @@ var SniceTable = (function (exports, snice) {
|
|
|
1034
1010
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1035
1011
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
1036
1012
|
}
|
|
1013
|
+
constructor() {
|
|
1014
|
+
super();
|
|
1015
|
+
this.internals = __runInitializers(this, _instanceExtraInitializers);
|
|
1016
|
+
this.disabled = __runInitializers(this, _disabled_initializers, false);
|
|
1017
|
+
this.required = (__runInitializers(this, _disabled_extraInitializers), __runInitializers(this, _required_initializers, false));
|
|
1018
|
+
this.invalid = (__runInitializers(this, _required_extraInitializers), __runInitializers(this, _invalid_initializers, false));
|
|
1019
|
+
this.readonly = (__runInitializers(this, _invalid_extraInitializers), __runInitializers(this, _readonly_initializers, false));
|
|
1020
|
+
this.loading = (__runInitializers(this, _readonly_extraInitializers), __runInitializers(this, _loading_initializers, false));
|
|
1021
|
+
this.multiple = (__runInitializers(this, _loading_extraInitializers), __runInitializers(this, _multiple_initializers, false));
|
|
1022
|
+
this.searchable = (__runInitializers(this, _multiple_extraInitializers), __runInitializers(this, _searchable_initializers, false));
|
|
1023
|
+
this.clearable = (__runInitializers(this, _searchable_extraInitializers), __runInitializers(this, _clearable_initializers, false));
|
|
1024
|
+
this.open = (__runInitializers(this, _clearable_extraInitializers), __runInitializers(this, _open_initializers, false));
|
|
1025
|
+
this.size = (__runInitializers(this, _open_extraInitializers), __runInitializers(this, _size_initializers, 'medium'));
|
|
1026
|
+
this.name = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _name_initializers, ''));
|
|
1027
|
+
this.value = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
1028
|
+
this.label = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _label_initializers, ''));
|
|
1029
|
+
this.placeholder = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _placeholder_initializers, 'Select an option'));
|
|
1030
|
+
this.maxHeight = (__runInitializers(this, _placeholder_extraInitializers), __runInitializers(this, _maxHeight_initializers, '200px'));
|
|
1031
|
+
// Options will be read from child snice-option elements
|
|
1032
|
+
this.options = (__runInitializers(this, _maxHeight_extraInitializers), []);
|
|
1033
|
+
this.trigger = __runInitializers(this, _trigger_initializers, void 0);
|
|
1034
|
+
this.dropdown = (__runInitializers(this, _trigger_extraInitializers), __runInitializers(this, _dropdown_initializers, void 0));
|
|
1035
|
+
this.valueDisplay = (__runInitializers(this, _dropdown_extraInitializers), __runInitializers(this, _valueDisplay_initializers, void 0));
|
|
1036
|
+
this.labelElement = (__runInitializers(this, _valueDisplay_extraInitializers), __runInitializers(this, _labelElement_initializers, void 0));
|
|
1037
|
+
this.searchInput = (__runInitializers(this, _labelElement_extraInitializers), __runInitializers(this, _searchInput_initializers, void 0));
|
|
1038
|
+
this.optionsList = (__runInitializers(this, _searchInput_extraInitializers), __runInitializers(this, _optionsList_initializers, void 0));
|
|
1039
|
+
this.clearButton = (__runInitializers(this, _optionsList_extraInitializers), __runInitializers(this, _clearButton_initializers, void 0));
|
|
1040
|
+
this.arrow = (__runInitializers(this, _clearButton_extraInitializers), __runInitializers(this, _arrow_initializers, void 0));
|
|
1041
|
+
this.searchContainer = (__runInitializers(this, _arrow_extraInitializers), __runInitializers(this, _searchContainer_initializers, void 0));
|
|
1042
|
+
this.optionElements = (__runInitializers(this, _searchContainer_extraInitializers), __runInitializers(this, _optionElements_initializers, void 0));
|
|
1043
|
+
this.filteredOptions = (__runInitializers(this, _optionElements_extraInitializers), []);
|
|
1044
|
+
this.selectedValues = new Set();
|
|
1045
|
+
this.focusedIndex = -1;
|
|
1046
|
+
if (typeof this.attachInternals == 'function') {
|
|
1047
|
+
this.internals = this.attachInternals();
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1037
1050
|
render() {
|
|
1038
1051
|
const labelClasses = `select-label select-label--${this.size} ${this.required ? 'select-label--required' : ''}`;
|
|
1039
1052
|
const triggerClasses = `select-trigger select-trigger--${this.size} ${this.loading ? 'select-trigger--loading' : ''}`;
|
|
@@ -1099,14 +1112,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
1099
1112
|
</div>
|
|
1100
1113
|
</div>
|
|
1101
1114
|
|
|
1102
|
-
<!-- Hidden native select for form submission -->
|
|
1103
|
-
<select
|
|
1104
|
-
class="select-native"
|
|
1105
|
-
name="${this.name || ''}"
|
|
1106
|
-
tabindex="-1"
|
|
1107
|
-
aria-hidden="true">
|
|
1108
|
-
<!-- Options will be added in @ready() -->
|
|
1109
|
-
</select>
|
|
1110
1115
|
</div>
|
|
1111
1116
|
`;
|
|
1112
1117
|
}
|
|
@@ -1145,7 +1150,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
1145
1150
|
}).join('');
|
|
1146
1151
|
}
|
|
1147
1152
|
styles() {
|
|
1148
|
-
return snice.css `${cssContent$
|
|
1153
|
+
return snice.css `${cssContent$d}`;
|
|
1149
1154
|
}
|
|
1150
1155
|
init() {
|
|
1151
1156
|
// Read options from child snice-option elements
|
|
@@ -1156,16 +1161,18 @@ var SniceTable = (function (exports, snice) {
|
|
|
1156
1161
|
}
|
|
1157
1162
|
// Initialize filtered options
|
|
1158
1163
|
this.filteredOptions = [...this.options];
|
|
1164
|
+
// Set initial form value
|
|
1165
|
+
if (this.internals) {
|
|
1166
|
+
this.internals.setFormValue(this.value);
|
|
1167
|
+
}
|
|
1159
1168
|
// Wait for @query decorators to populate shadow DOM elements
|
|
1160
1169
|
requestAnimationFrame(() => {
|
|
1161
1170
|
requestAnimationFrame(() => {
|
|
1162
1171
|
// Set initial imperative state
|
|
1163
1172
|
this.updateTriggerState();
|
|
1164
1173
|
this.updateDropdownState();
|
|
1165
|
-
this.updateNativeSelectAttributes();
|
|
1166
1174
|
// Now that we have options, update everything
|
|
1167
1175
|
this.updateDropdownContent();
|
|
1168
|
-
this.updateNativeSelect();
|
|
1169
1176
|
this.updateValueDisplay();
|
|
1170
1177
|
this.updateClearButton();
|
|
1171
1178
|
});
|
|
@@ -1255,7 +1262,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
1255
1262
|
if (relevant) {
|
|
1256
1263
|
this.readOptionsFromChildren();
|
|
1257
1264
|
this.filteredOptions = [...this.options];
|
|
1258
|
-
this.updateNativeSelect();
|
|
1259
1265
|
this.updateValueDisplay();
|
|
1260
1266
|
this.updateClearButton();
|
|
1261
1267
|
this.updateDropdownContent();
|
|
@@ -1379,7 +1385,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
1379
1385
|
if (value && this.multiple) {
|
|
1380
1386
|
this.selectedValues.delete(value);
|
|
1381
1387
|
this.value = Array.from(this.selectedValues).join(',');
|
|
1382
|
-
this.updateNativeSelect();
|
|
1383
1388
|
this.updateValueDisplay();
|
|
1384
1389
|
this.updateClearButton();
|
|
1385
1390
|
this.dispatchChangeEvent();
|
|
@@ -1425,7 +1430,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
1425
1430
|
this.value = option.value;
|
|
1426
1431
|
this.closeDropdown();
|
|
1427
1432
|
}
|
|
1428
|
-
this.updateNativeSelect();
|
|
1429
1433
|
this.updateValueDisplay();
|
|
1430
1434
|
this.updateClearButton();
|
|
1431
1435
|
this.dispatchChangeEvent(option);
|
|
@@ -1434,13 +1438,14 @@ var SniceTable = (function (exports, snice) {
|
|
|
1434
1438
|
if (this.multiple) {
|
|
1435
1439
|
this.selectedValues = new Set(this.value ? this.value.split(',').map(v => v.trim()) : []);
|
|
1436
1440
|
}
|
|
1437
|
-
this.updateNativeSelect();
|
|
1438
1441
|
this.updateValueDisplay();
|
|
1439
1442
|
this.updateClearButton();
|
|
1443
|
+
if (this.internals) {
|
|
1444
|
+
this.internals.setFormValue(this.value);
|
|
1445
|
+
}
|
|
1440
1446
|
}
|
|
1441
1447
|
handleDisabledChange() {
|
|
1442
1448
|
this.updateTriggerState();
|
|
1443
|
-
this.updateNativeSelectAttributes();
|
|
1444
1449
|
this.updateClearButton();
|
|
1445
1450
|
// Side effect: close dropdown when disabled
|
|
1446
1451
|
if (this.disabled && this.open) {
|
|
@@ -1449,7 +1454,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
1449
1454
|
}
|
|
1450
1455
|
handleLoadingChange() {
|
|
1451
1456
|
this.updateTriggerState();
|
|
1452
|
-
this.updateNativeSelectAttributes();
|
|
1453
1457
|
this.updateClearButton();
|
|
1454
1458
|
// Side effect: close dropdown when loading
|
|
1455
1459
|
if (this.loading && this.open) {
|
|
@@ -1473,9 +1477,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
1473
1477
|
}
|
|
1474
1478
|
}
|
|
1475
1479
|
}
|
|
1476
|
-
handleNativeSelectAttributeChange() {
|
|
1477
|
-
this.updateNativeSelectAttributes();
|
|
1478
|
-
}
|
|
1479
1480
|
updateValueDisplay() {
|
|
1480
1481
|
if (!this.valueDisplay)
|
|
1481
1482
|
return;
|
|
@@ -1518,21 +1519,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
1518
1519
|
return;
|
|
1519
1520
|
this.optionsList.innerHTML = this.renderOptions();
|
|
1520
1521
|
}
|
|
1521
|
-
updateNativeSelect() {
|
|
1522
|
-
if (!this.nativeSelect)
|
|
1523
|
-
return;
|
|
1524
|
-
// Clear and rebuild options
|
|
1525
|
-
this.nativeSelect.innerHTML = '';
|
|
1526
|
-
this.options.forEach(opt => {
|
|
1527
|
-
const option = document.createElement('option');
|
|
1528
|
-
option.value = opt.value;
|
|
1529
|
-
option.textContent = opt.label;
|
|
1530
|
-
option.selected = this.multiple ?
|
|
1531
|
-
this.selectedValues.has(opt.value) :
|
|
1532
|
-
opt.value === this.value;
|
|
1533
|
-
this.nativeSelect.appendChild(option);
|
|
1534
|
-
});
|
|
1535
|
-
}
|
|
1536
1522
|
dispatchChangeEvent(option) {
|
|
1537
1523
|
return {
|
|
1538
1524
|
value: this.multiple ? Array.from(this.selectedValues) : this.value,
|
|
@@ -1564,7 +1550,6 @@ var SniceTable = (function (exports, snice) {
|
|
|
1564
1550
|
else {
|
|
1565
1551
|
this.value = '';
|
|
1566
1552
|
}
|
|
1567
|
-
this.updateNativeSelect();
|
|
1568
1553
|
this.updateValueDisplay();
|
|
1569
1554
|
this.updateClearButton();
|
|
1570
1555
|
this.dispatchChangeEvent();
|
|
@@ -1614,24 +1599,11 @@ var SniceTable = (function (exports, snice) {
|
|
|
1614
1599
|
this.arrow.classList.toggle('select-arrow--open', this.open);
|
|
1615
1600
|
}
|
|
1616
1601
|
}
|
|
1617
|
-
updateNativeSelectAttributes() {
|
|
1618
|
-
if (!this.nativeSelect)
|
|
1619
|
-
return;
|
|
1620
|
-
this.nativeSelect.disabled = this.disabled || this.loading;
|
|
1621
|
-
this.nativeSelect.required = this.required;
|
|
1622
|
-
this.nativeSelect.multiple = this.multiple;
|
|
1623
|
-
if (this.name) {
|
|
1624
|
-
this.nativeSelect.name = this.name;
|
|
1625
|
-
}
|
|
1626
|
-
else {
|
|
1627
|
-
this.nativeSelect.removeAttribute('name');
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
1602
|
});
|
|
1631
1603
|
return _classThis;
|
|
1632
1604
|
})();
|
|
1633
1605
|
|
|
1634
|
-
var cssContent = ":host{display:flex;align-items:center;padding:0 var(--snice-table-cell-padding,var(--snice-spacing-md,.75rem));min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem;color:var(--snice-color-text)}.cell-content{width:100%;min-width:6.25rem;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}: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:inline-flex;align-items:center;justify-content:center}:host([type=rating]) .cell-content{display:inline-flex;align-items:center;justify-content:center;gap:.125rem}.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)}:host(.negative){color:var(--snice-color-danger)}:host(.warning){color:var(--snice-color-warning);background-color:hsl(var(--snice-color-yellow-100))}:host(.danger){color:var(--snice-color-danger);background-color:hsl(var(--snice-color-red-100))}:host(.success){color:var(--snice-color-success);background-color:hsl(var(--snice-color-green-100))}:host(.info){color:var(--snice-color-primary);background-color:hsl(var(--snice-color-blue-100))}:host(.date--today){font-weight:var(--snice-font-weight-semibold);color:var(--snice-color-primary)}:host(.date--past){color:var(--snice-color-text-secondary)}:host(.date--future){color:var(--snice-color-success)}:host(.number--negative.number--negative-red){color:var(--snice-color-danger)}:host(.number--positive.number--highlighted){color:var(--snice-color-success);font-weight:var(--snice-font-weight-semibold)}:host(.number--zero){color:var(--snice-color-text-secondary)}: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)}: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,hsl(0 0% 100% / .6),transparent);animation:1.5s infinite cell-shimmer}@keyframes cell-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}:host(:focus-within){outline:2px solid var(--snice-color-primary);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);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:hsl(var(--snice-color-green-100))}:host(.negative){background-color:hsl(var(--snice-color-red-100))}.cell-content a{text-decoration:underline}}@media print{:host{font-size:.75rem}:host(.loading)::after{display:none}.cell-content a{text-decoration:underline}}";
|
|
1606
|
+
var cssContent$c = ":host{display:flex;align-items:center;padding:0 var(--snice-table-cell-padding,var(--snice-spacing-md,.75rem));min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem;color:var(--snice-color-text)}.cell-content{width:100%;min-width:6.25rem;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}: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:inline-flex;align-items:center;justify-content:center}:host([type=rating]) .cell-content{display:inline-flex;align-items:center;justify-content:center;gap:.125rem}.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)}:host(.negative){color:var(--snice-color-danger)}:host(.warning){color:var(--snice-color-warning);background-color:hsl(var(--snice-color-yellow-100))}:host(.danger){color:var(--snice-color-danger);background-color:hsl(var(--snice-color-red-100))}:host(.success){color:var(--snice-color-success);background-color:hsl(var(--snice-color-green-100))}:host(.info){color:var(--snice-color-primary);background-color:hsl(var(--snice-color-blue-100))}:host(.date--today){font-weight:var(--snice-font-weight-semibold);color:var(--snice-color-primary)}:host(.date--past){color:var(--snice-color-text-secondary)}:host(.date--future){color:var(--snice-color-success)}:host(.number--negative.number--negative-red){color:var(--snice-color-danger)}:host(.number--positive.number--highlighted){color:var(--snice-color-success);font-weight:var(--snice-font-weight-semibold)}:host(.number--zero){color:var(--snice-color-text-secondary)}: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)}: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,hsl(0 0% 100% / .6),transparent);animation:1.5s infinite cell-shimmer}@keyframes cell-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}:host(:focus-within){outline:2px solid var(--snice-color-primary);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);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:hsl(var(--snice-color-green-100))}:host(.negative){background-color:hsl(var(--snice-color-red-100))}.cell-content a{text-decoration:underline}}@media print{:host{font-size:.75rem}:host(.loading)::after{display:none}.cell-content a{text-decoration:underline}}";
|
|
1635
1607
|
|
|
1636
1608
|
(() => {
|
|
1637
1609
|
let _classDecorators = [snice.element('snice-cell')];
|
|
@@ -1702,7 +1674,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
1702
1674
|
`;
|
|
1703
1675
|
}
|
|
1704
1676
|
styles() {
|
|
1705
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
1677
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
1706
1678
|
}
|
|
1707
1679
|
init() {
|
|
1708
1680
|
this.applyAlignment();
|
|
@@ -2177,7 +2149,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
2177
2149
|
`;
|
|
2178
2150
|
}
|
|
2179
2151
|
styles() {
|
|
2180
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
2152
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
2181
2153
|
}
|
|
2182
2154
|
init() {
|
|
2183
2155
|
this.applyAlignment();
|
|
@@ -2358,7 +2330,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
2358
2330
|
`;
|
|
2359
2331
|
}
|
|
2360
2332
|
styles() {
|
|
2361
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
2333
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
2362
2334
|
}
|
|
2363
2335
|
init() {
|
|
2364
2336
|
this.applyAlignment();
|
|
@@ -2568,7 +2540,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
2568
2540
|
`;
|
|
2569
2541
|
}
|
|
2570
2542
|
styles() {
|
|
2571
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
2543
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
2572
2544
|
}
|
|
2573
2545
|
init() {
|
|
2574
2546
|
this.applyAlignment();
|
|
@@ -2820,7 +2792,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
2820
2792
|
`;
|
|
2821
2793
|
}
|
|
2822
2794
|
styles() {
|
|
2823
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
2795
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
2824
2796
|
}
|
|
2825
2797
|
init() {
|
|
2826
2798
|
this.applyAlignment();
|
|
@@ -3041,7 +3013,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
3041
3013
|
`;
|
|
3042
3014
|
}
|
|
3043
3015
|
styles() {
|
|
3044
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
3016
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
3045
3017
|
}
|
|
3046
3018
|
init() {
|
|
3047
3019
|
this.applyAlignment();
|
|
@@ -3267,7 +3239,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
3267
3239
|
`;
|
|
3268
3240
|
}
|
|
3269
3241
|
styles() {
|
|
3270
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
3242
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
3271
3243
|
}
|
|
3272
3244
|
init() {
|
|
3273
3245
|
this.applyAlignment();
|
|
@@ -3388,7 +3360,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
3388
3360
|
`;
|
|
3389
3361
|
}
|
|
3390
3362
|
styles() {
|
|
3391
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
3363
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
3392
3364
|
}
|
|
3393
3365
|
init() {
|
|
3394
3366
|
this.applyAlignment();
|
|
@@ -3518,7 +3490,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
3518
3490
|
`;
|
|
3519
3491
|
}
|
|
3520
3492
|
styles() {
|
|
3521
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
3493
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
3522
3494
|
}
|
|
3523
3495
|
init() {
|
|
3524
3496
|
this.applyAlignment();
|
|
@@ -3696,7 +3668,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
3696
3668
|
`;
|
|
3697
3669
|
}
|
|
3698
3670
|
styles() {
|
|
3699
|
-
return snice.css /*css*/ `${cssContent}`;
|
|
3671
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
3700
3672
|
}
|
|
3701
3673
|
init() {
|
|
3702
3674
|
this.applyAlignment();
|
|
@@ -3888,6 +3860,2799 @@ var SniceTable = (function (exports, snice) {
|
|
|
3888
3860
|
return _classThis;
|
|
3889
3861
|
})();
|
|
3890
3862
|
|
|
3863
|
+
(() => {
|
|
3864
|
+
let _classDecorators = [snice.element('snice-column')];
|
|
3865
|
+
let _classDescriptor;
|
|
3866
|
+
let _classExtraInitializers = [];
|
|
3867
|
+
let _classThis;
|
|
3868
|
+
let _classSuper = HTMLElement;
|
|
3869
|
+
let _instanceExtraInitializers = [];
|
|
3870
|
+
let _key_decorators;
|
|
3871
|
+
let _key_initializers = [];
|
|
3872
|
+
let _key_extraInitializers = [];
|
|
3873
|
+
let _label_decorators;
|
|
3874
|
+
let _label_initializers = [];
|
|
3875
|
+
let _label_extraInitializers = [];
|
|
3876
|
+
let _type_decorators;
|
|
3877
|
+
let _type_initializers = [];
|
|
3878
|
+
let _type_extraInitializers = [];
|
|
3879
|
+
let _align_decorators;
|
|
3880
|
+
let _align_initializers = [];
|
|
3881
|
+
let _align_extraInitializers = [];
|
|
3882
|
+
let _width_decorators;
|
|
3883
|
+
let _width_initializers = [];
|
|
3884
|
+
let _width_extraInitializers = [];
|
|
3885
|
+
let _sortable_decorators;
|
|
3886
|
+
let _sortable_initializers = [];
|
|
3887
|
+
let _sortable_extraInitializers = [];
|
|
3888
|
+
let _filterable_decorators;
|
|
3889
|
+
let _filterable_initializers = [];
|
|
3890
|
+
let _filterable_extraInitializers = [];
|
|
3891
|
+
let _wrap_decorators;
|
|
3892
|
+
let _wrap_initializers = [];
|
|
3893
|
+
let _wrap_extraInitializers = [];
|
|
3894
|
+
let _ellipsis_decorators;
|
|
3895
|
+
let _ellipsis_initializers = [];
|
|
3896
|
+
let _ellipsis_extraInitializers = [];
|
|
3897
|
+
let _tooltip_decorators;
|
|
3898
|
+
let _tooltip_initializers = [];
|
|
3899
|
+
let _tooltip_extraInitializers = [];
|
|
3900
|
+
let _decimals_decorators;
|
|
3901
|
+
let _decimals_initializers = [];
|
|
3902
|
+
let _decimals_extraInitializers = [];
|
|
3903
|
+
let _thousandsSeparator_decorators;
|
|
3904
|
+
let _thousandsSeparator_initializers = [];
|
|
3905
|
+
let _thousandsSeparator_extraInitializers = [];
|
|
3906
|
+
let _numberPrefix_decorators;
|
|
3907
|
+
let _numberPrefix_initializers = [];
|
|
3908
|
+
let _numberPrefix_extraInitializers = [];
|
|
3909
|
+
let _numberSuffix_decorators;
|
|
3910
|
+
let _numberSuffix_initializers = [];
|
|
3911
|
+
let _numberSuffix_extraInitializers = [];
|
|
3912
|
+
let _negativeStyle_decorators;
|
|
3913
|
+
let _negativeStyle_initializers = [];
|
|
3914
|
+
let _negativeStyle_extraInitializers = [];
|
|
3915
|
+
let _dateFormat_decorators;
|
|
3916
|
+
let _dateFormat_initializers = [];
|
|
3917
|
+
let _dateFormat_extraInitializers = [];
|
|
3918
|
+
let _customDateFormat_decorators;
|
|
3919
|
+
let _customDateFormat_initializers = [];
|
|
3920
|
+
let _customDateFormat_extraInitializers = [];
|
|
3921
|
+
let _dateLocale_decorators;
|
|
3922
|
+
let _dateLocale_initializers = [];
|
|
3923
|
+
let _dateLocale_extraInitializers = [];
|
|
3924
|
+
let _trueValue_decorators;
|
|
3925
|
+
let _trueValue_initializers = [];
|
|
3926
|
+
let _trueValue_extraInitializers = [];
|
|
3927
|
+
let _falseValue_decorators;
|
|
3928
|
+
let _falseValue_initializers = [];
|
|
3929
|
+
let _falseValue_extraInitializers = [];
|
|
3930
|
+
let _useSymbols_decorators;
|
|
3931
|
+
let _useSymbols_initializers = [];
|
|
3932
|
+
let _useSymbols_extraInitializers = [];
|
|
3933
|
+
let _trueSymbol_decorators;
|
|
3934
|
+
let _trueSymbol_initializers = [];
|
|
3935
|
+
let _trueSymbol_extraInitializers = [];
|
|
3936
|
+
let _falseSymbol_decorators;
|
|
3937
|
+
let _falseSymbol_initializers = [];
|
|
3938
|
+
let _falseSymbol_extraInitializers = [];
|
|
3939
|
+
let _ratingMax_decorators;
|
|
3940
|
+
let _ratingMax_initializers = [];
|
|
3941
|
+
let _ratingMax_extraInitializers = [];
|
|
3942
|
+
let _ratingSymbol_decorators;
|
|
3943
|
+
let _ratingSymbol_initializers = [];
|
|
3944
|
+
let _ratingSymbol_extraInitializers = [];
|
|
3945
|
+
let _ratingEmptySymbol_decorators;
|
|
3946
|
+
let _ratingEmptySymbol_initializers = [];
|
|
3947
|
+
let _ratingEmptySymbol_extraInitializers = [];
|
|
3948
|
+
let _ratingColor_decorators;
|
|
3949
|
+
let _ratingColor_initializers = [];
|
|
3950
|
+
let _ratingColor_extraInitializers = [];
|
|
3951
|
+
let _progressMax_decorators;
|
|
3952
|
+
let _progressMax_initializers = [];
|
|
3953
|
+
let _progressMax_extraInitializers = [];
|
|
3954
|
+
let _showPercentage_decorators;
|
|
3955
|
+
let _showPercentage_initializers = [];
|
|
3956
|
+
let _showPercentage_extraInitializers = [];
|
|
3957
|
+
let _progressColor_decorators;
|
|
3958
|
+
let _progressColor_initializers = [];
|
|
3959
|
+
let _progressColor_extraInitializers = [];
|
|
3960
|
+
let _progressBgColor_decorators;
|
|
3961
|
+
let _progressBgColor_initializers = [];
|
|
3962
|
+
let _progressBgColor_extraInitializers = [];
|
|
3963
|
+
let _progressHeight_decorators;
|
|
3964
|
+
let _progressHeight_initializers = [];
|
|
3965
|
+
let _progressHeight_extraInitializers = [];
|
|
3966
|
+
let _sparklineType_decorators;
|
|
3967
|
+
let _sparklineType_initializers = [];
|
|
3968
|
+
let _sparklineType_extraInitializers = [];
|
|
3969
|
+
let _sparklineColor_decorators;
|
|
3970
|
+
let _sparklineColor_initializers = [];
|
|
3971
|
+
let _sparklineColor_extraInitializers = [];
|
|
3972
|
+
let _sparklineWidth_decorators;
|
|
3973
|
+
let _sparklineWidth_initializers = [];
|
|
3974
|
+
let _sparklineWidth_extraInitializers = [];
|
|
3975
|
+
let _sparklineHeight_decorators;
|
|
3976
|
+
let _sparklineHeight_initializers = [];
|
|
3977
|
+
let _sparklineHeight_extraInitializers = [];
|
|
3978
|
+
let _cellBgColor_decorators;
|
|
3979
|
+
let _cellBgColor_initializers = [];
|
|
3980
|
+
let _cellBgColor_extraInitializers = [];
|
|
3981
|
+
let _cellColor_decorators;
|
|
3982
|
+
let _cellColor_initializers = [];
|
|
3983
|
+
let _cellColor_extraInitializers = [];
|
|
3984
|
+
let _cellFontWeight_decorators;
|
|
3985
|
+
let _cellFontWeight_initializers = [];
|
|
3986
|
+
let _cellFontWeight_extraInitializers = [];
|
|
3987
|
+
let _cellFontStyle_decorators;
|
|
3988
|
+
let _cellFontStyle_initializers = [];
|
|
3989
|
+
let _cellFontStyle_extraInitializers = [];
|
|
3990
|
+
let _cellFontSize_decorators;
|
|
3991
|
+
let _cellFontSize_initializers = [];
|
|
3992
|
+
let _cellFontSize_extraInitializers = [];
|
|
3993
|
+
let _cellTextDecoration_decorators;
|
|
3994
|
+
let _cellTextDecoration_initializers = [];
|
|
3995
|
+
let _cellTextDecoration_extraInitializers = [];
|
|
3996
|
+
let _render_decorators;
|
|
3997
|
+
let _handleBasicPropsChange_decorators;
|
|
3998
|
+
let _handleNumberFormatChange_decorators;
|
|
3999
|
+
let _handleDateFormatChange_decorators;
|
|
4000
|
+
let _handleBooleanFormatChange_decorators;
|
|
4001
|
+
let _handleRatingFormatChange_decorators;
|
|
4002
|
+
let _handleProgressFormatChange_decorators;
|
|
4003
|
+
let _handleSparklineFormatChange_decorators;
|
|
4004
|
+
let _handleStyleChange_decorators;
|
|
4005
|
+
(class extends _classSuper {
|
|
4006
|
+
static { _classThis = this; }
|
|
4007
|
+
constructor() {
|
|
4008
|
+
super(...arguments);
|
|
4009
|
+
this.key = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _key_initializers, ''));
|
|
4010
|
+
this.label = (__runInitializers(this, _key_extraInitializers), __runInitializers(this, _label_initializers, ''));
|
|
4011
|
+
this.type = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _type_initializers, 'text'));
|
|
4012
|
+
this.align = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
4013
|
+
this.width = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _width_initializers, ''));
|
|
4014
|
+
this.sortable = (__runInitializers(this, _width_extraInitializers), __runInitializers(this, _sortable_initializers, true));
|
|
4015
|
+
this.filterable = (__runInitializers(this, _sortable_extraInitializers), __runInitializers(this, _filterable_initializers, true));
|
|
4016
|
+
this.wrap = (__runInitializers(this, _filterable_extraInitializers), __runInitializers(this, _wrap_initializers, false));
|
|
4017
|
+
this.ellipsis = (__runInitializers(this, _wrap_extraInitializers), __runInitializers(this, _ellipsis_initializers, true));
|
|
4018
|
+
this.tooltip = (__runInitializers(this, _ellipsis_extraInitializers), __runInitializers(this, _tooltip_initializers, false));
|
|
4019
|
+
// Number formatting properties
|
|
4020
|
+
this.decimals = (__runInitializers(this, _tooltip_extraInitializers), __runInitializers(this, _decimals_initializers, void 0));
|
|
4021
|
+
this.thousandsSeparator = (__runInitializers(this, _decimals_extraInitializers), __runInitializers(this, _thousandsSeparator_initializers, void 0));
|
|
4022
|
+
this.numberPrefix = (__runInitializers(this, _thousandsSeparator_extraInitializers), __runInitializers(this, _numberPrefix_initializers, void 0));
|
|
4023
|
+
this.numberSuffix = (__runInitializers(this, _numberPrefix_extraInitializers), __runInitializers(this, _numberSuffix_initializers, void 0));
|
|
4024
|
+
this.negativeStyle = (__runInitializers(this, _numberSuffix_extraInitializers), __runInitializers(this, _negativeStyle_initializers, void 0));
|
|
4025
|
+
// Date formatting properties
|
|
4026
|
+
this.dateFormat = (__runInitializers(this, _negativeStyle_extraInitializers), __runInitializers(this, _dateFormat_initializers, void 0));
|
|
4027
|
+
this.customDateFormat = (__runInitializers(this, _dateFormat_extraInitializers), __runInitializers(this, _customDateFormat_initializers, void 0));
|
|
4028
|
+
this.dateLocale = (__runInitializers(this, _customDateFormat_extraInitializers), __runInitializers(this, _dateLocale_initializers, void 0));
|
|
4029
|
+
// Boolean formatting properties
|
|
4030
|
+
this.trueValue = (__runInitializers(this, _dateLocale_extraInitializers), __runInitializers(this, _trueValue_initializers, void 0));
|
|
4031
|
+
this.falseValue = (__runInitializers(this, _trueValue_extraInitializers), __runInitializers(this, _falseValue_initializers, void 0));
|
|
4032
|
+
this.useSymbols = (__runInitializers(this, _falseValue_extraInitializers), __runInitializers(this, _useSymbols_initializers, void 0));
|
|
4033
|
+
this.trueSymbol = (__runInitializers(this, _useSymbols_extraInitializers), __runInitializers(this, _trueSymbol_initializers, void 0));
|
|
4034
|
+
this.falseSymbol = (__runInitializers(this, _trueSymbol_extraInitializers), __runInitializers(this, _falseSymbol_initializers, void 0));
|
|
4035
|
+
// Rating formatting properties
|
|
4036
|
+
this.ratingMax = (__runInitializers(this, _falseSymbol_extraInitializers), __runInitializers(this, _ratingMax_initializers, void 0));
|
|
4037
|
+
this.ratingSymbol = (__runInitializers(this, _ratingMax_extraInitializers), __runInitializers(this, _ratingSymbol_initializers, void 0));
|
|
4038
|
+
this.ratingEmptySymbol = (__runInitializers(this, _ratingSymbol_extraInitializers), __runInitializers(this, _ratingEmptySymbol_initializers, void 0));
|
|
4039
|
+
this.ratingColor = (__runInitializers(this, _ratingEmptySymbol_extraInitializers), __runInitializers(this, _ratingColor_initializers, void 0));
|
|
4040
|
+
// Progress formatting properties
|
|
4041
|
+
this.progressMax = (__runInitializers(this, _ratingColor_extraInitializers), __runInitializers(this, _progressMax_initializers, void 0));
|
|
4042
|
+
this.showPercentage = (__runInitializers(this, _progressMax_extraInitializers), __runInitializers(this, _showPercentage_initializers, void 0));
|
|
4043
|
+
this.progressColor = (__runInitializers(this, _showPercentage_extraInitializers), __runInitializers(this, _progressColor_initializers, void 0));
|
|
4044
|
+
this.progressBgColor = (__runInitializers(this, _progressColor_extraInitializers), __runInitializers(this, _progressBgColor_initializers, void 0));
|
|
4045
|
+
this.progressHeight = (__runInitializers(this, _progressBgColor_extraInitializers), __runInitializers(this, _progressHeight_initializers, void 0));
|
|
4046
|
+
// Sparkline formatting properties
|
|
4047
|
+
this.sparklineType = (__runInitializers(this, _progressHeight_extraInitializers), __runInitializers(this, _sparklineType_initializers, void 0));
|
|
4048
|
+
this.sparklineColor = (__runInitializers(this, _sparklineType_extraInitializers), __runInitializers(this, _sparklineColor_initializers, void 0));
|
|
4049
|
+
this.sparklineWidth = (__runInitializers(this, _sparklineColor_extraInitializers), __runInitializers(this, _sparklineWidth_initializers, void 0));
|
|
4050
|
+
this.sparklineHeight = (__runInitializers(this, _sparklineWidth_extraInitializers), __runInitializers(this, _sparklineHeight_initializers, void 0));
|
|
4051
|
+
// Style properties
|
|
4052
|
+
this.cellBgColor = (__runInitializers(this, _sparklineHeight_extraInitializers), __runInitializers(this, _cellBgColor_initializers, void 0));
|
|
4053
|
+
this.cellColor = (__runInitializers(this, _cellBgColor_extraInitializers), __runInitializers(this, _cellColor_initializers, void 0));
|
|
4054
|
+
this.cellFontWeight = (__runInitializers(this, _cellColor_extraInitializers), __runInitializers(this, _cellFontWeight_initializers, void 0));
|
|
4055
|
+
this.cellFontStyle = (__runInitializers(this, _cellFontWeight_extraInitializers), __runInitializers(this, _cellFontStyle_initializers, void 0));
|
|
4056
|
+
this.cellFontSize = (__runInitializers(this, _cellFontStyle_extraInitializers), __runInitializers(this, _cellFontSize_initializers, void 0));
|
|
4057
|
+
this.cellTextDecoration = (__runInitializers(this, _cellFontSize_extraInitializers), __runInitializers(this, _cellTextDecoration_initializers, void 0));
|
|
4058
|
+
this.formatter = __runInitializers(this, _cellTextDecoration_extraInitializers);
|
|
4059
|
+
this.conditionalFormats = [];
|
|
4060
|
+
}
|
|
4061
|
+
static {
|
|
4062
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
4063
|
+
_key_decorators = [snice.property({})];
|
|
4064
|
+
_label_decorators = [snice.property({})];
|
|
4065
|
+
_type_decorators = [snice.property({})];
|
|
4066
|
+
_align_decorators = [snice.property({})];
|
|
4067
|
+
_width_decorators = [snice.property({})];
|
|
4068
|
+
_sortable_decorators = [snice.property({ type: Boolean, })];
|
|
4069
|
+
_filterable_decorators = [snice.property({ type: Boolean, })];
|
|
4070
|
+
_wrap_decorators = [snice.property({ type: Boolean, })];
|
|
4071
|
+
_ellipsis_decorators = [snice.property({ type: Boolean, })];
|
|
4072
|
+
_tooltip_decorators = [snice.property({ type: Boolean, })];
|
|
4073
|
+
_decimals_decorators = [snice.property({ type: Number, attribute: 'decimals' })];
|
|
4074
|
+
_thousandsSeparator_decorators = [snice.property({ type: Boolean, attribute: 'thousands-separator' })];
|
|
4075
|
+
_numberPrefix_decorators = [snice.property({ attribute: 'number-prefix' })];
|
|
4076
|
+
_numberSuffix_decorators = [snice.property({ attribute: 'number-suffix' })];
|
|
4077
|
+
_negativeStyle_decorators = [snice.property({ attribute: 'negative-style' })];
|
|
4078
|
+
_dateFormat_decorators = [snice.property({ attribute: 'date-format' })];
|
|
4079
|
+
_customDateFormat_decorators = [snice.property({ attribute: 'custom-date-format' })];
|
|
4080
|
+
_dateLocale_decorators = [snice.property({ attribute: 'date-locale' })];
|
|
4081
|
+
_trueValue_decorators = [snice.property({ attribute: 'true-value' })];
|
|
4082
|
+
_falseValue_decorators = [snice.property({ attribute: 'false-value' })];
|
|
4083
|
+
_useSymbols_decorators = [snice.property({ type: Boolean, attribute: 'use-symbols' })];
|
|
4084
|
+
_trueSymbol_decorators = [snice.property({ attribute: 'true-symbol' })];
|
|
4085
|
+
_falseSymbol_decorators = [snice.property({ attribute: 'false-symbol' })];
|
|
4086
|
+
_ratingMax_decorators = [snice.property({ type: Number, attribute: 'rating-max' })];
|
|
4087
|
+
_ratingSymbol_decorators = [snice.property({ attribute: 'rating-symbol' })];
|
|
4088
|
+
_ratingEmptySymbol_decorators = [snice.property({ attribute: 'rating-empty-symbol' })];
|
|
4089
|
+
_ratingColor_decorators = [snice.property({ attribute: 'rating-color' })];
|
|
4090
|
+
_progressMax_decorators = [snice.property({ type: Number, attribute: 'progress-max' })];
|
|
4091
|
+
_showPercentage_decorators = [snice.property({ type: Boolean, attribute: 'show-percentage' })];
|
|
4092
|
+
_progressColor_decorators = [snice.property({ attribute: 'progress-color' })];
|
|
4093
|
+
_progressBgColor_decorators = [snice.property({ attribute: 'progress-bg-color' })];
|
|
4094
|
+
_progressHeight_decorators = [snice.property({ attribute: 'progress-height' })];
|
|
4095
|
+
_sparklineType_decorators = [snice.property({ attribute: 'sparkline-type' })];
|
|
4096
|
+
_sparklineColor_decorators = [snice.property({ attribute: 'sparkline-color' })];
|
|
4097
|
+
_sparklineWidth_decorators = [snice.property({ type: Number, attribute: 'sparkline-width' })];
|
|
4098
|
+
_sparklineHeight_decorators = [snice.property({ type: Number, attribute: 'sparkline-height' })];
|
|
4099
|
+
_cellBgColor_decorators = [snice.property({ attribute: 'cell-bg-color' })];
|
|
4100
|
+
_cellColor_decorators = [snice.property({ attribute: 'cell-color' })];
|
|
4101
|
+
_cellFontWeight_decorators = [snice.property({ attribute: 'cell-font-weight' })];
|
|
4102
|
+
_cellFontStyle_decorators = [snice.property({ attribute: 'cell-font-style' })];
|
|
4103
|
+
_cellFontSize_decorators = [snice.property({ attribute: 'cell-font-size' })];
|
|
4104
|
+
_cellTextDecoration_decorators = [snice.property({ attribute: 'cell-text-decoration' })];
|
|
4105
|
+
_render_decorators = [snice.render()];
|
|
4106
|
+
_handleBasicPropsChange_decorators = [snice.watch('key', 'label', 'type', 'align', 'width', 'sortable', 'filterable', 'wrap', 'ellipsis', 'tooltip')];
|
|
4107
|
+
_handleNumberFormatChange_decorators = [snice.watch('decimals', 'thousandsSeparator', 'numberPrefix', 'numberSuffix', 'negativeStyle')];
|
|
4108
|
+
_handleDateFormatChange_decorators = [snice.watch('dateFormat', 'customDateFormat', 'dateLocale')];
|
|
4109
|
+
_handleBooleanFormatChange_decorators = [snice.watch('trueValue', 'falseValue', 'useSymbols', 'trueSymbol', 'falseSymbol')];
|
|
4110
|
+
_handleRatingFormatChange_decorators = [snice.watch('ratingMax', 'ratingSymbol', 'ratingEmptySymbol', 'ratingColor')];
|
|
4111
|
+
_handleProgressFormatChange_decorators = [snice.watch('progressMax', 'showPercentage', 'progressColor', 'progressBgColor', 'progressHeight')];
|
|
4112
|
+
_handleSparklineFormatChange_decorators = [snice.watch('sparklineType', 'sparklineColor', 'sparklineWidth', 'sparklineHeight')];
|
|
4113
|
+
_handleStyleChange_decorators = [snice.watch('cellBgColor', 'cellColor', 'cellFontWeight', 'cellFontStyle', 'cellFontSize', 'cellTextDecoration')];
|
|
4114
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4115
|
+
__esDecorate(this, null, _handleBasicPropsChange_decorators, { kind: "method", name: "handleBasicPropsChange", static: false, private: false, access: { has: obj => "handleBasicPropsChange" in obj, get: obj => obj.handleBasicPropsChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4116
|
+
__esDecorate(this, null, _handleNumberFormatChange_decorators, { kind: "method", name: "handleNumberFormatChange", static: false, private: false, access: { has: obj => "handleNumberFormatChange" in obj, get: obj => obj.handleNumberFormatChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4117
|
+
__esDecorate(this, null, _handleDateFormatChange_decorators, { kind: "method", name: "handleDateFormatChange", static: false, private: false, access: { has: obj => "handleDateFormatChange" in obj, get: obj => obj.handleDateFormatChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4118
|
+
__esDecorate(this, null, _handleBooleanFormatChange_decorators, { kind: "method", name: "handleBooleanFormatChange", static: false, private: false, access: { has: obj => "handleBooleanFormatChange" in obj, get: obj => obj.handleBooleanFormatChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4119
|
+
__esDecorate(this, null, _handleRatingFormatChange_decorators, { kind: "method", name: "handleRatingFormatChange", static: false, private: false, access: { has: obj => "handleRatingFormatChange" in obj, get: obj => obj.handleRatingFormatChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4120
|
+
__esDecorate(this, null, _handleProgressFormatChange_decorators, { kind: "method", name: "handleProgressFormatChange", static: false, private: false, access: { has: obj => "handleProgressFormatChange" in obj, get: obj => obj.handleProgressFormatChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4121
|
+
__esDecorate(this, null, _handleSparklineFormatChange_decorators, { kind: "method", name: "handleSparklineFormatChange", static: false, private: false, access: { has: obj => "handleSparklineFormatChange" in obj, get: obj => obj.handleSparklineFormatChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4122
|
+
__esDecorate(this, null, _handleStyleChange_decorators, { kind: "method", name: "handleStyleChange", static: false, private: false, access: { has: obj => "handleStyleChange" in obj, get: obj => obj.handleStyleChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4123
|
+
__esDecorate(null, null, _key_decorators, { kind: "field", name: "key", static: false, private: false, access: { has: obj => "key" in obj, get: obj => obj.key, set: (obj, value) => { obj.key = value; } }, metadata: _metadata }, _key_initializers, _key_extraInitializers);
|
|
4124
|
+
__esDecorate(null, null, _label_decorators, { kind: "field", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
|
|
4125
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
4126
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
4127
|
+
__esDecorate(null, null, _width_decorators, { kind: "field", name: "width", static: false, private: false, access: { has: obj => "width" in obj, get: obj => obj.width, set: (obj, value) => { obj.width = value; } }, metadata: _metadata }, _width_initializers, _width_extraInitializers);
|
|
4128
|
+
__esDecorate(null, null, _sortable_decorators, { kind: "field", name: "sortable", static: false, private: false, access: { has: obj => "sortable" in obj, get: obj => obj.sortable, set: (obj, value) => { obj.sortable = value; } }, metadata: _metadata }, _sortable_initializers, _sortable_extraInitializers);
|
|
4129
|
+
__esDecorate(null, null, _filterable_decorators, { kind: "field", name: "filterable", static: false, private: false, access: { has: obj => "filterable" in obj, get: obj => obj.filterable, set: (obj, value) => { obj.filterable = value; } }, metadata: _metadata }, _filterable_initializers, _filterable_extraInitializers);
|
|
4130
|
+
__esDecorate(null, null, _wrap_decorators, { kind: "field", name: "wrap", static: false, private: false, access: { has: obj => "wrap" in obj, get: obj => obj.wrap, set: (obj, value) => { obj.wrap = value; } }, metadata: _metadata }, _wrap_initializers, _wrap_extraInitializers);
|
|
4131
|
+
__esDecorate(null, null, _ellipsis_decorators, { kind: "field", name: "ellipsis", static: false, private: false, access: { has: obj => "ellipsis" in obj, get: obj => obj.ellipsis, set: (obj, value) => { obj.ellipsis = value; } }, metadata: _metadata }, _ellipsis_initializers, _ellipsis_extraInitializers);
|
|
4132
|
+
__esDecorate(null, null, _tooltip_decorators, { kind: "field", name: "tooltip", static: false, private: false, access: { has: obj => "tooltip" in obj, get: obj => obj.tooltip, set: (obj, value) => { obj.tooltip = value; } }, metadata: _metadata }, _tooltip_initializers, _tooltip_extraInitializers);
|
|
4133
|
+
__esDecorate(null, null, _decimals_decorators, { kind: "field", name: "decimals", static: false, private: false, access: { has: obj => "decimals" in obj, get: obj => obj.decimals, set: (obj, value) => { obj.decimals = value; } }, metadata: _metadata }, _decimals_initializers, _decimals_extraInitializers);
|
|
4134
|
+
__esDecorate(null, null, _thousandsSeparator_decorators, { kind: "field", name: "thousandsSeparator", static: false, private: false, access: { has: obj => "thousandsSeparator" in obj, get: obj => obj.thousandsSeparator, set: (obj, value) => { obj.thousandsSeparator = value; } }, metadata: _metadata }, _thousandsSeparator_initializers, _thousandsSeparator_extraInitializers);
|
|
4135
|
+
__esDecorate(null, null, _numberPrefix_decorators, { kind: "field", name: "numberPrefix", static: false, private: false, access: { has: obj => "numberPrefix" in obj, get: obj => obj.numberPrefix, set: (obj, value) => { obj.numberPrefix = value; } }, metadata: _metadata }, _numberPrefix_initializers, _numberPrefix_extraInitializers);
|
|
4136
|
+
__esDecorate(null, null, _numberSuffix_decorators, { kind: "field", name: "numberSuffix", static: false, private: false, access: { has: obj => "numberSuffix" in obj, get: obj => obj.numberSuffix, set: (obj, value) => { obj.numberSuffix = value; } }, metadata: _metadata }, _numberSuffix_initializers, _numberSuffix_extraInitializers);
|
|
4137
|
+
__esDecorate(null, null, _negativeStyle_decorators, { kind: "field", name: "negativeStyle", static: false, private: false, access: { has: obj => "negativeStyle" in obj, get: obj => obj.negativeStyle, set: (obj, value) => { obj.negativeStyle = value; } }, metadata: _metadata }, _negativeStyle_initializers, _negativeStyle_extraInitializers);
|
|
4138
|
+
__esDecorate(null, null, _dateFormat_decorators, { kind: "field", name: "dateFormat", static: false, private: false, access: { has: obj => "dateFormat" in obj, get: obj => obj.dateFormat, set: (obj, value) => { obj.dateFormat = value; } }, metadata: _metadata }, _dateFormat_initializers, _dateFormat_extraInitializers);
|
|
4139
|
+
__esDecorate(null, null, _customDateFormat_decorators, { kind: "field", name: "customDateFormat", static: false, private: false, access: { has: obj => "customDateFormat" in obj, get: obj => obj.customDateFormat, set: (obj, value) => { obj.customDateFormat = value; } }, metadata: _metadata }, _customDateFormat_initializers, _customDateFormat_extraInitializers);
|
|
4140
|
+
__esDecorate(null, null, _dateLocale_decorators, { kind: "field", name: "dateLocale", static: false, private: false, access: { has: obj => "dateLocale" in obj, get: obj => obj.dateLocale, set: (obj, value) => { obj.dateLocale = value; } }, metadata: _metadata }, _dateLocale_initializers, _dateLocale_extraInitializers);
|
|
4141
|
+
__esDecorate(null, null, _trueValue_decorators, { kind: "field", name: "trueValue", static: false, private: false, access: { has: obj => "trueValue" in obj, get: obj => obj.trueValue, set: (obj, value) => { obj.trueValue = value; } }, metadata: _metadata }, _trueValue_initializers, _trueValue_extraInitializers);
|
|
4142
|
+
__esDecorate(null, null, _falseValue_decorators, { kind: "field", name: "falseValue", static: false, private: false, access: { has: obj => "falseValue" in obj, get: obj => obj.falseValue, set: (obj, value) => { obj.falseValue = value; } }, metadata: _metadata }, _falseValue_initializers, _falseValue_extraInitializers);
|
|
4143
|
+
__esDecorate(null, null, _useSymbols_decorators, { kind: "field", name: "useSymbols", static: false, private: false, access: { has: obj => "useSymbols" in obj, get: obj => obj.useSymbols, set: (obj, value) => { obj.useSymbols = value; } }, metadata: _metadata }, _useSymbols_initializers, _useSymbols_extraInitializers);
|
|
4144
|
+
__esDecorate(null, null, _trueSymbol_decorators, { kind: "field", name: "trueSymbol", static: false, private: false, access: { has: obj => "trueSymbol" in obj, get: obj => obj.trueSymbol, set: (obj, value) => { obj.trueSymbol = value; } }, metadata: _metadata }, _trueSymbol_initializers, _trueSymbol_extraInitializers);
|
|
4145
|
+
__esDecorate(null, null, _falseSymbol_decorators, { kind: "field", name: "falseSymbol", static: false, private: false, access: { has: obj => "falseSymbol" in obj, get: obj => obj.falseSymbol, set: (obj, value) => { obj.falseSymbol = value; } }, metadata: _metadata }, _falseSymbol_initializers, _falseSymbol_extraInitializers);
|
|
4146
|
+
__esDecorate(null, null, _ratingMax_decorators, { kind: "field", name: "ratingMax", static: false, private: false, access: { has: obj => "ratingMax" in obj, get: obj => obj.ratingMax, set: (obj, value) => { obj.ratingMax = value; } }, metadata: _metadata }, _ratingMax_initializers, _ratingMax_extraInitializers);
|
|
4147
|
+
__esDecorate(null, null, _ratingSymbol_decorators, { kind: "field", name: "ratingSymbol", static: false, private: false, access: { has: obj => "ratingSymbol" in obj, get: obj => obj.ratingSymbol, set: (obj, value) => { obj.ratingSymbol = value; } }, metadata: _metadata }, _ratingSymbol_initializers, _ratingSymbol_extraInitializers);
|
|
4148
|
+
__esDecorate(null, null, _ratingEmptySymbol_decorators, { kind: "field", name: "ratingEmptySymbol", static: false, private: false, access: { has: obj => "ratingEmptySymbol" in obj, get: obj => obj.ratingEmptySymbol, set: (obj, value) => { obj.ratingEmptySymbol = value; } }, metadata: _metadata }, _ratingEmptySymbol_initializers, _ratingEmptySymbol_extraInitializers);
|
|
4149
|
+
__esDecorate(null, null, _ratingColor_decorators, { kind: "field", name: "ratingColor", static: false, private: false, access: { has: obj => "ratingColor" in obj, get: obj => obj.ratingColor, set: (obj, value) => { obj.ratingColor = value; } }, metadata: _metadata }, _ratingColor_initializers, _ratingColor_extraInitializers);
|
|
4150
|
+
__esDecorate(null, null, _progressMax_decorators, { kind: "field", name: "progressMax", static: false, private: false, access: { has: obj => "progressMax" in obj, get: obj => obj.progressMax, set: (obj, value) => { obj.progressMax = value; } }, metadata: _metadata }, _progressMax_initializers, _progressMax_extraInitializers);
|
|
4151
|
+
__esDecorate(null, null, _showPercentage_decorators, { kind: "field", name: "showPercentage", static: false, private: false, access: { has: obj => "showPercentage" in obj, get: obj => obj.showPercentage, set: (obj, value) => { obj.showPercentage = value; } }, metadata: _metadata }, _showPercentage_initializers, _showPercentage_extraInitializers);
|
|
4152
|
+
__esDecorate(null, null, _progressColor_decorators, { kind: "field", name: "progressColor", static: false, private: false, access: { has: obj => "progressColor" in obj, get: obj => obj.progressColor, set: (obj, value) => { obj.progressColor = value; } }, metadata: _metadata }, _progressColor_initializers, _progressColor_extraInitializers);
|
|
4153
|
+
__esDecorate(null, null, _progressBgColor_decorators, { kind: "field", name: "progressBgColor", static: false, private: false, access: { has: obj => "progressBgColor" in obj, get: obj => obj.progressBgColor, set: (obj, value) => { obj.progressBgColor = value; } }, metadata: _metadata }, _progressBgColor_initializers, _progressBgColor_extraInitializers);
|
|
4154
|
+
__esDecorate(null, null, _progressHeight_decorators, { kind: "field", name: "progressHeight", static: false, private: false, access: { has: obj => "progressHeight" in obj, get: obj => obj.progressHeight, set: (obj, value) => { obj.progressHeight = value; } }, metadata: _metadata }, _progressHeight_initializers, _progressHeight_extraInitializers);
|
|
4155
|
+
__esDecorate(null, null, _sparklineType_decorators, { kind: "field", name: "sparklineType", static: false, private: false, access: { has: obj => "sparklineType" in obj, get: obj => obj.sparklineType, set: (obj, value) => { obj.sparklineType = value; } }, metadata: _metadata }, _sparklineType_initializers, _sparklineType_extraInitializers);
|
|
4156
|
+
__esDecorate(null, null, _sparklineColor_decorators, { kind: "field", name: "sparklineColor", static: false, private: false, access: { has: obj => "sparklineColor" in obj, get: obj => obj.sparklineColor, set: (obj, value) => { obj.sparklineColor = value; } }, metadata: _metadata }, _sparklineColor_initializers, _sparklineColor_extraInitializers);
|
|
4157
|
+
__esDecorate(null, null, _sparklineWidth_decorators, { kind: "field", name: "sparklineWidth", static: false, private: false, access: { has: obj => "sparklineWidth" in obj, get: obj => obj.sparklineWidth, set: (obj, value) => { obj.sparklineWidth = value; } }, metadata: _metadata }, _sparklineWidth_initializers, _sparklineWidth_extraInitializers);
|
|
4158
|
+
__esDecorate(null, null, _sparklineHeight_decorators, { kind: "field", name: "sparklineHeight", static: false, private: false, access: { has: obj => "sparklineHeight" in obj, get: obj => obj.sparklineHeight, set: (obj, value) => { obj.sparklineHeight = value; } }, metadata: _metadata }, _sparklineHeight_initializers, _sparklineHeight_extraInitializers);
|
|
4159
|
+
__esDecorate(null, null, _cellBgColor_decorators, { kind: "field", name: "cellBgColor", static: false, private: false, access: { has: obj => "cellBgColor" in obj, get: obj => obj.cellBgColor, set: (obj, value) => { obj.cellBgColor = value; } }, metadata: _metadata }, _cellBgColor_initializers, _cellBgColor_extraInitializers);
|
|
4160
|
+
__esDecorate(null, null, _cellColor_decorators, { kind: "field", name: "cellColor", static: false, private: false, access: { has: obj => "cellColor" in obj, get: obj => obj.cellColor, set: (obj, value) => { obj.cellColor = value; } }, metadata: _metadata }, _cellColor_initializers, _cellColor_extraInitializers);
|
|
4161
|
+
__esDecorate(null, null, _cellFontWeight_decorators, { kind: "field", name: "cellFontWeight", static: false, private: false, access: { has: obj => "cellFontWeight" in obj, get: obj => obj.cellFontWeight, set: (obj, value) => { obj.cellFontWeight = value; } }, metadata: _metadata }, _cellFontWeight_initializers, _cellFontWeight_extraInitializers);
|
|
4162
|
+
__esDecorate(null, null, _cellFontStyle_decorators, { kind: "field", name: "cellFontStyle", static: false, private: false, access: { has: obj => "cellFontStyle" in obj, get: obj => obj.cellFontStyle, set: (obj, value) => { obj.cellFontStyle = value; } }, metadata: _metadata }, _cellFontStyle_initializers, _cellFontStyle_extraInitializers);
|
|
4163
|
+
__esDecorate(null, null, _cellFontSize_decorators, { kind: "field", name: "cellFontSize", static: false, private: false, access: { has: obj => "cellFontSize" in obj, get: obj => obj.cellFontSize, set: (obj, value) => { obj.cellFontSize = value; } }, metadata: _metadata }, _cellFontSize_initializers, _cellFontSize_extraInitializers);
|
|
4164
|
+
__esDecorate(null, null, _cellTextDecoration_decorators, { kind: "field", name: "cellTextDecoration", static: false, private: false, access: { has: obj => "cellTextDecoration" in obj, get: obj => obj.cellTextDecoration, set: (obj, value) => { obj.cellTextDecoration = value; } }, metadata: _metadata }, _cellTextDecoration_initializers, _cellTextDecoration_extraInitializers);
|
|
4165
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
4166
|
+
_classThis = _classDescriptor.value;
|
|
4167
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
4168
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
4169
|
+
}
|
|
4170
|
+
render() {
|
|
4171
|
+
return snice.html /*html*/ `<slot></slot>`;
|
|
4172
|
+
}
|
|
4173
|
+
// Set custom formatter function
|
|
4174
|
+
setFormatter(formatter) {
|
|
4175
|
+
this.formatter = formatter;
|
|
4176
|
+
this.notifyTableOfChange();
|
|
4177
|
+
}
|
|
4178
|
+
// Add conditional formatting rule
|
|
4179
|
+
addConditionalFormat(format) {
|
|
4180
|
+
this.conditionalFormats.push(format);
|
|
4181
|
+
this.notifyTableOfChange();
|
|
4182
|
+
}
|
|
4183
|
+
// Remove conditional formatting rule
|
|
4184
|
+
removeConditionalFormat(index) {
|
|
4185
|
+
this.conditionalFormats.splice(index, 1);
|
|
4186
|
+
this.notifyTableOfChange();
|
|
4187
|
+
}
|
|
4188
|
+
// Clear all conditional formatting
|
|
4189
|
+
clearConditionalFormats() {
|
|
4190
|
+
this.conditionalFormats = [];
|
|
4191
|
+
this.notifyTableOfChange();
|
|
4192
|
+
}
|
|
4193
|
+
// Get the complete column definition for the table
|
|
4194
|
+
getColumnDefinition() {
|
|
4195
|
+
const definition = {
|
|
4196
|
+
key: this.key,
|
|
4197
|
+
label: this.label,
|
|
4198
|
+
type: this.type,
|
|
4199
|
+
align: this.align,
|
|
4200
|
+
width: this.width,
|
|
4201
|
+
sortable: this.sortable,
|
|
4202
|
+
filterable: this.filterable,
|
|
4203
|
+
wrap: this.wrap,
|
|
4204
|
+
ellipsis: this.ellipsis,
|
|
4205
|
+
tooltip: this.tooltip,
|
|
4206
|
+
formatter: this.formatter,
|
|
4207
|
+
conditionalFormats: this.conditionalFormats
|
|
4208
|
+
};
|
|
4209
|
+
// Add type-specific formatting
|
|
4210
|
+
if (this.type === 'number' || this.type === 'currency' || this.type === 'percent' ||
|
|
4211
|
+
this.type === 'accounting' || this.type === 'scientific' || this.type === 'fraction') {
|
|
4212
|
+
const numberFormat = {};
|
|
4213
|
+
if (this.decimals !== undefined)
|
|
4214
|
+
numberFormat.decimals = this.decimals;
|
|
4215
|
+
if (this.thousandsSeparator !== undefined)
|
|
4216
|
+
numberFormat.thousandsSeparator = this.thousandsSeparator;
|
|
4217
|
+
if (this.numberPrefix)
|
|
4218
|
+
numberFormat.prefix = this.numberPrefix;
|
|
4219
|
+
if (this.numberSuffix)
|
|
4220
|
+
numberFormat.suffix = this.numberSuffix;
|
|
4221
|
+
if (this.negativeStyle)
|
|
4222
|
+
numberFormat.negativeStyle = this.negativeStyle;
|
|
4223
|
+
if (Object.keys(numberFormat).length > 0) {
|
|
4224
|
+
definition.numberFormat = numberFormat;
|
|
4225
|
+
}
|
|
4226
|
+
}
|
|
4227
|
+
if (this.type === 'date') {
|
|
4228
|
+
const dateFormat = {};
|
|
4229
|
+
if (this.dateFormat)
|
|
4230
|
+
dateFormat.format = this.dateFormat;
|
|
4231
|
+
if (this.customDateFormat)
|
|
4232
|
+
dateFormat.customFormat = this.customDateFormat;
|
|
4233
|
+
if (this.dateLocale)
|
|
4234
|
+
dateFormat.locale = this.dateLocale;
|
|
4235
|
+
if (Object.keys(dateFormat).length > 0) {
|
|
4236
|
+
definition.dateFormat = dateFormat;
|
|
4237
|
+
}
|
|
4238
|
+
}
|
|
4239
|
+
if (this.type === 'boolean') {
|
|
4240
|
+
const booleanFormat = {};
|
|
4241
|
+
if (this.trueValue)
|
|
4242
|
+
booleanFormat.trueValue = this.trueValue;
|
|
4243
|
+
if (this.falseValue)
|
|
4244
|
+
booleanFormat.falseValue = this.falseValue;
|
|
4245
|
+
if (this.useSymbols !== undefined)
|
|
4246
|
+
booleanFormat.useSymbols = this.useSymbols;
|
|
4247
|
+
if (this.trueSymbol)
|
|
4248
|
+
booleanFormat.trueSymbol = this.trueSymbol;
|
|
4249
|
+
if (this.falseSymbol)
|
|
4250
|
+
booleanFormat.falseSymbol = this.falseSymbol;
|
|
4251
|
+
if (Object.keys(booleanFormat).length > 0) {
|
|
4252
|
+
definition.booleanFormat = booleanFormat;
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4255
|
+
if (this.type === 'rating') {
|
|
4256
|
+
const ratingFormat = {};
|
|
4257
|
+
if (this.ratingMax !== undefined)
|
|
4258
|
+
ratingFormat.max = this.ratingMax;
|
|
4259
|
+
if (this.ratingSymbol)
|
|
4260
|
+
ratingFormat.symbol = this.ratingSymbol;
|
|
4261
|
+
if (this.ratingEmptySymbol)
|
|
4262
|
+
ratingFormat.emptySymbol = this.ratingEmptySymbol;
|
|
4263
|
+
if (this.ratingColor)
|
|
4264
|
+
ratingFormat.color = this.ratingColor;
|
|
4265
|
+
if (Object.keys(ratingFormat).length > 0) {
|
|
4266
|
+
definition.ratingFormat = ratingFormat;
|
|
4267
|
+
}
|
|
4268
|
+
}
|
|
4269
|
+
if (this.type === 'progress') {
|
|
4270
|
+
const progressFormat = {};
|
|
4271
|
+
if (this.progressMax !== undefined)
|
|
4272
|
+
progressFormat.max = this.progressMax;
|
|
4273
|
+
if (this.showPercentage !== undefined)
|
|
4274
|
+
progressFormat.showPercentage = this.showPercentage;
|
|
4275
|
+
if (this.progressColor)
|
|
4276
|
+
progressFormat.color = this.progressColor;
|
|
4277
|
+
if (this.progressBgColor)
|
|
4278
|
+
progressFormat.backgroundColor = this.progressBgColor;
|
|
4279
|
+
if (this.progressHeight)
|
|
4280
|
+
progressFormat.height = this.progressHeight;
|
|
4281
|
+
if (Object.keys(progressFormat).length > 0) {
|
|
4282
|
+
definition.progressFormat = progressFormat;
|
|
4283
|
+
}
|
|
4284
|
+
}
|
|
4285
|
+
if (this.type === 'sparkline') {
|
|
4286
|
+
const sparklineFormat = {};
|
|
4287
|
+
if (this.sparklineType)
|
|
4288
|
+
sparklineFormat.type = this.sparklineType;
|
|
4289
|
+
if (this.sparklineColor)
|
|
4290
|
+
sparklineFormat.color = this.sparklineColor;
|
|
4291
|
+
if (this.sparklineWidth !== undefined)
|
|
4292
|
+
sparklineFormat.width = this.sparklineWidth;
|
|
4293
|
+
if (this.sparklineHeight !== undefined)
|
|
4294
|
+
sparklineFormat.height = this.sparklineHeight;
|
|
4295
|
+
if (Object.keys(sparklineFormat).length > 0) {
|
|
4296
|
+
definition.sparklineFormat = sparklineFormat;
|
|
4297
|
+
}
|
|
4298
|
+
}
|
|
4299
|
+
// Add cell style if any style properties are set
|
|
4300
|
+
const cellStyle = {};
|
|
4301
|
+
if (this.cellBgColor)
|
|
4302
|
+
cellStyle.backgroundColor = this.cellBgColor;
|
|
4303
|
+
if (this.cellColor)
|
|
4304
|
+
cellStyle.color = this.cellColor;
|
|
4305
|
+
if (this.cellFontWeight)
|
|
4306
|
+
cellStyle.fontWeight = this.cellFontWeight;
|
|
4307
|
+
if (this.cellFontStyle)
|
|
4308
|
+
cellStyle.fontStyle = this.cellFontStyle;
|
|
4309
|
+
if (this.cellFontSize)
|
|
4310
|
+
cellStyle.fontSize = this.cellFontSize;
|
|
4311
|
+
if (this.cellTextDecoration)
|
|
4312
|
+
cellStyle.textDecoration = this.cellTextDecoration;
|
|
4313
|
+
if (Object.keys(cellStyle).length > 0) {
|
|
4314
|
+
definition.style = cellStyle;
|
|
4315
|
+
}
|
|
4316
|
+
return definition;
|
|
4317
|
+
}
|
|
4318
|
+
handleBasicPropsChange() {
|
|
4319
|
+
this.notifyTableOfChange();
|
|
4320
|
+
}
|
|
4321
|
+
handleNumberFormatChange() {
|
|
4322
|
+
if (this.type === 'number' || this.type === 'currency' || this.type === 'percent' ||
|
|
4323
|
+
this.type === 'accounting' || this.type === 'scientific' || this.type === 'fraction') {
|
|
4324
|
+
this.notifyTableOfChange();
|
|
4325
|
+
}
|
|
4326
|
+
}
|
|
4327
|
+
handleDateFormatChange() {
|
|
4328
|
+
if (this.type === 'date') {
|
|
4329
|
+
this.notifyTableOfChange();
|
|
4330
|
+
}
|
|
4331
|
+
}
|
|
4332
|
+
handleBooleanFormatChange() {
|
|
4333
|
+
if (this.type === 'boolean') {
|
|
4334
|
+
this.notifyTableOfChange();
|
|
4335
|
+
}
|
|
4336
|
+
}
|
|
4337
|
+
handleRatingFormatChange() {
|
|
4338
|
+
if (this.type === 'rating') {
|
|
4339
|
+
this.notifyTableOfChange();
|
|
4340
|
+
}
|
|
4341
|
+
}
|
|
4342
|
+
handleProgressFormatChange() {
|
|
4343
|
+
if (this.type === 'progress') {
|
|
4344
|
+
this.notifyTableOfChange();
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
handleSparklineFormatChange() {
|
|
4348
|
+
if (this.type === 'sparkline') {
|
|
4349
|
+
this.notifyTableOfChange();
|
|
4350
|
+
}
|
|
4351
|
+
}
|
|
4352
|
+
handleStyleChange() {
|
|
4353
|
+
this.notifyTableOfChange();
|
|
4354
|
+
}
|
|
4355
|
+
notifyTableOfChange() {
|
|
4356
|
+
// Dispatch event to parent table to notify of column definition change
|
|
4357
|
+
this.dispatchEvent(new CustomEvent('column-changed', {
|
|
4358
|
+
detail: { column: this.getColumnDefinition() },
|
|
4359
|
+
bubbles: true,
|
|
4360
|
+
composed: true
|
|
4361
|
+
}));
|
|
4362
|
+
}
|
|
4363
|
+
});
|
|
4364
|
+
return _classThis;
|
|
4365
|
+
})();
|
|
4366
|
+
|
|
4367
|
+
var cssContent$b = ":host{color:var(--snice-color-text);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}.cell-link{display:inline-flex;align-items:center;gap:.25rem;color:var(--snice-color-primary);text-decoration:none;transition:color .2s}.cell-link:hover{color:var(--snice-color-primary-dark);text-decoration:underline}.cell-link:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-radius:2px}.cell-link:visited{color:var(--snice-color-secondary)}.link-icon{display:inline-flex;align-items:center;font-size:1rem}.link-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.external-icon{display:inline-flex;align-items:center;font-size:.75rem;opacity:.7}:host([align=left]){text-align:left;justify-content:flex-start}:host([align=center]){text-align:center;justify-content:center}:host([align=right]){text-align:right;justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text);font-size:.75rem;line-height:1rem}}@media print{.cell-link{text-decoration:underline}.cell-link::after{content:\" (\" attr(href) \")\";font-size:.75rem;color:var(--snice-color-text-secondary)}}";
|
|
4368
|
+
|
|
4369
|
+
(() => {
|
|
4370
|
+
let _classDecorators = [snice.element('snice-cell-link')];
|
|
4371
|
+
let _classDescriptor;
|
|
4372
|
+
let _classExtraInitializers = [];
|
|
4373
|
+
let _classThis;
|
|
4374
|
+
let _classSuper = HTMLElement;
|
|
4375
|
+
let _instanceExtraInitializers = [];
|
|
4376
|
+
let _value_decorators;
|
|
4377
|
+
let _value_initializers = [];
|
|
4378
|
+
let _value_extraInitializers = [];
|
|
4379
|
+
let _href_decorators;
|
|
4380
|
+
let _href_initializers = [];
|
|
4381
|
+
let _href_extraInitializers = [];
|
|
4382
|
+
let _target_decorators;
|
|
4383
|
+
let _target_initializers = [];
|
|
4384
|
+
let _target_extraInitializers = [];
|
|
4385
|
+
let _external_decorators;
|
|
4386
|
+
let _external_initializers = [];
|
|
4387
|
+
let _external_extraInitializers = [];
|
|
4388
|
+
let _icon_decorators;
|
|
4389
|
+
let _icon_initializers = [];
|
|
4390
|
+
let _icon_extraInitializers = [];
|
|
4391
|
+
let _text_decorators;
|
|
4392
|
+
let _text_initializers = [];
|
|
4393
|
+
let _text_extraInitializers = [];
|
|
4394
|
+
let _column_decorators;
|
|
4395
|
+
let _column_initializers = [];
|
|
4396
|
+
let _column_extraInitializers = [];
|
|
4397
|
+
let _rowData_decorators;
|
|
4398
|
+
let _rowData_initializers = [];
|
|
4399
|
+
let _rowData_extraInitializers = [];
|
|
4400
|
+
let _align_decorators;
|
|
4401
|
+
let _align_initializers = [];
|
|
4402
|
+
let _align_extraInitializers = [];
|
|
4403
|
+
let _type_decorators;
|
|
4404
|
+
let _type_initializers = [];
|
|
4405
|
+
let _type_extraInitializers = [];
|
|
4406
|
+
let _render_decorators;
|
|
4407
|
+
let _styles_decorators;
|
|
4408
|
+
let _init_decorators;
|
|
4409
|
+
let _updateCellAttributes_decorators;
|
|
4410
|
+
(class extends _classSuper {
|
|
4411
|
+
static { _classThis = this; }
|
|
4412
|
+
static {
|
|
4413
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
4414
|
+
_value_decorators = [snice.property({ type: String })];
|
|
4415
|
+
_href_decorators = [snice.property({ type: String })];
|
|
4416
|
+
_target_decorators = [snice.property({ type: String })];
|
|
4417
|
+
_external_decorators = [snice.property({ type: Boolean, attribute: 'external' })];
|
|
4418
|
+
_icon_decorators = [snice.property({ type: String })];
|
|
4419
|
+
_text_decorators = [snice.property({ type: String })];
|
|
4420
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
4421
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
4422
|
+
_align_decorators = [snice.property({ type: String })];
|
|
4423
|
+
_type_decorators = [snice.property({ type: String })];
|
|
4424
|
+
_render_decorators = [snice.render()];
|
|
4425
|
+
_styles_decorators = [snice.styles()];
|
|
4426
|
+
_init_decorators = [snice.ready()];
|
|
4427
|
+
_updateCellAttributes_decorators = [snice.watch('value', 'column')];
|
|
4428
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4429
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4430
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4431
|
+
__esDecorate(this, null, _updateCellAttributes_decorators, { kind: "method", name: "updateCellAttributes", static: false, private: false, access: { has: obj => "updateCellAttributes" in obj, get: obj => obj.updateCellAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4432
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
4433
|
+
__esDecorate(null, null, _href_decorators, { kind: "field", name: "href", static: false, private: false, access: { has: obj => "href" in obj, get: obj => obj.href, set: (obj, value) => { obj.href = value; } }, metadata: _metadata }, _href_initializers, _href_extraInitializers);
|
|
4434
|
+
__esDecorate(null, null, _target_decorators, { kind: "field", name: "target", static: false, private: false, access: { has: obj => "target" in obj, get: obj => obj.target, set: (obj, value) => { obj.target = value; } }, metadata: _metadata }, _target_initializers, _target_extraInitializers);
|
|
4435
|
+
__esDecorate(null, null, _external_decorators, { kind: "field", name: "external", static: false, private: false, access: { has: obj => "external" in obj, get: obj => obj.external, set: (obj, value) => { obj.external = value; } }, metadata: _metadata }, _external_initializers, _external_extraInitializers);
|
|
4436
|
+
__esDecorate(null, null, _icon_decorators, { kind: "field", name: "icon", static: false, private: false, access: { has: obj => "icon" in obj, get: obj => obj.icon, set: (obj, value) => { obj.icon = value; } }, metadata: _metadata }, _icon_initializers, _icon_extraInitializers);
|
|
4437
|
+
__esDecorate(null, null, _text_decorators, { kind: "field", name: "text", static: false, private: false, access: { has: obj => "text" in obj, get: obj => obj.text, set: (obj, value) => { obj.text = value; } }, metadata: _metadata }, _text_initializers, _text_extraInitializers);
|
|
4438
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
4439
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
4440
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
4441
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
4442
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
4443
|
+
_classThis = _classDescriptor.value;
|
|
4444
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
4445
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
4446
|
+
}
|
|
4447
|
+
render() {
|
|
4448
|
+
const linkHref = this.href || this.value;
|
|
4449
|
+
const linkText = this.text || this.value;
|
|
4450
|
+
const isExternal = this.external || this.target === '_blank' || linkHref.startsWith('http');
|
|
4451
|
+
const iconHTML = this.icon ? `<span class="link-icon">${this.icon}</span>` : '';
|
|
4452
|
+
const externalIcon = isExternal ? '<span class="external-icon">↗</span>' : '';
|
|
4453
|
+
return snice.html /*html*/ `
|
|
4454
|
+
<div class="cell-content cell-content--link" part="content">
|
|
4455
|
+
<a
|
|
4456
|
+
href="${linkHref}"
|
|
4457
|
+
target="${isExternal ? '_blank' : this.target}"
|
|
4458
|
+
rel="${isExternal ? 'noopener noreferrer' : ''}"
|
|
4459
|
+
class="cell-link"
|
|
4460
|
+
part="link"
|
|
4461
|
+
>
|
|
4462
|
+
${snice.unsafeHTML(iconHTML)}
|
|
4463
|
+
<span class="link-text">${linkText}</span>
|
|
4464
|
+
${snice.unsafeHTML(externalIcon)}
|
|
4465
|
+
</a>
|
|
4466
|
+
</div>
|
|
4467
|
+
`;
|
|
4468
|
+
}
|
|
4469
|
+
styles() {
|
|
4470
|
+
return snice.css /*css*/ `${cssContent$b}`;
|
|
4471
|
+
}
|
|
4472
|
+
init() {
|
|
4473
|
+
this.updateCellAttributes();
|
|
4474
|
+
}
|
|
4475
|
+
updateCellAttributes() {
|
|
4476
|
+
// Extract link properties from column config
|
|
4477
|
+
if (this.column?.linkFormat) {
|
|
4478
|
+
const format = this.column.linkFormat;
|
|
4479
|
+
this.href = format.href || this.value;
|
|
4480
|
+
this.target = format.target || '_self';
|
|
4481
|
+
this.external = format.external || false;
|
|
4482
|
+
this.icon = format.icon || '';
|
|
4483
|
+
this.text = format.text || this.value;
|
|
4484
|
+
}
|
|
4485
|
+
}
|
|
4486
|
+
constructor() {
|
|
4487
|
+
super(...arguments);
|
|
4488
|
+
this.value = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
4489
|
+
this.href = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _href_initializers, ''));
|
|
4490
|
+
this.target = (__runInitializers(this, _href_extraInitializers), __runInitializers(this, _target_initializers, '_self'));
|
|
4491
|
+
this.external = (__runInitializers(this, _target_extraInitializers), __runInitializers(this, _external_initializers, false));
|
|
4492
|
+
this.icon = (__runInitializers(this, _external_extraInitializers), __runInitializers(this, _icon_initializers, ''));
|
|
4493
|
+
this.text = (__runInitializers(this, _icon_extraInitializers), __runInitializers(this, _text_initializers, ''));
|
|
4494
|
+
this.column = (__runInitializers(this, _text_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
4495
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
4496
|
+
this.align = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
4497
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'link'));
|
|
4498
|
+
__runInitializers(this, _type_extraInitializers);
|
|
4499
|
+
}
|
|
4500
|
+
});
|
|
4501
|
+
return _classThis;
|
|
4502
|
+
})();
|
|
4503
|
+
|
|
4504
|
+
var cssContent$a = ":host{color:var(--snice-color-text);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}.actions-container{display:inline-flex;gap:.5rem;align-items:center}.action-button{display:inline-flex;align-items:center;gap:.25rem;padding:.25rem .5rem;border:1px solid transparent;border-radius:.25rem;background:0 0;cursor:pointer;transition:.2s;font-size:.875rem;line-height:1}.action-button:hover{background:hsl(0 0% 0% / .05)}.action-button:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px}.action-button:active{transform:scale(.95)}.action-button:disabled{opacity:.5;cursor:not-allowed}.action-button:disabled:hover{background:0 0}.action-button--primary{color:var(--snice-color-primary)}.action-button--primary:hover:not(:disabled){background:hsl(var(--snice-color-blue-500) / .1)}.action-button--secondary{color:var(--snice-color-text)}.action-button--danger{color:var(--snice-color-danger)}.action-button--danger:hover:not(:disabled){background:hsl(var(--snice-color-red-500) / .1)}.action-button--success{color:var(--snice-color-success)}.action-button--success:hover:not(:disabled){background:hsl(var(--snice-color-green-500) / .1)}.action-icon{display:inline-flex;align-items:center;font-size:1rem}.action-icon--image{width:1rem;height:1rem}.action-icon--image img{width:100%;height:100%;object-fit:contain}.action-label{font-weight:500}:host([align=left]){justify-content:flex-start}:host([align=center]){justify-content:center}:host([align=right]){justify-content:flex-end}@media (max-width:768px){.action-button{padding:.25rem}.action-label{display:none}}@media print{.actions-container{display:none}}";
|
|
4505
|
+
|
|
4506
|
+
(() => {
|
|
4507
|
+
let _classDecorators = [snice.element('snice-cell-actions')];
|
|
4508
|
+
let _classDescriptor;
|
|
4509
|
+
let _classExtraInitializers = [];
|
|
4510
|
+
let _classThis;
|
|
4511
|
+
let _classSuper = HTMLElement;
|
|
4512
|
+
let _instanceExtraInitializers = [];
|
|
4513
|
+
let _actions_decorators;
|
|
4514
|
+
let _actions_initializers = [];
|
|
4515
|
+
let _actions_extraInitializers = [];
|
|
4516
|
+
let _column_decorators;
|
|
4517
|
+
let _column_initializers = [];
|
|
4518
|
+
let _column_extraInitializers = [];
|
|
4519
|
+
let _rowData_decorators;
|
|
4520
|
+
let _rowData_initializers = [];
|
|
4521
|
+
let _rowData_extraInitializers = [];
|
|
4522
|
+
let _value_decorators;
|
|
4523
|
+
let _value_initializers = [];
|
|
4524
|
+
let _value_extraInitializers = [];
|
|
4525
|
+
let _align_decorators;
|
|
4526
|
+
let _align_initializers = [];
|
|
4527
|
+
let _align_extraInitializers = [];
|
|
4528
|
+
let _type_decorators;
|
|
4529
|
+
let _type_initializers = [];
|
|
4530
|
+
let _type_extraInitializers = [];
|
|
4531
|
+
let _render_decorators;
|
|
4532
|
+
let _styles_decorators;
|
|
4533
|
+
let _init_decorators;
|
|
4534
|
+
let _extractActionsFromColumn_decorators;
|
|
4535
|
+
let _dispatchAction_decorators;
|
|
4536
|
+
(class extends _classSuper {
|
|
4537
|
+
static { _classThis = this; }
|
|
4538
|
+
static {
|
|
4539
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
4540
|
+
_actions_decorators = [snice.property({ type: Array })];
|
|
4541
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
4542
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
4543
|
+
_value_decorators = [snice.property({ type: String })];
|
|
4544
|
+
_align_decorators = [snice.property({ type: String })];
|
|
4545
|
+
_type_decorators = [snice.property({ type: String })];
|
|
4546
|
+
_render_decorators = [snice.render()];
|
|
4547
|
+
_styles_decorators = [snice.styles()];
|
|
4548
|
+
_init_decorators = [snice.ready()];
|
|
4549
|
+
_extractActionsFromColumn_decorators = [snice.watch('column')];
|
|
4550
|
+
_dispatchAction_decorators = [snice.dispatch('cell-action', { bubbles: true, composed: true })];
|
|
4551
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4552
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4553
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4554
|
+
__esDecorate(this, null, _extractActionsFromColumn_decorators, { kind: "method", name: "extractActionsFromColumn", static: false, private: false, access: { has: obj => "extractActionsFromColumn" in obj, get: obj => obj.extractActionsFromColumn }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4555
|
+
__esDecorate(this, null, _dispatchAction_decorators, { kind: "method", name: "dispatchAction", static: false, private: false, access: { has: obj => "dispatchAction" in obj, get: obj => obj.dispatchAction }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4556
|
+
__esDecorate(null, null, _actions_decorators, { kind: "field", name: "actions", static: false, private: false, access: { has: obj => "actions" in obj, get: obj => obj.actions, set: (obj, value) => { obj.actions = value; } }, metadata: _metadata }, _actions_initializers, _actions_extraInitializers);
|
|
4557
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
4558
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
4559
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
4560
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
4561
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
4562
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
4563
|
+
_classThis = _classDescriptor.value;
|
|
4564
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
4565
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
4566
|
+
}
|
|
4567
|
+
render() {
|
|
4568
|
+
if (this.actions.length === 0) {
|
|
4569
|
+
return snice.html /*html*/ `
|
|
4570
|
+
<div class="cell-content cell-content--actions" part="content">
|
|
4571
|
+
<div class="actions-container"></div>
|
|
4572
|
+
</div>
|
|
4573
|
+
`;
|
|
4574
|
+
}
|
|
4575
|
+
return snice.html /*html*/ `
|
|
4576
|
+
<div class="cell-content cell-content--actions" part="content">
|
|
4577
|
+
<div class="actions-container">
|
|
4578
|
+
${this.actions.map(action => this.renderActionButton(action))}
|
|
4579
|
+
</div>
|
|
4580
|
+
</div>
|
|
4581
|
+
`;
|
|
4582
|
+
}
|
|
4583
|
+
styles() {
|
|
4584
|
+
return snice.css /*css*/ `${cssContent$a}`;
|
|
4585
|
+
}
|
|
4586
|
+
init() {
|
|
4587
|
+
this.extractActionsFromColumn();
|
|
4588
|
+
}
|
|
4589
|
+
extractActionsFromColumn() {
|
|
4590
|
+
if (this.column?.actionsFormat?.actions) {
|
|
4591
|
+
this.actions = this.column.actionsFormat.actions;
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4594
|
+
renderActionButton(action) {
|
|
4595
|
+
const icon = action.icon || '';
|
|
4596
|
+
const label = action.label || '';
|
|
4597
|
+
const variant = action.variant || 'secondary';
|
|
4598
|
+
const disabled = action.disabled || false;
|
|
4599
|
+
// Determine if icon is an image URL or text/emoji
|
|
4600
|
+
const isImageUrl = icon && (icon.startsWith('http://') || icon.startsWith('https://') || icon.startsWith('/') || icon.startsWith('./'));
|
|
4601
|
+
let iconHTML = '';
|
|
4602
|
+
if (icon) {
|
|
4603
|
+
if (isImageUrl) {
|
|
4604
|
+
iconHTML = `<span class="action-icon action-icon--image"><img src="${icon}" alt="" /></span>`;
|
|
4605
|
+
}
|
|
4606
|
+
else {
|
|
4607
|
+
iconHTML = `<span class="action-icon">${icon}</span>`;
|
|
4608
|
+
}
|
|
4609
|
+
}
|
|
4610
|
+
return snice.html /*html*/ `
|
|
4611
|
+
<button
|
|
4612
|
+
class="action-button action-button--${variant}"
|
|
4613
|
+
part="action-button"
|
|
4614
|
+
title="${action.title || action.action}"
|
|
4615
|
+
?disabled=${disabled}
|
|
4616
|
+
@click=${(e) => this.handleActionClick(e, action.action)}
|
|
4617
|
+
>
|
|
4618
|
+
${snice.unsafeHTML(iconHTML)}
|
|
4619
|
+
${label ? snice.html /*html*/ `<span class="action-label">${label}</span>` : ''}
|
|
4620
|
+
</button>
|
|
4621
|
+
`;
|
|
4622
|
+
}
|
|
4623
|
+
handleActionClick(e, action) {
|
|
4624
|
+
e.stopPropagation();
|
|
4625
|
+
this.dispatchAction(action);
|
|
4626
|
+
}
|
|
4627
|
+
dispatchAction(action) {
|
|
4628
|
+
return {
|
|
4629
|
+
action,
|
|
4630
|
+
rowData: this.rowData,
|
|
4631
|
+
column: this.column
|
|
4632
|
+
};
|
|
4633
|
+
}
|
|
4634
|
+
constructor() {
|
|
4635
|
+
super(...arguments);
|
|
4636
|
+
this.actions = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _actions_initializers, []));
|
|
4637
|
+
this.column = (__runInitializers(this, _actions_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
4638
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
4639
|
+
this.value = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
4640
|
+
this.align = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
4641
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'actions'));
|
|
4642
|
+
__runInitializers(this, _type_extraInitializers);
|
|
4643
|
+
}
|
|
4644
|
+
});
|
|
4645
|
+
return _classThis;
|
|
4646
|
+
})();
|
|
4647
|
+
|
|
4648
|
+
var cssContent$9 = ":host{color:var(--snice-color-text);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}.tags-container{display:inline-flex;flex-wrap:wrap;gap:.25rem;align-items:center}.tag{display:inline-flex;align-items:center;padding:.125rem .5rem;border-radius:.75rem;font-size:.75rem;font-weight:500;line-height:1.25;white-space:nowrap}.tag--default{background:hsl(0 0% 0% / .08);color:var(--snice-color-text)}.tag--primary{background:hsl(var(--snice-color-blue-500) / .1);color:var(--snice-color-primary)}.tag--success{background:hsl(var(--snice-color-green-500) / .1);color:var(--snice-color-success)}.tag--danger{background:hsl(var(--snice-color-red-500) / .1);color:var(--snice-color-danger)}.tag--warning{background:hsl(var(--snice-color-yellow-500) / .1);color:var(--snice-color-warning)}.tag--info{background:hsl(var(--snice-color-blue-400) / .1);color:var(--snice-color-primary)}:host([align=left]){justify-content:flex-start}:host([align=center]){justify-content:center}:host([align=right]){justify-content:flex-end}@media (max-width:768px){.tag{font-size:.6875rem;padding:.0625rem .375rem}}@media print{.tag{border:1px solid currentColor}}";
|
|
4649
|
+
|
|
4650
|
+
(() => {
|
|
4651
|
+
let _classDecorators = [snice.element('snice-cell-tag')];
|
|
4652
|
+
let _classDescriptor;
|
|
4653
|
+
let _classExtraInitializers = [];
|
|
4654
|
+
let _classThis;
|
|
4655
|
+
let _classSuper = HTMLElement;
|
|
4656
|
+
let _instanceExtraInitializers = [];
|
|
4657
|
+
let _tags_decorators;
|
|
4658
|
+
let _tags_initializers = [];
|
|
4659
|
+
let _tags_extraInitializers = [];
|
|
4660
|
+
let _value_decorators;
|
|
4661
|
+
let _value_initializers = [];
|
|
4662
|
+
let _value_extraInitializers = [];
|
|
4663
|
+
let _variant_decorators;
|
|
4664
|
+
let _variant_initializers = [];
|
|
4665
|
+
let _variant_extraInitializers = [];
|
|
4666
|
+
let _column_decorators;
|
|
4667
|
+
let _column_initializers = [];
|
|
4668
|
+
let _column_extraInitializers = [];
|
|
4669
|
+
let _rowData_decorators;
|
|
4670
|
+
let _rowData_initializers = [];
|
|
4671
|
+
let _rowData_extraInitializers = [];
|
|
4672
|
+
let _align_decorators;
|
|
4673
|
+
let _align_initializers = [];
|
|
4674
|
+
let _align_extraInitializers = [];
|
|
4675
|
+
let _type_decorators;
|
|
4676
|
+
let _type_initializers = [];
|
|
4677
|
+
let _type_extraInitializers = [];
|
|
4678
|
+
let _render_decorators;
|
|
4679
|
+
let _styles_decorators;
|
|
4680
|
+
let _init_decorators;
|
|
4681
|
+
let _extractTagsFromColumn_decorators;
|
|
4682
|
+
(class extends _classSuper {
|
|
4683
|
+
static { _classThis = this; }
|
|
4684
|
+
static {
|
|
4685
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
4686
|
+
_tags_decorators = [snice.property({ type: Array })];
|
|
4687
|
+
_value_decorators = [snice.property({ type: String })];
|
|
4688
|
+
_variant_decorators = [snice.property({ type: String })];
|
|
4689
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
4690
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
4691
|
+
_align_decorators = [snice.property({ type: String })];
|
|
4692
|
+
_type_decorators = [snice.property({ type: String })];
|
|
4693
|
+
_render_decorators = [snice.render()];
|
|
4694
|
+
_styles_decorators = [snice.styles()];
|
|
4695
|
+
_init_decorators = [snice.ready()];
|
|
4696
|
+
_extractTagsFromColumn_decorators = [snice.watch('value', 'column')];
|
|
4697
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4698
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4699
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4700
|
+
__esDecorate(this, null, _extractTagsFromColumn_decorators, { kind: "method", name: "extractTagsFromColumn", static: false, private: false, access: { has: obj => "extractTagsFromColumn" in obj, get: obj => obj.extractTagsFromColumn }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4701
|
+
__esDecorate(null, null, _tags_decorators, { kind: "field", name: "tags", static: false, private: false, access: { has: obj => "tags" in obj, get: obj => obj.tags, set: (obj, value) => { obj.tags = value; } }, metadata: _metadata }, _tags_initializers, _tags_extraInitializers);
|
|
4702
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
4703
|
+
__esDecorate(null, null, _variant_decorators, { kind: "field", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
4704
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
4705
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
4706
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
4707
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
4708
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
4709
|
+
_classThis = _classDescriptor.value;
|
|
4710
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
4711
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
4712
|
+
}
|
|
4713
|
+
render() {
|
|
4714
|
+
const tagList = this.tags.length > 0 ? this.tags : this.parseValue();
|
|
4715
|
+
return snice.html /*html*/ `
|
|
4716
|
+
<div class="cell-content cell-content--tag" part="content">
|
|
4717
|
+
<div class="tags-container">
|
|
4718
|
+
${tagList.map(tag => this.renderTag(tag))}
|
|
4719
|
+
</div>
|
|
4720
|
+
</div>
|
|
4721
|
+
`;
|
|
4722
|
+
}
|
|
4723
|
+
styles() {
|
|
4724
|
+
return snice.css /*css*/ `${cssContent$9}`;
|
|
4725
|
+
}
|
|
4726
|
+
init() {
|
|
4727
|
+
this.extractTagsFromColumn();
|
|
4728
|
+
}
|
|
4729
|
+
extractTagsFromColumn() {
|
|
4730
|
+
if (this.column?.tagFormat) {
|
|
4731
|
+
this.variant = this.column.tagFormat.variant || 'default';
|
|
4732
|
+
}
|
|
4733
|
+
}
|
|
4734
|
+
parseValue() {
|
|
4735
|
+
if (!this.value)
|
|
4736
|
+
return [];
|
|
4737
|
+
if (Array.isArray(this.value))
|
|
4738
|
+
return this.value;
|
|
4739
|
+
if (typeof this.value === 'string') {
|
|
4740
|
+
// Try parsing as JSON array first
|
|
4741
|
+
try {
|
|
4742
|
+
const parsed = JSON.parse(this.value);
|
|
4743
|
+
if (Array.isArray(parsed))
|
|
4744
|
+
return parsed;
|
|
4745
|
+
}
|
|
4746
|
+
catch { }
|
|
4747
|
+
// Otherwise split by comma
|
|
4748
|
+
return this.value.split(',').map(t => t.trim()).filter(t => t);
|
|
4749
|
+
}
|
|
4750
|
+
return [String(this.value)];
|
|
4751
|
+
}
|
|
4752
|
+
renderTag(tag) {
|
|
4753
|
+
return snice.html /*html*/ `
|
|
4754
|
+
<span class="tag tag--${this.variant}" part="tag">
|
|
4755
|
+
${tag}
|
|
4756
|
+
</span>
|
|
4757
|
+
`;
|
|
4758
|
+
}
|
|
4759
|
+
constructor() {
|
|
4760
|
+
super(...arguments);
|
|
4761
|
+
this.tags = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _tags_initializers, []));
|
|
4762
|
+
this.value = (__runInitializers(this, _tags_extraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
4763
|
+
this.variant = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _variant_initializers, 'default'));
|
|
4764
|
+
this.column = (__runInitializers(this, _variant_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
4765
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
4766
|
+
this.align = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
4767
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'tag'));
|
|
4768
|
+
__runInitializers(this, _type_extraInitializers);
|
|
4769
|
+
}
|
|
4770
|
+
});
|
|
4771
|
+
return _classThis;
|
|
4772
|
+
})();
|
|
4773
|
+
|
|
4774
|
+
var cssContent$8 = ":host{color:var(--snice-color-text);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}.cell-image{display:block;object-fit:cover;background-color:hsl(var(--snice-color-gray-100))}.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,hsl(var(--snice-color-gray-200)) 0,hsl(var(--snice-color-gray-300)) 100%);border:1px solid hsl(var(--snice-color-gray-300));position:relative}.cell-image--placeholder::after{content:'📷';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.875rem;opacity:.5}: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}}";
|
|
4775
|
+
|
|
4776
|
+
(() => {
|
|
4777
|
+
let _classDecorators = [snice.element('snice-cell-image')];
|
|
4778
|
+
let _classDescriptor;
|
|
4779
|
+
let _classExtraInitializers = [];
|
|
4780
|
+
let _classThis;
|
|
4781
|
+
let _classSuper = HTMLElement;
|
|
4782
|
+
let _instanceExtraInitializers = [];
|
|
4783
|
+
let _value_decorators;
|
|
4784
|
+
let _value_initializers = [];
|
|
4785
|
+
let _value_extraInitializers = [];
|
|
4786
|
+
let _src_decorators;
|
|
4787
|
+
let _src_initializers = [];
|
|
4788
|
+
let _src_extraInitializers = [];
|
|
4789
|
+
let _alt_decorators;
|
|
4790
|
+
let _alt_initializers = [];
|
|
4791
|
+
let _alt_extraInitializers = [];
|
|
4792
|
+
let _fallback_decorators;
|
|
4793
|
+
let _fallback_initializers = [];
|
|
4794
|
+
let _fallback_extraInitializers = [];
|
|
4795
|
+
let _variant_decorators;
|
|
4796
|
+
let _variant_initializers = [];
|
|
4797
|
+
let _variant_extraInitializers = [];
|
|
4798
|
+
let _size_decorators;
|
|
4799
|
+
let _size_initializers = [];
|
|
4800
|
+
let _size_extraInitializers = [];
|
|
4801
|
+
let _lazy_decorators;
|
|
4802
|
+
let _lazy_initializers = [];
|
|
4803
|
+
let _lazy_extraInitializers = [];
|
|
4804
|
+
let _column_decorators;
|
|
4805
|
+
let _column_initializers = [];
|
|
4806
|
+
let _column_extraInitializers = [];
|
|
4807
|
+
let _rowData_decorators;
|
|
4808
|
+
let _rowData_initializers = [];
|
|
4809
|
+
let _rowData_extraInitializers = [];
|
|
4810
|
+
let _align_decorators;
|
|
4811
|
+
let _align_initializers = [];
|
|
4812
|
+
let _align_extraInitializers = [];
|
|
4813
|
+
let _type_decorators;
|
|
4814
|
+
let _type_initializers = [];
|
|
4815
|
+
let _type_extraInitializers = [];
|
|
4816
|
+
let _imageError_decorators;
|
|
4817
|
+
let _imageError_initializers = [];
|
|
4818
|
+
let _imageError_extraInitializers = [];
|
|
4819
|
+
let _render_decorators;
|
|
4820
|
+
let _styles_decorators;
|
|
4821
|
+
let _init_decorators;
|
|
4822
|
+
let _updateImageAttributes_decorators;
|
|
4823
|
+
(class extends _classSuper {
|
|
4824
|
+
static { _classThis = this; }
|
|
4825
|
+
static {
|
|
4826
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
4827
|
+
_value_decorators = [snice.property({ type: String })];
|
|
4828
|
+
_src_decorators = [snice.property({ type: String })];
|
|
4829
|
+
_alt_decorators = [snice.property({ type: String })];
|
|
4830
|
+
_fallback_decorators = [snice.property({ type: String })];
|
|
4831
|
+
_variant_decorators = [snice.property({ type: String })];
|
|
4832
|
+
_size_decorators = [snice.property({ type: String })];
|
|
4833
|
+
_lazy_decorators = [snice.property({ type: Boolean })];
|
|
4834
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
4835
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
4836
|
+
_align_decorators = [snice.property({ type: String })];
|
|
4837
|
+
_type_decorators = [snice.property({ type: String })];
|
|
4838
|
+
_imageError_decorators = [snice.property({ type: Boolean })];
|
|
4839
|
+
_render_decorators = [snice.render()];
|
|
4840
|
+
_styles_decorators = [snice.styles()];
|
|
4841
|
+
_init_decorators = [snice.ready()];
|
|
4842
|
+
_updateImageAttributes_decorators = [snice.watch('column')];
|
|
4843
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4844
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4845
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4846
|
+
__esDecorate(this, null, _updateImageAttributes_decorators, { kind: "method", name: "updateImageAttributes", static: false, private: false, access: { has: obj => "updateImageAttributes" in obj, get: obj => obj.updateImageAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4847
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
4848
|
+
__esDecorate(null, null, _src_decorators, { kind: "field", name: "src", static: false, private: false, access: { has: obj => "src" in obj, get: obj => obj.src, set: (obj, value) => { obj.src = value; } }, metadata: _metadata }, _src_initializers, _src_extraInitializers);
|
|
4849
|
+
__esDecorate(null, null, _alt_decorators, { kind: "field", name: "alt", static: false, private: false, access: { has: obj => "alt" in obj, get: obj => obj.alt, set: (obj, value) => { obj.alt = value; } }, metadata: _metadata }, _alt_initializers, _alt_extraInitializers);
|
|
4850
|
+
__esDecorate(null, null, _fallback_decorators, { kind: "field", name: "fallback", static: false, private: false, access: { has: obj => "fallback" in obj, get: obj => obj.fallback, set: (obj, value) => { obj.fallback = value; } }, metadata: _metadata }, _fallback_initializers, _fallback_extraInitializers);
|
|
4851
|
+
__esDecorate(null, null, _variant_decorators, { kind: "field", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
4852
|
+
__esDecorate(null, null, _size_decorators, { kind: "field", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
4853
|
+
__esDecorate(null, null, _lazy_decorators, { kind: "field", name: "lazy", static: false, private: false, access: { has: obj => "lazy" in obj, get: obj => obj.lazy, set: (obj, value) => { obj.lazy = value; } }, metadata: _metadata }, _lazy_initializers, _lazy_extraInitializers);
|
|
4854
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
4855
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
4856
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
4857
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
4858
|
+
__esDecorate(null, null, _imageError_decorators, { kind: "field", name: "imageError", static: false, private: false, access: { has: obj => "imageError" in obj, get: obj => obj.imageError, set: (obj, value) => { obj.imageError = value; } }, metadata: _metadata }, _imageError_initializers, _imageError_extraInitializers);
|
|
4859
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
4860
|
+
_classThis = _classDescriptor.value;
|
|
4861
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
4862
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
4863
|
+
}
|
|
4864
|
+
render() {
|
|
4865
|
+
const imageSrc = this.src || this.value;
|
|
4866
|
+
const imageAlt = this.alt || 'Image';
|
|
4867
|
+
const loadingAttr = this.lazy ? 'lazy' : 'eager';
|
|
4868
|
+
const variantClass = `image--${this.variant}`;
|
|
4869
|
+
const sizeClass = `image--${this.size}`;
|
|
4870
|
+
const classes = `cell-image ${variantClass} ${sizeClass}`;
|
|
4871
|
+
if (this.imageError && this.fallback) {
|
|
4872
|
+
return snice.html /*html*/ `
|
|
4873
|
+
<div class="cell-content cell-content--image" part="content">
|
|
4874
|
+
<img src="${this.fallback}" alt="${imageAlt}" class="${classes}" />
|
|
4875
|
+
</div>
|
|
4876
|
+
`;
|
|
4877
|
+
}
|
|
4878
|
+
if (imageSrc) {
|
|
4879
|
+
return snice.html /*html*/ `
|
|
4880
|
+
<div class="cell-content cell-content--image" part="content">
|
|
4881
|
+
<img src="${imageSrc}" alt="${imageAlt}" loading="${loadingAttr}" class="${classes}" @error=${this.handleImageError} />
|
|
4882
|
+
</div>
|
|
4883
|
+
`;
|
|
4884
|
+
}
|
|
4885
|
+
return snice.html /*html*/ `
|
|
4886
|
+
<div class="cell-content cell-content--image" part="content">
|
|
4887
|
+
<div class="${classes} cell-image--placeholder"></div>
|
|
4888
|
+
</div>
|
|
4889
|
+
`;
|
|
4890
|
+
}
|
|
4891
|
+
styles() {
|
|
4892
|
+
return snice.css /*css*/ `${cssContent$8}`;
|
|
4893
|
+
}
|
|
4894
|
+
init() {
|
|
4895
|
+
this.updateImageAttributes();
|
|
4896
|
+
}
|
|
4897
|
+
updateImageAttributes() {
|
|
4898
|
+
if (this.column?.imageFormat) {
|
|
4899
|
+
const format = this.column.imageFormat;
|
|
4900
|
+
this.src = format.src || this.value;
|
|
4901
|
+
this.alt = format.alt || '';
|
|
4902
|
+
this.fallback = format.fallback || '';
|
|
4903
|
+
this.variant = format.variant || 'rounded';
|
|
4904
|
+
this.size = format.size || 'medium';
|
|
4905
|
+
this.lazy = format.lazy ?? true;
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
handleImageError() {
|
|
4909
|
+
this.imageError = true;
|
|
4910
|
+
}
|
|
4911
|
+
constructor() {
|
|
4912
|
+
super(...arguments);
|
|
4913
|
+
this.value = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
4914
|
+
this.src = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _src_initializers, ''));
|
|
4915
|
+
this.alt = (__runInitializers(this, _src_extraInitializers), __runInitializers(this, _alt_initializers, ''));
|
|
4916
|
+
this.fallback = (__runInitializers(this, _alt_extraInitializers), __runInitializers(this, _fallback_initializers, ''));
|
|
4917
|
+
this.variant = (__runInitializers(this, _fallback_extraInitializers), __runInitializers(this, _variant_initializers, 'rounded'));
|
|
4918
|
+
this.size = (__runInitializers(this, _variant_extraInitializers), __runInitializers(this, _size_initializers, 'medium'));
|
|
4919
|
+
this.lazy = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _lazy_initializers, true));
|
|
4920
|
+
this.column = (__runInitializers(this, _lazy_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
4921
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
4922
|
+
this.align = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _align_initializers, 'center'));
|
|
4923
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'image'));
|
|
4924
|
+
this.imageError = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _imageError_initializers, false));
|
|
4925
|
+
__runInitializers(this, _imageError_extraInitializers);
|
|
4926
|
+
}
|
|
4927
|
+
});
|
|
4928
|
+
return _classThis;
|
|
4929
|
+
})();
|
|
4930
|
+
|
|
4931
|
+
var cssContent$7 = ":host{color:var(--snice-color-text);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}.email-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.email-link{color:var(--snice-color-primary);text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-link:hover{color:var(--snice-color-primary-dark);text-decoration:underline}.email-link:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-radius:2px}.email-link:visited{color:var(--snice-color-secondary)}.email-empty{color:var(--snice-color-text-secondary);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);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)}.email-icon{display:none}}";
|
|
4932
|
+
|
|
4933
|
+
(() => {
|
|
4934
|
+
let _classDecorators = [snice.element('snice-cell-email')];
|
|
4935
|
+
let _classDescriptor;
|
|
4936
|
+
let _classExtraInitializers = [];
|
|
4937
|
+
let _classThis;
|
|
4938
|
+
let _classSuper = HTMLElement;
|
|
4939
|
+
let _instanceExtraInitializers = [];
|
|
4940
|
+
let _value_decorators;
|
|
4941
|
+
let _value_initializers = [];
|
|
4942
|
+
let _value_extraInitializers = [];
|
|
4943
|
+
let _email_decorators;
|
|
4944
|
+
let _email_initializers = [];
|
|
4945
|
+
let _email_extraInitializers = [];
|
|
4946
|
+
let _displayText_decorators;
|
|
4947
|
+
let _displayText_initializers = [];
|
|
4948
|
+
let _displayText_extraInitializers = [];
|
|
4949
|
+
let _showIcon_decorators;
|
|
4950
|
+
let _showIcon_initializers = [];
|
|
4951
|
+
let _showIcon_extraInitializers = [];
|
|
4952
|
+
let _column_decorators;
|
|
4953
|
+
let _column_initializers = [];
|
|
4954
|
+
let _column_extraInitializers = [];
|
|
4955
|
+
let _rowData_decorators;
|
|
4956
|
+
let _rowData_initializers = [];
|
|
4957
|
+
let _rowData_extraInitializers = [];
|
|
4958
|
+
let _align_decorators;
|
|
4959
|
+
let _align_initializers = [];
|
|
4960
|
+
let _align_extraInitializers = [];
|
|
4961
|
+
let _type_decorators;
|
|
4962
|
+
let _type_initializers = [];
|
|
4963
|
+
let _type_extraInitializers = [];
|
|
4964
|
+
let _render_decorators;
|
|
4965
|
+
let _styles_decorators;
|
|
4966
|
+
let _init_decorators;
|
|
4967
|
+
let _updateEmailAttributes_decorators;
|
|
4968
|
+
(class extends _classSuper {
|
|
4969
|
+
static { _classThis = this; }
|
|
4970
|
+
static {
|
|
4971
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
4972
|
+
_value_decorators = [snice.property({ type: String })];
|
|
4973
|
+
_email_decorators = [snice.property({ type: String })];
|
|
4974
|
+
_displayText_decorators = [snice.property({ type: String })];
|
|
4975
|
+
_showIcon_decorators = [snice.property({ type: Boolean })];
|
|
4976
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
4977
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
4978
|
+
_align_decorators = [snice.property({ type: String })];
|
|
4979
|
+
_type_decorators = [snice.property({ type: String })];
|
|
4980
|
+
_render_decorators = [snice.render()];
|
|
4981
|
+
_styles_decorators = [snice.styles()];
|
|
4982
|
+
_init_decorators = [snice.ready()];
|
|
4983
|
+
_updateEmailAttributes_decorators = [snice.watch('value', 'column')];
|
|
4984
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4985
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4986
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4987
|
+
__esDecorate(this, null, _updateEmailAttributes_decorators, { kind: "method", name: "updateEmailAttributes", static: false, private: false, access: { has: obj => "updateEmailAttributes" in obj, get: obj => obj.updateEmailAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4988
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
4989
|
+
__esDecorate(null, null, _email_decorators, { kind: "field", name: "email", static: false, private: false, access: { has: obj => "email" in obj, get: obj => obj.email, set: (obj, value) => { obj.email = value; } }, metadata: _metadata }, _email_initializers, _email_extraInitializers);
|
|
4990
|
+
__esDecorate(null, null, _displayText_decorators, { kind: "field", name: "displayText", static: false, private: false, access: { has: obj => "displayText" in obj, get: obj => obj.displayText, set: (obj, value) => { obj.displayText = value; } }, metadata: _metadata }, _displayText_initializers, _displayText_extraInitializers);
|
|
4991
|
+
__esDecorate(null, null, _showIcon_decorators, { kind: "field", name: "showIcon", static: false, private: false, access: { has: obj => "showIcon" in obj, get: obj => obj.showIcon, set: (obj, value) => { obj.showIcon = value; } }, metadata: _metadata }, _showIcon_initializers, _showIcon_extraInitializers);
|
|
4992
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
4993
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
4994
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
4995
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
4996
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
4997
|
+
_classThis = _classDescriptor.value;
|
|
4998
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
4999
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
5000
|
+
}
|
|
5001
|
+
render() {
|
|
5002
|
+
const emailAddress = this.email || this.value;
|
|
5003
|
+
const displayName = this.displayText || emailAddress;
|
|
5004
|
+
const iconHTML = this.showIcon ? '<span class="email-icon">✉</span>' : '';
|
|
5005
|
+
if (!emailAddress) {
|
|
5006
|
+
return snice.html /*html*/ `
|
|
5007
|
+
<div class="cell-content cell-content--email" part="content">
|
|
5008
|
+
<span class="email-empty"></span>
|
|
5009
|
+
</div>
|
|
5010
|
+
`;
|
|
5011
|
+
}
|
|
5012
|
+
return snice.html /*html*/ `
|
|
5013
|
+
<div class="cell-content cell-content--email" part="content">
|
|
5014
|
+
${snice.unsafeHTML(iconHTML)}
|
|
5015
|
+
<a href="mailto:${emailAddress}" class="email-link" part="link">
|
|
5016
|
+
${displayName}
|
|
5017
|
+
</a>
|
|
5018
|
+
</div>
|
|
5019
|
+
`;
|
|
5020
|
+
}
|
|
5021
|
+
styles() {
|
|
5022
|
+
return snice.css /*css*/ `${cssContent$7}`;
|
|
5023
|
+
}
|
|
5024
|
+
init() {
|
|
5025
|
+
this.updateEmailAttributes();
|
|
5026
|
+
}
|
|
5027
|
+
updateEmailAttributes() {
|
|
5028
|
+
if (this.column?.emailFormat) {
|
|
5029
|
+
const format = this.column.emailFormat;
|
|
5030
|
+
this.email = format.email || this.value;
|
|
5031
|
+
this.displayText = format.displayText || '';
|
|
5032
|
+
this.showIcon = format.showIcon ?? true;
|
|
5033
|
+
}
|
|
5034
|
+
}
|
|
5035
|
+
constructor() {
|
|
5036
|
+
super(...arguments);
|
|
5037
|
+
this.value = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
5038
|
+
this.email = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _email_initializers, ''));
|
|
5039
|
+
this.displayText = (__runInitializers(this, _email_extraInitializers), __runInitializers(this, _displayText_initializers, ''));
|
|
5040
|
+
this.showIcon = (__runInitializers(this, _displayText_extraInitializers), __runInitializers(this, _showIcon_initializers, true));
|
|
5041
|
+
this.column = (__runInitializers(this, _showIcon_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
5042
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
5043
|
+
this.align = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
5044
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'email'));
|
|
5045
|
+
__runInitializers(this, _type_extraInitializers);
|
|
5046
|
+
}
|
|
5047
|
+
});
|
|
5048
|
+
return _classThis;
|
|
5049
|
+
})();
|
|
5050
|
+
|
|
5051
|
+
var cssContent$6 = ":host{color:var(--snice-color-text);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);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-dark);text-decoration:underline}.phone-link:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-radius:2px}.phone-link:visited{color:var(--snice-color-secondary)}.phone-empty{color:var(--snice-color-text-secondary);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);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)}.phone-icon{display:none}}";
|
|
5052
|
+
|
|
5053
|
+
(() => {
|
|
5054
|
+
let _classDecorators = [snice.element('snice-cell-phone')];
|
|
5055
|
+
let _classDescriptor;
|
|
5056
|
+
let _classExtraInitializers = [];
|
|
5057
|
+
let _classThis;
|
|
5058
|
+
let _classSuper = HTMLElement;
|
|
5059
|
+
let _instanceExtraInitializers = [];
|
|
5060
|
+
let _value_decorators;
|
|
5061
|
+
let _value_initializers = [];
|
|
5062
|
+
let _value_extraInitializers = [];
|
|
5063
|
+
let _phone_decorators;
|
|
5064
|
+
let _phone_initializers = [];
|
|
5065
|
+
let _phone_extraInitializers = [];
|
|
5066
|
+
let _displayText_decorators;
|
|
5067
|
+
let _displayText_initializers = [];
|
|
5068
|
+
let _displayText_extraInitializers = [];
|
|
5069
|
+
let _showIcon_decorators;
|
|
5070
|
+
let _showIcon_initializers = [];
|
|
5071
|
+
let _showIcon_extraInitializers = [];
|
|
5072
|
+
let _format_decorators;
|
|
5073
|
+
let _format_initializers = [];
|
|
5074
|
+
let _format_extraInitializers = [];
|
|
5075
|
+
let _country_decorators;
|
|
5076
|
+
let _country_initializers = [];
|
|
5077
|
+
let _country_extraInitializers = [];
|
|
5078
|
+
let _column_decorators;
|
|
5079
|
+
let _column_initializers = [];
|
|
5080
|
+
let _column_extraInitializers = [];
|
|
5081
|
+
let _rowData_decorators;
|
|
5082
|
+
let _rowData_initializers = [];
|
|
5083
|
+
let _rowData_extraInitializers = [];
|
|
5084
|
+
let _align_decorators;
|
|
5085
|
+
let _align_initializers = [];
|
|
5086
|
+
let _align_extraInitializers = [];
|
|
5087
|
+
let _type_decorators;
|
|
5088
|
+
let _type_initializers = [];
|
|
5089
|
+
let _type_extraInitializers = [];
|
|
5090
|
+
let _render_decorators;
|
|
5091
|
+
let _styles_decorators;
|
|
5092
|
+
let _init_decorators;
|
|
5093
|
+
let _updatePhoneAttributes_decorators;
|
|
5094
|
+
(class extends _classSuper {
|
|
5095
|
+
static { _classThis = this; }
|
|
5096
|
+
static {
|
|
5097
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
5098
|
+
_value_decorators = [snice.property({ type: String })];
|
|
5099
|
+
_phone_decorators = [snice.property({ type: String })];
|
|
5100
|
+
_displayText_decorators = [snice.property({ type: String })];
|
|
5101
|
+
_showIcon_decorators = [snice.property({ type: Boolean })];
|
|
5102
|
+
_format_decorators = [snice.property({ type: Boolean })];
|
|
5103
|
+
_country_decorators = [snice.property({ type: String })];
|
|
5104
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
5105
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
5106
|
+
_align_decorators = [snice.property({ type: String })];
|
|
5107
|
+
_type_decorators = [snice.property({ type: String })];
|
|
5108
|
+
_render_decorators = [snice.render()];
|
|
5109
|
+
_styles_decorators = [snice.styles()];
|
|
5110
|
+
_init_decorators = [snice.ready()];
|
|
5111
|
+
_updatePhoneAttributes_decorators = [snice.watch('value', 'column')];
|
|
5112
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5113
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5114
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5115
|
+
__esDecorate(this, null, _updatePhoneAttributes_decorators, { kind: "method", name: "updatePhoneAttributes", static: false, private: false, access: { has: obj => "updatePhoneAttributes" in obj, get: obj => obj.updatePhoneAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5116
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
5117
|
+
__esDecorate(null, null, _phone_decorators, { kind: "field", name: "phone", static: false, private: false, access: { has: obj => "phone" in obj, get: obj => obj.phone, set: (obj, value) => { obj.phone = value; } }, metadata: _metadata }, _phone_initializers, _phone_extraInitializers);
|
|
5118
|
+
__esDecorate(null, null, _displayText_decorators, { kind: "field", name: "displayText", static: false, private: false, access: { has: obj => "displayText" in obj, get: obj => obj.displayText, set: (obj, value) => { obj.displayText = value; } }, metadata: _metadata }, _displayText_initializers, _displayText_extraInitializers);
|
|
5119
|
+
__esDecorate(null, null, _showIcon_decorators, { kind: "field", name: "showIcon", static: false, private: false, access: { has: obj => "showIcon" in obj, get: obj => obj.showIcon, set: (obj, value) => { obj.showIcon = value; } }, metadata: _metadata }, _showIcon_initializers, _showIcon_extraInitializers);
|
|
5120
|
+
__esDecorate(null, null, _format_decorators, { kind: "field", name: "format", static: false, private: false, access: { has: obj => "format" in obj, get: obj => obj.format, set: (obj, value) => { obj.format = value; } }, metadata: _metadata }, _format_initializers, _format_extraInitializers);
|
|
5121
|
+
__esDecorate(null, null, _country_decorators, { kind: "field", name: "country", static: false, private: false, access: { has: obj => "country" in obj, get: obj => obj.country, set: (obj, value) => { obj.country = value; } }, metadata: _metadata }, _country_initializers, _country_extraInitializers);
|
|
5122
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
5123
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
5124
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
5125
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
5126
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
5127
|
+
_classThis = _classDescriptor.value;
|
|
5128
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
5129
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
5130
|
+
}
|
|
5131
|
+
render() {
|
|
5132
|
+
const phoneNumber = this.phone || this.value;
|
|
5133
|
+
const displayText = this.displayText || (this.format ? this.formatPhoneNumber(phoneNumber) : phoneNumber);
|
|
5134
|
+
const iconHTML = this.showIcon ? '<span class="phone-icon">📞</span>' : '';
|
|
5135
|
+
if (!phoneNumber) {
|
|
5136
|
+
return snice.html /*html*/ `
|
|
5137
|
+
<div class="cell-content cell-content--phone" part="content">
|
|
5138
|
+
<span class="phone-empty"></span>
|
|
5139
|
+
</div>
|
|
5140
|
+
`;
|
|
5141
|
+
}
|
|
5142
|
+
return snice.html /*html*/ `
|
|
5143
|
+
<div class="cell-content cell-content--phone" part="content">
|
|
5144
|
+
${snice.unsafeHTML(iconHTML)}
|
|
5145
|
+
<a href="tel:${phoneNumber}" class="phone-link" part="link">
|
|
5146
|
+
${displayText}
|
|
5147
|
+
</a>
|
|
5148
|
+
</div>
|
|
5149
|
+
`;
|
|
5150
|
+
}
|
|
5151
|
+
styles() {
|
|
5152
|
+
return snice.css /*css*/ `${cssContent$6}`;
|
|
5153
|
+
}
|
|
5154
|
+
init() {
|
|
5155
|
+
this.updatePhoneAttributes();
|
|
5156
|
+
}
|
|
5157
|
+
updatePhoneAttributes() {
|
|
5158
|
+
if (this.column?.phoneFormat) {
|
|
5159
|
+
const format = this.column.phoneFormat;
|
|
5160
|
+
this.phone = format.phone || this.value;
|
|
5161
|
+
this.displayText = format.displayText || '';
|
|
5162
|
+
this.showIcon = format.showIcon ?? true;
|
|
5163
|
+
this.format = format.format ?? true;
|
|
5164
|
+
this.country = format.country || 'US';
|
|
5165
|
+
}
|
|
5166
|
+
}
|
|
5167
|
+
formatPhoneNumber(phone) {
|
|
5168
|
+
// Remove all non-numeric characters
|
|
5169
|
+
const cleaned = phone.replace(/\D/g, '');
|
|
5170
|
+
// Format US phone numbers (10 digits)
|
|
5171
|
+
if (this.country === 'US' && cleaned.length === 10) {
|
|
5172
|
+
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)}-${cleaned.slice(6)}`;
|
|
5173
|
+
}
|
|
5174
|
+
// Format US phone numbers with country code (11 digits starting with 1)
|
|
5175
|
+
if (this.country === 'US' && cleaned.length === 11 && cleaned[0] === '1') {
|
|
5176
|
+
return `+1 (${cleaned.slice(1, 4)}) ${cleaned.slice(4, 7)}-${cleaned.slice(7)}`;
|
|
5177
|
+
}
|
|
5178
|
+
// For other formats, just return the original value
|
|
5179
|
+
return phone;
|
|
5180
|
+
}
|
|
5181
|
+
constructor() {
|
|
5182
|
+
super(...arguments);
|
|
5183
|
+
this.value = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
5184
|
+
this.phone = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _phone_initializers, ''));
|
|
5185
|
+
this.displayText = (__runInitializers(this, _phone_extraInitializers), __runInitializers(this, _displayText_initializers, ''));
|
|
5186
|
+
this.showIcon = (__runInitializers(this, _displayText_extraInitializers), __runInitializers(this, _showIcon_initializers, true));
|
|
5187
|
+
this.format = (__runInitializers(this, _showIcon_extraInitializers), __runInitializers(this, _format_initializers, true));
|
|
5188
|
+
this.country = (__runInitializers(this, _format_extraInitializers), __runInitializers(this, _country_initializers, 'US'));
|
|
5189
|
+
this.column = (__runInitializers(this, _country_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
5190
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
5191
|
+
this.align = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
5192
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'phone'));
|
|
5193
|
+
__runInitializers(this, _type_extraInitializers);
|
|
5194
|
+
}
|
|
5195
|
+
});
|
|
5196
|
+
return _classThis;
|
|
5197
|
+
})();
|
|
5198
|
+
|
|
5199
|
+
var cssContent$5 = ":host{color:var(--snice-color-text);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:.5rem}.status-dot{width:.5rem;height:.5rem;border-radius:50%;flex-shrink:0;position:relative}.status-dot--online{background-color:var(--snice-color-success);box-shadow:0 0 0 2px hsl(var(--snice-color-green-500) / .2)}.status-dot--offline{background-color:hsl(var(--snice-color-gray-400));box-shadow:0 0 0 2px hsl(var(--snice-color-gray-500) / .2)}.status-dot--busy{background-color:var(--snice-color-danger);box-shadow:0 0 0 2px hsl(var(--snice-color-red-500) / .2)}.status-dot--away{background-color:var(--snice-color-warning);box-shadow:0 0 0 2px hsl(var(--snice-color-yellow-500) / .2)}.status-dot--custom{background-color:var(--snice-color-primary);box-shadow:0 0 0 2px hsl(var(--snice-color-blue-500) / .2)}.status-dot--online::after{content:'';position:absolute;top:-2px;left:-2px;right:-2px;bottom:-2px;border-radius:50%;border:2px solid var(--snice-color-success);animation:2s ease-in-out infinite status-pulse;opacity:0}@keyframes status-pulse{0%{transform:scale(1);opacity:1}100%{transform:scale(1.5);opacity:0}}.status-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-label--online{color:var(--snice-color-success)}.status-label--offline{color:var(--snice-color-text-secondary)}.status-label--busy{color:var(--snice-color-danger)}.status-label--away{color:var(--snice-color-warning)}.status-label--custom{color:var(--snice-color-text)}: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);font-size:.75rem;line-height:1rem}.status-dot{width:.375rem;height:.375rem}}@media (prefers-reduced-motion:reduce){.status-dot--online::after{animation:none}}@media print{.status-dot{border:1px solid var(--snice-color-text)}.status-dot--online{background-color:var(--snice-color-background);border-color:var(--snice-color-success)}.status-dot--offline{background-color:var(--snice-color-background);border-color:var(--snice-color-neutral)}.status-dot--busy{background-color:var(--snice-color-background);border-color:var(--snice-color-danger)}.status-dot--away{background-color:var(--snice-color-background);border-color:var(--snice-color-warning)}}";
|
|
5200
|
+
|
|
5201
|
+
(() => {
|
|
5202
|
+
let _classDecorators = [snice.element('snice-cell-status')];
|
|
5203
|
+
let _classDescriptor;
|
|
5204
|
+
let _classExtraInitializers = [];
|
|
5205
|
+
let _classThis;
|
|
5206
|
+
let _classSuper = HTMLElement;
|
|
5207
|
+
let _instanceExtraInitializers = [];
|
|
5208
|
+
let _value_decorators;
|
|
5209
|
+
let _value_initializers = [];
|
|
5210
|
+
let _value_extraInitializers = [];
|
|
5211
|
+
let _status_decorators;
|
|
5212
|
+
let _status_initializers = [];
|
|
5213
|
+
let _status_extraInitializers = [];
|
|
5214
|
+
let _label_decorators;
|
|
5215
|
+
let _label_initializers = [];
|
|
5216
|
+
let _label_extraInitializers = [];
|
|
5217
|
+
let _showDot_decorators;
|
|
5218
|
+
let _showDot_initializers = [];
|
|
5219
|
+
let _showDot_extraInitializers = [];
|
|
5220
|
+
let _variant_decorators;
|
|
5221
|
+
let _variant_initializers = [];
|
|
5222
|
+
let _variant_extraInitializers = [];
|
|
5223
|
+
let _column_decorators;
|
|
5224
|
+
let _column_initializers = [];
|
|
5225
|
+
let _column_extraInitializers = [];
|
|
5226
|
+
let _rowData_decorators;
|
|
5227
|
+
let _rowData_initializers = [];
|
|
5228
|
+
let _rowData_extraInitializers = [];
|
|
5229
|
+
let _align_decorators;
|
|
5230
|
+
let _align_initializers = [];
|
|
5231
|
+
let _align_extraInitializers = [];
|
|
5232
|
+
let _type_decorators;
|
|
5233
|
+
let _type_initializers = [];
|
|
5234
|
+
let _type_extraInitializers = [];
|
|
5235
|
+
let _render_decorators;
|
|
5236
|
+
let _styles_decorators;
|
|
5237
|
+
let _init_decorators;
|
|
5238
|
+
let _updateStatusAttributes_decorators;
|
|
5239
|
+
(class extends _classSuper {
|
|
5240
|
+
static { _classThis = this; }
|
|
5241
|
+
static {
|
|
5242
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
5243
|
+
_value_decorators = [snice.property({ type: String })];
|
|
5244
|
+
_status_decorators = [snice.property({ type: String })];
|
|
5245
|
+
_label_decorators = [snice.property({ type: String })];
|
|
5246
|
+
_showDot_decorators = [snice.property({ type: Boolean })];
|
|
5247
|
+
_variant_decorators = [snice.property({ type: String })];
|
|
5248
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
5249
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
5250
|
+
_align_decorators = [snice.property({ type: String })];
|
|
5251
|
+
_type_decorators = [snice.property({ type: String })];
|
|
5252
|
+
_render_decorators = [snice.render()];
|
|
5253
|
+
_styles_decorators = [snice.styles()];
|
|
5254
|
+
_init_decorators = [snice.ready()];
|
|
5255
|
+
_updateStatusAttributes_decorators = [snice.watch('value', 'column')];
|
|
5256
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5257
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5258
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5259
|
+
__esDecorate(this, null, _updateStatusAttributes_decorators, { kind: "method", name: "updateStatusAttributes", static: false, private: false, access: { has: obj => "updateStatusAttributes" in obj, get: obj => obj.updateStatusAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5260
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
5261
|
+
__esDecorate(null, null, _status_decorators, { kind: "field", name: "status", static: false, private: false, access: { has: obj => "status" in obj, get: obj => obj.status, set: (obj, value) => { obj.status = value; } }, metadata: _metadata }, _status_initializers, _status_extraInitializers);
|
|
5262
|
+
__esDecorate(null, null, _label_decorators, { kind: "field", name: "label", static: false, private: false, access: { has: obj => "label" in obj, get: obj => obj.label, set: (obj, value) => { obj.label = value; } }, metadata: _metadata }, _label_initializers, _label_extraInitializers);
|
|
5263
|
+
__esDecorate(null, null, _showDot_decorators, { kind: "field", name: "showDot", static: false, private: false, access: { has: obj => "showDot" in obj, get: obj => obj.showDot, set: (obj, value) => { obj.showDot = value; } }, metadata: _metadata }, _showDot_initializers, _showDot_extraInitializers);
|
|
5264
|
+
__esDecorate(null, null, _variant_decorators, { kind: "field", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
5265
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
5266
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
5267
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
5268
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
5269
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
5270
|
+
_classThis = _classDescriptor.value;
|
|
5271
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
5272
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
5273
|
+
}
|
|
5274
|
+
render() {
|
|
5275
|
+
const statusValue = this.status || this.value;
|
|
5276
|
+
const statusLabel = this.label || statusValue;
|
|
5277
|
+
const statusVariant = this.getStatusVariant(statusValue);
|
|
5278
|
+
const dotHTML = this.showDot ? `<span class="status-dot status-dot--${statusVariant}"></span>` : '';
|
|
5279
|
+
return snice.html /*html*/ `
|
|
5280
|
+
<div class="cell-content cell-content--status" part="content">
|
|
5281
|
+
${snice.unsafeHTML(dotHTML)}
|
|
5282
|
+
<span class="status-label status-label--${statusVariant}">${statusLabel}</span>
|
|
5283
|
+
</div>
|
|
5284
|
+
`;
|
|
5285
|
+
}
|
|
5286
|
+
styles() {
|
|
5287
|
+
return snice.css /*css*/ `${cssContent$5}`;
|
|
5288
|
+
}
|
|
5289
|
+
init() {
|
|
5290
|
+
this.updateStatusAttributes();
|
|
5291
|
+
}
|
|
5292
|
+
updateStatusAttributes() {
|
|
5293
|
+
if (this.column?.statusFormat) {
|
|
5294
|
+
const format = this.column.statusFormat;
|
|
5295
|
+
this.status = format.status || this.value;
|
|
5296
|
+
this.label = format.label || this.value;
|
|
5297
|
+
this.showDot = format.showDot ?? true;
|
|
5298
|
+
this.variant = format.variant || 'custom';
|
|
5299
|
+
}
|
|
5300
|
+
}
|
|
5301
|
+
getStatusVariant(status) {
|
|
5302
|
+
if (this.variant !== 'custom') {
|
|
5303
|
+
return this.variant;
|
|
5304
|
+
}
|
|
5305
|
+
// Auto-detect common status values
|
|
5306
|
+
const lowerStatus = status.toLowerCase();
|
|
5307
|
+
if (lowerStatus === 'online' || lowerStatus === 'active' || lowerStatus === 'available') {
|
|
5308
|
+
return 'online';
|
|
5309
|
+
}
|
|
5310
|
+
if (lowerStatus === 'offline' || lowerStatus === 'inactive' || lowerStatus === 'unavailable') {
|
|
5311
|
+
return 'offline';
|
|
5312
|
+
}
|
|
5313
|
+
if (lowerStatus === 'busy' || lowerStatus === 'dnd' || lowerStatus === 'do not disturb') {
|
|
5314
|
+
return 'busy';
|
|
5315
|
+
}
|
|
5316
|
+
if (lowerStatus === 'away' || lowerStatus === 'idle') {
|
|
5317
|
+
return 'away';
|
|
5318
|
+
}
|
|
5319
|
+
return 'custom';
|
|
5320
|
+
}
|
|
5321
|
+
constructor() {
|
|
5322
|
+
super(...arguments);
|
|
5323
|
+
this.value = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
5324
|
+
this.status = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _status_initializers, ''));
|
|
5325
|
+
this.label = (__runInitializers(this, _status_extraInitializers), __runInitializers(this, _label_initializers, ''));
|
|
5326
|
+
this.showDot = (__runInitializers(this, _label_extraInitializers), __runInitializers(this, _showDot_initializers, true));
|
|
5327
|
+
this.variant = (__runInitializers(this, _showDot_extraInitializers), __runInitializers(this, _variant_initializers, 'custom'));
|
|
5328
|
+
this.column = (__runInitializers(this, _variant_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
5329
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
5330
|
+
this.align = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
5331
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'status'));
|
|
5332
|
+
__runInitializers(this, _type_extraInitializers);
|
|
5333
|
+
}
|
|
5334
|
+
});
|
|
5335
|
+
return _classThis;
|
|
5336
|
+
})();
|
|
5337
|
+
|
|
5338
|
+
var cssContent$4 = ":host{color:var(--snice-color-text);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:.5rem}.color-swatch{border:1px solid var(--snice-color-border);border-radius:.25rem;flex-shrink:0;box-shadow:var(--snice-shadow-xs)}.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);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);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)}.color-text{font-size:.75rem}}";
|
|
5339
|
+
|
|
5340
|
+
(() => {
|
|
5341
|
+
let _classDecorators = [snice.element('snice-cell-color')];
|
|
5342
|
+
let _classDescriptor;
|
|
5343
|
+
let _classExtraInitializers = [];
|
|
5344
|
+
let _classThis;
|
|
5345
|
+
let _classSuper = HTMLElement;
|
|
5346
|
+
let _instanceExtraInitializers = [];
|
|
5347
|
+
let _value_decorators;
|
|
5348
|
+
let _value_initializers = [];
|
|
5349
|
+
let _value_extraInitializers = [];
|
|
5350
|
+
let _color_decorators;
|
|
5351
|
+
let _color_initializers = [];
|
|
5352
|
+
let _color_extraInitializers = [];
|
|
5353
|
+
let _showSwatch_decorators;
|
|
5354
|
+
let _showSwatch_initializers = [];
|
|
5355
|
+
let _showSwatch_extraInitializers = [];
|
|
5356
|
+
let _showHex_decorators;
|
|
5357
|
+
let _showHex_initializers = [];
|
|
5358
|
+
let _showHex_extraInitializers = [];
|
|
5359
|
+
let _showRgb_decorators;
|
|
5360
|
+
let _showRgb_initializers = [];
|
|
5361
|
+
let _showRgb_extraInitializers = [];
|
|
5362
|
+
let _swatchSize_decorators;
|
|
5363
|
+
let _swatchSize_initializers = [];
|
|
5364
|
+
let _swatchSize_extraInitializers = [];
|
|
5365
|
+
let _column_decorators;
|
|
5366
|
+
let _column_initializers = [];
|
|
5367
|
+
let _column_extraInitializers = [];
|
|
5368
|
+
let _rowData_decorators;
|
|
5369
|
+
let _rowData_initializers = [];
|
|
5370
|
+
let _rowData_extraInitializers = [];
|
|
5371
|
+
let _align_decorators;
|
|
5372
|
+
let _align_initializers = [];
|
|
5373
|
+
let _align_extraInitializers = [];
|
|
5374
|
+
let _type_decorators;
|
|
5375
|
+
let _type_initializers = [];
|
|
5376
|
+
let _type_extraInitializers = [];
|
|
5377
|
+
let _render_decorators;
|
|
5378
|
+
let _styles_decorators;
|
|
5379
|
+
let _init_decorators;
|
|
5380
|
+
let _updateColorAttributes_decorators;
|
|
5381
|
+
(class extends _classSuper {
|
|
5382
|
+
static { _classThis = this; }
|
|
5383
|
+
static {
|
|
5384
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
5385
|
+
_value_decorators = [snice.property({ type: String })];
|
|
5386
|
+
_color_decorators = [snice.property({ type: String })];
|
|
5387
|
+
_showSwatch_decorators = [snice.property({ type: Boolean })];
|
|
5388
|
+
_showHex_decorators = [snice.property({ type: Boolean })];
|
|
5389
|
+
_showRgb_decorators = [snice.property({ type: Boolean })];
|
|
5390
|
+
_swatchSize_decorators = [snice.property({ type: String })];
|
|
5391
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
5392
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
5393
|
+
_align_decorators = [snice.property({ type: String })];
|
|
5394
|
+
_type_decorators = [snice.property({ type: String })];
|
|
5395
|
+
_render_decorators = [snice.render()];
|
|
5396
|
+
_styles_decorators = [snice.styles()];
|
|
5397
|
+
_init_decorators = [snice.ready()];
|
|
5398
|
+
_updateColorAttributes_decorators = [snice.watch('value', 'column')];
|
|
5399
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5400
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5401
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5402
|
+
__esDecorate(this, null, _updateColorAttributes_decorators, { kind: "method", name: "updateColorAttributes", static: false, private: false, access: { has: obj => "updateColorAttributes" in obj, get: obj => obj.updateColorAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5403
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
5404
|
+
__esDecorate(null, null, _color_decorators, { kind: "field", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
|
|
5405
|
+
__esDecorate(null, null, _showSwatch_decorators, { kind: "field", name: "showSwatch", static: false, private: false, access: { has: obj => "showSwatch" in obj, get: obj => obj.showSwatch, set: (obj, value) => { obj.showSwatch = value; } }, metadata: _metadata }, _showSwatch_initializers, _showSwatch_extraInitializers);
|
|
5406
|
+
__esDecorate(null, null, _showHex_decorators, { kind: "field", name: "showHex", static: false, private: false, access: { has: obj => "showHex" in obj, get: obj => obj.showHex, set: (obj, value) => { obj.showHex = value; } }, metadata: _metadata }, _showHex_initializers, _showHex_extraInitializers);
|
|
5407
|
+
__esDecorate(null, null, _showRgb_decorators, { kind: "field", name: "showRgb", static: false, private: false, access: { has: obj => "showRgb" in obj, get: obj => obj.showRgb, set: (obj, value) => { obj.showRgb = value; } }, metadata: _metadata }, _showRgb_initializers, _showRgb_extraInitializers);
|
|
5408
|
+
__esDecorate(null, null, _swatchSize_decorators, { kind: "field", name: "swatchSize", static: false, private: false, access: { has: obj => "swatchSize" in obj, get: obj => obj.swatchSize, set: (obj, value) => { obj.swatchSize = value; } }, metadata: _metadata }, _swatchSize_initializers, _swatchSize_extraInitializers);
|
|
5409
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
5410
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
5411
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
5412
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
5413
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
5414
|
+
_classThis = _classDescriptor.value;
|
|
5415
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
5416
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
5417
|
+
}
|
|
5418
|
+
render() {
|
|
5419
|
+
const colorValue = this.color || this.value;
|
|
5420
|
+
const swatchHTML = this.showSwatch
|
|
5421
|
+
? `<span class="color-swatch color-swatch--${this.swatchSize}" style="background-color: ${colorValue};"></span>`
|
|
5422
|
+
: '';
|
|
5423
|
+
let textDisplay = '';
|
|
5424
|
+
if (this.showHex) {
|
|
5425
|
+
textDisplay = colorValue;
|
|
5426
|
+
}
|
|
5427
|
+
if (this.showRgb && colorValue.startsWith('#')) {
|
|
5428
|
+
const rgb = this.hexToRgb(colorValue);
|
|
5429
|
+
textDisplay = rgb ? `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})` : colorValue;
|
|
5430
|
+
}
|
|
5431
|
+
return snice.html /*html*/ `
|
|
5432
|
+
<div class="cell-content cell-content--color" part="content">
|
|
5433
|
+
${snice.unsafeHTML(swatchHTML)}
|
|
5434
|
+
${textDisplay ? snice.html `<span class="color-text">${textDisplay}</span>` : ''}
|
|
5435
|
+
</div>
|
|
5436
|
+
`;
|
|
5437
|
+
}
|
|
5438
|
+
styles() {
|
|
5439
|
+
return snice.css /*css*/ `${cssContent$4}`;
|
|
5440
|
+
}
|
|
5441
|
+
init() {
|
|
5442
|
+
this.updateColorAttributes();
|
|
5443
|
+
}
|
|
5444
|
+
updateColorAttributes() {
|
|
5445
|
+
if (this.column?.colorFormat) {
|
|
5446
|
+
const format = this.column.colorFormat;
|
|
5447
|
+
this.color = format.color || this.value;
|
|
5448
|
+
this.showSwatch = format.showSwatch ?? true;
|
|
5449
|
+
this.showHex = format.showHex ?? true;
|
|
5450
|
+
this.showRgb = format.showRgb ?? false;
|
|
5451
|
+
this.swatchSize = format.swatchSize || 'medium';
|
|
5452
|
+
}
|
|
5453
|
+
}
|
|
5454
|
+
hexToRgb(hex) {
|
|
5455
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
5456
|
+
return result
|
|
5457
|
+
? {
|
|
5458
|
+
r: parseInt(result[1], 16),
|
|
5459
|
+
g: parseInt(result[2], 16),
|
|
5460
|
+
b: parseInt(result[3], 16),
|
|
5461
|
+
}
|
|
5462
|
+
: null;
|
|
5463
|
+
}
|
|
5464
|
+
constructor() {
|
|
5465
|
+
super(...arguments);
|
|
5466
|
+
this.value = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
5467
|
+
this.color = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _color_initializers, ''));
|
|
5468
|
+
this.showSwatch = (__runInitializers(this, _color_extraInitializers), __runInitializers(this, _showSwatch_initializers, true));
|
|
5469
|
+
this.showHex = (__runInitializers(this, _showSwatch_extraInitializers), __runInitializers(this, _showHex_initializers, true));
|
|
5470
|
+
this.showRgb = (__runInitializers(this, _showHex_extraInitializers), __runInitializers(this, _showRgb_initializers, false));
|
|
5471
|
+
this.swatchSize = (__runInitializers(this, _showRgb_extraInitializers), __runInitializers(this, _swatchSize_initializers, 'medium'));
|
|
5472
|
+
this.column = (__runInitializers(this, _swatchSize_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
5473
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
5474
|
+
this.align = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
5475
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'color'));
|
|
5476
|
+
__runInitializers(this, _type_extraInitializers);
|
|
5477
|
+
}
|
|
5478
|
+
});
|
|
5479
|
+
return _classThis;
|
|
5480
|
+
})();
|
|
5481
|
+
|
|
5482
|
+
var cssContent$3 = ":host{color:var(--snice-color-text);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);cursor:pointer;padding:.125rem .25rem;font-size:.75rem;line-height:1;border-radius:.25rem;transition:background-color .2s;flex-shrink:0}.json-toggle:hover{background-color:var(--snice-color-background-hover)}.json-toggle:focus{outline:2px solid var(--snice-color-primary);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);font-style:italic}.json-object{padding-left:1rem}.json-line{margin:.125rem 0}.json-key{color:var(--snice-color-primary);font-weight:500;margin-right:.25rem}.json-string{color:var(--snice-color-success)}.json-number{color:var(--snice-color-info)}.json-boolean{color:var(--snice-color-warning)}.json-empty,.json-null,.json-undefined{color:var(--snice-color-text-secondary);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);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}}";
|
|
5483
|
+
|
|
5484
|
+
(() => {
|
|
5485
|
+
let _classDecorators = [snice.element('snice-cell-json')];
|
|
5486
|
+
let _classDescriptor;
|
|
5487
|
+
let _classExtraInitializers = [];
|
|
5488
|
+
let _classThis;
|
|
5489
|
+
let _classSuper = HTMLElement;
|
|
5490
|
+
let _instanceExtraInitializers = [];
|
|
5491
|
+
let _value_decorators;
|
|
5492
|
+
let _value_initializers = [];
|
|
5493
|
+
let _value_extraInitializers = [];
|
|
5494
|
+
let _collapsed_decorators;
|
|
5495
|
+
let _collapsed_initializers = [];
|
|
5496
|
+
let _collapsed_extraInitializers = [];
|
|
5497
|
+
let _maxDepth_decorators;
|
|
5498
|
+
let _maxDepth_initializers = [];
|
|
5499
|
+
let _maxDepth_extraInitializers = [];
|
|
5500
|
+
let _showToggle_decorators;
|
|
5501
|
+
let _showToggle_initializers = [];
|
|
5502
|
+
let _showToggle_extraInitializers = [];
|
|
5503
|
+
let _column_decorators;
|
|
5504
|
+
let _column_initializers = [];
|
|
5505
|
+
let _column_extraInitializers = [];
|
|
5506
|
+
let _rowData_decorators;
|
|
5507
|
+
let _rowData_initializers = [];
|
|
5508
|
+
let _rowData_extraInitializers = [];
|
|
5509
|
+
let _align_decorators;
|
|
5510
|
+
let _align_initializers = [];
|
|
5511
|
+
let _align_extraInitializers = [];
|
|
5512
|
+
let _type_decorators;
|
|
5513
|
+
let _type_initializers = [];
|
|
5514
|
+
let _type_extraInitializers = [];
|
|
5515
|
+
let _render_decorators;
|
|
5516
|
+
let _styles_decorators;
|
|
5517
|
+
let _init_decorators;
|
|
5518
|
+
let _updateJsonAttributes_decorators;
|
|
5519
|
+
let _handleToggle_decorators;
|
|
5520
|
+
(class extends _classSuper {
|
|
5521
|
+
static { _classThis = this; }
|
|
5522
|
+
static {
|
|
5523
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
5524
|
+
_value_decorators = [snice.property({ type: String })];
|
|
5525
|
+
_collapsed_decorators = [snice.property({ type: Boolean })];
|
|
5526
|
+
_maxDepth_decorators = [snice.property({ type: Number })];
|
|
5527
|
+
_showToggle_decorators = [snice.property({ type: Boolean })];
|
|
5528
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
5529
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
5530
|
+
_align_decorators = [snice.property({ type: String })];
|
|
5531
|
+
_type_decorators = [snice.property({ type: String })];
|
|
5532
|
+
_render_decorators = [snice.render()];
|
|
5533
|
+
_styles_decorators = [snice.styles()];
|
|
5534
|
+
_init_decorators = [snice.ready()];
|
|
5535
|
+
_updateJsonAttributes_decorators = [snice.watch('value', 'column')];
|
|
5536
|
+
_handleToggle_decorators = [snice.on('click', '.json-toggle')];
|
|
5537
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5538
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5539
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5540
|
+
__esDecorate(this, null, _updateJsonAttributes_decorators, { kind: "method", name: "updateJsonAttributes", static: false, private: false, access: { has: obj => "updateJsonAttributes" in obj, get: obj => obj.updateJsonAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5541
|
+
__esDecorate(this, null, _handleToggle_decorators, { kind: "method", name: "handleToggle", static: false, private: false, access: { has: obj => "handleToggle" in obj, get: obj => obj.handleToggle }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5542
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
5543
|
+
__esDecorate(null, null, _collapsed_decorators, { kind: "field", name: "collapsed", static: false, private: false, access: { has: obj => "collapsed" in obj, get: obj => obj.collapsed, set: (obj, value) => { obj.collapsed = value; } }, metadata: _metadata }, _collapsed_initializers, _collapsed_extraInitializers);
|
|
5544
|
+
__esDecorate(null, null, _maxDepth_decorators, { kind: "field", name: "maxDepth", static: false, private: false, access: { has: obj => "maxDepth" in obj, get: obj => obj.maxDepth, set: (obj, value) => { obj.maxDepth = value; } }, metadata: _metadata }, _maxDepth_initializers, _maxDepth_extraInitializers);
|
|
5545
|
+
__esDecorate(null, null, _showToggle_decorators, { kind: "field", name: "showToggle", static: false, private: false, access: { has: obj => "showToggle" in obj, get: obj => obj.showToggle, set: (obj, value) => { obj.showToggle = value; } }, metadata: _metadata }, _showToggle_initializers, _showToggle_extraInitializers);
|
|
5546
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
5547
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
5548
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
5549
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
5550
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
5551
|
+
_classThis = _classDescriptor.value;
|
|
5552
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
5553
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
5554
|
+
}
|
|
5555
|
+
render() {
|
|
5556
|
+
const jsonValue = typeof this.value === 'string' ? this.tryParseJson(this.value) : this.value;
|
|
5557
|
+
if (jsonValue === null || jsonValue === undefined) {
|
|
5558
|
+
return snice.html /*html*/ `
|
|
5559
|
+
<div class="cell-content cell-content--json" part="content">
|
|
5560
|
+
<span class="json-empty">null</span>
|
|
5561
|
+
</div>
|
|
5562
|
+
`;
|
|
5563
|
+
}
|
|
5564
|
+
const toggleHTML = this.showToggle
|
|
5565
|
+
? `<button class="json-toggle" part="toggle" aria-label="${this.collapsed ? 'Expand' : 'Collapse'}">${this.collapsed ? '▶' : '▼'}</button>`
|
|
5566
|
+
: '';
|
|
5567
|
+
const jsonHTML = this.collapsed
|
|
5568
|
+
? this.renderCollapsed(jsonValue)
|
|
5569
|
+
: this.renderExpanded(jsonValue);
|
|
5570
|
+
return snice.html /*html*/ `
|
|
5571
|
+
<div class="cell-content cell-content--json" part="content">
|
|
5572
|
+
${snice.unsafeHTML(toggleHTML)}
|
|
5573
|
+
<div class="json-viewer ${this.collapsed ? 'json-viewer--collapsed' : 'json-viewer--expanded'}">
|
|
5574
|
+
${snice.unsafeHTML(jsonHTML)}
|
|
5575
|
+
</div>
|
|
5576
|
+
</div>
|
|
5577
|
+
`;
|
|
5578
|
+
}
|
|
5579
|
+
styles() {
|
|
5580
|
+
return snice.css /*css*/ `${cssContent$3}`;
|
|
5581
|
+
}
|
|
5582
|
+
init() {
|
|
5583
|
+
this.updateJsonAttributes();
|
|
5584
|
+
}
|
|
5585
|
+
updateJsonAttributes() {
|
|
5586
|
+
if (this.column?.jsonFormat) {
|
|
5587
|
+
const format = this.column.jsonFormat;
|
|
5588
|
+
this.collapsed = format.collapsed ?? true;
|
|
5589
|
+
this.maxDepth = format.maxDepth ?? 3;
|
|
5590
|
+
this.showToggle = format.showToggle ?? true;
|
|
5591
|
+
}
|
|
5592
|
+
}
|
|
5593
|
+
handleToggle() {
|
|
5594
|
+
this.collapsed = !this.collapsed;
|
|
5595
|
+
}
|
|
5596
|
+
tryParseJson(str) {
|
|
5597
|
+
try {
|
|
5598
|
+
return JSON.parse(str);
|
|
5599
|
+
}
|
|
5600
|
+
catch {
|
|
5601
|
+
return str;
|
|
5602
|
+
}
|
|
5603
|
+
}
|
|
5604
|
+
renderCollapsed(json) {
|
|
5605
|
+
if (typeof json === 'object' && json !== null) {
|
|
5606
|
+
if (Array.isArray(json)) {
|
|
5607
|
+
return `<span class="json-preview">[${json.length} items]</span>`;
|
|
5608
|
+
}
|
|
5609
|
+
const keys = Object.keys(json);
|
|
5610
|
+
return `<span class="json-preview">{${keys.length} keys}</span>`;
|
|
5611
|
+
}
|
|
5612
|
+
return this.renderValue(json);
|
|
5613
|
+
}
|
|
5614
|
+
renderExpanded(json, depth = 0) {
|
|
5615
|
+
if (depth >= this.maxDepth) {
|
|
5616
|
+
return this.renderCollapsed(json);
|
|
5617
|
+
}
|
|
5618
|
+
if (typeof json === 'object' && json !== null) {
|
|
5619
|
+
if (Array.isArray(json)) {
|
|
5620
|
+
const items = json.map((item, i) => {
|
|
5621
|
+
const value = this.renderExpanded(item, depth + 1);
|
|
5622
|
+
return `<div class="json-line"><span class="json-key">${i}:</span> ${value}</div>`;
|
|
5623
|
+
}).join('');
|
|
5624
|
+
return `<div class="json-object">[${items}]</div>`;
|
|
5625
|
+
}
|
|
5626
|
+
const entries = Object.entries(json).map(([key, value]) => {
|
|
5627
|
+
const renderedValue = this.renderExpanded(value, depth + 1);
|
|
5628
|
+
return `<div class="json-line"><span class="json-key">${key}:</span> ${renderedValue}</div>`;
|
|
5629
|
+
}).join('');
|
|
5630
|
+
return `<div class="json-object">{${entries}}</div>`;
|
|
5631
|
+
}
|
|
5632
|
+
return this.renderValue(json);
|
|
5633
|
+
}
|
|
5634
|
+
renderValue(value) {
|
|
5635
|
+
if (value === null)
|
|
5636
|
+
return '<span class="json-null">null</span>';
|
|
5637
|
+
if (value === undefined)
|
|
5638
|
+
return '<span class="json-undefined">undefined</span>';
|
|
5639
|
+
if (typeof value === 'boolean')
|
|
5640
|
+
return `<span class="json-boolean">${value}</span>`;
|
|
5641
|
+
if (typeof value === 'number')
|
|
5642
|
+
return `<span class="json-number">${value}</span>`;
|
|
5643
|
+
if (typeof value === 'string')
|
|
5644
|
+
return `<span class="json-string">"${value}"</span>`;
|
|
5645
|
+
return String(value);
|
|
5646
|
+
}
|
|
5647
|
+
constructor() {
|
|
5648
|
+
super(...arguments);
|
|
5649
|
+
this.value = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, null));
|
|
5650
|
+
this.collapsed = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _collapsed_initializers, true));
|
|
5651
|
+
this.maxDepth = (__runInitializers(this, _collapsed_extraInitializers), __runInitializers(this, _maxDepth_initializers, 3));
|
|
5652
|
+
this.showToggle = (__runInitializers(this, _maxDepth_extraInitializers), __runInitializers(this, _showToggle_initializers, true));
|
|
5653
|
+
this.column = (__runInitializers(this, _showToggle_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
5654
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
5655
|
+
this.align = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
5656
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'json'));
|
|
5657
|
+
__runInitializers(this, _type_extraInitializers);
|
|
5658
|
+
}
|
|
5659
|
+
});
|
|
5660
|
+
return _classThis;
|
|
5661
|
+
})();
|
|
5662
|
+
|
|
5663
|
+
(() => {
|
|
5664
|
+
let _classDecorators = [snice.element('snice-cell-currency')];
|
|
5665
|
+
let _classDescriptor;
|
|
5666
|
+
let _classExtraInitializers = [];
|
|
5667
|
+
let _classThis;
|
|
5668
|
+
let _classSuper = HTMLElement;
|
|
5669
|
+
let _instanceExtraInitializers = [];
|
|
5670
|
+
let _align_decorators;
|
|
5671
|
+
let _align_initializers = [];
|
|
5672
|
+
let _align_extraInitializers = [];
|
|
5673
|
+
let _type_decorators;
|
|
5674
|
+
let _type_initializers = [];
|
|
5675
|
+
let _type_extraInitializers = [];
|
|
5676
|
+
let _value_decorators;
|
|
5677
|
+
let _value_initializers = [];
|
|
5678
|
+
let _value_extraInitializers = [];
|
|
5679
|
+
let _column_decorators;
|
|
5680
|
+
let _column_initializers = [];
|
|
5681
|
+
let _column_extraInitializers = [];
|
|
5682
|
+
let _rowData_decorators;
|
|
5683
|
+
let _rowData_initializers = [];
|
|
5684
|
+
let _rowData_extraInitializers = [];
|
|
5685
|
+
let _contentElement_decorators;
|
|
5686
|
+
let _contentElement_initializers = [];
|
|
5687
|
+
let _contentElement_extraInitializers = [];
|
|
5688
|
+
let _decimals_decorators;
|
|
5689
|
+
let _decimals_initializers = [];
|
|
5690
|
+
let _decimals_extraInitializers = [];
|
|
5691
|
+
let _thousandsSeparator_decorators;
|
|
5692
|
+
let _thousandsSeparator_initializers = [];
|
|
5693
|
+
let _thousandsSeparator_extraInitializers = [];
|
|
5694
|
+
let _currency_decorators;
|
|
5695
|
+
let _currency_initializers = [];
|
|
5696
|
+
let _currency_extraInitializers = [];
|
|
5697
|
+
let _currencyDisplay_decorators;
|
|
5698
|
+
let _currencyDisplay_initializers = [];
|
|
5699
|
+
let _currencyDisplay_extraInitializers = [];
|
|
5700
|
+
let _locale_decorators;
|
|
5701
|
+
let _locale_initializers = [];
|
|
5702
|
+
let _locale_extraInitializers = [];
|
|
5703
|
+
let _negativeStyle_decorators;
|
|
5704
|
+
let _negativeStyle_initializers = [];
|
|
5705
|
+
let _negativeStyle_extraInitializers = [];
|
|
5706
|
+
let _highlight_decorators;
|
|
5707
|
+
let _highlight_initializers = [];
|
|
5708
|
+
let _highlight_extraInitializers = [];
|
|
5709
|
+
let _render_decorators;
|
|
5710
|
+
let _styles_decorators;
|
|
5711
|
+
let _init_decorators;
|
|
5712
|
+
let _updateAlignment_decorators;
|
|
5713
|
+
let _updateContent_decorators;
|
|
5714
|
+
(class extends _classSuper {
|
|
5715
|
+
static { _classThis = this; }
|
|
5716
|
+
static {
|
|
5717
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
5718
|
+
_align_decorators = [snice.property({ type: String })];
|
|
5719
|
+
_type_decorators = [snice.property({ type: String })];
|
|
5720
|
+
_value_decorators = [snice.property({})];
|
|
5721
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
5722
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
5723
|
+
_contentElement_decorators = [snice.query('.cell-content')];
|
|
5724
|
+
_decimals_decorators = [snice.property({ type: Number })];
|
|
5725
|
+
_thousandsSeparator_decorators = [snice.property({ type: Boolean, attribute: 'thousands-separator' })];
|
|
5726
|
+
_currency_decorators = [snice.property({ type: String })];
|
|
5727
|
+
_currencyDisplay_decorators = [snice.property({ type: String })];
|
|
5728
|
+
_locale_decorators = [snice.property({ type: String })];
|
|
5729
|
+
_negativeStyle_decorators = [snice.property({ type: String, attribute: 'negative-style' })];
|
|
5730
|
+
_highlight_decorators = [snice.property({ type: Boolean })];
|
|
5731
|
+
_render_decorators = [snice.render()];
|
|
5732
|
+
_styles_decorators = [snice.styles()];
|
|
5733
|
+
_init_decorators = [snice.ready()];
|
|
5734
|
+
_updateAlignment_decorators = [snice.watch('align')];
|
|
5735
|
+
_updateContent_decorators = [snice.watch('value', 'column')];
|
|
5736
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5737
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5738
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5739
|
+
__esDecorate(this, null, _updateAlignment_decorators, { kind: "method", name: "updateAlignment", static: false, private: false, access: { has: obj => "updateAlignment" in obj, get: obj => obj.updateAlignment }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5740
|
+
__esDecorate(this, null, _updateContent_decorators, { kind: "method", name: "updateContent", static: false, private: false, access: { has: obj => "updateContent" in obj, get: obj => obj.updateContent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5741
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
5742
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
5743
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
5744
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
5745
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
5746
|
+
__esDecorate(null, null, _contentElement_decorators, { kind: "field", name: "contentElement", static: false, private: false, access: { has: obj => "contentElement" in obj, get: obj => obj.contentElement, set: (obj, value) => { obj.contentElement = value; } }, metadata: _metadata }, _contentElement_initializers, _contentElement_extraInitializers);
|
|
5747
|
+
__esDecorate(null, null, _decimals_decorators, { kind: "field", name: "decimals", static: false, private: false, access: { has: obj => "decimals" in obj, get: obj => obj.decimals, set: (obj, value) => { obj.decimals = value; } }, metadata: _metadata }, _decimals_initializers, _decimals_extraInitializers);
|
|
5748
|
+
__esDecorate(null, null, _thousandsSeparator_decorators, { kind: "field", name: "thousandsSeparator", static: false, private: false, access: { has: obj => "thousandsSeparator" in obj, get: obj => obj.thousandsSeparator, set: (obj, value) => { obj.thousandsSeparator = value; } }, metadata: _metadata }, _thousandsSeparator_initializers, _thousandsSeparator_extraInitializers);
|
|
5749
|
+
__esDecorate(null, null, _currency_decorators, { kind: "field", name: "currency", static: false, private: false, access: { has: obj => "currency" in obj, get: obj => obj.currency, set: (obj, value) => { obj.currency = value; } }, metadata: _metadata }, _currency_initializers, _currency_extraInitializers);
|
|
5750
|
+
__esDecorate(null, null, _currencyDisplay_decorators, { kind: "field", name: "currencyDisplay", static: false, private: false, access: { has: obj => "currencyDisplay" in obj, get: obj => obj.currencyDisplay, set: (obj, value) => { obj.currencyDisplay = value; } }, metadata: _metadata }, _currencyDisplay_initializers, _currencyDisplay_extraInitializers);
|
|
5751
|
+
__esDecorate(null, null, _locale_decorators, { kind: "field", name: "locale", static: false, private: false, access: { has: obj => "locale" in obj, get: obj => obj.locale, set: (obj, value) => { obj.locale = value; } }, metadata: _metadata }, _locale_initializers, _locale_extraInitializers);
|
|
5752
|
+
__esDecorate(null, null, _negativeStyle_decorators, { kind: "field", name: "negativeStyle", static: false, private: false, access: { has: obj => "negativeStyle" in obj, get: obj => obj.negativeStyle, set: (obj, value) => { obj.negativeStyle = value; } }, metadata: _metadata }, _negativeStyle_initializers, _negativeStyle_extraInitializers);
|
|
5753
|
+
__esDecorate(null, null, _highlight_decorators, { kind: "field", name: "highlight", static: false, private: false, access: { has: obj => "highlight" in obj, get: obj => obj.highlight, set: (obj, value) => { obj.highlight = value; } }, metadata: _metadata }, _highlight_initializers, _highlight_extraInitializers);
|
|
5754
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
5755
|
+
_classThis = _classDescriptor.value;
|
|
5756
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
5757
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
5758
|
+
}
|
|
5759
|
+
render() {
|
|
5760
|
+
const formattedValue = this.formatCurrencyValue();
|
|
5761
|
+
const styles = this.getCurrencyStyles();
|
|
5762
|
+
return snice.html /*html*/ `
|
|
5763
|
+
<div class="cell-content cell-content--number" part="content" style="${styles}">
|
|
5764
|
+
${formattedValue}
|
|
5765
|
+
</div>
|
|
5766
|
+
`;
|
|
5767
|
+
}
|
|
5768
|
+
styles() {
|
|
5769
|
+
return snice.css /*css*/ `${cssContent$c}`;
|
|
5770
|
+
}
|
|
5771
|
+
init() {
|
|
5772
|
+
this.applyAlignment();
|
|
5773
|
+
}
|
|
5774
|
+
applyAlignment() {
|
|
5775
|
+
this.style.textAlign = this.align;
|
|
5776
|
+
}
|
|
5777
|
+
updateAlignment() {
|
|
5778
|
+
this.applyAlignment();
|
|
5779
|
+
}
|
|
5780
|
+
updateContent() {
|
|
5781
|
+
if (this.contentElement) {
|
|
5782
|
+
const formattedValue = this.formatCurrencyValue();
|
|
5783
|
+
const styles = this.getCurrencyStyles();
|
|
5784
|
+
this.contentElement.innerHTML = formattedValue;
|
|
5785
|
+
this.contentElement.setAttribute('style', styles);
|
|
5786
|
+
}
|
|
5787
|
+
}
|
|
5788
|
+
formatCurrencyValue() {
|
|
5789
|
+
if (this.value === null || this.value === undefined || this.value === '') {
|
|
5790
|
+
return '';
|
|
5791
|
+
}
|
|
5792
|
+
// Use custom formatter if provided
|
|
5793
|
+
if (this.column.formatter) {
|
|
5794
|
+
return this.column.formatter(this.value, this.rowData);
|
|
5795
|
+
}
|
|
5796
|
+
// Use column currency format or component properties
|
|
5797
|
+
const format = this.column.currencyFormat || {
|
|
5798
|
+
decimals: this.decimals,
|
|
5799
|
+
currency: this.currency,
|
|
5800
|
+
currencyDisplay: this.currencyDisplay,
|
|
5801
|
+
locale: this.locale,
|
|
5802
|
+
negativeStyle: this.negativeStyle
|
|
5803
|
+
};
|
|
5804
|
+
const num = Number(this.value);
|
|
5805
|
+
if (isNaN(num)) {
|
|
5806
|
+
return String(this.value);
|
|
5807
|
+
}
|
|
5808
|
+
try {
|
|
5809
|
+
const formatter = new Intl.NumberFormat(format.locale || this.locale, {
|
|
5810
|
+
style: 'currency',
|
|
5811
|
+
currency: format.currency || this.currency,
|
|
5812
|
+
currencyDisplay: format.currencyDisplay || this.currencyDisplay,
|
|
5813
|
+
minimumFractionDigits: format.decimals ?? this.decimals,
|
|
5814
|
+
maximumFractionDigits: format.decimals ?? this.decimals
|
|
5815
|
+
});
|
|
5816
|
+
let formatted = formatter.format(Math.abs(num));
|
|
5817
|
+
// Handle negative numbers
|
|
5818
|
+
if (num < 0) {
|
|
5819
|
+
const negStyle = format.negativeStyle ?? this.negativeStyle;
|
|
5820
|
+
if (negStyle === 'parentheses') {
|
|
5821
|
+
formatted = `(${formatted})`;
|
|
5822
|
+
}
|
|
5823
|
+
else if (negStyle === 'red') {
|
|
5824
|
+
formatted = `-${formatted}`;
|
|
5825
|
+
}
|
|
5826
|
+
else {
|
|
5827
|
+
formatted = `-${formatted}`;
|
|
5828
|
+
}
|
|
5829
|
+
}
|
|
5830
|
+
return formatted;
|
|
5831
|
+
}
|
|
5832
|
+
catch (error) {
|
|
5833
|
+
// Fallback to basic formatting if Intl.NumberFormat fails
|
|
5834
|
+
let formatted = num.toFixed(format.decimals ?? this.decimals);
|
|
5835
|
+
if (this.thousandsSeparator) {
|
|
5836
|
+
const parts = formatted.split('.');
|
|
5837
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
5838
|
+
formatted = parts.join('.');
|
|
5839
|
+
}
|
|
5840
|
+
return `$${formatted}`;
|
|
5841
|
+
}
|
|
5842
|
+
}
|
|
5843
|
+
getCurrencyStyles() {
|
|
5844
|
+
const num = Number(this.value);
|
|
5845
|
+
// Remove existing number classes
|
|
5846
|
+
this.classList.remove('number--negative', 'number--positive', 'number--zero', 'number--highlighted');
|
|
5847
|
+
// Apply CSS classes instead of direct styles
|
|
5848
|
+
if (num < 0) {
|
|
5849
|
+
this.classList.add('number--negative');
|
|
5850
|
+
const negStyle = this.column.currencyFormat?.negativeStyle ?? this.negativeStyle;
|
|
5851
|
+
if (negStyle === 'red') {
|
|
5852
|
+
this.classList.add('number--negative-red');
|
|
5853
|
+
}
|
|
5854
|
+
}
|
|
5855
|
+
else if (num > 0) {
|
|
5856
|
+
this.classList.add('number--positive');
|
|
5857
|
+
if (this.highlight) {
|
|
5858
|
+
this.classList.add('number--highlighted');
|
|
5859
|
+
}
|
|
5860
|
+
}
|
|
5861
|
+
else if (num === 0) {
|
|
5862
|
+
this.classList.add('number--zero');
|
|
5863
|
+
}
|
|
5864
|
+
return 'text-align: right';
|
|
5865
|
+
}
|
|
5866
|
+
constructor() {
|
|
5867
|
+
super(...arguments);
|
|
5868
|
+
this.align = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _align_initializers, 'right'));
|
|
5869
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'currency'));
|
|
5870
|
+
this.value = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
5871
|
+
this.column = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _column_initializers, {
|
|
5872
|
+
key: '',
|
|
5873
|
+
label: '',
|
|
5874
|
+
type: 'currency',
|
|
5875
|
+
align: 'right'
|
|
5876
|
+
}));
|
|
5877
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
5878
|
+
this.contentElement = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _contentElement_initializers, void 0));
|
|
5879
|
+
this.decimals = (__runInitializers(this, _contentElement_extraInitializers), __runInitializers(this, _decimals_initializers, 2));
|
|
5880
|
+
this.thousandsSeparator = (__runInitializers(this, _decimals_extraInitializers), __runInitializers(this, _thousandsSeparator_initializers, true));
|
|
5881
|
+
this.currency = (__runInitializers(this, _thousandsSeparator_extraInitializers), __runInitializers(this, _currency_initializers, 'USD'));
|
|
5882
|
+
this.currencyDisplay = (__runInitializers(this, _currency_extraInitializers), __runInitializers(this, _currencyDisplay_initializers, 'symbol'));
|
|
5883
|
+
this.locale = (__runInitializers(this, _currencyDisplay_extraInitializers), __runInitializers(this, _locale_initializers, 'en-US'));
|
|
5884
|
+
this.negativeStyle = (__runInitializers(this, _locale_extraInitializers), __runInitializers(this, _negativeStyle_initializers, 'red'));
|
|
5885
|
+
this.highlight = (__runInitializers(this, _negativeStyle_extraInitializers), __runInitializers(this, _highlight_initializers, false));
|
|
5886
|
+
__runInitializers(this, _highlight_extraInitializers);
|
|
5887
|
+
}
|
|
5888
|
+
});
|
|
5889
|
+
return _classThis;
|
|
5890
|
+
})();
|
|
5891
|
+
|
|
5892
|
+
var cssContent$2 = ":host{color:var(--snice-color-text);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;font-variant-numeric:tabular-nums}.cell-content{width:100%;min-width:6.25rem;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}:host(.percentage--positive){color:var(--snice-color-success)}:host(.percentage--negative){color:var(--snice-color-danger)}:host(.percentage--zero){color:var(--snice-color-text-secondary)}:host(.percentage--trend-up) .percentage-trend{color:var(--snice-color-success)}:host(.percentage--trend-down) .percentage-trend{color:var(--snice-color-danger)}:host(.percentage--trend-neutral) .percentage-trend{color:var(--snice-color-text-secondary)}: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);font-size:.75rem;line-height:1rem}.percentage-trend{font-size:.875rem}}@media print{:host{color:var(--snice-color-text);font-size:.75rem}.percentage-trend{font-size:.875rem}}";
|
|
5893
|
+
|
|
5894
|
+
(() => {
|
|
5895
|
+
let _classDecorators = [snice.element('snice-cell-percentage')];
|
|
5896
|
+
let _classDescriptor;
|
|
5897
|
+
let _classExtraInitializers = [];
|
|
5898
|
+
let _classThis;
|
|
5899
|
+
let _classSuper = HTMLElement;
|
|
5900
|
+
let _instanceExtraInitializers = [];
|
|
5901
|
+
let _align_decorators;
|
|
5902
|
+
let _align_initializers = [];
|
|
5903
|
+
let _align_extraInitializers = [];
|
|
5904
|
+
let _type_decorators;
|
|
5905
|
+
let _type_initializers = [];
|
|
5906
|
+
let _type_extraInitializers = [];
|
|
5907
|
+
let _value_decorators;
|
|
5908
|
+
let _value_initializers = [];
|
|
5909
|
+
let _value_extraInitializers = [];
|
|
5910
|
+
let _column_decorators;
|
|
5911
|
+
let _column_initializers = [];
|
|
5912
|
+
let _column_extraInitializers = [];
|
|
5913
|
+
let _rowData_decorators;
|
|
5914
|
+
let _rowData_initializers = [];
|
|
5915
|
+
let _rowData_extraInitializers = [];
|
|
5916
|
+
let _contentElement_decorators;
|
|
5917
|
+
let _contentElement_initializers = [];
|
|
5918
|
+
let _contentElement_extraInitializers = [];
|
|
5919
|
+
let _decimals_decorators;
|
|
5920
|
+
let _decimals_initializers = [];
|
|
5921
|
+
let _decimals_extraInitializers = [];
|
|
5922
|
+
let _showTrend_decorators;
|
|
5923
|
+
let _showTrend_initializers = [];
|
|
5924
|
+
let _showTrend_extraInitializers = [];
|
|
5925
|
+
let _trendValue_decorators;
|
|
5926
|
+
let _trendValue_initializers = [];
|
|
5927
|
+
let _trendValue_extraInitializers = [];
|
|
5928
|
+
let _colorize_decorators;
|
|
5929
|
+
let _colorize_initializers = [];
|
|
5930
|
+
let _colorize_extraInitializers = [];
|
|
5931
|
+
let _render_decorators;
|
|
5932
|
+
let _styles_decorators;
|
|
5933
|
+
let _init_decorators;
|
|
5934
|
+
let _updateAlignment_decorators;
|
|
5935
|
+
let _updateContent_decorators;
|
|
5936
|
+
(class extends _classSuper {
|
|
5937
|
+
static { _classThis = this; }
|
|
5938
|
+
static {
|
|
5939
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
5940
|
+
_align_decorators = [snice.property({ type: String })];
|
|
5941
|
+
_type_decorators = [snice.property({ type: String })];
|
|
5942
|
+
_value_decorators = [snice.property({})];
|
|
5943
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
5944
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
5945
|
+
_contentElement_decorators = [snice.query('.cell-content')];
|
|
5946
|
+
_decimals_decorators = [snice.property({ type: Number })];
|
|
5947
|
+
_showTrend_decorators = [snice.property({ type: Boolean })];
|
|
5948
|
+
_trendValue_decorators = [snice.property({ type: Number })];
|
|
5949
|
+
_colorize_decorators = [snice.property({ type: Boolean })];
|
|
5950
|
+
_render_decorators = [snice.render()];
|
|
5951
|
+
_styles_decorators = [snice.styles()];
|
|
5952
|
+
_init_decorators = [snice.ready()];
|
|
5953
|
+
_updateAlignment_decorators = [snice.watch('align')];
|
|
5954
|
+
_updateContent_decorators = [snice.watch('value', 'column')];
|
|
5955
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5956
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5957
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5958
|
+
__esDecorate(this, null, _updateAlignment_decorators, { kind: "method", name: "updateAlignment", static: false, private: false, access: { has: obj => "updateAlignment" in obj, get: obj => obj.updateAlignment }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5959
|
+
__esDecorate(this, null, _updateContent_decorators, { kind: "method", name: "updateContent", static: false, private: false, access: { has: obj => "updateContent" in obj, get: obj => obj.updateContent }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
5960
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
5961
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
5962
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
5963
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
5964
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
5965
|
+
__esDecorate(null, null, _contentElement_decorators, { kind: "field", name: "contentElement", static: false, private: false, access: { has: obj => "contentElement" in obj, get: obj => obj.contentElement, set: (obj, value) => { obj.contentElement = value; } }, metadata: _metadata }, _contentElement_initializers, _contentElement_extraInitializers);
|
|
5966
|
+
__esDecorate(null, null, _decimals_decorators, { kind: "field", name: "decimals", static: false, private: false, access: { has: obj => "decimals" in obj, get: obj => obj.decimals, set: (obj, value) => { obj.decimals = value; } }, metadata: _metadata }, _decimals_initializers, _decimals_extraInitializers);
|
|
5967
|
+
__esDecorate(null, null, _showTrend_decorators, { kind: "field", name: "showTrend", static: false, private: false, access: { has: obj => "showTrend" in obj, get: obj => obj.showTrend, set: (obj, value) => { obj.showTrend = value; } }, metadata: _metadata }, _showTrend_initializers, _showTrend_extraInitializers);
|
|
5968
|
+
__esDecorate(null, null, _trendValue_decorators, { kind: "field", name: "trendValue", static: false, private: false, access: { has: obj => "trendValue" in obj, get: obj => obj.trendValue, set: (obj, value) => { obj.trendValue = value; } }, metadata: _metadata }, _trendValue_initializers, _trendValue_extraInitializers);
|
|
5969
|
+
__esDecorate(null, null, _colorize_decorators, { kind: "field", name: "colorize", static: false, private: false, access: { has: obj => "colorize" in obj, get: obj => obj.colorize, set: (obj, value) => { obj.colorize = value; } }, metadata: _metadata }, _colorize_initializers, _colorize_extraInitializers);
|
|
5970
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
5971
|
+
_classThis = _classDescriptor.value;
|
|
5972
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
5973
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
5974
|
+
}
|
|
5975
|
+
render() {
|
|
5976
|
+
const formattedValue = this.formatPercentageValue();
|
|
5977
|
+
const trendArrow = this.getTrendArrow();
|
|
5978
|
+
const styles = this.getPercentageStyles();
|
|
5979
|
+
return snice.html /*html*/ `
|
|
5980
|
+
<div class="cell-content cell-content--percentage" part="content" style="${styles}">
|
|
5981
|
+
${formattedValue}
|
|
5982
|
+
${this.showTrend && trendArrow ? snice.unsafeHTML(`<span class="percentage-trend">${trendArrow}</span>`) : ''}
|
|
5983
|
+
</div>
|
|
5984
|
+
`;
|
|
5985
|
+
}
|
|
5986
|
+
styles() {
|
|
5987
|
+
return snice.css /*css*/ `${cssContent$2}`;
|
|
5988
|
+
}
|
|
5989
|
+
init() {
|
|
5990
|
+
this.applyAlignment();
|
|
5991
|
+
}
|
|
5992
|
+
applyAlignment() {
|
|
5993
|
+
this.style.textAlign = this.align;
|
|
5994
|
+
}
|
|
5995
|
+
updateAlignment() {
|
|
5996
|
+
this.applyAlignment();
|
|
5997
|
+
}
|
|
5998
|
+
updateContent() {
|
|
5999
|
+
if (this.contentElement) {
|
|
6000
|
+
const formattedValue = this.formatPercentageValue();
|
|
6001
|
+
const trendArrow = this.getTrendArrow();
|
|
6002
|
+
const styles = this.getPercentageStyles();
|
|
6003
|
+
const trendHTML = this.showTrend && trendArrow
|
|
6004
|
+
? `<span class="percentage-trend">${trendArrow}</span>`
|
|
6005
|
+
: '';
|
|
6006
|
+
this.contentElement.innerHTML = formattedValue + trendHTML;
|
|
6007
|
+
this.contentElement.setAttribute('style', styles);
|
|
6008
|
+
}
|
|
6009
|
+
}
|
|
6010
|
+
formatPercentageValue() {
|
|
6011
|
+
if (this.value === null || this.value === undefined || this.value === '') {
|
|
6012
|
+
return '';
|
|
6013
|
+
}
|
|
6014
|
+
// Use custom formatter if provided
|
|
6015
|
+
if (this.column?.formatter) {
|
|
6016
|
+
return this.column.formatter(this.value, this.rowData);
|
|
6017
|
+
}
|
|
6018
|
+
// Use column percentage format or component properties
|
|
6019
|
+
const format = this.column?.percentageFormat || {
|
|
6020
|
+
decimals: this.decimals,
|
|
6021
|
+
showTrend: this.showTrend,
|
|
6022
|
+
trendValue: this.trendValue,
|
|
6023
|
+
colorize: this.colorize
|
|
6024
|
+
};
|
|
6025
|
+
const num = Number(this.value);
|
|
6026
|
+
if (isNaN(num)) {
|
|
6027
|
+
return String(this.value);
|
|
6028
|
+
}
|
|
6029
|
+
const formatted = num.toFixed(format.decimals ?? this.decimals);
|
|
6030
|
+
return `${formatted}%`;
|
|
6031
|
+
}
|
|
6032
|
+
getTrendArrow() {
|
|
6033
|
+
const trend = this.column?.percentageFormat?.trendValue ?? this.trendValue;
|
|
6034
|
+
if (trend === null || trend === undefined) {
|
|
6035
|
+
return '';
|
|
6036
|
+
}
|
|
6037
|
+
if (trend > 0) {
|
|
6038
|
+
return '↑';
|
|
6039
|
+
}
|
|
6040
|
+
else if (trend < 0) {
|
|
6041
|
+
return '↓';
|
|
6042
|
+
}
|
|
6043
|
+
return '→';
|
|
6044
|
+
}
|
|
6045
|
+
getPercentageStyles() {
|
|
6046
|
+
const num = Number(this.value);
|
|
6047
|
+
const shouldColorize = this.column?.percentageFormat?.colorize ?? this.colorize;
|
|
6048
|
+
// Remove existing classes
|
|
6049
|
+
this.classList.remove('percentage--positive', 'percentage--negative', 'percentage--zero');
|
|
6050
|
+
if (shouldColorize) {
|
|
6051
|
+
if (num > 0) {
|
|
6052
|
+
this.classList.add('percentage--positive');
|
|
6053
|
+
}
|
|
6054
|
+
else if (num < 0) {
|
|
6055
|
+
this.classList.add('percentage--negative');
|
|
6056
|
+
}
|
|
6057
|
+
else if (num === 0) {
|
|
6058
|
+
this.classList.add('percentage--zero');
|
|
6059
|
+
}
|
|
6060
|
+
}
|
|
6061
|
+
// Apply trend arrow color
|
|
6062
|
+
const trend = this.column?.percentageFormat?.trendValue ?? this.trendValue;
|
|
6063
|
+
this.classList.remove('percentage--trend-up', 'percentage--trend-down', 'percentage--trend-neutral');
|
|
6064
|
+
if (trend !== null && trend !== undefined) {
|
|
6065
|
+
if (trend > 0) {
|
|
6066
|
+
this.classList.add('percentage--trend-up');
|
|
6067
|
+
}
|
|
6068
|
+
else if (trend < 0) {
|
|
6069
|
+
this.classList.add('percentage--trend-down');
|
|
6070
|
+
}
|
|
6071
|
+
else {
|
|
6072
|
+
this.classList.add('percentage--trend-neutral');
|
|
6073
|
+
}
|
|
6074
|
+
}
|
|
6075
|
+
return 'text-align: right';
|
|
6076
|
+
}
|
|
6077
|
+
constructor() {
|
|
6078
|
+
super(...arguments);
|
|
6079
|
+
this.align = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _align_initializers, 'right'));
|
|
6080
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'percentage'));
|
|
6081
|
+
this.value = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
6082
|
+
this.column = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
6083
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
6084
|
+
this.contentElement = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _contentElement_initializers, void 0));
|
|
6085
|
+
this.decimals = (__runInitializers(this, _contentElement_extraInitializers), __runInitializers(this, _decimals_initializers, 2));
|
|
6086
|
+
this.showTrend = (__runInitializers(this, _decimals_extraInitializers), __runInitializers(this, _showTrend_initializers, false));
|
|
6087
|
+
this.trendValue = (__runInitializers(this, _showTrend_extraInitializers), __runInitializers(this, _trendValue_initializers, null));
|
|
6088
|
+
this.colorize = (__runInitializers(this, _trendValue_extraInitializers), __runInitializers(this, _colorize_initializers, true));
|
|
6089
|
+
__runInitializers(this, _colorize_extraInitializers);
|
|
6090
|
+
}
|
|
6091
|
+
});
|
|
6092
|
+
return _classThis;
|
|
6093
|
+
})();
|
|
6094
|
+
|
|
6095
|
+
var cssContent$1 = ":host{color:var(--snice-color-text);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);text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-link:hover{color:var(--snice-color-primary-dark);text-decoration:underline}.location-link:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-radius:2px}.location-link:visited{color:var(--snice-color-secondary)}.location-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--snice-color-text)}.location-empty{color:var(--snice-color-text-secondary);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);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)}.location-icon{display:none}}";
|
|
6096
|
+
|
|
6097
|
+
(() => {
|
|
6098
|
+
let _classDecorators = [snice.element('snice-cell-location')];
|
|
6099
|
+
let _classDescriptor;
|
|
6100
|
+
let _classExtraInitializers = [];
|
|
6101
|
+
let _classThis;
|
|
6102
|
+
let _classSuper = HTMLElement;
|
|
6103
|
+
let _instanceExtraInitializers = [];
|
|
6104
|
+
let _value_decorators;
|
|
6105
|
+
let _value_initializers = [];
|
|
6106
|
+
let _value_extraInitializers = [];
|
|
6107
|
+
let _address_decorators;
|
|
6108
|
+
let _address_initializers = [];
|
|
6109
|
+
let _address_extraInitializers = [];
|
|
6110
|
+
let _latitude_decorators;
|
|
6111
|
+
let _latitude_initializers = [];
|
|
6112
|
+
let _latitude_extraInitializers = [];
|
|
6113
|
+
let _longitude_decorators;
|
|
6114
|
+
let _longitude_initializers = [];
|
|
6115
|
+
let _longitude_extraInitializers = [];
|
|
6116
|
+
let _showMapLink_decorators;
|
|
6117
|
+
let _showMapLink_initializers = [];
|
|
6118
|
+
let _showMapLink_extraInitializers = [];
|
|
6119
|
+
let _mapProvider_decorators;
|
|
6120
|
+
let _mapProvider_initializers = [];
|
|
6121
|
+
let _mapProvider_extraInitializers = [];
|
|
6122
|
+
let _showIcon_decorators;
|
|
6123
|
+
let _showIcon_initializers = [];
|
|
6124
|
+
let _showIcon_extraInitializers = [];
|
|
6125
|
+
let _column_decorators;
|
|
6126
|
+
let _column_initializers = [];
|
|
6127
|
+
let _column_extraInitializers = [];
|
|
6128
|
+
let _rowData_decorators;
|
|
6129
|
+
let _rowData_initializers = [];
|
|
6130
|
+
let _rowData_extraInitializers = [];
|
|
6131
|
+
let _align_decorators;
|
|
6132
|
+
let _align_initializers = [];
|
|
6133
|
+
let _align_extraInitializers = [];
|
|
6134
|
+
let _type_decorators;
|
|
6135
|
+
let _type_initializers = [];
|
|
6136
|
+
let _type_extraInitializers = [];
|
|
6137
|
+
let _render_decorators;
|
|
6138
|
+
let _styles_decorators;
|
|
6139
|
+
let _init_decorators;
|
|
6140
|
+
let _updateLocationAttributes_decorators;
|
|
6141
|
+
(class extends _classSuper {
|
|
6142
|
+
static { _classThis = this; }
|
|
6143
|
+
static {
|
|
6144
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
6145
|
+
_value_decorators = [snice.property({ type: String })];
|
|
6146
|
+
_address_decorators = [snice.property({ type: String })];
|
|
6147
|
+
_latitude_decorators = [snice.property({ type: String })];
|
|
6148
|
+
_longitude_decorators = [snice.property({ type: String })];
|
|
6149
|
+
_showMapLink_decorators = [snice.property({ type: Boolean })];
|
|
6150
|
+
_mapProvider_decorators = [snice.property({ type: String })];
|
|
6151
|
+
_showIcon_decorators = [snice.property({ type: Boolean })];
|
|
6152
|
+
_column_decorators = [snice.property({ type: Object })];
|
|
6153
|
+
_rowData_decorators = [snice.property({ type: Object })];
|
|
6154
|
+
_align_decorators = [snice.property({ type: String })];
|
|
6155
|
+
_type_decorators = [snice.property({ type: String })];
|
|
6156
|
+
_render_decorators = [snice.render()];
|
|
6157
|
+
_styles_decorators = [snice.styles()];
|
|
6158
|
+
_init_decorators = [snice.ready()];
|
|
6159
|
+
_updateLocationAttributes_decorators = [snice.watch('value', 'column')];
|
|
6160
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6161
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6162
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6163
|
+
__esDecorate(this, null, _updateLocationAttributes_decorators, { kind: "method", name: "updateLocationAttributes", static: false, private: false, access: { has: obj => "updateLocationAttributes" in obj, get: obj => obj.updateLocationAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6164
|
+
__esDecorate(null, null, _value_decorators, { kind: "field", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
6165
|
+
__esDecorate(null, null, _address_decorators, { kind: "field", name: "address", static: false, private: false, access: { has: obj => "address" in obj, get: obj => obj.address, set: (obj, value) => { obj.address = value; } }, metadata: _metadata }, _address_initializers, _address_extraInitializers);
|
|
6166
|
+
__esDecorate(null, null, _latitude_decorators, { kind: "field", name: "latitude", static: false, private: false, access: { has: obj => "latitude" in obj, get: obj => obj.latitude, set: (obj, value) => { obj.latitude = value; } }, metadata: _metadata }, _latitude_initializers, _latitude_extraInitializers);
|
|
6167
|
+
__esDecorate(null, null, _longitude_decorators, { kind: "field", name: "longitude", static: false, private: false, access: { has: obj => "longitude" in obj, get: obj => obj.longitude, set: (obj, value) => { obj.longitude = value; } }, metadata: _metadata }, _longitude_initializers, _longitude_extraInitializers);
|
|
6168
|
+
__esDecorate(null, null, _showMapLink_decorators, { kind: "field", name: "showMapLink", static: false, private: false, access: { has: obj => "showMapLink" in obj, get: obj => obj.showMapLink, set: (obj, value) => { obj.showMapLink = value; } }, metadata: _metadata }, _showMapLink_initializers, _showMapLink_extraInitializers);
|
|
6169
|
+
__esDecorate(null, null, _mapProvider_decorators, { kind: "field", name: "mapProvider", static: false, private: false, access: { has: obj => "mapProvider" in obj, get: obj => obj.mapProvider, set: (obj, value) => { obj.mapProvider = value; } }, metadata: _metadata }, _mapProvider_initializers, _mapProvider_extraInitializers);
|
|
6170
|
+
__esDecorate(null, null, _showIcon_decorators, { kind: "field", name: "showIcon", static: false, private: false, access: { has: obj => "showIcon" in obj, get: obj => obj.showIcon, set: (obj, value) => { obj.showIcon = value; } }, metadata: _metadata }, _showIcon_initializers, _showIcon_extraInitializers);
|
|
6171
|
+
__esDecorate(null, null, _column_decorators, { kind: "field", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
6172
|
+
__esDecorate(null, null, _rowData_decorators, { kind: "field", name: "rowData", static: false, private: false, access: { has: obj => "rowData" in obj, get: obj => obj.rowData, set: (obj, value) => { obj.rowData = value; } }, metadata: _metadata }, _rowData_initializers, _rowData_extraInitializers);
|
|
6173
|
+
__esDecorate(null, null, _align_decorators, { kind: "field", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
|
|
6174
|
+
__esDecorate(null, null, _type_decorators, { kind: "field", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
6175
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
6176
|
+
_classThis = _classDescriptor.value;
|
|
6177
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
6178
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
6179
|
+
}
|
|
6180
|
+
render() {
|
|
6181
|
+
const locationValue = this.address || this.value;
|
|
6182
|
+
const iconHTML = this.showIcon ? '<span class="location-icon">📍</span>' : '';
|
|
6183
|
+
const mapLink = this.getMapLink();
|
|
6184
|
+
if (!locationValue && !this.latitude && !this.longitude) {
|
|
6185
|
+
return snice.html /*html*/ `
|
|
6186
|
+
<div class="cell-content cell-content--location" part="content">
|
|
6187
|
+
<span class="location-empty"></span>
|
|
6188
|
+
</div>
|
|
6189
|
+
`;
|
|
6190
|
+
}
|
|
6191
|
+
const displayText = locationValue || `${this.latitude}, ${this.longitude}`;
|
|
6192
|
+
return snice.html /*html*/ `
|
|
6193
|
+
<div class="cell-content cell-content--location" part="content">
|
|
6194
|
+
${snice.unsafeHTML(iconHTML)}
|
|
6195
|
+
${this.showMapLink && mapLink
|
|
6196
|
+
? snice.html `<a href="${mapLink}" target="_blank" rel="noopener noreferrer" class="location-link" part="link">
|
|
6197
|
+
${displayText}
|
|
6198
|
+
</a>`
|
|
6199
|
+
: snice.html `<span class="location-text">${displayText}</span>`}
|
|
6200
|
+
</div>
|
|
6201
|
+
`;
|
|
6202
|
+
}
|
|
6203
|
+
styles() {
|
|
6204
|
+
return snice.css /*css*/ `${cssContent$1}`;
|
|
6205
|
+
}
|
|
6206
|
+
init() {
|
|
6207
|
+
this.updateLocationAttributes();
|
|
6208
|
+
}
|
|
6209
|
+
updateLocationAttributes() {
|
|
6210
|
+
if (this.column?.locationFormat) {
|
|
6211
|
+
const format = this.column.locationFormat;
|
|
6212
|
+
this.address = format.address || this.value;
|
|
6213
|
+
this.latitude = format.latitude ? String(format.latitude) : '';
|
|
6214
|
+
this.longitude = format.longitude ? String(format.longitude) : '';
|
|
6215
|
+
this.showMapLink = format.showMapLink ?? true;
|
|
6216
|
+
this.mapProvider = format.mapProvider || 'google';
|
|
6217
|
+
this.showIcon = format.showIcon ?? true;
|
|
6218
|
+
}
|
|
6219
|
+
}
|
|
6220
|
+
getMapLink() {
|
|
6221
|
+
if (!this.showMapLink) {
|
|
6222
|
+
return '';
|
|
6223
|
+
}
|
|
6224
|
+
const address = this.address || this.value;
|
|
6225
|
+
const lat = this.latitude;
|
|
6226
|
+
const lon = this.longitude;
|
|
6227
|
+
switch (this.mapProvider) {
|
|
6228
|
+
case 'google':
|
|
6229
|
+
if (lat && lon) {
|
|
6230
|
+
return `https://www.google.com/maps?q=${lat},${lon}`;
|
|
6231
|
+
}
|
|
6232
|
+
if (address) {
|
|
6233
|
+
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`;
|
|
6234
|
+
}
|
|
6235
|
+
return '';
|
|
6236
|
+
case 'openstreetmap':
|
|
6237
|
+
if (lat && lon) {
|
|
6238
|
+
return `https://www.openstreetmap.org/?mlat=${lat}&mlon=${lon}&zoom=15`;
|
|
6239
|
+
}
|
|
6240
|
+
if (address) {
|
|
6241
|
+
return `https://www.openstreetmap.org/search?query=${encodeURIComponent(address)}`;
|
|
6242
|
+
}
|
|
6243
|
+
return '';
|
|
6244
|
+
case 'apple':
|
|
6245
|
+
if (lat && lon) {
|
|
6246
|
+
return `https://maps.apple.com/?ll=${lat},${lon}`;
|
|
6247
|
+
}
|
|
6248
|
+
if (address) {
|
|
6249
|
+
return `https://maps.apple.com/?address=${encodeURIComponent(address)}`;
|
|
6250
|
+
}
|
|
6251
|
+
return '';
|
|
6252
|
+
default:
|
|
6253
|
+
return '';
|
|
6254
|
+
}
|
|
6255
|
+
}
|
|
6256
|
+
constructor() {
|
|
6257
|
+
super(...arguments);
|
|
6258
|
+
this.value = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _value_initializers, ''));
|
|
6259
|
+
this.address = (__runInitializers(this, _value_extraInitializers), __runInitializers(this, _address_initializers, ''));
|
|
6260
|
+
this.latitude = (__runInitializers(this, _address_extraInitializers), __runInitializers(this, _latitude_initializers, ''));
|
|
6261
|
+
this.longitude = (__runInitializers(this, _latitude_extraInitializers), __runInitializers(this, _longitude_initializers, ''));
|
|
6262
|
+
this.showMapLink = (__runInitializers(this, _longitude_extraInitializers), __runInitializers(this, _showMapLink_initializers, true));
|
|
6263
|
+
this.mapProvider = (__runInitializers(this, _showMapLink_extraInitializers), __runInitializers(this, _mapProvider_initializers, 'google'));
|
|
6264
|
+
this.showIcon = (__runInitializers(this, _mapProvider_extraInitializers), __runInitializers(this, _showIcon_initializers, true));
|
|
6265
|
+
this.column = (__runInitializers(this, _showIcon_extraInitializers), __runInitializers(this, _column_initializers, null));
|
|
6266
|
+
this.rowData = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _rowData_initializers, null));
|
|
6267
|
+
this.align = (__runInitializers(this, _rowData_extraInitializers), __runInitializers(this, _align_initializers, 'left'));
|
|
6268
|
+
this.type = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _type_initializers, 'location'));
|
|
6269
|
+
__runInitializers(this, _type_extraInitializers);
|
|
6270
|
+
}
|
|
6271
|
+
});
|
|
6272
|
+
return _classThis;
|
|
6273
|
+
})();
|
|
6274
|
+
|
|
6275
|
+
var cssContent = ":host{display:block;width:100%;min-height:2.5rem}.row-container{display:flex;align-items:stretch;width:100%;min-height:2.5rem;height:2.5rem;background:0 0;color:var(--snice-color-text);border-bottom:1px solid var(--snice-color-border);transition:background-color .15s}.cell{display:flex;align-items:center;border-right:1px solid var(--snice-color-border);min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;word-wrap:break-word;overflow:hidden;color:var(--snice-color-text)}.cell:last-child{border-right:none}.cell--checkbox{width:3rem;min-width:3rem;max-width:3rem;padding:.75rem;justify-content:center}.row-checkbox{width:1rem;height:1rem;cursor:pointer}.cells-container{display:flex;flex:1;align-items:stretch}.cell--text{text-align:left}.cell--accounting,.cell--currency,.cell--fraction,.cell--number,.cell--percent,.cell--scientific{text-align:right;font-variant-numeric:tabular-nums}.cell--date{min-width:8rem;font-variant-numeric:tabular-nums}.cell--boolean{text-align:center;font-size:1rem}.cell--rating{text-align:center;min-width:6rem}.cell--progress{min-width:8rem}.cell--sparkline{text-align:center;min-width:6rem}.cell--duration,.cell--filesize{text-align:right;font-variant-numeric:tabular-nums}:host(.row--hoverable) .row-container:hover{background-color:var(--snice-color-background-secondary)}:host(.row--clickable) .row-container{cursor:pointer}:host(.row--clickable) .row-container:hover{background-color:var(--snice-color-background-tertiary)}:host(.row--selected) .row-container{background-color:var(--snice-color-primary-light)}:host(.row--selected.row--hoverable) .row-container:hover{background-color:var(--snice-color-primary-lighter)}:host(.row--highlighted) .row-container{background-color:var(--snice-color-warning-light)!important;animation:2s ease-out row-highlight-fade}@keyframes row-highlight-fade{0%{background-color:var(--snice-color-warning-lighter)}100%{background-color:var(--snice-color-warning-light)}}:host(:focus) .row-container{outline:2px solid var(--snice-color-primary);outline-offset:-2px}:host(.row--selectable){tabindex:0}:host(.row--striped) .row-container{background-color:var(--snice-color-background-secondary)}:host(.row--bordered) .row-container{border-bottom:1px solid var(--snice-color-border)}:host(.row--small) .cell{padding:.5rem .75rem;min-height:2rem;font-size:.75rem}:host(.row--small) .row-container{min-height:2rem}:host(.row--large) .cell{padding:1rem 1.25rem;min-height:3.5rem;font-size:1rem}:host(.row--large) .row-container{min-height:3.5rem}@media (max-width:768px){.cell{padding:.5rem .75rem;font-size:.875rem}.cell--checkbox{width:2.5rem;min-width:2.5rem;max-width:2.5rem;padding:.5rem}.row-checkbox{width:.875rem;height:.875rem}}:host(.row--loading) .row-container{opacity:.6;pointer-events:none}:host(.row--loading) .row-container::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,hsl(0 0% 100% / .6),transparent);animation:1.5s infinite loading-shimmer}@keyframes loading-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}@media (prefers-reduced-motion:reduce){.row-container{transition:none}:host(.row--highlighted) .row-container{animation:none;background-color:var(--snice-color-warning-light)!important}:host(.row--loading) .row-container::after{animation:none}}@media (prefers-contrast:high){.cell{border-right:1px solid}.row-container{border-bottom:1px solid}:host(.row--selected) .row-container{border:2px solid}}";
|
|
6276
|
+
|
|
6277
|
+
(() => {
|
|
6278
|
+
let _classDecorators = [snice.element('snice-row')];
|
|
6279
|
+
let _classDescriptor;
|
|
6280
|
+
let _classExtraInitializers = [];
|
|
6281
|
+
let _classThis;
|
|
6282
|
+
let _classSuper = HTMLElement;
|
|
6283
|
+
let _instanceExtraInitializers = [];
|
|
6284
|
+
let _selected_decorators;
|
|
6285
|
+
let _selected_initializers = [];
|
|
6286
|
+
let _selected_extraInitializers = [];
|
|
6287
|
+
let _hoverable_decorators;
|
|
6288
|
+
let _hoverable_initializers = [];
|
|
6289
|
+
let _hoverable_extraInitializers = [];
|
|
6290
|
+
let _clickable_decorators;
|
|
6291
|
+
let _clickable_initializers = [];
|
|
6292
|
+
let _clickable_extraInitializers = [];
|
|
6293
|
+
let _selectable_decorators;
|
|
6294
|
+
let _selectable_initializers = [];
|
|
6295
|
+
let _selectable_extraInitializers = [];
|
|
6296
|
+
let _data_decorators;
|
|
6297
|
+
let _data_initializers = [];
|
|
6298
|
+
let _data_extraInitializers = [];
|
|
6299
|
+
let _index_decorators;
|
|
6300
|
+
let _index_initializers = [];
|
|
6301
|
+
let _index_extraInitializers = [];
|
|
6302
|
+
let _columns_decorators;
|
|
6303
|
+
let _columns_initializers = [];
|
|
6304
|
+
let _columns_extraInitializers = [];
|
|
6305
|
+
let _render_decorators;
|
|
6306
|
+
let _styles_decorators;
|
|
6307
|
+
let _init_decorators;
|
|
6308
|
+
let _updateSelection_decorators;
|
|
6309
|
+
let _updateRowAttributes_decorators;
|
|
6310
|
+
let _updateCells_decorators;
|
|
6311
|
+
let _dispatchRowClick_decorators;
|
|
6312
|
+
let _dispatchRowSelect_decorators;
|
|
6313
|
+
let _dispatchRowHover_decorators;
|
|
6314
|
+
(class extends _classSuper {
|
|
6315
|
+
static { _classThis = this; }
|
|
6316
|
+
static {
|
|
6317
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
6318
|
+
_selected_decorators = [snice.property({ type: Boolean, })];
|
|
6319
|
+
_hoverable_decorators = [snice.property({ type: Boolean, })];
|
|
6320
|
+
_clickable_decorators = [snice.property({ type: Boolean, })];
|
|
6321
|
+
_selectable_decorators = [snice.property({ type: Boolean, })];
|
|
6322
|
+
_data_decorators = [snice.property({ type: Object })];
|
|
6323
|
+
_index_decorators = [snice.property({ type: Number, })];
|
|
6324
|
+
_columns_decorators = [snice.property({ type: Array })];
|
|
6325
|
+
_render_decorators = [snice.render()];
|
|
6326
|
+
_styles_decorators = [snice.styles()];
|
|
6327
|
+
_init_decorators = [snice.ready()];
|
|
6328
|
+
_updateSelection_decorators = [snice.watch('selected')];
|
|
6329
|
+
_updateRowAttributes_decorators = [snice.watch('hoverable', 'clickable', 'selectable')];
|
|
6330
|
+
_updateCells_decorators = [snice.watch('data', 'columns')];
|
|
6331
|
+
_dispatchRowClick_decorators = [snice.dispatch('row-click', { bubbles: true, composed: true })];
|
|
6332
|
+
_dispatchRowSelect_decorators = [snice.dispatch('row-select', { bubbles: true, composed: true })];
|
|
6333
|
+
_dispatchRowHover_decorators = [snice.dispatch('row-hover', { bubbles: true, composed: true })];
|
|
6334
|
+
__esDecorate(this, null, _render_decorators, { kind: "method", name: "render", static: false, private: false, access: { has: obj => "render" in obj, get: obj => obj.render }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6335
|
+
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6336
|
+
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6337
|
+
__esDecorate(this, null, _updateSelection_decorators, { kind: "method", name: "updateSelection", static: false, private: false, access: { has: obj => "updateSelection" in obj, get: obj => obj.updateSelection }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6338
|
+
__esDecorate(this, null, _updateRowAttributes_decorators, { kind: "method", name: "updateRowAttributes", static: false, private: false, access: { has: obj => "updateRowAttributes" in obj, get: obj => obj.updateRowAttributes }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6339
|
+
__esDecorate(this, null, _updateCells_decorators, { kind: "method", name: "updateCells", static: false, private: false, access: { has: obj => "updateCells" in obj, get: obj => obj.updateCells }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6340
|
+
__esDecorate(this, null, _dispatchRowClick_decorators, { kind: "method", name: "dispatchRowClick", static: false, private: false, access: { has: obj => "dispatchRowClick" in obj, get: obj => obj.dispatchRowClick }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6341
|
+
__esDecorate(this, null, _dispatchRowSelect_decorators, { kind: "method", name: "dispatchRowSelect", static: false, private: false, access: { has: obj => "dispatchRowSelect" in obj, get: obj => obj.dispatchRowSelect }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6342
|
+
__esDecorate(this, null, _dispatchRowHover_decorators, { kind: "method", name: "dispatchRowHover", static: false, private: false, access: { has: obj => "dispatchRowHover" in obj, get: obj => obj.dispatchRowHover }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6343
|
+
__esDecorate(null, null, _selected_decorators, { kind: "field", name: "selected", static: false, private: false, access: { has: obj => "selected" in obj, get: obj => obj.selected, set: (obj, value) => { obj.selected = value; } }, metadata: _metadata }, _selected_initializers, _selected_extraInitializers);
|
|
6344
|
+
__esDecorate(null, null, _hoverable_decorators, { kind: "field", name: "hoverable", static: false, private: false, access: { has: obj => "hoverable" in obj, get: obj => obj.hoverable, set: (obj, value) => { obj.hoverable = value; } }, metadata: _metadata }, _hoverable_initializers, _hoverable_extraInitializers);
|
|
6345
|
+
__esDecorate(null, null, _clickable_decorators, { kind: "field", name: "clickable", static: false, private: false, access: { has: obj => "clickable" in obj, get: obj => obj.clickable, set: (obj, value) => { obj.clickable = value; } }, metadata: _metadata }, _clickable_initializers, _clickable_extraInitializers);
|
|
6346
|
+
__esDecorate(null, null, _selectable_decorators, { kind: "field", name: "selectable", static: false, private: false, access: { has: obj => "selectable" in obj, get: obj => obj.selectable, set: (obj, value) => { obj.selectable = value; } }, metadata: _metadata }, _selectable_initializers, _selectable_extraInitializers);
|
|
6347
|
+
__esDecorate(null, null, _data_decorators, { kind: "field", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _data_extraInitializers);
|
|
6348
|
+
__esDecorate(null, null, _index_decorators, { kind: "field", name: "index", static: false, private: false, access: { has: obj => "index" in obj, get: obj => obj.index, set: (obj, value) => { obj.index = value; } }, metadata: _metadata }, _index_initializers, _index_extraInitializers);
|
|
6349
|
+
__esDecorate(null, null, _columns_decorators, { kind: "field", name: "columns", static: false, private: false, access: { has: obj => "columns" in obj, get: obj => obj.columns, set: (obj, value) => { obj.columns = value; } }, metadata: _metadata }, _columns_initializers, _columns_extraInitializers);
|
|
6350
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
6351
|
+
_classThis = _classDescriptor.value;
|
|
6352
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
6353
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
6354
|
+
}
|
|
6355
|
+
// Extract data from data-* attributes - pass raw values, let cells handle conversion
|
|
6356
|
+
extractDataFromAttributes() {
|
|
6357
|
+
const data = {};
|
|
6358
|
+
// Get all attribute names that start with data-
|
|
6359
|
+
const attrNames = this.getAttributeNames().filter(name => name.startsWith('data-') && name !== 'data-column-index');
|
|
6360
|
+
attrNames.forEach(attrName => {
|
|
6361
|
+
const key = attrName.slice(5); // Remove 'data-' prefix
|
|
6362
|
+
const value = this.getAttribute(attrName);
|
|
6363
|
+
if (value !== null) {
|
|
6364
|
+
data[key] = value; // Keep as raw string, let cells convert
|
|
6365
|
+
}
|
|
6366
|
+
});
|
|
6367
|
+
return data;
|
|
6368
|
+
}
|
|
6369
|
+
render() {
|
|
6370
|
+
return snice.html /*html*/ `
|
|
6371
|
+
<div class="row-container" part="container" @click=${(e) => this.handleRowClick(e)} @keydown=${(e) => this.handleKeyDown(e)}>
|
|
6372
|
+
<if ${this.selectable}>
|
|
6373
|
+
${this.renderCheckbox()}
|
|
6374
|
+
</if>
|
|
6375
|
+
<div class="cells-container">
|
|
6376
|
+
<if ${this.columns && this.columns.length}>
|
|
6377
|
+
${this.columns.map((column, columnIndex) => this.renderCell(column, columnIndex))}
|
|
6378
|
+
</if>
|
|
6379
|
+
<if ${!this.columns || !this.columns.length}>
|
|
6380
|
+
<!-- No columns set yet -->
|
|
6381
|
+
</if>
|
|
6382
|
+
</div>
|
|
6383
|
+
</div>
|
|
6384
|
+
`;
|
|
6385
|
+
}
|
|
6386
|
+
styles() {
|
|
6387
|
+
return snice.css /*css*/ `${cssContent}`;
|
|
6388
|
+
}
|
|
6389
|
+
init() {
|
|
6390
|
+
// Extract data from data-* attributes if data object is empty
|
|
6391
|
+
if (!this.data || Object.keys(this.data).length === 0) {
|
|
6392
|
+
this.data = this.extractDataFromAttributes();
|
|
6393
|
+
}
|
|
6394
|
+
this.updateRowAttributes();
|
|
6395
|
+
this.configureCells();
|
|
6396
|
+
}
|
|
6397
|
+
configureCells() {
|
|
6398
|
+
if (!this.columns) {
|
|
6399
|
+
return;
|
|
6400
|
+
}
|
|
6401
|
+
this.columns.forEach((column, index) => {
|
|
6402
|
+
const cellElement = this.shadowRoot?.querySelector(`[data-column-index="${index}"]`);
|
|
6403
|
+
if (cellElement) {
|
|
6404
|
+
const value = this.data[column.key];
|
|
6405
|
+
cellElement.value = value;
|
|
6406
|
+
cellElement.column = column;
|
|
6407
|
+
cellElement.rowData = this.data;
|
|
6408
|
+
// For sparkline cells, also set the data property if value is an array
|
|
6409
|
+
if (column.type === 'sparkline' && Array.isArray(value)) {
|
|
6410
|
+
cellElement.data = value;
|
|
6411
|
+
}
|
|
6412
|
+
}
|
|
6413
|
+
});
|
|
6414
|
+
}
|
|
6415
|
+
updateSelection() {
|
|
6416
|
+
this.updateRowAttributes();
|
|
6417
|
+
const checkbox = this.shadowRoot?.querySelector('.row-checkbox');
|
|
6418
|
+
if (checkbox) {
|
|
6419
|
+
checkbox.checked = this.selected;
|
|
6420
|
+
}
|
|
6421
|
+
}
|
|
6422
|
+
updateRowAttributes() {
|
|
6423
|
+
this.classList.toggle('row--hoverable', this.hoverable);
|
|
6424
|
+
this.classList.toggle('row--clickable', this.clickable);
|
|
6425
|
+
this.classList.toggle('row--selectable', this.selectable);
|
|
6426
|
+
this.classList.toggle('row--selected', this.selected);
|
|
6427
|
+
}
|
|
6428
|
+
updateCells() {
|
|
6429
|
+
// Re-render is handled automatically by @render decorator
|
|
6430
|
+
// Just need to reconfigure cells after the template updates
|
|
6431
|
+
setTimeout(() => this.configureCells(), 0);
|
|
6432
|
+
}
|
|
6433
|
+
handleRowClick(e) {
|
|
6434
|
+
const target = e.target;
|
|
6435
|
+
// Handle checkbox change separately
|
|
6436
|
+
if (target.matches('.row-checkbox')) {
|
|
6437
|
+
return; // Let the change event handle this
|
|
6438
|
+
}
|
|
6439
|
+
// Don't trigger row click if clicking on other interactive elements
|
|
6440
|
+
if (target.matches('button, a, .interactive')) {
|
|
6441
|
+
return;
|
|
6442
|
+
}
|
|
6443
|
+
if (this.clickable) {
|
|
6444
|
+
this.dispatchRowClick();
|
|
6445
|
+
}
|
|
6446
|
+
if (this.selectable) {
|
|
6447
|
+
this.toggleSelection();
|
|
6448
|
+
}
|
|
6449
|
+
}
|
|
6450
|
+
handleChange(e) {
|
|
6451
|
+
const target = e.target;
|
|
6452
|
+
if (!target.matches('.row-checkbox'))
|
|
6453
|
+
return;
|
|
6454
|
+
const checkbox = target;
|
|
6455
|
+
this.selected = checkbox.checked;
|
|
6456
|
+
this.dispatchRowSelect();
|
|
6457
|
+
}
|
|
6458
|
+
handleKeyDown(e) {
|
|
6459
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
6460
|
+
e.preventDefault();
|
|
6461
|
+
if (this.selectable) {
|
|
6462
|
+
this.toggleSelection();
|
|
6463
|
+
}
|
|
6464
|
+
else if (this.clickable) {
|
|
6465
|
+
this.dispatchRowClick();
|
|
6466
|
+
}
|
|
6467
|
+
}
|
|
6468
|
+
}
|
|
6469
|
+
renderCheckbox() {
|
|
6470
|
+
return snice.html /*html*/ `
|
|
6471
|
+
<div class="cell cell--checkbox" part="checkbox-cell">
|
|
6472
|
+
<input
|
|
6473
|
+
type="checkbox"
|
|
6474
|
+
class="row-checkbox"
|
|
6475
|
+
?checked=${this.selected}
|
|
6476
|
+
tabindex="-1"
|
|
6477
|
+
@change=${(e) => this.handleChange(e)}
|
|
6478
|
+
/>
|
|
6479
|
+
</div>
|
|
6480
|
+
`;
|
|
6481
|
+
}
|
|
6482
|
+
renderCell(column, columnIndex) {
|
|
6483
|
+
this.data[column.key];
|
|
6484
|
+
const cellComponent = this.getCellComponent(column.type);
|
|
6485
|
+
return snice.html /*html*/ `
|
|
6486
|
+
<div class="cell cell--${column.type}" part="cell" style="${this.getCellStyles(column)}">
|
|
6487
|
+
${snice.unsafeHTML(`<${cellComponent}
|
|
6488
|
+
type="${column.type}"
|
|
6489
|
+
align="${column.align || 'left'}"
|
|
6490
|
+
data-column-index="${columnIndex}"
|
|
6491
|
+
></${cellComponent}>`)}
|
|
6492
|
+
</div>
|
|
6493
|
+
`;
|
|
6494
|
+
}
|
|
6495
|
+
getCellComponent(type) {
|
|
6496
|
+
switch (type) {
|
|
6497
|
+
case 'text':
|
|
6498
|
+
return 'snice-cell-text';
|
|
6499
|
+
case 'number':
|
|
6500
|
+
case 'accounting':
|
|
6501
|
+
case 'scientific':
|
|
6502
|
+
case 'fraction':
|
|
6503
|
+
return 'snice-cell-number';
|
|
6504
|
+
case 'date':
|
|
6505
|
+
return 'snice-cell-date';
|
|
6506
|
+
case 'boolean':
|
|
6507
|
+
return 'snice-cell-boolean';
|
|
6508
|
+
case 'sparkline':
|
|
6509
|
+
return 'snice-cell-sparkline';
|
|
6510
|
+
case 'rating':
|
|
6511
|
+
return 'snice-cell-rating';
|
|
6512
|
+
case 'progress':
|
|
6513
|
+
return 'snice-cell-progress';
|
|
6514
|
+
case 'duration':
|
|
6515
|
+
return 'snice-cell-duration';
|
|
6516
|
+
case 'filesize':
|
|
6517
|
+
return 'snice-cell-filesize';
|
|
6518
|
+
case 'link':
|
|
6519
|
+
case 'url':
|
|
6520
|
+
return 'snice-cell-link';
|
|
6521
|
+
case 'actions':
|
|
6522
|
+
return 'snice-cell-actions';
|
|
6523
|
+
case 'tag':
|
|
6524
|
+
case 'tags':
|
|
6525
|
+
case 'badge':
|
|
6526
|
+
case 'badges':
|
|
6527
|
+
return 'snice-cell-tag';
|
|
6528
|
+
case 'image':
|
|
6529
|
+
case 'avatar':
|
|
6530
|
+
case 'thumbnail':
|
|
6531
|
+
return 'snice-cell-image';
|
|
6532
|
+
case 'email':
|
|
6533
|
+
return 'snice-cell-email';
|
|
6534
|
+
case 'phone':
|
|
6535
|
+
case 'tel':
|
|
6536
|
+
case 'telephone':
|
|
6537
|
+
return 'snice-cell-phone';
|
|
6538
|
+
case 'status':
|
|
6539
|
+
return 'snice-cell-status';
|
|
6540
|
+
case 'color':
|
|
6541
|
+
return 'snice-cell-color';
|
|
6542
|
+
case 'json':
|
|
6543
|
+
case 'object':
|
|
6544
|
+
return 'snice-cell-json';
|
|
6545
|
+
case 'currency':
|
|
6546
|
+
case 'money':
|
|
6547
|
+
return 'snice-cell-currency';
|
|
6548
|
+
case 'percent':
|
|
6549
|
+
case 'percentage':
|
|
6550
|
+
return 'snice-cell-percentage';
|
|
6551
|
+
case 'location':
|
|
6552
|
+
case 'address':
|
|
6553
|
+
case 'coordinates':
|
|
6554
|
+
return 'snice-cell-location';
|
|
6555
|
+
case 'custom':
|
|
6556
|
+
default:
|
|
6557
|
+
return 'snice-cell';
|
|
6558
|
+
}
|
|
6559
|
+
}
|
|
6560
|
+
getCellStyles(column) {
|
|
6561
|
+
let styles = [];
|
|
6562
|
+
if (column.width) {
|
|
6563
|
+
styles.push(`width: ${column.width}`);
|
|
6564
|
+
styles.push(`min-width: ${column.width}`);
|
|
6565
|
+
styles.push(`max-width: ${column.width}`);
|
|
6566
|
+
}
|
|
6567
|
+
if (column.align) {
|
|
6568
|
+
styles.push(`text-align: ${column.align}`);
|
|
6569
|
+
}
|
|
6570
|
+
return styles.join('; ');
|
|
6571
|
+
}
|
|
6572
|
+
escapeHtml(value) {
|
|
6573
|
+
if (value === null || value === undefined) {
|
|
6574
|
+
return '';
|
|
6575
|
+
}
|
|
6576
|
+
const str = String(value);
|
|
6577
|
+
const div = document.createElement('div');
|
|
6578
|
+
div.textContent = str;
|
|
6579
|
+
return div.innerHTML;
|
|
6580
|
+
}
|
|
6581
|
+
toggleSelection() {
|
|
6582
|
+
this.selected = !this.selected;
|
|
6583
|
+
this.dispatchRowSelect();
|
|
6584
|
+
}
|
|
6585
|
+
dispatchRowClick() {
|
|
6586
|
+
return {
|
|
6587
|
+
data: this.data,
|
|
6588
|
+
index: this.index,
|
|
6589
|
+
element: this
|
|
6590
|
+
};
|
|
6591
|
+
}
|
|
6592
|
+
dispatchRowSelect() {
|
|
6593
|
+
return {
|
|
6594
|
+
selected: this.selected,
|
|
6595
|
+
data: this.data,
|
|
6596
|
+
index: this.index,
|
|
6597
|
+
element: this
|
|
6598
|
+
};
|
|
6599
|
+
}
|
|
6600
|
+
dispatchRowHover() {
|
|
6601
|
+
return {
|
|
6602
|
+
data: this.data,
|
|
6603
|
+
index: this.index,
|
|
6604
|
+
element: this
|
|
6605
|
+
};
|
|
6606
|
+
}
|
|
6607
|
+
// Public API methods
|
|
6608
|
+
select() {
|
|
6609
|
+
this.selected = true;
|
|
6610
|
+
this.dispatchRowSelect();
|
|
6611
|
+
}
|
|
6612
|
+
deselect() {
|
|
6613
|
+
this.selected = false;
|
|
6614
|
+
this.dispatchRowSelect();
|
|
6615
|
+
}
|
|
6616
|
+
focusRow() {
|
|
6617
|
+
super.focus();
|
|
6618
|
+
this.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
6619
|
+
}
|
|
6620
|
+
getCellValue(columnKey) {
|
|
6621
|
+
return this.data[columnKey];
|
|
6622
|
+
}
|
|
6623
|
+
setCellValue(columnKey, value) {
|
|
6624
|
+
this.data = { ...this.data, [columnKey]: value };
|
|
6625
|
+
this.updateCells();
|
|
6626
|
+
}
|
|
6627
|
+
getCellElement(columnKey) {
|
|
6628
|
+
const column = this.columns.find(col => col.key === columnKey);
|
|
6629
|
+
if (!column)
|
|
6630
|
+
return null;
|
|
6631
|
+
const columnIndex = this.columns.indexOf(column);
|
|
6632
|
+
return this.shadowRoot?.querySelector(`[data-column-index="${columnIndex}"]`) || null;
|
|
6633
|
+
}
|
|
6634
|
+
// Highlight row temporarily (useful for showing updates)
|
|
6635
|
+
highlight(duration = 2000) {
|
|
6636
|
+
this.classList.add('row--highlighted');
|
|
6637
|
+
setTimeout(() => {
|
|
6638
|
+
this.classList.remove('row--highlighted');
|
|
6639
|
+
}, duration);
|
|
6640
|
+
}
|
|
6641
|
+
constructor() {
|
|
6642
|
+
super(...arguments);
|
|
6643
|
+
this.selected = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _selected_initializers, false));
|
|
6644
|
+
this.hoverable = (__runInitializers(this, _selected_extraInitializers), __runInitializers(this, _hoverable_initializers, true));
|
|
6645
|
+
this.clickable = (__runInitializers(this, _hoverable_extraInitializers), __runInitializers(this, _clickable_initializers, false));
|
|
6646
|
+
this.selectable = (__runInitializers(this, _clickable_extraInitializers), __runInitializers(this, _selectable_initializers, false));
|
|
6647
|
+
this.data = (__runInitializers(this, _selectable_extraInitializers), __runInitializers(this, _data_initializers, {}));
|
|
6648
|
+
this.index = (__runInitializers(this, _data_extraInitializers), __runInitializers(this, _index_initializers, 0));
|
|
6649
|
+
this.columns = (__runInitializers(this, _index_extraInitializers), __runInitializers(this, _columns_initializers, []));
|
|
6650
|
+
__runInitializers(this, _columns_extraInitializers);
|
|
6651
|
+
}
|
|
6652
|
+
});
|
|
6653
|
+
return _classThis;
|
|
6654
|
+
})();
|
|
6655
|
+
|
|
3891
6656
|
let SniceTable = (() => {
|
|
3892
6657
|
let _classDecorators = [snice.element('snice-table')];
|
|
3893
6658
|
let _classDescriptor;
|
|
@@ -4110,8 +6875,8 @@ var SniceTable = (function (exports, snice) {
|
|
|
4110
6875
|
_table_decorators = [snice.query('table')];
|
|
4111
6876
|
_thead_decorators = [snice.query('thead')];
|
|
4112
6877
|
_tbody_decorators = [snice.query('tbody')];
|
|
4113
|
-
_getTableConfig_decorators = [snice.request('
|
|
4114
|
-
_getTableData_decorators = [snice.request('
|
|
6878
|
+
_getTableConfig_decorators = [snice.request('table/config')];
|
|
6879
|
+
_getTableData_decorators = [snice.request('table/data')];
|
|
4115
6880
|
_styles_decorators = [snice.styles()];
|
|
4116
6881
|
_render_decorators = [snice.render()];
|
|
4117
6882
|
_initialize_decorators = [snice.ready()];
|
|
@@ -4531,7 +7296,7 @@ var SniceTable = (function (exports, snice) {
|
|
|
4531
7296
|
}
|
|
4532
7297
|
async initialize() {
|
|
4533
7298
|
// Listen for controller attached event
|
|
4534
|
-
this.addEventListener('
|
|
7299
|
+
this.addEventListener('controller-attached', this.onAttached);
|
|
4535
7300
|
// Listen for select change events from the filter dropdown
|
|
4536
7301
|
this.addEventListener('select-change', this.handleSelectorChange);
|
|
4537
7302
|
// Wait for snice-column to be defined
|