snice 4.9.0 → 4.10.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/app-tiles.d.ts +28 -0
- package/adapters/react/app-tiles.d.ts.map +1 -0
- package/adapters/react/app-tiles.js +24 -0
- package/adapters/react/app-tiles.js.map +1 -0
- package/adapters/react/app-tiles.tsx +36 -0
- package/adapters/react/book.d.ts +28 -0
- package/adapters/react/book.d.ts.map +1 -0
- package/adapters/react/book.js +24 -0
- package/adapters/react/book.js.map +1 -0
- package/adapters/react/book.tsx +36 -0
- package/adapters/react/comments.d.ts +29 -0
- package/adapters/react/comments.d.ts.map +1 -0
- package/adapters/react/comments.js +24 -0
- package/adapters/react/comments.js.map +1 -0
- package/adapters/react/comments.tsx +37 -0
- package/adapters/react/components.d.ts +52 -0
- package/adapters/react/components.d.ts.map +1 -1
- package/adapters/react/components.js +26 -0
- package/adapters/react/components.js.map +1 -1
- package/adapters/react/components.ts +52 -0
- package/adapters/react/countdown.d.ts +31 -0
- package/adapters/react/countdown.d.ts.map +1 -0
- package/adapters/react/countdown.js +24 -0
- package/adapters/react/countdown.js.map +1 -0
- package/adapters/react/countdown.tsx +39 -0
- package/adapters/react/cropper.d.ts +29 -0
- package/adapters/react/cropper.d.ts.map +1 -0
- package/adapters/react/cropper.js +24 -0
- package/adapters/react/cropper.js.map +1 -0
- package/adapters/react/cropper.tsx +37 -0
- package/adapters/react/diff.d.ts +31 -0
- package/adapters/react/diff.d.ts.map +1 -0
- package/adapters/react/diff.js +24 -0
- package/adapters/react/diff.js.map +1 -0
- package/adapters/react/diff.tsx +39 -0
- package/adapters/react/flip-card.d.ts +28 -0
- package/adapters/react/flip-card.d.ts.map +1 -0
- package/adapters/react/flip-card.js +24 -0
- package/adapters/react/flip-card.js.map +1 -0
- package/adapters/react/flip-card.tsx +36 -0
- package/adapters/react/flow.d.ts +32 -0
- package/adapters/react/flow.d.ts.map +1 -0
- package/adapters/react/flow.js +24 -0
- package/adapters/react/flow.js.map +1 -0
- package/adapters/react/flow.tsx +40 -0
- package/adapters/react/gantt.d.ts +27 -0
- package/adapters/react/gantt.d.ts.map +1 -0
- package/adapters/react/gantt.js +24 -0
- package/adapters/react/gantt.js.map +1 -0
- package/adapters/react/gantt.tsx +35 -0
- package/adapters/react/map.d.ts +30 -0
- package/adapters/react/map.d.ts.map +1 -0
- package/adapters/react/map.js +24 -0
- package/adapters/react/map.js.map +1 -0
- package/adapters/react/map.tsx +38 -0
- package/adapters/react/markdown.d.ts +26 -0
- package/adapters/react/markdown.d.ts.map +1 -0
- package/adapters/react/markdown.js +24 -0
- package/adapters/react/markdown.js.map +1 -0
- package/adapters/react/markdown.tsx +34 -0
- package/adapters/react/notification-center.d.ts +26 -0
- package/adapters/react/notification-center.d.ts.map +1 -0
- package/adapters/react/notification-center.js +24 -0
- package/adapters/react/notification-center.js.map +1 -0
- package/adapters/react/notification-center.tsx +34 -0
- package/adapters/react/org-chart.d.ts +28 -0
- package/adapters/react/org-chart.d.ts.map +1 -0
- package/adapters/react/org-chart.js +24 -0
- package/adapters/react/org-chart.js.map +1 -0
- package/adapters/react/org-chart.tsx +36 -0
- package/adapters/react/pdf-viewer.d.ts +28 -0
- package/adapters/react/pdf-viewer.d.ts.map +1 -0
- package/adapters/react/pdf-viewer.js +24 -0
- package/adapters/react/pdf-viewer.js.map +1 -0
- package/adapters/react/pdf-viewer.tsx +36 -0
- package/adapters/react/podcast-player.d.ts +40 -0
- package/adapters/react/podcast-player.d.ts.map +1 -0
- package/adapters/react/podcast-player.js +24 -0
- package/adapters/react/podcast-player.js.map +1 -0
- package/adapters/react/podcast-player.tsx +48 -0
- package/adapters/react/pricing-table.d.ts +27 -0
- package/adapters/react/pricing-table.d.ts.map +1 -0
- package/adapters/react/pricing-table.js +24 -0
- package/adapters/react/pricing-table.js.map +1 -0
- package/adapters/react/pricing-table.tsx +35 -0
- package/adapters/react/rating.d.ts +30 -0
- package/adapters/react/rating.d.ts.map +1 -0
- package/adapters/react/rating.js +24 -0
- package/adapters/react/rating.js.map +1 -0
- package/adapters/react/rating.tsx +38 -0
- package/adapters/react/recipe.d.ts +43 -0
- package/adapters/react/recipe.d.ts.map +1 -0
- package/adapters/react/recipe.js +24 -0
- package/adapters/react/recipe.js.map +1 -0
- package/adapters/react/recipe.tsx +51 -0
- package/adapters/react/sortable.d.ts +28 -0
- package/adapters/react/sortable.d.ts.map +1 -0
- package/adapters/react/sortable.js +24 -0
- package/adapters/react/sortable.js.map +1 -0
- package/adapters/react/sortable.tsx +36 -0
- package/adapters/react/spotlight.d.ts +27 -0
- package/adapters/react/spotlight.d.ts.map +1 -0
- package/adapters/react/spotlight.js +24 -0
- package/adapters/react/spotlight.js.map +1 -0
- package/adapters/react/spotlight.tsx +35 -0
- package/adapters/react/spreadsheet.d.ts +27 -0
- package/adapters/react/spreadsheet.d.ts.map +1 -0
- package/adapters/react/spreadsheet.js +24 -0
- package/adapters/react/spreadsheet.js.map +1 -0
- package/adapters/react/spreadsheet.tsx +35 -0
- package/adapters/react/tag-input.d.ts +33 -0
- package/adapters/react/tag-input.d.ts.map +1 -0
- package/adapters/react/tag-input.js +24 -0
- package/adapters/react/tag-input.js.map +1 -0
- package/adapters/react/tag-input.tsx +41 -0
- package/adapters/react/testimonial.d.ts +31 -0
- package/adapters/react/testimonial.d.ts.map +1 -0
- package/adapters/react/testimonial.js +24 -0
- package/adapters/react/testimonial.js.map +1 -0
- package/adapters/react/testimonial.tsx +39 -0
- package/adapters/react/video-player.d.ts +34 -0
- package/adapters/react/video-player.d.ts.map +1 -0
- package/adapters/react/video-player.js +24 -0
- package/adapters/react/video-player.js.map +1 -0
- package/adapters/react/video-player.tsx +42 -0
- package/adapters/react/waterfall.d.ts +29 -0
- package/adapters/react/waterfall.d.ts.map +1 -0
- package/adapters/react/waterfall.js +24 -0
- package/adapters/react/waterfall.js.map +1 -0
- package/adapters/react/waterfall.tsx +37 -0
- package/adapters/react/weather.d.ts +27 -0
- package/adapters/react/weather.d.ts.map +1 -0
- package/adapters/react/weather.js +24 -0
- package/adapters/react/weather.js.map +1 -0
- package/adapters/react/weather.tsx +35 -0
- 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/README.md +27 -0
- package/dist/cdn/app-tiles/snice-app-tiles.js +333 -0
- package/dist/cdn/app-tiles/snice-app-tiles.js.map +1 -0
- package/dist/cdn/app-tiles/snice-app-tiles.min.js +11 -0
- package/dist/cdn/app-tiles/snice-app-tiles.min.js.map +1 -0
- 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 +27 -0
- package/dist/cdn/book/snice-book.js +353 -0
- package/dist/cdn/book/snice-book.js.map +1 -0
- package/dist/cdn/book/snice-book.min.js +13 -0
- package/dist/cdn/book/snice-book.min.js.map +1 -0
- 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 +1 -1
- package/dist/cdn/code-block/snice-code-block.min.js +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-display/snice-color-display.min.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.min.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
- package/dist/cdn/comments/README.md +27 -0
- package/dist/cdn/comments/snice-comments.js +544 -0
- package/dist/cdn/comments/snice-comments.js.map +1 -0
- package/dist/cdn/comments/snice-comments.min.js +100 -0
- package/dist/cdn/comments/snice-comments.min.js.map +1 -0
- package/dist/cdn/countdown/README.md +27 -0
- package/dist/cdn/countdown/snice-countdown.js +235 -0
- package/dist/cdn/countdown/snice-countdown.js.map +1 -0
- package/dist/cdn/countdown/snice-countdown.min.js +14 -0
- package/dist/cdn/countdown/snice-countdown.min.js.map +1 -0
- package/dist/cdn/cropper/README.md +27 -0
- package/dist/cdn/cropper/snice-cropper.js +352 -0
- package/dist/cdn/cropper/snice-cropper.js.map +1 -0
- package/dist/cdn/cropper/snice-cropper.min.js +25 -0
- package/dist/cdn/cropper/snice-cropper.min.js.map +1 -0
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.min.js +1 -1
- package/dist/cdn/diff/README.md +27 -0
- package/dist/cdn/diff/snice-diff.js +441 -0
- package/dist/cdn/diff/snice-diff.js.map +1 -0
- package/dist/cdn/diff/snice-diff.min.js +54 -0
- package/dist/cdn/diff/snice-diff.min.js.map +1 -0
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/divider/snice-divider.min.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/doc/snice-doc.min.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/draw/snice-draw.min.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/drawer/snice-drawer.min.js +1 -1
- package/dist/cdn/empty-state/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/README.md +27 -0
- package/dist/cdn/flip-card/snice-flip-card.js +183 -0
- package/dist/cdn/flip-card/snice-flip-card.js.map +1 -0
- package/dist/cdn/flip-card/snice-flip-card.min.js +22 -0
- package/dist/cdn/flip-card/snice-flip-card.min.js.map +1 -0
- package/dist/cdn/flow/README.md +27 -0
- package/dist/cdn/flow/snice-flow.js +822 -0
- package/dist/cdn/flow/snice-flow.js.map +1 -0
- package/dist/cdn/flow/snice-flow.min.js +17 -0
- package/dist/cdn/flow/snice-flow.min.js.map +1 -0
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/funnel/snice-funnel.min.js +1 -1
- package/dist/cdn/gantt/README.md +27 -0
- package/dist/cdn/gantt/snice-gantt.js +436 -0
- package/dist/cdn/gantt/snice-gantt.js.map +1 -0
- package/dist/cdn/gantt/snice-gantt.min.js +60 -0
- package/dist/cdn/gantt/snice-gantt.min.js.map +1 -0
- 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 +1 -1
- package/dist/cdn/link-preview/snice-link-preview.min.js +1 -1
- package/dist/cdn/list/snice-list.js +1 -1
- package/dist/cdn/list/snice-list.min.js +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/README.md +27 -0
- package/dist/cdn/map/snice-map.js +415 -0
- package/dist/cdn/map/snice-map.js.map +1 -0
- package/dist/cdn/map/snice-map.min.js +52 -0
- package/dist/cdn/map/snice-map.min.js.map +1 -0
- package/dist/cdn/markdown/README.md +27 -0
- package/dist/cdn/markdown/snice-markdown.js +317 -0
- package/dist/cdn/markdown/snice-markdown.js.map +1 -0
- package/dist/cdn/markdown/snice-markdown.min.js +11 -0
- package/dist/cdn/markdown/snice-markdown.min.js.map +1 -0
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/masonry/snice-masonry.min.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/menu/snice-menu.min.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/modal/snice-modal.min.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/music-player/snice-music-player.min.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/nav/snice-nav.min.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.min.js +1 -1
- package/dist/cdn/notification-center/README.md +27 -0
- package/dist/cdn/notification-center/snice-notification-center.js +204 -0
- package/dist/cdn/notification-center/snice-notification-center.js.map +1 -0
- package/dist/cdn/notification-center/snice-notification-center.min.js +33 -0
- package/dist/cdn/notification-center/snice-notification-center.min.js.map +1 -0
- package/dist/cdn/org-chart/README.md +27 -0
- package/dist/cdn/org-chart/snice-org-chart.js +294 -0
- package/dist/cdn/org-chart/snice-org-chart.js.map +1 -0
- package/dist/cdn/org-chart/snice-org-chart.min.js +32 -0
- package/dist/cdn/org-chart/snice-org-chart.min.js.map +1 -0
- 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/README.md +27 -0
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +594 -0
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js.map +1 -0
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js +88 -0
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js.map +1 -0
- package/dist/cdn/podcast-player/README.md +27 -0
- package/dist/cdn/podcast-player/snice-podcast-player.js +835 -0
- package/dist/cdn/podcast-player/snice-podcast-player.js.map +1 -0
- package/dist/cdn/podcast-player/snice-podcast-player.min.js +209 -0
- package/dist/cdn/podcast-player/snice-podcast-player.min.js.map +1 -0
- package/dist/cdn/pricing-table/README.md +27 -0
- package/dist/cdn/pricing-table/snice-pricing-table.js +491 -0
- package/dist/cdn/pricing-table/snice-pricing-table.js.map +1 -0
- package/dist/cdn/pricing-table/snice-pricing-table.min.js +141 -0
- package/dist/cdn/pricing-table/snice-pricing-table.min.js.map +1 -0
- package/dist/cdn/progress/snice-progress.js +1 -1
- package/dist/cdn/progress/snice-progress.min.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.min.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.min.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/radio/snice-radio.min.js +1 -1
- package/dist/cdn/rating/README.md +27 -0
- package/dist/cdn/rating/snice-rating.js +210 -0
- package/dist/cdn/rating/snice-rating.js.map +1 -0
- package/dist/cdn/rating/snice-rating.min.js +25 -0
- package/dist/cdn/rating/snice-rating.min.js.map +1 -0
- package/dist/cdn/recipe/README.md +27 -0
- package/dist/cdn/recipe/snice-recipe.js +619 -0
- package/dist/cdn/recipe/snice-recipe.js.map +1 -0
- package/dist/cdn/recipe/snice-recipe.min.js +185 -0
- package/dist/cdn/recipe/snice-recipe.min.js.map +1 -0
- package/dist/cdn/runtime/snice-runtime.esm.js +3 -3
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +3 -3
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +3 -3
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +3 -3
- 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/snice-select.js +1 -1
- package/dist/cdn/select/snice-select.min.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.min.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/slider/snice-slider.min.js +1 -1
- package/dist/cdn/sortable/README.md +27 -0
- package/dist/cdn/sortable/snice-sortable.js +254 -0
- package/dist/cdn/sortable/snice-sortable.js.map +1 -0
- package/dist/cdn/sortable/snice-sortable.min.js +12 -0
- package/dist/cdn/sortable/snice-sortable.min.js.map +1 -0
- 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/README.md +27 -0
- package/dist/cdn/spotlight/snice-spotlight.js +397 -0
- package/dist/cdn/spotlight/snice-spotlight.js.map +1 -0
- package/dist/cdn/spotlight/snice-spotlight.min.js +8 -0
- package/dist/cdn/spotlight/snice-spotlight.min.js.map +1 -0
- package/dist/cdn/spreadsheet/README.md +27 -0
- package/dist/cdn/spreadsheet/snice-spreadsheet.js +1171 -0
- package/dist/cdn/spreadsheet/snice-spreadsheet.js.map +1 -0
- package/dist/cdn/spreadsheet/snice-spreadsheet.min.js +30 -0
- package/dist/cdn/spreadsheet/snice-spreadsheet.min.js.map +1 -0
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/stepper/snice-stepper.min.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/switch/snice-switch.min.js +1 -1
- package/dist/cdn/table/snice-table.js +1 -1
- package/dist/cdn/table/snice-table.min.js +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/README.md +27 -0
- package/dist/cdn/tag-input/snice-tag-input.js +387 -0
- package/dist/cdn/tag-input/snice-tag-input.js.map +1 -0
- package/dist/cdn/tag-input/snice-tag-input.min.js +65 -0
- package/dist/cdn/tag-input/snice-tag-input.min.js.map +1 -0
- package/dist/cdn/terminal/snice-terminal.js +1 -1
- package/dist/cdn/terminal/snice-terminal.min.js +1 -1
- package/dist/cdn/testimonial/README.md +27 -0
- package/dist/cdn/testimonial/snice-testimonial.js +187 -0
- package/dist/cdn/testimonial/snice-testimonial.js.map +1 -0
- package/dist/cdn/testimonial/snice-testimonial.min.js +21 -0
- package/dist/cdn/testimonial/snice-testimonial.min.js.map +1 -0
- 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/snice-toast.js +1 -1
- package/dist/cdn/toast/snice-toast.min.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.min.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/tree/snice-tree.min.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/treemap/snice-treemap.min.js +1 -1
- package/dist/cdn/video-player/README.md +27 -0
- package/dist/cdn/video-player/snice-video-player.js +721 -0
- package/dist/cdn/video-player/snice-video-player.js.map +1 -0
- package/dist/cdn/video-player/snice-video-player.min.js +153 -0
- package/dist/cdn/video-player/snice-video-player.min.js.map +1 -0
- 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/README.md +27 -0
- package/dist/cdn/waterfall/snice-waterfall.js +292 -0
- package/dist/cdn/waterfall/snice-waterfall.js.map +1 -0
- package/dist/cdn/waterfall/snice-waterfall.min.js +12 -0
- package/dist/cdn/waterfall/snice-waterfall.min.js.map +1 -0
- package/dist/cdn/weather/README.md +27 -0
- package/dist/cdn/weather/snice-weather.js +194 -0
- package/dist/cdn/weather/snice-weather.js.map +1 -0
- package/dist/cdn/weather/snice-weather.min.js +42 -0
- package/dist/cdn/weather/snice-weather.min.js.map +1 -0
- package/dist/components/app-tiles/snice-app-tiles.d.ts +36 -0
- package/dist/components/app-tiles/snice-app-tiles.js +265 -0
- package/dist/components/app-tiles/snice-app-tiles.js.map +1 -0
- package/dist/components/app-tiles/snice-app-tiles.types.d.ts +22 -0
- package/dist/components/book/snice-book.d.ts +46 -0
- package/dist/components/book/snice-book.js +285 -0
- package/dist/components/book/snice-book.js.map +1 -0
- package/dist/components/book/snice-book.types.d.ts +21 -0
- package/dist/components/comments/snice-comments.d.ts +62 -0
- package/dist/components/comments/snice-comments.js +476 -0
- package/dist/components/comments/snice-comments.js.map +1 -0
- package/dist/components/comments/snice-comments.types.d.ts +64 -0
- package/dist/components/countdown/snice-countdown.d.ts +21 -0
- package/dist/components/countdown/snice-countdown.js +168 -0
- package/dist/components/countdown/snice-countdown.js.map +1 -0
- package/dist/components/countdown/snice-countdown.types.d.ts +18 -0
- package/dist/components/cropper/snice-cropper.d.ts +32 -0
- package/dist/components/cropper/snice-cropper.js +285 -0
- package/dist/components/cropper/snice-cropper.js.map +1 -0
- package/dist/components/cropper/snice-cropper.types.d.ts +26 -0
- package/dist/components/diff/snice-diff.d.ts +32 -0
- package/dist/components/diff/snice-diff.js +374 -0
- package/dist/components/diff/snice-diff.js.map +1 -0
- package/dist/components/diff/snice-diff.types.d.ts +26 -0
- package/dist/components/flip-card/snice-flip-card.d.ts +15 -0
- package/dist/components/flip-card/snice-flip-card.js +116 -0
- package/dist/components/flip-card/snice-flip-card.js.map +1 -0
- package/dist/components/flip-card/snice-flip-card.types.d.ts +16 -0
- package/dist/components/flow/snice-flow.d.ts +91 -0
- package/dist/components/flow/snice-flow.js +755 -0
- package/dist/components/flow/snice-flow.js.map +1 -0
- package/dist/components/flow/snice-flow.types.d.ts +64 -0
- package/dist/components/gantt/snice-gantt.d.ts +34 -0
- package/dist/components/gantt/snice-gantt.js +369 -0
- package/dist/components/gantt/snice-gantt.js.map +1 -0
- package/dist/components/gantt/snice-gantt.types.d.ts +37 -0
- package/dist/components/map/snice-map.d.ts +44 -0
- package/dist/components/map/snice-map.js +348 -0
- package/dist/components/map/snice-map.js.map +1 -0
- package/dist/components/map/snice-map.types.d.ts +41 -0
- package/dist/components/markdown/snice-markdown.d.ts +24 -0
- package/dist/components/markdown/snice-markdown.js +250 -0
- package/dist/components/markdown/snice-markdown.js.map +1 -0
- package/dist/components/markdown/snice-markdown.types.d.ts +16 -0
- package/dist/components/notification-center/snice-notification-center.d.ts +18 -0
- package/dist/components/notification-center/snice-notification-center.js +137 -0
- package/dist/components/notification-center/snice-notification-center.js.map +1 -0
- package/dist/components/notification-center/snice-notification-center.types.d.ts +24 -0
- package/dist/components/org-chart/snice-org-chart.d.ts +28 -0
- package/dist/components/org-chart/snice-org-chart.js +227 -0
- package/dist/components/org-chart/snice-org-chart.js.map +1 -0
- package/dist/components/org-chart/snice-org-chart.types.d.ts +28 -0
- package/dist/components/pdf-viewer/pdf.min.mjs +21 -0
- package/dist/components/pdf-viewer/pdf.worker.min.mjs +21 -0
- package/dist/components/pdf-viewer/snice-pdf-viewer.d.ts +59 -0
- package/dist/components/pdf-viewer/snice-pdf-viewer.js +527 -0
- package/dist/components/pdf-viewer/snice-pdf-viewer.js.map +1 -0
- package/dist/components/pdf-viewer/snice-pdf-viewer.types.d.ts +25 -0
- package/dist/components/podcast-player/snice-podcast-player.d.ts +72 -0
- package/dist/components/podcast-player/snice-podcast-player.js +768 -0
- package/dist/components/podcast-player/snice-podcast-player.js.map +1 -0
- package/dist/components/podcast-player/snice-podcast-player.types.d.ts +79 -0
- package/dist/components/pricing-table/snice-pricing-table.d.ts +51 -0
- package/dist/components/pricing-table/snice-pricing-table.js +422 -0
- package/dist/components/pricing-table/snice-pricing-table.js.map +1 -0
- package/dist/components/pricing-table/snice-pricing-table.types.d.ts +49 -0
- package/dist/components/rating/snice-rating.d.ts +15 -0
- package/dist/components/rating/snice-rating.js +143 -0
- package/dist/components/rating/snice-rating.js.map +1 -0
- package/dist/components/rating/snice-rating.types.d.ts +15 -0
- package/dist/components/recipe/snice-recipe.d.ts +53 -0
- package/dist/components/recipe/snice-recipe.js +552 -0
- package/dist/components/recipe/snice-recipe.js.map +1 -0
- package/dist/components/recipe/snice-recipe.types.d.ts +56 -0
- package/dist/components/sortable/snice-sortable.d.ts +24 -0
- package/dist/components/sortable/snice-sortable.js +187 -0
- package/dist/components/sortable/snice-sortable.js.map +1 -0
- package/dist/components/sortable/snice-sortable.types.d.ts +20 -0
- package/dist/components/spotlight/snice-spotlight.d.ts +42 -0
- package/dist/components/spotlight/snice-spotlight.js +330 -0
- package/dist/components/spotlight/snice-spotlight.js.map +1 -0
- package/dist/components/spotlight/snice-spotlight.types.d.ts +26 -0
- package/dist/components/spreadsheet/snice-spreadsheet.d.ts +102 -0
- package/dist/components/spreadsheet/snice-spreadsheet.js +1104 -0
- package/dist/components/spreadsheet/snice-spreadsheet.js.map +1 -0
- package/dist/components/spreadsheet/snice-spreadsheet.types.d.ts +54 -0
- package/dist/components/tag-input/snice-tag-input.d.ts +40 -0
- package/dist/components/tag-input/snice-tag-input.js +320 -0
- package/dist/components/tag-input/snice-tag-input.js.map +1 -0
- package/dist/components/tag-input/snice-tag-input.types.d.ts +29 -0
- package/dist/components/testimonial/snice-testimonial.d.ts +15 -0
- package/dist/components/testimonial/snice-testimonial.js +120 -0
- package/dist/components/testimonial/snice-testimonial.js.map +1 -0
- package/dist/components/testimonial/snice-testimonial.types.d.ts +10 -0
- package/dist/components/video-player/snice-video-player.d.ts +78 -0
- package/dist/components/video-player/snice-video-player.js +654 -0
- package/dist/components/video-player/snice-video-player.js.map +1 -0
- package/dist/components/video-player/snice-video-player.types.d.ts +47 -0
- package/dist/components/waterfall/snice-waterfall.d.ts +30 -0
- package/dist/components/waterfall/snice-waterfall.js +225 -0
- package/dist/components/waterfall/snice-waterfall.js.map +1 -0
- package/dist/components/waterfall/snice-waterfall.types.d.ts +23 -0
- package/dist/components/weather/snice-weather.d.ts +10 -0
- package/dist/components/weather/snice-weather.js +127 -0
- package/dist/components/weather/snice-weather.js.map +1 -0
- package/dist/components/weather/snice-weather.types.d.ts +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/DEVELOPMENT.md +1 -1
- package/docs/ai/api.md +6 -3
- package/docs/ai/components/accordion.md +0 -34
- package/docs/ai/components/app-tiles.md +77 -0
- package/docs/ai/components/audio-recorder.md +2 -0
- package/docs/ai/components/badge.md +7 -0
- package/docs/ai/components/book.md +78 -0
- package/docs/ai/components/button.md +5 -0
- package/docs/ai/components/chart.md +0 -24
- package/docs/ai/components/chat.md +7 -95
- package/docs/ai/components/code-block.md +3 -82
- package/docs/ai/components/color-display.md +3 -3
- package/docs/ai/components/color-picker.md +4 -4
- package/docs/ai/components/comments.md +75 -0
- package/docs/ai/components/countdown.md +54 -0
- package/docs/ai/components/cropper.md +57 -0
- package/docs/ai/components/date-picker.md +15 -9
- package/docs/ai/components/diff.md +66 -0
- package/docs/ai/components/divider.md +1 -1
- package/docs/ai/components/draw.md +5 -5
- package/docs/ai/components/drawer.md +5 -5
- package/docs/ai/components/empty-state.md +2 -2
- package/docs/ai/components/file-gallery.md +16 -87
- package/docs/ai/components/file-upload.md +6 -6
- package/docs/ai/components/flip-card.md +52 -0
- package/docs/ai/components/flow.md +104 -0
- package/docs/ai/components/funnel.md +3 -3
- package/docs/ai/components/gantt.md +63 -0
- package/docs/ai/components/gauge.md +1 -1
- package/docs/ai/components/heatmap.md +5 -5
- package/docs/ai/components/input.md +20 -18
- package/docs/ai/components/kanban.md +2 -2
- package/docs/ai/components/kpi.md +4 -53
- package/docs/ai/components/layout.md +10 -235
- package/docs/ai/components/link-preview.md +20 -29
- package/docs/ai/components/link.md +27 -47
- package/docs/ai/components/list.md +51 -31
- package/docs/ai/components/location.md +15 -27
- package/docs/ai/components/login.md +43 -94
- package/docs/ai/components/map.md +72 -0
- package/docs/ai/components/markdown.md +63 -0
- package/docs/ai/components/masonry.md +10 -6
- package/docs/ai/components/menu.md +40 -72
- package/docs/ai/components/modal.md +25 -42
- package/docs/ai/components/music-player.md +37 -89
- package/docs/ai/components/nav.md +25 -39
- package/docs/ai/components/network-graph.md +39 -43
- package/docs/ai/components/notification-center.md +79 -0
- package/docs/ai/components/org-chart.md +62 -0
- package/docs/ai/components/pagination.md +16 -18
- package/docs/ai/components/pdf-viewer.md +57 -0
- package/docs/ai/components/podcast-player.md +94 -0
- package/docs/ai/components/pricing-table.md +87 -0
- package/docs/ai/components/progress.md +23 -39
- package/docs/ai/components/qr-code.md +37 -84
- package/docs/ai/components/qr-reader.md +51 -61
- package/docs/ai/components/radio.md +27 -39
- package/docs/ai/components/rating.md +56 -0
- package/docs/ai/components/recipe.md +90 -0
- package/docs/ai/components/skeleton.md +0 -8
- package/docs/ai/components/slider.md +10 -50
- package/docs/ai/components/sortable.md +57 -0
- package/docs/ai/components/sparkline.md +26 -152
- package/docs/ai/components/spinner.md +0 -21
- package/docs/ai/components/split-pane.md +16 -38
- package/docs/ai/components/spotlight.md +61 -0
- package/docs/ai/components/spreadsheet.md +138 -0
- package/docs/ai/components/stepper.md +37 -183
- package/docs/ai/components/switch.md +28 -35
- package/docs/ai/components/table.md +43 -172
- package/docs/ai/components/tabs.md +31 -52
- package/docs/ai/components/tag-input.md +70 -0
- package/docs/ai/components/terminal.md +34 -116
- package/docs/ai/components/testimonial.md +56 -0
- package/docs/ai/components/textarea.md +11 -43
- package/docs/ai/components/theme.md +120 -0
- package/docs/ai/components/time-range-picker.md +17 -49
- package/docs/ai/components/timeline.md +7 -46
- package/docs/ai/components/timer.md +41 -37
- package/docs/ai/components/toast.md +19 -90
- package/docs/ai/components/tooltip.md +17 -104
- package/docs/ai/components/tree.md +38 -162
- package/docs/ai/components/treemap.md +23 -44
- package/docs/ai/components/video-player.md +91 -0
- package/docs/ai/components/virtual-scroller.md +23 -46
- package/docs/ai/components/waterfall.md +56 -0
- package/docs/ai/components/weather.md +78 -0
- package/docs/ai/decorators.md +25 -3
- package/docs/ai/patterns.md +17 -1
- package/docs/components/accordion.md +8 -6
- package/docs/components/alert.md +2 -0
- package/docs/components/app-tiles.md +162 -0
- package/docs/components/audio-recorder.md +6 -0
- package/docs/components/avatar.md +225 -0
- package/docs/components/badge.md +2 -0
- package/docs/components/banner.md +2 -0
- package/docs/components/book.md +184 -0
- package/docs/components/breadcrumbs.md +2 -0
- package/docs/components/button.md +15 -0
- package/docs/components/calendar.md +2 -0
- package/docs/components/camera-annotate.md +2 -0
- package/docs/components/camera.md +2 -0
- package/docs/components/candlestick.md +2 -0
- package/docs/components/card.md +2 -0
- package/docs/components/carousel.md +205 -36
- package/docs/components/chart.md +2 -0
- package/docs/components/chat.md +2 -0
- package/docs/components/checkbox.md +2 -0
- package/docs/components/chip.md +2 -0
- package/docs/components/code-block.md +2 -0
- package/docs/components/color-display.md +2 -0
- package/docs/components/color-picker.md +6 -4
- package/docs/components/command-palette.md +2 -0
- package/docs/components/comments.md +235 -0
- package/docs/components/countdown.md +121 -0
- package/docs/components/cropper.md +152 -0
- package/docs/components/date-picker.md +201 -0
- package/docs/components/diff.md +177 -0
- package/docs/components/divider.md +132 -0
- package/docs/components/doc.md +2 -0
- package/docs/components/draw.md +2 -0
- package/docs/components/drawer.md +2 -0
- package/docs/components/empty-state.md +2 -0
- package/docs/components/file-gallery.md +2 -0
- package/docs/components/file-upload.md +2 -0
- package/docs/components/flip-card.md +169 -0
- package/docs/components/flow.md +208 -0
- package/docs/components/funnel.md +2 -0
- package/docs/components/gantt.md +187 -0
- package/docs/components/gauge.md +2 -0
- package/docs/components/heatmap.md +2 -0
- package/docs/components/image.md +2 -0
- package/docs/components/input.md +242 -0
- package/docs/components/kanban.md +2 -0
- package/docs/components/kpi.md +2 -0
- package/docs/components/layout.md +84 -0
- package/docs/components/link-preview.md +66 -92
- package/docs/components/link.md +73 -157
- package/docs/components/list.md +140 -44
- package/docs/components/location.md +96 -283
- package/docs/components/login.md +131 -498
- package/docs/components/map.md +203 -0
- package/docs/components/markdown.md +220 -0
- package/docs/components/masonry.md +57 -102
- package/docs/components/menu.md +87 -494
- package/docs/components/modal.md +83 -436
- package/docs/components/music-player.md +116 -221
- package/docs/components/nav.md +107 -170
- package/docs/components/network-graph.md +83 -111
- package/docs/components/notification-center.md +256 -0
- package/docs/components/org-chart.md +275 -0
- package/docs/components/pagination.md +75 -218
- package/docs/components/paint.md +108 -73
- package/docs/components/pdf-viewer.md +204 -0
- package/docs/components/podcast-player.md +277 -0
- package/docs/components/pricing-table.md +249 -0
- package/docs/components/progress.md +169 -0
- package/docs/components/qr-code.md +95 -378
- package/docs/components/qr-reader.md +83 -258
- package/docs/components/radio.md +151 -0
- package/docs/components/rating.md +154 -0
- package/docs/components/recipe.md +323 -0
- package/docs/components/sankey.md +84 -107
- package/docs/components/select.md +114 -485
- package/docs/components/skeleton.md +96 -0
- package/docs/components/slider.md +92 -235
- package/docs/components/sortable.md +267 -0
- package/docs/components/sparkline.md +76 -222
- package/docs/components/spinner.md +37 -18
- package/docs/components/split-pane.md +62 -226
- package/docs/components/spotlight.md +240 -0
- package/docs/components/spreadsheet.md +405 -0
- package/docs/components/stepper.md +72 -306
- package/docs/components/switch.md +69 -293
- package/docs/components/table.md +250 -0
- package/docs/components/tabs.md +92 -471
- package/docs/components/tag-input.md +257 -0
- package/docs/components/terminal.md +87 -391
- package/docs/components/testimonial.md +185 -0
- package/docs/components/textarea.md +96 -181
- package/docs/components/theme.md +216 -0
- package/docs/components/time-range-picker.md +99 -151
- package/docs/components/timeline.md +67 -115
- package/docs/components/timer.md +44 -86
- package/docs/components/toast.md +93 -432
- package/docs/components/tooltip.md +75 -419
- package/docs/components/tree.md +110 -436
- package/docs/components/treemap.md +86 -129
- package/docs/components/video-player.md +336 -0
- package/docs/components/virtual-scroller.md +86 -226
- package/docs/components/waterfall.md +217 -0
- package/docs/components/weather.md +239 -0
- package/package.json +1 -1
- package/docs/ai/components/popover.md +0 -70
- package/docs/components/popover.md +0 -333
|
@@ -0,0 +1,1104 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from 'tslib';
|
|
2
|
+
import { element, property, query, styles, ready, watch, on, dispatch, render, css, html } from 'snice';
|
|
3
|
+
|
|
4
|
+
var sheetStyles = ":host{display:block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);contain:layout style paint;width:100%;--spreadsheet-border:var(--snice-color-border, rgb(226 226 226));--spreadsheet-bg:var(--snice-color-background, rgb(255 255 255));--spreadsheet-bg-element:var(--snice-color-background-element, rgb(252 251 249));--spreadsheet-text:var(--snice-color-text, rgb(23 23 23));--spreadsheet-text-secondary:var(--snice-color-text-secondary, rgb(82 82 82));--spreadsheet-text-tertiary:var(--snice-color-text-tertiary, rgb(115 115 115));--spreadsheet-primary:var(--snice-color-primary, rgb(37 99 235));--spreadsheet-primary-subtle:var(--snice-color-primary-subtle, rgb(239 246 255));--spreadsheet-hover:var(--snice-color-background-hover, rgb(241 241 241));--spreadsheet-grid:rgba(200, 200, 200, 0.5)}.spreadsheet-formula-bar{display:flex;align-items:center;gap:var(--snice-spacing-xs,.5rem);padding:var(--snice-spacing-2xs,.25rem) var(--snice-spacing-xs,.5rem);border:1px solid var(--spreadsheet-border);border-bottom:none;border-radius:var(--snice-border-radius-lg,.5rem) var(--snice-border-radius-lg,.5rem) 0 0;background:var(--spreadsheet-bg-element);font-size:var(--snice-font-size-sm, .875rem)}.spreadsheet-cell-ref{display:inline-flex;align-items:center;justify-content:center;font-weight:var(--snice-font-weight-semibold,600);color:var(--spreadsheet-text-secondary);min-width:3.5rem;text-align:center;font-variant-numeric:tabular-nums;font-size:var(--snice-font-size-xs, .75rem);padding:var(--snice-spacing-3xs,.125rem) var(--snice-spacing-xs,.5rem);border:1px solid var(--spreadsheet-border);border-radius:var(--snice-border-radius-md,.25rem);background:var(--spreadsheet-bg);height:1.5rem}.spreadsheet-formula-input{flex:1;border:none;outline:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:inherit;padding:var(--snice-spacing-2xs,.25rem) var(--snice-spacing-xs,.5rem);background:0 0;color:var(--spreadsheet-text)}.spreadsheet{border:1px solid var(--spreadsheet-border);border-radius:0 0 var(--snice-border-radius-lg,.5rem) var(--snice-border-radius-lg,.5rem);overflow:auto;background:var(--spreadsheet-bg);position:relative;outline:0}.spreadsheet-table{border-collapse:collapse;width:max-content;min-width:100%;font-size:var(--snice-font-size-sm, .875rem);table-layout:fixed}.spreadsheet-th{background:var(--spreadsheet-bg-element);border-right:1px solid var(--spreadsheet-grid);border-bottom:2px solid var(--spreadsheet-border);padding:var(--snice-spacing-2xs,.25rem) var(--snice-spacing-sm,.75rem);font-weight:var(--snice-font-weight-semibold,600);color:var(--spreadsheet-text);text-align:left;white-space:nowrap;cursor:pointer;user-select:none;position:sticky;top:0;z-index:2;font-size:var(--snice-font-size-xs, .75rem);height:1.75rem;min-width:5rem}.spreadsheet-th:hover{background:var(--spreadsheet-hover)}.spreadsheet-th.col-selected{background:var(--spreadsheet-primary-subtle);color:var(--spreadsheet-primary)}.spreadsheet-th-sort{display:inline-flex;align-items:center;gap:var(--snice-spacing-2xs,.25rem)}.spreadsheet-th-sort-icon{opacity:.4;font-size:.5rem}.spreadsheet-th-sort-icon.active{opacity:1;color:var(--spreadsheet-primary)}.spreadsheet-resize-handle{position:absolute;right:0;top:0;bottom:0;width:4px;cursor:col-resize;z-index:3}.spreadsheet-resize-handle.resizing,.spreadsheet-resize-handle:hover{background:var(--spreadsheet-primary)}.spreadsheet-row-num{background:var(--spreadsheet-bg-element);border-right:1px solid var(--spreadsheet-grid);border-bottom:1px solid var(--spreadsheet-grid);padding:0 var(--snice-spacing-xs,.5rem);font-size:var(--snice-font-size-xs, .75rem);font-variant-numeric:tabular-nums;color:var(--spreadsheet-text-tertiary);text-align:center;width:2.75rem;min-width:2.75rem;cursor:pointer;user-select:none;position:sticky;left:0;z-index:1}.spreadsheet-row-num:hover{background:var(--spreadsheet-hover)}.spreadsheet-row-num.row-selected{background:var(--spreadsheet-primary-subtle);color:var(--spreadsheet-primary);font-weight:var(--snice-font-weight-semibold,600)}th.spreadsheet-row-num{position:sticky;top:0;left:0;z-index:4;border-bottom:2px solid var(--spreadsheet-border)}.spreadsheet-td{border-right:1px solid var(--spreadsheet-grid);border-bottom:1px solid var(--spreadsheet-grid);padding:0;position:relative;min-width:5rem;height:1.75rem}.spreadsheet-td.selected{outline:2px solid var(--spreadsheet-primary);outline-offset:-2px;z-index:1}.spreadsheet-td.in-range{background:var(--spreadsheet-primary-subtle)}.spreadsheet-cell{display:block;width:100%;padding:var(--snice-spacing-3xs,.125rem) var(--snice-spacing-xs,.5rem);color:var(--spreadsheet-text);cursor:cell;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:1.75rem;line-height:1.75rem;box-sizing:border-box}.spreadsheet-table tbody tr:hover .spreadsheet-td:not(.selected):not(.in-range){background:rgba(0,0,0,.015)}.spreadsheet-table tbody tr:hover .spreadsheet-row-num:not(.row-selected){background:var(--spreadsheet-hover)}.spreadsheet-input{display:block;width:100%;padding:var(--snice-spacing-3xs,.125rem) var(--snice-spacing-xs,.5rem);border:none;outline:0;font-family:inherit;font-size:inherit;color:var(--spreadsheet-text);background:rgb(255 255 240);box-sizing:border-box;min-height:1.75rem;line-height:1.75rem}.spreadsheet-select{display:block;width:100%;padding:var(--snice-spacing-3xs,.125rem) var(--snice-spacing-2xs,.25rem);border:none;outline:0;font-family:inherit;font-size:inherit;color:var(--spreadsheet-text);background:var(--spreadsheet-bg);cursor:pointer}.spreadsheet-checkbox{display:flex;align-items:center;justify-content:center;height:1.75rem}.spreadsheet-cell-number{text-align:right;font-variant-numeric:tabular-nums}.spreadsheet-cell-boolean{text-align:center}.spreadsheet-status-bar{display:flex;align-items:center;justify-content:flex-end;gap:var(--snice-spacing-md,1rem);padding:var(--snice-spacing-3xs,.125rem) var(--snice-spacing-sm,.75rem);border:1px solid var(--spreadsheet-border);border-top:none;border-radius:0 0 var(--snice-border-radius-lg,.5rem) var(--snice-border-radius-lg,.5rem);background:var(--spreadsheet-bg-element);font-size:var(--snice-font-size-xs, .75rem);color:var(--spreadsheet-text-secondary);min-height:1.375rem}.spreadsheet-status-item{display:inline-flex;gap:var(--snice-spacing-2xs,.25rem)}.spreadsheet-status-label{color:var(--spreadsheet-text-tertiary)}.spreadsheet-status-value{font-weight:var(--snice-font-weight-medium,500);font-variant-numeric:tabular-nums}.spreadsheet-context-menu{position:fixed;min-width:12.5rem;background:var(--spreadsheet-bg);border:1px solid var(--spreadsheet-border);border-radius:var(--snice-border-radius-md,.25rem);box-shadow:var(--snice-shadow-lg,0 10px 15px -3px rgb(0 0 0 / .1),0 4px 6px -4px rgb(0 0 0 / .1));padding:var(--snice-spacing-2xs,.25rem) 0;z-index:100;font-size:var(--snice-font-size-sm, .875rem)}.spreadsheet-context-item{display:flex;align-items:center;gap:var(--snice-spacing-sm,.75rem);padding:var(--snice-spacing-2xs,.25rem) var(--snice-spacing-sm,.75rem);cursor:pointer;color:var(--spreadsheet-text);white-space:nowrap}.spreadsheet-context-item:hover{background:var(--spreadsheet-primary-subtle)}.spreadsheet-context-item-shortcut{margin-left:auto;color:var(--spreadsheet-text-tertiary);font-size:var(--snice-font-size-xs, .75rem)}.spreadsheet-context-separator{height:1px;background:var(--spreadsheet-border);margin:var(--snice-spacing-2xs,.25rem) 0}.spreadsheet-add-row{display:flex;align-items:center;height:1.5rem;cursor:pointer;color:var(--spreadsheet-text-tertiary);font-size:var(--snice-font-size-xs, .75rem);user-select:none}.spreadsheet-add-row:hover{background:var(--spreadsheet-hover);color:var(--spreadsheet-primary)}.spreadsheet-add-row td{padding:0 var(--snice-spacing-xs,.5rem);border-right:1px solid var(--spreadsheet-grid);border-bottom:1px solid var(--spreadsheet-grid);height:1.5rem;line-height:1.5rem}.spreadsheet-add-col-header{background:var(--spreadsheet-bg-element);border-right:1px solid var(--spreadsheet-grid);border-bottom:2px solid var(--spreadsheet-border);width:2rem;min-width:2rem;text-align:center;cursor:pointer;color:var(--spreadsheet-text-tertiary);font-size:var(--snice-font-size-xs, .75rem);position:sticky;top:0;z-index:2;user-select:none}.spreadsheet-add-col-header:hover{background:var(--spreadsheet-hover);color:var(--spreadsheet-primary)}.spreadsheet-add-col-cell{border-right:1px solid var(--spreadsheet-grid);border-bottom:1px solid var(--spreadsheet-grid);width:2rem;min-width:2rem}.spreadsheet-empty{display:flex;align-items:center;justify-content:center;min-height:8rem;color:var(--spreadsheet-text-tertiary);font-size:var(--snice-font-size-sm, .875rem);cursor:default;user-select:none;padding:var(--snice-spacing-lg,1.5rem);text-align:center}";
|
|
5
|
+
|
|
6
|
+
let SniceSpreadsheet = (() => {
|
|
7
|
+
let _classDecorators = [element('snice-spreadsheet')];
|
|
8
|
+
let _classDescriptor;
|
|
9
|
+
let _classExtraInitializers = [];
|
|
10
|
+
let _classThis;
|
|
11
|
+
let _classSuper = HTMLElement;
|
|
12
|
+
let _instanceExtraInitializers = [];
|
|
13
|
+
let _data_decorators;
|
|
14
|
+
let _data_initializers = [];
|
|
15
|
+
let _data_extraInitializers = [];
|
|
16
|
+
let _columns_decorators;
|
|
17
|
+
let _columns_initializers = [];
|
|
18
|
+
let _columns_extraInitializers = [];
|
|
19
|
+
let _readonly_decorators;
|
|
20
|
+
let _readonly_initializers = [];
|
|
21
|
+
let _readonly_extraInitializers = [];
|
|
22
|
+
let _cellRefEl_decorators;
|
|
23
|
+
let _cellRefEl_initializers = [];
|
|
24
|
+
let _cellRefEl_extraInitializers = [];
|
|
25
|
+
let _formulaInputEl_decorators;
|
|
26
|
+
let _formulaInputEl_initializers = [];
|
|
27
|
+
let _formulaInputEl_extraInitializers = [];
|
|
28
|
+
let _wrapperEl_decorators;
|
|
29
|
+
let _wrapperEl_initializers = [];
|
|
30
|
+
let _wrapperEl_extraInitializers = [];
|
|
31
|
+
let _statusBarEl_decorators;
|
|
32
|
+
let _statusBarEl_initializers = [];
|
|
33
|
+
let _statusBarEl_extraInitializers = [];
|
|
34
|
+
let _contextMenuEl_decorators;
|
|
35
|
+
let _contextMenuEl_initializers = [];
|
|
36
|
+
let _contextMenuEl_extraInitializers = [];
|
|
37
|
+
let _componentStyles_decorators;
|
|
38
|
+
let _init_decorators;
|
|
39
|
+
let _onDataChange_decorators;
|
|
40
|
+
let _handleKeydown_decorators;
|
|
41
|
+
let _handleCopy_decorators;
|
|
42
|
+
let _handlePaste_decorators;
|
|
43
|
+
let _emitCellChange_decorators;
|
|
44
|
+
let _emitCellSelect_decorators;
|
|
45
|
+
let _emitRowSelect_decorators;
|
|
46
|
+
let _emitColumnSort_decorators;
|
|
47
|
+
let _renderSheet_decorators;
|
|
48
|
+
var SniceSpreadsheet = class extends _classSuper {
|
|
49
|
+
static { _classThis = this; }
|
|
50
|
+
static {
|
|
51
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
52
|
+
_data_decorators = [property({ type: Array })];
|
|
53
|
+
_columns_decorators = [property({ type: Array })];
|
|
54
|
+
_readonly_decorators = [property({ type: Boolean })];
|
|
55
|
+
_cellRefEl_decorators = [query('.spreadsheet-cell-ref')];
|
|
56
|
+
_formulaInputEl_decorators = [query('.spreadsheet-formula-input')];
|
|
57
|
+
_wrapperEl_decorators = [query('.spreadsheet')];
|
|
58
|
+
_statusBarEl_decorators = [query('.spreadsheet-status-bar')];
|
|
59
|
+
_contextMenuEl_decorators = [query('.spreadsheet-context-menu')];
|
|
60
|
+
_componentStyles_decorators = [styles()];
|
|
61
|
+
_init_decorators = [ready()];
|
|
62
|
+
_onDataChange_decorators = [watch('data', 'columns')];
|
|
63
|
+
_handleKeydown_decorators = [on('keydown')];
|
|
64
|
+
_handleCopy_decorators = [on('copy')];
|
|
65
|
+
_handlePaste_decorators = [on('paste')];
|
|
66
|
+
_emitCellChange_decorators = [dispatch('cell-change', { bubbles: true, composed: true })];
|
|
67
|
+
_emitCellSelect_decorators = [dispatch('cell-select', { bubbles: true, composed: true })];
|
|
68
|
+
_emitRowSelect_decorators = [dispatch('row-select', { bubbles: true, composed: true })];
|
|
69
|
+
_emitColumnSort_decorators = [dispatch('column-sort', { bubbles: true, composed: true })];
|
|
70
|
+
_renderSheet_decorators = [render({ once: true })];
|
|
71
|
+
__esDecorate(this, null, _componentStyles_decorators, { kind: "method", name: "componentStyles", static: false, private: false, access: { has: obj => "componentStyles" in obj, get: obj => obj.componentStyles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
72
|
+
__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);
|
|
73
|
+
__esDecorate(this, null, _onDataChange_decorators, { kind: "method", name: "onDataChange", static: false, private: false, access: { has: obj => "onDataChange" in obj, get: obj => obj.onDataChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
74
|
+
__esDecorate(this, null, _handleKeydown_decorators, { kind: "method", name: "handleKeydown", static: false, private: false, access: { has: obj => "handleKeydown" in obj, get: obj => obj.handleKeydown }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
75
|
+
__esDecorate(this, null, _handleCopy_decorators, { kind: "method", name: "handleCopy", static: false, private: false, access: { has: obj => "handleCopy" in obj, get: obj => obj.handleCopy }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
76
|
+
__esDecorate(this, null, _handlePaste_decorators, { kind: "method", name: "handlePaste", static: false, private: false, access: { has: obj => "handlePaste" in obj, get: obj => obj.handlePaste }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
77
|
+
__esDecorate(this, null, _emitCellChange_decorators, { kind: "method", name: "emitCellChange", static: false, private: false, access: { has: obj => "emitCellChange" in obj, get: obj => obj.emitCellChange }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
78
|
+
__esDecorate(this, null, _emitCellSelect_decorators, { kind: "method", name: "emitCellSelect", static: false, private: false, access: { has: obj => "emitCellSelect" in obj, get: obj => obj.emitCellSelect }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
79
|
+
__esDecorate(this, null, _emitRowSelect_decorators, { kind: "method", name: "emitRowSelect", static: false, private: false, access: { has: obj => "emitRowSelect" in obj, get: obj => obj.emitRowSelect }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
80
|
+
__esDecorate(this, null, _emitColumnSort_decorators, { kind: "method", name: "emitColumnSort", static: false, private: false, access: { has: obj => "emitColumnSort" in obj, get: obj => obj.emitColumnSort }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
81
|
+
__esDecorate(this, null, _renderSheet_decorators, { kind: "method", name: "renderSheet", static: false, private: false, access: { has: obj => "renderSheet" in obj, get: obj => obj.renderSheet }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
82
|
+
__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);
|
|
83
|
+
__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);
|
|
84
|
+
__esDecorate(null, null, _readonly_decorators, { kind: "field", name: "readonly", static: false, private: false, access: { has: obj => "readonly" in obj, get: obj => obj.readonly, set: (obj, value) => { obj.readonly = value; } }, metadata: _metadata }, _readonly_initializers, _readonly_extraInitializers);
|
|
85
|
+
__esDecorate(null, null, _cellRefEl_decorators, { kind: "field", name: "cellRefEl", static: false, private: false, access: { has: obj => "cellRefEl" in obj, get: obj => obj.cellRefEl, set: (obj, value) => { obj.cellRefEl = value; } }, metadata: _metadata }, _cellRefEl_initializers, _cellRefEl_extraInitializers);
|
|
86
|
+
__esDecorate(null, null, _formulaInputEl_decorators, { kind: "field", name: "formulaInputEl", static: false, private: false, access: { has: obj => "formulaInputEl" in obj, get: obj => obj.formulaInputEl, set: (obj, value) => { obj.formulaInputEl = value; } }, metadata: _metadata }, _formulaInputEl_initializers, _formulaInputEl_extraInitializers);
|
|
87
|
+
__esDecorate(null, null, _wrapperEl_decorators, { kind: "field", name: "wrapperEl", static: false, private: false, access: { has: obj => "wrapperEl" in obj, get: obj => obj.wrapperEl, set: (obj, value) => { obj.wrapperEl = value; } }, metadata: _metadata }, _wrapperEl_initializers, _wrapperEl_extraInitializers);
|
|
88
|
+
__esDecorate(null, null, _statusBarEl_decorators, { kind: "field", name: "statusBarEl", static: false, private: false, access: { has: obj => "statusBarEl" in obj, get: obj => obj.statusBarEl, set: (obj, value) => { obj.statusBarEl = value; } }, metadata: _metadata }, _statusBarEl_initializers, _statusBarEl_extraInitializers);
|
|
89
|
+
__esDecorate(null, null, _contextMenuEl_decorators, { kind: "field", name: "contextMenuEl", static: false, private: false, access: { has: obj => "contextMenuEl" in obj, get: obj => obj.contextMenuEl, set: (obj, value) => { obj.contextMenuEl = value; } }, metadata: _metadata }, _contextMenuEl_initializers, _contextMenuEl_extraInitializers);
|
|
90
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
91
|
+
SniceSpreadsheet = _classThis = _classDescriptor.value;
|
|
92
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
93
|
+
}
|
|
94
|
+
static { this.UNDO_LIMIT = 100; }
|
|
95
|
+
componentStyles() {
|
|
96
|
+
return css `${sheetStyles}`;
|
|
97
|
+
}
|
|
98
|
+
init() {
|
|
99
|
+
this.rebuild();
|
|
100
|
+
}
|
|
101
|
+
onDataChange() {
|
|
102
|
+
this.rebuild();
|
|
103
|
+
}
|
|
104
|
+
// ── Public API ──
|
|
105
|
+
getCell(row, col) {
|
|
106
|
+
if (row >= 0 && row < this.data.length && col >= 0 && col < (this.data[row]?.length || 0)) {
|
|
107
|
+
return this.resolveValue(this.data[row][col]);
|
|
108
|
+
}
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
setCell(row, col, value, trackUndo = true) {
|
|
112
|
+
if (row < 0 || col < 0)
|
|
113
|
+
return;
|
|
114
|
+
while (this.data.length <= row)
|
|
115
|
+
this.data.push([]);
|
|
116
|
+
while (this.data[row].length <= col)
|
|
117
|
+
this.data[row].push('');
|
|
118
|
+
const oldValue = this.data[row][col];
|
|
119
|
+
this.data[row][col] = value;
|
|
120
|
+
if (trackUndo && oldValue !== value) {
|
|
121
|
+
this.pushUndo({ row, col, oldValue, newValue: value });
|
|
122
|
+
}
|
|
123
|
+
this.data = [...this.data];
|
|
124
|
+
this.emitCellChange(row, col, value, oldValue);
|
|
125
|
+
}
|
|
126
|
+
getData() {
|
|
127
|
+
return this.data.map(row => [...row]);
|
|
128
|
+
}
|
|
129
|
+
setData(data) {
|
|
130
|
+
this.data = data.map(row => [...row]);
|
|
131
|
+
}
|
|
132
|
+
// ── Undo/Redo ──
|
|
133
|
+
pushUndo(entry) {
|
|
134
|
+
this.undoStack.push(entry);
|
|
135
|
+
if (this.undoStack.length > SniceSpreadsheet.UNDO_LIMIT)
|
|
136
|
+
this.undoStack.shift();
|
|
137
|
+
this.redoStack = [];
|
|
138
|
+
}
|
|
139
|
+
undo() {
|
|
140
|
+
const entry = this.undoStack.pop();
|
|
141
|
+
if (!entry)
|
|
142
|
+
return;
|
|
143
|
+
this.redoStack.push(entry);
|
|
144
|
+
this.data[entry.row][entry.col] = entry.oldValue;
|
|
145
|
+
this.selectedCell = { row: entry.row, col: entry.col };
|
|
146
|
+
this.selectionStart = { ...this.selectedCell };
|
|
147
|
+
this.selectionEnd = { ...this.selectedCell };
|
|
148
|
+
this.data = [...this.data];
|
|
149
|
+
}
|
|
150
|
+
redo() {
|
|
151
|
+
const entry = this.redoStack.pop();
|
|
152
|
+
if (!entry)
|
|
153
|
+
return;
|
|
154
|
+
this.undoStack.push(entry);
|
|
155
|
+
this.data[entry.row][entry.col] = entry.newValue;
|
|
156
|
+
this.selectedCell = { row: entry.row, col: entry.col };
|
|
157
|
+
this.selectionStart = { ...this.selectedCell };
|
|
158
|
+
this.selectionEnd = { ...this.selectedCell };
|
|
159
|
+
this.data = [...this.data];
|
|
160
|
+
}
|
|
161
|
+
// ── Selection Helpers ──
|
|
162
|
+
getSelectionRange() {
|
|
163
|
+
if (!this.selectionStart || !this.selectionEnd)
|
|
164
|
+
return null;
|
|
165
|
+
return {
|
|
166
|
+
start: {
|
|
167
|
+
row: Math.min(this.selectionStart.row, this.selectionEnd.row),
|
|
168
|
+
col: Math.min(this.selectionStart.col, this.selectionEnd.col),
|
|
169
|
+
},
|
|
170
|
+
end: {
|
|
171
|
+
row: Math.max(this.selectionStart.row, this.selectionEnd.row),
|
|
172
|
+
col: Math.max(this.selectionStart.col, this.selectionEnd.col),
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
isInRange(row, col) {
|
|
177
|
+
const range = this.getSelectionRange();
|
|
178
|
+
if (!range)
|
|
179
|
+
return false;
|
|
180
|
+
return row >= range.start.row && row <= range.end.row &&
|
|
181
|
+
col >= range.start.col && col <= range.end.col;
|
|
182
|
+
}
|
|
183
|
+
hasMultiSelection() {
|
|
184
|
+
if (!this.selectionStart || !this.selectionEnd)
|
|
185
|
+
return false;
|
|
186
|
+
return this.selectionStart.row !== this.selectionEnd.row ||
|
|
187
|
+
this.selectionStart.col !== this.selectionEnd.col;
|
|
188
|
+
}
|
|
189
|
+
getSelectionStats() {
|
|
190
|
+
const range = this.getSelectionRange();
|
|
191
|
+
if (!range || !this.hasMultiSelection())
|
|
192
|
+
return null;
|
|
193
|
+
const nums = [];
|
|
194
|
+
for (let r = range.start.row; r <= range.end.row; r++) {
|
|
195
|
+
for (let c = range.start.col; c <= range.end.col; c++) {
|
|
196
|
+
const val = this.getCell(r, c);
|
|
197
|
+
const num = typeof val === 'number' ? val : parseFloat(val);
|
|
198
|
+
if (!isNaN(num))
|
|
199
|
+
nums.push(num);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (nums.length === 0)
|
|
203
|
+
return null;
|
|
204
|
+
const sum = nums.reduce((a, b) => a + b, 0);
|
|
205
|
+
return { count: nums.length, sum, avg: sum / nums.length };
|
|
206
|
+
}
|
|
207
|
+
// ── Formula Support ──
|
|
208
|
+
resolveValue(value) {
|
|
209
|
+
if (typeof value !== 'string' || !value.startsWith('='))
|
|
210
|
+
return value;
|
|
211
|
+
try {
|
|
212
|
+
return this.evaluateFormula(value.substring(1).toUpperCase().trim());
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
return '#ERROR';
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
evaluateFormula(formula) {
|
|
219
|
+
const fnMatch = formula.match(/^(SUM|AVG|AVERAGE|COUNT|MIN|MAX)\(([^)]+)\)$/);
|
|
220
|
+
if (!fnMatch)
|
|
221
|
+
return '#ERROR';
|
|
222
|
+
const fn = fnMatch[1];
|
|
223
|
+
const nums = this.resolveRange(fnMatch[2]).filter(v => typeof v === 'number' && !isNaN(v));
|
|
224
|
+
switch (fn) {
|
|
225
|
+
case 'SUM': return nums.reduce((a, b) => a + b, 0);
|
|
226
|
+
case 'AVG':
|
|
227
|
+
case 'AVERAGE': return nums.length > 0 ? nums.reduce((a, b) => a + b, 0) / nums.length : 0;
|
|
228
|
+
case 'COUNT': return nums.length;
|
|
229
|
+
case 'MIN': return nums.length > 0 ? Math.min(...nums) : 0;
|
|
230
|
+
case 'MAX': return nums.length > 0 ? Math.max(...nums) : 0;
|
|
231
|
+
default: return '#ERROR';
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
resolveRange(rangeStr) {
|
|
235
|
+
const parts = rangeStr.split(':');
|
|
236
|
+
if (parts.length === 2) {
|
|
237
|
+
const start = this.parseCellRef(parts[0].trim());
|
|
238
|
+
const end = this.parseCellRef(parts[1].trim());
|
|
239
|
+
if (!start || !end)
|
|
240
|
+
return [];
|
|
241
|
+
const values = [];
|
|
242
|
+
for (let r = start.row; r <= end.row; r++) {
|
|
243
|
+
for (let c = start.col; c <= end.col; c++) {
|
|
244
|
+
if (r < this.data.length && c < (this.data[r]?.length || 0)) {
|
|
245
|
+
const raw = this.data[r][c];
|
|
246
|
+
const val = typeof raw === 'string' && raw.startsWith('=') ? this.resolveValue(raw) : raw;
|
|
247
|
+
const num = typeof val === 'number' ? val : parseFloat(val);
|
|
248
|
+
if (!isNaN(num))
|
|
249
|
+
values.push(num);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return values;
|
|
254
|
+
}
|
|
255
|
+
const ref = this.parseCellRef(rangeStr.trim());
|
|
256
|
+
if (ref && ref.row < this.data.length && ref.col < (this.data[ref.row]?.length || 0)) {
|
|
257
|
+
const val = this.resolveValue(this.data[ref.row][ref.col]);
|
|
258
|
+
return [typeof val === 'number' ? val : parseFloat(val)].filter(v => !isNaN(v));
|
|
259
|
+
}
|
|
260
|
+
return [];
|
|
261
|
+
}
|
|
262
|
+
parseCellRef(ref) {
|
|
263
|
+
const match = ref.match(/^([A-Z]+)(\d+)$/);
|
|
264
|
+
if (!match)
|
|
265
|
+
return null;
|
|
266
|
+
let col = 0;
|
|
267
|
+
for (const ch of match[1])
|
|
268
|
+
col = col * 26 + (ch.charCodeAt(0) - 64);
|
|
269
|
+
return { row: parseInt(match[2], 10) - 1, col: col - 1 };
|
|
270
|
+
}
|
|
271
|
+
colToLetter(col) {
|
|
272
|
+
let result = '';
|
|
273
|
+
let c = col;
|
|
274
|
+
while (c >= 0) {
|
|
275
|
+
result = String.fromCharCode(65 + (c % 26)) + result;
|
|
276
|
+
c = Math.floor(c / 26) - 1;
|
|
277
|
+
}
|
|
278
|
+
return result;
|
|
279
|
+
}
|
|
280
|
+
getCellRef() {
|
|
281
|
+
if (!this.selectedCell)
|
|
282
|
+
return '';
|
|
283
|
+
return `${this.colToLetter(this.selectedCell.col)}${this.selectedCell.row + 1}`;
|
|
284
|
+
}
|
|
285
|
+
getColumnCount() {
|
|
286
|
+
return Math.max(this.columns.length, ...this.data.map(row => row?.length || 0), 1);
|
|
287
|
+
}
|
|
288
|
+
getDefaultColWidth(col) {
|
|
289
|
+
return this.columns[col]?.width || 100;
|
|
290
|
+
}
|
|
291
|
+
getColWidth(col) {
|
|
292
|
+
return this.columnWidths.get(col) || this.getDefaultColWidth(col);
|
|
293
|
+
}
|
|
294
|
+
// ── Cell Interaction ──
|
|
295
|
+
handleCellMouseDown(row, col, e) {
|
|
296
|
+
if (this.editingCell)
|
|
297
|
+
this.commitEdit();
|
|
298
|
+
if (e.shiftKey && this.selectedCell) {
|
|
299
|
+
this.selectionEnd = { row, col };
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
this.selectedCell = { row, col };
|
|
303
|
+
this.selectionStart = { row, col };
|
|
304
|
+
this.selectionEnd = { row, col };
|
|
305
|
+
this.isDragging = true;
|
|
306
|
+
this.boundDragMove = (ev) => this.handleDragMove(ev);
|
|
307
|
+
this.boundDragUp = () => this.handleDragEnd();
|
|
308
|
+
document.addEventListener('mousemove', this.boundDragMove);
|
|
309
|
+
document.addEventListener('mouseup', this.boundDragUp);
|
|
310
|
+
}
|
|
311
|
+
this.editingCell = null;
|
|
312
|
+
this.emitCellSelect(row, col);
|
|
313
|
+
this.updateSelection();
|
|
314
|
+
}
|
|
315
|
+
handleDragMove(e) {
|
|
316
|
+
if (!this.isDragging || !this.wrapperEl)
|
|
317
|
+
return;
|
|
318
|
+
const cells = this.wrapperEl.querySelectorAll('.spreadsheet-td');
|
|
319
|
+
let closestRow = -1, closestCol = -1, minDist = Infinity;
|
|
320
|
+
cells.forEach(cell => {
|
|
321
|
+
const r = parseInt(cell.getAttribute('data-row') || '-1');
|
|
322
|
+
const c = parseInt(cell.getAttribute('data-col') || '-1');
|
|
323
|
+
if (r < 0 || c < 0)
|
|
324
|
+
return;
|
|
325
|
+
const rect = cell.getBoundingClientRect();
|
|
326
|
+
const dist = Math.hypot(e.clientX - (rect.left + rect.width / 2), e.clientY - (rect.top + rect.height / 2));
|
|
327
|
+
if (dist < minDist) {
|
|
328
|
+
minDist = dist;
|
|
329
|
+
closestRow = r;
|
|
330
|
+
closestCol = c;
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
if (closestRow >= 0 && (closestRow !== this.selectionEnd?.row || closestCol !== this.selectionEnd?.col)) {
|
|
334
|
+
this.selectionEnd = { row: closestRow, col: closestCol };
|
|
335
|
+
this.updateSelection();
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
handleDragEnd() {
|
|
339
|
+
this.isDragging = false;
|
|
340
|
+
if (this.boundDragMove) {
|
|
341
|
+
document.removeEventListener('mousemove', this.boundDragMove);
|
|
342
|
+
this.boundDragMove = null;
|
|
343
|
+
}
|
|
344
|
+
if (this.boundDragUp) {
|
|
345
|
+
document.removeEventListener('mouseup', this.boundDragUp);
|
|
346
|
+
this.boundDragUp = null;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
handleCellDblClick(row, col) {
|
|
350
|
+
if (this.readonly)
|
|
351
|
+
return;
|
|
352
|
+
this.startEditing(row, col);
|
|
353
|
+
}
|
|
354
|
+
startEditing(row, col, initialValue) {
|
|
355
|
+
if (this.readonly)
|
|
356
|
+
return;
|
|
357
|
+
this.editingCell = { row, col };
|
|
358
|
+
const raw = this.data[row]?.[col];
|
|
359
|
+
this.editValue = initialValue !== undefined ? initialValue : (raw != null ? String(raw) : '');
|
|
360
|
+
this.selectedCell = { row, col };
|
|
361
|
+
this.selectionStart = { row, col };
|
|
362
|
+
this.selectionEnd = { row, col };
|
|
363
|
+
const td = this.wrapperEl?.querySelector(`td[data-row="${row}"][data-col="${col}"]`);
|
|
364
|
+
if (!td)
|
|
365
|
+
return;
|
|
366
|
+
td.classList.add('selected');
|
|
367
|
+
const colDef = this.columns[col];
|
|
368
|
+
const cellType = colDef?.type || 'text';
|
|
369
|
+
if (cellType === 'boolean') {
|
|
370
|
+
td.innerHTML = `<div class="spreadsheet-checkbox"><input type="checkbox" ${raw ? 'checked' : ''} /></div>`;
|
|
371
|
+
const cb = td.querySelector('input');
|
|
372
|
+
cb?.addEventListener('change', (e) => { this.editingCell = null; this.setCell(row, col, e.target.checked); });
|
|
373
|
+
cb?.focus();
|
|
374
|
+
}
|
|
375
|
+
else if (cellType === 'select' && colDef?.options) {
|
|
376
|
+
const opts = colDef.options.map(opt => `<option value="${this.escAttr(opt)}" ${raw === opt ? 'selected' : ''}>${this.esc(opt)}</option>`).join('');
|
|
377
|
+
td.innerHTML = `<select class="spreadsheet-select">${opts}</select>`;
|
|
378
|
+
const sel = td.querySelector('select');
|
|
379
|
+
sel?.addEventListener('change', (e) => { this.editingCell = null; this.setCell(row, col, e.target.value); });
|
|
380
|
+
sel?.focus();
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
const inputType = cellType === 'number' ? 'number' : cellType === 'date' ? 'date' : 'text';
|
|
384
|
+
td.innerHTML = `<input class="spreadsheet-input" type="${inputType}" value="${this.escAttr(this.editValue)}" />`;
|
|
385
|
+
const input = td.querySelector('input');
|
|
386
|
+
if (input) {
|
|
387
|
+
input.addEventListener('input', (e) => { this.editValue = e.target.value; });
|
|
388
|
+
input.addEventListener('keydown', (e) => this.handleEditKeydown(e));
|
|
389
|
+
input.addEventListener('blur', () => this.commitEdit());
|
|
390
|
+
input.focus();
|
|
391
|
+
if (initialValue !== undefined) {
|
|
392
|
+
input.setSelectionRange(input.value.length, input.value.length);
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
input.select();
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
this.updateFormulaBar();
|
|
400
|
+
}
|
|
401
|
+
handleEditKeydown(e) {
|
|
402
|
+
const row = this.editingCell?.row;
|
|
403
|
+
const col = this.editingCell?.col;
|
|
404
|
+
if (row === undefined || col === undefined)
|
|
405
|
+
return;
|
|
406
|
+
if (e.key === 'Enter') {
|
|
407
|
+
e.preventDefault();
|
|
408
|
+
this.commitEdit();
|
|
409
|
+
const nextRow = row + 1;
|
|
410
|
+
if (nextRow >= this.data.length)
|
|
411
|
+
this.addRow();
|
|
412
|
+
this.selectedCell = { row: nextRow, col };
|
|
413
|
+
this.selectionStart = { ...this.selectedCell };
|
|
414
|
+
this.selectionEnd = { ...this.selectedCell };
|
|
415
|
+
this.updateSelection();
|
|
416
|
+
}
|
|
417
|
+
else if (e.key === 'Escape') {
|
|
418
|
+
e.preventDefault();
|
|
419
|
+
this.editingCell = null;
|
|
420
|
+
this.restoreCell(row, col);
|
|
421
|
+
this.updateSelection();
|
|
422
|
+
}
|
|
423
|
+
else if (e.key === 'Tab') {
|
|
424
|
+
e.preventDefault();
|
|
425
|
+
this.commitEdit();
|
|
426
|
+
const nextCol = e.shiftKey ? col - 1 : col + 1;
|
|
427
|
+
if (nextCol >= 0) {
|
|
428
|
+
if (nextCol >= this.getColumnCount())
|
|
429
|
+
this.addColumn();
|
|
430
|
+
this.selectedCell = { row, col: nextCol };
|
|
431
|
+
this.selectionStart = { ...this.selectedCell };
|
|
432
|
+
this.selectionEnd = { ...this.selectedCell };
|
|
433
|
+
this.updateSelection();
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
commitEdit() {
|
|
438
|
+
if (!this.editingCell)
|
|
439
|
+
return;
|
|
440
|
+
const { row, col } = this.editingCell;
|
|
441
|
+
let value = this.editValue;
|
|
442
|
+
const colDef = this.columns[col];
|
|
443
|
+
const type = colDef?.type || 'text';
|
|
444
|
+
if (type === 'number' && !value.startsWith('=')) {
|
|
445
|
+
const num = parseFloat(value);
|
|
446
|
+
if (!isNaN(num))
|
|
447
|
+
value = num;
|
|
448
|
+
}
|
|
449
|
+
else if (type === 'boolean') {
|
|
450
|
+
value = value === 'true' || value === '1';
|
|
451
|
+
}
|
|
452
|
+
this.editingCell = null;
|
|
453
|
+
this.setCell(row, col, value);
|
|
454
|
+
}
|
|
455
|
+
restoreCell(row, col) {
|
|
456
|
+
const td = this.wrapperEl?.querySelector(`td[data-row="${row}"][data-col="${col}"]`);
|
|
457
|
+
if (!td)
|
|
458
|
+
return;
|
|
459
|
+
const rawValue = this.data[row]?.[col];
|
|
460
|
+
const displayValue = this.resolveValue(rawValue);
|
|
461
|
+
const colDef = this.columns[col];
|
|
462
|
+
const cellType = colDef?.type || 'text';
|
|
463
|
+
const display = cellType === 'boolean'
|
|
464
|
+
? (displayValue ? '\u2713' : '\u2717')
|
|
465
|
+
: (displayValue != null ? this.esc(String(displayValue)) : '');
|
|
466
|
+
const contentClass = cellType === 'number' ? 'spreadsheet-cell spreadsheet-cell-number'
|
|
467
|
+
: cellType === 'boolean' ? 'spreadsheet-cell spreadsheet-cell-boolean'
|
|
468
|
+
: 'spreadsheet-cell';
|
|
469
|
+
td.innerHTML = `<span class="${contentClass}">${display}</span>`;
|
|
470
|
+
}
|
|
471
|
+
handleRowClick(row) {
|
|
472
|
+
this.selectedCell = { row, col: 0 };
|
|
473
|
+
this.selectionStart = { row, col: 0 };
|
|
474
|
+
this.selectionEnd = { row, col: this.getColumnCount() - 1 };
|
|
475
|
+
this.emitRowSelect(row);
|
|
476
|
+
this.updateSelection();
|
|
477
|
+
}
|
|
478
|
+
handleHeaderClick(col) {
|
|
479
|
+
if (this.sortCol === col) {
|
|
480
|
+
this.sortDir = this.sortDir === 'asc' ? 'desc' : 'asc';
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
this.sortCol = col;
|
|
484
|
+
this.sortDir = 'asc';
|
|
485
|
+
}
|
|
486
|
+
this.data = [...this.data].sort((a, b) => {
|
|
487
|
+
const aVal = a[col], bVal = b[col];
|
|
488
|
+
if (aVal === bVal)
|
|
489
|
+
return 0;
|
|
490
|
+
if (aVal == null)
|
|
491
|
+
return 1;
|
|
492
|
+
if (bVal == null)
|
|
493
|
+
return -1;
|
|
494
|
+
const cmp = typeof aVal === 'number' && typeof bVal === 'number'
|
|
495
|
+
? aVal - bVal : String(aVal).localeCompare(String(bVal));
|
|
496
|
+
return this.sortDir === 'asc' ? cmp : -cmp;
|
|
497
|
+
});
|
|
498
|
+
this.emitColumnSort(col, this.sortDir);
|
|
499
|
+
}
|
|
500
|
+
// ── Column Resize ──
|
|
501
|
+
handleResizeStart(col, e) {
|
|
502
|
+
e.preventDefault();
|
|
503
|
+
e.stopPropagation();
|
|
504
|
+
this.resizingCol = col;
|
|
505
|
+
this.resizeStartX = e.clientX;
|
|
506
|
+
this.resizeStartWidth = this.getColWidth(col);
|
|
507
|
+
this.boundResizeMove = (ev) => this.handleResizeMove(ev);
|
|
508
|
+
this.boundResizeUp = () => this.handleResizeEnd();
|
|
509
|
+
document.addEventListener('mousemove', this.boundResizeMove);
|
|
510
|
+
document.addEventListener('mouseup', this.boundResizeUp);
|
|
511
|
+
}
|
|
512
|
+
handleResizeMove(e) {
|
|
513
|
+
if (this.resizingCol < 0 || !this.wrapperEl)
|
|
514
|
+
return;
|
|
515
|
+
const newWidth = Math.max(40, this.resizeStartWidth + (e.clientX - this.resizeStartX));
|
|
516
|
+
this.columnWidths.set(this.resizingCol, newWidth);
|
|
517
|
+
this.wrapperEl.querySelectorAll(`th[data-col="${this.resizingCol}"], td[data-col="${this.resizingCol}"]`).forEach(el => {
|
|
518
|
+
el.style.width = `${newWidth}px`;
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
handleResizeEnd() {
|
|
522
|
+
this.resizingCol = -1;
|
|
523
|
+
if (this.boundResizeMove) {
|
|
524
|
+
document.removeEventListener('mousemove', this.boundResizeMove);
|
|
525
|
+
this.boundResizeMove = null;
|
|
526
|
+
}
|
|
527
|
+
if (this.boundResizeUp) {
|
|
528
|
+
document.removeEventListener('mouseup', this.boundResizeUp);
|
|
529
|
+
this.boundResizeUp = null;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
// ── Context Menu ──
|
|
533
|
+
handleContextMenu(row, col, e) {
|
|
534
|
+
e.preventDefault();
|
|
535
|
+
this.selectedCell = { row, col };
|
|
536
|
+
this.contextMenuCell = { row, col };
|
|
537
|
+
this.showContextMenu(e.clientX, e.clientY);
|
|
538
|
+
this.updateSelection();
|
|
539
|
+
setTimeout(() => {
|
|
540
|
+
this.boundCloseContext = (ev) => {
|
|
541
|
+
if (this.contextMenuEl && !this.contextMenuEl.contains(ev.target))
|
|
542
|
+
this.hideContextMenu();
|
|
543
|
+
};
|
|
544
|
+
this.boundCloseContextKey = (ev) => {
|
|
545
|
+
if (ev.key === 'Escape')
|
|
546
|
+
this.hideContextMenu();
|
|
547
|
+
};
|
|
548
|
+
document.addEventListener('mousedown', this.boundCloseContext);
|
|
549
|
+
document.addEventListener('keydown', this.boundCloseContextKey);
|
|
550
|
+
}, 0);
|
|
551
|
+
}
|
|
552
|
+
showContextMenu(x, y) {
|
|
553
|
+
if (!this.contextMenuEl)
|
|
554
|
+
return;
|
|
555
|
+
this.contextMenuEl.style.left = `${x}px`;
|
|
556
|
+
this.contextMenuEl.style.top = `${y}px`;
|
|
557
|
+
this.contextMenuEl.hidden = false;
|
|
558
|
+
}
|
|
559
|
+
hideContextMenu() {
|
|
560
|
+
if (this.contextMenuEl)
|
|
561
|
+
this.contextMenuEl.hidden = true;
|
|
562
|
+
this.contextMenuCell = null;
|
|
563
|
+
if (this.boundCloseContext) {
|
|
564
|
+
document.removeEventListener('mousedown', this.boundCloseContext);
|
|
565
|
+
this.boundCloseContext = null;
|
|
566
|
+
}
|
|
567
|
+
if (this.boundCloseContextKey) {
|
|
568
|
+
document.removeEventListener('keydown', this.boundCloseContextKey);
|
|
569
|
+
this.boundCloseContextKey = null;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
contextAction(action) {
|
|
573
|
+
const cell = this.contextMenuCell;
|
|
574
|
+
if (!cell) {
|
|
575
|
+
this.hideContextMenu();
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
const { row, col } = cell;
|
|
579
|
+
switch (action) {
|
|
580
|
+
case 'cut':
|
|
581
|
+
this.handleCopyCells();
|
|
582
|
+
this.clearSelectedCells();
|
|
583
|
+
break;
|
|
584
|
+
case 'copy':
|
|
585
|
+
this.handleCopyCells();
|
|
586
|
+
break;
|
|
587
|
+
case 'insert-row-above':
|
|
588
|
+
this.insertRow(row);
|
|
589
|
+
break;
|
|
590
|
+
case 'insert-row-below':
|
|
591
|
+
this.insertRow(row + 1);
|
|
592
|
+
break;
|
|
593
|
+
case 'delete-row':
|
|
594
|
+
this.deleteRow(row);
|
|
595
|
+
break;
|
|
596
|
+
case 'insert-col-left':
|
|
597
|
+
this.insertColumn(col);
|
|
598
|
+
break;
|
|
599
|
+
case 'insert-col-right':
|
|
600
|
+
this.insertColumn(col + 1);
|
|
601
|
+
break;
|
|
602
|
+
case 'delete-col':
|
|
603
|
+
this.deleteColumn(col);
|
|
604
|
+
break;
|
|
605
|
+
case 'clear':
|
|
606
|
+
this.clearSelectedCells();
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
this.hideContextMenu();
|
|
610
|
+
}
|
|
611
|
+
// ── Clipboard ──
|
|
612
|
+
handleCopyCells() {
|
|
613
|
+
const range = this.getSelectionRange();
|
|
614
|
+
if (!range) {
|
|
615
|
+
if (this.selectedCell) {
|
|
616
|
+
navigator.clipboard.writeText(String(this.getCell(this.selectedCell.row, this.selectedCell.col) ?? '')).catch(() => { });
|
|
617
|
+
}
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
const lines = [];
|
|
621
|
+
for (let r = range.start.row; r <= range.end.row; r++) {
|
|
622
|
+
const cells = [];
|
|
623
|
+
for (let c = range.start.col; c <= range.end.col; c++) {
|
|
624
|
+
cells.push(String(this.getCell(r, c) ?? ''));
|
|
625
|
+
}
|
|
626
|
+
lines.push(cells.join('\t'));
|
|
627
|
+
}
|
|
628
|
+
navigator.clipboard.writeText(lines.join('\n')).catch(() => { });
|
|
629
|
+
}
|
|
630
|
+
clearSelectedCells() {
|
|
631
|
+
const range = this.getSelectionRange();
|
|
632
|
+
if (range && this.hasMultiSelection()) {
|
|
633
|
+
for (let r = range.start.row; r <= range.end.row; r++) {
|
|
634
|
+
for (let c = range.start.col; c <= range.end.col; c++) {
|
|
635
|
+
this.setCell(r, c, '');
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
else if (this.selectedCell) {
|
|
640
|
+
this.setCell(this.selectedCell.row, this.selectedCell.col, '');
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
// ── Row/Column Operations ──
|
|
644
|
+
insertRow(atIndex) {
|
|
645
|
+
this.data.splice(atIndex, 0, new Array(this.getColumnCount()).fill(''));
|
|
646
|
+
this.data = [...this.data];
|
|
647
|
+
}
|
|
648
|
+
deleteRow(index) {
|
|
649
|
+
if (this.data.length <= 1)
|
|
650
|
+
return;
|
|
651
|
+
this.data.splice(index, 1);
|
|
652
|
+
this.data = [...this.data];
|
|
653
|
+
}
|
|
654
|
+
insertColumn(atIndex) {
|
|
655
|
+
for (const row of this.data)
|
|
656
|
+
row.splice(atIndex, 0, '');
|
|
657
|
+
if (this.columns.length > 0) {
|
|
658
|
+
this.columns.splice(atIndex, 0, { header: this.colToLetter(atIndex) });
|
|
659
|
+
this.columns = [...this.columns];
|
|
660
|
+
}
|
|
661
|
+
this.data = [...this.data];
|
|
662
|
+
}
|
|
663
|
+
deleteColumn(index) {
|
|
664
|
+
if (this.getColumnCount() <= 1)
|
|
665
|
+
return;
|
|
666
|
+
for (const row of this.data) {
|
|
667
|
+
if (index < row.length)
|
|
668
|
+
row.splice(index, 1);
|
|
669
|
+
}
|
|
670
|
+
if (this.columns.length > index) {
|
|
671
|
+
this.columns.splice(index, 1);
|
|
672
|
+
this.columns = [...this.columns];
|
|
673
|
+
}
|
|
674
|
+
this.data = [...this.data];
|
|
675
|
+
}
|
|
676
|
+
addRow() {
|
|
677
|
+
this.data.push(new Array(this.getColumnCount()).fill(''));
|
|
678
|
+
this.data = [...this.data];
|
|
679
|
+
}
|
|
680
|
+
addColumn() {
|
|
681
|
+
for (const row of this.data)
|
|
682
|
+
row.push('');
|
|
683
|
+
if (this.columns.length > 0) {
|
|
684
|
+
this.columns.push({ header: this.colToLetter(this.columns.length) });
|
|
685
|
+
this.columns = [...this.columns];
|
|
686
|
+
}
|
|
687
|
+
this.data = [...this.data];
|
|
688
|
+
}
|
|
689
|
+
// ── Keyboard ──
|
|
690
|
+
handleKeydown(e) {
|
|
691
|
+
if ((e.ctrlKey || e.metaKey) && e.key === 'z' && !e.shiftKey) {
|
|
692
|
+
e.preventDefault();
|
|
693
|
+
this.undo();
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
if ((e.ctrlKey || e.metaKey) && (e.key === 'y' || (e.key === 'z' && e.shiftKey))) {
|
|
697
|
+
e.preventDefault();
|
|
698
|
+
this.redo();
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
if (this.editingCell)
|
|
702
|
+
return;
|
|
703
|
+
if (!this.selectedCell)
|
|
704
|
+
return;
|
|
705
|
+
const { row, col } = this.selectedCell;
|
|
706
|
+
if (!e.ctrlKey && !e.metaKey && !e.altKey && e.key.length === 1 && !this.readonly) {
|
|
707
|
+
e.preventDefault();
|
|
708
|
+
this.startEditing(row, col, e.key);
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
switch (e.key) {
|
|
712
|
+
case 'ArrowUp':
|
|
713
|
+
e.preventDefault();
|
|
714
|
+
if (row > 0) {
|
|
715
|
+
const nr = row - 1;
|
|
716
|
+
this.selectedCell = { row: nr, col };
|
|
717
|
+
if (e.shiftKey) {
|
|
718
|
+
this.selectionEnd = { row: nr, col: this.selectionEnd?.col ?? col };
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
this.selectionStart = { row: nr, col };
|
|
722
|
+
this.selectionEnd = { row: nr, col };
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
break;
|
|
726
|
+
case 'ArrowDown':
|
|
727
|
+
e.preventDefault();
|
|
728
|
+
if (row < this.data.length - 1) {
|
|
729
|
+
const nr = row + 1;
|
|
730
|
+
this.selectedCell = { row: nr, col };
|
|
731
|
+
if (e.shiftKey) {
|
|
732
|
+
this.selectionEnd = { row: nr, col: this.selectionEnd?.col ?? col };
|
|
733
|
+
}
|
|
734
|
+
else {
|
|
735
|
+
this.selectionStart = { row: nr, col };
|
|
736
|
+
this.selectionEnd = { row: nr, col };
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
break;
|
|
740
|
+
case 'ArrowLeft':
|
|
741
|
+
e.preventDefault();
|
|
742
|
+
if (col > 0) {
|
|
743
|
+
const nc = col - 1;
|
|
744
|
+
this.selectedCell = { row, col: nc };
|
|
745
|
+
if (e.shiftKey) {
|
|
746
|
+
this.selectionEnd = { row: this.selectionEnd?.row ?? row, col: nc };
|
|
747
|
+
}
|
|
748
|
+
else {
|
|
749
|
+
this.selectionStart = { row, col: nc };
|
|
750
|
+
this.selectionEnd = { row, col: nc };
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
break;
|
|
754
|
+
case 'ArrowRight':
|
|
755
|
+
e.preventDefault();
|
|
756
|
+
{
|
|
757
|
+
const nc = col + 1;
|
|
758
|
+
this.selectedCell = { row, col: nc };
|
|
759
|
+
if (e.shiftKey) {
|
|
760
|
+
this.selectionEnd = { row: this.selectionEnd?.row ?? row, col: nc };
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
this.selectionStart = { row, col: nc };
|
|
764
|
+
this.selectionEnd = { row, col: nc };
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
break;
|
|
768
|
+
case 'Enter':
|
|
769
|
+
case 'F2':
|
|
770
|
+
e.preventDefault();
|
|
771
|
+
if (!this.readonly)
|
|
772
|
+
this.startEditing(row, col);
|
|
773
|
+
return;
|
|
774
|
+
case 'Delete':
|
|
775
|
+
case 'Backspace':
|
|
776
|
+
e.preventDefault();
|
|
777
|
+
if (!this.readonly)
|
|
778
|
+
this.clearSelectedCells();
|
|
779
|
+
return;
|
|
780
|
+
default:
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
this.updateSelection();
|
|
784
|
+
}
|
|
785
|
+
handleCopy(e) {
|
|
786
|
+
const range = this.getSelectionRange();
|
|
787
|
+
if (range && this.hasMultiSelection()) {
|
|
788
|
+
const lines = [];
|
|
789
|
+
for (let r = range.start.row; r <= range.end.row; r++) {
|
|
790
|
+
const cells = [];
|
|
791
|
+
for (let c = range.start.col; c <= range.end.col; c++) {
|
|
792
|
+
cells.push(String(this.getCell(r, c) ?? ''));
|
|
793
|
+
}
|
|
794
|
+
lines.push(cells.join('\t'));
|
|
795
|
+
}
|
|
796
|
+
e.clipboardData?.setData('text/plain', lines.join('\n'));
|
|
797
|
+
}
|
|
798
|
+
else if (this.selectedCell) {
|
|
799
|
+
e.clipboardData?.setData('text/plain', String(this.getCell(this.selectedCell.row, this.selectedCell.col) ?? ''));
|
|
800
|
+
}
|
|
801
|
+
e.preventDefault();
|
|
802
|
+
}
|
|
803
|
+
handlePaste(e) {
|
|
804
|
+
if (this.readonly || !this.selectedCell)
|
|
805
|
+
return;
|
|
806
|
+
const text = e.clipboardData?.getData('text/plain') || '';
|
|
807
|
+
e.preventDefault();
|
|
808
|
+
const rows = text.split('\n').filter(r => r.length > 0);
|
|
809
|
+
const startRow = this.selectedCell.row;
|
|
810
|
+
const startCol = this.selectedCell.col;
|
|
811
|
+
for (let r = 0; r < rows.length; r++) {
|
|
812
|
+
const cells = rows[r].split('\t');
|
|
813
|
+
for (let c = 0; c < cells.length; c++) {
|
|
814
|
+
this.setCell(startRow + r, startCol + c, cells[c]);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
// ── DOM: Rebuild ──
|
|
819
|
+
rebuild() {
|
|
820
|
+
const wrapper = this.wrapperEl;
|
|
821
|
+
if (!wrapper) {
|
|
822
|
+
requestAnimationFrame(() => this.rebuild());
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
if (!this.listenersAttached) {
|
|
826
|
+
this.attachListeners();
|
|
827
|
+
this.listenersAttached = true;
|
|
828
|
+
}
|
|
829
|
+
if (this.data.length === 0) {
|
|
830
|
+
wrapper.innerHTML = '<div class="spreadsheet-empty">Double-click or start typing to add data</div>';
|
|
831
|
+
this.updateFormulaBar();
|
|
832
|
+
this.updateStatusBar();
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
const colCount = this.getColumnCount();
|
|
836
|
+
let h = '<table class="spreadsheet-table"><thead><tr>';
|
|
837
|
+
h += '<th class="spreadsheet-row-num"> </th>';
|
|
838
|
+
for (let c = 0; c < colCount; c++) {
|
|
839
|
+
const header = this.columns[c]?.header || this.colToLetter(c);
|
|
840
|
+
const width = this.getColWidth(c);
|
|
841
|
+
h += `<th class="spreadsheet-th" data-col="${c}" style="width:${width}px;position:relative">`;
|
|
842
|
+
h += `<span class="spreadsheet-th-sort">${this.esc(header)}`;
|
|
843
|
+
if (this.sortCol === c) {
|
|
844
|
+
h += `<span class="spreadsheet-th-sort-icon active">${this.sortDir === 'asc' ? '\u25B2' : '\u25BC'}</span>`;
|
|
845
|
+
}
|
|
846
|
+
h += '</span>';
|
|
847
|
+
h += `<div class="spreadsheet-resize-handle" data-resize-col="${c}"></div>`;
|
|
848
|
+
h += '</th>';
|
|
849
|
+
}
|
|
850
|
+
h += '<th class="spreadsheet-add-col-header" data-action="add-col">+</th>';
|
|
851
|
+
h += '</tr></thead><tbody>';
|
|
852
|
+
for (let r = 0; r < this.data.length; r++) {
|
|
853
|
+
h += '<tr>';
|
|
854
|
+
h += `<td class="spreadsheet-row-num" data-row="${r}">${r + 1}</td>`;
|
|
855
|
+
for (let c = 0; c < colCount; c++) {
|
|
856
|
+
const rawValue = this.data[r]?.[c];
|
|
857
|
+
const displayValue = this.resolveValue(rawValue);
|
|
858
|
+
const colDef = this.columns[c];
|
|
859
|
+
const cellType = colDef?.type || 'text';
|
|
860
|
+
const width = this.getColWidth(c);
|
|
861
|
+
const display = cellType === 'boolean'
|
|
862
|
+
? (displayValue ? '\u2713' : '\u2717')
|
|
863
|
+
: (displayValue != null ? this.esc(String(displayValue)) : '');
|
|
864
|
+
const contentClass = cellType === 'number' ? 'spreadsheet-cell spreadsheet-cell-number'
|
|
865
|
+
: cellType === 'boolean' ? 'spreadsheet-cell spreadsheet-cell-boolean'
|
|
866
|
+
: 'spreadsheet-cell';
|
|
867
|
+
h += `<td class="spreadsheet-td" data-row="${r}" data-col="${c}" style="width:${width}px">`;
|
|
868
|
+
h += `<span class="${contentClass}">${display}</span>`;
|
|
869
|
+
h += '</td>';
|
|
870
|
+
}
|
|
871
|
+
h += '<td class="spreadsheet-add-col-cell"></td>';
|
|
872
|
+
h += '</tr>';
|
|
873
|
+
}
|
|
874
|
+
h += '<tr class="spreadsheet-add-row" data-action="add-row">';
|
|
875
|
+
h += '<td class="spreadsheet-row-num" style="position:sticky;left:0">+</td>';
|
|
876
|
+
for (let c = 0; c <= colCount; c++)
|
|
877
|
+
h += '<td></td>';
|
|
878
|
+
h += '</tr></tbody></table>';
|
|
879
|
+
wrapper.innerHTML = h;
|
|
880
|
+
this.updateSelection();
|
|
881
|
+
}
|
|
882
|
+
// ── DOM: Event Delegation ──
|
|
883
|
+
attachListeners() {
|
|
884
|
+
const wrapper = this.wrapperEl;
|
|
885
|
+
if (!wrapper)
|
|
886
|
+
return;
|
|
887
|
+
wrapper.addEventListener('mousedown', (e) => {
|
|
888
|
+
const target = e.target;
|
|
889
|
+
const resizeHandle = target.closest('.spreadsheet-resize-handle');
|
|
890
|
+
if (resizeHandle) {
|
|
891
|
+
this.handleResizeStart(parseInt(resizeHandle.dataset.resizeCol), e);
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
const td = target.closest('td[data-row][data-col]');
|
|
895
|
+
if (td && e.button === 0) {
|
|
896
|
+
this.handleCellMouseDown(parseInt(td.dataset.row), parseInt(td.dataset.col), e);
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
wrapper.addEventListener('click', (e) => {
|
|
900
|
+
const target = e.target;
|
|
901
|
+
const th = target.closest('th.spreadsheet-th[data-col]');
|
|
902
|
+
if (th) {
|
|
903
|
+
this.handleHeaderClick(parseInt(th.dataset.col));
|
|
904
|
+
return;
|
|
905
|
+
}
|
|
906
|
+
const rowNum = target.closest('td.spreadsheet-row-num[data-row]');
|
|
907
|
+
if (rowNum) {
|
|
908
|
+
this.handleRowClick(parseInt(rowNum.dataset.row));
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
if (target.closest('[data-action="add-row"]')) {
|
|
912
|
+
this.addRow();
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
if (target.closest('[data-action="add-col"]')) {
|
|
916
|
+
this.addColumn();
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
919
|
+
});
|
|
920
|
+
wrapper.addEventListener('dblclick', (e) => {
|
|
921
|
+
const target = e.target;
|
|
922
|
+
const td = target.closest('td[data-row][data-col]');
|
|
923
|
+
if (td) {
|
|
924
|
+
this.handleCellDblClick(parseInt(td.dataset.row), parseInt(td.dataset.col));
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
if (target.closest('.spreadsheet-empty')) {
|
|
928
|
+
this.data = [['']];
|
|
929
|
+
requestAnimationFrame(() => this.startEditing(0, 0));
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
wrapper.addEventListener('contextmenu', (e) => {
|
|
933
|
+
const target = e.target;
|
|
934
|
+
const td = target.closest('td[data-row][data-col]');
|
|
935
|
+
if (td)
|
|
936
|
+
this.handleContextMenu(parseInt(td.dataset.row), parseInt(td.dataset.col), e);
|
|
937
|
+
});
|
|
938
|
+
if (this.formulaInputEl) {
|
|
939
|
+
this.formulaInputEl.addEventListener('input', (e) => {
|
|
940
|
+
if (this.selectedCell) {
|
|
941
|
+
this.setCell(this.selectedCell.row, this.selectedCell.col, e.target.value);
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
if (this.contextMenuEl) {
|
|
946
|
+
this.contextMenuEl.addEventListener('click', (e) => {
|
|
947
|
+
const item = e.target.closest('[data-ctx]');
|
|
948
|
+
if (item)
|
|
949
|
+
this.contextAction(item.dataset.ctx);
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
// ── DOM: Targeted Updates ──
|
|
954
|
+
updateSelection() {
|
|
955
|
+
const wrapper = this.wrapperEl;
|
|
956
|
+
if (!wrapper)
|
|
957
|
+
return;
|
|
958
|
+
wrapper.querySelectorAll('.selected').forEach(el => el.classList.remove('selected'));
|
|
959
|
+
wrapper.querySelectorAll('.in-range').forEach(el => el.classList.remove('in-range'));
|
|
960
|
+
wrapper.querySelectorAll('.col-selected').forEach(el => el.classList.remove('col-selected'));
|
|
961
|
+
wrapper.querySelectorAll('.row-selected').forEach(el => el.classList.remove('row-selected'));
|
|
962
|
+
if (this.selectedCell) {
|
|
963
|
+
const { row, col } = this.selectedCell;
|
|
964
|
+
const cell = wrapper.querySelector(`td[data-row="${row}"][data-col="${col}"]`);
|
|
965
|
+
if (cell)
|
|
966
|
+
cell.classList.add('selected');
|
|
967
|
+
const colHeader = wrapper.querySelector(`th[data-col="${col}"]`);
|
|
968
|
+
if (colHeader)
|
|
969
|
+
colHeader.classList.add('col-selected');
|
|
970
|
+
const rowNum = wrapper.querySelector(`td.spreadsheet-row-num[data-row="${row}"]`);
|
|
971
|
+
if (rowNum)
|
|
972
|
+
rowNum.classList.add('row-selected');
|
|
973
|
+
}
|
|
974
|
+
const range = this.getSelectionRange();
|
|
975
|
+
if (range && this.hasMultiSelection()) {
|
|
976
|
+
for (let r = range.start.row; r <= range.end.row; r++) {
|
|
977
|
+
for (let c = range.start.col; c <= range.end.col; c++) {
|
|
978
|
+
if (this.selectedCell && r === this.selectedCell.row && c === this.selectedCell.col)
|
|
979
|
+
continue;
|
|
980
|
+
const cell = wrapper.querySelector(`td[data-row="${r}"][data-col="${c}"]`);
|
|
981
|
+
if (cell)
|
|
982
|
+
cell.classList.add('in-range');
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
this.updateFormulaBar();
|
|
987
|
+
this.updateStatusBar();
|
|
988
|
+
}
|
|
989
|
+
updateFormulaBar() {
|
|
990
|
+
if (this.cellRefEl)
|
|
991
|
+
this.cellRefEl.textContent = this.getCellRef();
|
|
992
|
+
if (this.formulaInputEl) {
|
|
993
|
+
const rawVal = this.selectedCell
|
|
994
|
+
? String(this.data[this.selectedCell.row]?.[this.selectedCell.col] ?? '')
|
|
995
|
+
: '';
|
|
996
|
+
if (this.formulaInputEl.value !== rawVal) {
|
|
997
|
+
this.formulaInputEl.value = rawVal;
|
|
998
|
+
}
|
|
999
|
+
this.formulaInputEl.readOnly = this.readonly;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
updateStatusBar() {
|
|
1003
|
+
if (!this.statusBarEl)
|
|
1004
|
+
return;
|
|
1005
|
+
const stats = this.getSelectionStats();
|
|
1006
|
+
if (stats) {
|
|
1007
|
+
this.statusBarEl.innerHTML =
|
|
1008
|
+
`<span class="spreadsheet-status-item"><span class="spreadsheet-status-label">Count:</span><span class="spreadsheet-status-value">${stats.count}</span></span>` +
|
|
1009
|
+
`<span class="spreadsheet-status-item"><span class="spreadsheet-status-label">Sum:</span><span class="spreadsheet-status-value">${stats.sum.toFixed(2)}</span></span>` +
|
|
1010
|
+
`<span class="spreadsheet-status-item"><span class="spreadsheet-status-label">Avg:</span><span class="spreadsheet-status-value">${stats.avg.toFixed(2)}</span></span>`;
|
|
1011
|
+
}
|
|
1012
|
+
else {
|
|
1013
|
+
this.statusBarEl.innerHTML = '';
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
// ── HTML Helpers ──
|
|
1017
|
+
esc(str) {
|
|
1018
|
+
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
1019
|
+
}
|
|
1020
|
+
escAttr(str) {
|
|
1021
|
+
return this.esc(str).replace(/"/g, '"');
|
|
1022
|
+
}
|
|
1023
|
+
// ── Events ──
|
|
1024
|
+
emitCellChange(row, col, value, oldValue) {
|
|
1025
|
+
return { row, col, value, oldValue };
|
|
1026
|
+
}
|
|
1027
|
+
emitCellSelect(row, col) {
|
|
1028
|
+
return { row, col };
|
|
1029
|
+
}
|
|
1030
|
+
emitRowSelect(row) {
|
|
1031
|
+
return { row };
|
|
1032
|
+
}
|
|
1033
|
+
emitColumnSort(col, direction) {
|
|
1034
|
+
return { col, direction };
|
|
1035
|
+
}
|
|
1036
|
+
// ── Shell Render ──
|
|
1037
|
+
renderSheet() {
|
|
1038
|
+
return html `
|
|
1039
|
+
<div class="spreadsheet-formula-bar">
|
|
1040
|
+
<span class="spreadsheet-cell-ref"></span>
|
|
1041
|
+
<input class="spreadsheet-formula-input" />
|
|
1042
|
+
</div>
|
|
1043
|
+
<div class="spreadsheet" tabindex="0"></div>
|
|
1044
|
+
<div class="spreadsheet-status-bar"></div>
|
|
1045
|
+
<div class="spreadsheet-context-menu" hidden>
|
|
1046
|
+
<div class="spreadsheet-context-item" data-ctx="cut"><span>Cut</span><span class="spreadsheet-context-item-shortcut">Ctrl+X</span></div>
|
|
1047
|
+
<div class="spreadsheet-context-item" data-ctx="copy"><span>Copy</span><span class="spreadsheet-context-item-shortcut">Ctrl+C</span></div>
|
|
1048
|
+
<div class="spreadsheet-context-item" data-ctx="paste"><span>Paste</span><span class="spreadsheet-context-item-shortcut">Ctrl+V</span></div>
|
|
1049
|
+
<div class="spreadsheet-context-separator"></div>
|
|
1050
|
+
<div class="spreadsheet-context-item" data-ctx="insert-row-above"><span>Insert Row Above</span></div>
|
|
1051
|
+
<div class="spreadsheet-context-item" data-ctx="insert-row-below"><span>Insert Row Below</span></div>
|
|
1052
|
+
<div class="spreadsheet-context-item" data-ctx="delete-row"><span>Delete Row</span></div>
|
|
1053
|
+
<div class="spreadsheet-context-separator"></div>
|
|
1054
|
+
<div class="spreadsheet-context-item" data-ctx="insert-col-left"><span>Insert Column Left</span></div>
|
|
1055
|
+
<div class="spreadsheet-context-item" data-ctx="insert-col-right"><span>Insert Column Right</span></div>
|
|
1056
|
+
<div class="spreadsheet-context-item" data-ctx="delete-col"><span>Delete Column</span></div>
|
|
1057
|
+
<div class="spreadsheet-context-separator"></div>
|
|
1058
|
+
<div class="spreadsheet-context-item" data-ctx="clear"><span>Clear Cell(s)</span><span class="spreadsheet-context-item-shortcut">Del</span></div>
|
|
1059
|
+
</div>
|
|
1060
|
+
`;
|
|
1061
|
+
}
|
|
1062
|
+
constructor() {
|
|
1063
|
+
super(...arguments);
|
|
1064
|
+
this.data = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _data_initializers, []));
|
|
1065
|
+
this.columns = (__runInitializers(this, _data_extraInitializers), __runInitializers(this, _columns_initializers, []));
|
|
1066
|
+
this.readonly = (__runInitializers(this, _columns_extraInitializers), __runInitializers(this, _readonly_initializers, false));
|
|
1067
|
+
this.selectedCell = (__runInitializers(this, _readonly_extraInitializers), null);
|
|
1068
|
+
this.editingCell = null;
|
|
1069
|
+
this.editValue = '';
|
|
1070
|
+
this.sortCol = -1;
|
|
1071
|
+
this.sortDir = 'asc';
|
|
1072
|
+
this.selectionStart = null;
|
|
1073
|
+
this.selectionEnd = null;
|
|
1074
|
+
this.isDragging = false;
|
|
1075
|
+
this.undoStack = [];
|
|
1076
|
+
this.redoStack = [];
|
|
1077
|
+
this.columnWidths = new Map();
|
|
1078
|
+
this.resizingCol = -1;
|
|
1079
|
+
this.resizeStartX = 0;
|
|
1080
|
+
this.resizeStartWidth = 0;
|
|
1081
|
+
this.contextMenuCell = null;
|
|
1082
|
+
this.boundDragMove = null;
|
|
1083
|
+
this.boundDragUp = null;
|
|
1084
|
+
this.boundResizeMove = null;
|
|
1085
|
+
this.boundResizeUp = null;
|
|
1086
|
+
this.boundCloseContext = null;
|
|
1087
|
+
this.boundCloseContextKey = null;
|
|
1088
|
+
this.listenersAttached = false;
|
|
1089
|
+
this.cellRefEl = __runInitializers(this, _cellRefEl_initializers, void 0);
|
|
1090
|
+
this.formulaInputEl = (__runInitializers(this, _cellRefEl_extraInitializers), __runInitializers(this, _formulaInputEl_initializers, void 0));
|
|
1091
|
+
this.wrapperEl = (__runInitializers(this, _formulaInputEl_extraInitializers), __runInitializers(this, _wrapperEl_initializers, void 0));
|
|
1092
|
+
this.statusBarEl = (__runInitializers(this, _wrapperEl_extraInitializers), __runInitializers(this, _statusBarEl_initializers, void 0));
|
|
1093
|
+
this.contextMenuEl = (__runInitializers(this, _statusBarEl_extraInitializers), __runInitializers(this, _contextMenuEl_initializers, void 0));
|
|
1094
|
+
__runInitializers(this, _contextMenuEl_extraInitializers);
|
|
1095
|
+
}
|
|
1096
|
+
static {
|
|
1097
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
return SniceSpreadsheet = _classThis;
|
|
1101
|
+
})();
|
|
1102
|
+
|
|
1103
|
+
export { SniceSpreadsheet };
|
|
1104
|
+
//# sourceMappingURL=snice-spreadsheet.js.map
|