@aceshooting/lyra-ui 30.9.0 → 31.1.1
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 +361 -335
- package/dist/ai/adapters/ag-ui.js +1 -1
- package/dist/autoloader-cdn.js +1 -1
- package/dist/components/agent-tools/activity-feed/activity-feed.class.js +1 -1
- package/dist/components/agent-tools/budget-meter/budget-meter.class.d.ts +12 -1
- package/dist/components/agent-tools/budget-meter/budget-meter.class.js +4 -4
- package/dist/components/agent-tools/compare-panel/compare-panel.class.js +1 -1
- package/dist/components/agent-tools/eval-dataset/eval-dataset.class.js +1 -1
- package/dist/components/agent-tools/thinking-panel/thinking-panel.class.js +1 -1
- package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.class.js +1 -1
- package/dist/components/charts/chart/box-plot.class.js +2 -2
- package/dist/components/charts/chart/chart-sync.js +1 -1
- package/dist/components/charts/chart/chart.class.d.ts +1 -1
- package/dist/components/charts/chart/chart.class.js +4 -4
- package/dist/components/charts/chart/lite-chart-axis-layout.js +1 -1
- package/dist/components/charts/chart/lite-chart.class.js +2 -2
- package/dist/components/conversation/chat-composer/chat-composer.class.d.ts +26 -11
- package/dist/components/conversation/chat-composer/chat-composer.class.js +11 -9
- package/dist/components/conversation/chat-composer/chat-composer.styles.js +1 -1
- package/dist/components/conversation/chat-message/chat-message.class.d.ts +27 -3
- package/dist/components/conversation/chat-message/chat-message.class.js +14 -12
- package/dist/components/conversation/chat-message/chat-message.styles.js +1 -1
- package/dist/components/conversation/chat-viewport/chat-viewport.class.d.ts +29 -2
- package/dist/components/conversation/chat-viewport/chat-viewport.class.js +2 -2
- package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +1 -1
- package/dist/components/conversation/code-block/code-block-shared.js +1 -1
- package/dist/components/conversation/markdown/markdown-base.class.d.ts +1 -1
- package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
- package/dist/components/conversation/markdown/markdown-code-header.js +1 -1
- package/dist/components/conversation/markdown/markdown-core.class.d.ts +10 -0
- package/dist/components/conversation/markdown/markdown-core.class.js +1 -1
- package/dist/components/conversation/markdown/markdown-shared.d.ts +7 -2
- package/dist/components/conversation/markdown/markdown-shared.js +3 -3
- package/dist/components/conversation/markdown/markdown.class.d.ts +10 -0
- package/dist/components/conversation/markdown/markdown.class.js +1 -1
- package/dist/components/conversation/message-feedback/message-feedback.class.d.ts +11 -3
- package/dist/components/conversation/message-feedback/message-feedback.class.js +12 -6
- package/dist/components/conversation/message-feedback/message-feedback.styles.js +1 -1
- package/dist/components/conversation/message-parts/message-parts.class.js +1 -1
- package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +8 -4
- package/dist/components/conversation/prompt-input/prompt-input.class.js +3 -2
- package/dist/components/conversation/push-to-talk/push-to-talk.class.js +1 -1
- package/dist/components/conversation/streaming-text/streaming-text-base.class.d.ts +4 -0
- package/dist/components/conversation/streaming-text/streaming-text-base.class.js +1 -1
- package/dist/components/conversation/streaming-text/streaming-text-core.class.d.ts +1 -1
- package/dist/components/conversation/streaming-text/streaming-text-core.class.js +1 -0
- package/dist/components/conversation/streaming-text/streaming-text.class.d.ts +1 -1
- package/dist/components/conversation/streaming-text/streaming-text.class.js +1 -0
- package/dist/components/conversation/suggestion-chips/suggestion-chips.class.d.ts +17 -3
- package/dist/components/conversation/suggestion-chips/suggestion-chips.class.js +3 -3
- package/dist/components/conversation/suggestion-chips/suggestion-chips.d.ts +1 -1
- package/dist/components/conversation/suggestion-chips/suggestion-chips.js +1 -1
- package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +1 -1
- package/dist/components/conversation/thread-list/thread-list.class.d.ts +1 -1
- package/dist/components/conversation/thread-list/thread-list.class.js +3 -3
- package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
- package/dist/components/data/data-grid/data-grid.class.d.ts +10 -10
- package/dist/components/data/data-grid/data-grid.class.js +1 -1
- package/dist/components/data/document-library/document-library-cursor.js +1 -0
- package/dist/components/data/document-library/document-library-types.d.ts +20 -0
- package/dist/components/data/document-library/document-library.class.d.ts +37 -26
- package/dist/components/data/document-library/document-library.class.js +20 -11
- package/dist/components/data/document-library/document-library.styles.js +1 -1
- package/dist/components/data/file-tree/file-tree.class.js +1 -1
- package/dist/components/data/flow-canvas/flow-canvas.class.d.ts +1 -1
- package/dist/components/data/flow-canvas/flow-canvas.class.js +2 -2
- package/dist/components/data/heatmap/heatmap.class.d.ts +1 -1
- package/dist/components/data/heatmap/heatmap.class.js +1 -1
- package/dist/components/data/pagination/pagination.class.js +1 -1
- package/dist/components/data/table/table.class.d.ts +31 -2
- package/dist/components/data/table/table.class.js +3 -3
- package/dist/components/data/table/table.styles.js +1 -1
- package/dist/components/data/timeline/timeline-cluster.js +1 -1
- package/dist/components/data/timeline/timeline-item.class.d.ts +10 -3
- package/dist/components/data/timeline/timeline-item.class.js +16 -12
- package/dist/components/data/timeline/timeline-item.styles.js +1 -1
- package/dist/components/data/timeline/timeline.class.d.ts +14 -2
- package/dist/components/data/timeline/timeline.class.js +9 -5
- package/dist/components/data/tree/tree-item.class.js +1 -1
- package/dist/components/data/tree/tree.class.d.ts +2 -0
- package/dist/components/data/tree/tree.class.js +1 -1
- package/dist/components/forms/button/button.class.d.ts +8 -6
- package/dist/components/forms/button/button.class.js +2 -2
- package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
- package/dist/components/forms/color-picker/color-core.js +1 -1
- package/dist/components/forms/combobox/combobox.class.d.ts +20 -12
- package/dist/components/forms/combobox/combobox.class.js +2 -2
- package/dist/components/forms/date-picker/date-input.class.d.ts +1 -1
- package/dist/components/forms/date-picker/date-input.class.js +1 -1
- package/dist/components/forms/icon-button/icon-button.class.d.ts +4 -2
- package/dist/components/forms/icon-button/icon-button.class.js +2 -2
- package/dist/components/forms/input/input-shared.js +2 -2
- package/dist/components/forms/input/number-input-locale.js +1 -0
- package/dist/components/forms/input/number-input.class.d.ts +19 -2
- package/dist/components/forms/input/number-input.class.js +2 -2
- package/dist/components/forms/locale-picker/locale-picker.class.d.ts +3 -3
- package/dist/components/forms/locale-picker/locale-picker.class.js +1 -1
- package/dist/components/layout/app-rail-group/app-rail-group.class.js +1 -1
- package/dist/components/layout/details/accordion-item.class.js +1 -1
- package/dist/components/layout/dock-panel/dock-panel.class.d.ts +1 -1
- package/dist/components/layout/dock-panel/dock-panel.class.js +1 -1
- package/dist/components/layout/menu/menu.class.js +1 -1
- package/dist/components/layout/multi-split/multi-split.class.js +1 -1
- package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.js +1 -1
- package/dist/components/layout/page/page.class.d.ts +3 -3
- package/dist/components/layout/page/page.class.js +1 -1
- package/dist/components/layout/segmented/segmented.class.d.ts +20 -7
- package/dist/components/layout/segmented/segmented.class.js +34 -24
- package/dist/components/layout/segmented/segmented.styles.js +1 -1
- package/dist/components/layout/stepper/stepper.styles.js +1 -1
- package/dist/components/layout/tab-group/tab-group.class.d.ts +8 -1
- package/dist/components/layout/tab-group/tab-group.class.js +1 -1
- package/dist/components/layout/tab-group/tab.class.d.ts +7 -1
- package/dist/components/layout/tab-group/tab.class.js +1 -1
- package/dist/components/layout/virtual-list/virtual-list.class.d.ts +2 -2
- package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
- package/dist/components/media/animated-image/animated-image.class.js +1 -1
- package/dist/components/media/attachment-chip/attachment-chip.class.d.ts +21 -14
- package/dist/components/media/attachment-chip/attachment-chip.class.js +1 -1
- package/dist/components/media/attachment-trigger/attachment-trigger.class.d.ts +36 -12
- package/dist/components/media/attachment-trigger/attachment-trigger.class.js +3 -3
- package/dist/components/media/drop-zone/drop-zone.class.d.ts +23 -5
- package/dist/components/media/drop-zone/drop-zone.class.js +2 -2
- package/dist/components/media/drop-zone/drop-zone.styles.js +1 -1
- package/dist/components/media/file-icon/file-icon.class.js +1 -1
- package/dist/components/media/flag/flag-url-resolver.js +1 -1
- package/dist/components/media/image-viewer/image-viewer.class.d.ts +2 -2
- package/dist/components/media/image-viewer/image-viewer.class.js +1 -1
- package/dist/components/media/map/map-anchor-controller.js +1 -1
- package/dist/components/media/map/map-canvas-target.js +1 -0
- package/dist/components/media/map/map-owned-features.js +1 -1
- package/dist/components/media/map/map-scene-elevated-lines.js +2 -2
- package/dist/components/media/map/map-scene-render-controller.js +1 -1
- package/dist/components/media/map/map.class.d.ts +15 -6
- package/dist/components/media/map/map.class.js +4 -4
- package/dist/components/media/map/map.styles.js +1 -1
- package/dist/components/media/pan-zoom/pan-zoom.class.js +1 -1
- package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +21 -9
- package/dist/components/media/sequence-playback/sequence-playback.class.js +7 -6
- package/dist/components/media/sequence-playback/sequence-playback.styles.js +1 -1
- package/dist/components/media/video/video.class.d.ts +3 -3
- package/dist/components/media/video/video.class.js +3 -1
- package/dist/components/media/video-playlist/video-playlist.class.js +1 -1
- package/dist/components/overlays/chip/chip.class.js +1 -1
- 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/tooltip.class.d.ts +5 -1
- package/dist/components/overlays/overlay/tooltip.class.js +3 -3
- package/dist/components/retrieval/embedding-explorer/embedding-explorer-engine.js +1 -1
- package/dist/components/retrieval/graph/graph-node-renderer.js +1 -1
- package/dist/components/retrieval/graph/graph-spatial-controller.js +1 -1
- package/dist/components/retrieval/graph/graph.class.d.ts +1 -1
- package/dist/components/retrieval/graph/graph.class.js +1 -1
- package/dist/components/retrieval/ingestion-queue/ingestion-queue-presentation.d.ts +11 -0
- package/dist/components/retrieval/ingestion-queue/ingestion-queue-presentation.js +1 -0
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.d.ts +18 -7
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.js +13 -26
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.styles.js +1 -1
- package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.d.ts +1 -1
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +3 -3
- package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +1 -1
- package/dist/components/utility/diff-view/diff-view.class.d.ts +5 -5
- package/dist/components/utility/diff-view/diff-view.class.js +1 -1
- package/dist/components/utility/icon/icon.class.js +1 -1
- package/dist/components/utility/json-viewer/json-viewer.class.d.ts +16 -1
- package/dist/components/utility/json-viewer/json-viewer.class.js +4 -4
- package/dist/components/utility/json-viewer/json-viewer.styles.js +1 -1
- package/dist/components/utility/known-date/known-date.class.js +1 -1
- package/dist/components/utility/mention-popover/mention-popover.class.js +1 -1
- package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
- package/dist/components/viewers/calendar-viewer/calendar-viewer.class.js +1 -1
- package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
- package/dist/components/viewers/csv-viewer/csv-viewer.class.js +1 -1
- package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +1 -1
- package/dist/components/viewers/document-preview/document-preview.class.js +2 -2
- package/dist/components/viewers/docx-viewer/docx-viewer.class.d.ts +1 -1
- package/dist/components/viewers/docx-viewer/docx-viewer.class.js +2 -2
- package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +1 -1
- package/dist/components/viewers/email-viewer/email-viewer.class.d.ts +1 -1
- package/dist/components/viewers/email-viewer/email-viewer.class.js +2 -2
- package/dist/components/viewers/html-viewer/html-viewer.class.js +1 -1
- package/dist/components/viewers/include/include.class.js +1 -1
- package/dist/components/viewers/model-viewer/model-viewer.class.js +1 -1
- package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +2 -2
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +2 -2
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +2 -2
- package/dist/components/viewers/pptx-viewer/pptx-viewer.class.js +1 -1
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +1 -1
- package/dist/components/viewers/svg-viewer/svg-viewer.class.js +1 -1
- package/dist/components/viewers/table-viewer-shared.js +4 -4
- package/dist/components/viewers/xml-viewer/xml-viewer.class.js +2 -2
- package/dist/data-sources.d.ts +10 -0
- package/dist/events.d.ts +9 -4
- package/dist/framework-types.d.ts +1 -1
- package/dist/internal/anchored-overlay-runtime.js +1 -1
- package/dist/internal/catalog-picker.js +1 -1
- package/dist/internal/default-strings/conversation.generated.js +1 -1
- package/dist/internal/default-strings/data.generated.js +1 -1
- package/dist/internal/default-strings/retrieval.generated.js +1 -1
- package/dist/internal/document-tokens.js +2 -2
- package/dist/internal/drop-session-controller.js +1 -1
- package/dist/internal/engine-3d.js +1 -1
- package/dist/internal/icon-only-content.js +1 -1
- package/dist/internal/layered-layout.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/lyra-element.js +2 -2
- package/dist/internal/map-custom-layer-controller.js +1 -1
- package/dist/internal/media-panorama.js +1 -1
- package/dist/internal/native-modal-context.js +1 -1
- package/dist/internal/overlay-manager.js +1 -1
- package/dist/internal/overlay-order.js +1 -1
- package/dist/internal/overlay-stack.js +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/runtime-diagnostics.js +1 -0
- package/dist/internal/safe-url.js +1 -1
- package/dist/internal/scoped-definitions.generated.js +1 -1
- package/dist/internal/scroll-overflow.js +1 -1
- package/dist/internal/source-cursor-controller.js +1 -0
- package/dist/internal/source-cursor-projection.js +1 -0
- package/dist/internal/source-page-scope.js +1 -1
- package/dist/internal/source-window-controller.js +1 -1
- package/dist/internal/text-quote.js +1 -1
- package/dist/internal/viewer-search.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/dist/sequence-time-binding.js +1 -1
- package/dist/simulation-clock.js +1 -1
- package/dist/styles/reservations.css +1 -1
- package/dist/styles/reservations.styles.js +1 -1
- package/dist/testing/happy-dom-shims.js +1 -1
- package/dist/theme/theme-bootstrap.js +1 -1
- package/dist/theme/theme.js +1 -1
- package/dist/utilities/overlay-manager.d.ts +2 -0
- package/llms/components/lr-attachment-chip.md +27 -12
- package/llms/components/lr-attachment-trigger.md +27 -7
- package/llms/components/lr-budget-meter.md +31 -0
- package/llms/components/lr-button.md +6 -4
- package/llms/components/lr-chat-composer.md +26 -9
- package/llms/components/lr-chat-message.md +44 -3
- package/llms/components/lr-chat-viewport.md +39 -2
- package/llms/components/lr-combobox.md +27 -1
- package/llms/components/lr-data-grid.md +2 -0
- package/llms/components/lr-dialog.md +10 -0
- package/llms/components/lr-diff-view.md +6 -0
- package/llms/components/lr-document-library.md +90 -6
- package/llms/components/lr-drop-zone.md +26 -2
- package/llms/components/lr-graph.md +5 -0
- package/llms/components/lr-icon-button.md +2 -1
- package/llms/components/lr-ingestion-queue.md +76 -8
- package/llms/components/lr-json-viewer.md +51 -0
- package/llms/components/lr-lite-chart.md +2 -1
- package/llms/components/lr-locale-picker.md +5 -0
- package/llms/components/lr-map.md +33 -0
- package/llms/components/lr-markdown-core.md +2 -1
- package/llms/components/lr-markdown.md +20 -4
- package/llms/components/lr-menu.md +3 -1
- package/llms/components/lr-message-feedback.md +38 -3
- package/llms/components/lr-number-input.md +28 -1
- package/llms/components/lr-page.md +4 -2
- package/llms/components/lr-prompt-input.md +6 -3
- package/llms/components/lr-segmented.md +30 -10
- package/llms/components/lr-sequence-playback.md +47 -12
- package/llms/components/lr-streaming-text-core.md +3 -2
- package/llms/components/lr-streaming-text.md +4 -1
- package/llms/components/lr-suggestion-chips.md +28 -5
- package/llms/components/lr-tab-group.md +13 -1
- package/llms/components/lr-tab.md +5 -0
- package/llms/components/lr-table.md +25 -4
- package/llms/components/lr-timeline-item.md +1 -1
- package/llms/components/lr-timeline.md +38 -4
- package/llms/components/lr-tooltip.md +3 -1
- package/llms/components/lr-tree.md +4 -0
- package/llms/components/lr-virtual-list.md +4 -1
- package/llms/peers.md +2 -2
- package/llms/shared/events-and-types.md +61 -2
- package/llms/shared/forms-and-accessibility.md +46 -4
- package/llms/shared/imports-and-registration.md +154 -110
- package/llms/shared/testing-and-utilities.md +5 -1
- package/llms/shared.md +266 -117
- package/locales.json +1 -1
- package/package.json +22 -21
- package/registrations.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{styleMap}from"lit/directives/style-map.js";import{sanitizeCssDeclarationValue,sanitizeCssLength}from"../../../internal/safe-css.js";import{LyraElement}from"../../../internal/lyra-element.js";import{isRtl}from"../../../internal/rtl.js";import{srOnly,nextId}from"../../../internal/a11y.js";import{finiteCount,finiteInteger,finiteRatio}from"../../../internal/numbers.js";import{trueDefaultBooleanConverter}from"../../../internal/converters.js";import{resolveCssTokenLength}from"../../../internal/css-token-length.js";import{getCollator,getNumberFormat}from"../../../internal/intl-cache.js";import{CollectionSourceTracker}from"../../../internal/collection-source-tracker.js";import{readPersistedState,writePersistedState}from"../../../internal/persisted-state.js";import{definePersistedProperty,isPersistedPropertyExplicitlySet}from"../../../internal/persisted-restore.js";import{styles}from"./table.styles.js";import{chevronIcon,closeIcon,sortIcon}from"../../../internal/icons.js";import{minMax}from"../../../internal/numbers.js";import{literalSetConverter,trueDefaultSpellcheckConverter as spellcheckConverter}from"../../../internal/converters.js";import{activeElementIn,shadowFocusTarget}from"../../../internal/active-element.js";import{AnnouncementSinkController}from"../../../internal/announcer.js";import{devWarnOnce}from"../../../internal/dev-mode-attribute-warning.js";import{normalizeSize,optionalSizeConverter}from"../../../internal/variants.js";import{markVetoGuardWrite,VetoWriteGuard}from"../../../internal/veto-write-guard.js";import{requestThenCommit}from"../../../internal/request-commit.js";import{ColumnResizePointerSession,columnResizeAriaValues,columnResizeKeyboardWidth,columnResizePointerWidth,columnResizeWidth}from"../../../internal/column-resize.js";import{renderDataState}from"../../../internal/data-state-renderer.js";import{LYRA_DEFAULT_noColumns,LYRA_DEFAULT_resizeColumn,LYRA_DEFAULT_showAllColumns,LYRA_DEFAULT_showFewerColumns,LYRA_DEFAULT_tableEditCell,LYRA_DEFAULT_tableFilterLabel,LYRA_DEFAULT_tableFilterPlaceholder,LYRA_DEFAULT_tableLoading,LYRA_DEFAULT_tableLoadingMore,LYRA_DEFAULT_tableRowLimit,LYRA_DEFAULT_tableRowTotal}from"../../../internal/default-strings/data.generated.js";import{LYRA_DEFAULT_clear,LYRA_DEFAULT_collapse,LYRA_DEFAULT_details,LYRA_DEFAULT_expand,LYRA_DEFAULT_loadMore,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_noData,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_open,LYRA_DEFAULT_resizeValuePixels,LYRA_DEFAULT_retry,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_tableLoadFailed}from"../../../internal/default-strings/shared.generated.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,DEFAULT_PAGE_SIZE=100,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_PAGINATION_FORMAT=literalSetConverter(["standard","compact"],"compact"),INTERACTIVE_SELECTOR='button, a[href], input, select, textarea, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"]), [role="button"], [role="checkbox"], [role="combobox"], [role="listbox"], [role="menu"], [role="menuitem"], [role="option"], [role="radio"], [role="separator"], [role="slider"], [role="spinbutton"], [role="switch"], [role="tab"], [role="textbox"]';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 property2=normalizeStyleProperty(rawProperty.trim()),key=`${property2}\0${value}`;let verdict=cellDeclarationVerdicts.get(key);verdict===void 0&&(verdict=sanitizeCssDeclarationValue(property2,value)??"",cellDeclarationVerdicts.size>=CELL_DECLARATION_CACHE_LIMIT&&cellDeclarationVerdicts.clear(),cellDeclarationVerdicts.set(key,verdict)),verdict&&(safe[property2]=verdict)}return safe}function normalizeStyleProperty(property2){return property2.startsWith("--")?property2:property2.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(INTERACTIVE_SELECTOR)&&!element.matches("[data-row-key], th[data-col-key]")))return element}return null}class LyraTable extends LyraElement{constructor(){super(...arguments),this.assignedSources=new CollectionSourceTracker,this._columns=Object.freeze([]),this._maxRows=MAX_TABLE_COLLECTION_ENTRIES,this.rowSourceLength=0,this._rows=Object.freeze([]),this._rowsTruncated=!1,this._layout="auto",this.sortKey="",this.sortDir="asc",this.sortIndicators="active",this.sortMode="client",this.defaultSortDir="asc",this.hostAccessibleLabel=null,this.caption="",this.captionId=nextId("lr-table-caption"),this.selectionMode="none",this.expansionMode="none",this.scrollMode="self",this._selectedKeys=new Set,this.filterable=!1,this.filterText="",this.spellcheck=!0,this.autocapitalize="",this.autoCorrect="",this.loading=!1,this.loadingAppearance="spinner",this.skeletonRows=0,this.pageSize=DEFAULT_PAGE_SIZE,this.page=1,this.totalItems=-1,this.paginationMode="client",this.unknownTotal=!1,this.paginationWithSummary=!1,this.paginationFormat="compact",this.hasNext=!0,this._expandedKeys=new Set,this.hasMore=!1,this.loadingMore=!1,this.error=!1,this.errorDescription="",this.announce=!1,this.emptyDescription="",this.emptyColumnsDescription="",this.hasHiddenPriorityColumns=!1,this.priorityToggleAvailable=!1,this.persistReady=!1,this.announcements=new AnnouncementSinkController(this,{eager:["polite","assertive"]}),this.firstUpdateAnnouncementsReady=!1,this._activeColKey=null,this._activeRowKey=null,this.editingCell=null,this.focusedEditorCell=null,this.editorHadFocusBeforeUpdate=!1,this.rovingFocusSnapshot=null,this._resizedColumnWidths=new Map,this.resizeWriteGuard=new VetoWriteGuard,this.resizePointer=new ColumnResizePointerSession(event=>this.onResizePointerMove(event),event=>this.onResizePointerEnd(event),event=>this.onResizePointerEnd(event)),this.rowsByKey=new Map,this.columnsByKey=new Map,this.layoutFrame=null,this.observedHeaders=new Set,this.priorityTierNaturalWidth=new Map,this.priorityTierHiddenAllocation=new Map,this.priorityTierRevealAllocation=new Map,this.onResizePointerDown=event=>{const handle=event.currentTarget,key=handle.dataset.colKey,column=key?this.columnsByKey.get(key):void 0,header=handle.closest("th[data-col-key]");if(!key||!column||!header||!this.ownerDocument.defaultView)return;const replacedStartWidth=this.resizeState?.key===key?this.resizeState.startWidth:void 0;this.cancelResizeGesture();const minWidth=this.minimumResizeWidth(column);this.resizeState={key,pointerId:event.pointerId,startX:event.clientX,startWidth:replacedStartWidth??header.getBoundingClientRect().width,minWidth,maxWidth:this.maximumResizeWidth(column,minWidth),handle,previousWidth:this.resizedColumnWidths.get(key)},handle.toggleAttribute("data-resizing",!0),event.preventDefault(),event.stopPropagation(),this.resizePointer.start(event,handle)},this.onResizePointerMove=event=>{const state2=this.resizeState;if(!state2||event.pointerId!==state2.pointerId)return;const width=columnResizePointerWidth(state2.startWidth,state2.startX,event.clientX,isRtl(this),state2.minWidth,state2.maxWidth);if(this.resizedColumnWidths.get(state2.key)===width)return;this._resizedColumnWidths=new Map(this.resizedColumnWidths).set(state2.key,width),markVetoGuardWrite(this.resizeWriteGuard),this.renderRoot.querySelector(`col[data-col-key="${CSS.escape(state2.key)}"]`)?.style.setProperty("inline-size",`${width}px`);const table=this.renderRoot.querySelector("table");table?.setAttribute("data-layout","fixed"),table?.setAttribute("data-has-column-widths",""),state2.handle.setAttribute("aria-valuenow",String(Math.round(width))),state2.handle.setAttribute("aria-valuetext",this.resizeValueText(width)),this.scheduleLayoutSync(),this.emit("lr-column-resize",Object.freeze({columnKey:state2.key,width}))},this.onResizeKeyDown=event=>{const handle=event.currentTarget,key=handle.dataset.colKey,column=key?this.columnsByKey.get(key):void 0;if(!column)return;const minWidth=this.minimumResizeWidth(column),maxWidth=this.maximumResizeWidth(column,minWidth),currentWidth=this.currentResizeWidth(column,handle),requestedWidth=columnResizeKeyboardWidth(event,currentWidth,minWidth,maxWidth,isRtl(this));requestedWidth!==void 0&&(event.preventDefault(),event.stopPropagation(),this.resizeColumnTo(column,requestedWidth))},this.onResizePointerEnd=event=>{const state2=this.resizeState;if(!state2||event.pointerId!==state2.pointerId)return;if(state2.handle.removeAttribute("data-resizing"),this.resizeState=void 0,this.resizePointer.stop(),event.type!=="pointerup"){this.rollbackResizePreview(state2);return}this.requestUpdate("resizedColumnWidths");const committedWidth=this.resizedColumnWidths.get(state2.key);if(committedWidth===void 0||committedWidth===state2.previousWidth)return;this.resizeWriteGuard.open();const request=this.emit("lr-column-resize-request",Object.freeze({columnKey:state2.key,width:committedWidth}),{cancelable:!0});if(!this.resizeWriteGuard.touched){if(request.defaultPrevented){this.rollbackResizePreview(state2);return}this.emit("lr-column-resize",Object.freeze({columnKey:state2.key,width:committedWidth}))}},this.scheduleLayoutSync=()=>{if(this.layoutFrame)return;const owner=this.ownerDocument.defaultView;if(!owner)return;const frame={owner,handle:0};frame.handle=owner.requestAnimationFrame(()=>{this.layoutFrame===frame&&(this.layoutFrame=null,!(!this.isConnected||this.ownerDocument.defaultView!==owner)&&this.syncLayoutGeometry())}),this.layoutFrame=frame},this.cachedCanonicalRowEntries=null,this.canonicalRowEntriesInputs=null,this.cachedMatchingEntries=null,this.matchingEntriesInputs=null,this.cachedSortedEntries=null,this.sortedEntriesInputs=null,this.publicRowsMemo=new WeakMap,this.aggregateValues=new Map,this.onFilterInput=event=>{event.stopPropagation();const input=event.currentTarget;this.filterText=input.value,this.emit("lr-filter-change",Object.freeze({filterText:this.filterText}))},this.onClearFilter=()=>{this.filterText!==""&&(this.filterText="",this.emit("lr-filter-change",Object.freeze({filterText:""})),this.renderRoot.querySelector('[part="filter"]')?.focus())},this.stopOwnedEvent=event=>{event.stopPropagation()},this.onNativeFocus=event=>{event.stopPropagation(),relayNativeEvent(this,event)},this.onNativeBlur=event=>{event.stopPropagation(),relayNativeEvent(this,event)},this.onPaginationChange=event=>{event.stopPropagation();const{page}=event.detail;this.paginationMode==="client"&&(this.page=page),this.emit("lr-page-change",Object.freeze({page}))},this.onTableFocusIn=event=>{const target=event.target,cell=target?.closest?.("td[data-col-key]"),row=target?.closest?.("[data-row-key]"),columnKey=cell?.dataset.colKey,rowKey=row?.dataset.rowKey;this.focusedEditorCell=target?.getAttribute("part")==="cell-editor"&&columnKey!==void 0&&rowKey!==void 0&&normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger)==="always"?{rowKey,columnKey}:null},this.onEditorKeyDown=(event,rowKey,columnKey)=>{event.stopPropagation();const alwaysOn=normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger)==="always";event.key==="Enter"?(event.preventDefault(),this.commitEdit(event,rowKey,columnKey)):event.key==="Escape"&&!alwaysOn&&(event.preventDefault(),this.editingCell=null)},this.onTableDoubleClick=event=>{const target=event.target,table=event.currentTarget;if(eventInteractiveTarget(event,table))return;const cell=target.closest('[part="cell"][data-col-key]'),row=target.closest("[data-row-key]");cell&&row?.dataset.rowKey&&cell.dataset.colKey&&this.startEditing(row.dataset.rowKey,cell.dataset.colKey)},this.toggleColumns=()=>{this.priorityColumnsVisible=!this.priorityColumnsVisible,this.emit("lr-priority-columns-visibility-change",Object.freeze({visible:this.priorityColumnsVisible}))},this.onExpandToggleClick=event=>{const token=event.currentTarget.closest("tr[data-row-key]")?.dataset.rowKey,entry=token===void 0?void 0:this.rowsByKey.get(token);entry&&this.activateExpandToggle(entry.key)},this.onTableClick=e=>{const target=e.target,table=e.currentTarget;if(eventInteractiveTarget(e,table))return;const th=target.closest("th[data-col-key]");if(th)return this.activateColumn(th.dataset.colKey);const tr=target.closest("[data-row-key]");tr&&this.activateRow(tr.dataset.rowKey)},this.onTableKeyDown=e=>{const target=e.target,table=e.currentTarget;if(eventInteractiveTarget(e,table)||(e.altKey||e.metaKey)&&e.key.startsWith("Arrow"))return;const th=target.closest("th[data-col-key]");if(th)return this.onHeaderKeyDown(e,th);const tr=target.closest("[data-row-key]");tr&&this.onRowKeyDown(e,tr)}}static{this.defaultStrings={...super.defaultStrings,clear:LYRA_DEFAULT_clear,collapse:LYRA_DEFAULT_collapse,details:LYRA_DEFAULT_details,expand:LYRA_DEFAULT_expand,loadMore:LYRA_DEFAULT_loadMore,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,noColumns:LYRA_DEFAULT_noColumns,noData:LYRA_DEFAULT_noData,noMatches:LYRA_DEFAULT_noMatches,open:LYRA_DEFAULT_open,resizeColumn:LYRA_DEFAULT_resizeColumn,resizeValuePixels:LYRA_DEFAULT_resizeValuePixels,retry:LYRA_DEFAULT_retry,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,showAllColumns:LYRA_DEFAULT_showAllColumns,showFewerColumns:LYRA_DEFAULT_showFewerColumns,tableEditCell:LYRA_DEFAULT_tableEditCell,tableFilterLabel:LYRA_DEFAULT_tableFilterLabel,tableFilterPlaceholder:LYRA_DEFAULT_tableFilterPlaceholder,tableLoadFailed:LYRA_DEFAULT_tableLoadFailed,tableLoading:LYRA_DEFAULT_tableLoading,tableLoadingMore:LYRA_DEFAULT_tableLoadingMore,tableRowLimit:LYRA_DEFAULT_tableRowLimit,tableRowTotal:LYRA_DEFAULT_tableRowTotal}}static{this.styles=[LyraElement.styles,styles,srOnly]}isRebind(name,value,current){return this.assignedSources.isRebind(name,value,current)}get columns(){return this._columns}set columns(value){if(this.isRebind("columns",value,this._columns))return;const previous=this._columns,columns=[],seen=new Set;let length=0;try{if(Array.isArray(value)){const descriptor=Object.getOwnPropertyDescriptor(value,"length"),sourceLength=descriptor&&"value"in descriptor?descriptor.value:0;typeof sourceLength=="number"&&Number.isSafeInteger(sourceLength)&&sourceLength>=0&&(length=Math.min(sourceLength,MAX_TABLE_COLLECTION_ENTRIES))}}catch{length=0}for(let index=0;index<length;index+=1){let descriptor;try{descriptor=Object.getOwnPropertyDescriptor(value,String(index))}catch{continue}if(!descriptor||!("value"in descriptor))continue;const column=descriptor.value;try{const key=column?.key;if(typeof key!="string"||key.trim().length===0||seen.has(key))continue;seen.add(key),columns.push(column)}catch{}}this._columns=frozenArray(columns),this.requestUpdate("columns",previous)}get maxRows(){return this._maxRows}set maxRows(value){const limit=Math.max(1,finiteCount(value,MAX_TABLE_COLLECTION_ENTRIES,MAX_TABLE_ROWS)),previous=this._maxRows;if(previous!==limit){if(this._maxRows=limit,this._rows){const source=this.rowSource?.deref();source&&(this.rowSourceLength=source.length),this.admitRows(source??this._rows,this.rowSourceLength)}if(this._selectedKeys?.size>limit&&this.commitSelectedKeys(keySet(this._selectedKeys,limit)),this._expandedKeys?.size>limit){const previousKeys=this._expandedKeys,next=keySet(previousKeys,limit);this.isRebind("expandedRowKeys",next,previousKeys),this._expandedKeys=next,this.requestUpdate("expandedRowKeys",previousKeys)}this.requestUpdate("maxRows",previous)}}get rows(){return this._rows}set rows(value){this.isRebind("rows",value,this._rows)||(this.rowSource=Array.isArray(value)?new WeakRef(value):void 0,this.rowSourceLength=Array.isArray(value)?value.length:0,this.admitRows(value,this.rowSourceLength))}admitRows(value,sourceLength){const previous=this._rows;this._rows=frozenArray(Array.isArray(value)?value:[],this.maxRows),this._rowsTruncated=sourceLength>this._rows.length,this.requestUpdate("rows",previous)}get rowsTruncated(){return this._rowsTruncated}get layout(){return this._layout}set layout(next){const normalized=TABLE_LAYOUT.normalizeReflected(this,"layout",next),old=this._layout;old!==normalized&&(this._layout=normalized,this.requestUpdate("layout",old))}get selectedRowKeys(){return storedKeySetFacade(this._selectedKeys)}set selectedRowKeys(value){if(this.isRebind("selectedRowKeys",value,storedKeySetFacade(this._selectedKeys)))return;const previous=this._selectedKeys;this._selectedKeys=keySet(value??[],this.maxRows),this.requestUpdate("selectedRowKeys",previous)}get expandedRowKeys(){return storedKeySetFacade(this._expandedKeys)}set expandedRowKeys(value){if(this.isRebind("expandedRowKeys",value,storedKeySetFacade(this._expandedKeys)))return;const previous=this._expandedKeys;this._expandedKeys=keySet(value??[],this.maxRows),this.requestUpdate("expandedRowKeys",previous)}asKeySet(keys){return keys}asKeyList(keys){return keys}get emptySize(){return this._emptySize}set emptySize(value){const previous=this._emptySize,next=optionalSizeConverter.normalize(value);next!==previous&&(this._emptySize=next,this.requestUpdate("emptySize",previous))}get priorityColumnsToggleAvailable(){return this.priorityToggleAvailable}static{definePersistedProperty(this.prototype,"priorityColumnsVisible",{initial:!1,attribute:"priority-columns-visible",type:Boolean,reflect:!0})}get storageFullKey(){return this.storageKey?`lr-table:${this.storageKey}`:void 0}get activeColKey(){return this._activeColKey}set activeColKey(value){this._activeColKey=value,this.patchRovingTabStop("th[data-col-key]","data-col-key",value)}get activeRowKey(){return this._activeRowKey}set activeRowKey(value){this._activeRowKey=value,this.patchRovingTabStop("tbody tr[data-row-key]","data-row-key",value)}patchRovingTabStop(selector,attribute,value){const next=value===null?null:this.renderRoot?.querySelector(`${selector}[${attribute}="${CSS.escape(value)}"]`);if(!next)return;const previous=this.renderRoot.querySelector(`${selector}[tabindex="0"]`);previous&&previous!==next&&(previous.tabIndex=-1),next.tabIndex=0}get resizedColumnWidths(){return this._resizedColumnWidths}set resizedColumnWidths(value){const previous=this._resizedColumnWidths;this._resizedColumnWidths=value,markVetoGuardWrite(this.resizeWriteGuard),this.requestUpdate("resizedColumnWidths",previous)}parsePixelLength(value){if(!value)return;const trimmed=value.trim();if(!trimmed.endsWith("px"))return;const parsed=Number.parseFloat(trimmed);return Number.isFinite(parsed)?parsed:void 0}minimumResizeWidth(column){const explicit=this.parsePixelLength(column.minWidth);if(explicit!==void 0)return Math.max(0,explicit);const cached=this.themedResizeMinWidth;if(cached&&cached.document===this.ownerDocument)return cached.width;const width=this.resolveThemedResizeMinWidth();return this.themedResizeMinWidth={document:this.ownerDocument,width},width}resolveThemedResizeMinWidth(){const hostStyle=this.ownerDocument.defaultView?.getComputedStyle(this),themed=hostStyle?.getPropertyValue("--lr-table-resize-min-width").trim()||hostStyle?.getPropertyValue("--_lr-table-resize-min-width-default").trim()||"",resolved=resolveCssTokenLength(themed,{host:this});return resolved===void 0?DEFAULT_RESIZE_MIN_WIDTH_PX:Math.max(0,resolved)}maximumResizeWidth(column,minWidth){const explicit=this.parsePixelLength(column.maxWidth);return explicit===void 0?Number.POSITIVE_INFINITY:Math.max(minWidth,explicit)}currentResizeWidth(column,handle){const resized=this.resizedColumnWidths.get(column.key);if(resized!==void 0)return resized;const explicit=this.parsePixelLength(column.width);if(explicit!==void 0)return explicit;const rendered=handle?.closest("th[data-col-key]")?.getBoundingClientRect().width;return rendered&&rendered>0?rendered:this.minimumResizeWidth(column)}resizeValueText(width){return this.localize("resizeValuePixels",void 0,{value:getNumberFormat(this.effectiveLocale).format(Math.round(width))})}resizeColumnTo(column,requestedWidth){const minWidth=this.minimumResizeWidth(column),maxWidth=this.maximumResizeWidth(column,minWidth),width=columnResizeWidth(requestedWidth,minWidth,maxWidth);this.resizedColumnWidths.get(column.key)!==width&&requestThenCommit({requestDetail:Object.freeze({columnKey:column.key,width}),emitRequest:(detail,init)=>this.emit("lr-column-resize-request",detail,init),guard:this.resizeWriteGuard,commit:()=>{this.resizedColumnWidths=new Map(this.resizedColumnWidths).set(column.key,width),this.emit("lr-column-resize",Object.freeze({columnKey:column.key,width})),markVetoGuardWrite(this.resizeWriteGuard)}})}renderedColumnWidth(column){const resized=this.resizedColumnWidths.get(column.key);return resized===void 0?sanitizeCssLength(column.width,"height"):`${resized}px`}renderResizeHandle(column){if(!column.resizable)return nothing;const minWidth=this.minimumResizeWidth(column),maxWidth=this.maximumResizeWidth(column,minWidth),width=this.currentResizeWidth(column),aria=columnResizeAriaValues(width,minWidth,maxWidth);return html`<span
|
|
1
|
+
import{__decorate}from"tslib";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{repeat}from"lit/directives/repeat.js";import{styleMap}from"lit/directives/style-map.js";import{sanitizeCssDeclarationValue,sanitizeCssLength}from"../../../internal/safe-css.js";import{LyraElement}from"../../../internal/lyra-element.js";import{isRtl}from"../../../internal/rtl.js";import{srOnly,nextId}from"../../../internal/a11y.js";import{finiteCount,finiteInteger,finiteRatio}from"../../../internal/numbers.js";import{trueDefaultBooleanConverter}from"../../../internal/converters.js";import{resolveCssTokenLength}from"../../../internal/css-token-length.js";import{getCollator,getNumberFormat}from"../../../internal/intl-cache.js";import{CollectionSourceTracker}from"../../../internal/collection-source-tracker.js";import{readPersistedState,writePersistedState}from"../../../internal/persisted-state.js";import{definePersistedProperty,isPersistedPropertyExplicitlySet}from"../../../internal/persisted-restore.js";import{styles}from"./table.styles.js";import{chevronIcon,closeIcon,sortIcon}from"../../../internal/icons.js";import{minMax}from"../../../internal/numbers.js";import{literalSetConverter,trueDefaultSpellcheckConverter as spellcheckConverter}from"../../../internal/converters.js";import{activeElementIn,shadowFocusTarget}from"../../../internal/active-element.js";import{AnnouncementSinkController}from"../../../internal/announcer.js";import{devWarnOnce}from"../../../internal/dev-mode-attribute-warning.js";import{normalizeSize,optionalSizeConverter}from"../../../internal/variants.js";import{markVetoGuardWrite,VetoWriteGuard}from"../../../internal/veto-write-guard.js";import{requestThenCommit}from"../../../internal/request-commit.js";import{ColumnResizePointerSession,columnResizeAriaValues,columnResizeKeyboardWidth,columnResizePointerWidth,columnResizeWidth}from"../../../internal/column-resize.js";import{renderDataState}from"../../../internal/data-state-renderer.js";import{LYRA_DEFAULT_noColumns,LYRA_DEFAULT_resizeColumn,LYRA_DEFAULT_showAllColumns,LYRA_DEFAULT_showFewerColumns,LYRA_DEFAULT_tableEditCell,LYRA_DEFAULT_tableFilterLabel,LYRA_DEFAULT_tableFilterPlaceholder,LYRA_DEFAULT_tableLoading,LYRA_DEFAULT_tableLoadingMore,LYRA_DEFAULT_tableRowLimit,LYRA_DEFAULT_tableRowTotal}from"../../../internal/default-strings/data.generated.js";import{LYRA_DEFAULT_clear,LYRA_DEFAULT_collapse,LYRA_DEFAULT_details,LYRA_DEFAULT_expand,LYRA_DEFAULT_loadMore,LYRA_DEFAULT_loading,LYRA_DEFAULT_map,LYRA_DEFAULT_navigation,LYRA_DEFAULT_noData,LYRA_DEFAULT_noMatches,LYRA_DEFAULT_open,LYRA_DEFAULT_resizeValuePixels,LYRA_DEFAULT_retry,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_tableLoadFailed}from"../../../internal/default-strings/shared.generated.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,DEFAULT_PAGE_SIZE=100,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_PAGINATION_FORMAT=literalSetConverter(["standard","compact"],"compact"),INTERACTIVE_SELECTOR='button, a[href], input, select, textarea, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"]), [role="button"], [role="checkbox"], [role="combobox"], [role="listbox"], [role="menu"], [role="menuitem"], [role="option"], [role="radio"], [role="separator"], [role="slider"], [role="spinbutton"], [role="switch"], [role="tab"], [role="textbox"]';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 property2=normalizeStyleProperty(rawProperty.trim()),key=`${property2}\0${value}`;let verdict=cellDeclarationVerdicts.get(key);verdict===void 0&&(verdict=sanitizeCssDeclarationValue(property2,value)??"",cellDeclarationVerdicts.size>=CELL_DECLARATION_CACHE_LIMIT&&cellDeclarationVerdicts.clear(),cellDeclarationVerdicts.set(key,verdict)),verdict&&(safe[property2]=verdict)}return safe}function normalizeStyleProperty(property2){return property2.startsWith("--")?property2:property2.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(INTERACTIVE_SELECTOR)&&!element.matches("[data-row-key], th[data-col-key]")))return element}return null}class LyraTable extends LyraElement{constructor(){super(...arguments),this.assignedSources=new CollectionSourceTracker,this._columns=Object.freeze([]),this._maxRows=MAX_TABLE_COLLECTION_ENTRIES,this.rowSourceLength=0,this._rows=Object.freeze([]),this._rowsTruncated=!1,this._layout="auto",this.sortKey="",this.sortDir="asc",this.sortIndicators="active",this.sortMode="client",this.defaultSortDir="asc",this.hostAccessibleLabel=null,this.caption="",this.captionId=nextId("lr-table-caption"),this.selectionMode="none",this.expansionMode="none",this.scrollMode="self",this._selectedKeys=new Set,this.filterable=!1,this.filterText="",this.spellcheck=!0,this.autocapitalize="",this.autoCorrect="",this.loading=!1,this.loadingAppearance="spinner",this.skeletonRows=0,this.pageSize=DEFAULT_PAGE_SIZE,this.page=1,this.totalItems=-1,this.paginationMode="client",this.unknownTotal=!1,this.paginationWithSummary=!1,this.paginationFormat="compact",this.hasNext=!0,this._expandedKeys=new Set,this.hasMore=!1,this.loadingMore=!1,this.error=!1,this.errorDescription="",this.announce=!1,this.emptyDescription="",this.emptyColumnsDescription="",this.hasHiddenPriorityColumns=!1,this.priorityToggleAvailable=!1,this.persistReady=!1,this.announcements=new AnnouncementSinkController(this,{eager:["polite","assertive"]}),this.firstUpdateAnnouncementsReady=!1,this._activeColKey=null,this._activeRowKey=null,this.editingCell=null,this.focusedEditorCell=null,this.editorHadFocusBeforeUpdate=!1,this.rovingFocusSnapshot=null,this._resizedColumnWidths=new Map,this.resizeWriteGuard=new VetoWriteGuard,this.resizePointer=new ColumnResizePointerSession(event=>this.onResizePointerMove(event),event=>this.onResizePointerEnd(event),event=>this.onResizePointerEnd(event)),this.rowsByKey=new Map,this.columnsByKey=new Map,this.layoutFrame=null,this.observedHeaders=new Set,this.priorityTierNaturalWidth=new Map,this.priorityTierHiddenAllocation=new Map,this.priorityTierRevealAllocation=new Map,this.onResizePointerDown=event=>{const handle=event.currentTarget,key=handle.dataset.colKey,column=key?this.columnsByKey.get(key):void 0,header=handle.closest("th[data-col-key]");if(!key||!column||!header||!this.ownerDocument.defaultView)return;const replacedStartWidth=this.resizeState?.key===key?this.resizeState.startWidth:void 0;this.cancelResizeGesture();const minWidth=this.minimumResizeWidth(column);this.resizeState={key,pointerId:event.pointerId,startX:event.clientX,startWidth:replacedStartWidth??header.getBoundingClientRect().width,minWidth,maxWidth:this.maximumResizeWidth(column,minWidth),handle,previousWidth:this.resizedColumnWidths.get(key)},handle.toggleAttribute("data-resizing",!0),event.preventDefault(),event.stopPropagation(),this.resizePointer.start(event,handle)},this.onResizePointerMove=event=>{const state2=this.resizeState;if(!state2||event.pointerId!==state2.pointerId)return;const width=columnResizePointerWidth(state2.startWidth,state2.startX,event.clientX,isRtl(this),state2.minWidth,state2.maxWidth);if(this.resizedColumnWidths.get(state2.key)===width)return;this._resizedColumnWidths=new Map(this.resizedColumnWidths).set(state2.key,width),markVetoGuardWrite(this.resizeWriteGuard),this.renderRoot.querySelector(`col[data-col-key="${CSS.escape(state2.key)}"]`)?.style.setProperty("inline-size",`${width}px`);const table=this.renderRoot.querySelector("table");table?.setAttribute("data-layout","fixed"),table?.setAttribute("data-has-column-widths",""),state2.handle.setAttribute("aria-valuenow",String(Math.round(width))),state2.handle.setAttribute("aria-valuetext",this.resizeValueText(width)),this.scheduleLayoutSync(),this.emit("lr-column-resize",Object.freeze({columnKey:state2.key,width}))},this.onResizeKeyDown=event=>{const handle=event.currentTarget,key=handle.dataset.colKey,column=key?this.columnsByKey.get(key):void 0;if(!column)return;const minWidth=this.minimumResizeWidth(column),maxWidth=this.maximumResizeWidth(column,minWidth),currentWidth=this.currentResizeWidth(column,handle),requestedWidth=columnResizeKeyboardWidth(event,currentWidth,minWidth,maxWidth,isRtl(this));requestedWidth!==void 0&&(event.preventDefault(),event.stopPropagation(),this.resizeColumnTo(column,requestedWidth))},this.onResizePointerEnd=event=>{const state2=this.resizeState;if(!state2||event.pointerId!==state2.pointerId)return;if(state2.handle.removeAttribute("data-resizing"),this.resizeState=void 0,this.resizePointer.stop(),event.type!=="pointerup"){this.rollbackResizePreview(state2);return}this.requestUpdate("resizedColumnWidths");const committedWidth=this.resizedColumnWidths.get(state2.key);if(committedWidth===void 0||committedWidth===state2.previousWidth)return;this.resizeWriteGuard.open();const request=this.emit("lr-column-resize-request",Object.freeze({columnKey:state2.key,width:committedWidth}),{cancelable:!0});if(!this.resizeWriteGuard.touched){if(request.defaultPrevented){this.rollbackResizePreview(state2);return}this.emit("lr-column-resize",Object.freeze({columnKey:state2.key,width:committedWidth}))}},this.scheduleLayoutSync=()=>{if(this.layoutFrame)return;const owner=this.ownerDocument.defaultView;if(!owner)return;const frame={owner,handle:0};frame.handle=owner.requestAnimationFrame(()=>{this.layoutFrame===frame&&(this.layoutFrame=null,!(!this.isConnected||this.ownerDocument.defaultView!==owner)&&this.syncLayoutGeometry())}),this.layoutFrame=frame},this.cachedCanonicalRowEntries=null,this.canonicalRowEntriesInputs=null,this.cachedMatchingEntries=null,this.matchingEntriesInputs=null,this.cachedSortedEntries=null,this.sortedEntriesInputs=null,this.publicRowsMemo=new WeakMap,this.aggregateValues=new Map,this.onFilterInput=event=>{event.stopPropagation();const input=event.currentTarget;this.filterText=input.value,this.emit("lr-filter-change",Object.freeze({filterText:this.filterText}))},this.onClearFilter=()=>{this.filterText!==""&&(this.filterText="",this.emit("lr-filter-change",Object.freeze({filterText:""})),this.renderRoot.querySelector('[part="filter"]')?.focus())},this.stopOwnedEvent=event=>{event.stopPropagation()},this.onNativeFocus=event=>{event.stopPropagation(),relayNativeEvent(this,event)},this.onNativeBlur=event=>{event.stopPropagation(),relayNativeEvent(this,event)},this.onPaginationChange=event=>{event.stopPropagation();const{page}=event.detail;this.paginationMode==="client"&&(this.page=page),this.emit("lr-page-change",Object.freeze({page}))},this.onTableFocusIn=event=>{const target=event.target,cell=target?.closest?.("td[data-col-key]"),row=target?.closest?.("[data-row-key]"),columnKey=cell?.dataset.colKey,rowKey=row?.dataset.rowKey;this.focusedEditorCell=target?.getAttribute("part")==="cell-editor"&&columnKey!==void 0&&rowKey!==void 0&&normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger)==="always"?{rowKey,columnKey}:null},this.onEditorKeyDown=(event,rowKey,columnKey)=>{event.stopPropagation();const alwaysOn=normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger)==="always";event.key==="Enter"?(event.preventDefault(),this.commitEdit(event,rowKey,columnKey)):event.key==="Escape"&&!alwaysOn&&(event.preventDefault(),this.editingCell=null)},this.onTableDoubleClick=event=>{const target=event.target,table=event.currentTarget;if(eventInteractiveTarget(event,table))return;const cell=target.closest('[part="cell"][data-col-key]'),row=target.closest("[data-row-key]");cell&&row?.dataset.rowKey&&cell.dataset.colKey&&this.startEditing(row.dataset.rowKey,cell.dataset.colKey)},this.toggleColumns=()=>{this.priorityColumnsVisible=!this.priorityColumnsVisible,this.emit("lr-priority-columns-visibility-change",Object.freeze({visible:this.priorityColumnsVisible}))},this.onExpandToggleClick=event=>{const token=event.currentTarget.closest("tr[data-row-key]")?.dataset.rowKey,entry=token===void 0?void 0:this.rowsByKey.get(token);entry&&this.activateExpandToggle(entry.key)},this.onTableClick=e=>{const target=e.target,table=e.currentTarget;if(eventInteractiveTarget(e,table))return;const th=target.closest("th[data-col-key]");if(th)return this.activateColumn(th.dataset.colKey);const tr=target.closest("[data-row-key]");tr&&this.activateRow(tr.dataset.rowKey)},this.onTableKeyDown=e=>{const target=e.target,table=e.currentTarget;if(eventInteractiveTarget(e,table)||(e.altKey||e.metaKey)&&e.key.startsWith("Arrow"))return;const th=target.closest("th[data-col-key]");if(th)return this.onHeaderKeyDown(e,th);const tr=target.closest("[data-row-key]");tr&&this.onRowKeyDown(e,tr)}}static{this.defaultStrings={...super.defaultStrings,clear:LYRA_DEFAULT_clear,collapse:LYRA_DEFAULT_collapse,details:LYRA_DEFAULT_details,expand:LYRA_DEFAULT_expand,loadMore:LYRA_DEFAULT_loadMore,loading:LYRA_DEFAULT_loading,map:LYRA_DEFAULT_map,navigation:LYRA_DEFAULT_navigation,noColumns:LYRA_DEFAULT_noColumns,noData:LYRA_DEFAULT_noData,noMatches:LYRA_DEFAULT_noMatches,open:LYRA_DEFAULT_open,resizeColumn:LYRA_DEFAULT_resizeColumn,resizeValuePixels:LYRA_DEFAULT_resizeValuePixels,retry:LYRA_DEFAULT_retry,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,showAllColumns:LYRA_DEFAULT_showAllColumns,showFewerColumns:LYRA_DEFAULT_showFewerColumns,tableEditCell:LYRA_DEFAULT_tableEditCell,tableFilterLabel:LYRA_DEFAULT_tableFilterLabel,tableFilterPlaceholder:LYRA_DEFAULT_tableFilterPlaceholder,tableLoadFailed:LYRA_DEFAULT_tableLoadFailed,tableLoading:LYRA_DEFAULT_tableLoading,tableLoadingMore:LYRA_DEFAULT_tableLoadingMore,tableRowLimit:LYRA_DEFAULT_tableRowLimit,tableRowTotal:LYRA_DEFAULT_tableRowTotal}}static{this.styles=[LyraElement.styles,styles,srOnly]}isRebind(name,value,current){return this.assignedSources.isRebind(name,value,current)}get columns(){return this._columns}set columns(value){if(this.isRebind("columns",value,this._columns))return;const previous=this._columns,columns=[],seen=new Set;let length=0;try{if(Array.isArray(value)){const descriptor=Object.getOwnPropertyDescriptor(value,"length"),sourceLength=descriptor&&"value"in descriptor?descriptor.value:0;typeof sourceLength=="number"&&Number.isSafeInteger(sourceLength)&&sourceLength>=0&&(length=Math.min(sourceLength,MAX_TABLE_COLLECTION_ENTRIES))}}catch{length=0}for(let index=0;index<length;index+=1){let descriptor;try{descriptor=Object.getOwnPropertyDescriptor(value,String(index))}catch{continue}if(!descriptor||!("value"in descriptor))continue;const column=descriptor.value;try{const key=column?.key;if(typeof key!="string"||key.trim().length===0||seen.has(key))continue;seen.add(key),columns.push(column)}catch{}}this._columns=frozenArray(columns),this.requestUpdate("columns",previous)}get maxRows(){return this._maxRows}set maxRows(value){const limit=Math.max(1,finiteCount(value,MAX_TABLE_COLLECTION_ENTRIES,MAX_TABLE_ROWS)),previous=this._maxRows;if(previous!==limit){if(this._maxRows=limit,this._rows){const source=this.rowSource?.deref();source&&(this.rowSourceLength=source.length),this.admitRows(source??this._rows,this.rowSourceLength)}if(this._selectedKeys?.size>limit&&this.commitSelectedKeys(keySet(this._selectedKeys,limit)),this._expandedKeys?.size>limit){const previousKeys=this._expandedKeys,next=keySet(previousKeys,limit);this.isRebind("expandedRowKeys",next,previousKeys),this._expandedKeys=next,this.requestUpdate("expandedRowKeys",previousKeys)}this.requestUpdate("maxRows",previous)}}get rows(){return this._rows}set rows(value){this.isRebind("rows",value,this._rows)||(this.rowSource=Array.isArray(value)?new WeakRef(value):void 0,this.rowSourceLength=Array.isArray(value)?value.length:0,this.admitRows(value,this.rowSourceLength))}admitRows(value,sourceLength){const previous=this._rows;this._rows=frozenArray(Array.isArray(value)?value:[],this.maxRows),this._rowsTruncated=sourceLength>this._rows.length,this.requestUpdate("rows",previous)}get rowsTruncated(){return this._rowsTruncated}get layout(){return this._layout}set layout(next){const normalized=TABLE_LAYOUT.normalizeReflected(this,"layout",next),old=this._layout;old!==normalized&&(this._layout=normalized,this.requestUpdate("layout",old))}get selectedRowKeys(){return storedKeySetFacade(this._selectedKeys)}set selectedRowKeys(value){if(this.isRebind("selectedRowKeys",value,storedKeySetFacade(this._selectedKeys)))return;const previous=this._selectedKeys;this._selectedKeys=keySet(value??[],this.maxRows),this.requestUpdate("selectedRowKeys",previous)}get expandedRowKeys(){return storedKeySetFacade(this._expandedKeys)}set expandedRowKeys(value){if(this.isRebind("expandedRowKeys",value,storedKeySetFacade(this._expandedKeys)))return;const previous=this._expandedKeys;this._expandedKeys=keySet(value??[],this.maxRows),this.requestUpdate("expandedRowKeys",previous)}asKeySet(keys){return keys}asKeyList(keys){return keys}get emptySize(){return this._emptySize}set emptySize(value){const previous=this._emptySize,next=optionalSizeConverter.normalize(value);next!==previous&&(this._emptySize=next,this.requestUpdate("emptySize",previous))}get priorityColumnsToggleAvailable(){return this.priorityToggleAvailable}static{definePersistedProperty(this.prototype,"priorityColumnsVisible",{initial:!1,attribute:"priority-columns-visible",type:Boolean,reflect:!0})}get storageFullKey(){return this.storageKey?`lr-table:${this.storageKey}`:void 0}get activeColKey(){return this._activeColKey}set activeColKey(value){this._activeColKey=value,this.patchRovingTabStop("th[data-col-key]","data-col-key",value)}get activeRowKey(){return this._activeRowKey}set activeRowKey(value){this._activeRowKey=value,this.patchRovingTabStop("tbody tr[data-row-key]","data-row-key",value)}patchRovingTabStop(selector,attribute,value){const next=value===null?null:this.renderRoot?.querySelector(`${selector}[${attribute}="${CSS.escape(value)}"]`);if(!next)return;const previous=this.renderRoot.querySelector(`${selector}[tabindex="0"]`);previous&&previous!==next&&(previous.tabIndex=-1),next.tabIndex=0}get resizedColumnWidths(){return this._resizedColumnWidths}set resizedColumnWidths(value){const previous=this._resizedColumnWidths;this._resizedColumnWidths=value,markVetoGuardWrite(this.resizeWriteGuard),this.requestUpdate("resizedColumnWidths",previous)}parsePixelLength(value){if(!value)return;const trimmed=value.trim();if(!trimmed.endsWith("px"))return;const parsed=Number.parseFloat(trimmed);return Number.isFinite(parsed)?parsed:void 0}minimumResizeWidth(column){const explicit=this.parsePixelLength(column.minWidth);if(explicit!==void 0)return Math.max(0,explicit);const cached=this.themedResizeMinWidth;if(cached&&cached.document===this.ownerDocument)return cached.width;const width=this.resolveThemedResizeMinWidth();return this.themedResizeMinWidth={document:this.ownerDocument,width},width}resolveThemedResizeMinWidth(){const hostStyle=this.ownerDocument.defaultView?.getComputedStyle(this),themed=hostStyle?.getPropertyValue("--lr-table-resize-min-width").trim()||hostStyle?.getPropertyValue("--_lr-table-resize-min-width-default").trim()||"",resolved=resolveCssTokenLength(themed,{host:this});return resolved===void 0?DEFAULT_RESIZE_MIN_WIDTH_PX:Math.max(0,resolved)}maximumResizeWidth(column,minWidth){const explicit=this.parsePixelLength(column.maxWidth);return explicit===void 0?Number.POSITIVE_INFINITY:Math.max(minWidth,explicit)}currentResizeWidth(column,handle){const resized=this.resizedColumnWidths.get(column.key);if(resized!==void 0)return resized;const explicit=this.parsePixelLength(column.width);if(explicit!==void 0)return explicit;const rendered=handle?.closest("th[data-col-key]")?.getBoundingClientRect().width;return rendered&&rendered>0?rendered:this.minimumResizeWidth(column)}resizeValueText(width){return this.localize("resizeValuePixels",void 0,{value:getNumberFormat(this.effectiveLocale).format(Math.round(width))})}resizeColumnTo(column,requestedWidth){const minWidth=this.minimumResizeWidth(column),maxWidth=this.maximumResizeWidth(column,minWidth),width=columnResizeWidth(requestedWidth,minWidth,maxWidth);this.resizedColumnWidths.get(column.key)!==width&&requestThenCommit({requestDetail:Object.freeze({columnKey:column.key,width}),emitRequest:(detail,init)=>this.emit("lr-column-resize-request",detail,init),guard:this.resizeWriteGuard,commit:()=>{this.resizedColumnWidths=new Map(this.resizedColumnWidths).set(column.key,width),this.emit("lr-column-resize",Object.freeze({columnKey:column.key,width})),markVetoGuardWrite(this.resizeWriteGuard)}})}renderedColumnWidth(column){const resized=this.resizedColumnWidths.get(column.key);return resized===void 0?sanitizeCssLength(column.width,"height"):`${resized}px`}renderResizeHandle(column){if(!column.resizable)return nothing;const minWidth=this.minimumResizeWidth(column),maxWidth=this.maximumResizeWidth(column,minWidth),width=this.currentResizeWidth(column),aria=columnResizeAriaValues(width,minWidth,maxWidth);return html`<span
|
|
2
2
|
part="resize-handle"
|
|
3
3
|
data-col-key=${column.key}
|
|
4
4
|
role="separator"
|
|
@@ -11,7 +11,7 @@ import{__decorate}from"tslib";import{relayNativeEvent}from"../../../internal/nat
|
|
|
11
11
|
aria-valuemax=${aria.max}
|
|
12
12
|
@pointerdown=${this.onResizePointerDown}
|
|
13
13
|
@keydown=${this.onResizeKeyDown}
|
|
14
|
-
></span>`}syncResizeHandleValues(writes){const measurements=[];for(const handle of this.renderRoot.querySelectorAll('[part="resize-handle"]')){const key=handle.dataset.colKey;if(!key)continue;const column=this.columnsByKey.get(key);if(!column||this.resizedColumnWidths.has(key)||this.parsePixelLength(column.width)!==void 0)continue;const rendered=handle.closest("th[data-col-key]")?.getBoundingClientRect().width;if(rendered&&rendered>0){const width=Math.round(rendered);measurements.push({handle,width})}}const apply=()=>{for(const{handle,width}of measurements)handle.setAttribute("aria-valuenow",String(width)),handle.setAttribute("aria-valuetext",this.resizeValueText(width))};writes.push(apply)}rollbackResizePreview(state2){const reverted=new Map(this.resizedColumnWidths);state2.previousWidth===void 0?reverted.delete(state2.key):reverted.set(state2.key,state2.previousWidth),this.resizedColumnWidths=reverted;const column=this.columnsByKey.get(state2.key),col=this.renderRoot.querySelector(`col[data-col-key="${CSS.escape(state2.key)}"]`),width=column?this.renderedColumnWidth(column):void 0;width?col?.style.setProperty("inline-size",width):col?.style.removeProperty("inline-size");const hasWidths=this.columns.some(column2=>column2.width||this.resizedColumnWidths.has(column2.key)),table=this.renderRoot.querySelector("table");table?.toggleAttribute("data-has-column-widths",hasWidths),table?.setAttribute("data-layout",this.layout==="fixed"||hasWidths||this.resizeState?"fixed":"auto")}cancelResizeGesture(){const state2=this.resizeState;this.resizeState=void 0,this.resizePointer.stop(),state2&&(state2.handle.removeAttribute("data-resizing"),this.rollbackResizePreview(state2))}syncLayoutGeometry(){const writes=[];this.syncAutoScrollMode(writes),this.applyStickyOffsets(writes),this.syncResizeHandleValues(writes),this.recomputeHiddenPriorityColumns(writes);for(const apply of writes)apply()}firstUpdated(changed){super.firstUpdated(changed),!this.hasAttribute("aria-label")&&!this.caption&&devWarnOnce(MISSING_ACCESSIBLE_NAME_WARNING,"<lr-table> has no accessible name: set a host `aria-label` or `caption` so assistive technology can identify the grid.")}connectedCallback(){super.connectedCallback();const owner=this.ownerDocument.defaultView,ResizeObserverCtor=owner?.ResizeObserver;let observer;ResizeObserverCtor&&(observer=new ResizeObserverCtor(()=>{!this.isConnected||this.ownerDocument.defaultView!==owner||this.resizeObserver!==observer||this.scheduleLayoutSync()})),this.resizeObserver=observer;const base=this.renderRoot?.querySelector('[part="base"]');base&&(this.observeBase(base),this.observeTable(this.renderRoot.querySelector('[part="table"]')??void 0),this.observeHeaders())}disconnectedCallback(){super.disconnectedCallback(),this.cancelResizeGesture(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0;const frame=this.layoutFrame;frame&&frame.owner.cancelAnimationFrame(frame.handle),this.layoutFrame=null,this.observedBase=void 0,this.observedTable=void 0,this.observedHeaders.clear()}adoptedCallback(){super.adoptedCallback(),this.announcements.adopted()}localizedOverride(key,override){return override??this.localize(TABLE_OVERRIDE_MESSAGE_KEYS[key])}loadingText(){return this.localizedOverride("tableLoading",this.loadingLabel)}loadingMoreText(){return this.localizedOverride("tableLoadingMore",this.loadingMoreLabel)}onLoadMore(){this.loadingMore||this.emit("lr-load-more")}observeBase(base){this.observedBase!==base&&(this.observedBase&&this.resizeObserver?.unobserve(this.observedBase),this.resizeObserver?.observe(base),this.observedBase=base)}observeTable(table){this.observedTable!==table&&(this.observedTable&&this.resizeObserver?.unobserve(this.observedTable),table&&this.resizeObserver?.observe(table),this.observedTable=table)}syncAutoScrollMode(writes){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return;const overflows=(this.scrollMode==="auto"||this.scrollMode==="page")&&base.scrollWidth-base.clientWidth>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,apply=()=>base.toggleAttribute("data-scroll-overflow",overflows);writes.push(apply)}observeHeaders(){const headers=new Set(this.columns.some(column=>column.sticky||column.resizable)?this.renderRoot.querySelectorAll("th[data-col-key]"):[]);for(const header of this.observedHeaders)headers.has(header)||(this.resizeObserver?.unobserve(header),this.observedHeaders.delete(header));for(const header of headers)this.observedHeaders.has(header)||(this.observedHeaders.add(header),this.resizeObserver?.observe(header))}priorityTierHeaders(tier){return[...this.renderRoot.querySelectorAll(`th[data-priority="${tier}"]`)]}recomputeHiddenPriorityColumns(writes){const hasLowColumn=this.columns.some(col=>col.priority==="low"),hasMediumColumn=this.columns.some(col=>col.priority==="medium"),base=this.renderRoot.querySelector('[part="base"]');if(!hasLowColumn&&!hasMediumColumn){this.priorityTierNaturalWidth.clear(),this.alwaysVisibleNaturalWidth=void 0,this.priorityTierHiddenAllocation.clear(),this.priorityTierRevealAllocation.clear();const visible=this.activeColKey===null?[]:this.visibleHeaders(),apply=()=>{base?.removeAttribute("data-hide-priority-low"),base?.removeAttribute("data-hide-priority-medium"),this.rehomeFocusedColumn(visible)};writes.push(apply),this.priorityToggleAvailable&&(this.priorityToggleAvailable=!1),this.hasHiddenPriorityColumns&&(this.hasHiddenPriorityColumns=!1);return}if(!base||base.clientWidth<=0){this.rehomeFocusedColumn();return}const genuineOverflow=base.scrollWidth-base.clientWidth>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,lowHeaders=hasLowColumn?this.priorityTierHeaders("low"):[],mediumHeaders=hasMediumColumn?this.priorityTierHeaders("medium"):[],refreshNaturalWidth=(tier,headers)=>{if(headers.length===0)return!1;const currentlyHidden=headers.every(header=>header.offsetParent===null);if(!currentlyHidden&&genuineOverflow){const width=headers.reduce((sum,header)=>sum+header.getBoundingClientRect().width,0);width>0&&this.priorityTierNaturalWidth.set(tier,width)}return currentlyHidden},lowActuallyHidden=refreshNaturalWidth("low",lowHeaders),mediumActuallyHidden=refreshNaturalWidth("medium",mediumHeaders);if(genuineOverflow){const alwaysWidth=[...this.renderRoot.querySelectorAll('[part="head"] > tr > th')].filter(header=>!header.hasAttribute("data-priority")).reduce((sum,header)=>sum+header.getBoundingClientRect().width,0);alwaysWidth>0&&(this.alwaysVisibleNaturalWidth=alwaysWidth)}const lowNaturalWidth=this.priorityTierNaturalWidth.get("low")??0,mediumNaturalWidth=this.priorityTierNaturalWidth.get("medium")??0,overflowAtFull=(lowActuallyHidden||mediumActuallyHidden?(this.alwaysVisibleNaturalWidth??0)+lowNaturalWidth+mediumNaturalWidth:base.scrollWidth)-base.clientWidth,measuredLow=hasLowColumn&&overflowAtFull>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,overflowAfterLow=measuredLow?overflowAtFull-lowNaturalWidth:overflowAtFull,measuredMedium=hasMediumColumn&&overflowAfterLow>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,allocation=base.offsetWidth,needsMedium=this.settlePriorityTier(base,"medium",measuredMedium,mediumActuallyHidden,allocation,writes),needsLow=this.settlePriorityTier(base,"low",hasLowColumn&&(measuredLow||needsMedium),lowActuallyHidden,allocation,writes);if(this.activeColKey!==null){const visible=this.visibleHeaders().filter(header=>this.priorityColumnsVisible||!(header.dataset.priority==="low"&&needsLow)&&!(header.dataset.priority==="medium"&&needsMedium)),apply=()=>this.rehomeFocusedColumn(visible);writes.push(apply)}const toggleAvailable=needsLow||needsMedium,anyPriorityHidden=toggleAvailable&&!this.priorityColumnsVisible;this.priorityToggleAvailable!==toggleAvailable&&(this.priorityToggleAvailable=toggleAvailable),this.hasHiddenPriorityColumns!==anyPriorityHidden&&(this.hasHiddenPriorityColumns=anyPriorityHidden)}settlePriorityTier(base,tier,measured,actuallyHidden,allocation,writes){const attribute=tier==="low"?"data-hide-priority-low":"data-hide-priority-medium",wasMarked=base.hasAttribute(attribute),revealedAt=this.priorityTierRevealAllocation.get(tier);this.priorityTierRevealAllocation.delete(tier);const hiddenAt=this.priorityTierHiddenAllocation.get(tier),held=actuallyHidden&&hiddenAt!==void 0&&allocation<=hiddenAt+TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,hide=measured||held;hide?(!wasMarked||hiddenAt===void 0)&&this.priorityTierHiddenAllocation.set(tier,Math.max(allocation,revealedAt??allocation)):(this.priorityTierHiddenAllocation.delete(tier),wasMarked&&actuallyHidden&&this.priorityTierRevealAllocation.set(tier,allocation));const apply=()=>base.toggleAttribute(attribute,hide);return writes.push(apply),hide}rehomeFocusedColumn(headers){if(this.activeColKey===null)return;const visible=headers??this.visibleHeaders();visible.length!==0&&(visible.some(header=>header.dataset.colKey===this.activeColKey)||(this.activeColKey=visible[0].dataset.colKey??null))}keyOf(row,index){try{const key=this.rowKey?this.rowKey(row):index;return typeof key=="string"?key.trim().length===0?void 0:key:typeof key=="number"?key:void 0}catch{return}}canonicalRowEntries(){const inputs=this.canonicalRowEntriesInputs;if(this.cachedCanonicalRowEntries!==null&&inputs?.rows===this.rows&&inputs.rowKey===this.rowKey)return this.cachedCanonicalRowEntries;const entries=[],seen=new Set;return this.rows.forEach((row,index)=>{const key=this.keyOf(row,index);if(key===void 0)return;const encoded=encodeKey(key);seen.has(encoded)||(seen.add(encoded),entries.push({row,index,key,token:encoded}))}),this.canonicalRowEntriesInputs={rows:this.rows,rowKey:this.rowKey},this.cachedCanonicalRowEntries=entries,entries}matchingEntries(){const text=(this.filterText??"").trim(),locale=text===""?"":this.effectiveLocale,canonicalEntries=this.sortedCanonicalEntries(),inputs=this.matchingEntriesInputs;if(this.cachedMatchingEntries!==null&&inputs!==null&&inputs.entries===canonicalEntries&&inputs.filter===this.filter&&inputs.text===text&&inputs.locale===locale)return this.cachedMatchingEntries;let entries;if(text==="")entries=canonicalEntries;else{const stringify=createFilterStringifier(),intlLocale=this.effectiveLocale,normalized=text.toLocaleLowerCase(intlLocale);entries=canonicalEntries.filter(entry=>{if(this.filter)return this.filter(entry.row,text);let haystack=entry.search?.locale===intlLocale?entry.search.text:void 0;return haystack===void 0&&(haystack=stringify(entry.row).toLocaleLowerCase(intlLocale),isImmutableSearchRow(entry.row)&&(entry.search={locale:intlLocale,text:haystack})),haystack.includes(normalized)})}return this.matchingEntriesInputs={entries:canonicalEntries,filter:this.filter,text,locale},this.cachedMatchingEntries=entries,entries}get normalizedPageSize(){return finiteInteger(this.pageSize,DEFAULT_PAGE_SIZE,1,MAX_PAGE_SIZE)}get effectiveSkeletonRows(){const explicit=finiteCount(this.skeletonRows,0,MAX_SKELETON_ROWS);if(explicit>0)return explicit;const pageSize=this.normalizedPageSize;return pageSize===DEFAULT_PAGE_SIZE?DEFAULT_SKELETON_ROWS:Math.min(pageSize,MAX_SKELETON_ROWS)}get matchingTotalItems(){const totalItems=finiteInteger(this.totalItems,-1);return totalItems>=0?totalItems:this.matchingEntries().length}get serverUnknownTotal(){return this.paginationMode==="server"&&this.unknownTotal}get pageCount(){const pageSize=this.normalizedPageSize;return pageSize>0?Math.ceil(this.matchingTotalItems/pageSize):0}get appliedPage(){return this.pageCount===0?1:finiteInteger(this.page,1,1,this.pageCount)}sortedEntries(){return this.matchingEntries()}sortedCanonicalEntries(){const entries=this.canonicalRowEntries();if(this.sortMode!=="client"||this.sortKey==="")return entries;const col=this.columnsByKey.get(this.sortKey);if(!col?.sortable)return entries;const locale=this.effectiveLocale,inputs=this.sortedEntriesInputs;if(this.cachedSortedEntries!==null&&inputs!==null&&inputs.entries===entries&&inputs.columns===this.columns&&inputs.mode===this.sortMode&&inputs.key===this.sortKey&&inputs.dir===this.sortDir&&inputs.locale===locale&&inputs.groupBy===this.groupBy)return this.cachedSortedEntries;const collator=getCollator(locale,{numeric:!0}),dir=this.sortDir==="desc"?-1:1,decorated=entries.map(entry=>{const raw=typeof col.sortValue=="function"?col.sortValue(entry.row):typeof col.cell=="function"?String(col.cell(entry.row)??""):"";return{entry,value:typeof raw=="number"&&!Number.isFinite(raw)?null:raw}}),compare=(a,b)=>{const av=a.value,bv=b.value;return av==null&&bv==null?0:av==null?1:bv==null?-1:typeof av=="number"&&typeof bv=="number"?(av-bv)*dir:collator.compare(String(av),String(bv))*dir};let sorted;const groupBy=this.groupBy;if(groupBy===void 0)decorated.sort(compare),sorted=decorated.map(decoration=>decoration.entry);else{const buckets=new Map;for(const decoration of decorated){const groupKey=groupBy(decoration.entry.row),bucket=buckets.get(groupKey);bucket===void 0?buckets.set(groupKey,[decoration]):bucket.push(decoration)}const ordered=[...buckets.values()],constantWithinEveryGroup=ordered.every(bucket=>bucket.every(decoration=>compare(decoration,bucket[0])===0));constantWithinEveryGroup&&ordered.sort((a,b)=>compare(a[0],b[0])),sorted=[];for(const bucket of ordered){constantWithinEveryGroup||bucket.sort(compare);for(const decoration of bucket)sorted.push(decoration.entry)}}return this.sortedEntriesInputs={entries,columns:this.columns,mode:this.sortMode,key:this.sortKey,dir:this.sortDir,locale,groupBy},this.cachedSortedEntries=sorted,sorted}renderedEntries(){const entries=this.sortedEntries(),size=this.normalizedPageSize,start=this.paginationMode==="server"?0:(this.appliedPage-1)*size,cached=this.pageEntriesMemo;if(cached&&cached.entries===entries&&cached.start===start&&cached.size===size)return cached.result;const result=entries.slice(start,start+size);return this.pageEntriesMemo={entries,start,size,result},result}publicRows(entries){let rows=this.publicRowsMemo.get(entries);return rows||(rows=Object.freeze(entries.map(entry=>entry.row)),this.publicRowsMemo.set(entries,rows)),rows}aggregate(callback,key=callback,receiver=this){if(!callback)return"";const rows=this.viewRows;return(rows!==this.aggregateRows||this.columns!==this.aggregateColumns||this.effectiveLocale!==this.aggregateLocale)&&(this.aggregateRows=rows,this.aggregateColumns=this.columns,this.aggregateLocale=this.effectiveLocale,this.aggregateValues.clear()),this.aggregateValues.has(key)||this.aggregateValues.set(key,callback.call(receiver,rows)),this.aggregateValues.get(key)}get viewRows(){return this.publicRows(this.sortedEntries())}get pageRows(){return this.publicRows(this.renderedEntries())}focusedColKey(displayed){const visibleKeys=displayed??this.visibleHeaders().map(el=>el.dataset.colKey).filter(key=>key!==void 0&&this.columnsByKey.has(key));return this.activeColKey!==null&&this.columnsByKey.has(this.activeColKey)&&(visibleKeys.length===0||visibleKeys.includes(this.activeColKey))?this.activeColKey:visibleKeys[0]??this.columns[0]?.key??null}displayedColumnKeys(){const base=this.renderRoot?.querySelector?.('[part="base"]'),hideLow=!this.priorityColumnsVisible&&!!base?.hasAttribute("data-hide-priority-low"),hideMedium=!this.priorityColumnsVisible&&!!base?.hasAttribute("data-hide-priority-medium");return this.columns.filter(col=>!(hideLow&&col.priority==="low")&&!(hideMedium&&col.priority==="medium")).map(col=>col.key)}focusedRowKey(){if(this.activeRowKey!==null&&this.rowsByKey.has(this.activeRowKey))return this.activeRowKey;const selectedKey=this._selectedKeys.values().next().value;if(selectedKey!==void 0){const selected=encodeKey(selectedKey);if(this.rowsByKey.has(selected))return selected}const first=this.renderedEntries()[0];return first?encodeKey(first.key):null}rowsAffectingRovingFocusChanged(changed){return changed.has("rows")||changed.has("rowKey")||changed.has("filterText")||changed.has("filter")||changed.has("page")||changed.has("pageSize")||changed.has("paginationMode")||changed.has("totalItems")||changed.has("columns")||changed.has("sortKey")||changed.has("sortDir")||changed.has("sortMode")||changed.has("groupBy")||this.rowsLocale!==this.effectiveLocale}captureRovingFocus(changed){this.rovingFocusSnapshot=null;const active=shadowFocusTarget(this),HTMLElementCtor=this.ownerDocument?.defaultView?.HTMLElement;if(!(!HTMLElementCtor||!(active instanceof HTMLElementCtor))){if(changed.has("columns")&&active.matches("th[data-col-key]")){const headers=this.visibleHeaders(),key=active.dataset.colKey,index=headers.indexOf(active);key!==void 0&&index>=0&&(this.rovingFocusSnapshot={kind:"header",key,index,targetKey:null,element:active});return}if(this.rowsAffectingRovingFocusChanged(changed)&&active.matches("tr[data-row-key]")){const renderedRows=[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")],key=active.dataset.rowKey,index=renderedRows.indexOf(active);key!==void 0&&index>=0&&(this.rovingFocusSnapshot={kind:"row",key,index,targetKey:null,element:active})}}}resolveRovingFocusTarget(){const snapshot=this.rovingFocusSnapshot;if(snapshot===null)return;const keys=snapshot.kind==="header"?this.columns.map(column=>column.key):[...this.rowsByKey.keys()];snapshot.targetKey=keys.includes(snapshot.key)?snapshot.key:keys[Math.min(snapshot.index,keys.length-1)]??null,snapshot.kind==="header"?this.activeColKey=snapshot.targetKey:this.activeRowKey=snapshot.targetKey}willUpdate(changed){if(super.willUpdate(changed),this.themedResizeMinWidth=void 0,this.captureRovingFocus(changed),this.selectionMode==="single"&&this._selectedKeys.size>1&&(changed.has("selectionMode")||changed.has("selectedRowKeys"))){const first=this._selectedKeys.values().next().value;if(this.selectedRowKeys=this.asKeySet(first===void 0?new Set:new Set([first])),this.hasUpdated){const rowKeys=this.asKeyList(Object.freeze(first===void 0?[]:[first]));this.emit("lr-selection-change",Object.freeze({selectedRowKeys:rowKeys}))}}if(this.expansionMode==="single"&&this._expandedKeys.size>1&&(changed.has("expansionMode")||changed.has("expandedRowKeys"))){const first=this._expandedKeys.values().next().value;this.expandedRowKeys=this.asKeySet(first===void 0?new Set:new Set([first]))}if(!this.hasUpdated){const parsed=readPersistedState(this.storageFullKey,v=>typeof v=="object"&&v!==null);parsed&&typeof parsed.priorityColumnsVisible=="boolean"&&!isPersistedPropertyExplicitlySet(this,"priorityColumnsVisible")&&(this.priorityColumnsVisible=parsed.priorityColumnsVisible)}if(changed.has("columns")&&(this.columnsByKey=new Map(this.columns.map(c=>[c.key,c]))),this.rowsAffectingRovingFocusChanged(changed)&&(this.rowsByKey=new Map(this.renderedEntries().map(entry=>[entry.token,entry])),this.rowsLocale=this.effectiveLocale),this.resolveRovingFocusTarget(),this.editingCell!==null){const column=this.columnsByKey.get(this.editingCell.columnKey);(!this.rowsByKey.has(this.editingCell.rowKey)||normalizedEditTrigger(column?.editTrigger)!=="double-click")&&(this.editingCell=null)}this.editorHadFocusBeforeUpdate=this.focusedEditorCell!==null&&shadowFocusTarget(this)===this.editorElementFor(this.focusedEditorCell.rowKey,this.focusedEditorCell.columnKey)}stickyOffsets(){const offsets=new Map,headerWidths=new Map;for(const el of this.renderRoot.querySelectorAll("th[data-col-key]")){const key=el.dataset.colKey;key!==void 0&&!headerWidths.has(key)&&headerWidths.set(key,el.offsetWidth)}const headerWidth=key=>headerWidths.get(key)??0;let runningStart=0;for(const col of this.columns)stickyDirection(col.sticky)==="start"&&(offsets.set(col.key,runningStart),runningStart+=headerWidth(col.key));let runningEnd=0;for(let i=this.columns.length-1;i>=0;i--){const col=this.columns[i];col&&stickyDirection(col.sticky)==="end"&&(offsets.set(col.key,runningEnd),runningEnd+=headerWidth(col.key))}return offsets}computeHeatDomain(hasHeatTint){if(!hasHeatTint)return null;const entries=this.matchingEntries(),min=this.heatTintScale?.min,max=this.heatTintScale?.max,cached=this.heatDomainCache;if(cached&&cached.entries===entries&&cached.columns===this.columns&&cached.min===min&&cached.max===max)return cached.domain;const domain=this.deriveHeatDomain(entries);return this.heatDomainCache={entries,columns:this.columns,min,max,domain},domain}deriveHeatDomain(entries){const values=[];for(const entry of entries)for(const col of this.columns){const v=col.heatValue?.(entry.row);v!=null&&Number.isFinite(v)&&values.push(v)}const auto=minMax(values),lo=this.heatTintScale?.min??auto?.[0],hi=this.heatTintScale?.max??auto?.[1];return lo===void 0||hi===void 0?null:[lo,hi]}heatShare(col,row,domain){if(!col.heatValue||!domain)return null;const v=col.heatValue(row);if(v==null||!Number.isFinite(v))return null;const[lo,hi]=domain;return`${(finiteRatio(v,lo,hi)*100).toFixed(2)}%`}applyStickyOffsets(writes){if(!this.columns.some(c=>c.sticky))return;const offsets=this.stickyOffsets(),cells=this.renderRoot.querySelectorAll("th[data-col-key], td[data-col-key]"),apply=()=>cells.forEach(el=>{const key=el.dataset.colKey;key!==void 0&&offsets.has(key)&&el.style.setProperty("--lr-table-sticky-offset",`${offsets.get(key)}px`)});writes.push(apply)}updated(changed){super.updated(changed),this.firstUpdateAnnouncementsReady&&this.rowsTruncated&&(changed.has("rows")||changed.has("maxRows"))&&this.announcements.announcePolite(this.localize("tableRowLimit",void 0,{count:getNumberFormat(this.effectiveLocale).format(this.rows.length)})),this.firstUpdateAnnouncementsReady&&changed.has("loading")&&this.loading&&this.announcements.announcePolite(this.loadingText()),this.firstUpdateAnnouncementsReady&&changed.has("loadingMore")&&this.loadingMore&&!this.loading&&this.shadowRoot?.querySelector('[part="more-button"]')&&this.announcements.announcePolite(this.loadingMoreText());const announcesErrorTransition=this.firstUpdateAnnouncementsReady&&changed.has("error")&&this.error,announcesMountedError=!this.firstUpdateAnnouncementsReady&&this.announce&&this.error;if((announcesErrorTransition||announcesMountedError)&&this.announcements.announceAssertive(this.localizedOverride("tableLoadFailed",this.errorHeading)),this.firstUpdateAnnouncementsReady=!0,this.persistReady&&changed.has("priorityColumnsVisible")&&writePersistedState(this.storageFullKey,{priorityColumnsVisible:this.priorityColumnsVisible}),this.persistReady=!0,changed.has("columns")||changed.has("revealColumnsLabel")||changed.has("columnsHideLabel")||changed.has("priorityColumnsVisible")||changed.has("storageKey")){const inertMembers=[],labelsInert=this.revealColumnsLabel!==void 0||this.columnsHideLabel!==void 0;labelsInert&&inertMembers.push("`revealColumnsLabel`/`columnsHideLabel`"),isPersistedPropertyExplicitlySet(this,"priorityColumnsVisible")&&inertMembers.push("`priorityColumnsVisible`"),this.storageKey&&inertMembers.push("`storageKey`"),inertMembers.length>0&&this.columns.length>0&&!this.columns.some(col=>col.priority)&&devWarnOnce(INERT_PRIORITY_COLUMN_CONFIG_WARNING,`<lr-table>: ${inertMembers.join(", ")} `+(inertMembers.length>1||labelsInert?"have":"has")+" no effect unless at least one column declares `priority`.")}const geometryChanged=changed.size===0||[...changed.keys()].some(key=>key!=="selectedRowKeys"&&key!=="selectionMode"&&key!=="activeRowKey"&&key!=="activeColKey"),base=this.renderRoot.querySelector('[part="base"]');if(base&&this.observeBase(base),this.observeTable(this.renderRoot.querySelector('[part="table"]')??void 0),geometryChanged&&this.observeHeaders(),this.restoreRovingFocus(),this.hasAlwaysOnEditors&&this.restoreAlwaysOnEditorFocus(),changed.has("editingCell"))if(this.editingCell){const{rowKey,columnKey}=this.editingCell;queueMicrotask(()=>this.editorElementFor(rowKey,columnKey)?.focus())}else{const previous=changed.get("editingCell");if(previous){const{rowKey,columnKey}=previous;queueMicrotask(()=>this.cellElementForToken(rowKey,columnKey)?.focus())}}geometryChanged&&queueMicrotask(()=>this.syncLayoutGeometry())}restoreRovingFocus(){const snapshot=this.rovingFocusSnapshot;if(this.rovingFocusSnapshot=null,snapshot===null)return;const internalActive=shadowFocusTarget(this);if(internalActive!==null&&internalActive!==snapshot.element)return;const documentActive=activeElementIn(this.ownerDocument);if(documentActive!==null&&documentActive!==this&&documentActive!==this.ownerDocument.body)return;const candidates=snapshot.kind==="header"?this.visibleHeaders():[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")],target=candidates.find(candidate=>snapshot.kind==="header"?candidate.dataset.colKey===snapshot.targetKey:candidate.dataset.rowKey===snapshot.targetKey)??candidates[Math.min(snapshot.index,candidates.length-1)]??null;snapshot.kind==="header"?this.focusHeader(target):this.focusRow(target)}activateColumn(key){this.activeColKey=key;const col=this.columnsByKey.get(key);if(!col?.sortable)return;const sortDir=this.sortKey===key?this.sortDir==="asc"?"desc":"asc":col.defaultSortDir??this.defaultSortDir,request=Object.freeze({phase:"request",sortKey:col.key,sortDir});this.emit("lr-sort-request",request,{cancelable:!0}).defaultPrevented||(this.sortMode==="client"&&(this.sortKey=col.key,this.sortDir=sortDir),this.emit("lr-sort",Object.freeze({phase:"commit",sortKey:col.key,sortDir})))}commitSelectedKeys(next){next.size>this.maxRows&&(next=keySet(next,this.maxRows));const previous=this._selectedKeys;this.isRebind("selectedRowKeys",next,previous),this._selectedKeys=next,this.requestUpdate("selectedRowKeys",previous)}activateRow(key){this.activeRowKey=key;const entry=this.rowsByKey.get(key);if(entry===void 0)return;const{row,key:selectedKey}=entry;if(this.emit("lr-row-activate",Object.freeze({row})),this.selectionMode==="single"){this.commitSelectedKeys(new Set([selectedKey]));const rowKeys=this.asKeyList(Object.freeze([selectedKey]));this.emit("lr-selection-change",Object.freeze({selectedRowKeys:rowKeys}))}else if(this.selectionMode==="multiple"){const rawKey=selectedKey,next=new Set(this._selectedKeys);next.has(rawKey)?next.delete(rawKey):next.add(rawKey),this.commitSelectedKeys(next);const rowKeys=this.asKeyList(Object.freeze([...this._selectedKeys]));this.emit("lr-selection-change",Object.freeze({selectedRowKeys:rowKeys}))}}get hasAlwaysOnEditors(){return this.columns.some(col=>normalizedEditTrigger(col.editTrigger)==="always")}editorValue(row,column){const value=column.editValue?.(row)??row[column.key]??"";return String(value)}startEditing(rowKey,columnKey){const column=this.columnsByKey.get(columnKey);normalizedEditTrigger(column?.editTrigger)!=="double-click"||!this.rowsByKey.has(rowKey)||(this.editingCell={rowKey,columnKey})}commitEdit(event,rowKey,columnKey){event.stopPropagation();const field=event.currentTarget,entry=this.rowsByKey.get(rowKey),column=this.columnsByKey.get(columnKey),isTransient=this.editingCell?.rowKey===rowKey&&this.editingCell.columnKey===columnKey;if(!entry||!column||normalizedEditTrigger(column.editTrigger)===void 0){isTransient&&(this.editingCell=null);return}const value=column.editType==="number"&&field.value!==""?Number(field.value):field.value;this.emit("lr-cell-edit",Object.freeze({row:entry.row,columnKey,value})),isTransient&&(this.editingCell=null)}editorElementFor(rowKey,columnKey){return this.cellElementForToken(rowKey,columnKey)?.querySelector('[part="cell-editor"]')??null}restoreAlwaysOnEditorFocus(){const cell=this.focusedEditorCell;if(cell===null)return;const editor=this.editorElementFor(cell.rowKey,cell.columnKey);editor===null?this.focusedEditorCell=null:this.editorHadFocusBeforeUpdate&&shadowFocusTarget(this)!==editor&&editor.focus(),this.editorHadFocusBeforeUpdate=!1}activateExpandToggle(key){const entry=this.rowsByKey.get(encodeKey(key));if(entry===void 0)return;const expanded=!this._expandedKeys.has(key),detail=Object.freeze({row:entry.row,rowKey:key,expanded});if(this.expansionMode!=="single"&&this.expansionMode!=="multiple"){this.emit("lr-row-expand-toggle",detail);return}requestThenCommit({requestDetail:detail,emitRequest:(requestDetail,init)=>this.emit("lr-row-expand-request",requestDetail,init),commit:()=>{let next=this.expansionMode==="single"?new Set:new Set(this._expandedKeys);expanded?next.add(key):next.delete(key),next.size>this.maxRows&&(next=keySet(next,this.maxRows));const displaced=[...this._expandedKeys].filter(other=>other!==key&&!next.has(other)),previous=this._expandedKeys;this.isRebind("expandedRowKeys",next,previous),this._expandedKeys=next,this.requestUpdate("expandedRowKeys",previous);for(const other of displaced){const displacedEntry=this.rowsByKey.get(encodeKey(other));displacedEntry!==void 0&&this.emit("lr-row-expand-toggle",Object.freeze({row:displacedEntry.row,rowKey:other,expanded:!1}))}this.emit("lr-row-expand-toggle",Object.freeze({...detail,expanded:next.has(key)}))}})}rowElement(rowKey){return this.rowElementForToken(encodeKey(rowKey))}cellElement(rowKey,columnKey){return this.cellElementForToken(encodeKey(rowKey),columnKey)}editCell(rowKey,columnKey){const token=encodeKey(rowKey),trigger=normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger);if(!(trigger===void 0||!this.rowsByKey.has(token))){if(trigger==="always"){this.editorElementFor(token,columnKey)?.focus();return}this.startEditing(token,columnKey)}}expandedContentElement(rowKey){const token=encodeKey(rowKey);return[...this.renderRoot.querySelectorAll("tbody tr[data-expanded-row-key]")].find(el=>el.dataset.expandedRowKey===token)?.querySelector('[part="expanded-cell"]')??null}rowElementForToken(token){return[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")].find(el=>el.dataset.rowKey===token)??null}cellElementForToken(token,columnKey){return[...this.rowElementForToken(token)?.querySelectorAll("td[data-col-key]")??[]].find(el=>el.dataset.colKey===columnKey)??null}visibleHeaders(){return[...this.renderRoot?.querySelectorAll("th[data-col-key]")??[]].filter(el=>el.offsetParent!==null)}focusHeader(el){el?.dataset.colKey&&(this.activeColKey=el.dataset.colKey,el.focus())}focusRow(el){el?.dataset.rowKey&&(this.activeRowKey=el.dataset.rowKey,el.focus())}onHeaderKeyDown(e,th){if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateColumn(th.dataset.colKey);return}const headers=this.visibleHeaders(),index=headers.indexOf(th);if(index<0)return;const rtl=isRtl(this);switch(e.key){case"ArrowLeft":e.preventDefault(),this.focusHeader(headers[rtl?Math.min(headers.length-1,index+1):Math.max(0,index-1)]??null);return;case"ArrowRight":e.preventDefault(),this.focusHeader(headers[rtl?Math.max(0,index-1):Math.min(headers.length-1,index+1)]??null);return;case"Home":e.preventDefault(),this.focusHeader(headers[0]??null);return;case"End":e.preventDefault(),this.focusHeader(headers[headers.length-1]??null);return;case"ArrowDown":{e.preventDefault();const rows=[...this.renderRoot.querySelectorAll("[data-row-key]")],key=this.focusedRowKey();this.focusRow(rows.find(r=>r.dataset.rowKey===key)??rows[0]??null);return}default:return}}editableCellFor(target){const columnKey=target.dataset.colKey;return target.tagName!=="TD"||columnKey===void 0?null:normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger)==="double-click"?{element:target,columnKey}:null}editableCellsInRow(tr){return[...tr.querySelectorAll("td[data-editable]")].filter(td=>td.offsetParent!==null&&!td.inert&&!td.closest("[inert]"))}onRowKeyDown(e,tr){const cell=this.editableCellFor(e.target);if((e.key==="Enter"||e.key==="F2")&&cell){e.preventDefault(),this.startEditing(tr.dataset.rowKey,cell.columnKey);return}if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateRow(tr.dataset.rowKey);return}if(e.key==="ArrowLeft"||e.key==="ArrowRight"){this.onRowLateralKeyDown(e,tr,cell);return}const bodyRows=[...this.renderRoot.querySelectorAll("[data-row-key]")],index=bodyRows.indexOf(tr);if(!(index<0))switch(e.key){case"ArrowDown":e.preventDefault(),this.focusRow(bodyRows[Math.min(bodyRows.length-1,index+1)]??null);return;case"ArrowUp":if(e.preventDefault(),index===0){const headers=this.visibleHeaders(),key=this.focusedColKey();this.focusHeader(headers.find(h=>h.dataset.colKey===key)??headers[0]??null)}else this.focusRow(bodyRows[index-1]??null);return;case"Home":e.preventDefault(),this.focusRow(bodyRows[0]??null);return;case"End":e.preventDefault(),this.focusRow(bodyRows[bodyRows.length-1]??null);return;default:return}}onRowLateralKeyDown(e,tr,cell){const cells=this.editableCellsInRow(tr);if(cells.length===0)return;e.preventDefault();const forward=e.key===(isRtl(this)?"ArrowLeft":"ArrowRight");if(cell===null){(forward?cells[0]:cells[cells.length-1])?.focus();return}const index=cells.indexOf(cell.element);forward?cells[index+1]?.focus():index<=0?this.focusRow(tr):cells[index-1]?.focus()}renderCellValue(col,row){return typeof col.cell=="function"?col.cell(row):(devWarnOnce(MISSING_CELL_RENDERER_WARNING,"<lr-table>: a column has no required `cell` renderer, so its cells render empty. Supply a `cell` callback for every column."),nothing)}renderCellEditor(row,col,rowKey,alwaysOn){const type=col.editType??"text",value=this.editorValue(row,col),label=col.editLabel?.(row)??this.localize("tableEditCell",void 0,{column:col.label}),onChange=event=>this.commitEdit(event,rowKey,col.key),onKeyDown=event=>this.onEditorKeyDown(event,rowKey,col.key);if(type==="select"){const options=col.editOptions??[];return html`<select
|
|
14
|
+
></span>`}syncResizeHandleValues(writes){const measurements=[];for(const handle of this.renderRoot.querySelectorAll('[part="resize-handle"]')){const key=handle.dataset.colKey;if(!key)continue;const column=this.columnsByKey.get(key);if(!column||this.resizedColumnWidths.has(key)||this.parsePixelLength(column.width)!==void 0)continue;const rendered=handle.closest("th[data-col-key]")?.getBoundingClientRect().width;if(rendered&&rendered>0){const width=Math.round(rendered);measurements.push({handle,width})}}const apply=()=>{for(const{handle,width}of measurements)handle.setAttribute("aria-valuenow",String(width)),handle.setAttribute("aria-valuetext",this.resizeValueText(width))};writes.push(apply)}rollbackResizePreview(state2){const reverted=new Map(this.resizedColumnWidths);state2.previousWidth===void 0?reverted.delete(state2.key):reverted.set(state2.key,state2.previousWidth),this.resizedColumnWidths=reverted;const column=this.columnsByKey.get(state2.key),col=this.renderRoot.querySelector(`col[data-col-key="${CSS.escape(state2.key)}"]`),width=column?this.renderedColumnWidth(column):void 0;width?col?.style.setProperty("inline-size",width):col?.style.removeProperty("inline-size");const hasWidths=this.columns.some(column2=>column2.width||this.resizedColumnWidths.has(column2.key)),table=this.renderRoot.querySelector("table");table?.toggleAttribute("data-has-column-widths",hasWidths),table?.setAttribute("data-layout",this.layout==="fixed"||hasWidths||this.resizeState?"fixed":"auto")}cancelResizeGesture(){const state2=this.resizeState;this.resizeState=void 0,this.resizePointer.stop(),state2&&(state2.handle.removeAttribute("data-resizing"),this.rollbackResizePreview(state2))}syncLayoutGeometry(){const writes=[];this.syncAutoScrollMode(writes),this.applyStickyOffsets(writes),this.syncResizeHandleValues(writes),this.recomputeHiddenPriorityColumns(writes);for(const apply of writes)apply()}firstUpdated(changed){super.firstUpdated(changed),!this.hasAttribute("aria-label")&&!this.caption&&devWarnOnce(MISSING_ACCESSIBLE_NAME_WARNING,"<lr-table> has no accessible name: set a host `aria-label` or `caption` so assistive technology can identify the grid.")}connectedCallback(){super.connectedCallback();const owner=this.ownerDocument.defaultView,ResizeObserverCtor=owner?.ResizeObserver;let observer;ResizeObserverCtor&&(observer=new ResizeObserverCtor(()=>{!this.isConnected||this.ownerDocument.defaultView!==owner||this.resizeObserver!==observer||this.scheduleLayoutSync()})),this.resizeObserver=observer;const base=this.renderRoot?.querySelector('[part="base"]');base&&(this.observeBase(base),this.observeTable(this.renderRoot.querySelector('[part="table"]')??void 0),this.observeHeaders())}disconnectedCallback(){super.disconnectedCallback(),this.cancelResizeGesture(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0;const frame=this.layoutFrame;frame&&frame.owner.cancelAnimationFrame(frame.handle),this.layoutFrame=null,this.observedBase=void 0,this.observedTable=void 0,this.observedHeaders.clear()}adoptedCallback(){super.adoptedCallback(),this.announcements.adopted()}localizedOverride(key,override){return override??this.localize(TABLE_OVERRIDE_MESSAGE_KEYS[key])}loadingText(){return this.localizedOverride("tableLoading",this.loadingLabel)}loadingMoreText(){return this.localizedOverride("tableLoadingMore",this.loadingMoreLabel)}onLoadMore(){this.loadingMore||this.emit("lr-load-more")}observeBase(base){this.observedBase!==base&&(this.observedBase&&this.resizeObserver?.unobserve(this.observedBase),this.resizeObserver?.observe(base),this.observedBase=base)}observeTable(table){this.observedTable!==table&&(this.observedTable&&this.resizeObserver?.unobserve(this.observedTable),table&&this.resizeObserver?.observe(table),this.observedTable=table)}syncAutoScrollMode(writes){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return;const overflows=(this.scrollMode==="auto"||this.scrollMode==="page")&&base.scrollWidth-base.clientWidth>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,apply=()=>base.toggleAttribute("data-scroll-overflow",overflows);writes.push(apply)}observeHeaders(){const headers=new Set(this.columns.some(column=>column.sticky||column.resizable)?this.renderRoot.querySelectorAll("th[data-col-key]"):[]);for(const header of this.observedHeaders)headers.has(header)||(this.resizeObserver?.unobserve(header),this.observedHeaders.delete(header));for(const header of headers)this.observedHeaders.has(header)||(this.observedHeaders.add(header),this.resizeObserver?.observe(header))}priorityTierHeaders(tier){return[...this.renderRoot.querySelectorAll(`th[data-priority="${tier}"]`)]}recomputeHiddenPriorityColumns(writes){const hasLowColumn=this.columns.some(col=>col.priority==="low"),hasMediumColumn=this.columns.some(col=>col.priority==="medium"),base=this.renderRoot.querySelector('[part="base"]');if(!hasLowColumn&&!hasMediumColumn){this.priorityTierNaturalWidth.clear(),this.alwaysVisibleNaturalWidth=void 0,this.priorityTierHiddenAllocation.clear(),this.priorityTierRevealAllocation.clear();const visible=this.activeColKey===null?[]:this.visibleHeaders(),apply=()=>{base?.removeAttribute("data-hide-priority-low"),base?.removeAttribute("data-hide-priority-medium"),this.rehomeFocusedColumn(visible)};writes.push(apply),this.priorityToggleAvailable&&(this.priorityToggleAvailable=!1),this.hasHiddenPriorityColumns&&(this.hasHiddenPriorityColumns=!1);return}if(!base||base.clientWidth<=0){this.rehomeFocusedColumn();return}const genuineOverflow=base.scrollWidth-base.clientWidth>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,lowHeaders=hasLowColumn?this.priorityTierHeaders("low"):[],mediumHeaders=hasMediumColumn?this.priorityTierHeaders("medium"):[],refreshNaturalWidth=(tier,headers)=>{if(headers.length===0)return!1;const currentlyHidden=headers.every(header=>header.offsetParent===null);if(!currentlyHidden&&genuineOverflow){const width=headers.reduce((sum,header)=>sum+header.getBoundingClientRect().width,0);width>0&&this.priorityTierNaturalWidth.set(tier,width)}return currentlyHidden},lowActuallyHidden=refreshNaturalWidth("low",lowHeaders),mediumActuallyHidden=refreshNaturalWidth("medium",mediumHeaders);if(genuineOverflow){const alwaysWidth=[...this.renderRoot.querySelectorAll('[part="head"] > tr > th')].filter(header=>!header.hasAttribute("data-priority")).reduce((sum,header)=>sum+header.getBoundingClientRect().width,0);alwaysWidth>0&&(this.alwaysVisibleNaturalWidth=alwaysWidth)}const lowNaturalWidth=this.priorityTierNaturalWidth.get("low")??0,mediumNaturalWidth=this.priorityTierNaturalWidth.get("medium")??0,overflowAtFull=(lowActuallyHidden||mediumActuallyHidden?(this.alwaysVisibleNaturalWidth??0)+lowNaturalWidth+mediumNaturalWidth:base.scrollWidth)-base.clientWidth,measuredLow=hasLowColumn&&overflowAtFull>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,overflowAfterLow=measuredLow?overflowAtFull-lowNaturalWidth:overflowAtFull,measuredMedium=hasMediumColumn&&overflowAfterLow>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,allocation=base.offsetWidth,needsMedium=this.settlePriorityTier(base,"medium",measuredMedium,mediumActuallyHidden,allocation,writes),needsLow=this.settlePriorityTier(base,"low",hasLowColumn&&(measuredLow||needsMedium),lowActuallyHidden,allocation,writes);if(this.activeColKey!==null){const visible=this.visibleHeaders().filter(header=>this.priorityColumnsVisible||!(header.dataset.priority==="low"&&needsLow)&&!(header.dataset.priority==="medium"&&needsMedium)),apply=()=>this.rehomeFocusedColumn(visible);writes.push(apply)}const toggleAvailable=needsLow||needsMedium,anyPriorityHidden=toggleAvailable&&!this.priorityColumnsVisible;this.priorityToggleAvailable!==toggleAvailable&&(this.priorityToggleAvailable=toggleAvailable),this.hasHiddenPriorityColumns!==anyPriorityHidden&&(this.hasHiddenPriorityColumns=anyPriorityHidden)}settlePriorityTier(base,tier,measured,actuallyHidden,allocation,writes){const attribute=tier==="low"?"data-hide-priority-low":"data-hide-priority-medium",wasMarked=base.hasAttribute(attribute),revealedAt=this.priorityTierRevealAllocation.get(tier);this.priorityTierRevealAllocation.delete(tier);const hiddenAt=this.priorityTierHiddenAllocation.get(tier),held=actuallyHidden&&hiddenAt!==void 0&&allocation<=hiddenAt+TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,hide=measured||held;hide?(!wasMarked||hiddenAt===void 0)&&this.priorityTierHiddenAllocation.set(tier,Math.max(allocation,revealedAt??allocation)):(this.priorityTierHiddenAllocation.delete(tier),wasMarked&&actuallyHidden&&this.priorityTierRevealAllocation.set(tier,allocation));const apply=()=>base.toggleAttribute(attribute,hide);return writes.push(apply),hide}rehomeFocusedColumn(headers){if(this.activeColKey===null)return;const visible=headers??this.visibleHeaders();visible.length!==0&&(visible.some(header=>header.dataset.colKey===this.activeColKey)||(this.activeColKey=visible[0].dataset.colKey??null))}keyOf(row,index){try{const key=this.rowKey?this.rowKey(row):index;return typeof key=="string"?key.trim().length===0?void 0:key:typeof key=="number"?key:void 0}catch{return}}canonicalRowEntries(){const inputs=this.canonicalRowEntriesInputs;if(this.cachedCanonicalRowEntries!==null&&inputs?.rows===this.rows&&inputs.rowKey===this.rowKey)return this.cachedCanonicalRowEntries;const entries=[],seen=new Set;return this.rows.forEach((row,index)=>{const key=this.keyOf(row,index);if(key===void 0)return;const encoded=encodeKey(key);seen.has(encoded)||(seen.add(encoded),entries.push({row,index,key,token:encoded}))}),this.canonicalRowEntriesInputs={rows:this.rows,rowKey:this.rowKey},this.cachedCanonicalRowEntries=entries,entries}matchingEntries(){const text=(this.filterText??"").trim(),locale=text===""?"":this.effectiveLocale,canonicalEntries=this.sortedCanonicalEntries(),inputs=this.matchingEntriesInputs;if(this.cachedMatchingEntries!==null&&inputs!==null&&inputs.entries===canonicalEntries&&inputs.filter===this.filter&&inputs.text===text&&inputs.locale===locale)return this.cachedMatchingEntries;let entries;if(text==="")entries=canonicalEntries;else{const stringify=createFilterStringifier(),intlLocale=this.effectiveLocale,normalized=text.toLocaleLowerCase(intlLocale);entries=canonicalEntries.filter(entry=>{if(this.filter)return this.filter(entry.row,text);let haystack=entry.search?.locale===intlLocale?entry.search.text:void 0;return haystack===void 0&&(haystack=stringify(entry.row).toLocaleLowerCase(intlLocale),isImmutableSearchRow(entry.row)&&(entry.search={locale:intlLocale,text:haystack})),haystack.includes(normalized)})}return this.matchingEntriesInputs={entries:canonicalEntries,filter:this.filter,text,locale},this.cachedMatchingEntries=entries,entries}get normalizedPageSize(){return finiteInteger(this.pageSize,DEFAULT_PAGE_SIZE,1,MAX_PAGE_SIZE)}get effectiveSkeletonRows(){const explicit=finiteCount(this.skeletonRows,0,MAX_SKELETON_ROWS);if(explicit>0)return explicit;const pageSize=this.normalizedPageSize;return pageSize===DEFAULT_PAGE_SIZE?DEFAULT_SKELETON_ROWS:Math.min(pageSize,MAX_SKELETON_ROWS)}get matchingTotalItems(){const totalItems=finiteInteger(this.totalItems,-1);return totalItems>=0?totalItems:this.matchingEntries().length}get serverUnknownTotal(){return this.paginationMode==="server"&&this.unknownTotal}get pageCount(){const pageSize=this.normalizedPageSize;return pageSize>0?Math.ceil(this.matchingTotalItems/pageSize):0}get appliedPage(){return this.pageCount===0?1:finiteInteger(this.page,1,1,this.pageCount)}sortedEntries(){return this.matchingEntries()}sortedCanonicalEntries(){const entries=this.canonicalRowEntries();if(this.sortMode!=="client"||this.sortKey==="")return entries;const col=this.columnsByKey.get(this.sortKey);if(!col?.sortable)return entries;const locale=this.effectiveLocale,inputs=this.sortedEntriesInputs;if(this.cachedSortedEntries!==null&&inputs!==null&&inputs.entries===entries&&inputs.columns===this.columns&&inputs.mode===this.sortMode&&inputs.key===this.sortKey&&inputs.dir===this.sortDir&&inputs.locale===locale&&inputs.groupBy===this.groupBy)return this.cachedSortedEntries;const collator=getCollator(locale,{numeric:!0}),dir=this.sortDir==="desc"?-1:1,decorated=entries.map(entry=>{const raw=typeof col.sortValue=="function"?col.sortValue(entry.row):typeof col.cell=="function"?String(col.cell(entry.row)??""):"";return{entry,value:typeof raw=="number"&&!Number.isFinite(raw)?null:raw}}),compare=(a,b)=>{const av=a.value,bv=b.value;return av==null&&bv==null?0:av==null?1:bv==null?-1:typeof av=="number"&&typeof bv=="number"?(av-bv)*dir:collator.compare(String(av),String(bv))*dir};let sorted;const groupBy=this.groupBy;if(groupBy===void 0)decorated.sort(compare),sorted=decorated.map(decoration=>decoration.entry);else{const buckets=new Map;for(const decoration of decorated){const groupKey=groupBy(decoration.entry.row),bucket=buckets.get(groupKey);bucket===void 0?buckets.set(groupKey,[decoration]):bucket.push(decoration)}const ordered=[...buckets.values()],constantWithinEveryGroup=ordered.every(bucket=>bucket.every(decoration=>compare(decoration,bucket[0])===0));constantWithinEveryGroup&&ordered.sort((a,b)=>compare(a[0],b[0])),sorted=[];for(const bucket of ordered){constantWithinEveryGroup||bucket.sort(compare);for(const decoration of bucket)sorted.push(decoration.entry)}}return this.sortedEntriesInputs={entries,columns:this.columns,mode:this.sortMode,key:this.sortKey,dir:this.sortDir,locale,groupBy},this.cachedSortedEntries=sorted,sorted}renderedEntries(){const entries=this.sortedEntries(),size=this.normalizedPageSize,start=this.paginationMode==="server"?0:(this.appliedPage-1)*size,cached=this.pageEntriesMemo;if(cached&&cached.entries===entries&&cached.start===start&&cached.size===size)return cached.result;const result=entries.slice(start,start+size);return this.pageEntriesMemo={entries,start,size,result},result}publicRows(entries){let rows=this.publicRowsMemo.get(entries);return rows||(rows=Object.freeze(entries.map(entry=>entry.row)),this.publicRowsMemo.set(entries,rows)),rows}aggregate(callback,key=callback,receiver=this){if(!callback)return"";const rows=this.viewRows;return(rows!==this.aggregateRows||this.columns!==this.aggregateColumns||this.effectiveLocale!==this.aggregateLocale)&&(this.aggregateRows=rows,this.aggregateColumns=this.columns,this.aggregateLocale=this.effectiveLocale,this.aggregateValues.clear()),this.aggregateValues.has(key)||this.aggregateValues.set(key,callback.call(receiver,rows)),this.aggregateValues.get(key)}get viewRows(){return this.publicRows(this.sortedEntries())}get pageRows(){return this.publicRows(this.renderedEntries())}focusedColKey(displayed){const visibleKeys=displayed??this.visibleHeaders().map(el=>el.dataset.colKey).filter(key=>key!==void 0&&this.columnsByKey.has(key));return this.activeColKey!==null&&this.columnsByKey.has(this.activeColKey)&&(visibleKeys.length===0||visibleKeys.includes(this.activeColKey))?this.activeColKey:visibleKeys[0]??this.columns[0]?.key??null}displayedColumnKeys(){const base=this.renderRoot?.querySelector?.('[part="base"]'),hideLow=!this.priorityColumnsVisible&&!!base?.hasAttribute("data-hide-priority-low"),hideMedium=!this.priorityColumnsVisible&&!!base?.hasAttribute("data-hide-priority-medium");return this.columns.filter(col=>!(hideLow&&col.priority==="low")&&!(hideMedium&&col.priority==="medium")).map(col=>col.key)}focusedRowKey(){if(this.activeRowKey!==null&&this.rowsByKey.has(this.activeRowKey))return this.activeRowKey;const selectedKey=this._selectedKeys.values().next().value;if(selectedKey!==void 0){const selected=encodeKey(selectedKey);if(this.rowsByKey.has(selected))return selected}const first=this.renderedEntries()[0];return first?encodeKey(first.key):null}rowsAffectingRovingFocusChanged(changed){return changed.has("rows")||changed.has("rowKey")||changed.has("filterText")||changed.has("filter")||changed.has("page")||changed.has("pageSize")||changed.has("paginationMode")||changed.has("totalItems")||changed.has("columns")||changed.has("sortKey")||changed.has("sortDir")||changed.has("sortMode")||changed.has("groupBy")||this.rowsLocale!==this.effectiveLocale}captureRovingFocus(changed){this.rovingFocusSnapshot=null;const active=shadowFocusTarget(this),HTMLElementCtor=this.ownerDocument?.defaultView?.HTMLElement;if(!(!HTMLElementCtor||!(active instanceof HTMLElementCtor))){if(changed.has("columns")&&active.matches("th[data-col-key]")){const headers=this.visibleHeaders(),key=active.dataset.colKey,index=headers.indexOf(active);key!==void 0&&index>=0&&(this.rovingFocusSnapshot={kind:"header",key,index,targetKey:null,element:active});return}if(this.rowsAffectingRovingFocusChanged(changed)&&active.matches("tr[data-row-key]")){const renderedRows=[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")],key=active.dataset.rowKey,index=renderedRows.indexOf(active);key!==void 0&&index>=0&&(this.rovingFocusSnapshot={kind:"row",key,index,targetKey:null,element:active})}}}resolveRovingFocusTarget(){const snapshot=this.rovingFocusSnapshot;if(snapshot===null)return;const keys=snapshot.kind==="header"?this.columns.map(column=>column.key):[...this.rowsByKey.keys()];snapshot.targetKey=keys.includes(snapshot.key)?snapshot.key:keys[Math.min(snapshot.index,keys.length-1)]??null,snapshot.kind==="header"?this.activeColKey=snapshot.targetKey:this.activeRowKey=snapshot.targetKey}willUpdate(changed){if(super.willUpdate(changed),this.themedResizeMinWidth=void 0,this.captureRovingFocus(changed),this.selectionMode==="single"&&this._selectedKeys.size>1&&(changed.has("selectionMode")||changed.has("selectedRowKeys"))){const first=this._selectedKeys.values().next().value;if(this.selectedRowKeys=this.asKeySet(first===void 0?new Set:new Set([first])),this.hasUpdated){const rowKeys=this.asKeyList(Object.freeze(first===void 0?[]:[first]));this.emit("lr-selection-change",Object.freeze({selectedRowKeys:rowKeys}))}}if(this.expansionMode==="single"&&this._expandedKeys.size>1&&(changed.has("expansionMode")||changed.has("expandedRowKeys"))){const first=this._expandedKeys.values().next().value;this.expandedRowKeys=this.asKeySet(first===void 0?new Set:new Set([first]))}if(!this.hasUpdated){const parsed=readPersistedState(this.storageFullKey,v=>typeof v=="object"&&v!==null);parsed&&typeof parsed.priorityColumnsVisible=="boolean"&&!isPersistedPropertyExplicitlySet(this,"priorityColumnsVisible")&&(this.priorityColumnsVisible=parsed.priorityColumnsVisible)}if(changed.has("columns")&&(this.columnsByKey=new Map(this.columns.map(c=>[c.key,c]))),this.rowsAffectingRovingFocusChanged(changed)&&(this.rowsByKey=new Map(this.renderedEntries().map(entry=>[entry.token,entry])),this.rowsLocale=this.effectiveLocale),this.resolveRovingFocusTarget(),this.editingCell!==null){const column=this.columnsByKey.get(this.editingCell.columnKey);(!this.rowsByKey.has(this.editingCell.rowKey)||normalizedEditTrigger(column?.editTrigger)!=="double-click")&&(this.editingCell=null)}this.editorHadFocusBeforeUpdate=this.focusedEditorCell!==null&&shadowFocusTarget(this)===this.editorElementFor(this.focusedEditorCell.rowKey,this.focusedEditorCell.columnKey)}stickyOffsets(){const offsets=new Map,headerWidths=new Map;for(const el of this.renderRoot.querySelectorAll("th[data-col-key]")){const key=el.dataset.colKey;key!==void 0&&!headerWidths.has(key)&&headerWidths.set(key,el.offsetWidth)}const headerWidth=key=>headerWidths.get(key)??0;let runningStart=0;for(const col of this.columns)stickyDirection(col.sticky)==="start"&&(offsets.set(col.key,runningStart),runningStart+=headerWidth(col.key));let runningEnd=0;for(let i=this.columns.length-1;i>=0;i--){const col=this.columns[i];col&&stickyDirection(col.sticky)==="end"&&(offsets.set(col.key,runningEnd),runningEnd+=headerWidth(col.key))}return offsets}computeHeatDomain(hasHeatTint){if(!hasHeatTint)return null;const entries=this.matchingEntries(),min=this.heatTintScale?.min,max=this.heatTintScale?.max,cached=this.heatDomainCache;if(cached&&cached.entries===entries&&cached.columns===this.columns&&cached.min===min&&cached.max===max)return cached.domain;const domain=this.deriveHeatDomain(entries);return this.heatDomainCache={entries,columns:this.columns,min,max,domain},domain}deriveHeatDomain(entries){const values=[];for(const entry of entries)for(const col of this.columns){const v=col.heatValue?.(entry.row);v!=null&&Number.isFinite(v)&&values.push(v)}const auto=minMax(values),lo=this.heatTintScale?.min??auto?.[0],hi=this.heatTintScale?.max??auto?.[1];return lo===void 0||hi===void 0?null:[lo,hi]}heatShare(col,row,domain){if(!col.heatValue||!domain)return null;const v=col.heatValue(row);if(v==null||!Number.isFinite(v))return null;const[lo,hi]=domain;return`${(finiteRatio(v,lo,hi)*100).toFixed(2)}%`}applyStickyOffsets(writes){if(!this.columns.some(c=>c.sticky))return;const offsets=this.stickyOffsets(),cells=this.renderRoot.querySelectorAll("th[data-col-key], td[data-col-key]"),apply=()=>cells.forEach(el=>{const key=el.dataset.colKey;key!==void 0&&offsets.has(key)&&el.style.setProperty("--lr-table-sticky-offset",`${offsets.get(key)}px`)});writes.push(apply)}updated(changed){super.updated(changed),this.firstUpdateAnnouncementsReady&&this.rowsTruncated&&(changed.has("rows")||changed.has("maxRows"))&&this.announcements.announcePolite(this.localize("tableRowLimit",void 0,{count:getNumberFormat(this.effectiveLocale).format(this.rows.length)})),this.firstUpdateAnnouncementsReady&&changed.has("loading")&&this.loading&&this.announcements.announcePolite(this.loadingText()),this.firstUpdateAnnouncementsReady&&changed.has("loadingMore")&&this.loadingMore&&!this.loading&&this.shadowRoot?.querySelector('[part="more-button"]')&&this.announcements.announcePolite(this.loadingMoreText());const announcesErrorTransition=this.firstUpdateAnnouncementsReady&&changed.has("error")&&this.error,announcesMountedError=!this.firstUpdateAnnouncementsReady&&this.announce&&this.error;if((announcesErrorTransition||announcesMountedError)&&this.announcements.announceAssertive(this.localizedOverride("tableLoadFailed",this.errorHeading)),this.firstUpdateAnnouncementsReady=!0,this.persistReady&&changed.has("priorityColumnsVisible")&&writePersistedState(this.storageFullKey,{priorityColumnsVisible:this.priorityColumnsVisible}),this.persistReady=!0,changed.has("columns")||changed.has("revealColumnsLabel")||changed.has("columnsHideLabel")||changed.has("priorityColumnsVisible")||changed.has("storageKey")){const inertMembers=[],labelsInert=this.revealColumnsLabel!==void 0||this.columnsHideLabel!==void 0;labelsInert&&inertMembers.push("`revealColumnsLabel`/`columnsHideLabel`"),isPersistedPropertyExplicitlySet(this,"priorityColumnsVisible")&&inertMembers.push("`priorityColumnsVisible`"),this.storageKey&&inertMembers.push("`storageKey`"),inertMembers.length>0&&this.columns.length>0&&!this.columns.some(col=>col.priority)&&devWarnOnce(INERT_PRIORITY_COLUMN_CONFIG_WARNING,`<lr-table>: ${inertMembers.join(", ")} `+(inertMembers.length>1||labelsInert?"have":"has")+" no effect unless at least one column declares `priority`.")}const geometryChanged=changed.size===0||[...changed.keys()].some(key=>key!=="selectedRowKeys"&&key!=="selectionMode"&&key!=="activeRowKey"&&key!=="activeColKey"),base=this.renderRoot.querySelector('[part="base"]');if(base&&this.observeBase(base),this.observeTable(this.renderRoot.querySelector('[part="table"]')??void 0),geometryChanged&&this.observeHeaders(),this.restoreRovingFocus(),this.hasAlwaysOnEditors&&this.restoreAlwaysOnEditorFocus(),changed.has("editingCell"))if(this.editingCell){const{rowKey,columnKey}=this.editingCell;queueMicrotask(()=>this.editorElementFor(rowKey,columnKey)?.focus())}else{const previous=changed.get("editingCell");if(previous){const{rowKey,columnKey}=previous;queueMicrotask(()=>this.cellElementForToken(rowKey,columnKey)?.focus())}}geometryChanged&&queueMicrotask(()=>this.syncLayoutGeometry())}restoreRovingFocus(){const snapshot=this.rovingFocusSnapshot;if(this.rovingFocusSnapshot=null,snapshot===null)return;const internalActive=shadowFocusTarget(this);if(internalActive!==null&&internalActive!==snapshot.element)return;const documentActive=activeElementIn(this.ownerDocument);if(documentActive!==null&&documentActive!==this&&documentActive!==this.ownerDocument.body)return;const candidates=snapshot.kind==="header"?this.visibleHeaders():[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")],target=candidates.find(candidate=>snapshot.kind==="header"?candidate.dataset.colKey===snapshot.targetKey:candidate.dataset.rowKey===snapshot.targetKey)??candidates[Math.min(snapshot.index,candidates.length-1)]??null;snapshot.kind==="header"?this.focusHeader(target):this.focusRow(target)}activateColumn(key){this.activeColKey=key;const col=this.columnsByKey.get(key);if(!col?.sortable)return;const sortDir=this.sortKey===key?this.sortDir==="asc"?"desc":"asc":col.defaultSortDir??this.defaultSortDir,request=Object.freeze({phase:"request",sortKey:col.key,sortDir});this.emit("lr-sort-request",request,{cancelable:!0}).defaultPrevented||(this.sortMode==="client"&&(this.sortKey=col.key,this.sortDir=sortDir),this.emit("lr-sort",Object.freeze({phase:"commit",sortKey:col.key,sortDir})))}commitSelectedKeys(next){next.size>this.maxRows&&(next=keySet(next,this.maxRows));const previous=this._selectedKeys;this.isRebind("selectedRowKeys",next,previous),this._selectedKeys=next,this.requestUpdate("selectedRowKeys",previous)}activateRow(key){this.activeRowKey=key;const entry=this.rowsByKey.get(key);if(entry===void 0)return;const{row,key:selectedKey}=entry;if(this.emit("lr-row-activate",Object.freeze({row})),this.selectionMode==="single"){this.commitSelectedKeys(new Set([selectedKey]));const rowKeys=this.asKeyList(Object.freeze([selectedKey]));this.emit("lr-selection-change",Object.freeze({selectedRowKeys:rowKeys}))}else if(this.selectionMode==="multiple"){const rawKey=selectedKey,next=new Set(this._selectedKeys);next.has(rawKey)?next.delete(rawKey):next.add(rawKey),this.commitSelectedKeys(next);const rowKeys=this.asKeyList(Object.freeze([...this._selectedKeys]));this.emit("lr-selection-change",Object.freeze({selectedRowKeys:rowKeys}))}}get hasAlwaysOnEditors(){return this.columns.some(col=>normalizedEditTrigger(col.editTrigger)==="always")}editorValue(row,column){const value=column.editValue?.(row)??row[column.key]??"";return String(value)}startEditing(rowKey,columnKey){const column=this.columnsByKey.get(columnKey);normalizedEditTrigger(column?.editTrigger)!=="double-click"||!this.rowsByKey.has(rowKey)||(this.editingCell={rowKey,columnKey})}commitEdit(event,rowKey,columnKey){event.stopPropagation();const field=event.currentTarget,entry=this.rowsByKey.get(rowKey),column=this.columnsByKey.get(columnKey),isTransient=this.editingCell?.rowKey===rowKey&&this.editingCell.columnKey===columnKey;if(!entry||!column||normalizedEditTrigger(column.editTrigger)===void 0){isTransient&&(this.editingCell=null);return}const value=column.editType==="number"&&field.value!==""?Number(field.value):field.value;this.emit("lr-cell-edit",Object.freeze({row:entry.row,columnKey,value})),isTransient&&(this.editingCell=null)}editorElementFor(rowKey,columnKey){return this.cellElementForToken(rowKey,columnKey)?.querySelector('[part="cell-editor"]')??null}restoreAlwaysOnEditorFocus(){const cell=this.focusedEditorCell;if(cell===null)return;const editor=this.editorElementFor(cell.rowKey,cell.columnKey);editor===null?this.focusedEditorCell=null:this.editorHadFocusBeforeUpdate&&shadowFocusTarget(this)!==editor&&editor.focus(),this.editorHadFocusBeforeUpdate=!1}activateExpandToggle(key){const entry=this.rowsByKey.get(encodeKey(key));if(entry===void 0)return;const expanded=!this._expandedKeys.has(key),detail=Object.freeze({row:entry.row,rowKey:key,expanded});if(this.expansionMode!=="single"&&this.expansionMode!=="multiple"){this.emit("lr-row-expand-toggle",detail);return}requestThenCommit({requestDetail:detail,emitRequest:(requestDetail,init)=>this.emit("lr-row-expand-request",requestDetail,init),commit:()=>{let next=this.expansionMode==="single"?new Set:new Set(this._expandedKeys);expanded?next.add(key):next.delete(key),next.size>this.maxRows&&(next=keySet(next,this.maxRows));const displaced=[...this._expandedKeys].filter(other=>other!==key&&!next.has(other)),previous=this._expandedKeys;this.isRebind("expandedRowKeys",next,previous),this._expandedKeys=next,this.requestUpdate("expandedRowKeys",previous);for(const other of displaced){const displacedEntry=this.rowsByKey.get(encodeKey(other));displacedEntry!==void 0&&this.emit("lr-row-expand-toggle",Object.freeze({row:displacedEntry.row,rowKey:other,expanded:!1}))}this.emit("lr-row-expand-toggle",Object.freeze({...detail,expanded:next.has(key)}))}})}rowElement(rowKey){return this.rowElementForToken(encodeKey(rowKey))}cellElement(rowKey,columnKey){return this.cellElementForToken(encodeKey(rowKey),columnKey)}editCell(rowKey,columnKey){const token=encodeKey(rowKey),trigger=normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger);if(!(trigger===void 0||!this.rowsByKey.has(token))){if(trigger==="always"){this.editorElementFor(token,columnKey)?.focus();return}this.startEditing(token,columnKey)}}expandedContentElement(rowKey){const token=encodeKey(rowKey);return[...this.renderRoot.querySelectorAll("tbody tr[data-expanded-row-key]")].find(el=>el.dataset.expandedRowKey===token)?.querySelector('[part="expanded-cell"]')??null}rowElementForToken(token){return[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")].find(el=>el.dataset.rowKey===token)??null}cellElementForToken(token,columnKey){return[...this.rowElementForToken(token)?.querySelectorAll("td[data-col-key]")??[]].find(el=>el.dataset.colKey===columnKey)??null}visibleHeaders(){return[...this.renderRoot?.querySelectorAll("th[data-col-key]")??[]].filter(el=>el.offsetParent!==null)}focusHeader(el){el?.dataset.colKey&&(this.activeColKey=el.dataset.colKey,el.focus())}focusRow(el){el?.dataset.rowKey&&(this.activeRowKey=el.dataset.rowKey,el.focus())}onHeaderKeyDown(e,th){if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateColumn(th.dataset.colKey);return}const headers=this.visibleHeaders(),index=headers.indexOf(th);if(index<0)return;const rtl=isRtl(this);switch(e.key){case"ArrowLeft":e.preventDefault(),this.focusHeader(headers[rtl?Math.min(headers.length-1,index+1):Math.max(0,index-1)]??null);return;case"ArrowRight":e.preventDefault(),this.focusHeader(headers[rtl?Math.max(0,index-1):Math.min(headers.length-1,index+1)]??null);return;case"Home":e.preventDefault(),this.focusHeader(headers[0]??null);return;case"End":e.preventDefault(),this.focusHeader(headers[headers.length-1]??null);return;case"ArrowDown":{e.preventDefault();const rows=[...this.renderRoot.querySelectorAll("[data-row-key]")],key=this.focusedRowKey();this.focusRow(rows.find(r=>r.dataset.rowKey===key)??rows[0]??null);return}default:return}}editableCellFor(target){const columnKey=target.dataset.colKey;return target.tagName!=="TD"||columnKey===void 0?null:normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger)==="double-click"?{element:target,columnKey}:null}editableCellsInRow(tr){return[...tr.querySelectorAll("td[data-editable]")].filter(td=>td.offsetParent!==null&&!td.inert&&!td.closest("[inert]"))}onRowKeyDown(e,tr){const cell=this.editableCellFor(e.target);if((e.key==="Enter"||e.key==="F2")&&cell){e.preventDefault(),this.startEditing(tr.dataset.rowKey,cell.columnKey);return}if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateRow(tr.dataset.rowKey);return}if(e.key==="ArrowLeft"||e.key==="ArrowRight"){this.onRowLateralKeyDown(e,tr,cell);return}const bodyRows=[...this.renderRoot.querySelectorAll("[data-row-key]")],index=bodyRows.indexOf(tr);if(!(index<0))switch(e.key){case"ArrowDown":e.preventDefault(),this.focusRow(bodyRows[Math.min(bodyRows.length-1,index+1)]??null);return;case"ArrowUp":if(e.preventDefault(),index===0){const headers=this.visibleHeaders(),key=this.focusedColKey();this.focusHeader(headers.find(h=>h.dataset.colKey===key)??headers[0]??null)}else this.focusRow(bodyRows[index-1]??null);return;case"Home":e.preventDefault(),this.focusRow(bodyRows[0]??null);return;case"End":e.preventDefault(),this.focusRow(bodyRows[bodyRows.length-1]??null);return;default:return}}onRowLateralKeyDown(e,tr,cell){const cells=this.editableCellsInRow(tr);if(cells.length===0)return;e.preventDefault();const forward=e.key===(isRtl(this)?"ArrowLeft":"ArrowRight");if(cell===null){(forward?cells[0]:cells[cells.length-1])?.focus();return}const index=cells.indexOf(cell.element);forward?cells[index+1]?.focus():index<=0?this.focusRow(tr):cells[index-1]?.focus()}renderCellContent(col,row){const value=this.renderCellValue(col,row);if(typeof col.cellPart!="function")return value;const extraParts=cellContentPartNames(col.cellPart(row));return html`<div part="cell-content ${extraParts}">${value}</div>`}renderCellValue(col,row){return typeof col.cell=="function"?col.cell(row):(devWarnOnce(MISSING_CELL_RENDERER_WARNING,"<lr-table>: a column has no required `cell` renderer, so its cells render empty. Supply a `cell` callback for every column."),nothing)}renderCellEditor(row,col,rowKey,alwaysOn){const type=col.editType??"text",value=this.editorValue(row,col),label=col.editLabel?.(row)??this.localize("tableEditCell",void 0,{column:col.label}),onChange=event=>this.commitEdit(event,rowKey,col.key),onKeyDown=event=>this.onEditorKeyDown(event,rowKey,col.key);if(type==="select"){const options=col.editOptions??[];return html`<select
|
|
15
15
|
part="cell-editor"
|
|
16
16
|
aria-label=${label}
|
|
17
17
|
@change=${onChange}
|
|
@@ -173,7 +173,7 @@ import{__decorate}from"tslib";import{relayNativeEvent}from"../../../internal/nat
|
|
|
173
173
|
title=${cellTitle||nothing}
|
|
174
174
|
style=${tintedStyle&&Object.keys(tintedStyle).length?styleMap(tintedStyle):nothing}
|
|
175
175
|
>
|
|
176
|
-
${editing?this.renderCellEditor(row,col,token,alwaysOn):this.
|
|
176
|
+
${editing?this.renderCellEditor(row,col,token,alwaysOn):this.renderCellContent(col,row)}
|
|
177
177
|
</td>`})}
|
|
178
178
|
${hasRowTotal?html`<td part="row-total-cell">${this.rowTotal?.(row)}</td>`:nothing}
|
|
179
179
|
</tr>`,rowExpanded?html`<tr part="expanded-row" role="row" data-expanded-row-key=${token}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{iconHitTarget,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";import{raiseWhileOverlayOpen}from"../../../internal/open-overlay-raise.styles.js";import{dataStateRetryStyles,dataStateSurfaceStyles}from"../../../internal/data-state-renderer.styles.js";const styles=css` :host { display: block; inline-size: 100%; --_lr-table-heat-tint-lo-default: var(--lr-color-brand-quiet); --_lr-table-heat-tint-hi-default: var(--lr-color-brand); --_lr-table-resize-min-width-default: var(--lr-size-3rem); --_lr-table-resize-handle-opacity-default: 0.12; } [part='base'] { overflow: auto; max-block-size: var(--lr-table-max-height, none); border: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); border-radius: var(--lr-table-radius, var(--lr-radius-container)); background: var(--lr-table-surface, var(--lr-color-surface)); scrollbar-width: var(--lr-theme-scrollbar-width, auto); scrollbar-gutter: var(--lr-theme-scrollbar-gutter, auto); } [part='row-limit'] { padding: var(--lr-space-s); color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-sm); } :host([scroll-mode='page']) [part='base'], :host([scroll-mode='auto']) [part='base']:not([data-scroll-overflow]) { overflow: visible; max-block-size: none; } :host([scroll-mode='page']) [part='base']:not([data-scroll-overflow]), :host([scroll-mode='auto']) [part='base']:not([data-scroll-overflow]) { overflow: clip; } [part='filter-label'] { display: flex; align-items: center; gap: var(--lr-space-s); padding: var(--lr-space-s); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-md-sm); } [part='filter'] { min-inline-size: 0; flex: 1; padding: var(--lr-space-xs) var(--lr-space-s); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-radius-xs); background: var(--lr-color-surface); color: var(--lr-color-text); font: inherit; } [part='filter']:focus-visible { ${focusRing} } :where([part='filter']):hover { background: var(--lr-color-brand-quiet); } :where([part='filter']):active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='filter']::placeholder { color: var(--lr-color-text-quiet); opacity: 1; } [part='filter'][type='search']::-webkit-search-cancel-button, [part='filter'][type='search']::-webkit-search-decoration { appearance: none; } [part='filter-clear'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; ${iconHitTarget} border: 0; border-radius: var(--lr-radius-xs); background: transparent; cursor: pointer; color: var(--lr-color-text-quiet); padding: var(--lr-space-xs); transition: background-color var(--lr-transition-fast), color var(--lr-transition-fast); } [part='filter-clear']:hover { color: var(--lr-color-text); } [part='filter-clear']:active { color: var(--lr-color-text); background: color-mix( in oklab, var(--lr-color-surface), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='filter-clear']:focus-visible { outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color); outline-offset: calc(-1 * var(--lr-focus-ring-width)); } [part='loading']:not(.sr-only) { display: grid; place-items: center; min-block-size: var(--lr-size-8rem); padding: var(--lr-space-l); } [part='pagination'] { display: block; border-block-start: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); } [part='base'][data-hide-priority-low]:not([data-force-visible]) [data-priority='low'] { display: none; } [part='base'][data-hide-priority-medium]:not([data-force-visible]) [data-priority='medium'] { display: none; } [part='table'] { inline-size: 100%; border-collapse: collapse; font: inherit; font-size: var(--lr-table-font-size, inherit); } [part='table'][data-layout='fixed'] { table-layout: fixed; } [part='row'], [part='head'] > tr, [part='footer-row'] { block-size: max( var(--lr-size-24px), var(--lr-table-row-height, calc(var(--lr-table-row-min-height) * var(--_lr-density-control, 1))), var(--_lr-density-target-min, 0px) ); } [part='header-cell'] { position: sticky; inset-block-start: 0; background: var(--_lr-table-header-bg, var(--lr-table-surface, var(--lr-color-surface))); text-align: start; font-weight: var(--lr-font-weight-semibold); padding: var(--lr-table-cell-padding, var(--lr-space-s)); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); cursor: default; white-space: nowrap; } [part='header-cell'][data-resizable] { padding-inline-end: calc(var(--lr-space-s) + var(--lr-size-0-5rem)); } [part='resize-handle'] { position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: var(--lr-size-0-5rem); ${iconHitTarget} cursor: col-resize; touch-action: none; } [part='resize-handle']:hover, [part='resize-handle']:focus-visible { background: var(--lr-table-resize-handle-hover-bg, var(--lr-color-brand)); opacity: var( --lr-table-resize-handle-hover-opacity, var(--lr-table-resize-handle-opacity, var(--_lr-table-resize-handle-opacity-default)) ); } [part='resize-handle']:active, [part='resize-handle'][data-resizing] { background: var( --lr-table-resize-handle-active-bg, var(--lr-table-resize-handle-hover-bg, var(--lr-color-brand)) ); opacity: var( --lr-table-resize-handle-active-opacity, calc( var( --lr-table-resize-handle-hover-opacity, var(--lr-table-resize-handle-opacity, var(--_lr-table-resize-handle-opacity-default)) ) * 2 ) ); } [part='resize-handle']:focus-visible { outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color); outline-offset: calc(-1 * max(var(--lr-focus-ring-width), calc(var(--lr-focus-ring-width) + var(--lr-focus-ring-offset)))); } :where([part='header-cell'][aria-sort]:not([aria-sort='none'])), :where([part='header-cell'][data-sortable]) { cursor: pointer; } [part='header-cell']:where([aria-sort]:not([aria-sort='none'])) { --_lr-table-header-bg: var(--lr-table-header-sorted-bg, var(--lr-table-surface, var(--lr-color-surface))); background: var(--_lr-table-header-bg); color: var(--lr-table-header-sorted-color, inherit); } [part='header-cell'][data-sortable]:hover { background: var(--lr-color-brand-quiet); } [part='header-cell'][data-sortable]:active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='header-cell']:focus-visible { ${focusRing} } [part='header-cell'][data-align='end'] { text-align: end; } [part~='sort-icon'] { display: inline-block; margin-inline-start: var(--lr-space-xs); vertical-align: middle; transition: transform var(--lr-transition-fast); } [part~='sort-icon-inactive'] { color: var(--lr-color-text-quiet); } @media (forced-colors: active) { [part~='sort-icon-inactive'] { color: CanvasText !important; } } [part~='sort-icon'] svg { display: block; } [part~='sort-icon'][data-dir='asc'] { transform: rotate(-90deg); } [part~='sort-icon'][data-dir='desc'] { transform: rotate(90deg); } @media (prefers-reduced-motion: reduce) { [part~='sort-icon'] { transition: none !important; } } [part='row'][data-stripe] { background: var(--lr-table-row-stripe-bg, transparent); --_lr-table-row-bg: var(--lr-table-row-stripe-bg, var(--lr-table-surface, var(--lr-color-surface))); } [part='row'][aria-selected='true'] { --_lr-table-row-bg: var(--lr-table-row-selected-bg, var(--lr-color-brand-quiet)); background: var(--_lr-table-row-bg); } [part='row']:hover { --_lr-table-row-bg: color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-hover)); background: var(--_lr-table-row-bg); } [part='row']:active { --_lr-table-row-bg: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); background: var(--_lr-table-row-bg); } @media (forced-colors: active) { :where([part~='row'][aria-selected='true']) { outline: var(--lr-border-width-medium) solid Highlight; outline-offset: calc(-1 * var(--lr-border-width-medium)); } :where([part~='row']:hover:not([aria-selected='true'])) { outline: var(--lr-border-width-thin) dashed Highlight; outline-offset: calc(-1 * var(--lr-border-width-thin)); } } [part='group-cell'] { padding: var(--lr-table-cell-padding-compact, var(--lr-space-xs) var(--lr-space-s)); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); background: var(--lr-color-surface-raised); color: var(--lr-color-text-quiet); font-weight: var(--lr-font-weight-semibold); text-align: start; } [part='row']:focus-visible { ${focusRing} } [part='cell'] { padding: var(--lr-table-cell-padding, var(--lr-space-s)); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); color: var(--lr-table-cell-color, inherit); } [part='cell'][data-editable] { transition: var(--lr-transition-interactive); } :where([part='cell'][data-editable]):hover { cursor: pointer; background: var(--lr-color-brand-quiet); } :where([part='cell'][data-editable]):active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='cell'][data-editable]:focus-visible { ${focusRing} } [part='cell'] a:where(:any-link) { color: var(--lr-table-cell-link-color, var(--lr-color-brand)); } [part='cell'] a:where(:any-link):hover, [part='cell'] a:where(:any-link):focus-visible, [part='cell'] a:where(:any-link):active { color: var( --lr-table-cell-link-hover-color, var(--lr-table-cell-link-color, var(--lr-color-brand)) ); text-decoration-thickness: var(--lr-border-width-medium); } [part='cell-editor'] { box-sizing: border-box; inline-size: 100%; min-inline-size: 0; padding: var(--lr-space-xs) var(--lr-space-s); border: var(--lr-border-width-thin) solid var(--lr-color-brand); border-radius: var(--lr-radius-xs); background: var(--lr-color-surface); color: var(--lr-color-text); font: inherit; } [part='cell-editor']:focus-visible { ${focusRing} } :where([part='cell-editor']):hover { background: var(--lr-color-brand-quiet); } :where([part='cell-editor']):active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='cell-editor'][type='number'] { appearance: textfield; } [part='cell-editor'][type='number']::-webkit-inner-spin-button, [part='cell-editor'][type='number']::-webkit-outer-spin-button { appearance: none; margin: 0; } select[part='cell-editor'] { appearance: none; padding-inline-end: calc(var(--lr-space-s) + var(--lr-size-0-75rem)); cursor: pointer; } select[part='cell-editor'] option { background: var(--lr-color-surface); color: var(--lr-color-text); } [part='cell']:has(> select[part='cell-editor']) { position: relative; } [part='cell']:has(> select[part='cell-editor'])::after { content: ''; position: absolute; inset-inline-end: var(--lr-space-s); inset-block-start: 50%; inline-size: var(--lr-size-0-75rem); block-size: var(--lr-size-0-75rem); color: var(--lr-color-text-quiet); background: currentColor; mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="9 6 15 12 9 18"%3E%3C/polyline%3E%3C/svg%3E') center / contain no-repeat; transform: translateY(-50%) rotate(90deg); pointer-events: none; } @media (forced-colors: active) { [part='cell']:has(> select[part='cell-editor'])::after { forced-color-adjust: none; color: ButtonText; } } [part='cell'][data-align='end'] { text-align: end; } [part='row-total-cell'] { padding: var(--lr-table-cell-padding, var(--lr-space-s)); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); font-weight: var(--lr-font-weight-semibold); text-align: end; } [part='cell'][data-heat] { background: color-mix( in srgb, var(--lr-table-heat-tint-hi, var(--_lr-table-heat-tint-hi-default)) var(--lr-table-heat-t), var(--lr-table-heat-tint-lo, var(--_lr-table-heat-tint-lo-default)) ); } [part='expand-toggle-cell'] { padding: var(--lr-space-s); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); text-align: center; } [part='row-expand-toggle'] { display: inline-flex; align-items: center; justify-content: center; font: inherit; border: none; background: none; padding: var(--lr-space-xs); cursor: pointer; color: inherit; ${iconHitTarget} } [part='row-expand-toggle']:hover { background: var(--lr-color-brand-quiet); } [part='row-expand-toggle']:active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='row-expand-toggle']:focus-visible { ${focusRing} } [part='row-expand-icon'] { display: inline-block; transition: transform var(--lr-transition-fast); } [part='row-expand-icon'] svg { display: block; } [part='row-expand-toggle'][aria-expanded='true'] [part='row-expand-icon'] { transform: rotate(90deg); } :host(:dir(rtl)) [part='row-expand-icon'] { transform: rotate(180deg); } :host(:dir(rtl)) [part='row-expand-toggle'][aria-expanded='true'] [part='row-expand-icon'] { transform: rotate(90deg); } @media (prefers-reduced-motion: reduce) { [part='row-expand-icon'] { transition: none !important; } } [part='expanded-row'] [part='expanded-cell'] { padding: var(--lr-space-s); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); background: var(--lr-table-surface, var(--lr-color-surface)); } [part='header-cell'][data-sticky], [part='cell'][data-sticky] { position: sticky; inset-inline-start: var(--lr-table-sticky-offset, 0); z-index: var(--lr-layer-content); box-shadow: var(--lr-size-1px) 0 0 0 var(--lr-color-border-subtle); } [part='cell'][data-sticky] { background: var(--_lr-table-row-bg, var(--lr-table-surface, var(--lr-color-surface))); } [part='header-cell'][data-sticky] { background: var(--_lr-table-header-bg, var(--lr-table-surface, var(--lr-color-surface))); } [part='header-cell'][data-sticky='end'], [part='cell'][data-sticky='end'] { inset-inline-start: auto; inset-inline-end: var(--lr-table-sticky-offset, 0); box-shadow: calc(-1 * var(--lr-size-1px)) 0 0 0 var(--lr-color-border-subtle); } :host(:dir(rtl)) [part='header-cell'][data-sticky], :host(:dir(rtl)) [part='cell'][data-sticky] { box-shadow: calc(-1 * var(--lr-size-1px)) 0 0 0 var(--lr-color-border-subtle); } :host(:dir(rtl)) [part='header-cell'][data-sticky='end'], :host(:dir(rtl)) [part='cell'][data-sticky='end'] { box-shadow: var(--lr-size-1px) 0 0 0 var(--lr-color-border-subtle); } ${raiseWhileOverlayOpen("[part='cell'][data-sticky]","var(--lr-layer-popover)","calc(var(--lr-layer-content) + 1)")} [part='foot'] { position: sticky; inset-block-end: 0; background: var(--lr-table-surface, var(--lr-color-surface)); } [part='footer-cell'] { padding: var(--lr-table-cell-padding-compact, var(--lr-space-xs) var(--lr-space-s)); border-block-start: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); font-weight: var(--lr-font-weight-semibold); text-align: start; } [part='footer-cell'][data-align='end'] { text-align: end; } [part='more-button'], [part='reveal-columns-button'] { display: block; inline-size: 100%; padding: var(--lr-space-s); border: none; background: none; color: var(--lr-color-brand); font: inherit; cursor: pointer; border-block-start: var(--lr-border-width-thin) solid var(--lr-color-border); } [part='more-button']:hover:where(:not([aria-disabled='true'])), [part='reveal-columns-button']:hover { background: var(--lr-color-brand-quiet); } [part='more-button']:active:where(:not([aria-disabled='true'])), [part='reveal-columns-button']:active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='more-button']:focus-visible, [part='reveal-columns-button']:focus-visible { ${focusRing} } [part='more-button']:where([aria-disabled='true']) { cursor: progress; } ${dataStateSurfaceStyles("error")} ${dataStateRetryStyles} `;export{styles};
|
|
1
|
+
import{iconHitTarget,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";import{raiseWhileOverlayOpen}from"../../../internal/open-overlay-raise.styles.js";import{dataStateRetryStyles,dataStateSurfaceStyles}from"../../../internal/data-state-renderer.styles.js";const styles=css` :host { display: block; inline-size: 100%; --_lr-table-heat-tint-lo-default: var(--lr-color-brand-quiet); --_lr-table-heat-tint-hi-default: var(--lr-color-brand); --_lr-table-resize-min-width-default: var(--lr-size-3rem); --_lr-table-resize-handle-opacity-default: 0.12; } [part='base'] { overflow: auto; max-block-size: var(--lr-table-max-height, none); border: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); border-radius: var(--lr-table-radius, var(--lr-radius-container)); background: var(--lr-table-surface, var(--lr-color-surface)); scrollbar-width: var(--lr-theme-scrollbar-width, auto); scrollbar-gutter: var(--lr-theme-scrollbar-gutter, auto); } [part='row-limit'] { padding: var(--lr-space-s); color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-sm); } :host([scroll-mode='page']) [part='base'], :host([scroll-mode='auto']) [part='base']:not([data-scroll-overflow]) { overflow: visible; max-block-size: none; } :host([scroll-mode='page']) [part='base']:not([data-scroll-overflow]), :host([scroll-mode='auto']) [part='base']:not([data-scroll-overflow]) { overflow: clip; } [part='filter-label'] { display: flex; align-items: center; gap: var(--lr-space-s); padding: var(--lr-space-s); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-md-sm); } [part='filter'] { min-inline-size: 0; flex: 1; padding: var(--lr-space-xs) var(--lr-space-s); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-radius-xs); background: var(--lr-color-surface); color: var(--lr-color-text); font: inherit; } [part='filter']:focus-visible { ${focusRing} } :where([part='filter']):hover { background: var(--lr-color-brand-quiet); } :where([part='filter']):active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='filter']::placeholder { color: var(--lr-color-text-quiet); opacity: 1; } [part='filter'][type='search']::-webkit-search-cancel-button, [part='filter'][type='search']::-webkit-search-decoration { appearance: none; } [part='filter-clear'] { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; ${iconHitTarget} border: 0; border-radius: var(--lr-radius-xs); background: transparent; cursor: pointer; color: var(--lr-color-text-quiet); padding: var(--lr-space-xs); transition: background-color var(--lr-transition-fast), color var(--lr-transition-fast); } [part='filter-clear']:hover { color: var(--lr-color-text); } [part='filter-clear']:active { color: var(--lr-color-text); background: color-mix( in oklab, var(--lr-color-surface), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='filter-clear']:focus-visible { outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color); outline-offset: calc(-1 * var(--lr-focus-ring-width)); } [part='loading']:not(.sr-only) { display: grid; place-items: center; min-block-size: var(--lr-size-8rem); padding: var(--lr-space-l); } [part='pagination'] { display: block; border-block-start: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); } [part='base'][data-hide-priority-low]:not([data-force-visible]) [data-priority='low'] { display: none; } [part='base'][data-hide-priority-medium]:not([data-force-visible]) [data-priority='medium'] { display: none; } [part='table'] { inline-size: 100%; border-collapse: collapse; font: inherit; font-size: var(--lr-table-font-size, inherit); } [part='table'][data-layout='fixed'] { table-layout: fixed; } [part='row'], [part='head'] > tr, [part='footer-row'] { block-size: max( var(--lr-size-24px), var(--lr-table-row-height, calc(var(--lr-table-row-min-height) * var(--_lr-density-control, 1))), var(--_lr-density-target-min, 0px) ); } [part='header-cell'] { position: sticky; inset-block-start: 0; background: var(--_lr-table-header-bg, var(--lr-table-surface, var(--lr-color-surface))); text-align: start; font-weight: var(--lr-font-weight-semibold); padding: var(--lr-table-cell-padding, var(--lr-space-s)); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); cursor: default; white-space: nowrap; } [part='header-cell'][data-resizable] { padding-inline-end: calc(var(--lr-space-s) + var(--lr-size-0-5rem)); } [part='resize-handle'] { position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: var(--lr-size-0-5rem); ${iconHitTarget} cursor: col-resize; touch-action: none; } [part='resize-handle']:hover, [part='resize-handle']:focus-visible { background: var(--lr-table-resize-handle-hover-bg, var(--lr-color-brand)); opacity: var( --lr-table-resize-handle-hover-opacity, var(--lr-table-resize-handle-opacity, var(--_lr-table-resize-handle-opacity-default)) ); } [part='resize-handle']:active, [part='resize-handle'][data-resizing] { background: var( --lr-table-resize-handle-active-bg, var(--lr-table-resize-handle-hover-bg, var(--lr-color-brand)) ); opacity: var( --lr-table-resize-handle-active-opacity, calc( var( --lr-table-resize-handle-hover-opacity, var(--lr-table-resize-handle-opacity, var(--_lr-table-resize-handle-opacity-default)) ) * 2 ) ); } [part='resize-handle']:focus-visible { outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color); outline-offset: calc(-1 * max(var(--lr-focus-ring-width), calc(var(--lr-focus-ring-width) + var(--lr-focus-ring-offset)))); } :where([part='header-cell'][aria-sort]:not([aria-sort='none'])), :where([part='header-cell'][data-sortable]) { cursor: pointer; } [part='header-cell']:where([aria-sort]:not([aria-sort='none'])) { --_lr-table-header-bg: var(--lr-table-header-sorted-bg, var(--lr-table-surface, var(--lr-color-surface))); background: var(--_lr-table-header-bg); color: var(--lr-table-header-sorted-color, inherit); } [part='header-cell'][data-sortable]:hover { background: var(--lr-color-brand-quiet); } [part='header-cell'][data-sortable]:active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='header-cell']:focus-visible { ${focusRing} } [part='header-cell'][data-align='end'] { text-align: end; } [part~='sort-icon'] { display: inline-block; margin-inline-start: var(--lr-space-xs); vertical-align: middle; transition: transform var(--lr-transition-fast); } [part~='sort-icon-inactive'] { color: var(--lr-color-text-quiet); } @media (forced-colors: active) { [part~='sort-icon-inactive'] { color: CanvasText !important; } } [part~='sort-icon'] svg { display: block; } [part~='sort-icon'][data-dir='asc'] { transform: rotate(-90deg); } [part~='sort-icon'][data-dir='desc'] { transform: rotate(90deg); } @media (prefers-reduced-motion: reduce) { [part~='sort-icon'] { transition: none !important; } } [part='row'][data-stripe] { background: var(--lr-table-row-stripe-bg, transparent); --_lr-table-row-bg: var(--lr-table-row-stripe-bg, var(--lr-table-surface, var(--lr-color-surface))); } [part='row'][aria-selected='true'] { --_lr-table-row-bg: var(--lr-table-row-selected-bg, var(--lr-color-brand-quiet)); background: var(--_lr-table-row-bg); } [part='row']:hover { --_lr-table-row-bg: color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-hover)); background: var(--_lr-table-row-bg); } [part='row']:active { --_lr-table-row-bg: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); background: var(--_lr-table-row-bg); } @media (forced-colors: active) { :where([part~='row'][aria-selected='true']) { outline: var(--lr-border-width-medium) solid Highlight; outline-offset: calc(-1 * var(--lr-border-width-medium)); } :where([part~='row']:hover:not([aria-selected='true'])) { outline: var(--lr-border-width-thin) dashed Highlight; outline-offset: calc(-1 * var(--lr-border-width-thin)); } } [part='group-cell'] { padding: var(--lr-table-cell-padding-compact, var(--lr-space-xs) var(--lr-space-s)); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); background: var(--lr-color-surface-raised); color: var(--lr-color-text-quiet); font-weight: var(--lr-font-weight-semibold); text-align: start; } [part='row']:focus-visible { ${focusRing} } [part='cell'] { padding: var(--lr-table-cell-padding, var(--lr-space-s)); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); color: var(--lr-table-cell-color, inherit); } [part~='cell-content'] { display: block; min-inline-size: 0; } [part='cell'][data-editable] { transition: var(--lr-transition-interactive); } :where([part='cell'][data-editable]):hover { cursor: pointer; background: var(--lr-color-brand-quiet); } :where([part='cell'][data-editable]):active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='cell'][data-editable]:focus-visible { ${focusRing} } [part='cell'] a:where(:any-link) { color: var(--lr-table-cell-link-color, var(--lr-color-brand)); } [part='cell'] a:where(:any-link):hover, [part='cell'] a:where(:any-link):focus-visible, [part='cell'] a:where(:any-link):active { color: var( --lr-table-cell-link-hover-color, var(--lr-table-cell-link-color, var(--lr-color-brand)) ); text-decoration-thickness: var(--lr-border-width-medium); } [part='cell-editor'] { box-sizing: border-box; inline-size: 100%; min-inline-size: 0; padding: var(--lr-space-xs) var(--lr-space-s); border: var(--lr-border-width-thin) solid var(--lr-color-brand); border-radius: var(--lr-radius-xs); background: var(--lr-color-surface); color: var(--lr-color-text); font: inherit; } [part='cell-editor']:focus-visible { ${focusRing} } :where([part='cell-editor']):hover { background: var(--lr-color-brand-quiet); } :where([part='cell-editor']):active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='cell-editor'][type='number'] { appearance: textfield; } [part='cell-editor'][type='number']::-webkit-inner-spin-button, [part='cell-editor'][type='number']::-webkit-outer-spin-button { appearance: none; margin: 0; } select[part='cell-editor'] { appearance: none; padding-inline-end: calc(var(--lr-space-s) + var(--lr-size-0-75rem)); cursor: pointer; } select[part='cell-editor'] option { background: var(--lr-color-surface); color: var(--lr-color-text); } [part='cell']:has(> select[part='cell-editor']) { position: relative; } [part='cell']:has(> select[part='cell-editor'])::after { content: ''; position: absolute; inset-inline-end: var(--lr-space-s); inset-block-start: 50%; inline-size: var(--lr-size-0-75rem); block-size: var(--lr-size-0-75rem); color: var(--lr-color-text-quiet); background: currentColor; mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="9 6 15 12 9 18"%3E%3C/polyline%3E%3C/svg%3E') center / contain no-repeat; transform: translateY(-50%) rotate(90deg); pointer-events: none; } @media (forced-colors: active) { [part='cell']:has(> select[part='cell-editor'])::after { forced-color-adjust: none; color: ButtonText; } } [part='cell'][data-align='end'] { text-align: end; } [part='row-total-cell'] { padding: var(--lr-table-cell-padding, var(--lr-space-s)); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); font-weight: var(--lr-font-weight-semibold); text-align: end; } [part='cell'][data-heat] { background: color-mix( in srgb, var(--lr-table-heat-tint-hi, var(--_lr-table-heat-tint-hi-default)) var(--lr-table-heat-t), var(--lr-table-heat-tint-lo, var(--_lr-table-heat-tint-lo-default)) ); } [part='expand-toggle-cell'] { padding: var(--lr-space-s); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); text-align: center; } [part='row-expand-toggle'] { display: inline-flex; align-items: center; justify-content: center; font: inherit; border: none; background: none; padding: var(--lr-space-xs); cursor: pointer; color: inherit; ${iconHitTarget} } [part='row-expand-toggle']:hover { background: var(--lr-color-brand-quiet); } [part='row-expand-toggle']:active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='row-expand-toggle']:focus-visible { ${focusRing} } [part='row-expand-icon'] { display: inline-block; transition: transform var(--lr-transition-fast); } [part='row-expand-icon'] svg { display: block; } [part='row-expand-toggle'][aria-expanded='true'] [part='row-expand-icon'] { transform: rotate(90deg); } :host(:dir(rtl)) [part='row-expand-icon'] { transform: rotate(180deg); } :host(:dir(rtl)) [part='row-expand-toggle'][aria-expanded='true'] [part='row-expand-icon'] { transform: rotate(90deg); } @media (prefers-reduced-motion: reduce) { [part='row-expand-icon'] { transition: none !important; } } [part='expanded-row'] [part='expanded-cell'] { padding: var(--lr-space-s); border-block-end: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); background: var(--lr-table-surface, var(--lr-color-surface)); } [part='header-cell'][data-sticky], [part='cell'][data-sticky] { position: sticky; inset-inline-start: var(--lr-table-sticky-offset, 0); z-index: var(--lr-layer-content); box-shadow: var(--lr-size-1px) 0 0 0 var(--lr-color-border-subtle); } [part='cell'][data-sticky] { background: var(--_lr-table-row-bg, var(--lr-table-surface, var(--lr-color-surface))); } [part='header-cell'][data-sticky] { background: var(--_lr-table-header-bg, var(--lr-table-surface, var(--lr-color-surface))); } [part='header-cell'][data-sticky='end'], [part='cell'][data-sticky='end'] { inset-inline-start: auto; inset-inline-end: var(--lr-table-sticky-offset, 0); box-shadow: calc(-1 * var(--lr-size-1px)) 0 0 0 var(--lr-color-border-subtle); } :host(:dir(rtl)) [part='header-cell'][data-sticky], :host(:dir(rtl)) [part='cell'][data-sticky] { box-shadow: calc(-1 * var(--lr-size-1px)) 0 0 0 var(--lr-color-border-subtle); } :host(:dir(rtl)) [part='header-cell'][data-sticky='end'], :host(:dir(rtl)) [part='cell'][data-sticky='end'] { box-shadow: var(--lr-size-1px) 0 0 0 var(--lr-color-border-subtle); } ${raiseWhileOverlayOpen("[part='cell'][data-sticky]","var(--lr-layer-popover)","calc(var(--lr-layer-content) + 1)")} [part='foot'] { position: sticky; inset-block-end: 0; background: var(--lr-table-surface, var(--lr-color-surface)); } [part='footer-cell'] { padding: var(--lr-table-cell-padding-compact, var(--lr-space-xs) var(--lr-space-s)); border-block-start: var(--lr-border-width-thin) solid var(--lr-color-border-subtle); font-weight: var(--lr-font-weight-semibold); text-align: start; } [part='footer-cell'][data-align='end'] { text-align: end; } [part='more-button'], [part='reveal-columns-button'] { display: block; inline-size: 100%; padding: var(--lr-space-s); border: none; background: none; color: var(--lr-color-brand); font: inherit; cursor: pointer; border-block-start: var(--lr-border-width-thin) solid var(--lr-color-border); } [part='more-button']:hover:where(:not([aria-disabled='true'])), [part='reveal-columns-button']:hover { background: var(--lr-color-brand-quiet); } [part='more-button']:active:where(:not([aria-disabled='true'])), [part='reveal-columns-button']:active { background: color-mix( in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='more-button']:focus-visible, [part='reveal-columns-button']:focus-visible { ${focusRing} } [part='more-button']:where([aria-disabled='true']) { cursor: progress; } ${dataStateSurfaceStyles("error")} ${dataStateRetryStyles} `;export{styles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const SET_TIMELINE_CLUSTER_PRESENTATION=Symbol.for("@aceshooting/lyra-ui/timeline/cluster-presentation/v1"),timeValueChanged=(value,old)=>value instanceof Date&&old instanceof Date?!Object.is(value.getTime(),old.getTime()):!Object.is(value,old),OBSERVE_TIMELINE_ITEM_TIMESTAMP=Symbol.for("@aceshooting/lyra-ui/timeline/timestamp-observer/v1");function isTimelineClusterItemContract(value){const candidate=value;return typeof candidate[SET_TIMELINE_CLUSTER_PRESENTATION]=="function"&&typeof candidate[OBSERVE_TIMELINE_ITEM_TIMESTAMP]=="function"}export{OBSERVE_TIMELINE_ITEM_TIMESTAMP,SET_TIMELINE_CLUSTER_PRESENTATION,isTimelineClusterItemContract,timeValueChanged};
|
|
1
|
+
const SET_TIMELINE_CLUSTER_PRESENTATION=Symbol.for("@aceshooting/lyra-ui/timeline/cluster-presentation/v1"),timeValueChanged=(value,old)=>value instanceof Date&&old instanceof Date?!Object.is(value.getTime(),old.getTime()):!Object.is(value,old),OBSERVE_TIMELINE_ITEM_TIMESTAMP=Symbol.for("@aceshooting/lyra-ui/timeline/timestamp-observer/v1");function isTimelineClusterItemContract(value){const candidate=value;return typeof candidate[SET_TIMELINE_CLUSTER_PRESENTATION]=="function"&&typeof candidate[OBSERVE_TIMELINE_ITEM_TIMESTAMP]=="function"}const SET_TIMELINE_ITEM_ORDINAL=Symbol.for("@aceshooting/lyra-ui/timeline/item-ordinal/v1"),TIMELINE_ITEM_ORDINAL_OF=Symbol.for("@aceshooting/lyra-ui/timeline/ordinal-of/v1");function isTimelineOrdinalItem(value){return typeof value[SET_TIMELINE_ITEM_ORDINAL]=="function"}function isTimelineOrdinalOwner(value){return value!==null&&typeof value[TIMELINE_ITEM_ORDINAL_OF]=="function"}export{OBSERVE_TIMELINE_ITEM_TIMESTAMP,SET_TIMELINE_CLUSTER_PRESENTATION,SET_TIMELINE_ITEM_ORDINAL,TIMELINE_ITEM_ORDINAL_OF,isTimelineClusterItemContract,isTimelineOrdinalItem,isTimelineOrdinalOwner,timeValueChanged};
|
|
@@ -52,8 +52,13 @@ import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from
|
|
|
52
52
|
* (marker beside content), `column` in horizontal-timeline mode (marker above content).
|
|
53
53
|
* @csspart track - Wrapper around the marker and rail (the "spine"). Always the opposite axis from
|
|
54
54
|
* `[part="base"]` -- see the class doc's rail-mechanism note.
|
|
55
|
-
* @csspart marker - The dot/icon circle.
|
|
56
|
-
*
|
|
55
|
+
* @csspart marker - The dot/icon circle. `aria-hidden="true"` -- purely decorative, the item's
|
|
56
|
+
* accessible content is its title/timestamp/description text -- except inside an `ordered`
|
|
57
|
+
* `<lr-timeline>`, where it is a ring (`--lr-timeline-marker-color` border, transparent fill)
|
|
58
|
+
* around `marker-number`, is exposed to assistive technology, and replaces the `marker-icon`
|
|
59
|
+
* slot. Its default size there is `--lr-size-1-5rem`, and it widens for a long number.
|
|
60
|
+
* @csspart marker-number - The step number inside the marker, rendered only inside an `ordered`
|
|
61
|
+
* `<lr-timeline>`: real text formatted for the effective locale.
|
|
57
62
|
* @csspart rail - The connecting line segment extending from this item's marker toward the next
|
|
58
63
|
* item's marker. Hidden (`visibility: hidden`, not removed) for the last item in a
|
|
59
64
|
* `<lr-timeline>` -- see the class doc.
|
|
@@ -71,6 +76,8 @@ import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from
|
|
|
71
76
|
* @cssprop [--lr-timeline-marker-size=var(--lr-size-1-25rem)] - Diameter of the marker circle
|
|
72
77
|
* (both inline-size and block-size, so the default dot stays circular). Inherits from theme
|
|
73
78
|
* ancestors.
|
|
79
|
+
* @cssprop [--lr-timeline-marker-number-color=var(--lr-color-text)] - Step-number colour inside an
|
|
80
|
+
* `ordered` timeline's marker ring.
|
|
74
81
|
* @cssprop [--lr-timeline-rail-width=var(--lr-border-width-medium)] - Thickness of the
|
|
75
82
|
* connecting rail line. Inherits from theme ancestors.
|
|
76
83
|
* @cssprop [--lr-timeline-rail-color=var(--lr-color-border-subtle)] - Color of the connecting rail
|
|
@@ -109,4 +116,4 @@ sync:boolean;private _variant;get variant():LyraVariant;set variant(value:LyraVa
|
|
|
109
116
|
/** Marks this as the current/in-progress item (e.g. "the agent is executing this step right now"),
|
|
110
117
|
* as opposed to a resolved past entry. Drives a pulsing marker (disabled under
|
|
111
118
|
* `prefers-reduced-motion: reduce`) and an explicit `aria-current` state on the host. */
|
|
112
|
-
active:boolean;private hasIconSlot;private hasTimestampSlot;private hasDescriptionSlot;private clusterPresentation?;private markerIconSlot?;private timestampSlotEl?;private descriptionSlotEl?;private readonly timestampObservers;private timestampObserversReady;connectedCallback():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private get normalizedTimestamp();private onIconSlotChange;private collectIconSlotAssignment;private onTimestampSlotChange;private collectTimestampSlotAssignment;private onDescriptionSlotChange;private collectDescriptionSlotAssignment;protected firstUpdated(changed:PropertyValues):void;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-timeline-item':LyraTimelineItem;}}
|
|
119
|
+
active:boolean;private hasIconSlot;private hasTimestampSlot;private hasDescriptionSlot;private clusterPresentation?;private ordinal?;private markerIconSlot?;private timestampSlotEl?;private descriptionSlotEl?;private readonly timestampObservers;private timestampObserversReady;connectedCallback():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private get normalizedTimestamp();private onIconSlotChange;private collectIconSlotAssignment;private onTimestampSlotChange;private collectTimestampSlotAssignment;private onDescriptionSlotChange;private collectDescriptionSlotAssignment;protected firstUpdated(changed:PropertyValues):void;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-timeline-item':LyraTimelineItem;}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{styles}from"./timeline-item.styles.js";import{getDateTimeFormat}from"../../../internal/intl-cache.js";import{collectInitialSlotAssignment}from"../../../internal/initial-slot-collection.js";import{OBSERVE_TIMELINE_ITEM_TIMESTAMP,SET_TIMELINE_CLUSTER_PRESENTATION,timeValueChanged}from"./timeline-cluster.js";const timelineItemVariantConverter={fromAttribute(value){return normalizeTimelineItemVariant(value)},toAttribute(value){return value==="neutral"?null:value}},normalizeTimelineItemVariant=value=>value==="brand"||value==="success"||value==="warning"||value==="danger"?value:"neutral";class LyraTimelineItem extends LyraElement{constructor(){super(...arguments),this.sync=!1,this._variant="neutral",this.active=!1,this.hasIconSlot=!1,this.hasTimestampSlot=!1,this.hasDescriptionSlot=!1,this.timestampObservers=new Set,this.timestampObserversReady=!1,this.onIconSlotChange=()=>{this.collectIconSlotAssignment(this.markerIconSlot)},this.onTimestampSlotChange=e=>{this.collectTimestampSlotAssignment(e.target)},this.onDescriptionSlotChange=e=>{this.collectDescriptionSlotAssignment(e.target)}}static{this.styles=[LyraElement.styles,styles]}get variant(){return this._variant}set variant(value){const normalized=normalizeTimelineItemVariant(value),raw=this.getAttribute("variant");if(raw!==null&&raw!==normalized){const reflected=timelineItemVariantConverter.toAttribute(normalized);reflected===null?this.removeAttribute("variant"):this.setAttribute("variant",reflected)}const previous=this._variant;previous!==normalized&&(this._variant=normalized,this.requestUpdate("variant",previous))}[SET_TIMELINE_CLUSTER_PRESENTATION](presentation){const current=this.clusterPresentation;current===presentation||current!==void 0&&presentation!==void 0&¤t.accessibleLabel===presentation.accessibleLabel&¤t.countText===presentation.countText&¤t.activate===presentation.activate||(this.clusterPresentation=presentation)}[OBSERVE_TIMELINE_ITEM_TIMESTAMP](observer,observe){observe?this.timestampObservers.add(observer):this.timestampObservers.delete(observer)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","listitem")}willUpdate(changed){super.willUpdate(changed),this.clusterPresentation?this.removeAttribute("aria-current"):this.setAttribute("aria-current",String(this.active))}updated(changed){super.updated(changed),this.timestampObserversReady&&changed.has("timestamp")&&this.scheduleAfterUpdate(()=>{for(const observer of[...this.timestampObservers])observer()},"timeline-item-timestamp-observers"),this.timestampObserversReady=!0}get normalizedTimestamp(){if(this.timestamp===void 0)return;const date=this.timestamp instanceof Date?this.timestamp:new Date(this.timestamp);return Number.isNaN(date.getTime())?void 0:date}collectIconSlotAssignment(slot){this.hasIconSlot=!!slot?.assignedElements({flatten:!0}).length}collectTimestampSlotAssignment(slot){this.hasTimestampSlot=slot.assignedElements({flatten:!0}).length>0}collectDescriptionSlotAssignment(slot){this.hasDescriptionSlot=slot.assignedElements({flatten:!0}).length>0}firstUpdated(changed){super.firstUpdated(changed);const markerIconSlot=this.markerIconSlot,timestampSlot=this.timestampSlotEl,descriptionSlot=this.descriptionSlotEl;queueMicrotask(()=>{collectInitialSlotAssignment(markerIconSlot,s=>this.collectIconSlotAssignment(s)),collectInitialSlotAssignment(timestampSlot,s=>this.collectTimestampSlotAssignment(s)),collectInitialSlotAssignment(descriptionSlot,s=>this.collectDescriptionSlotAssignment(s))})}render(){if(this.clusterPresentation)return html`
|
|
1
|
+
import{__decorate}from"tslib";import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{styles}from"./timeline-item.styles.js";import{getDateTimeFormat,getNumberFormat}from"../../../internal/intl-cache.js";import{collectInitialSlotAssignment}from"../../../internal/initial-slot-collection.js";import{OBSERVE_TIMELINE_ITEM_TIMESTAMP,SET_TIMELINE_CLUSTER_PRESENTATION,SET_TIMELINE_ITEM_ORDINAL,TIMELINE_ITEM_ORDINAL_OF,isTimelineOrdinalOwner,timeValueChanged}from"./timeline-cluster.js";const timelineItemVariantConverter={fromAttribute(value){return normalizeTimelineItemVariant(value)},toAttribute(value){return value==="neutral"?null:value}},normalizeTimelineItemVariant=value=>value==="brand"||value==="success"||value==="warning"||value==="danger"?value:"neutral";class LyraTimelineItem extends LyraElement{constructor(){super(...arguments),this.sync=!1,this._variant="neutral",this.active=!1,this.hasIconSlot=!1,this.hasTimestampSlot=!1,this.hasDescriptionSlot=!1,this.timestampObservers=new Set,this.timestampObserversReady=!1,this.onIconSlotChange=()=>{this.collectIconSlotAssignment(this.markerIconSlot)},this.onTimestampSlotChange=e=>{this.collectTimestampSlotAssignment(e.target)},this.onDescriptionSlotChange=e=>{this.collectDescriptionSlotAssignment(e.target)}}static{this.styles=[LyraElement.styles,styles]}get variant(){return this._variant}set variant(value){const normalized=normalizeTimelineItemVariant(value),raw=this.getAttribute("variant");if(raw!==null&&raw!==normalized){const reflected=timelineItemVariantConverter.toAttribute(normalized);reflected===null?this.removeAttribute("variant"):this.setAttribute("variant",reflected)}const previous=this._variant;previous!==normalized&&(this._variant=normalized,this.requestUpdate("variant",previous))}[SET_TIMELINE_CLUSTER_PRESENTATION](presentation){const current=this.clusterPresentation;current===presentation||current!==void 0&&presentation!==void 0&¤t.accessibleLabel===presentation.accessibleLabel&¤t.countText===presentation.countText&¤t.activate===presentation.activate||(this.clusterPresentation=presentation)}[SET_TIMELINE_ITEM_ORDINAL](ordinal){this.ordinal=ordinal}[OBSERVE_TIMELINE_ITEM_TIMESTAMP](observer,observe){observe?this.timestampObservers.add(observer):this.timestampObservers.delete(observer)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","listitem");const owner=this.parentElement;this.ordinal===void 0&&isTimelineOrdinalOwner(owner)&&(this.ordinal=owner[TIMELINE_ITEM_ORDINAL_OF](this))}willUpdate(changed){super.willUpdate(changed),this.clusterPresentation?this.removeAttribute("aria-current"):this.setAttribute("aria-current",String(this.active))}updated(changed){super.updated(changed),this.timestampObserversReady&&changed.has("timestamp")&&this.scheduleAfterUpdate(()=>{for(const observer of[...this.timestampObservers])observer()},"timeline-item-timestamp-observers"),this.timestampObserversReady=!0}get normalizedTimestamp(){if(this.timestamp===void 0)return;const date=this.timestamp instanceof Date?this.timestamp:new Date(this.timestamp);return Number.isNaN(date.getTime())?void 0:date}collectIconSlotAssignment(slot){this.hasIconSlot=!!slot?.assignedElements({flatten:!0}).length}collectTimestampSlotAssignment(slot){this.hasTimestampSlot=slot.assignedElements({flatten:!0}).length>0}collectDescriptionSlotAssignment(slot){this.hasDescriptionSlot=slot.assignedElements({flatten:!0}).length>0}firstUpdated(changed){super.firstUpdated(changed);const markerIconSlot=this.markerIconSlot,timestampSlot=this.timestampSlotEl,descriptionSlot=this.descriptionSlotEl;queueMicrotask(()=>{collectInitialSlotAssignment(markerIconSlot,s=>this.collectIconSlotAssignment(s)),collectInitialSlotAssignment(timestampSlot,s=>this.collectTimestampSlotAssignment(s)),collectInitialSlotAssignment(descriptionSlot,s=>this.collectDescriptionSlotAssignment(s))})}render(){if(this.clusterPresentation)return html`
|
|
2
2
|
<button
|
|
3
3
|
part="cluster"
|
|
4
4
|
type="button"
|
|
@@ -12,16 +12,20 @@ import{__decorate}from"tslib";import{html,nothing}from"lit";import{property,quer
|
|
|
12
12
|
`;const ts=this.normalizedTimestamp,showTimestampFallback=!this.hasTimestampSlot&&ts!==void 0,showTimestamp=this.hasTimestampSlot||ts!==void 0,absolute=ts?getDateTimeFormat(this.effectiveLocale||void 0,{dateStyle:"long",timeStyle:"short"}).format(ts):"";return html`
|
|
13
13
|
<div part="base">
|
|
14
14
|
<div part="track">
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
${this.ordinal!==void 0?html`<span part="marker" data-ordered
|
|
16
|
+
><span part="marker-number"
|
|
17
|
+
>${getNumberFormat(this.effectiveLocale||void 0,{useGrouping:!1}).format(this.ordinal)}</span
|
|
18
|
+
></span
|
|
19
|
+
>`:html`<span
|
|
20
|
+
part="marker"
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
?data-has-icon=${this.hasIconSlot}
|
|
23
|
+
>
|
|
24
|
+
<slot
|
|
25
|
+
name="marker-icon"
|
|
26
|
+
@slotchange=${this.onIconSlotChange}
|
|
27
|
+
></slot>
|
|
28
|
+
</span>`}
|
|
25
29
|
<span part="rail"></span>
|
|
26
30
|
</div>
|
|
27
31
|
<div part="content">
|
|
@@ -48,4 +52,4 @@ import{__decorate}from"tslib";import{html,nothing}from"lit";import{property,quer
|
|
|
48
52
|
</span>
|
|
49
53
|
</div>
|
|
50
54
|
</div>
|
|
51
|
-
`}}__decorate([property({attribute:!1,hasChanged:timeValueChanged})],LyraTimelineItem.prototype,"timestamp",void 0),__decorate([property({type:Boolean})],LyraTimelineItem.prototype,"sync",void 0),__decorate([property({reflect:!0,converter:timelineItemVariantConverter})],LyraTimelineItem.prototype,"variant",null),__decorate([property({type:Boolean,reflect:!0})],LyraTimelineItem.prototype,"active",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasIconSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasTimestampSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasDescriptionSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"clusterPresentation",void 0),__decorate([query('slot[name="marker-icon"]')],LyraTimelineItem.prototype,"markerIconSlot",void 0),__decorate([query('slot[name="timestamp"]')],LyraTimelineItem.prototype,"timestampSlotEl",void 0),__decorate([query('slot[name="description"]')],LyraTimelineItem.prototype,"descriptionSlotEl",void 0);export{LyraTimelineItem};
|
|
55
|
+
`}}__decorate([property({attribute:!1,hasChanged:timeValueChanged})],LyraTimelineItem.prototype,"timestamp",void 0),__decorate([property({type:Boolean})],LyraTimelineItem.prototype,"sync",void 0),__decorate([property({reflect:!0,converter:timelineItemVariantConverter})],LyraTimelineItem.prototype,"variant",null),__decorate([property({type:Boolean,reflect:!0})],LyraTimelineItem.prototype,"active",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasIconSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasTimestampSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasDescriptionSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"clusterPresentation",void 0),__decorate([state()],LyraTimelineItem.prototype,"ordinal",void 0),__decorate([query('slot[name="marker-icon"]')],LyraTimelineItem.prototype,"markerIconSlot",void 0),__decorate([query('slot[name="timestamp"]')],LyraTimelineItem.prototype,"timestampSlotEl",void 0),__decorate([query('slot[name="description"]')],LyraTimelineItem.prototype,"descriptionSlotEl",void 0);export{LyraTimelineItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{iconHitTarget,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` :host { display: block; min-inline-size: 0; --_lr-timeline-marker-color-default: var(--lr-color-text-quiet); } :host([variant='brand']) { --_lr-timeline-marker-color-default: var(--lr-color-brand); } :host([variant='success']) { --_lr-timeline-marker-color-default: var(--lr-color-success); } :host([variant='warning']) { --_lr-timeline-marker-color-default: var(--lr-color-warning); } :host([variant='danger']) { --_lr-timeline-marker-color-default: var(--lr-color-danger); } [part='base'] { display: flex; min-inline-size: 0; flex-direction: var(--_lr-timeline-item-direction, row); gap: var(--lr-space-s); } [part='track'] { display: flex; flex-direction: var(--_lr-timeline-item-track-direction, column); align-items: center; flex: 0 0 auto; } [part='marker'] { inline-size: var(--lr-timeline-marker-size, var(--lr-size-1-25rem)); block-size: var(--lr-timeline-marker-size, var(--lr-size-1-25rem)); border-radius: 50%; flex: 0 0 auto; background: var(--lr-timeline-marker-color, var(--_lr-timeline-marker-color-default)); color: var(--lr-timeline-marker-color, var(--_lr-timeline-marker-color-default)); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; } [part='marker'][data-has-icon] { background: transparent; } :host([active]) [part='marker'] { outline: var(--lr-border-width-medium) solid var( --lr-timeline-active-ring-color, var(--lr-timeline-marker-color, var(--_lr-timeline-marker-color-default)) ); outline-offset: var(--lr-space-2xs); animation: var(--_lr-motion-animation, lr-timeline-item-pulse var(--lr-transition-ambient) infinite); } @keyframes lr-timeline-item-pulse { 0%, 100% { transform: scale(0.85); opacity: 0.6; } 50% { transform: scale(1); opacity: 1; } } @media (prefers-reduced-motion: reduce) { [part='marker'] { animation: none !important; } } [part='rail'] { flex: 1 1 auto; inline-size: var(--lr-timeline-rail-width, var(--lr-border-width-medium)); block-size: var(--lr-timeline-rail-width, var(--lr-border-width-medium)); background: var(--lr-timeline-rail-color, var(--lr-color-border-subtle)); visibility: var(--_lr-timeline-item-rail-visibility, visible); } [part='content'] { display: flex; flex-direction: column; flex: 1 1 auto; min-inline-size: 0; gap: var(--lr-space-2xs); padding-block-end: var(--_lr-timeline-item-gap-block-end, 0); padding-inline-end: var(--_lr-timeline-item-gap-inline-end, 0); } [part='header'] { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--lr-space-xs); } [part='title'] { min-inline-size: 0; max-inline-size: 100%; overflow-wrap: anywhere; color: var(--lr-color-text); font-weight: var(--lr-font-weight-semibold); line-height: var(--lr-line-height-snug); } [part='timestamp'] { flex: 0 0 auto; color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-xs); white-space: nowrap; } [part='timestamp'][hidden] { display: none; } [part='description'] { min-inline-size: 0; color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-md-sm); line-height: var(--lr-line-height-1-4); overflow-wrap: anywhere; } [part='description'][hidden] { display: none; } [part='cluster'] { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; ${iconHitTarget} margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; } [part='cluster-count'] { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-inline-size: var(--lr-timeline-cluster-size, var(--lr-size-2rem)); min-block-size: var(--lr-timeline-cluster-size, var(--lr-size-2rem)); padding-inline: var(--lr-space-xs); border-radius: var(--lr-radius-pill); background: var(--lr-timeline-cluster-bg, var(--lr-color-brand)); color: var(--lr-timeline-cluster-color, var(--lr-color-on-brand)); font-size: var(--lr-font-size-sm); font-weight: var(--lr-font-weight-semibold); line-height: var(--lr-line-height-snug); } [part='cluster']:hover [part='cluster-count'] { background: color-mix( in oklab, var(--lr-timeline-cluster-bg, var(--lr-color-brand)), var(--lr-color-mix-partner) var(--lr-color-mix-hover) ); } [part='cluster']:active [part='cluster-count'] { background: color-mix( in oklab, var(--lr-timeline-cluster-bg, var(--lr-color-brand)), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='cluster']:focus-visible { ${focusRing} } @media (forced-colors: active) { [part='cluster-count'] { border: var(--lr-border-width-medium) solid ButtonText; background: ButtonFace; color: ButtonText; forced-color-adjust: auto; } [part='cluster']:hover [part='cluster-count'] { border-color: Highlight; } [part='cluster']:focus-visible { outline-color: Highlight; } } `;export{styles};
|
|
1
|
+
import{iconHitTarget,focusRing}from"../../../internal/interactive-control.styles.js";import{css}from"lit";const styles=css` :host { display: block; min-inline-size: 0; --_lr-timeline-marker-color-default: var(--lr-color-text-quiet); } :host([variant='brand']) { --_lr-timeline-marker-color-default: var(--lr-color-brand); } :host([variant='success']) { --_lr-timeline-marker-color-default: var(--lr-color-success); } :host([variant='warning']) { --_lr-timeline-marker-color-default: var(--lr-color-warning); } :host([variant='danger']) { --_lr-timeline-marker-color-default: var(--lr-color-danger); } [part='base'] { display: flex; min-inline-size: 0; flex-direction: var(--_lr-timeline-item-direction, row); gap: var(--lr-space-s); } [part='track'] { display: flex; flex-direction: var(--_lr-timeline-item-track-direction, column); align-items: center; flex: 0 0 auto; } [part='marker'] { inline-size: var(--lr-timeline-marker-size, var(--lr-size-1-25rem)); block-size: var(--lr-timeline-marker-size, var(--lr-size-1-25rem)); border-radius: 50%; flex: 0 0 auto; background: var(--lr-timeline-marker-color, var(--_lr-timeline-marker-color-default)); color: var(--lr-timeline-marker-color, var(--_lr-timeline-marker-color-default)); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; } [part='marker'][data-has-icon] { background: transparent; } [part='marker'][data-ordered] { box-sizing: border-box; inline-size: auto; min-inline-size: var(--lr-timeline-marker-size, var(--lr-size-1-5rem)); block-size: var(--lr-timeline-marker-size, var(--lr-size-1-5rem)); padding-inline: var(--lr-space-2xs); border: var(--lr-border-width-medium) solid var(--lr-timeline-marker-color, var(--_lr-timeline-marker-color-default)); border-radius: var(--lr-radius-pill); background: transparent; color: var(--lr-timeline-marker-number-color, var(--lr-color-text)); font-size: var(--lr-font-size-xs); font-weight: var(--lr-font-weight-semibold); font-variant-numeric: tabular-nums; line-height: var(--lr-line-height-none); } :host([active]) [part='marker'] { outline: var(--lr-border-width-medium) solid var( --lr-timeline-active-ring-color, var(--lr-timeline-marker-color, var(--_lr-timeline-marker-color-default)) ); outline-offset: var(--lr-space-2xs); animation: var(--_lr-motion-animation, lr-timeline-item-pulse var(--lr-transition-ambient) infinite); } @keyframes lr-timeline-item-pulse { 0%, 100% { transform: scale(0.85); opacity: 0.6; } 50% { transform: scale(1); opacity: 1; } } @media (prefers-reduced-motion: reduce) { [part='marker'] { animation: none !important; } } [part='rail'] { flex: 1 1 auto; inline-size: var(--lr-timeline-rail-width, var(--lr-border-width-medium)); block-size: var(--lr-timeline-rail-width, var(--lr-border-width-medium)); background: var(--lr-timeline-rail-color, var(--lr-color-border-subtle)); visibility: var(--_lr-timeline-item-rail-visibility, visible); } [part='content'] { display: flex; flex-direction: column; flex: 1 1 auto; min-inline-size: 0; gap: var(--lr-space-2xs); padding-block-end: var(--_lr-timeline-item-gap-block-end, 0); padding-inline-end: var(--_lr-timeline-item-gap-inline-end, 0); } [part='header'] { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--lr-space-xs); } [part='title'] { min-inline-size: 0; max-inline-size: 100%; overflow-wrap: anywhere; color: var(--lr-color-text); font-weight: var(--lr-font-weight-semibold); line-height: var(--lr-line-height-snug); } [part='timestamp'] { flex: 0 0 auto; color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-xs); white-space: nowrap; } [part='timestamp'][hidden] { display: none; } [part='description'] { min-inline-size: 0; color: var(--lr-color-text-quiet); font-size: var(--lr-font-size-md-sm); line-height: var(--lr-line-height-1-4); overflow-wrap: anywhere; } [part='description'][hidden] { display: none; } [part='cluster'] { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; ${iconHitTarget} margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; } [part='cluster-count'] { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-inline-size: var(--lr-timeline-cluster-size, var(--lr-size-2rem)); min-block-size: var(--lr-timeline-cluster-size, var(--lr-size-2rem)); padding-inline: var(--lr-space-xs); border-radius: var(--lr-radius-pill); background: var(--lr-timeline-cluster-bg, var(--lr-color-brand)); color: var(--lr-timeline-cluster-color, var(--lr-color-on-brand)); font-size: var(--lr-font-size-sm); font-weight: var(--lr-font-weight-semibold); line-height: var(--lr-line-height-snug); } [part='cluster']:hover [part='cluster-count'] { background: color-mix( in oklab, var(--lr-timeline-cluster-bg, var(--lr-color-brand)), var(--lr-color-mix-partner) var(--lr-color-mix-hover) ); } [part='cluster']:active [part='cluster-count'] { background: color-mix( in oklab, var(--lr-timeline-cluster-bg, var(--lr-color-brand)), var(--lr-color-mix-partner) var(--lr-color-mix-active) ); } [part='cluster']:focus-visible { ${focusRing} } @media (forced-colors: active) { [part='cluster-count'] { border: var(--lr-border-width-medium) solid ButtonText; background: ButtonFace; color: ButtonText; forced-color-adjust: auto; } [part='cluster']:hover [part='cluster-count'] { border-color: Highlight; } [part='cluster']:focus-visible { outline-color: Highlight; } } `;export{styles};
|
|
@@ -72,6 +72,18 @@ readonly items:readonly LyraTimelineItem[];}export interface LyraTimelineEventMa
|
|
|
72
72
|
* @since 4.0.0
|
|
73
73
|
*/
|
|
74
74
|
export declare class LyraTimeline extends LyraElement<LyraTimelineEventMap>{protected static collectionSupport:import("../../../internal/lyra-element.js").LyraCollectionSupport;protected static readonly immutableEventDetails:readonly string[];protected static readonly identityEventDetailProperties:Readonly<{'lr-cluster-activate':readonly string[];}>;static styles:import("lit").CSSResultGroup[];private _orientation;get orientation():LyraOrientation;set orientation(value:LyraOrientation);private _scale;get scale():LyraTimelineScale;set scale(value:LyraTimelineScale);private _collision;get collision():LyraTimelineCollision;set collision(value:LyraTimelineCollision);
|
|
75
|
+
/**
|
|
76
|
+
* Presents the items as an ordered sequence of steps. `[part='base']` becomes a native `<ol>`
|
|
77
|
+
* (with an explicit `role="list"`, which WebKit otherwise drops from an unstyled list), and each
|
|
78
|
+
* item's marker shows its step number as real, readable text instead of the decorative dot,
|
|
79
|
+
* formatted for the item's effective locale. In this mode the number replaces the
|
|
80
|
+
* `marker-icon` slot. Numbering follows document order, counts every default-slot item and
|
|
81
|
+
* starts at `start`. Works with every orientation and scale.
|
|
82
|
+
*/
|
|
83
|
+
ordered:boolean;
|
|
84
|
+
/** The number of the first step while `ordered` is set, like a native `<ol start>`. A
|
|
85
|
+
* non-finite value numbers from 1; fractions truncate. Ignored unless `ordered`. */
|
|
86
|
+
start:number;
|
|
75
87
|
/** Pins the axis start instead of deriving it from the earliest item. Ignored unless
|
|
76
88
|
* `scale="time"`; a non-finite or reversed pair falls back to the derived range. */
|
|
77
89
|
rangeStart?:Date|string|number;
|
|
@@ -83,8 +95,8 @@ rangeEnd?:Date|string|number;
|
|
|
83
95
|
* never inherits a host attribute automatically — same reasoning as `<lr-breadcrumb>`'s
|
|
84
96
|
* identical property. Unset falls back to the localized default; an explicitly empty
|
|
85
97
|
* `aria-label` stays empty. */
|
|
86
|
-
accessibleLabel?:string;private slottedCount;private collisionClusters;private readonly managedClusterHiddenItems;private readonly managedClusterRepresentatives;private readonly clusterActivations;private readonly timestampObservedItems;private clusterMeasurementFrame?;private clusterMeasurementView?;private timeExtentFrame?;private timeExtentView?;private focusRepairGeneration;private cachedTimelineItems?;private readonly timePositionedItems;private readonly overflowObservedItems;private overflowItemsPending;private timeGeometryObserver?;private timeGeometryBase?;private timeGeometryView?;private readonly geometryObservedItems;private readonly itemGeometry;private scrollOverflow;requestUpdate(...args:Parameters<LyraElement['requestUpdate']>):void;connectedCallback():void;disconnectedCallback():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private syncScrollTabStop;private countTimelineItems;firstUpdated(changed:PropertyValues):void;
|
|
98
|
+
accessibleLabel?:string;private slottedCount;private collisionClusters;private readonly managedClusterHiddenItems;private readonly managedClusterRepresentatives;private readonly clusterActivations;private readonly timestampObservedItems;private readonly numberedItems;private clusterMeasurementFrame?;private clusterMeasurementView?;private timeExtentFrame?;private timeExtentView?;private focusRepairGeneration;private cachedTimelineItems?;private readonly timePositionedItems;private readonly overflowObservedItems;private overflowItemsPending;private timeGeometryObserver?;private timeGeometryBase?;private timeGeometryView?;private readonly geometryObservedItems;private readonly itemGeometry;private scrollOverflow;requestUpdate(...args:Parameters<LyraElement['requestUpdate']>):void;connectedCallback():void;disconnectedCallback():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private syncScrollTabStop;private countTimelineItems;firstUpdated(changed:PropertyValues):void;
|
|
87
99
|
/** Read-only, live-updated count of default-slot `<lr-timeline-item>` assignments, including
|
|
88
100
|
* flattened forwarding slots — handy for building a `"{count} events"` header without
|
|
89
101
|
* hand-counting DOM children. */
|
|
90
|
-
get itemCount():number;private onSlotChange;private onTimelineItemTimestampChange;private syncTimestampObservers;private timelineItems;private collectTimelineItems;private timeRange;private applyTimeScale;private applyCollisionLanes;private buildCollisionClusters;private clusterCollisionThreshold;private scheduleTimeExtentMeasurement;private syncItemObservations;private invalidateTimeGeometry;private timeItemGeometry;private stopTimeGeometryObserver;private syncTimeGeometryObserver;private cancelTimeExtentMeasurement;private scheduleClusterMeasurement;private cancelClusterMeasurement;private sameClusters;private captureClusterFocusRepair;private scheduleClusterFocusRepair;private applyCollisionClusters;private syncClusterPresentations;private restoreClusterPresentation;private restoreClusterVisibility;private activateCluster;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-timeline':LyraTimeline;}}
|
|
102
|
+
get itemCount():number;private onSlotChange;private get firstOrdinal();private syncOrdinals;private onTimelineItemTimestampChange;private syncTimestampObservers;private timelineItems;private collectTimelineItems;private timeRange;private applyTimeScale;private applyCollisionLanes;private buildCollisionClusters;private clusterCollisionThreshold;private scheduleTimeExtentMeasurement;private syncItemObservations;private invalidateTimeGeometry;private timeItemGeometry;private stopTimeGeometryObserver;private syncTimeGeometryObserver;private cancelTimeExtentMeasurement;private scheduleClusterMeasurement;private cancelClusterMeasurement;private sameClusters;private captureClusterFocusRepair;private scheduleClusterFocusRepair;private applyCollisionClusters;private syncClusterPresentations;private restoreClusterPresentation;private restoreClusterVisibility;private activateCluster;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-timeline':LyraTimeline;}}
|