@lostgradient/cinder 0.2.0 → 0.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/CHANGELOG.md +83 -0
- package/README.md +4 -2
- package/components.json +1465 -290
- package/dist/_internal/overlay.d.ts +26 -3
- package/dist/_internal/toast-context.d.ts +8 -0
- package/dist/_internal/tree-context.d.ts +18 -0
- package/dist/_internal/tree-data.d.ts +22 -0
- package/dist/_internal/tree-drag-controller.svelte.d.ts +47 -0
- package/dist/_internal/tree-registry.svelte.d.ts +19 -3
- package/dist/_internal/use-virtualizer.svelte.d.ts +21 -0
- package/dist/_internal/virtual-item.d.ts +1 -0
- package/dist/components/_timeline-item/index.d.ts +4 -0
- package/dist/components/_tree-expand-all/index.d.ts +4 -0
- package/dist/components/_tree-expand-all/tree-expand-all.svelte.d.ts +18 -0
- package/dist/components/_tree-expand-all/tree-expand-all.types.d.ts +15 -0
- package/dist/components/_visually-hidden-live-region.svelte.d.ts +9 -0
- package/dist/components/access-gate/access-gate-inline.svelte.d.ts +13 -0
- package/dist/components/access-gate/access-gate.css +129 -0
- package/dist/components/access-gate/access-gate.schema.js +68 -0
- package/dist/components/access-gate/access-gate.svelte.d.ts +20 -0
- package/dist/components/access-gate/access-gate.types.d.ts +40 -0
- package/dist/components/access-gate/access-gate.variables.js +31 -0
- package/dist/components/access-gate/index.d.ts +5 -0
- package/dist/components/access-gate/index.js +1836 -0
- package/dist/components/accordion/accordion.schema.js +12 -32
- package/dist/components/accordion/accordion.svelte.d.ts +9 -2
- package/dist/components/accordion/accordion.variables.js +1 -31
- package/dist/components/accordion/index.js +1 -31
- package/dist/components/accordion-item/accordion-item.schema.js +12 -32
- package/dist/components/accordion-item/accordion-item.variables.js +1 -31
- package/dist/components/accordion-item/index.js +1 -31
- package/dist/components/alert/alert.schema.js +19 -32
- package/dist/components/alert/alert.variables.js +1 -31
- package/dist/components/alert/index.js +1 -31
- package/dist/components/alert-dialog/alert-dialog.schema.js +17 -39
- package/dist/components/alert-dialog/alert-dialog.types.d.ts +7 -0
- package/dist/components/alert-dialog/alert-dialog.variables.js +1 -31
- package/dist/components/alert-dialog/index.js +453 -238
- package/dist/components/area-chart/area-chart.schema.js +42 -46
- package/dist/components/area-chart/area-chart.types.d.ts +14 -0
- package/dist/components/area-chart/area-chart.variables.js +1 -31
- package/dist/components/area-chart/index.js +1 -31
- package/dist/components/aspect-ratio/aspect-ratio.schema.js +12 -32
- package/dist/components/aspect-ratio/aspect-ratio.variables.js +1 -31
- package/dist/components/aspect-ratio/index.js +1 -31
- package/dist/components/autocomplete/autocomplete.css +10 -3
- package/dist/components/autocomplete/autocomplete.schema.js +29 -45
- package/dist/components/autocomplete/autocomplete.types.d.ts +14 -0
- package/dist/components/autocomplete/autocomplete.variables.js +1 -31
- package/dist/components/autocomplete/index.js +961 -529
- package/dist/components/avatar/avatar.css +1 -0
- package/dist/components/avatar/avatar.schema.js +3 -32
- package/dist/components/avatar/avatar.types.d.ts +6 -0
- package/dist/components/avatar/avatar.variables.js +1 -31
- package/dist/components/avatar/index.js +1 -31
- package/dist/components/avatar-group/avatar-group.schema.js +6 -31
- package/dist/components/avatar-group/avatar-group.types.d.ts +10 -0
- package/dist/components/avatar-group/avatar-group.variables.js +1 -31
- package/dist/components/avatar-group/index.js +994 -559
- package/dist/components/backdrop/backdrop.schema.js +5 -33
- package/dist/components/backdrop/backdrop.variables.js +1 -31
- package/dist/components/backdrop/index.js +2 -32
- package/dist/components/badge/badge.css +1 -1
- package/dist/components/badge/badge.schema.js +12 -32
- package/dist/components/badge/badge.variables.js +1 -31
- package/dist/components/badge/index.js +1 -31
- package/dist/components/banner/banner.schema.js +8 -34
- package/dist/components/banner/banner.variables.js +1 -31
- package/dist/components/banner/index.js +1 -31
- package/dist/components/bar-chart/bar-chart.css +4 -0
- package/dist/components/bar-chart/bar-chart.schema.js +42 -46
- package/dist/components/bar-chart/bar-chart.types.d.ts +14 -0
- package/dist/components/bar-chart/bar-chart.variables.js +1 -31
- package/dist/components/bar-chart/index.js +2 -31
- package/dist/components/breadcrumbs/breadcrumbs.schema.js +1 -31
- package/dist/components/breadcrumbs/breadcrumbs.variables.js +1 -31
- package/dist/components/breadcrumbs/index.js +1 -31
- package/dist/components/button/button.css +7 -0
- package/dist/components/button/button.schema.js +20 -32
- package/dist/components/button/button.variables.js +1 -31
- package/dist/components/button/index.js +1 -31
- package/dist/components/button-group/button-group.schema.js +8 -34
- package/dist/components/button-group/button-group.types.d.ts +2 -0
- package/dist/components/button-group/button-group.variables.js +1 -31
- package/dist/components/button-group/index.js +1 -31
- package/dist/components/callout/callout.schema.js +6 -33
- package/dist/components/callout/callout.variables.js +1 -31
- package/dist/components/callout/index.js +1 -31
- package/dist/components/capability-gate/capability-gate.css +5 -2
- package/dist/components/capability-gate/capability-gate.schema.js +9 -35
- package/dist/components/capability-gate/capability-gate.variables.js +1 -31
- package/dist/components/capability-gate/index.js +1 -31
- package/dist/components/card/card.schema.js +7 -34
- package/dist/components/card/card.types.d.ts +2 -0
- package/dist/components/card/card.variables.js +1 -31
- package/dist/components/card/index.js +1 -31
- package/dist/components/chart.types.d.ts +12 -0
- package/dist/components/chat/adapter/chat-adapter.d.ts +123 -0
- package/dist/components/chat/adapter/index.d.ts +8 -0
- package/dist/components/chat/chat.schema.js +161 -48
- package/dist/components/chat/chat.types.d.ts +166 -0
- package/dist/components/chat/chat.variables.js +1 -31
- package/dist/components/chat/container/chat-history-trigger.svelte.d.ts +15 -0
- package/dist/components/chat/container/chat-participant-typing.svelte.d.ts +31 -0
- package/dist/components/chat/container/chat-status-announcer.svelte.d.ts +4 -1
- package/dist/components/chat/container/chat.svelte.d.ts +2 -85
- package/dist/components/chat/container/use-chat-keyboard-nav.svelte.d.ts +8 -0
- package/dist/components/chat/container/use-chat-message-groups.svelte.d.ts +16 -0
- package/dist/components/chat/container/use-chat-read-receipts.svelte.d.ts +51 -0
- package/dist/components/chat/container/use-chat-reasoning-state.svelte.d.ts +55 -0
- package/dist/components/chat/container/use-chat-typing-indicator.svelte.d.ts +76 -0
- package/dist/components/chat/container/use-chat-virtualizer.svelte.d.ts +47 -0
- package/dist/components/chat/index.d.ts +2 -1
- package/dist/components/chat/index.js +9813 -7207
- package/dist/components/chat/message/chat-message-parts-renderer.svelte.d.ts +4 -0
- package/dist/components/chat/message/chat-message-parts.d.ts +96 -0
- package/dist/components/chat/message/chat-message.svelte.d.ts +37 -0
- package/dist/components/chat/message/chat-read-receipt.svelte.d.ts +27 -0
- package/dist/components/chat/message/parts/image-part.svelte.d.ts +17 -0
- package/dist/components/chat/message/parts/markdown-part.svelte.d.ts +8 -0
- package/dist/components/chat/message/parts/reasoning-part.svelte.d.ts +12 -0
- package/dist/components/chat/message/parts/step-part.svelte.d.ts +8 -0
- package/dist/components/chat/message/parts/suggestion-part.svelte.d.ts +18 -0
- package/dist/components/chat/message/parts/tool-approval-part.svelte.d.ts +12 -0
- package/dist/components/chat/message/parts/tool-call-part.svelte.d.ts +12 -0
- package/dist/components/chat/message/parts/tool-result-part.svelte.d.ts +8 -0
- package/dist/components/chat/utilities/index.d.ts +2 -2
- package/dist/components/chat/utilities/types.d.ts +242 -2
- package/dist/components/chat/utilities/utilities.d.ts +64 -0
- package/dist/components/chat-conversation-header/chat-conversation-header.css +51 -0
- package/dist/components/chat-conversation-header/chat-conversation-header.schema.d.ts +3 -0
- package/dist/components/chat-conversation-header/chat-conversation-header.schema.js +64 -0
- package/dist/components/chat-conversation-header/chat-conversation-header.svelte.d.ts +19 -0
- package/dist/components/chat-conversation-header/chat-conversation-header.types.d.ts +18 -0
- package/dist/components/chat-conversation-header/chat-conversation-header.variables.d.ts +2 -0
- package/dist/components/chat-conversation-header/chat-conversation-header.variables.js +31 -0
- package/dist/components/chat-conversation-header/index.d.ts +5 -0
- package/dist/components/chat-conversation-header/index.js +3825 -0
- package/dist/components/chat-conversation-list/chat-conversation-list.css +114 -0
- package/dist/components/chat-conversation-list/chat-conversation-list.schema.d.ts +3 -0
- package/dist/components/chat-conversation-list/chat-conversation-list.schema.js +75 -0
- package/dist/components/chat-conversation-list/chat-conversation-list.svelte.d.ts +21 -0
- package/dist/components/chat-conversation-list/chat-conversation-list.types.d.ts +17 -0
- package/dist/components/chat-conversation-list/chat-conversation-list.variables.d.ts +2 -0
- package/dist/components/chat-conversation-list/chat-conversation-list.variables.js +31 -0
- package/dist/components/chat-conversation-list/conversation-summary.d.ts +30 -0
- package/dist/components/chat-conversation-list/index.d.ts +6 -0
- package/dist/components/chat-conversation-list/index.js +464 -0
- package/dist/components/checkbox/checkbox.schema.js +3 -32
- package/dist/components/checkbox/checkbox.variables.js +1 -31
- package/dist/components/checkbox/index.js +1 -31
- package/dist/components/checkbox-group/checkbox-group.schema.js +4 -32
- package/dist/components/checkbox-group/checkbox-group.variables.js +1 -31
- package/dist/components/checkbox-group/index.js +1 -31
- package/dist/components/chip/chip.schema.js +19 -40
- package/dist/components/chip/chip.types.d.ts +22 -0
- package/dist/components/chip/chip.variables.js +1 -31
- package/dist/components/chip/index.js +7 -31
- package/dist/components/choice-grid/choice-grid.schema.js +6 -33
- package/dist/components/choice-grid/choice-grid.variables.js +1 -31
- package/dist/components/choice-grid/index.js +1 -31
- package/dist/components/choice-grid-item/choice-grid-item.schema.js +4 -32
- package/dist/components/choice-grid-item/choice-grid-item.variables.js +1 -31
- package/dist/components/choice-grid-item/index.js +1 -31
- package/dist/components/click-away-listener/click-away-listener.schema.js +9 -33
- package/dist/components/click-away-listener/click-away-listener.variables.js +1 -31
- package/dist/components/click-away-listener/index.js +1 -31
- package/dist/components/code-block/code-block.css +77 -47
- package/dist/components/code-block/code-block.schema.js +4 -33
- package/dist/components/code-block/code-block.types.d.ts +9 -6
- package/dist/components/code-block/code-block.variables.js +1 -31
- package/dist/components/code-block/index.js +24 -42
- package/dist/components/collapsible/collapsible.schema.js +17 -32
- package/dist/components/collapsible/collapsible.variables.js +1 -31
- package/dist/components/collapsible/index.js +1 -31
- package/dist/components/color-field/color-field.schema.js +3 -32
- package/dist/components/color-field/color-field.variables.js +1 -31
- package/dist/components/color-field/index.js +1 -31
- package/dist/components/color-picker/color-picker.schema.js +5 -33
- package/dist/components/color-picker/color-picker.variables.js +1 -31
- package/dist/components/color-picker/index.js +1 -31
- package/dist/components/color-swatch-picker/color-swatch-picker.schema.js +9 -34
- package/dist/components/color-swatch-picker/color-swatch-picker.variables.js +1 -31
- package/dist/components/color-swatch-picker/index.js +1 -31
- package/dist/components/combobox/combobox.schema.js +10 -34
- package/dist/components/combobox/combobox.variables.js +1 -31
- package/dist/components/combobox/index.js +970 -511
- package/dist/components/command-item/command-item.schema.js +10 -35
- package/dist/components/command-item/command-item.variables.js +1 -31
- package/dist/components/command-item/index.js +1 -31
- package/dist/components/command-menu/command-menu.schema.js +15 -37
- package/dist/components/command-menu/command-menu.variables.js +1 -31
- package/dist/components/command-menu/index.js +962 -531
- package/dist/components/command-palette/command-palette.css +26 -12
- package/dist/components/command-palette/command-palette.schema.js +12 -36
- package/dist/components/command-palette/command-palette.variables.js +1 -31
- package/dist/components/command-palette/index.js +2 -32
- package/dist/components/confirm-dialog/confirm-dialog.schema.js +11 -34
- package/dist/components/confirm-dialog/confirm-dialog.variables.js +1 -31
- package/dist/components/confirm-dialog/index.js +455 -240
- package/dist/components/connection-indicator/connection-indicator.schema.js +1 -31
- package/dist/components/connection-indicator/connection-indicator.variables.js +1 -31
- package/dist/components/connection-indicator/index.js +1 -31
- package/dist/components/container/container.schema.js +12 -32
- package/dist/components/container/container.variables.js +1 -31
- package/dist/components/container/index.js +1 -31
- package/dist/components/context-menu/context-menu.context.d.ts +2 -0
- package/dist/components/context-menu/context-menu.schema.js +13 -37
- package/dist/components/context-menu/context-menu.types.d.ts +5 -0
- package/dist/components/context-menu/context-menu.variables.js +1 -31
- package/dist/components/context-menu/index.js +2111 -1670
- package/dist/components/context-menu-trigger/context-menu-trigger.schema.js +5 -33
- package/dist/components/context-menu-trigger/context-menu-trigger.types.d.ts +1 -0
- package/dist/components/context-menu-trigger/context-menu-trigger.variables.js +1 -31
- package/dist/components/context-menu-trigger/index.js +7 -31
- package/dist/components/copy-button/copy-button.schema.js +5 -33
- package/dist/components/copy-button/copy-button.variables.js +1 -31
- package/dist/components/copy-button/index.js +5 -32
- package/dist/components/data-grid/_internal/column-model.svelte.d.ts +43 -0
- package/dist/components/data-grid/_internal/geometry.d.ts +19 -0
- package/dist/components/data-grid/_internal/keyboard-model.d.ts +22 -0
- package/dist/components/data-grid/_internal/selection-model.svelte.d.ts +28 -0
- package/dist/components/data-grid/_internal/sort-model.d.ts +6 -0
- package/dist/components/data-grid/_internal/virtualization-adapter.svelte.d.ts +44 -0
- package/dist/components/data-grid/data-grid-selection-bind-probe.d.ts +4 -0
- package/dist/components/data-grid/data-grid.css +283 -0
- package/dist/components/data-grid/data-grid.schema.d.ts +3 -0
- package/dist/components/data-grid/data-grid.schema.js +136 -0
- package/dist/components/data-grid/data-grid.svelte.d.ts +40 -0
- package/dist/components/data-grid/data-grid.types.d.ts +102 -0
- package/dist/components/data-grid/data-grid.variables.d.ts +2 -0
- package/dist/components/data-grid/data-grid.variables.js +31 -0
- package/dist/components/data-grid/index.d.ts +5 -0
- package/dist/components/data-grid/index.js +3088 -0
- package/dist/components/data-list/data-list.schema.js +24 -36
- package/dist/components/data-list/data-list.types.d.ts +1 -0
- package/dist/components/data-list/data-list.variables.js +1 -31
- package/dist/components/data-list/index.js +1 -31
- package/dist/components/data-table/data-table.css +25 -0
- package/dist/components/data-table/data-table.schema.js +35 -34
- package/dist/components/data-table/data-table.types.d.ts +31 -1
- package/dist/components/data-table/data-table.variables.js +2 -32
- package/dist/components/data-table/index.js +458 -123
- package/dist/components/date-range-field/date-range-field.css +211 -0
- package/dist/components/date-range-field/date-range-field.schema.d.ts +3 -0
- package/dist/components/date-range-field/date-range-field.schema.js +95 -0
- package/dist/components/date-range-field/date-range-field.svelte.d.ts +19 -0
- package/dist/components/date-range-field/date-range-field.types.d.ts +72 -0
- package/dist/components/date-range-field/date-range-field.variables.d.ts +2 -0
- package/dist/components/date-range-field/date-range-field.variables.js +31 -0
- package/dist/components/date-range-field/index.d.ts +5 -0
- package/dist/components/date-range-field/index.js +297 -0
- package/dist/components/description-list/description-list.schema.js +7 -34
- package/dist/components/description-list/description-list.types.d.ts +1 -0
- package/dist/components/description-list/description-list.variables.js +1 -31
- package/dist/components/description-list/index.js +1 -31
- package/dist/components/diff-statistics/diff-statistics.schema.js +2 -32
- package/dist/components/diff-statistics/diff-statistics.types.d.ts +5 -2
- package/dist/components/diff-statistics/diff-statistics.variables.js +1 -31
- package/dist/components/diff-statistics/index.js +1 -31
- package/dist/components/diff-viewer/diff-viewer.schema.js +15 -36
- package/dist/components/diff-viewer/diff-viewer.variables.js +1 -31
- package/dist/components/diff-viewer/index.js +1 -31
- package/dist/components/divider/divider.schema.js +1 -31
- package/dist/components/divider/divider.svelte.d.ts +1 -1
- package/dist/components/divider/divider.variables.js +1 -31
- package/dist/components/divider/index.js +1 -31
- package/dist/components/drawer/drawer.schema.js +12 -35
- package/dist/components/drawer/drawer.variables.js +1 -31
- package/dist/components/drawer/index.js +382 -180
- package/dist/components/dropdown/dropdown.schema.js +9 -35
- package/dist/components/dropdown/dropdown.types.d.ts +4 -0
- package/dist/components/dropdown/dropdown.variables.js +1 -31
- package/dist/components/dropdown/index.js +1258 -827
- package/dist/components/dropdown-group/dropdown-group.schema.js +7 -34
- package/dist/components/dropdown-group/dropdown-group.types.d.ts +2 -0
- package/dist/components/dropdown-group/dropdown-group.variables.js +1 -31
- package/dist/components/dropdown-group/index.js +1 -31
- package/dist/components/dropdown-item/dropdown-item.schema.js +9 -35
- package/dist/components/dropdown-item/dropdown-item.types.d.ts +4 -0
- package/dist/components/dropdown-item/dropdown-item.variables.js +1 -31
- package/dist/components/dropdown-item/index.js +1 -31
- package/dist/components/dropdown-label/dropdown-label.schema.js +3 -32
- package/dist/components/dropdown-label/dropdown-label.types.d.ts +1 -0
- package/dist/components/dropdown-label/dropdown-label.variables.js +1 -31
- package/dist/components/dropdown-label/index.js +1 -31
- package/dist/components/dropdown-menu/dropdown-menu.schema.js +3 -32
- package/dist/components/dropdown-menu/dropdown-menu.types.d.ts +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.variables.js +1 -31
- package/dist/components/dropdown-menu/index.js +786 -355
- package/dist/components/dropdown-separator/dropdown-separator.schema.js +3 -32
- package/dist/components/dropdown-separator/dropdown-separator.types.d.ts +1 -0
- package/dist/components/dropdown-separator/dropdown-separator.variables.js +1 -31
- package/dist/components/dropdown-separator/index.js +1 -31
- package/dist/components/dropdown-trigger/dropdown-trigger.schema.js +3 -32
- package/dist/components/dropdown-trigger/dropdown-trigger.types.d.ts +1 -0
- package/dist/components/dropdown-trigger/dropdown-trigger.variables.js +1 -31
- package/dist/components/dropdown-trigger/index.js +1 -31
- package/dist/components/empty-state/empty-state.schema.js +7 -34
- package/dist/components/empty-state/empty-state.types.d.ts +3 -0
- package/dist/components/empty-state/empty-state.variables.js +1 -31
- package/dist/components/empty-state/index.js +1 -31
- package/dist/components/event-stream-viewer/event-stream-viewer.css +474 -0
- package/dist/components/event-stream-viewer/event-stream-viewer.schema.d.ts +3 -0
- package/dist/components/event-stream-viewer/event-stream-viewer.schema.js +92 -0
- package/dist/components/event-stream-viewer/event-stream-viewer.svelte.d.ts +19 -0
- package/dist/components/event-stream-viewer/event-stream-viewer.types.d.ts +81 -0
- package/dist/components/event-stream-viewer/event-stream-viewer.variables.d.ts +2 -0
- package/dist/components/event-stream-viewer/event-stream-viewer.variables.js +31 -0
- package/dist/components/event-stream-viewer/index.d.ts +5 -0
- package/dist/components/event-stream-viewer/index.js +1036 -0
- package/dist/components/experimental/connection-indicator/index.js +1 -31
- package/dist/components/experimental/json-viewer/index.js +1 -31
- package/dist/components/experimental/message/index.js +1 -31
- package/dist/components/faceted-filter-bar/faceted-filter-bar.css +121 -0
- package/dist/components/faceted-filter-bar/faceted-filter-bar.schema.d.ts +3 -0
- package/dist/components/faceted-filter-bar/faceted-filter-bar.schema.js +97 -0
- package/dist/components/faceted-filter-bar/faceted-filter-bar.svelte.d.ts +18 -0
- package/dist/components/faceted-filter-bar/faceted-filter-bar.types.d.ts +95 -0
- package/dist/components/faceted-filter-bar/faceted-filter-bar.variables.d.ts +2 -0
- package/dist/components/faceted-filter-bar/faceted-filter-bar.variables.js +31 -0
- package/dist/components/faceted-filter-bar/index.d.ts +5 -0
- package/dist/components/faceted-filter-bar/index.js +1062 -0
- package/dist/components/feed/feed.schema.js +6 -33
- package/dist/components/feed/feed.types.d.ts +1 -0
- package/dist/components/feed/feed.variables.js +1 -31
- package/dist/components/feed/index.js +1 -31
- package/dist/components/feed-event/feed-event.schema.js +16 -35
- package/dist/components/feed-event/feed-event.types.d.ts +1 -0
- package/dist/components/feed-event/feed-event.variables.js +1 -31
- package/dist/components/feed-event/index.js +1 -31
- package/dist/components/file-upload/file-upload.schema.js +15 -38
- package/dist/components/file-upload/file-upload.variables.js +1 -31
- package/dist/components/file-upload/index.js +1 -31
- package/dist/components/floating-action-button/floating-action-button.css +3 -1
- package/dist/components/floating-action-button/floating-action-button.schema.js +11 -32
- package/dist/components/floating-action-button/floating-action-button.variables.js +1 -31
- package/dist/components/floating-action-button/index.js +1 -31
- package/dist/components/focus-trap/focus-trap.schema.js +21 -37
- package/dist/components/focus-trap/focus-trap.types.d.ts +5 -0
- package/dist/components/focus-trap/focus-trap.utilities.svelte.d.ts +14 -0
- package/dist/components/focus-trap/focus-trap.variables.js +1 -31
- package/dist/components/focus-trap/index.js +6 -33
- package/dist/components/form-field/form-field.schema.js +4 -32
- package/dist/components/form-field/form-field.variables.js +1 -31
- package/dist/components/form-field/index.js +1 -31
- package/dist/components/form-section/form-section.schema.js +4 -32
- package/dist/components/form-section/form-section.variables.js +1 -31
- package/dist/components/form-section/index.js +1 -31
- package/dist/components/grid/grid.css +24 -0
- package/dist/components/grid/grid.schema.d.ts +3 -0
- package/dist/components/grid/grid.schema.js +83 -0
- package/dist/components/grid/grid.svelte.d.ts +18 -0
- package/dist/components/grid/grid.types.d.ts +29 -0
- package/dist/components/grid/grid.variables.d.ts +2 -0
- package/dist/components/grid/grid.variables.js +31 -0
- package/dist/components/grid/index.d.ts +13 -0
- package/dist/components/grid/index.js +147 -0
- package/dist/components/grid-item/grid-item.schema.d.ts +3 -0
- package/dist/components/grid-item/grid-item.schema.js +110 -0
- package/dist/components/grid-item/grid-item.svelte.d.ts +16 -0
- package/dist/components/grid-item/grid-item.types.d.ts +21 -0
- package/dist/components/grid-item/grid-item.variables.d.ts +2 -0
- package/dist/components/grid-item/grid-item.variables.js +31 -0
- package/dist/components/grid-item/index.d.ts +4 -0
- package/dist/components/grid-item/index.js +87 -0
- package/dist/components/grid-list/grid-list.schema.js +6 -33
- package/dist/components/grid-list/grid-list.variables.js +1 -31
- package/dist/components/grid-list/index.js +1 -31
- package/dist/components/grid-list-item/grid-list-item.schema.js +19 -40
- package/dist/components/grid-list-item/grid-list-item.types.d.ts +3 -0
- package/dist/components/grid-list-item/grid-list-item.variables.js +1 -31
- package/dist/components/grid-list-item/index.js +1 -31
- package/dist/components/hover-card/hover-card.schema.js +21 -41
- package/dist/components/hover-card/hover-card.types.d.ts +8 -0
- package/dist/components/hover-card/hover-card.variables.js +1 -31
- package/dist/components/hover-card/index.js +789 -358
- package/dist/components/image/image.schema.js +9 -35
- package/dist/components/image/image.variables.js +1 -31
- package/dist/components/image/index.js +1 -31
- package/dist/components/input/index.js +1 -31
- package/dist/components/input/input.schema.js +22 -41
- package/dist/components/input/input.types.d.ts +12 -0
- package/dist/components/input/input.variables.js +1 -31
- package/dist/components/invocation-rule-builder/index.d.ts +5 -0
- package/dist/components/invocation-rule-builder/index.js +526 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.css +281 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.d.ts +3 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.schema.js +101 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.svelte.d.ts +16 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.types.d.ts +147 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.variables.d.ts +2 -0
- package/dist/components/invocation-rule-builder/invocation-rule-builder.variables.js +31 -0
- package/dist/components/json-schema-editor/index.js +5328 -12274
- package/dist/components/json-schema-editor/json-schema-editor.schema.js +8 -34
- package/dist/components/json-schema-editor/json-schema-editor.types.d.ts +1 -0
- package/dist/components/json-schema-editor/json-schema-editor.variables.js +1 -31
- package/dist/components/json-viewer/index.js +5 -35
- package/dist/components/json-viewer/json-viewer.css +6 -0
- package/dist/components/json-viewer/json-viewer.schema.js +4 -32
- package/dist/components/json-viewer/json-viewer.variables.js +1 -31
- package/dist/components/kanban-board/index.js +1 -31
- package/dist/components/kanban-board/kanban-board.schema.js +19 -40
- package/dist/components/kanban-board/kanban-board.types.d.ts +4 -0
- package/dist/components/kanban-board/kanban-board.variables.js +1 -31
- package/dist/components/kbd/index.js +1 -31
- package/dist/components/kbd/kbd.schema.js +11 -32
- package/dist/components/kbd/kbd.variables.js +1 -31
- package/dist/components/keyboard-shortcuts/index.js +1 -31
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.schema.js +6 -33
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.variables.js +1 -31
- package/dist/components/label/index.js +1 -31
- package/dist/components/label/label.schema.js +6 -33
- package/dist/components/label/label.variables.js +1 -31
- package/dist/components/line-chart/index.js +1 -31
- package/dist/components/line-chart/line-chart.schema.js +40 -45
- package/dist/components/line-chart/line-chart.types.d.ts +13 -0
- package/dist/components/line-chart/line-chart.variables.js +1 -31
- package/dist/components/link/index.js +1 -31
- package/dist/components/link/link.schema.js +6 -33
- package/dist/components/link/link.variables.js +1 -31
- package/dist/components/load-more/index.js +3 -32
- package/dist/components/load-more/load-more.schema.js +10 -34
- package/dist/components/load-more/load-more.variables.js +1 -31
- package/dist/components/markdown-editor/index.js +3484 -3050
- package/dist/components/markdown-editor/markdown-editor.schema.js +29 -42
- package/dist/components/markdown-editor/markdown-editor.variables.js +1 -31
- package/dist/components/masonry/index.d.ts +5 -0
- package/dist/components/masonry/index.js +76 -0
- package/dist/components/masonry/masonry.css +12 -0
- package/dist/components/masonry/masonry.schema.d.ts +3 -0
- package/dist/components/masonry/masonry.schema.js +63 -0
- package/dist/components/masonry/masonry.svelte.d.ts +17 -0
- package/dist/components/masonry/masonry.types.d.ts +15 -0
- package/dist/components/masonry/masonry.variables.d.ts +2 -0
- package/dist/components/masonry/masonry.variables.js +31 -0
- package/dist/components/matrix-chart/index.js +9 -32
- package/dist/components/matrix-chart/matrix-chart.css +4 -0
- package/dist/components/matrix-chart/matrix-chart.schema.js +42 -45
- package/dist/components/matrix-chart/matrix-chart.types.d.ts +14 -1
- package/dist/components/matrix-chart/matrix-chart.variables.js +1 -31
- package/dist/components/media-controls/index.js +3 -32
- package/dist/components/media-controls/media-controls.schema.js +7 -34
- package/dist/components/media-controls/media-controls.variables.js +1 -31
- package/dist/components/menu-bar/index.js +1 -31
- package/dist/components/menu-bar/menu-bar.schema.js +11 -36
- package/dist/components/menu-bar/menu-bar.types.d.ts +4 -0
- package/dist/components/menu-bar/menu-bar.variables.js +1 -31
- package/dist/components/message/index.js +1 -31
- package/dist/components/message/message.schema.js +4 -32
- package/dist/components/message/message.variables.js +1 -31
- package/dist/components/modal/index.js +333 -118
- package/dist/components/modal/modal.schema.js +19 -40
- package/dist/components/modal/modal.types.d.ts +8 -0
- package/dist/components/modal/modal.variables.js +1 -31
- package/dist/components/navigation-bar/index.d.ts +1 -1
- package/dist/components/navigation-bar/index.js +19 -38
- package/dist/components/navigation-bar/navigation-bar.css +66 -0
- package/dist/components/navigation-bar/navigation-bar.schema.js +16 -33
- package/dist/components/navigation-bar/navigation-bar.svelte.d.ts +1 -1
- package/dist/components/navigation-bar/navigation-bar.types.d.ts +18 -0
- package/dist/components/navigation-bar/navigation-bar.variables.js +1 -31
- package/dist/components/navigation-item/index.js +1 -31
- package/dist/components/navigation-item/navigation-item.schema.js +16 -37
- package/dist/components/navigation-item/navigation-item.types.d.ts +4 -0
- package/dist/components/navigation-item/navigation-item.variables.js +1 -31
- package/dist/components/number-input/index.js +1 -31
- package/dist/components/number-input/number-input.schema.js +27 -44
- package/dist/components/number-input/number-input.types.d.ts +13 -0
- package/dist/components/number-input/number-input.variables.js +1 -31
- package/dist/components/pagination/index.js +1 -31
- package/dist/components/pagination/pagination.css +0 -1
- package/dist/components/pagination/pagination.schema.js +1 -31
- package/dist/components/pagination/pagination.variables.js +1 -31
- package/dist/components/payload-inspector/index.d.ts +5 -0
- package/dist/components/payload-inspector/index.js +2002 -0
- package/dist/components/payload-inspector/payload-inspector.css +173 -0
- package/dist/components/payload-inspector/payload-inspector.schema.d.ts +3 -0
- package/dist/components/payload-inspector/payload-inspector.schema.js +95 -0
- package/dist/components/payload-inspector/payload-inspector.svelte.d.ts +19 -0
- package/dist/components/payload-inspector/payload-inspector.types.d.ts +69 -0
- package/dist/components/payload-inspector/payload-inspector.variables.d.ts +2 -0
- package/dist/components/payload-inspector/payload-inspector.variables.js +31 -0
- package/dist/components/permission-matrix/index.d.ts +5 -0
- package/dist/components/permission-matrix/index.js +474 -0
- package/dist/components/permission-matrix/permission-matrix.css +165 -0
- package/dist/components/permission-matrix/permission-matrix.schema.d.ts +3 -0
- package/dist/components/permission-matrix/permission-matrix.schema.js +100 -0
- package/dist/components/permission-matrix/permission-matrix.svelte.d.ts +20 -0
- package/dist/components/permission-matrix/permission-matrix.types.d.ts +58 -0
- package/dist/components/permission-matrix/permission-matrix.variables.d.ts +2 -0
- package/dist/components/permission-matrix/permission-matrix.variables.js +31 -0
- package/dist/components/phone-input/index.js +1 -31
- package/dist/components/phone-input/phone-input.schema.js +3 -32
- package/dist/components/phone-input/phone-input.variables.js +1 -31
- package/dist/components/pin-input/index.js +1 -31
- package/dist/components/pin-input/pin-input.schema.js +6 -33
- package/dist/components/pin-input/pin-input.variables.js +1 -31
- package/dist/components/popover/index.js +793 -362
- package/dist/components/popover/popover.schema.js +12 -34
- package/dist/components/popover/popover.types.d.ts +6 -0
- package/dist/components/popover/popover.variables.js +1 -31
- package/dist/components/portal/index.js +1 -31
- package/dist/components/portal/portal.schema.js +19 -36
- package/dist/components/portal/portal.types.d.ts +4 -0
- package/dist/components/portal/portal.variables.js +1 -31
- package/dist/components/pricing-card/index.js +1 -31
- package/dist/components/pricing-card/pricing-card.css +11 -3
- package/dist/components/pricing-card/pricing-card.schema.js +12 -32
- package/dist/components/pricing-card/pricing-card.variables.js +1 -31
- package/dist/components/progress/index.js +1 -31
- package/dist/components/progress/progress.schema.js +1 -31
- package/dist/components/progress/progress.variables.js +1 -31
- package/dist/components/radio-group/index.js +1 -31
- package/dist/components/radio-group/radio-group.schema.js +4 -32
- package/dist/components/radio-group/radio-group.variables.js +1 -31
- package/dist/components/rating/index.js +1 -31
- package/dist/components/rating/rating.schema.js +4 -32
- package/dist/components/rating/rating.variables.js +1 -31
- package/dist/components/resizable-panels/index.js +1 -31
- package/dist/components/resizable-panels/resizable-panels.schema.js +13 -37
- package/dist/components/resizable-panels/resizable-panels.types.d.ts +4 -0
- package/dist/components/resizable-panels/resizable-panels.variables.js +1 -31
- package/dist/components/review-editor/index.d.ts +1 -1
- package/dist/components/review-editor/index.js +3700 -3262
- package/dist/components/review-editor/review-editor-selection-geometry.d.ts +2 -0
- package/dist/components/review-editor/review-editor-selection-types.d.ts +62 -0
- package/dist/components/review-editor/review-editor-selection.svelte.d.ts +1 -58
- package/dist/components/review-editor/review-editor.schema.js +15 -38
- package/dist/components/review-editor/review-editor.variables.js +1 -31
- package/dist/components/run-step-timeline/index.d.ts +5 -0
- package/dist/components/run-step-timeline/index.js +658 -0
- package/dist/components/run-step-timeline/run-step-timeline.css +215 -0
- package/dist/components/run-step-timeline/run-step-timeline.schema.d.ts +3 -0
- package/dist/components/run-step-timeline/run-step-timeline.schema.js +129 -0
- package/dist/components/run-step-timeline/run-step-timeline.svelte.d.ts +19 -0
- package/dist/components/run-step-timeline/run-step-timeline.types.d.ts +111 -0
- package/dist/components/run-step-timeline/run-step-timeline.variables.d.ts +2 -0
- package/dist/components/run-step-timeline/run-step-timeline.variables.js +31 -0
- package/dist/components/schema-form/index.d.ts +6 -0
- package/dist/components/schema-form/index.js +1164 -0
- package/dist/components/schema-form/schema-form-model.d.ts +46 -0
- package/dist/components/schema-form/schema-form-validation.d.ts +33 -0
- package/dist/components/schema-form/schema-form.css +180 -0
- package/dist/components/schema-form/schema-form.schema.d.ts +3 -0
- package/dist/components/schema-form/schema-form.schema.js +69 -0
- package/dist/components/schema-form/schema-form.svelte.d.ts +43 -0
- package/dist/components/schema-form/schema-form.types.d.ts +22 -0
- package/dist/components/schema-form/schema-form.variables.d.ts +2 -0
- package/dist/components/schema-form/schema-form.variables.js +31 -0
- package/dist/components/scroll-area/index.js +1 -31
- package/dist/components/scroll-area/scroll-area.schema.js +4 -32
- package/dist/components/scroll-area/scroll-area.variables.js +1 -31
- package/dist/components/search-field/index.js +1 -31
- package/dist/components/search-field/search-field.schema.js +9 -35
- package/dist/components/search-field/search-field.variables.js +1 -31
- package/dist/components/secret-value-field/index.d.ts +5 -0
- package/dist/components/secret-value-field/index.js +316 -0
- package/dist/components/secret-value-field/secret-value-field.css +147 -0
- package/dist/components/secret-value-field/secret-value-field.schema.d.ts +3 -0
- package/dist/components/secret-value-field/secret-value-field.schema.js +87 -0
- package/dist/components/secret-value-field/secret-value-field.svelte.d.ts +18 -0
- package/dist/components/secret-value-field/secret-value-field.types.d.ts +37 -0
- package/dist/components/secret-value-field/secret-value-field.variables.d.ts +2 -0
- package/dist/components/secret-value-field/secret-value-field.variables.js +31 -0
- package/dist/components/section-heading/index.js +1 -31
- package/dist/components/section-heading/section-heading.schema.js +8 -34
- package/dist/components/section-heading/section-heading.variables.js +1 -31
- package/dist/components/segment/index.js +1 -31
- package/dist/components/segment/segment.schema.js +11 -35
- package/dist/components/segment/segment.variables.js +1 -31
- package/dist/components/segmented-control/index.js +1 -31
- package/dist/components/segmented-control/segmented-control.css +17 -0
- package/dist/components/segmented-control/segmented-control.schema.js +10 -35
- package/dist/components/segmented-control/segmented-control.types.d.ts +2 -0
- package/dist/components/segmented-control/segmented-control.variables.js +1 -31
- package/dist/components/select/index.js +1 -31
- package/dist/components/select/select.schema.js +8 -34
- package/dist/components/select/select.variables.js +1 -31
- package/dist/components/selection-popover/index.js +793 -361
- package/dist/components/selection-popover/selection-popover.schema.js +12 -36
- package/dist/components/selection-popover/selection-popover.types.d.ts +8 -0
- package/dist/components/selection-popover/selection-popover.variables.js +1 -31
- package/dist/components/share-card/index.js +159 -174
- package/dist/components/share-card/share-card.schema.js +5 -33
- package/dist/components/share-card/share-card.variables.js +1 -31
- package/dist/components/sheet/index.js +387 -172
- package/dist/components/sheet/sheet.schema.js +12 -35
- package/dist/components/sheet/sheet.variables.js +1 -31
- package/dist/components/shortcut-hint/index.js +1 -31
- package/dist/components/shortcut-hint/shortcut-hint.schema.js +3 -32
- package/dist/components/shortcut-hint/shortcut-hint.variables.js +1 -31
- package/dist/components/side-navigation/index.d.ts +1 -1
- package/dist/components/side-navigation/index.js +1 -31
- package/dist/components/side-navigation/side-navigation.schema.js +6 -33
- package/dist/components/side-navigation/side-navigation.variables.js +1 -31
- package/dist/components/side-navigation-group/index.js +1 -31
- package/dist/components/side-navigation-group/side-navigation-group.schema.js +10 -35
- package/dist/components/side-navigation-group/side-navigation-group.variables.js +1 -31
- package/dist/components/side-navigation-item/index.js +1 -31
- package/dist/components/side-navigation-item/side-navigation-item.schema.js +16 -37
- package/dist/components/side-navigation-item/side-navigation-item.variables.js +1 -31
- package/dist/components/sidebar/index.js +448 -246
- package/dist/components/sidebar/sidebar.schema.js +7 -34
- package/dist/components/sidebar/sidebar.variables.js +1 -31
- package/dist/components/skeleton/index.js +1 -31
- package/dist/components/skeleton/skeleton.schema.js +9 -35
- package/dist/components/skeleton/skeleton.types.d.ts +4 -0
- package/dist/components/skeleton/skeleton.variables.js +1 -31
- package/dist/components/skip-link/index.js +1 -31
- package/dist/components/skip-link/skip-link.schema.js +11 -32
- package/dist/components/skip-link/skip-link.variables.js +1 -31
- package/dist/components/slider/index.js +1 -31
- package/dist/components/slider/slider.schema.js +5 -33
- package/dist/components/slider/slider.types.d.ts +2 -0
- package/dist/components/slider/slider.variables.js +1 -31
- package/dist/components/sortable-list/index.js +1 -31
- package/dist/components/sortable-list/sortable-list.schema.js +27 -40
- package/dist/components/sortable-list/sortable-list.types.d.ts +1 -0
- package/dist/components/sortable-list/sortable-list.variables.js +1 -31
- package/dist/components/spectrogram/index.js +1 -31
- package/dist/components/spectrogram/spectrogram.css +2 -1
- package/dist/components/spectrogram/spectrogram.schema.js +51 -42
- package/dist/components/spectrogram/spectrogram.types.d.ts +12 -1
- package/dist/components/spectrogram/spectrogram.variables.js +1 -31
- package/dist/components/spectrum-chart/index.js +1 -31
- package/dist/components/spectrum-chart/spectrum-chart.schema.js +43 -41
- package/dist/components/spectrum-chart/spectrum-chart.types.d.ts +9 -0
- package/dist/components/spectrum-chart/spectrum-chart.variables.js +1 -31
- package/dist/components/speed-dial/index.d.ts +13 -0
- package/dist/components/speed-dial/index.js +529 -0
- package/dist/components/speed-dial/speed-dial.context.d.ts +5 -0
- package/dist/components/speed-dial/speed-dial.css +112 -0
- package/dist/components/speed-dial/speed-dial.schema.d.ts +3 -0
- package/dist/components/speed-dial/speed-dial.schema.js +76 -0
- package/dist/components/speed-dial/speed-dial.svelte.d.ts +17 -0
- package/dist/components/speed-dial/speed-dial.types.d.ts +54 -0
- package/dist/components/speed-dial/speed-dial.variables.d.ts +2 -0
- package/dist/components/speed-dial/speed-dial.variables.js +31 -0
- package/dist/components/speed-dial-action/index.d.ts +4 -0
- package/dist/components/speed-dial-action/index.js +264 -0
- package/dist/components/speed-dial-action/speed-dial-action.schema.d.ts +3 -0
- package/dist/components/speed-dial-action/speed-dial-action.schema.js +71 -0
- package/dist/components/speed-dial-action/speed-dial-action.svelte.d.ts +16 -0
- package/dist/components/speed-dial-action/speed-dial-action.types.d.ts +44 -0
- package/dist/components/speed-dial-action/speed-dial-action.variables.d.ts +2 -0
- package/dist/components/speed-dial-action/speed-dial-action.variables.js +31 -0
- package/dist/components/spinner/index.js +1 -31
- package/dist/components/spinner/spinner.schema.js +1 -31
- package/dist/components/spinner/spinner.variables.js +1 -31
- package/dist/components/stacked-list-item/index.js +1 -31
- package/dist/components/stacked-list-item/stacked-list-item.schema.js +20 -40
- package/dist/components/stacked-list-item/stacked-list-item.types.d.ts +4 -0
- package/dist/components/stacked-list-item/stacked-list-item.variables.js +1 -31
- package/dist/components/stat/index.js +1 -31
- package/dist/components/stat/stat.schema.js +7 -34
- package/dist/components/stat/stat.variables.js +1 -31
- package/dist/components/stat-group/index.js +1 -31
- package/dist/components/stat-group/stat-group.schema.js +4 -32
- package/dist/components/stat-group/stat-group.variables.js +1 -31
- package/dist/components/status-dot/index.js +1 -31
- package/dist/components/status-dot/status-dot.css +1 -1
- package/dist/components/status-dot/status-dot.schema.js +1 -31
- package/dist/components/status-dot/status-dot.variables.js +1 -31
- package/dist/components/steps/index.js +1 -31
- package/dist/components/steps/steps.css +30 -10
- package/dist/components/steps/steps.schema.js +4 -32
- package/dist/components/steps/steps.variables.js +1 -31
- package/dist/components/subscription-badge/index.js +2 -32
- package/dist/components/subscription-badge/subscription-badge.schema.js +1 -31
- package/dist/components/subscription-badge/subscription-badge.variables.js +1 -31
- package/dist/components/surface/index.js +1 -31
- package/dist/components/surface/surface.schema.js +11 -32
- package/dist/components/surface/surface.types.d.ts +1 -0
- package/dist/components/surface/surface.variables.js +1 -31
- package/dist/components/tab/index.js +1 -31
- package/dist/components/tab/tab.schema.js +6 -33
- package/dist/components/tab/tab.variables.js +1 -31
- package/dist/components/tab-list/index.js +1 -31
- package/dist/components/tab-list/tab-list.schema.js +4 -32
- package/dist/components/tab-list/tab-list.variables.js +1 -31
- package/dist/components/tab-panel/index.js +1 -31
- package/dist/components/tab-panel/tab-panel.schema.js +4 -32
- package/dist/components/tab-panel/tab-panel.variables.js +1 -31
- package/dist/components/table/index.js +94 -53
- package/dist/components/table/table.css +23 -4
- package/dist/components/table/table.schema.js +6 -33
- package/dist/components/table/table.types.d.ts +2 -1
- package/dist/components/table/table.variables.js +1 -31
- package/dist/components/table-body/index.js +1 -31
- package/dist/components/table-body/table-body.schema.js +4 -32
- package/dist/components/table-body/table-body.variables.js +1 -31
- package/dist/components/table-cell/index.js +1 -31
- package/dist/components/table-cell/table-cell.schema.js +11 -33
- package/dist/components/table-cell/table-cell.types.d.ts +4 -7
- package/dist/components/table-cell/table-cell.variables.js +1 -31
- package/dist/components/table-header/index.js +1 -31
- package/dist/components/table-header/table-header.schema.js +6 -33
- package/dist/components/table-header/table-header.variables.js +1 -31
- package/dist/components/table-header-cell/index.js +1 -31
- package/dist/components/table-header-cell/table-header-cell.schema.js +4 -32
- package/dist/components/table-header-cell/table-header-cell.variables.js +1 -31
- package/dist/components/table-row/index.js +13 -32
- package/dist/components/table-row/table-row.schema.js +8 -34
- package/dist/components/table-row/table-row.types.d.ts +4 -1
- package/dist/components/table-row/table-row.variables.js +1 -31
- package/dist/components/tabs/index.js +1 -31
- package/dist/components/tabs/tabs.css +1 -1
- package/dist/components/tabs/tabs.schema.js +4 -32
- package/dist/components/tabs/tabs.variables.js +1 -31
- package/dist/components/tag-input/index.js +1 -31
- package/dist/components/tag-input/tag-input.css +2 -2
- package/dist/components/tag-input/tag-input.schema.js +5 -33
- package/dist/components/tag-input/tag-input.variables.js +1 -31
- package/dist/components/textarea/index.js +1 -31
- package/dist/components/textarea/textarea.css +1 -0
- package/dist/components/textarea/textarea.schema.js +13 -33
- package/dist/components/textarea/textarea.types.d.ts +4 -0
- package/dist/components/textarea/textarea.variables.js +1 -31
- package/dist/components/timeline/index.js +2 -32
- package/dist/components/timeline/timeline.css +40 -8
- package/dist/components/timeline/timeline.schema.js +17 -33
- package/dist/components/timeline/timeline.svelte.d.ts +2 -2
- package/dist/components/timeline/timeline.types.d.ts +2 -2
- package/dist/components/timeline/timeline.variables.js +1 -31
- package/dist/components/toast-region/index.js +106 -81
- package/dist/components/toast-region/toast-region.schema.js +3 -32
- package/dist/components/toast-region/toast-region.variables.js +1 -31
- package/dist/components/toggle/index.js +1 -31
- package/dist/components/toggle/toggle.css +5 -2
- package/dist/components/toggle/toggle.schema.js +1 -31
- package/dist/components/toggle/toggle.variables.js +1 -31
- package/dist/components/toolbar/index.js +1 -31
- package/dist/components/toolbar/toolbar.schema.js +12 -32
- package/dist/components/toolbar/toolbar.variables.js +1 -31
- package/dist/components/tooltip/index.js +792 -361
- package/dist/components/tooltip/tooltip.css +11 -2
- package/dist/components/tooltip/tooltip.schema.js +10 -35
- package/dist/components/tooltip/tooltip.types.d.ts +4 -0
- package/dist/components/tooltip/tooltip.variables.js +1 -31
- package/dist/components/transfer-list/index.d.ts +5 -0
- package/dist/components/transfer-list/index.js +451 -0
- package/dist/components/transfer-list/transfer-list.css +114 -0
- package/dist/components/transfer-list/transfer-list.schema.d.ts +3 -0
- package/dist/components/transfer-list/transfer-list.schema.js +91 -0
- package/dist/components/transfer-list/transfer-list.svelte.d.ts +17 -0
- package/dist/components/transfer-list/transfer-list.types.d.ts +52 -0
- package/dist/components/transfer-list/transfer-list.variables.d.ts +2 -0
- package/dist/components/transfer-list/transfer-list.variables.js +31 -0
- package/dist/components/tree/index.d.ts +9 -4
- package/dist/components/tree/index.js +3433 -365
- package/dist/components/tree/tree.css +203 -3
- package/dist/components/tree/tree.schema.js +72 -34
- package/dist/components/tree/tree.svelte.d.ts +2 -2
- package/dist/components/tree/tree.types.d.ts +69 -3
- package/dist/components/tree/tree.variables.js +6 -32
- package/dist/components/tree-item/index.js +608 -169
- package/dist/components/tree-item/tree-item.schema.js +19 -36
- package/dist/components/tree-item/tree-item.types.d.ts +11 -3
- package/dist/components/tree-item/tree-item.variables.js +1 -31
- package/dist/components/typography/index.js +1 -31
- package/dist/components/typography/typography.schema.js +12 -32
- package/dist/components/typography/typography.variables.js +1 -31
- package/dist/components/virtual-list/index.d.ts +7 -0
- package/dist/components/virtual-list/index.js +266 -0
- package/dist/components/virtual-list/virtual-list.css +30 -0
- package/dist/components/virtual-list/virtual-list.schema.d.ts +3 -0
- package/dist/components/virtual-list/virtual-list.schema.js +88 -0
- package/dist/components/virtual-list/virtual-list.svelte.d.ts +42 -0
- package/dist/components/virtual-list/virtual-list.types.d.ts +54 -0
- package/dist/components/virtual-list/virtual-list.variables.d.ts +2 -0
- package/dist/components/virtual-list/virtual-list.variables.js +31 -0
- package/dist/components/visually-hidden/index.js +1 -31
- package/dist/components/visually-hidden/visually-hidden.schema.js +12 -32
- package/dist/components/visually-hidden/visually-hidden.variables.js +1 -31
- package/dist/components/waveform/index.js +1 -31
- package/dist/components/waveform/waveform.schema.js +34 -41
- package/dist/components/waveform/waveform.types.d.ts +9 -0
- package/dist/components/waveform/waveform.variables.js +1 -31
- package/dist/highlighters/shiki/index.js +9 -32
- package/dist/index.d.ts +41 -3
- package/dist/index.js +192 -180
- package/dist/markdown/rendering/rehype-shiki-sync.d.ts +9 -0
- package/dist/markdown/rendering/rehype-shiki-sync.js +23 -10
- package/dist/markdown/rendering/render.js +8 -2
- package/dist/schema-types.d.ts +10 -0
- package/dist/server/components/access-gate/access-gate.schema.js +49 -0
- package/dist/server/components/access-gate/access-gate.variables.js +12 -0
- package/dist/server/components/access-gate/index.css +130 -0
- package/dist/server/components/access-gate/index.js +1693 -0
- package/dist/server/components/accordion/accordion.schema.js +12 -33
- package/dist/server/components/accordion/accordion.variables.js +1 -32
- package/dist/server/components/accordion/index.js +1 -32
- package/dist/server/components/accordion-item/accordion-item.schema.js +12 -33
- package/dist/server/components/accordion-item/accordion-item.variables.js +1 -32
- package/dist/server/components/accordion-item/index.js +1 -32
- package/dist/server/components/alert/alert.schema.js +19 -33
- package/dist/server/components/alert/alert.variables.js +1 -32
- package/dist/server/components/alert/index.js +1 -32
- package/dist/server/components/alert-dialog/alert-dialog.schema.js +17 -40
- package/dist/server/components/alert-dialog/alert-dialog.variables.js +1 -32
- package/dist/server/components/alert-dialog/index.js +274 -84
- package/dist/server/components/area-chart/area-chart.schema.js +42 -47
- package/dist/server/components/area-chart/area-chart.variables.js +1 -32
- package/dist/server/components/area-chart/index.js +1 -32
- package/dist/server/components/aspect-ratio/aspect-ratio.schema.js +12 -33
- package/dist/server/components/aspect-ratio/aspect-ratio.variables.js +1 -32
- package/dist/server/components/aspect-ratio/index.js +1 -32
- package/dist/server/components/autocomplete/autocomplete.schema.js +29 -46
- package/dist/server/components/autocomplete/autocomplete.variables.js +1 -32
- package/dist/server/components/autocomplete/index.css +0 -4
- package/dist/server/components/autocomplete/index.js +9 -34
- package/dist/server/components/avatar/avatar.schema.js +3 -33
- package/dist/server/components/avatar/avatar.variables.js +1 -32
- package/dist/server/components/avatar/index.css +1 -0
- package/dist/server/components/avatar/index.js +1 -32
- package/dist/server/components/avatar-group/avatar-group.schema.js +6 -32
- package/dist/server/components/avatar-group/avatar-group.variables.js +1 -32
- package/dist/server/components/avatar-group/index.js +5 -32
- package/dist/server/components/backdrop/backdrop.schema.js +5 -34
- package/dist/server/components/backdrop/backdrop.variables.js +1 -32
- package/dist/server/components/backdrop/index.js +2 -33
- package/dist/server/components/badge/badge.schema.js +12 -33
- package/dist/server/components/badge/badge.variables.js +1 -32
- package/dist/server/components/badge/index.css +1 -1
- package/dist/server/components/badge/index.js +1 -32
- package/dist/server/components/banner/banner.schema.js +8 -35
- package/dist/server/components/banner/banner.variables.js +1 -32
- package/dist/server/components/banner/index.js +1 -32
- package/dist/server/components/bar-chart/bar-chart.schema.js +42 -47
- package/dist/server/components/bar-chart/bar-chart.variables.js +1 -32
- package/dist/server/components/bar-chart/index.css +4 -0
- package/dist/server/components/bar-chart/index.js +2 -33
- package/dist/server/components/breadcrumbs/breadcrumbs.schema.js +1 -32
- package/dist/server/components/breadcrumbs/breadcrumbs.variables.js +1 -32
- package/dist/server/components/breadcrumbs/index.js +1 -32
- package/dist/server/components/button/button.schema.js +20 -33
- package/dist/server/components/button/button.variables.js +1 -32
- package/dist/server/components/button/index.js +1 -32
- package/dist/server/components/button-group/button-group.schema.js +8 -35
- package/dist/server/components/button-group/button-group.variables.js +1 -32
- package/dist/server/components/button-group/index.js +1 -32
- package/dist/server/components/callout/callout.schema.js +6 -34
- package/dist/server/components/callout/callout.variables.js +1 -32
- package/dist/server/components/callout/index.js +1 -32
- package/dist/server/components/capability-gate/capability-gate.schema.js +9 -36
- package/dist/server/components/capability-gate/capability-gate.variables.js +1 -32
- package/dist/server/components/capability-gate/index.css +5 -2
- package/dist/server/components/capability-gate/index.js +1 -32
- package/dist/server/components/card/card.schema.js +7 -35
- package/dist/server/components/card/card.variables.js +1 -32
- package/dist/server/components/card/index.js +1 -32
- package/dist/server/components/chat/chat.schema.js +161 -49
- package/dist/server/components/chat/chat.variables.js +1 -32
- package/dist/server/components/chat/index.js +2665 -1064
- package/dist/server/components/chat-conversation-header/chat-conversation-header.schema.js +45 -0
- package/dist/server/components/chat-conversation-header/chat-conversation-header.variables.js +12 -0
- package/dist/server/components/chat-conversation-header/index.css +309 -0
- package/dist/server/components/chat-conversation-header/index.js +1468 -0
- package/dist/server/components/chat-conversation-list/chat-conversation-list.schema.js +56 -0
- package/dist/server/components/chat-conversation-list/chat-conversation-list.variables.js +12 -0
- package/dist/server/components/chat-conversation-list/index.css +115 -0
- package/dist/server/components/chat-conversation-list/index.js +355 -0
- package/dist/server/components/checkbox/checkbox.schema.js +3 -33
- package/dist/server/components/checkbox/checkbox.variables.js +1 -32
- package/dist/server/components/checkbox/index.js +1 -32
- package/dist/server/components/checkbox-group/checkbox-group.schema.js +4 -33
- package/dist/server/components/checkbox-group/checkbox-group.variables.js +1 -32
- package/dist/server/components/checkbox-group/index.js +1 -32
- package/dist/server/components/chip/chip.schema.js +19 -41
- package/dist/server/components/chip/chip.variables.js +1 -32
- package/dist/server/components/chip/index.js +7 -32
- package/dist/server/components/choice-grid/choice-grid.schema.js +6 -34
- package/dist/server/components/choice-grid/choice-grid.variables.js +1 -32
- package/dist/server/components/choice-grid/index.js +1 -32
- package/dist/server/components/choice-grid-item/choice-grid-item.schema.js +4 -33
- package/dist/server/components/choice-grid-item/choice-grid-item.variables.js +1 -32
- package/dist/server/components/choice-grid-item/index.js +1 -32
- package/dist/server/components/click-away-listener/click-away-listener.schema.js +9 -34
- package/dist/server/components/click-away-listener/click-away-listener.variables.js +1 -32
- package/dist/server/components/click-away-listener/index.js +1 -32
- package/dist/server/components/code-block/code-block.schema.js +4 -34
- package/dist/server/components/code-block/code-block.variables.js +1 -32
- package/dist/server/components/code-block/index.css +42 -22
- package/dist/server/components/code-block/index.js +14 -38
- package/dist/server/components/collapsible/collapsible.schema.js +17 -33
- package/dist/server/components/collapsible/collapsible.variables.js +1 -32
- package/dist/server/components/collapsible/index.js +1 -32
- package/dist/server/components/color-field/color-field.schema.js +3 -33
- package/dist/server/components/color-field/color-field.variables.js +1 -32
- package/dist/server/components/color-field/index.js +1 -32
- package/dist/server/components/color-picker/color-picker.schema.js +5 -34
- package/dist/server/components/color-picker/color-picker.variables.js +1 -32
- package/dist/server/components/color-picker/index.js +1 -32
- package/dist/server/components/color-swatch-picker/color-swatch-picker.schema.js +9 -35
- package/dist/server/components/color-swatch-picker/color-swatch-picker.variables.js +1 -32
- package/dist/server/components/color-swatch-picker/index.js +1 -32
- package/dist/server/components/combobox/combobox.schema.js +10 -35
- package/dist/server/components/combobox/combobox.variables.js +1 -32
- package/dist/server/components/combobox/index.js +53 -65
- package/dist/server/components/command-item/command-item.schema.js +10 -36
- package/dist/server/components/command-item/command-item.variables.js +1 -32
- package/dist/server/components/command-item/index.js +1 -32
- package/dist/server/components/command-menu/command-menu.schema.js +15 -38
- package/dist/server/components/command-menu/command-menu.variables.js +1 -32
- package/dist/server/components/command-menu/index.js +1 -32
- package/dist/server/components/command-palette/command-palette.schema.js +12 -37
- package/dist/server/components/command-palette/command-palette.variables.js +1 -32
- package/dist/server/components/command-palette/index.css +12 -12
- package/dist/server/components/command-palette/index.js +2 -33
- package/dist/server/components/confirm-dialog/confirm-dialog.schema.js +11 -35
- package/dist/server/components/confirm-dialog/confirm-dialog.variables.js +1 -32
- package/dist/server/components/confirm-dialog/index.js +274 -84
- package/dist/server/components/connection-indicator/connection-indicator.schema.js +1 -32
- package/dist/server/components/connection-indicator/connection-indicator.variables.js +1 -32
- package/dist/server/components/connection-indicator/index.js +1 -32
- package/dist/server/components/container/container.schema.js +12 -33
- package/dist/server/components/container/container.variables.js +1 -32
- package/dist/server/components/container/index.js +1 -32
- package/dist/server/components/context-menu/context-menu.schema.js +13 -38
- package/dist/server/components/context-menu/context-menu.variables.js +1 -32
- package/dist/server/components/context-menu/index.js +13 -34
- package/dist/server/components/context-menu-trigger/context-menu-trigger.schema.js +5 -34
- package/dist/server/components/context-menu-trigger/context-menu-trigger.variables.js +1 -32
- package/dist/server/components/context-menu-trigger/index.js +7 -32
- package/dist/server/components/copy-button/copy-button.schema.js +5 -34
- package/dist/server/components/copy-button/copy-button.variables.js +1 -32
- package/dist/server/components/copy-button/index.js +9 -33
- package/dist/server/components/data-grid/data-grid.schema.js +117 -0
- package/dist/server/components/data-grid/data-grid.variables.js +12 -0
- package/dist/server/components/data-grid/index.css +245 -0
- package/dist/server/components/data-grid/index.js +2822 -0
- package/dist/server/components/data-list/data-list.schema.js +24 -37
- package/dist/server/components/data-list/data-list.variables.js +1 -32
- package/dist/server/components/data-list/index.js +1 -32
- package/dist/server/components/data-table/data-table.schema.js +35 -35
- package/dist/server/components/data-table/data-table.variables.js +2 -33
- package/dist/server/components/data-table/index.css +37 -4
- package/dist/server/components/data-table/index.js +328 -81
- package/dist/server/components/date-range-field/date-range-field.schema.js +76 -0
- package/dist/server/components/date-range-field/date-range-field.variables.js +12 -0
- package/dist/server/components/date-range-field/index.css +178 -0
- package/dist/server/components/date-range-field/index.js +189 -0
- package/dist/server/components/description-list/description-list.schema.js +7 -35
- package/dist/server/components/description-list/description-list.variables.js +1 -32
- package/dist/server/components/description-list/index.js +1 -32
- package/dist/server/components/diff-statistics/diff-statistics.schema.js +2 -33
- package/dist/server/components/diff-statistics/diff-statistics.variables.js +1 -32
- package/dist/server/components/diff-statistics/index.js +1 -32
- package/dist/server/components/diff-viewer/diff-viewer.schema.js +15 -37
- package/dist/server/components/diff-viewer/diff-viewer.variables.js +1 -32
- package/dist/server/components/diff-viewer/index.js +1 -32
- package/dist/server/components/divider/divider.schema.js +1 -32
- package/dist/server/components/divider/divider.variables.js +1 -32
- package/dist/server/components/divider/index.js +1 -32
- package/dist/server/components/drawer/drawer.schema.js +12 -36
- package/dist/server/components/drawer/drawer.variables.js +1 -32
- package/dist/server/components/drawer/index.js +261 -68
- package/dist/server/components/dropdown/dropdown.schema.js +9 -36
- package/dist/server/components/dropdown/dropdown.variables.js +1 -32
- package/dist/server/components/dropdown/index.js +2 -33
- package/dist/server/components/dropdown-group/dropdown-group.schema.js +7 -35
- package/dist/server/components/dropdown-group/dropdown-group.variables.js +1 -32
- package/dist/server/components/dropdown-group/index.js +1 -32
- package/dist/server/components/dropdown-item/dropdown-item.schema.js +9 -36
- package/dist/server/components/dropdown-item/dropdown-item.variables.js +1 -32
- package/dist/server/components/dropdown-item/index.js +1 -32
- package/dist/server/components/dropdown-label/dropdown-label.schema.js +3 -33
- package/dist/server/components/dropdown-label/dropdown-label.variables.js +1 -32
- package/dist/server/components/dropdown-label/index.js +1 -32
- package/dist/server/components/dropdown-menu/dropdown-menu.schema.js +3 -33
- package/dist/server/components/dropdown-menu/dropdown-menu.variables.js +1 -32
- package/dist/server/components/dropdown-menu/index.js +1 -32
- package/dist/server/components/dropdown-separator/dropdown-separator.schema.js +3 -33
- package/dist/server/components/dropdown-separator/dropdown-separator.variables.js +1 -32
- package/dist/server/components/dropdown-separator/index.js +1 -32
- package/dist/server/components/dropdown-trigger/dropdown-trigger.schema.js +3 -33
- package/dist/server/components/dropdown-trigger/dropdown-trigger.variables.js +1 -32
- package/dist/server/components/dropdown-trigger/index.js +1 -32
- package/dist/server/components/empty-state/empty-state.schema.js +7 -35
- package/dist/server/components/empty-state/empty-state.variables.js +1 -32
- package/dist/server/components/empty-state/index.js +1 -32
- package/dist/server/components/event-stream-viewer/event-stream-viewer.schema.js +73 -0
- package/dist/server/components/event-stream-viewer/event-stream-viewer.variables.js +12 -0
- package/dist/server/components/event-stream-viewer/index.css +414 -0
- package/dist/server/components/event-stream-viewer/index.js +627 -0
- package/dist/server/components/experimental/connection-indicator/index.js +1 -32
- package/dist/server/components/experimental/json-viewer/index.js +1 -32
- package/dist/server/components/experimental/message/index.js +1 -32
- package/dist/server/components/faceted-filter-bar/faceted-filter-bar.schema.js +78 -0
- package/dist/server/components/faceted-filter-bar/faceted-filter-bar.variables.js +12 -0
- package/dist/server/components/faceted-filter-bar/index.css +108 -0
- package/dist/server/components/faceted-filter-bar/index.js +736 -0
- package/dist/server/components/feed/feed.schema.js +6 -34
- package/dist/server/components/feed/feed.variables.js +1 -32
- package/dist/server/components/feed/index.js +1 -32
- package/dist/server/components/feed-event/feed-event.schema.js +16 -36
- package/dist/server/components/feed-event/feed-event.variables.js +1 -32
- package/dist/server/components/feed-event/index.js +1 -32
- package/dist/server/components/file-upload/file-upload.schema.js +15 -39
- package/dist/server/components/file-upload/file-upload.variables.js +1 -32
- package/dist/server/components/file-upload/index.js +1 -32
- package/dist/server/components/floating-action-button/floating-action-button.schema.js +11 -33
- package/dist/server/components/floating-action-button/floating-action-button.variables.js +1 -32
- package/dist/server/components/floating-action-button/index.css +2 -1
- package/dist/server/components/floating-action-button/index.js +1 -32
- package/dist/server/components/focus-trap/focus-trap.schema.js +21 -38
- package/dist/server/components/focus-trap/focus-trap.variables.js +1 -32
- package/dist/server/components/focus-trap/index.js +6 -34
- package/dist/server/components/form-field/form-field.schema.js +4 -33
- package/dist/server/components/form-field/form-field.variables.js +1 -32
- package/dist/server/components/form-field/index.js +1 -32
- package/dist/server/components/form-section/form-section.schema.js +4 -33
- package/dist/server/components/form-section/form-section.variables.js +1 -32
- package/dist/server/components/form-section/index.js +1 -32
- package/dist/server/components/grid/grid.schema.js +64 -0
- package/dist/server/components/grid/grid.variables.js +12 -0
- package/dist/server/components/grid/index.css +26 -0
- package/dist/server/components/grid/index.js +113 -0
- package/dist/server/components/grid-item/grid-item.schema.js +91 -0
- package/dist/server/components/grid-item/grid-item.variables.js +12 -0
- package/dist/server/components/grid-item/index.js +62 -0
- package/dist/server/components/grid-list/grid-list.schema.js +6 -34
- package/dist/server/components/grid-list/grid-list.variables.js +1 -32
- package/dist/server/components/grid-list/index.js +1 -32
- package/dist/server/components/grid-list-item/grid-list-item.schema.js +19 -41
- package/dist/server/components/grid-list-item/grid-list-item.variables.js +1 -32
- package/dist/server/components/grid-list-item/index.js +1 -32
- package/dist/server/components/hover-card/hover-card.schema.js +21 -42
- package/dist/server/components/hover-card/hover-card.variables.js +1 -32
- package/dist/server/components/hover-card/index.js +1 -32
- package/dist/server/components/image/image.schema.js +9 -36
- package/dist/server/components/image/image.variables.js +1 -32
- package/dist/server/components/image/index.js +1 -32
- package/dist/server/components/input/index.js +1 -32
- package/dist/server/components/input/input.schema.js +22 -42
- package/dist/server/components/input/input.variables.js +1 -32
- package/dist/server/components/invocation-rule-builder/index.css +262 -0
- package/dist/server/components/invocation-rule-builder/index.js +333 -0
- package/dist/server/components/invocation-rule-builder/invocation-rule-builder.schema.js +82 -0
- package/dist/server/components/invocation-rule-builder/invocation-rule-builder.variables.js +12 -0
- package/dist/server/components/json-schema-editor/index.js +26 -7430
- package/dist/server/components/json-schema-editor/json-schema-editor.schema.js +8 -35
- package/dist/server/components/json-schema-editor/json-schema-editor.variables.js +1 -32
- package/dist/server/components/json-viewer/index.css +6 -0
- package/dist/server/components/json-viewer/index.js +3 -34
- package/dist/server/components/json-viewer/json-viewer.schema.js +4 -33
- package/dist/server/components/json-viewer/json-viewer.variables.js +1 -32
- package/dist/server/components/kanban-board/index.js +1 -32
- package/dist/server/components/kanban-board/kanban-board.schema.js +19 -41
- package/dist/server/components/kanban-board/kanban-board.variables.js +1 -32
- package/dist/server/components/kbd/index.js +1 -32
- package/dist/server/components/kbd/kbd.schema.js +11 -33
- package/dist/server/components/kbd/kbd.variables.js +1 -32
- package/dist/server/components/keyboard-shortcuts/index.js +1 -32
- package/dist/server/components/keyboard-shortcuts/keyboard-shortcuts.schema.js +6 -34
- package/dist/server/components/keyboard-shortcuts/keyboard-shortcuts.variables.js +1 -32
- package/dist/server/components/label/index.js +1 -32
- package/dist/server/components/label/label.schema.js +6 -34
- package/dist/server/components/label/label.variables.js +1 -32
- package/dist/server/components/line-chart/index.js +1 -32
- package/dist/server/components/line-chart/line-chart.schema.js +40 -46
- package/dist/server/components/line-chart/line-chart.variables.js +1 -32
- package/dist/server/components/link/index.js +1 -32
- package/dist/server/components/link/link.schema.js +6 -34
- package/dist/server/components/link/link.variables.js +1 -32
- package/dist/server/components/load-more/index.js +7 -33
- package/dist/server/components/load-more/load-more.schema.js +10 -35
- package/dist/server/components/load-more/load-more.variables.js +1 -32
- package/dist/server/components/markdown-editor/index.js +109 -137
- package/dist/server/components/markdown-editor/markdown-editor.schema.js +29 -43
- package/dist/server/components/markdown-editor/markdown-editor.variables.js +1 -32
- package/dist/server/components/masonry/index.css +14 -0
- package/dist/server/components/masonry/index.js +48 -0
- package/dist/server/components/masonry/masonry.schema.js +44 -0
- package/dist/server/components/masonry/masonry.variables.js +12 -0
- package/dist/server/components/matrix-chart/index.css +4 -0
- package/dist/server/components/matrix-chart/index.js +7 -34
- package/dist/server/components/matrix-chart/matrix-chart.schema.js +42 -46
- package/dist/server/components/matrix-chart/matrix-chart.variables.js +1 -32
- package/dist/server/components/media-controls/index.js +7 -33
- package/dist/server/components/media-controls/media-controls.schema.js +7 -35
- package/dist/server/components/media-controls/media-controls.variables.js +1 -32
- package/dist/server/components/menu-bar/index.js +1 -32
- package/dist/server/components/menu-bar/menu-bar.schema.js +11 -37
- package/dist/server/components/menu-bar/menu-bar.variables.js +1 -32
- package/dist/server/components/message/index.js +1 -32
- package/dist/server/components/message/message.schema.js +4 -33
- package/dist/server/components/message/message.variables.js +1 -32
- package/dist/server/components/modal/index.js +251 -61
- package/dist/server/components/modal/modal.schema.js +19 -41
- package/dist/server/components/modal/modal.variables.js +1 -32
- package/dist/server/components/navigation-bar/index.css +57 -0
- package/dist/server/components/navigation-bar/index.js +14 -38
- package/dist/server/components/navigation-bar/navigation-bar.schema.js +16 -34
- package/dist/server/components/navigation-bar/navigation-bar.variables.js +1 -32
- package/dist/server/components/navigation-item/index.js +1 -32
- package/dist/server/components/navigation-item/navigation-item.schema.js +16 -38
- package/dist/server/components/navigation-item/navigation-item.variables.js +1 -32
- package/dist/server/components/number-input/index.js +1 -32
- package/dist/server/components/number-input/number-input.schema.js +27 -45
- package/dist/server/components/number-input/number-input.variables.js +1 -32
- package/dist/server/components/pagination/index.css +0 -1
- package/dist/server/components/pagination/index.js +1 -32
- package/dist/server/components/pagination/pagination.schema.js +1 -32
- package/dist/server/components/pagination/pagination.variables.js +1 -32
- package/dist/server/components/payload-inspector/index.css +144 -0
- package/dist/server/components/payload-inspector/index.js +1322 -0
- package/dist/server/components/payload-inspector/payload-inspector.schema.js +76 -0
- package/dist/server/components/payload-inspector/payload-inspector.variables.js +12 -0
- package/dist/server/components/permission-matrix/index.css +161 -0
- package/dist/server/components/permission-matrix/index.js +294 -0
- package/dist/server/components/permission-matrix/permission-matrix.schema.js +81 -0
- package/dist/server/components/permission-matrix/permission-matrix.variables.js +12 -0
- package/dist/server/components/phone-input/index.js +1 -32
- package/dist/server/components/phone-input/phone-input.schema.js +3 -33
- package/dist/server/components/phone-input/phone-input.variables.js +1 -32
- package/dist/server/components/pin-input/index.js +1 -32
- package/dist/server/components/pin-input/pin-input.schema.js +6 -34
- package/dist/server/components/pin-input/pin-input.variables.js +1 -32
- package/dist/server/components/popover/index.js +3 -33
- package/dist/server/components/popover/popover.schema.js +12 -35
- package/dist/server/components/popover/popover.variables.js +1 -32
- package/dist/server/components/portal/index.js +1 -32
- package/dist/server/components/portal/portal.schema.js +19 -37
- package/dist/server/components/portal/portal.variables.js +1 -32
- package/dist/server/components/pricing-card/index.css +2 -2
- package/dist/server/components/pricing-card/index.js +1 -32
- package/dist/server/components/pricing-card/pricing-card.schema.js +12 -33
- package/dist/server/components/pricing-card/pricing-card.variables.js +1 -32
- package/dist/server/components/progress/index.js +1 -32
- package/dist/server/components/progress/progress.schema.js +1 -32
- package/dist/server/components/progress/progress.variables.js +1 -32
- package/dist/server/components/radio-group/index.js +1 -32
- package/dist/server/components/radio-group/radio-group.schema.js +4 -33
- package/dist/server/components/radio-group/radio-group.variables.js +1 -32
- package/dist/server/components/rating/index.js +1 -32
- package/dist/server/components/rating/rating.schema.js +4 -33
- package/dist/server/components/rating/rating.variables.js +1 -32
- package/dist/server/components/resizable-panels/index.js +1 -32
- package/dist/server/components/resizable-panels/resizable-panels.schema.js +13 -38
- package/dist/server/components/resizable-panels/resizable-panels.variables.js +1 -32
- package/dist/server/components/review-editor/index.js +116 -140
- package/dist/server/components/review-editor/review-editor.schema.js +15 -39
- package/dist/server/components/review-editor/review-editor.variables.js +1 -32
- package/dist/server/components/run-step-timeline/index.css +161 -0
- package/dist/server/components/run-step-timeline/index.js +414 -0
- package/dist/server/components/run-step-timeline/run-step-timeline.schema.js +110 -0
- package/dist/server/components/run-step-timeline/run-step-timeline.variables.js +12 -0
- package/dist/server/components/schema-form/index.css +165 -0
- package/dist/server/components/schema-form/index.js +911 -0
- package/dist/server/components/schema-form/schema-form.schema.js +50 -0
- package/dist/server/components/schema-form/schema-form.variables.js +12 -0
- package/dist/server/components/scroll-area/index.js +1 -32
- package/dist/server/components/scroll-area/scroll-area.schema.js +4 -33
- package/dist/server/components/scroll-area/scroll-area.variables.js +1 -32
- package/dist/server/components/search-field/index.js +1 -32
- package/dist/server/components/search-field/search-field.schema.js +9 -36
- package/dist/server/components/search-field/search-field.variables.js +1 -32
- package/dist/server/components/secret-value-field/index.css +124 -0
- package/dist/server/components/secret-value-field/index.js +173 -0
- package/dist/server/components/secret-value-field/secret-value-field.schema.js +68 -0
- package/dist/server/components/secret-value-field/secret-value-field.variables.js +12 -0
- package/dist/server/components/section-heading/index.js +1 -32
- package/dist/server/components/section-heading/section-heading.schema.js +8 -35
- package/dist/server/components/section-heading/section-heading.variables.js +1 -32
- package/dist/server/components/segment/index.js +1 -32
- package/dist/server/components/segment/segment.schema.js +11 -36
- package/dist/server/components/segment/segment.variables.js +1 -32
- package/dist/server/components/segmented-control/index.css +5 -0
- package/dist/server/components/segmented-control/index.js +1 -32
- package/dist/server/components/segmented-control/segmented-control.schema.js +10 -36
- package/dist/server/components/segmented-control/segmented-control.variables.js +1 -32
- package/dist/server/components/select/index.js +1 -32
- package/dist/server/components/select/select.schema.js +8 -35
- package/dist/server/components/select/select.variables.js +1 -32
- package/dist/server/components/selection-popover/index.js +5 -35
- package/dist/server/components/selection-popover/selection-popover.schema.js +12 -37
- package/dist/server/components/selection-popover/selection-popover.variables.js +1 -32
- package/dist/server/components/share-card/index.js +45 -66
- package/dist/server/components/share-card/share-card.schema.js +5 -34
- package/dist/server/components/share-card/share-card.variables.js +1 -32
- package/dist/server/components/sheet/index.js +254 -64
- package/dist/server/components/sheet/sheet.schema.js +12 -36
- package/dist/server/components/sheet/sheet.variables.js +1 -32
- package/dist/server/components/shortcut-hint/index.js +1 -32
- package/dist/server/components/shortcut-hint/shortcut-hint.schema.js +3 -33
- package/dist/server/components/shortcut-hint/shortcut-hint.variables.js +1 -32
- package/dist/server/components/side-navigation/index.js +1 -32
- package/dist/server/components/side-navigation/side-navigation.schema.js +6 -34
- package/dist/server/components/side-navigation/side-navigation.variables.js +1 -32
- package/dist/server/components/side-navigation-group/index.js +1 -32
- package/dist/server/components/side-navigation-group/side-navigation-group.schema.js +10 -36
- package/dist/server/components/side-navigation-group/side-navigation-group.variables.js +1 -32
- package/dist/server/components/side-navigation-item/index.js +1 -32
- package/dist/server/components/side-navigation-item/side-navigation-item.schema.js +16 -38
- package/dist/server/components/side-navigation-item/side-navigation-item.variables.js +1 -32
- package/dist/server/components/sidebar/index.js +272 -79
- package/dist/server/components/sidebar/sidebar.schema.js +7 -35
- package/dist/server/components/sidebar/sidebar.variables.js +1 -32
- package/dist/server/components/skeleton/index.js +1 -32
- package/dist/server/components/skeleton/skeleton.schema.js +9 -36
- package/dist/server/components/skeleton/skeleton.variables.js +1 -32
- package/dist/server/components/skip-link/index.js +1 -32
- package/dist/server/components/skip-link/skip-link.schema.js +11 -33
- package/dist/server/components/skip-link/skip-link.variables.js +1 -32
- package/dist/server/components/slider/index.js +1 -32
- package/dist/server/components/slider/slider.schema.js +5 -34
- package/dist/server/components/slider/slider.variables.js +1 -32
- package/dist/server/components/sortable-list/index.js +1 -32
- package/dist/server/components/sortable-list/sortable-list.schema.js +27 -41
- package/dist/server/components/sortable-list/sortable-list.variables.js +1 -32
- package/dist/server/components/spectrogram/index.css +2 -1
- package/dist/server/components/spectrogram/index.js +1 -32
- package/dist/server/components/spectrogram/spectrogram.schema.js +51 -43
- package/dist/server/components/spectrogram/spectrogram.variables.js +1 -32
- package/dist/server/components/spectrum-chart/index.js +1 -32
- package/dist/server/components/spectrum-chart/spectrum-chart.schema.js +43 -42
- package/dist/server/components/spectrum-chart/spectrum-chart.variables.js +1 -32
- package/dist/server/components/speed-dial/index.css +111 -0
- package/dist/server/components/speed-dial/index.js +393 -0
- package/dist/server/components/speed-dial/speed-dial.schema.js +57 -0
- package/dist/server/components/speed-dial/speed-dial.variables.js +12 -0
- package/dist/server/components/speed-dial-action/index.js +171 -0
- package/dist/server/components/speed-dial-action/speed-dial-action.schema.js +52 -0
- package/dist/server/components/speed-dial-action/speed-dial-action.variables.js +12 -0
- package/dist/server/components/spinner/index.js +1 -32
- package/dist/server/components/spinner/spinner.schema.js +1 -32
- package/dist/server/components/spinner/spinner.variables.js +1 -32
- package/dist/server/components/stacked-list-item/index.js +1 -32
- package/dist/server/components/stacked-list-item/stacked-list-item.schema.js +20 -41
- package/dist/server/components/stacked-list-item/stacked-list-item.variables.js +1 -32
- package/dist/server/components/stat/index.js +1 -32
- package/dist/server/components/stat/stat.schema.js +7 -35
- package/dist/server/components/stat/stat.variables.js +1 -32
- package/dist/server/components/stat-group/index.js +1 -32
- package/dist/server/components/stat-group/stat-group.schema.js +4 -33
- package/dist/server/components/stat-group/stat-group.variables.js +1 -32
- package/dist/server/components/status-dot/index.css +1 -1
- package/dist/server/components/status-dot/index.js +1 -32
- package/dist/server/components/status-dot/status-dot.schema.js +1 -32
- package/dist/server/components/status-dot/status-dot.variables.js +1 -32
- package/dist/server/components/steps/index.css +13 -3
- package/dist/server/components/steps/index.js +1 -32
- package/dist/server/components/steps/steps.schema.js +4 -33
- package/dist/server/components/steps/steps.variables.js +1 -32
- package/dist/server/components/subscription-badge/index.js +2 -33
- package/dist/server/components/subscription-badge/subscription-badge.schema.js +1 -32
- package/dist/server/components/subscription-badge/subscription-badge.variables.js +1 -32
- package/dist/server/components/surface/index.js +1 -32
- package/dist/server/components/surface/surface.schema.js +11 -33
- package/dist/server/components/surface/surface.variables.js +1 -32
- package/dist/server/components/tab/index.js +1 -32
- package/dist/server/components/tab/tab.schema.js +6 -34
- package/dist/server/components/tab/tab.variables.js +1 -32
- package/dist/server/components/tab-list/index.js +1 -32
- package/dist/server/components/tab-list/tab-list.schema.js +4 -33
- package/dist/server/components/tab-list/tab-list.variables.js +1 -32
- package/dist/server/components/tab-panel/index.js +1 -32
- package/dist/server/components/tab-panel/tab-panel.schema.js +4 -33
- package/dist/server/components/tab-panel/tab-panel.variables.js +1 -32
- package/dist/server/components/table/index.css +14 -4
- package/dist/server/components/table/index.js +52 -38
- package/dist/server/components/table/table.schema.js +6 -34
- package/dist/server/components/table/table.variables.js +1 -32
- package/dist/server/components/table-body/index.js +1 -32
- package/dist/server/components/table-body/table-body.schema.js +4 -33
- package/dist/server/components/table-body/table-body.variables.js +1 -32
- package/dist/server/components/table-cell/index.js +1 -32
- package/dist/server/components/table-cell/table-cell.schema.js +11 -34
- package/dist/server/components/table-cell/table-cell.variables.js +1 -32
- package/dist/server/components/table-header/index.js +1 -32
- package/dist/server/components/table-header/table-header.schema.js +6 -34
- package/dist/server/components/table-header/table-header.variables.js +1 -32
- package/dist/server/components/table-header-cell/index.js +1 -32
- package/dist/server/components/table-header-cell/table-header-cell.schema.js +4 -33
- package/dist/server/components/table-header-cell/table-header-cell.variables.js +1 -32
- package/dist/server/components/table-row/index.js +9 -34
- package/dist/server/components/table-row/table-row.schema.js +8 -35
- package/dist/server/components/table-row/table-row.variables.js +1 -32
- package/dist/server/components/tabs/index.css +1 -1
- package/dist/server/components/tabs/index.js +1 -32
- package/dist/server/components/tabs/tabs.schema.js +4 -33
- package/dist/server/components/tabs/tabs.variables.js +1 -32
- package/dist/server/components/tag-input/index.css +2 -2
- package/dist/server/components/tag-input/index.js +1 -32
- package/dist/server/components/tag-input/tag-input.schema.js +5 -34
- package/dist/server/components/tag-input/tag-input.variables.js +1 -32
- package/dist/server/components/textarea/index.css +1 -0
- package/dist/server/components/textarea/index.js +1 -32
- package/dist/server/components/textarea/textarea.schema.js +13 -34
- package/dist/server/components/textarea/textarea.variables.js +1 -32
- package/dist/server/components/timeline/index.css +9 -7
- package/dist/server/components/timeline/index.js +2 -33
- package/dist/server/components/timeline/timeline.schema.js +17 -34
- package/dist/server/components/timeline/timeline.variables.js +1 -32
- package/dist/server/components/toast-region/index.js +31 -34
- package/dist/server/components/toast-region/toast-region.schema.js +3 -33
- package/dist/server/components/toast-region/toast-region.variables.js +1 -32
- package/dist/server/components/toggle/index.css +2 -2
- package/dist/server/components/toggle/index.js +1 -32
- package/dist/server/components/toggle/toggle.schema.js +1 -32
- package/dist/server/components/toggle/toggle.variables.js +1 -32
- package/dist/server/components/toolbar/index.js +1 -32
- package/dist/server/components/toolbar/toolbar.schema.js +12 -33
- package/dist/server/components/toolbar/toolbar.variables.js +1 -32
- package/dist/server/components/tooltip/index.css +3 -2
- package/dist/server/components/tooltip/index.js +1 -32
- package/dist/server/components/tooltip/tooltip.schema.js +10 -36
- package/dist/server/components/tooltip/tooltip.variables.js +1 -32
- package/dist/server/components/transfer-list/index.css +116 -0
- package/dist/server/components/transfer-list/index.js +326 -0
- package/dist/server/components/transfer-list/transfer-list.schema.js +72 -0
- package/dist/server/components/transfer-list/transfer-list.variables.js +12 -0
- package/dist/server/components/tree/index.css +186 -2
- package/dist/server/components/tree/index.js +2651 -157
- package/dist/server/components/tree/tree.schema.js +72 -35
- package/dist/server/components/tree/tree.variables.js +6 -33
- package/dist/server/components/tree-item/index.js +374 -49
- package/dist/server/components/tree-item/tree-item.schema.js +19 -37
- package/dist/server/components/tree-item/tree-item.variables.js +1 -32
- package/dist/server/components/typography/index.js +1 -32
- package/dist/server/components/typography/typography.schema.js +12 -33
- package/dist/server/components/typography/typography.variables.js +1 -32
- package/dist/server/components/virtual-list/index.css +30 -0
- package/dist/server/components/virtual-list/index.js +186 -0
- package/dist/server/components/virtual-list/virtual-list.schema.js +69 -0
- package/dist/server/components/virtual-list/virtual-list.variables.js +12 -0
- package/dist/server/components/visually-hidden/index.js +1 -32
- package/dist/server/components/visually-hidden/visually-hidden.schema.js +12 -33
- package/dist/server/components/visually-hidden/visually-hidden.variables.js +1 -32
- package/dist/server/components/waveform/index.js +1 -32
- package/dist/server/components/waveform/waveform.schema.js +34 -42
- package/dist/server/components/waveform/waveform.variables.js +1 -32
- package/dist/server/highlighters/shiki/index.js +9 -33
- package/dist/server/index.css +5383 -2634
- package/dist/server/index.js +14950 -12212
- package/dist/server/markdown/rendering/rehype-shiki-sync.d.ts +9 -0
- package/dist/server/markdown/rendering/rehype-shiki-sync.js +23 -10
- package/dist/server/markdown/rendering/render.js +8 -2
- package/dist/server/styles/base-guard.js +1 -32
- package/dist/styles/base-guard.js +1 -31
- package/dist/utilities/fixed-virtual-window.d.ts +27 -0
- package/package.json +465 -369
- package/src/_internal/anchored-overlay.svelte.ts +72 -48
- package/src/_internal/overlay.ts +27 -12
- package/src/_internal/toast-context.ts +8 -0
- package/src/_internal/tree-context.ts +18 -0
- package/src/_internal/tree-data.ts +91 -0
- package/src/_internal/tree-drag-controller.svelte.ts +328 -0
- package/src/_internal/tree-registry.svelte.ts +89 -4
- package/src/_internal/use-virtualizer.svelte.ts +226 -0
- package/src/_internal/virtual-item.ts +1 -0
- package/src/components/_timeline-item/index.ts +5 -0
- package/src/components/_tree-expand-all/index.ts +5 -0
- package/src/components/_tree-expand-all/tree-expand-all.svelte +83 -0
- package/src/components/_tree-expand-all/tree-expand-all.types.ts +15 -0
- package/src/components/_visually-hidden-live-region.svelte +13 -0
- package/src/components/access-gate/README.md +55 -0
- package/src/components/access-gate/access-gate-inline.svelte +415 -0
- package/src/components/access-gate/access-gate.css +129 -0
- package/src/components/access-gate/access-gate.examples.json +19 -0
- package/src/components/access-gate/access-gate.svelte +92 -0
- package/src/components/access-gate/access-gate.types.ts +46 -0
- package/src/components/access-gate/index.ts +6 -0
- package/src/components/accordion/README.md +5 -4
- package/src/components/accordion/accordion.examples.json +1 -1
- package/src/components/accordion/accordion.svelte +9 -2
- package/src/components/accordion-item/README.md +7 -6
- package/src/components/alert/README.md +8 -5
- package/src/components/alert-dialog/README.md +14 -14
- package/src/components/alert-dialog/alert-dialog.types.ts +7 -0
- package/src/components/area-chart/README.md +18 -16
- package/src/components/area-chart/area-chart.examples.json +1 -0
- package/src/components/area-chart/area-chart.types.ts +14 -0
- package/src/components/aspect-ratio/README.md +7 -6
- package/src/components/autocomplete/README.md +14 -14
- package/src/components/autocomplete/autocomplete.css +10 -3
- package/src/components/autocomplete/autocomplete.examples.json +3 -2
- package/src/components/autocomplete/autocomplete.types.ts +14 -0
- package/src/components/avatar/README.md +8 -8
- package/src/components/avatar/avatar.css +1 -0
- package/src/components/avatar/avatar.types.ts +6 -0
- package/src/components/avatar-group/README.md +11 -10
- package/src/components/avatar-group/avatar-group.svelte +16 -0
- package/src/components/avatar-group/avatar-group.types.ts +10 -0
- package/src/components/backdrop/README.md +9 -9
- package/src/components/badge/README.md +7 -6
- package/src/components/badge/badge.css +1 -1
- package/src/components/banner/README.md +3 -3
- package/src/components/bar-chart/README.md +16 -14
- package/src/components/bar-chart/bar-chart.css +4 -0
- package/src/components/bar-chart/bar-chart.svelte +4 -0
- package/src/components/bar-chart/bar-chart.types.ts +14 -0
- package/src/components/button/README.md +13 -10
- package/src/components/button/button.css +7 -0
- package/src/components/button/button.examples.json +1 -1
- package/src/components/button-group/README.md +7 -7
- package/src/components/button-group/button-group.types.ts +12 -1
- package/src/components/callout/README.md +2 -2
- package/src/components/capability-gate/README.md +14 -14
- package/src/components/capability-gate/capability-gate.css +5 -2
- package/src/components/card/README.md +3 -3
- package/src/components/card/card.types.ts +2 -0
- package/src/components/chart.types.ts +12 -0
- package/src/components/chat/README.md +149 -36
- package/src/components/chat/adapter/chat-adapter.ts +132 -0
- package/src/components/chat/adapter/index.ts +15 -0
- package/src/components/chat/chat.examples.json +26 -2
- package/src/components/chat/chat.types.ts +173 -0
- package/src/components/chat/container/chat-history-trigger.svelte +107 -0
- package/src/components/chat/container/chat-participant-typing.svelte +156 -0
- package/src/components/chat/container/chat-status-announcer.svelte +13 -19
- package/src/components/chat/container/chat.svelte +1326 -226
- package/src/components/chat/container/use-chat-keyboard-nav.svelte.ts +41 -8
- package/src/components/chat/container/use-chat-message-groups.svelte.ts +66 -0
- package/src/components/chat/container/use-chat-read-receipts.svelte.ts +103 -0
- package/src/components/chat/container/use-chat-reasoning-state.svelte.ts +93 -0
- package/src/components/chat/container/use-chat-typing-indicator.svelte.ts +200 -0
- package/src/components/chat/container/use-chat-virtualizer.svelte.ts +328 -0
- package/src/components/chat/index.ts +10 -1
- package/src/components/chat/message/chat-message-parts-renderer.svelte +152 -0
- package/src/components/chat/message/chat-message-parts.ts +163 -0
- package/src/components/chat/message/chat-message.svelte +112 -78
- package/src/components/chat/message/chat-read-receipt.svelte +115 -0
- package/src/components/chat/message/parts/image-part.svelte +27 -0
- package/src/components/chat/message/parts/markdown-part.svelte +23 -0
- package/src/components/chat/message/parts/reasoning-part.svelte +280 -0
- package/src/components/chat/message/parts/step-part.svelte +134 -0
- package/src/components/chat/message/parts/suggestion-part.svelte +99 -0
- package/src/components/chat/message/parts/tool-approval-part.svelte +301 -0
- package/src/components/chat/message/parts/tool-call-part.svelte +31 -0
- package/src/components/chat/message/parts/tool-result-part.svelte +74 -0
- package/src/components/chat/utilities/index.ts +17 -1
- package/src/components/chat/utilities/types.ts +265 -2
- package/src/components/chat/utilities/utilities.ts +325 -1
- package/src/components/chat-conversation-header/README.md +40 -0
- package/src/components/chat-conversation-header/chat-conversation-header.css +51 -0
- package/src/components/chat-conversation-header/chat-conversation-header.examples.json +13 -0
- package/src/components/chat-conversation-header/chat-conversation-header.svelte +83 -0
- package/src/components/chat-conversation-header/chat-conversation-header.types.ts +20 -0
- package/src/components/chat-conversation-header/index.ts +9 -0
- package/src/components/chat-conversation-list/README.md +45 -0
- package/src/components/chat-conversation-list/chat-conversation-list.css +114 -0
- package/src/components/chat-conversation-list/chat-conversation-list.examples.json +13 -0
- package/src/components/chat-conversation-list/chat-conversation-list.svelte +110 -0
- package/src/components/chat-conversation-list/chat-conversation-list.types.ts +18 -0
- package/src/components/chat-conversation-list/conversation-summary.ts +88 -0
- package/src/components/chat-conversation-list/index.ts +11 -0
- package/src/components/checkbox/README.md +1 -1
- package/src/components/checkbox/checkbox.examples.json +1 -1
- package/src/components/checkbox-group/README.md +1 -1
- package/src/components/chip/README.md +9 -9
- package/src/components/chip/chip.svelte +12 -0
- package/src/components/chip/chip.types.ts +22 -0
- package/src/components/choice-grid/README.md +2 -2
- package/src/components/choice-grid-item/README.md +1 -1
- package/src/components/click-away-listener/README.md +6 -6
- package/src/components/code-block/README.md +11 -9
- package/src/components/code-block/code-block.css +77 -47
- package/src/components/code-block/code-block.examples.json +6 -0
- package/src/components/code-block/code-block.svelte +32 -37
- package/src/components/code-block/code-block.types.ts +9 -6
- package/src/components/collapsible/README.md +9 -7
- package/src/components/color-field/README.md +1 -1
- package/src/components/color-field/color-field.examples.json +1 -1
- package/src/components/color-picker/README.md +2 -2
- package/src/components/color-swatch-picker/README.md +13 -13
- package/src/components/combobox/README.md +3 -3
- package/src/components/combobox/combobox.examples.json +1 -1
- package/src/components/combobox/combobox.svelte +64 -6
- package/src/components/command-item/README.md +11 -11
- package/src/components/command-menu/README.md +15 -15
- package/src/components/command-menu/command-menu.examples.json +1 -1
- package/src/components/command-palette/README.md +5 -5
- package/src/components/command-palette/command-palette.css +26 -12
- package/src/components/confirm-dialog/README.md +14 -14
- package/src/components/container/README.md +10 -9
- package/src/components/context-menu/README.md +9 -9
- package/src/components/context-menu/context-menu.context.ts +2 -0
- package/src/components/context-menu/context-menu.svelte +4 -0
- package/src/components/context-menu/context-menu.types.ts +5 -0
- package/src/components/context-menu-trigger/README.md +2 -2
- package/src/components/context-menu-trigger/context-menu-trigger.svelte +6 -0
- package/src/components/context-menu-trigger/context-menu-trigger.types.ts +1 -0
- package/src/components/copy-button/README.md +2 -2
- package/src/components/data-grid/README.md +80 -0
- package/src/components/data-grid/_internal/column-model.svelte.ts +218 -0
- package/src/components/data-grid/_internal/geometry.ts +87 -0
- package/src/components/data-grid/_internal/keyboard-model.ts +131 -0
- package/src/components/data-grid/_internal/selection-model.svelte.ts +168 -0
- package/src/components/data-grid/_internal/sort-model.ts +134 -0
- package/src/components/data-grid/_internal/virtualization-adapter.svelte.ts +505 -0
- package/src/components/data-grid/data-grid-selection-bind-probe.ts +15 -0
- package/src/components/data-grid/data-grid.css +283 -0
- package/src/components/data-grid/data-grid.examples.json +19 -0
- package/src/components/data-grid/data-grid.svelte +1030 -0
- package/src/components/data-grid/data-grid.types.ts +118 -0
- package/src/components/data-grid/index.ts +16 -0
- package/src/components/data-list/README.md +8 -8
- package/src/components/data-list/data-list.types.ts +1 -0
- package/src/components/data-table/README.md +23 -12
- package/src/components/data-table/data-table.css +25 -0
- package/src/components/data-table/data-table.examples.json +6 -0
- package/src/components/data-table/data-table.svelte +305 -13
- package/src/components/data-table/data-table.types.ts +35 -1
- package/src/components/date-range-field/README.md +141 -0
- package/src/components/date-range-field/date-range-field.css +211 -0
- package/src/components/date-range-field/date-range-field.examples.json +31 -0
- package/src/components/date-range-field/date-range-field.svelte +246 -0
- package/src/components/date-range-field/date-range-field.types.ts +78 -0
- package/src/components/date-range-field/index.ts +10 -0
- package/src/components/description-list/README.md +3 -3
- package/src/components/description-list/description-list.types.ts +1 -0
- package/src/components/diff-statistics/README.md +11 -11
- package/src/components/diff-statistics/diff-statistics.types.ts +5 -2
- package/src/components/diff-viewer/README.md +13 -13
- package/src/components/divider/divider.svelte +1 -1
- package/src/components/drawer/README.md +6 -6
- package/src/components/drawer/drawer.examples.json +1 -1
- package/src/components/drawer/drawer.svelte +39 -27
- package/src/components/dropdown/README.md +4 -4
- package/src/components/dropdown/dropdown.examples.json +1 -1
- package/src/components/dropdown/dropdown.types.ts +4 -0
- package/src/components/dropdown-group/README.md +6 -6
- package/src/components/dropdown-group/dropdown-group.types.ts +12 -1
- package/src/components/dropdown-item/README.md +4 -4
- package/src/components/dropdown-item/dropdown-item.types.ts +4 -0
- package/src/components/dropdown-label/README.md +1 -1
- package/src/components/dropdown-label/dropdown-label.types.ts +1 -0
- package/src/components/dropdown-menu/README.md +1 -1
- package/src/components/dropdown-menu/dropdown-menu.types.ts +1 -0
- package/src/components/dropdown-separator/README.md +3 -3
- package/src/components/dropdown-separator/dropdown-separator.types.ts +1 -0
- package/src/components/dropdown-trigger/README.md +1 -1
- package/src/components/dropdown-trigger/dropdown-trigger.types.ts +1 -0
- package/src/components/empty-state/README.md +3 -3
- package/src/components/empty-state/empty-state.types.ts +3 -0
- package/src/components/event-stream-viewer/README.md +147 -0
- package/src/components/event-stream-viewer/event-stream-viewer.css +474 -0
- package/src/components/event-stream-viewer/event-stream-viewer.examples.json +31 -0
- package/src/components/event-stream-viewer/event-stream-viewer.svelte +298 -0
- package/src/components/event-stream-viewer/event-stream-viewer.types.ts +85 -0
- package/src/components/event-stream-viewer/index.ts +11 -0
- package/src/components/faceted-filter-bar/README.md +170 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.css +121 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.examples.json +25 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.svelte +193 -0
- package/src/components/faceted-filter-bar/faceted-filter-bar.types.ts +98 -0
- package/src/components/faceted-filter-bar/index.ts +13 -0
- package/src/components/feed/README.md +2 -2
- package/src/components/feed/feed.types.ts +1 -0
- package/src/components/feed-event/README.md +4 -4
- package/src/components/feed-event/feed-event.types.ts +1 -0
- package/src/components/file-upload/README.md +15 -15
- package/src/components/floating-action-button/README.md +9 -8
- package/src/components/floating-action-button/floating-action-button.css +3 -1
- package/src/components/focus-trap/README.md +8 -7
- package/src/components/focus-trap/focus-trap.types.ts +5 -0
- package/src/components/focus-trap/focus-trap.utilities.svelte.ts +32 -3
- package/src/components/form-field/README.md +10 -10
- package/src/components/form-field/form-field.examples.json +1 -1
- package/src/components/form-section/README.md +9 -9
- package/src/components/grid/README.md +61 -0
- package/src/components/grid/grid.css +24 -0
- package/src/components/grid/grid.examples.json +19 -0
- package/src/components/grid/grid.svelte +62 -0
- package/src/components/grid/grid.types.ts +31 -0
- package/src/components/grid/index.ts +17 -0
- package/src/components/grid-item/README.md +50 -0
- package/src/components/grid-item/grid-item.svelte +55 -0
- package/src/components/grid-item/grid-item.types.ts +22 -0
- package/src/components/grid-item/index.ts +5 -0
- package/src/components/grid-list/README.md +2 -2
- package/src/components/grid-list-item/README.md +11 -11
- package/src/components/grid-list-item/grid-list-item.types.ts +3 -0
- package/src/components/hover-card/README.md +10 -10
- package/src/components/hover-card/hover-card.types.ts +8 -0
- package/src/components/image/README.md +4 -4
- package/src/components/input/README.md +10 -10
- package/src/components/input/input.examples.json +1 -1
- package/src/components/input/input.types.ts +12 -0
- package/src/components/invocation-rule-builder/README.md +128 -0
- package/src/components/invocation-rule-builder/index.ts +13 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.css +281 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.examples.json +19 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.svelte +545 -0
- package/src/components/invocation-rule-builder/invocation-rule-builder.types.ts +144 -0
- package/src/components/json-schema-editor/README.md +14 -14
- package/src/components/json-schema-editor/json-schema-editor.examples.json +1 -1
- package/src/components/json-schema-editor/json-schema-editor.types.ts +1 -0
- package/src/components/json-viewer/README.md +7 -7
- package/src/components/json-viewer/_json-viewer-node.svelte +7 -7
- package/src/components/json-viewer/json-viewer.css +6 -0
- package/src/components/json-viewer/json-viewer.examples.json +37 -0
- package/src/components/kanban-board/README.md +9 -9
- package/src/components/kanban-board/kanban-board.types.ts +4 -0
- package/src/components/kbd/README.md +6 -5
- package/src/components/keyboard-shortcuts/README.md +6 -6
- package/src/components/label/README.md +7 -7
- package/src/components/line-chart/README.md +17 -15
- package/src/components/line-chart/line-chart.examples.json +1 -0
- package/src/components/line-chart/line-chart.types.ts +13 -0
- package/src/components/link/README.md +2 -2
- package/src/components/load-more/README.md +13 -13
- package/src/components/markdown-editor/README.md +11 -11
- package/src/components/markdown-editor/markdown-editor.examples.json +1 -1
- package/src/components/masonry/README.md +49 -0
- package/src/components/masonry/index.ts +6 -0
- package/src/components/masonry/masonry.css +12 -0
- package/src/components/masonry/masonry.examples.json +13 -0
- package/src/components/masonry/masonry.svelte +39 -0
- package/src/components/masonry/masonry.types.ts +16 -0
- package/src/components/matrix-chart/README.md +17 -15
- package/src/components/matrix-chart/matrix-chart.css +4 -0
- package/src/components/matrix-chart/matrix-chart.svelte +19 -1
- package/src/components/matrix-chart/matrix-chart.types.ts +14 -1
- package/src/components/media-controls/README.md +14 -14
- package/src/components/menu-bar/README.md +7 -7
- package/src/components/menu-bar/menu-bar.svelte +9 -0
- package/src/components/menu-bar/menu-bar.types.ts +4 -0
- package/src/components/message/README.md +8 -8
- package/src/components/modal/README.md +16 -16
- package/src/components/modal/modal.examples.json +1 -1
- package/src/components/modal/modal.svelte +19 -1
- package/src/components/modal/modal.types.ts +8 -0
- package/src/components/navigation-bar/README.md +42 -12
- package/src/components/navigation-bar/index.ts +2 -0
- package/src/components/navigation-bar/navigation-bar.css +66 -0
- package/src/components/navigation-bar/navigation-bar.examples.json +6 -0
- package/src/components/navigation-bar/navigation-bar.svelte +16 -6
- package/src/components/navigation-bar/navigation-bar.types.ts +18 -0
- package/src/components/navigation-item/README.md +6 -6
- package/src/components/navigation-item/navigation-item.types.ts +4 -0
- package/src/components/number-input/README.md +13 -13
- package/src/components/number-input/number-input.types.ts +13 -0
- package/src/components/pagination/pagination.css +0 -1
- package/src/components/payload-inspector/README.md +147 -0
- package/src/components/payload-inspector/index.ts +10 -0
- package/src/components/payload-inspector/payload-inspector.css +173 -0
- package/src/components/payload-inspector/payload-inspector.examples.json +31 -0
- package/src/components/payload-inspector/payload-inspector.svelte +386 -0
- package/src/components/payload-inspector/payload-inspector.types.ts +72 -0
- package/src/components/permission-matrix/README.md +61 -0
- package/src/components/permission-matrix/index.ts +12 -0
- package/src/components/permission-matrix/permission-matrix.css +165 -0
- package/src/components/permission-matrix/permission-matrix.examples.json +13 -0
- package/src/components/permission-matrix/permission-matrix.svelte +181 -0
- package/src/components/permission-matrix/permission-matrix.types.ts +73 -0
- package/src/components/phone-input/README.md +18 -18
- package/src/components/phone-input/phone-input.examples.json +1 -1
- package/src/components/pin-input/README.md +19 -19
- package/src/components/pin-input/pin-input.examples.json +1 -1
- package/src/components/popover/README.md +19 -18
- package/src/components/popover/popover.svelte +10 -3
- package/src/components/popover/popover.types.ts +6 -0
- package/src/components/portal/README.md +7 -6
- package/src/components/portal/portal.types.ts +4 -0
- package/src/components/pricing-card/README.md +10 -9
- package/src/components/pricing-card/pricing-card.css +11 -3
- package/src/components/radio-group/README.md +12 -12
- package/src/components/radio-group/radio-group.examples.json +1 -1
- package/src/components/rating/README.md +18 -18
- package/src/components/rating/rating.examples.json +1 -1
- package/src/components/resizable-panels/resizable-panels.types.ts +4 -0
- package/src/components/review-editor/README.md +7 -7
- package/src/components/review-editor/index.ts +1 -1
- package/src/components/review-editor/review-editor-impl.svelte +5 -2
- package/src/components/review-editor/review-editor-selection-geometry.ts +3 -0
- package/src/components/review-editor/review-editor-selection-types.ts +68 -0
- package/src/components/review-editor/review-editor-selection.svelte.ts +2 -63
- package/src/components/review-editor/review-editor.examples.json +1 -1
- package/src/components/run-step-timeline/README.md +152 -0
- package/src/components/run-step-timeline/index.ts +11 -0
- package/src/components/run-step-timeline/run-step-timeline.css +215 -0
- package/src/components/run-step-timeline/run-step-timeline.examples.json +25 -0
- package/src/components/run-step-timeline/run-step-timeline.svelte +234 -0
- package/src/components/run-step-timeline/run-step-timeline.types.ts +123 -0
- package/src/components/schema-form/README.md +59 -0
- package/src/components/schema-form/index.ts +14 -0
- package/src/components/schema-form/schema-form-model.ts +409 -0
- package/src/components/schema-form/schema-form-validation.ts +199 -0
- package/src/components/schema-form/schema-form.css +180 -0
- package/src/components/schema-form/schema-form.examples.json +19 -0
- package/src/components/schema-form/schema-form.svelte +626 -0
- package/src/components/schema-form/schema-form.types.ts +36 -0
- package/src/components/scroll-area/README.md +1 -1
- package/src/components/search-field/README.md +4 -4
- package/src/components/search-field/search-field.examples.json +1 -1
- package/src/components/secret-value-field/README.md +85 -0
- package/src/components/secret-value-field/index.ts +6 -0
- package/src/components/secret-value-field/secret-value-field.css +147 -0
- package/src/components/secret-value-field/secret-value-field.examples.json +31 -0
- package/src/components/secret-value-field/secret-value-field.svelte +223 -0
- package/src/components/secret-value-field/secret-value-field.types.ts +47 -0
- package/src/components/section-heading/README.md +9 -9
- package/src/components/segment/README.md +9 -9
- package/src/components/segmented-control/README.md +4 -4
- package/src/components/segmented-control/segmented-control.css +17 -0
- package/src/components/segmented-control/segmented-control.types.ts +2 -0
- package/src/components/select/README.md +11 -11
- package/src/components/select/select.examples.json +7 -1
- package/src/components/selection-popover/README.md +13 -13
- package/src/components/selection-popover/selection-popover.examples.json +4 -4
- package/src/components/selection-popover/selection-popover.svelte +9 -2
- package/src/components/selection-popover/selection-popover.types.ts +8 -0
- package/src/components/share-card/README.md +12 -12
- package/src/components/share-card/share-card.svelte +159 -141
- package/src/components/sheet/README.md +6 -6
- package/src/components/sheet/sheet.svelte +6 -0
- package/src/components/shortcut-hint/README.md +7 -7
- package/src/components/side-navigation/README.md +5 -5
- package/src/components/side-navigation/side-navigation.examples.json +2 -2
- package/src/components/side-navigation-group/README.md +10 -10
- package/src/components/side-navigation-item/README.md +10 -10
- package/src/components/sidebar/README.md +3 -3
- package/src/components/skeleton/README.md +6 -6
- package/src/components/skeleton/skeleton.types.ts +4 -0
- package/src/components/skip-link/README.md +5 -4
- package/src/components/skip-link/skip-link.examples.json +1 -1
- package/src/components/slider/README.md +16 -16
- package/src/components/slider/slider.types.ts +2 -0
- package/src/components/sortable-list/README.md +12 -12
- package/src/components/sortable-list/sortable-list.types.ts +1 -0
- package/src/components/spectrogram/README.md +13 -11
- package/src/components/spectrogram/spectrogram.css +2 -1
- package/src/components/spectrogram/spectrogram.examples.json +12 -0
- package/src/components/spectrogram/spectrogram.types.ts +12 -1
- package/src/components/spectrum-chart/README.md +12 -10
- package/src/components/spectrum-chart/spectrum-chart.types.ts +9 -0
- package/src/components/speed-dial/README.md +54 -0
- package/src/components/speed-dial/index.ts +25 -0
- package/src/components/speed-dial/speed-dial.context.ts +16 -0
- package/src/components/speed-dial/speed-dial.css +112 -0
- package/src/components/speed-dial/speed-dial.examples.json +19 -0
- package/src/components/speed-dial/speed-dial.svelte +205 -0
- package/src/components/speed-dial/speed-dial.types.ts +59 -0
- package/src/components/speed-dial-action/README.md +51 -0
- package/src/components/speed-dial-action/index.ts +8 -0
- package/src/components/speed-dial-action/speed-dial-action.svelte +77 -0
- package/src/components/speed-dial-action/speed-dial-action.types.ts +50 -0
- package/src/components/stacked-list-item/README.md +21 -11
- package/src/components/stacked-list-item/stacked-list-item.examples.json +25 -0
- package/src/components/stacked-list-item/stacked-list-item.types.ts +4 -0
- package/src/components/stat/README.md +11 -11
- package/src/components/stat-group/README.md +1 -1
- package/src/components/stat-group/stat-group.examples.json +18 -0
- package/src/components/status-dot/status-dot.css +1 -1
- package/src/components/status-dot/status-dot.examples.json +2 -2
- package/src/components/steps/README.md +10 -3
- package/src/components/steps/steps.css +30 -10
- package/src/components/steps/steps.examples.json +12 -0
- package/src/components/subscription-badge/subscription-badge.examples.json +1 -1
- package/src/components/subscription-badge/subscription-badge.svelte +1 -1
- package/src/components/surface/README.md +6 -5
- package/src/components/surface/surface.types.ts +1 -0
- package/src/components/tab/README.md +8 -8
- package/src/components/tab-list/README.md +6 -6
- package/src/components/tab-panel/README.md +1 -1
- package/src/components/table/README.md +2 -2
- package/src/components/table/table.css +23 -4
- package/src/components/table/table.svelte +26 -1
- package/src/components/table/table.types.ts +2 -1
- package/src/components/table-body/README.md +4 -4
- package/src/components/table-cell/README.md +6 -6
- package/src/components/table-cell/table-cell.types.ts +4 -7
- package/src/components/table-header/README.md +2 -2
- package/src/components/table-header-cell/README.md +1 -1
- package/src/components/table-row/README.md +3 -3
- package/src/components/table-row/table-row.svelte +2 -1
- package/src/components/table-row/table-row.types.ts +4 -1
- package/src/components/tabs/README.md +1 -1
- package/src/components/tabs/tabs.css +1 -1
- package/src/components/tag-input/README.md +29 -29
- package/src/components/tag-input/tag-input.css +2 -2
- package/src/components/tag-input/tag-input.examples.json +7 -1
- package/src/components/tag-input/tag-input.svelte +18 -0
- package/src/components/textarea/README.md +4 -2
- package/src/components/textarea/textarea.css +1 -0
- package/src/components/textarea/textarea.examples.json +19 -1
- package/src/components/textarea/textarea.types.ts +10 -0
- package/src/components/timeline/README.md +12 -10
- package/src/components/timeline/timeline.css +40 -8
- package/src/components/timeline/timeline.examples.json +9 -3
- package/src/components/timeline/timeline.svelte +6 -3
- package/src/components/timeline/timeline.types.ts +2 -2
- package/src/components/toast-region/README.md +7 -7
- package/src/components/toast-region/toast-region.svelte +54 -1
- package/src/components/toggle/README.md +1 -1
- package/src/components/toggle/toggle.css +5 -2
- package/src/components/toggle/toggle.examples.json +7 -1
- package/src/components/toolbar/README.md +5 -4
- package/src/components/tooltip/README.md +7 -7
- package/src/components/tooltip/tooltip.css +11 -2
- package/src/components/tooltip/tooltip.types.ts +4 -0
- package/src/components/transfer-list/README.md +52 -0
- package/src/components/transfer-list/index.ts +10 -0
- package/src/components/transfer-list/transfer-list.css +114 -0
- package/src/components/transfer-list/transfer-list.examples.json +13 -0
- package/src/components/transfer-list/transfer-list.svelte +394 -0
- package/src/components/transfer-list/transfer-list.types.ts +55 -0
- package/src/components/tree/README.md +29 -15
- package/src/components/tree/index.ts +16 -3
- package/src/components/tree/tree.css +203 -3
- package/src/components/tree/tree.examples.json +12 -0
- package/src/components/tree/tree.svelte +981 -45
- package/src/components/tree/tree.types.ts +80 -3
- package/src/components/tree-item/README.md +14 -12
- package/src/components/tree-item/tree-item.svelte +410 -7
- package/src/components/tree-item/tree-item.types.ts +11 -3
- package/src/components/typography/README.md +8 -7
- package/src/components/virtual-list/README.md +70 -0
- package/src/components/virtual-list/index.ts +16 -0
- package/src/components/virtual-list/virtual-list.css +30 -0
- package/src/components/virtual-list/virtual-list.examples.json +13 -0
- package/src/components/virtual-list/virtual-list.svelte +192 -0
- package/src/components/virtual-list/virtual-list.types.ts +60 -0
- package/src/components/visually-hidden/README.md +6 -5
- package/src/components/waveform/README.md +13 -11
- package/src/components/waveform/waveform.examples.json +12 -0
- package/src/components/waveform/waveform.types.ts +9 -0
- package/src/highlighters/shiki/index.ts +11 -1
- package/src/index.ts +145 -3
- package/src/schema-types.ts +10 -0
- package/src/styles/all.css.d.ts +7 -0
- package/src/styles/base-guard.ts +95 -0
- package/src/styles/components/_dismiss-button.css +1 -1
- package/src/styles/components/_floating-surface.css +32 -2
- package/src/styles/components/_input-frame.css +29 -0
- package/src/styles/components.css +19 -2
- package/src/styles/foundation.css.d.ts +7 -0
- package/src/styles/index.css.d.ts +7 -0
- package/src/styles/tokens-base.css +110 -42
- package/src/styles/tokens.css.d.ts +7 -0
- package/src/styles/utilities.css.d.ts +7 -0
- package/src/utilities/clipboard.ts +2 -0
- package/src/utilities/fixed-virtual-window.ts +99 -0
- package/dist/components/accordion/accordion.fixture.svelte.d.ts +0 -8
- package/dist/components/dropdown/dropdown.fixture.svelte.d.ts +0 -7
- package/dist/components/experimental/timeline/index.d.ts +0 -2
- package/dist/components/experimental/timeline/index.js +0 -70
- package/dist/components/experimental/timeline-item/index.d.ts +0 -2
- package/dist/components/experimental/timeline-item/index.js +0 -70
- package/dist/components/modal/modal.fixture.svelte.d.ts +0 -9
- package/dist/components/navigation-item/navigation-item.fixture.svelte.d.ts +0 -7
- package/dist/components/segmented-control/segmented-control.fixture.svelte.d.ts +0 -7
- package/dist/components/side-navigation/side-navigation.fixture.svelte.d.ts +0 -8
- package/dist/components/table/table.fixture.svelte.d.ts +0 -4
- package/dist/components/tabs/tabs.fixture.svelte.d.ts +0 -7
- package/dist/components/timeline-item/index.d.ts +0 -5
- package/dist/components/timeline-item/index.js +0 -171
- package/dist/components/timeline-item/timeline-item.css +0 -7
- package/dist/components/timeline-item/timeline-item.schema.js +0 -103
- package/dist/components/timeline-item/timeline-item.variables.js +0 -61
- package/dist/server/components/experimental/timeline/index.js +0 -54
- package/dist/server/components/experimental/timeline-item/index.js +0 -54
- package/dist/server/components/timeline-item/index.css +0 -2
- package/dist/server/components/timeline-item/index.js +0 -108
- package/dist/server/components/timeline-item/timeline-item.schema.js +0 -85
- package/dist/server/components/timeline-item/timeline-item.variables.js +0 -43
- package/src/components/_radio/radio.schema.json +0 -36
- package/src/components/_radio/radio.schema.ts +0 -41
- package/src/components/_radio/radio.variables.json +0 -1
- package/src/components/_radio/radio.variables.ts +0 -3
- package/src/components/_tree-select-all/tree-select-all.css +0 -38
- package/src/components/_tree-select-all/tree-select-all.schema.json +0 -38
- package/src/components/_tree-select-all/tree-select-all.schema.ts +0 -43
- package/src/components/_tree-select-all/tree-select-all.variables.json +0 -1
- package/src/components/_tree-select-all/tree-select-all.variables.ts +0 -3
- package/src/components/accordion/accordion.fixture.svelte +0 -32
- package/src/components/accordion/accordion.schema.json +0 -16
- package/src/components/accordion/accordion.schema.ts +0 -20
- package/src/components/accordion/accordion.variables.json +0 -1
- package/src/components/accordion/accordion.variables.ts +0 -3
- package/src/components/accordion-item/accordion-item.schema.json +0 -25
- package/src/components/accordion-item/accordion-item.schema.ts +0 -29
- package/src/components/accordion-item/accordion-item.variables.json +0 -1
- package/src/components/accordion-item/accordion-item.variables.ts +0 -3
- package/src/components/alert/alert.schema.json +0 -21
- package/src/components/alert/alert.schema.ts +0 -26
- package/src/components/alert/alert.variables.json +0 -1
- package/src/components/alert/alert.variables.ts +0 -3
- package/src/components/alert-dialog/alert-dialog.schema.json +0 -45
- package/src/components/alert-dialog/alert-dialog.schema.ts +0 -49
- package/src/components/alert-dialog/alert-dialog.variables.json +0 -1
- package/src/components/alert-dialog/alert-dialog.variables.ts +0 -3
- package/src/components/area-chart/area-chart.schema.json +0 -117
- package/src/components/area-chart/area-chart.schema.ts +0 -121
- package/src/components/area-chart/area-chart.variables.json +0 -1
- package/src/components/area-chart/area-chart.variables.ts +0 -3
- package/src/components/aspect-ratio/aspect-ratio.schema.json +0 -133
- package/src/components/aspect-ratio/aspect-ratio.schema.ts +0 -137
- package/src/components/aspect-ratio/aspect-ratio.variables.json +0 -1
- package/src/components/aspect-ratio/aspect-ratio.variables.ts +0 -3
- package/src/components/autocomplete/autocomplete.schema.json +0 -65
- package/src/components/autocomplete/autocomplete.schema.ts +0 -69
- package/src/components/autocomplete/autocomplete.variables.json +0 -1
- package/src/components/autocomplete/autocomplete.variables.ts +0 -3
- package/src/components/avatar/avatar.schema.json +0 -35
- package/src/components/avatar/avatar.schema.ts +0 -40
- package/src/components/avatar/avatar.variables.json +0 -1
- package/src/components/avatar/avatar.variables.ts +0 -3
- package/src/components/avatar-group/avatar-group.schema.json +0 -64
- package/src/components/avatar-group/avatar-group.schema.ts +0 -69
- package/src/components/avatar-group/avatar-group.variables.json +0 -1
- package/src/components/avatar-group/avatar-group.variables.ts +0 -3
- package/src/components/backdrop/backdrop.schema.json +0 -42
- package/src/components/backdrop/backdrop.schema.ts +0 -49
- package/src/components/backdrop/backdrop.variables.json +0 -1
- package/src/components/backdrop/backdrop.variables.ts +0 -3
- package/src/components/badge/badge.schema.json +0 -26
- package/src/components/badge/badge.schema.ts +0 -31
- package/src/components/badge/badge.variables.json +0 -1
- package/src/components/badge/badge.variables.ts +0 -3
- package/src/components/banner/banner.schema.json +0 -35
- package/src/components/banner/banner.schema.ts +0 -40
- package/src/components/banner/banner.variables.json +0 -1
- package/src/components/banner/banner.variables.ts +0 -3
- package/src/components/bar-chart/bar-chart.schema.json +0 -118
- package/src/components/bar-chart/bar-chart.schema.ts +0 -125
- package/src/components/bar-chart/bar-chart.variables.json +0 -1
- package/src/components/bar-chart/bar-chart.variables.ts +0 -3
- package/src/components/breadcrumbs/breadcrumbs.schema.json +0 -21
- package/src/components/breadcrumbs/breadcrumbs.schema.ts +0 -25
- package/src/components/breadcrumbs/breadcrumbs.variables.json +0 -1
- package/src/components/breadcrumbs/breadcrumbs.variables.ts +0 -3
- package/src/components/button/button.schema.json +0 -44
- package/src/components/button/button.schema.ts +0 -48
- package/src/components/button/button.variables.json +0 -1
- package/src/components/button/button.variables.ts +0 -3
- package/src/components/button-group/button-group.schema.json +0 -29
- package/src/components/button-group/button-group.schema.ts +0 -33
- package/src/components/button-group/button-group.variables.json +0 -1
- package/src/components/button-group/button-group.variables.ts +0 -3
- package/src/components/callout/callout.schema.json +0 -31
- package/src/components/callout/callout.schema.ts +0 -37
- package/src/components/callout/callout.variables.json +0 -1
- package/src/components/callout/callout.variables.ts +0 -3
- package/src/components/capability-gate/capability-gate.schema.json +0 -68
- package/src/components/capability-gate/capability-gate.schema.ts +0 -72
- package/src/components/capability-gate/capability-gate.variables.json +0 -1
- package/src/components/capability-gate/capability-gate.variables.ts +0 -3
- package/src/components/card/card.schema.json +0 -57
- package/src/components/card/card.schema.ts +0 -63
- package/src/components/card/card.variables.json +0 -1
- package/src/components/card/card.variables.ts +0 -3
- package/src/components/chat/chat.schema.json +0 -131
- package/src/components/chat/chat.schema.ts +0 -135
- package/src/components/chat/chat.variables.json +0 -1
- package/src/components/chat/chat.variables.ts +0 -3
- package/src/components/checkbox/checkbox.schema.json +0 -43
- package/src/components/checkbox/checkbox.schema.ts +0 -48
- package/src/components/checkbox/checkbox.variables.json +0 -1
- package/src/components/checkbox/checkbox.variables.ts +0 -3
- package/src/components/checkbox-group/checkbox-group.schema.json +0 -43
- package/src/components/checkbox-group/checkbox-group.schema.ts +0 -51
- package/src/components/checkbox-group/checkbox-group.variables.json +0 -1
- package/src/components/checkbox-group/checkbox-group.variables.ts +0 -3
- package/src/components/chip/chip.schema.json +0 -51
- package/src/components/chip/chip.schema.ts +0 -55
- package/src/components/chip/chip.variables.json +0 -1
- package/src/components/chip/chip.variables.ts +0 -3
- package/src/components/choice-grid/choice-grid.schema.json +0 -61
- package/src/components/choice-grid/choice-grid.schema.ts +0 -70
- package/src/components/choice-grid/choice-grid.variables.json +0 -1
- package/src/components/choice-grid/choice-grid.variables.ts +0 -3
- package/src/components/choice-grid-item/choice-grid-item.schema.json +0 -32
- package/src/components/choice-grid-item/choice-grid-item.schema.ts +0 -38
- package/src/components/choice-grid-item/choice-grid-item.variables.json +0 -1
- package/src/components/choice-grid-item/choice-grid-item.variables.ts +0 -3
- package/src/components/click-away-listener/click-away-listener.schema.json +0 -27
- package/src/components/click-away-listener/click-away-listener.schema.ts +0 -32
- package/src/components/click-away-listener/click-away-listener.variables.json +0 -1
- package/src/components/click-away-listener/click-away-listener.variables.ts +0 -3
- package/src/components/code-block/code-block.schema.json +0 -36
- package/src/components/code-block/code-block.schema.ts +0 -42
- package/src/components/code-block/code-block.variables.json +0 -1
- package/src/components/code-block/code-block.variables.ts +0 -3
- package/src/components/collapsible/collapsible.schema.json +0 -30
- package/src/components/collapsible/collapsible.schema.ts +0 -36
- package/src/components/collapsible/collapsible.variables.json +0 -1
- package/src/components/collapsible/collapsible.variables.ts +0 -3
- package/src/components/color-field/color-field.schema.json +0 -79
- package/src/components/color-field/color-field.schema.ts +0 -90
- package/src/components/color-field/color-field.variables.json +0 -1
- package/src/components/color-field/color-field.variables.ts +0 -3
- package/src/components/color-picker/color-picker.schema.json +0 -54
- package/src/components/color-picker/color-picker.schema.ts +0 -60
- package/src/components/color-picker/color-picker.variables.json +0 -1
- package/src/components/color-picker/color-picker.variables.ts +0 -3
- package/src/components/color-swatch-picker/color-swatch-picker.schema.json +0 -56
- package/src/components/color-swatch-picker/color-swatch-picker.schema.ts +0 -62
- package/src/components/color-swatch-picker/color-swatch-picker.variables.json +0 -1
- package/src/components/color-swatch-picker/color-swatch-picker.variables.ts +0 -3
- package/src/components/combobox/combobox.schema.json +0 -64
- package/src/components/combobox/combobox.schema.ts +0 -69
- package/src/components/combobox/combobox.variables.json +0 -1
- package/src/components/combobox/combobox.variables.ts +0 -3
- package/src/components/command-item/command-item.schema.json +0 -48
- package/src/components/command-item/command-item.schema.ts +0 -52
- package/src/components/command-item/command-item.variables.json +0 -1
- package/src/components/command-item/command-item.variables.ts +0 -3
- package/src/components/command-menu/command-menu.schema.json +0 -73
- package/src/components/command-menu/command-menu.schema.ts +0 -77
- package/src/components/command-menu/command-menu.variables.json +0 -1
- package/src/components/command-menu/command-menu.variables.ts +0 -3
- package/src/components/command-palette/command-palette.schema.json +0 -52
- package/src/components/command-palette/command-palette.schema.ts +0 -58
- package/src/components/command-palette/command-palette.variables.json +0 -1
- package/src/components/command-palette/command-palette.variables.ts +0 -3
- package/src/components/confirm-dialog/confirm-dialog.schema.json +0 -52
- package/src/components/confirm-dialog/confirm-dialog.schema.ts +0 -60
- package/src/components/confirm-dialog/confirm-dialog.variables.json +0 -1
- package/src/components/confirm-dialog/confirm-dialog.variables.ts +0 -3
- package/src/components/connection-indicator/connection-indicator.schema.json +0 -20
- package/src/components/connection-indicator/connection-indicator.schema.ts +0 -24
- package/src/components/connection-indicator/connection-indicator.variables.json +0 -1
- package/src/components/connection-indicator/connection-indicator.variables.ts +0 -3
- package/src/components/container/container.schema.json +0 -130
- package/src/components/container/container.schema.ts +0 -134
- package/src/components/container/container.variables.json +0 -1
- package/src/components/container/container.variables.ts +0 -3
- package/src/components/context-menu/context-menu.schema.json +0 -44
- package/src/components/context-menu/context-menu.schema.ts +0 -48
- package/src/components/context-menu/context-menu.variables.json +0 -1
- package/src/components/context-menu/context-menu.variables.ts +0 -3
- package/src/components/context-menu-trigger/context-menu-trigger.schema.json +0 -18
- package/src/components/context-menu-trigger/context-menu-trigger.schema.ts +0 -22
- package/src/components/context-menu-trigger/context-menu-trigger.variables.json +0 -1
- package/src/components/context-menu-trigger/context-menu-trigger.variables.ts +0 -3
- package/src/components/copy-button/copy-button.schema.json +0 -44
- package/src/components/copy-button/copy-button.schema.ts +0 -50
- package/src/components/copy-button/copy-button.variables.json +0 -1
- package/src/components/copy-button/copy-button.variables.ts +0 -3
- package/src/components/data-list/data-list.schema.json +0 -34
- package/src/components/data-list/data-list.schema.ts +0 -39
- package/src/components/data-list/data-list.variables.json +0 -1
- package/src/components/data-list/data-list.variables.ts +0 -3
- package/src/components/data-table/data-table.schema.json +0 -43
- package/src/components/data-table/data-table.schema.ts +0 -50
- package/src/components/data-table/data-table.variables.json +0 -1
- package/src/components/data-table/data-table.variables.ts +0 -3
- package/src/components/description-list/description-list.schema.json +0 -26
- package/src/components/description-list/description-list.schema.ts +0 -31
- package/src/components/description-list/description-list.variables.json +0 -1
- package/src/components/description-list/description-list.variables.ts +0 -3
- package/src/components/diff-statistics/diff-statistics.schema.json +0 -36
- package/src/components/diff-statistics/diff-statistics.schema.ts +0 -41
- package/src/components/diff-statistics/diff-statistics.variables.json +0 -1
- package/src/components/diff-statistics/diff-statistics.variables.ts +0 -3
- package/src/components/diff-viewer/diff-viewer.schema.json +0 -56
- package/src/components/diff-viewer/diff-viewer.schema.ts +0 -62
- package/src/components/diff-viewer/diff-viewer.variables.json +0 -1
- package/src/components/diff-viewer/diff-viewer.variables.ts +0 -3
- package/src/components/divider/divider.schema.json +0 -31
- package/src/components/divider/divider.schema.ts +0 -35
- package/src/components/divider/divider.variables.json +0 -1
- package/src/components/divider/divider.variables.ts +0 -3
- package/src/components/drawer/drawer.schema.json +0 -52
- package/src/components/drawer/drawer.schema.ts +0 -58
- package/src/components/drawer/drawer.variables.json +0 -1
- package/src/components/drawer/drawer.variables.ts +0 -3
- package/src/components/dropdown/dropdown.fixture.svelte +0 -28
- package/src/components/dropdown/dropdown.schema.json +0 -31
- package/src/components/dropdown/dropdown.schema.ts +0 -35
- package/src/components/dropdown/dropdown.variables.json +0 -1
- package/src/components/dropdown/dropdown.variables.ts +0 -3
- package/src/components/dropdown-group/dropdown-group.schema.json +0 -25
- package/src/components/dropdown-group/dropdown-group.schema.ts +0 -29
- package/src/components/dropdown-group/dropdown-group.variables.json +0 -1
- package/src/components/dropdown-group/dropdown-group.variables.ts +0 -3
- package/src/components/dropdown-item/dropdown-item.schema.json +0 -39
- package/src/components/dropdown-item/dropdown-item.schema.ts +0 -45
- package/src/components/dropdown-item/dropdown-item.variables.json +0 -1
- package/src/components/dropdown-item/dropdown-item.variables.ts +0 -3
- package/src/components/dropdown-label/dropdown-label.schema.json +0 -18
- package/src/components/dropdown-label/dropdown-label.schema.ts +0 -22
- package/src/components/dropdown-label/dropdown-label.variables.json +0 -1
- package/src/components/dropdown-label/dropdown-label.variables.ts +0 -3
- package/src/components/dropdown-menu/dropdown-menu.schema.json +0 -18
- package/src/components/dropdown-menu/dropdown-menu.schema.ts +0 -22
- package/src/components/dropdown-menu/dropdown-menu.variables.json +0 -1
- package/src/components/dropdown-menu/dropdown-menu.variables.ts +0 -3
- package/src/components/dropdown-separator/dropdown-separator.schema.json +0 -10
- package/src/components/dropdown-separator/dropdown-separator.schema.ts +0 -14
- package/src/components/dropdown-separator/dropdown-separator.variables.json +0 -1
- package/src/components/dropdown-separator/dropdown-separator.variables.ts +0 -3
- package/src/components/dropdown-trigger/dropdown-trigger.schema.json +0 -22
- package/src/components/dropdown-trigger/dropdown-trigger.schema.ts +0 -26
- package/src/components/dropdown-trigger/dropdown-trigger.variables.json +0 -1
- package/src/components/dropdown-trigger/dropdown-trigger.variables.ts +0 -3
- package/src/components/empty-state/empty-state.schema.json +0 -34
- package/src/components/empty-state/empty-state.schema.ts +0 -38
- package/src/components/empty-state/empty-state.variables.json +0 -1
- package/src/components/empty-state/empty-state.variables.ts +0 -3
- package/src/components/experimental/timeline/index.ts +0 -25
- package/src/components/experimental/timeline-item/index.ts +0 -17
- package/src/components/feed/feed.schema.json +0 -22
- package/src/components/feed/feed.schema.ts +0 -27
- package/src/components/feed/feed.variables.json +0 -1
- package/src/components/feed/feed.variables.ts +0 -3
- package/src/components/feed-event/feed-event.schema.json +0 -39
- package/src/components/feed-event/feed-event.schema.ts +0 -45
- package/src/components/feed-event/feed-event.variables.json +0 -1
- package/src/components/feed-event/feed-event.variables.ts +0 -3
- package/src/components/file-upload/file-upload.schema.json +0 -63
- package/src/components/file-upload/file-upload.schema.ts +0 -67
- package/src/components/file-upload/file-upload.variables.json +0 -6
- package/src/components/file-upload/file-upload.variables.ts +0 -8
- package/src/components/floating-action-button/floating-action-button.schema.json +0 -35
- package/src/components/floating-action-button/floating-action-button.schema.ts +0 -39
- package/src/components/floating-action-button/floating-action-button.variables.json +0 -1
- package/src/components/floating-action-button/floating-action-button.variables.ts +0 -3
- package/src/components/focus-trap/focus-trap.schema.json +0 -36
- package/src/components/focus-trap/focus-trap.schema.ts +0 -40
- package/src/components/focus-trap/focus-trap.variables.json +0 -1
- package/src/components/focus-trap/focus-trap.variables.ts +0 -3
- package/src/components/form-field/form-field.schema.json +0 -44
- package/src/components/form-field/form-field.schema.ts +0 -50
- package/src/components/form-field/form-field.variables.json +0 -1
- package/src/components/form-field/form-field.variables.ts +0 -3
- package/src/components/form-section/form-section.schema.json +0 -39
- package/src/components/form-section/form-section.schema.ts +0 -43
- package/src/components/form-section/form-section.variables.json +0 -1
- package/src/components/form-section/form-section.variables.ts +0 -3
- package/src/components/grid-list/grid-list.schema.json +0 -23
- package/src/components/grid-list/grid-list.schema.ts +0 -28
- package/src/components/grid-list/grid-list.variables.json +0 -1
- package/src/components/grid-list/grid-list.variables.ts +0 -3
- package/src/components/grid-list-item/grid-list-item.schema.json +0 -51
- package/src/components/grid-list-item/grid-list-item.schema.ts +0 -55
- package/src/components/grid-list-item/grid-list-item.variables.json +0 -1
- package/src/components/grid-list-item/grid-list-item.variables.ts +0 -3
- package/src/components/hover-card/hover-card.schema.json +0 -64
- package/src/components/hover-card/hover-card.schema.ts +0 -68
- package/src/components/hover-card/hover-card.variables.json +0 -1
- package/src/components/hover-card/hover-card.variables.ts +0 -3
- package/src/components/image/image.schema.json +0 -60
- package/src/components/image/image.schema.ts +0 -68
- package/src/components/image/image.variables.json +0 -1
- package/src/components/image/image.variables.ts +0 -3
- package/src/components/input/input.schema.json +0 -55
- package/src/components/input/input.schema.ts +0 -59
- package/src/components/input/input.variables.json +0 -1
- package/src/components/input/input.variables.ts +0 -3
- package/src/components/json-schema-editor/json-schema-editor.schema.json +0 -59
- package/src/components/json-schema-editor/json-schema-editor.schema.ts +0 -63
- package/src/components/json-schema-editor/json-schema-editor.variables.json +0 -1
- package/src/components/json-schema-editor/json-schema-editor.variables.ts +0 -3
- package/src/components/json-viewer/json-viewer.schema.json +0 -31
- package/src/components/json-viewer/json-viewer.schema.ts +0 -36
- package/src/components/json-viewer/json-viewer.variables.json +0 -1
- package/src/components/json-viewer/json-viewer.variables.ts +0 -3
- package/src/components/kanban-board/kanban-board.schema.json +0 -55
- package/src/components/kanban-board/kanban-board.schema.ts +0 -59
- package/src/components/kanban-board/kanban-board.variables.json +0 -6
- package/src/components/kanban-board/kanban-board.variables.ts +0 -8
- package/src/components/kbd/kbd.schema.json +0 -20
- package/src/components/kbd/kbd.schema.ts +0 -24
- package/src/components/kbd/kbd.variables.json +0 -1
- package/src/components/kbd/kbd.variables.ts +0 -3
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.schema.json +0 -27
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.schema.ts +0 -31
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.variables.json +0 -1
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.variables.ts +0 -3
- package/src/components/label/label.schema.json +0 -32
- package/src/components/label/label.schema.ts +0 -37
- package/src/components/label/label.variables.json +0 -1
- package/src/components/label/label.variables.ts +0 -3
- package/src/components/line-chart/line-chart.schema.json +0 -114
- package/src/components/line-chart/line-chart.schema.ts +0 -118
- package/src/components/line-chart/line-chart.variables.json +0 -1
- package/src/components/line-chart/line-chart.variables.ts +0 -3
- package/src/components/link/link.schema.json +0 -58
- package/src/components/link/link.schema.ts +0 -68
- package/src/components/link/link.variables.json +0 -1
- package/src/components/link/link.variables.ts +0 -3
- package/src/components/load-more/load-more.schema.json +0 -55
- package/src/components/load-more/load-more.schema.ts +0 -59
- package/src/components/load-more/load-more.variables.json +0 -1
- package/src/components/load-more/load-more.variables.ts +0 -3
- package/src/components/markdown-editor/markdown-editor.schema.json +0 -100
- package/src/components/markdown-editor/markdown-editor.schema.ts +0 -105
- package/src/components/markdown-editor/markdown-editor.variables.json +0 -1
- package/src/components/markdown-editor/markdown-editor.variables.ts +0 -3
- package/src/components/matrix-chart/matrix-chart.schema.json +0 -63
- package/src/components/matrix-chart/matrix-chart.schema.ts +0 -67
- package/src/components/matrix-chart/matrix-chart.variables.json +0 -1
- package/src/components/matrix-chart/matrix-chart.variables.ts +0 -3
- package/src/components/media-controls/media-controls.schema.json +0 -65
- package/src/components/media-controls/media-controls.schema.ts +0 -69
- package/src/components/media-controls/media-controls.variables.json +0 -1
- package/src/components/media-controls/media-controls.variables.ts +0 -3
- package/src/components/menu-bar/menu-bar.schema.json +0 -27
- package/src/components/menu-bar/menu-bar.schema.ts +0 -31
- package/src/components/menu-bar/menu-bar.variables.json +0 -1
- package/src/components/menu-bar/menu-bar.variables.ts +0 -3
- package/src/components/message/message.schema.json +0 -36
- package/src/components/message/message.schema.ts +0 -42
- package/src/components/message/message.variables.json +0 -1
- package/src/components/message/message.variables.ts +0 -3
- package/src/components/modal/modal.fixture.svelte +0 -89
- package/src/components/modal/modal.schema.json +0 -68
- package/src/components/modal/modal.schema.ts +0 -8
- package/src/components/modal/modal.variables.json +0 -1
- package/src/components/modal/modal.variables.ts +0 -3
- package/src/components/navigation-bar/navigation-bar.schema.json +0 -39
- package/src/components/navigation-bar/navigation-bar.schema.ts +0 -44
- package/src/components/navigation-bar/navigation-bar.variables.json +0 -1
- package/src/components/navigation-bar/navigation-bar.variables.ts +0 -3
- package/src/components/navigation-item/navigation-item.fixture.svelte +0 -21
- package/src/components/navigation-item/navigation-item.schema.json +0 -39
- package/src/components/navigation-item/navigation-item.schema.ts +0 -45
- package/src/components/navigation-item/navigation-item.variables.json +0 -1
- package/src/components/navigation-item/navigation-item.variables.ts +0 -3
- package/src/components/number-input/number-input.schema.json +0 -77
- package/src/components/number-input/number-input.schema.ts +0 -81
- package/src/components/number-input/number-input.variables.json +0 -1
- package/src/components/number-input/number-input.variables.ts +0 -3
- package/src/components/pagination/pagination.schema.json +0 -24
- package/src/components/pagination/pagination.schema.ts +0 -28
- package/src/components/pagination/pagination.variables.json +0 -1
- package/src/components/pagination/pagination.variables.ts +0 -3
- package/src/components/phone-input/phone-input.schema.json +0 -571
- package/src/components/phone-input/phone-input.schema.ts +0 -577
- package/src/components/phone-input/phone-input.variables.json +0 -1
- package/src/components/phone-input/phone-input.variables.ts +0 -3
- package/src/components/pin-input/pin-input.schema.json +0 -80
- package/src/components/pin-input/pin-input.schema.ts +0 -86
- package/src/components/pin-input/pin-input.variables.json +0 -1
- package/src/components/pin-input/pin-input.variables.ts +0 -3
- package/src/components/popover/popover.schema.json +0 -80
- package/src/components/popover/popover.schema.ts +0 -84
- package/src/components/popover/popover.variables.json +0 -1
- package/src/components/popover/popover.variables.ts +0 -3
- package/src/components/portal/portal.schema.json +0 -26
- package/src/components/portal/portal.schema.ts +0 -30
- package/src/components/portal/portal.variables.json +0 -1
- package/src/components/portal/portal.variables.ts +0 -3
- package/src/components/pricing-card/pricing-card.schema.json +0 -40
- package/src/components/pricing-card/pricing-card.schema.ts +0 -44
- package/src/components/pricing-card/pricing-card.variables.json +0 -1
- package/src/components/pricing-card/pricing-card.variables.ts +0 -3
- package/src/components/progress/progress.schema.json +0 -39
- package/src/components/progress/progress.schema.ts +0 -46
- package/src/components/progress/progress.variables.json +0 -1
- package/src/components/progress/progress.variables.ts +0 -3
- package/src/components/radio-group/radio-group.schema.json +0 -52
- package/src/components/radio-group/radio-group.schema.ts +0 -58
- package/src/components/radio-group/radio-group.variables.json +0 -1
- package/src/components/radio-group/radio-group.variables.ts +0 -3
- package/src/components/rating/rating.schema.json +0 -76
- package/src/components/rating/rating.schema.ts +0 -83
- package/src/components/rating/rating.variables.json +0 -1
- package/src/components/rating/rating.variables.ts +0 -3
- package/src/components/resizable-panels/resizable-panels.schema.json +0 -47
- package/src/components/resizable-panels/resizable-panels.schema.ts +0 -51
- package/src/components/resizable-panels/resizable-panels.variables.json +0 -1
- package/src/components/resizable-panels/resizable-panels.variables.ts +0 -3
- package/src/components/review-editor/review-editor.schema.json +0 -76
- package/src/components/review-editor/review-editor.schema.ts +0 -81
- package/src/components/review-editor/review-editor.variables.json +0 -1
- package/src/components/review-editor/review-editor.variables.ts +0 -3
- package/src/components/scroll-area/scroll-area.schema.json +0 -43
- package/src/components/scroll-area/scroll-area.schema.ts +0 -49
- package/src/components/scroll-area/scroll-area.variables.json +0 -1
- package/src/components/scroll-area/scroll-area.variables.ts +0 -3
- package/src/components/search-field/search-field.schema.json +0 -59
- package/src/components/search-field/search-field.schema.ts +0 -64
- package/src/components/search-field/search-field.variables.json +0 -1
- package/src/components/search-field/search-field.variables.ts +0 -3
- package/src/components/section-heading/section-heading.schema.json +0 -40
- package/src/components/section-heading/section-heading.schema.ts +0 -46
- package/src/components/section-heading/section-heading.variables.json +0 -1
- package/src/components/section-heading/section-heading.variables.ts +0 -3
- package/src/components/segment/segment.schema.json +0 -39
- package/src/components/segment/segment.schema.ts +0 -44
- package/src/components/segment/segment.variables.json +0 -1
- package/src/components/segment/segment.variables.ts +0 -3
- package/src/components/segmented-control/segmented-control.fixture.svelte +0 -31
- package/src/components/segmented-control/segmented-control.schema.json +0 -75
- package/src/components/segmented-control/segmented-control.schema.ts +0 -82
- package/src/components/segmented-control/segmented-control.variables.json +0 -1
- package/src/components/segmented-control/segmented-control.variables.ts +0 -3
- package/src/components/select/select.schema.json +0 -48
- package/src/components/select/select.schema.ts +0 -53
- package/src/components/select/select.variables.json +0 -1
- package/src/components/select/select.variables.ts +0 -3
- package/src/components/selection-popover/selection-popover.schema.json +0 -44
- package/src/components/selection-popover/selection-popover.schema.ts +0 -48
- package/src/components/selection-popover/selection-popover.variables.json +0 -1
- package/src/components/selection-popover/selection-popover.variables.ts +0 -3
- package/src/components/share-card/share-card.schema.json +0 -53
- package/src/components/share-card/share-card.schema.ts +0 -57
- package/src/components/share-card/share-card.variables.json +0 -1
- package/src/components/share-card/share-card.variables.ts +0 -3
- package/src/components/sheet/sheet.schema.json +0 -48
- package/src/components/sheet/sheet.schema.ts +0 -55
- package/src/components/sheet/sheet.variables.json +0 -1
- package/src/components/sheet/sheet.variables.ts +0 -3
- package/src/components/shortcut-hint/shortcut-hint.schema.json +0 -36
- package/src/components/shortcut-hint/shortcut-hint.schema.ts +0 -40
- package/src/components/shortcut-hint/shortcut-hint.variables.json +0 -1
- package/src/components/shortcut-hint/shortcut-hint.variables.ts +0 -3
- package/src/components/side-navigation/side-navigation.fixture.svelte +0 -39
- package/src/components/side-navigation/side-navigation.schema.json +0 -24
- package/src/components/side-navigation/side-navigation.schema.ts +0 -29
- package/src/components/side-navigation/side-navigation.variables.json +0 -1
- package/src/components/side-navigation/side-navigation.variables.ts +0 -3
- package/src/components/side-navigation-group/side-navigation-group.schema.json +0 -44
- package/src/components/side-navigation-group/side-navigation-group.schema.ts +0 -49
- package/src/components/side-navigation-group/side-navigation-group.variables.json +0 -1
- package/src/components/side-navigation-group/side-navigation-group.variables.ts +0 -3
- package/src/components/side-navigation-item/side-navigation-item.schema.json +0 -39
- package/src/components/side-navigation-item/side-navigation-item.schema.ts +0 -44
- package/src/components/side-navigation-item/side-navigation-item.variables.json +0 -1
- package/src/components/side-navigation-item/side-navigation-item.variables.ts +0 -3
- package/src/components/sidebar/sidebar.schema.json +0 -35
- package/src/components/sidebar/sidebar.schema.ts +0 -41
- package/src/components/sidebar/sidebar.variables.json +0 -1
- package/src/components/sidebar/sidebar.variables.ts +0 -3
- package/src/components/skeleton/skeleton.schema.json +0 -19
- package/src/components/skeleton/skeleton.schema.ts +0 -23
- package/src/components/skeleton/skeleton.variables.json +0 -1
- package/src/components/skeleton/skeleton.variables.ts +0 -3
- package/src/components/skip-link/skip-link.schema.json +0 -16
- package/src/components/skip-link/skip-link.schema.ts +0 -20
- package/src/components/skip-link/skip-link.variables.json +0 -1
- package/src/components/skip-link/skip-link.variables.ts +0 -3
- package/src/components/slider/slider.schema.json +0 -80
- package/src/components/slider/slider.schema.ts +0 -85
- package/src/components/slider/slider.variables.json +0 -1
- package/src/components/slider/slider.variables.ts +0 -3
- package/src/components/sortable-list/sortable-list.schema.json +0 -50
- package/src/components/sortable-list/sortable-list.schema.ts +0 -54
- package/src/components/sortable-list/sortable-list.variables.json +0 -1
- package/src/components/sortable-list/sortable-list.variables.ts +0 -3
- package/src/components/spectrogram/spectrogram.schema.json +0 -43
- package/src/components/spectrogram/spectrogram.schema.ts +0 -47
- package/src/components/spectrogram/spectrogram.variables.json +0 -1
- package/src/components/spectrogram/spectrogram.variables.ts +0 -3
- package/src/components/spectrum-chart/spectrum-chart.schema.json +0 -37
- package/src/components/spectrum-chart/spectrum-chart.schema.ts +0 -41
- package/src/components/spectrum-chart/spectrum-chart.variables.json +0 -1
- package/src/components/spectrum-chart/spectrum-chart.variables.ts +0 -3
- package/src/components/spinner/spinner.schema.json +0 -21
- package/src/components/spinner/spinner.schema.ts +0 -25
- package/src/components/spinner/spinner.variables.json +0 -1
- package/src/components/spinner/spinner.variables.ts +0 -3
- package/src/components/stacked-list-item/stacked-list-item.schema.json +0 -66
- package/src/components/stacked-list-item/stacked-list-item.schema.ts +0 -71
- package/src/components/stacked-list-item/stacked-list-item.variables.json +0 -1
- package/src/components/stacked-list-item/stacked-list-item.variables.ts +0 -3
- package/src/components/stat/stat.schema.json +0 -47
- package/src/components/stat/stat.schema.ts +0 -51
- package/src/components/stat/stat.variables.json +0 -1
- package/src/components/stat/stat.variables.ts +0 -3
- package/src/components/stat-group/stat-group.schema.json +0 -33
- package/src/components/stat-group/stat-group.schema.ts +0 -39
- package/src/components/stat-group/stat-group.variables.json +0 -1
- package/src/components/stat-group/stat-group.variables.ts +0 -3
- package/src/components/status-dot/status-dot.schema.json +0 -30
- package/src/components/status-dot/status-dot.schema.ts +0 -36
- package/src/components/status-dot/status-dot.variables.json +0 -1
- package/src/components/status-dot/status-dot.variables.ts +0 -3
- package/src/components/steps/steps.schema.json +0 -36
- package/src/components/steps/steps.schema.ts +0 -42
- package/src/components/steps/steps.variables.json +0 -1
- package/src/components/steps/steps.variables.ts +0 -3
- package/src/components/subscription-badge/subscription-badge.schema.json +0 -16
- package/src/components/subscription-badge/subscription-badge.schema.ts +0 -21
- package/src/components/subscription-badge/subscription-badge.variables.json +0 -1
- package/src/components/subscription-badge/subscription-badge.variables.ts +0 -3
- package/src/components/surface/surface.schema.json +0 -16
- package/src/components/surface/surface.schema.ts +0 -20
- package/src/components/surface/surface.variables.json +0 -1
- package/src/components/surface/surface.variables.ts +0 -3
- package/src/components/tab/tab.schema.json +0 -36
- package/src/components/tab/tab.schema.ts +0 -40
- package/src/components/tab/tab.variables.json +0 -1
- package/src/components/tab/tab.variables.ts +0 -3
- package/src/components/tab-list/tab-list.schema.json +0 -27
- package/src/components/tab-list/tab-list.schema.ts +0 -31
- package/src/components/tab-list/tab-list.variables.json +0 -1
- package/src/components/tab-list/tab-list.variables.ts +0 -3
- package/src/components/tab-panel/tab-panel.schema.json +0 -28
- package/src/components/tab-panel/tab-panel.schema.ts +0 -33
- package/src/components/tab-panel/tab-panel.variables.json +0 -1
- package/src/components/tab-panel/tab-panel.variables.ts +0 -3
- package/src/components/table/table.fixture.svelte +0 -87
- package/src/components/table/table.schema.json +0 -39
- package/src/components/table/table.schema.ts +0 -45
- package/src/components/table/table.variables.json +0 -1
- package/src/components/table/table.variables.ts +0 -3
- package/src/components/table-body/table-body.schema.json +0 -19
- package/src/components/table-body/table-body.schema.ts +0 -23
- package/src/components/table-body/table-body.variables.json +0 -1
- package/src/components/table-body/table-body.variables.ts +0 -3
- package/src/components/table-cell/table-cell.schema.json +0 -27
- package/src/components/table-cell/table-cell.schema.ts +0 -32
- package/src/components/table-cell/table-cell.variables.json +0 -1
- package/src/components/table-cell/table-cell.variables.ts +0 -3
- package/src/components/table-header/table-header.schema.json +0 -35
- package/src/components/table-header/table-header.schema.ts +0 -42
- package/src/components/table-header/table-header.variables.json +0 -1
- package/src/components/table-header/table-header.variables.ts +0 -3
- package/src/components/table-header-cell/table-header-cell.schema.json +0 -35
- package/src/components/table-header-cell/table-header-cell.schema.ts +0 -41
- package/src/components/table-header-cell/table-header-cell.variables.json +0 -1
- package/src/components/table-header-cell/table-header-cell.variables.ts +0 -3
- package/src/components/table-row/table-row.schema.json +0 -33
- package/src/components/table-row/table-row.schema.ts +0 -38
- package/src/components/table-row/table-row.variables.json +0 -1
- package/src/components/table-row/table-row.variables.ts +0 -3
- package/src/components/tabs/tabs.fixture.svelte +0 -35
- package/src/components/tabs/tabs.schema.json +0 -31
- package/src/components/tabs/tabs.schema.ts +0 -36
- package/src/components/tabs/tabs.variables.json +0 -1
- package/src/components/tabs/tabs.variables.ts +0 -3
- package/src/components/tag-input/tag-input.schema.json +0 -160
- package/src/components/tag-input/tag-input.schema.ts +0 -169
- package/src/components/tag-input/tag-input.variables.json +0 -1
- package/src/components/tag-input/tag-input.variables.ts +0 -3
- package/src/components/textarea/textarea.schema.json +0 -48
- package/src/components/textarea/textarea.schema.ts +0 -53
- package/src/components/textarea/textarea.variables.json +0 -1
- package/src/components/textarea/textarea.variables.ts +0 -3
- package/src/components/timeline/timeline.schema.json +0 -76
- package/src/components/timeline/timeline.schema.ts +0 -81
- package/src/components/timeline/timeline.variables.json +0 -1
- package/src/components/timeline/timeline.variables.ts +0 -3
- package/src/components/timeline-item/README.md +0 -51
- package/src/components/timeline-item/index.ts +0 -6
- package/src/components/timeline-item/timeline-item.css +0 -7
- package/src/components/timeline-item/timeline-item.schema.json +0 -43
- package/src/components/timeline-item/timeline-item.schema.ts +0 -48
- package/src/components/timeline-item/timeline-item.variables.json +0 -1
- package/src/components/timeline-item/timeline-item.variables.ts +0 -3
- package/src/components/toast-region/toast-region.schema.json +0 -38
- package/src/components/toast-region/toast-region.schema.ts +0 -35
- package/src/components/toast-region/toast-region.variables.json +0 -1
- package/src/components/toast-region/toast-region.variables.ts +0 -3
- package/src/components/toggle/toggle.schema.json +0 -44
- package/src/components/toggle/toggle.schema.ts +0 -54
- package/src/components/toggle/toggle.variables.json +0 -1
- package/src/components/toggle/toggle.variables.ts +0 -3
- package/src/components/toolbar/toolbar.schema.json +0 -16
- package/src/components/toolbar/toolbar.schema.ts +0 -20
- package/src/components/toolbar/toolbar.variables.json +0 -1
- package/src/components/toolbar/toolbar.variables.ts +0 -3
- package/src/components/tooltip/tooltip.schema.json +0 -29
- package/src/components/tooltip/tooltip.schema.ts +0 -33
- package/src/components/tooltip/tooltip.variables.json +0 -1
- package/src/components/tooltip/tooltip.variables.ts +0 -3
- package/src/components/tree/tree.schema.json +0 -60
- package/src/components/tree/tree.schema.ts +0 -67
- package/src/components/tree/tree.variables.json +0 -1
- package/src/components/tree/tree.variables.ts +0 -3
- package/src/components/tree-item/tree-item.schema.json +0 -55
- package/src/components/tree-item/tree-item.schema.ts +0 -61
- package/src/components/tree-item/tree-item.variables.json +0 -1
- package/src/components/tree-item/tree-item.variables.ts +0 -3
- package/src/components/typography/typography.schema.json +0 -144
- package/src/components/typography/typography.schema.ts +0 -148
- package/src/components/typography/typography.variables.json +0 -1
- package/src/components/typography/typography.variables.ts +0 -3
- package/src/components/visually-hidden/visually-hidden.schema.json +0 -121
- package/src/components/visually-hidden/visually-hidden.schema.ts +0 -125
- package/src/components/visually-hidden/visually-hidden.variables.json +0 -1
- package/src/components/visually-hidden/visually-hidden.variables.ts +0 -3
- package/src/components/waveform/waveform.schema.json +0 -38
- package/src/components/waveform/waveform.schema.ts +0 -42
- package/src/components/waveform/waveform.variables.json +0 -1
- package/src/components/waveform/waveform.variables.ts +0 -3
- /package/dist/components/{timeline-item → _timeline-item}/timeline-item.svelte.d.ts +0 -0
- /package/dist/components/{timeline-item → _timeline-item}/timeline-item.types.d.ts +0 -0
- /package/dist/components/{timeline-item/timeline-item.schema.d.ts → access-gate/access-gate.schema.d.ts} +0 -0
- /package/dist/components/{timeline-item/timeline-item.variables.d.ts → access-gate/access-gate.variables.d.ts} +0 -0
- /package/src/components/{timeline-item → _timeline-item}/timeline-item.svelte +0 -0
- /package/src/components/{timeline-item → _timeline-item}/timeline-item.types.ts +0 -0
|
@@ -0,0 +1,3088 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
16
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
17
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
18
|
+
}) : x)(function(x) {
|
|
19
|
+
if (typeof require !== "undefined")
|
|
20
|
+
return require.apply(this, arguments);
|
|
21
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// src/components/data-grid/index.ts
|
|
25
|
+
import"@lostgradient/cinder/data-grid/styles";
|
|
26
|
+
|
|
27
|
+
// src/components/data-grid/data-grid.svelte
|
|
28
|
+
import"svelte/internal/disclose-version";
|
|
29
|
+
import * as $4 from "svelte/internal/client";
|
|
30
|
+
import { tick } from "svelte";
|
|
31
|
+
|
|
32
|
+
// src/utilities/class-names.ts
|
|
33
|
+
function classNames(...parts) {
|
|
34
|
+
return parts.filter((part) => typeof part === "string" && part.length > 0).join(" ");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/utilities/clipboard.ts
|
|
38
|
+
async function copyToClipboard(text) {
|
|
39
|
+
if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
|
|
40
|
+
try {
|
|
41
|
+
await navigator.clipboard.writeText(text);
|
|
42
|
+
return true;
|
|
43
|
+
} catch {}
|
|
44
|
+
}
|
|
45
|
+
return legacyCopy(text);
|
|
46
|
+
}
|
|
47
|
+
function legacyCopy(text) {
|
|
48
|
+
if (typeof document === "undefined")
|
|
49
|
+
return false;
|
|
50
|
+
const textarea = document.createElement("textarea");
|
|
51
|
+
textarea.value = text;
|
|
52
|
+
textarea.setAttribute("readonly", "");
|
|
53
|
+
textarea.setAttribute("aria-hidden", "true");
|
|
54
|
+
textarea.setAttribute("tabindex", "-1");
|
|
55
|
+
textarea.style.position = "absolute";
|
|
56
|
+
textarea.style.left = "-9999px";
|
|
57
|
+
document.body.appendChild(textarea);
|
|
58
|
+
textarea.select();
|
|
59
|
+
let succeeded = false;
|
|
60
|
+
try {
|
|
61
|
+
succeeded = document.execCommand("copy");
|
|
62
|
+
} catch {
|
|
63
|
+
succeeded = false;
|
|
64
|
+
}
|
|
65
|
+
textarea.remove();
|
|
66
|
+
return succeeded;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ../../node_modules/esm-env/true.js
|
|
70
|
+
var true_default = true;
|
|
71
|
+
// src/utilities/dev-warn.ts
|
|
72
|
+
function devWarn(message, ...args) {
|
|
73
|
+
if (!true_default)
|
|
74
|
+
return;
|
|
75
|
+
console.warn(message, ...args);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/components/data-grid/_internal/column-model.svelte.ts
|
|
79
|
+
import * as $ from "svelte/internal/client";
|
|
80
|
+
var DEFAULT_DATA_GRID_COLUMN_WIDTH = 150;
|
|
81
|
+
var DEFAULT_DATA_GRID_COLUMN_MIN_WIDTH = 60;
|
|
82
|
+
|
|
83
|
+
class DataGridColumnModel {
|
|
84
|
+
columns;
|
|
85
|
+
columnOrder;
|
|
86
|
+
columnSizing;
|
|
87
|
+
columnPinning;
|
|
88
|
+
constructor(options) {
|
|
89
|
+
this.columns = options.columns;
|
|
90
|
+
this.columnOrder = options.columnOrder;
|
|
91
|
+
this.columnSizing = options.columnSizing;
|
|
92
|
+
this.columnPinning = options.columnPinning;
|
|
93
|
+
}
|
|
94
|
+
#orderedColumns = $.derived(() => orderColumns(this.columns(), this.columnOrder()).map((column, index) => resolveColumn(column, index, this.columnSizing(), this.columnPinning())));
|
|
95
|
+
get orderedColumns() {
|
|
96
|
+
return $.get(this.#orderedColumns);
|
|
97
|
+
}
|
|
98
|
+
set orderedColumns(value) {
|
|
99
|
+
$.set(this.#orderedColumns, value);
|
|
100
|
+
}
|
|
101
|
+
#leftPinnedColumns = $.derived(() => withPinOffsets(this.orderedColumns.filter((column) => column.pin === "left"), "left"));
|
|
102
|
+
get leftPinnedColumns() {
|
|
103
|
+
return $.get(this.#leftPinnedColumns);
|
|
104
|
+
}
|
|
105
|
+
set leftPinnedColumns(value) {
|
|
106
|
+
$.set(this.#leftPinnedColumns, value);
|
|
107
|
+
}
|
|
108
|
+
#rightPinnedColumns = $.derived(() => withPinOffsets(this.orderedColumns.filter((column) => column.pin === "right"), "right"));
|
|
109
|
+
get rightPinnedColumns() {
|
|
110
|
+
return $.get(this.#rightPinnedColumns);
|
|
111
|
+
}
|
|
112
|
+
set rightPinnedColumns(value) {
|
|
113
|
+
$.set(this.#rightPinnedColumns, value);
|
|
114
|
+
}
|
|
115
|
+
#leftPinnedWidth = $.derived(() => totalColumnWidth(this.leftPinnedColumns));
|
|
116
|
+
get leftPinnedWidth() {
|
|
117
|
+
return $.get(this.#leftPinnedWidth);
|
|
118
|
+
}
|
|
119
|
+
set leftPinnedWidth(value) {
|
|
120
|
+
$.set(this.#leftPinnedWidth, value);
|
|
121
|
+
}
|
|
122
|
+
#rightPinnedWidth = $.derived(() => totalColumnWidth(this.rightPinnedColumns));
|
|
123
|
+
get rightPinnedWidth() {
|
|
124
|
+
return $.get(this.#rightPinnedWidth);
|
|
125
|
+
}
|
|
126
|
+
set rightPinnedWidth(value) {
|
|
127
|
+
$.set(this.#rightPinnedWidth, value);
|
|
128
|
+
}
|
|
129
|
+
#unpinnedColumns = $.derived(() => this.orderedColumns.filter((column) => column.pin === undefined));
|
|
130
|
+
get unpinnedColumns() {
|
|
131
|
+
return $.get(this.#unpinnedColumns);
|
|
132
|
+
}
|
|
133
|
+
set unpinnedColumns(value) {
|
|
134
|
+
$.set(this.#unpinnedColumns, value);
|
|
135
|
+
}
|
|
136
|
+
#renderColumns = $.derived(() => {
|
|
137
|
+
return withRenderColIndexes([
|
|
138
|
+
...this.leftPinnedColumns,
|
|
139
|
+
...this.unpinnedColumns,
|
|
140
|
+
...this.rightPinnedColumns
|
|
141
|
+
]);
|
|
142
|
+
});
|
|
143
|
+
get renderColumns() {
|
|
144
|
+
return $.get(this.#renderColumns);
|
|
145
|
+
}
|
|
146
|
+
set renderColumns(value) {
|
|
147
|
+
$.set(this.#renderColumns, value);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function orderColumns(columns, columnOrder) {
|
|
151
|
+
assertUniqueColumnKeys(columns);
|
|
152
|
+
if (!columnOrder || columnOrder.length === 0)
|
|
153
|
+
return columns;
|
|
154
|
+
const byKey = new Map(columns.map((column) => [column.key, column]));
|
|
155
|
+
const ordered = columnOrder.flatMap((key) => {
|
|
156
|
+
const column = byKey.get(key);
|
|
157
|
+
if (!column)
|
|
158
|
+
return [];
|
|
159
|
+
byKey.delete(key);
|
|
160
|
+
return [column];
|
|
161
|
+
});
|
|
162
|
+
return [...ordered, ...byKey.values()];
|
|
163
|
+
}
|
|
164
|
+
function assertUniqueColumnKeys(columns) {
|
|
165
|
+
const seenColumnKeys = new Set;
|
|
166
|
+
for (const column of columns) {
|
|
167
|
+
if (seenColumnKeys.has(column.key)) {
|
|
168
|
+
throw new Error(`[cinder-data-grid] DataGrid column keys must be unique. Duplicate column key: ${JSON.stringify(column.key)}.`);
|
|
169
|
+
}
|
|
170
|
+
seenColumnKeys.add(column.key);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function resolveColumn(column, index, columnSizing, columnPinning) {
|
|
174
|
+
const minWidth = Math.max(0, finiteNumberOrFallback(column.minWidth, DEFAULT_DATA_GRID_COLUMN_MIN_WIDTH));
|
|
175
|
+
const baseWidth = finiteNumberOrFallback(columnSizing?.[column.key] ?? column.width, DEFAULT_DATA_GRID_COLUMN_WIDTH);
|
|
176
|
+
const maxWidth = Math.max(minWidth, finiteNumberOrFallback(column.maxWidth, Number.POSITIVE_INFINITY));
|
|
177
|
+
const pin = resolveColumnPin(column, columnPinning);
|
|
178
|
+
const resolvedColumn = {
|
|
179
|
+
key: column.key,
|
|
180
|
+
header: column.header,
|
|
181
|
+
minWidth,
|
|
182
|
+
width: Math.min(Math.max(baseWidth, minWidth), maxWidth),
|
|
183
|
+
colIndex: index + 1,
|
|
184
|
+
renderIndex: index + 1,
|
|
185
|
+
pinOffset: 0
|
|
186
|
+
};
|
|
187
|
+
if (column.cell !== undefined)
|
|
188
|
+
resolvedColumn.cell = column.cell;
|
|
189
|
+
if (column.maxWidth !== undefined)
|
|
190
|
+
resolvedColumn.maxWidth = column.maxWidth;
|
|
191
|
+
if (column.sortable !== undefined)
|
|
192
|
+
resolvedColumn.sortable = column.sortable;
|
|
193
|
+
if (column.sortComparator !== undefined)
|
|
194
|
+
resolvedColumn.sortComparator = column.sortComparator;
|
|
195
|
+
if (column.getValue !== undefined)
|
|
196
|
+
resolvedColumn.getValue = column.getValue;
|
|
197
|
+
if (pin !== undefined)
|
|
198
|
+
return { ...resolvedColumn, pin };
|
|
199
|
+
const { pin: _pin, ...unpinnedColumn } = resolvedColumn;
|
|
200
|
+
return unpinnedColumn;
|
|
201
|
+
}
|
|
202
|
+
function finiteNumberOrFallback(value, fallback) {
|
|
203
|
+
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
204
|
+
}
|
|
205
|
+
function resolveColumnPin(column, columnPinning) {
|
|
206
|
+
if (columnPinning?.left?.includes(column.key))
|
|
207
|
+
return "left";
|
|
208
|
+
if (columnPinning?.right?.includes(column.key))
|
|
209
|
+
return "right";
|
|
210
|
+
return column.pin;
|
|
211
|
+
}
|
|
212
|
+
function withPinOffsets(columns, pin) {
|
|
213
|
+
if (pin === "left") {
|
|
214
|
+
let offset2 = 0;
|
|
215
|
+
return columns.map((column) => {
|
|
216
|
+
const nextColumn = { ...column, pinOffset: offset2 };
|
|
217
|
+
offset2 += column.width;
|
|
218
|
+
return nextColumn;
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
let offset = 0;
|
|
222
|
+
const columnsWithOffsets = [];
|
|
223
|
+
for (let index = columns.length - 1;index >= 0; index -= 1) {
|
|
224
|
+
const column = columns[index];
|
|
225
|
+
if (!column)
|
|
226
|
+
continue;
|
|
227
|
+
columnsWithOffsets.unshift({ ...column, pinOffset: offset });
|
|
228
|
+
offset += column.width;
|
|
229
|
+
}
|
|
230
|
+
return columnsWithOffsets;
|
|
231
|
+
}
|
|
232
|
+
function withRenderColIndexes(columns) {
|
|
233
|
+
return columns.map((column, index) => ({ ...column, renderIndex: index + 1 }));
|
|
234
|
+
}
|
|
235
|
+
function totalColumnWidth(columns) {
|
|
236
|
+
return columns.reduce((totalWidth, column) => totalWidth + column.width, 0);
|
|
237
|
+
}
|
|
238
|
+
function getDataGridColumnValue(row, column) {
|
|
239
|
+
if (column.getValue)
|
|
240
|
+
return column.getValue(row);
|
|
241
|
+
if (row !== null && typeof row === "object" && Object.hasOwn(row, column.key)) {
|
|
242
|
+
const value = Reflect.get(row, column.key);
|
|
243
|
+
return value;
|
|
244
|
+
}
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// src/components/data-grid/_internal/keyboard-model.ts
|
|
249
|
+
function dataGridKeyToAction(event, context) {
|
|
250
|
+
const { activeRowIndex, activeColumnIndex, rowCount, columnCount, pageSize = 10 } = context;
|
|
251
|
+
if (rowCount === 0 || columnCount === 0)
|
|
252
|
+
return;
|
|
253
|
+
const extend = event.shiftKey;
|
|
254
|
+
const isCommand = event.ctrlKey || event.metaKey;
|
|
255
|
+
if (isCommand && event.key.toLowerCase() === "a")
|
|
256
|
+
return { type: "select-all" };
|
|
257
|
+
if (isCommand && event.key.toLowerCase() === "c")
|
|
258
|
+
return { type: "copy-selection" };
|
|
259
|
+
if (event.key === "Escape")
|
|
260
|
+
return { type: "collapse-selection" };
|
|
261
|
+
if (event.key === "Enter" || event.key === " ")
|
|
262
|
+
return { type: "select-active-cell" };
|
|
263
|
+
if (event.key === "ArrowRight") {
|
|
264
|
+
return {
|
|
265
|
+
type: "move-cell",
|
|
266
|
+
rowIndex: activeRowIndex,
|
|
267
|
+
columnIndex: activeColumnIndex + 1,
|
|
268
|
+
extend
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
if (event.key === "ArrowLeft") {
|
|
272
|
+
return {
|
|
273
|
+
type: "move-cell",
|
|
274
|
+
rowIndex: activeRowIndex,
|
|
275
|
+
columnIndex: activeColumnIndex - 1,
|
|
276
|
+
extend
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
if (event.key === "ArrowDown") {
|
|
280
|
+
return {
|
|
281
|
+
type: "move-cell",
|
|
282
|
+
rowIndex: activeRowIndex + 1,
|
|
283
|
+
columnIndex: activeColumnIndex,
|
|
284
|
+
extend
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
if (event.key === "ArrowUp") {
|
|
288
|
+
return {
|
|
289
|
+
type: "move-cell",
|
|
290
|
+
rowIndex: activeRowIndex - 1,
|
|
291
|
+
columnIndex: activeColumnIndex,
|
|
292
|
+
extend
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
if (event.key === "Home") {
|
|
296
|
+
return {
|
|
297
|
+
type: "move-cell",
|
|
298
|
+
rowIndex: isCommand ? 0 : activeRowIndex,
|
|
299
|
+
columnIndex: 0,
|
|
300
|
+
extend
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
if (event.key === "End") {
|
|
304
|
+
return {
|
|
305
|
+
type: "move-cell",
|
|
306
|
+
rowIndex: isCommand ? rowCount - 1 : activeRowIndex,
|
|
307
|
+
columnIndex: columnCount - 1,
|
|
308
|
+
extend
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
if (event.key === "PageDown") {
|
|
312
|
+
return {
|
|
313
|
+
type: "move-cell",
|
|
314
|
+
rowIndex: activeRowIndex + pageSize,
|
|
315
|
+
columnIndex: activeColumnIndex,
|
|
316
|
+
extend
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
if (event.key === "PageUp") {
|
|
320
|
+
return {
|
|
321
|
+
type: "move-cell",
|
|
322
|
+
rowIndex: activeRowIndex - pageSize,
|
|
323
|
+
columnIndex: activeColumnIndex,
|
|
324
|
+
extend
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
if (event.key === "Tab") {
|
|
328
|
+
const direction = event.shiftKey ? -1 : 1;
|
|
329
|
+
const nextCellIndex = activeRowIndex * columnCount + activeColumnIndex + direction;
|
|
330
|
+
const lastCellIndex = rowCount * columnCount - 1;
|
|
331
|
+
if (nextCellIndex < 0 || nextCellIndex > lastCellIndex)
|
|
332
|
+
return;
|
|
333
|
+
return {
|
|
334
|
+
type: "move-cell",
|
|
335
|
+
rowIndex: Math.floor(nextCellIndex / columnCount),
|
|
336
|
+
columnIndex: nextCellIndex % columnCount,
|
|
337
|
+
extend: false
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// src/components/data-grid/_internal/selection-model.svelte.ts
|
|
344
|
+
import * as $2 from "svelte/internal/client";
|
|
345
|
+
|
|
346
|
+
// src/components/data-grid/_internal/geometry.ts
|
|
347
|
+
function getCellCoordinateKey(cell) {
|
|
348
|
+
return `${cell.rowId}\x00${cell.columnKey}`;
|
|
349
|
+
}
|
|
350
|
+
function computeCellRange(anchor, focus, rowIds, columnKeys) {
|
|
351
|
+
const anchorRowIndex = rowIds.indexOf(anchor.rowId);
|
|
352
|
+
const focusRowIndex = rowIds.indexOf(focus.rowId);
|
|
353
|
+
const anchorColumnIndex = columnKeys.indexOf(anchor.columnKey);
|
|
354
|
+
const focusColumnIndex = columnKeys.indexOf(focus.columnKey);
|
|
355
|
+
if (anchorRowIndex < 0 || focusRowIndex < 0 || anchorColumnIndex < 0 || focusColumnIndex < 0) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
const startRowIndex = Math.min(anchorRowIndex, focusRowIndex);
|
|
359
|
+
const endRowIndex = Math.max(anchorRowIndex, focusRowIndex);
|
|
360
|
+
const startColumnIndex = Math.min(anchorColumnIndex, focusColumnIndex);
|
|
361
|
+
const endColumnIndex = Math.max(anchorColumnIndex, focusColumnIndex);
|
|
362
|
+
return {
|
|
363
|
+
anchor,
|
|
364
|
+
focus,
|
|
365
|
+
rowIds: rowIds.slice(startRowIndex, endRowIndex + 1),
|
|
366
|
+
columnKeys: columnKeys.slice(startColumnIndex, endColumnIndex + 1),
|
|
367
|
+
startRowIndex,
|
|
368
|
+
endRowIndex,
|
|
369
|
+
startColumnIndex,
|
|
370
|
+
endColumnIndex
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
function getCellsInRange(range) {
|
|
374
|
+
if (!range)
|
|
375
|
+
return [];
|
|
376
|
+
return range.rowIds.flatMap((rowId) => range.columnKeys.map((columnKey) => ({
|
|
377
|
+
rowId,
|
|
378
|
+
columnKey
|
|
379
|
+
})));
|
|
380
|
+
}
|
|
381
|
+
function clampCellCoordinate(cell, rowIds, columnKeys) {
|
|
382
|
+
if (rowIds.length === 0 || columnKeys.length === 0)
|
|
383
|
+
return;
|
|
384
|
+
const rowIndex = rowIds.indexOf(cell.rowId);
|
|
385
|
+
const columnIndex = columnKeys.indexOf(cell.columnKey);
|
|
386
|
+
if (rowIndex < 0 || columnIndex < 0)
|
|
387
|
+
return;
|
|
388
|
+
return {
|
|
389
|
+
rowId: rowIds[Math.min(Math.max(rowIndex, 0), rowIds.length - 1)] ?? rowIds[0],
|
|
390
|
+
columnKey: columnKeys[Math.min(Math.max(columnIndex, 0), columnKeys.length - 1)] ?? columnKeys[0]
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// src/components/data-grid/_internal/selection-model.svelte.ts
|
|
395
|
+
class DataGridSelectionModel {
|
|
396
|
+
rowIds;
|
|
397
|
+
columnKeys;
|
|
398
|
+
#activeCell = $2.state();
|
|
399
|
+
get activeCell() {
|
|
400
|
+
return $2.get(this.#activeCell);
|
|
401
|
+
}
|
|
402
|
+
set activeCell(value) {
|
|
403
|
+
$2.set(this.#activeCell, value, true);
|
|
404
|
+
}
|
|
405
|
+
#anchorCell = $2.state();
|
|
406
|
+
get anchorCell() {
|
|
407
|
+
return $2.get(this.#anchorCell);
|
|
408
|
+
}
|
|
409
|
+
set anchorCell(value) {
|
|
410
|
+
$2.set(this.#anchorCell, value, true);
|
|
411
|
+
}
|
|
412
|
+
#toggledCells = $2.state([]);
|
|
413
|
+
get toggledCells() {
|
|
414
|
+
return $2.get(this.#toggledCells);
|
|
415
|
+
}
|
|
416
|
+
set toggledCells(value) {
|
|
417
|
+
$2.set(this.#toggledCells, value);
|
|
418
|
+
}
|
|
419
|
+
constructor(options) {
|
|
420
|
+
this.rowIds = options.rowIds;
|
|
421
|
+
this.columnKeys = options.columnKeys;
|
|
422
|
+
}
|
|
423
|
+
#range = $2.derived(() => {
|
|
424
|
+
if (!this.anchorCell || !this.activeCell)
|
|
425
|
+
return;
|
|
426
|
+
return computeCellRange(this.anchorCell, this.activeCell, this.rowIds(), this.columnKeys());
|
|
427
|
+
});
|
|
428
|
+
get range() {
|
|
429
|
+
return $2.get(this.#range);
|
|
430
|
+
}
|
|
431
|
+
set range(value) {
|
|
432
|
+
$2.set(this.#range, value);
|
|
433
|
+
}
|
|
434
|
+
#selectedCellCoordinates = $2.derived(() => {
|
|
435
|
+
const cellsByKey = new Map;
|
|
436
|
+
for (const cell of getCellsInRange(this.range))
|
|
437
|
+
cellsByKey.set(getCellCoordinateKey(cell), cell);
|
|
438
|
+
for (const cell of this.toggledCells) {
|
|
439
|
+
if (clampCellCoordinate(cell, this.rowIds(), this.columnKeys())) {
|
|
440
|
+
cellsByKey.set(getCellCoordinateKey(cell), cell);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return [...cellsByKey.values()];
|
|
444
|
+
});
|
|
445
|
+
get selectedCellCoordinates() {
|
|
446
|
+
return $2.get(this.#selectedCellCoordinates);
|
|
447
|
+
}
|
|
448
|
+
set selectedCellCoordinates(value) {
|
|
449
|
+
$2.set(this.#selectedCellCoordinates, value);
|
|
450
|
+
}
|
|
451
|
+
#selectedCells = $2.derived(() => {
|
|
452
|
+
const keys = new Set;
|
|
453
|
+
for (const cell of this.selectedCellCoordinates)
|
|
454
|
+
keys.add(getCellCoordinateKey(cell));
|
|
455
|
+
return keys;
|
|
456
|
+
});
|
|
457
|
+
get selectedCells() {
|
|
458
|
+
return $2.get(this.#selectedCells);
|
|
459
|
+
}
|
|
460
|
+
set selectedCells(value) {
|
|
461
|
+
$2.set(this.#selectedCells, value);
|
|
462
|
+
}
|
|
463
|
+
setActiveCell(cell, options = {}) {
|
|
464
|
+
if (options.toggle) {
|
|
465
|
+
this.materializeRangeSelection();
|
|
466
|
+
this.toggleCell(cell);
|
|
467
|
+
this.activeCell = cell;
|
|
468
|
+
this.anchorCell = undefined;
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
if (options.extend) {
|
|
472
|
+
if (!this.anchorCell)
|
|
473
|
+
this.anchorCell = this.activeCell ?? cell;
|
|
474
|
+
this.activeCell = cell;
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
this.anchorCell = cell;
|
|
478
|
+
this.toggledCells = [];
|
|
479
|
+
this.activeCell = cell;
|
|
480
|
+
}
|
|
481
|
+
selectAll() {
|
|
482
|
+
const firstRowId = this.rowIds()[0];
|
|
483
|
+
const lastRowId = this.rowIds().at(-1);
|
|
484
|
+
const firstColumnKey = this.columnKeys()[0];
|
|
485
|
+
const lastColumnKey = this.columnKeys().at(-1);
|
|
486
|
+
if (firstRowId === undefined || lastRowId === undefined || firstColumnKey === undefined || lastColumnKey === undefined) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
this.anchorCell = { rowId: firstRowId, columnKey: firstColumnKey };
|
|
490
|
+
this.activeCell = { rowId: lastRowId, columnKey: lastColumnKey };
|
|
491
|
+
this.toggledCells = [];
|
|
492
|
+
}
|
|
493
|
+
collapseToActiveCell() {
|
|
494
|
+
if (!this.activeCell)
|
|
495
|
+
return;
|
|
496
|
+
this.anchorCell = this.activeCell;
|
|
497
|
+
this.toggledCells = [];
|
|
498
|
+
}
|
|
499
|
+
isCellSelected(cell) {
|
|
500
|
+
return this.selectedCells.has(getCellCoordinateKey(cell));
|
|
501
|
+
}
|
|
502
|
+
isAnchorCell(cell) {
|
|
503
|
+
if (!this.anchorCell)
|
|
504
|
+
return false;
|
|
505
|
+
return getCellCoordinateKey(this.anchorCell) === getCellCoordinateKey(cell);
|
|
506
|
+
}
|
|
507
|
+
reconcile(fallbackCell) {
|
|
508
|
+
const rowIds = this.rowIds();
|
|
509
|
+
const columnKeys = this.columnKeys();
|
|
510
|
+
if (rowIds.length === 0 || columnKeys.length === 0) {
|
|
511
|
+
this.activeCell = undefined;
|
|
512
|
+
this.anchorCell = undefined;
|
|
513
|
+
this.toggledCells = [];
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
const hadActiveCell = this.activeCell !== undefined;
|
|
517
|
+
const hadAnchorCell = this.anchorCell !== undefined;
|
|
518
|
+
const reconciledActiveCell = this.activeCell && clampCellCoordinate(this.activeCell, rowIds, columnKeys);
|
|
519
|
+
const nextActiveCell = reconciledActiveCell ?? fallbackCell;
|
|
520
|
+
if (!areCellsEqual(this.activeCell, nextActiveCell))
|
|
521
|
+
this.activeCell = nextActiveCell;
|
|
522
|
+
const nextAnchorCell = (this.anchorCell && clampCellCoordinate(this.anchorCell, rowIds, columnKeys)) ?? (hadAnchorCell || !hadActiveCell ? nextActiveCell : undefined);
|
|
523
|
+
if (!areCellsEqual(this.anchorCell, nextAnchorCell))
|
|
524
|
+
this.anchorCell = nextAnchorCell;
|
|
525
|
+
const nextToggledCells = this.toggledCells.filter((cell) => clampCellCoordinate(cell, rowIds, columnKeys));
|
|
526
|
+
if (nextToggledCells.length !== this.toggledCells.length) {
|
|
527
|
+
this.toggledCells = nextToggledCells;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
materializeRangeSelection() {
|
|
531
|
+
const rangeCells = getCellsInRange(this.range);
|
|
532
|
+
if (rangeCells.length <= 1)
|
|
533
|
+
return;
|
|
534
|
+
const cellsByKey = new Map(this.toggledCells.map((toggledCell) => [getCellCoordinateKey(toggledCell), toggledCell]));
|
|
535
|
+
for (const cell of rangeCells)
|
|
536
|
+
cellsByKey.set(getCellCoordinateKey(cell), cell);
|
|
537
|
+
this.toggledCells = [...cellsByKey.values()];
|
|
538
|
+
}
|
|
539
|
+
toggleCell(cell) {
|
|
540
|
+
const key = getCellCoordinateKey(cell);
|
|
541
|
+
const cellsByKey = new Map(this.toggledCells.map((toggledCell) => [getCellCoordinateKey(toggledCell), toggledCell]));
|
|
542
|
+
if (cellsByKey.has(key))
|
|
543
|
+
cellsByKey.delete(key);
|
|
544
|
+
else
|
|
545
|
+
cellsByKey.set(key, cell);
|
|
546
|
+
this.toggledCells = [...cellsByKey.values()];
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
function areCellsEqual(left, right) {
|
|
550
|
+
if (left === undefined && right === undefined)
|
|
551
|
+
return true;
|
|
552
|
+
if (!left || !right)
|
|
553
|
+
return false;
|
|
554
|
+
return left.rowId === right.rowId && left.columnKey === right.columnKey;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// src/components/data-grid/_internal/sort-model.ts
|
|
558
|
+
var sortCollator = new Intl.Collator(undefined, { numeric: true, sensitivity: "base" });
|
|
559
|
+
function getNextDataGridSortModel(currentSortModel, columnKey, multiSort) {
|
|
560
|
+
const currentIndex = currentSortModel.findIndex((item) => item.key === columnKey);
|
|
561
|
+
const currentItem = currentIndex >= 0 ? currentSortModel[currentIndex] : undefined;
|
|
562
|
+
const nextDirection = getNextSortDirection(currentItem?.direction);
|
|
563
|
+
if (!multiSort) {
|
|
564
|
+
return nextDirection === undefined ? [] : [{ key: columnKey, direction: nextDirection }];
|
|
565
|
+
}
|
|
566
|
+
if (currentIndex < 0)
|
|
567
|
+
return [...currentSortModel, { key: columnKey, direction: "ascending" }];
|
|
568
|
+
if (nextDirection === undefined)
|
|
569
|
+
return currentSortModel.filter((item) => item.key !== columnKey);
|
|
570
|
+
return currentSortModel.map((item, index) => index === currentIndex ? { key: columnKey, direction: nextDirection } : item);
|
|
571
|
+
}
|
|
572
|
+
function getActiveDataGridSortModel(columns, sortModel) {
|
|
573
|
+
return sortModel.filter((item) => columns.some((column) => column.sortable && column.key === item.key));
|
|
574
|
+
}
|
|
575
|
+
function getSortedDataGridRowIndices(rows, columns, sortModel) {
|
|
576
|
+
const rowIndices = rows.map((_, index) => index);
|
|
577
|
+
const activeSortItems = getActiveDataGridSortModel(columns, sortModel).flatMap((item) => {
|
|
578
|
+
const column = columns.find((candidate) => candidate.key === item.key);
|
|
579
|
+
return column === undefined ? [] : [{ column, direction: item.direction }];
|
|
580
|
+
});
|
|
581
|
+
if (activeSortItems.length === 0)
|
|
582
|
+
return rowIndices;
|
|
583
|
+
const sortedRowIndices = rowIndices.slice();
|
|
584
|
+
sortedRowIndices.sort((leftIndex, rightIndex) => {
|
|
585
|
+
const leftRow = rows[leftIndex];
|
|
586
|
+
const rightRow = rows[rightIndex];
|
|
587
|
+
if (leftRow === undefined || rightRow === undefined)
|
|
588
|
+
return leftIndex - rightIndex;
|
|
589
|
+
for (const { column, direction } of activeSortItems) {
|
|
590
|
+
const leftValue = getDataGridColumnValue(leftRow, column);
|
|
591
|
+
const rightValue = getDataGridColumnValue(rightRow, column);
|
|
592
|
+
if (isNullishSortValue(leftValue) || isNullishSortValue(rightValue)) {
|
|
593
|
+
const comparison2 = compareDataGridValues(leftValue, rightValue, direction);
|
|
594
|
+
if (comparison2 !== 0)
|
|
595
|
+
return comparison2;
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
const comparison = column.sortComparator ? column.sortComparator(leftValue, rightValue, leftRow, rightRow) : compareDataGridValues(leftValue, rightValue, direction);
|
|
599
|
+
if (comparison !== 0) {
|
|
600
|
+
return column.sortComparator && direction === "descending" ? -comparison : comparison;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
return leftIndex - rightIndex;
|
|
604
|
+
});
|
|
605
|
+
return sortedRowIndices;
|
|
606
|
+
}
|
|
607
|
+
function compareDataGridValues(leftValue, rightValue, direction = "ascending") {
|
|
608
|
+
if (Object.is(leftValue, rightValue))
|
|
609
|
+
return 0;
|
|
610
|
+
const leftValueIsNullish = isNullishSortValue(leftValue);
|
|
611
|
+
const rightValueIsNullish = isNullishSortValue(rightValue);
|
|
612
|
+
if (leftValueIsNullish && rightValueIsNullish)
|
|
613
|
+
return 0;
|
|
614
|
+
if (leftValueIsNullish)
|
|
615
|
+
return 1;
|
|
616
|
+
if (rightValueIsNullish)
|
|
617
|
+
return -1;
|
|
618
|
+
const leftNumber = getComparableNumber(leftValue);
|
|
619
|
+
const rightNumber = getComparableNumber(rightValue);
|
|
620
|
+
if (leftNumber !== undefined && rightNumber !== undefined) {
|
|
621
|
+
return direction === "ascending" ? leftNumber - rightNumber : rightNumber - leftNumber;
|
|
622
|
+
}
|
|
623
|
+
const comparison = sortCollator.compare(getComparableLabel(leftValue), getComparableLabel(rightValue));
|
|
624
|
+
return direction === "ascending" ? comparison : -comparison;
|
|
625
|
+
}
|
|
626
|
+
function getNextSortDirection(currentDirection) {
|
|
627
|
+
if (currentDirection === undefined)
|
|
628
|
+
return "ascending";
|
|
629
|
+
if (currentDirection === "ascending")
|
|
630
|
+
return "descending";
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
function getComparableNumber(value) {
|
|
634
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
635
|
+
return value;
|
|
636
|
+
if (value instanceof Date) {
|
|
637
|
+
const time = value.getTime();
|
|
638
|
+
return Number.isFinite(time) ? time : undefined;
|
|
639
|
+
}
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
function getComparableLabel(value) {
|
|
643
|
+
if (typeof value === "string")
|
|
644
|
+
return value;
|
|
645
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
646
|
+
return value.toString();
|
|
647
|
+
}
|
|
648
|
+
if (typeof value === "symbol")
|
|
649
|
+
return value.description ?? "";
|
|
650
|
+
if (value instanceof Date)
|
|
651
|
+
return value.toISOString();
|
|
652
|
+
return Object.prototype.toString.call(value);
|
|
653
|
+
}
|
|
654
|
+
function isNullishSortValue(value) {
|
|
655
|
+
return value === null || value === undefined || value instanceof Date && !Number.isFinite(value.getTime());
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
// src/components/data-grid/_internal/virtualization-adapter.svelte.ts
|
|
659
|
+
import * as $3 from "svelte/internal/client";
|
|
660
|
+
|
|
661
|
+
// ../../node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js
|
|
662
|
+
function createLazyMeasurementsView(count, flat, getItemKey) {
|
|
663
|
+
const cache = new Array(count);
|
|
664
|
+
return new Proxy(cache, {
|
|
665
|
+
get(target, prop, receiver) {
|
|
666
|
+
if (typeof prop === "string") {
|
|
667
|
+
const c = prop.charCodeAt(0);
|
|
668
|
+
if (c >= 48 && c <= 57) {
|
|
669
|
+
const i = +prop;
|
|
670
|
+
if (Number.isInteger(i) && i >= 0 && i < count) {
|
|
671
|
+
let v = target[i];
|
|
672
|
+
if (!v) {
|
|
673
|
+
const s = flat[i * 2];
|
|
674
|
+
v = target[i] = {
|
|
675
|
+
index: i,
|
|
676
|
+
key: getItemKey(i),
|
|
677
|
+
start: s,
|
|
678
|
+
size: flat[i * 2 + 1],
|
|
679
|
+
end: s + flat[i * 2 + 1],
|
|
680
|
+
lane: 0
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
return v;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
if (prop === "length")
|
|
687
|
+
return count;
|
|
688
|
+
}
|
|
689
|
+
return Reflect.get(target, prop, receiver);
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
// ../../node_modules/@tanstack/virtual-core/dist/esm/utils.js
|
|
695
|
+
function memo(getDeps, fn, opts) {
|
|
696
|
+
let deps = opts.initialDeps ?? [];
|
|
697
|
+
let result;
|
|
698
|
+
let isInitial = true;
|
|
699
|
+
function memoizedFunction() {
|
|
700
|
+
var _a;
|
|
701
|
+
const debugEnabled = !!opts.key && !!((_a = opts.debug) == null ? undefined : _a.call(opts));
|
|
702
|
+
let depTime = 0;
|
|
703
|
+
if (debugEnabled)
|
|
704
|
+
depTime = Date.now();
|
|
705
|
+
const newDeps = getDeps();
|
|
706
|
+
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
707
|
+
if (!depsChanged) {
|
|
708
|
+
return result;
|
|
709
|
+
}
|
|
710
|
+
deps = newDeps;
|
|
711
|
+
let resultTime = 0;
|
|
712
|
+
if (debugEnabled)
|
|
713
|
+
resultTime = Date.now();
|
|
714
|
+
result = fn(...newDeps);
|
|
715
|
+
if (debugEnabled) {
|
|
716
|
+
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
717
|
+
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
718
|
+
const resultFpsPercentage = resultEndTime / 16;
|
|
719
|
+
const pad = (str, num) => {
|
|
720
|
+
str = String(str);
|
|
721
|
+
while (str.length < num) {
|
|
722
|
+
str = " " + str;
|
|
723
|
+
}
|
|
724
|
+
return str;
|
|
725
|
+
};
|
|
726
|
+
console.info(`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, `
|
|
727
|
+
font-size: .6rem;
|
|
728
|
+
font-weight: bold;
|
|
729
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts == null ? undefined : opts.key);
|
|
730
|
+
}
|
|
731
|
+
if ((opts == null ? undefined : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {
|
|
732
|
+
opts.onChange(result);
|
|
733
|
+
}
|
|
734
|
+
isInitial = false;
|
|
735
|
+
return result;
|
|
736
|
+
}
|
|
737
|
+
memoizedFunction.updateDeps = (newDeps) => {
|
|
738
|
+
deps = newDeps;
|
|
739
|
+
};
|
|
740
|
+
return memoizedFunction;
|
|
741
|
+
}
|
|
742
|
+
function notUndefined(value, msg) {
|
|
743
|
+
if (value === undefined) {
|
|
744
|
+
throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`);
|
|
745
|
+
} else {
|
|
746
|
+
return value;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
var approxEqual = (a, b) => Math.abs(a - b) < 1.01;
|
|
750
|
+
|
|
751
|
+
// ../../node_modules/@tanstack/virtual-core/dist/esm/index.js
|
|
752
|
+
var _isIOSResult;
|
|
753
|
+
var isIOSWebKit = () => {
|
|
754
|
+
if (_isIOSResult !== undefined)
|
|
755
|
+
return _isIOSResult;
|
|
756
|
+
if (typeof navigator === "undefined")
|
|
757
|
+
return _isIOSResult = false;
|
|
758
|
+
if (/iP(hone|od|ad)/.test(navigator.userAgent))
|
|
759
|
+
return _isIOSResult = true;
|
|
760
|
+
const mtp = navigator.maxTouchPoints;
|
|
761
|
+
return _isIOSResult = navigator.platform === "MacIntel" && mtp !== undefined && mtp > 0;
|
|
762
|
+
};
|
|
763
|
+
var defaultKeyExtractor = (index) => index;
|
|
764
|
+
var defaultRangeExtractor = (range) => {
|
|
765
|
+
const start = Math.max(range.startIndex - range.overscan, 0);
|
|
766
|
+
const end = Math.min(range.endIndex + range.overscan, range.count - 1);
|
|
767
|
+
const len = end - start + 1;
|
|
768
|
+
const arr = new Array(len);
|
|
769
|
+
for (let i = 0;i < len; i++) {
|
|
770
|
+
arr[i] = start + i;
|
|
771
|
+
}
|
|
772
|
+
return arr;
|
|
773
|
+
};
|
|
774
|
+
var addEventListenerOptions = {
|
|
775
|
+
passive: true
|
|
776
|
+
};
|
|
777
|
+
var supportsScrollend = typeof window == "undefined" ? true : ("onscrollend" in window);
|
|
778
|
+
var measureElement = (element, entry, instance) => {
|
|
779
|
+
if (instance.options.useCachedMeasurements) {
|
|
780
|
+
const index = instance.indexFromElement(element);
|
|
781
|
+
const key = instance.options.getItemKey(index);
|
|
782
|
+
return instance.itemSizeCache.get(key) ?? instance.options.estimateSize(index);
|
|
783
|
+
}
|
|
784
|
+
if (entry == null ? undefined : entry.borderBoxSize) {
|
|
785
|
+
const box = entry.borderBoxSize[0];
|
|
786
|
+
if (box) {
|
|
787
|
+
const size = Math.round(box[instance.options.horizontal ? "inlineSize" : "blockSize"]);
|
|
788
|
+
return size;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
if (!entry) {
|
|
792
|
+
const index = instance.indexFromElement(element);
|
|
793
|
+
const key = instance.options.getItemKey(index);
|
|
794
|
+
const cachedSize = instance.itemSizeCache.get(key);
|
|
795
|
+
if (cachedSize !== undefined) {
|
|
796
|
+
return cachedSize;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
800
|
+
};
|
|
801
|
+
class Virtualizer {
|
|
802
|
+
constructor(opts) {
|
|
803
|
+
this.unsubs = [];
|
|
804
|
+
this.scrollElement = null;
|
|
805
|
+
this.targetWindow = null;
|
|
806
|
+
this.isScrolling = false;
|
|
807
|
+
this.scrollState = null;
|
|
808
|
+
this.measurementsCache = [];
|
|
809
|
+
this._flatMeasurements = null;
|
|
810
|
+
this.itemSizeCache = /* @__PURE__ */ new Map;
|
|
811
|
+
this.itemSizeCacheVersion = 0;
|
|
812
|
+
this.laneAssignments = /* @__PURE__ */ new Map;
|
|
813
|
+
this.pendingMin = null;
|
|
814
|
+
this.prevLanes = undefined;
|
|
815
|
+
this.lanesChangedFlag = false;
|
|
816
|
+
this.lanesSettling = false;
|
|
817
|
+
this.pendingScrollAnchor = null;
|
|
818
|
+
this.scrollRect = null;
|
|
819
|
+
this.scrollOffset = null;
|
|
820
|
+
this.scrollDirection = null;
|
|
821
|
+
this.scrollAdjustments = 0;
|
|
822
|
+
this._iosDeferredAdjustment = 0;
|
|
823
|
+
this._iosTouching = false;
|
|
824
|
+
this._iosJustTouchEnded = false;
|
|
825
|
+
this._iosTouchEndTimerId = null;
|
|
826
|
+
this._intendedScrollOffset = null;
|
|
827
|
+
this.elementsCache = /* @__PURE__ */ new Map;
|
|
828
|
+
this.now = () => {
|
|
829
|
+
var _a, _b, _c;
|
|
830
|
+
return ((_c = (_b = (_a = this.targetWindow) == null ? undefined : _a.performance) == null ? undefined : _b.now) == null ? undefined : _c.call(_b)) ?? Date.now();
|
|
831
|
+
};
|
|
832
|
+
this.observer = /* @__PURE__ */ (() => {
|
|
833
|
+
let _ro = null;
|
|
834
|
+
const get3 = () => {
|
|
835
|
+
if (_ro) {
|
|
836
|
+
return _ro;
|
|
837
|
+
}
|
|
838
|
+
if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
|
|
839
|
+
return null;
|
|
840
|
+
}
|
|
841
|
+
return _ro = new this.targetWindow.ResizeObserver((entries) => {
|
|
842
|
+
entries.forEach((entry) => {
|
|
843
|
+
const run = () => {
|
|
844
|
+
const node = entry.target;
|
|
845
|
+
const index = this.indexFromElement(node);
|
|
846
|
+
if (!node.isConnected) {
|
|
847
|
+
this.observer.unobserve(node);
|
|
848
|
+
for (const [cacheKey, cachedNode] of this.elementsCache) {
|
|
849
|
+
if (cachedNode === node) {
|
|
850
|
+
this.elementsCache.delete(cacheKey);
|
|
851
|
+
break;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
if (this.shouldMeasureDuringScroll(index)) {
|
|
857
|
+
this.resizeItem(index, this.options.measureElement(node, entry, this));
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
|
|
861
|
+
});
|
|
862
|
+
});
|
|
863
|
+
};
|
|
864
|
+
return {
|
|
865
|
+
disconnect: () => {
|
|
866
|
+
var _a;
|
|
867
|
+
(_a = get3()) == null || _a.disconnect();
|
|
868
|
+
_ro = null;
|
|
869
|
+
},
|
|
870
|
+
observe: (target) => {
|
|
871
|
+
var _a;
|
|
872
|
+
return (_a = get3()) == null ? undefined : _a.observe(target, { box: "border-box" });
|
|
873
|
+
},
|
|
874
|
+
unobserve: (target) => {
|
|
875
|
+
var _a;
|
|
876
|
+
return (_a = get3()) == null ? undefined : _a.unobserve(target);
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
})();
|
|
880
|
+
this.range = null;
|
|
881
|
+
this.setOptions = (opts2) => {
|
|
882
|
+
var _a, _b;
|
|
883
|
+
const merged = {
|
|
884
|
+
debug: false,
|
|
885
|
+
initialOffset: 0,
|
|
886
|
+
overscan: 1,
|
|
887
|
+
paddingStart: 0,
|
|
888
|
+
paddingEnd: 0,
|
|
889
|
+
scrollPaddingStart: 0,
|
|
890
|
+
scrollPaddingEnd: 0,
|
|
891
|
+
horizontal: false,
|
|
892
|
+
getItemKey: defaultKeyExtractor,
|
|
893
|
+
rangeExtractor: defaultRangeExtractor,
|
|
894
|
+
onChange: () => {},
|
|
895
|
+
measureElement,
|
|
896
|
+
initialRect: { width: 0, height: 0 },
|
|
897
|
+
scrollMargin: 0,
|
|
898
|
+
gap: 0,
|
|
899
|
+
indexAttribute: "data-index",
|
|
900
|
+
initialMeasurementsCache: [],
|
|
901
|
+
lanes: 1,
|
|
902
|
+
anchorTo: "start",
|
|
903
|
+
followOnAppend: false,
|
|
904
|
+
scrollEndThreshold: 1,
|
|
905
|
+
isScrollingResetDelay: 150,
|
|
906
|
+
enabled: true,
|
|
907
|
+
isRtl: false,
|
|
908
|
+
useScrollendEvent: false,
|
|
909
|
+
useAnimationFrameWithResizeObserver: false,
|
|
910
|
+
laneAssignmentMode: "estimate",
|
|
911
|
+
useCachedMeasurements: false
|
|
912
|
+
};
|
|
913
|
+
for (const key in opts2) {
|
|
914
|
+
const v = opts2[key];
|
|
915
|
+
if (v !== undefined)
|
|
916
|
+
merged[key] = v;
|
|
917
|
+
}
|
|
918
|
+
const prevOptions = this.options;
|
|
919
|
+
let anchor = null;
|
|
920
|
+
let followOnAppend = null;
|
|
921
|
+
let edgeKeysChanged = false;
|
|
922
|
+
if (prevOptions !== undefined && prevOptions.enabled && merged.enabled && merged.anchorTo === "end" && this.scrollElement !== null) {
|
|
923
|
+
const prevCount = prevOptions.count;
|
|
924
|
+
const nextCount = merged.count;
|
|
925
|
+
const measurements = this.getMeasurements();
|
|
926
|
+
const prevFirstKey = prevCount > 0 ? ((_a = measurements[0]) == null ? undefined : _a.key) ?? prevOptions.getItemKey(0) : null;
|
|
927
|
+
const prevLastKey = prevCount > 0 ? ((_b = measurements[prevCount - 1]) == null ? undefined : _b.key) ?? prevOptions.getItemKey(prevCount - 1) : null;
|
|
928
|
+
const didCountChange = nextCount !== prevCount;
|
|
929
|
+
const didEdgeKeysChange = didCountChange || prevCount > 0 && nextCount > 0 && (merged.getItemKey(0) !== prevFirstKey || merged.getItemKey(nextCount - 1) !== prevLastKey);
|
|
930
|
+
if (didEdgeKeysChange) {
|
|
931
|
+
edgeKeysChanged = true;
|
|
932
|
+
const item = prevCount > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? measurements[0] : null;
|
|
933
|
+
if (item) {
|
|
934
|
+
anchor = [item.key, this.getScrollOffset() - item.start];
|
|
935
|
+
}
|
|
936
|
+
const behavior = merged.followOnAppend === true ? "auto" : merged.followOnAppend || null;
|
|
937
|
+
if (behavior && nextCount > prevCount && this.isAtEnd(prevOptions.scrollEndThreshold) && (prevCount === 0 || merged.getItemKey(nextCount - 1) !== prevLastKey)) {
|
|
938
|
+
followOnAppend = behavior;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
this.options = merged;
|
|
943
|
+
if (edgeKeysChanged) {
|
|
944
|
+
this.pendingMin = 0;
|
|
945
|
+
this.itemSizeCacheVersion++;
|
|
946
|
+
}
|
|
947
|
+
let anchorResolved = false;
|
|
948
|
+
let anchorDelta = 0;
|
|
949
|
+
if (anchor && this.scrollOffset !== null) {
|
|
950
|
+
const [anchorKey, anchorOffset] = anchor;
|
|
951
|
+
const newMeasurements = this.getMeasurements();
|
|
952
|
+
const { count, getItemKey } = this.options;
|
|
953
|
+
let idx = 0;
|
|
954
|
+
while (idx < count && getItemKey(idx) !== anchorKey) {
|
|
955
|
+
idx++;
|
|
956
|
+
}
|
|
957
|
+
if (idx < count) {
|
|
958
|
+
const anchorItem = newMeasurements[idx];
|
|
959
|
+
if (anchorItem) {
|
|
960
|
+
const newOffset = anchorItem.start + anchorOffset;
|
|
961
|
+
if (newOffset !== this.scrollOffset) {
|
|
962
|
+
anchorDelta = newOffset - this.scrollOffset;
|
|
963
|
+
this.scrollOffset = newOffset;
|
|
964
|
+
anchorResolved = true;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
if (anchorResolved || followOnAppend) {
|
|
970
|
+
this.pendingScrollAnchor = [
|
|
971
|
+
anchorResolved ? anchor[0] : null,
|
|
972
|
+
anchorResolved ? anchor[1] : 0,
|
|
973
|
+
followOnAppend,
|
|
974
|
+
anchorDelta
|
|
975
|
+
];
|
|
976
|
+
}
|
|
977
|
+
};
|
|
978
|
+
this.notify = (sync) => {
|
|
979
|
+
var _a, _b;
|
|
980
|
+
(_b = (_a = this.options).onChange) == null || _b.call(_a, this, sync);
|
|
981
|
+
};
|
|
982
|
+
this.maybeNotify = memo(() => {
|
|
983
|
+
this.calculateRange();
|
|
984
|
+
return [
|
|
985
|
+
this.isScrolling,
|
|
986
|
+
this.range ? this.range.startIndex : null,
|
|
987
|
+
this.range ? this.range.endIndex : null
|
|
988
|
+
];
|
|
989
|
+
}, (isScrolling) => {
|
|
990
|
+
this.notify(isScrolling);
|
|
991
|
+
}, {
|
|
992
|
+
key: "maybeNotify",
|
|
993
|
+
debug: () => this.options.debug,
|
|
994
|
+
initialDeps: [
|
|
995
|
+
this.isScrolling,
|
|
996
|
+
this.range ? this.range.startIndex : null,
|
|
997
|
+
this.range ? this.range.endIndex : null
|
|
998
|
+
]
|
|
999
|
+
});
|
|
1000
|
+
this.cleanup = () => {
|
|
1001
|
+
this.unsubs.filter(Boolean).forEach((d) => d());
|
|
1002
|
+
this.unsubs = [];
|
|
1003
|
+
this.observer.disconnect();
|
|
1004
|
+
if (this.rafId != null && this.targetWindow) {
|
|
1005
|
+
this.targetWindow.cancelAnimationFrame(this.rafId);
|
|
1006
|
+
this.rafId = null;
|
|
1007
|
+
}
|
|
1008
|
+
this.scrollState = null;
|
|
1009
|
+
this.scrollElement = null;
|
|
1010
|
+
this.targetWindow = null;
|
|
1011
|
+
};
|
|
1012
|
+
this._didMount = () => {
|
|
1013
|
+
return () => {
|
|
1014
|
+
this.cleanup();
|
|
1015
|
+
};
|
|
1016
|
+
};
|
|
1017
|
+
this._willUpdate = () => {
|
|
1018
|
+
var _a;
|
|
1019
|
+
const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
|
|
1020
|
+
if (this.scrollElement !== scrollElement) {
|
|
1021
|
+
this.cleanup();
|
|
1022
|
+
if (!scrollElement) {
|
|
1023
|
+
this.maybeNotify();
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
this.scrollElement = scrollElement;
|
|
1027
|
+
if (this.scrollElement && "ownerDocument" in this.scrollElement) {
|
|
1028
|
+
this.targetWindow = this.scrollElement.ownerDocument.defaultView;
|
|
1029
|
+
} else {
|
|
1030
|
+
this.targetWindow = ((_a = this.scrollElement) == null ? undefined : _a.window) ?? null;
|
|
1031
|
+
}
|
|
1032
|
+
this.elementsCache.forEach((cached) => {
|
|
1033
|
+
this.observer.observe(cached);
|
|
1034
|
+
});
|
|
1035
|
+
this.unsubs.push(this.options.observeElementRect(this, (rect) => {
|
|
1036
|
+
this.scrollRect = rect;
|
|
1037
|
+
this.maybeNotify();
|
|
1038
|
+
}));
|
|
1039
|
+
this.unsubs.push(this.options.observeElementOffset(this, (offset, isScrolling) => {
|
|
1040
|
+
if (this._intendedScrollOffset !== null && Math.abs(offset - this._intendedScrollOffset) < 1.5) {
|
|
1041
|
+
offset = this._intendedScrollOffset;
|
|
1042
|
+
}
|
|
1043
|
+
this._intendedScrollOffset = null;
|
|
1044
|
+
this.scrollAdjustments = 0;
|
|
1045
|
+
this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null;
|
|
1046
|
+
this.scrollOffset = offset;
|
|
1047
|
+
this.isScrolling = isScrolling;
|
|
1048
|
+
this._flushIosDeferredIfReady();
|
|
1049
|
+
if (this.scrollState) {
|
|
1050
|
+
this.scheduleScrollReconcile();
|
|
1051
|
+
}
|
|
1052
|
+
this.maybeNotify();
|
|
1053
|
+
}));
|
|
1054
|
+
if ("addEventListener" in this.scrollElement) {
|
|
1055
|
+
const scrollEl = this.scrollElement;
|
|
1056
|
+
const onTouchStart = () => {
|
|
1057
|
+
this._iosTouching = true;
|
|
1058
|
+
this._iosJustTouchEnded = false;
|
|
1059
|
+
if (this._iosTouchEndTimerId !== null && this.targetWindow != null) {
|
|
1060
|
+
this.targetWindow.clearTimeout(this._iosTouchEndTimerId);
|
|
1061
|
+
this._iosTouchEndTimerId = null;
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
const onTouchEnd = () => {
|
|
1065
|
+
this._iosTouching = false;
|
|
1066
|
+
if (!isIOSWebKit() || this.targetWindow == null) {
|
|
1067
|
+
return;
|
|
1068
|
+
}
|
|
1069
|
+
this._iosJustTouchEnded = true;
|
|
1070
|
+
this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
|
|
1071
|
+
this._iosJustTouchEnded = false;
|
|
1072
|
+
this._iosTouchEndTimerId = null;
|
|
1073
|
+
this._flushIosDeferredIfReady();
|
|
1074
|
+
}, 150);
|
|
1075
|
+
};
|
|
1076
|
+
scrollEl.addEventListener("touchstart", onTouchStart, addEventListenerOptions);
|
|
1077
|
+
scrollEl.addEventListener("touchend", onTouchEnd, addEventListenerOptions);
|
|
1078
|
+
this.unsubs.push(() => {
|
|
1079
|
+
scrollEl.removeEventListener("touchstart", onTouchStart);
|
|
1080
|
+
scrollEl.removeEventListener("touchend", onTouchEnd);
|
|
1081
|
+
if (this._iosTouchEndTimerId !== null && this.targetWindow != null) {
|
|
1082
|
+
this.targetWindow.clearTimeout(this._iosTouchEndTimerId);
|
|
1083
|
+
this._iosTouchEndTimerId = null;
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
1088
|
+
adjustments: undefined,
|
|
1089
|
+
behavior: undefined
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
const anchor = this.pendingScrollAnchor;
|
|
1093
|
+
this.pendingScrollAnchor = null;
|
|
1094
|
+
if (anchor && this.scrollElement && this.options.enabled) {
|
|
1095
|
+
const [key, _offset, followOnAppend, anchorDelta] = anchor;
|
|
1096
|
+
if (key !== null && !followOnAppend) {
|
|
1097
|
+
if (isIOSWebKit() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded)) {
|
|
1098
|
+
if (anchorDelta !== 0) {
|
|
1099
|
+
this._iosDeferredAdjustment += anchorDelta;
|
|
1100
|
+
}
|
|
1101
|
+
} else {
|
|
1102
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
1103
|
+
adjustments: undefined,
|
|
1104
|
+
behavior: undefined
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
if (followOnAppend) {
|
|
1109
|
+
this.scrollToEnd({ behavior: followOnAppend });
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
this._flushIosDeferredIfReady = () => {
|
|
1114
|
+
if (this._iosDeferredAdjustment === 0)
|
|
1115
|
+
return;
|
|
1116
|
+
if (this.isScrolling)
|
|
1117
|
+
return;
|
|
1118
|
+
if (this._iosTouching)
|
|
1119
|
+
return;
|
|
1120
|
+
if (this._iosJustTouchEnded)
|
|
1121
|
+
return;
|
|
1122
|
+
const cur = this.getScrollOffset();
|
|
1123
|
+
const max = this.getMaxScrollOffset();
|
|
1124
|
+
if (cur < 0 || cur > max)
|
|
1125
|
+
return;
|
|
1126
|
+
const delta = this._iosDeferredAdjustment;
|
|
1127
|
+
this._iosDeferredAdjustment = 0;
|
|
1128
|
+
this._scrollToOffset(cur, {
|
|
1129
|
+
adjustments: this.scrollAdjustments += delta,
|
|
1130
|
+
behavior: undefined
|
|
1131
|
+
});
|
|
1132
|
+
};
|
|
1133
|
+
this.rafId = null;
|
|
1134
|
+
this.getSize = () => {
|
|
1135
|
+
if (!this.options.enabled) {
|
|
1136
|
+
this.scrollRect = null;
|
|
1137
|
+
return 0;
|
|
1138
|
+
}
|
|
1139
|
+
this.scrollRect = this.scrollRect ?? this.options.initialRect;
|
|
1140
|
+
return this.scrollRect[this.options.horizontal ? "width" : "height"];
|
|
1141
|
+
};
|
|
1142
|
+
this.getScrollOffset = () => {
|
|
1143
|
+
if (!this.options.enabled) {
|
|
1144
|
+
this.scrollOffset = null;
|
|
1145
|
+
return 0;
|
|
1146
|
+
}
|
|
1147
|
+
this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
|
|
1148
|
+
return this.scrollOffset;
|
|
1149
|
+
};
|
|
1150
|
+
this.getFurthestMeasurement = (measurements, index) => {
|
|
1151
|
+
const furthestMeasurementsFound = /* @__PURE__ */ new Map;
|
|
1152
|
+
const furthestMeasurements = /* @__PURE__ */ new Map;
|
|
1153
|
+
for (let m = index - 1;m >= 0; m--) {
|
|
1154
|
+
const measurement = measurements[m];
|
|
1155
|
+
if (furthestMeasurementsFound.has(measurement.lane)) {
|
|
1156
|
+
continue;
|
|
1157
|
+
}
|
|
1158
|
+
const previousFurthestMeasurement = furthestMeasurements.get(measurement.lane);
|
|
1159
|
+
if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
|
|
1160
|
+
furthestMeasurements.set(measurement.lane, measurement);
|
|
1161
|
+
} else if (measurement.end < previousFurthestMeasurement.end) {
|
|
1162
|
+
furthestMeasurementsFound.set(measurement.lane, true);
|
|
1163
|
+
}
|
|
1164
|
+
if (furthestMeasurementsFound.size === this.options.lanes) {
|
|
1165
|
+
break;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {
|
|
1169
|
+
if (a.end === b.end) {
|
|
1170
|
+
return a.index - b.index;
|
|
1171
|
+
}
|
|
1172
|
+
return a.end - b.end;
|
|
1173
|
+
})[0] : undefined;
|
|
1174
|
+
};
|
|
1175
|
+
this.getMeasurementOptions = memo(() => [
|
|
1176
|
+
this.options.count,
|
|
1177
|
+
this.options.paddingStart,
|
|
1178
|
+
this.options.scrollMargin,
|
|
1179
|
+
this.options.getItemKey,
|
|
1180
|
+
this.options.enabled,
|
|
1181
|
+
this.options.lanes,
|
|
1182
|
+
this.options.laneAssignmentMode
|
|
1183
|
+
], (count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode) => {
|
|
1184
|
+
const lanesChanged = this.prevLanes !== undefined && this.prevLanes !== lanes;
|
|
1185
|
+
if (lanesChanged) {
|
|
1186
|
+
this.lanesChangedFlag = true;
|
|
1187
|
+
}
|
|
1188
|
+
this.prevLanes = lanes;
|
|
1189
|
+
this.pendingMin = null;
|
|
1190
|
+
return {
|
|
1191
|
+
count,
|
|
1192
|
+
paddingStart,
|
|
1193
|
+
scrollMargin,
|
|
1194
|
+
getItemKey,
|
|
1195
|
+
enabled,
|
|
1196
|
+
lanes,
|
|
1197
|
+
laneAssignmentMode
|
|
1198
|
+
};
|
|
1199
|
+
}, {
|
|
1200
|
+
key: false
|
|
1201
|
+
});
|
|
1202
|
+
this.getMeasurements = memo(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({
|
|
1203
|
+
count,
|
|
1204
|
+
paddingStart,
|
|
1205
|
+
scrollMargin,
|
|
1206
|
+
getItemKey,
|
|
1207
|
+
enabled,
|
|
1208
|
+
lanes,
|
|
1209
|
+
laneAssignmentMode
|
|
1210
|
+
}, _itemSizeCacheVersion) => {
|
|
1211
|
+
const itemSizeCache = this.itemSizeCache;
|
|
1212
|
+
if (!enabled) {
|
|
1213
|
+
this.measurementsCache = [];
|
|
1214
|
+
this.itemSizeCache.clear();
|
|
1215
|
+
this.laneAssignments.clear();
|
|
1216
|
+
return [];
|
|
1217
|
+
}
|
|
1218
|
+
if (this.laneAssignments.size > count) {
|
|
1219
|
+
for (const index of this.laneAssignments.keys()) {
|
|
1220
|
+
if (index >= count) {
|
|
1221
|
+
this.laneAssignments.delete(index);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
if (this.lanesChangedFlag) {
|
|
1226
|
+
this.lanesChangedFlag = false;
|
|
1227
|
+
this.lanesSettling = true;
|
|
1228
|
+
this.measurementsCache = [];
|
|
1229
|
+
this.itemSizeCache.clear();
|
|
1230
|
+
this.laneAssignments.clear();
|
|
1231
|
+
this.pendingMin = null;
|
|
1232
|
+
}
|
|
1233
|
+
if (this.measurementsCache.length === 0 && !this.lanesSettling) {
|
|
1234
|
+
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
1235
|
+
this.measurementsCache.forEach((item) => {
|
|
1236
|
+
this.itemSizeCache.set(item.key, item.size);
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
const min = this.lanesSettling ? 0 : this.pendingMin ?? 0;
|
|
1240
|
+
this.pendingMin = null;
|
|
1241
|
+
if (this.lanesSettling && this.measurementsCache.length === count) {
|
|
1242
|
+
this.lanesSettling = false;
|
|
1243
|
+
}
|
|
1244
|
+
if (lanes === 1) {
|
|
1245
|
+
const gap = this.options.gap;
|
|
1246
|
+
const need = count * 2;
|
|
1247
|
+
let flat = this._flatMeasurements;
|
|
1248
|
+
if (!flat || flat.length < need) {
|
|
1249
|
+
const next = new Float64Array(need);
|
|
1250
|
+
if (flat && min > 0)
|
|
1251
|
+
next.set(flat.subarray(0, min * 2));
|
|
1252
|
+
flat = next;
|
|
1253
|
+
this._flatMeasurements = flat;
|
|
1254
|
+
}
|
|
1255
|
+
let runningStart;
|
|
1256
|
+
if (min === 0) {
|
|
1257
|
+
runningStart = paddingStart + scrollMargin;
|
|
1258
|
+
} else {
|
|
1259
|
+
const prevIdx = min - 1;
|
|
1260
|
+
runningStart = flat[prevIdx * 2] + flat[prevIdx * 2 + 1] + gap;
|
|
1261
|
+
}
|
|
1262
|
+
for (let i = min;i < count; i++) {
|
|
1263
|
+
const key = getItemKey(i);
|
|
1264
|
+
const measuredSize = itemSizeCache.get(key);
|
|
1265
|
+
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
|
|
1266
|
+
flat[i * 2] = runningStart;
|
|
1267
|
+
flat[i * 2 + 1] = size;
|
|
1268
|
+
runningStart += size + gap;
|
|
1269
|
+
}
|
|
1270
|
+
const view = createLazyMeasurementsView(count, flat, getItemKey);
|
|
1271
|
+
this.measurementsCache = view;
|
|
1272
|
+
return view;
|
|
1273
|
+
}
|
|
1274
|
+
const measurements = this.measurementsCache.slice(0, min);
|
|
1275
|
+
const laneLastIndex = new Array(lanes).fill(undefined);
|
|
1276
|
+
for (let m = 0;m < min; m++) {
|
|
1277
|
+
const item = measurements[m];
|
|
1278
|
+
if (item) {
|
|
1279
|
+
laneLastIndex[item.lane] = m;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
for (let i = min;i < count; i++) {
|
|
1283
|
+
const key = getItemKey(i);
|
|
1284
|
+
const cachedLane = this.laneAssignments.get(i);
|
|
1285
|
+
let lane;
|
|
1286
|
+
let start;
|
|
1287
|
+
const shouldCacheLane = laneAssignmentMode === "estimate" || itemSizeCache.has(key);
|
|
1288
|
+
if (cachedLane !== undefined && this.options.lanes > 1) {
|
|
1289
|
+
lane = cachedLane;
|
|
1290
|
+
const prevIndex = laneLastIndex[lane];
|
|
1291
|
+
const prevInLane = prevIndex !== undefined ? measurements[prevIndex] : undefined;
|
|
1292
|
+
start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin;
|
|
1293
|
+
} else {
|
|
1294
|
+
const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
|
|
1295
|
+
start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
|
|
1296
|
+
lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
|
|
1297
|
+
if (this.options.lanes > 1 && shouldCacheLane) {
|
|
1298
|
+
this.laneAssignments.set(i, lane);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
const measuredSize = itemSizeCache.get(key);
|
|
1302
|
+
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
|
|
1303
|
+
const end = start + size;
|
|
1304
|
+
measurements[i] = {
|
|
1305
|
+
index: i,
|
|
1306
|
+
start,
|
|
1307
|
+
size,
|
|
1308
|
+
end,
|
|
1309
|
+
key,
|
|
1310
|
+
lane
|
|
1311
|
+
};
|
|
1312
|
+
laneLastIndex[lane] = i;
|
|
1313
|
+
}
|
|
1314
|
+
this.measurementsCache = measurements;
|
|
1315
|
+
return measurements;
|
|
1316
|
+
}, {
|
|
1317
|
+
key: "getMeasurements",
|
|
1318
|
+
debug: () => this.options.debug
|
|
1319
|
+
});
|
|
1320
|
+
this.calculateRange = memo(() => [
|
|
1321
|
+
this.getMeasurements(),
|
|
1322
|
+
this.getSize(),
|
|
1323
|
+
this.getScrollOffset(),
|
|
1324
|
+
this.options.lanes
|
|
1325
|
+
], (measurements, outerSize, scrollOffset, lanes) => {
|
|
1326
|
+
return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
|
|
1327
|
+
measurements,
|
|
1328
|
+
outerSize,
|
|
1329
|
+
scrollOffset,
|
|
1330
|
+
lanes,
|
|
1331
|
+
flat: lanes === 1 && this._flatMeasurements != null ? this._flatMeasurements : null
|
|
1332
|
+
}) : null;
|
|
1333
|
+
}, {
|
|
1334
|
+
key: "calculateRange",
|
|
1335
|
+
debug: () => this.options.debug
|
|
1336
|
+
});
|
|
1337
|
+
this.getVirtualIndexes = memo(() => {
|
|
1338
|
+
let startIndex = null;
|
|
1339
|
+
let endIndex = null;
|
|
1340
|
+
const range = this.calculateRange();
|
|
1341
|
+
if (range) {
|
|
1342
|
+
startIndex = range.startIndex;
|
|
1343
|
+
endIndex = range.endIndex;
|
|
1344
|
+
}
|
|
1345
|
+
this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]);
|
|
1346
|
+
return [
|
|
1347
|
+
this.options.rangeExtractor,
|
|
1348
|
+
this.options.overscan,
|
|
1349
|
+
this.options.count,
|
|
1350
|
+
startIndex,
|
|
1351
|
+
endIndex
|
|
1352
|
+
];
|
|
1353
|
+
}, (rangeExtractor, overscan, count, startIndex, endIndex) => {
|
|
1354
|
+
return startIndex === null || endIndex === null ? [] : rangeExtractor({
|
|
1355
|
+
startIndex,
|
|
1356
|
+
endIndex,
|
|
1357
|
+
overscan,
|
|
1358
|
+
count
|
|
1359
|
+
});
|
|
1360
|
+
}, {
|
|
1361
|
+
key: "getVirtualIndexes",
|
|
1362
|
+
debug: () => this.options.debug
|
|
1363
|
+
});
|
|
1364
|
+
this.indexFromElement = (node) => {
|
|
1365
|
+
const attributeName = this.options.indexAttribute;
|
|
1366
|
+
const indexStr = node.getAttribute(attributeName);
|
|
1367
|
+
if (!indexStr) {
|
|
1368
|
+
console.warn(`Missing attribute name '${attributeName}={index}' on measured element.`);
|
|
1369
|
+
return -1;
|
|
1370
|
+
}
|
|
1371
|
+
return parseInt(indexStr, 10);
|
|
1372
|
+
};
|
|
1373
|
+
this.shouldMeasureDuringScroll = (index) => {
|
|
1374
|
+
var _a;
|
|
1375
|
+
if (!this.scrollState || this.scrollState.behavior !== "smooth") {
|
|
1376
|
+
return true;
|
|
1377
|
+
}
|
|
1378
|
+
const scrollIndex = this.scrollState.index ?? ((_a = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? undefined : _a.index);
|
|
1379
|
+
if (scrollIndex !== undefined && this.range) {
|
|
1380
|
+
const bufferSize = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2));
|
|
1381
|
+
const minIndex = Math.max(0, scrollIndex - bufferSize);
|
|
1382
|
+
const maxIndex = Math.min(this.options.count - 1, scrollIndex + bufferSize);
|
|
1383
|
+
return index >= minIndex && index <= maxIndex;
|
|
1384
|
+
}
|
|
1385
|
+
return true;
|
|
1386
|
+
};
|
|
1387
|
+
this.measureElement = (node) => {
|
|
1388
|
+
if (!node) {
|
|
1389
|
+
this.elementsCache.forEach((cached, key2) => {
|
|
1390
|
+
if (!cached.isConnected) {
|
|
1391
|
+
this.observer.unobserve(cached);
|
|
1392
|
+
this.elementsCache.delete(key2);
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
const index = this.indexFromElement(node);
|
|
1398
|
+
const key = this.options.getItemKey(index);
|
|
1399
|
+
const prevNode = this.elementsCache.get(key);
|
|
1400
|
+
if (prevNode !== node) {
|
|
1401
|
+
if (prevNode) {
|
|
1402
|
+
this.observer.unobserve(prevNode);
|
|
1403
|
+
}
|
|
1404
|
+
this.observer.observe(node);
|
|
1405
|
+
this.elementsCache.set(key, node);
|
|
1406
|
+
}
|
|
1407
|
+
if ((!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(index)) {
|
|
1408
|
+
this.resizeItem(index, this.options.measureElement(node, undefined, this));
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
this.resizeItem = (index, size) => {
|
|
1412
|
+
var _a, _b;
|
|
1413
|
+
if (index < 0 || index >= this.options.count)
|
|
1414
|
+
return;
|
|
1415
|
+
let cachedSize;
|
|
1416
|
+
let itemStart;
|
|
1417
|
+
let key;
|
|
1418
|
+
const flat = this._flatMeasurements;
|
|
1419
|
+
if (this.options.lanes === 1 && flat !== null) {
|
|
1420
|
+
key = this.options.getItemKey(index);
|
|
1421
|
+
itemStart = flat[index * 2];
|
|
1422
|
+
cachedSize = flat[index * 2 + 1];
|
|
1423
|
+
} else {
|
|
1424
|
+
const item = this.measurementsCache[index];
|
|
1425
|
+
if (!item)
|
|
1426
|
+
return;
|
|
1427
|
+
key = item.key;
|
|
1428
|
+
itemStart = item.start;
|
|
1429
|
+
cachedSize = item.size;
|
|
1430
|
+
}
|
|
1431
|
+
const itemSize = this.itemSizeCache.get(key) ?? cachedSize;
|
|
1432
|
+
const delta = size - itemSize;
|
|
1433
|
+
if (delta !== 0) {
|
|
1434
|
+
const wasAtEnd = this.options.anchorTo === "end" && ((_a = this.scrollState) == null ? undefined : _a.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold;
|
|
1435
|
+
const prevTotalSize = wasAtEnd ? this.getTotalSize() : 0;
|
|
1436
|
+
const shouldAdjustScroll = ((_b = this.scrollState) == null ? undefined : _b.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== undefined ? this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[index] ?? {
|
|
1437
|
+
index,
|
|
1438
|
+
key,
|
|
1439
|
+
start: itemStart,
|
|
1440
|
+
size: cachedSize,
|
|
1441
|
+
end: itemStart + cachedSize,
|
|
1442
|
+
lane: 0
|
|
1443
|
+
}, delta, this) : itemStart < this.getScrollOffset() + this.scrollAdjustments && (!this.itemSizeCache.has(key) || this.scrollDirection !== "backward"));
|
|
1444
|
+
if (this.pendingMin === null || index < this.pendingMin) {
|
|
1445
|
+
this.pendingMin = index;
|
|
1446
|
+
}
|
|
1447
|
+
this.itemSizeCache.set(key, size);
|
|
1448
|
+
this.itemSizeCacheVersion++;
|
|
1449
|
+
if (wasAtEnd) {
|
|
1450
|
+
this.applyScrollAdjustment(this.getTotalSize() - prevTotalSize);
|
|
1451
|
+
} else if (shouldAdjustScroll) {
|
|
1452
|
+
this.applyScrollAdjustment(delta);
|
|
1453
|
+
}
|
|
1454
|
+
this.notify(false);
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
this.getVirtualItems = memo(() => [this.getVirtualIndexes(), this.getMeasurements()], (indexes, measurements) => {
|
|
1458
|
+
const virtualItems = [];
|
|
1459
|
+
for (let k = 0, len = indexes.length;k < len; k++) {
|
|
1460
|
+
const i = indexes[k];
|
|
1461
|
+
const measurement = measurements[i];
|
|
1462
|
+
virtualItems.push(measurement);
|
|
1463
|
+
}
|
|
1464
|
+
return virtualItems;
|
|
1465
|
+
}, {
|
|
1466
|
+
key: "getVirtualItems",
|
|
1467
|
+
debug: () => this.options.debug
|
|
1468
|
+
});
|
|
1469
|
+
this.getVirtualItemForOffset = (offset) => {
|
|
1470
|
+
const measurements = this.getMeasurements();
|
|
1471
|
+
if (measurements.length === 0) {
|
|
1472
|
+
return;
|
|
1473
|
+
}
|
|
1474
|
+
const flat = this._flatMeasurements;
|
|
1475
|
+
const useFlat = this.options.lanes === 1 && flat != null;
|
|
1476
|
+
const idx = findNearestBinarySearch(0, measurements.length - 1, useFlat ? (i) => flat[i * 2] : (i) => notUndefined(measurements[i]).start, offset);
|
|
1477
|
+
return notUndefined(measurements[idx]);
|
|
1478
|
+
};
|
|
1479
|
+
this.getMaxScrollOffset = () => {
|
|
1480
|
+
if (!this.scrollElement)
|
|
1481
|
+
return 0;
|
|
1482
|
+
if ("scrollHeight" in this.scrollElement) {
|
|
1483
|
+
return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
1484
|
+
} else {
|
|
1485
|
+
const doc = this.scrollElement.document.documentElement;
|
|
1486
|
+
return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight;
|
|
1487
|
+
}
|
|
1488
|
+
};
|
|
1489
|
+
this.getVirtualDistanceFromEnd = () => {
|
|
1490
|
+
return Math.max(this.getTotalSize() - this.getSize() - this.getScrollOffset(), 0);
|
|
1491
|
+
};
|
|
1492
|
+
this.getDistanceFromEnd = () => {
|
|
1493
|
+
return Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0);
|
|
1494
|
+
};
|
|
1495
|
+
this.isAtEnd = (threshold = this.options.scrollEndThreshold) => {
|
|
1496
|
+
return this.getDistanceFromEnd() <= threshold;
|
|
1497
|
+
};
|
|
1498
|
+
this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
|
|
1499
|
+
if (!this.scrollElement)
|
|
1500
|
+
return 0;
|
|
1501
|
+
const size = this.getSize();
|
|
1502
|
+
const scrollOffset = this.getScrollOffset();
|
|
1503
|
+
if (align === "auto") {
|
|
1504
|
+
align = toOffset >= scrollOffset + size ? "end" : "start";
|
|
1505
|
+
}
|
|
1506
|
+
if (align === "center") {
|
|
1507
|
+
toOffset += (itemSize - size) / 2;
|
|
1508
|
+
} else if (align === "end") {
|
|
1509
|
+
toOffset -= size;
|
|
1510
|
+
}
|
|
1511
|
+
const maxOffset = this.getMaxScrollOffset();
|
|
1512
|
+
return Math.max(Math.min(maxOffset, toOffset), 0);
|
|
1513
|
+
};
|
|
1514
|
+
this.getOffsetForIndex = (index, align = "auto") => {
|
|
1515
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1516
|
+
const size = this.getSize();
|
|
1517
|
+
const scrollOffset = this.getScrollOffset();
|
|
1518
|
+
const item = this.measurementsCache[index];
|
|
1519
|
+
if (!item)
|
|
1520
|
+
return;
|
|
1521
|
+
if (align === "auto") {
|
|
1522
|
+
if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {
|
|
1523
|
+
align = "end";
|
|
1524
|
+
} else if (item.start <= scrollOffset + this.options.scrollPaddingStart) {
|
|
1525
|
+
align = "start";
|
|
1526
|
+
} else {
|
|
1527
|
+
return [scrollOffset, align];
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
if (align === "end" && index === this.options.count - 1) {
|
|
1531
|
+
return [this.getMaxScrollOffset(), align];
|
|
1532
|
+
}
|
|
1533
|
+
const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
|
|
1534
|
+
return [
|
|
1535
|
+
this.getOffsetForAlignment(toOffset, align, item.size),
|
|
1536
|
+
align
|
|
1537
|
+
];
|
|
1538
|
+
};
|
|
1539
|
+
this.scrollToOffset = (toOffset, { align = "start", behavior = "auto" } = {}) => {
|
|
1540
|
+
const offset = this.getOffsetForAlignment(toOffset, align);
|
|
1541
|
+
const now = this.now();
|
|
1542
|
+
this.scrollState = {
|
|
1543
|
+
index: null,
|
|
1544
|
+
align,
|
|
1545
|
+
behavior,
|
|
1546
|
+
startedAt: now,
|
|
1547
|
+
lastTargetOffset: offset,
|
|
1548
|
+
stableFrames: 0
|
|
1549
|
+
};
|
|
1550
|
+
this._scrollToOffset(offset, { adjustments: undefined, behavior });
|
|
1551
|
+
this.scheduleScrollReconcile();
|
|
1552
|
+
};
|
|
1553
|
+
this.scrollToIndex = (index, {
|
|
1554
|
+
align: initialAlign = "auto",
|
|
1555
|
+
behavior = "auto"
|
|
1556
|
+
} = {}) => {
|
|
1557
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
1558
|
+
const offsetInfo = this.getOffsetForIndex(index, initialAlign);
|
|
1559
|
+
if (!offsetInfo) {
|
|
1560
|
+
return;
|
|
1561
|
+
}
|
|
1562
|
+
const [offset, align] = offsetInfo;
|
|
1563
|
+
const now = this.now();
|
|
1564
|
+
this.scrollState = {
|
|
1565
|
+
index,
|
|
1566
|
+
align,
|
|
1567
|
+
behavior,
|
|
1568
|
+
startedAt: now,
|
|
1569
|
+
lastTargetOffset: offset,
|
|
1570
|
+
stableFrames: 0
|
|
1571
|
+
};
|
|
1572
|
+
this._scrollToOffset(offset, { adjustments: undefined, behavior });
|
|
1573
|
+
this.scheduleScrollReconcile();
|
|
1574
|
+
};
|
|
1575
|
+
this.scrollBy = (delta, { behavior = "auto" } = {}) => {
|
|
1576
|
+
const offset = this.getScrollOffset() + delta;
|
|
1577
|
+
const now = this.now();
|
|
1578
|
+
this.scrollState = {
|
|
1579
|
+
index: null,
|
|
1580
|
+
align: "start",
|
|
1581
|
+
behavior,
|
|
1582
|
+
startedAt: now,
|
|
1583
|
+
lastTargetOffset: offset,
|
|
1584
|
+
stableFrames: 0
|
|
1585
|
+
};
|
|
1586
|
+
this._scrollToOffset(offset, { adjustments: undefined, behavior });
|
|
1587
|
+
this.scheduleScrollReconcile();
|
|
1588
|
+
};
|
|
1589
|
+
this.scrollToEnd = ({ behavior = "auto" } = {}) => {
|
|
1590
|
+
if (this.options.count > 0) {
|
|
1591
|
+
this.scrollToIndex(this.options.count - 1, {
|
|
1592
|
+
align: "end",
|
|
1593
|
+
behavior
|
|
1594
|
+
});
|
|
1595
|
+
return;
|
|
1596
|
+
}
|
|
1597
|
+
this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), {
|
|
1598
|
+
behavior
|
|
1599
|
+
});
|
|
1600
|
+
};
|
|
1601
|
+
this.getTotalSize = () => {
|
|
1602
|
+
var _a;
|
|
1603
|
+
const measurements = this.getMeasurements();
|
|
1604
|
+
let end;
|
|
1605
|
+
if (measurements.length === 0) {
|
|
1606
|
+
end = this.options.paddingStart;
|
|
1607
|
+
} else if (this.options.lanes === 1) {
|
|
1608
|
+
const lastIdx = measurements.length - 1;
|
|
1609
|
+
const flat = this._flatMeasurements;
|
|
1610
|
+
if (flat != null) {
|
|
1611
|
+
end = flat[lastIdx * 2] + flat[lastIdx * 2 + 1];
|
|
1612
|
+
} else {
|
|
1613
|
+
end = ((_a = measurements[lastIdx]) == null ? undefined : _a.end) ?? 0;
|
|
1614
|
+
}
|
|
1615
|
+
} else {
|
|
1616
|
+
const endByLane = Array(this.options.lanes).fill(null);
|
|
1617
|
+
let endIndex = measurements.length - 1;
|
|
1618
|
+
while (endIndex >= 0 && endByLane.some((val) => val === null)) {
|
|
1619
|
+
const item = measurements[endIndex];
|
|
1620
|
+
if (endByLane[item.lane] === null) {
|
|
1621
|
+
endByLane[item.lane] = item.end;
|
|
1622
|
+
}
|
|
1623
|
+
endIndex--;
|
|
1624
|
+
}
|
|
1625
|
+
end = Math.max(...endByLane.filter((val) => val !== null));
|
|
1626
|
+
}
|
|
1627
|
+
return Math.max(end - this.options.scrollMargin + this.options.paddingEnd, 0);
|
|
1628
|
+
};
|
|
1629
|
+
this.takeSnapshot = () => {
|
|
1630
|
+
const snapshot = [];
|
|
1631
|
+
if (this.itemSizeCache.size === 0)
|
|
1632
|
+
return snapshot;
|
|
1633
|
+
const m = this.getMeasurements();
|
|
1634
|
+
for (const item of m) {
|
|
1635
|
+
if (item && this.itemSizeCache.has(item.key)) {
|
|
1636
|
+
snapshot.push({
|
|
1637
|
+
index: item.index,
|
|
1638
|
+
key: item.key,
|
|
1639
|
+
start: item.start,
|
|
1640
|
+
size: item.size,
|
|
1641
|
+
end: item.end,
|
|
1642
|
+
lane: item.lane
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
return snapshot;
|
|
1647
|
+
};
|
|
1648
|
+
this._scrollToOffset = (offset, {
|
|
1649
|
+
adjustments,
|
|
1650
|
+
behavior
|
|
1651
|
+
}) => {
|
|
1652
|
+
this._intendedScrollOffset = offset + (adjustments ?? 0);
|
|
1653
|
+
this.options.scrollToFn(offset, { behavior, adjustments }, this);
|
|
1654
|
+
};
|
|
1655
|
+
this.measure = () => {
|
|
1656
|
+
this.pendingMin = null;
|
|
1657
|
+
this.itemSizeCache.clear();
|
|
1658
|
+
this.laneAssignments.clear();
|
|
1659
|
+
this.itemSizeCacheVersion++;
|
|
1660
|
+
this.notify(false);
|
|
1661
|
+
};
|
|
1662
|
+
this.setOptions(opts);
|
|
1663
|
+
}
|
|
1664
|
+
applyScrollAdjustment(delta, behavior) {
|
|
1665
|
+
if (delta === 0)
|
|
1666
|
+
return;
|
|
1667
|
+
if (this.options.debug) {
|
|
1668
|
+
console.info("correction", delta);
|
|
1669
|
+
}
|
|
1670
|
+
if (isIOSWebKit() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded)) {
|
|
1671
|
+
this._iosDeferredAdjustment += delta;
|
|
1672
|
+
} else {
|
|
1673
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
1674
|
+
adjustments: this.scrollAdjustments += delta,
|
|
1675
|
+
behavior
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
scheduleScrollReconcile() {
|
|
1680
|
+
if (!this.targetWindow) {
|
|
1681
|
+
this.scrollState = null;
|
|
1682
|
+
return;
|
|
1683
|
+
}
|
|
1684
|
+
if (this.rafId != null)
|
|
1685
|
+
return;
|
|
1686
|
+
this.rafId = this.targetWindow.requestAnimationFrame(() => {
|
|
1687
|
+
this.rafId = null;
|
|
1688
|
+
this.reconcileScroll();
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
reconcileScroll() {
|
|
1692
|
+
if (!this.scrollState)
|
|
1693
|
+
return;
|
|
1694
|
+
const el = this.scrollElement;
|
|
1695
|
+
if (!el)
|
|
1696
|
+
return;
|
|
1697
|
+
const MAX_RECONCILE_MS = 5000;
|
|
1698
|
+
if (this.now() - this.scrollState.startedAt > MAX_RECONCILE_MS) {
|
|
1699
|
+
this.scrollState = null;
|
|
1700
|
+
return;
|
|
1701
|
+
}
|
|
1702
|
+
const offsetInfo = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : undefined;
|
|
1703
|
+
const targetOffset = offsetInfo ? offsetInfo[0] : this.scrollState.lastTargetOffset;
|
|
1704
|
+
const STABLE_FRAMES = 1;
|
|
1705
|
+
const targetChanged = targetOffset !== this.scrollState.lastTargetOffset;
|
|
1706
|
+
if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) {
|
|
1707
|
+
this.scrollState.stableFrames++;
|
|
1708
|
+
if (this.scrollState.stableFrames >= STABLE_FRAMES) {
|
|
1709
|
+
if (this.getScrollOffset() !== targetOffset) {
|
|
1710
|
+
this._scrollToOffset(targetOffset, {
|
|
1711
|
+
adjustments: undefined,
|
|
1712
|
+
behavior: "auto"
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
this.scrollState = null;
|
|
1716
|
+
return;
|
|
1717
|
+
}
|
|
1718
|
+
} else {
|
|
1719
|
+
this.scrollState.stableFrames = 0;
|
|
1720
|
+
if (targetChanged) {
|
|
1721
|
+
const viewport = this.getSize() || 600;
|
|
1722
|
+
const distance = Math.abs(targetOffset - this.getScrollOffset());
|
|
1723
|
+
const keepSmooth = this.scrollState.behavior === "smooth" && distance > viewport;
|
|
1724
|
+
this.scrollState.lastTargetOffset = targetOffset;
|
|
1725
|
+
if (!keepSmooth) {
|
|
1726
|
+
this.scrollState.behavior = "auto";
|
|
1727
|
+
}
|
|
1728
|
+
this._scrollToOffset(targetOffset, {
|
|
1729
|
+
adjustments: undefined,
|
|
1730
|
+
behavior: keepSmooth ? "smooth" : "auto"
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
this.scheduleScrollReconcile();
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
var findNearestBinarySearch = (low, high, getCurrentValue, value) => {
|
|
1738
|
+
while (low <= high) {
|
|
1739
|
+
const middle = (low + high) / 2 | 0;
|
|
1740
|
+
const currentValue = getCurrentValue(middle);
|
|
1741
|
+
if (currentValue < value) {
|
|
1742
|
+
low = middle + 1;
|
|
1743
|
+
} else if (currentValue > value) {
|
|
1744
|
+
high = middle - 1;
|
|
1745
|
+
} else {
|
|
1746
|
+
return middle;
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
if (low > 0) {
|
|
1750
|
+
return low - 1;
|
|
1751
|
+
} else {
|
|
1752
|
+
return 0;
|
|
1753
|
+
}
|
|
1754
|
+
};
|
|
1755
|
+
function calculateRange({
|
|
1756
|
+
measurements,
|
|
1757
|
+
outerSize,
|
|
1758
|
+
scrollOffset,
|
|
1759
|
+
lanes,
|
|
1760
|
+
flat
|
|
1761
|
+
}) {
|
|
1762
|
+
const lastIndex = measurements.length - 1;
|
|
1763
|
+
const getStart = flat ? (index) => flat[index * 2] : (index) => measurements[index].start;
|
|
1764
|
+
const getEnd = flat ? (index) => flat[index * 2] + flat[index * 2 + 1] : (index) => measurements[index].end;
|
|
1765
|
+
if (measurements.length <= lanes) {
|
|
1766
|
+
return {
|
|
1767
|
+
startIndex: 0,
|
|
1768
|
+
endIndex: lastIndex
|
|
1769
|
+
};
|
|
1770
|
+
}
|
|
1771
|
+
let startIndex = findNearestBinarySearch(0, lastIndex, getStart, scrollOffset);
|
|
1772
|
+
let endIndex = startIndex;
|
|
1773
|
+
if (lanes === 1) {
|
|
1774
|
+
while (endIndex < lastIndex && getEnd(endIndex) < scrollOffset + outerSize) {
|
|
1775
|
+
endIndex++;
|
|
1776
|
+
}
|
|
1777
|
+
} else if (lanes > 1) {
|
|
1778
|
+
const endPerLane = Array(lanes).fill(0);
|
|
1779
|
+
while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
|
|
1780
|
+
const item = measurements[endIndex];
|
|
1781
|
+
endPerLane[item.lane] = item.end;
|
|
1782
|
+
endIndex++;
|
|
1783
|
+
}
|
|
1784
|
+
const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
|
|
1785
|
+
while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
|
|
1786
|
+
const item = measurements[startIndex];
|
|
1787
|
+
startPerLane[item.lane] = item.start;
|
|
1788
|
+
startIndex--;
|
|
1789
|
+
}
|
|
1790
|
+
startIndex = Math.max(0, startIndex - startIndex % lanes);
|
|
1791
|
+
endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
|
|
1792
|
+
}
|
|
1793
|
+
return { startIndex, endIndex };
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
// src/components/data-grid/_internal/virtualization-adapter.svelte.ts
|
|
1797
|
+
import { createSubscriber } from "svelte/reactivity";
|
|
1798
|
+
var defaultDataGridVirtualRowHeight = 44;
|
|
1799
|
+
|
|
1800
|
+
class DataGridVirtualizationAdapter {
|
|
1801
|
+
options;
|
|
1802
|
+
#rowVirtualizer = null;
|
|
1803
|
+
#columnVirtualizer = null;
|
|
1804
|
+
#scrollElement = null;
|
|
1805
|
+
#update = () => {};
|
|
1806
|
+
#subscribe;
|
|
1807
|
+
constructor(options) {
|
|
1808
|
+
this.options = options;
|
|
1809
|
+
this.#subscribe = createSubscriber((update) => {
|
|
1810
|
+
if (typeof window === "undefined")
|
|
1811
|
+
return;
|
|
1812
|
+
this.#update = update;
|
|
1813
|
+
this.#rowVirtualizer = new Virtualizer(this.#buildRowOptions());
|
|
1814
|
+
this.#columnVirtualizer = new Virtualizer(this.#buildColumnOptions());
|
|
1815
|
+
const cleanup = this.#rowVirtualizer._didMount();
|
|
1816
|
+
const cleanupColumns = this.#columnVirtualizer._didMount();
|
|
1817
|
+
this.#rowVirtualizer._willUpdate();
|
|
1818
|
+
this.#columnVirtualizer._willUpdate();
|
|
1819
|
+
update();
|
|
1820
|
+
return () => {
|
|
1821
|
+
cleanup();
|
|
1822
|
+
cleanupColumns();
|
|
1823
|
+
this.#rowVirtualizer = null;
|
|
1824
|
+
this.#columnVirtualizer = null;
|
|
1825
|
+
};
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
get virtualRows() {
|
|
1829
|
+
if (typeof window === "undefined")
|
|
1830
|
+
return [];
|
|
1831
|
+
this.#subscribe();
|
|
1832
|
+
this.#syncOptions();
|
|
1833
|
+
const fallbackRows = this.#fallbackRows();
|
|
1834
|
+
const virtualRows = this.#rowVirtualizer?.getVirtualItems();
|
|
1835
|
+
const rows = this.#shouldUseFallbackRows(virtualRows, fallbackRows) ? fallbackRows : virtualRows ?? fallbackRows;
|
|
1836
|
+
return rows.map(toDataGridVirtualItem);
|
|
1837
|
+
}
|
|
1838
|
+
get virtualColumns() {
|
|
1839
|
+
if (typeof window === "undefined")
|
|
1840
|
+
return [];
|
|
1841
|
+
this.#subscribe();
|
|
1842
|
+
this.#syncOptions();
|
|
1843
|
+
const fallbackColumns = this.#fallbackColumns();
|
|
1844
|
+
const virtualColumns = this.#columnVirtualizer?.getVirtualItems();
|
|
1845
|
+
const columns = this.#shouldUseFallbackColumns(virtualColumns, fallbackColumns) ? fallbackColumns : virtualColumns ?? fallbackColumns;
|
|
1846
|
+
return columns.map(toDataGridVirtualItem);
|
|
1847
|
+
}
|
|
1848
|
+
get totalHeight() {
|
|
1849
|
+
if (typeof window === "undefined")
|
|
1850
|
+
return this.options.getRowCount() * this.#rowHeight();
|
|
1851
|
+
this.#subscribe();
|
|
1852
|
+
this.#syncOptions();
|
|
1853
|
+
return this.#rowVirtualizer?.getTotalSize() ?? this.options.getRowCount() * this.#rowHeight();
|
|
1854
|
+
}
|
|
1855
|
+
get totalWidth() {
|
|
1856
|
+
if (typeof window === "undefined")
|
|
1857
|
+
return this.#totalColumnWidth();
|
|
1858
|
+
this.#subscribe();
|
|
1859
|
+
this.#syncOptions();
|
|
1860
|
+
return this.#columnVirtualizer?.getTotalSize() ?? this.#totalColumnWidth();
|
|
1861
|
+
}
|
|
1862
|
+
mountScrollContainer = (node) => {
|
|
1863
|
+
this.#setScrollElement(node);
|
|
1864
|
+
return () => {
|
|
1865
|
+
if (this.#scrollElement === node) {
|
|
1866
|
+
this.#setScrollElement(null);
|
|
1867
|
+
}
|
|
1868
|
+
};
|
|
1869
|
+
};
|
|
1870
|
+
measureElement = (node) => {
|
|
1871
|
+
this.#syncOptions();
|
|
1872
|
+
this.#rowVirtualizer?.measureElement(node);
|
|
1873
|
+
return () => this.#rowVirtualizer?.measureElement(null);
|
|
1874
|
+
};
|
|
1875
|
+
refreshMeasurements() {
|
|
1876
|
+
this.#subscribe();
|
|
1877
|
+
this.#syncOptions();
|
|
1878
|
+
this.#update();
|
|
1879
|
+
}
|
|
1880
|
+
scrollToRow(index, options = { align: "auto" }) {
|
|
1881
|
+
this.#subscribe();
|
|
1882
|
+
this.#syncOptions();
|
|
1883
|
+
const element = this.#getScrollElement();
|
|
1884
|
+
const shouldUseFallbackScroll = Boolean(element && (!this.#rowVirtualizer || element.clientHeight === 0));
|
|
1885
|
+
this.#rowVirtualizer?.scrollToIndex(index, options);
|
|
1886
|
+
if (!element || !shouldUseFallbackScroll)
|
|
1887
|
+
return;
|
|
1888
|
+
element.scrollTop = this.#scrollPaddingStart() + Math.max(0, index * this.#rowHeight());
|
|
1889
|
+
element.dispatchEvent(new Event("scroll"));
|
|
1890
|
+
}
|
|
1891
|
+
scrollToColumn(index, options = { align: "auto" }) {
|
|
1892
|
+
this.#subscribe();
|
|
1893
|
+
this.#syncOptions();
|
|
1894
|
+
const element = this.#getScrollElement();
|
|
1895
|
+
const shouldUseFallbackScroll = Boolean(element && (!this.#columnVirtualizer || element.clientWidth === 0));
|
|
1896
|
+
this.#columnVirtualizer?.scrollToIndex(index, options);
|
|
1897
|
+
if (!element || !shouldUseFallbackScroll)
|
|
1898
|
+
return;
|
|
1899
|
+
element.scrollLeft = this.#columnStart(index);
|
|
1900
|
+
element.dispatchEvent(new Event("scroll"));
|
|
1901
|
+
}
|
|
1902
|
+
#setScrollElement(element) {
|
|
1903
|
+
if (this.#scrollElement === element)
|
|
1904
|
+
return;
|
|
1905
|
+
this.#scrollElement = element;
|
|
1906
|
+
this.#syncOptions();
|
|
1907
|
+
this.#update();
|
|
1908
|
+
}
|
|
1909
|
+
#syncOptions() {
|
|
1910
|
+
if (this.#rowVirtualizer) {
|
|
1911
|
+
this.#rowVirtualizer.setOptions(this.#buildRowOptions());
|
|
1912
|
+
this.#rowVirtualizer._willUpdate();
|
|
1913
|
+
}
|
|
1914
|
+
if (this.#columnVirtualizer) {
|
|
1915
|
+
this.#columnVirtualizer.setOptions(this.#buildColumnOptions());
|
|
1916
|
+
this.#columnVirtualizer._willUpdate();
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
#buildRowOptions() {
|
|
1920
|
+
return {
|
|
1921
|
+
count: this.options.getRowCount(),
|
|
1922
|
+
getScrollElement: this.#getScrollElement,
|
|
1923
|
+
getItemKey: this.options.getRowKey,
|
|
1924
|
+
estimateSize: () => this.#rowHeight(),
|
|
1925
|
+
overscan: this.#overscan(),
|
|
1926
|
+
initialRect: { width: 0, height: this.options.getInitialHeight() },
|
|
1927
|
+
observeElementRect: this.#observeElementRect,
|
|
1928
|
+
observeElementOffset: this.#observeElementOffset,
|
|
1929
|
+
scrollToFn: this.#scrollToOffset,
|
|
1930
|
+
measureElement: this.#measureElement,
|
|
1931
|
+
onChange: () => this.#update(),
|
|
1932
|
+
indexAttribute: "data-cinder-virtual-index",
|
|
1933
|
+
scrollPaddingStart: this.#scrollPaddingStart()
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
#buildColumnOptions() {
|
|
1937
|
+
return {
|
|
1938
|
+
count: this.options.getColumnCount(),
|
|
1939
|
+
getScrollElement: this.#getScrollElement,
|
|
1940
|
+
getItemKey: this.options.getColumnKey,
|
|
1941
|
+
estimateSize: (index) => this.#columnWidth(index),
|
|
1942
|
+
overscan: this.#overscan(),
|
|
1943
|
+
horizontal: true,
|
|
1944
|
+
initialRect: { width: this.options.getInitialWidth(), height: 0 },
|
|
1945
|
+
observeElementRect: this.#observeElementRect,
|
|
1946
|
+
observeElementOffset: this.#observeElementHorizontalOffset,
|
|
1947
|
+
scrollToFn: this.#scrollToHorizontalOffset,
|
|
1948
|
+
onChange: () => this.#update(),
|
|
1949
|
+
scrollPaddingStart: 0
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
#getScrollElement = () => this.#scrollElement ?? this.options.getScrollElement();
|
|
1953
|
+
#scrollToOffset = (offset, { adjustments = 0, behavior }, instance) => {
|
|
1954
|
+
const element = instance.scrollElement;
|
|
1955
|
+
if (!element)
|
|
1956
|
+
return;
|
|
1957
|
+
const top = this.#scrollPaddingStart() + offset + adjustments;
|
|
1958
|
+
if (typeof element.scrollTo === "function") {
|
|
1959
|
+
element.scrollTo(behavior ? { top, behavior } : { top });
|
|
1960
|
+
return;
|
|
1961
|
+
}
|
|
1962
|
+
element.scrollTop = top;
|
|
1963
|
+
};
|
|
1964
|
+
#scrollToHorizontalOffset = (offset, { adjustments = 0, behavior }, instance) => {
|
|
1965
|
+
const element = instance.scrollElement;
|
|
1966
|
+
if (!element)
|
|
1967
|
+
return;
|
|
1968
|
+
const left = offset + adjustments;
|
|
1969
|
+
if (typeof element.scrollTo === "function") {
|
|
1970
|
+
element.scrollTo(behavior ? { left, behavior } : { left });
|
|
1971
|
+
return;
|
|
1972
|
+
}
|
|
1973
|
+
element.scrollLeft = left;
|
|
1974
|
+
};
|
|
1975
|
+
#observeElementRect = (instance, callback) => {
|
|
1976
|
+
const element = instance.scrollElement;
|
|
1977
|
+
if (!element)
|
|
1978
|
+
return () => {};
|
|
1979
|
+
const notify = () => {
|
|
1980
|
+
const rect = element.getBoundingClientRect();
|
|
1981
|
+
const scrollPaddingStart = this.#scrollPaddingStart();
|
|
1982
|
+
const height = rect.height || element.clientHeight || this.options.getInitialHeight();
|
|
1983
|
+
const width = rect.width || element.clientWidth || this.options.getInitialWidth();
|
|
1984
|
+
callback({
|
|
1985
|
+
width: Math.max(0, width - this.#scrollPaddingInlineStart() - this.#scrollPaddingInlineEnd()) || this.options.getInitialWidth(),
|
|
1986
|
+
height: Math.max(0, height - scrollPaddingStart) || this.options.getInitialHeight()
|
|
1987
|
+
});
|
|
1988
|
+
};
|
|
1989
|
+
notify();
|
|
1990
|
+
if (typeof ResizeObserver === "undefined")
|
|
1991
|
+
return () => {};
|
|
1992
|
+
const observer = new ResizeObserver(notify);
|
|
1993
|
+
observer.observe(element);
|
|
1994
|
+
return () => observer.disconnect();
|
|
1995
|
+
};
|
|
1996
|
+
#observeElementOffset = (instance, callback) => {
|
|
1997
|
+
const element = instance.scrollElement;
|
|
1998
|
+
if (!element)
|
|
1999
|
+
return () => {};
|
|
2000
|
+
const notify = () => {
|
|
2001
|
+
callback(this.#scrollOffset(element), true);
|
|
2002
|
+
this.#update();
|
|
2003
|
+
};
|
|
2004
|
+
callback(this.#scrollOffset(element), false);
|
|
2005
|
+
element.addEventListener("scroll", notify, { passive: true });
|
|
2006
|
+
return () => element.removeEventListener("scroll", notify);
|
|
2007
|
+
};
|
|
2008
|
+
#observeElementHorizontalOffset = (instance, callback) => {
|
|
2009
|
+
const element = instance.scrollElement;
|
|
2010
|
+
if (!element)
|
|
2011
|
+
return () => {};
|
|
2012
|
+
const notify = () => {
|
|
2013
|
+
callback(this.#horizontalScrollOffset(element), true);
|
|
2014
|
+
this.#update();
|
|
2015
|
+
};
|
|
2016
|
+
callback(this.#horizontalScrollOffset(element), false);
|
|
2017
|
+
element.addEventListener("scroll", notify, { passive: true });
|
|
2018
|
+
return () => element.removeEventListener("scroll", notify);
|
|
2019
|
+
};
|
|
2020
|
+
#measureElement = (element) => {
|
|
2021
|
+
const rect = element.getBoundingClientRect();
|
|
2022
|
+
return rect.height || this.#rowHeight();
|
|
2023
|
+
};
|
|
2024
|
+
#fallbackRows() {
|
|
2025
|
+
const count = this.options.getRowCount();
|
|
2026
|
+
if (count === 0)
|
|
2027
|
+
return [];
|
|
2028
|
+
const rowHeight = this.#rowHeight();
|
|
2029
|
+
const overscan = this.#overscan();
|
|
2030
|
+
const scrollTop = this.#scrollOffset(this.#getScrollElement());
|
|
2031
|
+
const visibleCount = Math.ceil(this.#viewportHeight() / rowHeight);
|
|
2032
|
+
const startIndex = Math.max(0, Math.floor(scrollTop / rowHeight) - overscan);
|
|
2033
|
+
const itemCount = Math.min(count - startIndex, visibleCount + overscan * 2);
|
|
2034
|
+
return Array.from({ length: itemCount }, (_, offset) => {
|
|
2035
|
+
const index = startIndex + offset;
|
|
2036
|
+
return {
|
|
2037
|
+
key: this.options.getRowKey(index),
|
|
2038
|
+
index,
|
|
2039
|
+
start: index * rowHeight,
|
|
2040
|
+
end: (index + 1) * rowHeight,
|
|
2041
|
+
size: rowHeight,
|
|
2042
|
+
lane: 0
|
|
2043
|
+
};
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
#fallbackColumns() {
|
|
2047
|
+
const count = this.options.getColumnCount();
|
|
2048
|
+
if (count === 0)
|
|
2049
|
+
return [];
|
|
2050
|
+
const overscan = this.#overscan();
|
|
2051
|
+
const scrollLeft = this.#horizontalScrollOffset(this.#getScrollElement());
|
|
2052
|
+
const viewportWidth = this.#viewportWidth();
|
|
2053
|
+
const startIndex = Math.max(0, this.#columnIndexAtOffset(scrollLeft) - overscan);
|
|
2054
|
+
const items = [];
|
|
2055
|
+
let index = startIndex;
|
|
2056
|
+
let start = this.#columnStart(index);
|
|
2057
|
+
let end = start;
|
|
2058
|
+
const maxEnd = scrollLeft + viewportWidth;
|
|
2059
|
+
while (index < count && (items.length < overscan * 2 || end <= maxEnd + this.#columnWidth(index))) {
|
|
2060
|
+
const size = this.#columnWidth(index);
|
|
2061
|
+
end = start + size;
|
|
2062
|
+
items.push({
|
|
2063
|
+
key: this.options.getColumnKey(index),
|
|
2064
|
+
index,
|
|
2065
|
+
start,
|
|
2066
|
+
end,
|
|
2067
|
+
size,
|
|
2068
|
+
lane: 0
|
|
2069
|
+
});
|
|
2070
|
+
index += 1;
|
|
2071
|
+
start = end;
|
|
2072
|
+
}
|
|
2073
|
+
return items;
|
|
2074
|
+
}
|
|
2075
|
+
#shouldUseFallbackRows(virtualizerRows, fallbackRows) {
|
|
2076
|
+
if (!virtualizerRows || fallbackRows.length === 0)
|
|
2077
|
+
return false;
|
|
2078
|
+
if (virtualizerRows.length === 0)
|
|
2079
|
+
return true;
|
|
2080
|
+
const scrollTop = this.#scrollOffset(this.#getScrollElement());
|
|
2081
|
+
if (scrollTop <= 0)
|
|
2082
|
+
return false;
|
|
2083
|
+
const firstVirtualizerIndex = virtualizerRows[0]?.index ?? 0;
|
|
2084
|
+
const firstFallbackIndex = fallbackRows[0]?.index ?? 0;
|
|
2085
|
+
return Math.abs(firstVirtualizerIndex - firstFallbackIndex) > 1;
|
|
2086
|
+
}
|
|
2087
|
+
#shouldUseFallbackColumns(virtualizerColumns, fallbackColumns) {
|
|
2088
|
+
if (!virtualizerColumns || fallbackColumns.length === 0)
|
|
2089
|
+
return false;
|
|
2090
|
+
if (virtualizerColumns.length === 0)
|
|
2091
|
+
return true;
|
|
2092
|
+
const scrollLeft = this.#horizontalScrollOffset(this.#getScrollElement());
|
|
2093
|
+
if (scrollLeft <= 0)
|
|
2094
|
+
return false;
|
|
2095
|
+
const firstVirtualizerIndex = virtualizerColumns[0]?.index ?? 0;
|
|
2096
|
+
const firstFallbackIndex = fallbackColumns[0]?.index ?? 0;
|
|
2097
|
+
return Math.abs(firstVirtualizerIndex - firstFallbackIndex) > 1;
|
|
2098
|
+
}
|
|
2099
|
+
#rowHeight() {
|
|
2100
|
+
const rowHeight = this.options.getRowHeight();
|
|
2101
|
+
return Number.isFinite(rowHeight) && rowHeight > 0 ? rowHeight : defaultDataGridVirtualRowHeight;
|
|
2102
|
+
}
|
|
2103
|
+
#viewportHeight() {
|
|
2104
|
+
const element = this.#getScrollElement();
|
|
2105
|
+
if (!element)
|
|
2106
|
+
return this.options.getInitialHeight();
|
|
2107
|
+
const rect = element.getBoundingClientRect();
|
|
2108
|
+
const height = rect.height || element.clientHeight || this.options.getInitialHeight();
|
|
2109
|
+
return Math.max(0, height - this.#scrollPaddingStart()) || this.options.getInitialHeight();
|
|
2110
|
+
}
|
|
2111
|
+
#viewportWidth() {
|
|
2112
|
+
const element = this.#getScrollElement();
|
|
2113
|
+
if (!element)
|
|
2114
|
+
return this.options.getInitialWidth();
|
|
2115
|
+
const rect = element.getBoundingClientRect();
|
|
2116
|
+
const width = rect.width || element.clientWidth || this.options.getInitialWidth();
|
|
2117
|
+
return Math.max(0, width - this.#scrollPaddingInlineStart() - this.#scrollPaddingInlineEnd()) || this.options.getInitialWidth();
|
|
2118
|
+
}
|
|
2119
|
+
#scrollOffset(element) {
|
|
2120
|
+
if (!element)
|
|
2121
|
+
return 0;
|
|
2122
|
+
return Math.max(0, element.scrollTop - this.#scrollPaddingStart());
|
|
2123
|
+
}
|
|
2124
|
+
#horizontalScrollOffset(element) {
|
|
2125
|
+
if (!element)
|
|
2126
|
+
return 0;
|
|
2127
|
+
return Math.max(0, element.scrollLeft);
|
|
2128
|
+
}
|
|
2129
|
+
#scrollPaddingStart() {
|
|
2130
|
+
const value = this.options.getScrollPaddingStart();
|
|
2131
|
+
return Number.isFinite(value) && value > 0 ? value : 0;
|
|
2132
|
+
}
|
|
2133
|
+
#scrollPaddingInlineStart() {
|
|
2134
|
+
const value = this.options.getScrollPaddingInlineStart();
|
|
2135
|
+
return Number.isFinite(value) && value > 0 ? value : 0;
|
|
2136
|
+
}
|
|
2137
|
+
#scrollPaddingInlineEnd() {
|
|
2138
|
+
const value = this.options.getScrollPaddingInlineEnd();
|
|
2139
|
+
return Number.isFinite(value) && value > 0 ? value : 0;
|
|
2140
|
+
}
|
|
2141
|
+
#overscan() {
|
|
2142
|
+
return Math.max(0, this.options.getOverscan());
|
|
2143
|
+
}
|
|
2144
|
+
#columnWidth(index) {
|
|
2145
|
+
const width = this.options.getColumnWidth(index);
|
|
2146
|
+
return Number.isFinite(width) && width > 0 ? width : 1;
|
|
2147
|
+
}
|
|
2148
|
+
#totalColumnWidth() {
|
|
2149
|
+
let totalWidth = 0;
|
|
2150
|
+
for (let index = 0;index < this.options.getColumnCount(); index += 1) {
|
|
2151
|
+
totalWidth += this.#columnWidth(index);
|
|
2152
|
+
}
|
|
2153
|
+
return totalWidth;
|
|
2154
|
+
}
|
|
2155
|
+
#columnStart(targetIndex) {
|
|
2156
|
+
let start = 0;
|
|
2157
|
+
for (let index = 0;index < targetIndex; index += 1) {
|
|
2158
|
+
start += this.#columnWidth(index);
|
|
2159
|
+
}
|
|
2160
|
+
return start;
|
|
2161
|
+
}
|
|
2162
|
+
#columnIndexAtOffset(offset) {
|
|
2163
|
+
let start = 0;
|
|
2164
|
+
for (let index = 0;index < this.options.getColumnCount(); index += 1) {
|
|
2165
|
+
const end = start + this.#columnWidth(index);
|
|
2166
|
+
if (end > offset)
|
|
2167
|
+
return index;
|
|
2168
|
+
start = end;
|
|
2169
|
+
}
|
|
2170
|
+
return Math.max(0, this.options.getColumnCount() - 1);
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
function toDataGridVirtualItem(item) {
|
|
2174
|
+
return {
|
|
2175
|
+
index: item.index,
|
|
2176
|
+
start: item.start,
|
|
2177
|
+
size: item.size,
|
|
2178
|
+
key: typeof item.key === "number" || typeof item.key === "string" ? item.key : String(item.key)
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
// src/components/data-grid/data-grid.svelte
|
|
2183
|
+
var root_7 = $4.from_html(`<span class="cinder-data-grid__sort-priority" aria-hidden="true"> </span>`);
|
|
2184
|
+
var root_2 = $4.from_html(`<button class="cinder-data-grid__sort-button" type="button"><span class="cinder-data-grid__header-content"><!></span> <span class="cinder-data-grid__sort-indicator" aria-hidden="true"><!></span> <!> <span class="cinder-sr-only"> </span></button>`);
|
|
2185
|
+
var root_1 = $4.from_html(`<div class="cinder-data-grid__header-cell" role="columnheader"><!></div>`);
|
|
2186
|
+
var root_11 = $4.from_html(`<div class="cinder-data-grid__cell" role="gridcell" tabindex="-1"><!></div>`);
|
|
2187
|
+
var root_10 = $4.from_html(`<div role="row"></div>`);
|
|
2188
|
+
var root = $4.from_html(`<div><div class="cinder-data-grid__header-row" role="row" aria-rowindex="1"></div> <div class="cinder-data-grid__body" role="rowgroup"></div></div> <div class="cinder-sr-only cinder-data-grid__live-region" role="status" aria-live="polite" aria-atomic="true"> </div>`, 1);
|
|
2189
|
+
function Data_grid($$anchor, $$props) {
|
|
2190
|
+
const gridId = $4.props_id();
|
|
2191
|
+
$4.push($$props, true);
|
|
2192
|
+
const interactiveDescendantSelector = [
|
|
2193
|
+
"a[href]",
|
|
2194
|
+
"button",
|
|
2195
|
+
"input",
|
|
2196
|
+
"select",
|
|
2197
|
+
"textarea",
|
|
2198
|
+
'[contenteditable=""]',
|
|
2199
|
+
'[contenteditable="true"]',
|
|
2200
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
2201
|
+
].join(",");
|
|
2202
|
+
const defaultVirtualRowHeight = 44;
|
|
2203
|
+
let density = $4.prop($$props, "density", 3, "comfortable"), stickyHeader = $4.prop($$props, "stickyHeader", 3, true), virtualizeRows = $4.prop($$props, "virtualizeRows", 3, false), virtualizeColumns = $4.prop($$props, "virtualizeColumns", 3, false), selectionMode = $4.prop($$props, "selectionMode", 3, "none"), selectionModel = $4.prop($$props, "selectionModel", 15, undefined), sortModel = $4.prop($$props, "sortModel", 31, () => $4.proxy([])), rest = $4.rest_props($$props, [
|
|
2204
|
+
"$$slots",
|
|
2205
|
+
"$$events",
|
|
2206
|
+
"$$legacy",
|
|
2207
|
+
"rows",
|
|
2208
|
+
"columns",
|
|
2209
|
+
"getRowId",
|
|
2210
|
+
"density",
|
|
2211
|
+
"stickyHeader",
|
|
2212
|
+
"virtualizeRows",
|
|
2213
|
+
"virtualizeColumns",
|
|
2214
|
+
"rowHeight",
|
|
2215
|
+
"columnOrder",
|
|
2216
|
+
"columnSizing",
|
|
2217
|
+
"columnPinning",
|
|
2218
|
+
"selectionMode",
|
|
2219
|
+
"selectionModel",
|
|
2220
|
+
"onSelectionModelChange",
|
|
2221
|
+
"sortModel",
|
|
2222
|
+
"onSortModelChange",
|
|
2223
|
+
"rowClass",
|
|
2224
|
+
"getRowAriaLabel",
|
|
2225
|
+
"class",
|
|
2226
|
+
"aria-label",
|
|
2227
|
+
"aria-labelledby",
|
|
2228
|
+
"onkeydown"
|
|
2229
|
+
]);
|
|
2230
|
+
const columnModel = new DataGridColumnModel({
|
|
2231
|
+
columns: () => $$props.columns,
|
|
2232
|
+
columnOrder: () => $$props.columnOrder,
|
|
2233
|
+
columnSizing: () => $$props.columnSizing,
|
|
2234
|
+
columnPinning: () => $$props.columnPinning
|
|
2235
|
+
});
|
|
2236
|
+
let liveRegionMessage = $4.state("");
|
|
2237
|
+
let renderedLiveRegionMessage = $4.state("");
|
|
2238
|
+
let liveRegionAnnouncementSequence = $4.state(0);
|
|
2239
|
+
let measuredGridWidth = $4.state(undefined);
|
|
2240
|
+
let isRightToLeft = $4.state(false);
|
|
2241
|
+
const activeSortModel = $4.derived(() => getActiveDataGridSortModel(columnModel.orderedColumns, sortModel()));
|
|
2242
|
+
const sortedRowIndices = $4.derived(() => getSortedDataGridRowIndices($$props.rows, columnModel.orderedColumns, $4.get(activeSortModel)));
|
|
2243
|
+
const keyedRows = $4.derived(() => {
|
|
2244
|
+
const records = $$props.rows.map((row, rowIndex) => ({ row, rowId: $$props.getRowId(row), rowIndex }));
|
|
2245
|
+
const rowIdCounts = new Map;
|
|
2246
|
+
for (const { rowId } of records) {
|
|
2247
|
+
rowIdCounts.set(rowId, (rowIdCounts.get(rowId) ?? 0) + 1);
|
|
2248
|
+
}
|
|
2249
|
+
const rowIdOccurrences = new Map;
|
|
2250
|
+
return records.map((record) => {
|
|
2251
|
+
const occurrence = rowIdOccurrences.get(record.rowId) ?? 0;
|
|
2252
|
+
rowIdOccurrences.set(record.rowId, occurrence + 1);
|
|
2253
|
+
const hasDuplicateRowId = (rowIdCounts.get(record.rowId) ?? 0) > 1;
|
|
2254
|
+
const uniqueRowId = hasDuplicateRowId ? `${record.rowId}\x00${occurrence}` : record.rowId;
|
|
2255
|
+
return { ...record, rowDomId: uniqueRowId, rowKey: uniqueRowId };
|
|
2256
|
+
});
|
|
2257
|
+
});
|
|
2258
|
+
const sortedKeyedRows = $4.derived(() => $4.get(sortedRowIndices).flatMap((rowIndex) => $4.get(keyedRows)[rowIndex] ?? []));
|
|
2259
|
+
const resolvedRowHeight = $4.derived(() => resolveVirtualRowHeight($$props.rowHeight));
|
|
2260
|
+
const shouldWarnVirtualRowHeightFallback = $4.derived(() => virtualizeRows() && !isValidVirtualRowHeight($$props.rowHeight));
|
|
2261
|
+
const shouldVirtualizeRows = $4.derived(() => virtualizeRows() && $4.get(sortedKeyedRows).length > 0);
|
|
2262
|
+
const shouldVirtualizeColumns = $4.derived(() => virtualizeColumns() && columnModel.unpinnedColumns.length > 0 && $4.get(measuredGridWidth) !== undefined && $4.get(measuredGridWidth) > 0 && !$4.get(isRightToLeft) && typeof window !== "undefined");
|
|
2263
|
+
const rowVirtualizer = new DataGridVirtualizationAdapter({
|
|
2264
|
+
getScrollElement: () => gridElement ?? null,
|
|
2265
|
+
getRowCount: () => $4.get(sortedKeyedRows).length,
|
|
2266
|
+
getRowKey: (index) => $4.get(sortedKeyedRows)[index]?.rowKey ?? index,
|
|
2267
|
+
getRowHeight: () => $4.get(resolvedRowHeight),
|
|
2268
|
+
getColumnCount: () => columnModel.unpinnedColumns.length,
|
|
2269
|
+
getColumnKey: (index) => columnModel.unpinnedColumns[index]?.key ?? index,
|
|
2270
|
+
getColumnWidth: (index) => columnModel.unpinnedColumns[index]?.width ?? 150,
|
|
2271
|
+
getOverscan: () => 5,
|
|
2272
|
+
getInitialHeight: () => $4.get(resolvedRowHeight) * 10,
|
|
2273
|
+
getInitialWidth: () => $4.get(measuredGridWidth) ?? 1000,
|
|
2274
|
+
getScrollPaddingStart: () => getHeaderHeight(),
|
|
2275
|
+
getScrollPaddingInlineStart: () => columnModel.leftPinnedWidth,
|
|
2276
|
+
getScrollPaddingInlineEnd: () => columnModel.rightPinnedWidth
|
|
2277
|
+
});
|
|
2278
|
+
const observeHeaderSize = (node) => {
|
|
2279
|
+
if (typeof ResizeObserver === "undefined")
|
|
2280
|
+
return;
|
|
2281
|
+
let previousHeight = getElementHeight(node);
|
|
2282
|
+
const observer = new ResizeObserver(() => {
|
|
2283
|
+
const nextHeight = getElementHeight(node);
|
|
2284
|
+
if (nextHeight === previousHeight)
|
|
2285
|
+
return;
|
|
2286
|
+
previousHeight = nextHeight;
|
|
2287
|
+
rowVirtualizer.refreshMeasurements();
|
|
2288
|
+
});
|
|
2289
|
+
observer.observe(node);
|
|
2290
|
+
return () => observer.disconnect();
|
|
2291
|
+
};
|
|
2292
|
+
const observeGridSize = (node) => {
|
|
2293
|
+
const updateGridMeasurement = () => {
|
|
2294
|
+
const rect = node.getBoundingClientRect();
|
|
2295
|
+
$4.set(measuredGridWidth, rect.width || node.clientWidth || undefined, true);
|
|
2296
|
+
$4.set(isRightToLeft, getComputedStyle(node).direction === "rtl");
|
|
2297
|
+
};
|
|
2298
|
+
updateGridMeasurement();
|
|
2299
|
+
if (typeof ResizeObserver === "undefined")
|
|
2300
|
+
return;
|
|
2301
|
+
const observer = new ResizeObserver(updateGridMeasurement);
|
|
2302
|
+
observer.observe(node);
|
|
2303
|
+
return () => observer.disconnect();
|
|
2304
|
+
};
|
|
2305
|
+
const delegateBodyEvents = (node) => {
|
|
2306
|
+
node.addEventListener("click", handleBodyClick);
|
|
2307
|
+
node.addEventListener("keydown", handleBodyKeydown);
|
|
2308
|
+
return () => {
|
|
2309
|
+
node.removeEventListener("click", handleBodyClick);
|
|
2310
|
+
node.removeEventListener("keydown", handleBodyKeydown);
|
|
2311
|
+
};
|
|
2312
|
+
};
|
|
2313
|
+
const virtualRows = $4.derived(() => rowVirtualizer.virtualRows);
|
|
2314
|
+
const virtualColumns = $4.derived(() => rowVirtualizer.virtualColumns);
|
|
2315
|
+
const virtualColumnLeadingSpacer = $4.derived(() => $4.get(virtualColumns)[0]?.start ?? 0);
|
|
2316
|
+
const virtualColumnTrailingSpacer = $4.derived(() => {
|
|
2317
|
+
const lastColumn = $4.get(virtualColumns).at(-1);
|
|
2318
|
+
if (!lastColumn)
|
|
2319
|
+
return 0;
|
|
2320
|
+
return Math.max(0, rowVirtualizer.totalWidth - (lastColumn.start + lastColumn.size));
|
|
2321
|
+
});
|
|
2322
|
+
const gridContentWidth = $4.derived(() => $4.get(shouldVirtualizeColumns) ? columnModel.leftPinnedWidth + rowVirtualizer.totalWidth + columnModel.rightPinnedWidth : undefined);
|
|
2323
|
+
const gridTemplateColumns = $4.derived(() => {
|
|
2324
|
+
if (!$4.get(shouldVirtualizeColumns)) {
|
|
2325
|
+
return columnModel.renderColumns.map((column) => `${column.width}px`).join(" ");
|
|
2326
|
+
}
|
|
2327
|
+
return [
|
|
2328
|
+
...columnModel.leftPinnedColumns.map((column) => `${column.width}px`),
|
|
2329
|
+
`${$4.get(virtualColumnLeadingSpacer)}px`,
|
|
2330
|
+
...$4.get(virtualColumns).map((item) => `${item.size}px`),
|
|
2331
|
+
`${$4.get(virtualColumnTrailingSpacer)}px`,
|
|
2332
|
+
...columnModel.rightPinnedColumns.map((column) => `${column.width}px`)
|
|
2333
|
+
].join(" ");
|
|
2334
|
+
});
|
|
2335
|
+
const renderedColumns = $4.derived(() => {
|
|
2336
|
+
if (!$4.get(shouldVirtualizeColumns))
|
|
2337
|
+
return columnModel.renderColumns;
|
|
2338
|
+
const virtualUnpinnedColumns = $4.get(virtualColumns).flatMap((item) => {
|
|
2339
|
+
const column = columnModel.unpinnedColumns[item.index];
|
|
2340
|
+
return column ? [column] : [];
|
|
2341
|
+
});
|
|
2342
|
+
return [
|
|
2343
|
+
...columnModel.leftPinnedColumns,
|
|
2344
|
+
...virtualUnpinnedColumns,
|
|
2345
|
+
...columnModel.rightPinnedColumns
|
|
2346
|
+
];
|
|
2347
|
+
});
|
|
2348
|
+
const renderedRows = $4.derived(() => {
|
|
2349
|
+
if (!$4.get(shouldVirtualizeRows)) {
|
|
2350
|
+
return $4.get(sortedKeyedRows).map((keyedRow, visualRowIndex) => ({
|
|
2351
|
+
keyedRow,
|
|
2352
|
+
visualRowIndex,
|
|
2353
|
+
start: 0,
|
|
2354
|
+
size: $4.get(resolvedRowHeight),
|
|
2355
|
+
virtualized: false
|
|
2356
|
+
}));
|
|
2357
|
+
}
|
|
2358
|
+
return $4.get(virtualRows).flatMap((item) => {
|
|
2359
|
+
const keyedRow = $4.get(sortedKeyedRows)[item.index];
|
|
2360
|
+
return keyedRow ? [
|
|
2361
|
+
{
|
|
2362
|
+
keyedRow,
|
|
2363
|
+
visualRowIndex: item.index,
|
|
2364
|
+
start: item.start,
|
|
2365
|
+
size: item.size,
|
|
2366
|
+
virtualized: true
|
|
2367
|
+
}
|
|
2368
|
+
] : [];
|
|
2369
|
+
});
|
|
2370
|
+
});
|
|
2371
|
+
const bodyHeight = $4.derived(() => $4.get(shouldVirtualizeRows) ? `${rowVirtualizer.totalHeight}px` : undefined);
|
|
2372
|
+
const duplicateRowIds = $4.derived(() => {
|
|
2373
|
+
const seen = new Set;
|
|
2374
|
+
const duplicates = new Set;
|
|
2375
|
+
for (const { rowId } of $4.get(keyedRows)) {
|
|
2376
|
+
if (seen.has(rowId))
|
|
2377
|
+
duplicates.add(rowId);
|
|
2378
|
+
else
|
|
2379
|
+
seen.add(rowId);
|
|
2380
|
+
}
|
|
2381
|
+
return [...duplicates];
|
|
2382
|
+
});
|
|
2383
|
+
const firstRowDomId = $4.derived(() => $4.get(sortedKeyedRows)[0]?.rowDomId);
|
|
2384
|
+
const firstColumnKey = $4.derived(() => columnModel.renderColumns[0]?.key);
|
|
2385
|
+
const rowDomIds = $4.derived(() => $4.get(sortedKeyedRows).map((row) => row.rowDomId));
|
|
2386
|
+
const columnKeys = $4.derived(() => columnModel.renderColumns.map((column) => column.key));
|
|
2387
|
+
let requestedActiveRowIndex = $4.state(0);
|
|
2388
|
+
let requestedActiveColumnKey = $4.state(undefined);
|
|
2389
|
+
const selectionState = new DataGridSelectionModel({
|
|
2390
|
+
rowIds: () => $4.get(rowDomIds),
|
|
2391
|
+
columnKeys: () => $4.get(columnKeys)
|
|
2392
|
+
});
|
|
2393
|
+
const activeRowIndex = $4.derived(() => $4.get(sortedKeyedRows).length > 0 ? Math.min($4.get(requestedActiveRowIndex), $4.get(sortedKeyedRows).length - 1) : 0);
|
|
2394
|
+
const activeColumnIndex = $4.derived(() => {
|
|
2395
|
+
const index = columnModel.renderColumns.findIndex((column) => column.key === $4.get(requestedActiveColumnKey));
|
|
2396
|
+
return index >= 0 ? index : 0;
|
|
2397
|
+
});
|
|
2398
|
+
const activeRowDomId = $4.derived(() => $4.get(sortedKeyedRows).length > 0 ? $4.get(sortedKeyedRows)[Math.min($4.get(activeRowIndex), $4.get(sortedKeyedRows).length - 1)]?.rowDomId : $4.get(firstRowDomId));
|
|
2399
|
+
const activeColumnKey = $4.derived(() => columnModel.renderColumns[$4.get(activeColumnIndex)]?.key);
|
|
2400
|
+
const canExposeActiveCell = $4.derived(() => !($4.get(shouldVirtualizeRows) && typeof window === "undefined"));
|
|
2401
|
+
const activeCellId = $4.derived(() => $4.get(canExposeActiveCell) && $4.get(activeRowDomId) !== undefined && $4.get(firstColumnKey) !== undefined ? getCellId($4.get(activeRowDomId), $4.get(activeColumnKey) ?? $4.get(firstColumnKey)) : undefined);
|
|
2402
|
+
const activeCellCoordinates = $4.derived(() => $4.get(activeRowDomId) !== undefined && $4.get(activeColumnKey) !== undefined ? {
|
|
2403
|
+
rowId: $4.get(activeRowDomId),
|
|
2404
|
+
columnKey: $4.get(activeColumnKey)
|
|
2405
|
+
} : undefined);
|
|
2406
|
+
const resolvedSelectionModel = $4.derived(() => selectionModel() ?? []);
|
|
2407
|
+
const selectedRowIds = $4.derived(() => selectionMode() === "none" ? new Set : new Set($4.get(resolvedSelectionModel)));
|
|
2408
|
+
const resolvedAriaLabel = $4.derived(() => typeof $$props["aria-label"] === "string" && $$props["aria-label"].trim().length > 0 ? $$props["aria-label"] : undefined);
|
|
2409
|
+
const resolvedAriaLabelledBy = $4.derived(() => typeof $$props["aria-labelledby"] === "string" && $$props["aria-labelledby"].trim().length > 0 ? $$props["aria-labelledby"] : undefined);
|
|
2410
|
+
let hasWarnedNoLabel = false;
|
|
2411
|
+
let warnedDuplicateRowIdsSignature;
|
|
2412
|
+
let previousActiveCellId;
|
|
2413
|
+
let previousActiveVirtualRowIndex;
|
|
2414
|
+
let previousActiveVirtualColumnIndex;
|
|
2415
|
+
let previousSelectionRowIds;
|
|
2416
|
+
let previousSelectionColumnKeys;
|
|
2417
|
+
let gridElement;
|
|
2418
|
+
let headerElement;
|
|
2419
|
+
let liveRegionTimeoutId;
|
|
2420
|
+
let liveRegionVersion = 0;
|
|
2421
|
+
let warnedVirtualRowHeightFallback = false;
|
|
2422
|
+
$4.user_effect(() => {
|
|
2423
|
+
if (!$4.get(resolvedAriaLabel) && !$4.get(resolvedAriaLabelledBy) && !hasWarnedNoLabel) {
|
|
2424
|
+
hasWarnedNoLabel = true;
|
|
2425
|
+
devWarn("[cinder-data-grid] DataGrid requires either aria-label or aria-labelledby.");
|
|
2426
|
+
}
|
|
2427
|
+
});
|
|
2428
|
+
$4.user_effect(() => {
|
|
2429
|
+
if ($4.get(duplicateRowIds).length === 0) {
|
|
2430
|
+
warnedDuplicateRowIdsSignature = undefined;
|
|
2431
|
+
return;
|
|
2432
|
+
}
|
|
2433
|
+
const signature = JSON.stringify($4.get(duplicateRowIds));
|
|
2434
|
+
if (signature === warnedDuplicateRowIdsSignature)
|
|
2435
|
+
return;
|
|
2436
|
+
warnedDuplicateRowIdsSignature = signature;
|
|
2437
|
+
devWarn(`[cinder-data-grid] getRowId returned duplicate row ids: ${$4.get(duplicateRowIds).map((rowId) => JSON.stringify(rowId)).join(", ")}. Row ids must be unique.`);
|
|
2438
|
+
});
|
|
2439
|
+
$4.user_effect(() => {
|
|
2440
|
+
if (!$4.get(shouldWarnVirtualRowHeightFallback) || warnedVirtualRowHeightFallback)
|
|
2441
|
+
return;
|
|
2442
|
+
warnedVirtualRowHeightFallback = true;
|
|
2443
|
+
devWarn("[cinder-data-grid] DataGrid row virtualization is using the default rowHeight of 44px. Pass a positive finite rowHeight to match your row layout.");
|
|
2444
|
+
});
|
|
2445
|
+
$4.user_effect(() => {
|
|
2446
|
+
const nextMessage = $4.get(liveRegionMessage);
|
|
2447
|
+
$4.get(liveRegionAnnouncementSequence);
|
|
2448
|
+
const currentVersion = ++liveRegionVersion;
|
|
2449
|
+
if (liveRegionTimeoutId) {
|
|
2450
|
+
clearTimeout(liveRegionTimeoutId);
|
|
2451
|
+
liveRegionTimeoutId = undefined;
|
|
2452
|
+
}
|
|
2453
|
+
$4.set(renderedLiveRegionMessage, "");
|
|
2454
|
+
if (nextMessage === "")
|
|
2455
|
+
return;
|
|
2456
|
+
liveRegionTimeoutId = setTimeout(() => {
|
|
2457
|
+
if (liveRegionVersion !== currentVersion)
|
|
2458
|
+
return;
|
|
2459
|
+
$4.set(renderedLiveRegionMessage, nextMessage, true);
|
|
2460
|
+
liveRegionTimeoutId = undefined;
|
|
2461
|
+
}, 0);
|
|
2462
|
+
return () => {
|
|
2463
|
+
if (!liveRegionTimeoutId)
|
|
2464
|
+
return;
|
|
2465
|
+
clearTimeout(liveRegionTimeoutId);
|
|
2466
|
+
liveRegionTimeoutId = undefined;
|
|
2467
|
+
};
|
|
2468
|
+
});
|
|
2469
|
+
$4.user_effect(() => {
|
|
2470
|
+
const cellId = $4.get(activeCellId);
|
|
2471
|
+
const activeVirtualRowIndex = $4.get(shouldVirtualizeRows) ? $4.get(activeRowIndex) : undefined;
|
|
2472
|
+
const activeVirtualColumnIndex = $4.get(shouldVirtualizeColumns) ? getUnpinnedColumnIndex($4.get(activeColumnKey)) : undefined;
|
|
2473
|
+
if (cellId === undefined || cellId === previousActiveCellId && activeVirtualRowIndex === previousActiveVirtualRowIndex && activeVirtualColumnIndex === previousActiveVirtualColumnIndex) {
|
|
2474
|
+
previousActiveCellId = cellId;
|
|
2475
|
+
previousActiveVirtualRowIndex = activeVirtualRowIndex;
|
|
2476
|
+
previousActiveVirtualColumnIndex = activeVirtualColumnIndex;
|
|
2477
|
+
return;
|
|
2478
|
+
}
|
|
2479
|
+
if (previousActiveCellId === undefined && previousActiveVirtualRowIndex === undefined && previousActiveVirtualColumnIndex === undefined) {
|
|
2480
|
+
previousActiveCellId = cellId;
|
|
2481
|
+
previousActiveVirtualRowIndex = activeVirtualRowIndex;
|
|
2482
|
+
previousActiveVirtualColumnIndex = activeVirtualColumnIndex;
|
|
2483
|
+
return;
|
|
2484
|
+
}
|
|
2485
|
+
previousActiveCellId = cellId;
|
|
2486
|
+
previousActiveVirtualRowIndex = activeVirtualRowIndex;
|
|
2487
|
+
previousActiveVirtualColumnIndex = activeVirtualColumnIndex;
|
|
2488
|
+
if ($4.get(shouldVirtualizeRows)) {
|
|
2489
|
+
rowVirtualizer.scrollToRow($4.get(activeRowIndex));
|
|
2490
|
+
}
|
|
2491
|
+
if ($4.get(shouldVirtualizeColumns) && activeVirtualColumnIndex !== undefined) {
|
|
2492
|
+
rowVirtualizer.scrollToColumn(activeVirtualColumnIndex);
|
|
2493
|
+
}
|
|
2494
|
+
scrollActiveCellIntoView(cellId);
|
|
2495
|
+
});
|
|
2496
|
+
$4.user_effect(() => {
|
|
2497
|
+
const previousRowIds = previousSelectionRowIds;
|
|
2498
|
+
const previousColumnKeys = previousSelectionColumnKeys;
|
|
2499
|
+
const isInitialSelectionReconciliation = previousRowIds === undefined || previousColumnKeys === undefined;
|
|
2500
|
+
const didSelectionGeometryChange = !isInitialSelectionReconciliation && (didStringArrayChange(previousRowIds, $4.get(rowDomIds)) || didStringArrayChange(previousColumnKeys, $4.get(columnKeys)));
|
|
2501
|
+
previousSelectionRowIds = $4.get(rowDomIds);
|
|
2502
|
+
previousSelectionColumnKeys = $4.get(columnKeys);
|
|
2503
|
+
if (!isInitialSelectionReconciliation && !didSelectionGeometryChange)
|
|
2504
|
+
return;
|
|
2505
|
+
selectionState.reconcile($4.get(activeCellCoordinates));
|
|
2506
|
+
if (!didSelectionGeometryChange)
|
|
2507
|
+
return;
|
|
2508
|
+
syncRequestedActiveCell();
|
|
2509
|
+
});
|
|
2510
|
+
function syncRequestedActiveCell() {
|
|
2511
|
+
const activeCell = selectionState.activeCell;
|
|
2512
|
+
if (!activeCell)
|
|
2513
|
+
return;
|
|
2514
|
+
const nextActiveRowIndex = $4.get(rowDomIds).indexOf(activeCell.rowId);
|
|
2515
|
+
if (nextActiveRowIndex >= 0 && $4.get(requestedActiveRowIndex) !== nextActiveRowIndex) {
|
|
2516
|
+
$4.set(requestedActiveRowIndex, nextActiveRowIndex, true);
|
|
2517
|
+
}
|
|
2518
|
+
if ($4.get(requestedActiveColumnKey) !== activeCell.columnKey) {
|
|
2519
|
+
$4.set(requestedActiveColumnKey, activeCell.columnKey, true);
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
function didStringArrayChange(previousValues, nextValues) {
|
|
2523
|
+
if (previousValues.length !== nextValues.length)
|
|
2524
|
+
return true;
|
|
2525
|
+
return previousValues.some((value, index) => value !== nextValues[index]);
|
|
2526
|
+
}
|
|
2527
|
+
function getCellId(rowId, columnKey) {
|
|
2528
|
+
return `${gridId}-cell-r-${toDomIdSegment(rowId)}-c-${toDomIdSegment(columnKey)}`;
|
|
2529
|
+
}
|
|
2530
|
+
function toDomIdSegment(value) {
|
|
2531
|
+
const segment = Array.from(value, (character) => character.codePointAt(0)?.toString(16) ?? "0");
|
|
2532
|
+
return segment.length > 0 ? segment.join("_") : "empty";
|
|
2533
|
+
}
|
|
2534
|
+
function isValidVirtualRowHeight(value) {
|
|
2535
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0;
|
|
2536
|
+
}
|
|
2537
|
+
function resolveVirtualRowHeight(value) {
|
|
2538
|
+
return isValidVirtualRowHeight(value) ? value : defaultVirtualRowHeight;
|
|
2539
|
+
}
|
|
2540
|
+
function formatDataGridValue(value) {
|
|
2541
|
+
if (value === null || value === undefined)
|
|
2542
|
+
return "";
|
|
2543
|
+
if (value instanceof Date)
|
|
2544
|
+
return value.toISOString();
|
|
2545
|
+
return String(value);
|
|
2546
|
+
}
|
|
2547
|
+
function getRowClass(row, rowIndex) {
|
|
2548
|
+
if (typeof $$props.rowClass === "function")
|
|
2549
|
+
return $$props.rowClass(row, rowIndex);
|
|
2550
|
+
return $$props.rowClass;
|
|
2551
|
+
}
|
|
2552
|
+
function getResolvedRowAriaLabel(row, rowIndex) {
|
|
2553
|
+
const label = $$props.getRowAriaLabel?.(row, rowIndex);
|
|
2554
|
+
return typeof label === "string" && label.trim().length > 0 ? label : undefined;
|
|
2555
|
+
}
|
|
2556
|
+
function getCellStyle(column) {
|
|
2557
|
+
const customProperties = [
|
|
2558
|
+
`--_cinder-data-grid-column-width: ${column.width}px`,
|
|
2559
|
+
`grid-column: ${getCellGridColumn(column)}`
|
|
2560
|
+
];
|
|
2561
|
+
if (column.pin === "left") {
|
|
2562
|
+
customProperties.push(`--_cinder-data-grid-pin-left-offset: ${column.pinOffset}px`);
|
|
2563
|
+
}
|
|
2564
|
+
if (column.pin === "right") {
|
|
2565
|
+
customProperties.push(`--_cinder-data-grid-pin-right-offset: ${column.pinOffset}px`);
|
|
2566
|
+
}
|
|
2567
|
+
return customProperties.join("; ");
|
|
2568
|
+
}
|
|
2569
|
+
function getRowStyle(row) {
|
|
2570
|
+
if (!row.virtualized)
|
|
2571
|
+
return;
|
|
2572
|
+
return [
|
|
2573
|
+
`--_cinder-data-grid-row-translate-y: ${row.start}px`,
|
|
2574
|
+
`--_cinder-data-grid-row-height: ${row.size}px`
|
|
2575
|
+
].join("; ");
|
|
2576
|
+
}
|
|
2577
|
+
function getHeaderHeight() {
|
|
2578
|
+
return headerElement ? getElementHeight(headerElement) : 0;
|
|
2579
|
+
}
|
|
2580
|
+
function getElementHeight(element) {
|
|
2581
|
+
const offsetHeight = element.offsetHeight;
|
|
2582
|
+
if (offsetHeight > 0)
|
|
2583
|
+
return offsetHeight;
|
|
2584
|
+
return element.getBoundingClientRect().height || 0;
|
|
2585
|
+
}
|
|
2586
|
+
function getColumnSortModelItem(columnKey) {
|
|
2587
|
+
return $4.get(activeSortModel).find((item) => item.key === columnKey);
|
|
2588
|
+
}
|
|
2589
|
+
function getColumnSortPriority(columnKey) {
|
|
2590
|
+
const index = $4.get(activeSortModel).findIndex((item) => item.key === columnKey);
|
|
2591
|
+
return index >= 0 && $4.get(activeSortModel).length > 1 ? index + 1 : undefined;
|
|
2592
|
+
}
|
|
2593
|
+
function getHeaderAriaSort(column, sortItem) {
|
|
2594
|
+
return $4.get(activeSortModel)[0]?.key === column.key ? sortItem?.direction : undefined;
|
|
2595
|
+
}
|
|
2596
|
+
function getSortStateDescription(sortItem, sortPriority) {
|
|
2597
|
+
if (!sortItem)
|
|
2598
|
+
return "not sorted";
|
|
2599
|
+
if (sortPriority === undefined)
|
|
2600
|
+
return `sorted ${sortItem.direction}`;
|
|
2601
|
+
return `sorted ${sortItem.direction}, priority ${sortPriority}`;
|
|
2602
|
+
}
|
|
2603
|
+
function handleColumnHeaderClick(column, event) {
|
|
2604
|
+
if (!column.sortable)
|
|
2605
|
+
return;
|
|
2606
|
+
const nextSortModel = getNextDataGridSortModel($4.get(activeSortModel), column.key, event.shiftKey);
|
|
2607
|
+
sortModel(nextSortModel);
|
|
2608
|
+
$$props.onSortModelChange?.(nextSortModel);
|
|
2609
|
+
}
|
|
2610
|
+
function getCellCoordinate(rowIndex, columnIndex) {
|
|
2611
|
+
const rowId = $4.get(rowDomIds)[Math.min(Math.max(rowIndex, 0), $4.get(rowDomIds).length - 1)];
|
|
2612
|
+
const columnKey = $4.get(columnKeys)[Math.min(Math.max(columnIndex, 0), $4.get(columnKeys).length - 1)];
|
|
2613
|
+
if (rowId === undefined || columnKey === undefined)
|
|
2614
|
+
return;
|
|
2615
|
+
return { rowId, columnKey };
|
|
2616
|
+
}
|
|
2617
|
+
function getUnpinnedColumnIndex(columnKey) {
|
|
2618
|
+
if (columnKey === undefined)
|
|
2619
|
+
return;
|
|
2620
|
+
const index = columnModel.unpinnedColumns.findIndex((column) => column.key === columnKey);
|
|
2621
|
+
return index >= 0 ? index : undefined;
|
|
2622
|
+
}
|
|
2623
|
+
function getCellGridColumn(column) {
|
|
2624
|
+
if (!$4.get(shouldVirtualizeColumns))
|
|
2625
|
+
return column.renderIndex;
|
|
2626
|
+
const leftPinnedCount = columnModel.leftPinnedColumns.length;
|
|
2627
|
+
if (column.pin === "left") {
|
|
2628
|
+
const leftPinnedIndex = columnModel.leftPinnedColumns.findIndex((item) => item.key === column.key);
|
|
2629
|
+
return Math.max(0, leftPinnedIndex) + 1;
|
|
2630
|
+
}
|
|
2631
|
+
const visibleUnpinnedIndex = $4.get(virtualColumns).findIndex((item) => item.key === column.key);
|
|
2632
|
+
if (visibleUnpinnedIndex >= 0)
|
|
2633
|
+
return leftPinnedCount + 2 + visibleUnpinnedIndex;
|
|
2634
|
+
const rightPinnedIndex = columnModel.rightPinnedColumns.findIndex((item) => item.key === column.key);
|
|
2635
|
+
return leftPinnedCount + 2 + $4.get(virtualColumns).length + 1 + Math.max(0, rightPinnedIndex);
|
|
2636
|
+
}
|
|
2637
|
+
async function scrollActiveCellIntoView(cellId) {
|
|
2638
|
+
await tick();
|
|
2639
|
+
document.getElementById(cellId)?.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
2640
|
+
}
|
|
2641
|
+
function moveActiveCell(rowIndex, columnIndex, extend = false) {
|
|
2642
|
+
if ($4.get(sortedKeyedRows).length === 0 || columnModel.renderColumns.length === 0)
|
|
2643
|
+
return;
|
|
2644
|
+
$4.set(requestedActiveRowIndex, Math.min(Math.max(rowIndex, 0), $4.get(sortedKeyedRows).length - 1), true);
|
|
2645
|
+
$4.set(requestedActiveColumnKey, columnModel.renderColumns[Math.min(Math.max(columnIndex, 0), columnModel.renderColumns.length - 1)]?.key, true);
|
|
2646
|
+
const cell = getCellCoordinate(rowIndex, columnIndex);
|
|
2647
|
+
if (cell)
|
|
2648
|
+
selectionState.setActiveCell(cell, { extend });
|
|
2649
|
+
}
|
|
2650
|
+
function setSelectionModel(nextSelectionModel) {
|
|
2651
|
+
selectionModel(nextSelectionModel);
|
|
2652
|
+
$$props.onSelectionModelChange?.(nextSelectionModel);
|
|
2653
|
+
}
|
|
2654
|
+
function updateRowSelection(rowId, event) {
|
|
2655
|
+
if (selectionMode() === "none")
|
|
2656
|
+
return;
|
|
2657
|
+
if (selectionMode() === "single") {
|
|
2658
|
+
setSelectionModel([rowId]);
|
|
2659
|
+
return;
|
|
2660
|
+
}
|
|
2661
|
+
const isToggle = event.ctrlKey || event.metaKey;
|
|
2662
|
+
if (event.shiftKey)
|
|
2663
|
+
return;
|
|
2664
|
+
if (!isToggle) {
|
|
2665
|
+
setSelectionModel([rowId]);
|
|
2666
|
+
return;
|
|
2667
|
+
}
|
|
2668
|
+
const nextSelection = new Set($4.get(resolvedSelectionModel));
|
|
2669
|
+
if (nextSelection.has(rowId))
|
|
2670
|
+
nextSelection.delete(rowId);
|
|
2671
|
+
else
|
|
2672
|
+
nextSelection.add(rowId);
|
|
2673
|
+
setSelectionModel([...nextSelection]);
|
|
2674
|
+
}
|
|
2675
|
+
function selectActiveCell(event) {
|
|
2676
|
+
const row = $4.get(sortedKeyedRows)[$4.get(activeRowIndex)];
|
|
2677
|
+
if (!row || $4.get(activeColumnKey) === undefined || $4.get(activeRowDomId) === undefined)
|
|
2678
|
+
return;
|
|
2679
|
+
selectionState.setActiveCell({
|
|
2680
|
+
rowId: $4.get(activeRowDomId),
|
|
2681
|
+
columnKey: $4.get(activeColumnKey)
|
|
2682
|
+
}, {
|
|
2683
|
+
extend: event.shiftKey,
|
|
2684
|
+
toggle: event.ctrlKey || event.metaKey
|
|
2685
|
+
});
|
|
2686
|
+
updateRowSelection(row.rowId, event);
|
|
2687
|
+
}
|
|
2688
|
+
function collapseSelectionToActiveCell() {
|
|
2689
|
+
selectionState.collapseToActiveCell();
|
|
2690
|
+
if (selectionMode() === "none")
|
|
2691
|
+
return;
|
|
2692
|
+
const row = $4.get(sortedKeyedRows)[$4.get(activeRowIndex)];
|
|
2693
|
+
setSelectionModel(row ? [row.rowId] : []);
|
|
2694
|
+
}
|
|
2695
|
+
async function copySelectedCells() {
|
|
2696
|
+
const cells = selectionState.selectedCellCoordinates.length > 0 ? sortCellsByGridOrder(selectionState.selectedCellCoordinates) : $4.get(activeCellCoordinates) ? [$4.get(activeCellCoordinates)] : [];
|
|
2697
|
+
if (cells.length === 0)
|
|
2698
|
+
return;
|
|
2699
|
+
const rowsByDomId = new Map($4.get(keyedRows).map((row) => [row.rowDomId, row.row]));
|
|
2700
|
+
const columnsByKey = new Map(columnModel.renderColumns.map((column) => [column.key, column]));
|
|
2701
|
+
const cellsByRow = new Map;
|
|
2702
|
+
for (const cell of cells) {
|
|
2703
|
+
const rowCells = cellsByRow.get(cell.rowId);
|
|
2704
|
+
if (rowCells)
|
|
2705
|
+
rowCells.push(cell);
|
|
2706
|
+
else
|
|
2707
|
+
cellsByRow.set(cell.rowId, [cell]);
|
|
2708
|
+
}
|
|
2709
|
+
const text2 = [...cellsByRow.entries()].map(([rowId, rowCells]) => {
|
|
2710
|
+
const row = rowsByDomId.get(rowId);
|
|
2711
|
+
if (!row)
|
|
2712
|
+
return "";
|
|
2713
|
+
return rowCells.map((cell) => {
|
|
2714
|
+
const column = columnsByKey.get(cell.columnKey);
|
|
2715
|
+
if (!column)
|
|
2716
|
+
return "";
|
|
2717
|
+
return formatDataGridValue(getDataGridColumnValue(row, column));
|
|
2718
|
+
}).join("\t");
|
|
2719
|
+
}).join(`
|
|
2720
|
+
`);
|
|
2721
|
+
const copied = await copyToClipboard(text2);
|
|
2722
|
+
if (copied) {
|
|
2723
|
+
announceCopiedCells(`Copied ${cells.length} ${cells.length === 1 ? "cell" : "cells"}`);
|
|
2724
|
+
return;
|
|
2725
|
+
}
|
|
2726
|
+
announceCopiedCells("Copy failed");
|
|
2727
|
+
}
|
|
2728
|
+
function announceCopiedCells(message) {
|
|
2729
|
+
$4.set(liveRegionMessage, message, true);
|
|
2730
|
+
$4.set(liveRegionAnnouncementSequence, $4.get(liveRegionAnnouncementSequence) + 1);
|
|
2731
|
+
}
|
|
2732
|
+
function sortCellsByGridOrder(cells) {
|
|
2733
|
+
const rowIndexes = new Map($4.get(rowDomIds).map((rowId, index) => [rowId, index]));
|
|
2734
|
+
const columnIndexes = new Map($4.get(columnKeys).map((columnKey, index) => [columnKey, index]));
|
|
2735
|
+
return [...cells].sort((left, right) => {
|
|
2736
|
+
const leftRowIndex = rowIndexes.get(left.rowId) ?? Number.POSITIVE_INFINITY;
|
|
2737
|
+
const rightRowIndex = rowIndexes.get(right.rowId) ?? Number.POSITIVE_INFINITY;
|
|
2738
|
+
if (leftRowIndex !== rightRowIndex)
|
|
2739
|
+
return leftRowIndex - rightRowIndex;
|
|
2740
|
+
const leftColumnIndex = columnIndexes.get(left.columnKey) ?? Number.POSITIVE_INFINITY;
|
|
2741
|
+
const rightColumnIndex = columnIndexes.get(right.columnKey) ?? Number.POSITIVE_INFINITY;
|
|
2742
|
+
return leftColumnIndex - rightColumnIndex;
|
|
2743
|
+
});
|
|
2744
|
+
}
|
|
2745
|
+
function handleCellClick(event, rowId, rowDomId, columnKey, rowIndex) {
|
|
2746
|
+
$4.set(requestedActiveRowIndex, rowIndex, true);
|
|
2747
|
+
$4.set(requestedActiveColumnKey, columnKey, true);
|
|
2748
|
+
selectionState.setActiveCell({ rowId: rowDomId, columnKey }, {
|
|
2749
|
+
extend: event.shiftKey,
|
|
2750
|
+
toggle: event.ctrlKey || event.metaKey
|
|
2751
|
+
});
|
|
2752
|
+
updateRowSelection(rowId, event);
|
|
2753
|
+
if (!isInteractiveEventTarget(event))
|
|
2754
|
+
gridElement?.focus({ preventScroll: true });
|
|
2755
|
+
}
|
|
2756
|
+
function handleBodyClick(event) {
|
|
2757
|
+
const cell = getCellEventDetail(event);
|
|
2758
|
+
if (!cell)
|
|
2759
|
+
return;
|
|
2760
|
+
handleCellClick(event, cell.rowId, cell.rowDomId, cell.columnKey, cell.rowIndex);
|
|
2761
|
+
}
|
|
2762
|
+
function handleCellKeydown(event, rowId, rowDomId, columnKey, rowIndex) {
|
|
2763
|
+
if (isInteractiveEventTarget(event))
|
|
2764
|
+
return;
|
|
2765
|
+
if (event.key !== "Enter" && event.key !== " ")
|
|
2766
|
+
return;
|
|
2767
|
+
event.preventDefault();
|
|
2768
|
+
event.stopPropagation();
|
|
2769
|
+
$4.set(requestedActiveRowIndex, rowIndex, true);
|
|
2770
|
+
$4.set(requestedActiveColumnKey, columnKey, true);
|
|
2771
|
+
selectionState.setActiveCell({ rowId: rowDomId, columnKey }, {
|
|
2772
|
+
extend: event.shiftKey,
|
|
2773
|
+
toggle: event.ctrlKey || event.metaKey
|
|
2774
|
+
});
|
|
2775
|
+
updateRowSelection(rowId, event);
|
|
2776
|
+
gridElement?.focus({ preventScroll: true });
|
|
2777
|
+
}
|
|
2778
|
+
function handleBodyKeydown(event) {
|
|
2779
|
+
const cell = getCellEventDetail(event);
|
|
2780
|
+
if (!cell)
|
|
2781
|
+
return;
|
|
2782
|
+
handleCellKeydown(event, cell.rowId, cell.rowDomId, cell.columnKey, cell.rowIndex);
|
|
2783
|
+
}
|
|
2784
|
+
function getCellEventDetail(event) {
|
|
2785
|
+
if (!(event.target instanceof Element))
|
|
2786
|
+
return;
|
|
2787
|
+
const cell = event.target.closest(".cinder-data-grid__cell");
|
|
2788
|
+
if (!cell)
|
|
2789
|
+
return;
|
|
2790
|
+
const { cinderRowId, cinderRowDomId, cinderColumnKey, cinderRowIndex } = cell.dataset;
|
|
2791
|
+
const rowIndex = Number(cinderRowIndex);
|
|
2792
|
+
if (cinderRowId === undefined || cinderRowDomId === undefined || cinderColumnKey === undefined || !Number.isInteger(rowIndex)) {
|
|
2793
|
+
return;
|
|
2794
|
+
}
|
|
2795
|
+
return {
|
|
2796
|
+
rowId: cinderRowId,
|
|
2797
|
+
rowDomId: cinderRowDomId,
|
|
2798
|
+
columnKey: cinderColumnKey,
|
|
2799
|
+
rowIndex
|
|
2800
|
+
};
|
|
2801
|
+
}
|
|
2802
|
+
function handleKeydown(event) {
|
|
2803
|
+
if ($$props.onkeydown) {
|
|
2804
|
+
$$props.onkeydown(event);
|
|
2805
|
+
}
|
|
2806
|
+
if (event.defaultPrevented)
|
|
2807
|
+
return;
|
|
2808
|
+
if (event.target instanceof Element && event.target.closest(".cinder-data-grid__sort-button")) {
|
|
2809
|
+
return;
|
|
2810
|
+
}
|
|
2811
|
+
if (isInteractiveEventTarget(event))
|
|
2812
|
+
return;
|
|
2813
|
+
if ($4.get(sortedKeyedRows).length === 0 || columnModel.renderColumns.length === 0)
|
|
2814
|
+
return;
|
|
2815
|
+
const action = dataGridKeyToAction(event, {
|
|
2816
|
+
activeRowIndex: $4.get(activeRowIndex),
|
|
2817
|
+
activeColumnIndex: $4.get(activeColumnIndex),
|
|
2818
|
+
rowCount: $4.get(sortedKeyedRows).length,
|
|
2819
|
+
columnCount: columnModel.renderColumns.length
|
|
2820
|
+
});
|
|
2821
|
+
if (!action)
|
|
2822
|
+
return;
|
|
2823
|
+
event.preventDefault();
|
|
2824
|
+
if (action.type === "move-cell") {
|
|
2825
|
+
moveActiveCell(action.rowIndex, action.columnIndex, action.extend);
|
|
2826
|
+
return;
|
|
2827
|
+
}
|
|
2828
|
+
if (action.type === "select-all") {
|
|
2829
|
+
selectionState.selectAll();
|
|
2830
|
+
syncRequestedActiveCell();
|
|
2831
|
+
if (selectionMode() === "multiple") {
|
|
2832
|
+
setSelectionModel($4.get(sortedKeyedRows).map((row) => row.rowId));
|
|
2833
|
+
} else if (selectionMode() === "single") {
|
|
2834
|
+
const row = $4.get(sortedKeyedRows)[$4.get(activeRowIndex)];
|
|
2835
|
+
setSelectionModel(row ? [row.rowId] : []);
|
|
2836
|
+
}
|
|
2837
|
+
return;
|
|
2838
|
+
}
|
|
2839
|
+
if (action.type === "collapse-selection") {
|
|
2840
|
+
collapseSelectionToActiveCell();
|
|
2841
|
+
return;
|
|
2842
|
+
}
|
|
2843
|
+
if (action.type === "select-active-cell") {
|
|
2844
|
+
selectActiveCell(event);
|
|
2845
|
+
return;
|
|
2846
|
+
}
|
|
2847
|
+
if (action.type === "copy-selection") {
|
|
2848
|
+
copySelectedCells();
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
function isInteractiveEventTarget(event) {
|
|
2852
|
+
if (!(event.target instanceof Element))
|
|
2853
|
+
return false;
|
|
2854
|
+
const interactiveElement = event.target.closest(interactiveDescendantSelector);
|
|
2855
|
+
return interactiveElement !== null && interactiveElement !== gridElement;
|
|
2856
|
+
}
|
|
2857
|
+
var fragment = root();
|
|
2858
|
+
var div = $4.first_child(fragment);
|
|
2859
|
+
$4.attribute_effect(div, ($0) => ({
|
|
2860
|
+
...rest,
|
|
2861
|
+
class: $0,
|
|
2862
|
+
role: "grid",
|
|
2863
|
+
"aria-rowcount": $$props.rows.length + 1,
|
|
2864
|
+
"aria-colcount": columnModel.orderedColumns.length,
|
|
2865
|
+
"aria-label": $4.get(resolvedAriaLabel),
|
|
2866
|
+
"aria-labelledby": $4.get(resolvedAriaLabelledBy),
|
|
2867
|
+
"aria-activedescendant": $4.get(activeCellId),
|
|
2868
|
+
"aria-multiselectable": "true",
|
|
2869
|
+
tabindex: "0",
|
|
2870
|
+
onkeydown: handleKeydown,
|
|
2871
|
+
"data-cinder-density": density(),
|
|
2872
|
+
"data-cinder-sticky-header": stickyHeader() ? "true" : undefined,
|
|
2873
|
+
"data-cinder-virtualized-rows": $4.get(shouldVirtualizeRows) ? "true" : undefined,
|
|
2874
|
+
"data-cinder-virtualized-columns": $4.get(shouldVirtualizeColumns) ? "true" : undefined,
|
|
2875
|
+
[$4.STYLE]: {
|
|
2876
|
+
"--_cinder-data-grid-template-columns": $4.get(gridTemplateColumns),
|
|
2877
|
+
"--_cinder-data-grid-content-width": $4.get(gridContentWidth) === undefined ? undefined : `${$4.get(gridContentWidth)}px`
|
|
2878
|
+
}
|
|
2879
|
+
}), [() => classNames("cinder-data-grid", $$props.class)]);
|
|
2880
|
+
var div_1 = $4.child(div);
|
|
2881
|
+
$4.each(div_1, 21, () => $4.get(renderedColumns), (column) => column.key, ($$anchor2, column) => {
|
|
2882
|
+
const sortItem = $4.derived(() => getColumnSortModelItem($4.get(column).key));
|
|
2883
|
+
const sortPriority = $4.derived(() => getColumnSortPriority($4.get(column).key));
|
|
2884
|
+
var div_2 = root_1();
|
|
2885
|
+
var node_1 = $4.child(div_2);
|
|
2886
|
+
{
|
|
2887
|
+
var consequent_4 = ($$anchor3) => {
|
|
2888
|
+
var button = root_2();
|
|
2889
|
+
var span = $4.child(button);
|
|
2890
|
+
var node_2 = $4.child(span);
|
|
2891
|
+
{
|
|
2892
|
+
var consequent = ($$anchor4) => {
|
|
2893
|
+
var fragment_1 = $4.comment();
|
|
2894
|
+
var node_3 = $4.first_child(fragment_1);
|
|
2895
|
+
$4.snippet(node_3, () => $4.get(column).header);
|
|
2896
|
+
$4.append($$anchor4, fragment_1);
|
|
2897
|
+
};
|
|
2898
|
+
var alternate = ($$anchor4) => {
|
|
2899
|
+
var text_1 = $4.text();
|
|
2900
|
+
$4.template_effect(() => $4.set_text(text_1, $4.get(column).header));
|
|
2901
|
+
$4.append($$anchor4, text_1);
|
|
2902
|
+
};
|
|
2903
|
+
$4.if(node_2, ($$render) => {
|
|
2904
|
+
if (typeof $4.get(column).header === "function")
|
|
2905
|
+
$$render(consequent);
|
|
2906
|
+
else
|
|
2907
|
+
$$render(alternate, -1);
|
|
2908
|
+
});
|
|
2909
|
+
}
|
|
2910
|
+
$4.reset(span);
|
|
2911
|
+
var span_1 = $4.sibling(span, 2);
|
|
2912
|
+
var node_4 = $4.child(span_1);
|
|
2913
|
+
{
|
|
2914
|
+
var consequent_1 = ($$anchor4) => {
|
|
2915
|
+
var text_2 = $4.text("Asc");
|
|
2916
|
+
$4.append($$anchor4, text_2);
|
|
2917
|
+
};
|
|
2918
|
+
var consequent_2 = ($$anchor4) => {
|
|
2919
|
+
var text_3 = $4.text("Desc");
|
|
2920
|
+
$4.append($$anchor4, text_3);
|
|
2921
|
+
};
|
|
2922
|
+
$4.if(node_4, ($$render) => {
|
|
2923
|
+
if ($4.get(sortItem)?.direction === "ascending")
|
|
2924
|
+
$$render(consequent_1);
|
|
2925
|
+
else if ($4.get(sortItem)?.direction === "descending")
|
|
2926
|
+
$$render(consequent_2, 1);
|
|
2927
|
+
});
|
|
2928
|
+
}
|
|
2929
|
+
$4.reset(span_1);
|
|
2930
|
+
var node_5 = $4.sibling(span_1, 2);
|
|
2931
|
+
{
|
|
2932
|
+
var consequent_3 = ($$anchor4) => {
|
|
2933
|
+
var span_2 = root_7();
|
|
2934
|
+
var text_4 = $4.child(span_2, true);
|
|
2935
|
+
$4.reset(span_2);
|
|
2936
|
+
$4.template_effect(() => $4.set_text(text_4, $4.get(sortPriority)));
|
|
2937
|
+
$4.append($$anchor4, span_2);
|
|
2938
|
+
};
|
|
2939
|
+
$4.if(node_5, ($$render) => {
|
|
2940
|
+
if ($4.get(sortPriority) !== undefined)
|
|
2941
|
+
$$render(consequent_3);
|
|
2942
|
+
});
|
|
2943
|
+
}
|
|
2944
|
+
var span_3 = $4.sibling(node_5, 2);
|
|
2945
|
+
var text_5 = $4.child(span_3, true);
|
|
2946
|
+
$4.reset(span_3);
|
|
2947
|
+
$4.reset(button);
|
|
2948
|
+
$4.template_effect(($0) => $4.set_text(text_5, $0), [
|
|
2949
|
+
() => getSortStateDescription($4.get(sortItem), $4.get(sortPriority))
|
|
2950
|
+
]);
|
|
2951
|
+
$4.delegated("click", button, (event) => handleColumnHeaderClick($4.get(column), event));
|
|
2952
|
+
$4.append($$anchor3, button);
|
|
2953
|
+
};
|
|
2954
|
+
var consequent_5 = ($$anchor3) => {
|
|
2955
|
+
var fragment_3 = $4.comment();
|
|
2956
|
+
var node_6 = $4.first_child(fragment_3);
|
|
2957
|
+
$4.snippet(node_6, () => $4.get(column).header);
|
|
2958
|
+
$4.append($$anchor3, fragment_3);
|
|
2959
|
+
};
|
|
2960
|
+
var alternate_1 = ($$anchor3) => {
|
|
2961
|
+
var text_6 = $4.text();
|
|
2962
|
+
$4.template_effect(() => $4.set_text(text_6, $4.get(column).header));
|
|
2963
|
+
$4.append($$anchor3, text_6);
|
|
2964
|
+
};
|
|
2965
|
+
$4.if(node_1, ($$render) => {
|
|
2966
|
+
if ($4.get(column).sortable)
|
|
2967
|
+
$$render(consequent_4);
|
|
2968
|
+
else if (typeof $4.get(column).header === "function")
|
|
2969
|
+
$$render(consequent_5, 1);
|
|
2970
|
+
else
|
|
2971
|
+
$$render(alternate_1, -1);
|
|
2972
|
+
});
|
|
2973
|
+
}
|
|
2974
|
+
$4.reset(div_2);
|
|
2975
|
+
$4.template_effect(($0, $1) => {
|
|
2976
|
+
$4.set_attribute(div_2, "aria-colindex", $4.get(column).colIndex);
|
|
2977
|
+
$4.set_attribute(div_2, "aria-sort", $0);
|
|
2978
|
+
$4.set_attribute(div_2, "data-cinder-pin", $4.get(column).pin);
|
|
2979
|
+
$4.set_attribute(div_2, "data-cinder-sortable", $4.get(column).sortable ? "true" : undefined);
|
|
2980
|
+
$4.set_attribute(div_2, "data-cinder-sort-direction", $4.get(sortItem)?.direction);
|
|
2981
|
+
$4.set_style(div_2, $1);
|
|
2982
|
+
}, [
|
|
2983
|
+
() => $4.get(column).sortable ? getHeaderAriaSort($4.get(column), $4.get(sortItem)) : undefined,
|
|
2984
|
+
() => getCellStyle($4.get(column))
|
|
2985
|
+
]);
|
|
2986
|
+
$4.append($$anchor2, div_2);
|
|
2987
|
+
});
|
|
2988
|
+
$4.reset(div_1);
|
|
2989
|
+
$4.bind_this(div_1, ($$value) => headerElement = $$value, () => headerElement);
|
|
2990
|
+
$4.attach(div_1, () => observeHeaderSize);
|
|
2991
|
+
var div_3 = $4.sibling(div_1, 2);
|
|
2992
|
+
let styles;
|
|
2993
|
+
$4.each(div_3, 21, () => $4.get(renderedRows), (renderedRow) => renderedRow.keyedRow.rowKey, ($$anchor2, renderedRow) => {
|
|
2994
|
+
const keyedRow = $4.derived(() => $4.get(renderedRow).keyedRow);
|
|
2995
|
+
const row = $4.derived(() => $4.get(keyedRow).row);
|
|
2996
|
+
const rowId = $4.derived(() => $4.get(keyedRow).rowId);
|
|
2997
|
+
const rowDomId = $4.derived(() => $4.get(keyedRow).rowDomId);
|
|
2998
|
+
const rowIndex = $4.derived(() => $4.get(renderedRow).visualRowIndex);
|
|
2999
|
+
var div_4 = root_10();
|
|
3000
|
+
$4.each(div_4, 21, () => $4.get(renderedColumns), (column) => column.key, ($$anchor3, column) => {
|
|
3001
|
+
const value = $4.derived(() => getDataGridColumnValue($4.get(row), $4.get(column)));
|
|
3002
|
+
const cellId = $4.derived(() => getCellId($4.get(rowDomId), $4.get(column).key));
|
|
3003
|
+
const cellCoordinates = $4.derived(() => ({ rowId: $4.get(rowDomId), columnKey: $4.get(column).key }));
|
|
3004
|
+
const isSelectedCell = $4.derived(() => selectionState.isCellSelected($4.get(cellCoordinates)));
|
|
3005
|
+
const isAnchorCell = $4.derived(() => selectionState.isAnchorCell($4.get(cellCoordinates)));
|
|
3006
|
+
var div_5 = root_11();
|
|
3007
|
+
var node_7 = $4.child(div_5);
|
|
3008
|
+
{
|
|
3009
|
+
var consequent_6 = ($$anchor4) => {
|
|
3010
|
+
var fragment_5 = $4.comment();
|
|
3011
|
+
var node_8 = $4.first_child(fragment_5);
|
|
3012
|
+
$4.snippet(node_8, () => $4.get(column).cell, () => ({ row: $4.get(row), value: $4.get(value), editing: false }));
|
|
3013
|
+
$4.append($$anchor4, fragment_5);
|
|
3014
|
+
};
|
|
3015
|
+
var alternate_2 = ($$anchor4) => {
|
|
3016
|
+
var text_7 = $4.text();
|
|
3017
|
+
$4.template_effect(($0) => $4.set_text(text_7, $0), [() => formatDataGridValue($4.get(value))]);
|
|
3018
|
+
$4.append($$anchor4, text_7);
|
|
3019
|
+
};
|
|
3020
|
+
$4.if(node_7, ($$render) => {
|
|
3021
|
+
if ($4.get(column).cell)
|
|
3022
|
+
$$render(consequent_6);
|
|
3023
|
+
else
|
|
3024
|
+
$$render(alternate_2, -1);
|
|
3025
|
+
});
|
|
3026
|
+
}
|
|
3027
|
+
$4.reset(div_5);
|
|
3028
|
+
$4.template_effect(($0) => {
|
|
3029
|
+
$4.set_attribute(div_5, "id", $4.get(cellId));
|
|
3030
|
+
$4.set_attribute(div_5, "aria-colindex", $4.get(column).colIndex);
|
|
3031
|
+
$4.set_attribute(div_5, "aria-selected", $4.get(isSelectedCell) ? "true" : undefined);
|
|
3032
|
+
$4.set_attribute(div_5, "data-cinder-pin", $4.get(column).pin);
|
|
3033
|
+
$4.set_attribute(div_5, "data-cinder-active", $4.get(activeCellId) === $4.get(cellId) ? "true" : undefined);
|
|
3034
|
+
$4.set_attribute(div_5, "data-cinder-selected", $4.get(isSelectedCell) ? "true" : undefined);
|
|
3035
|
+
$4.set_attribute(div_5, "data-cinder-anchor", $4.get(isAnchorCell) ? "true" : undefined);
|
|
3036
|
+
$4.set_attribute(div_5, "data-cinder-row-id", $4.get(rowId));
|
|
3037
|
+
$4.set_attribute(div_5, "data-cinder-row-dom-id", $4.get(rowDomId));
|
|
3038
|
+
$4.set_attribute(div_5, "data-cinder-column-key", $4.get(column).key);
|
|
3039
|
+
$4.set_attribute(div_5, "data-cinder-row-index", $4.get(rowIndex));
|
|
3040
|
+
$4.set_style(div_5, $0);
|
|
3041
|
+
}, [() => getCellStyle($4.get(column))]);
|
|
3042
|
+
$4.append($$anchor3, div_5);
|
|
3043
|
+
});
|
|
3044
|
+
$4.reset(div_4);
|
|
3045
|
+
$4.template_effect(($0, $1, $22, $32, $42) => {
|
|
3046
|
+
$4.set_class(div_4, 1, $0);
|
|
3047
|
+
$4.set_attribute(div_4, "aria-rowindex", $4.get(rowIndex) + 2);
|
|
3048
|
+
$4.set_attribute(div_4, "aria-label", $1);
|
|
3049
|
+
$4.set_attribute(div_4, "aria-selected", $22);
|
|
3050
|
+
$4.set_attribute(div_4, "data-cinder-selected", $32);
|
|
3051
|
+
$4.set_attribute(div_4, "data-cinder-virtual-index", $4.get(rowIndex));
|
|
3052
|
+
$4.set_style(div_4, $42);
|
|
3053
|
+
}, [
|
|
3054
|
+
() => $4.clsx(classNames("cinder-data-grid__row", getRowClass($4.get(row), $4.get(rowIndex)))),
|
|
3055
|
+
() => getResolvedRowAriaLabel($4.get(row), $4.get(rowIndex)),
|
|
3056
|
+
() => $4.get(selectedRowIds).has($4.get(rowId)) ? "true" : undefined,
|
|
3057
|
+
() => $4.get(selectedRowIds).has($4.get(rowId)) ? "true" : undefined,
|
|
3058
|
+
() => getRowStyle($4.get(renderedRow))
|
|
3059
|
+
]);
|
|
3060
|
+
$4.append($$anchor2, div_4);
|
|
3061
|
+
});
|
|
3062
|
+
$4.reset(div_3);
|
|
3063
|
+
$4.attach(div_3, () => delegateBodyEvents);
|
|
3064
|
+
$4.reset(div);
|
|
3065
|
+
$4.bind_this(div, ($$value) => gridElement = $$value, () => gridElement);
|
|
3066
|
+
$4.attach(div, () => rowVirtualizer.mountScrollContainer);
|
|
3067
|
+
$4.attach(div, () => observeGridSize);
|
|
3068
|
+
var div_6 = $4.sibling(div, 2);
|
|
3069
|
+
var text_8 = $4.child(div_6, true);
|
|
3070
|
+
$4.reset(div_6);
|
|
3071
|
+
$4.template_effect(() => {
|
|
3072
|
+
$4.set_attribute(div_3, "data-cinder-virtualized", $4.get(shouldVirtualizeRows) ? "true" : undefined);
|
|
3073
|
+
styles = $4.set_style(div_3, "", styles, { height: $4.get(bodyHeight) });
|
|
3074
|
+
$4.set_text(text_8, $4.get(renderedLiveRegionMessage));
|
|
3075
|
+
});
|
|
3076
|
+
$4.append($$anchor, fragment);
|
|
3077
|
+
$4.pop();
|
|
3078
|
+
}
|
|
3079
|
+
$4.delegate(["click"]);
|
|
3080
|
+
|
|
3081
|
+
// src/components/data-grid/index.ts
|
|
3082
|
+
var data_grid_default = Data_grid;
|
|
3083
|
+
export {
|
|
3084
|
+
data_grid_default as default,
|
|
3085
|
+
Data_grid as DataGrid
|
|
3086
|
+
};
|
|
3087
|
+
|
|
3088
|
+
//# debugId=DBADF5D5E9737F4864756E2164756E21
|