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