snice 3.1.0 → 3.3.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/README.md +90 -41
- package/dist/components/accordion/snice-accordion-item.d.ts +2 -2
- package/dist/components/accordion/snice-accordion-item.js +9 -9
- package/dist/components/accordion/snice-accordion-item.js.map +1 -1
- package/dist/components/accordion/snice-accordion.d.ts +2 -2
- package/dist/components/accordion/snice-accordion.js +9 -9
- package/dist/components/accordion/snice-accordion.js.map +1 -1
- package/dist/components/actions/snice-actions.d.ts +28 -0
- package/dist/components/actions/snice-actions.js +220 -0
- package/dist/components/actions/snice-actions.js.map +1 -0
- package/dist/components/actions/snice-actions.types.d.ts +27 -0
- package/dist/components/alert/snice-alert.d.ts +2 -2
- package/dist/components/alert/snice-alert.js +9 -9
- package/dist/components/alert/snice-alert.js.map +1 -1
- package/dist/components/audio-recorder/snice-audio-recorder.d.ts +58 -0
- package/dist/components/audio-recorder/snice-audio-recorder.js +413 -0
- package/dist/components/audio-recorder/snice-audio-recorder.js.map +1 -0
- package/dist/components/audio-recorder/snice-audio-recorder.types.d.ts +28 -0
- package/dist/components/avatar/snice-avatar.d.ts +2 -2
- package/dist/components/avatar/snice-avatar.js +9 -9
- package/dist/components/avatar/snice-avatar.js.map +1 -1
- package/dist/components/badge/snice-badge.d.ts +2 -2
- package/dist/components/badge/snice-badge.js +10 -10
- package/dist/components/badge/snice-badge.js.map +1 -1
- package/dist/components/banner/snice-banner.d.ts +22 -0
- package/dist/components/banner/snice-banner.js +180 -0
- package/dist/components/banner/snice-banner.js.map +1 -0
- package/dist/components/banner/snice-banner.types.d.ts +14 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.d.ts +2 -2
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +9 -9
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -1
- package/dist/components/button/snice-button.d.ts +2 -2
- package/dist/components/button/snice-button.js +9 -9
- package/dist/components/button/snice-button.js.map +1 -1
- package/dist/components/calendar/snice-calendar.d.ts +46 -0
- package/dist/components/calendar/snice-calendar.js +294 -0
- package/dist/components/calendar/snice-calendar.js.map +1 -0
- package/dist/components/calendar/snice-calendar.types.d.ts +34 -0
- package/dist/components/camera/snice-camera.d.ts +39 -0
- package/dist/components/camera/snice-camera.js +286 -0
- package/dist/components/camera/snice-camera.js.map +1 -0
- package/dist/components/camera/snice-camera.types.d.ts +28 -0
- package/dist/components/card/snice-card.d.ts +2 -2
- package/dist/components/card/snice-card.js +9 -9
- package/dist/components/card/snice-card.js.map +1 -1
- package/dist/components/carousel/snice-carousel.d.ts +32 -0
- package/dist/components/carousel/snice-carousel.js +279 -0
- package/dist/components/carousel/snice-carousel.js.map +1 -0
- package/dist/components/carousel/snice-carousel.types.d.ts +22 -0
- package/dist/components/chart/snice-chart.d.ts +73 -0
- package/dist/components/chart/snice-chart.js +940 -0
- package/dist/components/chart/snice-chart.js.map +1 -0
- package/dist/components/chart/snice-chart.types.d.ts +71 -0
- package/dist/components/chat/snice-chat.d.ts +98 -0
- package/dist/components/chat/snice-chat.js +589 -0
- package/dist/components/chat/snice-chat.js.map +1 -0
- package/dist/components/chat/snice-chat.types.d.ts +141 -0
- package/dist/components/checkbox/snice-checkbox.d.ts +2 -2
- package/dist/components/checkbox/snice-checkbox.js +9 -9
- package/dist/components/checkbox/snice-checkbox.js.map +1 -1
- package/dist/components/chip/snice-chip.d.ts +2 -2
- package/dist/components/chip/snice-chip.js +9 -9
- package/dist/components/chip/snice-chip.js.map +1 -1
- package/dist/components/code-block/snice-code-block.d.ts +15 -0
- package/dist/components/code-block/snice-code-block.js +141 -0
- package/dist/components/code-block/snice-code-block.js.map +1 -0
- package/dist/components/code-block/snice-code-block.types.d.ts +15 -0
- package/dist/components/color-display/snice-color-display.d.ts +14 -0
- package/dist/components/color-display/snice-color-display.js +151 -0
- package/dist/components/color-display/snice-color-display.js.map +1 -0
- package/dist/components/color-display/snice-color-display.types.d.ts +10 -0
- package/dist/components/color-picker/snice-color-picker.d.ts +50 -0
- package/dist/components/color-picker/snice-color-picker.js +489 -0
- package/dist/components/color-picker/snice-color-picker.js.map +1 -0
- package/dist/components/color-picker/snice-color-picker.types.d.ts +19 -0
- package/dist/components/command-palette/snice-command-palette.d.ts +47 -0
- package/dist/components/command-palette/snice-command-palette.js +428 -0
- package/dist/components/command-palette/snice-command-palette.js.map +1 -0
- package/dist/components/command-palette/snice-command-palette.types.d.ts +49 -0
- package/dist/components/date-picker/snice-date-picker.d.ts +2 -2
- package/dist/components/date-picker/snice-date-picker.js +10 -10
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/divider/snice-divider.d.ts +2 -2
- package/dist/components/divider/snice-divider.js +9 -9
- package/dist/components/divider/snice-divider.js.map +1 -1
- package/dist/components/doc/snice-doc.d.ts +93 -0
- package/dist/components/doc/snice-doc.js +626 -0
- package/dist/components/doc/snice-doc.js.map +1 -0
- package/dist/components/doc/snice-doc.types.d.ts +118 -0
- package/dist/components/draw/snice-draw.d.ts +71 -0
- package/dist/components/draw/snice-draw.js +709 -0
- package/dist/components/draw/snice-draw.js.map +1 -0
- package/dist/components/draw/snice-draw.types.d.ts +41 -0
- package/dist/components/drawer/snice-drawer.d.ts +2 -2
- package/dist/components/drawer/snice-drawer.js +9 -9
- package/dist/components/drawer/snice-drawer.js.map +1 -1
- package/dist/components/empty-state/snice-empty-state.d.ts +13 -0
- package/dist/components/empty-state/snice-empty-state.js +121 -0
- package/dist/components/empty-state/snice-empty-state.js.map +1 -0
- package/dist/components/empty-state/snice-empty-state.types.d.ts +9 -0
- package/dist/components/file-upload/snice-file-upload.d.ts +44 -0
- package/dist/components/file-upload/snice-file-upload.js +387 -0
- package/dist/components/file-upload/snice-file-upload.js.map +1 -0
- package/dist/components/file-upload/snice-file-upload.types.d.ts +22 -0
- package/dist/components/gantt/snice-gantt.d.ts +29 -0
- package/dist/components/gantt/snice-gantt.js +268 -0
- package/dist/components/gantt/snice-gantt.js.map +1 -0
- package/dist/components/gantt/snice-gantt.types.d.ts +23 -0
- package/dist/components/image/snice-image.d.ts +22 -0
- package/dist/components/image/snice-image.js +201 -0
- package/dist/components/image/snice-image.js.map +1 -0
- package/dist/components/image/snice-image.types.d.ts +17 -0
- package/dist/components/input/snice-input.d.ts +2 -2
- package/dist/components/input/snice-input.js +9 -9
- package/dist/components/input/snice-input.js.map +1 -1
- package/dist/components/kanban/snice-kanban.d.ts +31 -0
- package/dist/components/kanban/snice-kanban.js +243 -0
- package/dist/components/kanban/snice-kanban.js.map +1 -0
- package/dist/components/kanban/snice-kanban.types.d.ts +29 -0
- package/dist/components/kpi/snice-kpi.d.ts +16 -0
- package/dist/components/kpi/snice-kpi.js +162 -0
- package/dist/components/kpi/snice-kpi.js.map +1 -0
- package/dist/components/kpi/snice-kpi.types.d.ts +12 -0
- package/dist/components/layout/snice-layout-blog.d.ts +2 -2
- package/dist/components/layout/snice-layout-blog.js +9 -9
- package/dist/components/layout/snice-layout-blog.js.map +1 -1
- package/dist/components/layout/snice-layout-card.d.ts +2 -2
- package/dist/components/layout/snice-layout-card.js +9 -9
- package/dist/components/layout/snice-layout-card.js.map +1 -1
- package/dist/components/layout/snice-layout-centered.d.ts +2 -2
- package/dist/components/layout/snice-layout-centered.js +9 -9
- package/dist/components/layout/snice-layout-centered.js.map +1 -1
- package/dist/components/layout/snice-layout-dashboard.d.ts +2 -2
- package/dist/components/layout/snice-layout-dashboard.js +9 -9
- package/dist/components/layout/snice-layout-dashboard.js.map +1 -1
- package/dist/components/layout/snice-layout-fullscreen.d.ts +2 -2
- package/dist/components/layout/snice-layout-fullscreen.js +9 -9
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -1
- package/dist/components/layout/snice-layout-landing.d.ts +2 -2
- package/dist/components/layout/snice-layout-landing.js +9 -9
- package/dist/components/layout/snice-layout-landing.js.map +1 -1
- package/dist/components/layout/snice-layout-minimal.d.ts +2 -2
- package/dist/components/layout/snice-layout-minimal.js +9 -9
- package/dist/components/layout/snice-layout-minimal.js.map +1 -1
- package/dist/components/layout/snice-layout-sidebar.d.ts +2 -2
- package/dist/components/layout/snice-layout-sidebar.js +9 -9
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -1
- package/dist/components/layout/snice-layout-split.d.ts +2 -2
- package/dist/components/layout/snice-layout-split.js +9 -9
- package/dist/components/layout/snice-layout-split.js.map +1 -1
- package/dist/components/layout/snice-layout.d.ts +2 -2
- package/dist/components/layout/snice-layout.js +9 -9
- package/dist/components/layout/snice-layout.js.map +1 -1
- package/dist/components/link/snice-link.d.ts +13 -0
- package/dist/components/link/snice-link.js +137 -0
- package/dist/components/link/snice-link.js.map +1 -0
- package/dist/components/link/snice-link.types.d.ts +11 -0
- package/dist/components/list/snice-list-item.d.ts +6 -0
- package/dist/components/list/snice-list-item.js +68 -0
- package/dist/components/list/snice-list-item.js.map +1 -0
- package/dist/components/list/snice-list.d.ts +23 -0
- package/dist/components/list/snice-list.js +270 -0
- package/dist/components/list/snice-list.js.map +1 -0
- package/dist/components/list/snice-list.types.d.ts +28 -0
- package/dist/components/location/snice-location.d.ts +35 -0
- package/dist/components/location/snice-location.js +238 -0
- package/dist/components/location/snice-location.js.map +1 -0
- package/dist/components/location/snice-location.types.d.ts +35 -0
- package/dist/components/login/snice-login.d.ts +2 -2
- package/dist/components/login/snice-login.js +9 -9
- package/dist/components/login/snice-login.js.map +1 -1
- package/dist/components/menu/snice-menu-divider.d.ts +4 -0
- package/dist/components/menu/snice-menu-divider.js +53 -0
- package/dist/components/menu/snice-menu-divider.js.map +1 -0
- package/dist/components/menu/snice-menu-item.d.ts +10 -0
- package/dist/components/menu/snice-menu-item.js +99 -0
- package/dist/components/menu/snice-menu-item.js.map +1 -0
- package/dist/components/menu/snice-menu-item.types.d.ts +9 -0
- package/dist/components/menu/snice-menu.d.ts +27 -0
- package/dist/components/menu/snice-menu.js +199 -0
- package/dist/components/menu/snice-menu.js.map +1 -0
- package/dist/components/menu/snice-menu.types.d.ts +18 -0
- package/dist/components/modal/snice-modal.d.ts +2 -2
- package/dist/components/modal/snice-modal.js +9 -9
- package/dist/components/modal/snice-modal.js.map +1 -1
- package/dist/components/nav/snice-nav.js +1 -1
- package/dist/components/nav/snice-nav.js.map +1 -1
- package/dist/components/pagination/snice-pagination.d.ts +2 -2
- package/dist/components/pagination/snice-pagination.js +8 -8
- package/dist/components/pagination/snice-pagination.js.map +1 -1
- package/dist/components/progress/snice-progress.d.ts +2 -2
- package/dist/components/progress/snice-progress.js +9 -9
- package/dist/components/progress/snice-progress.js.map +1 -1
- package/dist/components/qr-code/qrcode.d.ts +28 -0
- package/dist/components/qr-code/qrcode.js +906 -0
- package/dist/components/qr-code/qrcode.js.map +1 -0
- package/dist/components/qr-code/snice-qr-code.d.ts +35 -0
- package/dist/components/qr-code/snice-qr-code.js +256 -0
- package/dist/components/qr-code/snice-qr-code.js.map +1 -0
- package/dist/components/qr-code/snice-qr-code.types.d.ts +33 -0
- package/dist/components/radio/snice-radio.d.ts +2 -2
- package/dist/components/radio/snice-radio.js +9 -9
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-option.d.ts +2 -2
- package/dist/components/select/snice-option.js +8 -8
- package/dist/components/select/snice-option.js.map +1 -1
- package/dist/components/select/snice-select.d.ts +2 -2
- package/dist/components/select/snice-select.js +9 -9
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/skeleton/snice-skeleton.d.ts +2 -2
- package/dist/components/skeleton/snice-skeleton.js +9 -9
- package/dist/components/skeleton/snice-skeleton.js.map +1 -1
- package/dist/components/slider/snice-slider.d.ts +53 -0
- package/dist/components/slider/snice-slider.js +479 -0
- package/dist/components/slider/snice-slider.js.map +1 -0
- package/dist/components/slider/snice-slider.types.d.ts +26 -0
- package/dist/components/snice-cell-C0slgOpe.js +4 -0
- package/dist/components/snice-cell-C0slgOpe.js.map +1 -0
- package/dist/components/sparkline/snice-sparkline.d.ts +21 -0
- package/dist/components/sparkline/snice-sparkline.js +228 -0
- package/dist/components/sparkline/snice-sparkline.js.map +1 -0
- package/dist/components/sparkline/snice-sparkline.types.d.ts +16 -0
- package/dist/components/spinner/snice-spinner.d.ts +10 -0
- package/dist/components/spinner/snice-spinner.js +109 -0
- package/dist/components/spinner/snice-spinner.js.map +1 -0
- package/dist/components/spinner/snice-spinner.types.d.ts +8 -0
- package/dist/components/split-pane/snice-split-pane.d.ts +32 -0
- package/dist/components/split-pane/snice-split-pane.js +191 -0
- package/dist/components/split-pane/snice-split-pane.js.map +1 -0
- package/dist/components/split-pane/snice-split-pane.types.d.ts +19 -0
- package/dist/components/stat/snice-stat.d.ts +14 -0
- package/dist/components/stat/snice-stat.js +140 -0
- package/dist/components/stat/snice-stat.js.map +1 -0
- package/dist/components/stat/snice-stat.types.d.ts +12 -0
- package/dist/components/stepper/snice-stepper-panel.d.ts +8 -0
- package/dist/components/stepper/snice-stepper-panel.js +70 -0
- package/dist/components/stepper/snice-stepper-panel.js.map +1 -0
- package/dist/components/stepper/snice-stepper-panel.types.d.ts +4 -0
- package/dist/components/stepper/snice-stepper.d.ts +15 -0
- package/dist/components/stepper/snice-stepper.js +163 -0
- package/dist/components/stepper/snice-stepper.js.map +1 -0
- package/dist/components/stepper/snice-stepper.types.d.ts +13 -0
- package/dist/components/switch/snice-switch.d.ts +2 -2
- package/dist/components/switch/snice-switch.js +9 -9
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-cell-actions.d.ts +2 -2
- package/dist/components/table/snice-cell-actions.js +9 -9
- package/dist/components/table/snice-cell-actions.js.map +1 -1
- package/dist/components/table/snice-cell-boolean.d.ts +2 -2
- package/dist/components/table/snice-cell-boolean.js +9 -9
- package/dist/components/table/snice-cell-boolean.js.map +1 -1
- package/dist/components/table/snice-cell-color.d.ts +2 -2
- package/dist/components/table/snice-cell-color.js +9 -9
- package/dist/components/table/snice-cell-color.js.map +1 -1
- package/dist/components/table/snice-cell-currency.d.ts +2 -2
- package/dist/components/table/snice-cell-currency.js +9 -9
- package/dist/components/table/snice-cell-currency.js.map +1 -1
- package/dist/components/table/snice-cell-date.d.ts +2 -2
- package/dist/components/table/snice-cell-date.js +9 -9
- package/dist/components/table/snice-cell-date.js.map +1 -1
- package/dist/components/table/snice-cell-duration.d.ts +2 -2
- package/dist/components/table/snice-cell-duration.js +9 -9
- package/dist/components/table/snice-cell-duration.js.map +1 -1
- package/dist/components/table/snice-cell-email.d.ts +2 -2
- package/dist/components/table/snice-cell-email.js +9 -9
- package/dist/components/table/snice-cell-email.js.map +1 -1
- package/dist/components/table/snice-cell-filesize.d.ts +2 -2
- package/dist/components/table/snice-cell-filesize.js +9 -9
- package/dist/components/table/snice-cell-filesize.js.map +1 -1
- package/dist/components/table/snice-cell-image.d.ts +2 -2
- package/dist/components/table/snice-cell-image.js +9 -9
- package/dist/components/table/snice-cell-image.js.map +1 -1
- package/dist/components/table/snice-cell-json.d.ts +2 -2
- package/dist/components/table/snice-cell-json.js +9 -9
- package/dist/components/table/snice-cell-json.js.map +1 -1
- package/dist/components/table/snice-cell-link.d.ts +2 -2
- package/dist/components/table/snice-cell-link.js +9 -9
- package/dist/components/table/snice-cell-link.js.map +1 -1
- package/dist/components/table/snice-cell-location.d.ts +2 -2
- package/dist/components/table/snice-cell-location.js +9 -9
- package/dist/components/table/snice-cell-location.js.map +1 -1
- package/dist/components/table/snice-cell-number.d.ts +2 -2
- package/dist/components/table/snice-cell-number.js +9 -9
- package/dist/components/table/snice-cell-number.js.map +1 -1
- package/dist/components/table/snice-cell-percentage.d.ts +2 -2
- package/dist/components/table/snice-cell-percentage.js +9 -9
- package/dist/components/table/snice-cell-percentage.js.map +1 -1
- package/dist/components/table/snice-cell-phone.d.ts +2 -2
- package/dist/components/table/snice-cell-phone.js +9 -9
- package/dist/components/table/snice-cell-phone.js.map +1 -1
- package/dist/components/table/snice-cell-progress.d.ts +2 -2
- package/dist/components/table/snice-cell-progress.js +9 -9
- package/dist/components/table/snice-cell-progress.js.map +1 -1
- package/dist/components/table/snice-cell-rating.d.ts +2 -2
- package/dist/components/table/snice-cell-rating.js +9 -9
- package/dist/components/table/snice-cell-rating.js.map +1 -1
- package/dist/components/table/snice-cell-sparkline.d.ts +2 -2
- package/dist/components/table/snice-cell-sparkline.js +9 -9
- package/dist/components/table/snice-cell-sparkline.js.map +1 -1
- package/dist/components/table/snice-cell-status.d.ts +2 -2
- package/dist/components/table/snice-cell-status.js +9 -9
- package/dist/components/table/snice-cell-status.js.map +1 -1
- package/dist/components/table/snice-cell-tag.d.ts +2 -2
- package/dist/components/table/snice-cell-tag.js +9 -9
- package/dist/components/table/snice-cell-tag.js.map +1 -1
- package/dist/components/table/snice-cell-text.d.ts +2 -2
- package/dist/components/table/snice-cell-text.js +9 -9
- package/dist/components/table/snice-cell-text.js.map +1 -1
- package/dist/components/table/snice-cell.d.ts +2 -2
- package/dist/components/table/snice-cell.js +9 -9
- package/dist/components/table/snice-cell.js.map +1 -1
- package/dist/components/table/snice-column.d.ts +1 -1
- package/dist/components/table/snice-column.js +4 -4
- package/dist/components/table/snice-column.js.map +1 -1
- package/dist/components/table/snice-header.d.ts +2 -2
- package/dist/components/table/snice-header.js +9 -9
- package/dist/components/table/snice-header.js.map +1 -1
- package/dist/components/table/snice-progress.d.ts +2 -2
- package/dist/components/table/snice-progress.js +8 -8
- package/dist/components/table/snice-progress.js.map +1 -1
- package/dist/components/table/snice-rating.d.ts +2 -2
- package/dist/components/table/snice-rating.js +8 -8
- package/dist/components/table/snice-rating.js.map +1 -1
- package/dist/components/table/snice-row.d.ts +2 -2
- package/dist/components/table/snice-row.js +10 -10
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +2 -3
- package/dist/components/table/snice-table.js +9 -14
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/tabs/snice-tab-panel.d.ts +2 -2
- package/dist/components/tabs/snice-tab-panel.js +9 -9
- package/dist/components/tabs/snice-tab-panel.js.map +1 -1
- package/dist/components/tabs/snice-tab.d.ts +2 -2
- package/dist/components/tabs/snice-tab.js +9 -9
- package/dist/components/tabs/snice-tab.js.map +1 -1
- package/dist/components/tabs/snice-tabs.d.ts +2 -2
- package/dist/components/tabs/snice-tabs.js +9 -9
- package/dist/components/tabs/snice-tabs.js.map +1 -1
- package/dist/components/terminal/snice-terminal.types.d.ts +133 -0
- package/dist/components/textarea/snice-textarea.d.ts +52 -0
- package/dist/components/textarea/snice-textarea.js +407 -0
- package/dist/components/textarea/snice-textarea.js.map +1 -0
- package/dist/components/textarea/snice-textarea.types.d.ts +30 -0
- package/dist/components/timeline/snice-timeline.d.ts +11 -0
- package/dist/components/timeline/snice-timeline.js +112 -0
- package/dist/components/timeline/snice-timeline.js.map +1 -0
- package/dist/components/timeline/snice-timeline.types.d.ts +16 -0
- package/dist/components/toast/snice-toast-container.d.ts +2 -2
- package/dist/components/toast/snice-toast-container.js +8 -8
- package/dist/components/toast/snice-toast-container.js.map +1 -1
- package/dist/components/toast/snice-toast.d.ts +2 -2
- package/dist/components/toast/snice-toast.js +8 -8
- package/dist/components/toast/snice-toast.js.map +1 -1
- package/dist/components/tooltip/snice-tooltip.d.ts +2 -2
- package/dist/components/tooltip/snice-tooltip.js +10 -10
- package/dist/components/tooltip/snice-tooltip.js.map +1 -1
- package/dist/components/tree/snice-tree-item.d.ts +35 -0
- package/dist/components/tree/snice-tree-item.js +301 -0
- package/dist/components/tree/snice-tree-item.js.map +1 -0
- package/dist/components/tree/snice-tree-item.types.d.ts +30 -0
- package/dist/components/tree/snice-tree.d.ts +45 -0
- package/dist/components/tree/snice-tree.js +390 -0
- package/dist/components/tree/snice-tree.js.map +1 -0
- package/dist/components/tree/snice-tree.types.d.ts +65 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.d.ts +31 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.js +160 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.js.map +1 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.types.d.ts +19 -0
- package/dist/index.cjs +125 -158
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +125 -158
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +125 -158
- package/dist/index.iife.js.map +1 -1
- package/dist/parts.d.ts +13 -16
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/template.d.ts +0 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/README.md +10 -1
- package/docs/ai/components/actions.md +81 -0
- package/docs/ai/components/audio-recorder.md +97 -0
- package/docs/ai/components/banner.md +84 -0
- package/docs/ai/components/calendar.md +95 -0
- package/docs/ai/components/camera.md +130 -0
- package/docs/ai/components/carousel.md +49 -0
- package/docs/ai/components/chart.md +160 -0
- package/docs/ai/components/chat.md +189 -0
- package/docs/ai/components/code-block.md +32 -0
- package/docs/ai/components/color-display.md +48 -0
- package/docs/ai/components/color-picker.md +75 -0
- package/docs/ai/components/command-palette.md +117 -0
- package/docs/ai/components/doc.md +154 -0
- package/docs/ai/components/draw.md +140 -0
- package/docs/ai/components/empty-state.md +72 -0
- package/docs/ai/components/file-upload.md +93 -0
- package/docs/ai/components/gantt.md +95 -0
- package/docs/ai/components/image.md +60 -0
- package/docs/ai/components/kanban.md +102 -0
- package/docs/ai/components/kpi.md +158 -0
- package/docs/ai/components/layout.md +261 -0
- package/docs/ai/components/link.md +77 -0
- package/docs/ai/components/list.md +50 -0
- package/docs/ai/components/location.md +75 -0
- package/docs/ai/components/menu.md +114 -0
- package/docs/ai/components/popover.md +70 -0
- package/docs/ai/components/qr-code.md +106 -0
- package/docs/ai/components/slider.md +87 -0
- package/docs/ai/components/sparkline.md +168 -0
- package/docs/ai/components/spinner.md +47 -0
- package/docs/ai/components/split-pane.md +71 -0
- package/docs/ai/components/stat.md +29 -0
- package/docs/ai/components/stepper.md +216 -0
- package/docs/ai/components/textarea.md +87 -0
- package/docs/ai/components/timeline.md +77 -0
- package/docs/ai/components/tree.md +191 -0
- package/docs/ai/components/virtual-scroller.md +71 -0
- package/docs/components/actions.md +317 -0
- package/docs/components/alert.md +540 -0
- package/docs/components/audio-recorder.md +152 -0
- package/docs/components/badge.md +593 -0
- package/docs/components/banner.md +106 -0
- package/docs/components/breadcrumbs.md +568 -0
- package/docs/components/button.md +648 -0
- package/docs/components/calendar.md +397 -0
- package/docs/components/camera.md +383 -0
- package/docs/components/card.md +778 -0
- package/docs/components/carousel.md +63 -0
- package/docs/components/chart.md +526 -0
- package/docs/components/chat.md +482 -0
- package/docs/components/checkbox.md +714 -0
- package/docs/components/chip.md +670 -0
- package/docs/components/code-block.md +49 -0
- package/docs/components/color-display.md +96 -0
- package/docs/components/color-picker.md +81 -0
- package/docs/components/command-palette.md +159 -0
- package/docs/components/doc.md +357 -0
- package/docs/components/draw.md +307 -0
- package/docs/components/empty-state.md +79 -0
- package/docs/components/file-upload.md +263 -0
- package/docs/components/gantt.md +347 -0
- package/docs/components/image.md +110 -0
- package/docs/components/kanban.md +410 -0
- package/docs/components/kpi.md +251 -0
- package/docs/components/link.md +229 -0
- package/docs/components/list.md +65 -0
- package/docs/components/location.md +369 -0
- package/docs/components/menu.md +633 -0
- package/docs/components/popover.md +333 -0
- package/docs/components/qr-code.md +464 -0
- package/docs/components/slider.md +297 -0
- package/docs/components/sparkline.md +293 -0
- package/docs/components/spinner.md +63 -0
- package/docs/components/split-pane.md +315 -0
- package/docs/components/stat.md +45 -0
- package/docs/components/stepper.md +410 -0
- package/docs/components/textarea.md +235 -0
- package/docs/components/timeline.md +192 -0
- package/docs/components/tree.md +536 -0
- package/docs/components/virtual-scroller.md +298 -0
- package/package.json +2 -1
- package/dist/components/snice-cell-BLFVdxPp.js +0 -4
- package/dist/components/snice-cell-BLFVdxPp.js.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Carousel Component
|
|
2
|
+
|
|
3
|
+
Image/content carousel with autoplay, loop, and navigation controls.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<snice-carousel>
|
|
9
|
+
<div class="slide">Slide 1</div>
|
|
10
|
+
<div class="slide">Slide 2</div>
|
|
11
|
+
<div class="slide">Slide 3</div>
|
|
12
|
+
</snice-carousel>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
| Property | Type | Default | Description |
|
|
18
|
+
|----------|------|---------|-------------|
|
|
19
|
+
| `activeIndex` | `number` | `0` | Current slide index |
|
|
20
|
+
| `autoplay` | `boolean` | `false` | Enable autoplay |
|
|
21
|
+
| `autoplayInterval` | `number` | `3000` | Autoplay interval (ms) |
|
|
22
|
+
| `autoplayDirection` | `'forward' \| 'backward'` | `'forward'` | Autoplay direction |
|
|
23
|
+
| `loop` | `boolean` | `true` | Loop slides |
|
|
24
|
+
| `showControls` | `boolean` | `true` | Show prev/next buttons |
|
|
25
|
+
| `showIndicators` | `boolean` | `true` | Show slide indicators |
|
|
26
|
+
| `slidesPerView` | `number` | `1` | Number of slides visible |
|
|
27
|
+
| `spaceBetween` | `number` | `0` | Space between slides (px) |
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
- `next()` - Go to next slide
|
|
32
|
+
- `prev()` - Go to previous slide
|
|
33
|
+
- `goToSlide(index: number)` - Go to specific slide
|
|
34
|
+
- `play()` - Start autoplay
|
|
35
|
+
- `pause()` - Pause autoplay
|
|
36
|
+
|
|
37
|
+
## Events
|
|
38
|
+
|
|
39
|
+
- `@snice/carousel-slide-change` - Slide changed (detail: { activeIndex, previousIndex, carousel })
|
|
40
|
+
|
|
41
|
+
## Examples
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<!-- Autoplay -->
|
|
45
|
+
<snice-carousel autoplay autoplay-interval="2000">
|
|
46
|
+
<div>Slide 1</div>
|
|
47
|
+
<div>Slide 2</div>
|
|
48
|
+
</snice-carousel>
|
|
49
|
+
|
|
50
|
+
<!-- Multiple slides -->
|
|
51
|
+
<snice-carousel slides-per-view="3" space-between="20">
|
|
52
|
+
<div>1</div>
|
|
53
|
+
<div>2</div>
|
|
54
|
+
<div>3</div>
|
|
55
|
+
<div>4</div>
|
|
56
|
+
</snice-carousel>
|
|
57
|
+
|
|
58
|
+
<!-- No loop -->
|
|
59
|
+
<snice-carousel loop="false">
|
|
60
|
+
<div>Slide 1</div>
|
|
61
|
+
<div>Slide 2</div>
|
|
62
|
+
</snice-carousel>
|
|
63
|
+
```
|
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
# Chart Component
|
|
2
|
+
|
|
3
|
+
General-purpose charting component supporting multiple chart types with animations and interactivity.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```javascript
|
|
8
|
+
const chart = document.querySelector('snice-chart');
|
|
9
|
+
|
|
10
|
+
chart.type = 'line';
|
|
11
|
+
chart.datasets = [
|
|
12
|
+
{
|
|
13
|
+
label: 'Sales',
|
|
14
|
+
data: [12, 19, 15, 25, 22, 30],
|
|
15
|
+
borderColor: '#2196f3'
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
chart.labels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'];
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
| Property | Type | Default | Description |
|
|
24
|
+
|----------|------|---------|-------------|
|
|
25
|
+
| `type` | `ChartType` | `'line'` | Chart type |
|
|
26
|
+
| `datasets` | `ChartDataset[]` | `[]` | Chart datasets |
|
|
27
|
+
| `labels` | `string[]` | `[]` | X-axis labels |
|
|
28
|
+
| `options` | `ChartOptions` | `{}` | Chart options |
|
|
29
|
+
| `width` | `number` | `0` | Chart width (0 = auto) |
|
|
30
|
+
| `height` | `number` | `0` | Chart height (0 = auto) |
|
|
31
|
+
|
|
32
|
+
## Chart Types
|
|
33
|
+
|
|
34
|
+
- `'line'` - Line chart
|
|
35
|
+
- `'bar'` - Vertical bar chart
|
|
36
|
+
- `'horizontal-bar'` - Horizontal bar chart
|
|
37
|
+
- `'area'` - Area chart (filled line)
|
|
38
|
+
- `'pie'` - Pie chart
|
|
39
|
+
- `'donut'` - Donut chart
|
|
40
|
+
- `'scatter'` - Scatter plot
|
|
41
|
+
- `'bubble'` - Bubble chart
|
|
42
|
+
- `'radar'` - Radar/spider chart
|
|
43
|
+
- `'mixed'` - Mixed chart types
|
|
44
|
+
|
|
45
|
+
## ChartDataset Interface
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
interface ChartDataset {
|
|
49
|
+
label: string;
|
|
50
|
+
data: (number | ChartDataPoint)[];
|
|
51
|
+
type?: ChartType; // for mixed charts
|
|
52
|
+
backgroundColor?: string | string[];
|
|
53
|
+
borderColor?: string;
|
|
54
|
+
borderWidth?: number;
|
|
55
|
+
fill?: boolean;
|
|
56
|
+
tension?: number; // 0-1 for line smoothing
|
|
57
|
+
pointRadius?: number;
|
|
58
|
+
pointHoverRadius?: number;
|
|
59
|
+
hidden?: boolean;
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## ChartOptions Interface
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
interface ChartOptions {
|
|
67
|
+
responsive?: boolean;
|
|
68
|
+
maintainAspectRatio?: boolean;
|
|
69
|
+
aspectRatio?: number;
|
|
70
|
+
legend?: ChartLegend;
|
|
71
|
+
tooltip?: ChartTooltip;
|
|
72
|
+
animation?: ChartAnimation;
|
|
73
|
+
xAxis?: ChartAxis;
|
|
74
|
+
yAxis?: ChartAxis;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Methods
|
|
79
|
+
|
|
80
|
+
### `refresh(): void`
|
|
81
|
+
Refresh the chart display.
|
|
82
|
+
|
|
83
|
+
```javascript
|
|
84
|
+
chart.refresh();
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `update(datasets: ChartDataset[]): void`
|
|
88
|
+
Update all datasets.
|
|
89
|
+
|
|
90
|
+
```javascript
|
|
91
|
+
chart.update([
|
|
92
|
+
{ label: 'New Data', data: [10, 20, 30] }
|
|
93
|
+
]);
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### `addDataset(dataset: ChartDataset): void`
|
|
97
|
+
Add a new dataset.
|
|
98
|
+
|
|
99
|
+
```javascript
|
|
100
|
+
chart.addDataset({
|
|
101
|
+
label: 'Series 3',
|
|
102
|
+
data: [15, 25, 35]
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### `removeDataset(index: number): void`
|
|
107
|
+
Remove dataset by index.
|
|
108
|
+
|
|
109
|
+
```javascript
|
|
110
|
+
chart.removeDataset(0);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### `toggleDataset(index: number): void`
|
|
114
|
+
Toggle dataset visibility.
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
chart.toggleDataset(0);
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### `exportImage(format?: 'png' | 'svg'): string`
|
|
121
|
+
Export chart as image.
|
|
122
|
+
|
|
123
|
+
```javascript
|
|
124
|
+
const svg = chart.exportImage('svg');
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### `getData(): { datasets, labels }`
|
|
128
|
+
Get current chart data.
|
|
129
|
+
|
|
130
|
+
```javascript
|
|
131
|
+
const data = chart.getData();
|
|
132
|
+
console.log(data.datasets, data.labels);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Examples
|
|
136
|
+
|
|
137
|
+
### Line Chart
|
|
138
|
+
|
|
139
|
+
```javascript
|
|
140
|
+
chart.type = 'line';
|
|
141
|
+
chart.datasets = [
|
|
142
|
+
{
|
|
143
|
+
label: 'Temperature',
|
|
144
|
+
data: [20, 22, 19, 25, 27, 24, 23],
|
|
145
|
+
borderColor: '#2196f3',
|
|
146
|
+
tension: 0.4 // Smooth line
|
|
147
|
+
}
|
|
148
|
+
];
|
|
149
|
+
chart.labels = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Bar Chart
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
chart.type = 'bar';
|
|
156
|
+
chart.datasets = [
|
|
157
|
+
{
|
|
158
|
+
label: 'Revenue',
|
|
159
|
+
data: [65, 59, 80, 81, 56, 55, 40],
|
|
160
|
+
backgroundColor: [
|
|
161
|
+
'#ff6384', '#36a2eb', '#ffce56', '#4bc0c0',
|
|
162
|
+
'#9966ff', '#ff9f40', '#ffcd56'
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
];
|
|
166
|
+
chart.labels = ['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', 'Q7'];
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Area Chart
|
|
170
|
+
|
|
171
|
+
```javascript
|
|
172
|
+
chart.type = 'area';
|
|
173
|
+
chart.datasets = [
|
|
174
|
+
{
|
|
175
|
+
label: 'Users',
|
|
176
|
+
data: [30, 40, 35, 50, 49, 60, 70],
|
|
177
|
+
borderColor: '#4caf50',
|
|
178
|
+
backgroundColor: '#4caf50',
|
|
179
|
+
fill: true
|
|
180
|
+
}
|
|
181
|
+
];
|
|
182
|
+
chart.labels = ['Week 1', 'Week 2', 'Week 3', 'Week 4', 'Week 5', 'Week 6', 'Week 7'];
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Pie Chart
|
|
186
|
+
|
|
187
|
+
```javascript
|
|
188
|
+
chart.type = 'pie';
|
|
189
|
+
chart.datasets = [
|
|
190
|
+
{
|
|
191
|
+
label: 'Market Share',
|
|
192
|
+
data: [30, 25, 20, 15, 10],
|
|
193
|
+
backgroundColor: [
|
|
194
|
+
'#ff6384', '#36a2eb', '#ffce56', '#4bc0c0', '#9966ff'
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
];
|
|
198
|
+
chart.labels = ['Product A', 'Product B', 'Product C', 'Product D', 'Product E'];
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Donut Chart
|
|
202
|
+
|
|
203
|
+
```javascript
|
|
204
|
+
chart.type = 'donut';
|
|
205
|
+
chart.datasets = [
|
|
206
|
+
{
|
|
207
|
+
label: 'Sales',
|
|
208
|
+
data: [300, 250, 200, 150],
|
|
209
|
+
backgroundColor: ['#2196f3', '#4caf50', '#ff9800', '#f44336']
|
|
210
|
+
}
|
|
211
|
+
];
|
|
212
|
+
chart.labels = ['North', 'South', 'East', 'West'];
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Scatter Plot
|
|
216
|
+
|
|
217
|
+
```javascript
|
|
218
|
+
chart.type = 'scatter';
|
|
219
|
+
chart.datasets = [
|
|
220
|
+
{
|
|
221
|
+
label: 'Dataset 1',
|
|
222
|
+
data: [
|
|
223
|
+
{ x: 10, y: 20 },
|
|
224
|
+
{ x: 15, y: 25 },
|
|
225
|
+
{ x: 20, y: 22 },
|
|
226
|
+
{ x: 25, y: 30 }
|
|
227
|
+
],
|
|
228
|
+
backgroundColor: '#2196f3',
|
|
229
|
+
pointRadius: 5
|
|
230
|
+
}
|
|
231
|
+
];
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Bubble Chart
|
|
235
|
+
|
|
236
|
+
```javascript
|
|
237
|
+
chart.type = 'bubble';
|
|
238
|
+
chart.datasets = [
|
|
239
|
+
{
|
|
240
|
+
label: 'Bubble Data',
|
|
241
|
+
data: [
|
|
242
|
+
{ x: 10, y: 20, r: 15 },
|
|
243
|
+
{ x: 15, y: 25, r: 25 },
|
|
244
|
+
{ x: 20, y: 22, r: 10 }
|
|
245
|
+
],
|
|
246
|
+
backgroundColor: '#ff9800'
|
|
247
|
+
}
|
|
248
|
+
];
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Radar Chart
|
|
252
|
+
|
|
253
|
+
```javascript
|
|
254
|
+
chart.type = 'radar';
|
|
255
|
+
chart.datasets = [
|
|
256
|
+
{
|
|
257
|
+
label: 'Team A',
|
|
258
|
+
data: [80, 90, 70, 85, 75],
|
|
259
|
+
borderColor: '#2196f3',
|
|
260
|
+
backgroundColor: '#2196f3'
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
label: 'Team B',
|
|
264
|
+
data: [70, 85, 80, 75, 85],
|
|
265
|
+
borderColor: '#4caf50',
|
|
266
|
+
backgroundColor: '#4caf50'
|
|
267
|
+
}
|
|
268
|
+
];
|
|
269
|
+
chart.labels = ['Speed', 'Strength', 'Agility', 'Defense', 'Skill'];
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Mixed Chart
|
|
273
|
+
|
|
274
|
+
```javascript
|
|
275
|
+
chart.type = 'mixed';
|
|
276
|
+
chart.datasets = [
|
|
277
|
+
{
|
|
278
|
+
label: 'Bar Data',
|
|
279
|
+
type: 'bar',
|
|
280
|
+
data: [10, 20, 30, 40, 50],
|
|
281
|
+
backgroundColor: '#2196f3'
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
label: 'Line Data',
|
|
285
|
+
type: 'line',
|
|
286
|
+
data: [15, 25, 20, 35, 30],
|
|
287
|
+
borderColor: '#4caf50'
|
|
288
|
+
}
|
|
289
|
+
];
|
|
290
|
+
chart.labels = ['A', 'B', 'C', 'D', 'E'];
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Multiple Datasets
|
|
294
|
+
|
|
295
|
+
```javascript
|
|
296
|
+
chart.type = 'line';
|
|
297
|
+
chart.datasets = [
|
|
298
|
+
{
|
|
299
|
+
label: 'Sales 2023',
|
|
300
|
+
data: [12, 19, 15, 25, 22, 30],
|
|
301
|
+
borderColor: '#2196f3'
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
label: 'Sales 2024',
|
|
305
|
+
data: [15, 22, 18, 28, 25, 33],
|
|
306
|
+
borderColor: '#4caf50'
|
|
307
|
+
}
|
|
308
|
+
];
|
|
309
|
+
chart.labels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'];
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Custom Options
|
|
313
|
+
|
|
314
|
+
```javascript
|
|
315
|
+
chart.type = 'bar';
|
|
316
|
+
chart.datasets = [{ label: 'Data', data: [10, 20, 30] }];
|
|
317
|
+
chart.labels = ['A', 'B', 'C'];
|
|
318
|
+
|
|
319
|
+
chart.options = {
|
|
320
|
+
responsive: true,
|
|
321
|
+
legend: {
|
|
322
|
+
position: 'bottom',
|
|
323
|
+
clickable: true
|
|
324
|
+
},
|
|
325
|
+
tooltip: {
|
|
326
|
+
trigger: 'hover',
|
|
327
|
+
format: (value, datasetIndex, pointIndex) => {
|
|
328
|
+
return `Value: ${value}`;
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
animation: {
|
|
332
|
+
enabled: true,
|
|
333
|
+
duration: 1000,
|
|
334
|
+
easing: 'ease-in-out'
|
|
335
|
+
},
|
|
336
|
+
xAxis: {
|
|
337
|
+
title: 'Categories',
|
|
338
|
+
grid: true
|
|
339
|
+
},
|
|
340
|
+
yAxis: {
|
|
341
|
+
title: 'Values',
|
|
342
|
+
min: 0,
|
|
343
|
+
max: 100,
|
|
344
|
+
ticks: 5,
|
|
345
|
+
grid: true
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Dynamic Updates
|
|
351
|
+
|
|
352
|
+
```javascript
|
|
353
|
+
// Add data point
|
|
354
|
+
function addData(label, value) {
|
|
355
|
+
chart.labels = [...chart.labels, label];
|
|
356
|
+
chart.datasets = chart.datasets.map(dataset => ({
|
|
357
|
+
...dataset,
|
|
358
|
+
data: [...dataset.data, value]
|
|
359
|
+
}));
|
|
360
|
+
chart.refresh();
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// Remove data point
|
|
364
|
+
function removeData() {
|
|
365
|
+
chart.labels = chart.labels.slice(0, -1);
|
|
366
|
+
chart.datasets = chart.datasets.map(dataset => ({
|
|
367
|
+
...dataset,
|
|
368
|
+
data: dataset.data.slice(0, -1)
|
|
369
|
+
}));
|
|
370
|
+
chart.refresh();
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Update data
|
|
374
|
+
function updateData(index, newValue) {
|
|
375
|
+
chart.datasets = chart.datasets.map(dataset => {
|
|
376
|
+
const newData = [...dataset.data];
|
|
377
|
+
newData[index] = newValue;
|
|
378
|
+
return { ...dataset, data: newData };
|
|
379
|
+
});
|
|
380
|
+
chart.refresh();
|
|
381
|
+
}
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Legend Interaction
|
|
385
|
+
|
|
386
|
+
```javascript
|
|
387
|
+
chart.options = {
|
|
388
|
+
legend: {
|
|
389
|
+
position: 'top',
|
|
390
|
+
clickable: true // Allow hiding datasets by clicking legend
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
// Programmatically toggle dataset
|
|
395
|
+
chart.toggleDataset(0); // Hide/show first dataset
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Tooltips
|
|
399
|
+
|
|
400
|
+
```javascript
|
|
401
|
+
chart.options = {
|
|
402
|
+
tooltip: {
|
|
403
|
+
trigger: 'hover', // or 'click', 'none'
|
|
404
|
+
format: (value, datasetIndex, pointIndex) => {
|
|
405
|
+
const dataset = chart.datasets[datasetIndex];
|
|
406
|
+
const label = chart.labels[pointIndex];
|
|
407
|
+
return `${dataset.label} at ${label}: ${value}`;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Export Chart
|
|
414
|
+
|
|
415
|
+
```javascript
|
|
416
|
+
// Export as SVG
|
|
417
|
+
const svg = chart.exportImage('svg');
|
|
418
|
+
console.log(svg);
|
|
419
|
+
|
|
420
|
+
// Download as SVG
|
|
421
|
+
function downloadChart() {
|
|
422
|
+
const svg = chart.exportImage('svg');
|
|
423
|
+
const blob = new Blob([svg], { type: 'image/svg+xml' });
|
|
424
|
+
const url = URL.createObjectURL(blob);
|
|
425
|
+
const a = document.createElement('a');
|
|
426
|
+
a.href = url;
|
|
427
|
+
a.download = 'chart.svg';
|
|
428
|
+
a.click();
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Real-time Data
|
|
433
|
+
|
|
434
|
+
```javascript
|
|
435
|
+
let dataPoints = [10, 20, 30, 40, 50];
|
|
436
|
+
|
|
437
|
+
setInterval(() => {
|
|
438
|
+
// Add new point
|
|
439
|
+
dataPoints.push(Math.random() * 100);
|
|
440
|
+
|
|
441
|
+
// Keep last 20 points
|
|
442
|
+
if (dataPoints.length > 20) {
|
|
443
|
+
dataPoints.shift();
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
chart.datasets = [{
|
|
447
|
+
label: 'Live Data',
|
|
448
|
+
data: dataPoints,
|
|
449
|
+
borderColor: '#2196f3'
|
|
450
|
+
}];
|
|
451
|
+
|
|
452
|
+
chart.labels = dataPoints.map((_, i) => i);
|
|
453
|
+
chart.refresh();
|
|
454
|
+
}, 1000);
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### Responsive Chart
|
|
458
|
+
|
|
459
|
+
```html
|
|
460
|
+
<snice-chart id="responsive-chart"></snice-chart>
|
|
461
|
+
|
|
462
|
+
<script>
|
|
463
|
+
const chart = document.getElementById('responsive-chart');
|
|
464
|
+
|
|
465
|
+
chart.options = {
|
|
466
|
+
responsive: true,
|
|
467
|
+
maintainAspectRatio: true,
|
|
468
|
+
aspectRatio: 2 // 2:1 ratio
|
|
469
|
+
};
|
|
470
|
+
</script>
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Financial Chart
|
|
474
|
+
|
|
475
|
+
```javascript
|
|
476
|
+
// Candlestick-style using bar chart with custom colors
|
|
477
|
+
chart.type = 'bar';
|
|
478
|
+
chart.datasets = [{
|
|
479
|
+
label: 'Stock Price',
|
|
480
|
+
data: [100, 110, 95, 120, 115, 130, 125],
|
|
481
|
+
backgroundColor: [
|
|
482
|
+
'#4caf50', '#4caf50', '#f44336', '#4caf50',
|
|
483
|
+
'#f44336', '#4caf50', '#f44336'
|
|
484
|
+
]
|
|
485
|
+
}];
|
|
486
|
+
chart.labels = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
### Comparison Chart
|
|
490
|
+
|
|
491
|
+
```javascript
|
|
492
|
+
chart.type = 'bar';
|
|
493
|
+
chart.datasets = [
|
|
494
|
+
{
|
|
495
|
+
label: 'Last Year',
|
|
496
|
+
data: [30, 40, 35, 50, 45],
|
|
497
|
+
backgroundColor: '#e0e0e0'
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
label: 'This Year',
|
|
501
|
+
data: [35, 45, 40, 55, 50],
|
|
502
|
+
backgroundColor: '#2196f3'
|
|
503
|
+
}
|
|
504
|
+
];
|
|
505
|
+
chart.labels = ['Q1', 'Q2', 'Q3', 'Q4', 'Q5'];
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
## Accessibility
|
|
509
|
+
|
|
510
|
+
- Keyboard navigation support
|
|
511
|
+
- ARIA labels for chart elements
|
|
512
|
+
- Screen reader friendly data tables
|
|
513
|
+
- High contrast color support
|
|
514
|
+
|
|
515
|
+
## Browser Support
|
|
516
|
+
|
|
517
|
+
- Modern browsers with Custom Elements v1 support
|
|
518
|
+
- SVG rendering support
|
|
519
|
+
- Responsive and touch-friendly
|
|
520
|
+
|
|
521
|
+
## Performance Tips
|
|
522
|
+
|
|
523
|
+
- Limit data points for smooth animations (< 100 points recommended)
|
|
524
|
+
- Disable animations for large datasets
|
|
525
|
+
- Use debouncing for real-time updates
|
|
526
|
+
- Consider data aggregation for time-series data
|