@aceshooting/lyra-ui 32.0.0 → 32.1.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 +203 -0
- package/README.md +24 -6
- package/design-tokens.json +1 -1
- package/dist/all.d.ts +1 -1
- package/dist/all.js +1 -1
- package/dist/autoloader.d.ts +10 -0
- package/dist/autoloader.js +1 -1
- package/dist/cli/migrate-wa.mjs +45 -37
- package/dist/cli/migration-contract.json.gz +0 -0
- package/dist/components/agent-tools/budget-meter/budget-meter.class.d.ts +1 -0
- package/dist/components/agent-tools/budget-meter/budget-meter.styles.js +1 -1
- package/dist/components/charts/chart/box-plot.class.d.ts +3 -0
- package/dist/components/charts/chart/chart-band.js +1 -1
- package/dist/components/charts/chart/chart-input-projection.js +1 -1
- package/dist/components/charts/chart/chart-surface.styles.js +1 -1
- package/dist/components/charts/chart/chart-types.d.ts +16 -2
- package/dist/components/charts/chart/chart.class.d.ts +4 -1
- package/dist/components/charts/chart/chart.class.js +3 -3
- package/dist/components/charts/chart/lite-chart.class.d.ts +3 -0
- package/dist/components/charts/chart/lite-chart.styles.js +1 -1
- package/dist/components/conversation/code-block/code-block-base.class.d.ts +29 -3
- package/dist/components/conversation/code-block/code-block-base.class.js +1 -1
- package/dist/components/conversation/code-block/code-block-core.class.d.ts +46 -2
- package/dist/components/conversation/code-block/code-block-core.class.js +1 -1
- package/dist/components/conversation/code-block/code-block-shared.d.ts +6 -2
- package/dist/components/conversation/code-block/code-block-shared.js +5 -4
- package/dist/components/conversation/code-block/code-block.class.d.ts +45 -1
- package/dist/components/conversation/code-block/code-block.class.js +1 -1
- package/dist/components/conversation/code-block/code-block.styles.js +1 -1
- package/dist/components/conversation/markdown/markdown-core.class.d.ts +12 -0
- package/dist/components/conversation/markdown/markdown.class.d.ts +12 -0
- package/dist/components/conversation/markdown/markdown.styles.js +1 -1
- package/dist/components/conversation/model-select/model-select.class.d.ts +6 -0
- package/dist/components/conversation/suggestion-chips/suggestion-chips.class.d.ts +1 -0
- package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +1 -1
- package/dist/components/conversation/thread-list/thread-list.class.d.ts +3 -0
- package/dist/components/conversation/thread-list/thread-list.styles.js +1 -1
- package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +6 -0
- package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +4 -0
- package/dist/components/data/heatmap/heatmap.class.d.ts +21 -2
- package/dist/components/data/heatmap/heatmap.class.js +2 -2
- package/dist/components/data/heatmap/heatmap.styles.js +1 -1
- package/dist/components/data/stat/stat.class.d.ts +24 -1
- package/dist/components/data/stat/stat.class.js +2 -2
- package/dist/components/data/stat/stat.styles.js +1 -1
- package/dist/components/data/table/table-row-attributes.js +1 -0
- package/dist/components/data/table/table-support.d.ts +65 -5
- package/dist/components/data/table/table-support.js +1 -1
- package/dist/components/data/table/table.class.d.ts +77 -7
- package/dist/components/data/table/table.class.js +10 -10
- package/dist/components/data/table/table.styles.js +1 -1
- package/dist/components/data/timeline/timeline-item.class.d.ts +27 -5
- package/dist/components/data/timeline/timeline-item.class.js +11 -7
- package/dist/components/data/timeline/timeline-item.styles.js +1 -1
- package/dist/components/data/timeline/timeline.class.d.ts +40 -5
- package/dist/components/data/timeline/timeline.class.js +11 -7
- package/dist/components/data/timeline/timeline.styles.js +1 -1
- package/dist/components/data/tree/tree-item.class.d.ts +2 -0
- package/dist/components/data/tree/tree-item.class.js +2 -2
- package/dist/components/data/tree/tree-item.styles.js +1 -1
- package/dist/components/forms/button/button.class.d.ts +13 -0
- package/dist/components/forms/button/button.styles.js +1 -1
- package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +29 -2
- package/dist/components/forms/checkbox-group/checkbox-group.class.js +3 -3
- package/dist/components/forms/checkbox-group/checkbox-group.styles.js +1 -1
- package/dist/components/forms/code-editor/code-editor.class.d.ts +6 -0
- package/dist/components/forms/color-picker/color-picker.class.d.ts +9 -0
- package/dist/components/forms/color-picker/color-picker.class.js +3 -3
- package/dist/components/forms/color-picker/color-picker.styles.js +1 -1
- package/dist/components/forms/combobox/combobox.class.d.ts +114 -7
- package/dist/components/forms/combobox/combobox.class.js +9 -7
- package/dist/components/forms/combobox/combobox.styles.js +1 -1
- package/dist/components/forms/country-picker/country-picker.class.d.ts +2 -0
- package/dist/components/forms/currency-picker/currency-picker.class.d.ts +2 -0
- package/dist/components/forms/date-picker/date-input.class.d.ts +41 -0
- package/dist/components/forms/date-picker/date-input.class.js +2 -2
- package/dist/components/forms/date-picker/date-input.styles.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +4 -0
- package/dist/components/forms/icon-button/icon-button.styles.js +1 -1
- package/dist/components/forms/input/input-shared.d.ts +12 -0
- package/dist/components/forms/input/input.styles.js +1 -1
- package/dist/components/forms/input/time-input.class.d.ts +6 -0
- package/dist/components/forms/input/time-input.styles.js +1 -1
- package/dist/components/forms/locale-picker/locale-picker.class.d.ts +11 -0
- package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -1
- package/dist/components/forms/otp-input/otp-input.class.d.ts +6 -0
- package/dist/components/forms/phone-input/phone-input.class.d.ts +6 -0
- package/dist/components/forms/phone-input/phone-input.styles.js +1 -1
- package/dist/components/forms/radio/radio-group.class.d.ts +24 -2
- package/dist/components/forms/radio/radio-group.class.js +2 -2
- package/dist/components/forms/radio/radio-group.styles.js +1 -1
- package/dist/components/forms/rubric-form/rubric-form.class.d.ts +4 -0
- package/dist/components/forms/select/select.class.d.ts +13 -0
- package/dist/components/forms/select/select.class.js +1 -1
- package/dist/components/forms/select/select.styles.js +1 -1
- package/dist/components/forms/signature-pad/signature-pad.class.d.ts +6 -0
- package/dist/components/forms/signature-pad/signature-pad.styles.js +1 -1
- package/dist/components/forms/slider/slider.class.d.ts +28 -2
- package/dist/components/forms/slider/slider.class.js +3 -3
- package/dist/components/forms/slider/slider.styles.js +1 -1
- package/dist/components/forms/switch/switch.class.d.ts +2 -0
- package/dist/components/forms/switch/switch.styles.js +1 -1
- package/dist/components/forms/textarea/textarea.class.d.ts +8 -0
- package/dist/components/forms/textarea/textarea.styles.js +1 -1
- package/dist/components/forms/time-zone-picker/time-zone-picker.class.d.ts +2 -0
- package/dist/components/forms/token-input/token-input.class.d.ts +96 -18
- package/dist/components/forms/token-input/token-input.class.js +11 -8
- package/dist/components/forms/token-input/token-input.styles.js +1 -1
- package/dist/components/forms/unit-picker/unit-picker.class.d.ts +2 -0
- package/dist/components/layout/app-rail/app-rail.class.d.ts +3 -0
- package/dist/components/layout/app-rail/app-rail.styles.js +1 -1
- package/dist/components/layout/button-group/button-group.class.d.ts +4 -0
- package/dist/components/layout/button-group/button-group.class.js +1 -1
- package/dist/components/layout/card/card.class.d.ts +15 -1
- package/dist/components/layout/card/card.styles.js +1 -1
- package/dist/components/layout/details/details.class.d.ts +6 -0
- package/dist/components/layout/details/details.styles.js +1 -1
- package/dist/components/layout/filter-bar/filter-bar.class.d.ts +6 -0
- package/dist/components/layout/filter-bar/filter-bar.styles.js +1 -1
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/layout/menu/dropdown-item.class.d.ts +8 -2
- package/dist/components/layout/menu/dropdown-item.class.js +1 -1
- package/dist/components/layout/menu/menu-item.class.d.ts +7 -0
- package/dist/components/layout/menu/menu-item.styles.js +1 -1
- package/dist/components/layout/menu/menu-label.class.d.ts +5 -0
- package/dist/components/layout/menu/menu-label.class.js +1 -1
- package/dist/components/layout/menu/menu.class.d.ts +3 -0
- package/dist/components/layout/menu/menu.styles.js +1 -1
- package/dist/components/layout/page/page.class.d.ts +9 -1
- package/dist/components/layout/page/page.class.js +2 -2
- package/dist/components/layout/segmented/segmented.class.d.ts +22 -3
- package/dist/components/layout/segmented/segmented.class.js +3 -4
- package/dist/components/layout/segmented/segmented.styles.js +1 -1
- package/dist/components/layout/stepper/step.class.d.ts +89 -0
- package/dist/components/layout/stepper/step.class.js +18 -0
- package/dist/components/layout/stepper/step.styles.js +1 -0
- package/dist/components/layout/stepper/stepper.class.d.ts +106 -13
- package/dist/components/layout/stepper/stepper.class.js +6 -2
- package/dist/components/layout/stepper/stepper.styles.js +1 -1
- package/dist/components/layout/tab-group/tab-group.class.d.ts +10 -1
- package/dist/components/layout/tab-group/tab-group.class.js +1 -1
- package/dist/components/layout/tab-group/tab-group.styles.js +1 -1
- package/dist/components/layout/tab-group/tab-panel.class.d.ts +1 -0
- package/dist/components/layout/tab-group/tab-panel.class.js +1 -1
- package/dist/components/layout/tab-group/tab.class.d.ts +4 -0
- package/dist/components/layout/widget/widget.class.d.ts +1 -0
- package/dist/components/layout/widget/widget.styles.js +1 -1
- package/dist/components/lr-code-block-core.d.ts +1 -1
- package/dist/components/lr-code-block.d.ts +1 -1
- package/dist/components/lr-counter.d.ts +1 -0
- package/dist/components/lr-counter.js +1 -0
- package/dist/components/lr-lightbox-item.d.ts +1 -0
- package/dist/components/lr-lightbox-item.js +1 -0
- package/dist/components/lr-lightbox.d.ts +1 -1
- package/dist/components/lr-lightbox.js +1 -1
- package/dist/components/lr-number-ticker.d.ts +1 -0
- package/dist/components/lr-number-ticker.js +1 -0
- package/dist/components/lr-step.d.ts +1 -0
- package/dist/components/lr-step.js +1 -0
- package/dist/components/media/file-input/file-input.class.d.ts +7 -1
- package/dist/components/media/file-input/file-input.class.js +2 -2
- package/dist/components/media/file-input/file-input.styles.js +1 -1
- package/dist/components/media/index.d.ts +1 -1
- package/dist/components/media/index.js +1 -1
- package/dist/components/media/lightbox/lightbox-item.class.d.ts +57 -0
- package/dist/components/media/lightbox/lightbox-item.class.js +9 -0
- package/dist/components/media/lightbox/lightbox-item.styles.js +1 -0
- package/dist/components/media/lightbox/lightbox.class.d.ts +90 -20
- package/dist/components/media/lightbox/lightbox.class.js +17 -12
- package/dist/components/media/lightbox/lightbox.styles.js +1 -1
- package/dist/components/media/map/map-anchor-avoid.js +1 -1
- package/dist/components/media/map/map-drawing-controller.js +1 -1
- package/dist/components/media/map/map.class.d.ts +137 -7
- package/dist/components/media/map/map.class.js +6 -6
- package/dist/components/media/map/map.styles.js +1 -1
- package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +9 -0
- package/dist/components/media/sequence-playback/sequence-playback.class.js +2 -2
- package/dist/components/media/sequence-playback/sequence-playback.styles.js +1 -1
- package/dist/components/media/video/video.class.d.ts +4 -0
- package/dist/components/media/video/video.class.js +2 -2
- package/dist/components/media/video/video.styles.js +1 -1
- package/dist/components/media/zoomable-frame/zoomable-frame.class.d.ts +15 -0
- package/dist/components/media/zoomable-frame/zoomable-frame.class.js +2 -2
- package/dist/components/overlays/badge/badge.class.d.ts +2 -0
- package/dist/components/overlays/badge/badge.styles.js +1 -1
- package/dist/components/overlays/badge/tag.class.d.ts +2 -0
- package/dist/components/overlays/badge/tag.class.js +1 -1
- package/dist/components/overlays/chip/chip-group.class.d.ts +31 -4
- package/dist/components/overlays/chip/chip-group.class.js +3 -3
- package/dist/components/overlays/context-menu/context-menu.class.d.ts +5 -0
- package/dist/components/overlays/context-menu/context-menu.class.js +1 -1
- package/dist/components/overlays/dialog/dialog.class.d.ts +36 -4
- package/dist/components/overlays/dialog/dialog.class.js +3 -3
- package/dist/components/overlays/dialog/dialog.styles.js +1 -1
- package/dist/components/overlays/dialog/prompt.d.ts +60 -0
- package/dist/components/overlays/dialog/prompt.js +1 -0
- package/dist/components/overlays/drawer/drawer.class.d.ts +16 -1
- package/dist/components/overlays/drawer/drawer.class.js +1 -1
- package/dist/components/overlays/empty/empty.class.d.ts +1 -0
- package/dist/components/overlays/empty/empty.class.js +1 -1
- package/dist/components/overlays/overlay/dropdown.class.d.ts +4 -0
- package/dist/components/overlays/overlay/dropdown.class.js +1 -1
- package/dist/components/overlays/overlay/overlay.styles.js +1 -1
- package/dist/components/overlays/overlay/popover.class.d.ts +29 -3
- package/dist/components/overlays/overlay/popover.class.js +2 -2
- package/dist/components/overlays/overlay/tooltip.class.d.ts +2 -0
- package/dist/components/overlays/overlay/tooltip.class.js +2 -2
- package/dist/components/overlays/toast/toast-item.class.d.ts +1 -0
- package/dist/components/overlays/toast/toast-item.class.js +1 -1
- package/dist/components/overlays/toast/toast-item.styles.js +1 -1
- package/dist/components/overlays/toast/toast.class.d.ts +6 -0
- package/dist/components/overlays/toast/toast.class.js +1 -1
- package/dist/components/utility/copy-button/copy-button.class.d.ts +2 -0
- package/dist/components/utility/copy-button/copy-button.class.js +2 -2
- package/dist/components/utility/counter/counter-time.d.ts +15 -0
- package/dist/components/utility/counter/counter-time.js +1 -0
- package/dist/components/utility/counter/counter.class.d.ts +67 -0
- package/dist/components/utility/counter/counter.class.js +1 -0
- package/dist/components/utility/counter/counter.styles.js +1 -0
- package/dist/components/utility/divider/divider.class.d.ts +21 -3
- package/dist/components/utility/divider/divider.class.js +5 -1
- package/dist/components/utility/export-button/export-button.class.d.ts +5 -0
- package/dist/components/utility/export-button/export-button.styles.js +1 -1
- package/dist/components/utility/icon/icon-library.d.ts +14 -1
- package/dist/components/utility/icon/icon-library.js +1 -1
- package/dist/components/utility/icon/icon-sprite.js +1 -0
- package/dist/components/utility/icon/icon.class.d.ts +4 -2
- package/dist/components/utility/icon/icon.class.js +2 -2
- package/dist/components/utility/index.d.ts +1 -1
- package/dist/components/utility/index.js +1 -1
- package/dist/components/utility/known-date/known-date.class.d.ts +4 -0
- package/dist/components/utility/number-ticker/number-ticker.class.d.ts +58 -0
- package/dist/components/utility/number-ticker/number-ticker.class.js +1 -0
- package/dist/components/utility/number-ticker/number-ticker.styles.js +1 -0
- package/dist/components/viewers/include/include.class.d.ts +4 -1
- package/dist/components/viewers/include/include.class.js +1 -1
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +10 -1
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +2 -2
- package/dist/components/viewers/pdf-viewer/pdf-viewer.styles.js +1 -1
- package/dist/custom-elements-jsx.d.ts +1 -1
- package/dist/event-classes.d.ts +2342 -0
- package/dist/event-classes.js +1 -0
- package/dist/events.d.ts +48 -22
- package/dist/framework-types.d.ts +2 -2
- package/dist/internal/all-defined-arguments.d.ts +19 -0
- package/dist/internal/all-defined-arguments.js +1 -0
- package/dist/internal/autoloader-tags.d.ts +1 -1
- package/dist/internal/autoloader-tags.js +1 -1
- package/dist/internal/checked-control-label.js +1 -1
- package/dist/internal/component-loaders.generated.js +1 -1
- package/dist/internal/dedent.js +7 -0
- package/dist/internal/default-strings/forms.generated.js +1 -1
- package/dist/internal/default-strings/layout.generated.js +1 -1
- package/dist/internal/dev-mode-attribute-warning.development.js +1 -1
- package/dist/internal/document-tokens.generated.js +3 -3
- package/dist/internal/form-control/chrome.styles.js +1 -1
- package/dist/internal/form-control.styles.js +1 -1
- package/dist/internal/interactive-control.styles.js +2 -2
- package/dist/internal/labeled-group.js +1 -1
- package/dist/internal/localization-runtime.d.ts +5 -0
- package/dist/internal/localization-runtime.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +2 -2
- package/dist/internal/lyra-element.js +2 -2
- package/dist/internal/lyra-event.d.ts +22 -0
- package/dist/internal/lyra-event.js +1 -0
- package/dist/internal/overlay-shared.d.ts +5 -2
- package/dist/internal/overlay-shared.js +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/root-registration-allowlist.js +1 -1
- package/dist/internal/scoped-definitions.generated.js +1 -1
- package/dist/internal/shiki/core.d.ts +4 -1
- package/dist/internal/shiki/tokenize.js +1 -1
- package/dist/internal/srcset.js +1 -0
- package/dist/lyra.d.ts +1 -1
- package/dist/lyra.js +1 -1
- package/dist/ssr/all.d.ts +1 -1
- package/dist/ssr/all.js +1 -1
- package/dist/ssr.d.ts +5 -5
- package/dist/ssr.js +1 -1
- package/dist/styles/native.css +1 -1
- package/dist/styles/palette.css +1 -0
- package/dist/styles/tokens-root.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/testing/happy-dom-shims.d.ts +11 -2
- package/dist/testing/happy-dom-shims.js +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/lyra-tag-event-map.d.ts +2 -2
- package/dist/testing/lyra-tag-event-map.js +1 -1
- package/dist/theme-core.css +1 -1
- package/dist/theme.css +1 -1
- package/dist/utilities/defined.d.ts +10 -1
- package/dist/utilities/defined.js +1 -1
- package/dist/utilities/form.d.ts +9 -0
- package/dist/utilities/form.js +1 -0
- package/dist/utilities/index.d.ts +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/vue.d.ts +1 -1
- package/llms/components/lr-app-rail.md +4 -2
- package/llms/components/lr-badge.md +4 -4
- package/llms/components/lr-bar-chart.md +1 -1
- package/llms/components/lr-box-plot.md +6 -1
- package/llms/components/lr-bubble-chart.md +1 -1
- package/llms/components/lr-budget-meter.md +2 -2
- package/llms/components/lr-button-group.md +7 -3
- package/llms/components/lr-button.md +11 -1
- package/llms/components/lr-card.md +11 -1
- package/llms/components/lr-chart.md +21 -7
- package/llms/components/lr-checkbox-group.md +11 -1
- package/llms/components/lr-chip.md +11 -1
- package/llms/components/lr-code-block-core.md +36 -8
- package/llms/components/lr-code-block.md +45 -6
- package/llms/components/lr-code-editor.md +11 -1
- package/llms/components/lr-color-picker.md +17 -4
- package/llms/components/lr-combobox.md +62 -6
- package/llms/components/lr-context-menu.md +5 -3
- package/llms/components/lr-copy-button.md +2 -1
- package/llms/components/lr-counter.md +60 -0
- package/llms/components/lr-country-picker.md +5 -1
- package/llms/components/lr-currency-picker.md +5 -1
- package/llms/components/lr-date-input.md +1 -1
- package/llms/components/lr-date-picker.md +25 -1
- package/llms/components/lr-details.md +6 -2
- package/llms/components/lr-dialog.md +72 -8
- package/llms/components/lr-divider.md +14 -5
- package/llms/components/lr-doughnut-chart.md +1 -1
- package/llms/components/lr-drawer.md +26 -7
- package/llms/components/lr-dropdown-item.md +1 -1
- package/llms/components/lr-dropdown.md +8 -4
- package/llms/components/lr-emoji-picker.md +10 -1
- package/llms/components/lr-empty.md +3 -2
- package/llms/components/lr-export-button.md +5 -2
- package/llms/components/lr-file-input.md +13 -1
- package/llms/components/lr-filter-bar.md +6 -2
- package/llms/components/lr-graph-query-builder.md +10 -1
- package/llms/components/lr-heatmap.md +20 -3
- package/llms/components/lr-histogram.md +7 -2
- package/llms/components/lr-icon-button.md +3 -1
- package/llms/components/lr-icon.md +8 -0
- package/llms/components/lr-include.md +3 -0
- package/llms/components/lr-input.md +9 -1
- package/llms/components/lr-known-date.md +10 -1
- package/llms/components/lr-lightbox-item.md +14 -0
- package/llms/components/lr-lightbox.md +84 -5
- package/llms/components/lr-line-chart.md +7 -2
- package/llms/components/lr-lite-chart.md +3 -2
- package/llms/components/lr-locale-picker.md +17 -1
- package/llms/components/lr-map.md +122 -11
- package/llms/components/lr-markdown-core.md +15 -4
- package/llms/components/lr-markdown.md +13 -4
- package/llms/components/lr-menu-item.md +1 -1
- package/llms/components/lr-menu-label.md +5 -2
- package/llms/components/lr-menu.md +21 -6
- package/llms/components/lr-model-select.md +11 -1
- package/llms/components/lr-native-time-input.md +11 -1
- package/llms/components/lr-number-input.md +11 -1
- package/llms/components/lr-number-ticker.md +55 -0
- package/llms/components/lr-otp-input.md +11 -1
- package/llms/components/lr-page.md +7 -1
- package/llms/components/lr-pagination.md +18 -0
- package/llms/components/lr-pdf-viewer.md +6 -1
- package/llms/components/lr-phone-input.md +11 -1
- package/llms/components/lr-pie-chart.md +1 -1
- package/llms/components/lr-polar-area-chart.md +1 -1
- package/llms/components/lr-popover.md +25 -5
- package/llms/components/lr-radar-chart.md +1 -1
- package/llms/components/lr-radio-group.md +11 -1
- package/llms/components/lr-rubric-form.md +7 -1
- package/llms/components/lr-scatter-chart.md +1 -1
- package/llms/components/lr-segmented.md +20 -2
- package/llms/components/lr-select.md +10 -2
- package/llms/components/lr-sequence-playback.md +8 -2
- package/llms/components/lr-signature-pad.md +8 -1
- package/llms/components/lr-slider.md +17 -4
- package/llms/components/lr-stat.md +20 -5
- package/llms/components/lr-step.md +61 -0
- package/llms/components/lr-stepper.md +64 -8
- package/llms/components/lr-suggestion-chips.md +3 -2
- package/llms/components/lr-switch.md +4 -3
- package/llms/components/lr-tab-group.md +10 -3
- package/llms/components/lr-tab-panel.md +2 -2
- package/llms/components/lr-table.md +87 -8
- package/llms/components/lr-tag.md +1 -1
- package/llms/components/lr-textarea.md +17 -1
- package/llms/components/lr-thread-list.md +4 -2
- package/llms/components/lr-time-input.md +8 -1
- package/llms/components/lr-time-zone-picker.md +5 -1
- package/llms/components/lr-timeline-item.md +1 -1
- package/llms/components/lr-timeline.md +38 -1
- package/llms/components/lr-toast-item.md +1 -1
- package/llms/components/lr-toast.md +7 -2
- package/llms/components/lr-token-input.md +64 -8
- package/llms/components/lr-tooltip.md +3 -3
- package/llms/components/lr-tree-item.md +1 -1
- package/llms/components/lr-tree.md +2 -1
- package/llms/components/lr-unit-picker.md +5 -1
- package/llms/components/lr-video.md +5 -4
- package/llms/components/lr-voice-picker.md +8 -1
- package/llms/components/lr-widget.md +2 -2
- package/llms/components/lr-zoomable-frame.md +8 -0
- package/llms/index.md +145 -141
- package/llms/migration.md +20 -12
- package/llms/peers.md +2 -2
- package/llms/shared/events-and-types.md +36 -0
- package/llms/shared/imports-and-registration.md +60 -1
- package/llms/shared/native-styles-and-utilities.md +109 -3
- package/llms/shared/styles-and-tokens.md +2 -2
- package/llms/shared/testing-and-utilities.md +21 -0
- package/llms/shared.md +227 -6
- package/llms/tokens.md +6 -1
- package/llms.txt +3 -3
- package/locales.json +1 -1
- package/package.json +38 -9
- package/registrations.json +1 -1
- package/skills/compose-lyra-interfaces/SKILL.md +1 -1
- package/skills/lyra-ui/SKILL.md +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{AnnouncementSinkController}from"../../../internal/announcer.js";import{collectionSupport,publicCollectionTruncation}from"../../../internal/collection-snapshot.js";import{LyraElement}from"../../../internal/lyra-element.js";import{chevronIcon}from"../../../internal/icons.js";import{nextId,srOnly}from"../../../internal/a11y.js";import{decimalPlaces,finiteNumber}from"../../../internal/numbers.js";import{resolveGuardedRel}from"../../../internal/link-rel.js";import{safeLinkHref}from"../../../internal/safe-url.js";import{detectPlatform}from"../../../internal/platform.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{containsNestedInteractive}from"../../../internal/nested-interactive.js";import{writeOptionalSize,optionalSizeConverter}from"../../../internal/variants.js";import{styles}from"./stat.styles.js";import{bdi}from"../../../internal/bidi.js";import{blankNumberConverter}from"../../../internal/converters.js";import{LYRA_DEFAULT_statRowsInputLimit,LYRA_DEFAULT_statTrendAnnouncement,LYRA_DEFAULT_statTrendBad,LYRA_DEFAULT_statTrendDecreased,LYRA_DEFAULT_statTrendGood,LYRA_DEFAULT_statTrendIncreased,LYRA_DEFAULT_trendUnchanged}from"../../../internal/default-strings/data.generated.js";class LyraStat extends LyraElement{constructor(){super(...arguments),this.label="",this.accessibleLabel=null,this.value="",this.unit="",this.variant="neutral",this._deltaPercent=null,this.caption="",this.goodDirection="up",this._rows=[],this.emphasis=!1,this.exactValue="",this.sub="",this.prose=!1,this.frame="card",this.orientation="vertical",this.fill=!1,this.hasIcon=!1,this.hasCaptionSlot=!1,this.hasSparkSlot=!1,this.hasSubSlot=!1,this.hasActionsSlot=!1,this.labelId=nextId("stat-label"),this.valueId=`${this.labelId}-value`,this.unitId=`${this.labelId}-unit`,this.rowLabelIds=[],this.onIconSlotChange=()=>{this.hasIcon=Array.from(this.children??[]).some(el=>el.getAttribute("slot")==="start")},this.onCaptionSlotChange=()=>{this.hasCaptionSlot=Array.from(this.children??[]).some(el=>el.getAttribute("slot")==="caption")},this.onSparkSlotChange=()=>{this.hasSparkSlot=Array.from(this.children??[]).some(el=>el.getAttribute("slot")==="spark")},this.onSubSlotChange=()=>{this.hasSubSlot=Array.from(this.children??[]).some(el=>el.getAttribute("slot")==="sub")},this.onActionsSlotChange=()=>{this.hasActionsSlot=Array.from(this.children).some(el=>el.getAttribute("slot")==="actions")},this.onLinkedContentClick=event=>{if(containsNestedInteractive(event,event.currentTarget)||event.defaultPrevented)return;const anchor=this.shadowRoot?.querySelector('[part="base"][href]'),MouseEventConstructor=this.ownerDocument.defaultView?.MouseEvent;if(anchor)if(event.stopPropagation(),MouseEventConstructor&&event instanceof MouseEventConstructor){const platform=detectPlatform(this.ownerDocument.defaultView?.navigator),newContext=event.shiftKey||(platform==="mac"?event.metaKey:event.ctrlKey),previousTarget=anchor.getAttribute("target"),previousRel=anchor.getAttribute("rel"),guardedRel=resolveGuardedRel(this.rel,"_blank");newContext&&(anchor.target="_blank",anchor.rel=guardedRel);try{anchor.dispatchEvent(new MouseEventConstructor("click",{bubbles:!0,cancelable:!0,composed:!0,view:event.view,detail:event.detail,button:event.button,buttons:event.buttons,clientX:event.clientX,clientY:event.clientY,screenX:event.screenX,screenY:event.screenY,ctrlKey:event.ctrlKey,metaKey:event.metaKey,shiftKey:event.shiftKey,altKey:event.altKey}))}finally{newContext&&(anchor.getAttribute("target")==="_blank"&&(previousTarget===null?anchor.removeAttribute("target"):anchor.setAttribute("target",previousTarget)),anchor.getAttribute("rel")===guardedRel&&(previousRel===null?anchor.removeAttribute("rel"):anchor.setAttribute("rel",previousRel)))}}else anchor.click()},this.announcements=new AnnouncementSinkController(this)}static{this.defaultStrings={...super.defaultStrings,statRowsInputLimit:LYRA_DEFAULT_statRowsInputLimit,statTrendAnnouncement:LYRA_DEFAULT_statTrendAnnouncement,statTrendBad:LYRA_DEFAULT_statTrendBad,statTrendDecreased:LYRA_DEFAULT_statTrendDecreased,statTrendGood:LYRA_DEFAULT_statTrendGood,statTrendIncreased:LYRA_DEFAULT_statTrendIncreased,trendUnchanged:LYRA_DEFAULT_trendUnchanged}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["rows"])}static{this.identityCollectionProperties=Object.freeze(["rows"])}static{this.styles=[LyraElement.styles,styles,srOnly]}get deltaPercent(){return this._deltaPercent}set deltaPercent(value){const old=this._deltaPercent;this._deltaPercent=value!=null&&Number.isFinite(value)?finiteNumber(value,0):null,this.requestUpdate("deltaPercent",old)}get rows(){return this._rows}set rows(value){const previous=this._rows,snapshot=[];if(Array.isArray(value))for(const row of value)try{snapshot.push(Object.freeze({label:typeof row?.label=="string"?row.label:"",value:typeof row?.value=="string"?row.value:"",...typeof row?.exactValue=="string"?{exactValue:row.exactValue}:{}}))}catch{}this._rows=Object.freeze(snapshot),this.requestUpdate("rows",previous)}get size(){return this._size}set size(next){writeOptionalSize(this,this._size,next,value=>{this._size=value})}willUpdate(changed){if(super.willUpdate(changed),!this.hasUpdated){const lightChildren=Array.from(this.children??[]);this.hasIcon=lightChildren.some(el=>el.getAttribute("slot")==="start"),this.hasCaptionSlot=lightChildren.some(el=>el.getAttribute("slot")==="caption"),this.hasSparkSlot=lightChildren.some(el=>el.getAttribute("slot")==="spark"),this.hasSubSlot=lightChildren.some(el=>el.getAttribute("slot")==="sub"),this.hasActionsSlot=lightChildren.some(el=>el.getAttribute("slot")==="actions")}changed.has("rows")&&(this.rowLabelIds=this.rows.map(()=>nextId("stat-row-label")))}click(){const anchor=this.shadowRoot?.querySelector('[part="base"][href]');anchor?anchor.click():super.click()}inputLimitMessage(){const limit=publicCollectionTruncation(this,"rows");return limit?this.localize("statRowsInputLimit",void 0,{count:this.formatLocaleNumber(limit.retained),total:this.formatLocaleNumber(limit.source)}):""}updated(changed){super.updated(changed);const notice=this.inputLimitMessage();this.announcements.transition("input-limit",notice,notice,"polite")}render(){const notice=this.inputLimitMessage(),href=safeLinkHref(this.href),linked=!!href,exactId=this.exactValue?`${this.valueId}-exact`:void 0,hasTrend=this.deltaPercent!==null,effectiveDelta=this.deltaPercent??0,rawDirection=effectiveDelta>0?"up":effectiveDelta<0?"down":"flat",isGood=rawDirection==="flat"?null:rawDirection===this.goodDirection,arrow=rawDirection==="flat"?"–":chevronIcon(),hasCaption=this.hasCaptionSlot||(this.caption??"").length>0,hasSub=this.hasSubSlot||(this.sub??"").length>0,formattedTrend=getNumberFormat(this.effectiveLocale,{style:"percent",maximumFractionDigits:Math.min(20,decimalPlaces(effectiveDelta))}).format(Math.abs(effectiveDelta)/100),trendAnnouncement=rawDirection==="flat"?this.localize("trendUnchanged"):this.localize("statTrendAnnouncement",void 0,{trend:this.localize(rawDirection==="up"?"statTrendIncreased":"statTrendDecreased",void 0,{value:formattedTrend}),polarity:this.localize(isGood?"statTrendGood":"statTrendBad")}),content=html`
|
|
1
|
+
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{AnnouncementSinkController}from"../../../internal/announcer.js";import{collectionSupport,publicCollectionTruncation}from"../../../internal/collection-snapshot.js";import{LyraElement}from"../../../internal/lyra-element.js";import{chevronIcon}from"../../../internal/icons.js";import{nextId,srOnly}from"../../../internal/a11y.js";import{decimalPlaces,finiteNumber}from"../../../internal/numbers.js";import{resolveGuardedRel}from"../../../internal/link-rel.js";import{safeLinkHref}from"../../../internal/safe-url.js";import{detectPlatform}from"../../../internal/platform.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{containsNestedInteractive}from"../../../internal/nested-interactive.js";import{writeOptionalSize,optionalSizeConverter}from"../../../internal/variants.js";import{styles}from"./stat.styles.js";import{bdi}from"../../../internal/bidi.js";import{blankNumberConverter}from"../../../internal/converters.js";import{LYRA_DEFAULT_statRowsInputLimit,LYRA_DEFAULT_statTrendAnnouncement,LYRA_DEFAULT_statTrendBad,LYRA_DEFAULT_statTrendDecreased,LYRA_DEFAULT_statTrendGood,LYRA_DEFAULT_statTrendIncreased,LYRA_DEFAULT_trendUnchanged}from"../../../internal/default-strings/data.generated.js";class LyraStat extends LyraElement{constructor(){super(...arguments),this.label="",this.accessibleLabel=null,this.value="",this.unit="",this.variant="neutral",this._deltaPercent=null,this.caption="",this.goodDirection="up",this._rows=[],this.emphasis=!1,this.exactValue="",this.sub="",this.prose=!1,this.frame="card",this.orientation="vertical",this.fill=!1,this.truncate=!1,this.hasIcon=!1,this.hasCaptionSlot=!1,this.hasSparkSlot=!1,this.hasSubSlot=!1,this.hasActionsSlot=!1,this.labelId=nextId("stat-label"),this.valueId=`${this.labelId}-value`,this.unitId=`${this.labelId}-unit`,this.rowLabelIds=[],this.onIconSlotChange=()=>{this.hasIcon=Array.from(this.children??[]).some(el=>el.getAttribute("slot")==="start")},this.onCaptionSlotChange=()=>{this.hasCaptionSlot=Array.from(this.children??[]).some(el=>el.getAttribute("slot")==="caption")},this.onSparkSlotChange=()=>{this.hasSparkSlot=Array.from(this.children??[]).some(el=>el.getAttribute("slot")==="spark")},this.onSubSlotChange=()=>{this.hasSubSlot=Array.from(this.children??[]).some(el=>el.getAttribute("slot")==="sub")},this.onActionsSlotChange=()=>{this.hasActionsSlot=Array.from(this.children).some(el=>el.getAttribute("slot")==="actions")},this.onLinkedContentClick=event=>{if(containsNestedInteractive(event,event.currentTarget)||event.defaultPrevented)return;const anchor=this.shadowRoot?.querySelector('[part="base"][href]'),MouseEventConstructor=this.ownerDocument.defaultView?.MouseEvent;if(anchor)if(event.stopPropagation(),MouseEventConstructor&&event instanceof MouseEventConstructor){const platform=detectPlatform(this.ownerDocument.defaultView?.navigator),newContext=event.shiftKey||(platform==="mac"?event.metaKey:event.ctrlKey),previousTarget=anchor.getAttribute("target"),previousRel=anchor.getAttribute("rel"),guardedRel=resolveGuardedRel(this.rel,"_blank");newContext&&(anchor.target="_blank",anchor.rel=guardedRel);try{anchor.dispatchEvent(new MouseEventConstructor("click",{bubbles:!0,cancelable:!0,composed:!0,view:event.view,detail:event.detail,button:event.button,buttons:event.buttons,clientX:event.clientX,clientY:event.clientY,screenX:event.screenX,screenY:event.screenY,ctrlKey:event.ctrlKey,metaKey:event.metaKey,shiftKey:event.shiftKey,altKey:event.altKey}))}finally{newContext&&(anchor.getAttribute("target")==="_blank"&&(previousTarget===null?anchor.removeAttribute("target"):anchor.setAttribute("target",previousTarget)),anchor.getAttribute("rel")===guardedRel&&(previousRel===null?anchor.removeAttribute("rel"):anchor.setAttribute("rel",previousRel)))}}else anchor.click()},this.announcements=new AnnouncementSinkController(this)}static{this.defaultStrings={...super.defaultStrings,statRowsInputLimit:LYRA_DEFAULT_statRowsInputLimit,statTrendAnnouncement:LYRA_DEFAULT_statTrendAnnouncement,statTrendBad:LYRA_DEFAULT_statTrendBad,statTrendDecreased:LYRA_DEFAULT_statTrendDecreased,statTrendGood:LYRA_DEFAULT_statTrendGood,statTrendIncreased:LYRA_DEFAULT_statTrendIncreased,trendUnchanged:LYRA_DEFAULT_trendUnchanged}}static{this.collectionSupport=collectionSupport}static{this.ownedCollectionProperties=Object.freeze(["rows"])}static{this.identityCollectionProperties=Object.freeze(["rows"])}static{this.styles=[LyraElement.styles,styles,srOnly]}get deltaPercent(){return this._deltaPercent}set deltaPercent(value){const old=this._deltaPercent;this._deltaPercent=value!=null&&Number.isFinite(value)?finiteNumber(value,0):null,this.requestUpdate("deltaPercent",old)}get rows(){return this._rows}set rows(value){const previous=this._rows,snapshot=[];if(Array.isArray(value))for(const row of value)try{snapshot.push(Object.freeze({label:typeof row?.label=="string"?row.label:"",value:typeof row?.value=="string"?row.value:"",...typeof row?.exactValue=="string"?{exactValue:row.exactValue}:{}}))}catch{}this._rows=Object.freeze(snapshot),this.requestUpdate("rows",previous)}get size(){return this._size}set size(next){writeOptionalSize(this,this._size,next,value=>{this._size=value})}willUpdate(changed){if(super.willUpdate(changed),!this.hasUpdated){const lightChildren=Array.from(this.children??[]);this.hasIcon=lightChildren.some(el=>el.getAttribute("slot")==="start"),this.hasCaptionSlot=lightChildren.some(el=>el.getAttribute("slot")==="caption"),this.hasSparkSlot=lightChildren.some(el=>el.getAttribute("slot")==="spark"),this.hasSubSlot=lightChildren.some(el=>el.getAttribute("slot")==="sub"),this.hasActionsSlot=lightChildren.some(el=>el.getAttribute("slot")==="actions")}changed.has("rows")&&(this.rowLabelIds=this.rows.map(()=>nextId("stat-row-label")))}click(){const anchor=this.shadowRoot?.querySelector('[part="base"][href]');anchor?anchor.click():super.click()}inputLimitMessage(){const limit=publicCollectionTruncation(this,"rows");return limit?this.localize("statRowsInputLimit",void 0,{count:this.formatLocaleNumber(limit.retained),total:this.formatLocaleNumber(limit.source)}):""}updated(changed){super.updated(changed);const notice=this.inputLimitMessage();this.announcements.transition("input-limit",notice,notice,"polite")}render(){const notice=this.inputLimitMessage(),href=safeLinkHref(this.href),linked=!!href,exactId=this.exactValue?`${this.valueId}-exact`:void 0,hasTrend=this.deltaPercent!==null,effectiveDelta=this.deltaPercent??0,rawDirection=effectiveDelta>0?"up":effectiveDelta<0?"down":"flat",isGood=rawDirection==="flat"?null:rawDirection===this.goodDirection,arrow=rawDirection==="flat"?"–":chevronIcon(),hasCaption=this.hasCaptionSlot||(this.caption??"").length>0,hasSub=this.hasSubSlot||(this.sub??"").length>0,formattedTrend=getNumberFormat(this.effectiveLocale,{style:"percent",maximumFractionDigits:Math.min(20,decimalPlaces(effectiveDelta))}).format(Math.abs(effectiveDelta)/100),trendAnnouncement=rawDirection==="flat"?this.localize("trendUnchanged"):this.localize("statTrendAnnouncement",void 0,{trend:this.localize(rawDirection==="up"?"statTrendIncreased":"statTrendDecreased",void 0,{value:formattedTrend}),polarity:this.localize(isGood?"statTrendGood":"statTrendBad")}),content=html`
|
|
2
2
|
<span part="icon" ?hidden=${!this.hasIcon} ><slot name="start" @slotchange=${this.onIconSlotChange}></slot
|
|
3
3
|
></span
|
|
4
4
|
>
|
|
@@ -41,4 +41,4 @@ import{__decorate}from"tslib";import{html,nothing}from"lit";import{property,stat
|
|
|
41
41
|
<a part="base" href=${href} target=${this.target||nothing} rel=${resolveGuardedRel(this.rel,this.target)??nothing} aria-label=${this.accessibleLabel??nothing} aria-describedby=${exactId??nothing} ><span class="sr-only">${[this.label,this.value,this.unit].filter(Boolean).join(" ")}</span></a
|
|
42
42
|
>
|
|
43
43
|
<div class="linked-content" @click=${this.onLinkedContentClick}>${content}</div>
|
|
44
|
-
</div>`:html`<div part="base">${content}</div>`}}__decorate([property()],LyraStat.prototype,"label",void 0),__decorate([property({attribute:"aria-label"})],LyraStat.prototype,"accessibleLabel",void 0),__decorate([property()],LyraStat.prototype,"value",void 0),__decorate([property()],LyraStat.prototype,"unit",void 0),__decorate([property({reflect:!0})],LyraStat.prototype,"variant",void 0),__decorate([property()],LyraStat.prototype,"href",void 0),__decorate([property()],LyraStat.prototype,"target",void 0),__decorate([property()],LyraStat.prototype,"rel",void 0),__decorate([property({converter:blankNumberConverter(null),attribute:"delta-percent"})],LyraStat.prototype,"deltaPercent",null),__decorate([property()],LyraStat.prototype,"caption",void 0),__decorate([property({attribute:"good-direction"})],LyraStat.prototype,"goodDirection",void 0),__decorate([property({attribute:!1})],LyraStat.prototype,"rows",null),__decorate([property({type:Boolean,reflect:!0})],LyraStat.prototype,"emphasis",void 0),__decorate([property({attribute:"exact-value"})],LyraStat.prototype,"exactValue",void 0),__decorate([property()],LyraStat.prototype,"sub",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraStat.prototype,"prose",void 0),__decorate([property({reflect:!0,converter:optionalSizeConverter})],LyraStat.prototype,"size",null),__decorate([property({reflect:!0})],LyraStat.prototype,"frame",void 0),__decorate([property({reflect:!0})],LyraStat.prototype,"orientation",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraStat.prototype,"fill",void 0),__decorate([state()],LyraStat.prototype,"hasIcon",void 0),__decorate([state()],LyraStat.prototype,"hasCaptionSlot",void 0),__decorate([state()],LyraStat.prototype,"hasSparkSlot",void 0),__decorate([state()],LyraStat.prototype,"hasSubSlot",void 0),__decorate([state()],LyraStat.prototype,"hasActionsSlot",void 0),__decorate([state()],LyraStat.prototype,"rowLabelIds",void 0);export{LyraStat};
|
|
44
|
+
</div>`:html`<div part="base">${content}</div>`}}__decorate([property()],LyraStat.prototype,"label",void 0),__decorate([property({attribute:"aria-label"})],LyraStat.prototype,"accessibleLabel",void 0),__decorate([property()],LyraStat.prototype,"value",void 0),__decorate([property()],LyraStat.prototype,"unit",void 0),__decorate([property({reflect:!0})],LyraStat.prototype,"variant",void 0),__decorate([property()],LyraStat.prototype,"href",void 0),__decorate([property()],LyraStat.prototype,"target",void 0),__decorate([property()],LyraStat.prototype,"rel",void 0),__decorate([property({converter:blankNumberConverter(null),attribute:"delta-percent"})],LyraStat.prototype,"deltaPercent",null),__decorate([property()],LyraStat.prototype,"caption",void 0),__decorate([property({attribute:"good-direction"})],LyraStat.prototype,"goodDirection",void 0),__decorate([property({attribute:!1})],LyraStat.prototype,"rows",null),__decorate([property({type:Boolean,reflect:!0})],LyraStat.prototype,"emphasis",void 0),__decorate([property({attribute:"exact-value"})],LyraStat.prototype,"exactValue",void 0),__decorate([property()],LyraStat.prototype,"sub",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraStat.prototype,"prose",void 0),__decorate([property({reflect:!0,converter:optionalSizeConverter})],LyraStat.prototype,"size",null),__decorate([property({reflect:!0})],LyraStat.prototype,"frame",void 0),__decorate([property({reflect:!0})],LyraStat.prototype,"orientation",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraStat.prototype,"fill",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraStat.prototype,"truncate",void 0),__decorate([state()],LyraStat.prototype,"hasIcon",void 0),__decorate([state()],LyraStat.prototype,"hasCaptionSlot",void 0),__decorate([state()],LyraStat.prototype,"hasSparkSlot",void 0),__decorate([state()],LyraStat.prototype,"hasSubSlot",void 0),__decorate([state()],LyraStat.prototype,"hasActionsSlot",void 0),__decorate([state()],LyraStat.prototype,"rowLabelIds",void 0);export{LyraStat};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{activeFill,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` [part=limit]{color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-xs);overflow-wrap:anywhere}:host{display:block}[part=base]{display:flex;min-inline-size:0;max-inline-size:100%;flex-direction:column;gap:var(--lr-stat-gap,var(--lr-space-xs));padding:var(--lr-stat-padding,var(--lr-space-m));border:var(--lr-border-width-thin) solid var(--_lr-stat-edge,var(--lr-color-border-subtle));border-radius:var(--lr-radius);background:var(--lr-stat-bg,var(--lr-color-surface));block-size:100%;box-sizing:border-box;color:inherit;text-decoration:none}.linked-shell{position:relative;min-inline-size:0;max-inline-size:100%;block-size:100%}.linked-shell>[part=base]{position:absolute;inset:0;z-index:var(--lr-layer-base)}.linked-content{position:relative;z-index:var(--lr-layer-content);display:flex;min-inline-size:0;max-inline-size:100%;flex-direction:column;gap:var(--lr-stat-gap,var(--lr-space-xs));padding:var(--lr-stat-padding,var(--lr-space-m));block-size:100%;box-sizing:border-box;pointer-events:none}.linked-content slot,.linked-content [title]{pointer-events:auto}[part=base][href]{--_lr-stat-edge:var(--lr-color-border);cursor:pointer;transition:border-color var(--lr-transition-fast),box-shadow var(--lr-transition-fast)}:where([part=base][href]):hover,:where(.linked-shell):hover>:where([part=base]){border-color:var(--lr-stat-link-hover-border-color,var(--lr-color-brand));box-shadow:var(--lr-stat-link-hover-shadow,var(--lr-shadow-s))}:where([part=base][href]):active{border-color:var(--lr-stat-link-active-border-color,var(--lr-stat-link-hover-border-color,var(--lr-color-brand)));box-shadow:var(--lr-stat-link-active-shadow,var(--lr-stat-link-hover-shadow,var(--lr-shadow-s)));background:var(--lr-stat-link-active-bg,${activeFill("var(--lr-stat-bg, var(--lr-color-surface))")})}[part=base][href]:focus-visible{${focusRing}}[part=icon]{align-self:flex-start;font-size:var(--lr-stat-icon-size,inherit);padding:var(--lr-stat-icon-padding,0);border-radius:var(--lr-stat-icon-radius,0);background:var(--lr-stat-icon-bg,transparent);color:var(--lr-stat-icon-color,var(--lr-color-text-quiet))}[part=icon][hidden]{display:none}[part=label]{min-inline-size:0;overflow-wrap:anywhere;font-size:var(--lr-stat-label-font-size,var(--lr-font-size-xs));font-weight:var(--lr-stat-label-font-weight,var(--lr-font-weight-semibold));text-transform:var(--lr-stat-label-text-transform,uppercase);letter-spacing:var(--lr-stat-label-letter-spacing,var(--lr-size-0-04em));color:var(--lr-stat-label-color,var(--lr-color-text-quiet))}[part=label][hidden]{display:none}.label-row{display:contents}.label-row[data-actions]{display:flex;align-items:flex-start;gap:var(--lr-space-xs);min-inline-size:0}.label-row[data-actions] [part=label]{flex:1 1 auto}[part=actions]{display:inline-flex;flex:none;align-items:center;gap:var(--lr-space-2xs);margin-inline-start:auto}[part=actions][hidden]{display:none}[part=value-row]{display:flex;flex-wrap:wrap;min-inline-size:0;align-items:baseline;gap:var(--lr-space-xs)}[part=value],[part=row-value]{unicode-bidi:plaintext}[part=value]{min-inline-size:0;max-inline-size:100%;overflow-wrap:anywhere;font-size:var(--lr-stat-value-font-size,var(--lr-font-size-2xl));font-weight:var(--lr-stat-value-font-weight,var(--lr-font-weight-bold));font-family:var(--lr-stat-value-font-family,inherit);font-variant-numeric:tabular-nums}[part=value]:focus-visible,[part=row-value]:focus-visible{${focusRing}}:where([part=value][tabindex]):hover,:where([part=row-value][tabindex]):hover{color:var(--lr-stat-value-hover-color,var(--lr-color-brand));cursor:help}.exact-reveal{display:none}[part=value]:focus-visible~.exact-reveal,[part=row-value]:focus-visible~.exact-reveal,.linked-shell>[part=base]:focus-visible + .linked-content [part=value-row]>.exact-reveal{display:block;flex-basis:100%;min-inline-size:0;overflow-wrap:anywhere;font-family:var(--lr-stat-value-font-family,inherit);font-variant-numeric:tabular-nums;font-size:var(--lr-font-size-sm);color:var(--lr-color-text-quiet)}[part=unit]{min-inline-size:0;max-inline-size:100%;overflow-wrap:anywhere;font-size:var(--lr-stat-unit-font-size,var(--lr-font-size-md-sm));color:var(--lr-stat-unit-color,var(--lr-color-text-quiet))}[part=trend]{display:inline-flex;align-items:center;gap:var(--lr-space-xs);font-size:var(--lr-font-size-sm);font-weight:var(--lr-font-weight-semibold);border-radius:var(--lr-radius);padding:var(--lr-size-0-05rem) var(--lr-size-0-4rem);align-self:flex-start}[part=trend][data-direction=up] svg{transform:rotate(-90deg)}[part=trend][data-direction=down] svg{transform:rotate(90deg)}[part=trend][data-polarity=good]{color:var(--lr-stat-trend-good-color,var(--lr-color-success));background:var(--lr-stat-trend-good-bg,color-mix(in srgb,var(--lr-color-success) 8%,transparent))}[part=trend][data-polarity=bad]{color:var(--lr-stat-trend-bad-color,var(--lr-color-danger));background:var(--lr-stat-trend-bad-bg,color-mix(in srgb,var(--lr-color-danger) 8%,transparent))}:host([variant=brand]) [part=value]{color:var(--lr-stat-value-brand-color,var(--lr-color-brand))}:host([variant=success]) [part=value]{color:var(--lr-stat-value-success-color,var(--lr-color-success))}:host([variant=warning]) [part=value]{color:var(--lr-stat-value-warning-color,var(--lr-color-warning))}:host([variant=danger]) [part=value]{color:var(--lr-stat-value-danger-color,var(--lr-color-danger))}[part=spark]{display:block}[part=spark][hidden]{display:none}[part=sub]{min-inline-size:0;overflow-wrap:anywhere;font-size:var(--lr-font-size-sm);font-weight:var(--lr-font-weight-semibold)}[part=sub][hidden]{display:none}[part=caption]{min-inline-size:0;overflow-wrap:anywhere;font-size:var(--lr-stat-caption-font-size,var(--lr-font-size-sm));color:var(--lr-stat-caption-color,var(--lr-color-text-quiet))}[part=caption][hidden]{display:none}[part=rows]{display:flex;min-inline-size:0;flex-direction:column;gap:var(--lr-size-0-125rem)}[part=rows][hidden]{display:none}[part=row]{display:flex;flex-wrap:wrap;min-inline-size:0;align-items:baseline;justify-content:space-between;gap:var(--lr-space-xs);font-size:var(--lr-font-size-sm)}[part=row-label]{min-inline-size:0;overflow-wrap:anywhere;color:var(--lr-color-text-quiet)}[part=row-value]{min-inline-size:0;max-inline-size:100%;overflow-wrap:anywhere;font-family:var(--lr-stat-value-font-family,inherit);font-variant-numeric:tabular-nums;font-weight:var(--lr-font-weight-semibold)}:host([emphasis]) [part=base]{border-inline-start:var(--lr-border-width-thick) solid var(--lr-stat-emphasis-border-color,var(--lr-color-brand))}:host([emphasis][variant=neutral]) [part=value]{color:var(--lr-stat-emphasis-value-color,var(--lr-color-brand))}:host([prose]) [part=value]{font-size:var(--lr-size-0-9375rem);font-weight:var(--lr-font-weight-normal);font-family:inherit;color:var(--lr-color-text-quiet)}:host([prose]) [part=unit]{display:none}:host([size='2xs']) [part=base],:host([size=xs]) [part=base],:host([size=s]) [part=base],:host([size=small]) [part=base]{padding:var(--lr-stat-padding,var(--lr-space-s));gap:var(--lr-stat-gap,var(--lr-size-0-125rem))}:host([size='2xs']) .linked-content,:host([size=xs]) .linked-content,:host([size=s]) .linked-content,:host([size=small]) .linked-content{padding:var(--lr-stat-padding,var(--lr-space-s));gap:var(--lr-stat-gap,var(--lr-size-0-125rem))}:host([frame=plain]) [part=base]{padding:var(--lr-stat-padding,0);border:0;border-radius:0;background:transparent;block-size:auto}:host([frame=plain]) .linked-shell,:host([frame=plain]) .linked-content{block-size:auto}:host([frame=plain]) .linked-content{padding:var(--lr-stat-padding,0)}:host([frame=plain]) [part=base][href]:hover,:host([frame=plain]) .linked-shell:hover>[part=base]{box-shadow:none}:host([frame=plain]) [part=base][href]:active{box-shadow:none;background:transparent}:host([frame=plain]) .linked-shell:hover .linked-content [part=value],:host([frame=plain]) [part=base][href]:focus-visible + .linked-content [part=value]{text-decoration:underline}:host([frame=plain]) [part=base][href]:active + .linked-content [part=value]{text-decoration:underline;text-decoration-thickness:var(--lr-border-width-medium)}:host([fill]){block-size:100%}:host([fill]) [part=base],:host([fill]) .linked-shell,:host([fill]) .linked-content{block-size:100%}:host([fill]:not([orientation=horizontal])) [part=caption]{margin-block-start:auto}:host([orientation=horizontal]) [part=base]{flex-direction:row;flex-wrap:wrap;align-items:baseline;column-gap:var(--lr-space-s)}:host([orientation=horizontal]) .linked-content{flex-direction:row;flex-wrap:wrap;align-items:baseline;column-gap:var(--lr-space-s)}:host([orientation=horizontal]) [part=trend],:host([orientation=horizontal]) [part=icon]{align-self:baseline}:host([orientation=horizontal]) [part=spark],:host([orientation=horizontal]) [part=rows]{flex-basis:100%}@media (prefers-reduced-motion:reduce){[part=base][href]{transition:none}}`;export{styles};
|
|
1
|
+
import{activeFill,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` [part=limit]{color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-xs);overflow-wrap:anywhere}:host{display:block}[part=base]{display:flex;min-inline-size:0;max-inline-size:100%;flex-direction:column;gap:var(--lr-stat-gap,var(--lr-space-xs));padding:var(--lr-stat-padding,var(--lr-space-m));border:var(--lr-border-width-thin) solid var(--_lr-stat-edge,var(--lr-stat-border-color,var(--lr-color-border-subtle)));border-radius:var(--lr-stat-radius,var(--lr-radius));background:var(--lr-stat-bg,var(--lr-color-surface));block-size:100%;box-sizing:border-box;color:inherit;text-decoration:none}.linked-shell{position:relative;min-inline-size:0;max-inline-size:100%;block-size:100%}[part=base],.linked-content{align-items:var(--lr-stat-align,normal);text-align:var(--lr-stat-align,inherit)}.linked-shell>[part=base]{position:absolute;inset:0;z-index:var(--lr-layer-base)}.linked-content{position:relative;z-index:var(--lr-layer-content);display:flex;min-inline-size:0;max-inline-size:100%;flex-direction:column;gap:var(--lr-stat-gap,var(--lr-space-xs));padding:var(--lr-stat-padding,var(--lr-space-m));block-size:100%;box-sizing:border-box;pointer-events:none}.linked-content slot,.linked-content [title]{pointer-events:auto}[part=base][href]{--_lr-stat-edge:var(--lr-stat-border-color, var(--lr-color-border));cursor:pointer;transition:border-color var(--lr-transition-fast),box-shadow var(--lr-transition-fast)}:where([part=base][href]):hover,:where(.linked-shell):hover>:where([part=base]){border-color:var(--lr-stat-link-hover-border-color,var(--lr-color-brand));box-shadow:var(--lr-stat-link-hover-shadow,var(--lr-shadow-s))}:where([part=base][href]):active{border-color:var(--lr-stat-link-active-border-color,var(--lr-stat-link-hover-border-color,var(--lr-color-brand)));box-shadow:var(--lr-stat-link-active-shadow,var(--lr-stat-link-hover-shadow,var(--lr-shadow-s)));background:var(--lr-stat-link-active-bg,${activeFill("var(--lr-stat-bg, var(--lr-color-surface))")})}[part=base][href]:focus-visible{${focusRing}}[part=icon]{align-self:var(--lr-stat-align,flex-start);font-size:var(--lr-stat-icon-size,inherit);inline-size:var(--lr-stat-icon-box-size,auto);block-size:var(--lr-stat-icon-box-size,auto);box-sizing:border-box;align-content:center;text-align:center;padding:var(--lr-stat-icon-padding,0);border-radius:var(--lr-stat-icon-radius,0);background:var(--lr-stat-icon-bg,transparent);color:var(--lr-stat-icon-color,var(--lr-color-text-quiet))}[part=icon][hidden]{display:none}[part=label]{min-inline-size:0;overflow-wrap:anywhere;font-size:var(--lr-stat-label-font-size,var(--lr-font-size-xs));font-weight:var(--lr-stat-label-font-weight,var(--lr-font-weight-semibold));text-transform:var(--lr-stat-label-text-transform,uppercase);letter-spacing:var(--lr-stat-label-letter-spacing,var(--lr-size-0-04em));line-height:var(--lr-stat-label-line-height,inherit);color:var(--lr-stat-label-color,var(--lr-color-text-quiet))}[part=label][hidden]{display:none}.label-row{display:contents}.label-row[data-actions]{display:flex;align-items:flex-start;gap:var(--lr-space-xs);min-inline-size:0}.label-row[data-actions] [part=label]{flex:1 1 auto}[part=actions]{display:inline-flex;flex:none;align-items:center;gap:var(--lr-space-2xs);margin-inline-start:auto}[part=actions][hidden]{display:none}[part=value-row]{display:flex;flex-wrap:wrap;min-inline-size:0;align-items:var(--lr-stat-value-row-align,baseline);justify-content:var(--lr-stat-align,normal);gap:var(--lr-space-xs)}[part=value],[part=row-value]{unicode-bidi:plaintext}[part=value]{min-inline-size:0;max-inline-size:100%;overflow-wrap:anywhere;font-size:var(--lr-stat-value-font-size,var(--lr-font-size-2xl));font-weight:var(--lr-stat-value-font-weight,var(--lr-font-weight-bold));font-family:var(--lr-stat-value-font-family,inherit);font-variant-numeric:tabular-nums;letter-spacing:var(--lr-stat-value-letter-spacing,normal);line-height:var(--lr-stat-value-line-height,inherit);margin:var(--lr-stat-value-margin,0);color:var(--lr-stat-value-color,inherit)}:host([truncate]) [part=value]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[part=value]:focus-visible,[part=row-value]:focus-visible{${focusRing}}:where([part=value][tabindex]):hover,:where([part=row-value][tabindex]):hover{color:var(--lr-stat-value-hover-color,var(--lr-color-brand));cursor:help}.exact-reveal{display:none}[part=value]:focus-visible~.exact-reveal,[part=row-value]:focus-visible~.exact-reveal,.linked-shell>[part=base]:focus-visible + .linked-content [part=value-row]>.exact-reveal{display:block;flex-basis:100%;min-inline-size:0;overflow-wrap:anywhere;font-family:var(--lr-stat-value-font-family,inherit);font-variant-numeric:tabular-nums;font-size:var(--lr-font-size-sm);color:var(--lr-color-text-quiet)}[part=unit]{min-inline-size:0;max-inline-size:100%;overflow-wrap:anywhere;font-size:var(--lr-stat-unit-font-size,var(--lr-font-size-md-sm));color:var(--lr-stat-unit-color,var(--lr-color-text-quiet))}[part=trend]{display:inline-flex;align-items:center;gap:var(--lr-space-xs);font-size:var(--lr-font-size-sm);font-weight:var(--lr-font-weight-semibold);border-radius:var(--lr-radius);padding:var(--lr-size-0-05rem) var(--lr-size-0-4rem);align-self:var(--lr-stat-align,flex-start)}[part=trend][data-direction=up] svg{transform:rotate(-90deg)}[part=trend][data-direction=down] svg{transform:rotate(90deg)}[part=trend][data-polarity=good]{color:var(--lr-stat-trend-good-color,var(--lr-color-success));background:var(--lr-stat-trend-good-bg,color-mix(in srgb,var(--lr-color-success) 8%,transparent))}[part=trend][data-polarity=bad]{color:var(--lr-stat-trend-bad-color,var(--lr-color-danger));background:var(--lr-stat-trend-bad-bg,color-mix(in srgb,var(--lr-color-danger) 8%,transparent))}:host([variant=brand]) [part=value]{color:var(--lr-stat-value-brand-color,var(--lr-color-brand))}:host([variant=success]) [part=value]{color:var(--lr-stat-value-success-color,var(--lr-color-success))}:host([variant=warning]) [part=value]{color:var(--lr-stat-value-warning-color,var(--lr-color-warning))}:host([variant=danger]) [part=value]{color:var(--lr-stat-value-danger-color,var(--lr-color-danger))}[part=spark]{display:block}[part=spark][hidden]{display:none}[part=sub]{min-inline-size:0;overflow-wrap:anywhere;font-size:var(--lr-font-size-sm);font-weight:var(--lr-font-weight-semibold)}[part=sub][hidden]{display:none}[part=caption]{min-inline-size:0;overflow-wrap:anywhere;font-size:var(--lr-stat-caption-font-size,var(--lr-font-size-sm));color:var(--lr-stat-caption-color,var(--lr-color-text-quiet))}[part=caption][hidden]{display:none}[part=rows]{display:flex;min-inline-size:0;flex-direction:column;gap:var(--lr-stat-rows-gap,var(--lr-size-0-125rem))}[part=rows][hidden]{display:none}[part=row]{display:flex;flex-wrap:wrap;min-inline-size:0;align-items:baseline;justify-content:space-between;gap:var(--lr-space-xs);font-size:var(--lr-font-size-sm)}[part=row-label]{min-inline-size:0;overflow-wrap:anywhere;color:var(--lr-color-text-quiet)}[part=row-value]{min-inline-size:0;max-inline-size:100%;overflow-wrap:anywhere;font-family:var(--lr-stat-value-font-family,inherit);font-variant-numeric:tabular-nums;font-weight:var(--lr-font-weight-semibold)}:host([emphasis]) [part=base]{border-inline-start:var(--lr-border-width-thick) solid var(--lr-stat-emphasis-border-color,var(--lr-color-brand))}:host([emphasis][variant=neutral]) [part=value]{color:var(--lr-stat-emphasis-value-color,var(--lr-color-brand))}:host([prose]) [part=value]{font-size:var(--lr-size-0-9375rem);font-weight:var(--lr-font-weight-normal);font-family:inherit;color:var(--lr-color-text-quiet)}:host([prose]) [part=unit]{display:none}:host([size='2xs']) [part=base],:host([size=xs]) [part=base],:host([size=s]) [part=base],:host([size=small]) [part=base]{padding:var(--lr-stat-padding,var(--lr-space-s));gap:var(--lr-stat-gap,var(--lr-size-0-125rem))}:host([size='2xs']) .linked-content,:host([size=xs]) .linked-content,:host([size=s]) .linked-content,:host([size=small]) .linked-content{padding:var(--lr-stat-padding,var(--lr-space-s));gap:var(--lr-stat-gap,var(--lr-size-0-125rem))}:host([frame=plain]) [part=base]{padding:var(--lr-stat-padding,0);border:0;border-radius:0;background:transparent;block-size:auto}:host([frame=plain]) .linked-shell,:host([frame=plain]) .linked-content{block-size:auto}:host([frame=plain]) .linked-content{padding:var(--lr-stat-padding,0)}:host([frame=plain]) [part=base][href]:hover,:host([frame=plain]) .linked-shell:hover>[part=base]{box-shadow:none}:host([frame=plain]) [part=base][href]:active{box-shadow:none;background:transparent}:host([frame=plain]) .linked-shell:hover .linked-content [part=value],:host([frame=plain]) [part=base][href]:focus-visible + .linked-content [part=value]{text-decoration:underline}:host([frame=plain]) [part=base][href]:active + .linked-content [part=value]{text-decoration:underline;text-decoration-thickness:var(--lr-border-width-medium)}:host([fill]){block-size:100%}:host([fill]) [part=base],:host([fill]) .linked-shell,:host([fill]) .linked-content{block-size:100%}:host([fill]:not([orientation=horizontal])) [part=caption]{margin-block-start:auto}:host([orientation=horizontal]) [part=base]{flex-direction:row;flex-wrap:wrap;align-items:baseline;column-gap:var(--lr-space-s)}:host([orientation=horizontal]) .linked-content{flex-direction:row;flex-wrap:wrap;align-items:baseline;column-gap:var(--lr-space-s)}:host([orientation=horizontal]) [part=trend],:host([orientation=horizontal]) [part=icon]{align-self:baseline}:host([orientation=horizontal]) [part=spark],:host([orientation=horizontal]) [part=rows]{flex-basis:100%}@media (prefers-reduced-motion:reduce){[part=base][href]{transition:none}}`;export{styles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{noChange}from"lit";import{Directive,directive,PartType}from"lit/directive.js";class RowAttributesDirective extends Directive{constructor(part){if(super(part),this.applied=new Set,part.type!==PartType.ELEMENT)throw new Error("rowAttributes() belongs on an element")}render(_attributes){return noChange}update(part,[attributes]){const element=part.element;for(const name of this.applied)attributes?.has(name)||element.removeAttribute(name);const applied=new Set;for(const[name,value]of attributes??[])element.getAttribute(name)!==value&&element.setAttribute(name,value),applied.add(name);return this.applied=applied,noChange}}const rowAttributes=directive(RowAttributesDirective);export{rowAttributes};
|
|
@@ -16,7 +16,34 @@ export declare const MAX_SKELETON_ROWS=20;
|
|
|
16
16
|
export declare const MAX_PAGE_SIZE=500;export declare const MAX_TABLE_COLLECTION_ENTRIES=10000;export declare const MAX_TABLE_ROWS=100000;export declare const TABLE_SCROLL_OVERFLOW_TOLERANCE_PX=1;export declare const DEFAULT_RESIZE_MIN_WIDTH_PX=48;
|
|
17
17
|
/** An omitted ARIA maximum defaults to 100 for `role="separator"`. Represent an author-unbounded
|
|
18
18
|
* CSS maximum with the largest exact finite integer so wider pixel values stay truthful. */
|
|
19
|
-
export declare const MISSING_CELL_RENDERER_WARNING="lyra-table-missing-cell-renderer";export declare const MISSING_ACCESSIBLE_NAME_WARNING="lyra-table-missing-accessible-name";export declare const INERT_PRIORITY_COLUMN_CONFIG_WARNING="lyra-table-inert-priority-column-config";
|
|
19
|
+
export declare const MISSING_CELL_RENDERER_WARNING="lyra-table-missing-cell-renderer";export declare const MISSING_ACCESSIBLE_NAME_WARNING="lyra-table-missing-accessible-name";export declare const INERT_PRIORITY_COLUMN_CONFIG_WARNING="lyra-table-inert-priority-column-config";
|
|
20
|
+
/** Prefix of the per-name `cellPart` collision diagnostic key (`<prefix>:<part name>`).*/
|
|
21
|
+
export declare const RESERVED_CELL_PART_WARNING="lyra-table-reserved-cell-part";export declare const REJECTED_ROW_ATTRIBUTE_WARNING="lyra-table-rejected-row-attribute";
|
|
22
|
+
/** Column header cells. Scoped by `scope="col"` so a `rowHeader` column's body `<th scope="row">`
|
|
23
|
+
* never reads as a header-strip cell (sorting, resizing, header roving focus, measurement). */
|
|
24
|
+
export declare const HEADER_CELL_SELECTOR="th[scope=\"col\"][data-col-key]";
|
|
25
|
+
/** Body cells, including a `rowHeader` column's `<th scope="row">`.*/
|
|
26
|
+
export declare const BODY_CELL_SELECTOR=":is(td, th[scope=\"row\"])[data-col-key]";
|
|
27
|
+
/** Every CSS part name `<lr-table>` renders or forwards, so a `cellPart(row)` result can be checked
|
|
28
|
+
* against them: a consumer name equal to one of these is styled by every
|
|
29
|
+
* `lr-table::part(<name>)` rule the table's own part already receives, and vice versa. */
|
|
30
|
+
export declare const TABLE_PART_NAMES:readonly string[];
|
|
31
|
+
/** The names in a normalized `cellPart` result (see `cellContentPartNames`) that collide with one
|
|
32
|
+
* of the table's own parts. */
|
|
33
|
+
export declare function reservedCellPartNames(names:string):string[];
|
|
34
|
+
/** One `rowAttributes(row, index)` value: a string or finite number is written as text, `true`
|
|
35
|
+
* writes an empty (present) attribute, and `false`/`null`/`undefined` leave it absent. */
|
|
36
|
+
export type TableRowAttributeValue=string|number|boolean|null|undefined;
|
|
37
|
+
/** What `rowAttributes(row, index)` returns: attribute name to value, for one body row.*/
|
|
38
|
+
export type TableRowAttributes=Readonly<Record<string,TableRowAttributeValue>>;
|
|
39
|
+
/** Whether `name` is an attribute `rowAttributes` may set: a lowercase `data-*` name outside the
|
|
40
|
+
* table's own row markers and the library's `data-lr-*` namespace, or one of
|
|
41
|
+
* `TABLE_ROW_ARIA_ATTRIBUTES`. Event handlers (`on*`), `style`, `class`, `id`, `role`, `tabindex`
|
|
42
|
+
* and every other attribute are refused. */
|
|
43
|
+
export declare function isAllowedRowAttribute(name:string):boolean;
|
|
44
|
+
/** Normalizes one `rowAttributes` result to the attributes to write. A non-object result, a
|
|
45
|
+
* throwing getter or a refused name or value is skipped; `rejected` reports whether anything was. */
|
|
46
|
+
export declare function normalizeRowAttributes(value:unknown):{attributes:Map<string,string>;rejected:boolean;};export declare function frozenArray<Value>(values:Iterable<Value>,limit?:number):readonly Value[];export declare function keySet(values:Iterable<string|number>,limit?:number):Set<string|number>;export declare function storedKeySetFacade(values:ReadonlySet<string|number>):ReadonlySet<string|number>;export interface OwnedAnimationFrame{owner:Window;handle:number;}export interface TableResizeState{key:string;pointerId:number;startX:number;startWidth:number;minWidth:number;maxWidth:number;handle:HTMLElement;
|
|
20
47
|
/** Width stored before this drag, restored if the live preview is canceled or vetoed.*/
|
|
21
48
|
previousWidth:number|undefined;}export interface TableRovingFocusSnapshot{kind:'header'|'row';key:string;index:number;targetKey:string|null;element:HTMLElement;}export interface TableRowEntry<T>{row:T;index:number;key:string|number;token:string;search?:{locale:string;text:string;};}export declare const isCompactEmptySize:(size:LyraSize)=>boolean;
|
|
22
49
|
/** Which inline-start/inline-end edge a column aligns or sticks to.*/
|
|
@@ -59,7 +86,15 @@ export type TableSortIndicators='active'|'all';
|
|
|
59
86
|
export type TableScrollMode='self'|'page'|'auto';export declare const TABLE_LAYOUT:import("../../../internal/converters.js").LiteralSetConverter<"auto"|"fixed">;
|
|
60
87
|
/** `never` keeps the grid, `always` stacks every row as a card, `auto` stacks below the
|
|
61
88
|
* `--lr-table-stack-breakpoint` allocation. */
|
|
62
|
-
export type TableStackMode='never'|'auto'|'always';export declare const TABLE_STACK:import("../../../internal/converters.js").LiteralSetConverter<TableStackMode>;
|
|
89
|
+
export type TableStackMode='never'|'auto'|'always';export declare const TABLE_STACK:import("../../../internal/converters.js").LiteralSetConverter<TableStackMode>;
|
|
90
|
+
/** What the column header strip shows while rows are stacked: `visible` keeps every header (the
|
|
91
|
+
* default), `sortable` keeps only the sortable headers as a compact sort strip, `hidden` keeps none.
|
|
92
|
+
* A header left out of the strip stays in the accessibility tree and is shown while it has focus. */
|
|
93
|
+
export type TableStackHeader='visible'|'sortable'|'hidden';export declare const TABLE_STACK_HEADER:import("../../../internal/converters.js").LiteralSetConverter<TableStackHeader>;export declare const TABLE_PAGINATION_FORMAT:import("../../../internal/converters.js").LiteralSetConverter<LyraPaginationFormat>;
|
|
94
|
+
/** `columns[].wrap` values, named after the CSS `flex-wrap` keywords `--lr-table-filter-wrap` uses.*/
|
|
95
|
+
export type TableColumnWrap='wrap'|'nowrap';
|
|
96
|
+
/** Fails closed for untyped values outside the `columns[].wrap` vocabulary.*/
|
|
97
|
+
export declare function columnWrap(wrap:unknown):TableColumnWrap|undefined;
|
|
63
98
|
/** Canonical table sort direction.*/
|
|
64
99
|
export type TableSortDirection='asc'|'desc';
|
|
65
100
|
/** Cancelable sort proposal detail.*/
|
|
@@ -94,6 +129,20 @@ maxWidth?:string;
|
|
|
94
129
|
* width internally and emits non-cancelable `lr-column-resize` notifications. The final
|
|
95
130
|
* drag-end or keyboard proposal can be vetoed with `lr-column-resize-request`. */
|
|
96
131
|
resizable?:boolean;sortable?:boolean;
|
|
132
|
+
/** Renders this column's body cells as row headers -- `<th scope="row" role="rowheader">` in
|
|
133
|
+
* place of `<td role="gridcell">` -- so assistive technology announces that cell's content as
|
|
134
|
+
* the name of its row while moving across the row's other cells. Usually the one identifying
|
|
135
|
+
* column (a name or id). The cell keeps `part="cell"` and every other column behaviour; it also
|
|
136
|
+
* carries `data-row-header`, and `--lr-table-row-header-font-weight` (default `inherit`, so it
|
|
137
|
+
* looks like any other cell) sets its weight. Omit for an ordinary data column. */
|
|
138
|
+
rowHeader?:boolean;
|
|
139
|
+
/** Line wrapping for this column's body and footer cells (the header keeps its own single
|
|
140
|
+
* line). `'nowrap'` keeps each value on one line, widening the column instead -- e.g. an id,
|
|
141
|
+
* date or amount; `'wrap'` lets long values wrap and also breaks an unbroken token (a URL, a
|
|
142
|
+
* hash) so it stays inside a narrow or fixed-width column. Omit for the default: values wrap at
|
|
143
|
+
* spaces as before. While rows are stacked a `'nowrap'` column wraps, since a card cannot
|
|
144
|
+
* scroll sideways. The cell carries `[data-wrap]`; unknown values are ignored. */
|
|
145
|
+
wrap?:TableColumnWrap;
|
|
97
146
|
/** This column's own initial sort direction the first time header activation makes it the active
|
|
98
147
|
* `sortKey` -- consulted before the element-level `defaultSortDir`, which remains the fallback
|
|
99
148
|
* when this is omitted. Lets a mixed text/numeric table give one column (e.g. a "last updated"
|
|
@@ -140,7 +189,11 @@ footer?(rows:readonly T[]):unknown;
|
|
|
140
189
|
* external stylesheet rule regardless of specificity, so a `background`/`backgroundColor`
|
|
141
190
|
* returned here silently and completely overrides this same column's `heatValue` tint (which is
|
|
142
191
|
* painted by a shadow-stylesheet rule, not inline) -- combine the two only when that override is
|
|
143
|
-
* the intended effect.
|
|
192
|
+
* the intended effect.
|
|
193
|
+
*
|
|
194
|
+
* For text layout -- `white-space`, line clamping, `text-overflow` -- prefer `cellPart` plus a
|
|
195
|
+
* `::part()` rule: that wrapper holds only the value, while this style lands on the whole cell,
|
|
196
|
+
* which in stacked mode also holds the `cell-label` caption. */
|
|
144
197
|
cellStyle?(row:T):Record<string,string> |undefined;
|
|
145
198
|
/** Applied as the generated `<td>`'s native `title`, symmetrical with `cellStyle` -- e.g. the
|
|
146
199
|
* untruncated text behind an ellipsized cell, or a formatted timestamp behind a relative one.
|
|
@@ -160,7 +213,11 @@ cellTitle?(row:T):string|undefined;
|
|
|
160
213
|
* `display: block` element carrying `part="cell-content"` plus every whitespace-separated name
|
|
161
214
|
* returned here, so an outer scope can style it per row: `lr-table::part(cell-muted)`. Return
|
|
162
215
|
* `undefined` or an empty string for a plain `cell-content` wrapper; non-string results are
|
|
163
|
-
* ignored. Prefix your names (e.g. `cell-`) so they cannot collide with the table's own parts
|
|
216
|
+
* ignored. Prefix your names (e.g. `cell-`) so they cannot collide with the table's own parts:
|
|
217
|
+
* every name the table renders or forwards (`cell`, `cell-content`, `cell-label`, `cell-link`,
|
|
218
|
+
* `cell-editor`, `row`, `header-cell`, ...; the full list is `@csspart` on `<lr-table>`) is
|
|
219
|
+
* reserved, and a development build warns once per name when this returns one. The name is
|
|
220
|
+
* still applied, so the warning is the only change.
|
|
164
221
|
* Not applied to an open inline editor. A `part` attribute written directly inside a `cell()`
|
|
165
222
|
* template is equally a part of this table. */
|
|
166
223
|
cellPart?(row:T):string|undefined;
|
|
@@ -276,4 +333,7 @@ export interface LyraTableEventMap<T=unknown,K extends string|number=string|numb
|
|
|
276
333
|
/** A row was activated by pointer or Enter/Space.*/
|
|
277
334
|
'lr-row-activate':CustomEvent<Readonly<{row:T;}>>;'lr-row-expand-request':CustomEvent<Readonly<{row:T;rowKey:K;expanded:boolean;}>>;'lr-row-expand-toggle':CustomEvent<Readonly<{row:T;rowKey:K;expanded:boolean;}>>;'lr-load-more':CustomEvent<null>;'lr-retry-request':CustomEvent<null>;'lr-selection-change':CustomEvent<Readonly<{selectedRowKeys:readonly K[];}>>;'lr-filter-change':CustomEvent<Readonly<{filterText:string;}>>;
|
|
278
335
|
/** One-based `page`; `offset` is `(page - 1) * pageSize`.*/
|
|
279
|
-
'lr-before-page-change':CustomEvent<Readonly<{page:number;pageSize:number;offset:number;}>>;
|
|
336
|
+
'lr-before-page-change':CustomEvent<Readonly<{page:number;pageSize:number;offset:number;}>>;
|
|
337
|
+
/** `pageSize` and `offset` are always set (as on `lr-before-page-change`); they are typed optional
|
|
338
|
+
* only so the published `{ page }` detail type stays assignable until the next major. */
|
|
339
|
+
'lr-page-change':CustomEvent<Readonly<{page:number;pageSize?:number;offset?:number;}>>;'lr-cell-edit':CustomEvent<Readonly<{row:T;columnKey:string;value:string|number;}>>;'lr-column-resize-request':CustomEvent<Readonly<{columnKey:string;width:number;}>>;'lr-column-resize':CustomEvent<Readonly<{columnKey:string;width:number;}>>;}export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NESTED_INTERACTIVE_SELECTOR}from"../../../internal/nested-interactive.js";import{sanitizeCssDeclarationValue}from"../../../internal/safe-css.js";import{literalSetConverter}from"../../../internal/converters.js";import{normalizeSize}from"../../../internal/variants.js";const DEFAULT_SKELETON_ROWS=3,TABLE_OVERRIDE_MESSAGE_KEYS={tableLoading:"tableLoading",tableLoadingMore:"tableLoadingMore",tableLoadFailed:"tableLoadFailed",noColumns:"noColumns",noData:"noData",tableFilterLabel:"tableFilterLabel",tableFilterPlaceholder:"tableFilterPlaceholder",noMatches:"noMatches",showFewerColumns:"showFewerColumns",showAllColumns:"showAllColumns",loadMore:"loadMore"},MAX_SKELETON_ROWS=20,MAX_PAGE_SIZE=500,MAX_TABLE_COLLECTION_ENTRIES=1e4,MAX_TABLE_ROWS=1e5,TABLE_SCROLL_OVERFLOW_TOLERANCE_PX=1,DEFAULT_RESIZE_MIN_WIDTH_PX=48,MISSING_CELL_RENDERER_WARNING="lyra-table-missing-cell-renderer",MISSING_ACCESSIBLE_NAME_WARNING="lyra-table-missing-accessible-name",INERT_PRIORITY_COLUMN_CONFIG_WARNING="lyra-table-inert-priority-column-config";function frozenArray(values,limit=MAX_TABLE_COLLECTION_ENTRIES){const snapshot=[];try{for(const value of values)if(snapshot.push(value),snapshot.length>=limit)break}catch{}return Object.freeze(snapshot)}function keySet(values,limit=MAX_TABLE_COLLECTION_ENTRIES){const snapshot=new Set;try{for(const value of values){if(typeof value=="string"){if(value.trim().length===0)continue}else if(typeof value!="number")continue;if(snapshot.add(value),snapshot.size>=limit)break}}catch{}return snapshot}function readonlyKeySet(snapshot){let facade;return facade={get size(){return snapshot.size},has:value=>snapshot.has(value),entries:()=>snapshot.entries(),keys:()=>snapshot.keys(),values:()=>snapshot.values(),[Symbol.iterator]:()=>snapshot[Symbol.iterator](),forEach(callback,thisArg){snapshot.forEach(value=>callback.call(thisArg,value,value,facade))}},Object.freeze(facade)}const keySetFacades=new WeakMap;function storedKeySetFacade(values){let facade=keySetFacades.get(values);return facade||(facade=readonlyKeySet(values),keySetFacades.set(values,facade)),facade}const COMPACT_EMPTY_SIZES=new Set(["2xs","xs","s"]),isCompactEmptySize=size=>COMPACT_EMPTY_SIZES.has(normalizeSize(size)),TABLE_LAYOUT=literalSetConverter(["auto","fixed"],"auto"),TABLE_STACK=literalSetConverter(["never","auto","always"],"never"),TABLE_PAGINATION_FORMAT=literalSetConverter(["standard","compact"],"compact");function cellContentPartNames(value){if(typeof value!="string")return"";const names=new Set(value.split(/\s+/).filter(Boolean));return names.delete("cell-content"),[...names].join(" ")}function stickyDirection(sticky){if(sticky==="start"||sticky==="end")return sticky}const cellDeclarationVerdicts=new Map,CELL_DECLARATION_CACHE_LIMIT=1e3;function sanitizeCellStyle(cellStyle){const safe={};for(const[rawProperty,value]of Object.entries(cellStyle??{})){if(typeof value!="string")continue;const property=normalizeStyleProperty(rawProperty.trim()),key=`${property}\0${value}`;let verdict=cellDeclarationVerdicts.get(key);verdict===void 0&&(verdict=sanitizeCssDeclarationValue(property,value)??"",cellDeclarationVerdicts.size>=CELL_DECLARATION_CACHE_LIMIT&&cellDeclarationVerdicts.clear(),cellDeclarationVerdicts.set(key,verdict)),verdict&&(safe[property]=verdict)}return safe}function normalizeStyleProperty(property){return property.startsWith("--")?property:property.replace(/[A-Z]/g,"-$&").toLowerCase()}function normalizedEditTrigger(editTrigger){if(editTrigger==="always"||editTrigger==="double-click")return editTrigger}function encodeKey(key){return`${typeof key}:${key}`}function isImmutableSearchRow(value){if(value===null||typeof value!="object"&&typeof value!="function")return!0;try{return!Object.isFrozen(value)||"toJSON"in value||Object.getPrototypeOf(value)!==Object.prototype&&Object.getPrototypeOf(value)!==null?!1:Object.values(Object.getOwnPropertyDescriptors(value)).every(descriptor=>"value"in descriptor&&(descriptor.value===null||typeof descriptor.value!="object"&&typeof descriptor.value!="function"))}catch{return!1}}function createFilterStringifier(){let first,seen;const replace=(_key,value)=>{if(typeof value=="bigint")return value.toString();if(typeof value=="object"&&value!==null)if(first===void 0)first=value;else{if(value===first||(seen??=new Set,seen.has(value)))return"[Circular]";seen.add(value)}return value};return row=>{try{return JSON.stringify(row,replace)??""}catch{return""}finally{first=void 0,seen?.clear()}}}function asElement(value){return typeof value!="object"||!("nodeType"in value)||value.nodeType!==1||!("matches"in value)?null:value}function eventInteractiveTarget(event,boundary){for(const value of event.composedPath()){if(value===boundary)break;const element=asElement(value);if(element!==null&&(element.matches("[data-table-interactive]")||element.matches(NESTED_INTERACTIVE_SELECTOR)&&!element.matches("[data-row-key], th[data-col-key]")))return element}return null}export{DEFAULT_RESIZE_MIN_WIDTH_PX,DEFAULT_SKELETON_ROWS,INERT_PRIORITY_COLUMN_CONFIG_WARNING,MAX_PAGE_SIZE,MAX_SKELETON_ROWS,MAX_TABLE_COLLECTION_ENTRIES,MAX_TABLE_ROWS,MISSING_ACCESSIBLE_NAME_WARNING,MISSING_CELL_RENDERER_WARNING,TABLE_LAYOUT,TABLE_OVERRIDE_MESSAGE_KEYS,TABLE_PAGINATION_FORMAT,TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,TABLE_STACK,cellContentPartNames,createFilterStringifier,encodeKey,eventInteractiveTarget,frozenArray,isCompactEmptySize,isImmutableSearchRow,keySet,normalizedEditTrigger,sanitizeCellStyle,stickyDirection,storedKeySetFacade};
|
|
1
|
+
import{NESTED_INTERACTIVE_SELECTOR}from"../../../internal/nested-interactive.js";import{sanitizeCssDeclarationValue}from"../../../internal/safe-css.js";import{literalSetConverter}from"../../../internal/converters.js";import{normalizeSize}from"../../../internal/variants.js";const DEFAULT_SKELETON_ROWS=3,TABLE_OVERRIDE_MESSAGE_KEYS={tableLoading:"tableLoading",tableLoadingMore:"tableLoadingMore",tableLoadFailed:"tableLoadFailed",noColumns:"noColumns",noData:"noData",tableFilterLabel:"tableFilterLabel",tableFilterPlaceholder:"tableFilterPlaceholder",noMatches:"noMatches",showFewerColumns:"showFewerColumns",showAllColumns:"showAllColumns",loadMore:"loadMore"},MAX_SKELETON_ROWS=20,MAX_PAGE_SIZE=500,MAX_TABLE_COLLECTION_ENTRIES=1e4,MAX_TABLE_ROWS=1e5,TABLE_SCROLL_OVERFLOW_TOLERANCE_PX=1,DEFAULT_RESIZE_MIN_WIDTH_PX=48,MISSING_CELL_RENDERER_WARNING="lyra-table-missing-cell-renderer",MISSING_ACCESSIBLE_NAME_WARNING="lyra-table-missing-accessible-name",INERT_PRIORITY_COLUMN_CONFIG_WARNING="lyra-table-inert-priority-column-config",RESERVED_CELL_PART_WARNING="lyra-table-reserved-cell-part",REJECTED_ROW_ATTRIBUTE_WARNING="lyra-table-rejected-row-attribute",HEADER_CELL_SELECTOR='th[scope="col"][data-col-key]',BODY_CELL_SELECTOR=':is(td, th[scope="row"])[data-col-key]',TABLE_PART_NAMES=/* @__PURE__ */(()=>Object.freeze(["base","caption","cell","cell-content","cell-editor","cell-label","cell-link","empty","empty-actions","empty-base","empty-description","empty-heading","empty-icon","error","error-actions","error-base","error-cell","error-description","error-heading","error-icon","error-row","expanded-cell","expanded-row","expand-toggle-cell","filter","filter-clear","filter-label","foot","footer-cell","footer-row","group-cell","group-row","head","header-cell","loading","more-button","pagination","pagination-button","pagination-controls","pagination-page","pagination-page-count","pagination-page-current","pagination-page-field","pagination-page-input","pagination-pages","pagination-summary","resize-handle","retry-button","reveal-columns-button","row","row-expand-icon","row-expand-toggle","row-limit","row-total-cell","skeleton","sort-icon","sort-icon-active","sort-icon-inactive","table"]))(),TABLE_PART_NAME_SET=new Set(TABLE_PART_NAMES);function reservedCellPartNames(names){return names?names.split(" ").filter(name=>TABLE_PART_NAME_SET.has(name)):[]}const TABLE_ROW_ARIA_ATTRIBUTES=/* @__PURE__ */(()=>Object.freeze(["aria-label","aria-description","aria-current","aria-rowindex"]))(),TABLE_ROW_ARIA_SET=new Set(TABLE_ROW_ARIA_ATTRIBUTES),RESERVED_ROW_DATA_ATTRIBUTES=new Set(["data-row-key","data-stripe","data-skeleton-row","data-expanded-row-key"]),DATA_ATTRIBUTE_NAME=/^data-[a-z0-9_.-]+$/;function isAllowedRowAttribute(name){return TABLE_ROW_ARIA_SET.has(name)?!0:DATA_ATTRIBUTE_NAME.test(name)&&!name.startsWith("data-lr-")&&!RESERVED_ROW_DATA_ATTRIBUTES.has(name)}function normalizeRowAttributes(value){const attributes=new Map;let rejected=!1;if(value==null)return{attributes,rejected};if(typeof value!="object")return{attributes,rejected:!0};let entries;try{entries=Object.entries(value)}catch{return{attributes,rejected:!0}}for(const[name,raw]of entries){if(!isAllowedRowAttribute(name)){rejected=!0;continue}raw===!1||raw===null||raw===void 0||(raw===!0?attributes.set(name,""):typeof raw=="string"?attributes.set(name,raw):typeof raw=="number"&&Number.isFinite(raw)?attributes.set(name,String(raw)):rejected=!0)}return{attributes,rejected}}function frozenArray(values,limit=MAX_TABLE_COLLECTION_ENTRIES){const snapshot=[];try{for(const value of values)if(snapshot.push(value),snapshot.length>=limit)break}catch{}return Object.freeze(snapshot)}function keySet(values,limit=MAX_TABLE_COLLECTION_ENTRIES){const snapshot=new Set;try{for(const value of values){if(typeof value=="string"){if(value.trim().length===0)continue}else if(typeof value!="number")continue;if(snapshot.add(value),snapshot.size>=limit)break}}catch{}return snapshot}function readonlyKeySet(snapshot){let facade;return facade={get size(){return snapshot.size},has:value=>snapshot.has(value),entries:()=>snapshot.entries(),keys:()=>snapshot.keys(),values:()=>snapshot.values(),[Symbol.iterator]:()=>snapshot[Symbol.iterator](),forEach(callback,thisArg){snapshot.forEach(value=>callback.call(thisArg,value,value,facade))}},Object.freeze(facade)}const keySetFacades=new WeakMap;function storedKeySetFacade(values){let facade=keySetFacades.get(values);return facade||(facade=readonlyKeySet(values),keySetFacades.set(values,facade)),facade}const COMPACT_EMPTY_SIZES=new Set(["2xs","xs","s"]),isCompactEmptySize=size=>COMPACT_EMPTY_SIZES.has(normalizeSize(size)),TABLE_LAYOUT=literalSetConverter(["auto","fixed"],"auto"),TABLE_STACK=literalSetConverter(["never","auto","always"],"never"),TABLE_STACK_HEADER=literalSetConverter(["visible","sortable","hidden"],"visible"),TABLE_PAGINATION_FORMAT=literalSetConverter(["standard","compact"],"compact");function columnWrap(wrap){return wrap==="wrap"||wrap==="nowrap"?wrap:void 0}function cellContentPartNames(value){if(typeof value!="string")return"";const names=new Set(value.split(/\s+/).filter(Boolean));return names.delete("cell-content"),[...names].join(" ")}function stickyDirection(sticky){if(sticky==="start"||sticky==="end")return sticky}const cellDeclarationVerdicts=new Map,CELL_DECLARATION_CACHE_LIMIT=1e3;function sanitizeCellStyle(cellStyle){const safe={};for(const[rawProperty,value]of Object.entries(cellStyle??{})){if(typeof value!="string")continue;const property=normalizeStyleProperty(rawProperty.trim()),key=`${property}\0${value}`;let verdict=cellDeclarationVerdicts.get(key);verdict===void 0&&(verdict=sanitizeCssDeclarationValue(property,value)??"",cellDeclarationVerdicts.size>=CELL_DECLARATION_CACHE_LIMIT&&cellDeclarationVerdicts.clear(),cellDeclarationVerdicts.set(key,verdict)),verdict&&(safe[property]=verdict)}return safe}function normalizeStyleProperty(property){return property.startsWith("--")?property:property.replace(/[A-Z]/g,"-$&").toLowerCase()}function normalizedEditTrigger(editTrigger){if(editTrigger==="always"||editTrigger==="double-click")return editTrigger}function encodeKey(key){return`${typeof key}:${key}`}function isImmutableSearchRow(value){if(value===null||typeof value!="object"&&typeof value!="function")return!0;try{return!Object.isFrozen(value)||"toJSON"in value||Object.getPrototypeOf(value)!==Object.prototype&&Object.getPrototypeOf(value)!==null?!1:Object.values(Object.getOwnPropertyDescriptors(value)).every(descriptor=>"value"in descriptor&&(descriptor.value===null||typeof descriptor.value!="object"&&typeof descriptor.value!="function"))}catch{return!1}}function createFilterStringifier(){let first,seen;const replace=(_key,value)=>{if(typeof value=="bigint")return value.toString();if(typeof value=="object"&&value!==null)if(first===void 0)first=value;else{if(value===first||(seen??=new Set,seen.has(value)))return"[Circular]";seen.add(value)}return value};return row=>{try{return JSON.stringify(row,replace)??""}catch{return""}finally{first=void 0,seen?.clear()}}}function asElement(value){return typeof value!="object"||!("nodeType"in value)||value.nodeType!==1||!("matches"in value)?null:value}function eventInteractiveTarget(event,boundary){for(const value of event.composedPath()){if(value===boundary)break;const element=asElement(value);if(element!==null&&(element.matches("[data-table-interactive]")||element.matches(NESTED_INTERACTIVE_SELECTOR)&&!element.matches("[data-row-key], th[data-col-key]")))return element}return null}export{BODY_CELL_SELECTOR,DEFAULT_RESIZE_MIN_WIDTH_PX,DEFAULT_SKELETON_ROWS,HEADER_CELL_SELECTOR,INERT_PRIORITY_COLUMN_CONFIG_WARNING,MAX_PAGE_SIZE,MAX_SKELETON_ROWS,MAX_TABLE_COLLECTION_ENTRIES,MAX_TABLE_ROWS,MISSING_ACCESSIBLE_NAME_WARNING,MISSING_CELL_RENDERER_WARNING,REJECTED_ROW_ATTRIBUTE_WARNING,RESERVED_CELL_PART_WARNING,TABLE_LAYOUT,TABLE_OVERRIDE_MESSAGE_KEYS,TABLE_PAGINATION_FORMAT,TABLE_PART_NAMES,TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,TABLE_STACK,TABLE_STACK_HEADER,cellContentPartNames,columnWrap,createFilterStringifier,encodeKey,eventInteractiveTarget,frozenArray,isAllowedRowAttribute,isCompactEmptySize,isImmutableSearchRow,keySet,normalizeRowAttributes,normalizedEditTrigger,reservedCellPartNames,sanitizeCellStyle,stickyDirection,storedKeySetFacade};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type{LyraPaginationFormat}from'../pagination/pagination.class.js';import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraSize}from'../../../internal/variants.js';import{type TableLoadingAppearance,type TableSelectionMode,type TableExpansionMode,type TableSortMode,type TableSortIndicators,type TableScrollMode,type TableSortDirection,type TableStackMode,type TableColumn,type LyraTableEventMap}from'./table-support.js';export type{TableLoadingAppearance,TableEdgeAlign,TableColumnEditTrigger,TableColumnEditOption,TableSelectionMode,TableExpansionMode,TableSortMode,TableSortIndicators,TableScrollMode,TableSortDirection,TableStackMode,TableSortRequestDetail,TableSortCommitDetail,TableSortDetail,TableColumn,LyraTableEventMap}from'./table-support.js';
|
|
1
|
+
import type{LyraPaginationFormat}from'../pagination/pagination.class.js';import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type LyraSize}from'../../../internal/variants.js';import{type TableLoadingAppearance,type TableSelectionMode,type TableExpansionMode,type TableSortMode,type TableSortIndicators,type TableScrollMode,type TableSortDirection,type TableStackMode,type TableStackHeader,type TableRowAttributes,type TableColumn,type LyraTableEventMap}from'./table-support.js';export type{TableLoadingAppearance,TableEdgeAlign,TableColumnEditTrigger,TableColumnEditOption,TableSelectionMode,TableExpansionMode,TableSortMode,TableSortIndicators,TableScrollMode,TableSortDirection,TableStackMode,TableStackHeader,TableRowAttributes,TableRowAttributeValue,TableColumnWrap,TableSortRequestDetail,TableSortCommitDetail,TableSortDetail,TableColumn,LyraTableEventMap}from'./table-support.js';
|
|
2
2
|
/**
|
|
3
3
|
* `<lr-table>` — a sort/select-aware data table. Sorting is a cancelable request followed by a
|
|
4
4
|
* committed `lr-sort` (client mode reorders rows; server mode leaves order to the caller);
|
|
@@ -53,7 +53,8 @@ import type{LyraPaginationFormat}from'../pagination/pagination.class.js';import{
|
|
|
53
53
|
* the zero-based index of the page's first row. The nested pager's own event of this name stops
|
|
54
54
|
* inside the shadow root, so one page action reaches a document listener once, targeted at the
|
|
55
55
|
* table. Vetoing it keeps `page` and suppresses `lr-page-change`.
|
|
56
|
-
* @event lr-page-change - A pagination control requested a page. Frozen readonly `detail: { page }
|
|
56
|
+
* @event lr-page-change - A pagination control requested a page. Frozen readonly `detail: { page, pageSize, offset }`;
|
|
57
|
+
* `page` is one-based and `offset` is `(page - 1) * pageSize`.
|
|
57
58
|
* @event lr-cell-edit - An inline editor committed a value. `detail: { row, columnKey, value }`.
|
|
58
59
|
* @event lr-column-resize-request - Cancelable proposal before accepting a keyboard resize or
|
|
59
60
|
* final pointer drag width. `detail: { columnKey, width }`. Vetoing discards the proposal or drag preview.
|
|
@@ -66,18 +67,31 @@ import type{LyraPaginationFormat}from'../pagination/pagination.class.js';import{
|
|
|
66
67
|
* @csspart base - The root wrapper around the `<table>` and its footer controls.
|
|
67
68
|
* @csspart table - The `<table role="grid">` element.
|
|
68
69
|
* @csspart caption - The `<caption>` element, rendered only when `caption` is set.
|
|
69
|
-
* @csspart head - The `<thead>` element.
|
|
70
|
+
* @csspart head - The `<thead>` element; not rendered while `without-header-row` is set.
|
|
70
71
|
* @csspart header-cell - Each `<th>` header cell.
|
|
71
72
|
* @csspart resize-handle - The focusable separator used to resize a `resizable` column. Its
|
|
72
73
|
* numeric ARIA range remains in CSS pixels while `aria-valuetext` reports the current value
|
|
73
74
|
* through the effective locale.
|
|
74
75
|
* @csspart row - Each body `<tr>`.
|
|
75
|
-
* @csspart cell - Each body `<td
|
|
76
|
+
* @csspart cell - Each body `<td>`, or `<th scope="row">` for a `rowHeader` column (which also
|
|
77
|
+
* carries `[data-row-header]`). An `editTrigger: 'double-click'` column's resting (not
|
|
76
78
|
* currently editing) cell additionally carries `[data-editable]` and its own `tabindex="-1"`
|
|
77
79
|
* roving-focus stop -- see the keyboard paragraph above.
|
|
78
80
|
* @csspart cell-label - The visible column caption a stacked body cell shows before its value
|
|
79
81
|
* (`stack` is `always`, or `auto` below the breakpoint); hidden from assistive technology, which
|
|
80
82
|
* already reads the column header.
|
|
83
|
+
*
|
|
84
|
+
* Reserved part names: every `@csspart` listed here is the table's own, so a `cellPart(row)` result
|
|
85
|
+
* must not reuse one (`cell-label` included) -- a development build warns once per colliding name.
|
|
86
|
+
* Prefix your own names (`cell-archived`, `cell-muted`).
|
|
87
|
+
* @cssprop [--lr-table-row-header-font-weight=inherit] - Font weight of a `rowHeader` column's body cells.
|
|
88
|
+
* @cssprop [--lr-table-border=var(--lr-border-width-thin) solid var(--lr-color-border-subtle)] - Border
|
|
89
|
+
* shorthand of the outer frame (`[part='base']`); `none` drops it. Row and header rules keep
|
|
90
|
+
* their own colour tokens.
|
|
91
|
+
* @cssprop [--lr-table-cell-line-height=inherit] - Line height of body cells; header and footer cells
|
|
92
|
+
* keep the inherited value.
|
|
93
|
+
* @cssprop [--lr-table-sort-icon-vertical-align=middle] - `vertical-align` of the header sort icon
|
|
94
|
+
* against the label text, e.g. `text-bottom` or a length such as `-0.125em`.
|
|
81
95
|
* @cssprop --lr-form-control-touch-font-size-min - Minimum font size of the inner text inputs under touch density.
|
|
82
96
|
* @cssprop [--lr-table-stack-breakpoint=var(--lr-size-36rem)] - Allocation below which `stack="auto"` stacks rows.
|
|
83
97
|
* @cssprop [--lr-table-stack-label-inline-size=40%] - Inline size of a stacked cell's caption; the value flows after it.
|
|
@@ -202,6 +216,36 @@ import type{LyraPaginationFormat}from'../pagination/pagination.class.js';import{
|
|
|
202
216
|
* default.
|
|
203
217
|
* @cssprop [--lr-table-cell-link-hover-color=var(--lr-table-cell-link-color,var(--lr-color-brand))] -
|
|
204
218
|
* Colour of that anchor on hover and `:focus-visible`, which also thicken its underline.
|
|
219
|
+
* @cssprop [--lr-table-cell-link-font-weight=inherit] - Font weight of that anchor.
|
|
220
|
+
* @cssprop [--lr-table-cell-link-text-decoration=revert] - `text-decoration` of that anchor; `revert`
|
|
221
|
+
* keeps the UA underline, `none` removes it.
|
|
222
|
+
* @cssprop [--lr-table-cell-link-hover-font-weight=var(--lr-table-cell-link-font-weight,inherit)] - Font
|
|
223
|
+
* weight of that anchor on hover, `:focus-visible` and press.
|
|
224
|
+
* @cssprop [--lr-table-cell-link-hover-text-decoration=var(--lr-table-cell-link-text-decoration,revert)] -
|
|
225
|
+
* `text-decoration` of that anchor on hover, `:focus-visible` and press (the underline still thickens).
|
|
226
|
+
* @cssprop [--lr-table-filter-height=var(--lr-input-control-min-height,auto)] - Minimum block size of the
|
|
227
|
+
* built-in `filterable` field; honours `--lr-input-control-min-height` so it lines up with `lr-input`.
|
|
228
|
+
* @cssprop [--lr-table-filter-font-size=inherit] - Font size of the built-in filter field.
|
|
229
|
+
* @cssprop [--lr-table-filter-wrap=nowrap] - `flex-wrap` of the filter row. Set `wrap` with
|
|
230
|
+
* `--lr-table-filter-basis` to stack the field under its label text at narrow widths.
|
|
231
|
+
* @cssprop [--lr-table-filter-basis=0%] - Preferred inline size of the filter field (its flex basis);
|
|
232
|
+
* the point at which a `wrap` row drops the field onto its own line.
|
|
233
|
+
* @cssprop [--lr-table-caption-font-size=inherit] - Font size of the `caption`.
|
|
234
|
+
* @cssprop [--lr-table-caption-font-weight=inherit] - Font weight of the `caption`.
|
|
235
|
+
* @cssprop [--lr-table-caption-color=inherit] - Text colour of the `caption`.
|
|
236
|
+
* @cssprop [--lr-table-caption-text-align=revert] - Alignment of the `caption`; `revert` keeps the UA
|
|
237
|
+
* centring, `start` aligns it with the first column.
|
|
238
|
+
* @cssprop [--lr-table-caption-padding=0] - Padding of the `caption`.
|
|
239
|
+
* @cssprop [--lr-table-reveal-columns-min-size=0] - Minimum inline and block size of the
|
|
240
|
+
* reveal-columns button, for a larger touch target.
|
|
241
|
+
* @cssprop [--lr-table-header-bg=var(--lr-table-surface,var(--lr-color-surface))] - Background of a header
|
|
242
|
+
* cell, including a sticky one. The sorted header's own `--lr-table-header-sorted-bg` still wins.
|
|
243
|
+
* @cssprop [--lr-table-header-border-color=var(--lr-table-cell-border-color,var(--lr-color-border-subtle))] -
|
|
244
|
+
* Colour of the rule under a header cell, distinct from the body-row rules.
|
|
245
|
+
* @cssprop [--lr-table-group-bg=var(--lr-color-surface-raised)] - Background of a group-header cell.
|
|
246
|
+
* @cssprop [--lr-table-more-button-bg=none] - Resting fill of the "load more" button; hover and press
|
|
247
|
+
* keep their own fills.
|
|
248
|
+
* @cssprop [--lr-table-reveal-columns-bg=none] - Resting fill of the reveal-columns button.
|
|
205
249
|
* @cssprop [--lr-table-cell-padding=var(--lr-space-s)] - Padding of a header cell, a body cell, and
|
|
206
250
|
* the row-total cell.
|
|
207
251
|
* @cssprop [--lr-table-cell-padding-compact=var(--lr-space-xs) var(--lr-space-s)] - Padding of a
|
|
@@ -303,7 +347,22 @@ get layout():'auto'|'fixed';set layout(next:'auto'|'fixed');private _stack;
|
|
|
303
347
|
* The grid, row and cell roles, the sortable header buttons, selection, activation, editing,
|
|
304
348
|
* expansion and links keep working; only the layout changes. Unsupported values normalize to
|
|
305
349
|
* `'never'`. */
|
|
306
|
-
get stack():TableStackMode;set stack(next:TableStackMode);private
|
|
350
|
+
get stack():TableStackMode;set stack(next:TableStackMode);private _stackHeader;
|
|
351
|
+
/** What the column header strip shows while rows are stacked (`stack` is `'always'`, or `'auto'`
|
|
352
|
+
* below its breakpoint); it has no effect on the grid. `'visible'` (the default) keeps every
|
|
353
|
+
* header wrapped into a strip above the cards. `'sortable'` keeps only the sortable headers, as a
|
|
354
|
+
* compact sort strip, and `'hidden'` keeps none -- each card's `cell-label` captions already name
|
|
355
|
+
* its values. A header left out of the strip is visually hidden rather than removed, so the
|
|
356
|
+
* grid's column headers still name every cell for assistive technology, and it is shown again
|
|
357
|
+
* while it holds keyboard focus. Unsupported values normalize to `'visible'`. */
|
|
358
|
+
get stackHeader():TableStackHeader;set stackHeader(next:TableStackHeader);
|
|
359
|
+
/** Omits the column header row (`<thead>`) entirely, for a table whose columns need no headings
|
|
360
|
+
* -- a key/value summary, say, ideally with a `rowHeader` column. Sorting from a header, column
|
|
361
|
+
* resizing and header keyboard navigation have nothing to act on while it is set; rows,
|
|
362
|
+
* selection, editing, expansion and the footer keep working. Name the grid with `caption` or a
|
|
363
|
+
* host `aria-label` (the development build warns when neither is set). Same spelling as
|
|
364
|
+
* `<lr-csv-viewer>`'s `without-header-row`. */
|
|
365
|
+
withoutHeaderRow:boolean;private autoStacked;private get stacked();
|
|
307
366
|
/** Column key identifying the active sort.*/
|
|
308
367
|
sortKey:string;
|
|
309
368
|
/** Direction of the active sort.*/
|
|
@@ -511,6 +570,17 @@ heatTintScale?:{min?:number;max?:number;};
|
|
|
511
570
|
* `footer(rows)` — does not assume addition, so a non-sum aggregate works identically. Omit for
|
|
512
571
|
* no trailing column at all (unchanged output). */
|
|
513
572
|
rowTotal?:(row:T)=>unknown;
|
|
573
|
+
/** Extra attributes for each body row's `<tr part="row">`, from `row` and its 0-based position
|
|
574
|
+
* among the rows currently rendered (after sorting, filtering and pagination) -- e.g. a
|
|
575
|
+
* `data-status` hook for `lr-table::part(row)` rules, or a test id. Only lowercase `data-*` names
|
|
576
|
+
* (except the table's own `data-row-key`/`data-stripe` markers and the `data-lr-*` namespace)
|
|
577
|
+
* and `aria-label`, `aria-description`, `aria-current` and `aria-rowindex` are written; event
|
|
578
|
+
* handlers, `style`, `class`, `id`, `role`, `tabindex` and every other name are dropped, with a
|
|
579
|
+
* development-build warning. A string or finite number is written as text, `true` as an empty
|
|
580
|
+
* attribute, and `false`/`null`/`undefined` leave it off; a name returned on one render and not
|
|
581
|
+
* the next is removed. A throwing callback writes nothing for that row. Applied in the browser,
|
|
582
|
+
* not in server-rendered markup. */
|
|
583
|
+
rowAttributes?:(row:T,index:number)=>TableRowAttributes|undefined;
|
|
514
584
|
/** Renders the bottom-right cell (row-total column × footer row). Only rendered when both
|
|
515
585
|
* `rowTotal` is set **and** at least one column defines `footer` — otherwise there is no footer
|
|
516
586
|
* row for it to occupy, and this renders nothing. */
|
|
@@ -608,7 +678,7 @@ priorityColumnsVisible:boolean;
|
|
|
608
678
|
* `.priorityColumnsVisible=${...}` binding) -- including a binding that pins it to `false`, its
|
|
609
679
|
* own default. The same "explicit beats persisted" guarantee as `lr-app-rail`'s and
|
|
610
680
|
* `lr-widget`'s `storage-key` restores, which share this one's write-tracking mechanism. */
|
|
611
|
-
storageKey?:string;private get storageFullKey();private persistReady;private readonly announcements;private firstUpdateAnnouncementsReady;private _activeColKey;private get activeColKey();private set activeColKey(value);private _activeRowKey;private get activeRowKey();private set activeRowKey(value);private patchRovingTabStop;private editingCell;private focusedEditorCell;private editorHadFocusBeforeUpdate;private rovingFocusSnapshot;private _resizedColumnWidths;private readonly resizeWriteGuard;private get resizedColumnWidths();private set resizedColumnWidths(value);private resizeState?;private readonly resizePointer;private rowsByKey;private rowsLocale?;private columnsByKey;private resizeObserver?;private layoutFrame;private observedBase?;private observedTable?;private readonly observedHeaders;private readonly priorityTierNaturalWidth;private alwaysVisibleNaturalWidth;private readonly priorityTierHiddenAllocation;private readonly priorityTierRevealAllocation;private parsePixelLength;private themedResizeMinWidth?;private minimumResizeWidth;private resolveThemedResizeMinWidth;private maximumResizeWidth;private currentResizeWidth;private resizeValueText;private resizeColumnTo;private renderedColumnWidth;private onResizePointerDown;private onResizePointerMove;private onResizeKeyDown;private renderResizeHandle;private syncResizeHandleValues;private onResizePointerEnd;private rollbackResizePreview;private cancelResizeGesture;private syncLayoutGeometry;private syncAutoStack;private scheduleLayoutSync;protected firstUpdated(changed:PropertyValues):void;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;private localizedOverride;private loadingText;private loadingMoreText;private onLoadMore;private observeBase;private observeTable;private syncAutoScrollMode;private observeHeaders;private priorityTierHeaders;private recomputeHiddenPriorityColumns;private settlePriorityTier;private rehomeFocusedColumn;private keyOf;private cachedCanonicalRowEntries;private canonicalRowEntriesInputs;private canonicalRowEntries;private readonly matchEntries;private matchingEntries;private get normalizedPageSize();private get effectiveSkeletonRows();private get matchingTotalItems();private get serverUnknownTotal();private get pageCount();private get appliedPage();private sortedCanonicalEntries;private readonly sortEntries;private readonly pageEntries;private renderedEntries;private readonly publicRowsMemo;private publicRows;private aggregateRows?;private aggregateColumns?;private aggregateLocale?;private readonly aggregateValues;private aggregate;
|
|
681
|
+
storageKey?:string;private get storageFullKey();private persistReady;private readonly announcements;private firstUpdateAnnouncementsReady;private _activeColKey;private get activeColKey();private set activeColKey(value);private _activeRowKey;private get activeRowKey();private set activeRowKey(value);private patchRovingTabStop;private editingCell;private focusedEditorCell;private editorHadFocusBeforeUpdate;private rovingFocusSnapshot;private _resizedColumnWidths;private readonly resizeWriteGuard;private get resizedColumnWidths();private set resizedColumnWidths(value);private resizeState?;private readonly resizePointer;private rowsByKey;private rowsLocale?;private columnsByKey;private resizeObserver?;private layoutFrame;private observedBase?;private observedTable?;private readonly observedHeaders;private readonly priorityTierNaturalWidth;private alwaysVisibleNaturalWidth;private readonly priorityTierHiddenAllocation;private readonly priorityTierRevealAllocation;private parsePixelLength;private themedResizeMinWidth?;private minimumResizeWidth;private resolveThemedResizeMinWidth;private maximumResizeWidth;private currentResizeWidth;private resizeValueText;private resizeColumnTo;private renderedColumnWidth;private onResizePointerDown;private onResizePointerMove;private onResizeKeyDown;private renderResizeHandle;private syncResizeHandleValues;private onResizePointerEnd;private rollbackResizePreview;private cancelResizeGesture;private syncLayoutGeometry;private syncAutoStack;private scheduleLayoutSync;protected firstUpdated(changed:PropertyValues):void;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;private localizedOverride;private loadingText;private loadingMoreText;private onLoadMore;private observeBase;private observeTable;private syncAutoScrollMode;private observeHeaders;private priorityTierHeaders;private columnMeasureCells;private recomputeHiddenPriorityColumns;private settlePriorityTier;private rehomeFocusedColumn;private keyOf;private cachedCanonicalRowEntries;private canonicalRowEntriesInputs;private canonicalRowEntries;private readonly matchEntries;private matchingEntries;private get normalizedPageSize();private get effectiveSkeletonRows();private get matchingTotalItems();private get serverUnknownTotal();private get pageCount();private get appliedPage();private sortedCanonicalEntries;private readonly sortEntries;private readonly pageEntries;private renderedEntries;private readonly publicRowsMemo;private publicRows;private aggregateRows?;private aggregateColumns?;private aggregateLocale?;private readonly aggregateValues;private aggregate;
|
|
612
682
|
/** `rows` after filtering and (client-mode) sorting, ignoring pagination -- the same set
|
|
613
683
|
* `columns[].footer(rows)`/`grandTotal(rows)` and the heat-tint domain already compute over.
|
|
614
684
|
* Lets a consumer that needs "what the grid currently shows" (e.g. exporting the visible rows)
|
|
@@ -694,4 +764,4 @@ expandedContentElement(rowKey:K):HTMLElement|null;private rowElementForToken;pri
|
|
|
694
764
|
* Degrade to an empty cell so the rest of the table stays usable, and emit one fixed
|
|
695
765
|
* development-only diagnostic for the page without retaining or reporting caller data.
|
|
696
766
|
*/
|
|
697
|
-
private renderCellContent;private renderCellLink;private renderCellValue;private columnName;private callbackLabel;private rowIdentity;private renderCellEditor;private renderSkeletonPlaceholder;private renderSkeletonRows;private emptyCompactFor;private renderErrorContent;private renderErrorRow;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-table':LyraTable;}}
|
|
767
|
+
private renderCellContent;private warnReservedCellParts;private rowAttributeMap;private renderCellLink;private renderCellValue;private columnName;private callbackLabel;private rowIdentity;private renderCellEditor;private renderSkeletonPlaceholder;private renderSkeletonRows;private emptyCompactFor;private renderErrorContent;private renderErrorRow;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-table':LyraTable;}}
|