@knime/kds-table 13.0.2 → 13.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["W","E","s","g","V","D","h","y","K","R","$slots","$slots","$emit","$emit","$el"],"sources":["../src/config/table.config.ts","../../styles/dist/tokens/ts/border.js","../../styles/dist/tokens/ts/dimension.js","../../styles/dist/tokens/ts/spacing.js","../src/constants.ts","../src/types/BackgroundColor.ts","../src/utils/index.ts","../../../node_modules/.pnpm/@knime+vue-headless-virtual-scroller@0.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/@knime/vue-headless-virtual-scroller/dist/vue-headless-virtual-scrolling.js","../../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs","../../utils/dist/index.js","../src/components/composables/useDataValueViews.ts","../src/components/composables/useStartEditingKeydown.ts","../src/components/TableBodyNavigatable.vue","../src/components/TableBodyNavigatable.vue","../src/components/composables/useHorizontalIndicesAndStyles.ts","../src/components/useColumnSizes.ts","../src/components/ui/EmptyRow.vue","../src/components/ui/EmptyRow.vue","../src/components/ui/PlaceholderRow.vue","../src/components/ui/PlaceholderRow.vue","../src/components/VirtualRow.vue","../src/components/VirtualRow.vue","../src/components/composables/useBodyWidth.ts","../src/components/composables/useCloseSubMenusOnScroll.ts","../src/components/composables/useOverflowStyles.ts","../src/components/composables/useCommonScrollContainerProps.ts","../src/components/composables/useResizeScrollSpacer.ts","../src/components/TableCoreVirtual.vue","../src/components/TableCoreVirtual.vue","../../../node_modules/.pnpm/raf-throttle@2.0.6/node_modules/raf-throttle/lib/rafThrottle.js","../src/components/composables/useAvailableWidth.ts","../src/components/TableCore.vue","../src/components/TableCore.vue","../src/components/composables/useBoolean.ts","../src/components/composables/useCellCopyPaste.ts","../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../src/components/composables/useCellSelection.ts","../src/components/composables/useEditCellKeydown.ts","../src/components/composables/useVisibleAfterAvailableWidth.ts","../src/components/control/actionbar/PopoverContainer.vue","../src/components/control/actionbar/useButtonPopoverInteraction.ts","../src/components/control/actionbar/SortControl.vue","../src/components/control/actionbar/SortControl.vue","../src/components/control/TableActionBar.vue","../src/components/control/TableActionBar.vue","../src/utils/columnHeaderActionButtons.ts","../src/components/layout/useAutoScrollOnRightEdge.ts","../src/components/layout/HeaderCell.vue","../src/components/layout/HeaderCell.vue","../src/components/layout/Header.vue","../src/components/layout/Header.vue","../src/components/layout/NewRowButton.vue","../src/components/layout/NewRowButton.vue","../src/components/ui/CellExpandButton.vue","../src/components/ui/CellExpandButton.vue","../src/components/layout/CellRenderer.vue","../src/components/layout/CellRenderer.vue","../src/components/layout/Cell.vue","../src/components/layout/Cell.vue","../src/components/layout/Row.vue","../src/components/layout/Row.vue","../src/components/ui/CellSelectionOverlay.vue","../src/components/ui/CellSelectionOverlay.vue","../src/components/TableUI.vue","../src/components/TableUI.vue","../src/components/composables/useTableReady.ts","../src/components/TableUIWithAutoSizeCalculation.vue","../src/components/TableUIWithAutoSizeCalculation.vue"],"sourcesContent":["export const defaultPageSize = 10;\n\nexport const columnTypes = {\n Nominal: \"Nominal\" as const,\n String: \"String\" as const,\n DateTime: \"DateTime\" as const,\n Duration: \"Duration\" as const,\n Number: \"Number\" as const,\n Boolean: \"Boolean\" as const,\n Array: \"Array\" as const,\n Object: \"Object\" as const,\n Image: \"Image\" as const,\n};\n\ntype ValueOf<T> = T[keyof T];\n\nexport type ColumnType = ValueOf<typeof columnTypes>;\n\nexport const columnSortText = {\n [columnTypes.Nominal]: {\n ascending: \"A to Z\",\n descending: \"Z to A\",\n },\n [columnTypes.String]: {\n ascending: \"A to Z\",\n descending: \"Z to A\",\n },\n [columnTypes.DateTime]: {\n ascending: \"Oldest first\",\n descending: \"Newest first\",\n },\n [columnTypes.Duration]: {\n ascending: \"Shortest first\",\n descending: \"Longest first\",\n },\n [columnTypes.Number]: {\n ascending: \"Smallest first\",\n descending: \"Largest first\",\n },\n [columnTypes.Boolean]: {\n ascending: \"False first\",\n descending: \"True first\",\n },\n [columnTypes.Image]: {\n ascending: \"By filename A to Z\",\n descending: \"By filename Z to A\",\n },\n [columnTypes.Array]: {\n ascending: \"Fewest items first\",\n descending: \"Most items first\",\n },\n [columnTypes.Object]: {\n ascending: \"Fewest keys first\",\n descending: \"Most keys first\",\n },\n default: {\n ascending: \"Ascending\",\n descending: \"Descending\",\n },\n} as Record<ColumnType | \"default\", { ascending: string; descending: string }>;\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const border = {\n action: {\n transparent: {\n color: {\n light: { h: 0, s: 0, l: 11.4, a: 0 },\n dark: { h: 0, s: 0, l: 11.4, a: 0 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(0 0% 11.4% / 0)\",\n variable: \"var(--kds-border-action-transparent)\",\n },\n },\n default: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-action-default)\",\n },\n },\n disabled: {\n color: {\n light: { h: 0, s: 0, l: 72.5, a: 1 },\n dark: { h: 0, s: 0, l: 48.2, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0, 0%, 72.5%), hsl(0, 0%, 48.2%))\",\n variable: \"var(--kds-border-action-disabled)\",\n },\n },\n focused: {\n color: {\n light: { h: 209.4, s: 57.3, l: 49.6, a: 1 },\n dark: { h: 213.6, s: 91.6, l: 76.7, a: 1 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(209.4, 57.3%, 49.6%), hsl(213.6, 91.6%, 76.7%))\",\n variable: \"var(--kds-border-action-focused)\",\n },\n },\n selected: {\n color: {\n light: { h: 171.8, s: 27, l: 47.8, a: 1 },\n dark: { h: 168, s: 46.7, l: 85.3, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(171.8, 27%, 47.8%), hsl(168, 46.7%, 85.3%))\",\n variable: \"var(--kds-border-action-selected)\",\n },\n },\n \"selected-accent\": {\n color: {\n light: { h: 209.4, s: 57.3, l: 49.6, a: 1 },\n dark: { h: 213.6, s: 91.6, l: 76.7, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(209.4, 57.3%, 49.6%), hsl(213.6, 91.6%, 76.7%))\",\n variable: \"var(--kds-border-action-selected-accent)\",\n },\n },\n error: {\n color: {\n light: { h: 348.8, s: 90.9, l: 34.5, a: 1 },\n dark: { h: 3.5, s: 100, l: 79.6, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(348.8, 90.9%, 34.5%), hsl(3.5, 100%, 79.6%))\",\n variable: \"var(--kds-border-action-error)\",\n },\n },\n primary: {\n color: {\n light: { h: 176.7, s: 82, l: 17.5, a: 1 },\n dark: { h: 176.7, s: 82, l: 17.5, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(176.7, 82%, 17.5%)\",\n variable: \"var(--kds-border-action-primary)\",\n },\n },\n input: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-action-input)\",\n },\n },\n },\n base: {\n default: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-base-default)\",\n },\n },\n muted: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.2 },\n dark: { h: 0, s: 0, l: 99, a: 0.2 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.2), hsl(0 0% 99% / 0.2))\",\n variable: \"var(--kds-border-base-muted)\",\n },\n },\n subtle: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.1 },\n dark: { h: 0, s: 0, l: 99, a: 0.1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.1), hsl(0 0% 99% / 0.1))\",\n variable: \"var(--kds-border-base-subtle)\",\n },\n },\n brand: {\n color: {\n light: { h: 50.8, s: 100, l: 50, a: 1 },\n dark: { h: 50.8, s: 100, l: 50, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(50.8, 100%, 50%)\",\n variable: \"var(--kds-border-base-brand)\",\n },\n },\n danger: {\n color: {\n light: { h: 3.4, s: 100, l: 86.1, a: 1 },\n dark: { h: 348, s: 94.3, l: 20.8, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(3.4, 100%, 86.1%), hsl(348, 94.3%, 20.8%))\",\n variable: \"var(--kds-border-base-danger)\",\n },\n },\n warning: {\n color: {\n light: { h: 30.8, s: 79.3, l: 73.5, a: 1 },\n dark: { h: 13.1, s: 66.1, l: 23.1, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(30.8, 79.3%, 73.5%), hsl(13.1, 66.1%, 23.1%))\",\n variable: \"var(--kds-border-base-warning)\",\n },\n },\n success: {\n color: {\n light: { h: 112, s: 56.5, l: 71.2, a: 1 },\n dark: { h: 123.7, s: 46.7, l: 20.6, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(112, 56.5%, 71.2%), hsl(123.7, 46.7%, 20.6%))\",\n variable: \"var(--kds-border-base-success)\",\n },\n },\n info: {\n color: {\n light: { h: 214.5, s: 100, l: 84.3, a: 1 },\n dark: { h: 210, s: 50, l: 27.5, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(214.5, 100%, 84.3%), hsl(210, 50%, 27.5%))\",\n variable: \"var(--kds-border-base-info)\",\n },\n },\n },\n \"node-status\": {\n empty: {\n color: {\n light: { h: 0, s: 0, l: 90.2, a: 1 },\n dark: { h: 0, s: 0, l: 32.2, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0, 0%, 90.2%), hsl(0, 0%, 32.2%))\",\n variable: \"var(--kds-border-node-status-empty)\",\n },\n },\n error: {\n color: {\n light: { h: 348, s: 94.3, l: 20.8, a: 1 },\n dark: { h: 2.6, s: 100, l: 72.4, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(348, 94.3%, 20.8%), hsl(2.6, 100%, 72.4%))\",\n variable: \"var(--kds-border-node-status-error)\",\n },\n },\n warning: {\n color: {\n light: { h: 19, s: 63.1, l: 38.2, a: 1 },\n dark: { h: 49.1, s: 99.1, l: 43.7, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(19, 63.1%, 38.2%), hsl(49.1, 99.1%, 43.7%))\",\n variable: \"var(--kds-border-node-status-warning)\",\n },\n },\n success: {\n color: {\n light: { h: 116.1, s: 46.6, l: 25.7, a: 1 },\n dark: { h: 106.5, s: 42.6, l: 54.9, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(116.1, 46.6%, 25.7%), hsl(106.5, 42.6%, 54.9%))\",\n variable: \"var(--kds-border-node-status-success)\",\n },\n },\n },\n ResizeHandle: {\n initial: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.4 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.4))\",\n variable: \"var(--kds-border-resize-handle-initial)\",\n },\n },\n hover: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.64 },\n dark: { h: 0, s: 0, l: 99, a: 0.58 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.64), hsl(0 0% 99% / 0.58))\",\n variable: \"var(--kds-border-resize-handle-hover)\",\n },\n },\n active: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.74 },\n dark: { h: 0, s: 0, l: 99, a: 0.68 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.74), hsl(0 0% 99% / 0.68))\",\n variable: \"var(--kds-border-resize-handle-active)\",\n },\n },\n },\n ColorPickerHandle: {\n initial: {\n color: {\n light: { h: 0, s: 0, l: 99, a: 1 },\n dark: { h: 0, s: 0, l: 99, a: 1 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid hsl(0, 0%, 99%)\",\n variable: \"var(--kds-border-color-picker-handle-initial)\",\n },\n },\n },\n};\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const dimension = {\n component: {\n height: {\n \"0.125x\": {\n value: 2,\n unit: \"px\",\n css: {\n value: \"2px\",\n variable: \"var(--kds-dimension-component-height-0-125x)\",\n },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-dimension-component-height-0-25x)\",\n },\n },\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: {\n value: \"8px\",\n variable: \"var(--kds-dimension-component-height-0-5x)\",\n },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: {\n value: \"12px\",\n variable: \"var(--kds-dimension-component-height-0-75x)\",\n },\n },\n \"0.88x\": {\n value: 14,\n unit: \"px\",\n css: {\n value: \"14px\",\n variable: \"var(--kds-dimension-component-height-0-88x)\",\n },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: {\n value: \"16px\",\n variable: \"var(--kds-dimension-component-height-1x)\",\n },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: {\n value: \"20px\",\n variable: \"var(--kds-dimension-component-height-1-25x)\",\n },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: {\n value: \"24px\",\n variable: \"var(--kds-dimension-component-height-1-5x)\",\n },\n },\n \"1.75x\": {\n value: 28,\n unit: \"px\",\n css: {\n value: \"28px\",\n variable: \"var(--kds-dimension-component-height-1-75x)\",\n },\n },\n \"2.25x\": {\n value: 36,\n unit: \"px\",\n css: {\n value: \"36px\",\n variable: \"var(--kds-dimension-component-height-2-25x)\",\n },\n },\n \"2.75x\": {\n value: 44,\n unit: \"px\",\n css: {\n value: \"44px\",\n variable: \"var(--kds-dimension-component-height-2-75x)\",\n },\n },\n \"2.5x\": {\n value: 40,\n unit: \"px\",\n css: {\n value: \"40px\",\n variable: \"var(--kds-dimension-component-height-2-5x)\",\n },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: {\n value: \"64px\",\n variable: \"var(--kds-dimension-component-height-4x)\",\n },\n },\n \"5x\": {\n value: 80,\n unit: \"px\",\n css: {\n value: \"80px\",\n variable: \"var(--kds-dimension-component-height-5x)\",\n },\n },\n \"12x\": {\n value: 192,\n unit: \"px\",\n css: {\n value: \"192px\",\n variable: \"var(--kds-dimension-component-height-12x)\",\n },\n },\n \"12.5x\": {\n value: 200,\n unit: \"px\",\n css: {\n value: \"200px\",\n variable: \"var(--kds-dimension-component-height-12-5x)\",\n },\n },\n \"20x\": {\n value: 320,\n unit: \"px\",\n css: {\n value: \"320px\",\n variable: \"var(--kds-dimension-component-height-20x)\",\n },\n },\n \"25x\": {\n value: 400,\n unit: \"px\",\n css: {\n value: \"400px\",\n variable: \"var(--kds-dimension-component-height-25x)\",\n },\n },\n \"45x\": {\n value: 720,\n unit: \"px\",\n css: {\n value: \"720px\",\n variable: \"var(--kds-dimension-component-height-45x)\",\n },\n },\n },\n width: {\n \"0.125x\": {\n value: 2,\n unit: \"px\",\n css: {\n value: \"2px\",\n variable: \"var(--kds-dimension-component-width-0-125x)\",\n },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-dimension-component-width-0-25x)\",\n },\n },\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: {\n value: \"8px\",\n variable: \"var(--kds-dimension-component-width-0-5x)\",\n },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: {\n value: \"12px\",\n variable: \"var(--kds-dimension-component-width-0-75x)\",\n },\n },\n \"0.88x\": {\n value: 14,\n unit: \"px\",\n css: {\n value: \"14px\",\n variable: \"var(--kds-dimension-component-width-0-88x)\",\n },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: {\n value: \"16px\",\n variable: \"var(--kds-dimension-component-width-1x)\",\n },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: {\n value: \"20px\",\n variable: \"var(--kds-dimension-component-width-1-25x)\",\n },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: {\n value: \"24px\",\n variable: \"var(--kds-dimension-component-width-1-5x)\",\n },\n },\n \"1.75x\": {\n value: 28,\n unit: \"px\",\n css: {\n value: \"28px\",\n variable: \"var(--kds-dimension-component-width-1-75x)\",\n },\n },\n \"2x\": {\n value: 32,\n unit: \"px\",\n css: {\n value: \"32px\",\n variable: \"var(--kds-dimension-component-width-2x)\",\n },\n },\n \"2.25x\": {\n value: 36,\n unit: \"px\",\n css: {\n value: \"36px\",\n variable: \"var(--kds-dimension-component-width-2-25x)\",\n },\n },\n \"2.75x\": {\n value: 44,\n unit: \"px\",\n css: {\n value: \"44px\",\n variable: \"var(--kds-dimension-component-width-2-75x)\",\n },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: {\n value: \"64px\",\n variable: \"var(--kds-dimension-component-width-4x)\",\n },\n },\n \"6x\": {\n value: 96,\n unit: \"px\",\n css: {\n value: \"96px\",\n variable: \"var(--kds-dimension-component-width-6x)\",\n },\n },\n \"8x\": {\n value: 128,\n unit: \"px\",\n css: {\n value: \"128px\",\n variable: \"var(--kds-dimension-component-width-8x)\",\n },\n },\n \"12x\": {\n value: 192,\n unit: \"px\",\n css: {\n value: \"192px\",\n variable: \"var(--kds-dimension-component-width-12x)\",\n },\n },\n \"12.5x\": {\n value: 200,\n unit: \"px\",\n css: {\n value: \"200px\",\n variable: \"var(--kds-dimension-component-width-12-5x)\",\n },\n },\n \"16x\": {\n value: 256,\n unit: \"px\",\n css: {\n value: \"256px\",\n variable: \"var(--kds-dimension-component-width-16x)\",\n },\n },\n \"17.5x\": {\n value: 280,\n unit: \"px\",\n css: {\n value: \"280px\",\n variable: \"var(--kds-dimension-component-width-17-5x)\",\n },\n },\n \"20x\": {\n value: 320,\n unit: \"px\",\n css: {\n value: \"320px\",\n variable: \"var(--kds-dimension-component-width-20x)\",\n },\n },\n \"25x\": {\n value: 400,\n unit: \"px\",\n css: {\n value: \"400px\",\n variable: \"var(--kds-dimension-component-width-25x)\",\n },\n },\n \"32x\": {\n value: 512,\n unit: \"px\",\n css: {\n value: \"512px\",\n variable: \"var(--kds-dimension-component-width-32x)\",\n },\n },\n \"35x\": {\n value: 560,\n unit: \"px\",\n css: {\n value: \"560px\",\n variable: \"var(--kds-dimension-component-width-35x)\",\n },\n },\n \"45x\": {\n value: 720,\n unit: \"px\",\n css: {\n value: \"720px\",\n variable: \"var(--kds-dimension-component-width-45x)\",\n },\n },\n \"52.5x\": {\n value: 840,\n unit: \"px\",\n css: {\n value: \"840px\",\n variable: \"var(--kds-dimension-component-width-52-5x)\",\n },\n },\n \"61x\": {\n value: 976,\n unit: \"px\",\n css: {\n value: \"976px\",\n variable: \"var(--kds-dimension-component-width-61x)\",\n },\n },\n },\n },\n icon: {\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: { value: \"8px\", variable: \"var(--kds-dimension-icon-0-5x)\" },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: { value: \"12px\", variable: \"var(--kds-dimension-icon-0-75x)\" },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: { value: \"16px\", variable: \"var(--kds-dimension-icon-1x)\" },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: { value: \"20px\", variable: \"var(--kds-dimension-icon-1-25x)\" },\n },\n },\n chart: {\n \"line-width\": {\n value: 1.5,\n unit: \"px\",\n css: {\n value: \"1.5px\",\n variable: \"var(--kds-dimension-chart-line-width)\",\n },\n },\n \"segment-gap\": {\n value: 0.75,\n unit: \"px\",\n css: {\n value: \"0.75px\",\n variable: \"var(--kds-dimension-chart-segment-gap)\",\n },\n },\n },\n};\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const spacing = {\n container: {\n negative: {\n \"0.25x\": {\n value: -4,\n unit: \"px\",\n css: {\n value: \"-4px\",\n variable: \"var(--kds-spacing-container-negative-0-25x)\",\n },\n },\n \"0.375x\": {\n value: -6,\n unit: \"px\",\n css: {\n value: \"-6px\",\n variable: \"var(--kds-spacing-container-negative-0-375x)\",\n },\n },\n \"0.5x\": {\n value: -8,\n unit: \"px\",\n css: {\n value: \"-8px\",\n variable: \"var(--kds-spacing-container-negative-0-5x)\",\n },\n },\n },\n none: {\n value: 0,\n unit: \"px\",\n css: { value: \"0\", variable: \"var(--kds-spacing-container-none)\" },\n },\n \"0.10x\": {\n value: 1,\n unit: \"px\",\n css: { value: \"1px\", variable: \"var(--kds-spacing-container-0-10x)\" },\n },\n \"0.12x\": {\n value: 2,\n unit: \"px\",\n css: { value: \"2px\", variable: \"var(--kds-spacing-container-0-12x)\" },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: { value: \"4px\", variable: \"var(--kds-spacing-container-0-25x)\" },\n },\n \"0.37x\": {\n value: 6,\n unit: \"px\",\n css: { value: \"6px\", variable: \"var(--kds-spacing-container-0-37x)\" },\n },\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: { value: \"8px\", variable: \"var(--kds-spacing-container-0-5x)\" },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: { value: \"12px\", variable: \"var(--kds-spacing-container-0-75x)\" },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: { value: \"16px\", variable: \"var(--kds-spacing-container-1x)\" },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: { value: \"20px\", variable: \"var(--kds-spacing-container-1-25x)\" },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: { value: \"24px\", variable: \"var(--kds-spacing-container-1-5x)\" },\n },\n \"2x\": {\n value: 32,\n unit: \"px\",\n css: { value: \"32px\", variable: \"var(--kds-spacing-container-2x)\" },\n },\n \"3x\": {\n value: 48,\n unit: \"px\",\n css: { value: \"48px\", variable: \"var(--kds-spacing-container-3x)\" },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: { value: \"64px\", variable: \"var(--kds-spacing-container-4x)\" },\n },\n \"5x\": {\n value: 80,\n unit: \"px\",\n css: { value: \"80px\", variable: \"var(--kds-spacing-container-5x)\" },\n },\n },\n offset: {\n focus: {\n value: 1,\n unit: \"px\",\n css: { value: \"1px\", variable: \"var(--kds-spacing-offset-focus)\" },\n },\n },\n inputLabel: {\n \"spacing-bottom\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-spacing-input-label-spacing-bottom)\",\n },\n },\n },\n SubText: {\n \"spacing-top\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-spacing-sub-text-spacing-top)\",\n },\n },\n },\n};\n","import { border, dimension, spacing } from \"@knime/kds-styles/tokens\";\n\n// The parts a column header's minimum width is made of: its horizontal\n// padding, the action buttons it shows, and the gap between them. See\n// {@link minColumnSize}.\nconst HEADER_HORIZONTAL_PADDING =\n spacing.container[\"0.5x\"].value + spacing.container[\"0.37x\"].value;\nconst HEADER_ACTION_BUTTON_GAP = spacing.container[\"0.12x\"].value;\nconst HEADER_ACTION_BUTTON_WIDTH = dimension.component.width[\"1.5x\"].value;\n// Wider than the others, since it is permanently visible (see HeaderCell.vue).\nconst DELETE_COLUMN_BUTTON_WIDTH = dimension.component.width[\"2x\"].value;\n\n// the min-width of cells in the header and rows, no matter what the header of\n// the column holds\nexport const MIN_COLUMN_SIZE = 50;\n\n/**\n * The min-width of a column whose header shows the given action buttons, i.e.\n * the width at which its name has truncated away entirely but the buttons\n * still fit. Never below {@link MIN_COLUMN_SIZE}. Enforced on the column size\n * shared with the row cells rather than as a header-only CSS min-width, which\n * would desync the header cell's width from its column's and shift later\n * columns out of alignment.\n */\nexport const minColumnSize = ({\n menuButton = false,\n sortButton = false,\n deleteButton = false,\n}: {\n menuButton?: boolean;\n sortButton?: boolean;\n deleteButton?: boolean;\n}) => {\n const buttonWidths = [\n ...(menuButton ? [HEADER_ACTION_BUTTON_WIDTH] : []),\n ...(sortButton ? [HEADER_ACTION_BUTTON_WIDTH] : []),\n ...(deleteButton ? [DELETE_COLUMN_BUTTON_WIDTH] : []),\n ];\n const gaps = Math.max(buttonWidths.length - 1, 0) * HEADER_ACTION_BUTTON_GAP;\n return Math.max(\n MIN_COLUMN_SIZE,\n HEADER_HORIZONTAL_PADDING +\n buttonWidths.reduce((total, width) => total + width, 0) +\n gaps,\n );\n};\n\n// the max-width of cells in the header and rows when using fit content column sizing\nexport const MAX_AUTO_COLUMN_SIZE = 960;\n\n// the width of special (collapser, selection, filter) columns in the header and rows\nexport const SPECIAL_COLUMNS_SIZE = dimension.component.width[\"2x\"].value;\n\n// the bottom border width of any given row\nexport const ROW_BORDER_BOTTOM_WIDTH = border.base.subtle.width.value;\n\n// the default height of a row, including its bottom border\nexport const DEFAULT_ROW_HEIGHT =\n dimension.component.height[\"2.5x\"].value + ROW_BORDER_BOTTOM_WIDTH;\n\n// the compact height of a row, including its bottom border\nexport const COMPACT_ROW_HEIGHT =\n dimension.component.height[\"1.75x\"].value + ROW_BORDER_BOTTOM_WIDTH;\n\n// the default top/bottom padding of a row (kds.spacing.container.0_75x)\n// Note that this is not arbitrary, but leads to remaining space of 1x which aligns with\n// the typography which uses 0.75x font size and 130% line height\n// (so we are just off by 0.025x which we accept since all of this is only important for\n// the centered-ness of content in the cell and not for exact measurements)\nexport const DEFAULT_ROW_PADDING_TOP_BOTTOM = spacing.container[\"0.75x\"].value;\n\n// the compact top/bottom padding of a row (kds.spacing.container.0_37x)\n// Note that this is not arbitrary, but leads to remaining space of 1x which aligns with\n// the typography which uses 0.75x font size and 130% line height\n// (so we are just off by 0.025x which we accept since all of this is only important for\n// the centered-ness of content in the cell and not for exact measurements)\nexport const COMPACT_ROW_PADDING_TOP_BOTTOM = spacing.container[\"0.37x\"].value;\n\n// the default horizontal padding of a table cell (kds.spacing.container.0_5x)\nexport const CELL_PADDING_HORIZONTAL = spacing.container[\"0.5x\"].value;\n\n// the minimum height of a row\nexport const MIN_ROW_HEIGHT = COMPACT_ROW_HEIGHT;\n\n// the height of the table header and group headers\nexport const HEADER_HEIGHT =\n dimension.component.height[\"2.5x\"].value + 2 * ROW_BORDER_BOTTOM_WIDTH;\n\n// the maximum width of the submenu in the header\nexport const MAX_SUB_MENU_WIDTH = 160;\n\n// after resizing rows, scroll is temporarily disabled until the resize is complete to prevent jumps\nexport const ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY = 100;\n\n// the width of the column resize drag handle\nexport const COLUMN_RESIZE_DRAG_HANDLE_WIDTH = 5;\n\n// the width of the cell expand button\nexport const EXPAND_BUTTON_WIDTH = dimension.component.width[\"1x\"].value;\n\nexport default {\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n MIN_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n COMPACT_ROW_HEIGHT,\n CELL_PADDING_HORIZONTAL,\n};\n","import type { PropType } from \"vue\";\n\n/**\n * Background-color tokens the table can be rendered on top of. Used to match\n * the table header's background to the surface surrounding the table.\n */\nexport const BACKGROUND_COLORS = [\n \"page-default\",\n \"surface-default\",\n \"surface-muted\",\n \"surface-subtle\",\n] as const;\n\nexport type BackgroundColor = (typeof BACKGROUND_COLORS)[number];\n\n/**\n * Shared Vue prop options for `renderedOnBackgroundColor`, used by every\n * component that exposes it. The `validator` guards the runtime value for\n * plain-JS callers that bypass the `BackgroundColor` type at compile time.\n */\nexport const renderedOnBackgroundColorProp = {\n type: String as PropType<BackgroundColor>,\n default: \"page-default\" as BackgroundColor,\n validator: (value: string) =>\n (BACKGROUND_COLORS as readonly string[]).includes(value),\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { ColumnConfig } from \"..\";\n\nconst isNonEmptyObject = (val: any) =>\n val !== null &&\n typeof val === \"object\" &&\n Object.getOwnPropertyNames(val).length > 0;\n\nconst isObjectRepresentation = (\n val: any,\n): val is { value?: any; color?: string; metadata?: string } => {\n const possibleKeys = [\"value\", \"metadata\", \"color\"];\n return (\n isNonEmptyObject(val) &&\n Object.getOwnPropertyNames(val).every((key) => possibleKeys.includes(key))\n );\n};\n\nexport const unpackObjectRepresentation = (val: any) => {\n if (isObjectRepresentation(val)) {\n if (val.hasOwnProperty(\"metadata\") && !val.hasOwnProperty(\"value\")) {\n return null;\n }\n return val.value;\n }\n return val;\n};\n\nexport const getColor = (val: any) => {\n if (isObjectRepresentation(val) && val.hasOwnProperty(\"color\")) {\n const color = val.color;\n return typeof color === \"undefined\" ? null : color;\n }\n return null;\n};\n\nexport const isMissingValue = (val: any): val is { metadata: string } | null =>\n val === null ||\n (isObjectRepresentation(val) && val?.hasOwnProperty(\"metadata\"));\n\nexport const getMissingValueMessage = (\n cellData: { metadata: string } | null,\n) => {\n const metadata = cellData?.metadata;\n const missingValueMsg = typeof metadata === \"string\" ? ` (${metadata})` : \"\";\n return `Missing Value${missingValueMsg}`;\n};\n\nexport const isEmpty = (val: any): val is { value: undefined } | undefined =>\n typeof unpackObjectRepresentation(val) === \"undefined\";\n\nexport const getPropertiesFromColumns = <T extends keyof ColumnConfig>(\n columnConfigs: ColumnConfig[],\n key: T,\n): Array<ColumnConfig[T]> => columnConfigs.map((colConfig) => colConfig[key]);\n","var $ = Object.defineProperty;\nvar P = (t, e, r) => e in t ? $(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;\nvar u = (t, e, r) => P(t, typeof e != \"symbol\" ? e + \"\" : e, r);\nimport { getCurrentScope as W, onScopeDispose as E, unref as s, computed as h, watch as y, ref as g, getCurrentInstance as V, onMounted as D, watchEffect as N, isRef as R } from \"vue\";\nfunction C(t) {\n return W() ? (E(t), !0) : !1;\n}\nfunction F(t) {\n return typeof t == \"function\" ? t() : s(t);\n}\nconst G = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nfunction T(t) {\n var e;\n const r = F(t);\n return (e = r == null ? void 0 : r.$el) != null ? e : r;\n}\nconst j = G ? window : void 0;\nfunction q() {\n const t = g(!1);\n return V() && D(() => {\n t.value = !0;\n }), t;\n}\nfunction _(t) {\n const e = q();\n return h(() => (e.value, !!t()));\n}\nfunction B(t, e, r = {}) {\n const { window: n = j, ...c } = r;\n let o;\n const f = _(() => n && \"ResizeObserver\" in n), i = () => {\n o && (o.disconnect(), o = void 0);\n }, d = h(() => Array.isArray(t) ? t.map((m) => T(m)) : [T(t)]), l = y(\n d,\n (m) => {\n if (i(), f.value && n) {\n o = new ResizeObserver(e);\n for (const v of m)\n v && o.observe(v, c);\n }\n },\n { immediate: !0, flush: \"post\", deep: !0 }\n ), p = () => {\n i(), l();\n };\n return C(p), {\n isSupported: f,\n stop: p\n };\n}\nfunction H(t) {\n return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, \"default\") ? t.default : t;\n}\nvar J = function(e) {\n var r = null, n, c = function(i) {\n return function() {\n r = null, e.apply(i, n);\n };\n }, o = function() {\n for (var i = arguments.length, d = new Array(i), l = 0; l < i; l++)\n d[l] = arguments[l];\n n = d, r === null && (r = requestAnimationFrame(c(this)));\n };\n return o.cancel = function() {\n cancelAnimationFrame(r), r = null;\n }, o;\n}, K = J;\nconst Q = /* @__PURE__ */ H(K), X = 500, L = ({\n sizeManager: t,\n buffer: e = X\n}, r = \"vertical\", n = null) => {\n const o = g({ scrollStart: 0, scrollEnd: 0 }), f = r === \"vertical\", i = n ?? g(null), d = Q(() => {\n if (!i.value)\n return;\n const { scrollTop: a, scrollLeft: S, offsetHeight: w, offsetWidth: O } = i.value, I = f ? a : S, U = f ? w : O;\n o.value = { scrollStart: I, scrollEnd: I + U };\n });\n t.onUpdate(d), n || B(i, d);\n let l = null;\n const p = h(() => {\n const a = t.toIndex(o.value.scrollStart - e), S = Math.min(\n t.toIndex(o.value.scrollEnd + e) + 1,\n t.getNumItems()\n );\n return l && l.startIndex === a && l.endIndex === S || (l = { startIndex: a, endIndex: S, toArray: () => Array.from({ length: S - a }, (O, I) => a + I) }), l;\n }), m = h(() => t.toOffset(p.value.startIndex)), v = h(() => t.getTotalSize()), x = `--virtual-scroller-${r}-offset`, A = `--virtual-scroller-${r}-total-size`;\n N(() => {\n const a = i.value;\n a && (a.style.setProperty(x, `${m.value}px`), a.style.setProperty(A, `${v.value}px`));\n });\n const M = {\n [`padding${f ? \"Top\" : \"Left\"}`]: `var(${x})`,\n [f ? \"height\" : \"width\"]: `var(${A})`,\n /**\n * Since the height of the element should not be influenced by its padding.\n * An alternative without box-sizing: \"border-box\" would be to use margins instead\n * paddings, but then it is no longer easily possible to absolutely position\n * other elements (e.g. a cell selection overlay) inside this element.\n */\n boxSizing: \"border-box\"\n };\n return {\n containerProps: {\n ref: i,\n onScroll: d\n },\n indices: p,\n scrolledAreaStyles: M\n };\n}, te = (t) => {\n const e = g(null), r = L(t.rows, \"vertical\", e), n = L(t.columns, \"horizontal\", e), c = () => {\n r.containerProps.onScroll(), n.containerProps.onScroll();\n };\n return B(e, c), {\n containerProps: {\n ref: e,\n onScroll: c\n },\n scrolledAreaStyles: {\n vertical: r.scrolledAreaStyles,\n horizontal: n.scrolledAreaStyles\n },\n indices: {\n vertical: r.indices,\n horizontal: n.indices\n }\n };\n}, z = (t, e) => R(t) && y(() => t.value, e), Y = (t, e) => Math.floor(t / e);\nclass re {\n constructor(e, r) {\n u(this, \"numItems\");\n u(this, \"size\");\n this.numItems = e, this.size = r;\n }\n getNumItems() {\n return s(this.numItems);\n }\n onUpdate(e) {\n z(this.numItems, e), z(this.size, e);\n }\n toOffset(e) {\n return e * s(this.size);\n }\n getTotalSize() {\n return s(this.numItems) * s(this.size);\n }\n toIndex(e) {\n return Math.max(\n Math.min(\n Y(e, s(this.size)),\n s(this.numItems) - 1\n ),\n 0\n );\n }\n}\nclass Z {\n constructor(e) {\n u(this, \"isLeft\");\n this.isLeft = e;\n }\n getLastLeftIndex(e, r = 0) {\n if (e - r <= 1)\n return this.isLeft(e) ? e : r;\n const n = Math.floor((e + r) / 2);\n return this.isLeft(n) ? this.getLastLeftIndex(e, n) : this.getLastLeftIndex(n, r);\n }\n}\nclass ne {\n constructor(e) {\n u(this, \"numItems\");\n u(this, \"accumulatedSizes\");\n this.numItems = h(() => s(e).length), this.accumulatedSizes = h(() => {\n const r = [0];\n for (let n = 0; n < s(e).length; n++)\n r.push(r[n] + s(e)[n]);\n return r;\n });\n }\n getNumItems() {\n return s(this.numItems);\n }\n onUpdate(e) {\n y([this.accumulatedSizes], e);\n }\n toOffset(e) {\n return this.accumulatedSizes.value[e];\n }\n getTotalSize() {\n return this.accumulatedSizes.value[s(this.numItems)];\n }\n toIndex(e) {\n return e < 0 ? 0 : new Z((n) => this.toOffset(n) <= e).getLastLeftIndex(s(this.numItems) - 1);\n }\n}\nclass b {\n constructor(e) {\n u(this, \"delegate\");\n this.delegate = e;\n }\n getTotalSize() {\n return this.delegate.getTotalSize();\n }\n toIndex(e) {\n return this.delegate.toIndex(e);\n }\n getNumItems() {\n return this.delegate.getNumItems();\n }\n toOffset(e) {\n return this.delegate.toOffset(e);\n }\n onUpdate(e) {\n this.delegate.onUpdate(e);\n }\n}\nclass se extends b {\n constructor({\n spaceBefore: r,\n spaceBeforeIsOffset: n\n }, c) {\n super(c);\n u(this, \"spaceBefore\");\n u(this, \"spaceBeforeIsOffset\");\n this.spaceBefore = r, this.spaceBeforeIsOffset = n;\n }\n onUpdate(r) {\n super.onUpdate(r), z(this.spaceBefore, r);\n }\n toOffset(r) {\n return (this.spaceBeforeIsOffset ? s(this.spaceBefore) : 0) + super.toOffset(r);\n }\n getTotalSize() {\n return s(this.spaceBefore) + super.getTotalSize();\n }\n toIndex(r) {\n return super.toIndex(r - s(this.spaceBefore));\n }\n}\nclass oe extends b {\n constructor(r, n) {\n super(n);\n u(this, \"spaceAfter\");\n this.spaceAfter = r;\n }\n onUpdate(r) {\n super.onUpdate(r), z(this.spaceAfter, r);\n }\n getTotalSize() {\n return super.getTotalSize() + s(this.spaceAfter);\n }\n}\nexport {\n ne as ArraySizeManager,\n re as SameSizeManager,\n oe as WithSpaceAfter,\n se as WithSpaceBefore,\n te as useVirtualGrid,\n L as useVirtualLine\n};\n","/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */\nfunction _OverloadYield(e, d) {\n\tthis.v = e, this.k = d;\n}\nfunction _arrayLikeToArray(r, a) {\n\t(null == a || a > r.length) && (a = r.length);\n\tfor (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n\treturn n;\n}\nfunction _arrayWithHoles(r) {\n\tif (Array.isArray(r)) return r;\n}\nfunction _iterableToArrayLimit(r, l) {\n\tvar t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n\tif (null != t) {\n\t\tvar e, n, i, u, a = [], f = !0, o = !1;\n\t\ttry {\n\t\t\tif (i = (t = t.call(r)).next, 0 === l) {\n\t\t\t\tif (Object(t) !== t) return;\n\t\t\t\tf = !1;\n\t\t\t} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n\t\t} catch (r) {\n\t\t\to = !0, n = r;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n\t\t\t} finally {\n\t\t\t\tif (o) throw n;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}\nfunction _nonIterableRest() {\n\tthrow new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\nfunction _slicedToArray(r, e) {\n\treturn _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _unsupportedIterableToArray(r, a) {\n\tif (r) {\n\t\tif (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n\t\tvar t = {}.toString.call(r).slice(8, -1);\n\t\treturn \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n\t}\n}\nfunction AsyncGenerator(e) {\n\tvar t, n;\n\tfunction resume(t, n) {\n\t\ttry {\n\t\t\tvar r = e[t](n), o = r.value, u = o instanceof _OverloadYield;\n\t\t\tPromise.resolve(u ? o.v : o).then(function(n) {\n\t\t\t\tif (u) {\n\t\t\t\t\tvar i = \"return\" === t && o.k ? t : \"next\";\n\t\t\t\t\tif (!o.k || n.done) return resume(i, n);\n\t\t\t\t\tn = e[i](n).value;\n\t\t\t\t}\n\t\t\t\tsettle(!!r.done, n);\n\t\t\t}, function(e) {\n\t\t\t\tresume(\"throw\", e);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tsettle(2, e);\n\t\t}\n\t}\n\tfunction settle(e, r) {\n\t\t2 === e ? t.reject(r) : t.resolve({\n\t\t\tvalue: r,\n\t\t\tdone: e\n\t\t}), (t = t.next) ? resume(t.key, t.arg) : n = null;\n\t}\n\tthis._invoke = function(e, r) {\n\t\treturn new Promise(function(o, u) {\n\t\t\tvar i = {\n\t\t\t\tkey: e,\n\t\t\t\targ: r,\n\t\t\t\tresolve: o,\n\t\t\t\treject: u,\n\t\t\t\tnext: null\n\t\t\t};\n\t\t\tn ? n = n.next = i : (t = n = i, resume(e, r));\n\t\t});\n\t}, \"function\" != typeof e.return && (this.return = void 0);\n}\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function() {\n\treturn this;\n}, AsyncGenerator.prototype.next = function(e) {\n\treturn this._invoke(\"next\", e);\n}, AsyncGenerator.prototype.throw = function(e) {\n\treturn this._invoke(\"throw\", e);\n}, AsyncGenerator.prototype.return = function(e) {\n\treturn this._invoke(\"return\", e);\n};\nconst entries = Object.entries;\nconst setPrototypeOf = Object.setPrototypeOf;\nconst isFrozen = Object.isFrozen;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nlet freeze = Object.freeze;\nlet seal = Object.seal;\nlet create = Object.create;\nlet _ref = typeof Reflect !== \"undefined\" && Reflect;\nlet apply = _ref.apply;\nlet construct = _ref.construct;\nif (!freeze) freeze = function freeze(x) {\n\treturn x;\n};\nif (!seal) seal = function seal(x) {\n\treturn x;\n};\nif (!apply) apply = function apply(func, thisArg) {\n\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\treturn func.apply(thisArg, args);\n};\nif (!construct) construct = function construct(Func) {\n\tfor (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];\n\treturn new Func(...args);\n};\nconst arrayForEach = unapply(Array.prototype.forEach);\nArray.prototype.indexOf;\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\nconst arraySplice = unapply(Array.prototype.splice);\nconst arrayIsArray = Array.isArray;\nconst setCreate = unconstruct(Set);\nconst setAdd = unapply(Set.prototype.add);\nconst setHas = unapply(Set.prototype.has);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst numberToString = unapply(Number.prototype.toString);\nconst booleanToString = unapply(Boolean.prototype.toString);\nconst bigintToString = typeof BigInt === \"undefined\" ? null : unapply(BigInt.prototype.toString);\nconst symbolToString = typeof Symbol === \"undefined\" ? null : unapply(Symbol.prototype.toString);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst objectToString = unapply(Object.prototype.toString);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n* Creates a new function that calls the given function with a specified thisArg and arguments.\n*\n* @param func - The function to be wrapped and called.\n* @returns A new function that calls the given function with a specified thisArg and arguments.\n*/\nfunction unapply(func) {\n\treturn function(thisArg) {\n\t\tif (thisArg instanceof RegExp) thisArg.lastIndex = 0;\n\t\tfor (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];\n\t\treturn apply(func, thisArg, args);\n\t};\n}\n/**\n* Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n*\n* @param func - The constructor function to be wrapped and called.\n* @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n*/\nfunction unconstruct(Func) {\n\treturn function() {\n\t\tfor (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];\n\t\treturn construct(Func, args);\n\t};\n}\n/**\n* Add properties to a lookup table\n*\n* @param set - The set to which elements will be added.\n* @param array - The array containing elements to be added to the set.\n* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n* @returns The modified set with added elements.\n*/\nfunction addToSet(set, array) {\n\tlet transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;\n\tif (setPrototypeOf) setPrototypeOf(set, null);\n\tif (!arrayIsArray(array)) return set;\n\tlet l = array.length;\n\twhile (l--) {\n\t\tlet element = array[l];\n\t\tif (typeof element === \"string\") {\n\t\t\tconst lcElement = transformCaseFunc(element);\n\t\t\tif (lcElement !== element) {\n\t\t\t\tif (!isFrozen(array)) array[l] = lcElement;\n\t\t\t\telement = lcElement;\n\t\t\t}\n\t\t}\n\t\tset[element] = true;\n\t}\n\treturn set;\n}\n/**\n* Clean up an array to harden against CSPP\n*\n* @param array - The array to be cleaned.\n* @returns The cleaned version of the array\n*/\nfunction cleanArray(array) {\n\tfor (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;\n\treturn array;\n}\n/**\n* Shallow clone an object\n*\n* @param object - The object to be cloned.\n* @returns A new object that copies the original.\n*/\nfunction clone(object) {\n\tconst newObject = create(null);\n\tfor (const _ref2 of entries(object)) {\n\t\tvar _ref3 = _slicedToArray(_ref2, 2);\n\t\tconst property = _ref3[0];\n\t\tconst value = _ref3[1];\n\t\tif (objectHasOwnProperty(object, property)) {\n\t\t\tif (arrayIsArray(value)) newObject[property] = cleanArray(value);\n\t\t\telse if (value && typeof value === \"object\" && value.constructor === Object) newObject[property] = clone(value);\n\t\t\telse newObject[property] = value;\n\t\t}\n\t}\n\treturn newObject;\n}\n/**\n* Convert non-node values into strings without depending on direct property access.\n*\n* @param value - The value to stringify.\n* @returns A string representation of the provided value.\n*/\nfunction stringifyValue(value) {\n\tswitch (typeof value) {\n\t\tcase \"string\": return value;\n\t\tcase \"number\": return numberToString(value);\n\t\tcase \"boolean\": return booleanToString(value);\n\t\tcase \"bigint\": return bigintToString ? bigintToString(value) : \"0\";\n\t\tcase \"symbol\": return symbolToString ? symbolToString(value) : \"Symbol()\";\n\t\tcase \"undefined\": return objectToString(value);\n\t\tcase \"function\":\n\t\tcase \"object\": {\n\t\t\tif (value === null) return objectToString(value);\n\t\t\tconst valueAsRecord = value;\n\t\t\tconst valueToString = lookupGetter(valueAsRecord, \"toString\");\n\t\t\tif (typeof valueToString === \"function\") {\n\t\t\t\tconst stringified = valueToString(valueAsRecord);\n\t\t\t\treturn typeof stringified === \"string\" ? stringified : objectToString(stringified);\n\t\t\t}\n\t\t\treturn objectToString(value);\n\t\t}\n\t\tdefault: return objectToString(value);\n\t}\n}\n/**\n* This method automatically checks if the prop is function or getter and behaves accordingly.\n*\n* @param object - The object to look up the getter function in its prototype chain.\n* @param prop - The property name for which to find the getter function.\n* @returns The getter function found in the prototype chain or a fallback function.\n*/\nfunction lookupGetter(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\t\tif (desc) {\n\t\t\tif (desc.get) return unapply(desc.get);\n\t\t\tif (typeof desc.value === \"function\") return unapply(desc.value);\n\t\t}\n\t\tobject = getPrototypeOf(object);\n\t}\n\tfunction fallbackValue() {\n\t\treturn null;\n\t}\n\treturn fallbackValue;\n}\n/**\n* Like lookupGetter, but for accessor properties only, and returns null\n* instead of a null-returning fallback when no getter exists on the chain.\n* Lets a caller fall back to a direct property read in environments that\n* lack the getter, where a fallback returning null would be indistinguishable\n* from a legitimate null value (e.g. namespaceURI of a no-namespace element).\n*\n* @param object - The object (usually a prototype) to start the lookup at.\n* @param prop - The accessor property name.\n* @returns The unapplied getter, or null if none was found.\n*/\nfunction lookupAccessor(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\t\tif (desc) return desc.get ? unapply(desc.get) : null;\n\t\tobject = getPrototypeOf(object);\n\t}\n\treturn null;\n}\nfunction isRegex(value) {\n\ttry {\n\t\tregExpTest(value, \"\");\n\t\treturn true;\n\t} catch (_unused) {\n\t\treturn false;\n\t}\n}\nconst html$1 = freeze([\n\t\"a\",\n\t\"abbr\",\n\t\"acronym\",\n\t\"address\",\n\t\"area\",\n\t\"article\",\n\t\"aside\",\n\t\"audio\",\n\t\"b\",\n\t\"bdi\",\n\t\"bdo\",\n\t\"big\",\n\t\"blink\",\n\t\"blockquote\",\n\t\"body\",\n\t\"br\",\n\t\"button\",\n\t\"canvas\",\n\t\"caption\",\n\t\"center\",\n\t\"cite\",\n\t\"code\",\n\t\"col\",\n\t\"colgroup\",\n\t\"content\",\n\t\"data\",\n\t\"datalist\",\n\t\"dd\",\n\t\"decorator\",\n\t\"del\",\n\t\"details\",\n\t\"dfn\",\n\t\"dialog\",\n\t\"dir\",\n\t\"div\",\n\t\"dl\",\n\t\"dt\",\n\t\"element\",\n\t\"em\",\n\t\"fieldset\",\n\t\"figcaption\",\n\t\"figure\",\n\t\"font\",\n\t\"footer\",\n\t\"form\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"head\",\n\t\"header\",\n\t\"hgroup\",\n\t\"hr\",\n\t\"html\",\n\t\"i\",\n\t\"img\",\n\t\"input\",\n\t\"ins\",\n\t\"kbd\",\n\t\"label\",\n\t\"legend\",\n\t\"li\",\n\t\"main\",\n\t\"map\",\n\t\"mark\",\n\t\"marquee\",\n\t\"menu\",\n\t\"menuitem\",\n\t\"meter\",\n\t\"nav\",\n\t\"nobr\",\n\t\"ol\",\n\t\"optgroup\",\n\t\"option\",\n\t\"output\",\n\t\"p\",\n\t\"picture\",\n\t\"pre\",\n\t\"progress\",\n\t\"q\",\n\t\"rp\",\n\t\"rt\",\n\t\"ruby\",\n\t\"s\",\n\t\"samp\",\n\t\"search\",\n\t\"section\",\n\t\"select\",\n\t\"shadow\",\n\t\"slot\",\n\t\"small\",\n\t\"source\",\n\t\"spacer\",\n\t\"span\",\n\t\"strike\",\n\t\"strong\",\n\t\"style\",\n\t\"sub\",\n\t\"summary\",\n\t\"sup\",\n\t\"table\",\n\t\"tbody\",\n\t\"td\",\n\t\"template\",\n\t\"textarea\",\n\t\"tfoot\",\n\t\"th\",\n\t\"thead\",\n\t\"time\",\n\t\"tr\",\n\t\"track\",\n\t\"tt\",\n\t\"u\",\n\t\"ul\",\n\t\"var\",\n\t\"video\",\n\t\"wbr\"\n]);\nconst svg$1 = freeze([\n\t\"svg\",\n\t\"a\",\n\t\"altglyph\",\n\t\"altglyphdef\",\n\t\"altglyphitem\",\n\t\"animatecolor\",\n\t\"animatemotion\",\n\t\"animatetransform\",\n\t\"circle\",\n\t\"clippath\",\n\t\"defs\",\n\t\"desc\",\n\t\"ellipse\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"filter\",\n\t\"font\",\n\t\"g\",\n\t\"glyph\",\n\t\"glyphref\",\n\t\"hkern\",\n\t\"image\",\n\t\"inputmode\",\n\t\"line\",\n\t\"lineargradient\",\n\t\"marker\",\n\t\"mask\",\n\t\"metadata\",\n\t\"mpath\",\n\t\"part\",\n\t\"path\",\n\t\"pattern\",\n\t\"polygon\",\n\t\"polyline\",\n\t\"radialgradient\",\n\t\"rect\",\n\t\"stop\",\n\t\"style\",\n\t\"switch\",\n\t\"symbol\",\n\t\"text\",\n\t\"textpath\",\n\t\"title\",\n\t\"tref\",\n\t\"tspan\",\n\t\"view\",\n\t\"vkern\"\n]);\nconst svgFilters = freeze([\n\t\"feBlend\",\n\t\"feColorMatrix\",\n\t\"feComponentTransfer\",\n\t\"feComposite\",\n\t\"feConvolveMatrix\",\n\t\"feDiffuseLighting\",\n\t\"feDisplacementMap\",\n\t\"feDistantLight\",\n\t\"feDropShadow\",\n\t\"feFlood\",\n\t\"feFuncA\",\n\t\"feFuncB\",\n\t\"feFuncG\",\n\t\"feFuncR\",\n\t\"feGaussianBlur\",\n\t\"feImage\",\n\t\"feMerge\",\n\t\"feMergeNode\",\n\t\"feMorphology\",\n\t\"feOffset\",\n\t\"fePointLight\",\n\t\"feSpecularLighting\",\n\t\"feSpotLight\",\n\t\"feTile\",\n\t\"feTurbulence\"\n]);\nconst svgDisallowed = freeze([\n\t\"animate\",\n\t\"color-profile\",\n\t\"cursor\",\n\t\"discard\",\n\t\"font-face\",\n\t\"font-face-format\",\n\t\"font-face-name\",\n\t\"font-face-src\",\n\t\"font-face-uri\",\n\t\"foreignobject\",\n\t\"hatch\",\n\t\"hatchpath\",\n\t\"mesh\",\n\t\"meshgradient\",\n\t\"meshpatch\",\n\t\"meshrow\",\n\t\"missing-glyph\",\n\t\"script\",\n\t\"set\",\n\t\"solidcolor\",\n\t\"unknown\",\n\t\"use\"\n]);\nconst mathMl$1 = freeze([\n\t\"math\",\n\t\"menclose\",\n\t\"merror\",\n\t\"mfenced\",\n\t\"mfrac\",\n\t\"mglyph\",\n\t\"mi\",\n\t\"mlabeledtr\",\n\t\"mmultiscripts\",\n\t\"mn\",\n\t\"mo\",\n\t\"mover\",\n\t\"mpadded\",\n\t\"mphantom\",\n\t\"mroot\",\n\t\"mrow\",\n\t\"ms\",\n\t\"mspace\",\n\t\"msqrt\",\n\t\"mstyle\",\n\t\"msub\",\n\t\"msup\",\n\t\"msubsup\",\n\t\"mtable\",\n\t\"mtd\",\n\t\"mtext\",\n\t\"mtr\",\n\t\"munder\",\n\t\"munderover\",\n\t\"mprescripts\"\n]);\nconst mathMlDisallowed = freeze([\n\t\"maction\",\n\t\"maligngroup\",\n\t\"malignmark\",\n\t\"mlongdiv\",\n\t\"mscarries\",\n\t\"mscarry\",\n\t\"msgroup\",\n\t\"mstack\",\n\t\"msline\",\n\t\"msrow\",\n\t\"semantics\",\n\t\"annotation\",\n\t\"annotation-xml\",\n\t\"mprescripts\",\n\t\"none\"\n]);\nconst text = freeze([\"#text\"]);\nconst html = freeze([\n\t\"accept\",\n\t\"action\",\n\t\"align\",\n\t\"alt\",\n\t\"autocapitalize\",\n\t\"autocomplete\",\n\t\"autopictureinpicture\",\n\t\"autoplay\",\n\t\"background\",\n\t\"bgcolor\",\n\t\"border\",\n\t\"capture\",\n\t\"cellpadding\",\n\t\"cellspacing\",\n\t\"checked\",\n\t\"cite\",\n\t\"class\",\n\t\"clear\",\n\t\"color\",\n\t\"cols\",\n\t\"colspan\",\n\t\"command\",\n\t\"commandfor\",\n\t\"controls\",\n\t\"controlslist\",\n\t\"coords\",\n\t\"crossorigin\",\n\t\"datetime\",\n\t\"decoding\",\n\t\"default\",\n\t\"dir\",\n\t\"disabled\",\n\t\"disablepictureinpicture\",\n\t\"disableremoteplayback\",\n\t\"download\",\n\t\"draggable\",\n\t\"enctype\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"face\",\n\t\"for\",\n\t\"headers\",\n\t\"height\",\n\t\"hidden\",\n\t\"high\",\n\t\"href\",\n\t\"hreflang\",\n\t\"id\",\n\t\"inert\",\n\t\"inputmode\",\n\t\"integrity\",\n\t\"ismap\",\n\t\"kind\",\n\t\"label\",\n\t\"lang\",\n\t\"list\",\n\t\"loading\",\n\t\"loop\",\n\t\"low\",\n\t\"max\",\n\t\"maxlength\",\n\t\"media\",\n\t\"method\",\n\t\"min\",\n\t\"minlength\",\n\t\"multiple\",\n\t\"muted\",\n\t\"name\",\n\t\"nonce\",\n\t\"noshade\",\n\t\"novalidate\",\n\t\"nowrap\",\n\t\"open\",\n\t\"optimum\",\n\t\"part\",\n\t\"pattern\",\n\t\"placeholder\",\n\t\"playsinline\",\n\t\"popover\",\n\t\"popovertarget\",\n\t\"popovertargetaction\",\n\t\"poster\",\n\t\"preload\",\n\t\"pubdate\",\n\t\"radiogroup\",\n\t\"readonly\",\n\t\"rel\",\n\t\"required\",\n\t\"rev\",\n\t\"reversed\",\n\t\"role\",\n\t\"rows\",\n\t\"rowspan\",\n\t\"spellcheck\",\n\t\"scope\",\n\t\"selected\",\n\t\"shape\",\n\t\"size\",\n\t\"sizes\",\n\t\"slot\",\n\t\"span\",\n\t\"srclang\",\n\t\"start\",\n\t\"src\",\n\t\"srcset\",\n\t\"step\",\n\t\"style\",\n\t\"summary\",\n\t\"tabindex\",\n\t\"title\",\n\t\"translate\",\n\t\"type\",\n\t\"usemap\",\n\t\"valign\",\n\t\"value\",\n\t\"width\",\n\t\"wrap\",\n\t\"xmlns\"\n]);\nconst svg = freeze([\n\t\"accent-height\",\n\t\"accumulate\",\n\t\"additive\",\n\t\"alignment-baseline\",\n\t\"amplitude\",\n\t\"ascent\",\n\t\"attributename\",\n\t\"attributetype\",\n\t\"azimuth\",\n\t\"basefrequency\",\n\t\"baseline-shift\",\n\t\"begin\",\n\t\"bias\",\n\t\"by\",\n\t\"class\",\n\t\"clip\",\n\t\"clippathunits\",\n\t\"clip-path\",\n\t\"clip-rule\",\n\t\"color\",\n\t\"color-interpolation\",\n\t\"color-interpolation-filters\",\n\t\"color-profile\",\n\t\"color-rendering\",\n\t\"cx\",\n\t\"cy\",\n\t\"d\",\n\t\"dx\",\n\t\"dy\",\n\t\"diffuseconstant\",\n\t\"direction\",\n\t\"display\",\n\t\"divisor\",\n\t\"dominant-baseline\",\n\t\"dur\",\n\t\"edgemode\",\n\t\"elevation\",\n\t\"end\",\n\t\"exponent\",\n\t\"fill\",\n\t\"fill-opacity\",\n\t\"fill-rule\",\n\t\"filter\",\n\t\"filterunits\",\n\t\"flood-color\",\n\t\"flood-opacity\",\n\t\"font-family\",\n\t\"font-size\",\n\t\"font-size-adjust\",\n\t\"font-stretch\",\n\t\"font-style\",\n\t\"font-variant\",\n\t\"font-weight\",\n\t\"fx\",\n\t\"fy\",\n\t\"g1\",\n\t\"g2\",\n\t\"glyph-name\",\n\t\"glyphref\",\n\t\"gradientunits\",\n\t\"gradienttransform\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"image-rendering\",\n\t\"in\",\n\t\"in2\",\n\t\"intercept\",\n\t\"k\",\n\t\"k1\",\n\t\"k2\",\n\t\"k3\",\n\t\"k4\",\n\t\"kerning\",\n\t\"keypoints\",\n\t\"keysplines\",\n\t\"keytimes\",\n\t\"lang\",\n\t\"lengthadjust\",\n\t\"letter-spacing\",\n\t\"kernelmatrix\",\n\t\"kernelunitlength\",\n\t\"lighting-color\",\n\t\"local\",\n\t\"marker-end\",\n\t\"marker-mid\",\n\t\"marker-start\",\n\t\"markerheight\",\n\t\"markerunits\",\n\t\"markerwidth\",\n\t\"maskcontentunits\",\n\t\"maskunits\",\n\t\"max\",\n\t\"mask\",\n\t\"mask-type\",\n\t\"media\",\n\t\"method\",\n\t\"mode\",\n\t\"min\",\n\t\"name\",\n\t\"numoctaves\",\n\t\"offset\",\n\t\"operator\",\n\t\"opacity\",\n\t\"order\",\n\t\"orient\",\n\t\"orientation\",\n\t\"origin\",\n\t\"overflow\",\n\t\"paint-order\",\n\t\"path\",\n\t\"pathlength\",\n\t\"patterncontentunits\",\n\t\"patterntransform\",\n\t\"patternunits\",\n\t\"pointer-events\",\n\t\"points\",\n\t\"preservealpha\",\n\t\"preserveaspectratio\",\n\t\"primitiveunits\",\n\t\"r\",\n\t\"rx\",\n\t\"ry\",\n\t\"radius\",\n\t\"refx\",\n\t\"refy\",\n\t\"repeatcount\",\n\t\"repeatdur\",\n\t\"restart\",\n\t\"result\",\n\t\"rotate\",\n\t\"scale\",\n\t\"seed\",\n\t\"shape-rendering\",\n\t\"slope\",\n\t\"specularconstant\",\n\t\"specularexponent\",\n\t\"spreadmethod\",\n\t\"startoffset\",\n\t\"stddeviation\",\n\t\"stitchtiles\",\n\t\"stop-color\",\n\t\"stop-opacity\",\n\t\"stroke-dasharray\",\n\t\"stroke-dashoffset\",\n\t\"stroke-linecap\",\n\t\"stroke-linejoin\",\n\t\"stroke-miterlimit\",\n\t\"stroke-opacity\",\n\t\"stroke\",\n\t\"stroke-width\",\n\t\"style\",\n\t\"surfacescale\",\n\t\"systemlanguage\",\n\t\"tabindex\",\n\t\"tablevalues\",\n\t\"targetx\",\n\t\"targety\",\n\t\"transform\",\n\t\"transform-origin\",\n\t\"text-anchor\",\n\t\"text-decoration\",\n\t\"text-orientation\",\n\t\"text-rendering\",\n\t\"textlength\",\n\t\"type\",\n\t\"u1\",\n\t\"u2\",\n\t\"unicode\",\n\t\"values\",\n\t\"vector-effect\",\n\t\"viewbox\",\n\t\"visibility\",\n\t\"version\",\n\t\"vert-adv-y\",\n\t\"vert-origin-x\",\n\t\"vert-origin-y\",\n\t\"width\",\n\t\"word-spacing\",\n\t\"wrap\",\n\t\"writing-mode\",\n\t\"xchannelselector\",\n\t\"ychannelselector\",\n\t\"x\",\n\t\"x1\",\n\t\"x2\",\n\t\"xmlns\",\n\t\"y\",\n\t\"y1\",\n\t\"y2\",\n\t\"z\",\n\t\"zoomandpan\"\n]);\nconst mathMl = freeze([\n\t\"accent\",\n\t\"accentunder\",\n\t\"align\",\n\t\"bevelled\",\n\t\"close\",\n\t\"columnalign\",\n\t\"columnlines\",\n\t\"columnspacing\",\n\t\"columnspan\",\n\t\"denomalign\",\n\t\"depth\",\n\t\"dir\",\n\t\"display\",\n\t\"displaystyle\",\n\t\"encoding\",\n\t\"fence\",\n\t\"frame\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"largeop\",\n\t\"length\",\n\t\"linethickness\",\n\t\"lquote\",\n\t\"lspace\",\n\t\"mathbackground\",\n\t\"mathcolor\",\n\t\"mathsize\",\n\t\"mathvariant\",\n\t\"maxsize\",\n\t\"minsize\",\n\t\"movablelimits\",\n\t\"notation\",\n\t\"numalign\",\n\t\"open\",\n\t\"rowalign\",\n\t\"rowlines\",\n\t\"rowspacing\",\n\t\"rowspan\",\n\t\"rspace\",\n\t\"rquote\",\n\t\"scriptlevel\",\n\t\"scriptminsize\",\n\t\"scriptsizemultiplier\",\n\t\"selection\",\n\t\"separator\",\n\t\"separators\",\n\t\"stretchy\",\n\t\"subscriptshift\",\n\t\"supscriptshift\",\n\t\"symmetric\",\n\t\"voffset\",\n\t\"width\",\n\t\"xmlns\"\n]);\nconst xml = freeze([\n\t\"xlink:href\",\n\t\"xml:id\",\n\t\"xlink:title\",\n\t\"xml:space\",\n\t\"xmlns:xlink\"\n]);\nconst MUSTACHE_EXPR = seal(/{{[\\w\\W]*|^[\\w\\W]*}}/g);\nconst ERB_EXPR = seal(/<%[\\w\\W]*|^[\\w\\W]*%>/g);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*/g);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/);\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/);\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\nconst ELEMENT_MARKUP_PROBE = seal(/<[/\\w!]/g);\nconst COMMENT_MARKUP_PROBE = seal(/<[/\\w]/g);\nconst FALLBACK_TAG_CLOSE = seal(/<\\/no(script|embed|frames)/i);\nconst SELF_CLOSING_TAG = seal(/\\/>/i);\nconst NODE_TYPE = {\n\telement: 1,\n\tattribute: 2,\n\ttext: 3,\n\tcdataSection: 4,\n\tentityReference: 5,\n\tentityNode: 6,\n\tprocessingInstruction: 7,\n\tcomment: 8,\n\tdocument: 9,\n\tdocumentType: 10,\n\tdocumentFragment: 11,\n\tnotation: 12\n};\nconst LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, [\n\t\"style\",\n\t\"script\",\n\t\"xmp\",\n\t\"iframe\",\n\t\"noembed\",\n\t\"noframes\",\n\t\"plaintext\",\n\t\"noscript\"\n]));\nconst getGlobal = function getGlobal() {\n\treturn typeof window === \"undefined\" ? null : window;\n};\n/**\n* Creates a no-op policy for internal use only.\n* Don't export this function outside this module!\n* @param trustedTypes The policy factory.\n* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n* @return The policy created (or null, if Trusted Types\n* are not supported or creating the policy failed).\n*/\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n\tif (typeof trustedTypes !== \"object\" || typeof trustedTypes.createPolicy !== \"function\") return null;\n\tlet suffix = null;\n\tconst ATTR_NAME = \"data-tt-policy-suffix\";\n\tif (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);\n\tconst policyName = \"dompurify\" + (suffix ? \"#\" + suffix : \"\");\n\ttry {\n\t\treturn trustedTypes.createPolicy(policyName, {\n\t\t\tcreateHTML(html) {\n\t\t\t\treturn html;\n\t\t\t},\n\t\t\tcreateScriptURL(scriptUrl) {\n\t\t\t\treturn scriptUrl;\n\t\t\t}\n\t\t});\n\t} catch (_) {\n\t\tconsole.warn(\"TrustedTypes policy \" + policyName + \" could not be created.\");\n\t\treturn null;\n\t}\n};\nconst _createHooksMap = function _createHooksMap() {\n\treturn {\n\t\tafterSanitizeAttributes: [],\n\t\tafterSanitizeElements: [],\n\t\tafterSanitizeShadowDOM: [],\n\t\tbeforeSanitizeAttributes: [],\n\t\tbeforeSanitizeElements: [],\n\t\tbeforeSanitizeShadowDOM: [],\n\t\tuponSanitizeAttribute: [],\n\t\tuponSanitizeElement: [],\n\t\tuponSanitizeShadowNode: []\n\t};\n};\n/**\n* Resolve a set-valued configuration option: a fresh set built from\n* cfg[key] when it is an own array property (seeded with a clone of\n* options.base when given, case-normalized via options.transform),\n* the fallback set otherwise.\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param fallback the set to use when the option is absent or not an array\n* @param options transform and optional base set to merge into\n* @returns the resolved set\n*/\nconst _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {\n\treturn objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;\n};\n/**\n* Resolve an object-valued configuration option: a prototype-free clone\n* of cfg[key] when it is an own, truthy object property, else a fresh\n* fallback built by makeFallback (fresh on every parse, so a previous\n* parse can never leak state into the next one).\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param makeFallback builds the fallback value when the option is absent\n* @returns the resolved object\n*/\nconst _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback) {\n\tconst value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;\n\treturn value && typeof value === \"object\" ? clone(value) : makeFallback();\n};\nfunction createDOMPurify() {\n\tlet window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();\n\tconst DOMPurify = (root) => createDOMPurify(root);\n\tDOMPurify.version = \"3.4.17\";\n\tDOMPurify.removed = [];\n\tif (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n\t\tDOMPurify.isSupported = false;\n\t\treturn DOMPurify;\n\t}\n\tlet document = window.document;\n\tconst originalDocument = document;\n\tconst currentScript = originalDocument.currentScript;\n\twindow.DocumentFragment;\n\tconst HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter;\n\twindow.NamedNodeMap === void 0 && (window.NamedNodeMap || window.MozNamedAttrMap);\n\twindow.HTMLFormElement;\n\tconst DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;\n\tconst ElementPrototype = Element.prototype;\n\tconst cloneNode = lookupGetter(ElementPrototype, \"cloneNode\");\n\tconst remove = lookupGetter(ElementPrototype, \"remove\");\n\tconst removeAttributeNode = lookupGetter(ElementPrototype, \"removeAttributeNode\");\n\tconst getNextSibling = lookupGetter(ElementPrototype, \"nextSibling\");\n\tconst getChildNodes = lookupGetter(ElementPrototype, \"childNodes\");\n\tconst getParentNode = lookupGetter(ElementPrototype, \"parentNode\");\n\tconst getShadowRoot = lookupGetter(ElementPrototype, \"shadowRoot\");\n\tconst getAttributes = lookupGetter(ElementPrototype, \"attributes\");\n\tconst getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeType\") : null;\n\tconst getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeName\") : null;\n\tconst getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, \"ownerDocument\") : null;\n\tconst _readNodeType = function _readNodeType(node) {\n\t\treturn getNodeType ? getNodeType(node) : node.nodeType;\n\t};\n\tconst _readNodeName = function _readNodeName(node) {\n\t\treturn getNodeName ? getNodeName(node) : node.nodeName;\n\t};\n\tconst getNamespaceURI = lookupAccessor(ElementPrototype, \"namespaceURI\");\n\tconst _readNamespaceURI = function _readNamespaceURI(element) {\n\t\treturn getNamespaceURI ? getNamespaceURI(element) : element.namespaceURI;\n\t};\n\tif (typeof HTMLTemplateElement === \"function\") {\n\t\tconst template = document.createElement(\"template\");\n\t\tif (template.content && template.content.ownerDocument) document = template.content.ownerDocument;\n\t}\n\tlet trustedTypesPolicy;\n\tlet emptyHTML = \"\";\n\tlet defaultTrustedTypesPolicy;\n\tlet defaultTrustedTypesPolicyResolved = false;\n\tlet IN_TRUSTED_TYPES_POLICY = 0;\n\tconst _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {\n\t\tif (IN_TRUSTED_TYPES_POLICY > 0) throw typeErrorCreate(\"A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \\\"DOMPurify and Trusted Types\\\" section of the README.\");\n\t};\n\tconst _createTrustedHTML = function _createTrustedHTML(html) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createHTML(html);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createScriptURL(scriptUrl);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {\n\t\tif (!defaultTrustedTypesPolicyResolved) {\n\t\t\tdefaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n\t\t\tdefaultTrustedTypesPolicyResolved = true;\n\t\t}\n\t\treturn defaultTrustedTypesPolicy;\n\t};\n\tconst _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;\n\tconst importNode = originalDocument.importNode;\n\tlet hooks = _createHooksMap();\n\t/**\n\t* Expose whether this browser supports running the full DOMPurify.\n\t*/\n\tDOMPurify.isSupported = typeof entries === \"function\" && typeof getParentNode === \"function\" && implementation && implementation.createHTMLDocument !== void 0;\n\tconst MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;\n\tlet IS_ALLOWED_URI$1 = IS_ALLOWED_URI;\n\t/**\n\t* We consider the elements and attributes below to be safe. Ideally\n\t* don't add any new ones but feel free to remove unwanted ones.\n\t*/\n\tlet ALLOWED_TAGS = null;\n\tconst DEFAULT_ALLOWED_TAGS = addToSet({}, [\n\t\t...html$1,\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...mathMl$1,\n\t\t...text\n\t]);\n\tlet ALLOWED_ATTR = null;\n\tconst DEFAULT_ALLOWED_ATTR = addToSet({}, [\n\t\t...html,\n\t\t...svg,\n\t\t...mathMl,\n\t\t...xml\n\t]);\n\tlet CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tallowCustomizedBuiltInElements: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: false\n\t\t}\n\t}));\n\tlet FORBID_TAGS = null;\n\tlet FORBID_ATTR = null;\n\tconst EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t}\n\t}));\n\tlet ALLOW_ARIA_ATTR = true;\n\tlet ALLOW_DATA_ATTR = true;\n\tlet ALLOW_UNKNOWN_PROTOCOLS = false;\n\tlet ALLOW_SELF_CLOSE_IN_ATTR = true;\n\tlet SAFE_FOR_TEMPLATES = false;\n\tlet SAFE_FOR_XML = true;\n\tlet WHOLE_DOCUMENT = false;\n\tlet SET_CONFIG = false;\n\tlet SET_CONFIG_ALLOWED_TAGS = null;\n\tlet SET_CONFIG_ALLOWED_ATTR = null;\n\tlet FORCE_BODY = false;\n\tlet RETURN_DOM = false;\n\tlet RETURN_DOM_FRAGMENT = false;\n\tlet RETURN_TRUSTED_TYPE = false;\n\tlet SANITIZE_DOM = true;\n\tlet SANITIZE_NAMED_PROPS = false;\n\tconst SANITIZE_NAMED_PROPS_PREFIX = \"user-content-\";\n\tlet KEEP_CONTENT = true;\n\tlet IN_PLACE = false;\n\tlet IN_PLACE_VISITED = null;\n\tlet USE_PROFILES = {};\n\tlet FORBID_CONTENTS = null;\n\tconst DEFAULT_FORBID_CONTENTS = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"audio\",\n\t\t\"colgroup\",\n\t\t\"desc\",\n\t\t\"foreignobject\",\n\t\t\"head\",\n\t\t\"iframe\",\n\t\t\"math\",\n\t\t\"mi\",\n\t\t\"mn\",\n\t\t\"mo\",\n\t\t\"ms\",\n\t\t\"mtext\",\n\t\t\"noembed\",\n\t\t\"noframes\",\n\t\t\"noscript\",\n\t\t\"plaintext\",\n\t\t\"script\",\n\t\t\"selectedcontent\",\n\t\t\"style\",\n\t\t\"svg\",\n\t\t\"template\",\n\t\t\"thead\",\n\t\t\"title\",\n\t\t\"video\",\n\t\t\"xmp\"\n\t]);\n\tlet DATA_URI_TAGS = null;\n\tconst DEFAULT_DATA_URI_TAGS = addToSet({}, [\n\t\t\"audio\",\n\t\t\"video\",\n\t\t\"img\",\n\t\t\"source\",\n\t\t\"image\",\n\t\t\"track\"\n\t]);\n\tlet URI_SAFE_ATTRIBUTES = null;\n\tconst DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n\t\t\"alt\",\n\t\t\"class\",\n\t\t\"for\",\n\t\t\"id\",\n\t\t\"label\",\n\t\t\"name\",\n\t\t\"pattern\",\n\t\t\"placeholder\",\n\t\t\"role\",\n\t\t\"summary\",\n\t\t\"title\",\n\t\t\"value\",\n\t\t\"style\",\n\t\t\"xmlns\"\n\t]);\n\tconst MATHML_NAMESPACE = \"http://www.w3.org/1998/Math/MathML\";\n\tconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\n\tconst HTML_NAMESPACE = \"http://www.w3.org/1999/xhtml\";\n\tlet NAMESPACE = HTML_NAMESPACE;\n\tlet IS_EMPTY_INPUT = false;\n\tlet ALLOWED_NAMESPACES = null;\n\tconst DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [\n\t\tMATHML_NAMESPACE,\n\t\tSVG_NAMESPACE,\n\t\tHTML_NAMESPACE\n\t], stringToString);\n\tconst DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([\n\t\t\"mi\",\n\t\t\"mo\",\n\t\t\"mn\",\n\t\t\"ms\",\n\t\t\"mtext\"\n\t]);\n\tlet MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);\n\tconst DEFAULT_HTML_INTEGRATION_POINTS = freeze([\"annotation-xml\"]);\n\tlet HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);\n\tconst COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n\t\t\"title\",\n\t\t\"style\",\n\t\t\"font\",\n\t\t\"a\",\n\t\t\"script\"\n\t]);\n\tlet PARSER_MEDIA_TYPE = null;\n\tconst SUPPORTED_PARSER_MEDIA_TYPES = [\"application/xhtml+xml\", \"text/html\"];\n\tconst DEFAULT_PARSER_MEDIA_TYPE = \"text/html\";\n\tlet transformCaseFunc = null;\n\tlet CONFIG = null;\n\tconst formElement = document.createElement(\"form\");\n\tconst isRegexOrFunction = function isRegexOrFunction(testValue) {\n\t\treturn testValue instanceof RegExp || testValue instanceof Function;\n\t};\n\t/**\n\t* _parseConfig\n\t*\n\t* @param cfg optional config literal\n\t*/\n\tconst _parseConfig = function _parseConfig() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\tif (CONFIG && CONFIG === cfg) return;\n\t\tif (!cfg || typeof cfg !== \"object\") cfg = {};\n\t\tcfg = clone(cfg);\n\t\tPARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\t\ttransformCaseFunc = PARSER_MEDIA_TYPE === \"application/xhtml+xml\" ? stringToString : stringToLowerCase;\n\t\tALLOWED_TAGS = _resolveSetOption(cfg, \"ALLOWED_TAGS\", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });\n\t\tALLOWED_ATTR = _resolveSetOption(cfg, \"ALLOWED_ATTR\", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });\n\t\tALLOWED_NAMESPACES = _resolveSetOption(cfg, \"ALLOWED_NAMESPACES\", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });\n\t\tURI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, \"ADD_URI_SAFE_ATTR\", DEFAULT_URI_SAFE_ATTRIBUTES, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_URI_SAFE_ATTRIBUTES\n\t\t});\n\t\tDATA_URI_TAGS = _resolveSetOption(cfg, \"ADD_DATA_URI_TAGS\", DEFAULT_DATA_URI_TAGS, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_DATA_URI_TAGS\n\t\t});\n\t\tFORBID_CONTENTS = _resolveSetOption(cfg, \"FORBID_CONTENTS\", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });\n\t\tFORBID_TAGS = _resolveSetOption(cfg, \"FORBID_TAGS\", clone({}), { transform: transformCaseFunc });\n\t\tFORBID_ATTR = _resolveSetOption(cfg, \"FORBID_ATTR\", clone({}), { transform: transformCaseFunc });\n\t\tUSE_PROFILES = objectHasOwnProperty(cfg, \"USE_PROFILES\") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === \"object\" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;\n\t\tALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;\n\t\tALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;\n\t\tALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;\n\t\tALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;\n\t\tSAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;\n\t\tSAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;\n\t\tWHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;\n\t\tRETURN_DOM = cfg.RETURN_DOM || false;\n\t\tRETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;\n\t\tRETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;\n\t\tFORCE_BODY = cfg.FORCE_BODY || false;\n\t\tSANITIZE_DOM = cfg.SANITIZE_DOM !== false;\n\t\tSANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;\n\t\tKEEP_CONTENT = cfg.KEEP_CONTENT !== false;\n\t\tIN_PLACE = cfg.IN_PLACE || false;\n\t\tIS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;\n\t\tNAMESPACE = typeof cfg.NAMESPACE === \"string\" ? cfg.NAMESPACE : HTML_NAMESPACE;\n\t\tMATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"MATHML_TEXT_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));\n\t\tHTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"HTML_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS));\n\t\tconst customElementHandling = _resolveObjectOption(cfg, \"CUSTOM_ELEMENT_HANDLING\", () => create(null));\n\t\tCUSTOM_ELEMENT_HANDLING = create(null);\n\t\tif (objectHasOwnProperty(customElementHandling, \"tagNameCheck\") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"attributeNameCheck\") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"allowCustomizedBuiltInElements\") && typeof customElementHandling.allowCustomizedBuiltInElements === \"boolean\") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;\n\t\tseal(CUSTOM_ELEMENT_HANDLING);\n\t\tif (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;\n\t\tif (RETURN_DOM_FRAGMENT) RETURN_DOM = true;\n\t\tif (USE_PROFILES) {\n\t\t\tALLOWED_TAGS = addToSet({}, text);\n\t\t\tALLOWED_ATTR = create(null);\n\t\t\tif (USE_PROFILES.html === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, html$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, html);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svg === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svg$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svgFilters === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svgFilters);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.mathMl === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, mathMl$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, mathMl);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t}\n\t\tEXTRA_ELEMENT_HANDLING.tagCheck = null;\n\t\tEXTRA_ELEMENT_HANDLING.attributeCheck = null;\n\t\tif (objectHasOwnProperty(cfg, \"ADD_TAGS\")) {\n\t\t\tif (typeof cfg.ADD_TAGS === \"function\") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n\t\t\telse if (arrayIsArray(cfg.ADD_TAGS)) {\n\t\t\t\tif (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\t\t\taddToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_ATTR\")) {\n\t\t\tif (typeof cfg.ADD_ATTR === \"function\") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n\t\t\telse if (arrayIsArray(cfg.ADD_ATTR)) {\n\t\t\t\tif (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\t\t\taddToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_FORBID_CONTENTS\") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {\n\t\t\tif (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);\n\t\t\taddToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n\t\t}\n\t\tif (KEEP_CONTENT) ALLOWED_TAGS[\"#text\"] = true;\n\t\tif (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [\n\t\t\t\"html\",\n\t\t\t\"head\",\n\t\t\t\"body\"\n\t\t]);\n\t\tif (ALLOWED_TAGS.table) {\n\t\t\taddToSet(ALLOWED_TAGS, [\"tbody\"]);\n\t\t\tdelete FORBID_TAGS.tbody;\n\t\t}\n\t\tif (cfg.TRUSTED_TYPES_POLICY) {\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createHTML\\\" hook.\");\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createScriptURL\\\" hook.\");\n\t\t\tconst previousTrustedTypesPolicy = trustedTypesPolicy;\n\t\t\ttrustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\t\t\ttry {\n\t\t\t\temptyHTML = _createTrustedHTML(\"\");\n\t\t\t} catch (error) {\n\t\t\t\ttrustedTypesPolicy = previousTrustedTypesPolicy;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t} else if (cfg.TRUSTED_TYPES_POLICY === null) {\n\t\t\ttrustedTypesPolicy = void 0;\n\t\t\temptyHTML = \"\";\n\t\t} else {\n\t\t\tif (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();\n\t\t\tif (trustedTypesPolicy && typeof emptyHTML === \"string\") emptyHTML = _createTrustedHTML(\"\");\n\t\t}\n\t\tif (freeze) freeze(cfg);\n\t\tCONFIG = cfg;\n\t};\n\tconst ALL_SVG_TAGS = addToSet({}, [\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...svgDisallowed\n\t]);\n\tconst ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\t/**\n\t* Namespace rules for an element in the SVG namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"svg\";\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE) return tagName === \"svg\" && (parentTagName === \"annotation-xml\" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n\t\treturn Boolean(ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the MathML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"math\";\n\t\tif (parent.namespaceURI === SVG_NAMESPACE) return tagName === \"math\" && HTML_INTEGRATION_POINTS[parentTagName];\n\t\treturn Boolean(ALL_MATHML_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the HTML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;\n\t\treturn !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* @param element a DOM element whose namespace is being checked\n\t* @returns Return false if the element has a\n\t* namespace that a spec-compliant parser would never\n\t* return. Return true otherwise.\n\t*/\n\tconst _checkValidNamespace = function _checkValidNamespace(element) {\n\t\tconst elementNamespace = _readNamespaceURI(element);\n\t\tconst tagName = stringToLowerCase(_readNodeName(element));\n\t\tconst parentNode = getParentNode(element);\n\t\tlet parent;\n\t\tlet parentTagName;\n\t\tif (parentNode && _readNodeType(parentNode) === NODE_TYPE.element) {\n\t\t\tparent = { namespaceURI: _readNamespaceURI(parentNode) };\n\t\t\tparentTagName = stringToLowerCase(_readNodeName(parentNode));\n\t\t} else {\n\t\t\tparent = { namespaceURI: NAMESPACE };\n\t\t\tparentTagName = \"template\";\n\t\t}\n\t\tif (!ALLOWED_NAMESPACES[elementNamespace]) return false;\n\t\tif (elementNamespace === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);\n\t\tif (elementNamespace === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);\n\t\tif (elementNamespace === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && ALLOWED_NAMESPACES[elementNamespace]) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* _forceRemove\n\t*\n\t* @param node a DOM node\n\t*/\n\tconst _forceRemove = function _forceRemove(node) {\n\t\tarrayPush(DOMPurify.removed, { element: node });\n\t\ttry {\n\t\t\tgetParentNode(node).removeChild(node);\n\t\t} catch (_) {\n\t\t\tremove(node);\n\t\t\tif (!getParentNode(node)) throw typeErrorCreate(\"a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place\");\n\t\t}\n\t};\n\t/**\n\t* _stripAttributeNode\n\t*\n\t* Remove a single Attr node case/namespace-exactly on an attribute-teardown\n\t* path. Name-based removeAttribute() ASCII-lowercases its lookup key for an\n\t* HTML element in an HTML document and so silently misses a case-preserved\n\t* handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect\n\t* _removeAttribute() was fixed for, which a name-based call would reintroduce\n\t* on these IN_PLACE teardown paths. Unlike _removeAttribute this does not\n\t* record into DOMPurify.removed: the neutralize passes intentionally do not\n\t* book-keep. A clobbered/detached node falls back to best-effort name-based\n\t* removal.\n\t*\n\t* @param element the element to strip the attribute from\n\t* @param attribute the Attr node to remove\n\t* @param name the attribute's name, for the fallback path\n\t*/\n\tconst _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {\n\t\ttry {\n\t\t\tremoveAttributeNode(element, attribute);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* Fail-closed teardown of an in-place root: strip every disallowed attribute\n\t* in the subtree first, so nothing armed is left behind, then remove all\n\t* children and the root's own attributes.\n\t*\n\t* @param root the in-place root to empty\n\t*/\n\tconst _neutralizeRoot = function _neutralizeRoot(root) {\n\t\t_neutralizeSubtree(root);\n\t\tconst childNodes = getChildNodes(root);\n\t\tif (childNodes) arrayForEach(arraySlice(childNodes), (child) => {\n\t\t\ttry {\n\t\t\t\tremove(child);\n\t\t\t} catch (_) {}\n\t\t});\n\t\tconst attributes = _readNodeType(root) === NODE_TYPE.element ? getAttributes(root) : null;\n\t\tif (attributes) for (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name === \"string\") _stripAttributeNode(root, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* Removes an attribute, preferably as its exact Attr node: name-based\n\t* removal lowercases the name in HTML documents and misses case-preserved\n\t* names, e.g. from imported XHTML.\n\t*\n\t* @param name an Attribute name\n\t* @param element a DOM node\n\t* @param attr the exact Attr node to remove, when the caller has it\n\t*/\n\tconst _removeAttribute = function _removeAttribute(name, element, attr) {\n\t\tif (!attr) try {\n\t\t\tattr = element.getAttributeNode(name);\n\t\t} catch (_) {\n\t\t\tattr = null;\n\t\t}\n\t\tarrayPush(DOMPurify.removed, {\n\t\t\tattribute: attr || null,\n\t\t\tfrom: element\n\t\t});\n\t\ttry {\n\t\t\tif (attr) removeAttributeNode(element, attr);\n\t\t\telse element.removeAttribute(name);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t\tif (name === \"is\") {\n\t\t\tif (RETURN_DOM || RETURN_DOM_FRAGMENT) try {\n\t\t\t\t_forceRemove(element);\n\t\t\t} catch (_) {}\n\t\t\telse try {\n\t\t\t\telement.setAttribute(name, \"\");\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* Removes every attribute the configuration does not allow. Used to\n\t* neutralize nodes discarded from an in-place tree.\n\t*\n\t* @param element the element to strip\n\t*/\n\tconst _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {\n\t\tconst attributes = getAttributes(element);\n\t\tif (!attributes) return;\n\t\tfor (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name !== \"string\" || ALLOWED_ATTR[transformCaseFunc(name)]) continue;\n\t\t\t_stripAttributeNode(element, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* Iterative depth-first walk, so deep trees cannot overflow the call stack,\n\t* reading through the cached getters, so clobbering cannot hide children.\n\t* When `visit` returns false, the node's children are skipped. With\n\t* `intoShadow`, open shadow roots are walked after their host's children.\n\t*\n\t* @param root where to start\n\t* @param visit called for every node\n\t* @param intoShadow whether to enter open shadow roots\n\t*/\n\tconst _walkTree = function _walkTree(root, visit) {\n\t\tlet intoShadow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\t\tconst stack = [root];\n\t\twhile (stack.length > 0) {\n\t\t\tconst node = stack.pop();\n\t\t\tif (visit(node) === false) continue;\n\t\t\tif (intoShadow && _readNodeType(node) === NODE_TYPE.element) {\n\t\t\t\tconst shadowRoot = getShadowRoot(node);\n\t\t\t\tif (_isDocumentFragment(shadowRoot)) stack.push(shadowRoot);\n\t\t\t}\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);\n\t\t}\n\t};\n\t/**\n\t* Strips disallowed attributes from every element of a discarded subtree,\n\t* so a handler that is already queued (a loading image) cannot fire.\n\t*\n\t* @param root the root of a removed subtree\n\t*/\n\tconst _neutralizeSubtree = function _neutralizeSubtree(root) {\n\t\t_walkTree(root, (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);\n\t\t});\n\t};\n\t/**\n\t* All nodes under `root`, root first, including open shadow roots. Template\n\t* content is not entered, it is inert.\n\t*\n\t* @param root the in-place root\n\t* @return the nodes\n\t*/\n\tconst _collectLiveNodes = function _collectLiveNodes(root) {\n\t\tconst nodes = [];\n\t\t_walkTree(root, (node) => {\n\t\t\tnodes.push(node);\n\t\t}, true);\n\t\treturn nodes;\n\t};\n\t/**\n\t* Strips disallowed attributes from every element that was under the\n\t* in-place root when the call started and no longer is, whatever removed\n\t* or moved it.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t*/\n\tconst _neutralizeEscapedElements = function _neutralizeEscapedElements(root, before) {\n\t\tconst reachable = setCreate();\n\t\tarrayForEach(_collectLiveNodes(root), (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element) setAdd(reachable, node);\n\t\t});\n\t\tarrayForEach(before, (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element && !setHas(reachable, node)) _stripDisallowedAttributes(node);\n\t\t});\n\t};\n\t/**\n\t* Neutralizes everything that left the in-place tree during the call: what\n\t* DOMPurify removed, and what hooks or custom elements removed or moved out.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t* @return true if the root itself was removed\n\t*/\n\tconst _neutralizeDiscarded = function _neutralizeDiscarded(root, before) {\n\t\tlet rootRemoved = false;\n\t\tarrayForEach(DOMPurify.removed, (entry) => {\n\t\t\tif (entry.element) {\n\t\t\t\trootRemoved = rootRemoved || entry.element === root;\n\t\t\t\t_neutralizeSubtree(entry.element);\n\t\t\t}\n\t\t});\n\t\t_neutralizeEscapedElements(root, before);\n\t\treturn rootRemoved;\n\t};\n\tconst MAX_UNVISITED_ROUNDS = 8;\n\t/**\n\t* The walk only moves forward, so a node moved to a position it already\n\t* passed is never visited. Give every original node that is still in the\n\t* tree but unvisited the normal treatment, hooks included. Nodes created\n\t* during the call are left alone. Fails closed if the tree keeps changing.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t*/\n\tconst _sanitizeUnvisitedNodes = function _sanitizeUnvisitedNodes(root, before) {\n\t\tconst visited = IN_PLACE_VISITED;\n\t\tlet original = null;\n\t\tconst getOriginal = () => {\n\t\t\tif (!original) {\n\t\t\t\toriginal = setCreate();\n\t\t\t\tarrayForEach(before, (beforeNode) => {\n\t\t\t\t\tsetAdd(original, beforeNode);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn original;\n\t\t};\n\t\tfor (let round = 0;; round++) {\n\t\t\tconst live = _collectLiveNodes(root);\n\t\t\tconst containers = [root];\n\t\t\tlet pending = false;\n\t\t\tarrayForEach(live, (node) => {\n\t\t\t\tif (_readNodeType(node) === NODE_TYPE.documentFragment) arrayPush(containers, node);\n\t\t\t\telse if (!pending && !setHas(visited, node)) pending = setHas(getOriginal(), node);\n\t\t\t});\n\t\t\tif (!pending) return;\n\t\t\tif (round >= MAX_UNVISITED_ROUNDS) throw typeErrorCreate(\"the tree kept changing during in-place sanitization; refusing to return it\");\n\t\t\tarrayForEach(containers, (container, index) => {\n\t\t\t\t_sanitizeUnvisitedIn(container, index > 0, root, getOriginal());\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* One _sanitizeUnvisitedNodes pass over the root or an open shadow root.\n\t*\n\t* @param container the root or an open shadow root\n\t* @param inShadow whether container is a shadow root\n\t* @param root the in-place root\n\t* @param original the root's nodes collected before the walk, as a set\n\t*/\n\tconst _sanitizeUnvisitedIn = function _sanitizeUnvisitedIn(container, inShadow, root, original) {\n\t\tconst iterator = _createNodeIterator(container);\n\t\tlet node;\n\t\twhile (node = iterator.nextNode()) {\n\t\t\tif (!setHas(original, node) || setHas(IN_PLACE_VISITED, node)) continue;\n\t\t\tif (inShadow) _executeHooks(hooks.uponSanitizeShadowNode, node, null);\n\t\t\t_sanitizeElements(node, root);\n\t\t\t_sanitizeAttributes(node, root);\n\t\t\tif (_isDocumentFragment(node.content)) _sanitizeShadowDOM2(node.content);\n\t\t}\n\t};\n\t/**\n\t* Records that _sanitizeElements processed `node`. No-op outside IN_PLACE.\n\t*\n\t* @param node the node being processed\n\t*/\n\tconst _markVisited = function _markVisited(node) {\n\t\tif (IN_PLACE_VISITED) setAdd(IN_PLACE_VISITED, node);\n\t};\n\t/**\n\t* Patch-linkage attributes (declarative partial updates): `patchsrc`\n\t* always, `for` everywhere except on <label> and <output>. Gated on\n\t* SAFE_FOR_XML. Shared by the IN_PLACE pre-pass and _isValidAttribute.\n\t*\n\t* @param lcName the transformCaseFunc'd attribute name\n\t* @param lcTag the transformCaseFunc'd tag name of the carrying element\n\t* @return true if the attribute is patch linkage and must be dropped\n\t*/\n\tconst _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {\n\t\tif (!SAFE_FOR_XML) return false;\n\t\tif (lcName === \"patchsrc\") return true;\n\t\treturn lcName === \"for\" && lcTag !== \"label\" && lcTag !== \"output\";\n\t};\n\t/**\n\t* IN_PLACE pre-pass: sever all patch linkage before the walk, so no patch\n\t* can fire mid-walk into a part of the tree the walker already passed.\n\t* Removes range markers (processing instructions, comments with markup)\n\t* and strips linkage attributes. It cannot undo a patch that already fired.\n\t*\n\t* TODO: if the shipped feature can patch through `for` on <label>/<output>,\n\t* drop that pair here too (see test/declarative-patch-probe.html).\n\t*\n\t* @param root the in-place root to sweep\n\t*/\n\tconst _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {\n\t\tif (!SAFE_FOR_XML) return;\n\t\t_walkTree(root, (node) => {\n\t\t\tconst nodeType = _readNodeType(node);\n\t\t\tif (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {\n\t\t\t\ttry {\n\t\t\t\t\tremove(node);\n\t\t\t\t} catch (_) {}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (nodeType === NODE_TYPE.element) {\n\t\t\t\tconst element = node;\n\t\t\t\tconst lcTag = transformCaseFunc(_readNodeName(node));\n\t\t\t\ttry {\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"patchsrc\")) element.removeAttribute(\"patchsrc\");\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"for\") && _isPatchLinkageAttribute(\"for\", lcTag)) element.removeAttribute(\"for\");\n\t\t\t\t} catch (_) {}\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* _initDocument\n\t*\n\t* @param dirty - a string of dirty markup\n\t* @return a DOM, filled with the dirty markup\n\t*/\n\tconst _initDocument = function _initDocument(dirty) {\n\t\tlet doc = null;\n\t\tlet leadingWhitespace = null;\n\t\tif (FORCE_BODY) dirty = \"<remove></remove>\" + dirty;\n\t\telse {\n\t\t\tconst matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n\t\t\tleadingWhitespace = matches && matches[0];\n\t\t}\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && NAMESPACE === HTML_NAMESPACE) dirty = \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\"><head></head><body>\" + dirty + \"</body></html>\";\n\t\tconst dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;\n\t\tif (NAMESPACE === HTML_NAMESPACE) try {\n\t\t\tdoc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n\t\t} catch (_) {}\n\t\tif (!doc || !doc.documentElement) {\n\t\t\tdoc = implementation.createDocument(NAMESPACE, \"template\", null);\n\t\t\ttry {\n\t\t\t\tdoc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n\t\t\t} catch (_) {}\n\t\t}\n\t\tconst body = doc.body || doc.documentElement;\n\t\tif (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n\t\tif (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? \"html\" : \"body\")[0];\n\t\treturn WHOLE_DOCUMENT ? doc.documentElement : body;\n\t};\n\t/**\n\t* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n\t*\n\t* @param root The root element or node to start traversing on.\n\t* @return The created NodeIterator\n\t*/\n\tconst _createNodeIterator = function _createNodeIterator(root) {\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;\n\t\treturn createNodeIterator.call(doc || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n\t};\n\t/**\n\t* Replace template expression syntax (mustache, ERB, template\n\t* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub\n\t* sites. Order matters: mustache, then ERB, then template literal.\n\t*\n\t* @param value the string to scrub\n\t* @returns the scrubbed string\n\t*/\n\tconst _stripTemplateExpressions = function _stripTemplateExpressions(value) {\n\t\tvalue = stringReplace(value, MUSTACHE_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, ERB_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, TMPLIT_EXPR$1, \" \");\n\t\treturn value;\n\t};\n\t/**\n\t* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the\n\t* character data of an element subtree. Used as the final safety net for\n\t* SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions\n\t* which only form after text-node normalization (e.g. fragments split across\n\t* stripped elements) cannot survive into a template-evaluating framework.\n\t*\n\t* Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`\n\t* in place rather than round-tripping through innerHTML. This preserves\n\t* descendant node references (important for IN_PLACE callers), avoids a\n\t* serialize/reparse cycle, and reads literal character data — which means\n\t* `<%...%>` in text content matches the ERB regex against its real bytes\n\t* instead of the HTML-entity-escaped form innerHTML would produce.\n\t*\n\t* Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for\n\t* attributes is performed during the per-node `_sanitizeAttributes` pass.\n\t*\n\t* @param node The root element whose character data should be scrubbed.\n\t*/\n\tconst _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {\n\t\tvar _node$querySelectorAl;\n\t\t_scrubOwnCharacterData(node);\n\t\tconst templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, \"template\");\n\t\tif (templates) arrayForEach(templates, (tmpl) => {\n\t\t\tif (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);\n\t\t});\n\t};\n\t/**\n\t* _scrubOwnCharacterData\n\t*\n\t* Non-recursive core of _scrubTemplateExpressions: normalize `node` and\n\t* strip template expressions from its own character data only. Does not\n\t* enter <template>.content or attached shadow roots (NodeIterator never\n\t* does). Used by _sanitizeShadowDOM, where every nested template content\n\t* and shadow root is already walked - and therefore scrubbed - by its own\n\t* recursive _sanitizeShadowDOM call; recursing here as well would rescrub\n\t* each nested fragment once per ancestor, which is quadratic in nesting\n\t* depth.\n\t*\n\t* @param node The root whose own character data should be scrubbed.\n\t*/\n\tconst _scrubOwnCharacterData = function _scrubOwnCharacterData(node) {\n\t\tnode.normalize();\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;\n\t\tconst walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);\n\t\tlet currentNode = walker.nextNode();\n\t\twhile (currentNode) {\n\t\t\tcurrentNode.data = _stripTemplateExpressions(currentNode.data);\n\t\t\tcurrentNode = walker.nextNode();\n\t\t}\n\t};\n\t/**\n\t* _isClobbered\n\t*\n\t* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML\n\t* interface with [LegacyOverrideBuiltIns]; a descendant element with a\n\t* `name` attribute matching a prototype property shadows that property\n\t* on direct reads. We use this check at the IN_PLACE entry-point and\n\t* during attribute sanitization to refuse clobbered forms.\n\t*\n\t* @param element element to check for clobbering attacks\n\t* @return true if clobbered, false if safe\n\t*/\n\tconst _isClobbered = function _isClobbered(element) {\n\t\tconst realTagName = getNodeName ? getNodeName(element) : null;\n\t\tif (typeof realTagName !== \"string\") return false;\n\t\tif (transformCaseFunc(realTagName) !== \"form\") return false;\n\t\treturn typeof element.nodeName !== \"string\" || typeof element.textContent !== \"string\" || typeof element.removeChild !== \"function\" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== \"function\" || typeof element.removeAttributeNode !== \"function\" || typeof element.getAttributeNode !== \"function\" || typeof element.setAttribute !== \"function\" || typeof element.namespaceURI !== \"string\" || typeof element.insertBefore !== \"function\" || typeof element.hasChildNodes !== \"function\" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);\n\t};\n\t/**\n\t* Checks whether the given value is a DocumentFragment from any realm.\n\t*\n\t* The realm-independent replacement reads `nodeType` through the cached\n\t* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE\n\t* constant (11). nodeType is a numeric value resolved from the node's\n\t* internal slot, identical across realms for the same kind of node.\n\t*\n\t* @param value object to check\n\t* @return true if value is a DocumentFragment-shaped node from any realm\n\t*/\n\tconst _isDocumentFragment = function _isDocumentFragment(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn getNodeType(value) === NODE_TYPE.documentFragment;\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* Checks whether the given object is a DOM node, including nodes that\n\t* originate from a different window/realm (e.g. an iframe's\n\t* contentDocument). The previous `value instanceof Node` check was\n\t* realm-bound: nodes from a different window failed it, causing\n\t* sanitize() to silently stringify them and reset IN_PLACE to false,\n\t* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.\n\t*\n\t* @param value object to check whether it's a DOM node\n\t* @return true if value is a DOM node from any realm\n\t*/\n\tconst _isNode = function _isNode(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn typeof getNodeType(value) === \"number\";\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\tfunction _executeHooks(hooks, currentNode, data) {\n\t\tif (hooks.length === 0) return;\n\t\tarrayForEach(hooks, (hook) => {\n\t\t\thook.call(DOMPurify, currentNode, data, CONFIG);\n\t\t});\n\t}\n\t/**\n\t* Structural-threat checks that condemn a node regardless of the\n\t* allowlists: mXSS via namespace confusion, risky CSS construction,\n\t* processing instructions, markup-bearing comments. Pure predicate;\n\t* the caller removes. Check order is load-bearing.\n\t*\n\t* @param currentNode the node to inspect\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node must be removed\n\t*/\n\tconst _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {\n\t\tif (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;\n\t\tif (SAFE_FOR_XML && LITERAL_TEXT_ELEMENTS[tagName] && _readNodeType(currentNode) === NODE_TYPE.element && _readNamespaceURI(currentNode) === HTML_NAMESPACE && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === \"string\" && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent))) return true;\n\t\tif (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;\n\t\tif (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate\n\t* function, per the validation in _parseConfig) against a name.\n\t* Additional arguments are forwarded to predicate functions - the\n\t* attributeNameCheck predicate receives the tag name as its second\n\t* argument. A null/absent check never matches.\n\t*\n\t* @param check the configured tagNameCheck / attributeNameCheck value\n\t* @param name the name to test\n\t* @param args extra arguments forwarded to a predicate function\n\t* @return true if the check matches the name\n\t*/\n\tconst _matchesNameCheck = function _matchesNameCheck(check, name) {\n\t\tif (check instanceof RegExp) return regExpTest(check, name);\n\t\tif (check instanceof Function) {\n\t\t\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\t\t\treturn Boolean(check(name, ...args));\n\t\t}\n\t\treturn false;\n\t};\n\t/**\n\t* Handle a node whose tag is forbidden or not allowlisted: keep\n\t* allowed custom elements (false return exits _sanitizeElements\n\t* early - the namespace and fallback-tag removal checks are\n\t* intentionally skipped for kept custom elements), else hoist\n\t* content per KEEP_CONTENT and remove.\n\t*\n\t* A kept custom element is the ONLY case in which this function\n\t* returns false, so the caller uses that return value to run the\n\t* afterSanitizeElements hook on the kept element and keep the\n\t* element-hook lifecycle consistent with normal allowlisted\n\t* elements (GHSA-c2j3-45gr-mqc4).\n\t*\n\t* @param currentNode the disallowed node\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node was removed, false if kept\n\t*/\n\tconst _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {\n\t\tif (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;\n\t\tif (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && !FORBID_CONTENTS[stringToLowerCase(tagName)]) {\n\t\t\tconst parentNode = getParentNode(currentNode);\n\t\t\tconst childNodes = getChildNodes(currentNode);\n\t\t\tif (childNodes && parentNode) {\n\t\t\t\tconst childCount = childNodes.length;\n\t\t\t\tfor (let i = childCount - 1; i >= 0; --i) {\n\t\t\t\t\tconst hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];\n\t\t\t\t\tparentNode.insertBefore(hoisted, getNextSibling(currentNode));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_forceRemove(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* Fork a hook-mutable allowlist off its shared binding the first time a\n\t* (possibly lazily-installed) uponSanitize* hook is about to see it, so the\n\t* hook cannot widen the per-instance default or the setConfig binding by\n\t* reference and leak past the call. Returns the set unchanged once it is\n\t* already call-local, so repeated calls across elements are idempotent.\n\t*\n\t* @param hookList the uponSanitize* hook array for this event\n\t* @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding\n\t* @param defaultSet the per-instance DEFAULT_ALLOWED_* constant\n\t* @param setConfigSet the captured setConfig() binding, or null\n\t* @return a call-local clone if a hook is present and set is still shared,\n\t* else set unchanged\n\t*/\n\tconst _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {\n\t\tif (hookList.length === 0) return set;\n\t\treturn set === defaultSet || set === setConfigSet ? clone(set) : set;\n\t};\n\t/**\n\t* A hook may have detached the node it was called for. If so, treat it as\n\t* removed and stop processing it; the walk root is exempt. On the IN_PLACE\n\t* path the detached subtree is neutralized right away.\n\t*\n\t* @param currentNode the node a hook may have detached\n\t* @param root the current walk root\n\t* @return true if the node was detached\n\t*/\n\tconst _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {\n\t\tif (currentNode === root || getParentNode(currentNode) !== null) return false;\n\t\tif (IN_PLACE) _neutralizeSubtree(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* _sanitizeElements\n\t*\n\t* @protect nodeName\n\t* @protect textContent\n\t* @protect removeChild\n\t* @param currentNode to check for permission to exist\n\t* @return true if node was killed, false if left alive\n\t*/\n\tconst _sanitizeElements = function _sanitizeElements(currentNode, root) {\n\t\t_markVisited(currentNode);\n\t\t_executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isClobbered(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tconst tagName = transformCaseFunc(_readNodeName(currentNode));\n\t\tALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);\n\t\t_executeHooks(hooks.uponSanitizeElement, currentNode, {\n\t\t\ttagName,\n\t\t\tallowedTags: ALLOWED_TAGS\n\t\t});\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isUnsafeNode(currentNode, tagName)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {\n\t\t\tconst removed = _sanitizeDisallowedNode(currentNode, tagName, root);\n\t\t\tif (removed === false) {\n\t\t\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\t\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\t\t}\n\t\t\treturn removed;\n\t\t}\n\t\tif (_readNodeType(currentNode) === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif ((tagName === \"noscript\" || tagName === \"noembed\" || tagName === \"noframes\") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n\t\t\tconst content = _stripTemplateExpressions(currentNode.textContent);\n\t\t\tif (currentNode.textContent !== content) {\n\t\t\t\tarrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n\t\t\t\tcurrentNode.textContent = content;\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\treturn _handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _isValidAttribute\n\t*\n\t* @param lcTag Lowercase tag name of containing element.\n\t* @param lcName Lowercase attribute name.\n\t* @param value Attribute value.\n\t* @return Returns true if `value` is valid, otherwise false.\n\t*/\n\tconst _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n\t\tif (FORBID_ATTR[lcName]) return false;\n\t\tif (_isPatchLinkageAttribute(lcName, lcTag)) return false;\n\t\tif (SANITIZE_DOM && (lcName === \"id\" || lcName === \"name\") && (value in document || value in formElement)) return false;\n\t\tconst nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);\n\t\tif (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;\n\t\tif (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;\n\t\tif (!nameIsPermitted) return _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || lcName === \"is\" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value);\n\t\tif (URI_SAFE_ATTRIBUTES[lcName]) return true;\n\t\tif (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\tif ((lcName === \"src\" || lcName === \"xlink:href\" || lcName === \"href\") && lcTag !== \"script\" && stringIndexOf(value, \"data:\") === 0 && DATA_URI_TAGS[lcTag]) return true;\n\t\tif (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\treturn !value;\n\t};\n\tconst RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"color-profile\",\n\t\t\"font-face\",\n\t\t\"font-face-format\",\n\t\t\"font-face-name\",\n\t\t\"font-face-src\",\n\t\t\"font-face-uri\",\n\t\t\"missing-glyph\"\n\t]);\n\t/**\n\t* _isBasicCustomElement\n\t* checks if at least one dash is included in tagName, and it's not the first char\n\t* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n\t*\n\t* @param tagName name of the tag of the node to sanitize\n\t* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n\t*/\n\tconst _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n\t\treturn !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);\n\t};\n\t/**\n\t* Wrap an attribute value in the matching Trusted Types object when\n\t* the active policy requires it. Namespaced attributes pass through\n\t* unchanged (no TT support yet, see\n\t* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).\n\t*\n\t* @param lcTag lowercase tag name of the containing element\n\t* @param lcName lowercase attribute name\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the attribute value to wrap\n\t* @return the value, wrapped when Trusted Types demand it\n\t*/\n\tconst _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {\n\t\tif (trustedTypesPolicy && typeof trustedTypes === \"object\" && typeof trustedTypes.getAttributeType === \"function\" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n\t\t\tcase \"TrustedHTML\": return _createTrustedHTML(value);\n\t\t\tcase \"TrustedScriptURL\": return _createTrustedScriptURL(value);\n\t\t}\n\t\treturn value;\n\t};\n\t/**\n\t* Write a modified attribute value back onto the element. On\n\t* success, re-probe for clobbering introduced by the new value and\n\t* remove the element when found; otherwise, when this writeback is the\n\t* recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the\n\t* removal entry that path recorded so it does not show as removed. On\n\t* failure, remove the attribute instead.\n\t*\n\t* Returns true only on a clean write (the value was set and the new value\n\t* introduced no clobbering). The caller uses that, together with its own\n\t* knowledge of whether this attribute pushed a DOMPurify.removed record, to\n\t* decide whether to pop that record. The pop must happen ONLY for the\n\t* named-prop remove-and-recreate; popping on any other value change (trim,\n\t* template scrubbing, Trusted Types) would consume an unrelated _forceRemove\n\t* subtree-cleanup record and let that detached subtree keep a live event\n\t* handler through the IN_PLACE neutralization pass (SO-001).\n\t*\n\t* @param currentNode the element carrying the attribute\n\t* @param name the attribute name as present on the element\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the new attribute value\n\t* @return true if the value was written without introducing clobbering\n\t*/\n\tconst _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {\n\t\ttry {\n\t\t\tif (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);\n\t\t\telse currentNode.setAttribute(name, value);\n\t\t\tif (_isClobbered(currentNode)) {\n\t\t\t\t_forceRemove(currentNode);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (_) {\n\t\t\t_removeAttribute(name, currentNode);\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* _isUnsafeAttributeValue\n\t*\n\t* Value-based attribute checks that the attribute walk applies before any\n\t* hook can force-keep an attribute, shared with the public\n\t* isValidAttribute() so that it never approves a value sanitize() would\n\t* strip.\n\t*\n\t* @param name the attribute name as found on the node (case preserved)\n\t* @param value the attribute value\n\t* @returns true if the attribute must be removed because of its value\n\t*/\n\tconst _isUnsafeAttributeValue = function _isUnsafeAttributeValue(name, value) {\n\t\tif (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) return true;\n\t\treturn stringToLowerCase(name) === \"attributename\" && stringMatch(value, \"href\") !== null;\n\t};\n\t/**\n\t* _sanitizeAttributes\n\t*\n\t* @protect attributes\n\t* @protect nodeName\n\t* @protect removeAttribute\n\t* @protect setAttribute\n\t*\n\t* @param currentNode to sanitize\n\t* @param root the current walk root\n\t*/\n\tconst _sanitizeAttributes = function _sanitizeAttributes(currentNode, root) {\n\t\t_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return;\n\t\tconst attributes = currentNode.attributes;\n\t\tif (!attributes || _isClobbered(currentNode)) return;\n\t\tALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);\n\t\tconst hookEvent = {\n\t\t\tattrName: \"\",\n\t\t\tattrValue: \"\",\n\t\t\tkeepAttr: true,\n\t\t\tallowedAttributes: ALLOWED_ATTR,\n\t\t\tforceKeepAttr: void 0\n\t\t};\n\t\tlet l = attributes.length;\n\t\tconst lcTag = transformCaseFunc(currentNode.nodeName);\n\t\twhile (l--) {\n\t\t\tconst attr = attributes[l];\n\t\t\tconst name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;\n\t\t\tconst lcName = transformCaseFunc(name);\n\t\t\tconst initValue = attrValue;\n\t\t\tlet value = name === \"value\" ? initValue : stringTrim(initValue);\n\t\t\tlet recreatedNamedProp = false;\n\t\t\thookEvent.attrName = lcName;\n\t\t\thookEvent.attrValue = value;\n\t\t\thookEvent.keepAttr = true;\n\t\t\thookEvent.forceKeepAttr = void 0;\n\t\t\t_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n\t\t\tvalue = hookEvent.attrValue;\n\t\t\tif (SANITIZE_NAMED_PROPS && (lcName === \"id\" || lcName === \"name\") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tvalue = SANITIZE_NAMED_PROPS_PREFIX + value;\n\t\t\t\trecreatedNamedProp = true;\n\t\t\t}\n\t\t\tif (_isUnsafeAttributeValue(name, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hookEvent.forceKeepAttr) continue;\n\t\t\tif (!hookEvent.keepAttr) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (SAFE_FOR_TEMPLATES) value = _stripTemplateExpressions(value);\n\t\t\tif (!_isValidAttribute(lcTag, lcName, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvalue = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);\n\t\t\tif (value !== initValue) {\n\t\t\t\tif (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n\t\t_handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _sanitizeShadowDOM\n\t*\n\t* @param fragment to iterate over recursively\n\t*/\n\tconst _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {\n\t\tlet shadowNode = null;\n\t\tconst shadowIterator = _createNodeIterator(fragment);\n\t\t_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n\t\twhile (shadowNode = shadowIterator.nextNode()) {\n\t\t\t_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n\t\t\t_sanitizeElements(shadowNode, fragment);\n\t\t\t_sanitizeAttributes(shadowNode, fragment);\n\t\t\tif (_isDocumentFragment(shadowNode.content)) _sanitizeShadowDOM2(shadowNode.content);\n\t\t\tif (_readNodeType(shadowNode) === NODE_TYPE.element) {\n\t\t\t\tconst innerSr = getShadowRoot(shadowNode);\n\t\t\t\tif (_isDocumentFragment(innerSr)) {\n\t\t\t\t\t_sanitizeAttachedShadowRoots(innerSr);\n\t\t\t\t\t_sanitizeShadowDOM2(innerSr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (SAFE_FOR_TEMPLATES) _scrubOwnCharacterData(fragment);\n\t\t_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n\t};\n\t/**\n\t* Sanitizes every attached shadow root under `root`, since the node\n\t* iterator does not enter shadow trees. Needed for IN_PLACE input and for\n\t* DOM input whose clonable shadow roots were copied by importNode().\n\t*\n\t* @param root the subtree root to walk for attached shadow roots\n\t*/\n\tconst _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {\n\t\tconst stack = [{\n\t\t\tnode: root,\n\t\t\tshadow: null\n\t\t}];\n\t\twhile (stack.length > 0) {\n\t\t\tconst item = stack.pop();\n\t\t\tif (item.shadow) {\n\t\t\t\t_sanitizeShadowDOM2(item.shadow);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst node = item.node;\n\t\t\tconst isElement = _readNodeType(node) === NODE_TYPE.element;\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push({\n\t\t\t\tnode: childNodes[i],\n\t\t\t\tshadow: null\n\t\t\t});\n\t\t\tif (isElement) {\n\t\t\t\tconst rootName = getNodeName ? getNodeName(node) : null;\n\t\t\t\tif (typeof rootName === \"string\" && transformCaseFunc(rootName) === \"template\") {\n\t\t\t\t\tconst content = node.content;\n\t\t\t\t\tif (_isDocumentFragment(content)) stack.push({\n\t\t\t\t\t\tnode: content,\n\t\t\t\t\t\tshadow: null\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isElement) {\n\t\t\t\tconst sr = getShadowRoot(node);\n\t\t\t\tif (_isDocumentFragment(sr)) stack.push({\n\t\t\t\t\tnode: null,\n\t\t\t\t\tshadow: sr\n\t\t\t\t}, {\n\t\t\t\t\tnode: sr,\n\t\t\t\t\tshadow: null\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tDOMPurify.sanitize = function(dirty) {\n\t\tlet cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n\t\tlet body = null;\n\t\tlet importedNode = null;\n\t\tlet currentNode = null;\n\t\tlet returnNode = null;\n\t\tIS_EMPTY_INPUT = !dirty;\n\t\tif (IS_EMPTY_INPUT) dirty = \"<!-->\";\n\t\tif (typeof dirty !== \"string\" && !_isNode(dirty)) {\n\t\t\tdirty = stringifyValue(dirty);\n\t\t\tif (typeof dirty !== \"string\") throw typeErrorCreate(\"dirty is not a string, aborting\");\n\t\t}\n\t\tif (!DOMPurify.isSupported) return dirty;\n\t\tif (SET_CONFIG) {\n\t\t\tALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;\n\t\t\tALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;\n\t\t} else _parseConfig(cfg);\n\t\tif (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\tif (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\tDOMPurify.removed = [];\n\t\tconst inPlace = IN_PLACE && typeof dirty !== \"string\" && _isNode(dirty);\n\t\tlet inPlaceNodes = [];\n\t\tconst outerVisited = IN_PLACE_VISITED;\n\t\tif (inPlace) {\n\t\t\t_neutralizePatchLinkage(dirty);\n\t\t\tconst nn = _readNodeName(dirty);\n\t\t\tif (typeof nn === \"string\") {\n\t\t\t\tconst tagName = transformCaseFunc(nn);\n\t\t\t\tif (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n\t\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\t\tthrow typeErrorCreate(\"root node is forbidden and cannot be sanitized in-place\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_isClobbered(dirty)) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\tthrow typeErrorCreate(\"root node is clobbered and cannot be sanitized in-place\");\n\t\t\t}\n\t\t\tinPlaceNodes = _collectLiveNodes(dirty);\n\t\t\tIN_PLACE_VISITED = setCreate();\n\t\t} else if (_isNode(dirty)) {\n\t\t\tbody = _initDocument(\"<!---->\");\n\t\t\timportedNode = body.ownerDocument.importNode(dirty, true);\n\t\t\tif (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === \"BODY\") body = importedNode;\n\t\t\telse if (importedNode.nodeName === \"HTML\") body = importedNode;\n\t\t\telse body.appendChild(importedNode);\n\t\t\t_sanitizeAttachedShadowRoots(body);\n\t\t} else {\n\t\t\tif (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf(\"<\") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;\n\t\t\tbody = _initDocument(dirty);\n\t\t\tif (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : \"\";\n\t\t}\n\t\tif (body && FORCE_BODY) _forceRemove(body.firstChild);\n\t\tconst walkRoot = inPlace ? dirty : body;\n\t\ttry {\n\t\t\tif (inPlace) _sanitizeAttachedShadowRoots(dirty);\n\t\t\tconst nodeIterator = _createNodeIterator(walkRoot);\n\t\t\twhile (currentNode = nodeIterator.nextNode()) {\n\t\t\t\t_sanitizeElements(currentNode, walkRoot);\n\t\t\t\t_sanitizeAttributes(currentNode, walkRoot);\n\t\t\t\tif (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);\n\t\t\t}\n\t\t\tif (inPlace) _sanitizeUnvisitedNodes(dirty, inPlaceNodes);\n\t\t} catch (error) {\n\t\t\tif (inPlace) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\t_neutralizeDiscarded(dirty, inPlaceNodes);\n\t\t\t}\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tIN_PLACE_VISITED = outerVisited;\n\t\t}\n\t\tif (inPlace) {\n\t\t\tif (_neutralizeDiscarded(dirty, inPlaceNodes)) throw typeErrorCreate(\"a node selected for removal could not be safely returned; refusing to sanitize in place\");\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);\n\t\t\treturn dirty;\n\t\t}\n\t\tif (RETURN_DOM) {\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);\n\t\t\tif (RETURN_DOM_FRAGMENT) {\n\t\t\t\treturnNode = createDocumentFragment.call(body.ownerDocument);\n\t\t\t\twhile (body.firstChild) returnNode.appendChild(body.firstChild);\n\t\t\t} else returnNode = body;\n\t\t\tif (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);\n\t\t\treturn returnNode;\n\t\t}\n\t\tlet serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\t\tif (WHOLE_DOCUMENT && ALLOWED_TAGS[\"!doctype\"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = \"<!DOCTYPE \" + body.ownerDocument.doctype.name + \">\\n\" + serializedHTML;\n\t\tif (SAFE_FOR_TEMPLATES) serializedHTML = _stripTemplateExpressions(serializedHTML);\n\t\treturn trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;\n\t};\n\tDOMPurify.setConfig = function() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\t_parseConfig(cfg);\n\t\tSET_CONFIG = true;\n\t\tSET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;\n\t\tSET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;\n\t};\n\tDOMPurify.clearConfig = function() {\n\t\tCONFIG = null;\n\t\tSET_CONFIG = false;\n\t\tSET_CONFIG_ALLOWED_TAGS = null;\n\t\tSET_CONFIG_ALLOWED_ATTR = null;\n\t\ttrustedTypesPolicy = defaultTrustedTypesPolicy;\n\t\temptyHTML = \"\";\n\t};\n\tDOMPurify.isValidAttribute = function(tag, attr, value) {\n\t\tif (!CONFIG) _parseConfig({});\n\t\tconst lcTag = transformCaseFunc(tag);\n\t\tconst lcName = transformCaseFunc(attr);\n\t\tif (typeof value === \"string\" && (_isUnsafeAttributeValue(attr, value) || !ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value))) return false;\n\t\treturn _isValidAttribute(lcTag, lcName, value);\n\t};\n\tDOMPurify.addHook = function(entryPoint, hookFunction) {\n\t\tif (typeof hookFunction !== \"function\") return;\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tarrayPush(hooks[entryPoint], hookFunction);\n\t};\n\tDOMPurify.removeHook = function(entryPoint, hookFunction) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tif (hookFunction !== void 0) {\n\t\t\tconst index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n\t\t\treturn index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];\n\t\t}\n\t\treturn arrayPop(hooks[entryPoint]);\n\t};\n\tDOMPurify.removeHooks = function(entryPoint) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\thooks[entryPoint] = [];\n\t};\n\tDOMPurify.removeAllHooks = function() {\n\t\thooks = _createHooksMap();\n\t};\n\treturn DOMPurify;\n}\nvar purify_default = createDOMPurify();\nexport { purify_default as default };\n\n//# sourceMappingURL=purify.es.mjs.map","import { getDate, getMonth, getYear, isAfter, isBefore, isValid, set } from \"date-fns\";\nimport prettyBytes from \"pretty-bytes\";\nimport DomPurify from \"dompurify\";\n//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\n//#region src/capitalize.ts\n/**\n* Uppercases first letter of string\n* @param string to be capitalized first string, e.g. \"workflow\"\n* @return Capitalized String, e.g. \"Workflow\"\n*/\nvar capitalize = (input) => input.charAt(0).toUpperCase() + input.substring(1);\nvar formats = {\n\tcustomFormat: (input, delimiter) => capitalize(input.replace(delimiter, \" \").toLowerCase()),\n\tkebabFormat: (input) => formats.customFormat(input, \"-\"),\n\tsnakeFormat: (input) => formats.customFormat(input, \"_\"),\n\tcamelPascalCase: (input) => capitalize((input.match(/([A-Z]?[^A-Z]*)/g) ?? []).slice(0, -1).join(\" \").toLowerCase())\n};\nvar caseFormatter = ({ string, delimiter, format }) => {\n\tif (delimiter) return formats.customFormat(string, delimiter);\n\tif (format) return formats[format](string, delimiter ?? \"\");\n\treturn capitalize(string);\n};\n//#endregion\n//#region src/updateDate.ts\n/**\n* Updates the date part (year, day and month) of a date object (base)\n* time, offset (timezone) and so on will be left untouched.\n*\n* @param base - Date which will be used (copied) to set day, month and year.\n* @param date - Extract day, month and year from this date object.\n* @returns Copy of base with day, month and year of date.\n*/\nvar updateDate_default = (base, date) => {\n\tif (date) {\n\t\tbase = isValid(base) ? base : new Date(Date.UTC(0, 0));\n\t\treturn set(base, {\n\t\t\tyear: getYear(date),\n\t\t\tmonth: getMonth(date),\n\t\t\tdate: getDate(date)\n\t\t});\n\t}\n\treturn base;\n};\n//#endregion\n//#region src/updateTime.ts\n/**\n* Updates the time part (hour, minute, second and millisecond) of a date object (base)\n* date, offset (timezone) and so on will be left untouched.\n*\n* @param base - Date which will be used (copied) to set day, month and year.\n* @param date - Extract hour, minute, second and millisecond from this date object.\n* @returns Copy of base with hour, minute, second and millisecond changed.\n*/\nvar updateTime_default = (base, date) => {\n\tconst d = new Date(base);\n\tif (date) {\n\t\td.setHours(date.getHours());\n\t\td.setMinutes(date.getMinutes());\n\t\td.setSeconds(date.getSeconds());\n\t\td.setMilliseconds(date.getMilliseconds());\n\t}\n\treturn d;\n};\n//#endregion\n//#region src/dateMinMaxCheck.ts\n/**\n* Check if date is before min.\n* @param date\n* @param min\n* @param checkDate - check date part (year, day, month).\n* @param checkTime - check time part (hour, minutes etc.).\n* @returns whether limit is kept or not.\n*/\nvar isBeforeMinDate = (date, min, checkDate, checkTime) => {\n\tif (min) {\n\t\tif (checkTime && checkDate) return isBefore(date, min);\n\t\tif (checkTime) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isBefore(updateTime_default(base, date), updateTime_default(base, min));\n\t\t}\n\t\tif (checkDate) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isBefore(updateDate_default(base, date), updateDate_default(base, min));\n\t\t}\n\t}\n\treturn false;\n};\n/**\n* Check\n* @param date - date to check.\n* @param max - maximum date.\n* @param checkDate - check date part (year, day, month).\n* @param checkTime - check time part (hour, minutes etc.).\n* @returns whether limit is kept or not.\n*/\nvar isAfterMaxDate = (date, max, checkDate, checkTime) => {\n\tif (max) {\n\t\tif (checkTime && checkDate) return isAfter(date, max);\n\t\tif (checkTime) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isAfter(updateTime_default(base, date), updateTime_default(base, max));\n\t\t}\n\t\tif (checkDate) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isAfter(updateDate_default(base, date), updateDate_default(base, max));\n\t\t}\n\t}\n\treturn false;\n};\n//#endregion\n//#region src/debounce.ts\nvar debounce = (callback, wait) => {\n\tlet timer;\n\tlet lastCall = 0;\n\treturn (...args) => {\n\t\tconst [value, index] = args;\n\t\tclearTimeout(timer);\n\t\tconst now = Date.now();\n\t\tif (now - lastCall > wait) {\n\t\t\tlastCall = now;\n\t\t\tcallback(value, index);\n\t\t} else timer = setTimeout(() => {\n\t\t\tlastCall = now;\n\t\t\tcallback(value, index);\n\t\t}, wait);\n\t};\n};\nvar filters = Object.assign({}, ...[\n\t{\n\t\tid: \"search\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\treturn caseSensitiveSearch ? searchTerm : searchTerm.toLowerCase();\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = (caseSensitiveSearch ? text : text.toLowerCase()).includes(normalizedSearchTerm);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"wildcard\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\tif (searchTerm.length > 0) searchTerm = `^${searchTerm.replace(/[-[\\]{}()+.,\\\\^$|#\\s]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/\\?/g, \".?\")}$`;\n\t\t\telse return { test: () => false };\n\t\t\ttry {\n\t\t\t\treturn new RegExp(searchTerm, caseSensitiveSearch ? \"\" : \"i\");\n\t\t\t} catch (_error) {\n\t\t\t\treturn /$^/;\n\t\t\t}\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = normalizedSearchTerm.test(text);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"regex\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\ttry {\n\t\t\t\tconst flags = caseSensitiveSearch ? \"\" : \"i\";\n\t\t\t\treturn new RegExp(`^(${searchTerm})$`, flags);\n\t\t\t} catch (_error) {\n\t\t\t\treturn /$^/;\n\t\t\t}\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = normalizedSearchTerm.test(text);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"type\",\n\t\tnormalize(selectedTypes) {\n\t\t\treturn { test: (type) => selectedTypes.includes(type) };\n\t\t},\n\t\ttest(type, normalizedSearchTerm) {\n\t\t\tif (typeof type === \"undefined\") return false;\n\t\t\treturn normalizedSearchTerm.test(type);\n\t\t}\n\t}\n].map((obj) => ({ [obj.id]: obj })));\n//#endregion\n//#region src/localTimezone.ts\n/**\n* Get the users local timezone.\n*\n* @returns current users timezone (browser based) tz db string (e. g. Europe/Berlin).\n*/\nvar localTimezone_default = () => Intl.DateTimeFormat().resolvedOptions().timeZone;\n//#endregion\n//#region src/format.ts\n/**\n* Converts the specified date String to human readable text containing the day, month, and year.\n* Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018'\n*\n* @param dateString String representation of the Date to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable date String\n*/\nvar formatDateString = (dateString, useTimeZone = false) => {\n\tconst date = new Date(dateString);\n\tif (isNaN(date)) throw Error(\"Invalid Date format\");\n\tconst baseDateOptions = {\n\t\tday: \"numeric\",\n\t\tmonth: \"short\",\n\t\tyear: \"numeric\"\n\t};\n\tconst dateOptions = useTimeZone ? {\n\t\t...baseDateOptions,\n\t\ttimeZone: localTimezone_default()\n\t} : baseDateOptions;\n\treturn date.toLocaleDateString(\"en-US\", dateOptions);\n};\n/**\n* Converts the specified time String to human readable text containing the hour (12-hour) and minute.\n* Example: '2018-07-31T09:44:31+00:00' => '9:44 AM'\n*\n* @param timeString String representation of the Date (including time) to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable time String\n*/\nvar formatTimeString = (timeString, useTimeZone = false) => {\n\tconst time = new Date(timeString);\n\tif (isNaN(time)) throw Error(\"Invalid Date format\");\n\tconst baseTimeOptions = {\n\t\thour: \"numeric\",\n\t\tminute: \"2-digit\"\n\t};\n\tconst timeOptions = useTimeZone ? {\n\t\t...baseTimeOptions,\n\t\ttimeZone: localTimezone_default()\n\t} : baseTimeOptions;\n\treturn time.toLocaleTimeString(\"en-US\", timeOptions);\n};\n/**\n* Converts the specified time String to human readable text containing the date (day, month, year) and time (hour,\n* minute; 12-hour).\n* Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018 9:44 AM'\n*\n* @param dateTimeString String representation of the Date (including time and date) to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable date/time String\n*/\nvar formatDateTimeString = (dateTimeString, useTimeZone = false) => {\n\treturn `${formatDateString(dateTimeString, useTimeZone)} ${formatTimeString(dateTimeString, useTimeZone)}`;\n};\n/**\n* Converts the specified date and time to the user time zone with option to display (day, month, year) only or with time (hour,\n* minute; 12-hour).\n*\n* @param showTime String representation of the Date to convert and format\n* @param String | number} date String representation of the Date to convert and format\n* @returns human readable date/time String converted to user time zone\n*/\nvar formatLocalDateTimeString = (date, showTime) => showTime ? formatDateTimeString(date, true) : formatDateString(date, true);\nvar formatFileSize = (bytes) => {\n\treturn prettyBytes(Number.isFinite(bytes) && bytes >= 0 ? bytes : 0);\n};\n//#endregion\n//#region src/getDeepActiveElement.ts\nvar getDeepActiveElement = () => {\n\tlet element = document?.activeElement;\n\twhile (element?.shadowRoot) element = element?.shadowRoot?.activeElement;\n\treturn element;\n};\n//#endregion\n//#region src/getWrappedAroundIndex.ts\n/**\n* Since (a % b) yields a negative outcome for negative a, we need this method in order\n* to correctly compute wrapped around indices in lists\n* @param {number} index an arbitrary integer\n* @param {number} length a positive integer\n* @returns {number} the non-negative modulo outcome\n*/\nvar getWrappedAroundIndex_default = (index, length) => (index % length + length) % length;\n//#endregion\n//#region src/intervalUtils.ts\nvar intervalUtils_exports = /* @__PURE__ */ __exportAll({\n\tformatIntervalToHumanReadableIntervalString: () => formatIntervalToHumanReadableIntervalString,\n\tformatIntervalToISOIntervalString: () => formatIntervalToISOIntervalString,\n\tisValidHumanReadableIntervalString: () => isValidHumanReadableIntervalString,\n\tisValidISOIntervalString: () => isValidISOIntervalString,\n\tisValidIntervalString: () => isValidIntervalString,\n\tisZero: () => isZero,\n\tparseGenericIntervalString: () => parseGenericIntervalString,\n\tparseHumanReadableIntervalString: () => parseHumanReadableIntervalString,\n\tparseISOIntervalString: () => parseISOIntervalString\n});\nvar extractPeriodFromRegexMatch = (negative, match) => {\n\treturn {\n\t\tnegative,\n\t\tyears: parseInt(match[1] ?? \"0\", 10),\n\t\tmonths: parseInt(match[2] ?? \"0\", 10),\n\t\tweeks: parseInt(match[3] ?? \"0\", 10),\n\t\tdays: parseInt(match[4] ?? \"0\", 10)\n\t};\n};\nvar extractDurationFromRegexMatch = (negative, match) => {\n\tconst milliseconds = parseInt(match[4]?.padEnd(3, \"0\") ?? \"0\", 10);\n\treturn {\n\t\tnegative,\n\t\thours: parseInt(match[1] ?? \"0\", 10),\n\t\tminutes: parseInt(match[2] ?? \"0\", 10),\n\t\tseconds: parseInt(match[3] ?? \"0\", 10),\n\t\tmilliseconds\n\t};\n};\nvar isZero = (interval) => {\n\tif (interval.type === \"DATE\") return interval.interval.years === 0 && interval.interval.months === 0 && interval.interval.weeks === 0 && interval.interval.days === 0;\n\telse return interval.interval.hours === 0 && interval.interval.minutes === 0 && interval.interval.seconds === 0 && interval.interval.milliseconds === 0;\n};\n/**\n* Take an interval object and convert it to an ISO duration or period string. All parts of the\n* relevant part of the Interval object are included in the output, even if they are zero.\n*\n* Technically the ISO standard allows to mix period and duration parts, but we don't support that\n* here because it's incredibly hard to deal with all the edge cases. Maybe in a future ticket.\n*\n* The output here is allowed to be negative, in which case the minus sign is prepended to the\n* output.\n*\n* @param toFormat The PeriodOrDuration object to format\n*/\nvar formatIntervalToISOIntervalString = (toFormat) => {\n\tlet output = \"P\";\n\tif (toFormat.type === \"DATE\") output += `${toFormat.interval.years}Y${toFormat.interval.months}M${toFormat.interval.weeks}W${toFormat.interval.days}D`;\n\telse output += `T${toFormat.interval.hours}H${toFormat.interval.minutes}M${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")}S`;\n\tif (toFormat.interval.negative) output = `-${output}`;\n\treturn output;\n};\n/**\n* Take an interval object and convert it to a human readable string. Only non-zero parts are\n* included in the output (unless all parts are 0).\n*\n* The output here is allowed to be negative, in which case the minus sign is prepended to the\n* output and we wrap the whole thing in brackets e.g. -(1 year 2 days).\n*\n* @param toFormat The PeriodOrDuration object to format\n*/\nvar formatIntervalToHumanReadableIntervalString = (toFormat) => {\n\tconst formatPart = (value, unit) => {\n\t\tif (value === 0) return \"\";\n\t\telse if (value === 1) return `${value} ${unit} `;\n\t\telse return `${value} ${unit}s `;\n\t};\n\tlet output = \"\";\n\tif (toFormat.type === \"DATE\") {\n\t\tif (isZero(toFormat)) return \"0 days\";\n\t\toutput += formatPart(toFormat.interval.years, \"year\");\n\t\toutput += formatPart(toFormat.interval.months, \"month\");\n\t\toutput += formatPart(toFormat.interval.weeks, \"week\");\n\t\toutput += formatPart(toFormat.interval.days, \"day\");\n\t} else {\n\t\tif (isZero(toFormat)) return \"0 seconds\";\n\t\toutput += formatPart(toFormat.interval.hours, \"hour\");\n\t\toutput += formatPart(toFormat.interval.minutes, \"minute\");\n\t\tconst milliSecondsZero = toFormat.interval.milliseconds === 0;\n\t\tif (toFormat.interval.seconds !== 0 || !milliSecondsZero) if (milliSecondsZero) output += formatPart(toFormat.interval.seconds, \"second\");\n\t\telse output += `${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")} seconds `;\n\t}\n\tif (toFormat.interval.negative) output = `-(${output.trim()})`;\n\treturn output.trim();\n};\nvar yearsPart = \"(\\\\d+)\\\\s*y(?:ears?)?\";\nvar monthsPart = \"(\\\\d+)\\\\s*m(?:o(?:nths?)?)?\";\nvar weeksPart = \"(\\\\d+)\\\\s*w(?:eeks?)?\";\nvar daysPart = \"(\\\\d+)\\\\s*d(?:ays?)?\";\nvar hoursPart = \"(\\\\d+)\\\\s*h(?:ours?)?\";\nvar minutesPart = \"(\\\\d+)\\\\s*m(?:in(?:s|utes?)?)?\";\nvar secondsPart = \"(\\\\d+)(?:[,.](\\\\d{1,3}))?\\\\s*s(?:ec(?:s|onds?)?)?\";\n/**\n* Matches a human readable period string, e.g. \"1y 2mo 3weeks 4day\" (each part is optional)\n*/\nvar humanReadablePeriodRegex = new RegExp(`^(?:${yearsPart})?\\\\s*(?:${monthsPart})?\\\\s*(?:${weeksPart})?\\\\s*(?:${daysPart})?\\\\s*$`, \"i\");\n/**\n* Matches a human readable duration string, e.g. \"1h 2m 3.456s\" (each part is optional)\n*/\nvar humanReadableDurationRegex = new RegExp(`^(?:${hoursPart})?\\\\s*(?:${minutesPart})?\\\\s*(?:${secondsPart})?$`, \"i\");\n/**\n* Matches a negative human readable period string, e.g. \"-(1y 2mo 3weeks 4day)\" (each part is optional)\n*/\nvar negativeHumanReadablePeriodRegex = new RegExp(`^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadablePeriodRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable period string with one field like \"-1y\" or \"-1w\"\n*/\nvar negativeHumanReadablePeriodRegexWithSingleField = new RegExp(`^\\\\s*-\\\\s*(?:\\\\s*${yearsPart}|${monthsPart}|${weeksPart}|${daysPart})\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable duration string, e.g. \"-(1h 2m 3.456s)\" (each part is optional)\n*/\nvar negativeHumanReadableDurationRegex = new RegExp(`^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadableDurationRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable duration string with one field like \"-1h\" or \"-1.5s\"\n*/\nvar negativeHumanReadableDurationRegexWithSingleField = new RegExp(`^\\\\s*-\\\\s*(?:\\\\s*${hoursPart}|${minutesPart}|${secondsPart})\\\\s*$`, \"i\");\n/**\n* Try to parse a human readable interval string into an Interval object. Any parts not specified\n* are assumed to be zero. Note that the string must be either a period or a duration, not a mix of\n* both. So for example, \"1y 2mo 3weeks 4day\" is fine, as is \"1h 2m 3.456s\". However, \"1y 2mo 1sec\"\n* is not, since it's a mix of both.\n*\n* Negative intervals are allowed, although if multiple fields are provided the string must include\n* brackets, so \"-(1y 2mo)\" is also valid, as is \"-5 seconds\".\n*\n* The string is required to have at least some content, any string that is blank will throw an error.\n*\n* @param intervalString The human readable time string\n*/\nvar parseHumanReadableIntervalString = (intervalString) => {\n\tintervalString = intervalString?.trim();\n\tif (!intervalString) throw new Error(\"Empty interval string\");\n\tconst matchPositivePeriod = humanReadablePeriodRegex.exec(intervalString);\n\tconst matchNegativePeriod = negativeHumanReadablePeriodRegex.exec(intervalString) ?? negativeHumanReadablePeriodRegexWithSingleField.exec(intervalString);\n\tconst matchPositiveDuration = humanReadableDurationRegex.exec(intervalString);\n\tconst matchNegativeDuration = negativeHumanReadableDurationRegex.exec(intervalString) ?? negativeHumanReadableDurationRegexWithSingleField.exec(intervalString);\n\tconst matchPeriod = matchPositivePeriod ?? matchNegativePeriod;\n\tconst matchDuration = matchPositiveDuration ?? matchNegativeDuration;\n\tconst negative = (matchNegativePeriod ?? matchNegativeDuration) !== null;\n\tif (matchDuration && matchPeriod) throw new Error(\"Ambiguous time format\");\n\tif (matchPeriod) return {\n\t\ttype: \"DATE\",\n\t\tinterval: extractPeriodFromRegexMatch(negative, matchPeriod)\n\t};\n\telse if (matchDuration) return {\n\t\ttype: \"TIME\",\n\t\tinterval: extractDurationFromRegexMatch(negative, matchDuration)\n\t};\n\telse throw new Error(`Invalid human readable time: ${intervalString}`);\n};\n/**\n* Check if the given string can be understood as a human readable duration or period string. The\n* type parameter specifies whether the string should be a date, time, or either.\n*\n* @param time the string to check\n* @param expectedType the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidHumanReadableIntervalString = (time, expectedType) => {\n\ttry {\n\t\tconst validationResult = parseHumanReadableIntervalString(time);\n\t\tconst actualType = validationResult.type;\n\t\tconst negative = validationResult.interval.negative;\n\t\tif (actualType === expectedType || expectedType === \"DATE_OR_TIME\") return {\n\t\t\tvalid: true,\n\t\t\ttype: actualType,\n\t\t\tnegative\n\t\t};\n\t\telse return { valid: false };\n\t} catch (_e) {\n\t\treturn { valid: false };\n\t}\n};\n/**\n* Convert an ISO duration OR period string to an Interval object. So for example,\n* \"P1Y2M3W4D\" is fine, as is \"PT1H2M3.456S\". However, \"P1Y2M3W4D1H2M3.456S\" is not, since\n* it's a mix of both. We're more forgiving than the ISO standard, so we allow for missing parts.\n* Also, the string is allowed to be negative, so \"-P1Y2M3W4D\" is also valid.\n*\n* The string is required to have at least some content, so the strings \"\", \"P\", and \"PT\" are\n* considered invalid (also if they start with a -).\n*\n* @param isoString The ISO duration or period string.\n*/\nvar parseISOIntervalString = (isoString) => {\n\tisoString = isoString?.trim();\n\tif ([\n\t\t\"\",\n\t\t\"P\",\n\t\t\"PT\",\n\t\t\"-\",\n\t\t\"-P\",\n\t\t\"-PT\"\n\t].includes(isoString)) throw new Error(\"Empty ISO duration\");\n\tconst periodRegex = /^-?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?$/;\n\tconst durationRegex = /^-?PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(?:[,.](\\d{1,3}))?S)?$/;\n\tconst matchPeriod = periodRegex.exec(isoString);\n\tconst matchDuration = durationRegex.exec(isoString);\n\tif (matchPeriod) return {\n\t\ttype: \"DATE\",\n\t\tinterval: extractPeriodFromRegexMatch(isoString.startsWith(\"-\"), matchPeriod)\n\t};\n\telse if (matchDuration) return {\n\t\ttype: \"TIME\",\n\t\tinterval: extractDurationFromRegexMatch(isoString.startsWith(\"-\"), matchDuration)\n\t};\n\telse throw new Error(`Invalid ISO duration: ${isoString}`);\n};\n/**\n* Check if the given string is a valid duration or period ISO string. The type parameter\n* specifies whether the string should be a date, time, or either.\n*\n* @param isoString the string to check\n* @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidISOIntervalString = (isoString, type) => {\n\ttry {\n\t\tconst validationResult = parseISOIntervalString(isoString);\n\t\tconst actualType = validationResult.type;\n\t\tconst negative = validationResult.interval.negative;\n\t\tif (actualType === type || type === \"DATE_OR_TIME\") return {\n\t\t\tvalid: true,\n\t\t\ttype: actualType,\n\t\t\tnegative\n\t\t};\n\t\telse return { valid: false };\n\t} catch (_e) {\n\t\treturn { valid: false };\n\t}\n};\n/**\n* Try to convert an interval string to an Interval object. The string can be either an ISO\n* duration/period string or a human readable string. If the string is not valid, an error is\n* thrown.\n*\n* @param time the time string, either ISO or human readable\n*/\nvar parseGenericIntervalString = (time) => {\n\tconst validISO = isValidISOIntervalString(time, \"DATE_OR_TIME\");\n\tconst validHumanReadable = isValidHumanReadableIntervalString(time, \"DATE_OR_TIME\");\n\tif (validISO.valid) return parseISOIntervalString(time);\n\telse if (validHumanReadable.valid) return parseHumanReadableIntervalString(time);\n\telse throw new Error(`Invalid interval string: ${time}`);\n};\n/**\n* Check if the given string is a valid interval string, either human readable or ISO. The type parameter\n* specifies whether the string should be a period, duration, or either.\n*\n* @param time the time string to check\n* @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidIntervalString = (time, type) => {\n\tconst validISO = isValidISOIntervalString(time, type);\n\tconst validHumanReadable = isValidHumanReadableIntervalString(time, type);\n\tif (validISO.valid) return validISO;\n\telse if (validHumanReadable.valid) return validHumanReadable;\n\telse return { valid: false };\n};\n//#endregion\n//#region src/numIntegerDigits.ts\n/**\n* Count the number of integer digits for a given number.\n*\n* @param input number.\n* @returns number of integer digits x has. 1234 = 4 but 1234.44 is also 4.\n*/\nvar numIntegerDigits_default = (input) => Math.max(Math.floor(Math.log10(Math.abs(input))), 0) + 1;\n//#endregion\n//#region src/promise/createAbortablePromise.ts\nvar AbortError = class extends Error {};\n/**\n* Helper to create an abortable promise. Returns an AbortController and a Function\n* that you can pass your async handler to. Whenever the AbortController signal is\n* aborted then the async handler's promise will reject with an AbortError\n*\n* Example:\n* ```\n* import { abortUtils } from \"@knime/utils\"\n* const myFetchCall = async (params...) => {...};\n*\n* try {\n* const { runAbortablePromise, abortController } = createAbortablePromise(() =>\n* myFetchCall(params...),\n* );\n* } catch (e) {\n* if (e instanceof abortUtils.AbortError) {\n* console.info('ignore due to abort');\n* return;\n* }\n* }\n*\n* // somewhere else (while request is in-flight)\n* abortController.abort(new abortUtils.AbortError('reason here'))\n* ```\n*/\nvar createAbortablePromise = () => {\n\tconst abortController = new AbortController();\n\tconst runAbortablePromise = (request) => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst abortListener = ({ target }) => {\n\t\t\t\tabortController.signal.removeEventListener(\"abort\", abortListener);\n\t\t\t\tconst reason = target.reason;\n\t\t\t\treject(reason instanceof AbortError ? reason : new AbortError(reason));\n\t\t\t};\n\t\t\trequest().then(resolve).catch((error) => {\n\t\t\t\tif (error instanceof AbortError) return;\n\t\t\t\treject(error);\n\t\t\t});\n\t\t\tabortController.signal.addEventListener(\"abort\", abortListener);\n\t\t});\n\t};\n\treturn {\n\t\tabortController,\n\t\trunAbortablePromise\n\t};\n};\n//#endregion\n//#region src/promise/createUnwrappedPromise.ts\nvar createUnwrappedPromise = () => {\n\tlet resolve = () => {};\n\tlet reject = () => {};\n\tconst promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\treturn {\n\t\tresolve,\n\t\treject,\n\t\tpromise\n\t};\n};\n//#endregion\n//#region src/sleep.ts\n/**\n* Returns promise that resolves after ms.\n*/\nfunction sleep(ms) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n/**\n* Helper to add retry capability to an async function\n* @param fn async function\n* @param retryCount max number of retries. defaults to 5\n* @param retryDelayMS delay in-between retries in millisecs. defaults to 0\n* @param excludeError predicate fn to exclude specific errors from causing a retry\n*/\nasync function retryPromise({ fn, retryCount = 5, retryDelayMS = 0, excludeError }) {\n\ttry {\n\t\treturn await fn();\n\t} catch (error) {\n\t\tif (excludeError?.(error)) throw error;\n\t\tif (retryCount > 0) {\n\t\t\tawait sleep(retryDelayMS);\n\t\t\treturn await retryPromise({\n\t\t\t\tfn,\n\t\t\t\tretryCount: retryCount - 1,\n\t\t\t\tretryDelayMS,\n\t\t\t\texcludeError\n\t\t\t});\n\t\t}\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/promise/index.ts\nvar promise_exports = /* @__PURE__ */ __exportAll({\n\tAbortError: () => AbortError,\n\tDEFAULT_RETRY_COUNT: () => 5,\n\tDEFAULT_RETRY_DELAY_MS: () => 0,\n\tcreateAbortablePromise: () => createAbortablePromise,\n\tcreateUnwrappedPromise: () => createUnwrappedPromise,\n\tretryPromise: () => retryPromise\n});\n//#endregion\n//#region src/sanitization.ts\nvar ALLOWED_TAGS = [\n\t\"p\",\n\t\"div\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"ul\",\n\t\"ol\",\n\t\"li\",\n\t\"blockquote\",\n\t\"b\",\n\t\"i\",\n\t\"s\",\n\t\"u\",\n\t\"sup\",\n\t\"sub\",\n\t\"ins\",\n\t\"del\",\n\t\"strong\",\n\t\"strike\",\n\t\"tt\",\n\t\"code\",\n\t\"big\",\n\t\"small\",\n\t\"br\",\n\t\"span\",\n\t\"em\"\n];\n/**\n* Sanitizes Raw HTML and only allow specific tags to be used, as per OWASP standards.\n* @param rawHTML\n* @param options.allowStyleAttribute - Allow the style attribute on elements\n* @param options.allowHyperlinks - Allow anchor tags with href attribute\n* @returns sanitized html\n*/\nvar sanitizeHTML = (rawHTML, options = {\n\tallowStyleAttribute: false,\n\tallowHyperlinks: false\n}) => {\n\tconst { allowStyleAttribute, allowHyperlinks } = options;\n\tconst ALLOWED_ATTR = [...allowStyleAttribute ? [\"style\"] : [], ...allowHyperlinks ? [\"href\"] : []];\n\tconst allowedTags = allowHyperlinks ? [...ALLOWED_TAGS, \"a\"] : ALLOWED_TAGS;\n\treturn DomPurify.sanitize(rawHTML, {\n\t\tALLOWED_TAGS: allowedTags,\n\t\tALLOWED_ATTR\n\t});\n};\n/**\n* Removes any HTML tag from the input string. Keeps HTML entities\n* (e.g because these can be considered plain text)\n* @param rawHTML\n* @returns plain text\n*/\nvar stripHTML = (rawHTML) => {\n\treturn DomPurify.sanitize(rawHTML, {\n\t\tALLOWED_TAGS: [],\n\t\tALLOWED_ATTR: []\n\t});\n};\nvar sanitization = {\n\tsanitizeHTML,\n\tstripHTML\n};\n//#endregion\n//#region src/truncateString.ts\nvar defaultMaxLength = 160;\nvar truncateString_default = (string = \"\", maxLength = defaultMaxLength) => {\n\tconst dots = string.length > maxLength ? \"…\" : \"\";\n\treturn `${string.substring(0, maxLength - 1)}${dots}`;\n};\n//#endregion\n//#region src/fileExtensions.ts\n/**\n* Gets the file extension\n* @param nameOrPath can take a full file name (e.g \"file.txt\") or a path to a file\n* (e.g \"file://path/to/file.txt\" OR \"/path/to/file.txt\")\n* @returns just the file extension (e.g \"txt\")\n*/\nvar getFileExtension = (nameOrPath) => {\n\tconst basename = nameOrPath.split(/[\\\\/]/).pop() ?? \"\";\n\tconst parts = basename.split(\".\");\n\tif (basename === \"\" || parts.length === 1) return \"\";\n\treturn parts.at(-1) ?? \"\";\n};\n/**\n* Metadata for .knar files, which corresponds to exported KNIME Workflow Groups\n* or Components\n*/\nvar KNAR = Object.freeze({\n\textension: \"knar\",\n\tmimeType: \"application/vnd.knime.workflow-group+zip\",\n\tmatches(file) {\n\t\treturn getFileExtension(file.name) === this.extension;\n\t}\n});\n/**\n* Metadata for .knwf files, which corresponds to exported KNIME Workflows\n*/\nvar KNWF = Object.freeze({\n\textension: \"knwf\",\n\tmimeType: \"application/vnd.knime.workflow+zip\",\n\tmatches(file) {\n\t\treturn getFileExtension(file.name) === this.extension;\n\t},\n\t/**\n\t* Gets the name of a .knwf file without the extension. If the file is not\n\t* matched as a .knwf file then this function will return the default value,\n\t* which is empty string (\"\") if param is not provided\n\t*/\n\tgetNameOrDefault(file, defaultValue = \"\") {\n\t\tif (!this.matches(file)) return defaultValue;\n\t\treturn file.name.replace(`.${this.extension}`, \"\");\n\t}\n});\nvar knimeFileFormats = {\n\tKNAR,\n\tKNWF\n};\n/**\n* Gets the mime type from a given file. Defaults to `application/octet-stream`\n* if mimeType cannot be detected\n* @param file File\n* @returns mimeType\n*/\nvar getFileMimeType = (file) => {\n\tconst DEFAULT_MIMETYPE = \"application/octet-stream\";\n\tif (!getFileExtension(file.name)) return DEFAULT_MIMETYPE;\n\tif (KNWF.matches(file)) return KNWF.mimeType;\n\tif (KNAR.matches(file)) return KNAR.mimeType;\n\tif (!file.type) return DEFAULT_MIMETYPE;\n\treturn file.type;\n};\n//#endregion\n//#region src/hotkeys/enums.ts\n/**\n* Platforms that influence how modifier keys are rendered. macOS substitutes\n* dedicated glyphs (`⌘`, `⌥`, `⇧`, …), every other platform uses the textual\n* rendering (`Ctrl`, `Alt`, `Shift`, …).\n*/\nvar hotkeyPlatform = {\n\tMAC_OS: \"macOS\",\n\tOTHER: \"other\"\n};\nObject.values(hotkeyPlatform);\n//#endregion\n//#region src/platform/navigator.ts\nvar navigator_exports = /* @__PURE__ */ __exportAll({\n\tisMac: () => isMac,\n\tisWindows: () => isWindows\n});\n/**\n*\n* @returns true if the platform of the user is Mac\n*/\nvar isMac = () => navigator?.userAgent?.toLowerCase()?.includes(\"mac\");\n/**\n*\n* @returns true if the platform of the user is Windows\n*/\nvar isWindows = () => navigator?.userAgent?.toLowerCase()?.includes(\"windows\");\n//#endregion\n//#region src/hotkeys/format.ts\nvar globalKeyMap = {\n\tArrowUp: \"↑\",\n\tArrowDown: \"↓\",\n\tArrowLeft: \"←\",\n\tArrowRight: \"→\",\n\tEnter: \"↵\",\n\t\" \": \"Space\",\n\tCtrlOrCmd: \"Ctrl\"\n};\nvar MacOSkeyMap = {\n\tShift: \"⇧\",\n\tDelete: \"⌫\",\n\tCtrlOrCmd: \"⌘\",\n\tCtrl: \"⌃\",\n\tAlt: \"⌥\",\n\tEnter: \"↩\"\n};\n/**\n* Returns a string representation of a single hotkey. Replaces some special key names with symbols.\n*\n* By default the platform is auto-detected from the user agent via `isMac()`.\n* Pass `platform` to force a specific platform's glyphs — useful for SSR,\n* tests, or rendering multiple platforms on the same page.\n*/\nvar formatHotkey = (hotkey, platform) => {\n\t/**\n\t* Returns the symbol corresponding to the `key` based on the given\n\t* `formatMap`. Otherwise, if not found, returns the same `key` value given\n\t*/\n\tconst mapSymbols = (formatMap) => (key) => formatMap[key] ?? key;\n\t/**\n\t* Pipe function implementation. Receives a list of functions to execute in order\n\t* and will pipe the parameter passed at the end to each function returning the final output\n\t*/\n\tconst pipe = (...fns) => fns.reduce((f, g) => (arg) => g(f(arg)), (arg) => arg);\n\tconst macKeyFormatter = pipe(mapSymbols(MacOSkeyMap), mapSymbols(globalKeyMap));\n\tconst generalKeyFormatter = mapSymbols(globalKeyMap);\n\treturn (platform === void 0 ? isMac() : platform === hotkeyPlatform.MAC_OS) ? macKeyFormatter(hotkey) : generalKeyFormatter(hotkey);\n};\nvar getDefaultSeparator = () => isMac() ? \" \" : \"+\";\n/**\n* Returns a string representation of a list of hotkeys. Replaces some special key names with symbols\n*/\nvar formatHotkeys = (hotkeys, getSeparator = getDefaultSeparator) => hotkeys.map((hotkey) => formatHotkey(hotkey)).join(getSeparator());\n/**\n* Appends a formatted hotkey shortcut to the given string. Useful for tooltips\n*/\nvar textWithHotkeys = (text, hotkeys) => {\n\treturn `${text} – ${formatHotkeys(hotkeys)}`;\n};\n//#endregion\n//#region src/hotkeys/match.ts\n/**\n* Checks whether a pressed `Digit` key falls within a numeric hotkey range such\n* as `1-9`.\n* @param keyCode - The `KeyboardEvent.code` to check (e.g. `Digit5`).\n* @param hotkey - The hotkey token, expected to be a single-digit range like `1-9`.\n* @returns True if the pressed digit lies within the inclusive range.\n*/\nvar isDigitKeyInRange = (keyCode, hotkey) => {\n\tif (hotkey.length !== 3 || !keyCode?.startsWith(\"Digit\")) return false;\n\tconst keyNumber = Number(keyCode.slice(5));\n\tconst [lower, upper] = hotkey.split(\"-\");\n\treturn Boolean(lower) && Boolean(upper) && Number.parseInt(lower, 10) <= keyNumber && keyNumber <= Number.parseInt(upper, 10);\n};\n/**\n* Checks whether a keyboard event matches a hotkey definition. The last token is\n* treated as the character; any preceding tokens are modifiers. The special\n* `CtrlOrCmd` modifier resolves to the platform's primary modifier (Meta/`⌘` on\n* macOS, Ctrl elsewhere).\n* @param event - The keyboard event to check.\n* @param hotkeys - The ordered hotkey tokens (modifiers followed by the character).\n* @returns True if the event matches the given hotkey, otherwise false.\n*/\nvar match = (event, hotkeys) => {\n\tconst { key, code, metaKey, ctrlKey, shiftKey, altKey } = event;\n\tconst modifiers = hotkeys.slice();\n\tconst character = modifiers.pop() ?? \"\";\n\tconst ctrlOrMeta = isMac() ? \"Meta\" : \"Ctrl\";\n\tconst platformModifiers = new Set(modifiers.map((modifier) => modifier === \"CtrlOrCmd\" ? ctrlOrMeta : modifier));\n\tconst metaMatches = Boolean(metaKey) === platformModifiers.has(\"Meta\");\n\tconst ctrlMatches = Boolean(ctrlKey) === platformModifiers.has(\"Ctrl\");\n\tconst shiftMatches = Boolean(shiftKey) === platformModifiers.has(\"Shift\");\n\tconst altMatches = Boolean(altKey) === platformModifiers.has(\"Alt\");\n\tconst keysMatch = key.toUpperCase() === character.toUpperCase() || character.includes(\"-\") && isDigitKeyInRange(code, character) || isMac() && character === \"Delete\" && key === \"Backspace\";\n\treturn metaMatches && ctrlMatches && shiftMatches && altMatches && keysMatch;\n};\n//#endregion\n//#region src/hotkeys/modifiers.ts\n/**\n* Checks if any modifier key (Ctrl, Meta, Alt, or Shift) is pressed.\n* @param event - The keyboard event to check.\n* @returns True if a modifier key is pressed, otherwise false.\n*/\nvar isModifierKeyPressed = (event) => {\n\treturn event.ctrlKey || event.metaKey || event.altKey || event.shiftKey;\n};\n/**\n* Checks if a specific key (or keys) were pressed without any modifier keys.\n* @param event - The keyboard event to check.\n* @param keys - The key or keys to check for.\n* @returns True if the specified key(s) were pressed without modifiers, otherwise false.\n*/\nvar isKeyWithoutModifiers = (event, keys) => {\n\treturn (Array.isArray(keys) ? keys : [keys]).includes(event.key) && !isModifierKeyPressed(event);\n};\n/**\n* Returns the name of the primary modifier key for the current platform.\n*/\nvar getMetaOrCtrlKey = () => {\n\treturn isMac() ? \"metaKey\" : \"ctrlKey\";\n};\n//#endregion\n//#region src/hotkeys/index.ts\n/**\n* Grouped keyboard-shortcut helpers, exposed as a single namespace for\n* ergonomic access (e.g. `hotkeys.formatHotkey`).\n*/\nvar hotkeys = {\n\tformatHotkeys,\n\tformatHotkey,\n\tgetDefaultSeparator,\n\thotkeyPlatform,\n\ttextWithHotkeys,\n\tmatch\n};\n//#endregion\nexport { capitalize, caseFormatter, debounce, filters, formatDateString, formatDateTimeString, formatFileSize, formatLocalDateTimeString, formatTimeString, getDeepActiveElement, getFileExtension, getFileMimeType, localTimezone_default as getLocalTimeZone, getMetaOrCtrlKey, getWrappedAroundIndex_default as getWrappedAroundIndex, hotkeys, intervalUtils_exports as intervalUtils, isAfterMaxDate, isBeforeMinDate, isKeyWithoutModifiers, isModifierKeyPressed, knimeFileFormats, match, navigator_exports as navigatorUtils, numIntegerDigits_default as numIntegerDigits, promise_exports as promise, sanitization, sleep, truncateString_default as truncateString, updateDate_default as updateDate, updateTime_default as updateTime };\n\n//# sourceMappingURL=index.js.map","import { type InjectionKey, type Ref, computed, inject, provide } from \"vue\";\n\nimport type { TableState } from \"../../types/TableConfig\";\n\n/**\n * Exported for testing purposes\n */\nexport const injectionKey: InjectionKey<{\n isShown: Ref<boolean>;\n close: () => void;\n}> = Symbol(\"dataValueViewsIsShown\");\n\nexport const useDataValueViews = () => inject(injectionKey)!;\n\nexport const provideDataValueViewsIsShown = (\n tableState: Ref<TableState>,\n closeDataValueView: () => void,\n) =>\n provide(injectionKey, {\n isShown: computed(() => Boolean(tableState.value.dataValueViewIsShown)),\n close: closeDataValueView,\n });\n","import { getMetaOrCtrlKey } from \"@knime/utils\";\n\nconst isNavigationKey = (event: KeyboardEvent) =>\n event.key.includes(\"Arrow\") || event.key === \"Tab\" || event.key === \"Escape\";\n\n/**\n * Creates a keydown handler that detects editing-trigger keys and calls the\n * appropriate callback:\n * - Enter (without Shift) / Space → `onExpandAndStartEditing`\n * - Backspace / printable characters (key.length === 1, no Ctrl/Cmd, no Alt)\n * → `onStartEditing`\n *\n * Navigation keys (Arrow, Tab, Escape) and modifier combos (Ctrl/Cmd, Alt)\n * are ignored and left for other handlers.\n */\nexport const useStartEditingKeydown = ({\n onExpandAndStartEditing,\n onStartEditing,\n}: {\n onExpandAndStartEditing: (initialValue?: string) => void;\n onStartEditing: (initialValue?: string) => void;\n}) => {\n const onKeydown = (event: KeyboardEvent) => {\n if (isNavigationKey(event) || event[getMetaOrCtrlKey()]) {\n return;\n }\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n event.stopPropagation();\n onExpandAndStartEditing();\n } else if (event.key === \" \") {\n event.preventDefault();\n onExpandAndStartEditing(\" \");\n } else if (event.key === \"Backspace\") {\n onStartEditing(\"\");\n } else if (!event.altKey && event.key.length === 1) {\n event.preventDefault();\n onStartEditing(event.key);\n }\n };\n\n return { onKeydown };\n};\n","<script setup lang=\"ts\">\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport { useDataValueViews } from \"./composables/useDataValueViews\";\nimport { useStartEditingKeydown } from \"./composables/useStartEditingKeydown\";\n\nconst emit = defineEmits<{\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst onArrowKeyDown = (event: KeyboardEvent) => {\n let horizontal = 0;\n let vertical = 0;\n switch (event.key) {\n case \"ArrowLeft\":\n horizontal = -1;\n break;\n case \"ArrowRight\":\n horizontal = 1;\n break;\n case \"ArrowUp\":\n vertical = -1;\n break;\n case \"ArrowDown\":\n vertical = 1;\n break;\n }\n if (horizontal || vertical) {\n event.preventDefault();\n emit(\"moveSelection\", horizontal, vertical, event.shiftKey);\n }\n};\n\nconst { isShown: selectedCellIsExpanded, close: closeExpandedSelectedCell } =\n useDataValueViews();\n\nconst onEscape = (event: KeyboardEvent) => {\n if (selectedCellIsExpanded.value) {\n event.preventDefault();\n event.stopPropagation();\n closeExpandedSelectedCell();\n }\n};\n\nconst onTab = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n emit(\"moveSelection\", horizontalMove, 0, false);\n};\n\nconst { onKeydown: onStartEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: (initialValue?: string) => {\n emit(\"expandSelectedCell\");\n emit(\"startEditing\", initialValue);\n },\n onStartEditing: (initialValue?: string) => {\n emit(\"startEditing\", initialValue);\n },\n});\n\nconst onKeyDown = (event: KeyboardEvent) => {\n if (!event[getMetaOrCtrlKey()] && event.key.includes(\"Arrow\")) {\n onArrowKeyDown(event);\n } else if (event.key === \"Tab\") {\n onTab(event);\n } else if (event.key === \"Escape\") {\n onEscape(event);\n } else {\n onStartEditingKeydown(event);\n }\n};\n</script>\n\n<template>\n <tbody\n :tabindex=\"-1\"\n @keydown.self=\"onKeyDown\"\n @focusin=\"emit('bodyFocusin')\"\n @focusout=\"emit('bodyFocusout')\"\n >\n <slot name=\"bodyContent\" />\n <slot name=\"belowBody\" />\n </tbody>\n</template>\n\n<style scoped>\ntbody {\n outline: none;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport { useDataValueViews } from \"./composables/useDataValueViews\";\nimport { useStartEditingKeydown } from \"./composables/useStartEditingKeydown\";\n\nconst emit = defineEmits<{\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst onArrowKeyDown = (event: KeyboardEvent) => {\n let horizontal = 0;\n let vertical = 0;\n switch (event.key) {\n case \"ArrowLeft\":\n horizontal = -1;\n break;\n case \"ArrowRight\":\n horizontal = 1;\n break;\n case \"ArrowUp\":\n vertical = -1;\n break;\n case \"ArrowDown\":\n vertical = 1;\n break;\n }\n if (horizontal || vertical) {\n event.preventDefault();\n emit(\"moveSelection\", horizontal, vertical, event.shiftKey);\n }\n};\n\nconst { isShown: selectedCellIsExpanded, close: closeExpandedSelectedCell } =\n useDataValueViews();\n\nconst onEscape = (event: KeyboardEvent) => {\n if (selectedCellIsExpanded.value) {\n event.preventDefault();\n event.stopPropagation();\n closeExpandedSelectedCell();\n }\n};\n\nconst onTab = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n emit(\"moveSelection\", horizontalMove, 0, false);\n};\n\nconst { onKeydown: onStartEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: (initialValue?: string) => {\n emit(\"expandSelectedCell\");\n emit(\"startEditing\", initialValue);\n },\n onStartEditing: (initialValue?: string) => {\n emit(\"startEditing\", initialValue);\n },\n});\n\nconst onKeyDown = (event: KeyboardEvent) => {\n if (!event[getMetaOrCtrlKey()] && event.key.includes(\"Arrow\")) {\n onArrowKeyDown(event);\n } else if (event.key === \"Tab\") {\n onTab(event);\n } else if (event.key === \"Escape\") {\n onEscape(event);\n } else {\n onStartEditingKeydown(event);\n }\n};\n</script>\n\n<template>\n <tbody\n :tabindex=\"-1\"\n @keydown.self=\"onKeyDown\"\n @focusin=\"emit('bodyFocusin')\"\n @focusout=\"emit('bodyFocusout')\"\n >\n <slot name=\"bodyContent\" />\n <slot name=\"belowBody\" />\n </tbody>\n</template>\n\n<style scoped>\ntbody {\n outline: none;\n}\n</style>\n","import {\n type CSSProperties,\n type InjectionKey,\n type MaybeRef,\n type Ref,\n computed,\n inject,\n provide,\n} from \"vue\";\n\nimport type { IndexStartEnd } from \"@knime/vue-headless-virtual-scroller\";\n\nexport interface Payload {\n horizontal: Ref<IndexStartEnd>;\n horizontalStyles: CSSProperties;\n}\n\nconst injectionKey: InjectionKey<Payload> = Symbol(\n \"useHorizontalIndicesAndStyles.ts\",\n);\n\nexport const provideForHorizontalVirtualScrolling = (payload: Payload) =>\n provide(injectionKey, payload);\n\n/**\n * The horizontal column indices to render plus the style positioning the\n * horizontally virtualized window. While horizontal virtual scrolling is\n * provided the indices are the currently visible column range; otherwise\n * `fallbackIndices` (e.g. all columns) is used.\n */\nconst useHorizontalIndices = (\n fallbackIndices: () => number[],\n): {\n indices: Ref<number[]>;\n style: MaybeRef<CSSProperties>;\n} => {\n const providedForVirtualScrolling = inject(injectionKey, null);\n if (providedForVirtualScrolling) {\n return {\n indices: computed(() =>\n providedForVirtualScrolling.horizontal.value.toArray(),\n ),\n style: providedForVirtualScrolling.horizontalStyles,\n };\n }\n return {\n indices: computed(fallbackIndices),\n style: {},\n };\n};\n\nexport const useIndicesAndStylesFor = <T>(\n data: Ref<T[]>,\n): {\n indexedData: Ref<[T, number][]>;\n style: MaybeRef<CSSProperties>;\n} => {\n const { indices, style } = useHorizontalIndices(() =>\n data.value.map((_, index) => index),\n );\n return {\n indexedData: computed(() =>\n indices.value.map((index) => [data.value[index], index]),\n ),\n style,\n };\n};\n\n/**\n * Like {@link useIndicesAndStylesFor} but for consumers that only need the\n * column indices (not per-column data), e.g. {@link EmptyRow} whose skeleton\n * cells read their width from the `--col-size-<index>` CSS variable rather than\n * from a render-time read of the numeric column sizes. The fallback renders all\n * `numColumns` columns when horizontal virtual scrolling is not provided.\n */\nexport const useColumnIndicesFor = (\n numColumns: Ref<number>,\n): {\n indices: Ref<number[]>;\n style: MaybeRef<CSSProperties>;\n} =>\n useHorizontalIndices(() =>\n Array.from({ length: numColumns.value }, (_, index) => index),\n );\n","import {\n type InjectionKey,\n type Ref,\n computed,\n inject,\n provide,\n ref,\n watch,\n} from \"vue\";\n\nexport const getColSizeCSSVar = (index: number) => `--col-size-${index}`;\n\ninterface ColumnSizesContext {\n /**\n * The live numeric column sizes, updated per drag frame during a column\n * resize. Only consume them where this update frequency is wanted (e.g.\n * imperative CSS variable writes), not at render time above the cell tree.\n */\n colSizes: Ref<number[]>;\n /**\n * The column sizes captured at drag start while a column resize is active,\n * identical to the live sizes otherwise. Consumers whose render output must\n * not update per drag frame (e.g. Row's slotted cell width,\n * TableCoreVirtual's column window) read these instead of freezing the live\n * sizes themselves.\n */\n colSizesFrozenWhenResizing: Ref<number[]>;\n /**\n * Whether a column resize drag is currently active. Set by TableUI (the\n * owner of the column resize events); drives the freezing above.\n */\n columnResizeActive: Ref<boolean>;\n}\n\nexport const columnSizesInjectionKey: InjectionKey<ColumnSizesContext> =\n Symbol(\"columnSizes\");\n\n/**\n * Non-reactive override for the injected column sizes. While its `value` is a\n * sizes array, {@link injectColumnSizes} returns those sizes instead of the\n * live ones. Used by the hidden auto-size calculation table so it can render at\n * its own (e.g. maximum) widths without affecting the visible table. It does\n * not need to be reactive: each consumer reads the sizes once when it is set\n * up, and the calculation table is (re)mounted for every calculation, so the\n * override only needs to be set before it mounts and reset to `null` after.\n */\ninterface AutoSizeColumnSizes {\n value: number[] | null;\n}\n\nconst autoSizeColumnSizesInjectionKey: InjectionKey<AutoSizeColumnSizes> =\n Symbol(\"autoSizeColumnSizes\");\n\n/**\n * Provides the {@link AutoSizeColumnSizes} override to descendants and returns\n * methods to set/unset it around an auto-size calculation. Has to be called\n * above the components whose injected sizes should be overridden (i.e. the\n * auto-size calculation table).\n */\nexport const provideAutoSizeColumnSizes = () => {\n const holder: AutoSizeColumnSizes = { value: null };\n provide(autoSizeColumnSizesInjectionKey, holder);\n return {\n setAutoSizeColumnSizes: (sizes: number[]) => {\n holder.value = sizes;\n },\n unsetAutoSizeColumnSizes: () => {\n holder.value = null;\n },\n };\n};\n\n/**\n * Owns the column-size handling for the table. Using a provide/inject pattern to share\n * live sizes with descendants instead of a property, we avoid memory issues arising\n * on column resizing.\n * When switching to @vue/vapor virtualizer, we can remove this again.\n */\nexport const useColumnSizes = (\n colSizes: Ref<number[]>,\n /**\n * An element reference that is either the root of the table or a parent.\n * This element will be used to define the global css variables controlling\n * column widths.\n */\n element: Ref<HTMLElement | null>,\n) => {\n let previousColumnCount = 0;\n watch(\n [colSizes, element],\n ([sizes]) => {\n const el = element.value;\n if (!el) {\n return;\n }\n sizes.forEach((size, index) => {\n el.style.setProperty(getColSizeCSSVar(index), `${size}px`);\n });\n // Remove the CSS variables of columns that no longer exist so they do not\n // linger on the element after the column count shrinks.\n for (let index = sizes.length; index < previousColumnCount; index++) {\n el.style.removeProperty(getColSizeCSSVar(index));\n }\n previousColumnCount = sizes.length;\n },\n { immediate: true },\n );\n\n const columnResizeActive = ref(false);\n const colSizesOnStartColResize = ref<number[] | null>(null);\n watch(columnResizeActive, (active) => {\n colSizesOnStartColResize.value = active ? [...colSizes.value] : null;\n });\n const colSizesFrozenWhenResizing = computed(\n () => colSizesOnStartColResize.value ?? colSizes.value,\n );\n\n const context: ColumnSizesContext = {\n colSizes,\n colSizesFrozenWhenResizing,\n columnResizeActive,\n };\n provide(columnSizesInjectionKey, context);\n return context;\n};\n\nexport const injectColumnSizes = (): ColumnSizesContext => {\n const context = inject(columnSizesInjectionKey);\n if (!context) {\n throw new Error(\n \"No column-size context found. Components from @knime/kds-table must be \" +\n \"rendered below a useColumnSizes provider (see useColumnSizes). Without \" +\n \"it the column-width CSS variables are never set and columns collapse.\",\n );\n }\n // If an auto-size calculation is in progress, transparently override the\n // injected sizes with the ones it wants to render at.\n const autoSizeColumnSizes = inject(autoSizeColumnSizesInjectionKey, null);\n if (autoSizeColumnSizes && autoSizeColumnSizes.value !== null) {\n const sizes = ref(autoSizeColumnSizes.value);\n return {\n ...context,\n colSizes: sizes,\n colSizesFrozenWhenResizing: sizes,\n };\n }\n return context;\n};\n","<script setup lang=\"ts\">\nimport { computed, toRef } from \"vue\";\n\nimport { KdsCheckbox, KdsLoadingSkeleton } from \"@knime/kds-components\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useColumnIndicesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar } from \"../useColumnSizes\";\n\nconst props = defineProps<{\n height: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n\nconst { indices: columnIndices, style: rowStyles } = useColumnIndicesFor(\n toRef(props, \"numColumns\"),\n);\n\nconst paddingTopBottom = computed(() =>\n props.compact\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\n</script>\n\n<template>\n <!--class \"row\" required for deep selector from knime-core-ui-->\n <tr\n :class=\"`row${compact ? ' compact-mode' : ''}`\"\n :style=\"{\n ...rowStyles,\n height: `${height}px`,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell-spacer\" />\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox tooltip=\"Selection\" disabled class=\"select-checkbox\" />\n </td>\n <td\n v-for=\"cellIndex of columnIndices\"\n :key=\"cellIndex\"\n :style=\"{\n width: `var(${getColSizeCSSVar(cellIndex)})`,\n padding: `${paddingTopBottom}px ${CELL_PADDING_HORIZONTAL}px`,\n }\"\n >\n <KdsLoadingSkeleton loading class=\"skeleton\" />\n </td>\n </tr>\n</template>\n\n<style scoped>\ntr {\n display: flex;\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n\n & .skeleton {\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, toRef } from \"vue\";\n\nimport { KdsCheckbox, KdsLoadingSkeleton } from \"@knime/kds-components\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useColumnIndicesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar } from \"../useColumnSizes\";\n\nconst props = defineProps<{\n height: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n\nconst { indices: columnIndices, style: rowStyles } = useColumnIndicesFor(\n toRef(props, \"numColumns\"),\n);\n\nconst paddingTopBottom = computed(() =>\n props.compact\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\n</script>\n\n<template>\n <!--class \"row\" required for deep selector from knime-core-ui-->\n <tr\n :class=\"`row${compact ? ' compact-mode' : ''}`\"\n :style=\"{\n ...rowStyles,\n height: `${height}px`,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell-spacer\" />\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox tooltip=\"Selection\" disabled class=\"select-checkbox\" />\n </td>\n <td\n v-for=\"cellIndex of columnIndices\"\n :key=\"cellIndex\"\n :style=\"{\n width: `var(${getColSizeCSSVar(cellIndex)})`,\n padding: `${paddingTopBottom}px ${CELL_PADDING_HORIZONTAL}px`,\n }\"\n >\n <KdsLoadingSkeleton loading class=\"skeleton\" />\n </td>\n </tr>\n</template>\n\n<style scoped>\ntr {\n display: flex;\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n\n & .skeleton {\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\ndefineProps<{ height: number }>();\n</script>\n\n<template>\n <div class=\"dots\" :style=\"{ height: `${height}px` }\">\n <span> ⋮ </span>\n </div>\n</template>\n\n<style scoped>\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font: var(--kds-font-base-interactive-large);\n color: var(--kds-color-text-and-icon-neutral);\n border-bottom: var(--kds-border-base-subtle);\n\n & span {\n text-align: center;\n pointer-events: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\ndefineProps<{ height: number }>();\n</script>\n\n<template>\n <div class=\"dots\" :style=\"{ height: `${height}px` }\">\n <span> ⋮ </span>\n </div>\n</template>\n\n<style scoped>\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font: var(--kds-font-base-interactive-large);\n color: var(--kds-color-text-and-icon-neutral);\n border-bottom: var(--kds-border-base-subtle);\n\n & span {\n text-align: center;\n pointer-events: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport type { DataItem } from \"./TableUI.vue\";\nimport EmptyRow from \"./ui/EmptyRow.vue\";\nimport PlaceholderRow from \"./ui/PlaceholderRow.vue\";\n\ndefineProps<{\n dataItem?: DataItem;\n rowHeight: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n</script>\n\n<template>\n <template v-if=\"dataItem\">\n <template v-if=\"dataItem.dots\">\n <PlaceholderRow :height=\"rowHeight\" />\n </template>\n <slot v-else :row=\"dataItem.data\" />\n </template>\n <EmptyRow\n v-else\n :height=\"rowHeight\"\n :compact=\"compact\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport type { DataItem } from \"./TableUI.vue\";\nimport EmptyRow from \"./ui/EmptyRow.vue\";\nimport PlaceholderRow from \"./ui/PlaceholderRow.vue\";\n\ndefineProps<{\n dataItem?: DataItem;\n rowHeight: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n</script>\n\n<template>\n <template v-if=\"dataItem\">\n <template v-if=\"dataItem.dots\">\n <PlaceholderRow :height=\"rowHeight\" />\n </template>\n <slot v-else :row=\"dataItem.data\" />\n </template>\n <EmptyRow\n v-else\n :height=\"rowHeight\"\n :compact=\"compact\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n />\n</template>\n","import {\n type InjectionKey,\n type Ref,\n inject,\n provide,\n ref,\n watchEffect,\n} from \"vue\";\n\n/**\n * CSS variable holding the current table body width (in px). It is written\n * imperatively to the scroll container by {@link useBodyWidth} so that style\n * consumers (the sticky header, the resize scroll spacer) can read the body\n * width via `var(...)` instead of via a render-time read of the live\n * column-size array.\n */\nexport const BODY_WIDTH_CSS_VAR = \"--current-body-width\";\n\nconst bodyWidthInjectionKey: InjectionKey<Ref<number>> = Symbol(\"bodyWidth\");\n\n/**\n * Owns the table body width. Given the live numeric body width and the scroll\n * container element, it\n * - writes the width to {@link BODY_WIDTH_CSS_VAR} on the element (the single\n * source the sticky header and the resize scroll spacer read their width\n * from), and\n * - provides the live numeric body width for the few descendants that genuinely\n * need a number in JS but must not read it every frame (they inject via\n * {@link injectBodyWidth}).\n */\nexport const useBodyWidth = (\n bodyWidth: Ref<number>,\n element: Ref<HTMLElement | null>,\n) => {\n watchEffect(() => {\n element.value?.style.setProperty(\n BODY_WIDTH_CSS_VAR,\n `${bodyWidth.value}px`,\n );\n });\n\n provide(bodyWidthInjectionKey, bodyWidth);\n};\n\nexport const injectBodyWidth = () => inject(bodyWidthInjectionKey, ref(0));\n","import { type InjectionKey, inject, provide, ref } from \"vue\";\n\nconst setup = () => {\n const currentCallback = ref<(() => void) | null>(null);\n\n const registerExpandedSubMenu = (callback: () => void) => {\n // Timeout to prevent the sub menu to be closed due to scroll event triggered by clicking a row/group\n setTimeout(() => {\n currentCallback.value = () => {\n callback();\n currentCallback.value = null;\n };\n }, 100);\n };\n return {\n closeExpandedSubMenu: () => currentCallback.value?.(),\n registerExpandedSubMenu,\n };\n};\n\ntype Provided = ReturnType<typeof setup>;\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Provided> = Symbol(\n \"useCloseSubMenusOnScroll.ts\",\n);\n\nexport const provideForCloseSubMenusOnScroll = () =>\n provide(injectionKey, setup());\n\nexport const injectCloseExpandedSubMenu = () =>\n inject(injectionKey)!.closeExpandedSubMenu;\nexport const injectRegisterExpandedSubMenu = () =>\n inject(injectionKey)!.registerExpandedSubMenu;\n","import {\n type CSSProperties,\n type InjectionKey,\n type Ref,\n computed,\n inject,\n provide,\n ref,\n watch,\n} from \"vue\";\n\ntype Provided = Ref<CSSProperties>;\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Provided> = Symbol(\n \"useOverflowStyles.ts\",\n);\n\nconst elIsPresent = (el: HTMLElement | null): el is HTMLElement => Boolean(el);\n\nexport const provideOverflowStyles = ({\n columnResizeActive,\n fitsWithoutHorizontalScrollbar,\n scrolledElement,\n}: {\n fitsWithoutHorizontalScrollbar: Ref<boolean>;\n columnResizeActive: Ref<boolean>;\n scrolledElement: Ref<HTMLElement | null>;\n}) => {\n // Captured at the moment column resize starts: was a vertical scrollbar\n // visible at that instant? If yes, we keep it as `overflow-y: scroll` during\n // the resize so that toggling the horizontal scrollbar cannot make the\n // vertical scrollbar appear/disappear (which would cause flickering).\n const verticalScrollbarVisibleAtResizeStart = ref(false);\n // flush: 'sync' so we read scrollHeight/clientHeight the instant\n // columnResizeActive flips true — before any other reactive consumer\n // (notably our own overflow computed) can mutate the DOM and thereby\n // change which scrollbars are visible.\n watch(\n columnResizeActive,\n (active) => {\n if (active) {\n const el = scrolledElement.value;\n verticalScrollbarVisibleAtResizeStart.value =\n elIsPresent(el) && el.scrollHeight > el.clientHeight;\n }\n },\n { flush: \"sync\" },\n );\n\n provide(\n injectionKey,\n computed(() => ({\n overflowX:\n !columnResizeActive.value && !fitsWithoutHorizontalScrollbar.value\n ? \"auto\"\n : \"hidden\",\n overflowY:\n columnResizeActive.value && verticalScrollbarVisibleAtResizeStart.value\n ? \"scroll\"\n : \"auto\",\n })),\n );\n};\n\nexport const useOverflowStyles = () => inject(injectionKey)!;\n","import { type InjectionKey, type Ref, inject, provide, ref } from \"vue\";\n\nimport {\n injectCloseExpandedSubMenu,\n provideForCloseSubMenusOnScroll,\n} from \"./useCloseSubMenusOnScroll\";\nimport { provideOverflowStyles, useOverflowStyles } from \"./useOverflowStyles\";\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Ref<HTMLElement | null>> =\n Symbol(\"scrollContainerRed\");\n\nexport const provideCommonScrollContainerProps = (\n containerRef: Ref<HTMLElement | null>,\n params: {\n fitsWithoutHorizontalScrollbar: Ref<boolean>;\n columnResizeActive: Ref<boolean>;\n },\n) => {\n provideOverflowStyles({ ...params, scrolledElement: containerRef });\n provideForCloseSubMenusOnScroll();\n provide(injectionKey, containerRef);\n};\n\n/**\n * Thin helper that injects only the scroll container ref provided by\n * {@link provideCommonScrollContainerProps}, without pulling in the overflow\n * and sub-menu providers that {@link useCommonScrollContainerProps} requires.\n * Falls back to a null ref when no provider is present (e.g. in isolated tests).\n */\nexport const useScrollContainer = () => inject(injectionKey, ref(null));\n\nexport const useCommonScrollContainerProps = () => {\n const closeExpandedSubMenu = injectCloseExpandedSubMenu();\n const overflowStyles = useOverflowStyles();\n return {\n overflowStyles,\n closeExpandedSubMenu,\n containerRef: useScrollContainer(),\n };\n};\n","import { type Ref, nextTick, ref, watch } from \"vue\";\n\n/**\n * While a column resize is active a screen-wide spacer is rendered to the right of the\n * table content, guaranteeing there is always horizontal scroll room so the edge\n * auto-scroll (see Header.vue) can keep growing a column past the current table width.\n *\n * This composable owns the spacer's lifecycle: when the resize ends it only animates the\n * spacer's width back down to the current body width if the extra scroll room is actually\n * on screen (the container is scrolled past the body's right edge) - otherwise there is\n * nothing to see and the spacer is dropped immediately. Once the collapse animation has\n * finished, `onResizeScrollSpacerTransitionEnd` unmounts it.\n */\nexport const useResizeScrollSpacer = ({\n columnResizeActive,\n currentBodyWidth,\n scrollContainer,\n}: {\n columnResizeActive: Ref<boolean>;\n currentBodyWidth: Ref<number>;\n scrollContainer: Ref<HTMLElement | null>;\n}) => {\n const showResizeScrollSpacer = ref(false);\n const collapseResizeScrollSpacer = ref(false);\n const additionalSpacerWidth = ref(\"0px\");\n\n // True when the area beyond the body's right edge (i.e. part of the spacer) is within\n // the currently visible viewport of the scroll container.\n const getVisibleWidthBeyondBody = () => {\n const container = scrollContainer.value;\n if (container === null) {\n return 0;\n }\n return Math.max(\n 0,\n container.scrollLeft + container.clientWidth - currentBodyWidth.value,\n );\n };\n\n watch(columnResizeActive, (active) => {\n if (active) {\n collapseResizeScrollSpacer.value = false;\n showResizeScrollSpacer.value = true;\n additionalSpacerWidth.value = \"100vw\";\n } else if (showResizeScrollSpacer.value) {\n const visibleWidthBeyondBody = getVisibleWidthBeyondBody();\n if (visibleWidthBeyondBody > 0) {\n additionalSpacerWidth.value = `${visibleWidthBeyondBody}px`;\n nextTick(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n scrollContainer.value?.offsetWidth; // force layout so the width change above is registered before we collapse\n additionalSpacerWidth.value = \"0px\";\n collapseResizeScrollSpacer.value = true;\n });\n } else {\n // the spacer is scrolled out of view, so just drop it without animating\n showResizeScrollSpacer.value = false;\n additionalSpacerWidth.value = \"0px\";\n }\n }\n });\n\n const onResizeScrollSpacerTransitionEnd = () => {\n if (collapseResizeScrollSpacer.value) {\n showResizeScrollSpacer.value = false;\n collapseResizeScrollSpacer.value = false;\n }\n };\n\n return {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n };\n};\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, toRef, watch } from \"vue\";\nimport { useResizeObserver } from \"@vueuse/core\";\nimport \"../assets/global-z-indices.css\";\n\nimport {\n ArraySizeManager,\n SameSizeManager,\n type SizeManager,\n WithSpaceAfter,\n WithSpaceBefore,\n useVirtualGrid,\n} from \"@knime/vue-headless-virtual-scroller\";\n\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableBodyNavigatable from \"./TableBodyNavigatable.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport VirtualRow from \"./VirtualRow.vue\";\nimport {\n BODY_WIDTH_CSS_VAR,\n injectBodyWidth,\n} from \"./composables/useBodyWidth\";\nimport { useCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { provideForHorizontalVirtualScrolling } from \"./composables/useHorizontalIndicesAndStyles\";\nimport { useResizeScrollSpacer } from \"./composables/useResizeScrollSpacer\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport interface Props {\n scrollData: DataItem[];\n scrollConfig: {\n numRowsAbove: number;\n numRowsBelow: number;\n itemSize: number;\n compact: boolean;\n };\n specialColumnSizes: {\n selectionSize: number;\n deletionSize: number;\n rightSideSize: number;\n };\n tableConfig: TableConfig;\n columnResizeActive: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst withLeftSideSize = (sizeManager: SizeManager) =>\n new WithSpaceBefore(\n {\n spaceBefore: computed(\n () =>\n props.specialColumnSizes.selectionSize +\n props.specialColumnSizes.deletionSize,\n ),\n spaceBeforeIsOffset: false,\n },\n sizeManager,\n );\nconst withRightSideSize = (sizeManager: SizeManager) =>\n new WithSpaceAfter(\n computed(() => props.specialColumnSizes.rightSideSize),\n sizeManager,\n );\n\n/**\n * The size manager input is split by output:\n * - `toOffset`/`getTotalSize` are applied imperatively (as CSS variables, see\n * useVirtualLine) and never read at render time, so they track the live\n * (per-frame) column sizes during a resize drag — the scrolled-area width and\n * offset stay correct while dragging without causing any re-render.\n * - `toIndex` determines the rendered column window (`indices`), which every\n * row and the header consume at render time. With live sizes the window\n * shifts whenever a column boundary crosses the buffered viewport edge\n * mid-drag, re-rendering all visible cells each time. It therefore uses the\n * resize-frozen sizes of the column-size context (frozen at drag start);\n * the window is corrected once when the resize ends.\n */\nconst { colSizes: liveColSizes, colSizesFrozenWhenResizing: indexColSizes } =\n injectColumnSizes();\n\nconst decorateWithSideSizes = (sizeManager: SizeManager) =>\n withLeftSideSize(withRightSideSize(sizeManager));\nconst liveSizeManager = decorateWithSideSizes(\n new ArraySizeManager(liveColSizes),\n);\nconst indexSizeManager = decorateWithSideSizes(\n new ArraySizeManager(indexColSizes),\n);\nconst columnSizeManager: SizeManager = {\n toIndex: (position) => indexSizeManager.toIndex(position),\n toOffset: (index) => liveSizeManager.toOffset(index),\n getTotalSize: () => liveSizeManager.getTotalSize(),\n getNumItems: () => liveSizeManager.getNumItems(),\n onUpdate: (callback) => liveSizeManager.onUpdate(callback),\n};\n\n/**\n * The number of columns is passed to the (empty) rows instead of the live\n * numeric `colSizes`: the rows read each cell width from the `--col-size-<index>`\n * CSS variable, so they only need the column count. Deriving it as a computed\n * means a per-frame `colSizes` change during a resize does not re-render this\n * component (and therefore does not re-invoke the forwarded row slot) as long as\n * the count is unchanged.\n */\nconst numColumns = computed(() => liveColSizes.value.length);\n\n/**\n * Buffer (in px) of additionally rendered columns on each side of the visible\n * viewport, larger than the scroller's 500px default: the rendered column\n * window is frozen while a column resize drag is active (see above), so when a\n * column is shrunk, the columns sliding in from the right are only those\n * already rendered into this buffer. Up to this many pixels of net shrink no\n * white space appears before the resize ends; the price is rendering the extra\n * buffered columns at all times.\n */\nconst HORIZONTAL_BUFFER_PX = 1000;\n\nconst numRows: Ref<number> = computed(\n () =>\n props.scrollData.length +\n props.scrollConfig.numRowsAbove +\n props.scrollConfig.numRowsBelow,\n);\nconst rowHeight = computed(() => props.scrollConfig.itemSize);\nconst rowSizeManager = new SameSizeManager(numRows, rowHeight);\n\nconst {\n containerProps,\n indices: { vertical, horizontal },\n scrolledAreaStyles: {\n vertical: verticalStyles,\n horizontal: horizontalStyles,\n },\n} = useVirtualGrid({\n rows: { sizeManager: rowSizeManager },\n columns: { sizeManager: columnSizeManager, buffer: HORIZONTAL_BUFFER_PX },\n});\n\nwatch(\n () => vertical.value,\n ({ endIndex, startIndex }) => {\n if (Number.isNaN(endIndex) || Number.isNaN(startIndex)) {\n return;\n }\n emit(\"scrollerUpdate\", startIndex, endIndex);\n },\n { immediate: true },\n);\n\nif (!props.tableConfig.forceRenderAll) {\n provideForHorizontalVirtualScrolling({\n horizontal,\n horizontalStyles,\n });\n}\n\nconst renderedRowIndices = computed(() =>\n props.tableConfig.forceRenderAll\n ? Array.from({ length: numRows.value }, (_, i) => i)\n : vertical.value.toArray(),\n);\n\n// DRAG HANDLE\n\nconst headerContainer: Ref<null | HTMLElement> = ref(null);\nconst getHeaderHeight = () => {\n return headerContainer.value?.offsetHeight ?? 0;\n};\n\nconst getBody = () => containerProps.ref.value?.querySelector(\"tbody\");\n\nconst getDragHandleHeight = () => {\n const scrollContainer = containerProps.ref.value;\n if (scrollContainer === null) {\n return 0;\n }\n const headerHeight = getHeaderHeight();\n /**\n * If the second argument is the smaller one, this means that the scroller is\n * not scrollable at the moment, i.e. adding the header height to the body height\n * is the desired height, as they cannot overlap.\n */\n return Math.min(\n scrollContainer.offsetHeight,\n Math.floor(getBody()!.offsetHeight + headerHeight),\n );\n};\n\nconst headerHeight = ref(0);\nconst updateHeaderHeight = () => {\n headerHeight.value = getHeaderHeight();\n};\nonMounted(updateHeaderHeight);\nuseResizeObserver(headerContainer, updateHeaderHeight);\n\nconst emptyStateStyle = computed(() => ({\n height: `calc(100% - ${headerHeight.value}px)`,\n}));\n\nconst isEmpty = computed(() => numRows.value === 0);\n\n/**\n * With all rows rendered there is nothing to scroll, so the container only takes\n * the space it needs. Without any rows it keeps the full height nonetheless: the\n * empty state fills the space the rows would have occupied, and the container's\n * horizontal scrollbar belongs at the bottom of the table rather than directly\n * below the header.\n */\nconst fitContent = computed(\n () => props.tableConfig.forceRenderAll && !isEmpty.value,\n);\n\nconst {\n closeExpandedSubMenu,\n containerRef: injectedContainerRef,\n overflowStyles,\n} = useCommonScrollContainerProps();\n\nconst {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n} = useResizeScrollSpacer({\n columnResizeActive: toRef(props, \"columnResizeActive\"),\n currentBodyWidth: injectBodyWidth(),\n scrollContainer: containerProps.ref,\n});\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n scrollToPosition: ({ top, left }: { top?: number; left?: number }) => {\n if (top !== undefined) {\n containerProps.ref.value!.scrollTop = top;\n }\n if (left !== undefined) {\n containerProps.ref.value!.scrollLeft = left;\n }\n containerProps.onScroll();\n },\n getScrollStart: () => containerProps.ref.value!.scrollTop,\n getBody,\n getContainer: () => containerProps.ref.value,\n});\n</script>\n\n<template>\n <div\n v-if=\"containerProps\"\n :ref=\"\n (element) => {\n containerProps.ref.value = injectedContainerRef =\n element as HTMLElement | null;\n }\n \"\n :style=\"overflowStyles\"\n :class=\"['container', { 'fit-content': fitContent }]\"\n @scroll=\"() => [containerProps.onScroll(), closeExpandedSubMenu()]\"\n >\n <div ref=\"headerContainer\" class=\"header-container\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </div>\n <TableBodyNavigatable\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @expand-selected-cell=\"emit('expandSelectedCell')\"\n @start-editing=\"(initialValue) => emit('startEditing', initialValue)\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #bodyContent>\n <slot name=\"cell-selection-overlay\" />\n <div :style=\"tableConfig.forceRenderAll ? {} : verticalStyles\">\n <VirtualRow\n v-for=\"rowInd in renderedRowIndices\"\n :key=\"rowInd\"\n #default=\"{ row }\"\n :row-height=\"scrollConfig.itemSize\"\n :compact=\"scrollConfig.compact\"\n :data-item=\"scrollData[rowInd - scrollConfig.numRowsAbove]\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n >\n <slot name=\"row\" :row-ind=\"rowInd\" :row=\"row\" />\n </VirtualRow>\n </div>\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n </TableBodyNavigatable>\n <!--\n The empty state takes over the space left over by the empty body. It is\n sticky rather than part of the scrolled content, so that it stays put while\n scrolling horizontally through the (row-less) columns.\n -->\n <div\n v-if=\"isEmpty && $slots['empty-state']\"\n class=\"empty-state-container\"\n :style=\"emptyStateStyle\"\n >\n <slot name=\"empty-state\" />\n </div>\n <!--\n While a column is being resized we add a screen-wide spacer to the right of\n the table content. This guarantees there is always horizontal scroll room\n so the edge auto-scroll (see Header.vue) can keep growing a column - in\n particular the last one - past the current table width. When the resize ends\n we animate its width back down to the current body width so the extra scroll\n room collapses smoothly, then unmount it (see onResizeScrollSpacerTransitionEnd).\n -->\n <div\n v-if=\"showResizeScrollSpacer\"\n :class=\"[\n 'resize-scroll-spacer',\n { collapsing: collapseResizeScrollSpacer },\n ]\"\n aria-hidden=\"true\"\n :style=\"{\n width: `calc(var(${BODY_WIDTH_CSS_VAR}) + ${additionalSpacerWidth})`,\n }\"\n @transitionend=\"onResizeScrollSpacerTransitionEnd\"\n />\n </div>\n</template>\n\n<style scoped>\n.container {\n flex: 1 1 0;\n\n &.fit-content {\n flex: 0 0 auto;\n }\n\n & .header-container {\n position: sticky;\n top: 0;\n z-index: var(--z-index-sticky-header);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n & tbody {\n /**\n * Necessary for the absolutely placed elements inside of it (e.g. cell selection overlay)\n * to scroll with the body.\n */\n position: relative;\n\n /**\n * Otherwise there is a small margin from the left that leads to an unnecessary scrollbar\n */\n display: block;\n\n /**\n * Necessary so that non-virtual elements (like drag handles) are wide enough\n */\n width: fit-content;\n }\n}\n\n.empty-state-container {\n position: sticky;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n\n /*\n The two spacers share the space around the empty state equally, i.e. they\n center it - but the upper one is capped, so with plenty of space the message\n stays close to the header instead of drifting into the middle of the table.\n */\n &::before,\n &::after {\n flex: 1 1 0;\n content: \"\";\n }\n\n &::before {\n max-height: var(--kds-spacing-container-5x);\n }\n\n /* Rather overflow than squeeze the message when the space gets tight. */\n & > * {\n flex: 0 0 auto;\n }\n}\n\n.resize-scroll-spacer {\n /* Only animate when collapsing back after a resize ends; while resizing the width\n tracks the growing column and must update instantly. */\n &.collapsing {\n transition: width 0.2s ease;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, toRef, watch } from \"vue\";\nimport { useResizeObserver } from \"@vueuse/core\";\nimport \"../assets/global-z-indices.css\";\n\nimport {\n ArraySizeManager,\n SameSizeManager,\n type SizeManager,\n WithSpaceAfter,\n WithSpaceBefore,\n useVirtualGrid,\n} from \"@knime/vue-headless-virtual-scroller\";\n\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableBodyNavigatable from \"./TableBodyNavigatable.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport VirtualRow from \"./VirtualRow.vue\";\nimport {\n BODY_WIDTH_CSS_VAR,\n injectBodyWidth,\n} from \"./composables/useBodyWidth\";\nimport { useCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { provideForHorizontalVirtualScrolling } from \"./composables/useHorizontalIndicesAndStyles\";\nimport { useResizeScrollSpacer } from \"./composables/useResizeScrollSpacer\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport interface Props {\n scrollData: DataItem[];\n scrollConfig: {\n numRowsAbove: number;\n numRowsBelow: number;\n itemSize: number;\n compact: boolean;\n };\n specialColumnSizes: {\n selectionSize: number;\n deletionSize: number;\n rightSideSize: number;\n };\n tableConfig: TableConfig;\n columnResizeActive: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst withLeftSideSize = (sizeManager: SizeManager) =>\n new WithSpaceBefore(\n {\n spaceBefore: computed(\n () =>\n props.specialColumnSizes.selectionSize +\n props.specialColumnSizes.deletionSize,\n ),\n spaceBeforeIsOffset: false,\n },\n sizeManager,\n );\nconst withRightSideSize = (sizeManager: SizeManager) =>\n new WithSpaceAfter(\n computed(() => props.specialColumnSizes.rightSideSize),\n sizeManager,\n );\n\n/**\n * The size manager input is split by output:\n * - `toOffset`/`getTotalSize` are applied imperatively (as CSS variables, see\n * useVirtualLine) and never read at render time, so they track the live\n * (per-frame) column sizes during a resize drag — the scrolled-area width and\n * offset stay correct while dragging without causing any re-render.\n * - `toIndex` determines the rendered column window (`indices`), which every\n * row and the header consume at render time. With live sizes the window\n * shifts whenever a column boundary crosses the buffered viewport edge\n * mid-drag, re-rendering all visible cells each time. It therefore uses the\n * resize-frozen sizes of the column-size context (frozen at drag start);\n * the window is corrected once when the resize ends.\n */\nconst { colSizes: liveColSizes, colSizesFrozenWhenResizing: indexColSizes } =\n injectColumnSizes();\n\nconst decorateWithSideSizes = (sizeManager: SizeManager) =>\n withLeftSideSize(withRightSideSize(sizeManager));\nconst liveSizeManager = decorateWithSideSizes(\n new ArraySizeManager(liveColSizes),\n);\nconst indexSizeManager = decorateWithSideSizes(\n new ArraySizeManager(indexColSizes),\n);\nconst columnSizeManager: SizeManager = {\n toIndex: (position) => indexSizeManager.toIndex(position),\n toOffset: (index) => liveSizeManager.toOffset(index),\n getTotalSize: () => liveSizeManager.getTotalSize(),\n getNumItems: () => liveSizeManager.getNumItems(),\n onUpdate: (callback) => liveSizeManager.onUpdate(callback),\n};\n\n/**\n * The number of columns is passed to the (empty) rows instead of the live\n * numeric `colSizes`: the rows read each cell width from the `--col-size-<index>`\n * CSS variable, so they only need the column count. Deriving it as a computed\n * means a per-frame `colSizes` change during a resize does not re-render this\n * component (and therefore does not re-invoke the forwarded row slot) as long as\n * the count is unchanged.\n */\nconst numColumns = computed(() => liveColSizes.value.length);\n\n/**\n * Buffer (in px) of additionally rendered columns on each side of the visible\n * viewport, larger than the scroller's 500px default: the rendered column\n * window is frozen while a column resize drag is active (see above), so when a\n * column is shrunk, the columns sliding in from the right are only those\n * already rendered into this buffer. Up to this many pixels of net shrink no\n * white space appears before the resize ends; the price is rendering the extra\n * buffered columns at all times.\n */\nconst HORIZONTAL_BUFFER_PX = 1000;\n\nconst numRows: Ref<number> = computed(\n () =>\n props.scrollData.length +\n props.scrollConfig.numRowsAbove +\n props.scrollConfig.numRowsBelow,\n);\nconst rowHeight = computed(() => props.scrollConfig.itemSize);\nconst rowSizeManager = new SameSizeManager(numRows, rowHeight);\n\nconst {\n containerProps,\n indices: { vertical, horizontal },\n scrolledAreaStyles: {\n vertical: verticalStyles,\n horizontal: horizontalStyles,\n },\n} = useVirtualGrid({\n rows: { sizeManager: rowSizeManager },\n columns: { sizeManager: columnSizeManager, buffer: HORIZONTAL_BUFFER_PX },\n});\n\nwatch(\n () => vertical.value,\n ({ endIndex, startIndex }) => {\n if (Number.isNaN(endIndex) || Number.isNaN(startIndex)) {\n return;\n }\n emit(\"scrollerUpdate\", startIndex, endIndex);\n },\n { immediate: true },\n);\n\nif (!props.tableConfig.forceRenderAll) {\n provideForHorizontalVirtualScrolling({\n horizontal,\n horizontalStyles,\n });\n}\n\nconst renderedRowIndices = computed(() =>\n props.tableConfig.forceRenderAll\n ? Array.from({ length: numRows.value }, (_, i) => i)\n : vertical.value.toArray(),\n);\n\n// DRAG HANDLE\n\nconst headerContainer: Ref<null | HTMLElement> = ref(null);\nconst getHeaderHeight = () => {\n return headerContainer.value?.offsetHeight ?? 0;\n};\n\nconst getBody = () => containerProps.ref.value?.querySelector(\"tbody\");\n\nconst getDragHandleHeight = () => {\n const scrollContainer = containerProps.ref.value;\n if (scrollContainer === null) {\n return 0;\n }\n const headerHeight = getHeaderHeight();\n /**\n * If the second argument is the smaller one, this means that the scroller is\n * not scrollable at the moment, i.e. adding the header height to the body height\n * is the desired height, as they cannot overlap.\n */\n return Math.min(\n scrollContainer.offsetHeight,\n Math.floor(getBody()!.offsetHeight + headerHeight),\n );\n};\n\nconst headerHeight = ref(0);\nconst updateHeaderHeight = () => {\n headerHeight.value = getHeaderHeight();\n};\nonMounted(updateHeaderHeight);\nuseResizeObserver(headerContainer, updateHeaderHeight);\n\nconst emptyStateStyle = computed(() => ({\n height: `calc(100% - ${headerHeight.value}px)`,\n}));\n\nconst isEmpty = computed(() => numRows.value === 0);\n\n/**\n * With all rows rendered there is nothing to scroll, so the container only takes\n * the space it needs. Without any rows it keeps the full height nonetheless: the\n * empty state fills the space the rows would have occupied, and the container's\n * horizontal scrollbar belongs at the bottom of the table rather than directly\n * below the header.\n */\nconst fitContent = computed(\n () => props.tableConfig.forceRenderAll && !isEmpty.value,\n);\n\nconst {\n closeExpandedSubMenu,\n containerRef: injectedContainerRef,\n overflowStyles,\n} = useCommonScrollContainerProps();\n\nconst {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n} = useResizeScrollSpacer({\n columnResizeActive: toRef(props, \"columnResizeActive\"),\n currentBodyWidth: injectBodyWidth(),\n scrollContainer: containerProps.ref,\n});\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n scrollToPosition: ({ top, left }: { top?: number; left?: number }) => {\n if (top !== undefined) {\n containerProps.ref.value!.scrollTop = top;\n }\n if (left !== undefined) {\n containerProps.ref.value!.scrollLeft = left;\n }\n containerProps.onScroll();\n },\n getScrollStart: () => containerProps.ref.value!.scrollTop,\n getBody,\n getContainer: () => containerProps.ref.value,\n});\n</script>\n\n<template>\n <div\n v-if=\"containerProps\"\n :ref=\"\n (element) => {\n containerProps.ref.value = injectedContainerRef =\n element as HTMLElement | null;\n }\n \"\n :style=\"overflowStyles\"\n :class=\"['container', { 'fit-content': fitContent }]\"\n @scroll=\"() => [containerProps.onScroll(), closeExpandedSubMenu()]\"\n >\n <div ref=\"headerContainer\" class=\"header-container\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </div>\n <TableBodyNavigatable\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @expand-selected-cell=\"emit('expandSelectedCell')\"\n @start-editing=\"(initialValue) => emit('startEditing', initialValue)\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #bodyContent>\n <slot name=\"cell-selection-overlay\" />\n <div :style=\"tableConfig.forceRenderAll ? {} : verticalStyles\">\n <VirtualRow\n v-for=\"rowInd in renderedRowIndices\"\n :key=\"rowInd\"\n #default=\"{ row }\"\n :row-height=\"scrollConfig.itemSize\"\n :compact=\"scrollConfig.compact\"\n :data-item=\"scrollData[rowInd - scrollConfig.numRowsAbove]\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n >\n <slot name=\"row\" :row-ind=\"rowInd\" :row=\"row\" />\n </VirtualRow>\n </div>\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n </TableBodyNavigatable>\n <!--\n The empty state takes over the space left over by the empty body. It is\n sticky rather than part of the scrolled content, so that it stays put while\n scrolling horizontally through the (row-less) columns.\n -->\n <div\n v-if=\"isEmpty && $slots['empty-state']\"\n class=\"empty-state-container\"\n :style=\"emptyStateStyle\"\n >\n <slot name=\"empty-state\" />\n </div>\n <!--\n While a column is being resized we add a screen-wide spacer to the right of\n the table content. This guarantees there is always horizontal scroll room\n so the edge auto-scroll (see Header.vue) can keep growing a column - in\n particular the last one - past the current table width. When the resize ends\n we animate its width back down to the current body width so the extra scroll\n room collapses smoothly, then unmount it (see onResizeScrollSpacerTransitionEnd).\n -->\n <div\n v-if=\"showResizeScrollSpacer\"\n :class=\"[\n 'resize-scroll-spacer',\n { collapsing: collapseResizeScrollSpacer },\n ]\"\n aria-hidden=\"true\"\n :style=\"{\n width: `calc(var(${BODY_WIDTH_CSS_VAR}) + ${additionalSpacerWidth})`,\n }\"\n @transitionend=\"onResizeScrollSpacerTransitionEnd\"\n />\n </div>\n</template>\n\n<style scoped>\n.container {\n flex: 1 1 0;\n\n &.fit-content {\n flex: 0 0 auto;\n }\n\n & .header-container {\n position: sticky;\n top: 0;\n z-index: var(--z-index-sticky-header);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n & tbody {\n /**\n * Necessary for the absolutely placed elements inside of it (e.g. cell selection overlay)\n * to scroll with the body.\n */\n position: relative;\n\n /**\n * Otherwise there is a small margin from the left that leads to an unnecessary scrollbar\n */\n display: block;\n\n /**\n * Necessary so that non-virtual elements (like drag handles) are wide enough\n */\n width: fit-content;\n }\n}\n\n.empty-state-container {\n position: sticky;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n\n /*\n The two spacers share the space around the empty state equally, i.e. they\n center it - but the upper one is capped, so with plenty of space the message\n stays close to the header instead of drifting into the middle of the table.\n */\n &::before,\n &::after {\n flex: 1 1 0;\n content: \"\";\n }\n\n &::before {\n max-height: var(--kds-spacing-container-5x);\n }\n\n /* Rather overflow than squeeze the message when the space gets tight. */\n & > * {\n flex: 0 0 auto;\n }\n}\n\n.resize-scroll-spacer {\n /* Only animate when collapsing back after a resize ends; while resizing the width\n tracks the growing column and must update instantly. */\n &.collapsing {\n transition: width 0.2s ease;\n }\n}\n</style>\n","'use strict';\n\nvar rafThrottle = function rafThrottle(callback) {\n var requestId = null;\n var lastArgs;\n var later = function later(context) {\n return function () {\n requestId = null;\n callback.apply(context, lastArgs);\n };\n };\n var throttled = function throttled() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n lastArgs = args;\n if (requestId === null) {\n requestId = requestAnimationFrame(later(this));\n }\n };\n throttled.cancel = function () {\n cancelAnimationFrame(requestId);\n requestId = null;\n };\n return throttled;\n};\n\nmodule.exports = rafThrottle;\n","// a vue composable for the capability of the the TableUI to detect the available width for all columns.\nimport {\n type Ref,\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from \"vue\";\nimport throttle from \"raf-throttle\";\n\nexport const useTotalWidth = (root: Ref<null | HTMLElement>) => {\n const totalWidth: Ref<null | number> = ref(null);\n\n const rootResizeCallback = throttle((entries) => {\n const rect = entries[0].contentRect;\n totalWidth.value = rect.width;\n });\n const rootResizeObserver = new ResizeObserver(rootResizeCallback);\n\n onMounted(() => {\n if (root.value) {\n rootResizeObserver.observe(root.value);\n }\n });\n\n onBeforeUnmount(() => {\n if (root.value) {\n rootResizeObserver.unobserve(root.value);\n }\n });\n\n return totalWidth;\n};\n\nconst useScrollbarSizes = (scrolledElement: Ref<null | HTMLElement>) => {\n const currentScrollBarWidth = ref<null | number>(null);\n const currentScrollBarHeight = ref<null | number>(null);\n\n const scrollbarWidthCallback = throttle((entries) => {\n const totalWidth = entries[0].borderBoxSize[0].inlineSize;\n const innerWidth = entries[0].contentRect.width;\n const totalHeight = entries[0].borderBoxSize[0].blockSize;\n const innerHeight = entries[0].contentRect.height;\n currentScrollBarHeight.value = Math.ceil(totalHeight - innerHeight);\n currentScrollBarWidth.value = Math.ceil(totalWidth - innerWidth);\n });\n const scrollbarWidthObserver = new ResizeObserver(scrollbarWidthCallback);\n\n onMounted(() => {\n // next tick necessary for the virtual scroller to be rendered\n nextTick(() => {\n if (scrolledElement.value) {\n scrollbarWidthObserver.observe(scrolledElement.value);\n }\n });\n });\n\n /**\n * If the scroller is refreshed, the scrollbar width observer needs to be updated.\n */\n watch(\n () => scrolledElement.value,\n (newEl, oldEl) => {\n if (oldEl !== null) {\n scrollbarWidthObserver.unobserve(oldEl);\n }\n if (newEl !== null) {\n scrollbarWidthObserver.observe(newEl);\n }\n },\n );\n\n onBeforeUnmount(() => {\n if (scrolledElement.value) {\n scrollbarWidthObserver.unobserve(scrolledElement.value);\n }\n });\n\n return { currentScrollBarWidth, currentScrollBarHeight };\n};\n\nexport const useAvailableWidth = ({\n emitAvailableWidth,\n specialColumnsSizeTotal,\n refs: { scrolledElement },\n totalWidth,\n}: {\n emitAvailableWidth: (availableWidth: number) => void;\n specialColumnsSizeTotal: Ref<number>;\n refs: {\n scrolledElement: Ref<null | HTMLElement>;\n };\n totalWidth: Ref<null | number>;\n}) => {\n const { currentScrollBarWidth, currentScrollBarHeight } =\n useScrollbarSizes(scrolledElement);\n\n const totalWidthWithoutSpecialColumns = computed(() => {\n if (totalWidth.value === null) {\n return null;\n }\n return totalWidth.value - specialColumnsSizeTotal.value;\n });\n const currentDataWidth = computed(() => {\n if (\n totalWidthWithoutSpecialColumns.value === null ||\n currentScrollBarWidth.value === null\n ) {\n return null;\n }\n return totalWidthWithoutSpecialColumns.value - currentScrollBarWidth.value;\n });\n\n const innerWidthToBodyWidth = (columnsWidth: number) => {\n return columnsWidth + specialColumnsSizeTotal.value;\n };\n\n const fitsInsideTotalWidth = (bodyWidth: number) => {\n let width = totalWidth.value ?? 0;\n if (currentScrollBarWidth.value) {\n width -= currentScrollBarWidth.value;\n }\n return Math.floor(bodyWidth) <= width;\n };\n\n const allSizes = computed(() => ({\n currentDataWidth: currentDataWidth.value,\n totalWidthWithoutSpecialColumns: totalWidthWithoutSpecialColumns.value,\n }));\n\n watch(\n allSizes,\n (\n {\n currentDataWidth: newCurrentDataWidth,\n totalWidthWithoutSpecialColumns: newTotalWidthWithoutSpecialColumns,\n },\n {\n currentDataWidth: oldCurrentDataWidth,\n totalWidthWithoutSpecialColumns: oldTotalWidthWithoutSpecialColumns,\n },\n ) => {\n if (newCurrentDataWidth !== null) {\n const changeIsInducedByAppearingScrollbar =\n oldTotalWidthWithoutSpecialColumns ===\n newTotalWidthWithoutSpecialColumns &&\n oldCurrentDataWidth !== null &&\n oldCurrentDataWidth > newCurrentDataWidth;\n const yScrollBarExistsBecauseOfXScrollBar =\n currentScrollBarHeight.value &&\n scrolledElement.value!.scrollHeight <=\n scrolledElement.value!.clientHeight + currentScrollBarHeight.value;\n if (\n changeIsInducedByAppearingScrollbar &&\n yScrollBarExistsBecauseOfXScrollBar\n ) {\n /**\n * Updating the available width in this case can lead to an endless flicker loop:\n * 1. An x-scrollbar appears, because the content is too wide\n * 2. A y-scrollbar appears, because the x-scrollbar appeared\n * 3. The available width is updated, because the y-scrollbar appeared\n * 4. The content is scaled accordingly\n * 5. The x-scrollbar disappears, because the content is now smaller\n * 6. The y-scrollbar disappears, because the x-scrollbar disappeared\n * 7. The available width is updated, because the y-scrollbar disappeared\n * 8. The content is scaled accordingly\n * 9. Go to 1.\n *\n * To prevent this, we do not update the available width, if the y-scrollbar only exists because of the x-scrollbar.\n */\n return;\n }\n emitAvailableWidth(newCurrentDataWidth);\n }\n },\n );\n\n return { innerWidthToBodyWidth, fitsInsideTotalWidth };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, toRef } from \"vue\";\n\nimport \"../assets/global-z-indices.css\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../constants\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableCoreVirtual from \"./TableCoreVirtual.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport { useAvailableWidth } from \"./composables/useAvailableWidth\";\nimport { useBodyWidth } from \"./composables/useBodyWidth\";\nimport { provideCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nconst props = defineProps<{\n scrollData: DataItem[][];\n scrollConfig: {\n itemSize: number;\n numRowsAbove: number;\n numRowsBelow: number;\n compact: boolean;\n };\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n totalWidth: null | number;\n currentRowHeight: number | \"dynamic\";\n columnResize: {\n active: boolean;\n };\n newColumnButtonWidth: number;\n}>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n \"update:available-width\": [newAvailableWidth: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst tableCoreVirtual = ref<InstanceType<typeof TableCoreVirtual> | null>(\n null,\n);\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n virtualScrollToPosition: (position: { top?: number; left?: number }) =>\n tableCoreVirtual.value?.scrollToPosition(position),\n getVirtualScrollStart: () => tableCoreVirtual.value?.getScrollStart(),\n getVirtualBody: () => tableCoreVirtual.value?.getBody(),\n getVirtualContainer: () => tableCoreVirtual.value?.getContainer(),\n});\n\nconst selectionSize = computed(() =>\n props.tableConfig.showSelection ? SPECIAL_COLUMNS_SIZE : 0,\n);\nconst deletionSize = computed(() =>\n props.tableConfig.enableRowDeletion ? SPECIAL_COLUMNS_SIZE : 0,\n);\n\nconst rightSideSize = computed(() => {\n const rowSubMenuSpace =\n (props.subMenuConfig.subMenuItems ?? []).length > 0 ||\n props.subMenuConfig.reserveSpaceForSubMenu === \"always\"\n ? SPECIAL_COLUMNS_SIZE\n : 0;\n return rowSubMenuSpace + props.newColumnButtonWidth;\n});\n\nconst scrolledElement = ref<HTMLElement | null>(null);\nconst { fitsInsideTotalWidth, innerWidthToBodyWidth } = useAvailableWidth({\n emitAvailableWidth: (newWidth) => emit(\"update:available-width\", newWidth),\n specialColumnsSizeTotal: computed(\n () => selectionSize.value + deletionSize.value + rightSideSize.value,\n ),\n refs: { scrolledElement },\n totalWidth: toRef(props, \"totalWidth\"),\n});\n\nconst { colSizes } = injectColumnSizes();\n\n/**\n * Note that this currentBodyWidth is currently smaller than the actual content width of the scrolled container\n * in case column resizing is active, since the resize handle area does not fit within a headers cell completely.\n *\n * It is intentionally not read in this component's template: instead it is written to a CSS variable on the\n * scroll container by {@link useBodyWidth} (consumed by the sticky header and the resize scroll spacer) and\n * provided as a numeric ref for the few JS-only consumers. This keeps TableCore from re-rendering whenever the\n * live column sizes change (e.g. per frame during a column resize).\n */\nconst currentBodyWidth = computed(() => {\n const widthContentColumns = colSizes.value.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (prev: any, curr: any) => prev + curr,\n 0,\n );\n return innerWidthToBodyWidth(widthContentColumns);\n});\nuseBodyWidth(currentBodyWidth, scrolledElement);\n\nconst fitsWithoutHorizontalScrollbar = computed(() =>\n fitsInsideTotalWidth(currentBodyWidth.value),\n);\n\nprovideCommonScrollContainerProps(scrolledElement, {\n fitsWithoutHorizontalScrollbar,\n columnResizeActive: computed(() => props.columnResize.active),\n});\n</script>\n\n<template>\n <TableCoreVirtual\n ref=\"tableCoreVirtual\"\n :scroll-data=\"scrollData[0]\"\n :scroll-config=\"scrollConfig\"\n :special-column-sizes=\"{\n selectionSize,\n deletionSize,\n rightSideSize,\n }\"\n :table-config=\"tableConfig\"\n :column-resize-active=\"columnResize.active\"\n @scroller-update=\"\n (startIndex, endIndex) => emit('scrollerUpdate', startIndex, endIndex)\n \"\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #header=\"{ getDragHandleHeight }\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </template>\n <template #row=\"{ row, rowInd }\">\n <slot name=\"row\" :row=\"row\" :row-ind=\"rowInd\" :group-ind=\"null\" />\n </template>\n <template #cell-selection-overlay>\n <slot name=\"cell-selection-overlay\" />\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n <template v-if=\"$slots['empty-state']\" #empty-state>\n <slot name=\"empty-state\" />\n </template>\n </TableCoreVirtual>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, toRef } from \"vue\";\n\nimport \"../assets/global-z-indices.css\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../constants\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableCoreVirtual from \"./TableCoreVirtual.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport { useAvailableWidth } from \"./composables/useAvailableWidth\";\nimport { useBodyWidth } from \"./composables/useBodyWidth\";\nimport { provideCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nconst props = defineProps<{\n scrollData: DataItem[][];\n scrollConfig: {\n itemSize: number;\n numRowsAbove: number;\n numRowsBelow: number;\n compact: boolean;\n };\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n totalWidth: null | number;\n currentRowHeight: number | \"dynamic\";\n columnResize: {\n active: boolean;\n };\n newColumnButtonWidth: number;\n}>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n \"update:available-width\": [newAvailableWidth: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst tableCoreVirtual = ref<InstanceType<typeof TableCoreVirtual> | null>(\n null,\n);\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n virtualScrollToPosition: (position: { top?: number; left?: number }) =>\n tableCoreVirtual.value?.scrollToPosition(position),\n getVirtualScrollStart: () => tableCoreVirtual.value?.getScrollStart(),\n getVirtualBody: () => tableCoreVirtual.value?.getBody(),\n getVirtualContainer: () => tableCoreVirtual.value?.getContainer(),\n});\n\nconst selectionSize = computed(() =>\n props.tableConfig.showSelection ? SPECIAL_COLUMNS_SIZE : 0,\n);\nconst deletionSize = computed(() =>\n props.tableConfig.enableRowDeletion ? SPECIAL_COLUMNS_SIZE : 0,\n);\n\nconst rightSideSize = computed(() => {\n const rowSubMenuSpace =\n (props.subMenuConfig.subMenuItems ?? []).length > 0 ||\n props.subMenuConfig.reserveSpaceForSubMenu === \"always\"\n ? SPECIAL_COLUMNS_SIZE\n : 0;\n return rowSubMenuSpace + props.newColumnButtonWidth;\n});\n\nconst scrolledElement = ref<HTMLElement | null>(null);\nconst { fitsInsideTotalWidth, innerWidthToBodyWidth } = useAvailableWidth({\n emitAvailableWidth: (newWidth) => emit(\"update:available-width\", newWidth),\n specialColumnsSizeTotal: computed(\n () => selectionSize.value + deletionSize.value + rightSideSize.value,\n ),\n refs: { scrolledElement },\n totalWidth: toRef(props, \"totalWidth\"),\n});\n\nconst { colSizes } = injectColumnSizes();\n\n/**\n * Note that this currentBodyWidth is currently smaller than the actual content width of the scrolled container\n * in case column resizing is active, since the resize handle area does not fit within a headers cell completely.\n *\n * It is intentionally not read in this component's template: instead it is written to a CSS variable on the\n * scroll container by {@link useBodyWidth} (consumed by the sticky header and the resize scroll spacer) and\n * provided as a numeric ref for the few JS-only consumers. This keeps TableCore from re-rendering whenever the\n * live column sizes change (e.g. per frame during a column resize).\n */\nconst currentBodyWidth = computed(() => {\n const widthContentColumns = colSizes.value.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (prev: any, curr: any) => prev + curr,\n 0,\n );\n return innerWidthToBodyWidth(widthContentColumns);\n});\nuseBodyWidth(currentBodyWidth, scrolledElement);\n\nconst fitsWithoutHorizontalScrollbar = computed(() =>\n fitsInsideTotalWidth(currentBodyWidth.value),\n);\n\nprovideCommonScrollContainerProps(scrolledElement, {\n fitsWithoutHorizontalScrollbar,\n columnResizeActive: computed(() => props.columnResize.active),\n});\n</script>\n\n<template>\n <TableCoreVirtual\n ref=\"tableCoreVirtual\"\n :scroll-data=\"scrollData[0]\"\n :scroll-config=\"scrollConfig\"\n :special-column-sizes=\"{\n selectionSize,\n deletionSize,\n rightSideSize,\n }\"\n :table-config=\"tableConfig\"\n :column-resize-active=\"columnResize.active\"\n @scroller-update=\"\n (startIndex, endIndex) => emit('scrollerUpdate', startIndex, endIndex)\n \"\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #header=\"{ getDragHandleHeight }\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </template>\n <template #row=\"{ row, rowInd }\">\n <slot name=\"row\" :row=\"row\" :row-ind=\"rowInd\" :group-ind=\"null\" />\n </template>\n <template #cell-selection-overlay>\n <slot name=\"cell-selection-overlay\" />\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n <template v-if=\"$slots['empty-state']\" #empty-state>\n <slot name=\"empty-state\" />\n </template>\n </TableCoreVirtual>\n</template>\n","import { reactive, ref } from \"vue\";\n\nexport const useBoolean = (initialValue = false) => {\n const state = ref(initialValue);\n const setTrue = () => {\n state.value = true;\n };\n const setFalse = () => {\n state.value = false;\n };\n return reactive({ state, setTrue, setFalse });\n};\n","import { type ComputedRef, type Ref, onMounted, onUnmounted } from \"vue\";\n\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport type CellSelectionOverlay from \"../ui/CellSelectionOverlay.vue\";\n\nimport type { CellPosition } from \"./useCellSelection\";\n\nexport const useCellCopyPaste = ({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy,\n onPaste,\n onDelete,\n onCut,\n}: {\n focusWithin: Ref<boolean>;\n isEditingCell: Ref<boolean>;\n selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n >;\n selectedCell: ComputedRef<CellPosition | undefined>;\n isEditingEnabled: ComputedRef<boolean>;\n onCopy: ({ withHeaders }: { withHeaders: boolean }) => void;\n onPaste?: () => void;\n onCut?: () => void;\n onDelete?: () => void;\n}) => {\n const isHeaderCellSelected = () => selectedCell.value?.y === -1;\n\n const triggerCopyAnimation = () => {\n if (Array.isArray(selectionOverlay.value)) {\n selectionOverlay.value[0]?.triggerCopied();\n } else if (selectionOverlay.value) {\n selectionOverlay.value.triggerCopied();\n }\n };\n\n const isBodySelected = () => {\n return focusWithin.value && !isHeaderCellSelected() && !isEditingCell.value;\n };\n\n const primaryModifierKey = getMetaOrCtrlKey();\n\n const onCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (!isBodySelected()) {\n return;\n }\n triggerCopyAnimation();\n onCopy({ withHeaders });\n };\n\n const onCutSelection = () => {\n if (isEditingEnabled.value && onCut && isBodySelected()) {\n triggerCopyAnimation();\n onCut();\n }\n };\n\n const onDeleteSelection = () => {\n if (isEditingEnabled.value && onDelete && isBodySelected()) {\n onDelete();\n }\n };\n\n const onPasteSelection = () => {\n if (isEditingEnabled.value && onPaste && isBodySelected()) {\n onPaste();\n }\n };\n\n const handleDefaultCopyEvent = () => {\n onCopySelection({ withHeaders: false });\n };\n\n const handleCopyOnKeydown = (e: KeyboardEvent) => {\n if (e[primaryModifierKey]) {\n onCopySelection({ withHeaders: true });\n }\n };\n\n onMounted(() => {\n globalThis.addEventListener(\"copy\", handleDefaultCopyEvent);\n if (onPaste) {\n globalThis.addEventListener(\"paste\", onPasteSelection);\n }\n if (onCut) {\n globalThis.addEventListener(\"cut\", onCutSelection);\n }\n });\n\n onUnmounted(() => {\n globalThis.removeEventListener(\"copy\", handleDefaultCopyEvent);\n if (onPaste) {\n globalThis.removeEventListener(\"paste\", onPasteSelection);\n }\n if (onCut) {\n globalThis.removeEventListener(\"cut\", onCutSelection);\n }\n });\n\n return { handleCopyOnKeydown, handleDeleteSelection: onDeleteSelection };\n};\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { type Ref, computed, ref, watch } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nexport type CellPosition = {\n x: number;\n y: number;\n};\n\nclass CellRect {\n anchor: CellPosition;\n opposite: CellPosition;\n\n constructor(anchorPosition: CellPosition) {\n this.anchor = this.opposite = anchorPosition;\n }\n\n setCorner(cellPos: CellPosition) {\n if (isEqual(this.opposite, cellPos)) {\n return;\n }\n this.opposite = cellPos;\n }\n\n getMinMax(coord: keyof CellPosition) {\n const coords = [this.anchor[coord], this.opposite[coord]];\n return { min: Math.min(...coords), max: Math.max(...coords) };\n }\n}\n\nexport type MinMax = { min: number; max: number };\n\nexport type Rect = { x: MinMax; y: MinMax };\n\nexport type RectId = number;\n\nexport const useCellSelection = (enableCellSelection: Ref<boolean>) => {\n const cellRect = ref<CellRect | null>(null);\n const currentRectId: Ref<RectId | null> = ref(null);\n\n const rectMinMax = computed<Rect | null>(() => {\n const rectValue = cellRect.value;\n if (rectValue === null) {\n return null;\n }\n return {\n x: rectValue.getMinMax(\"x\"),\n y: rectValue.getMinMax(\"y\"),\n };\n });\n\n const selectedCell = computed(() => cellRect.value?.opposite);\n\n const isSingleSelectedCell = (cellPosition: CellPosition) => {\n return (\n cellRect.value !== null &&\n isEqual(cellRect.value.anchor, cellRect.value.opposite) &&\n isEqual(cellRect.value.anchor, cellPosition)\n );\n };\n\n const clearCellSelection = () => {\n cellRect.value = null;\n currentRectId.value = null;\n };\n\n watch(\n () => enableCellSelection.value,\n (isEnabled) => {\n if (!isEnabled) {\n clearCellSelection();\n }\n },\n );\n\n const selectCell = (\n cellPosition: CellPosition,\n rectId: RectId,\n ignoreIfSelected: boolean = false,\n ) => {\n if (\n rectId === currentRectId.value &&\n isSingleSelectedCell(cellPosition) &&\n !ignoreIfSelected\n ) {\n clearCellSelection();\n return;\n }\n cellRect.value = new CellRect(cellPosition);\n currentRectId.value = rectId;\n };\n\n const expandCellSelection = (cellPosition: CellPosition, rectId: RectId) => {\n if (cellRect.value === null || currentRectId.value !== rectId) {\n selectCell(cellPosition, rectId);\n return;\n }\n cellRect.value.setCorner(cellPosition);\n };\n\n const applyIfEnabled = (method: (...args: any[]) => void) => {\n return (...args: any[]) => {\n if (enableCellSelection.value) {\n method(...args);\n }\n };\n };\n\n return {\n selectCell: applyIfEnabled(selectCell),\n expandCellSelection: applyIfEnabled(expandCellSelection),\n clearCellSelection,\n rectMinMax,\n selectedCell,\n currentRectId,\n isSingleSelectedCell,\n };\n};\n","/**\n * This method returns true if we should stop processing the key event since it is\n * to be ignored outside of the editing context.\n */\nconst isToBeIgnoredKeyEvent = (keyEvent: KeyboardEvent) => {\n // Ignore backspace and delete to prevent clearing the cell value while editing\n return keyEvent.key === \"Backspace\" || keyEvent.key === \"Delete\";\n};\n\nexport const createEditingCellKeydownHandler = ({\n moveSelection,\n}: {\n moveSelection: (\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) => void;\n}) => {\n return (event: KeyboardEvent) => {\n if (isToBeIgnoredKeyEvent(event)) {\n event.stopPropagation();\n return;\n }\n if (event.key === \"Tab\") {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n moveSelection(horizontalMove, 0, false);\n } else if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n event.stopPropagation();\n moveSelection(0, 1, false);\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n // Select the underlying cell again to stop editing\n moveSelection(0, 0, false);\n }\n };\n};\n","import { nextTick, ref } from \"vue\";\n\n/**\n * Keeps the table hidden until one tick after the available width has been\n * reported for the first time.\n *\n * Column sizes that are derived from the available width (see the\n * `update:available-width` emit) can only be applied once that width is known,\n * i.e. anything rendered before that is rendered at sizes which are about to\n * change — a visible jump on every initial load. Waiting one tick after the\n * report lets the reaction to it (and with it the column-size CSS variables)\n * reach the DOM first, so the first frame the user sees is the final one.\n */\nexport const useVisibleAfterAvailableWidth = () => {\n const isVisible = ref(false);\n\n const onAvailableWidthReported = async () => {\n if (isVisible.value) {\n return;\n }\n await nextTick();\n isVisible.value = true;\n };\n\n return { isVisible, onAvailableWidthReported };\n};\n","<template>\n <div class=\"popover\">\n <span class=\"header\">\n <slot name=\"header\" />\n </span>\n <div class=\"body\">\n <slot name=\"body\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.popover {\n display: flex;\n flex-direction: column;\n gap: var(--kds-spacing-container-0-5x);\n align-items: flex-start;\n max-height: var(--kds-dimension-component-height-25x);\n padding: var(--kds-spacing-container-0-75x);\n background-color: var(--kds-color-surface-default);\n border-radius: var(--kds-border-radius-container-0-50x);\n box-shadow: var(--kds-elevation-level-3);\n\n & .header {\n font: var(--kds-font-base-title-xsmall);\n color: var(--kds-color-text-and-icon-muted);\n }\n\n & .body {\n width: 100%;\n }\n}\n</style>\n","import { type Ref, ref, watch } from \"vue\";\n\nexport const useButtonPopoverInteraction = ({\n keepButtonActive,\n}: {\n keepButtonActive: Ref<boolean>;\n}) => {\n const buttonIsActive = ref(keepButtonActive.value);\n const showPopover = ref(false);\n\n watch(keepButtonActive, (newValue) => {\n buttonIsActive.value = newValue || showPopover.value;\n });\n\n const onButtonClick = (isActive: boolean) => {\n showPopover.value = !showPopover.value;\n buttonIsActive.value = keepButtonActive.value || isActive;\n };\n\n const onPopoverToggle = (isOpen: boolean) => {\n buttonIsActive.value = keepButtonActive.value || isOpen;\n showPopover.value = isOpen;\n };\n\n const openPopover = () => {\n showPopover.value = true;\n buttonIsActive.value = true;\n };\n\n return {\n onButtonClick,\n onPopoverToggle,\n buttonIsActive,\n showPopover,\n openPopover,\n };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport {\n KdsDropdown,\n type KdsDropdownOption,\n KdsIcon,\n KdsPopover,\n KdsToggleButton,\n} from \"@knime/kds-components\";\nimport { dimension } from \"@knime/kds-styles/tokens\";\n\nimport type { ColSortValue } from \"../../..\";\n\nimport PopoverContainer from \"./PopoverContainer.vue\";\nimport { useButtonPopoverInteraction } from \"./useButtonPopoverInteraction\";\n\nconst POPOVER_MAX_INLINE_SIZE = dimension.component.width[\"20x\"].css.variable;\n\nexport type SortControlOptions = {\n selectableColumns: KdsDropdownOption[];\n selectableDirections: Record<string, KdsDropdownOption[]>;\n};\n\nconst NONE_COLUMN_VALUE = \"None\";\n\nconst props = defineProps<{\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst emit = defineEmits<{\n columnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n}>();\n\nconst sortPopoverRef = useTemplateRef(\"sortPopoverRef\");\nconst sortButtonEl = useTemplateRef(\"sortButton\");\n\n// Local column selection: tracks the user's in-progress pick independently of\n// whether a sort has been emitted yet. Synced from props when external state\n// changes (e.g. sort triggered from column header).\nconst selectedColumn = ref(\n props.colSortValues?.[0]?.id?.toString() ?? NONE_COLUMN_VALUE,\n);\nwatch(\n () => props.colSortValues?.[0]?.id,\n (val) => {\n if (val === undefined && selectedColumn.value !== undefined) {\n return;\n }\n selectedColumn.value = val?.toString() ?? NONE_COLUMN_VALUE;\n },\n);\n\nconst hasSortConfig = computed(\n () =>\n props.colSortValues !== undefined &&\n props.colSortValues[0]?.id !== undefined &&\n props.colSortValues[0]?.direction !== undefined,\n);\n\nconst possibleColumns = computed(() => [\n { id: NONE_COLUMN_VALUE, text: NONE_COLUMN_VALUE },\n ...props.sortControlOptions.selectableColumns,\n]);\n\nconst possibleDirections = computed(() =>\n selectedColumn.value === NONE_COLUMN_VALUE\n ? []\n : (props.sortControlOptions.selectableDirections[selectedColumn.value] ??\n []),\n);\n\nconst selectedSortDirection = computed(\n () => props.colSortValues?.[0]?.direction?.toString() ?? \"\",\n);\n\nconst { buttonIsActive, showPopover, onButtonClick, onPopoverToggle } =\n useButtonPopoverInteraction({ keepButtonActive: hasSortConfig });\n\nconst onSortColumnChange = (columnId: string) => {\n selectedColumn.value = columnId;\n if (columnId === NONE_COLUMN_VALUE) {\n emit(\"columnSort\", undefined, 0);\n return;\n }\n emit(\n \"columnSort\",\n columnId,\n (props.colSortValues?.[0]?.direction || 1) as 1 | -1,\n );\n};\n\nconst onSortDirectionChange = (direction: string) => {\n emit(\n \"columnSort\",\n selectedColumn.value,\n Number.parseInt(direction, 10) as 0 | 1 | -1,\n );\n};\n</script>\n\n<template>\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"buttonIsActive\"\n label=\"Sorting\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"sort-ascending\"\n :aria-controls=\"sortPopoverRef?.popoverId\"\n :aria-expanded=\"showPopover\"\n aria-haspopup=\"dialog\"\n @update:model-value=\"onButtonClick\"\n />\n\n <KdsPopover\n ref=\"sortPopoverRef\"\n :anchor=\"sortButtonEl?.$el\"\n :model-value=\"showPopover\"\n aria-label=\"Sort\"\n popover-type=\"auto\"\n role=\"dialog\"\n class=\"sort-popover\"\n stretch-inline\n :max-inline-size=\"POPOVER_MAX_INLINE_SIZE\"\n @update:model-value=\"onPopoverToggle\"\n >\n <PopoverContainer class=\"popover-container\">\n <template #header>\n <KdsIcon name=\"sort-ascending\" size=\"small\" /> Sorting\n </template>\n <template #body>\n <div class=\"body\">\n <KdsDropdown\n :model-value=\"selectedColumn\"\n :possible-values=\"possibleColumns\"\n ariaLabel=\"Column to sort by\"\n @update:model-value=\"onSortColumnChange\"\n />\n <KdsDropdown\n :model-value=\"selectedSortDirection\"\n :possible-values=\"possibleDirections\"\n ariaLabel=\"Sort direction\"\n :disabled=\"selectedColumn === NONE_COLUMN_VALUE\"\n placeholder=\"No sorting\"\n @update:model-value=\"onSortDirectionChange\"\n />\n </div>\n </template>\n </PopoverContainer>\n </KdsPopover>\n</template>\n\n<style scoped>\n.sort-popover {\n position-try-order: most-inline-size;\n}\n\n.popover-container {\n .body {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--kds-spacing-container-0-5x);\n\n & > * {\n min-width: 0;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport {\n KdsDropdown,\n type KdsDropdownOption,\n KdsIcon,\n KdsPopover,\n KdsToggleButton,\n} from \"@knime/kds-components\";\nimport { dimension } from \"@knime/kds-styles/tokens\";\n\nimport type { ColSortValue } from \"../../..\";\n\nimport PopoverContainer from \"./PopoverContainer.vue\";\nimport { useButtonPopoverInteraction } from \"./useButtonPopoverInteraction\";\n\nconst POPOVER_MAX_INLINE_SIZE = dimension.component.width[\"20x\"].css.variable;\n\nexport type SortControlOptions = {\n selectableColumns: KdsDropdownOption[];\n selectableDirections: Record<string, KdsDropdownOption[]>;\n};\n\nconst NONE_COLUMN_VALUE = \"None\";\n\nconst props = defineProps<{\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst emit = defineEmits<{\n columnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n}>();\n\nconst sortPopoverRef = useTemplateRef(\"sortPopoverRef\");\nconst sortButtonEl = useTemplateRef(\"sortButton\");\n\n// Local column selection: tracks the user's in-progress pick independently of\n// whether a sort has been emitted yet. Synced from props when external state\n// changes (e.g. sort triggered from column header).\nconst selectedColumn = ref(\n props.colSortValues?.[0]?.id?.toString() ?? NONE_COLUMN_VALUE,\n);\nwatch(\n () => props.colSortValues?.[0]?.id,\n (val) => {\n if (val === undefined && selectedColumn.value !== undefined) {\n return;\n }\n selectedColumn.value = val?.toString() ?? NONE_COLUMN_VALUE;\n },\n);\n\nconst hasSortConfig = computed(\n () =>\n props.colSortValues !== undefined &&\n props.colSortValues[0]?.id !== undefined &&\n props.colSortValues[0]?.direction !== undefined,\n);\n\nconst possibleColumns = computed(() => [\n { id: NONE_COLUMN_VALUE, text: NONE_COLUMN_VALUE },\n ...props.sortControlOptions.selectableColumns,\n]);\n\nconst possibleDirections = computed(() =>\n selectedColumn.value === NONE_COLUMN_VALUE\n ? []\n : (props.sortControlOptions.selectableDirections[selectedColumn.value] ??\n []),\n);\n\nconst selectedSortDirection = computed(\n () => props.colSortValues?.[0]?.direction?.toString() ?? \"\",\n);\n\nconst { buttonIsActive, showPopover, onButtonClick, onPopoverToggle } =\n useButtonPopoverInteraction({ keepButtonActive: hasSortConfig });\n\nconst onSortColumnChange = (columnId: string) => {\n selectedColumn.value = columnId;\n if (columnId === NONE_COLUMN_VALUE) {\n emit(\"columnSort\", undefined, 0);\n return;\n }\n emit(\n \"columnSort\",\n columnId,\n (props.colSortValues?.[0]?.direction || 1) as 1 | -1,\n );\n};\n\nconst onSortDirectionChange = (direction: string) => {\n emit(\n \"columnSort\",\n selectedColumn.value,\n Number.parseInt(direction, 10) as 0 | 1 | -1,\n );\n};\n</script>\n\n<template>\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"buttonIsActive\"\n label=\"Sorting\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"sort-ascending\"\n :aria-controls=\"sortPopoverRef?.popoverId\"\n :aria-expanded=\"showPopover\"\n aria-haspopup=\"dialog\"\n @update:model-value=\"onButtonClick\"\n />\n\n <KdsPopover\n ref=\"sortPopoverRef\"\n :anchor=\"sortButtonEl?.$el\"\n :model-value=\"showPopover\"\n aria-label=\"Sort\"\n popover-type=\"auto\"\n role=\"dialog\"\n class=\"sort-popover\"\n stretch-inline\n :max-inline-size=\"POPOVER_MAX_INLINE_SIZE\"\n @update:model-value=\"onPopoverToggle\"\n >\n <PopoverContainer class=\"popover-container\">\n <template #header>\n <KdsIcon name=\"sort-ascending\" size=\"small\" /> Sorting\n </template>\n <template #body>\n <div class=\"body\">\n <KdsDropdown\n :model-value=\"selectedColumn\"\n :possible-values=\"possibleColumns\"\n ariaLabel=\"Column to sort by\"\n @update:model-value=\"onSortColumnChange\"\n />\n <KdsDropdown\n :model-value=\"selectedSortDirection\"\n :possible-values=\"possibleDirections\"\n ariaLabel=\"Sort direction\"\n :disabled=\"selectedColumn === NONE_COLUMN_VALUE\"\n placeholder=\"No sorting\"\n @update:model-value=\"onSortDirectionChange\"\n />\n </div>\n </template>\n </PopoverContainer>\n </KdsPopover>\n</template>\n\n<style scoped>\n.sort-popover {\n position-try-order: most-inline-size;\n}\n\n.popover-container {\n .body {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--kds-spacing-container-0-5x);\n\n & > * {\n min-width: 0;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from \"vue\";\n\nimport {\n KdsButton,\n KdsInfoToggleButton,\n KdsMenuButton,\n KdsSearchInput,\n} from \"@knime/kds-components\";\n\nimport type { ActionConfig, ActionState, ColSortValue } from \"../../\";\nimport type { TableState } from \"../../types/TableConfig\";\n\nimport SortControl, {\n type SortControlOptions,\n} from \"./actionbar/SortControl.vue\";\n\nconst {\n tableSizes,\n rowLabel = \"Rows\",\n actionState,\n showTableSize = true,\n colSortValues = [],\n actionConfig,\n} = defineProps<{\n tableSizes?: TableState[\"tableSizes\"];\n rowLabel?: string;\n actionState?: ActionState;\n showTableSize?: boolean;\n actionConfig: ActionConfig;\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst slots = useSlots();\n\nconst viewType = computed(() => actionState?.viewType ?? \"DEFAULT\");\n\nconst isTemporaryView = computed(\n () => viewType.value === \"TEMP_VIEW\" || viewType.value === \"PREVIEW\",\n);\nconst isPreview = computed(() => viewType.value === \"PREVIEW\");\nconst showResetButton = computed(() => viewType.value === \"TEMP_VIEW\");\n\nconst hasContent = computed(\n () =>\n isTemporaryView.value ||\n showTableSize ||\n (actionConfig.enableSorting && !actionConfig.hideSortingButton) ||\n actionConfig.enableSearch ||\n actionConfig.forceShow ||\n Boolean(slots[\"action-bar-left\"]),\n);\n\n/**\n * Renders \"total\" by default, and \"current of total\" only when `current` is\n * given and strictly below `total`. The `current >= total` guard prevents an\n * inconsistent \"m of n\" where m would not be smaller than n. An unknown total\n * (`null`) renders as \"-\".\n */\nconst formatCount = (label: string, total: number | null, current?: number) => {\n if (total === null) {\n return `${label}: -`;\n }\n const appendTotal = current !== undefined && current < total;\n return `${label}: ${appendTotal ? `${current} of ${total}` : total}`;\n};\n\nconst rowText = computed(() =>\n formatCount(\n rowLabel,\n tableSizes ? tableSizes.totalNumRows : 0,\n tableSizes?.currentNumRows,\n ),\n);\n\nconst columnText = computed(() => {\n const totalNumColumns = tableSizes?.totalNumColumns ?? 0;\n if (totalNumColumns < 2) {\n return undefined;\n }\n return formatCount(\"Cols\", totalNumColumns, tableSizes?.currentNumColumns);\n});\n\nconst dimensionText = computed(() => {\n if (columnText.value === undefined) {\n return rowText.value;\n }\n return `${rowText.value} | ${columnText.value}`;\n});\n\nconst showRowCountDropdown = computed(() =>\n Boolean(actionConfig.rowCountItems?.length),\n);\n\nconst emit = defineEmits<{\n resetTemporaryView: [];\n onColumnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n \"update:searchTerm\": [newSearchTerm: string];\n}>();\n</script>\n\n<template>\n <div\n v-if=\"hasContent\"\n :class=\"['kds-table-action-bar', { 'temporary-view': isTemporaryView }]\"\n >\n <div class=\"left\">\n <SortControl\n v-if=\"actionConfig.enableSorting && !actionConfig.hideSortingButton\"\n :col-sort-values\n :sort-control-options\n @column-sort=\"\n (columnId, colDir) => emit('onColumnSort', columnId, colDir)\n \"\n />\n <slot name=\"action-bar-left\" />\n </div>\n <div class=\"center\">\n <div v-if=\"isPreview\" class=\"preview\">\n <span class=\"preview-label\">Preview</span>\n <KdsInfoToggleButton\n v-if=\"actionState?.previewDescription\"\n :content=\"actionState.previewDescription\"\n />\n </div>\n <span\n v-if=\"showTableSize && showRowCountDropdown\"\n class=\"dimension with-row-count-dropdown\"\n >\n <KdsMenuButton\n class=\"row-count-menu-button\"\n :label=\"rowText\"\n size=\"small\"\n variant=\"transparent\"\n trailing-icon=\"chevron-down\"\n :items=\"actionConfig.rowCountItems ?? []\"\n /><template v-if=\"columnText\">{{ ` | ${columnText}` }}</template>\n </span>\n <span v-else-if=\"showTableSize\" class=\"dimension\">\n {{ dimensionText }}\n </span>\n </div>\n <div class=\"right\">\n <KdsSearchInput\n v-if=\"actionConfig.enableSearch\"\n ariaLabel=\"Search table\"\n size=\"small\"\n :model-value=\"actionState?.searchTerm ?? ''\"\n @update:model-value=\"$emit('update:searchTerm', $event)\"\n />\n <KdsMenuButton\n v-if=\"actionConfig.settingsItems?.length\"\n ariaLabel=\"Table settings\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"parameter\"\n :items=\"actionConfig.settingsItems\"\n />\n <KdsButton\n v-if=\"showResetButton\"\n ariaLabel=\"Reset table\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"x-close\"\n @click=\"emit('resetTemporaryView')\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.kds-table-action-bar {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n min-height: var(--kds-dimension-component-height-2-5x);\n padding-right: var(--kds-spacing-container-0-25x);\n padding-left: var(--kds-spacing-container-0-5x);\n border-bottom: var(--kds-border-base-subtle);\n\n &.temporary-view {\n background-color: var(--kds-color-background-static-info-muted);\n }\n\n & .dimension {\n --dimension-font: var(--kds-font-base-title-small);\n --dimension-color: var(--kds-color-text-and-icon-muted);\n\n font: var(--dimension-font);\n color: var(--dimension-color);\n white-space: pre;\n\n &.with-row-count-dropdown {\n display: inline-flex;\n align-items: center;\n }\n\n /*\n * Match the row-count dropdown trigger's label to the dimension text.\n * :deep() is needed since KdsMenuButton is a multi-root component, so the\n * scope id is not inherited by the button element the class lands on.\n */\n & :deep(.row-count-menu-button) {\n font: var(--dimension-font);\n color: var(--dimension-color);\n }\n }\n\n & .preview {\n display: flex;\n gap: var(--kds-spacing-container-0-12x);\n align-items: center;\n\n & .preview-label {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-neutral);\n }\n }\n\n & .left,\n & .center,\n & .right {\n display: flex;\n flex: 1;\n align-items: center;\n min-width: 0;\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n & .left,\n & .center {\n gap: var(--kds-spacing-container-0-5x);\n }\n\n & .center {\n justify-content: center;\n }\n\n & .right {\n gap: var(--kds-spacing-container-0-25x);\n justify-content: flex-end;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from \"vue\";\n\nimport {\n KdsButton,\n KdsInfoToggleButton,\n KdsMenuButton,\n KdsSearchInput,\n} from \"@knime/kds-components\";\n\nimport type { ActionConfig, ActionState, ColSortValue } from \"../../\";\nimport type { TableState } from \"../../types/TableConfig\";\n\nimport SortControl, {\n type SortControlOptions,\n} from \"./actionbar/SortControl.vue\";\n\nconst {\n tableSizes,\n rowLabel = \"Rows\",\n actionState,\n showTableSize = true,\n colSortValues = [],\n actionConfig,\n} = defineProps<{\n tableSizes?: TableState[\"tableSizes\"];\n rowLabel?: string;\n actionState?: ActionState;\n showTableSize?: boolean;\n actionConfig: ActionConfig;\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst slots = useSlots();\n\nconst viewType = computed(() => actionState?.viewType ?? \"DEFAULT\");\n\nconst isTemporaryView = computed(\n () => viewType.value === \"TEMP_VIEW\" || viewType.value === \"PREVIEW\",\n);\nconst isPreview = computed(() => viewType.value === \"PREVIEW\");\nconst showResetButton = computed(() => viewType.value === \"TEMP_VIEW\");\n\nconst hasContent = computed(\n () =>\n isTemporaryView.value ||\n showTableSize ||\n (actionConfig.enableSorting && !actionConfig.hideSortingButton) ||\n actionConfig.enableSearch ||\n actionConfig.forceShow ||\n Boolean(slots[\"action-bar-left\"]),\n);\n\n/**\n * Renders \"total\" by default, and \"current of total\" only when `current` is\n * given and strictly below `total`. The `current >= total` guard prevents an\n * inconsistent \"m of n\" where m would not be smaller than n. An unknown total\n * (`null`) renders as \"-\".\n */\nconst formatCount = (label: string, total: number | null, current?: number) => {\n if (total === null) {\n return `${label}: -`;\n }\n const appendTotal = current !== undefined && current < total;\n return `${label}: ${appendTotal ? `${current} of ${total}` : total}`;\n};\n\nconst rowText = computed(() =>\n formatCount(\n rowLabel,\n tableSizes ? tableSizes.totalNumRows : 0,\n tableSizes?.currentNumRows,\n ),\n);\n\nconst columnText = computed(() => {\n const totalNumColumns = tableSizes?.totalNumColumns ?? 0;\n if (totalNumColumns < 2) {\n return undefined;\n }\n return formatCount(\"Cols\", totalNumColumns, tableSizes?.currentNumColumns);\n});\n\nconst dimensionText = computed(() => {\n if (columnText.value === undefined) {\n return rowText.value;\n }\n return `${rowText.value} | ${columnText.value}`;\n});\n\nconst showRowCountDropdown = computed(() =>\n Boolean(actionConfig.rowCountItems?.length),\n);\n\nconst emit = defineEmits<{\n resetTemporaryView: [];\n onColumnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n \"update:searchTerm\": [newSearchTerm: string];\n}>();\n</script>\n\n<template>\n <div\n v-if=\"hasContent\"\n :class=\"['kds-table-action-bar', { 'temporary-view': isTemporaryView }]\"\n >\n <div class=\"left\">\n <SortControl\n v-if=\"actionConfig.enableSorting && !actionConfig.hideSortingButton\"\n :col-sort-values\n :sort-control-options\n @column-sort=\"\n (columnId, colDir) => emit('onColumnSort', columnId, colDir)\n \"\n />\n <slot name=\"action-bar-left\" />\n </div>\n <div class=\"center\">\n <div v-if=\"isPreview\" class=\"preview\">\n <span class=\"preview-label\">Preview</span>\n <KdsInfoToggleButton\n v-if=\"actionState?.previewDescription\"\n :content=\"actionState.previewDescription\"\n />\n </div>\n <span\n v-if=\"showTableSize && showRowCountDropdown\"\n class=\"dimension with-row-count-dropdown\"\n >\n <KdsMenuButton\n class=\"row-count-menu-button\"\n :label=\"rowText\"\n size=\"small\"\n variant=\"transparent\"\n trailing-icon=\"chevron-down\"\n :items=\"actionConfig.rowCountItems ?? []\"\n /><template v-if=\"columnText\">{{ ` | ${columnText}` }}</template>\n </span>\n <span v-else-if=\"showTableSize\" class=\"dimension\">\n {{ dimensionText }}\n </span>\n </div>\n <div class=\"right\">\n <KdsSearchInput\n v-if=\"actionConfig.enableSearch\"\n ariaLabel=\"Search table\"\n size=\"small\"\n :model-value=\"actionState?.searchTerm ?? ''\"\n @update:model-value=\"$emit('update:searchTerm', $event)\"\n />\n <KdsMenuButton\n v-if=\"actionConfig.settingsItems?.length\"\n ariaLabel=\"Table settings\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"parameter\"\n :items=\"actionConfig.settingsItems\"\n />\n <KdsButton\n v-if=\"showResetButton\"\n ariaLabel=\"Reset table\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"x-close\"\n @click=\"emit('resetTemporaryView')\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.kds-table-action-bar {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n min-height: var(--kds-dimension-component-height-2-5x);\n padding-right: var(--kds-spacing-container-0-25x);\n padding-left: var(--kds-spacing-container-0-5x);\n border-bottom: var(--kds-border-base-subtle);\n\n &.temporary-view {\n background-color: var(--kds-color-background-static-info-muted);\n }\n\n & .dimension {\n --dimension-font: var(--kds-font-base-title-small);\n --dimension-color: var(--kds-color-text-and-icon-muted);\n\n font: var(--dimension-font);\n color: var(--dimension-color);\n white-space: pre;\n\n &.with-row-count-dropdown {\n display: inline-flex;\n align-items: center;\n }\n\n /*\n * Match the row-count dropdown trigger's label to the dimension text.\n * :deep() is needed since KdsMenuButton is a multi-root component, so the\n * scope id is not inherited by the button element the class lands on.\n */\n & :deep(.row-count-menu-button) {\n font: var(--dimension-font);\n color: var(--dimension-color);\n }\n }\n\n & .preview {\n display: flex;\n gap: var(--kds-spacing-container-0-12x);\n align-items: center;\n\n & .preview-label {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-neutral);\n }\n }\n\n & .left,\n & .center,\n & .right {\n display: flex;\n flex: 1;\n align-items: center;\n min-width: 0;\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n & .left,\n & .center {\n gap: var(--kds-spacing-container-0-5x);\n }\n\n & .center {\n justify-content: center;\n }\n\n & .right {\n gap: var(--kds-spacing-container-0-25x);\n justify-content: flex-end;\n }\n}\n</style>\n","import type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport { minColumnSize } from \"../constants\";\nimport type { ActionConfig } from \"../types/ActionConfig\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\n\n/**\n * Which action buttons the header of the given column shows. Mirrors the\n * conditions HeaderCell.vue renders them under, for the places that need to\n * know a column's buttons without rendering its header — namely the minimum\n * width the column needs (see {@link minColumnSize}).\n */\nexport const columnHeaderActionButtons = ({\n column,\n actionConfig,\n additionalMenuItems,\n}: {\n column: ColumnConfig;\n actionConfig?: ActionConfig;\n additionalMenuItems?: KdsMenuItem[];\n}) => ({\n menuButton: Boolean(additionalMenuItems?.length),\n sortButton: Boolean(actionConfig?.enableSorting) && !column.isNotSortable,\n deleteButton: Boolean(column.deletable),\n});\n\n/** The minimum width the given column needs for its header action buttons. */\nexport const minSizeOfColumn = (\n params: Parameters<typeof columnHeaderActionButtons>[0],\n) => minColumnSize(columnHeaderActionButtons(params));\n","import { type Ref, nextTick } from \"vue\";\nimport { useRafFn } from \"@vueuse/core\";\n\n// while resizing a column, auto-scroll engages when the pointer is within this many\n// px inward of the scroll container's right edge (or anywhere past it)\nexport const AUTO_SCROLL_EDGE_SIZE = 20;\n\n// the speed (in px/s) at which the column grows and the container scrolls while\n// auto-scrolling during a column resize drag\nexport const AUTO_SCROLL_SPEED = 250;\n\n/**\n * While a column is being resized, this composable grows the dragged column and scrolls\n * the container to the right in lockstep whenever the pointer is near (or past) the\n * container's right edge. This lets the last column be widened beyond the visible area\n * without having to release and re-grab the handle.\n *\n * The accumulated px gained via auto-scrolling is added to the caller-owned\n * `autoScrollOffset` ref (and reset to 0 on pointer-up); the caller must include it in the\n * emitted column width. `onAutoScroll` is invoked on every animation frame so the caller\n * can re-emit the (now wider) column width.\n */\nexport const useAutoScrollOnRightEdge = ({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll,\n}: {\n scrollContainer: Ref<HTMLElement | null>;\n autoScrollOffset: Ref<number>;\n onAutoScroll: () => void;\n}) => {\n let pointerClientX = 0;\n // target scroll position is `scrollLeftBase + autoScrollOffset` (see below).\n let scrollLeftBase = 0;\n\n const isInTriggerZone = () => {\n const container = scrollContainer.value;\n if (!container) {\n return false;\n }\n const { right } = container.getBoundingClientRect();\n return pointerClientX >= right - AUTO_SCROLL_EDGE_SIZE;\n };\n\n // `delta` is the ms since the previous frame, so the speed is time-based and thus\n // identical across e.g. 60Hz / 120Hz displays. The loop steps unconditionally.\n const { pause, resume } = useRafFn(\n ({ delta }) => {\n const deltaPx = (AUTO_SCROLL_SPEED * delta) / 1000;\n autoScrollOffset.value += deltaPx;\n const container = scrollContainer.value;\n onAutoScroll();\n // We wait one tick assuming that the wider width is applied then\n // Otherwise we cannot scroll further right when resizing the last column\n // which leads to a flickering since the scroll is lagging behind one frame\n nextTick(() => {\n if (container) {\n container.scrollLeft = scrollLeftBase + autoScrollOffset.value;\n }\n });\n },\n { immediate: false },\n );\n\n const updateZone = (clientX: number) => {\n pointerClientX = clientX;\n if (isInTriggerZone()) {\n resume();\n } else {\n pause();\n }\n };\n\n const onPointerDown = (clientX: number) => {\n scrollLeftBase = scrollContainer.value?.scrollLeft ?? 0;\n updateZone(clientX);\n };\n\n const onPointerMove = (clientX: number) => {\n updateZone(clientX);\n };\n\n const onPointerUp = () => {\n pause();\n autoScrollOffset.value = 0;\n };\n\n return { onPointerDown, onPointerMove, onPointerUp };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsMenuButton,\n KdsToggleButton,\n vKdsTooltip,\n} from \"@knime/kds-components\";\nimport type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport {\n COLUMN_RESIZE_DRAG_HANDLE_WIDTH,\n HEADER_HEIGHT,\n minColumnSize,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useScrollContainer } from \"../composables/useCommonScrollContainerProps\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport { useAutoScrollOnRightEdge } from \"./useAutoScrollOnRightEdge\";\n\nconst props = defineProps<{\n column: ColumnConfig;\n additionalMenuItems?: KdsMenuItem[];\n tableConfig: TableConfig;\n actionConfig: ActionConfig;\n sortDirection: -1 | 0 | 1;\n index: number;\n focused: boolean;\n selected: boolean;\n otherColumnResizing: boolean;\n /** Returns the height the drag handle should span while resizing. */\n getDragHandleHeight: () => number;\n}>();\n\n/**\n * The cell reads its width from this CSS variable (the single source of truth\n * for column widths), so the header subtree does not re-render when the numeric\n * `colSizes` change.\n */\nconst colSizeCSSVar = computed(() => getColSizeCSSVar(props.index));\n\n/**\n * Live numeric column sizes, needed only imperatively at drag start (see\n * {@link onPointerDown}). Injected rather than passed as a prop so that reading\n * it does not create a render-time dependency on `colSizes`.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst emit = defineEmits<{\n onColumnSort: [direction: -1 | 0 | 1];\n onHeaderCellFocus: [];\n onHeaderCellBlur: [];\n onHeaderClick: [];\n onKeydownTab: [];\n onKeydownLeft: [];\n onKeydownRight: [];\n onKeydownDown: [];\n onHeaderCellKeydown: [event: KeyboardEvent];\n onDeleteColumn: [];\n columnResizeStart: [];\n columnResizeEnd: [];\n columnResize: [newSize: number];\n allColumnsResize: [newSize: number];\n}>();\n\nconst columnHeader = useTemplateRef<HTMLTableCellElement>(\"columnHeader\");\nconst content = useTemplateRef<HTMLDivElement>(\"content\");\nconst mainHeader = useTemplateRef<HTMLDivElement>(\"mainHeader\");\nconst headerText = useTemplateRef<HTMLSpanElement>(\"headerText\");\nconst columnDeleteButton =\n useTemplateRef<InstanceType<typeof KdsButton>>(\"columnDeleteButton\");\nconst sortButton =\n useTemplateRef<InstanceType<typeof KdsToggleButton>>(\"sortButton\");\nconst columnMenuButtonRef = \"columnMenuButton\";\nconst columnMenuButton =\n useTemplateRef<InstanceType<typeof KdsMenuButton>>(columnMenuButtonRef);\n\n/**\n * Every sortable column of a table with sorting enabled offers the sort button;\n * there is no separate opt-in for it.\n */\nconst showSortButton = computed(\n () =>\n Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable,\n);\n\nconst isSorted = computed(() => props.sortDirection !== 0);\n\nconst SORT_NEXT_DIRECTION = { 0: 1, 1: -1, [-1]: 0 } as const;\n\n/** Cycles unsorted -> ascending -> descending -> unsorted on each click. */\nconst sortNextDirection = computed<-1 | 0 | 1>(\n () => SORT_NEXT_DIRECTION[props.sortDirection],\n);\n\nconst onSortToggle = () => emit(\"onColumnSort\", sortNextDirection.value);\n\n/** The width below which this header's action buttons would not fit. */\nconst minSize = computed(() =>\n minColumnSize({\n menuButton: Boolean(props.additionalMenuItems?.length),\n sortButton: showSortButton.value,\n deleteButton: Boolean(props.column.deletable),\n }),\n);\n\nconst resizeHandleHovered = ref(false);\nconst headerHovered = ref(false);\nconst menuOpen = ref(false);\nconst nativeFocusInsideHeader = ref(false);\nconst onThFocusOut = (event: FocusEvent) => {\n if (!columnHeader.value?.contains(event.relatedTarget as Node)) {\n nativeFocusInsideHeader.value = false;\n }\n};\nconst onThFocusIn = (event: FocusEvent) => {\n if ((event.target as HTMLElement).matches(\":focus-visible\")) {\n nativeFocusInsideHeader.value = true;\n }\n};\n\n/* Column-resize-via-drag state, local to this header cell. */\nconst dragging = ref(false);\nlet columnSizeOnDragStart = 0; // the original width of the column when the resize drag started\nlet pageXOnDragStart = 0; // the x coordinate at which the pointer was pressed when starting the resize drag\nlet currentPageX = 0; // latest pointer pageX during the drag\nlet currentDragHandlerHeight = 0; // the height the drag handle spans while resizing\n\nconst scrollContainer = useScrollContainer();\nconst autoScrollOffset = ref(0); // px gained via auto-scrolling during the drag\n\n/**\n * Emits the new width of the dragged column. Called both on pointermove and on every\n * auto-scroll frame, so it derives the width from stored state (latest pointer position\n * plus accumulated auto-scroll offset) rather than from an event.\n */\nconst emitColumnResize = () => {\n if (!dragging.value) {\n return;\n }\n const newColumnSize =\n columnSizeOnDragStart +\n (currentPageX - pageXOnDragStart) +\n autoScrollOffset.value;\n emit(\"columnResize\", Math.max(newColumnSize, minSize.value));\n};\n\nconst {\n onPointerDown: startAutoScroll,\n onPointerMove: updateAutoScroll,\n onPointerUp: stopAutoScroll,\n} = useAutoScrollOnRightEdge({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll: emitColumnResize,\n});\n\nconst currentResizeDragHandleWidth = computed(() =>\n props.tableConfig.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0,\n);\n\nconst dragHandleHeight = (isDragging: boolean) =>\n isDragging ? currentDragHandlerHeight : HEADER_HEIGHT;\n\nconst onPointerDown = (event: PointerEvent & { target: HTMLElement }) => {\n menuOpen.value = false;\n consola.debug(\"Resize via drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n event.target.setPointerCapture(event.pointerId);\n dragging.value = true;\n currentDragHandlerHeight = props.getDragHandleHeight();\n columnSizeOnDragStart = colSizes.value[props.index] ?? minSize.value;\n pageXOnDragStart = event.pageX;\n currentPageX = event.pageX;\n emit(\"columnResizeStart\");\n // Engage auto-scroll right away if the handle already sits in the trigger zone\n // (notably the last column, whose handle is at the container's right edge), so it\n // does not wait for a pointermove that the OS edge-clamp would never deliver.\n startAutoScroll(event.clientX);\n};\n\nconst onPointerUp = (event: PointerEvent) => {\n emit(\"columnResizeEnd\");\n if (event.shiftKey) {\n const newColumnSize =\n columnSizeOnDragStart +\n event.pageX -\n pageXOnDragStart +\n autoScrollOffset.value;\n emit(\"allColumnsResize\", newColumnSize);\n }\n // Read the offset above before this zeroes it.\n stopAutoScroll();\n};\n\nconst unthrottledOnPointerMove = (event: PointerEvent) => {\n if (dragging.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n currentPageX = event.pageX;\n emitColumnResize();\n updateAutoScroll(event.clientX);\n }\n};\n\nconst onPointerMove = throttle((event: PointerEvent) => {\n unthrottledOnPointerMove(event);\n});\n\n/* The lostpointercapture event is triggered if the pointer capture is lost for any reason, including its\n orderly release via a pointerup event. Because the onPointerMove function is throttled we also need to throttle\n the onLostPointerCapture function to guarantee order of event handling. */\nconst onLostPointerCapture = throttle((event: PointerEvent) => {\n consola.debug(\"Resize via drag finished: \", event);\n stopAutoScroll();\n dragging.value = false;\n /* Also have to reset resizeHandleHovered since we might no longer be hovering over the drag handle */\n resizeHandleHovered.value = false;\n});\n\nconst getHeaderCellWidth = () => {\n const widthCompleteHeader = Math.ceil(\n columnHeader.value!.getBoundingClientRect().width,\n );\n const widthMainHeader = Math.ceil(\n mainHeader.value!.getBoundingClientRect().width,\n );\n const widthHeaderText = headerText.value!.getBoundingClientRect().width;\n return (\n widthCompleteHeader -\n widthMainHeader +\n widthHeaderText +\n currentResizeDragHandleWidth.value\n );\n};\n\nconst focus = () => {\n if (props.tableConfig.enableHeaderCellSelection || props.column.editable) {\n content.value?.focus();\n } else if (props.additionalMenuItems?.length) {\n nativeFocusInsideHeader.value = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (columnMenuButton.value as any)?.menuButtonEl?.$el?.focus();\n } else if (props.column.deletable) {\n columnDeleteButton.value?.$el?.focus();\n } else if (showSortButton.value) {\n sortButton.value?.$el?.focus();\n }\n};\n\nconst isFocusable = () =>\n Boolean(\n props.tableConfig.enableHeaderCellSelection ||\n props.column.editable ||\n props.additionalMenuItems?.length ||\n props.column.deletable ||\n showSortButton.value,\n );\n\nconst showMenuButton = computed(() => {\n return (\n props.additionalMenuItems?.length &&\n (headerHovered.value || menuOpen.value || nativeFocusInsideHeader.value) &&\n !dragging.value\n );\n});\n\nconst sortButtonVisible = computed(\n () =>\n showSortButton.value &&\n (headerHovered.value || nativeFocusInsideHeader.value || isSorted.value) &&\n !dragging.value,\n);\n\ndefineExpose({ getHeaderCellWidth, focus, isFocusable });\n</script>\n\n<template>\n <th\n ref=\"columnHeader\"\n scope=\"col\"\n :style=\"{\n width: `var(${colSizeCSSVar})`,\n ...(column.headerColor\n ? { '--data-cell-color': column.headerColor }\n : {}),\n }\"\n :class=\"[\n 'column-header',\n {\n 'colored-header': column.headerColor,\n 'header-focused': focused || selected,\n },\n ]\"\n @pointerenter=\"headerHovered = true\"\n @pointerleave=\"headerHovered = false\"\n @focusin=\"onThFocusIn\"\n @focusout=\"onThFocusOut\"\n >\n <div\n ref=\"content\"\n :class=\"[\n 'column-header-content',\n {\n 'with-button-in-header':\n showMenuButton || column.deletable || sortButtonVisible,\n },\n ]\"\n :tabindex=\"\n tableConfig.enableHeaderCellSelection || column.editable ? 0 : -1\n \"\n @focus=\"emit('onHeaderCellFocus')\"\n @blur=\"emit('onHeaderCellBlur')\"\n @click=\"emit('onHeaderClick')\"\n @keydown.space=\"emit('onHeaderClick')\"\n @keydown.tab=\"emit('onKeydownTab')\"\n @keydown.left.prevent=\"emit('onKeydownLeft')\"\n @keydown.right.prevent=\"emit('onKeydownRight')\"\n @keydown.down.self.prevent=\"emit('onKeydownDown')\"\n @keydown=\"emit('onHeaderCellKeydown', $event)\"\n >\n <div ref=\"mainHeader\" class=\"main-header\">\n <div\n v-kds-tooltip:truncated=\"column.header\"\n class=\"header-text-container\"\n >\n <span ref=\"headerText\">{{ column.header }}</span>\n </div>\n </div>\n <div v-if=\"column.subHeader\" class=\"sub-header-text-container\">\n <slot name=\"subHeader\" :sub-header=\"column.subHeader\">{{\n column.subHeader\n }}</slot>\n </div>\n </div>\n <div\n v-if=\"additionalMenuItems?.length\"\n :class=\"[\n 'header-action-button',\n 'menu-button',\n { 'action-button-hidden': !showMenuButton },\n ]\"\n >\n <KdsMenuButton\n :ref=\"columnMenuButtonRef\"\n v-model=\"menuOpen\"\n ariaLabel=\"Table column options\"\n :items=\"additionalMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"showSortButton\"\n :class=\"[\n 'header-action-button',\n 'sort-button',\n { 'action-button-hidden': !sortButtonVisible },\n ]\"\n >\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"isSorted\"\n variant=\"transparent\"\n size=\"small\"\n :leading-icon=\"\n sortDirection === -1 ? 'sort-descending' : 'sort-ascending'\n \"\n ariaLabel=\"Sort\"\n tooltip=\"Sort\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n @update:model-value=\"onSortToggle\"\n />\n </div>\n <!-- Rightmost, since unlike the other two it is permanently visible. -->\n <div\n v-if=\"column.deletable\"\n class=\"header-action-button delete-column-button\"\n >\n <KdsButton\n ref=\"columnDeleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n ariaLabel=\"Delete column\"\n @click.stop=\"emit('onDeleteColumn')\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"tableConfig.enableColumnResizing\"\n :class=\"[\n 'resize-handle-area',\n { hover: resizeHandleHovered && !otherColumnResizing, drag: dragging },\n ]\"\n :style=\"{\n height: `${dragHandleHeight(dragging)}px`,\n }\"\n @pointerover=\"resizeHandleHovered = true\"\n @pointerleave=\"resizeHandleHovered = false\"\n @pointerdown.passive=\"onPointerDown($event as any)\"\n @pointerup.passive=\"onPointerUp($event)\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n >\n <span class=\"resize-handle\" />\n </div>\n </th>\n</template>\n\n<style scoped>\n.column-header {\n /* Need to set position relative here to position the resize handle absolutely within the header cell */\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n padding-right: var(--kds-spacing-container-0-37x);\n padding-left: var(--kds-spacing-container-0-5x);\n color: var(--kds-color-text-and-icon-neutral);\n text-align: left;\n white-space: nowrap;\n\n &.header-focused {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-header {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .column-header-content {\n display: flex;\n flex-shrink: 1;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n\n /* Allows this flex item to shrink below its content's width, so the\n column name truncates (and, if there is no room left at all,\n disappears) instead of pushing the header-action buttons outside. */\n min-width: 0;\n\n &:focus {\n outline: none;\n }\n\n &.with-button-in-header {\n width: calc(\n 100% - var(--kds-dimension-component-width-1-5x)\n ); /* due to .sub-menu-select-header / .delete-column-button: width */\n }\n\n & .main-header {\n display: flex;\n min-width: 0;\n\n & .header-text-container {\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-title-medium-strong);\n }\n }\n\n & .sub-header-text-container {\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-subtext-small);\n }\n }\n\n & .header-action-button {\n flex-shrink: 0;\n\n & + .header-action-button {\n margin-left: var(--kds-spacing-container-0-12x);\n }\n\n /* Collapsed to zero width by default so it reserves no space in the\n header; it only claims room once hovered/focused (or sorted), at\n which point the column name shrinks/truncates to make room for it. */\n &.action-button-hidden {\n width: 0;\n overflow: hidden;\n pointer-events: none;\n opacity: 0;\n }\n }\n\n & .delete-column-button {\n display: flex;\n align-items: center;\n width: var(--kds-dimension-component-width-2x);\n }\n\n & .resize-handle-area {\n position: absolute;\n\n /* resize handle should range into top border */\n top: calc(-1 * var(--kds-core-border-width-xs));\n\n /* resize handle should be at the very right of the header cell, but not range into the next cell, which is\n why we need to remove half of the .resize-handles' border */\n right: calc(\n -1 *\n (\n var(--kds-spacing-container-0-25x) - var(--kds-core-border-width-l) /\n 2\n )\n );\n\n /* otherwise the handle will be behind rows when virtual scrolling */\n z-index: var(--z-index-column-resize-drag-handle);\n display: flex;\n justify-content: center;\n width: 0;\n height: 100%;\n padding-inline: var(--kds-spacing-container-0-25x);\n cursor: col-resize;\n opacity: 0;\n\n & .resize-handle {\n border-right: var(--kds-border-resize-handle-hover);\n border-radius: var(--kds-border-radius-container-0-25x);\n }\n\n &.hover {\n opacity: 1;\n }\n\n &.drag {\n opacity: 1;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsMenuButton,\n KdsToggleButton,\n vKdsTooltip,\n} from \"@knime/kds-components\";\nimport type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport {\n COLUMN_RESIZE_DRAG_HANDLE_WIDTH,\n HEADER_HEIGHT,\n minColumnSize,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useScrollContainer } from \"../composables/useCommonScrollContainerProps\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport { useAutoScrollOnRightEdge } from \"./useAutoScrollOnRightEdge\";\n\nconst props = defineProps<{\n column: ColumnConfig;\n additionalMenuItems?: KdsMenuItem[];\n tableConfig: TableConfig;\n actionConfig: ActionConfig;\n sortDirection: -1 | 0 | 1;\n index: number;\n focused: boolean;\n selected: boolean;\n otherColumnResizing: boolean;\n /** Returns the height the drag handle should span while resizing. */\n getDragHandleHeight: () => number;\n}>();\n\n/**\n * The cell reads its width from this CSS variable (the single source of truth\n * for column widths), so the header subtree does not re-render when the numeric\n * `colSizes` change.\n */\nconst colSizeCSSVar = computed(() => getColSizeCSSVar(props.index));\n\n/**\n * Live numeric column sizes, needed only imperatively at drag start (see\n * {@link onPointerDown}). Injected rather than passed as a prop so that reading\n * it does not create a render-time dependency on `colSizes`.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst emit = defineEmits<{\n onColumnSort: [direction: -1 | 0 | 1];\n onHeaderCellFocus: [];\n onHeaderCellBlur: [];\n onHeaderClick: [];\n onKeydownTab: [];\n onKeydownLeft: [];\n onKeydownRight: [];\n onKeydownDown: [];\n onHeaderCellKeydown: [event: KeyboardEvent];\n onDeleteColumn: [];\n columnResizeStart: [];\n columnResizeEnd: [];\n columnResize: [newSize: number];\n allColumnsResize: [newSize: number];\n}>();\n\nconst columnHeader = useTemplateRef<HTMLTableCellElement>(\"columnHeader\");\nconst content = useTemplateRef<HTMLDivElement>(\"content\");\nconst mainHeader = useTemplateRef<HTMLDivElement>(\"mainHeader\");\nconst headerText = useTemplateRef<HTMLSpanElement>(\"headerText\");\nconst columnDeleteButton =\n useTemplateRef<InstanceType<typeof KdsButton>>(\"columnDeleteButton\");\nconst sortButton =\n useTemplateRef<InstanceType<typeof KdsToggleButton>>(\"sortButton\");\nconst columnMenuButtonRef = \"columnMenuButton\";\nconst columnMenuButton =\n useTemplateRef<InstanceType<typeof KdsMenuButton>>(columnMenuButtonRef);\n\n/**\n * Every sortable column of a table with sorting enabled offers the sort button;\n * there is no separate opt-in for it.\n */\nconst showSortButton = computed(\n () =>\n Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable,\n);\n\nconst isSorted = computed(() => props.sortDirection !== 0);\n\nconst SORT_NEXT_DIRECTION = { 0: 1, 1: -1, [-1]: 0 } as const;\n\n/** Cycles unsorted -> ascending -> descending -> unsorted on each click. */\nconst sortNextDirection = computed<-1 | 0 | 1>(\n () => SORT_NEXT_DIRECTION[props.sortDirection],\n);\n\nconst onSortToggle = () => emit(\"onColumnSort\", sortNextDirection.value);\n\n/** The width below which this header's action buttons would not fit. */\nconst minSize = computed(() =>\n minColumnSize({\n menuButton: Boolean(props.additionalMenuItems?.length),\n sortButton: showSortButton.value,\n deleteButton: Boolean(props.column.deletable),\n }),\n);\n\nconst resizeHandleHovered = ref(false);\nconst headerHovered = ref(false);\nconst menuOpen = ref(false);\nconst nativeFocusInsideHeader = ref(false);\nconst onThFocusOut = (event: FocusEvent) => {\n if (!columnHeader.value?.contains(event.relatedTarget as Node)) {\n nativeFocusInsideHeader.value = false;\n }\n};\nconst onThFocusIn = (event: FocusEvent) => {\n if ((event.target as HTMLElement).matches(\":focus-visible\")) {\n nativeFocusInsideHeader.value = true;\n }\n};\n\n/* Column-resize-via-drag state, local to this header cell. */\nconst dragging = ref(false);\nlet columnSizeOnDragStart = 0; // the original width of the column when the resize drag started\nlet pageXOnDragStart = 0; // the x coordinate at which the pointer was pressed when starting the resize drag\nlet currentPageX = 0; // latest pointer pageX during the drag\nlet currentDragHandlerHeight = 0; // the height the drag handle spans while resizing\n\nconst scrollContainer = useScrollContainer();\nconst autoScrollOffset = ref(0); // px gained via auto-scrolling during the drag\n\n/**\n * Emits the new width of the dragged column. Called both on pointermove and on every\n * auto-scroll frame, so it derives the width from stored state (latest pointer position\n * plus accumulated auto-scroll offset) rather than from an event.\n */\nconst emitColumnResize = () => {\n if (!dragging.value) {\n return;\n }\n const newColumnSize =\n columnSizeOnDragStart +\n (currentPageX - pageXOnDragStart) +\n autoScrollOffset.value;\n emit(\"columnResize\", Math.max(newColumnSize, minSize.value));\n};\n\nconst {\n onPointerDown: startAutoScroll,\n onPointerMove: updateAutoScroll,\n onPointerUp: stopAutoScroll,\n} = useAutoScrollOnRightEdge({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll: emitColumnResize,\n});\n\nconst currentResizeDragHandleWidth = computed(() =>\n props.tableConfig.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0,\n);\n\nconst dragHandleHeight = (isDragging: boolean) =>\n isDragging ? currentDragHandlerHeight : HEADER_HEIGHT;\n\nconst onPointerDown = (event: PointerEvent & { target: HTMLElement }) => {\n menuOpen.value = false;\n consola.debug(\"Resize via drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n event.target.setPointerCapture(event.pointerId);\n dragging.value = true;\n currentDragHandlerHeight = props.getDragHandleHeight();\n columnSizeOnDragStart = colSizes.value[props.index] ?? minSize.value;\n pageXOnDragStart = event.pageX;\n currentPageX = event.pageX;\n emit(\"columnResizeStart\");\n // Engage auto-scroll right away if the handle already sits in the trigger zone\n // (notably the last column, whose handle is at the container's right edge), so it\n // does not wait for a pointermove that the OS edge-clamp would never deliver.\n startAutoScroll(event.clientX);\n};\n\nconst onPointerUp = (event: PointerEvent) => {\n emit(\"columnResizeEnd\");\n if (event.shiftKey) {\n const newColumnSize =\n columnSizeOnDragStart +\n event.pageX -\n pageXOnDragStart +\n autoScrollOffset.value;\n emit(\"allColumnsResize\", newColumnSize);\n }\n // Read the offset above before this zeroes it.\n stopAutoScroll();\n};\n\nconst unthrottledOnPointerMove = (event: PointerEvent) => {\n if (dragging.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n currentPageX = event.pageX;\n emitColumnResize();\n updateAutoScroll(event.clientX);\n }\n};\n\nconst onPointerMove = throttle((event: PointerEvent) => {\n unthrottledOnPointerMove(event);\n});\n\n/* The lostpointercapture event is triggered if the pointer capture is lost for any reason, including its\n orderly release via a pointerup event. Because the onPointerMove function is throttled we also need to throttle\n the onLostPointerCapture function to guarantee order of event handling. */\nconst onLostPointerCapture = throttle((event: PointerEvent) => {\n consola.debug(\"Resize via drag finished: \", event);\n stopAutoScroll();\n dragging.value = false;\n /* Also have to reset resizeHandleHovered since we might no longer be hovering over the drag handle */\n resizeHandleHovered.value = false;\n});\n\nconst getHeaderCellWidth = () => {\n const widthCompleteHeader = Math.ceil(\n columnHeader.value!.getBoundingClientRect().width,\n );\n const widthMainHeader = Math.ceil(\n mainHeader.value!.getBoundingClientRect().width,\n );\n const widthHeaderText = headerText.value!.getBoundingClientRect().width;\n return (\n widthCompleteHeader -\n widthMainHeader +\n widthHeaderText +\n currentResizeDragHandleWidth.value\n );\n};\n\nconst focus = () => {\n if (props.tableConfig.enableHeaderCellSelection || props.column.editable) {\n content.value?.focus();\n } else if (props.additionalMenuItems?.length) {\n nativeFocusInsideHeader.value = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (columnMenuButton.value as any)?.menuButtonEl?.$el?.focus();\n } else if (props.column.deletable) {\n columnDeleteButton.value?.$el?.focus();\n } else if (showSortButton.value) {\n sortButton.value?.$el?.focus();\n }\n};\n\nconst isFocusable = () =>\n Boolean(\n props.tableConfig.enableHeaderCellSelection ||\n props.column.editable ||\n props.additionalMenuItems?.length ||\n props.column.deletable ||\n showSortButton.value,\n );\n\nconst showMenuButton = computed(() => {\n return (\n props.additionalMenuItems?.length &&\n (headerHovered.value || menuOpen.value || nativeFocusInsideHeader.value) &&\n !dragging.value\n );\n});\n\nconst sortButtonVisible = computed(\n () =>\n showSortButton.value &&\n (headerHovered.value || nativeFocusInsideHeader.value || isSorted.value) &&\n !dragging.value,\n);\n\ndefineExpose({ getHeaderCellWidth, focus, isFocusable });\n</script>\n\n<template>\n <th\n ref=\"columnHeader\"\n scope=\"col\"\n :style=\"{\n width: `var(${colSizeCSSVar})`,\n ...(column.headerColor\n ? { '--data-cell-color': column.headerColor }\n : {}),\n }\"\n :class=\"[\n 'column-header',\n {\n 'colored-header': column.headerColor,\n 'header-focused': focused || selected,\n },\n ]\"\n @pointerenter=\"headerHovered = true\"\n @pointerleave=\"headerHovered = false\"\n @focusin=\"onThFocusIn\"\n @focusout=\"onThFocusOut\"\n >\n <div\n ref=\"content\"\n :class=\"[\n 'column-header-content',\n {\n 'with-button-in-header':\n showMenuButton || column.deletable || sortButtonVisible,\n },\n ]\"\n :tabindex=\"\n tableConfig.enableHeaderCellSelection || column.editable ? 0 : -1\n \"\n @focus=\"emit('onHeaderCellFocus')\"\n @blur=\"emit('onHeaderCellBlur')\"\n @click=\"emit('onHeaderClick')\"\n @keydown.space=\"emit('onHeaderClick')\"\n @keydown.tab=\"emit('onKeydownTab')\"\n @keydown.left.prevent=\"emit('onKeydownLeft')\"\n @keydown.right.prevent=\"emit('onKeydownRight')\"\n @keydown.down.self.prevent=\"emit('onKeydownDown')\"\n @keydown=\"emit('onHeaderCellKeydown', $event)\"\n >\n <div ref=\"mainHeader\" class=\"main-header\">\n <div\n v-kds-tooltip:truncated=\"column.header\"\n class=\"header-text-container\"\n >\n <span ref=\"headerText\">{{ column.header }}</span>\n </div>\n </div>\n <div v-if=\"column.subHeader\" class=\"sub-header-text-container\">\n <slot name=\"subHeader\" :sub-header=\"column.subHeader\">{{\n column.subHeader\n }}</slot>\n </div>\n </div>\n <div\n v-if=\"additionalMenuItems?.length\"\n :class=\"[\n 'header-action-button',\n 'menu-button',\n { 'action-button-hidden': !showMenuButton },\n ]\"\n >\n <KdsMenuButton\n :ref=\"columnMenuButtonRef\"\n v-model=\"menuOpen\"\n ariaLabel=\"Table column options\"\n :items=\"additionalMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"showSortButton\"\n :class=\"[\n 'header-action-button',\n 'sort-button',\n { 'action-button-hidden': !sortButtonVisible },\n ]\"\n >\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"isSorted\"\n variant=\"transparent\"\n size=\"small\"\n :leading-icon=\"\n sortDirection === -1 ? 'sort-descending' : 'sort-ascending'\n \"\n ariaLabel=\"Sort\"\n tooltip=\"Sort\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n @update:model-value=\"onSortToggle\"\n />\n </div>\n <!-- Rightmost, since unlike the other two it is permanently visible. -->\n <div\n v-if=\"column.deletable\"\n class=\"header-action-button delete-column-button\"\n >\n <KdsButton\n ref=\"columnDeleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n ariaLabel=\"Delete column\"\n @click.stop=\"emit('onDeleteColumn')\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"tableConfig.enableColumnResizing\"\n :class=\"[\n 'resize-handle-area',\n { hover: resizeHandleHovered && !otherColumnResizing, drag: dragging },\n ]\"\n :style=\"{\n height: `${dragHandleHeight(dragging)}px`,\n }\"\n @pointerover=\"resizeHandleHovered = true\"\n @pointerleave=\"resizeHandleHovered = false\"\n @pointerdown.passive=\"onPointerDown($event as any)\"\n @pointerup.passive=\"onPointerUp($event)\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n >\n <span class=\"resize-handle\" />\n </div>\n </th>\n</template>\n\n<style scoped>\n.column-header {\n /* Need to set position relative here to position the resize handle absolutely within the header cell */\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n padding-right: var(--kds-spacing-container-0-37x);\n padding-left: var(--kds-spacing-container-0-5x);\n color: var(--kds-color-text-and-icon-neutral);\n text-align: left;\n white-space: nowrap;\n\n &.header-focused {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-header {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .column-header-content {\n display: flex;\n flex-shrink: 1;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n\n /* Allows this flex item to shrink below its content's width, so the\n column name truncates (and, if there is no room left at all,\n disappears) instead of pushing the header-action buttons outside. */\n min-width: 0;\n\n &:focus {\n outline: none;\n }\n\n &.with-button-in-header {\n width: calc(\n 100% - var(--kds-dimension-component-width-1-5x)\n ); /* due to .sub-menu-select-header / .delete-column-button: width */\n }\n\n & .main-header {\n display: flex;\n min-width: 0;\n\n & .header-text-container {\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-title-medium-strong);\n }\n }\n\n & .sub-header-text-container {\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-subtext-small);\n }\n }\n\n & .header-action-button {\n flex-shrink: 0;\n\n & + .header-action-button {\n margin-left: var(--kds-spacing-container-0-12x);\n }\n\n /* Collapsed to zero width by default so it reserves no space in the\n header; it only claims room once hovered/focused (or sorted), at\n which point the column name shrinks/truncates to make room for it. */\n &.action-button-hidden {\n width: 0;\n overflow: hidden;\n pointer-events: none;\n opacity: 0;\n }\n }\n\n & .delete-column-button {\n display: flex;\n align-items: center;\n width: var(--kds-dimension-component-width-2x);\n }\n\n & .resize-handle-area {\n position: absolute;\n\n /* resize handle should range into top border */\n top: calc(-1 * var(--kds-core-border-width-xs));\n\n /* resize handle should be at the very right of the header cell, but not range into the next cell, which is\n why we need to remove half of the .resize-handles' border */\n right: calc(\n -1 *\n (\n var(--kds-spacing-container-0-25x) - var(--kds-core-border-width-l) /\n 2\n )\n );\n\n /* otherwise the handle will be behind rows when virtual scrolling */\n z-index: var(--z-index-column-resize-drag-handle);\n display: flex;\n justify-content: center;\n width: 0;\n height: 100%;\n padding-inline: var(--kds-spacing-container-0-25x);\n cursor: col-resize;\n opacity: 0;\n\n & .resize-handle {\n border-right: var(--kds-border-resize-handle-hover);\n border-radius: var(--kds-border-radius-container-0-25x);\n }\n\n &.hover {\n opacity: 1;\n }\n\n &.drag {\n opacity: 1;\n }\n }\n}\n</style>\n","<!-- eslint-disable max-lines -->\n<script lang=\"ts\">\nimport { type PropType, toRef } from \"vue\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport {\n HEADER_HEIGHT,\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { ColSortValue } from \"../../types/ColumnState\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { minSizeOfColumn } from \"../../utils/columnHeaderActionButtons\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { useStartEditingKeydown } from \"../composables/useStartEditingKeydown\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport HeaderCell from \"./HeaderCell.vue\";\n\n/**\n * A table header element for displaying the column names in a table. This component\n * has a checkbox for selecting all rows in the table.\n *\n * @emits headerSelect event when the checkbox is selected for table-wide toggling of selection.\n * @emits subMenuItemSelection event when the selection of a submenu item is changed\n */\nexport default {\n components: {\n KdsCheckbox,\n KdsButton,\n HeaderCell,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n actionConfig: {\n type: Object as PropType<ActionConfig>,\n default: () => ({}),\n },\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n isSelected: {\n type: Boolean,\n default: false,\n },\n getDragHandleHeight: {\n type: Function as PropType<() => number>,\n default: () => HEADER_HEIGHT,\n },\n showNewColumnButton: {\n type: Boolean,\n default: false,\n },\n selectedHeaderIndex: {\n type: Number as PropType<number | null>,\n default: null,\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n headerSelect: (selected: boolean) => true,\n showColumnBorder: () => true,\n columnResize: (index: number, newSize: number) => true,\n hideColumnBorder: () => true,\n columnResizeEnd: () => true,\n columnResizeStart: () => true,\n allColumnsResize: (newSize: number) => true,\n columnSort: (index: number, direction: -1 | 0 | 1) => true,\n moveDownFromHeaderCell: (index: number) => true,\n headerCellSelect: (index: number) => true,\n \"update:newColumnButtonWidth\": (width: number) => true,\n newColumnButtonClick: (event: MouseEvent) => true,\n newColumnButtonKeydownLeft: (event: KeyboardEvent) => true,\n selectionKeydownDown: () => true,\n headerCellDeselect: () => true,\n headerCellStartEditing: (index: number, initialValue?: string) => true,\n deleteColumn: (index: number) => true,\n },\n setup(props, { emit }) {\n const { indexedData: indexedColumns, style: headerStyles } =\n useIndicesAndStylesFor(toRef(props, \"columns\"));\n\n let currentColumnIndex = 0;\n const onStartEditing = (initialValue?: string) => {\n emit(\"headerCellStartEditing\", currentColumnIndex, initialValue);\n };\n const { onKeydown: startEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: onStartEditing,\n onStartEditing,\n });\n\n const onHeaderCellKeydown = (event: KeyboardEvent, columnIndex: number) => {\n currentColumnIndex = columnIndex;\n startEditingKeydown(event);\n };\n\n const { colSizesFrozenWhenResizing } = injectColumnSizes();\n\n return {\n indexedColumns,\n headerStyles,\n onHeaderCellKeydown,\n colSizesFrozenWhenResizing,\n };\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n data() {\n return {\n minimumColumnWidth: MIN_COLUMN_SIZE, // need to add this here since it is referenced in the template\n resizingColumnIndex: null as null | number, // the index of the column that is currently being resized; null otherwise\n focusedHeaderIndex: null as null | number, // the index of the currently focused header cell\n };\n },\n computed: {\n headerBackgroundColor(): string {\n return `var(--kds-color-${this.renderedOnBackgroundColor}, var(--kds-color-page-default))`;\n },\n /**\n * The smallest size that can be given to all columns at once, i.e. the\n * largest of their individual minimums (see {@link minSizeOfColumn}).\n */\n minSizeForAllColumns(): number {\n return this.columns.reduce(\n (max, column, index) =>\n Math.max(\n max,\n minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n }),\n ),\n MIN_COLUMN_SIZE,\n );\n },\n headerSelectionOverlayStyle(): Record<string, string> | null {\n const columnIndex = this.selectedHeaderIndex;\n if (\n columnIndex === null ||\n !this.tableConfig.enableHeaderCellSelection ||\n // Positioned from the sizes frozen at drag start, so it would lag\n // behind the live column widths while a column is being resized.\n this.resizingColumnIndex !== null\n ) {\n return null;\n }\n let left = 0;\n if (this.tableConfig.showSelection) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n if (this.tableConfig.enableRowDeletion) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n for (let i = 0; i < columnIndex; i++) {\n left += this.columnSize(i);\n }\n const width = this.columnSize(columnIndex);\n return {\n left: `${left}px`,\n width: `${width}px`,\n };\n },\n },\n methods: {\n columnSize(columnIndex: number): number {\n return (\n this.colSizesFrozenWhenResizing[columnIndex] ?? this.minimumColumnWidth\n );\n },\n sortDirection(columnIndex: number): -1 | 0 | 1 {\n const columnId = this.columns[columnIndex].id;\n return (\n this.colSortValues.find(({ id }) => id === columnId)?.direction ?? 0\n );\n },\n onHeaderCellFocus(columnIndex: number) {\n if (\n !this.tableConfig.enableHeaderCellSelection &&\n !this.columns[columnIndex].editable\n ) {\n return;\n }\n this.focusedHeaderIndex = columnIndex;\n this.$emit(\"headerCellSelect\", columnIndex);\n },\n onHeaderCellBlur(columnIndex: number) {\n this.focusedHeaderIndex = null;\n if (!this.columns[columnIndex].editable) {\n this.$emit(\"headerCellDeselect\");\n }\n },\n emitNewColumnButtonWidth() {\n const newColumnButtonHead = this.$refs[\n \"new-column-button-head\"\n ] as HTMLElement;\n this.$emit(\n \"update:newColumnButtonWidth\",\n newColumnButtonHead.getBoundingClientRect().width ?? 0,\n );\n },\n onSelect() {\n this.$emit(\"headerSelect\", !this.isSelected);\n },\n onHeaderClick(ind: number) {\n if (\n this.tableConfig.enableHeaderCellSelection &&\n this.selectedHeaderIndex !== ind\n ) {\n this.$emit(\"headerCellSelect\", ind);\n }\n if (this.columns[ind].editable) {\n this.$emit(\"headerCellStartEditing\", ind);\n }\n },\n onColumnResizeStart(columnIndex: number) {\n this.resizingColumnIndex = columnIndex;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.resizingColumnIndex = null;\n this.$emit(\"columnResizeEnd\");\n },\n onColumnResize(columnIndex: number, newSize: number) {\n this.$emit(\"columnResize\", columnIndex, newSize);\n },\n onAllColumnsResize(newSize: number) {\n // One size for every column, so it has to clear the largest of their\n // minimums; the dragged cell cannot clamp this on its own.\n this.$emit(\n \"allColumnsResize\",\n Math.max(newSize, this.minSizeForAllColumns),\n );\n },\n onColumnSort(columnIndex: number, direction: -1 | 0 | 1) {\n this.$emit(\"columnSort\", columnIndex, direction);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n this.$emit(\"newColumnButtonClick\", event);\n },\n onNewColumnButtonKeydownLeft(event: KeyboardEvent) {\n this.$emit(\"newColumnButtonKeydownLeft\", event);\n },\n onDeleteColumn(ind: number) {\n this.$emit(\"deleteColumn\", ind);\n },\n getHeaderCellWidths() {\n return this.columns.map((_column, columnIndex) =>\n (\n this.$refs[`headerCell-${columnIndex}`] as InstanceType<\n typeof HeaderCell\n >[]\n )[0].getHeaderCellWidth(),\n );\n },\n /**\n * We deliberately only react on Tab and not on blur since we do\n * want to keep the header in a selected yet unfocused state when\n * the user clicks outside the table.\n */\n onKeydownTab() {\n this.$emit(\"headerCellDeselect\");\n },\n onKeydownLeft(columnIndex: number) {\n if (columnIndex > 0) {\n this.focusHeaderCell(columnIndex - 1);\n }\n },\n onKeydownRight(columnIndex: number) {\n if (columnIndex < this.columns.length - 1) {\n this.focusHeaderCell(columnIndex + 1);\n } else if (this.showNewColumnButton) {\n if (this.tableConfig.enableHeaderCellSelection) {\n this.$emit(\"headerCellDeselect\");\n }\n this.focusNewColumnButton();\n }\n },\n onKeydownDown(columnIndex: number) {\n if (this.tableConfig.enableCellSelection) {\n this.$emit(\"moveDownFromHeaderCell\", columnIndex);\n }\n },\n focusHeaderCell(cellInd: number) {\n (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].focus();\n },\n isColumnHeaderFocusable(cellInd: number): boolean {\n return (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].isFocusable();\n },\n focusNewColumnButton() {\n (\n this.$refs[\"new-column-button\"] as InstanceType<typeof KdsButton>\n )?.$el.focus();\n },\n focusSelectionCheckbox() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.$refs[\"selection-checkbox\"] as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n },\n },\n};\n</script>\n\n<template>\n <thead>\n <tr :style=\"{ ...headerStyles }\">\n <th\n v-if=\"tableConfig.enableRowDeletion\"\n scope=\"col\"\n class=\"deletion-cell-spacer\"\n aria-label=\"Delete row\"\n />\n <th\n v-if=\"tableConfig.showSelection\"\n scope=\"col\"\n class=\"select-cell\"\n @keydown.down.prevent.stop=\"$emit('selectionKeydownDown')\"\n >\n <KdsCheckbox\n ref=\"selection-checkbox\"\n class=\"select-checkbox\"\n tooltip=\"Select all rows\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n />\n </th>\n <HeaderCell\n v-for=\"[column, ind] in indexedColumns\"\n :key=\"ind\"\n :ref=\"`headerCell-${ind}`\"\n :column\n :additional-menu-items=\"additionalHeaderMenuItems[ind] ?? []\"\n :table-config\n :action-config\n :sort-direction=\"sortDirection(ind)\"\n :index=\"ind\"\n :focused=\"focusedHeaderIndex === ind\"\n :selected=\"selectedHeaderIndex === ind\"\n :other-column-resizing=\"\n resizingColumnIndex !== null && resizingColumnIndex !== ind\n \"\n :get-drag-handle-height=\"getDragHandleHeight\"\n @on-header-cell-focus=\"onHeaderCellFocus(ind)\"\n @on-header-cell-blur=\"onHeaderCellBlur(ind)\"\n @on-header-click=\"onHeaderClick(ind)\"\n @on-keydown-tab=\"onKeydownTab\"\n @on-keydown-left=\"onKeydownLeft(ind)\"\n @on-keydown-right=\"onKeydownRight(ind)\"\n @on-keydown-down=\"onKeydownDown(ind)\"\n @on-header-cell-keydown=\"onHeaderCellKeydown($event, ind)\"\n @on-delete-column=\"onDeleteColumn(ind)\"\n @on-column-sort=\"onColumnSort(ind, $event)\"\n @column-resize-start=\"onColumnResizeStart(ind)\"\n @column-resize-end=\"onColumnResizeEnd\"\n @column-resize=\"onColumnResize(ind, $event)\"\n @all-columns-resize=\"onAllColumnsResize\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" :column-index=\"ind\" />\n </template>\n </HeaderCell>\n <th\n v-if=\"showNewColumnButton\"\n ref=\"new-column-button-head\"\n scope=\"col\"\n class=\"new-column-head\"\n aria-label=\"Add column\"\n @vue:mounted=\"emitNewColumnButtonWidth\"\n >\n <KdsButton\n ref=\"new-column-button\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n @click=\"onNewColumnButtonClick\"\n @keydown.left.prevent.stop=\"onNewColumnButtonKeydownLeft\"\n />\n </th>\n </tr>\n <div\n v-if=\"headerSelectionOverlayStyle\"\n :class=\"[\n 'header-selection-overlay',\n { 'header-focused': focusedHeaderIndex !== null },\n ]\"\n :style=\"headerSelectionOverlayStyle\"\n />\n </thead>\n</template>\n\n<style scoped>\nthead {\n background-color: v-bind(headerBackgroundColor);\n border-bottom: var(--kds-border-base-subtle);\n\n & tr {\n display: flex;\n height: 100%;\n transition:\n height 0.3s,\n box-shadow 0.15s;\n\n & th {\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n text-align: left;\n white-space: nowrap;\n\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n padding: var(--kds-spacing-container-0-75x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.new-column-head {\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: var(--kds-spacing-container-0-5x);\n }\n }\n\n &:hover {\n outline: none;\n }\n }\n\n &.sub-menu-active tr {\n padding-right: var(--kds-dimension-component-width-2x);\n }\n}\n\n.header-selection-overlay {\n position: absolute;\n top: 0;\n height: 100%;\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.header-focused {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<!-- eslint-disable max-lines -->\n<script lang=\"ts\">\nimport { type PropType, toRef } from \"vue\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport {\n HEADER_HEIGHT,\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { ColSortValue } from \"../../types/ColumnState\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { minSizeOfColumn } from \"../../utils/columnHeaderActionButtons\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { useStartEditingKeydown } from \"../composables/useStartEditingKeydown\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport HeaderCell from \"./HeaderCell.vue\";\n\n/**\n * A table header element for displaying the column names in a table. This component\n * has a checkbox for selecting all rows in the table.\n *\n * @emits headerSelect event when the checkbox is selected for table-wide toggling of selection.\n * @emits subMenuItemSelection event when the selection of a submenu item is changed\n */\nexport default {\n components: {\n KdsCheckbox,\n KdsButton,\n HeaderCell,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n actionConfig: {\n type: Object as PropType<ActionConfig>,\n default: () => ({}),\n },\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n isSelected: {\n type: Boolean,\n default: false,\n },\n getDragHandleHeight: {\n type: Function as PropType<() => number>,\n default: () => HEADER_HEIGHT,\n },\n showNewColumnButton: {\n type: Boolean,\n default: false,\n },\n selectedHeaderIndex: {\n type: Number as PropType<number | null>,\n default: null,\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n headerSelect: (selected: boolean) => true,\n showColumnBorder: () => true,\n columnResize: (index: number, newSize: number) => true,\n hideColumnBorder: () => true,\n columnResizeEnd: () => true,\n columnResizeStart: () => true,\n allColumnsResize: (newSize: number) => true,\n columnSort: (index: number, direction: -1 | 0 | 1) => true,\n moveDownFromHeaderCell: (index: number) => true,\n headerCellSelect: (index: number) => true,\n \"update:newColumnButtonWidth\": (width: number) => true,\n newColumnButtonClick: (event: MouseEvent) => true,\n newColumnButtonKeydownLeft: (event: KeyboardEvent) => true,\n selectionKeydownDown: () => true,\n headerCellDeselect: () => true,\n headerCellStartEditing: (index: number, initialValue?: string) => true,\n deleteColumn: (index: number) => true,\n },\n setup(props, { emit }) {\n const { indexedData: indexedColumns, style: headerStyles } =\n useIndicesAndStylesFor(toRef(props, \"columns\"));\n\n let currentColumnIndex = 0;\n const onStartEditing = (initialValue?: string) => {\n emit(\"headerCellStartEditing\", currentColumnIndex, initialValue);\n };\n const { onKeydown: startEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: onStartEditing,\n onStartEditing,\n });\n\n const onHeaderCellKeydown = (event: KeyboardEvent, columnIndex: number) => {\n currentColumnIndex = columnIndex;\n startEditingKeydown(event);\n };\n\n const { colSizesFrozenWhenResizing } = injectColumnSizes();\n\n return {\n indexedColumns,\n headerStyles,\n onHeaderCellKeydown,\n colSizesFrozenWhenResizing,\n };\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n data() {\n return {\n minimumColumnWidth: MIN_COLUMN_SIZE, // need to add this here since it is referenced in the template\n resizingColumnIndex: null as null | number, // the index of the column that is currently being resized; null otherwise\n focusedHeaderIndex: null as null | number, // the index of the currently focused header cell\n };\n },\n computed: {\n headerBackgroundColor(): string {\n return `var(--kds-color-${this.renderedOnBackgroundColor}, var(--kds-color-page-default))`;\n },\n /**\n * The smallest size that can be given to all columns at once, i.e. the\n * largest of their individual minimums (see {@link minSizeOfColumn}).\n */\n minSizeForAllColumns(): number {\n return this.columns.reduce(\n (max, column, index) =>\n Math.max(\n max,\n minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n }),\n ),\n MIN_COLUMN_SIZE,\n );\n },\n headerSelectionOverlayStyle(): Record<string, string> | null {\n const columnIndex = this.selectedHeaderIndex;\n if (\n columnIndex === null ||\n !this.tableConfig.enableHeaderCellSelection ||\n // Positioned from the sizes frozen at drag start, so it would lag\n // behind the live column widths while a column is being resized.\n this.resizingColumnIndex !== null\n ) {\n return null;\n }\n let left = 0;\n if (this.tableConfig.showSelection) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n if (this.tableConfig.enableRowDeletion) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n for (let i = 0; i < columnIndex; i++) {\n left += this.columnSize(i);\n }\n const width = this.columnSize(columnIndex);\n return {\n left: `${left}px`,\n width: `${width}px`,\n };\n },\n },\n methods: {\n columnSize(columnIndex: number): number {\n return (\n this.colSizesFrozenWhenResizing[columnIndex] ?? this.minimumColumnWidth\n );\n },\n sortDirection(columnIndex: number): -1 | 0 | 1 {\n const columnId = this.columns[columnIndex].id;\n return (\n this.colSortValues.find(({ id }) => id === columnId)?.direction ?? 0\n );\n },\n onHeaderCellFocus(columnIndex: number) {\n if (\n !this.tableConfig.enableHeaderCellSelection &&\n !this.columns[columnIndex].editable\n ) {\n return;\n }\n this.focusedHeaderIndex = columnIndex;\n this.$emit(\"headerCellSelect\", columnIndex);\n },\n onHeaderCellBlur(columnIndex: number) {\n this.focusedHeaderIndex = null;\n if (!this.columns[columnIndex].editable) {\n this.$emit(\"headerCellDeselect\");\n }\n },\n emitNewColumnButtonWidth() {\n const newColumnButtonHead = this.$refs[\n \"new-column-button-head\"\n ] as HTMLElement;\n this.$emit(\n \"update:newColumnButtonWidth\",\n newColumnButtonHead.getBoundingClientRect().width ?? 0,\n );\n },\n onSelect() {\n this.$emit(\"headerSelect\", !this.isSelected);\n },\n onHeaderClick(ind: number) {\n if (\n this.tableConfig.enableHeaderCellSelection &&\n this.selectedHeaderIndex !== ind\n ) {\n this.$emit(\"headerCellSelect\", ind);\n }\n if (this.columns[ind].editable) {\n this.$emit(\"headerCellStartEditing\", ind);\n }\n },\n onColumnResizeStart(columnIndex: number) {\n this.resizingColumnIndex = columnIndex;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.resizingColumnIndex = null;\n this.$emit(\"columnResizeEnd\");\n },\n onColumnResize(columnIndex: number, newSize: number) {\n this.$emit(\"columnResize\", columnIndex, newSize);\n },\n onAllColumnsResize(newSize: number) {\n // One size for every column, so it has to clear the largest of their\n // minimums; the dragged cell cannot clamp this on its own.\n this.$emit(\n \"allColumnsResize\",\n Math.max(newSize, this.minSizeForAllColumns),\n );\n },\n onColumnSort(columnIndex: number, direction: -1 | 0 | 1) {\n this.$emit(\"columnSort\", columnIndex, direction);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n this.$emit(\"newColumnButtonClick\", event);\n },\n onNewColumnButtonKeydownLeft(event: KeyboardEvent) {\n this.$emit(\"newColumnButtonKeydownLeft\", event);\n },\n onDeleteColumn(ind: number) {\n this.$emit(\"deleteColumn\", ind);\n },\n getHeaderCellWidths() {\n return this.columns.map((_column, columnIndex) =>\n (\n this.$refs[`headerCell-${columnIndex}`] as InstanceType<\n typeof HeaderCell\n >[]\n )[0].getHeaderCellWidth(),\n );\n },\n /**\n * We deliberately only react on Tab and not on blur since we do\n * want to keep the header in a selected yet unfocused state when\n * the user clicks outside the table.\n */\n onKeydownTab() {\n this.$emit(\"headerCellDeselect\");\n },\n onKeydownLeft(columnIndex: number) {\n if (columnIndex > 0) {\n this.focusHeaderCell(columnIndex - 1);\n }\n },\n onKeydownRight(columnIndex: number) {\n if (columnIndex < this.columns.length - 1) {\n this.focusHeaderCell(columnIndex + 1);\n } else if (this.showNewColumnButton) {\n if (this.tableConfig.enableHeaderCellSelection) {\n this.$emit(\"headerCellDeselect\");\n }\n this.focusNewColumnButton();\n }\n },\n onKeydownDown(columnIndex: number) {\n if (this.tableConfig.enableCellSelection) {\n this.$emit(\"moveDownFromHeaderCell\", columnIndex);\n }\n },\n focusHeaderCell(cellInd: number) {\n (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].focus();\n },\n isColumnHeaderFocusable(cellInd: number): boolean {\n return (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].isFocusable();\n },\n focusNewColumnButton() {\n (\n this.$refs[\"new-column-button\"] as InstanceType<typeof KdsButton>\n )?.$el.focus();\n },\n focusSelectionCheckbox() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.$refs[\"selection-checkbox\"] as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n },\n },\n};\n</script>\n\n<template>\n <thead>\n <tr :style=\"{ ...headerStyles }\">\n <th\n v-if=\"tableConfig.enableRowDeletion\"\n scope=\"col\"\n class=\"deletion-cell-spacer\"\n aria-label=\"Delete row\"\n />\n <th\n v-if=\"tableConfig.showSelection\"\n scope=\"col\"\n class=\"select-cell\"\n @keydown.down.prevent.stop=\"$emit('selectionKeydownDown')\"\n >\n <KdsCheckbox\n ref=\"selection-checkbox\"\n class=\"select-checkbox\"\n tooltip=\"Select all rows\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n />\n </th>\n <HeaderCell\n v-for=\"[column, ind] in indexedColumns\"\n :key=\"ind\"\n :ref=\"`headerCell-${ind}`\"\n :column\n :additional-menu-items=\"additionalHeaderMenuItems[ind] ?? []\"\n :table-config\n :action-config\n :sort-direction=\"sortDirection(ind)\"\n :index=\"ind\"\n :focused=\"focusedHeaderIndex === ind\"\n :selected=\"selectedHeaderIndex === ind\"\n :other-column-resizing=\"\n resizingColumnIndex !== null && resizingColumnIndex !== ind\n \"\n :get-drag-handle-height=\"getDragHandleHeight\"\n @on-header-cell-focus=\"onHeaderCellFocus(ind)\"\n @on-header-cell-blur=\"onHeaderCellBlur(ind)\"\n @on-header-click=\"onHeaderClick(ind)\"\n @on-keydown-tab=\"onKeydownTab\"\n @on-keydown-left=\"onKeydownLeft(ind)\"\n @on-keydown-right=\"onKeydownRight(ind)\"\n @on-keydown-down=\"onKeydownDown(ind)\"\n @on-header-cell-keydown=\"onHeaderCellKeydown($event, ind)\"\n @on-delete-column=\"onDeleteColumn(ind)\"\n @on-column-sort=\"onColumnSort(ind, $event)\"\n @column-resize-start=\"onColumnResizeStart(ind)\"\n @column-resize-end=\"onColumnResizeEnd\"\n @column-resize=\"onColumnResize(ind, $event)\"\n @all-columns-resize=\"onAllColumnsResize\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" :column-index=\"ind\" />\n </template>\n </HeaderCell>\n <th\n v-if=\"showNewColumnButton\"\n ref=\"new-column-button-head\"\n scope=\"col\"\n class=\"new-column-head\"\n aria-label=\"Add column\"\n @vue:mounted=\"emitNewColumnButtonWidth\"\n >\n <KdsButton\n ref=\"new-column-button\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n @click=\"onNewColumnButtonClick\"\n @keydown.left.prevent.stop=\"onNewColumnButtonKeydownLeft\"\n />\n </th>\n </tr>\n <div\n v-if=\"headerSelectionOverlayStyle\"\n :class=\"[\n 'header-selection-overlay',\n { 'header-focused': focusedHeaderIndex !== null },\n ]\"\n :style=\"headerSelectionOverlayStyle\"\n />\n </thead>\n</template>\n\n<style scoped>\nthead {\n background-color: v-bind(headerBackgroundColor);\n border-bottom: var(--kds-border-base-subtle);\n\n & tr {\n display: flex;\n height: 100%;\n transition:\n height 0.3s,\n box-shadow 0.15s;\n\n & th {\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n text-align: left;\n white-space: nowrap;\n\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n padding: var(--kds-spacing-container-0-75x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.new-column-head {\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: var(--kds-spacing-container-0-5x);\n }\n }\n\n &:hover {\n outline: none;\n }\n }\n\n &.sub-menu-active tr {\n padding-right: var(--kds-dimension-component-width-2x);\n }\n}\n\n.header-selection-overlay {\n position: absolute;\n top: 0;\n height: 100%;\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.header-focused {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { useTemplateRef } from \"vue\";\n\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst emit = defineEmits<{\n click: [event: MouseEvent];\n \"keydown-up\": [event: KeyboardEvent];\n}>();\n\nconst buttonRef = \"button\";\nconst button = useTemplateRef<InstanceType<typeof KdsButton>>(buttonRef);\ndefineExpose({\n focus: () => {\n button.value?.$el.focus();\n },\n});\n</script>\n\n<template>\n <div class=\"sticky-container\">\n <KdsButton\n :ref=\"buttonRef\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n class=\"add-button\"\n @click=\"emit('click', $event)\"\n @keydown.up.prevent.stop=\"emit('keydown-up', $event)\"\n />\n </div>\n</template>\n\n<style scoped>\n.sticky-container {\n position: sticky;\n left: 0;\n width: fit-content;\n\n & .add-button {\n margin: var(--kds-spacing-container-0-25x);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { useTemplateRef } from \"vue\";\n\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst emit = defineEmits<{\n click: [event: MouseEvent];\n \"keydown-up\": [event: KeyboardEvent];\n}>();\n\nconst buttonRef = \"button\";\nconst button = useTemplateRef<InstanceType<typeof KdsButton>>(buttonRef);\ndefineExpose({\n focus: () => {\n button.value?.$el.focus();\n },\n});\n</script>\n\n<template>\n <div class=\"sticky-container\">\n <KdsButton\n :ref=\"buttonRef\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n class=\"add-button\"\n @click=\"emit('click', $event)\"\n @keydown.up.prevent.stop=\"emit('keydown-up', $event)\"\n />\n </div>\n</template>\n\n<style scoped>\n.sticky-container {\n position: sticky;\n left: 0;\n width: fit-content;\n\n & .add-button {\n margin: var(--kds-spacing-container-0-25x);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { KdsIcon } from \"@knime/kds-components\";\n\ndefineProps<{\n toggled?: boolean;\n}>();\n\ndefineEmits<{\n click: [event: MouseEvent];\n}>();\n</script>\n\n<template>\n <div\n role=\"button\"\n tabindex=\"-1\"\n :class=\"['expand-button', { toggled }]\"\n aria-label=\"Open data value view\"\n @click=\"$emit('click', $event)\"\n >\n <KdsIcon name=\"data-value-view\" size=\"small\" />\n </div>\n</template>\n\n<style scoped>\n.expand-button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-1x);\n height: var(--kds-dimension-component-height-1x);\n padding: 0;\n color: var(--kds-color-text-and-icon-info);\n cursor: pointer;\n background-color: var(--kds-color-background-neutral-initial);\n border: none;\n border-radius: var(--kds-border-radius-container-0-12x);\n\n &:hover {\n background-color: var(--kds-color-background-neutral-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-neutral-active);\n }\n\n &.toggled {\n color: var(--kds-color-text-and-icon-neutral-inverted);\n background-color: var(--kds-color-background-info-bold-initial);\n border: var(--kds-border-action-transparent);\n\n &:hover {\n background-color: var(--kds-color-background-info-bold-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-info-bold-active);\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { KdsIcon } from \"@knime/kds-components\";\n\ndefineProps<{\n toggled?: boolean;\n}>();\n\ndefineEmits<{\n click: [event: MouseEvent];\n}>();\n</script>\n\n<template>\n <div\n role=\"button\"\n tabindex=\"-1\"\n :class=\"['expand-button', { toggled }]\"\n aria-label=\"Open data value view\"\n @click=\"$emit('click', $event)\"\n >\n <KdsIcon name=\"data-value-view\" size=\"small\" />\n </div>\n</template>\n\n<style scoped>\n.expand-button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-1x);\n height: var(--kds-dimension-component-height-1x);\n padding: 0;\n color: var(--kds-color-text-and-icon-info);\n cursor: pointer;\n background-color: var(--kds-color-background-neutral-initial);\n border: none;\n border-radius: var(--kds-border-radius-container-0-12x);\n\n &:hover {\n background-color: var(--kds-color-background-neutral-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-neutral-active);\n }\n\n &.toggled {\n color: var(--kds-color-text-and-icon-neutral-inverted);\n background-color: var(--kds-color-background-info-bold-initial);\n border: var(--kds-border-action-transparent);\n\n &:hover {\n background-color: var(--kds-color-background-info-bold-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-info-bold-active);\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, useTemplateRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport { KdsMissingValueIcon, vKdsTooltip } from \"@knime/kds-components\";\n\nimport { EXPAND_BUTTON_WIDTH } from \"../../constants\";\nimport { useDataValueViews } from \"../composables/useDataValueViews\";\nimport CellExpandButton from \"../ui/CellExpandButton.vue\";\n\nimport type { CellRendererProps } from \"./CellRendererProps\";\n\nconst emit = defineEmits([\"click\", \"expand\", \"input\", \"select\"]);\nconst props = defineProps<CellRendererProps>();\n\nconst dataCellColorStyle = computed(() => {\n const { color } = props;\n return color === null\n ? {}\n : {\n \"--data-cell-color\": color,\n };\n});\n\nconst hasPaddingTopBottom = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingTopBottom));\n});\n\nconst hasPaddingLeftRight = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingLeftRight));\n});\n\nconst paddingTopBottom = computed(() => {\n if (!hasPaddingTopBottom.value) {\n return {};\n }\n\n let paddingTopBottom = props.defaultTopBottomPadding;\n if (props.isMissing) {\n // height of text is 16px, height of missing value icon is 14px => padding needs to be increased by 1px\n paddingTopBottom += 1;\n }\n\n return {\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n };\n});\n\nconst cellContent: Ref<HTMLElement | null> = useTemplateRef(\"cell-content\");\nconst getCellContentDimensions = () => {\n const firstElementChild = cellContent.value?.firstElementChild;\n let widthDataCellFirstChild = 0;\n let heightDataCellFirstChild = 0;\n if (firstElementChild) {\n widthDataCellFirstChild = Math.ceil(firstElementChild.scrollWidth);\n heightDataCellFirstChild = Math.ceil(firstElementChild.scrollHeight);\n }\n return {\n width: props.defaultLeftRightPadding * 2 + widthDataCellFirstChild,\n height:\n heightDataCellFirstChild +\n (hasPaddingTopBottom.value ? props.defaultTopBottomPadding * 2 : 0),\n };\n};\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst onPointerMove = throttle(() => {\n if (props.selectOnMove) {\n emit(\"select\", { expandSelection: true });\n }\n});\n\nconst onPointerDown = (event: MouseEvent) => {\n if (event.button === 0) {\n emit(\"select\", { expandSelection: event.shiftKey });\n }\n};\n\nconst { close: closeExpandedSelectedCell, isShown: isExpandedIfSelected } =\n useDataValueViews();\n\nconst expand = () => emit(\"expand\");\nconst expandAndSelect = (event: MouseEvent) => {\n expand();\n\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n};\n\nconst isExpanded = computed(\n () => props.isSelected && isExpandedIfSelected.value,\n);\nconst isHovered = ref(false);\nconst showCellExpandButton = computed(\n () => props.enableExpand && (isHovered.value || isExpanded.value),\n);\n\n// Snapshot taken on pointerdown — by the time `click` fires, selecting this\n// cell may have already auto-expanded it (when another cell's view was open),\n// flipping `props.isExpanded` to true and making us wrongly close.\nconst wasExpandedAtPointerDown = ref(false);\nconst onExpandButtonPointerDown = () => {\n wasExpandedAtPointerDown.value = isExpanded.value;\n};\nconst onExpandButtonClick = (event: MouseEvent) => {\n if (wasExpandedAtPointerDown.value) {\n closeExpandedSelectedCell();\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n } else {\n expandAndSelect(event);\n }\n};\n\nconst changeExpandedCellViewIfNecessary = () => {\n if (props.isToBeExpanded) {\n if (props.enableExpand) {\n expand();\n } else {\n closeExpandedSelectedCell();\n }\n }\n};\n\nwatch(() => props.isToBeExpanded, changeExpandedCellViewIfNecessary);\nonMounted(changeExpandedCellViewIfNecessary);\n</script>\n\n<template>\n <td\n v-kds-tooltip=\"isMissing ? props.tooltip : undefined\"\n :class=\"[\n 'data-cell',\n {\n 'colored-cell': color,\n 'in-cell-selection': isInCellSelection,\n },\n ]\"\n :style=\"{\n width: `var(${colSizeCssVar})`,\n ...(hasPaddingLeftRight\n ? {\n paddingLeft: `${props.defaultLeftRightPadding}px`,\n paddingRight: `${props.defaultLeftRightPadding}px`,\n }\n : {}),\n ...paddingTopBottom,\n ...dataCellColorStyle,\n }\"\n @dblclick=\"(event: MouseEvent) => enableExpand && expandAndSelect(event)\"\n @pointerenter=\"isHovered = true\"\n @pointerleave=\"isHovered = false\"\n @pointermove=\"onPointerMove\"\n @pointerdown=\"onPointerDown\"\n @input=\"(val: any) => emit('input', { value: val, cell: $el })\"\n >\n <div ref=\"cell-content\" class=\"cell-content\">\n <slot v-if=\"isEditing\" name=\"editable-cell\" :cell-element=\"$el\" />\n <KdsMissingValueIcon v-else-if=\"isMissing\" size=\"small\" />\n <slot\n v-else-if=\"isSlotted\"\n :width=\"\n size -\n props.defaultLeftRightPadding * 2 -\n (showCellExpandButton && !overlayExpandButton\n ? EXPAND_BUTTON_WIDTH\n : 0)\n \"\n />\n <span v-else v-kds-tooltip:truncated=\"props.tooltip\" class=\"cell-text\">\n {{ text }}\n </span>\n <CellExpandButton\n v-if=\"showCellExpandButton\"\n :class=\"{ overlaid: overlayExpandButton }\"\n :toggled=\"isExpanded\"\n @pointerdown=\"onExpandButtonPointerDown\"\n @click=\"onExpandButtonClick\"\n />\n </div>\n </td>\n</template>\n\n<style scoped>\n.data-cell {\n display: flex;\n font: var(--kds-font-base-interactive-small);\n color: var(--kds-color-text-and-icon-neutral);\n white-space: nowrap;\n user-select: none;\n background-clip: border-box;\n\n &.in-cell-selection {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-cell {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .cell-content {\n position: relative;\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-self: flex-start;\n justify-content: space-between;\n width: 100%;\n\n /* Anchored at the same height as the buttons of padded (non-slotted)\n cells, so it lines up with the other columns' buttons in the row. */\n & > .overlaid {\n position: absolute;\n top: v-bind(\"`${defaultTopBottomPadding}px`\");\n right: 0;\n }\n }\n\n & .cell-content .cell-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, useTemplateRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport { KdsMissingValueIcon, vKdsTooltip } from \"@knime/kds-components\";\n\nimport { EXPAND_BUTTON_WIDTH } from \"../../constants\";\nimport { useDataValueViews } from \"../composables/useDataValueViews\";\nimport CellExpandButton from \"../ui/CellExpandButton.vue\";\n\nimport type { CellRendererProps } from \"./CellRendererProps\";\n\nconst emit = defineEmits([\"click\", \"expand\", \"input\", \"select\"]);\nconst props = defineProps<CellRendererProps>();\n\nconst dataCellColorStyle = computed(() => {\n const { color } = props;\n return color === null\n ? {}\n : {\n \"--data-cell-color\": color,\n };\n});\n\nconst hasPaddingTopBottom = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingTopBottom));\n});\n\nconst hasPaddingLeftRight = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingLeftRight));\n});\n\nconst paddingTopBottom = computed(() => {\n if (!hasPaddingTopBottom.value) {\n return {};\n }\n\n let paddingTopBottom = props.defaultTopBottomPadding;\n if (props.isMissing) {\n // height of text is 16px, height of missing value icon is 14px => padding needs to be increased by 1px\n paddingTopBottom += 1;\n }\n\n return {\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n };\n});\n\nconst cellContent: Ref<HTMLElement | null> = useTemplateRef(\"cell-content\");\nconst getCellContentDimensions = () => {\n const firstElementChild = cellContent.value?.firstElementChild;\n let widthDataCellFirstChild = 0;\n let heightDataCellFirstChild = 0;\n if (firstElementChild) {\n widthDataCellFirstChild = Math.ceil(firstElementChild.scrollWidth);\n heightDataCellFirstChild = Math.ceil(firstElementChild.scrollHeight);\n }\n return {\n width: props.defaultLeftRightPadding * 2 + widthDataCellFirstChild,\n height:\n heightDataCellFirstChild +\n (hasPaddingTopBottom.value ? props.defaultTopBottomPadding * 2 : 0),\n };\n};\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst onPointerMove = throttle(() => {\n if (props.selectOnMove) {\n emit(\"select\", { expandSelection: true });\n }\n});\n\nconst onPointerDown = (event: MouseEvent) => {\n if (event.button === 0) {\n emit(\"select\", { expandSelection: event.shiftKey });\n }\n};\n\nconst { close: closeExpandedSelectedCell, isShown: isExpandedIfSelected } =\n useDataValueViews();\n\nconst expand = () => emit(\"expand\");\nconst expandAndSelect = (event: MouseEvent) => {\n expand();\n\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n};\n\nconst isExpanded = computed(\n () => props.isSelected && isExpandedIfSelected.value,\n);\nconst isHovered = ref(false);\nconst showCellExpandButton = computed(\n () => props.enableExpand && (isHovered.value || isExpanded.value),\n);\n\n// Snapshot taken on pointerdown — by the time `click` fires, selecting this\n// cell may have already auto-expanded it (when another cell's view was open),\n// flipping `props.isExpanded` to true and making us wrongly close.\nconst wasExpandedAtPointerDown = ref(false);\nconst onExpandButtonPointerDown = () => {\n wasExpandedAtPointerDown.value = isExpanded.value;\n};\nconst onExpandButtonClick = (event: MouseEvent) => {\n if (wasExpandedAtPointerDown.value) {\n closeExpandedSelectedCell();\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n } else {\n expandAndSelect(event);\n }\n};\n\nconst changeExpandedCellViewIfNecessary = () => {\n if (props.isToBeExpanded) {\n if (props.enableExpand) {\n expand();\n } else {\n closeExpandedSelectedCell();\n }\n }\n};\n\nwatch(() => props.isToBeExpanded, changeExpandedCellViewIfNecessary);\nonMounted(changeExpandedCellViewIfNecessary);\n</script>\n\n<template>\n <td\n v-kds-tooltip=\"isMissing ? props.tooltip : undefined\"\n :class=\"[\n 'data-cell',\n {\n 'colored-cell': color,\n 'in-cell-selection': isInCellSelection,\n },\n ]\"\n :style=\"{\n width: `var(${colSizeCssVar})`,\n ...(hasPaddingLeftRight\n ? {\n paddingLeft: `${props.defaultLeftRightPadding}px`,\n paddingRight: `${props.defaultLeftRightPadding}px`,\n }\n : {}),\n ...paddingTopBottom,\n ...dataCellColorStyle,\n }\"\n @dblclick=\"(event: MouseEvent) => enableExpand && expandAndSelect(event)\"\n @pointerenter=\"isHovered = true\"\n @pointerleave=\"isHovered = false\"\n @pointermove=\"onPointerMove\"\n @pointerdown=\"onPointerDown\"\n @input=\"(val: any) => emit('input', { value: val, cell: $el })\"\n >\n <div ref=\"cell-content\" class=\"cell-content\">\n <slot v-if=\"isEditing\" name=\"editable-cell\" :cell-element=\"$el\" />\n <KdsMissingValueIcon v-else-if=\"isMissing\" size=\"small\" />\n <slot\n v-else-if=\"isSlotted\"\n :width=\"\n size -\n props.defaultLeftRightPadding * 2 -\n (showCellExpandButton && !overlayExpandButton\n ? EXPAND_BUTTON_WIDTH\n : 0)\n \"\n />\n <span v-else v-kds-tooltip:truncated=\"props.tooltip\" class=\"cell-text\">\n {{ text }}\n </span>\n <CellExpandButton\n v-if=\"showCellExpandButton\"\n :class=\"{ overlaid: overlayExpandButton }\"\n :toggled=\"isExpanded\"\n @pointerdown=\"onExpandButtonPointerDown\"\n @click=\"onExpandButtonClick\"\n />\n </div>\n </td>\n</template>\n\n<style scoped>\n.data-cell {\n display: flex;\n font: var(--kds-font-base-interactive-small);\n color: var(--kds-color-text-and-icon-neutral);\n white-space: nowrap;\n user-select: none;\n background-clip: border-box;\n\n &.in-cell-selection {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-cell {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .cell-content {\n position: relative;\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-self: flex-start;\n justify-content: space-between;\n width: 100%;\n\n /* Anchored at the same height as the buttons of padded (non-slotted)\n cells, so it lines up with the other columns' buttons in the row. */\n & > .overlaid {\n position: absolute;\n top: v-bind(\"`${defaultTopBottomPadding}px`\");\n right: 0;\n }\n }\n\n & .cell-content .cell-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, type Slot, computed, ref } from \"vue\";\n\nimport {\n getColor,\n getMissingValueMessage,\n isMissingValue,\n unpackObjectRepresentation,\n} from \"../../utils\";\n\nimport type { CellProps } from \"./CellProps\";\nimport CellRenderer from \"./CellRenderer.vue\";\n\nconst emit = defineEmits([\"click\", \"input\", \"select\", \"dataValueView\"]);\nconst props = defineProps<CellProps>();\n\nconst color = computed(() => getColor(props.cellData));\n\n/* const isClickable = computed(() => {\n const { cellData, isClickableByConfig } = props;\n return isClickableByConfig && Boolean(cellData) && cellData !== \"-\";\n}); */\n\nconst isMissing = computed(() => isMissingValue(props.cellData));\n\nconst unpackedValue = computed(() =>\n unpackObjectRepresentation(props.cellData),\n);\n\nconst tooltip = computed(() => {\n const { cellData } = props;\n if (isMissingValue(cellData)) {\n return getMissingValueMessage(cellData);\n }\n if (unpackedValue.value === undefined) {\n return null;\n } else {\n return String(unpackedValue.value);\n }\n});\n\nconst cellRenderer: Ref<InstanceType<typeof CellRenderer> | null> = ref(null);\nconst getCellContentDimensions = () =>\n cellRenderer.value?.getCellContentDimensions();\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst slots = defineSlots<Record<string, Slot>>();\n\nconst forwardedSlotEntries = Object.entries(slots) as Array<[string, Slot]>;\n</script>\n\n<template>\n <CellRenderer\n ref=\"cellRenderer\"\n :is-missing\n :is-slotted=\"column.hasSlotContent ?? false\"\n :text=\"unpackedValue\"\n :tooltip=\"tooltip\"\n :color\n :select-on-move\n :default-top-bottom-padding\n :default-left-right-padding\n :no-padding-left-right=\"column.noPaddingLeftRight\"\n :no-padding-top-bottom=\"column.noPaddingTopBottom\"\n :col-size-css-var\n :size\n :enable-expand=\"\n !isMissing && enableDataValueView && column.hasDataValueView\n \"\n :overlay-expand-button=\"column.overlayDataValueViewButton\"\n :is-selected\n :is-in-cell-selection\n :is-to-be-expanded\n :is-editing\n @click=\"(value) => emit('click', value)\"\n @expand=\"() => emit('dataValueView')\"\n @select=\"(value) => emit('select', value)\"\n @input=\"(value) => emit('input', value)\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </CellRenderer>\n</template>\n","<script setup lang=\"ts\">\nimport { type Ref, type Slot, computed, ref } from \"vue\";\n\nimport {\n getColor,\n getMissingValueMessage,\n isMissingValue,\n unpackObjectRepresentation,\n} from \"../../utils\";\n\nimport type { CellProps } from \"./CellProps\";\nimport CellRenderer from \"./CellRenderer.vue\";\n\nconst emit = defineEmits([\"click\", \"input\", \"select\", \"dataValueView\"]);\nconst props = defineProps<CellProps>();\n\nconst color = computed(() => getColor(props.cellData));\n\n/* const isClickable = computed(() => {\n const { cellData, isClickableByConfig } = props;\n return isClickableByConfig && Boolean(cellData) && cellData !== \"-\";\n}); */\n\nconst isMissing = computed(() => isMissingValue(props.cellData));\n\nconst unpackedValue = computed(() =>\n unpackObjectRepresentation(props.cellData),\n);\n\nconst tooltip = computed(() => {\n const { cellData } = props;\n if (isMissingValue(cellData)) {\n return getMissingValueMessage(cellData);\n }\n if (unpackedValue.value === undefined) {\n return null;\n } else {\n return String(unpackedValue.value);\n }\n});\n\nconst cellRenderer: Ref<InstanceType<typeof CellRenderer> | null> = ref(null);\nconst getCellContentDimensions = () =>\n cellRenderer.value?.getCellContentDimensions();\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst slots = defineSlots<Record<string, Slot>>();\n\nconst forwardedSlotEntries = Object.entries(slots) as Array<[string, Slot]>;\n</script>\n\n<template>\n <CellRenderer\n ref=\"cellRenderer\"\n :is-missing\n :is-slotted=\"column.hasSlotContent ?? false\"\n :text=\"unpackedValue\"\n :tooltip=\"tooltip\"\n :color\n :select-on-move\n :default-top-bottom-padding\n :default-left-right-padding\n :no-padding-left-right=\"column.noPaddingLeftRight\"\n :no-padding-top-bottom=\"column.noPaddingTopBottom\"\n :col-size-css-var\n :size\n :enable-expand=\"\n !isMissing && enableDataValueView && column.hasDataValueView\n \"\n :overlay-expand-button=\"column.overlayDataValueViewButton\"\n :is-selected\n :is-in-cell-selection\n :is-to-be-expanded\n :is-editing\n @click=\"(value) => emit('click', value)\"\n @expand=\"() => emit('dataValueView')\"\n @select=\"(value) => emit('select', value)\"\n @input=\"(value) => emit('input', value)\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </CellRenderer>\n</template>\n","<script setup lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * A table row element which is used for displaying data in the table body. It offers a\n * wide range of functionality which is described in the following sections:\n *\n * Collapsible content:\n * This component can be optionally collapsible for showing row-specific details/content.\n * This expand capability is slotted for flexibility.\n *\n * Selection:\n * Each row can also be selectable- with a checkbox in the first position of the row.\n *\n * SubMenu:\n * A row can display a SubMenu in the last position of the row with row-specific actions\n * configured via props.\n *\n * Editable rows:\n * A cell in the row can be editable and render an input field or other component to allow\n * real time interactions and events.\n *\n * Cell events:\n * DOM events are triggered on a cell-by-cell basis for both clicking and hovering. These events\n * emit information about the data of the cell and the index of the column in the row.\n *\n * Dynamic cell content:\n * Specific columns can be slotted for dynamic rendering methods or configured to use a pre-determined\n * rendering component with the Vue Component/v-is API.\n *\n * @emits rowSelect event when selection is enabled and a row checkbox is toggled.\n * @emits rowInput event when table cells are clicked, cell input is triggered or a hover event is\n * detected.\n * @emits rowSubMenuClick event when a row SubMenu action is triggered.\n */\n\nimport { type Ref, computed, ref, toRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n KdsMenuButton,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport type { ColumnConfig, RowConfig, SubMenuConfig } from \"../..\";\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_HEIGHT,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { VirtualElementAnchor } from \"../../types/DataValueView\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport {\n getPropertiesFromColumns,\n unpackObjectRepresentation,\n} from \"../../utils\";\nimport { injectRegisterExpandedSubMenu } from \"../composables/useCloseSubMenusOnScroll\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport Cell from \"./Cell.vue\";\n\nexport interface RowProps {\n rowData?: { subMenuItemsForRow?: KdsMenuItem[] };\n row?: any[];\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n columns: ColumnConfig[];\n rowConfig?: RowConfig;\n rowHeight?: number | \"dynamic\";\n isSelected?: boolean;\n minRowHeight?: number;\n showDragHandle?: boolean;\n selectCellsOnMove?: boolean;\n disableRowHeightTransition?: boolean;\n selectedCellIndex?: number | null;\n cellSelectionRange?: { min: number; max: number } | null;\n toBeExpandedCellIndex?: number | null;\n toBeEditedCellIndex?: number | null;\n newColumnButtonWidth?: number;\n}\n\nconst props = withDefaults(defineProps<RowProps>(), {\n rowData: () => ({}),\n rowConfig: () => ({}),\n row: () => [],\n rowHeight: DEFAULT_ROW_HEIGHT,\n minRowHeight: 0,\n isSelected: false,\n selectCellsOnMove: false,\n showDragHandle: false,\n disableRowHeightTransition: false,\n selectedCellIndex: null,\n cellSelectionRange: null,\n toBeExpandedCellIndex: null,\n toBeEditedCellIndex: null,\n newColumnButtonWidth: 0,\n});\n\nconst { indexedData: indexedRow, style: rowStyles } = useIndicesAndStylesFor(\n toRef(props, \"row\"),\n);\n\nconst emit = defineEmits<{\n rowSelect: [value: any];\n rowInput: [event: any];\n rowSubMenuClick: [item: any];\n resizeAllRows: [size: number, rowElement: HTMLElement];\n resizeRow: [size: number];\n cellSelect: [index: number, ignoreIfSelected: boolean];\n expandCellSelect: [index: number];\n dataValueView: [index: number, anchor: VirtualElementAnchor];\n deleteRow: [];\n virtualColumnNav: [\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n ];\n}>();\n\nconst showContent = ref(false);\nconst currentRowHeight = ref(props.rowHeight);\nconst paddingTopBottom = computed(() =>\n props.rowConfig.compactMode\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\nconst paddingLeftRight = CELL_PADDING_HORIZONTAL;\n\nwatch(\n () => props.rowHeight,\n (newRowHeight) => {\n currentRowHeight.value = newRowHeight;\n },\n);\nconst activeDrag = ref(false);\nconst rowHeightOnDragStart = ref(0);\n\nconst columnKeys = computed(() =>\n getPropertiesFromColumns(props.columns, \"key\"),\n);\n\nconst DEFAULT_COLUMN_SIZE = 100;\n// The resize-frozen sizes are used so the slotted cell content does not\n// re-render on every drag frame of a column resize; while not resizing they\n// are identical to the live sizes.\nconst { colSizesFrozenWhenResizing } = injectColumnSizes();\nconst getCellSize = (index: number) =>\n colSizesFrozenWhenResizing.value[index] ?? DEFAULT_COLUMN_SIZE;\n\n// const clickableColumns = computed(() =>\n// getPropertiesFromColumns(props.columnConfigs, \"popoverRenderer\").map(\n// (config) => Boolean(config),\n// ),\n// );\nconst filteredSubMenuItems = computed(() => {\n if (\n !props.subMenuConfig.subMenuItems?.length &&\n !props.rowData?.subMenuItemsForRow?.length\n ) {\n return [];\n }\n\n return props.rowData?.subMenuItemsForRow?.length\n ? props.rowData?.subMenuItemsForRow\n : props.subMenuConfig.subMenuItems;\n});\nconst onDeleteRow = () => {\n emit(\"deleteRow\");\n};\nconst onRowExpand = () => {\n showContent.value = !showContent.value;\n};\nconst onSelect = (value: any) => {\n emit(\"rowSelect\", value);\n};\nconst onCellClick = (event: any, colInd: number, data: any) => {\n emit(\"rowInput\", {\n ...event,\n type: \"click\",\n value: null,\n colInd,\n data,\n });\n};\nconst onInput = (event: any) => {\n emit(\"rowInput\", { type: \"input\", ...event });\n};\nconst registerExpandedSubMenu = injectRegisterExpandedSubMenu();\nconst isMenuOpen = ref(false);\nwatch(isMenuOpen, (open) => {\n if (open) {\n registerExpandedSubMenu(() => {\n isMenuOpen.value = false;\n });\n }\n});\n// const isClickableByConfig = (ind: number) => {\n// return Boolean(props.tableConfig.showPopovers) && clickableColumns.value[ind];\n// };\nconst getCellContentSlotName = (columnKeys: any, columnId: any) => {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columnKeys[columnId]}`;\n};\nconst onPointerDown = (event: PointerEvent) => {\n if (currentRowHeight.value === \"dynamic\") {\n return;\n }\n consola.debug(\"Resize via row drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n (event.target as Element).setPointerCapture(event.pointerId);\n activeDrag.value = true;\n rowHeightOnDragStart.value = currentRowHeight.value;\n};\n\nconst rowElement: Ref<null | HTMLElement> = ref(null);\nconst onPointerUp = (event: PointerEvent) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via row drag ended: \", event);\n activeDrag.value = false;\n emit(\"resizeAllRows\", currentRowHeight.value as number, rowElement.value!);\n }\n};\nconst onPointerMove = throttle((event) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n const newRowHeight =\n event.clientY - rowElement.value!.getBoundingClientRect().top;\n currentRowHeight.value = Math.max(newRowHeight, props.minRowHeight);\n emit(\"resizeRow\", currentRowHeight.value - rowHeightOnDragStart.value);\n }\n});\nconst onLostPointerCapture = throttle(() => {\n activeDrag.value = false;\n});\nconst cells: Ref<Record<number, any>> = ref({});\nconst getCellComponents = () => {\n return props.row.map((_, columnIndex) => cells.value[columnIndex]);\n};\nconst onCellSelect = ({\n expandSelection,\n ind,\n ignoreIfSelected = false,\n}: {\n expandSelection: boolean;\n ind: number;\n ignoreIfSelected?: boolean;\n}) => {\n if (expandSelection) {\n emit(\"expandCellSelect\", ind);\n } else {\n emit(\"cellSelect\", ind, ignoreIfSelected);\n }\n};\n\nconst onDataValueView = (index: number) => {\n const anchor = cells.value[index].$el.getBoundingClientRect();\n emit(\"dataValueView\", index, anchor);\n};\n\nconst selectionCheckbox = ref<InstanceType<typeof KdsCheckbox> | null>(null);\nconst deleteButton = ref<InstanceType<typeof KdsButton> | null>(null);\nconst onVirtualColumnKeydown = (\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n) => {\n emit(\"virtualColumnNav\", type, direction);\n};\n\nconst focusDeleteButton = () => {\n deleteButton.value?.$el?.focus();\n};\nconst focusSelectionCheckbox = () => {\n (selectionCheckbox.value as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n};\n\nconst rowHeightStyle = computed(() =>\n currentRowHeight.value === \"dynamic\"\n ? {}\n : { height: `${currentRowHeight.value}px` },\n);\n\nconst transitionInactiveDrag = computed(() => {\n const rowHeightTransition = props.disableRowHeightTransition\n ? \"\"\n : \"height 0.3s, \";\n return { transition: `${rowHeightTransition}box-shadow 0.15s` };\n});\n\nconst transition = computed(() =>\n activeDrag.value ? {} : transitionInactiveDrag.value,\n);\n\ndefineExpose({\n getCellComponents,\n focusDeleteButton,\n focusSelectionCheckbox,\n /**\n * For TableUI test purposes only\n */\n onRowExpand,\n});\n</script>\n\n<template>\n <tr\n ref=\"rowElement\"\n :class=\"[\n 'row',\n {\n 'no-sub-menu': !filteredSubMenuItems?.length,\n 'compact-mode': rowConfig.compactMode,\n },\n ]\"\n :style=\"{\n ...rowStyles,\n ...transition,\n ...rowHeightStyle,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell\">\n <KdsButton\n ref=\"deleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n destructive\n ariaLabel=\"Delete row\"\n @click.stop=\"onDeleteRow\"\n @keydown.left.prevent.stop\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('delete', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('delete', 'down')\"\n @keydown.right.prevent.stop=\"onVirtualColumnKeydown('delete', 'right')\"\n />\n </td>\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox\n ref=\"selectionCheckbox\"\n tooltip=\"Select row\"\n class=\"select-checkbox\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('selection', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('selection', 'down')\"\n @keydown.left.prevent.stop=\"onVirtualColumnKeydown('selection', 'left')\"\n @keydown.right.prevent.stop=\"\n onVirtualColumnKeydown('selection', 'right')\n \"\n @focusout.stop\n />\n </td>\n <Cell\n v-for=\"[cell, ind] of indexedRow\"\n :ref=\"\n (el) => {\n cells[ind] = el;\n }\n \"\n :key=\"ind\"\n :column=\"columns[ind]\"\n :cell-data=\"cell\"\n :select-on-move=\"selectCellsOnMove\"\n :is-selected=\"selectedCellIndex === ind\"\n :is-in-cell-selection=\"\n cellSelectionRange !== null &&\n ind >= cellSelectionRange.min &&\n ind <= cellSelectionRange.max\n \"\n :is-to-be-expanded=\"toBeExpandedCellIndex === ind\"\n :enable-data-value-view=\"tableConfig.enableDataValueViews\"\n :is-editing=\"toBeEditedCellIndex === ind\"\n :col-size-css-var=\"getColSizeCSSVar(ind)\"\n :size=\"getCellSize(ind)\"\n :default-top-bottom-padding=\"paddingTopBottom\"\n :default-left-right-padding=\"paddingLeftRight\"\n @click=\"onCellClick($event, ind, cell)\"\n @select=\"onCellSelect({ ...$event, ind })\"\n @data-value-view=\"onDataValueView(ind)\"\n @input=\"onInput\"\n >\n <template #default=\"{ width }\">\n <slot\n :name=\"getCellContentSlotName(columnKeys, ind)\"\n :row=\"row\"\n :cell=\"unpackObjectRepresentation(cell)\"\n :height=\"rowHeight\"\n :width=\"width\"\n :ind=\"ind\"\n />\n </template>\n <template #editable-cell=\"{ cellElement }\">\n <slot name=\"editable-cell\" :cell-element=\"cellElement\" :ind=\"ind\" />\n </template>\n </Cell>\n <td v-if=\"filteredSubMenuItems?.length\" class=\"action\">\n <KdsMenuButton\n v-model=\"isMenuOpen\"\n ariaLabel=\"More actions\"\n :items=\"filteredSubMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @item-click=\"emit('rowSubMenuClick', $event)\"\n />\n </td>\n <td\n v-if=\"newColumnButtonWidth\"\n :style=\"{ minWidth: `${newColumnButtonWidth}px` }\"\n />\n </tr>\n <div\n v-if=\"showDragHandle && !selectCellsOnMove\"\n class=\"row-drag-handle\"\n @pointerdown.passive=\"onPointerDown\"\n @pointerup.passive=\"onPointerUp\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n />\n</template>\n\n<style scoped>\ntr {\n display: flex;\n}\n\ntr.row {\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n padding: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.deletion-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n overflow: visible;\n opacity: 0;\n\n &:focus-within {\n opacity: 1;\n }\n }\n\n &.action {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n }\n\n &:hover {\n outline: none;\n background-color: var(--kds-color-background-neutral-hover);\n\n /* stylelint-disable-next-line no-descending-specificity -- hover needs lower specificity but must come after base rule */\n & .deletion-cell {\n opacity: 1;\n }\n }\n\n & a {\n outline: none;\n }\n}\n\n.row-drag-handle {\n height: var(--kds-spacing-container-0-37x);\n margin-top: calc(-1 * var(--kds-spacing-container-0-37x));\n cursor: row-resize;\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * A table row element which is used for displaying data in the table body. It offers a\n * wide range of functionality which is described in the following sections:\n *\n * Collapsible content:\n * This component can be optionally collapsible for showing row-specific details/content.\n * This expand capability is slotted for flexibility.\n *\n * Selection:\n * Each row can also be selectable- with a checkbox in the first position of the row.\n *\n * SubMenu:\n * A row can display a SubMenu in the last position of the row with row-specific actions\n * configured via props.\n *\n * Editable rows:\n * A cell in the row can be editable and render an input field or other component to allow\n * real time interactions and events.\n *\n * Cell events:\n * DOM events are triggered on a cell-by-cell basis for both clicking and hovering. These events\n * emit information about the data of the cell and the index of the column in the row.\n *\n * Dynamic cell content:\n * Specific columns can be slotted for dynamic rendering methods or configured to use a pre-determined\n * rendering component with the Vue Component/v-is API.\n *\n * @emits rowSelect event when selection is enabled and a row checkbox is toggled.\n * @emits rowInput event when table cells are clicked, cell input is triggered or a hover event is\n * detected.\n * @emits rowSubMenuClick event when a row SubMenu action is triggered.\n */\n\nimport { type Ref, computed, ref, toRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n KdsMenuButton,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport type { ColumnConfig, RowConfig, SubMenuConfig } from \"../..\";\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_HEIGHT,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { VirtualElementAnchor } from \"../../types/DataValueView\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport {\n getPropertiesFromColumns,\n unpackObjectRepresentation,\n} from \"../../utils\";\nimport { injectRegisterExpandedSubMenu } from \"../composables/useCloseSubMenusOnScroll\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport Cell from \"./Cell.vue\";\n\nexport interface RowProps {\n rowData?: { subMenuItemsForRow?: KdsMenuItem[] };\n row?: any[];\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n columns: ColumnConfig[];\n rowConfig?: RowConfig;\n rowHeight?: number | \"dynamic\";\n isSelected?: boolean;\n minRowHeight?: number;\n showDragHandle?: boolean;\n selectCellsOnMove?: boolean;\n disableRowHeightTransition?: boolean;\n selectedCellIndex?: number | null;\n cellSelectionRange?: { min: number; max: number } | null;\n toBeExpandedCellIndex?: number | null;\n toBeEditedCellIndex?: number | null;\n newColumnButtonWidth?: number;\n}\n\nconst props = withDefaults(defineProps<RowProps>(), {\n rowData: () => ({}),\n rowConfig: () => ({}),\n row: () => [],\n rowHeight: DEFAULT_ROW_HEIGHT,\n minRowHeight: 0,\n isSelected: false,\n selectCellsOnMove: false,\n showDragHandle: false,\n disableRowHeightTransition: false,\n selectedCellIndex: null,\n cellSelectionRange: null,\n toBeExpandedCellIndex: null,\n toBeEditedCellIndex: null,\n newColumnButtonWidth: 0,\n});\n\nconst { indexedData: indexedRow, style: rowStyles } = useIndicesAndStylesFor(\n toRef(props, \"row\"),\n);\n\nconst emit = defineEmits<{\n rowSelect: [value: any];\n rowInput: [event: any];\n rowSubMenuClick: [item: any];\n resizeAllRows: [size: number, rowElement: HTMLElement];\n resizeRow: [size: number];\n cellSelect: [index: number, ignoreIfSelected: boolean];\n expandCellSelect: [index: number];\n dataValueView: [index: number, anchor: VirtualElementAnchor];\n deleteRow: [];\n virtualColumnNav: [\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n ];\n}>();\n\nconst showContent = ref(false);\nconst currentRowHeight = ref(props.rowHeight);\nconst paddingTopBottom = computed(() =>\n props.rowConfig.compactMode\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\nconst paddingLeftRight = CELL_PADDING_HORIZONTAL;\n\nwatch(\n () => props.rowHeight,\n (newRowHeight) => {\n currentRowHeight.value = newRowHeight;\n },\n);\nconst activeDrag = ref(false);\nconst rowHeightOnDragStart = ref(0);\n\nconst columnKeys = computed(() =>\n getPropertiesFromColumns(props.columns, \"key\"),\n);\n\nconst DEFAULT_COLUMN_SIZE = 100;\n// The resize-frozen sizes are used so the slotted cell content does not\n// re-render on every drag frame of a column resize; while not resizing they\n// are identical to the live sizes.\nconst { colSizesFrozenWhenResizing } = injectColumnSizes();\nconst getCellSize = (index: number) =>\n colSizesFrozenWhenResizing.value[index] ?? DEFAULT_COLUMN_SIZE;\n\n// const clickableColumns = computed(() =>\n// getPropertiesFromColumns(props.columnConfigs, \"popoverRenderer\").map(\n// (config) => Boolean(config),\n// ),\n// );\nconst filteredSubMenuItems = computed(() => {\n if (\n !props.subMenuConfig.subMenuItems?.length &&\n !props.rowData?.subMenuItemsForRow?.length\n ) {\n return [];\n }\n\n return props.rowData?.subMenuItemsForRow?.length\n ? props.rowData?.subMenuItemsForRow\n : props.subMenuConfig.subMenuItems;\n});\nconst onDeleteRow = () => {\n emit(\"deleteRow\");\n};\nconst onRowExpand = () => {\n showContent.value = !showContent.value;\n};\nconst onSelect = (value: any) => {\n emit(\"rowSelect\", value);\n};\nconst onCellClick = (event: any, colInd: number, data: any) => {\n emit(\"rowInput\", {\n ...event,\n type: \"click\",\n value: null,\n colInd,\n data,\n });\n};\nconst onInput = (event: any) => {\n emit(\"rowInput\", { type: \"input\", ...event });\n};\nconst registerExpandedSubMenu = injectRegisterExpandedSubMenu();\nconst isMenuOpen = ref(false);\nwatch(isMenuOpen, (open) => {\n if (open) {\n registerExpandedSubMenu(() => {\n isMenuOpen.value = false;\n });\n }\n});\n// const isClickableByConfig = (ind: number) => {\n// return Boolean(props.tableConfig.showPopovers) && clickableColumns.value[ind];\n// };\nconst getCellContentSlotName = (columnKeys: any, columnId: any) => {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columnKeys[columnId]}`;\n};\nconst onPointerDown = (event: PointerEvent) => {\n if (currentRowHeight.value === \"dynamic\") {\n return;\n }\n consola.debug(\"Resize via row drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n (event.target as Element).setPointerCapture(event.pointerId);\n activeDrag.value = true;\n rowHeightOnDragStart.value = currentRowHeight.value;\n};\n\nconst rowElement: Ref<null | HTMLElement> = ref(null);\nconst onPointerUp = (event: PointerEvent) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via row drag ended: \", event);\n activeDrag.value = false;\n emit(\"resizeAllRows\", currentRowHeight.value as number, rowElement.value!);\n }\n};\nconst onPointerMove = throttle((event) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n const newRowHeight =\n event.clientY - rowElement.value!.getBoundingClientRect().top;\n currentRowHeight.value = Math.max(newRowHeight, props.minRowHeight);\n emit(\"resizeRow\", currentRowHeight.value - rowHeightOnDragStart.value);\n }\n});\nconst onLostPointerCapture = throttle(() => {\n activeDrag.value = false;\n});\nconst cells: Ref<Record<number, any>> = ref({});\nconst getCellComponents = () => {\n return props.row.map((_, columnIndex) => cells.value[columnIndex]);\n};\nconst onCellSelect = ({\n expandSelection,\n ind,\n ignoreIfSelected = false,\n}: {\n expandSelection: boolean;\n ind: number;\n ignoreIfSelected?: boolean;\n}) => {\n if (expandSelection) {\n emit(\"expandCellSelect\", ind);\n } else {\n emit(\"cellSelect\", ind, ignoreIfSelected);\n }\n};\n\nconst onDataValueView = (index: number) => {\n const anchor = cells.value[index].$el.getBoundingClientRect();\n emit(\"dataValueView\", index, anchor);\n};\n\nconst selectionCheckbox = ref<InstanceType<typeof KdsCheckbox> | null>(null);\nconst deleteButton = ref<InstanceType<typeof KdsButton> | null>(null);\nconst onVirtualColumnKeydown = (\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n) => {\n emit(\"virtualColumnNav\", type, direction);\n};\n\nconst focusDeleteButton = () => {\n deleteButton.value?.$el?.focus();\n};\nconst focusSelectionCheckbox = () => {\n (selectionCheckbox.value as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n};\n\nconst rowHeightStyle = computed(() =>\n currentRowHeight.value === \"dynamic\"\n ? {}\n : { height: `${currentRowHeight.value}px` },\n);\n\nconst transitionInactiveDrag = computed(() => {\n const rowHeightTransition = props.disableRowHeightTransition\n ? \"\"\n : \"height 0.3s, \";\n return { transition: `${rowHeightTransition}box-shadow 0.15s` };\n});\n\nconst transition = computed(() =>\n activeDrag.value ? {} : transitionInactiveDrag.value,\n);\n\ndefineExpose({\n getCellComponents,\n focusDeleteButton,\n focusSelectionCheckbox,\n /**\n * For TableUI test purposes only\n */\n onRowExpand,\n});\n</script>\n\n<template>\n <tr\n ref=\"rowElement\"\n :class=\"[\n 'row',\n {\n 'no-sub-menu': !filteredSubMenuItems?.length,\n 'compact-mode': rowConfig.compactMode,\n },\n ]\"\n :style=\"{\n ...rowStyles,\n ...transition,\n ...rowHeightStyle,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell\">\n <KdsButton\n ref=\"deleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n destructive\n ariaLabel=\"Delete row\"\n @click.stop=\"onDeleteRow\"\n @keydown.left.prevent.stop\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('delete', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('delete', 'down')\"\n @keydown.right.prevent.stop=\"onVirtualColumnKeydown('delete', 'right')\"\n />\n </td>\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox\n ref=\"selectionCheckbox\"\n tooltip=\"Select row\"\n class=\"select-checkbox\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('selection', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('selection', 'down')\"\n @keydown.left.prevent.stop=\"onVirtualColumnKeydown('selection', 'left')\"\n @keydown.right.prevent.stop=\"\n onVirtualColumnKeydown('selection', 'right')\n \"\n @focusout.stop\n />\n </td>\n <Cell\n v-for=\"[cell, ind] of indexedRow\"\n :ref=\"\n (el) => {\n cells[ind] = el;\n }\n \"\n :key=\"ind\"\n :column=\"columns[ind]\"\n :cell-data=\"cell\"\n :select-on-move=\"selectCellsOnMove\"\n :is-selected=\"selectedCellIndex === ind\"\n :is-in-cell-selection=\"\n cellSelectionRange !== null &&\n ind >= cellSelectionRange.min &&\n ind <= cellSelectionRange.max\n \"\n :is-to-be-expanded=\"toBeExpandedCellIndex === ind\"\n :enable-data-value-view=\"tableConfig.enableDataValueViews\"\n :is-editing=\"toBeEditedCellIndex === ind\"\n :col-size-css-var=\"getColSizeCSSVar(ind)\"\n :size=\"getCellSize(ind)\"\n :default-top-bottom-padding=\"paddingTopBottom\"\n :default-left-right-padding=\"paddingLeftRight\"\n @click=\"onCellClick($event, ind, cell)\"\n @select=\"onCellSelect({ ...$event, ind })\"\n @data-value-view=\"onDataValueView(ind)\"\n @input=\"onInput\"\n >\n <template #default=\"{ width }\">\n <slot\n :name=\"getCellContentSlotName(columnKeys, ind)\"\n :row=\"row\"\n :cell=\"unpackObjectRepresentation(cell)\"\n :height=\"rowHeight\"\n :width=\"width\"\n :ind=\"ind\"\n />\n </template>\n <template #editable-cell=\"{ cellElement }\">\n <slot name=\"editable-cell\" :cell-element=\"cellElement\" :ind=\"ind\" />\n </template>\n </Cell>\n <td v-if=\"filteredSubMenuItems?.length\" class=\"action\">\n <KdsMenuButton\n v-model=\"isMenuOpen\"\n ariaLabel=\"More actions\"\n :items=\"filteredSubMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @item-click=\"emit('rowSubMenuClick', $event)\"\n />\n </td>\n <td\n v-if=\"newColumnButtonWidth\"\n :style=\"{ minWidth: `${newColumnButtonWidth}px` }\"\n />\n </tr>\n <div\n v-if=\"showDragHandle && !selectCellsOnMove\"\n class=\"row-drag-handle\"\n @pointerdown.passive=\"onPointerDown\"\n @pointerup.passive=\"onPointerUp\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n />\n</template>\n\n<style scoped>\ntr {\n display: flex;\n}\n\ntr.row {\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n padding: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.deletion-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n overflow: visible;\n opacity: 0;\n\n &:focus-within {\n opacity: 1;\n }\n }\n\n &.action {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n }\n\n &:hover {\n outline: none;\n background-color: var(--kds-color-background-neutral-hover);\n\n /* stylelint-disable-next-line no-descending-specificity -- hover needs lower specificity but must come after base rule */\n & .deletion-cell {\n opacity: 1;\n }\n }\n\n & a {\n outline: none;\n }\n}\n\n.row-drag-handle {\n height: var(--kds-spacing-container-0-37x);\n margin-top: calc(-1 * var(--kds-spacing-container-0-37x));\n cursor: row-resize;\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from \"vue\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../../constants\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport type { CellSelectionOverlayProps } from \"./CellSelectionOverlayProps\";\n\nconst props = defineProps<CellSelectionOverlayProps>();\n\n/**\n * Live numeric column sizes, injected rather than received as a prop. The\n * overlay is rendered as a sibling of the row/cell tree (in the\n * `cell-selection-overlay` slot), so re-rendering it when the sizes change\n * during a resize does not cascade to the cells. Reading the live sizes at\n * render time is therefore safe here and keeps the selection rectangle correct\n * while a column is being resized.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst getRowResizeOffset = computed(() => {\n const rowResizeIndex = props.rowResizeIndex;\n const rowResizeDelta = props.rowResizeDelta;\n if (rowResizeIndex === null || rowResizeDelta === null) {\n return () => 0;\n } else {\n return (index: number) => (index > rowResizeIndex ? rowResizeDelta : 0);\n }\n});\n\nconst top = computed(() => {\n const { min } = props.rect.y;\n return min * props.rowHeight + getRowResizeOffset.value(min);\n});\n\nconst bottom = computed(() => {\n const { max } = props.rect.y;\n return (max + 1) * props.rowHeight + getRowResizeOffset.value(max + 1);\n});\n\nconst columnOffsets = computed(() => {\n let currentOffset = 0;\n if (props.tableConfig.showSelection) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n if (props.tableConfig.enableRowDeletion) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n const offsets: number[] = [];\n colSizes.value.forEach((size) => {\n offsets.push(currentOffset);\n currentOffset += size;\n });\n offsets.push(currentOffset);\n return offsets;\n});\n\nconst left = computed(() => {\n const { min } = props.rect.x;\n return columnOffsets.value[min];\n});\n\nconst right = computed(() => {\n const { max } = props.rect.x;\n return columnOffsets.value[max + 1];\n});\n\nconst height = computed(() => {\n return bottom.value - top.value;\n});\n\nconst width = computed(() => {\n return right.value - left.value;\n});\n\nconst copied = ref(false);\nconst triggerCopied = () => {\n copied.value = true;\n};\n\nconst virtualFocusOverlay = ref<null | HTMLDivElement>(null);\nconst virtualFocusOverlayCoordinates = computed(() => {\n if (!props.cellSelectionRectFocusCorner) {\n return null;\n }\n const { x: left, y: top } = props.cellSelectionRectFocusCorner;\n const right = left + 1;\n const bottom = top + 1;\n return {\n left: columnOffsets.value[left],\n right: columnOffsets.value[right],\n top: top * props.rowHeight + getRowResizeOffset.value(top),\n bottom: bottom * props.rowHeight + getRowResizeOffset.value(bottom),\n };\n});\n\nconst virtualFocusOverlayHeight = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.bottom -\n virtualFocusOverlayCoordinates.value!.top\n );\n});\n\nconst virtualFocusOverlayWidth = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.right -\n virtualFocusOverlayCoordinates.value!.left\n );\n});\n\nconst isVirtualFocusOverlayInsideViewportOfBody = (\n containerBCR: DOMRect,\n focusOverlay: HTMLDivElement,\n headerHeight: number,\n) => {\n const virtualFocusOverlayBCR = focusOverlay.getBoundingClientRect();\n const bodyTop = containerBCR.top + headerHeight;\n\n return {\n verticalInside:\n bodyTop <= virtualFocusOverlayBCR.top &&\n virtualFocusOverlayBCR.bottom <= containerBCR.bottom,\n horizontalInside:\n containerBCR.left <= virtualFocusOverlayBCR.left &&\n virtualFocusOverlayBCR.right <= containerBCR.right,\n };\n};\n\nconst scrollFocusOverlayIntoView = async (\n params: null | {\n containerBCR: DOMRect | null;\n headerHeight: number;\n scrollTo: (scrollToValues: {\n top?: number;\n left?: number;\n }) => void | undefined;\n },\n) => {\n // wait for focusOverlay to render at new position to calculate bounding client rect\n await nextTick();\n if (params) {\n const { containerBCR, headerHeight, scrollTo } = params;\n if (\n containerBCR &&\n virtualFocusOverlay.value &&\n virtualFocusOverlayCoordinates.value\n ) {\n const { verticalInside, horizontalInside } =\n isVirtualFocusOverlayInsideViewportOfBody(\n containerBCR,\n virtualFocusOverlay.value,\n headerHeight,\n );\n\n if (!verticalInside) {\n scrollTo({\n top:\n virtualFocusOverlayCoordinates.value.top -\n containerBCR.height / 2 +\n virtualFocusOverlayHeight.value,\n });\n } else if (!horizontalInside) {\n scrollTo({\n left:\n virtualFocusOverlayCoordinates.value.left -\n containerBCR.width / 2 +\n virtualFocusOverlayWidth.value / 2,\n });\n }\n }\n } else {\n virtualFocusOverlay.value?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n });\n }\n};\n\nconst getFocusOverlayBoundingClientRect = () =>\n virtualFocusOverlay.value?.getBoundingClientRect();\n\ndefineExpose({\n triggerCopied,\n focus,\n scrollFocusOverlayIntoView,\n getFocusOverlayBoundingClientRect,\n});\n</script>\n\n<template>\n <div\n class=\"overlay\"\n :class=\"{ copied: copied }\"\n :style=\"{\n transform: `translateY(${top}px) translateX(${left}px)`,\n width: `${width}px`,\n height: `${height}px`,\n }\"\n @animationend=\"copied = false\"\n />\n <div\n v-if=\"virtualFocusOverlayCoordinates\"\n ref=\"virtualFocusOverlay\"\n class=\"overlay virtual-focus\"\n :style=\"{\n transform: `translateY(${virtualFocusOverlayCoordinates.top}px) translateX(${virtualFocusOverlayCoordinates.left}px)`,\n width: `${virtualFocusOverlayWidth}px`,\n height: `${virtualFocusOverlayHeight}px`,\n }\"\n />\n</template>\n\n<style scoped>\n.overlay {\n position: absolute;\n z-index: var(--z-index-cell-selection-overlay);\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.virtual-focus {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from \"vue\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../../constants\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport type { CellSelectionOverlayProps } from \"./CellSelectionOverlayProps\";\n\nconst props = defineProps<CellSelectionOverlayProps>();\n\n/**\n * Live numeric column sizes, injected rather than received as a prop. The\n * overlay is rendered as a sibling of the row/cell tree (in the\n * `cell-selection-overlay` slot), so re-rendering it when the sizes change\n * during a resize does not cascade to the cells. Reading the live sizes at\n * render time is therefore safe here and keeps the selection rectangle correct\n * while a column is being resized.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst getRowResizeOffset = computed(() => {\n const rowResizeIndex = props.rowResizeIndex;\n const rowResizeDelta = props.rowResizeDelta;\n if (rowResizeIndex === null || rowResizeDelta === null) {\n return () => 0;\n } else {\n return (index: number) => (index > rowResizeIndex ? rowResizeDelta : 0);\n }\n});\n\nconst top = computed(() => {\n const { min } = props.rect.y;\n return min * props.rowHeight + getRowResizeOffset.value(min);\n});\n\nconst bottom = computed(() => {\n const { max } = props.rect.y;\n return (max + 1) * props.rowHeight + getRowResizeOffset.value(max + 1);\n});\n\nconst columnOffsets = computed(() => {\n let currentOffset = 0;\n if (props.tableConfig.showSelection) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n if (props.tableConfig.enableRowDeletion) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n const offsets: number[] = [];\n colSizes.value.forEach((size) => {\n offsets.push(currentOffset);\n currentOffset += size;\n });\n offsets.push(currentOffset);\n return offsets;\n});\n\nconst left = computed(() => {\n const { min } = props.rect.x;\n return columnOffsets.value[min];\n});\n\nconst right = computed(() => {\n const { max } = props.rect.x;\n return columnOffsets.value[max + 1];\n});\n\nconst height = computed(() => {\n return bottom.value - top.value;\n});\n\nconst width = computed(() => {\n return right.value - left.value;\n});\n\nconst copied = ref(false);\nconst triggerCopied = () => {\n copied.value = true;\n};\n\nconst virtualFocusOverlay = ref<null | HTMLDivElement>(null);\nconst virtualFocusOverlayCoordinates = computed(() => {\n if (!props.cellSelectionRectFocusCorner) {\n return null;\n }\n const { x: left, y: top } = props.cellSelectionRectFocusCorner;\n const right = left + 1;\n const bottom = top + 1;\n return {\n left: columnOffsets.value[left],\n right: columnOffsets.value[right],\n top: top * props.rowHeight + getRowResizeOffset.value(top),\n bottom: bottom * props.rowHeight + getRowResizeOffset.value(bottom),\n };\n});\n\nconst virtualFocusOverlayHeight = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.bottom -\n virtualFocusOverlayCoordinates.value!.top\n );\n});\n\nconst virtualFocusOverlayWidth = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.right -\n virtualFocusOverlayCoordinates.value!.left\n );\n});\n\nconst isVirtualFocusOverlayInsideViewportOfBody = (\n containerBCR: DOMRect,\n focusOverlay: HTMLDivElement,\n headerHeight: number,\n) => {\n const virtualFocusOverlayBCR = focusOverlay.getBoundingClientRect();\n const bodyTop = containerBCR.top + headerHeight;\n\n return {\n verticalInside:\n bodyTop <= virtualFocusOverlayBCR.top &&\n virtualFocusOverlayBCR.bottom <= containerBCR.bottom,\n horizontalInside:\n containerBCR.left <= virtualFocusOverlayBCR.left &&\n virtualFocusOverlayBCR.right <= containerBCR.right,\n };\n};\n\nconst scrollFocusOverlayIntoView = async (\n params: null | {\n containerBCR: DOMRect | null;\n headerHeight: number;\n scrollTo: (scrollToValues: {\n top?: number;\n left?: number;\n }) => void | undefined;\n },\n) => {\n // wait for focusOverlay to render at new position to calculate bounding client rect\n await nextTick();\n if (params) {\n const { containerBCR, headerHeight, scrollTo } = params;\n if (\n containerBCR &&\n virtualFocusOverlay.value &&\n virtualFocusOverlayCoordinates.value\n ) {\n const { verticalInside, horizontalInside } =\n isVirtualFocusOverlayInsideViewportOfBody(\n containerBCR,\n virtualFocusOverlay.value,\n headerHeight,\n );\n\n if (!verticalInside) {\n scrollTo({\n top:\n virtualFocusOverlayCoordinates.value.top -\n containerBCR.height / 2 +\n virtualFocusOverlayHeight.value,\n });\n } else if (!horizontalInside) {\n scrollTo({\n left:\n virtualFocusOverlayCoordinates.value.left -\n containerBCR.width / 2 +\n virtualFocusOverlayWidth.value / 2,\n });\n }\n }\n } else {\n virtualFocusOverlay.value?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n });\n }\n};\n\nconst getFocusOverlayBoundingClientRect = () =>\n virtualFocusOverlay.value?.getBoundingClientRect();\n\ndefineExpose({\n triggerCopied,\n focus,\n scrollFocusOverlayIntoView,\n getFocusOverlayBoundingClientRect,\n});\n</script>\n\n<template>\n <div\n class=\"overlay\"\n :class=\"{ copied: copied }\"\n :style=\"{\n transform: `translateY(${top}px) translateX(${left}px)`,\n width: `${width}px`,\n height: `${height}px`,\n }\"\n @animationend=\"copied = false\"\n />\n <div\n v-if=\"virtualFocusOverlayCoordinates\"\n ref=\"virtualFocusOverlay\"\n class=\"overlay virtual-focus\"\n :style=\"{\n transform: `translateY(${virtualFocusOverlayCoordinates.top}px) translateX(${virtualFocusOverlayCoordinates.left}px)`,\n width: `${virtualFocusOverlayWidth}px`,\n height: `${virtualFocusOverlayHeight}px`,\n }\"\n />\n</template>\n\n<style scoped>\n.overlay {\n position: absolute;\n z-index: var(--z-index-cell-selection-overlay);\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.virtual-focus {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport {\n type PropType,\n type Ref,\n computed,\n nextTick,\n ref,\n toRef,\n watch,\n watchEffect,\n} from \"vue\";\n\nimport {\n KdsEmptyState,\n type KdsEmptyStateProps,\n type KdsMenuItem,\n KdsPagination,\n} from \"@knime/kds-components\";\n\nimport { columnSortText } from \"../config/table.config\";\nimport {\n COMPACT_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY,\n SPECIAL_COLUMNS_SIZE,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { VirtualElementAnchor } from \"../types/DataValueView\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\n\nimport TableCore from \"./TableCore.vue\";\nimport { useTotalWidth } from \"./composables/useAvailableWidth\";\nimport { BODY_WIDTH_CSS_VAR } from \"./composables/useBodyWidth\";\nimport { useBoolean } from \"./composables/useBoolean\";\nimport { useCellCopyPaste } from \"./composables/useCellCopyPaste\";\nimport {\n type CellPosition,\n type Rect,\n type RectId,\n useCellSelection,\n} from \"./composables/useCellSelection\";\nimport { provideDataValueViewsIsShown } from \"./composables/useDataValueViews\";\nimport { createEditingCellKeydownHandler } from \"./composables/useEditCellKeydown\";\nimport { useVisibleAfterAvailableWidth } from \"./composables/useVisibleAfterAvailableWidth\";\nimport TableActionBar from \"./control/TableActionBar.vue\";\nimport Header from \"./layout/Header.vue\";\nimport NewRowButton from \"./layout/NewRowButton.vue\";\nimport Row from \"./layout/Row.vue\";\nimport CellSelectionOverlay from \"./ui/CellSelectionOverlay.vue\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport type DataItem =\n | {\n data: any;\n dots?: false;\n }\n | {\n dots: true;\n };\n\n/**\n * @see README.md\n */\nexport default {\n components: {\n KdsPagination,\n Header,\n Row,\n // TablePopover,\n CellSelectionOverlay,\n TableCore,\n NewRowButton,\n TableActionBar,\n KdsEmptyState,\n },\n props: {\n /**\n * Data props.\n */\n data: {\n type: Array as PropType<Array<Array<any>>>,\n required: true,\n },\n /**\n * It specifies how many (empty) rows should be simultated above the given rows in this.data[0]\n */\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n /**\n * It specifies how many (empty) rows should be simultated below the given rows in this.data[0]\n */\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n /**\n * Data displayed when scrolling to the bottom of the table. Currently only supproted together\n * with virtual scrolling enabled.\n */\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /**\n * analogous to currentSelection but for the bottomData\n */\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n /** Stable per-column definitions. */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n required: true,\n },\n /** Additional per-column header menu items (index-aligned with columns), appended after sort items. */\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n /** Active sorts, ordered by sort priority. */\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n /** Feature switches for the table. */\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n /** Runtime totals and flags for the table. */\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n /** Pagination config; its presence enables pagination. */\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n /** Runtime pagination state. */\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n /** Action-bar config; its presence enables the action bar. */\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n /** Runtime state of the action bar. */\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n required: false,\n },\n /** Per-row and per-group submenu config. */\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** Appearance of the table's rows. */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n disableRowHeightTransition: {\n type: Boolean,\n default: false,\n },\n emptyState: {\n type: Object as PropType<KdsEmptyStateProps>,\n default: undefined,\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n resizeActive: (isActive: boolean) => true,\n columnUpdate: (newColumnList: string[]) => true,\n columnReorder: (colInd: number, newColInd: number) => true,\n pageChange: (newPageNumber: number) => true,\n pageSizeUpdate: (newPageSize: number) => true,\n columnSort: (colInd: number | undefined, sortDirection: -1 | 0 | 1) => true,\n selectAll: (selected: boolean) => true,\n rowSelect: (\n selected: boolean,\n rowInd: number,\n groupInd: number,\n isTop: boolean,\n ) => true,\n tableInput: (event: any) => true,\n columnResize: (columnIndex: number, newColumnSize: number) => true,\n lazyload: (lazyloadParams: {\n direction: 1 | -1;\n startIndex: number;\n endIndex: number;\n }) => true,\n allColumnsResize: (newColumnSize: number) => true,\n columnResizeStart: () => true,\n columnResizeEnd: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n \"update:searchTerm\": (newSearchTerm: string /** Might be empty */) => true,\n rowHeightUpdate: (newRowHeight: number | null | \"dynamic\") => true,\n copySelection: (copySelectionParams: {\n rect: Rect;\n id: RectId | null;\n withHeaders: boolean;\n }) => true,\n pasteSelection: (pasteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n updateSelection: (newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n }) => void;\n }) => true,\n cutSelection: (cutSelectionParams: { rect: Rect; id: RectId | null }) =>\n true,\n deleteSelection: (deleteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n }) => true,\n cellSelectionChange: (cellPosition: CellPosition | null) => true,\n dataValueView: (\n row: { indexInInput: number; isTop: boolean },\n columnIndex: number,\n rect: VirtualElementAnchor,\n ) => true,\n closeDataValueView: () => true,\n newColumnButtonClick: () => true,\n newRowButtonClick: (\n lastPosition: {\n columnInd: number;\n rectId: number | null;\n } | null,\n ) => true,\n headerCellStartEditing: (columnIndex: number, initialValue?: string) =>\n true,\n deleteColumn: (colInd: number) => true,\n deleteRow: (rowInd: number) => true,\n resetTemporaryView: () => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(props, { emit }) {\n const wrapper: Ref<any> = ref(null);\n const tableCore: Ref<InstanceType<typeof TableCore> | null> = ref(null);\n const header: Ref<InstanceType<typeof Header> | null> = ref(null);\n const selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n > = ref([]);\n const totalWidth = useTotalWidth(wrapper);\n const { isVisible: tableIsVisible, onAvailableWidthReported } =\n useVisibleAfterAvailableWidth();\n const onUpdateAvailableWidth = (newAvailableWidth: number) => {\n emit(\"update:available-width\", newAvailableWidth);\n onAvailableWidthReported();\n };\n const enableCellSelection = computed(() =>\n Boolean(props.tableConfig.enableCellSelection),\n );\n // cell selection\n const {\n selectCell,\n expandCellSelection,\n clearCellSelection,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n } = useCellSelection(enableCellSelection);\n\n watch(selectedCell, (newCell) =>\n emit(\"cellSelectionChange\", newCell ?? null),\n );\n\n const selectCellsOnMove = useBoolean(false);\n // cell copying\n const emitCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (rectMinMax.value) {\n emit(\"copySelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n withHeaders,\n });\n }\n };\n\n const scrollToCellSelectionOverlay = async () => {\n const tableCoreRef = tableCore.value;\n if (tableCoreRef === null) {\n return;\n }\n const scrollToViewParams = {\n containerBCR:\n tableCoreRef.getVirtualContainer()?.getBoundingClientRect() || null,\n headerHeight: header.value?.$el.clientHeight || 0,\n scrollTo: (position: { left?: number; top?: number }) =>\n tableCoreRef.virtualScrollToPosition(position),\n };\n\n if (Array.isArray(selectionOverlay.value)) {\n await selectionOverlay.value[0]?.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n } else if (selectionOverlay.value) {\n await selectionOverlay.value.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n }\n };\n\n const updateCellSelection = (\n newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n },\n newRectId: RectId | null = null,\n ) => {\n const rectId = newRectId ?? currentRectId.value ?? 0;\n selectCell({ x: newRect.maxX, y: newRect.maxY }, rectId, true);\n if (newRect.minX !== newRect.maxX || newRect.minY !== newRect.maxY) {\n expandCellSelection({ x: newRect.minX, y: newRect.minY }, rectId);\n }\n tableCore.value?.getVirtualBody()?.focus({ preventScroll: true });\n nextTick().then(scrollToCellSelectionOverlay);\n };\n\n const emitPasteSelection = () => {\n if (rectMinMax.value) {\n emit(\"pasteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n updateSelection: updateCellSelection,\n });\n }\n };\n const emitCutSelection = () => {\n if (rectMinMax.value) {\n emit(\"cutSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n const emitDeleteSelection = () => {\n if (rectMinMax.value) {\n emit(\"deleteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n\n const focusWithin = ref(false);\n const changeFocus = (newFocus: boolean) => {\n focusWithin.value = newFocus;\n };\n\n const toBeEditedCell = ref<null | CellPosition>(null);\n const editingCellInitialValue = ref<null | string>(null);\n const editingCell = computed(() =>\n selectCellsOnMove.state ? null : toBeEditedCell.value,\n );\n const isEditingCell = computed(() => editingCell.value !== null);\n\n const setToBeEditedCell = (\n cellPosition: CellPosition | null,\n initialValue?: string,\n ) => {\n toBeEditedCell.value = cellPosition;\n editingCellInitialValue.value = initialValue ?? null;\n };\n const isEditingEnabled = computed(() =>\n getPropertiesFromColumns(props.columns, \"editable\").some(Boolean),\n );\n const { handleCopyOnKeydown, handleDeleteSelection } = useCellCopyPaste({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy: emitCopySelection,\n onPaste: emitPasteSelection,\n onCut: emitCutSelection,\n onDelete: emitDeleteSelection,\n });\n\n const stopEditingCell = (rowInd?: number, colInd?: number) => {\n const toBeEditedCellValue = toBeEditedCell.value;\n if (\n rowInd !== undefined &&\n colInd !== undefined &&\n toBeEditedCellValue &&\n (toBeEditedCellValue.x !== colInd || toBeEditedCellValue.y !== rowInd)\n ) {\n return;\n }\n setToBeEditedCell(null);\n };\n\n const toBeShownCell = ref<null | CellPosition>(null);\n\n const closeDataValueView = () => {\n if (props.tableState.dataValueViewIsShown) {\n emit(\"closeDataValueView\");\n }\n toBeShownCell.value = null;\n };\n\n provideDataValueViewsIsShown(\n toRef(props, \"tableState\"),\n closeDataValueView,\n );\n\n const { columnResizeActive } = injectColumnSizes();\n watchEffect(() => emit(\"resizeActive\", columnResizeActive.value));\n\n const showNewColumnAndRowButton = computed(() =>\n Boolean(props.tableConfig.showNewColumnAndRowButton),\n );\n const newColumnButtonWidth = ref(0);\n\n return {\n wrapper,\n totalWidth,\n tableIsVisible,\n onUpdateAvailableWidth,\n tableCore,\n header,\n selectionOverlay,\n scrollToCellSelectionOverlay,\n selectCellsOnMove,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n selectCell,\n expandCellSelection,\n clearCellSelection: () => {\n clearCellSelection();\n closeDataValueView();\n },\n clearCellSelectionAndStopPropagation: (event: Event) => {\n if (rectMinMax.value === null) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n clearCellSelection();\n },\n setToBeEditedCell,\n editingCellInitialValue,\n stopEditingCell,\n updateCellSelection,\n changeFocus,\n focusWithin,\n handleCopyOnKeydown,\n handleDeleteSelection,\n toBeShownCell,\n toBeEditedCell,\n editingCell,\n isEditingCell,\n createEditingCellKeydownHandler,\n columnResizeActive,\n showNewColumnAndRowButton,\n newColumnButtonWidth,\n BODY_WIDTH_CSS_VAR,\n };\n },\n data() {\n return {\n popoverColumn: null as null | string | number | symbol,\n lastScrollIndex: 0,\n newVal: null,\n resizeCount: 0,\n updatedBefore: false,\n wrapperWidth: 0,\n closeExpandedSubMenu: () => {},\n scrollerId: \"scroller\",\n resizedRowHeight: null as null | number,\n currentResizedScrollIndex: null as null | number,\n currentRowSizeDelta: null as null | number,\n SPECIAL_COLUMNS_SIZE,\n lastRowAndRectIdBeforeMovingToNewColumnButton: null as null | {\n rowInd: number;\n rectId: RectId | null;\n },\n lastColumnAndRectIdBeforeMovingToNewRowButton: null as\n | null\n | {\n columnInd: number;\n rectId: RectId | null;\n }\n | {\n virtualColumn: \"delete\" | \"selection\";\n rectId: RectId | null;\n },\n };\n },\n computed: {\n showActionBar() {\n const viewType = this.actionState?.viewType;\n // A temporary view is highlighted via the action bar, so the bar must\n // render even when no action bar feature is enabled via actionConfig\n return (\n Boolean(this.actionConfig) ||\n viewType === \"TEMP_VIEW\" ||\n viewType === \"PREVIEW\"\n );\n },\n minRowHeight() {\n return this.rowConfig.compactMode\n ? COMPACT_ROW_HEIGHT\n : DEFAULT_ROW_HEIGHT;\n },\n initialRowHeight() {\n return this.rowConfig?.rowHeight || this.minRowHeight;\n },\n currentRowHeight() {\n return this.resizedRowHeight ?? this.initialRowHeight;\n },\n selectedHeaderIndex(): number | null {\n return this.selectedCell?.y === -1 ? this.selectedCell.x : null;\n },\n slottedColumns() {\n return getPropertiesFromColumns(this.columns, \"hasSlotContent\")\n .map((hasSlotContent: any, colInd: any) =>\n hasSlotContent ? colInd : null,\n )\n .filter((colInd: any) => colInd !== null);\n },\n topDataLength() {\n if (this.data === null || this.data.length === 0) {\n return 0;\n }\n return this.data[0].length;\n },\n totalTableLength() {\n return this.scrollData[0].length + this.numRowsAbove;\n },\n numPlaceholderRows() {\n return this.topDataLength ? 1 : 0;\n },\n placeholderRowRowIndex() {\n return this.data[0].length + this.numRowsAbove;\n },\n scrollData() {\n if (this.data === null || this.data.length === 0) {\n return [[]];\n }\n const dataItems: DataItem[][] = this.data?.map((groupData) =>\n groupData.map((data) => ({ data })),\n );\n if (this.bottomData.length > 0) {\n if (this.numPlaceholderRows) {\n dataItems[0].push({ dots: true });\n }\n dataItems[0].push(...this.bottomData.map((data) => ({ data })));\n }\n return dataItems;\n },\n currentSelectionMap() {\n if (!this.tableConfig.showSelection) {\n return () => false;\n }\n return (rowInd: number, groupInd: number) => {\n const { isTop, indexInInput } = this.resolveRowIndex(rowInd);\n return isTop\n ? this.currentSelection[groupInd][indexInInput]\n : this.currentBottomSelection[indexInInput];\n };\n },\n scrollerItemSize() {\n if (this.currentRowHeight === \"dynamic\") {\n return this.minRowHeight;\n }\n return this.currentRowHeight;\n },\n sortControlOptions() {\n const selectableColumns: { id: string; text: string }[] = [];\n const selectableDirections: Record<\n string,\n { id: string; text: string }[]\n > = {};\n this.columns.forEach((column) => {\n if (column.isNotSortable) {\n return;\n }\n selectableColumns.push({\n id: column.id as string,\n text: column.header,\n });\n const sortTexts = columnSortText[column.type ?? \"default\"];\n selectableDirections[column.id as string] = [\n { id: \"1\", text: sortTexts.ascending },\n { id: \"-1\", text: sortTexts.descending },\n ];\n });\n return { selectableColumns, selectableDirections };\n },\n },\n watch: {\n \"rowConfig.compactMode\": {\n handler() {\n this.resetRowHeight();\n },\n },\n \"rowConfig.rowHeight\": {\n handler() {\n this.resetRowHeight();\n },\n },\n currentRowHeight(newRowHeight) {\n this.$emit(\"rowHeightUpdate\", newRowHeight);\n },\n },\n methods: {\n // Utilities\n refreshScroller() {\n this.tableCore?.virtualScrollToPosition({ top: 0 });\n },\n resetRowHeight() {\n this.resizedRowHeight = null;\n },\n isTop(index: number) {\n return index < this.topDataLength + this.numRowsAbove;\n },\n resolveRowIndex(index: number) {\n if (index < this.numRowsAbove) {\n throw new Error(`Accessing invalid row index: ${index}`);\n }\n if (this.isTop(index)) {\n return {\n isTop: true,\n indexInInput: index - this.numRowsAbove,\n };\n }\n return {\n isTop: false,\n indexInInput:\n index -\n this.numRowsAbove -\n this.numPlaceholderRows -\n this.topDataLength,\n };\n },\n // Event handling\n onScroll(startIndex: number, endIndex: number) {\n if (\n this.lastScrollIndex === endIndex ||\n this.currentResizedScrollIndex !== null\n ) {\n return;\n }\n const direction: 1 | -1 = this.lastScrollIndex < endIndex ? 1 : -1;\n this.lastScrollIndex = endIndex;\n this.$emit(\"lazyload\", { direction, startIndex, endIndex });\n },\n onColumnUpdate(newColumnList: any) {\n consola.debug(`TableUI emitting: columnUpdate ${newColumnList}`);\n this.clearCellSelection();\n this.$emit(\"columnUpdate\", newColumnList);\n },\n onColumnReorder(colInd: number, newColInd: number) {\n consola.debug(`TableUI emitting: columnReorder ${colInd} ${newColInd}`);\n this.clearCellSelection();\n this.$emit(\"columnReorder\", colInd, newColInd);\n },\n onPageChange(newPageNumber: number) {\n consola.debug(`TableUI emitting: pageChange ${newPageNumber}`);\n this.clearCellSelection();\n this.$emit(\"pageChange\", newPageNumber);\n },\n onPageSizeUpdate(newPageSize: number) {\n consola.debug(`TableUI emitting: pageSizeUpdate ${newPageSize}`);\n this.clearCellSelection();\n this.$emit(\"pageSizeUpdate\", newPageSize);\n },\n clearAllCellInteractions() {\n this.clearCellSelection();\n this.stopEditingCell();\n },\n onDeleteColumn(colInd: number) {\n this.clearAllCellInteractions();\n this.$emit(\"deleteColumn\", colInd);\n },\n onDeleteRow(rowInd: number) {\n this.clearAllCellInteractions();\n const { indexInInput } = this.resolveRowIndex(rowInd);\n this.$emit(\"deleteRow\", indexInInput);\n },\n onColumnSort(colInd: number | undefined, sortDirection: -1 | 0 | 1) {\n consola.debug(`TableUI emitting: columnSort ${colInd} ${sortDirection}`);\n this.clearCellSelection();\n this.$emit(\"columnSort\", colInd, sortDirection);\n },\n onActionBarColumnSort(\n columnId: string | undefined,\n sortDirection: -1 | 0 | 1,\n ) {\n // The action bar's SortControl identifies columns by their stable id,\n // but the columnSort event is positional. Translate the id back to the\n // column's index before delegating to the shared handler.\n const colInd =\n columnId === undefined\n ? undefined\n : this.columns.findIndex((column) => column.id === columnId);\n this.onColumnSort(colInd, sortDirection);\n },\n onSelectAll(selected: boolean) {\n consola.debug(`TableUI emitting: selectAll ${selected}`);\n this.$emit(\"selectAll\", selected);\n },\n onDataValueView(\n cellInd: number,\n rowInd: number,\n anchor: VirtualElementAnchor,\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n this.toBeShownCell = null;\n this.$emit(\"dataValueView\", { indexInInput, isTop }, cellInd, anchor);\n },\n onRowSelect(selected: boolean, rowInd: number, groupInd: number) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n consola.debug(\n `TableUI emitting: rowSelect ${selected} ${indexInInput} ${groupInd} ${isTop}`,\n );\n this.$emit(\"rowSelect\", selected, indexInInput, groupInd, isTop);\n },\n onCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n const isTop = this.isTop(rowInd);\n this.selectCell(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n ignoreIfSelected || Boolean(this.columns[cellInd]?.editable),\n );\n this.stopEditingCell();\n },\n onCellSelectRowEvent(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n if (\n this.toBeEditedCell &&\n this.toBeEditedCell.x === cellInd &&\n this.toBeEditedCell.y === rowInd\n ) {\n // If the cell to be edited is clicked again, do not interrupt editing\n return;\n }\n const isEditable = Boolean(this.columns[cellInd]?.editable);\n if (isEditable && this.isSingleSelectedCell({ x: cellInd, y: rowInd })) {\n this.onStartEditingCell();\n } else {\n this.onCellSelect(cellInd, rowInd, groupInd, ignoreIfSelected);\n }\n },\n onExpandCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ) {\n const isTop = this.isTop(rowInd);\n this.expandCellSelection(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n );\n this.stopEditingCell();\n },\n focusBody() {\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n this.focusWithin = true;\n },\n onTableBodyFocusOut() {\n this.changeFocus(false);\n if (this.selectedCell) {\n if (this.columns[this.selectedCell.x]?.editable) {\n this.selectCell(this.selectedCell, this.currentRectId ?? 0, true);\n } else if (!this.tableState.dataValueViewIsShown) {\n this.clearCellSelection();\n }\n }\n },\n onHeaderCellSelect(columnIndex: number) {\n this.stopEditingCell();\n this.selectCell({ x: columnIndex, y: -1 }, 0, true);\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onHeaderCellDeselect() {\n if (this.selectedCell?.y === -1) {\n this.clearCellSelection();\n }\n },\n onMoveDownFromHeaderCell(columnIndex: number) {\n if (this.totalTableLength === 0) {\n if (this.showNewColumnAndRowButton) {\n this.clearCellSelection();\n this.focusNewRowButton();\n }\n return;\n }\n this.onCellSelect(columnIndex, 0, null);\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n tableCoreRef.virtualScrollToPosition({ top: 0 });\n },\n onUpdateNewColumnButtonWidth(width: number) {\n this.newColumnButtonWidth = width;\n },\n onKeyboardMoveSelectionVirtual(\n columnInd: number,\n rowInd: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n let adaptedRowInd = rowInd;\n if (rowInd === this.totalTableLength) {\n this.onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === this.placeholderRowRowIndex) {\n adaptedRowInd += verticalMove;\n }\n this[expandSelection ? \"onExpandCellSelect\" : \"onCellSelect\"](\n columnInd,\n adaptedRowInd,\n null,\n );\n },\n async onKeyboardMoveSelectionFromEditingCell(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n await this.onKeyboardMoveSelection(\n horizontalMove,\n verticalMove,\n expandSelection,\n );\n if (this.selectedCell) {\n this.focusBody();\n }\n this.stopEditingCell();\n },\n onMoveSelectionOutOfBodyUp({ columnInd }: { columnInd: number }) {\n if (!this.header?.isColumnHeaderFocusable(columnInd)) {\n return;\n }\n this.clearCellSelection();\n this.focusHeaderCell(columnInd);\n },\n focusNewRowButton() {\n (\n this.$refs[\"new-row-button\"] as InstanceType<typeof NewRowButton>\n )?.focus();\n },\n onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId,\n }: {\n columnInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.clearCellSelection();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n columnInd,\n rectId,\n };\n }\n },\n onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.getHeaderComponent().focusNewColumnButton();\n this.clearCellSelection();\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = { rowInd, rectId };\n }\n },\n onMoveIntoBodyFromRight() {\n const lastColumnInd = this.columns.length - 1;\n const lastRowAndRectId = this\n .lastRowAndRectIdBeforeMovingToNewColumnButton ?? {\n rowInd: -1,\n rectId: null,\n };\n if (lastRowAndRectId.rowInd === -1) {\n this.focusHeaderCell(lastColumnInd);\n } else {\n this.updateCellSelection(\n {\n minX: lastColumnInd,\n minY: lastRowAndRectId.rowInd,\n maxX: lastColumnInd,\n maxY: lastRowAndRectId.rowInd,\n },\n lastRowAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onMoveIntoBodyFromBottom() {\n const lastRowInd = this.totalTableLength - 1;\n const lastColumnAndRectId = this\n .lastColumnAndRectIdBeforeMovingToNewRowButton ?? {\n columnInd: 0,\n rectId: null,\n };\n if (\"virtualColumn\" in lastColumnAndRectId) {\n this.focusRowVirtualColumn(\n lastColumnAndRectId.virtualColumn,\n lastRowInd,\n lastColumnAndRectId.rectId,\n );\n } else {\n if (this.totalTableLength === 0) {\n this.focusHeaderCell(0);\n return;\n }\n this.updateCellSelection(\n {\n minX: lastColumnAndRectId.columnInd,\n minY: lastRowInd,\n maxX: lastColumnAndRectId.columnInd,\n maxY: lastRowInd,\n },\n lastColumnAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = null;\n },\n onMoveSelectionOutOfBodyLeft({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n this.clearCellSelection();\n } else if (this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n this.clearCellSelection();\n }\n },\n onMoveIntoBodyFromLeft(rowInd: number, groupInd: RectId | null) {\n this.updateCellSelection(\n {\n minX: 0,\n minY: rowInd,\n maxX: 0,\n maxY: rowInd,\n },\n groupInd,\n );\n this.focusBody();\n },\n focusRowVirtualColumn(\n type: \"delete\" | \"selection\",\n rowInd: number,\n _groupInd: RectId | null,\n ) {\n const refName = this.getRowRefName(null, rowInd);\n const rowComponent = this.$refs[refName] as InstanceType<typeof Row>;\n if (type === \"delete\") {\n rowComponent?.focusDeleteButton();\n } else {\n rowComponent?.focusSelectionCheckbox();\n }\n },\n onVirtualColumnNav(\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n rowInd: number,\n groupInd: null | number,\n ) {\n const rectId = groupInd ?? null;\n if (direction === \"right\") {\n if (type === \"delete\" && this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n } else if (this.columns.length > 0) {\n this.onMoveIntoBodyFromLeft(rowInd, rectId);\n }\n } else if (direction === \"left\") {\n if (type === \"selection\" && this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n }\n } else if (direction === \"up\") {\n if (rowInd > 0) {\n this.focusRowVirtualColumn(type, rowInd - 1, rectId);\n } else if (type === \"selection\") {\n this.getHeaderComponent().focusSelectionCheckbox();\n }\n } else if (direction === \"down\") {\n if (rowInd < this.totalTableLength - 1) {\n this.focusRowVirtualColumn(type, rowInd + 1, rectId);\n } else if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n virtualColumn: type,\n rectId,\n };\n }\n }\n },\n onHeaderSelectionKeydownDown() {\n this.focusRowVirtualColumn(\"selection\", 0, null);\n },\n async onKeyboardMoveSelection(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n if (!this.selectedCell) {\n return;\n }\n const columnInd = this.selectedCell.x + horizontalMove;\n const rowInd = this.selectedCell.y + verticalMove;\n if (columnInd === -1) {\n this.onMoveSelectionOutOfBodyLeft({\n rowInd: this.selectedCell!.y,\n rectId: this.currentRectId,\n });\n return;\n }\n if (columnInd === this.columns.length) {\n this.onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === -1) {\n this.onMoveSelectionOutOfBodyUp({ columnInd });\n return;\n }\n\n this.onKeyboardMoveSelectionVirtual(\n columnInd,\n rowInd,\n verticalMove,\n expandSelection,\n );\n\n await this.scrollToCellSelectionOverlay();\n\n this.toBeShownCell = this.tableState.dataValueViewIsShown\n ? this.selectedCell\n : null;\n },\n async expandSelectedCell() {\n if (this.selectedCell && this.tableConfig.enableDataValueViews) {\n // scroll current selection into view\n await this.onKeyboardMoveSelection(0, 0, true);\n this.toBeShownCell = this.selectedCell;\n }\n },\n\n onStartEditingCell(initialValue?: string) {\n if (this.selectedCell && this.columns[this.selectedCell.x]?.editable) {\n this.setToBeEditedCell(this.selectedCell, initialValue);\n }\n },\n onResizeRow(rowSizeDelta: number, scrollIndex: number) {\n this.currentRowSizeDelta = rowSizeDelta;\n this.currentResizedScrollIndex = scrollIndex;\n },\n onResizeAllRows(currentSize: number, row: HTMLElement, rowInd: number) {\n if (this.currentRowHeight === \"dynamic\") {\n return;\n }\n this.currentRowSizeDelta = 0;\n const previousScrollTop = this.tableCore?.getVirtualScrollStart();\n if (previousScrollTop === undefined) {\n return;\n }\n const heightAboveCurrentRow = rowInd * this.currentRowHeight;\n const offset = heightAboveCurrentRow - previousScrollTop;\n this.resizedRowHeight = currentSize;\n const scrollPosition = rowInd * this.currentRowHeight - offset;\n this.keepScrollerPositionOnRowResize(scrollPosition);\n },\n keepScrollerPositionOnRowResize(scrollPosition: number) {\n const resizeObserver = new ResizeObserver(() => {\n setTimeout(() => {\n // scroll was temporarily disabled to avoid sending scroll events during resize\n this.currentResizedScrollIndex = null;\n }, ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY);\n this.tableCore?.virtualScrollToPosition({ top: scrollPosition });\n resizeObserver.disconnect();\n });\n const virtualBody = this.tableCore?.getVirtualBody();\n if (virtualBody) {\n resizeObserver.observe(virtualBody);\n }\n },\n onRowInput(\n _event: any,\n rowInd: number,\n groupInd: number,\n row: { id: string },\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n const event = {\n ..._event,\n rowInd: indexInInput,\n id: row.id,\n groupInd,\n isTop,\n };\n consola.debug(`TableUI emitting: tableInput ${event}`);\n this.$emit(\"tableInput\", event);\n },\n onRowSubMenuClick(event: any, row: any) {\n consola.debug(`TableUI row submenu clicked ${event} ${row}`);\n if (event.callback) {\n event.callback(row, this);\n }\n },\n onColumnResize(columnIndex: number, newColumnSize: number) {\n this.$emit(\"columnResize\", columnIndex, newColumnSize);\n },\n onAllColumnsResize(newColumnSize: number) {\n this.$emit(\"allColumnsResize\", newColumnSize);\n },\n onColumnResizeStart() {\n this.columnResizeActive = true;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.columnResizeActive = false;\n this.$emit(\"columnResizeEnd\");\n },\n getCellContentSlotName(columns: ColumnConfig[], columnId: number) {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columns[columnId].key as unknown as string}`;\n },\n getHeaderComponent() {\n return this.$refs.header as InstanceType<typeof Header>;\n },\n getTableCoreComponent() {\n return this.$refs.tableCore as InstanceType<typeof TableCore>;\n },\n getSelectionOverlayComponent() {\n return this.$refs.selectionOverlay as InstanceType<\n typeof CellSelectionOverlay\n >;\n },\n focusHeaderCell(cellInd: number) {\n this.getHeaderComponent().focusHeaderCell(cellInd);\n },\n refocusSelection() {\n if (this.selectedHeaderIndex === null) {\n this.focusBody();\n } else {\n this.focusHeaderCell(this.selectedHeaderIndex);\n }\n },\n getRowComponents() {\n const rowComponents: any[] = [];\n this.data.forEach((group: any) => {\n group.forEach((_: any, rowIndex: number) =>\n rowComponents.push(this.$refs[this.getRowRefName(null, rowIndex)]),\n );\n });\n return rowComponents;\n },\n getRowData(row: Record<string, unknown> | Array<unknown>) {\n const isEmptyArray = Array.isArray(row) && row.length === 0;\n return isEmptyArray\n ? row\n : this.columns.map(\n (column) =>\n (row as Record<string, unknown>)[column.key as unknown as string],\n );\n },\n getRowRefName(groupInd: null | number, rowInd: number) {\n if (groupInd === null) {\n return `row-${rowInd}`;\n }\n return `group-${groupInd}-row-${rowInd}`;\n },\n getCellIndex(cell: CellPosition | null | undefined, rowInd: number) {\n if (cell && cell.y === rowInd) {\n return cell.x;\n }\n return null;\n },\n getCellSelectionRange(rowInd: number) {\n const rect = this.rectMinMax;\n if (!rect || rowInd < rect.y.min || rowInd > rect.y.max) {\n return null;\n }\n return { min: rect.x.min, max: rect.x.max };\n },\n onNewRowButtonClick(event: MouseEvent) {\n event.stopPropagation();\n const lastCellOrLastVirtualCell =\n this.lastColumnAndRectIdBeforeMovingToNewRowButton;\n const lastCellWasVirtualColumn =\n lastCellOrLastVirtualCell &&\n \"virtualColumn\" in lastCellOrLastVirtualCell;\n const lastCell = lastCellWasVirtualColumn\n ? null\n : lastCellOrLastVirtualCell;\n\n this.$emit(\"newRowButtonClick\", lastCell);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n event.stopPropagation();\n this.$emit(\"newColumnButtonClick\");\n },\n },\n};\n</script>\n\n<template>\n <div\n class=\"wrapper\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n >\n <TableActionBar\n v-if=\"showActionBar\"\n :table-sizes=\"tableState.tableSizes\"\n :action-state\n :row-label=\"tableConfig.rowLabel\"\n :show-table-size=\"tableConfig.showTableSize\"\n :action-config=\"actionConfig ?? {}\"\n :col-sort-values\n :sort-control-options\n @reset-temporary-view=\"$emit('resetTemporaryView')\"\n @on-column-sort=\"onActionBarColumnSort\"\n @update:search-term=\"$emit('update:searchTerm', $event)\"\n >\n <template v-if=\"$slots['action-bar-left']\" #action-bar-left>\n <slot name=\"action-bar-left\" />\n </template>\n </TableActionBar>\n <table\n ref=\"wrapper\"\n :tabindex=\"-1\"\n @pointerleave=\"selectCellsOnMove.setFalse\"\n @pointerdown.passive.stop=\"\n $event.button === 0 && selectCellsOnMove.setTrue()\n \"\n @pointerup.passive=\"$event.button === 0 && selectCellsOnMove.setFalse()\"\n @keydown.ctrl.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.meta.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.delete.exact=\"handleDeleteSelection\"\n @keydown.escape.exact=\"clearCellSelectionAndStopPropagation\"\n >\n <TableCore\n ref=\"tableCore\"\n :scroll-data=\"scrollData\"\n :total-width=\"totalWidth\"\n :column-resize=\"{ active: columnResizeActive }\"\n :table-config\n :sub-menu-config\n :scroll-config=\"{\n itemSize: scrollerItemSize,\n numRowsAbove,\n numRowsBelow,\n compact: Boolean(rowConfig.compactMode),\n }\"\n :current-row-height=\"currentRowHeight\"\n :new-column-button-width\n @scroller-update=\"onScroll\"\n @update:available-width=\"onUpdateAvailableWidth\"\n @move-selection=\"onKeyboardMoveSelection\"\n @clear-selection=\"clearCellSelection\"\n @expand-selected-cell=\"expandSelectedCell\"\n @start-editing=\"onStartEditingCell\"\n @body-focusin=\"changeFocus(true)\"\n @body-focusout=\"onTableBodyFocusOut()\"\n >\n <template #row=\"{ row, groupInd, rowInd }\">\n <Row\n :ref=\"getRowRefName(groupInd, rowInd)\"\n :row-data=\"row\"\n :row=\"getRowData(row)\"\n :table-config\n :sub-menu-config\n :show-drag-handle=\"tableConfig.enableRowResizing\"\n :columns\n :row-config=\"rowConfig\"\n :row-height=\"currentRowHeight\"\n :min-row-height=\"minRowHeight\"\n :is-selected=\"currentSelectionMap(rowInd, groupInd || 0)\"\n :select-cells-on-move=\"selectCellsOnMove.state\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n :selected-cell-index=\"getCellIndex(selectedCell, rowInd)\"\n :cell-selection-range=\"getCellSelectionRange(rowInd)\"\n :to-be-expanded-cell-index=\"getCellIndex(toBeShownCell, rowInd)\"\n :to-be-edited-cell-index=\"getCellIndex(editingCell, rowInd)\"\n :new-column-button-width\n @delete-row=\"() => onDeleteRow(rowInd)\"\n @row-select=\"onRowSelect($event, rowInd, groupInd || 0)\"\n @cell-select=\"\n (cellInd, ignoreIfSelected) =>\n onCellSelectRowEvent(\n cellInd,\n rowInd,\n groupInd,\n ignoreIfSelected,\n )\n \"\n @data-value-view=\"\n (cellInd, anchor) => onDataValueView(cellInd, rowInd, anchor)\n \"\n @expand-cell-select=\"\n (cellInd) => onExpandCellSelect(cellInd, rowInd, groupInd)\n \"\n @row-input=\"\n (event) => onRowInput(event, rowInd, groupInd ?? 0, row)\n \"\n @row-sub-menu-click=\"onRowSubMenuClick($event, row)\"\n @resize-all-rows=\"\n (currentSize, row) => onResizeAllRows(currentSize, row, rowInd)\n \"\n @resize-row=\"(rowSizeDelta) => onResizeRow(rowSizeDelta, rowInd)\"\n @virtual-column-nav=\"\n (type, direction) =>\n onVirtualColumnNav(type, direction, rowInd, groupInd)\n \"\n >\n <!-- Vue requires named slots on \"custom\" elements (i.e. template). -->\n <!-- eslint-disable vue/valid-v-slot -->\n <template\n v-for=\"colInd in slottedColumns\"\n #[getCellContentSlotName(columns,colInd)]=\"cellData\"\n :key=\"rowInd + '_' + colInd\"\n >\n <!-- \n TODO: UIEXT-1753:\n not yet working properly with empty and bottom rows, \n since rowInd is the actual scroll index and not the input in the input data\n in this case\n -->\n <slot\n :name=\"`cellContent-${columns[colInd].key as unknown as string}`\"\n :data=\"{\n ...cellData,\n key: columns[colInd].key,\n rowInd,\n colInd,\n }\"\n />\n </template>\n <template #editable-cell=\"{ ind, cellElement }\">\n <slot\n name=\"editable-cell\"\n :row-ind=\"rowInd\"\n :col-ind=\"ind\"\n :initial-value=\"editingCellInitialValue\"\n :cell-element=\"cellElement\"\n @keydown=\"\n (event: KeyboardEvent) =>\n createEditingCellKeydownHandler({\n moveSelection: onKeyboardMoveSelectionFromEditingCell,\n })(event)\n \"\n @click-away=\"stopEditingCell\"\n />\n </template>\n </Row>\n </template>\n <template #header=\"{ getDragHandleHeight }\">\n <Header\n ref=\"header\"\n :style=\"{ width: `var(${BODY_WIDTH_CSS_VAR})` }\"\n :table-config\n :action-config\n :columns\n :additional-header-menu-items\n :col-sort-values\n :is-selected=\"Boolean(tableState.totalSelected)\"\n :get-drag-handle-height=\"getDragHandleHeight\"\n :class=\"[\n 'table-header',\n {\n 'sub-menu-active': subMenuConfig.subMenuItems?.length,\n },\n ]\"\n :show-new-column-button=\"showNewColumnAndRowButton\"\n :selected-header-index=\"selectedHeaderIndex\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n @header-select=\"onSelectAll\"\n @column-sort=\"onColumnSort\"\n @delete-column=\"onDeleteColumn\"\n @column-resize=\"onColumnResize\"\n @all-columns-resize=\"onAllColumnsResize\"\n @column-resize-start=\"onColumnResizeStart\"\n @column-resize-end=\"onColumnResizeEnd\"\n @move-down-from-header-cell=\"onMoveDownFromHeaderCell\"\n @header-cell-select=\"onHeaderCellSelect\"\n @header-cell-deselect=\"onHeaderCellDeselect\"\n @header-cell-start-editing=\"\n (columnIndex: number, initialValue?: string) =>\n $emit('headerCellStartEditing', columnIndex, initialValue)\n \"\n @update:new-column-button-width=\"onUpdateNewColumnButtonWidth\"\n @new-column-button-click=\"onNewColumnButtonClick\"\n @selection-keydown-down=\"onHeaderSelectionKeydownDown()\"\n @new-column-button-keydown-left=\"onMoveIntoBodyFromRight()\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" />\n </template>\n </Header>\n </template>\n <template #cell-selection-overlay>\n <CellSelectionOverlay\n v-if=\"rectMinMax && !isEditingCell && selectedHeaderIndex === null\"\n ref=\"selectionOverlay\"\n :rect=\"rectMinMax\"\n :row-height=\"scrollerItemSize\"\n :table-config=\"tableConfig\"\n :row-resize-index=\"currentResizedScrollIndex\"\n :row-resize-delta=\"currentRowSizeDelta\"\n :cell-selection-rect-focus-corner=\"\n focusWithin ? selectedCell : undefined\n \"\n />\n </template>\n <template #belowBody>\n <NewRowButton\n v-if=\"showNewColumnAndRowButton\"\n ref=\"new-row-button\"\n @click=\"onNewRowButtonClick\"\n @pointerdown.stop\n @keydown-up=\"onMoveIntoBodyFromBottom\"\n />\n </template>\n <template v-if=\"emptyState\" #empty-state>\n <KdsEmptyState class=\"empty-state\" v-bind=\"emptyState\" />\n </template>\n </TableCore>\n <KdsPagination\n v-if=\"pageConfig && pageState\"\n class=\"pagination\"\n :current-page=\"pageState.currentPage\"\n :page-size=\"pageConfig.pageSize\"\n :possible-page-sizes=\"pageConfig.possiblePageSizes\"\n :total-rows=\"tableState.tableSizes?.currentNumRows ?? 0\"\n :show-table-size=\"tableConfig.showTableSize\"\n :row-label=\"tableConfig.rowLabel\"\n @update:current-page=\"onPageChange\"\n @update:page-size=\"onPageSizeUpdate\"\n />\n </table>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n @media screen {\n /* height 100% does not mix well with flex-box on print (https://issues.chromium.org/issues/365922171) */\n height: 100%;\n }\n}\n\ntable {\n position: relative;\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n\n &:focus {\n outline: none;\n }\n\n & .new-row-footer {\n width: 100%;\n }\n\n /* The table inherits its parent's background; the pagination footer is the\n one place Figma sets a surface token for (SLEEK-297). KdsPagination stays\n transparent so it can sit on any surface. */\n & .pagination {\n background: var(--kds-color-surface-default);\n }\n}\n\n/* The empty state is placed into the rows' area by TableCoreVirtual. */\n.empty-state {\n max-width: 100%;\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport {\n type PropType,\n type Ref,\n computed,\n nextTick,\n ref,\n toRef,\n watch,\n watchEffect,\n} from \"vue\";\n\nimport {\n KdsEmptyState,\n type KdsEmptyStateProps,\n type KdsMenuItem,\n KdsPagination,\n} from \"@knime/kds-components\";\n\nimport { columnSortText } from \"../config/table.config\";\nimport {\n COMPACT_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY,\n SPECIAL_COLUMNS_SIZE,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { VirtualElementAnchor } from \"../types/DataValueView\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\n\nimport TableCore from \"./TableCore.vue\";\nimport { useTotalWidth } from \"./composables/useAvailableWidth\";\nimport { BODY_WIDTH_CSS_VAR } from \"./composables/useBodyWidth\";\nimport { useBoolean } from \"./composables/useBoolean\";\nimport { useCellCopyPaste } from \"./composables/useCellCopyPaste\";\nimport {\n type CellPosition,\n type Rect,\n type RectId,\n useCellSelection,\n} from \"./composables/useCellSelection\";\nimport { provideDataValueViewsIsShown } from \"./composables/useDataValueViews\";\nimport { createEditingCellKeydownHandler } from \"./composables/useEditCellKeydown\";\nimport { useVisibleAfterAvailableWidth } from \"./composables/useVisibleAfterAvailableWidth\";\nimport TableActionBar from \"./control/TableActionBar.vue\";\nimport Header from \"./layout/Header.vue\";\nimport NewRowButton from \"./layout/NewRowButton.vue\";\nimport Row from \"./layout/Row.vue\";\nimport CellSelectionOverlay from \"./ui/CellSelectionOverlay.vue\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport type DataItem =\n | {\n data: any;\n dots?: false;\n }\n | {\n dots: true;\n };\n\n/**\n * @see README.md\n */\nexport default {\n components: {\n KdsPagination,\n Header,\n Row,\n // TablePopover,\n CellSelectionOverlay,\n TableCore,\n NewRowButton,\n TableActionBar,\n KdsEmptyState,\n },\n props: {\n /**\n * Data props.\n */\n data: {\n type: Array as PropType<Array<Array<any>>>,\n required: true,\n },\n /**\n * It specifies how many (empty) rows should be simultated above the given rows in this.data[0]\n */\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n /**\n * It specifies how many (empty) rows should be simultated below the given rows in this.data[0]\n */\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n /**\n * Data displayed when scrolling to the bottom of the table. Currently only supproted together\n * with virtual scrolling enabled.\n */\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /**\n * analogous to currentSelection but for the bottomData\n */\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n /** Stable per-column definitions. */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n required: true,\n },\n /** Additional per-column header menu items (index-aligned with columns), appended after sort items. */\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n /** Active sorts, ordered by sort priority. */\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n /** Feature switches for the table. */\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n /** Runtime totals and flags for the table. */\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n /** Pagination config; its presence enables pagination. */\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n /** Runtime pagination state. */\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n /** Action-bar config; its presence enables the action bar. */\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n /** Runtime state of the action bar. */\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n required: false,\n },\n /** Per-row and per-group submenu config. */\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** Appearance of the table's rows. */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n disableRowHeightTransition: {\n type: Boolean,\n default: false,\n },\n emptyState: {\n type: Object as PropType<KdsEmptyStateProps>,\n default: undefined,\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n resizeActive: (isActive: boolean) => true,\n columnUpdate: (newColumnList: string[]) => true,\n columnReorder: (colInd: number, newColInd: number) => true,\n pageChange: (newPageNumber: number) => true,\n pageSizeUpdate: (newPageSize: number) => true,\n columnSort: (colInd: number | undefined, sortDirection: -1 | 0 | 1) => true,\n selectAll: (selected: boolean) => true,\n rowSelect: (\n selected: boolean,\n rowInd: number,\n groupInd: number,\n isTop: boolean,\n ) => true,\n tableInput: (event: any) => true,\n columnResize: (columnIndex: number, newColumnSize: number) => true,\n lazyload: (lazyloadParams: {\n direction: 1 | -1;\n startIndex: number;\n endIndex: number;\n }) => true,\n allColumnsResize: (newColumnSize: number) => true,\n columnResizeStart: () => true,\n columnResizeEnd: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n \"update:searchTerm\": (newSearchTerm: string /** Might be empty */) => true,\n rowHeightUpdate: (newRowHeight: number | null | \"dynamic\") => true,\n copySelection: (copySelectionParams: {\n rect: Rect;\n id: RectId | null;\n withHeaders: boolean;\n }) => true,\n pasteSelection: (pasteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n updateSelection: (newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n }) => void;\n }) => true,\n cutSelection: (cutSelectionParams: { rect: Rect; id: RectId | null }) =>\n true,\n deleteSelection: (deleteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n }) => true,\n cellSelectionChange: (cellPosition: CellPosition | null) => true,\n dataValueView: (\n row: { indexInInput: number; isTop: boolean },\n columnIndex: number,\n rect: VirtualElementAnchor,\n ) => true,\n closeDataValueView: () => true,\n newColumnButtonClick: () => true,\n newRowButtonClick: (\n lastPosition: {\n columnInd: number;\n rectId: number | null;\n } | null,\n ) => true,\n headerCellStartEditing: (columnIndex: number, initialValue?: string) =>\n true,\n deleteColumn: (colInd: number) => true,\n deleteRow: (rowInd: number) => true,\n resetTemporaryView: () => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(props, { emit }) {\n const wrapper: Ref<any> = ref(null);\n const tableCore: Ref<InstanceType<typeof TableCore> | null> = ref(null);\n const header: Ref<InstanceType<typeof Header> | null> = ref(null);\n const selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n > = ref([]);\n const totalWidth = useTotalWidth(wrapper);\n const { isVisible: tableIsVisible, onAvailableWidthReported } =\n useVisibleAfterAvailableWidth();\n const onUpdateAvailableWidth = (newAvailableWidth: number) => {\n emit(\"update:available-width\", newAvailableWidth);\n onAvailableWidthReported();\n };\n const enableCellSelection = computed(() =>\n Boolean(props.tableConfig.enableCellSelection),\n );\n // cell selection\n const {\n selectCell,\n expandCellSelection,\n clearCellSelection,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n } = useCellSelection(enableCellSelection);\n\n watch(selectedCell, (newCell) =>\n emit(\"cellSelectionChange\", newCell ?? null),\n );\n\n const selectCellsOnMove = useBoolean(false);\n // cell copying\n const emitCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (rectMinMax.value) {\n emit(\"copySelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n withHeaders,\n });\n }\n };\n\n const scrollToCellSelectionOverlay = async () => {\n const tableCoreRef = tableCore.value;\n if (tableCoreRef === null) {\n return;\n }\n const scrollToViewParams = {\n containerBCR:\n tableCoreRef.getVirtualContainer()?.getBoundingClientRect() || null,\n headerHeight: header.value?.$el.clientHeight || 0,\n scrollTo: (position: { left?: number; top?: number }) =>\n tableCoreRef.virtualScrollToPosition(position),\n };\n\n if (Array.isArray(selectionOverlay.value)) {\n await selectionOverlay.value[0]?.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n } else if (selectionOverlay.value) {\n await selectionOverlay.value.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n }\n };\n\n const updateCellSelection = (\n newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n },\n newRectId: RectId | null = null,\n ) => {\n const rectId = newRectId ?? currentRectId.value ?? 0;\n selectCell({ x: newRect.maxX, y: newRect.maxY }, rectId, true);\n if (newRect.minX !== newRect.maxX || newRect.minY !== newRect.maxY) {\n expandCellSelection({ x: newRect.minX, y: newRect.minY }, rectId);\n }\n tableCore.value?.getVirtualBody()?.focus({ preventScroll: true });\n nextTick().then(scrollToCellSelectionOverlay);\n };\n\n const emitPasteSelection = () => {\n if (rectMinMax.value) {\n emit(\"pasteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n updateSelection: updateCellSelection,\n });\n }\n };\n const emitCutSelection = () => {\n if (rectMinMax.value) {\n emit(\"cutSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n const emitDeleteSelection = () => {\n if (rectMinMax.value) {\n emit(\"deleteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n\n const focusWithin = ref(false);\n const changeFocus = (newFocus: boolean) => {\n focusWithin.value = newFocus;\n };\n\n const toBeEditedCell = ref<null | CellPosition>(null);\n const editingCellInitialValue = ref<null | string>(null);\n const editingCell = computed(() =>\n selectCellsOnMove.state ? null : toBeEditedCell.value,\n );\n const isEditingCell = computed(() => editingCell.value !== null);\n\n const setToBeEditedCell = (\n cellPosition: CellPosition | null,\n initialValue?: string,\n ) => {\n toBeEditedCell.value = cellPosition;\n editingCellInitialValue.value = initialValue ?? null;\n };\n const isEditingEnabled = computed(() =>\n getPropertiesFromColumns(props.columns, \"editable\").some(Boolean),\n );\n const { handleCopyOnKeydown, handleDeleteSelection } = useCellCopyPaste({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy: emitCopySelection,\n onPaste: emitPasteSelection,\n onCut: emitCutSelection,\n onDelete: emitDeleteSelection,\n });\n\n const stopEditingCell = (rowInd?: number, colInd?: number) => {\n const toBeEditedCellValue = toBeEditedCell.value;\n if (\n rowInd !== undefined &&\n colInd !== undefined &&\n toBeEditedCellValue &&\n (toBeEditedCellValue.x !== colInd || toBeEditedCellValue.y !== rowInd)\n ) {\n return;\n }\n setToBeEditedCell(null);\n };\n\n const toBeShownCell = ref<null | CellPosition>(null);\n\n const closeDataValueView = () => {\n if (props.tableState.dataValueViewIsShown) {\n emit(\"closeDataValueView\");\n }\n toBeShownCell.value = null;\n };\n\n provideDataValueViewsIsShown(\n toRef(props, \"tableState\"),\n closeDataValueView,\n );\n\n const { columnResizeActive } = injectColumnSizes();\n watchEffect(() => emit(\"resizeActive\", columnResizeActive.value));\n\n const showNewColumnAndRowButton = computed(() =>\n Boolean(props.tableConfig.showNewColumnAndRowButton),\n );\n const newColumnButtonWidth = ref(0);\n\n return {\n wrapper,\n totalWidth,\n tableIsVisible,\n onUpdateAvailableWidth,\n tableCore,\n header,\n selectionOverlay,\n scrollToCellSelectionOverlay,\n selectCellsOnMove,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n selectCell,\n expandCellSelection,\n clearCellSelection: () => {\n clearCellSelection();\n closeDataValueView();\n },\n clearCellSelectionAndStopPropagation: (event: Event) => {\n if (rectMinMax.value === null) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n clearCellSelection();\n },\n setToBeEditedCell,\n editingCellInitialValue,\n stopEditingCell,\n updateCellSelection,\n changeFocus,\n focusWithin,\n handleCopyOnKeydown,\n handleDeleteSelection,\n toBeShownCell,\n toBeEditedCell,\n editingCell,\n isEditingCell,\n createEditingCellKeydownHandler,\n columnResizeActive,\n showNewColumnAndRowButton,\n newColumnButtonWidth,\n BODY_WIDTH_CSS_VAR,\n };\n },\n data() {\n return {\n popoverColumn: null as null | string | number | symbol,\n lastScrollIndex: 0,\n newVal: null,\n resizeCount: 0,\n updatedBefore: false,\n wrapperWidth: 0,\n closeExpandedSubMenu: () => {},\n scrollerId: \"scroller\",\n resizedRowHeight: null as null | number,\n currentResizedScrollIndex: null as null | number,\n currentRowSizeDelta: null as null | number,\n SPECIAL_COLUMNS_SIZE,\n lastRowAndRectIdBeforeMovingToNewColumnButton: null as null | {\n rowInd: number;\n rectId: RectId | null;\n },\n lastColumnAndRectIdBeforeMovingToNewRowButton: null as\n | null\n | {\n columnInd: number;\n rectId: RectId | null;\n }\n | {\n virtualColumn: \"delete\" | \"selection\";\n rectId: RectId | null;\n },\n };\n },\n computed: {\n showActionBar() {\n const viewType = this.actionState?.viewType;\n // A temporary view is highlighted via the action bar, so the bar must\n // render even when no action bar feature is enabled via actionConfig\n return (\n Boolean(this.actionConfig) ||\n viewType === \"TEMP_VIEW\" ||\n viewType === \"PREVIEW\"\n );\n },\n minRowHeight() {\n return this.rowConfig.compactMode\n ? COMPACT_ROW_HEIGHT\n : DEFAULT_ROW_HEIGHT;\n },\n initialRowHeight() {\n return this.rowConfig?.rowHeight || this.minRowHeight;\n },\n currentRowHeight() {\n return this.resizedRowHeight ?? this.initialRowHeight;\n },\n selectedHeaderIndex(): number | null {\n return this.selectedCell?.y === -1 ? this.selectedCell.x : null;\n },\n slottedColumns() {\n return getPropertiesFromColumns(this.columns, \"hasSlotContent\")\n .map((hasSlotContent: any, colInd: any) =>\n hasSlotContent ? colInd : null,\n )\n .filter((colInd: any) => colInd !== null);\n },\n topDataLength() {\n if (this.data === null || this.data.length === 0) {\n return 0;\n }\n return this.data[0].length;\n },\n totalTableLength() {\n return this.scrollData[0].length + this.numRowsAbove;\n },\n numPlaceholderRows() {\n return this.topDataLength ? 1 : 0;\n },\n placeholderRowRowIndex() {\n return this.data[0].length + this.numRowsAbove;\n },\n scrollData() {\n if (this.data === null || this.data.length === 0) {\n return [[]];\n }\n const dataItems: DataItem[][] = this.data?.map((groupData) =>\n groupData.map((data) => ({ data })),\n );\n if (this.bottomData.length > 0) {\n if (this.numPlaceholderRows) {\n dataItems[0].push({ dots: true });\n }\n dataItems[0].push(...this.bottomData.map((data) => ({ data })));\n }\n return dataItems;\n },\n currentSelectionMap() {\n if (!this.tableConfig.showSelection) {\n return () => false;\n }\n return (rowInd: number, groupInd: number) => {\n const { isTop, indexInInput } = this.resolveRowIndex(rowInd);\n return isTop\n ? this.currentSelection[groupInd][indexInInput]\n : this.currentBottomSelection[indexInInput];\n };\n },\n scrollerItemSize() {\n if (this.currentRowHeight === \"dynamic\") {\n return this.minRowHeight;\n }\n return this.currentRowHeight;\n },\n sortControlOptions() {\n const selectableColumns: { id: string; text: string }[] = [];\n const selectableDirections: Record<\n string,\n { id: string; text: string }[]\n > = {};\n this.columns.forEach((column) => {\n if (column.isNotSortable) {\n return;\n }\n selectableColumns.push({\n id: column.id as string,\n text: column.header,\n });\n const sortTexts = columnSortText[column.type ?? \"default\"];\n selectableDirections[column.id as string] = [\n { id: \"1\", text: sortTexts.ascending },\n { id: \"-1\", text: sortTexts.descending },\n ];\n });\n return { selectableColumns, selectableDirections };\n },\n },\n watch: {\n \"rowConfig.compactMode\": {\n handler() {\n this.resetRowHeight();\n },\n },\n \"rowConfig.rowHeight\": {\n handler() {\n this.resetRowHeight();\n },\n },\n currentRowHeight(newRowHeight) {\n this.$emit(\"rowHeightUpdate\", newRowHeight);\n },\n },\n methods: {\n // Utilities\n refreshScroller() {\n this.tableCore?.virtualScrollToPosition({ top: 0 });\n },\n resetRowHeight() {\n this.resizedRowHeight = null;\n },\n isTop(index: number) {\n return index < this.topDataLength + this.numRowsAbove;\n },\n resolveRowIndex(index: number) {\n if (index < this.numRowsAbove) {\n throw new Error(`Accessing invalid row index: ${index}`);\n }\n if (this.isTop(index)) {\n return {\n isTop: true,\n indexInInput: index - this.numRowsAbove,\n };\n }\n return {\n isTop: false,\n indexInInput:\n index -\n this.numRowsAbove -\n this.numPlaceholderRows -\n this.topDataLength,\n };\n },\n // Event handling\n onScroll(startIndex: number, endIndex: number) {\n if (\n this.lastScrollIndex === endIndex ||\n this.currentResizedScrollIndex !== null\n ) {\n return;\n }\n const direction: 1 | -1 = this.lastScrollIndex < endIndex ? 1 : -1;\n this.lastScrollIndex = endIndex;\n this.$emit(\"lazyload\", { direction, startIndex, endIndex });\n },\n onColumnUpdate(newColumnList: any) {\n consola.debug(`TableUI emitting: columnUpdate ${newColumnList}`);\n this.clearCellSelection();\n this.$emit(\"columnUpdate\", newColumnList);\n },\n onColumnReorder(colInd: number, newColInd: number) {\n consola.debug(`TableUI emitting: columnReorder ${colInd} ${newColInd}`);\n this.clearCellSelection();\n this.$emit(\"columnReorder\", colInd, newColInd);\n },\n onPageChange(newPageNumber: number) {\n consola.debug(`TableUI emitting: pageChange ${newPageNumber}`);\n this.clearCellSelection();\n this.$emit(\"pageChange\", newPageNumber);\n },\n onPageSizeUpdate(newPageSize: number) {\n consola.debug(`TableUI emitting: pageSizeUpdate ${newPageSize}`);\n this.clearCellSelection();\n this.$emit(\"pageSizeUpdate\", newPageSize);\n },\n clearAllCellInteractions() {\n this.clearCellSelection();\n this.stopEditingCell();\n },\n onDeleteColumn(colInd: number) {\n this.clearAllCellInteractions();\n this.$emit(\"deleteColumn\", colInd);\n },\n onDeleteRow(rowInd: number) {\n this.clearAllCellInteractions();\n const { indexInInput } = this.resolveRowIndex(rowInd);\n this.$emit(\"deleteRow\", indexInInput);\n },\n onColumnSort(colInd: number | undefined, sortDirection: -1 | 0 | 1) {\n consola.debug(`TableUI emitting: columnSort ${colInd} ${sortDirection}`);\n this.clearCellSelection();\n this.$emit(\"columnSort\", colInd, sortDirection);\n },\n onActionBarColumnSort(\n columnId: string | undefined,\n sortDirection: -1 | 0 | 1,\n ) {\n // The action bar's SortControl identifies columns by their stable id,\n // but the columnSort event is positional. Translate the id back to the\n // column's index before delegating to the shared handler.\n const colInd =\n columnId === undefined\n ? undefined\n : this.columns.findIndex((column) => column.id === columnId);\n this.onColumnSort(colInd, sortDirection);\n },\n onSelectAll(selected: boolean) {\n consola.debug(`TableUI emitting: selectAll ${selected}`);\n this.$emit(\"selectAll\", selected);\n },\n onDataValueView(\n cellInd: number,\n rowInd: number,\n anchor: VirtualElementAnchor,\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n this.toBeShownCell = null;\n this.$emit(\"dataValueView\", { indexInInput, isTop }, cellInd, anchor);\n },\n onRowSelect(selected: boolean, rowInd: number, groupInd: number) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n consola.debug(\n `TableUI emitting: rowSelect ${selected} ${indexInInput} ${groupInd} ${isTop}`,\n );\n this.$emit(\"rowSelect\", selected, indexInInput, groupInd, isTop);\n },\n onCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n const isTop = this.isTop(rowInd);\n this.selectCell(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n ignoreIfSelected || Boolean(this.columns[cellInd]?.editable),\n );\n this.stopEditingCell();\n },\n onCellSelectRowEvent(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n if (\n this.toBeEditedCell &&\n this.toBeEditedCell.x === cellInd &&\n this.toBeEditedCell.y === rowInd\n ) {\n // If the cell to be edited is clicked again, do not interrupt editing\n return;\n }\n const isEditable = Boolean(this.columns[cellInd]?.editable);\n if (isEditable && this.isSingleSelectedCell({ x: cellInd, y: rowInd })) {\n this.onStartEditingCell();\n } else {\n this.onCellSelect(cellInd, rowInd, groupInd, ignoreIfSelected);\n }\n },\n onExpandCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ) {\n const isTop = this.isTop(rowInd);\n this.expandCellSelection(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n );\n this.stopEditingCell();\n },\n focusBody() {\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n this.focusWithin = true;\n },\n onTableBodyFocusOut() {\n this.changeFocus(false);\n if (this.selectedCell) {\n if (this.columns[this.selectedCell.x]?.editable) {\n this.selectCell(this.selectedCell, this.currentRectId ?? 0, true);\n } else if (!this.tableState.dataValueViewIsShown) {\n this.clearCellSelection();\n }\n }\n },\n onHeaderCellSelect(columnIndex: number) {\n this.stopEditingCell();\n this.selectCell({ x: columnIndex, y: -1 }, 0, true);\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onHeaderCellDeselect() {\n if (this.selectedCell?.y === -1) {\n this.clearCellSelection();\n }\n },\n onMoveDownFromHeaderCell(columnIndex: number) {\n if (this.totalTableLength === 0) {\n if (this.showNewColumnAndRowButton) {\n this.clearCellSelection();\n this.focusNewRowButton();\n }\n return;\n }\n this.onCellSelect(columnIndex, 0, null);\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n tableCoreRef.virtualScrollToPosition({ top: 0 });\n },\n onUpdateNewColumnButtonWidth(width: number) {\n this.newColumnButtonWidth = width;\n },\n onKeyboardMoveSelectionVirtual(\n columnInd: number,\n rowInd: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n let adaptedRowInd = rowInd;\n if (rowInd === this.totalTableLength) {\n this.onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === this.placeholderRowRowIndex) {\n adaptedRowInd += verticalMove;\n }\n this[expandSelection ? \"onExpandCellSelect\" : \"onCellSelect\"](\n columnInd,\n adaptedRowInd,\n null,\n );\n },\n async onKeyboardMoveSelectionFromEditingCell(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n await this.onKeyboardMoveSelection(\n horizontalMove,\n verticalMove,\n expandSelection,\n );\n if (this.selectedCell) {\n this.focusBody();\n }\n this.stopEditingCell();\n },\n onMoveSelectionOutOfBodyUp({ columnInd }: { columnInd: number }) {\n if (!this.header?.isColumnHeaderFocusable(columnInd)) {\n return;\n }\n this.clearCellSelection();\n this.focusHeaderCell(columnInd);\n },\n focusNewRowButton() {\n (\n this.$refs[\"new-row-button\"] as InstanceType<typeof NewRowButton>\n )?.focus();\n },\n onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId,\n }: {\n columnInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.clearCellSelection();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n columnInd,\n rectId,\n };\n }\n },\n onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.getHeaderComponent().focusNewColumnButton();\n this.clearCellSelection();\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = { rowInd, rectId };\n }\n },\n onMoveIntoBodyFromRight() {\n const lastColumnInd = this.columns.length - 1;\n const lastRowAndRectId = this\n .lastRowAndRectIdBeforeMovingToNewColumnButton ?? {\n rowInd: -1,\n rectId: null,\n };\n if (lastRowAndRectId.rowInd === -1) {\n this.focusHeaderCell(lastColumnInd);\n } else {\n this.updateCellSelection(\n {\n minX: lastColumnInd,\n minY: lastRowAndRectId.rowInd,\n maxX: lastColumnInd,\n maxY: lastRowAndRectId.rowInd,\n },\n lastRowAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onMoveIntoBodyFromBottom() {\n const lastRowInd = this.totalTableLength - 1;\n const lastColumnAndRectId = this\n .lastColumnAndRectIdBeforeMovingToNewRowButton ?? {\n columnInd: 0,\n rectId: null,\n };\n if (\"virtualColumn\" in lastColumnAndRectId) {\n this.focusRowVirtualColumn(\n lastColumnAndRectId.virtualColumn,\n lastRowInd,\n lastColumnAndRectId.rectId,\n );\n } else {\n if (this.totalTableLength === 0) {\n this.focusHeaderCell(0);\n return;\n }\n this.updateCellSelection(\n {\n minX: lastColumnAndRectId.columnInd,\n minY: lastRowInd,\n maxX: lastColumnAndRectId.columnInd,\n maxY: lastRowInd,\n },\n lastColumnAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = null;\n },\n onMoveSelectionOutOfBodyLeft({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n this.clearCellSelection();\n } else if (this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n this.clearCellSelection();\n }\n },\n onMoveIntoBodyFromLeft(rowInd: number, groupInd: RectId | null) {\n this.updateCellSelection(\n {\n minX: 0,\n minY: rowInd,\n maxX: 0,\n maxY: rowInd,\n },\n groupInd,\n );\n this.focusBody();\n },\n focusRowVirtualColumn(\n type: \"delete\" | \"selection\",\n rowInd: number,\n _groupInd: RectId | null,\n ) {\n const refName = this.getRowRefName(null, rowInd);\n const rowComponent = this.$refs[refName] as InstanceType<typeof Row>;\n if (type === \"delete\") {\n rowComponent?.focusDeleteButton();\n } else {\n rowComponent?.focusSelectionCheckbox();\n }\n },\n onVirtualColumnNav(\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n rowInd: number,\n groupInd: null | number,\n ) {\n const rectId = groupInd ?? null;\n if (direction === \"right\") {\n if (type === \"delete\" && this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n } else if (this.columns.length > 0) {\n this.onMoveIntoBodyFromLeft(rowInd, rectId);\n }\n } else if (direction === \"left\") {\n if (type === \"selection\" && this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n }\n } else if (direction === \"up\") {\n if (rowInd > 0) {\n this.focusRowVirtualColumn(type, rowInd - 1, rectId);\n } else if (type === \"selection\") {\n this.getHeaderComponent().focusSelectionCheckbox();\n }\n } else if (direction === \"down\") {\n if (rowInd < this.totalTableLength - 1) {\n this.focusRowVirtualColumn(type, rowInd + 1, rectId);\n } else if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n virtualColumn: type,\n rectId,\n };\n }\n }\n },\n onHeaderSelectionKeydownDown() {\n this.focusRowVirtualColumn(\"selection\", 0, null);\n },\n async onKeyboardMoveSelection(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n if (!this.selectedCell) {\n return;\n }\n const columnInd = this.selectedCell.x + horizontalMove;\n const rowInd = this.selectedCell.y + verticalMove;\n if (columnInd === -1) {\n this.onMoveSelectionOutOfBodyLeft({\n rowInd: this.selectedCell!.y,\n rectId: this.currentRectId,\n });\n return;\n }\n if (columnInd === this.columns.length) {\n this.onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === -1) {\n this.onMoveSelectionOutOfBodyUp({ columnInd });\n return;\n }\n\n this.onKeyboardMoveSelectionVirtual(\n columnInd,\n rowInd,\n verticalMove,\n expandSelection,\n );\n\n await this.scrollToCellSelectionOverlay();\n\n this.toBeShownCell = this.tableState.dataValueViewIsShown\n ? this.selectedCell\n : null;\n },\n async expandSelectedCell() {\n if (this.selectedCell && this.tableConfig.enableDataValueViews) {\n // scroll current selection into view\n await this.onKeyboardMoveSelection(0, 0, true);\n this.toBeShownCell = this.selectedCell;\n }\n },\n\n onStartEditingCell(initialValue?: string) {\n if (this.selectedCell && this.columns[this.selectedCell.x]?.editable) {\n this.setToBeEditedCell(this.selectedCell, initialValue);\n }\n },\n onResizeRow(rowSizeDelta: number, scrollIndex: number) {\n this.currentRowSizeDelta = rowSizeDelta;\n this.currentResizedScrollIndex = scrollIndex;\n },\n onResizeAllRows(currentSize: number, row: HTMLElement, rowInd: number) {\n if (this.currentRowHeight === \"dynamic\") {\n return;\n }\n this.currentRowSizeDelta = 0;\n const previousScrollTop = this.tableCore?.getVirtualScrollStart();\n if (previousScrollTop === undefined) {\n return;\n }\n const heightAboveCurrentRow = rowInd * this.currentRowHeight;\n const offset = heightAboveCurrentRow - previousScrollTop;\n this.resizedRowHeight = currentSize;\n const scrollPosition = rowInd * this.currentRowHeight - offset;\n this.keepScrollerPositionOnRowResize(scrollPosition);\n },\n keepScrollerPositionOnRowResize(scrollPosition: number) {\n const resizeObserver = new ResizeObserver(() => {\n setTimeout(() => {\n // scroll was temporarily disabled to avoid sending scroll events during resize\n this.currentResizedScrollIndex = null;\n }, ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY);\n this.tableCore?.virtualScrollToPosition({ top: scrollPosition });\n resizeObserver.disconnect();\n });\n const virtualBody = this.tableCore?.getVirtualBody();\n if (virtualBody) {\n resizeObserver.observe(virtualBody);\n }\n },\n onRowInput(\n _event: any,\n rowInd: number,\n groupInd: number,\n row: { id: string },\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n const event = {\n ..._event,\n rowInd: indexInInput,\n id: row.id,\n groupInd,\n isTop,\n };\n consola.debug(`TableUI emitting: tableInput ${event}`);\n this.$emit(\"tableInput\", event);\n },\n onRowSubMenuClick(event: any, row: any) {\n consola.debug(`TableUI row submenu clicked ${event} ${row}`);\n if (event.callback) {\n event.callback(row, this);\n }\n },\n onColumnResize(columnIndex: number, newColumnSize: number) {\n this.$emit(\"columnResize\", columnIndex, newColumnSize);\n },\n onAllColumnsResize(newColumnSize: number) {\n this.$emit(\"allColumnsResize\", newColumnSize);\n },\n onColumnResizeStart() {\n this.columnResizeActive = true;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.columnResizeActive = false;\n this.$emit(\"columnResizeEnd\");\n },\n getCellContentSlotName(columns: ColumnConfig[], columnId: number) {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columns[columnId].key as unknown as string}`;\n },\n getHeaderComponent() {\n return this.$refs.header as InstanceType<typeof Header>;\n },\n getTableCoreComponent() {\n return this.$refs.tableCore as InstanceType<typeof TableCore>;\n },\n getSelectionOverlayComponent() {\n return this.$refs.selectionOverlay as InstanceType<\n typeof CellSelectionOverlay\n >;\n },\n focusHeaderCell(cellInd: number) {\n this.getHeaderComponent().focusHeaderCell(cellInd);\n },\n refocusSelection() {\n if (this.selectedHeaderIndex === null) {\n this.focusBody();\n } else {\n this.focusHeaderCell(this.selectedHeaderIndex);\n }\n },\n getRowComponents() {\n const rowComponents: any[] = [];\n this.data.forEach((group: any) => {\n group.forEach((_: any, rowIndex: number) =>\n rowComponents.push(this.$refs[this.getRowRefName(null, rowIndex)]),\n );\n });\n return rowComponents;\n },\n getRowData(row: Record<string, unknown> | Array<unknown>) {\n const isEmptyArray = Array.isArray(row) && row.length === 0;\n return isEmptyArray\n ? row\n : this.columns.map(\n (column) =>\n (row as Record<string, unknown>)[column.key as unknown as string],\n );\n },\n getRowRefName(groupInd: null | number, rowInd: number) {\n if (groupInd === null) {\n return `row-${rowInd}`;\n }\n return `group-${groupInd}-row-${rowInd}`;\n },\n getCellIndex(cell: CellPosition | null | undefined, rowInd: number) {\n if (cell && cell.y === rowInd) {\n return cell.x;\n }\n return null;\n },\n getCellSelectionRange(rowInd: number) {\n const rect = this.rectMinMax;\n if (!rect || rowInd < rect.y.min || rowInd > rect.y.max) {\n return null;\n }\n return { min: rect.x.min, max: rect.x.max };\n },\n onNewRowButtonClick(event: MouseEvent) {\n event.stopPropagation();\n const lastCellOrLastVirtualCell =\n this.lastColumnAndRectIdBeforeMovingToNewRowButton;\n const lastCellWasVirtualColumn =\n lastCellOrLastVirtualCell &&\n \"virtualColumn\" in lastCellOrLastVirtualCell;\n const lastCell = lastCellWasVirtualColumn\n ? null\n : lastCellOrLastVirtualCell;\n\n this.$emit(\"newRowButtonClick\", lastCell);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n event.stopPropagation();\n this.$emit(\"newColumnButtonClick\");\n },\n },\n};\n</script>\n\n<template>\n <div\n class=\"wrapper\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n >\n <TableActionBar\n v-if=\"showActionBar\"\n :table-sizes=\"tableState.tableSizes\"\n :action-state\n :row-label=\"tableConfig.rowLabel\"\n :show-table-size=\"tableConfig.showTableSize\"\n :action-config=\"actionConfig ?? {}\"\n :col-sort-values\n :sort-control-options\n @reset-temporary-view=\"$emit('resetTemporaryView')\"\n @on-column-sort=\"onActionBarColumnSort\"\n @update:search-term=\"$emit('update:searchTerm', $event)\"\n >\n <template v-if=\"$slots['action-bar-left']\" #action-bar-left>\n <slot name=\"action-bar-left\" />\n </template>\n </TableActionBar>\n <table\n ref=\"wrapper\"\n :tabindex=\"-1\"\n @pointerleave=\"selectCellsOnMove.setFalse\"\n @pointerdown.passive.stop=\"\n $event.button === 0 && selectCellsOnMove.setTrue()\n \"\n @pointerup.passive=\"$event.button === 0 && selectCellsOnMove.setFalse()\"\n @keydown.ctrl.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.meta.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.delete.exact=\"handleDeleteSelection\"\n @keydown.escape.exact=\"clearCellSelectionAndStopPropagation\"\n >\n <TableCore\n ref=\"tableCore\"\n :scroll-data=\"scrollData\"\n :total-width=\"totalWidth\"\n :column-resize=\"{ active: columnResizeActive }\"\n :table-config\n :sub-menu-config\n :scroll-config=\"{\n itemSize: scrollerItemSize,\n numRowsAbove,\n numRowsBelow,\n compact: Boolean(rowConfig.compactMode),\n }\"\n :current-row-height=\"currentRowHeight\"\n :new-column-button-width\n @scroller-update=\"onScroll\"\n @update:available-width=\"onUpdateAvailableWidth\"\n @move-selection=\"onKeyboardMoveSelection\"\n @clear-selection=\"clearCellSelection\"\n @expand-selected-cell=\"expandSelectedCell\"\n @start-editing=\"onStartEditingCell\"\n @body-focusin=\"changeFocus(true)\"\n @body-focusout=\"onTableBodyFocusOut()\"\n >\n <template #row=\"{ row, groupInd, rowInd }\">\n <Row\n :ref=\"getRowRefName(groupInd, rowInd)\"\n :row-data=\"row\"\n :row=\"getRowData(row)\"\n :table-config\n :sub-menu-config\n :show-drag-handle=\"tableConfig.enableRowResizing\"\n :columns\n :row-config=\"rowConfig\"\n :row-height=\"currentRowHeight\"\n :min-row-height=\"minRowHeight\"\n :is-selected=\"currentSelectionMap(rowInd, groupInd || 0)\"\n :select-cells-on-move=\"selectCellsOnMove.state\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n :selected-cell-index=\"getCellIndex(selectedCell, rowInd)\"\n :cell-selection-range=\"getCellSelectionRange(rowInd)\"\n :to-be-expanded-cell-index=\"getCellIndex(toBeShownCell, rowInd)\"\n :to-be-edited-cell-index=\"getCellIndex(editingCell, rowInd)\"\n :new-column-button-width\n @delete-row=\"() => onDeleteRow(rowInd)\"\n @row-select=\"onRowSelect($event, rowInd, groupInd || 0)\"\n @cell-select=\"\n (cellInd, ignoreIfSelected) =>\n onCellSelectRowEvent(\n cellInd,\n rowInd,\n groupInd,\n ignoreIfSelected,\n )\n \"\n @data-value-view=\"\n (cellInd, anchor) => onDataValueView(cellInd, rowInd, anchor)\n \"\n @expand-cell-select=\"\n (cellInd) => onExpandCellSelect(cellInd, rowInd, groupInd)\n \"\n @row-input=\"\n (event) => onRowInput(event, rowInd, groupInd ?? 0, row)\n \"\n @row-sub-menu-click=\"onRowSubMenuClick($event, row)\"\n @resize-all-rows=\"\n (currentSize, row) => onResizeAllRows(currentSize, row, rowInd)\n \"\n @resize-row=\"(rowSizeDelta) => onResizeRow(rowSizeDelta, rowInd)\"\n @virtual-column-nav=\"\n (type, direction) =>\n onVirtualColumnNav(type, direction, rowInd, groupInd)\n \"\n >\n <!-- Vue requires named slots on \"custom\" elements (i.e. template). -->\n <!-- eslint-disable vue/valid-v-slot -->\n <template\n v-for=\"colInd in slottedColumns\"\n #[getCellContentSlotName(columns,colInd)]=\"cellData\"\n :key=\"rowInd + '_' + colInd\"\n >\n <!-- \n TODO: UIEXT-1753:\n not yet working properly with empty and bottom rows, \n since rowInd is the actual scroll index and not the input in the input data\n in this case\n -->\n <slot\n :name=\"`cellContent-${columns[colInd].key as unknown as string}`\"\n :data=\"{\n ...cellData,\n key: columns[colInd].key,\n rowInd,\n colInd,\n }\"\n />\n </template>\n <template #editable-cell=\"{ ind, cellElement }\">\n <slot\n name=\"editable-cell\"\n :row-ind=\"rowInd\"\n :col-ind=\"ind\"\n :initial-value=\"editingCellInitialValue\"\n :cell-element=\"cellElement\"\n @keydown=\"\n (event: KeyboardEvent) =>\n createEditingCellKeydownHandler({\n moveSelection: onKeyboardMoveSelectionFromEditingCell,\n })(event)\n \"\n @click-away=\"stopEditingCell\"\n />\n </template>\n </Row>\n </template>\n <template #header=\"{ getDragHandleHeight }\">\n <Header\n ref=\"header\"\n :style=\"{ width: `var(${BODY_WIDTH_CSS_VAR})` }\"\n :table-config\n :action-config\n :columns\n :additional-header-menu-items\n :col-sort-values\n :is-selected=\"Boolean(tableState.totalSelected)\"\n :get-drag-handle-height=\"getDragHandleHeight\"\n :class=\"[\n 'table-header',\n {\n 'sub-menu-active': subMenuConfig.subMenuItems?.length,\n },\n ]\"\n :show-new-column-button=\"showNewColumnAndRowButton\"\n :selected-header-index=\"selectedHeaderIndex\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n @header-select=\"onSelectAll\"\n @column-sort=\"onColumnSort\"\n @delete-column=\"onDeleteColumn\"\n @column-resize=\"onColumnResize\"\n @all-columns-resize=\"onAllColumnsResize\"\n @column-resize-start=\"onColumnResizeStart\"\n @column-resize-end=\"onColumnResizeEnd\"\n @move-down-from-header-cell=\"onMoveDownFromHeaderCell\"\n @header-cell-select=\"onHeaderCellSelect\"\n @header-cell-deselect=\"onHeaderCellDeselect\"\n @header-cell-start-editing=\"\n (columnIndex: number, initialValue?: string) =>\n $emit('headerCellStartEditing', columnIndex, initialValue)\n \"\n @update:new-column-button-width=\"onUpdateNewColumnButtonWidth\"\n @new-column-button-click=\"onNewColumnButtonClick\"\n @selection-keydown-down=\"onHeaderSelectionKeydownDown()\"\n @new-column-button-keydown-left=\"onMoveIntoBodyFromRight()\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" />\n </template>\n </Header>\n </template>\n <template #cell-selection-overlay>\n <CellSelectionOverlay\n v-if=\"rectMinMax && !isEditingCell && selectedHeaderIndex === null\"\n ref=\"selectionOverlay\"\n :rect=\"rectMinMax\"\n :row-height=\"scrollerItemSize\"\n :table-config=\"tableConfig\"\n :row-resize-index=\"currentResizedScrollIndex\"\n :row-resize-delta=\"currentRowSizeDelta\"\n :cell-selection-rect-focus-corner=\"\n focusWithin ? selectedCell : undefined\n \"\n />\n </template>\n <template #belowBody>\n <NewRowButton\n v-if=\"showNewColumnAndRowButton\"\n ref=\"new-row-button\"\n @click=\"onNewRowButtonClick\"\n @pointerdown.stop\n @keydown-up=\"onMoveIntoBodyFromBottom\"\n />\n </template>\n <template v-if=\"emptyState\" #empty-state>\n <KdsEmptyState class=\"empty-state\" v-bind=\"emptyState\" />\n </template>\n </TableCore>\n <KdsPagination\n v-if=\"pageConfig && pageState\"\n class=\"pagination\"\n :current-page=\"pageState.currentPage\"\n :page-size=\"pageConfig.pageSize\"\n :possible-page-sizes=\"pageConfig.possiblePageSizes\"\n :total-rows=\"tableState.tableSizes?.currentNumRows ?? 0\"\n :show-table-size=\"tableConfig.showTableSize\"\n :row-label=\"tableConfig.rowLabel\"\n @update:current-page=\"onPageChange\"\n @update:page-size=\"onPageSizeUpdate\"\n />\n </table>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n @media screen {\n /* height 100% does not mix well with flex-box on print (https://issues.chromium.org/issues/365922171) */\n height: 100%;\n }\n}\n\ntable {\n position: relative;\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n\n &:focus {\n outline: none;\n }\n\n & .new-row-footer {\n width: 100%;\n }\n\n /* The table inherits its parent's background; the pagination footer is the\n one place Figma sets a surface token for (SLEEK-297). KdsPagination stays\n transparent so it can sit on any surface. */\n & .pagination {\n background: var(--kds-color-surface-default);\n }\n}\n\n/* The empty state is placed into the rows' area by TableCoreVirtual. */\n.empty-state {\n max-width: 100%;\n}\n</style>\n","import { computed, nextTick, ref, watchEffect } from \"vue\";\n\nexport const useTableReady = ({ onReady }: { onReady: () => void }) => {\n const autoSizesInitialized = ref(false);\n const availableWidthInitialized = ref(false);\n\n const tableIsVisible = computed(\n () => autoSizesInitialized.value && availableWidthInitialized.value,\n );\n\n const setAutoSizesInitialized = () => {\n autoSizesInitialized.value = true;\n };\n const setAvailableWidthInitialized = () => {\n availableWidthInitialized.value = true;\n };\n\n const waitUntilVisibleInDOMAndCallOnReady = async () => {\n await nextTick();\n onReady();\n };\n\n watchEffect(() => {\n if (tableIsVisible.value) {\n waitUntilVisibleInDOMAndCallOnReady();\n }\n });\n\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n };\n};\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This component contains the ability to size the columns in the tableUI according to the width of their content by\n * enforcing a maximum size of MAX_AUTO_COLUMN_SIZE. It takes the same props as the TableUI.vue and one additional prop,\n * the options for the calculation. The automatic row height relies on the column sizes and enforces a maximum\n * height given by the auto row height options.\n * To trigger the calculation of the auto sizes, the corresponding trigger method can be called from the parent. The\n * method is automatically called from within this component when:\n * - the component is mounted\n * - one property of the autoColumnSizesOptions changes\n * - one property of the autoRowHeightOptions changes\n * - columns were removed, added, or replaced\n * - the compact mode is toggled\n */\n\nimport type { PropType, Slot } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nimport type { KdsMenuItem } from \"@knime/kds-components\";\nimport { sleep } from \"@knime/utils\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n MAX_AUTO_COLUMN_SIZE,\n MIN_COLUMN_SIZE,\n MIN_ROW_HEIGHT,\n ROW_BORDER_BOTTOM_WIDTH,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig, ColumnId } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\nimport { minSizeOfColumn } from \"../utils/columnHeaderActionButtons\";\n\nimport TableUI from \"./TableUI.vue\";\nimport { useTableReady } from \"./composables/useTableReady\";\nimport { provideAutoSizeColumnSizes } from \"./useColumnSizes\";\n\ntype SizeByColumn = Record<string | symbol, number>;\n\n/**\n * In a lot of cases, the row ids are Row0, Row1, ....\n * With 11 rows taken into account, we respect \"Row10\".\n */\nconst DEFAULT_NUM_ROWS = 11;\n\nexport default {\n components: { TableUI },\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<Array<Array<any>>>, default: () => [] },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /** Stable per-column definitions (forwarded to TableUI). */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n /** Appearance of the table's rows (forwarded to TableUI). */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on (forwarded to TableUI). */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** This object contains all the options necessary to calculate the sizes based on the\n * content. In case only one of calculateForBody/calculateForHeader is true, the emitted object contains auto\n * sizes according to body/header. In case both are true, the maximum of both values is used. For fixedSizes only\n * header sizes are calculated and the body sizes will be increased by the horizontal cell padding.\n */\n autoColumnSizesOptions: {\n type: Object as PropType<{\n calculateForBody: boolean;\n calculateForHeader: boolean;\n fixedSizes: SizeByColumn;\n }>,\n default: () => ({}),\n },\n autoRowHeightOptions: {\n type: Object as PropType<{\n calculate: boolean;\n fixedHeights: SizeByColumn;\n maxHeight: number;\n }>,\n default: () => ({}),\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n autoColumnSizesUpdate: (sizes: SizeByColumn) => true,\n autoRowHeightUpdate: (height: number | null) => true,\n ready: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(_props, { emit }) {\n // The hidden auto-size calculation table renders below the same\n // useColumnSizes provider (mounted by the embedding app) as the visible\n // table, so by default it is injected the actual column sizes — which is\n // what we want when only the row heights are calculated. When the column\n // sizes themselves are calculated, setAutoSizeColumnSizes overrides them\n // with the maximum width while the calculation table is mounted (see\n // triggerCalculationOfAutoSizes and calculateAutoSizes).\n const {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n } = useTableReady({ onReady: () => emit(\"ready\") });\n const { setAutoSizeColumnSizes, unsetAutoSizeColumnSizes } =\n provideAutoSizeColumnSizes();\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n setAutoSizeColumnSizes,\n unsetAutoSizeColumnSizes,\n };\n },\n data() {\n return {\n currentColumnSizes: {} as SizeByColumn,\n currentHeightsByColumn: {} as SizeByColumn,\n calculateSizes: false,\n useSavedColumnSizes: false,\n disableRowHeightTransition: true,\n };\n },\n computed: {\n /**\n * Needed for a combined watcher for changes in case we change both\n * option parts at the same time.\n */\n combinedOptions() {\n return {\n columns: this.autoColumnSizesOptions,\n rows: this.autoRowHeightOptions,\n };\n },\n mountTableUIForAutoSizeCalculation() {\n return this.data !== null && this.calculateSizes;\n },\n columnIds() {\n return getPropertiesFromColumns(this.columns, \"id\");\n },\n /**\n * The width each column needs at the very least, i.e. the one at which the\n * action buttons of its header still fit (see {@link minSizeOfColumn}).\n */\n minColumnSizes(): Record<ColumnId, number> {\n return this.columns.reduce(\n (minSizes, column, index) => {\n minSizes[column.id] = minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n });\n return minSizes;\n },\n {} as Record<ColumnId, number>,\n );\n },\n currentColumnsWithAutoSize() {\n return new Set<ColumnId>([\n ...Reflect.ownKeys(this.currentColumnSizes),\n ...Reflect.ownKeys(this.currentHeightsByColumn),\n ]);\n },\n removedColumnIds() {\n const removedColumnIds = new Set<ColumnId>();\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (!this.columnIds.includes(columnId)) {\n removedColumnIds.add(columnId);\n }\n });\n return removedColumnIds;\n },\n addedColumnIds() {\n const addedColumnIds = new Set<ColumnId>();\n this.columnIds.forEach((columnId) => {\n if (!this.currentColumnsWithAutoSize.has(columnId)) {\n addedColumnIds.add(columnId);\n }\n });\n return addedColumnIds;\n },\n columnsWereOnlyRemoved() {\n return this.addedColumnIds.size === 0 && this.removedColumnIds.size > 0;\n },\n paginatedDataForAutoColumnSizesCalculation() {\n return [this.data.flat().slice(0, DEFAULT_NUM_ROWS)];\n },\n colSizesForCalculationWithAutoColumnSizes() {\n return this.columnIds.map(() => MAX_AUTO_COLUMN_SIZE);\n },\n tableConfigForAutoSizesCalculation() {\n return {\n ...this.tableConfig,\n forceRenderAll: true,\n };\n },\n autoColumnSizingActive() {\n return (\n this.autoColumnSizesOptions.calculateForBody ||\n this.autoColumnSizesOptions.calculateForHeader\n );\n },\n autoRowHeightSizingActive() {\n return this.autoRowHeightOptions.calculate;\n },\n autoColumnSizeCalculationRequired() {\n return this.autoColumnSizingActive && !this.useSavedColumnSizes;\n },\n columnPaddingsHorizontal() {\n return this.columnIds.reduce(\n (paddings, columnId) => {\n paddings[columnId] = CELL_PADDING_HORIZONTAL * 2;\n return paddings;\n },\n {} as Record<string | symbol | number, number>,\n );\n },\n currentRowHeight() {\n const rowHeights = Reflect.ownKeys(this.currentHeightsByColumn).map(\n (columnId) => this.currentHeightsByColumn[columnId],\n );\n return rowHeights.length === 0\n ? null\n : Math.min(\n Math.max(...rowHeights),\n this.autoRowHeightOptions.maxHeight,\n );\n },\n forwardedSlotEntries(): Array<[string, Slot]> {\n return Object.entries(this.$slots) as Array<[string, Slot]>;\n },\n },\n watch: {\n combinedOptions: {\n handler(newVal, oldVal) {\n const columnsIsEqual = isEqual(newVal.columns, oldVal.columns);\n const rowsIsEqual = isEqual(newVal.rows, oldVal.rows);\n if (!rowsIsEqual && columnsIsEqual) {\n this.useSavedColumnSizes = true;\n }\n if (!rowsIsEqual || !columnsIsEqual) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n deep: true,\n },\n columnIds(newIds, oldIds) {\n if (\n newIds.length !== oldIds.length ||\n !newIds.every((el: any, index: number) => el === oldIds[index])\n ) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n \"rowConfig.compactMode\": {\n handler() {\n if (this.autoRowHeightOptions.calculate) {\n this.useSavedColumnSizes = true;\n this.triggerCalculationOfAutoSizes();\n }\n },\n },\n },\n mounted() {\n if (this.autoRowHeightSizingActive) {\n const unwatchRowHeight = this.$watch(\n () => this.rowConfig.rowHeight,\n async () => {\n // wait until the DOM changes regarding the newRowHeight are completely rendered and enable the transition\n // otherwise, a table with auto row height calculation performs row height animations when being first mounted\n await sleep(0);\n this.disableRowHeightTransition = false;\n unwatchRowHeight();\n },\n );\n } else {\n this.disableRowHeightTransition = false;\n }\n this.triggerCalculationOfAutoSizes();\n },\n methods: {\n emitNewAutoSizes() {\n this.$emit(\"autoColumnSizesUpdate\", { ...this.currentColumnSizes });\n this.$emit(\"autoRowHeightUpdate\", this.currentRowHeight);\n this.useSavedColumnSizes = false;\n this.setAutoSizesInitialized();\n },\n triggerCalculationOfAutoSizes() {\n if (this.autoColumnSizingActive && this.columnsWereOnlyRemoved) {\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (this.removedColumnIds.has(columnId)) {\n delete this.currentColumnSizes[columnId];\n delete this.currentHeightsByColumn[columnId];\n }\n });\n this.emitNewAutoSizes();\n return;\n }\n\n if (!this.autoColumnSizingActive) {\n this.currentColumnSizes = {};\n }\n if (!this.autoRowHeightSizingActive) {\n this.currentHeightsByColumn = {};\n }\n\n const autoSizingRequired =\n this.autoRowHeightSizingActive ||\n this.autoColumnSizeCalculationRequired;\n if (autoSizingRequired) {\n if (this.autoColumnSizingActive) {\n // Override the injected sizes with the maximum width before the\n // calculation table mounts, so its content is measured untruncated\n // (unset again in calculateAutoSizes). When only the row heights are\n // calculated we keep the actual column sizes from the provider.\n this.setAutoSizeColumnSizes(\n this.colSizesForCalculationWithAutoColumnSizes,\n );\n }\n this.calculateSizes = true;\n } else {\n this.emitNewAutoSizes();\n }\n },\n setAutoColumnSizes(autoColumnSizes: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentColumnSizes,\n autoSizesByRow: autoColumnSizes,\n fixedSizes: this.autoColumnSizesOptions.fixedSizes,\n minSize: (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n paddings: this.columnPaddingsHorizontal,\n });\n },\n setAutoRowHeights(autoRowHeights: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentHeightsByColumn,\n autoSizesByRow: autoRowHeights,\n fixedSizes: this.autoRowHeightOptions.fixedHeights,\n minSize: () => MIN_ROW_HEIGHT,\n });\n },\n async calculateAutoSizes() {\n // Wait for the fonts to be loaded before calculating the column sizes based on the rendered table\n await Promise.all([\n document.fonts.load(\"400 1em Roboto\"),\n document.fonts.load(\"700 1em Roboto\"),\n ]);\n\n const bodyComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForBody;\n const headerComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForHeader;\n const bodyComputesRows = this.autoRowHeightSizingActive;\n const computeColumns = this.autoColumnSizeCalculationRequired;\n\n if (computeColumns) {\n this.currentColumnSizes = this.initializeSizesWithMinSize(\n (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n );\n }\n if (bodyComputesRows) {\n this.currentHeightsByColumn = this.initializeSizesWithMinSize(\n () => MIN_ROW_HEIGHT,\n );\n }\n\n if (bodyComputesColumns || bodyComputesRows) {\n const { autoColumnSizes, autoRowHeights } =\n this.calculateAutoSizesBody();\n\n if (bodyComputesRows) {\n this.setAutoRowHeights(autoRowHeights);\n }\n\n if (bodyComputesColumns) {\n this.setAutoColumnSizes(autoColumnSizes);\n }\n }\n\n if (headerComputesColumns) {\n this.calculateAndSetAutoColumnSizesHeader();\n }\n if (computeColumns) {\n this.enforceMaxColSize();\n }\n\n this.calculateSizes = false;\n this.unsetAutoSizeColumnSizes();\n this.emitNewAutoSizes();\n },\n initializeSizesWithMinSize(minSize: (columnId: ColumnId) => number) {\n return this.columnIds.reduce(\n (sizes, columnId) => ({\n ...sizes,\n [columnId]: minSize(columnId),\n }),\n {},\n );\n },\n addFixedAndAutoSizes({\n sizesToUpdate,\n autoSizesByRow,\n fixedSizes,\n minSize,\n paddings = null,\n }: {\n sizesToUpdate: SizeByColumn;\n autoSizesByRow: SizeByColumn[];\n fixedSizes: SizeByColumn;\n minSize: (columnId: ColumnId) => number;\n paddings?: SizeByColumn | null;\n }) {\n Reflect.ownKeys(fixedSizes).forEach((columnId) => {\n if (sizesToUpdate.hasOwnProperty(columnId)) {\n sizesToUpdate[columnId] = Math.max(\n minSize(columnId),\n fixedSizes[columnId] + (paddings?.[columnId] || 0),\n );\n }\n });\n\n autoSizesByRow.forEach((autoSizes) => {\n Reflect.ownKeys(autoSizes).forEach((columnId) => {\n sizesToUpdate[columnId] = Math.max(\n sizesToUpdate[columnId],\n autoSizes[columnId],\n );\n });\n });\n },\n calculateAutoSizesBody() {\n const rowComponents = (\n this.$refs.tableUIForAutoSize as any\n ).getRowComponents();\n\n const { fixedSizes } = this.autoColumnSizesOptions;\n\n const autoColumnSizes: SizeByColumn[] = [];\n const autoRowHeights: SizeByColumn[] = [];\n\n rowComponents.forEach((rowComponent: any) => {\n const sizesByColumn: SizeByColumn = {};\n const heightsByColumn: SizeByColumn = {};\n const cellComponents = rowComponent.getCellComponents();\n this.columnIds.forEach((columnId, columnIndex) => {\n if (!fixedSizes.hasOwnProperty(columnId)) {\n const { width, height } =\n cellComponents[columnIndex].getCellContentDimensions();\n sizesByColumn[columnId] = width;\n heightsByColumn[columnId] = height + ROW_BORDER_BOTTOM_WIDTH;\n }\n });\n autoColumnSizes.push(sizesByColumn);\n autoRowHeights.push(heightsByColumn);\n });\n return { autoColumnSizes, autoRowHeights };\n },\n calculateAndSetAutoColumnSizesHeader() {\n const headerCellSizes = (this.$refs.tableUIForAutoSize as any)\n .getHeaderComponent()\n .getHeaderCellWidths();\n this.columnIds.forEach((columnId, columnIndex) => {\n const headerWidth = headerCellSizes[columnIndex];\n if (this.currentColumnSizes[columnId] < headerWidth) {\n this.currentColumnSizes[columnId] = headerWidth;\n }\n });\n },\n enforceMaxColSize() {\n this.currentColumnSizes = Reflect.ownKeys(this.currentColumnSizes).reduce(\n (enforcedColSizes, columnId) => ({\n ...enforcedColSizes,\n [columnId]: Math.min(\n this.currentColumnSizes[columnId],\n MAX_AUTO_COLUMN_SIZE,\n ),\n }),\n {},\n );\n },\n onUpdateAvailableWidth(newAvailableWidth: number) {\n this.$emit(\"update:available-width\", newAvailableWidth);\n this.setAvailableWidthInitialized();\n },\n getTableUIElement() {\n return (this.$refs.tableUI as any).$el;\n },\n refreshScroller() {\n (this.$refs.tableUI as any)?.refreshScroller();\n },\n clearCellSelection() {\n (this.$refs.tableUI as any)?.clearCellSelection();\n },\n },\n};\n</script>\n\n<template>\n <TableUI\n ref=\"tableUI\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n v-bind=\"$attrs\"\n :data=\"data\"\n :current-selection=\"currentSelection\"\n :current-bottom-selection=\"currentBottomSelection\"\n :columns=\"columns\"\n :additional-header-menu-items\n :col-sort-values=\"colSortValues\"\n :num-rows-above=\"numRowsAbove\"\n :num-rows-below=\"numRowsBelow\"\n :bottom-data=\"bottomData\"\n :row-config=\"rowConfig\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n :table-config=\"tableConfig\"\n :table-state=\"tableState\"\n :page-config=\"pageConfig\"\n :page-state=\"pageState\"\n :action-config=\"actionConfig\"\n :action-state=\"actionState\"\n :sub-menu-config=\"subMenuConfig\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n @update:available-width=\"onUpdateAvailableWidth\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n <TableUI\n v-if=\"mountTableUIForAutoSizeCalculation\"\n ref=\"tableUIForAutoSize\"\n class=\"table-column-size-calculation\"\n :data=\"paginatedDataForAutoColumnSizesCalculation\"\n :current-selection=\"currentSelection\"\n :columns=\"columns\"\n :row-config=\"rowConfig\"\n :table-config=\"tableConfigForAutoSizesCalculation\"\n @vue:mounted=\"calculateAutoSizes\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <!-- The cells of this table are mounted at the maximum column width. Slot content\n that stretches to its cell (e.g. to align text) would then be measured at that\n width, so it gets told that it is being measured and can size itself to its content. -->\n <slot\n :name=\"slotName\"\n v-bind=\"{ ...(slotProps ?? {}), usedForAutoSizeCalculation: true }\"\n />\n </template>\n </TableUI>\n</template>\n\n<style scoped>\n.table-column-size-calculation {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: hidden;\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This component contains the ability to size the columns in the tableUI according to the width of their content by\n * enforcing a maximum size of MAX_AUTO_COLUMN_SIZE. It takes the same props as the TableUI.vue and one additional prop,\n * the options for the calculation. The automatic row height relies on the column sizes and enforces a maximum\n * height given by the auto row height options.\n * To trigger the calculation of the auto sizes, the corresponding trigger method can be called from the parent. The\n * method is automatically called from within this component when:\n * - the component is mounted\n * - one property of the autoColumnSizesOptions changes\n * - one property of the autoRowHeightOptions changes\n * - columns were removed, added, or replaced\n * - the compact mode is toggled\n */\n\nimport type { PropType, Slot } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nimport type { KdsMenuItem } from \"@knime/kds-components\";\nimport { sleep } from \"@knime/utils\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n MAX_AUTO_COLUMN_SIZE,\n MIN_COLUMN_SIZE,\n MIN_ROW_HEIGHT,\n ROW_BORDER_BOTTOM_WIDTH,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig, ColumnId } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\nimport { minSizeOfColumn } from \"../utils/columnHeaderActionButtons\";\n\nimport TableUI from \"./TableUI.vue\";\nimport { useTableReady } from \"./composables/useTableReady\";\nimport { provideAutoSizeColumnSizes } from \"./useColumnSizes\";\n\ntype SizeByColumn = Record<string | symbol, number>;\n\n/**\n * In a lot of cases, the row ids are Row0, Row1, ....\n * With 11 rows taken into account, we respect \"Row10\".\n */\nconst DEFAULT_NUM_ROWS = 11;\n\nexport default {\n components: { TableUI },\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<Array<Array<any>>>, default: () => [] },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /** Stable per-column definitions (forwarded to TableUI). */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n /** Appearance of the table's rows (forwarded to TableUI). */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on (forwarded to TableUI). */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** This object contains all the options necessary to calculate the sizes based on the\n * content. In case only one of calculateForBody/calculateForHeader is true, the emitted object contains auto\n * sizes according to body/header. In case both are true, the maximum of both values is used. For fixedSizes only\n * header sizes are calculated and the body sizes will be increased by the horizontal cell padding.\n */\n autoColumnSizesOptions: {\n type: Object as PropType<{\n calculateForBody: boolean;\n calculateForHeader: boolean;\n fixedSizes: SizeByColumn;\n }>,\n default: () => ({}),\n },\n autoRowHeightOptions: {\n type: Object as PropType<{\n calculate: boolean;\n fixedHeights: SizeByColumn;\n maxHeight: number;\n }>,\n default: () => ({}),\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n autoColumnSizesUpdate: (sizes: SizeByColumn) => true,\n autoRowHeightUpdate: (height: number | null) => true,\n ready: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(_props, { emit }) {\n // The hidden auto-size calculation table renders below the same\n // useColumnSizes provider (mounted by the embedding app) as the visible\n // table, so by default it is injected the actual column sizes — which is\n // what we want when only the row heights are calculated. When the column\n // sizes themselves are calculated, setAutoSizeColumnSizes overrides them\n // with the maximum width while the calculation table is mounted (see\n // triggerCalculationOfAutoSizes and calculateAutoSizes).\n const {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n } = useTableReady({ onReady: () => emit(\"ready\") });\n const { setAutoSizeColumnSizes, unsetAutoSizeColumnSizes } =\n provideAutoSizeColumnSizes();\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n setAutoSizeColumnSizes,\n unsetAutoSizeColumnSizes,\n };\n },\n data() {\n return {\n currentColumnSizes: {} as SizeByColumn,\n currentHeightsByColumn: {} as SizeByColumn,\n calculateSizes: false,\n useSavedColumnSizes: false,\n disableRowHeightTransition: true,\n };\n },\n computed: {\n /**\n * Needed for a combined watcher for changes in case we change both\n * option parts at the same time.\n */\n combinedOptions() {\n return {\n columns: this.autoColumnSizesOptions,\n rows: this.autoRowHeightOptions,\n };\n },\n mountTableUIForAutoSizeCalculation() {\n return this.data !== null && this.calculateSizes;\n },\n columnIds() {\n return getPropertiesFromColumns(this.columns, \"id\");\n },\n /**\n * The width each column needs at the very least, i.e. the one at which the\n * action buttons of its header still fit (see {@link minSizeOfColumn}).\n */\n minColumnSizes(): Record<ColumnId, number> {\n return this.columns.reduce(\n (minSizes, column, index) => {\n minSizes[column.id] = minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n });\n return minSizes;\n },\n {} as Record<ColumnId, number>,\n );\n },\n currentColumnsWithAutoSize() {\n return new Set<ColumnId>([\n ...Reflect.ownKeys(this.currentColumnSizes),\n ...Reflect.ownKeys(this.currentHeightsByColumn),\n ]);\n },\n removedColumnIds() {\n const removedColumnIds = new Set<ColumnId>();\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (!this.columnIds.includes(columnId)) {\n removedColumnIds.add(columnId);\n }\n });\n return removedColumnIds;\n },\n addedColumnIds() {\n const addedColumnIds = new Set<ColumnId>();\n this.columnIds.forEach((columnId) => {\n if (!this.currentColumnsWithAutoSize.has(columnId)) {\n addedColumnIds.add(columnId);\n }\n });\n return addedColumnIds;\n },\n columnsWereOnlyRemoved() {\n return this.addedColumnIds.size === 0 && this.removedColumnIds.size > 0;\n },\n paginatedDataForAutoColumnSizesCalculation() {\n return [this.data.flat().slice(0, DEFAULT_NUM_ROWS)];\n },\n colSizesForCalculationWithAutoColumnSizes() {\n return this.columnIds.map(() => MAX_AUTO_COLUMN_SIZE);\n },\n tableConfigForAutoSizesCalculation() {\n return {\n ...this.tableConfig,\n forceRenderAll: true,\n };\n },\n autoColumnSizingActive() {\n return (\n this.autoColumnSizesOptions.calculateForBody ||\n this.autoColumnSizesOptions.calculateForHeader\n );\n },\n autoRowHeightSizingActive() {\n return this.autoRowHeightOptions.calculate;\n },\n autoColumnSizeCalculationRequired() {\n return this.autoColumnSizingActive && !this.useSavedColumnSizes;\n },\n columnPaddingsHorizontal() {\n return this.columnIds.reduce(\n (paddings, columnId) => {\n paddings[columnId] = CELL_PADDING_HORIZONTAL * 2;\n return paddings;\n },\n {} as Record<string | symbol | number, number>,\n );\n },\n currentRowHeight() {\n const rowHeights = Reflect.ownKeys(this.currentHeightsByColumn).map(\n (columnId) => this.currentHeightsByColumn[columnId],\n );\n return rowHeights.length === 0\n ? null\n : Math.min(\n Math.max(...rowHeights),\n this.autoRowHeightOptions.maxHeight,\n );\n },\n forwardedSlotEntries(): Array<[string, Slot]> {\n return Object.entries(this.$slots) as Array<[string, Slot]>;\n },\n },\n watch: {\n combinedOptions: {\n handler(newVal, oldVal) {\n const columnsIsEqual = isEqual(newVal.columns, oldVal.columns);\n const rowsIsEqual = isEqual(newVal.rows, oldVal.rows);\n if (!rowsIsEqual && columnsIsEqual) {\n this.useSavedColumnSizes = true;\n }\n if (!rowsIsEqual || !columnsIsEqual) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n deep: true,\n },\n columnIds(newIds, oldIds) {\n if (\n newIds.length !== oldIds.length ||\n !newIds.every((el: any, index: number) => el === oldIds[index])\n ) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n \"rowConfig.compactMode\": {\n handler() {\n if (this.autoRowHeightOptions.calculate) {\n this.useSavedColumnSizes = true;\n this.triggerCalculationOfAutoSizes();\n }\n },\n },\n },\n mounted() {\n if (this.autoRowHeightSizingActive) {\n const unwatchRowHeight = this.$watch(\n () => this.rowConfig.rowHeight,\n async () => {\n // wait until the DOM changes regarding the newRowHeight are completely rendered and enable the transition\n // otherwise, a table with auto row height calculation performs row height animations when being first mounted\n await sleep(0);\n this.disableRowHeightTransition = false;\n unwatchRowHeight();\n },\n );\n } else {\n this.disableRowHeightTransition = false;\n }\n this.triggerCalculationOfAutoSizes();\n },\n methods: {\n emitNewAutoSizes() {\n this.$emit(\"autoColumnSizesUpdate\", { ...this.currentColumnSizes });\n this.$emit(\"autoRowHeightUpdate\", this.currentRowHeight);\n this.useSavedColumnSizes = false;\n this.setAutoSizesInitialized();\n },\n triggerCalculationOfAutoSizes() {\n if (this.autoColumnSizingActive && this.columnsWereOnlyRemoved) {\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (this.removedColumnIds.has(columnId)) {\n delete this.currentColumnSizes[columnId];\n delete this.currentHeightsByColumn[columnId];\n }\n });\n this.emitNewAutoSizes();\n return;\n }\n\n if (!this.autoColumnSizingActive) {\n this.currentColumnSizes = {};\n }\n if (!this.autoRowHeightSizingActive) {\n this.currentHeightsByColumn = {};\n }\n\n const autoSizingRequired =\n this.autoRowHeightSizingActive ||\n this.autoColumnSizeCalculationRequired;\n if (autoSizingRequired) {\n if (this.autoColumnSizingActive) {\n // Override the injected sizes with the maximum width before the\n // calculation table mounts, so its content is measured untruncated\n // (unset again in calculateAutoSizes). When only the row heights are\n // calculated we keep the actual column sizes from the provider.\n this.setAutoSizeColumnSizes(\n this.colSizesForCalculationWithAutoColumnSizes,\n );\n }\n this.calculateSizes = true;\n } else {\n this.emitNewAutoSizes();\n }\n },\n setAutoColumnSizes(autoColumnSizes: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentColumnSizes,\n autoSizesByRow: autoColumnSizes,\n fixedSizes: this.autoColumnSizesOptions.fixedSizes,\n minSize: (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n paddings: this.columnPaddingsHorizontal,\n });\n },\n setAutoRowHeights(autoRowHeights: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentHeightsByColumn,\n autoSizesByRow: autoRowHeights,\n fixedSizes: this.autoRowHeightOptions.fixedHeights,\n minSize: () => MIN_ROW_HEIGHT,\n });\n },\n async calculateAutoSizes() {\n // Wait for the fonts to be loaded before calculating the column sizes based on the rendered table\n await Promise.all([\n document.fonts.load(\"400 1em Roboto\"),\n document.fonts.load(\"700 1em Roboto\"),\n ]);\n\n const bodyComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForBody;\n const headerComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForHeader;\n const bodyComputesRows = this.autoRowHeightSizingActive;\n const computeColumns = this.autoColumnSizeCalculationRequired;\n\n if (computeColumns) {\n this.currentColumnSizes = this.initializeSizesWithMinSize(\n (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n );\n }\n if (bodyComputesRows) {\n this.currentHeightsByColumn = this.initializeSizesWithMinSize(\n () => MIN_ROW_HEIGHT,\n );\n }\n\n if (bodyComputesColumns || bodyComputesRows) {\n const { autoColumnSizes, autoRowHeights } =\n this.calculateAutoSizesBody();\n\n if (bodyComputesRows) {\n this.setAutoRowHeights(autoRowHeights);\n }\n\n if (bodyComputesColumns) {\n this.setAutoColumnSizes(autoColumnSizes);\n }\n }\n\n if (headerComputesColumns) {\n this.calculateAndSetAutoColumnSizesHeader();\n }\n if (computeColumns) {\n this.enforceMaxColSize();\n }\n\n this.calculateSizes = false;\n this.unsetAutoSizeColumnSizes();\n this.emitNewAutoSizes();\n },\n initializeSizesWithMinSize(minSize: (columnId: ColumnId) => number) {\n return this.columnIds.reduce(\n (sizes, columnId) => ({\n ...sizes,\n [columnId]: minSize(columnId),\n }),\n {},\n );\n },\n addFixedAndAutoSizes({\n sizesToUpdate,\n autoSizesByRow,\n fixedSizes,\n minSize,\n paddings = null,\n }: {\n sizesToUpdate: SizeByColumn;\n autoSizesByRow: SizeByColumn[];\n fixedSizes: SizeByColumn;\n minSize: (columnId: ColumnId) => number;\n paddings?: SizeByColumn | null;\n }) {\n Reflect.ownKeys(fixedSizes).forEach((columnId) => {\n if (sizesToUpdate.hasOwnProperty(columnId)) {\n sizesToUpdate[columnId] = Math.max(\n minSize(columnId),\n fixedSizes[columnId] + (paddings?.[columnId] || 0),\n );\n }\n });\n\n autoSizesByRow.forEach((autoSizes) => {\n Reflect.ownKeys(autoSizes).forEach((columnId) => {\n sizesToUpdate[columnId] = Math.max(\n sizesToUpdate[columnId],\n autoSizes[columnId],\n );\n });\n });\n },\n calculateAutoSizesBody() {\n const rowComponents = (\n this.$refs.tableUIForAutoSize as any\n ).getRowComponents();\n\n const { fixedSizes } = this.autoColumnSizesOptions;\n\n const autoColumnSizes: SizeByColumn[] = [];\n const autoRowHeights: SizeByColumn[] = [];\n\n rowComponents.forEach((rowComponent: any) => {\n const sizesByColumn: SizeByColumn = {};\n const heightsByColumn: SizeByColumn = {};\n const cellComponents = rowComponent.getCellComponents();\n this.columnIds.forEach((columnId, columnIndex) => {\n if (!fixedSizes.hasOwnProperty(columnId)) {\n const { width, height } =\n cellComponents[columnIndex].getCellContentDimensions();\n sizesByColumn[columnId] = width;\n heightsByColumn[columnId] = height + ROW_BORDER_BOTTOM_WIDTH;\n }\n });\n autoColumnSizes.push(sizesByColumn);\n autoRowHeights.push(heightsByColumn);\n });\n return { autoColumnSizes, autoRowHeights };\n },\n calculateAndSetAutoColumnSizesHeader() {\n const headerCellSizes = (this.$refs.tableUIForAutoSize as any)\n .getHeaderComponent()\n .getHeaderCellWidths();\n this.columnIds.forEach((columnId, columnIndex) => {\n const headerWidth = headerCellSizes[columnIndex];\n if (this.currentColumnSizes[columnId] < headerWidth) {\n this.currentColumnSizes[columnId] = headerWidth;\n }\n });\n },\n enforceMaxColSize() {\n this.currentColumnSizes = Reflect.ownKeys(this.currentColumnSizes).reduce(\n (enforcedColSizes, columnId) => ({\n ...enforcedColSizes,\n [columnId]: Math.min(\n this.currentColumnSizes[columnId],\n MAX_AUTO_COLUMN_SIZE,\n ),\n }),\n {},\n );\n },\n onUpdateAvailableWidth(newAvailableWidth: number) {\n this.$emit(\"update:available-width\", newAvailableWidth);\n this.setAvailableWidthInitialized();\n },\n getTableUIElement() {\n return (this.$refs.tableUI as any).$el;\n },\n refreshScroller() {\n (this.$refs.tableUI as any)?.refreshScroller();\n },\n clearCellSelection() {\n (this.$refs.tableUI as any)?.clearCellSelection();\n },\n },\n};\n</script>\n\n<template>\n <TableUI\n ref=\"tableUI\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n v-bind=\"$attrs\"\n :data=\"data\"\n :current-selection=\"currentSelection\"\n :current-bottom-selection=\"currentBottomSelection\"\n :columns=\"columns\"\n :additional-header-menu-items\n :col-sort-values=\"colSortValues\"\n :num-rows-above=\"numRowsAbove\"\n :num-rows-below=\"numRowsBelow\"\n :bottom-data=\"bottomData\"\n :row-config=\"rowConfig\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n :table-config=\"tableConfig\"\n :table-state=\"tableState\"\n :page-config=\"pageConfig\"\n :page-state=\"pageState\"\n :action-config=\"actionConfig\"\n :action-state=\"actionState\"\n :sub-menu-config=\"subMenuConfig\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n @update:available-width=\"onUpdateAvailableWidth\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n <TableUI\n v-if=\"mountTableUIForAutoSizeCalculation\"\n ref=\"tableUIForAutoSize\"\n class=\"table-column-size-calculation\"\n :data=\"paginatedDataForAutoColumnSizesCalculation\"\n :current-selection=\"currentSelection\"\n :columns=\"columns\"\n :row-config=\"rowConfig\"\n :table-config=\"tableConfigForAutoSizesCalculation\"\n @vue:mounted=\"calculateAutoSizes\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <!-- The cells of this table are mounted at the maximum column width. Slot content\n that stretches to its cell (e.g. to align text) would then be measured at that\n width, so it gets told that it is being measured and can size itself to its content. -->\n <slot\n :name=\"slotName\"\n v-bind=\"{ ...(slotProps ?? {}), usedForAutoSizeCalculation: true }\"\n />\n </template>\n </TableUI>\n</template>\n\n<style scoped>\n.table-column-size-calculation {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: hidden;\n}\n</style>\n"],"x_google_ignoreList":[7,8,29,35],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAa,kBAAkB;AAE/B,IAAa,cAAc;CACzB,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,QAAQ;CACR,SAAS;CACT,OAAO;CACP,QAAQ;CACR,OAAO;AACT;AAMA,IAAa,iBAAiB;EAC3B,YAAY,UAAU;EACrB,WAAW;EACX,YAAY;CACd;EACC,YAAY,SAAS;EACpB,WAAW;EACX,YAAY;CACd;EACC,YAAY,WAAW;EACtB,WAAW;EACX,YAAY;CACd;EACC,YAAY,WAAW;EACtB,WAAW;EACX,YAAY;CACd;EACC,YAAY,SAAS;EACpB,WAAW;EACX,YAAY;CACd;EACC,YAAY,UAAU;EACrB,WAAW;EACX,YAAY;CACd;EACC,YAAY,QAAQ;EACnB,WAAW;EACX,YAAY;CACd;EACC,YAAY,QAAQ;EACnB,WAAW;EACX,YAAY;CACd;EACC,YAAY,SAAS;EACpB,WAAW;EACX,YAAY;CACd;CACA,SAAS;EACP,WAAW;EACX,YAAY;CACd;AACF;;;;;;;ACvDA,IAAa,SAAS;CAClB,QAAQ;EACJ,aAAa;GACT,OAAO;IACH,OAAO;KAAE,GAAG;KAAG,GAAG;KAAG,GAAG;KAAM,GAAG;IAAE;IACnC,MAAM;KAAE,GAAG;KAAG,GAAG;KAAG,GAAG;KAAM,GAAG;IAAE;GACtC;GACA,OAAO;IAAE,OAAO;IAAG,MAAM;GAAK;GAC9B,OAAO;GACP,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AAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;EACJ;EACA,OAAO;GACH,UAAU;IACN,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;EACJ;CACJ;CACA,MAAM;EACF,QAAQ;GACJ,OAAO;GACP,MAAM;GACN,KAA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MAAM;CACnC,OAAO,WAAW,MAAM;EACvB,MAAM,OAAO,yBAAyB,QAAQ,IAAI;EAClD,IAAI,MAAM;GACT,IAAI,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;GACrC,IAAI,OAAO,KAAK,UAAU,YAAY,OAAO,QAAQ,KAAK,KAAK;EAChE;EACA,SAAS,eAAe,MAAM;CAC/B;CACA,SAAS,gBAAgB;EACxB,OAAO;CACR;CACA,OAAO;AACR;;;;;;;;;;;;AAYA,SAAS,eAAe,QAAQ,MAAM;CACrC,OAAO,WAAW,MAAM;EACvB,MAAM,OAAO,yBAAyB,QAAQ,IAAI;EAClD,IAAI,MAAM,OAAO,KAAK,MAAM,QAAQ,KAAK,GAAG,IAAI;EAChD,SAAS,eAAe,MAAM;CAC/B;CACA,OAAO;AACR;AACA,SAAS,QAAQ,OAAO;CACvB,IAAI;EACH,WAAW,OAAO,EAAE;EACpB,OAAO;CACR,SAAS,SAAS;EACjB,OAAO;CACR;AACD;AACA,IAAM,SAAS,OAAO;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,QAAQ,OAAO;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,aAAa,OAAO;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,gBAAgB,OAAO;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,WAAW,OAAO;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,mBAAmB,OAAO;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,OAAO,OAAO,CAAC,OAAO,CAAC;AAC7B,IAAM,OAAO,OAAO;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,MAAM,OAAO;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,SAAS,OAA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AA,IAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["W","E","s","g","V","D","h","y","K","R","$slots","$slots","$emit","$emit","$el"],"sources":["../src/config/table.config.ts","../../styles/dist/tokens/ts/border.js","../../styles/dist/tokens/ts/dimension.js","../../styles/dist/tokens/ts/spacing.js","../src/constants.ts","../src/types/BackgroundColor.ts","../src/utils/index.ts","../../../node_modules/.pnpm/@knime+vue-headless-virtual-scroller@0.2.0_vue@3.5.42_typescript@6.0.3_/node_modules/@knime/vue-headless-virtual-scroller/dist/vue-headless-virtual-scrolling.js","../../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs","../../utils/dist/index.js","../src/components/composables/useDataValueViews.ts","../src/components/composables/useStartEditingKeydown.ts","../src/components/TableBodyNavigatable.vue","../src/components/TableBodyNavigatable.vue","../src/components/composables/useHorizontalIndicesAndStyles.ts","../src/components/useColumnSizes.ts","../src/components/ui/EmptyRow.vue","../src/components/ui/EmptyRow.vue","../src/components/ui/PlaceholderRow.vue","../src/components/ui/PlaceholderRow.vue","../src/components/VirtualRow.vue","../src/components/VirtualRow.vue","../src/components/composables/useBodyWidth.ts","../src/components/composables/useCloseSubMenusOnScroll.ts","../src/components/composables/useOverflowStyles.ts","../src/components/composables/useCommonScrollContainerProps.ts","../src/components/composables/useResizeScrollSpacer.ts","../src/components/TableCoreVirtual.vue","../src/components/TableCoreVirtual.vue","../../../node_modules/.pnpm/raf-throttle@2.0.6/node_modules/raf-throttle/lib/rafThrottle.js","../src/components/composables/useAvailableWidth.ts","../src/components/TableCore.vue","../src/components/TableCore.vue","../src/components/composables/useBoolean.ts","../src/components/composables/useCellCopyPaste.ts","../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../src/components/composables/useCellSelection.ts","../src/components/composables/useEditCellKeydown.ts","../src/components/composables/useVisibleAfterAvailableWidth.ts","../src/components/control/actionbar/PopoverContainer.vue","../src/components/control/actionbar/useButtonPopoverInteraction.ts","../src/components/control/actionbar/SortControl.vue","../src/components/control/actionbar/SortControl.vue","../src/components/control/TableActionBar.vue","../src/components/control/TableActionBar.vue","../src/utils/columnHeaderActionButtons.ts","../src/components/layout/useAutoScrollOnRightEdge.ts","../src/components/layout/HeaderCell.vue","../src/components/layout/HeaderCell.vue","../src/components/layout/Header.vue","../src/components/layout/Header.vue","../src/components/layout/NewRowButton.vue","../src/components/layout/NewRowButton.vue","../src/components/ui/CellExpandButton.vue","../src/components/ui/CellExpandButton.vue","../src/components/layout/CellRenderer.vue","../src/components/layout/CellRenderer.vue","../src/components/layout/Cell.vue","../src/components/layout/Cell.vue","../src/components/layout/Row.vue","../src/components/layout/Row.vue","../src/components/ui/CellSelectionOverlay.vue","../src/components/ui/CellSelectionOverlay.vue","../src/components/TableUI.vue","../src/components/TableUI.vue","../src/components/composables/useTableReady.ts","../src/components/TableUIWithAutoSizeCalculation.vue","../src/components/TableUIWithAutoSizeCalculation.vue"],"sourcesContent":["export const defaultPageSize = 10;\n\nexport const columnTypes = {\n Nominal: \"Nominal\" as const,\n String: \"String\" as const,\n DateTime: \"DateTime\" as const,\n Duration: \"Duration\" as const,\n Number: \"Number\" as const,\n Boolean: \"Boolean\" as const,\n Array: \"Array\" as const,\n Object: \"Object\" as const,\n Image: \"Image\" as const,\n};\n\ntype ValueOf<T> = T[keyof T];\n\nexport type ColumnType = ValueOf<typeof columnTypes>;\n\nexport const columnSortText = {\n [columnTypes.Nominal]: {\n ascending: \"A to Z\",\n descending: \"Z to A\",\n },\n [columnTypes.String]: {\n ascending: \"A to Z\",\n descending: \"Z to A\",\n },\n [columnTypes.DateTime]: {\n ascending: \"Oldest first\",\n descending: \"Newest first\",\n },\n [columnTypes.Duration]: {\n ascending: \"Shortest first\",\n descending: \"Longest first\",\n },\n [columnTypes.Number]: {\n ascending: \"Smallest first\",\n descending: \"Largest first\",\n },\n [columnTypes.Boolean]: {\n ascending: \"False first\",\n descending: \"True first\",\n },\n [columnTypes.Image]: {\n ascending: \"By filename A to Z\",\n descending: \"By filename Z to A\",\n },\n [columnTypes.Array]: {\n ascending: \"Fewest items first\",\n descending: \"Most items first\",\n },\n [columnTypes.Object]: {\n ascending: \"Fewest keys first\",\n descending: \"Most keys first\",\n },\n default: {\n ascending: \"Ascending\",\n descending: \"Descending\",\n },\n} as Record<ColumnType | \"default\", { ascending: string; descending: string }>;\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const border = {\n action: {\n transparent: {\n color: {\n light: { h: 0, s: 0, l: 11.4, a: 0 },\n dark: { h: 0, s: 0, l: 11.4, a: 0 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(0 0% 11.4% / 0)\",\n variable: \"var(--kds-border-action-transparent)\",\n },\n },\n default: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-action-default)\",\n },\n },\n disabled: {\n color: {\n light: { h: 0, s: 0, l: 72.5, a: 1 },\n dark: { h: 0, s: 0, l: 48.2, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0, 0%, 72.5%), hsl(0, 0%, 48.2%))\",\n variable: \"var(--kds-border-action-disabled)\",\n },\n },\n focused: {\n color: {\n light: { h: 209.4, s: 57.3, l: 49.6, a: 1 },\n dark: { h: 213.6, s: 91.6, l: 76.7, a: 1 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(209.4, 57.3%, 49.6%), hsl(213.6, 91.6%, 76.7%))\",\n variable: \"var(--kds-border-action-focused)\",\n },\n },\n selected: {\n color: {\n light: { h: 171.8, s: 27, l: 47.8, a: 1 },\n dark: { h: 168, s: 46.7, l: 85.3, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(171.8, 27%, 47.8%), hsl(168, 46.7%, 85.3%))\",\n variable: \"var(--kds-border-action-selected)\",\n },\n },\n \"selected-accent\": {\n color: {\n light: { h: 209.4, s: 57.3, l: 49.6, a: 1 },\n dark: { h: 213.6, s: 91.6, l: 76.7, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(209.4, 57.3%, 49.6%), hsl(213.6, 91.6%, 76.7%))\",\n variable: \"var(--kds-border-action-selected-accent)\",\n },\n },\n error: {\n color: {\n light: { h: 348.8, s: 90.9, l: 34.5, a: 1 },\n dark: { h: 3.5, s: 100, l: 79.6, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(348.8, 90.9%, 34.5%), hsl(3.5, 100%, 79.6%))\",\n variable: \"var(--kds-border-action-error)\",\n },\n },\n primary: {\n color: {\n light: { h: 176.7, s: 82, l: 17.5, a: 1 },\n dark: { h: 176.7, s: 82, l: 17.5, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(176.7, 82%, 17.5%)\",\n variable: \"var(--kds-border-action-primary)\",\n },\n },\n input: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-action-input)\",\n },\n },\n },\n base: {\n default: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-base-default)\",\n },\n },\n muted: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.2 },\n dark: { h: 0, s: 0, l: 99, a: 0.2 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.2), hsl(0 0% 99% / 0.2))\",\n variable: \"var(--kds-border-base-muted)\",\n },\n },\n subtle: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.1 },\n dark: { h: 0, s: 0, l: 99, a: 0.1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.1), hsl(0 0% 99% / 0.1))\",\n variable: \"var(--kds-border-base-subtle)\",\n },\n },\n brand: {\n color: {\n light: { h: 50.8, s: 100, l: 50, a: 1 },\n dark: { h: 50.8, s: 100, l: 50, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(50.8, 100%, 50%)\",\n variable: \"var(--kds-border-base-brand)\",\n },\n },\n danger: {\n color: {\n light: { h: 3.4, s: 100, l: 86.1, a: 1 },\n dark: { h: 348, s: 94.3, l: 20.8, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(3.4, 100%, 86.1%), hsl(348, 94.3%, 20.8%))\",\n variable: \"var(--kds-border-base-danger)\",\n },\n },\n warning: {\n color: {\n light: { h: 30.8, s: 79.3, l: 73.5, a: 1 },\n dark: { h: 13.1, s: 66.1, l: 23.1, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(30.8, 79.3%, 73.5%), hsl(13.1, 66.1%, 23.1%))\",\n variable: \"var(--kds-border-base-warning)\",\n },\n },\n success: {\n color: {\n light: { h: 112, s: 56.5, l: 71.2, a: 1 },\n dark: { h: 123.7, s: 46.7, l: 20.6, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(112, 56.5%, 71.2%), hsl(123.7, 46.7%, 20.6%))\",\n variable: \"var(--kds-border-base-success)\",\n },\n },\n info: {\n color: {\n light: { h: 214.5, s: 100, l: 84.3, a: 1 },\n dark: { h: 210, s: 50, l: 27.5, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(214.5, 100%, 84.3%), hsl(210, 50%, 27.5%))\",\n variable: \"var(--kds-border-base-info)\",\n },\n },\n },\n \"node-status\": {\n empty: {\n color: {\n light: { h: 0, s: 0, l: 90.2, a: 1 },\n dark: { h: 0, s: 0, l: 32.2, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0, 0%, 90.2%), hsl(0, 0%, 32.2%))\",\n variable: \"var(--kds-border-node-status-empty)\",\n },\n },\n error: {\n color: {\n light: { h: 348, s: 94.3, l: 20.8, a: 1 },\n dark: { h: 2.6, s: 100, l: 72.4, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(348, 94.3%, 20.8%), hsl(2.6, 100%, 72.4%))\",\n variable: \"var(--kds-border-node-status-error)\",\n },\n },\n warning: {\n color: {\n light: { h: 19, s: 63.1, l: 38.2, a: 1 },\n dark: { h: 49.1, s: 99.1, l: 43.7, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(19, 63.1%, 38.2%), hsl(49.1, 99.1%, 43.7%))\",\n variable: \"var(--kds-border-node-status-warning)\",\n },\n },\n success: {\n color: {\n light: { h: 116.1, s: 46.6, l: 25.7, a: 1 },\n dark: { h: 106.5, s: 42.6, l: 54.9, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(116.1, 46.6%, 25.7%), hsl(106.5, 42.6%, 54.9%))\",\n variable: \"var(--kds-border-node-status-success)\",\n },\n },\n },\n ResizeHandle: {\n initial: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.4 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.4))\",\n variable: \"var(--kds-border-resize-handle-initial)\",\n },\n },\n hover: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.64 },\n dark: { h: 0, s: 0, l: 99, a: 0.58 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.64), hsl(0 0% 99% / 0.58))\",\n variable: \"var(--kds-border-resize-handle-hover)\",\n },\n },\n active: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.74 },\n dark: { h: 0, s: 0, l: 99, a: 0.68 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.74), hsl(0 0% 99% / 0.68))\",\n variable: \"var(--kds-border-resize-handle-active)\",\n },\n },\n },\n ColorPickerHandle: {\n initial: {\n color: {\n light: { h: 0, s: 0, l: 99, a: 1 },\n dark: { h: 0, s: 0, l: 99, a: 1 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid hsl(0, 0%, 99%)\",\n variable: \"var(--kds-border-color-picker-handle-initial)\",\n },\n },\n },\n};\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const dimension = {\n component: {\n height: {\n \"0.125x\": {\n value: 2,\n unit: \"px\",\n css: {\n value: \"2px\",\n variable: \"var(--kds-dimension-component-height-0-125x)\",\n },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-dimension-component-height-0-25x)\",\n },\n },\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: {\n value: \"8px\",\n variable: \"var(--kds-dimension-component-height-0-5x)\",\n },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: {\n value: \"12px\",\n variable: \"var(--kds-dimension-component-height-0-75x)\",\n },\n },\n \"0.88x\": {\n value: 14,\n unit: \"px\",\n css: {\n value: \"14px\",\n variable: \"var(--kds-dimension-component-height-0-88x)\",\n },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: {\n value: \"16px\",\n variable: \"var(--kds-dimension-component-height-1x)\",\n },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: {\n value: \"20px\",\n variable: \"var(--kds-dimension-component-height-1-25x)\",\n },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: {\n value: \"24px\",\n variable: \"var(--kds-dimension-component-height-1-5x)\",\n },\n },\n \"1.75x\": {\n value: 28,\n unit: \"px\",\n css: {\n value: \"28px\",\n variable: \"var(--kds-dimension-component-height-1-75x)\",\n },\n },\n \"2.25x\": {\n value: 36,\n unit: \"px\",\n css: {\n value: \"36px\",\n variable: \"var(--kds-dimension-component-height-2-25x)\",\n },\n },\n \"2.75x\": {\n value: 44,\n unit: \"px\",\n css: {\n value: \"44px\",\n variable: \"var(--kds-dimension-component-height-2-75x)\",\n },\n },\n \"2.5x\": {\n value: 40,\n unit: \"px\",\n css: {\n value: \"40px\",\n variable: \"var(--kds-dimension-component-height-2-5x)\",\n },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: {\n value: \"64px\",\n variable: \"var(--kds-dimension-component-height-4x)\",\n },\n },\n \"5x\": {\n value: 80,\n unit: \"px\",\n css: {\n value: \"80px\",\n variable: \"var(--kds-dimension-component-height-5x)\",\n },\n },\n \"12x\": {\n value: 192,\n unit: \"px\",\n css: {\n value: \"192px\",\n variable: \"var(--kds-dimension-component-height-12x)\",\n },\n },\n \"12.5x\": {\n value: 200,\n unit: \"px\",\n css: {\n value: \"200px\",\n variable: \"var(--kds-dimension-component-height-12-5x)\",\n },\n },\n \"20x\": {\n value: 320,\n unit: \"px\",\n css: {\n value: \"320px\",\n variable: \"var(--kds-dimension-component-height-20x)\",\n },\n },\n \"25x\": {\n value: 400,\n unit: \"px\",\n css: {\n value: \"400px\",\n variable: \"var(--kds-dimension-component-height-25x)\",\n },\n },\n \"45x\": {\n value: 720,\n unit: \"px\",\n css: {\n value: \"720px\",\n variable: \"var(--kds-dimension-component-height-45x)\",\n },\n },\n },\n width: {\n \"0.125x\": {\n value: 2,\n unit: \"px\",\n css: {\n value: \"2px\",\n variable: \"var(--kds-dimension-component-width-0-125x)\",\n },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-dimension-component-width-0-25x)\",\n },\n },\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: {\n value: \"8px\",\n variable: \"var(--kds-dimension-component-width-0-5x)\",\n },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: {\n value: \"12px\",\n variable: \"var(--kds-dimension-component-width-0-75x)\",\n },\n },\n \"0.88x\": {\n value: 14,\n unit: \"px\",\n css: {\n value: \"14px\",\n variable: \"var(--kds-dimension-component-width-0-88x)\",\n },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: {\n value: \"16px\",\n variable: \"var(--kds-dimension-component-width-1x)\",\n },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: {\n value: \"20px\",\n variable: \"var(--kds-dimension-component-width-1-25x)\",\n },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: {\n value: \"24px\",\n variable: \"var(--kds-dimension-component-width-1-5x)\",\n },\n },\n \"1.75x\": {\n value: 28,\n unit: \"px\",\n css: {\n value: \"28px\",\n variable: \"var(--kds-dimension-component-width-1-75x)\",\n },\n },\n \"2x\": {\n value: 32,\n unit: \"px\",\n css: {\n value: \"32px\",\n variable: \"var(--kds-dimension-component-width-2x)\",\n },\n },\n \"2.25x\": {\n value: 36,\n unit: \"px\",\n css: {\n value: \"36px\",\n variable: \"var(--kds-dimension-component-width-2-25x)\",\n },\n },\n \"2.75x\": {\n value: 44,\n unit: \"px\",\n css: {\n value: \"44px\",\n variable: \"var(--kds-dimension-component-width-2-75x)\",\n },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: {\n value: \"64px\",\n variable: \"var(--kds-dimension-component-width-4x)\",\n },\n },\n \"6x\": {\n value: 96,\n unit: \"px\",\n css: {\n value: \"96px\",\n variable: \"var(--kds-dimension-component-width-6x)\",\n },\n },\n \"8x\": {\n value: 128,\n unit: \"px\",\n css: {\n value: \"128px\",\n variable: \"var(--kds-dimension-component-width-8x)\",\n },\n },\n \"12x\": {\n value: 192,\n unit: \"px\",\n css: {\n value: \"192px\",\n variable: \"var(--kds-dimension-component-width-12x)\",\n },\n },\n \"12.5x\": {\n value: 200,\n unit: \"px\",\n css: {\n value: \"200px\",\n variable: \"var(--kds-dimension-component-width-12-5x)\",\n },\n },\n \"16x\": {\n value: 256,\n unit: \"px\",\n css: {\n value: \"256px\",\n variable: \"var(--kds-dimension-component-width-16x)\",\n },\n },\n \"17.5x\": {\n value: 280,\n unit: \"px\",\n css: {\n value: \"280px\",\n variable: \"var(--kds-dimension-component-width-17-5x)\",\n },\n },\n \"20x\": {\n value: 320,\n unit: \"px\",\n css: {\n value: \"320px\",\n variable: \"var(--kds-dimension-component-width-20x)\",\n },\n },\n \"25x\": {\n value: 400,\n unit: \"px\",\n css: {\n value: \"400px\",\n variable: \"var(--kds-dimension-component-width-25x)\",\n },\n },\n \"32x\": {\n value: 512,\n unit: \"px\",\n css: {\n value: \"512px\",\n variable: \"var(--kds-dimension-component-width-32x)\",\n },\n },\n \"35x\": {\n value: 560,\n unit: \"px\",\n css: {\n value: \"560px\",\n variable: \"var(--kds-dimension-component-width-35x)\",\n },\n },\n \"45x\": {\n value: 720,\n unit: \"px\",\n css: {\n value: \"720px\",\n variable: \"var(--kds-dimension-component-width-45x)\",\n },\n },\n \"52.5x\": {\n value: 840,\n unit: \"px\",\n css: {\n value: \"840px\",\n variable: \"var(--kds-dimension-component-width-52-5x)\",\n },\n },\n \"61x\": {\n value: 976,\n unit: \"px\",\n css: {\n value: \"976px\",\n variable: \"var(--kds-dimension-component-width-61x)\",\n },\n },\n },\n },\n icon: {\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: { value: \"8px\", variable: \"var(--kds-dimension-icon-0-5x)\" },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: { value: \"12px\", variable: \"var(--kds-dimension-icon-0-75x)\" },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: { value: \"16px\", variable: \"var(--kds-dimension-icon-1x)\" },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: { value: \"20px\", variable: \"var(--kds-dimension-icon-1-25x)\" },\n },\n },\n chart: {\n \"line-width\": {\n value: 1.5,\n unit: \"px\",\n css: {\n value: \"1.5px\",\n variable: \"var(--kds-dimension-chart-line-width)\",\n },\n },\n \"segment-gap\": {\n value: 0.75,\n unit: \"px\",\n css: {\n value: \"0.75px\",\n variable: \"var(--kds-dimension-chart-segment-gap)\",\n },\n },\n },\n};\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const spacing = {\n container: {\n negative: {\n \"0.25x\": {\n value: -4,\n unit: \"px\",\n css: {\n value: \"-4px\",\n variable: \"var(--kds-spacing-container-negative-0-25x)\",\n },\n },\n \"0.375x\": {\n value: -6,\n unit: \"px\",\n css: {\n value: \"-6px\",\n variable: \"var(--kds-spacing-container-negative-0-375x)\",\n },\n },\n \"0.5x\": {\n value: -8,\n unit: \"px\",\n css: {\n value: \"-8px\",\n variable: \"var(--kds-spacing-container-negative-0-5x)\",\n },\n },\n },\n none: {\n value: 0,\n unit: \"px\",\n css: { value: \"0\", variable: \"var(--kds-spacing-container-none)\" },\n },\n \"0.10x\": {\n value: 1,\n unit: \"px\",\n css: { value: \"1px\", variable: \"var(--kds-spacing-container-0-10x)\" },\n },\n \"0.12x\": {\n value: 2,\n unit: \"px\",\n css: { value: \"2px\", variable: \"var(--kds-spacing-container-0-12x)\" },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: { value: \"4px\", variable: \"var(--kds-spacing-container-0-25x)\" },\n },\n \"0.37x\": {\n value: 6,\n unit: \"px\",\n css: { value: \"6px\", variable: \"var(--kds-spacing-container-0-37x)\" },\n },\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: { value: \"8px\", variable: \"var(--kds-spacing-container-0-5x)\" },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: { value: \"12px\", variable: \"var(--kds-spacing-container-0-75x)\" },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: { value: \"16px\", variable: \"var(--kds-spacing-container-1x)\" },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: { value: \"20px\", variable: \"var(--kds-spacing-container-1-25x)\" },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: { value: \"24px\", variable: \"var(--kds-spacing-container-1-5x)\" },\n },\n \"2x\": {\n value: 32,\n unit: \"px\",\n css: { value: \"32px\", variable: \"var(--kds-spacing-container-2x)\" },\n },\n \"3x\": {\n value: 48,\n unit: \"px\",\n css: { value: \"48px\", variable: \"var(--kds-spacing-container-3x)\" },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: { value: \"64px\", variable: \"var(--kds-spacing-container-4x)\" },\n },\n \"5x\": {\n value: 80,\n unit: \"px\",\n css: { value: \"80px\", variable: \"var(--kds-spacing-container-5x)\" },\n },\n },\n offset: {\n focus: {\n value: 1,\n unit: \"px\",\n css: { value: \"1px\", variable: \"var(--kds-spacing-offset-focus)\" },\n },\n },\n inputLabel: {\n \"spacing-bottom\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-spacing-input-label-spacing-bottom)\",\n },\n },\n },\n SubText: {\n \"spacing-top\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-spacing-sub-text-spacing-top)\",\n },\n },\n },\n};\n","import { border, dimension, spacing } from \"@knime/kds-styles/tokens\";\n\n// The parts a column header's minimum width is made of: its horizontal\n// padding, the action buttons it shows, and the gap between them. See\n// {@link minColumnSize}.\nconst HEADER_HORIZONTAL_PADDING =\n spacing.container[\"0.5x\"].value + spacing.container[\"0.37x\"].value;\nconst HEADER_ACTION_BUTTON_GAP = spacing.container[\"0.12x\"].value;\nconst HEADER_ACTION_BUTTON_WIDTH = dimension.component.width[\"1.5x\"].value;\n// Wider than the others, since it is permanently visible (see HeaderCell.vue).\nconst DELETE_COLUMN_BUTTON_WIDTH = dimension.component.width[\"2x\"].value;\n\n// the min-width of cells in the header and rows, no matter what the header of\n// the column holds\nexport const MIN_COLUMN_SIZE = 50;\n\n/**\n * The min-width of a column whose header shows the given action buttons, i.e.\n * the width at which its name has truncated away entirely but the buttons\n * still fit. Never below {@link MIN_COLUMN_SIZE}. Enforced on the column size\n * shared with the row cells rather than as a header-only CSS min-width, which\n * would desync the header cell's width from its column's and shift later\n * columns out of alignment.\n */\nexport const minColumnSize = ({\n menuButton = false,\n sortButton = false,\n deleteButton = false,\n}: {\n menuButton?: boolean;\n sortButton?: boolean;\n deleteButton?: boolean;\n}) => {\n const buttonWidths = [\n ...(menuButton ? [HEADER_ACTION_BUTTON_WIDTH] : []),\n ...(sortButton ? [HEADER_ACTION_BUTTON_WIDTH] : []),\n ...(deleteButton ? [DELETE_COLUMN_BUTTON_WIDTH] : []),\n ];\n const gaps = Math.max(buttonWidths.length - 1, 0) * HEADER_ACTION_BUTTON_GAP;\n return Math.max(\n MIN_COLUMN_SIZE,\n HEADER_HORIZONTAL_PADDING +\n buttonWidths.reduce((total, width) => total + width, 0) +\n gaps,\n );\n};\n\n// the max-width of cells in the header and rows when using fit content column sizing\nexport const MAX_AUTO_COLUMN_SIZE = 960;\n\n// the width of special (collapser, selection, filter) columns in the header and rows\nexport const SPECIAL_COLUMNS_SIZE = dimension.component.width[\"2x\"].value;\n\n// the bottom border width of any given row\nexport const ROW_BORDER_BOTTOM_WIDTH = border.base.subtle.width.value;\n\n// the default height of a row, including its bottom border\nexport const DEFAULT_ROW_HEIGHT =\n dimension.component.height[\"2.5x\"].value + ROW_BORDER_BOTTOM_WIDTH;\n\n// the compact height of a row, including its bottom border\nexport const COMPACT_ROW_HEIGHT =\n dimension.component.height[\"1.75x\"].value + ROW_BORDER_BOTTOM_WIDTH;\n\n// the default top/bottom padding of a row (kds.spacing.container.0_75x)\n// Note that this is not arbitrary, but leads to remaining space of 1x which aligns with\n// the typography which uses 0.75x font size and 130% line height\n// (so we are just off by 0.025x which we accept since all of this is only important for\n// the centered-ness of content in the cell and not for exact measurements)\nexport const DEFAULT_ROW_PADDING_TOP_BOTTOM = spacing.container[\"0.75x\"].value;\n\n// the compact top/bottom padding of a row (kds.spacing.container.0_37x)\n// Note that this is not arbitrary, but leads to remaining space of 1x which aligns with\n// the typography which uses 0.75x font size and 130% line height\n// (so we are just off by 0.025x which we accept since all of this is only important for\n// the centered-ness of content in the cell and not for exact measurements)\nexport const COMPACT_ROW_PADDING_TOP_BOTTOM = spacing.container[\"0.37x\"].value;\n\n// the default horizontal padding of a table cell (kds.spacing.container.0_5x)\nexport const CELL_PADDING_HORIZONTAL = spacing.container[\"0.5x\"].value;\n\n// the minimum height of a row\nexport const MIN_ROW_HEIGHT = COMPACT_ROW_HEIGHT;\n\n// the height of the table header and group headers\nexport const HEADER_HEIGHT =\n dimension.component.height[\"2.5x\"].value + 2 * ROW_BORDER_BOTTOM_WIDTH;\n\n// the maximum width of the submenu in the header\nexport const MAX_SUB_MENU_WIDTH = 160;\n\n// after resizing rows, scroll is temporarily disabled until the resize is complete to prevent jumps\nexport const ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY = 100;\n\n// the width of the column resize drag handle\nexport const COLUMN_RESIZE_DRAG_HANDLE_WIDTH = 5;\n\n// the width of the cell expand button\nexport const EXPAND_BUTTON_WIDTH = dimension.component.width[\"1x\"].value;\n\nexport default {\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n MIN_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n COMPACT_ROW_HEIGHT,\n CELL_PADDING_HORIZONTAL,\n};\n","import type { PropType } from \"vue\";\n\n/**\n * Background-color tokens the table can be rendered on top of. Used to match\n * the table header's background to the surface surrounding the table.\n */\nexport const BACKGROUND_COLORS = [\n \"page-default\",\n \"surface-default\",\n \"surface-muted\",\n \"surface-subtle\",\n] as const;\n\nexport type BackgroundColor = (typeof BACKGROUND_COLORS)[number];\n\n/**\n * Shared Vue prop options for `renderedOnBackgroundColor`, used by every\n * component that exposes it. The `validator` guards the runtime value for\n * plain-JS callers that bypass the `BackgroundColor` type at compile time.\n */\nexport const renderedOnBackgroundColorProp = {\n type: String as PropType<BackgroundColor>,\n default: \"page-default\" as BackgroundColor,\n validator: (value: string) =>\n (BACKGROUND_COLORS as readonly string[]).includes(value),\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { ColumnConfig } from \"..\";\n\nconst isNonEmptyObject = (val: any) =>\n val !== null &&\n typeof val === \"object\" &&\n Object.getOwnPropertyNames(val).length > 0;\n\nconst isObjectRepresentation = (\n val: any,\n): val is { value?: any; color?: string; metadata?: string } => {\n const possibleKeys = [\"value\", \"metadata\", \"color\"];\n return (\n isNonEmptyObject(val) &&\n Object.getOwnPropertyNames(val).every((key) => possibleKeys.includes(key))\n );\n};\n\nexport const unpackObjectRepresentation = (val: any) => {\n if (isObjectRepresentation(val)) {\n if (val.hasOwnProperty(\"metadata\") && !val.hasOwnProperty(\"value\")) {\n return null;\n }\n return val.value;\n }\n return val;\n};\n\nexport const getColor = (val: any) => {\n if (isObjectRepresentation(val) && val.hasOwnProperty(\"color\")) {\n const color = val.color;\n return typeof color === \"undefined\" ? null : color;\n }\n return null;\n};\n\nexport const isMissingValue = (val: any): val is { metadata: string } | null =>\n val === null ||\n (isObjectRepresentation(val) && val?.hasOwnProperty(\"metadata\"));\n\nexport const getMissingValueMessage = (\n cellData: { metadata: string } | null,\n) => {\n const metadata = cellData?.metadata;\n const missingValueMsg = typeof metadata === \"string\" ? ` (${metadata})` : \"\";\n return `Missing Value${missingValueMsg}`;\n};\n\nexport const isEmpty = (val: any): val is { value: undefined } | undefined =>\n typeof unpackObjectRepresentation(val) === \"undefined\";\n\nexport const getPropertiesFromColumns = <T extends keyof ColumnConfig>(\n columnConfigs: ColumnConfig[],\n key: T,\n): Array<ColumnConfig[T]> => columnConfigs.map((colConfig) => colConfig[key]);\n","var $ = Object.defineProperty;\nvar P = (t, e, r) => e in t ? $(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;\nvar u = (t, e, r) => P(t, typeof e != \"symbol\" ? e + \"\" : e, r);\nimport { getCurrentScope as W, onScopeDispose as E, unref as s, computed as h, watch as y, ref as g, getCurrentInstance as V, onMounted as D, watchEffect as N, isRef as R } from \"vue\";\nfunction C(t) {\n return W() ? (E(t), !0) : !1;\n}\nfunction F(t) {\n return typeof t == \"function\" ? t() : s(t);\n}\nconst G = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nfunction T(t) {\n var e;\n const r = F(t);\n return (e = r == null ? void 0 : r.$el) != null ? e : r;\n}\nconst j = G ? window : void 0;\nfunction q() {\n const t = g(!1);\n return V() && D(() => {\n t.value = !0;\n }), t;\n}\nfunction _(t) {\n const e = q();\n return h(() => (e.value, !!t()));\n}\nfunction B(t, e, r = {}) {\n const { window: n = j, ...c } = r;\n let o;\n const f = _(() => n && \"ResizeObserver\" in n), i = () => {\n o && (o.disconnect(), o = void 0);\n }, d = h(() => Array.isArray(t) ? t.map((m) => T(m)) : [T(t)]), l = y(\n d,\n (m) => {\n if (i(), f.value && n) {\n o = new ResizeObserver(e);\n for (const v of m)\n v && o.observe(v, c);\n }\n },\n { immediate: !0, flush: \"post\", deep: !0 }\n ), p = () => {\n i(), l();\n };\n return C(p), {\n isSupported: f,\n stop: p\n };\n}\nfunction H(t) {\n return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, \"default\") ? t.default : t;\n}\nvar J = function(e) {\n var r = null, n, c = function(i) {\n return function() {\n r = null, e.apply(i, n);\n };\n }, o = function() {\n for (var i = arguments.length, d = new Array(i), l = 0; l < i; l++)\n d[l] = arguments[l];\n n = d, r === null && (r = requestAnimationFrame(c(this)));\n };\n return o.cancel = function() {\n cancelAnimationFrame(r), r = null;\n }, o;\n}, K = J;\nconst Q = /* @__PURE__ */ H(K), X = 500, L = ({\n sizeManager: t,\n buffer: e = X\n}, r = \"vertical\", n = null) => {\n const o = g({ scrollStart: 0, scrollEnd: 0 }), f = r === \"vertical\", i = n ?? g(null), d = Q(() => {\n if (!i.value)\n return;\n const { scrollTop: a, scrollLeft: S, offsetHeight: w, offsetWidth: O } = i.value, I = f ? a : S, U = f ? w : O;\n o.value = { scrollStart: I, scrollEnd: I + U };\n });\n t.onUpdate(d), n || B(i, d);\n let l = null;\n const p = h(() => {\n const a = t.toIndex(o.value.scrollStart - e), S = Math.min(\n t.toIndex(o.value.scrollEnd + e) + 1,\n t.getNumItems()\n );\n return l && l.startIndex === a && l.endIndex === S || (l = { startIndex: a, endIndex: S, toArray: () => Array.from({ length: S - a }, (O, I) => a + I) }), l;\n }), m = h(() => t.toOffset(p.value.startIndex)), v = h(() => t.getTotalSize()), x = `--virtual-scroller-${r}-offset`, A = `--virtual-scroller-${r}-total-size`;\n N(() => {\n const a = i.value;\n a && (a.style.setProperty(x, `${m.value}px`), a.style.setProperty(A, `${v.value}px`));\n });\n const M = {\n [`padding${f ? \"Top\" : \"Left\"}`]: `var(${x})`,\n [f ? \"height\" : \"width\"]: `var(${A})`,\n /**\n * Since the height of the element should not be influenced by its padding.\n * An alternative without box-sizing: \"border-box\" would be to use margins instead\n * paddings, but then it is no longer easily possible to absolutely position\n * other elements (e.g. a cell selection overlay) inside this element.\n */\n boxSizing: \"border-box\"\n };\n return {\n containerProps: {\n ref: i,\n onScroll: d\n },\n indices: p,\n scrolledAreaStyles: M\n };\n}, te = (t) => {\n const e = g(null), r = L(t.rows, \"vertical\", e), n = L(t.columns, \"horizontal\", e), c = () => {\n r.containerProps.onScroll(), n.containerProps.onScroll();\n };\n return B(e, c), {\n containerProps: {\n ref: e,\n onScroll: c\n },\n scrolledAreaStyles: {\n vertical: r.scrolledAreaStyles,\n horizontal: n.scrolledAreaStyles\n },\n indices: {\n vertical: r.indices,\n horizontal: n.indices\n }\n };\n}, z = (t, e) => R(t) && y(() => t.value, e), Y = (t, e) => Math.floor(t / e);\nclass re {\n constructor(e, r) {\n u(this, \"numItems\");\n u(this, \"size\");\n this.numItems = e, this.size = r;\n }\n getNumItems() {\n return s(this.numItems);\n }\n onUpdate(e) {\n z(this.numItems, e), z(this.size, e);\n }\n toOffset(e) {\n return e * s(this.size);\n }\n getTotalSize() {\n return s(this.numItems) * s(this.size);\n }\n toIndex(e) {\n return Math.max(\n Math.min(\n Y(e, s(this.size)),\n s(this.numItems) - 1\n ),\n 0\n );\n }\n}\nclass Z {\n constructor(e) {\n u(this, \"isLeft\");\n this.isLeft = e;\n }\n getLastLeftIndex(e, r = 0) {\n if (e - r <= 1)\n return this.isLeft(e) ? e : r;\n const n = Math.floor((e + r) / 2);\n return this.isLeft(n) ? this.getLastLeftIndex(e, n) : this.getLastLeftIndex(n, r);\n }\n}\nclass ne {\n constructor(e) {\n u(this, \"numItems\");\n u(this, \"accumulatedSizes\");\n this.numItems = h(() => s(e).length), this.accumulatedSizes = h(() => {\n const r = [0];\n for (let n = 0; n < s(e).length; n++)\n r.push(r[n] + s(e)[n]);\n return r;\n });\n }\n getNumItems() {\n return s(this.numItems);\n }\n onUpdate(e) {\n y([this.accumulatedSizes], e);\n }\n toOffset(e) {\n return this.accumulatedSizes.value[e];\n }\n getTotalSize() {\n return this.accumulatedSizes.value[s(this.numItems)];\n }\n toIndex(e) {\n return e < 0 ? 0 : new Z((n) => this.toOffset(n) <= e).getLastLeftIndex(s(this.numItems) - 1);\n }\n}\nclass b {\n constructor(e) {\n u(this, \"delegate\");\n this.delegate = e;\n }\n getTotalSize() {\n return this.delegate.getTotalSize();\n }\n toIndex(e) {\n return this.delegate.toIndex(e);\n }\n getNumItems() {\n return this.delegate.getNumItems();\n }\n toOffset(e) {\n return this.delegate.toOffset(e);\n }\n onUpdate(e) {\n this.delegate.onUpdate(e);\n }\n}\nclass se extends b {\n constructor({\n spaceBefore: r,\n spaceBeforeIsOffset: n\n }, c) {\n super(c);\n u(this, \"spaceBefore\");\n u(this, \"spaceBeforeIsOffset\");\n this.spaceBefore = r, this.spaceBeforeIsOffset = n;\n }\n onUpdate(r) {\n super.onUpdate(r), z(this.spaceBefore, r);\n }\n toOffset(r) {\n return (this.spaceBeforeIsOffset ? s(this.spaceBefore) : 0) + super.toOffset(r);\n }\n getTotalSize() {\n return s(this.spaceBefore) + super.getTotalSize();\n }\n toIndex(r) {\n return super.toIndex(r - s(this.spaceBefore));\n }\n}\nclass oe extends b {\n constructor(r, n) {\n super(n);\n u(this, \"spaceAfter\");\n this.spaceAfter = r;\n }\n onUpdate(r) {\n super.onUpdate(r), z(this.spaceAfter, r);\n }\n getTotalSize() {\n return super.getTotalSize() + s(this.spaceAfter);\n }\n}\nexport {\n ne as ArraySizeManager,\n re as SameSizeManager,\n oe as WithSpaceAfter,\n se as WithSpaceBefore,\n te as useVirtualGrid,\n L as useVirtualLine\n};\n","/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */\nfunction _OverloadYield(e, d) {\n\tthis.v = e, this.k = d;\n}\nfunction _arrayLikeToArray(r, a) {\n\t(null == a || a > r.length) && (a = r.length);\n\tfor (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n\treturn n;\n}\nfunction _arrayWithHoles(r) {\n\tif (Array.isArray(r)) return r;\n}\nfunction _iterableToArrayLimit(r, l) {\n\tvar t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n\tif (null != t) {\n\t\tvar e, n, i, u, a = [], f = !0, o = !1;\n\t\ttry {\n\t\t\tif (i = (t = t.call(r)).next, 0 === l) {\n\t\t\t\tif (Object(t) !== t) return;\n\t\t\t\tf = !1;\n\t\t\t} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n\t\t} catch (r) {\n\t\t\to = !0, n = r;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n\t\t\t} finally {\n\t\t\t\tif (o) throw n;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}\n}\nfunction _nonIterableRest() {\n\tthrow new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\nfunction _slicedToArray(r, e) {\n\treturn _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _unsupportedIterableToArray(r, a) {\n\tif (r) {\n\t\tif (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n\t\tvar t = {}.toString.call(r).slice(8, -1);\n\t\treturn \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n\t}\n}\nfunction AsyncGenerator(e) {\n\tvar t, n;\n\tfunction resume(t, n) {\n\t\ttry {\n\t\t\tvar r = e[t](n), o = r.value, u = o instanceof _OverloadYield;\n\t\t\tPromise.resolve(u ? o.v : o).then(function(n) {\n\t\t\t\tif (u) {\n\t\t\t\t\tvar i = \"return\" === t && o.k ? t : \"next\";\n\t\t\t\t\tif (!o.k || n.done) return resume(i, n);\n\t\t\t\t\tn = e[i](n).value;\n\t\t\t\t}\n\t\t\t\tsettle(!!r.done, n);\n\t\t\t}, function(e) {\n\t\t\t\tresume(\"throw\", e);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tsettle(2, e);\n\t\t}\n\t}\n\tfunction settle(e, r) {\n\t\t2 === e ? t.reject(r) : t.resolve({\n\t\t\tvalue: r,\n\t\t\tdone: e\n\t\t}), (t = t.next) ? resume(t.key, t.arg) : n = null;\n\t}\n\tthis._invoke = function(e, r) {\n\t\treturn new Promise(function(o, u) {\n\t\t\tvar i = {\n\t\t\t\tkey: e,\n\t\t\t\targ: r,\n\t\t\t\tresolve: o,\n\t\t\t\treject: u,\n\t\t\t\tnext: null\n\t\t\t};\n\t\t\tn ? n = n.next = i : (t = n = i, resume(e, r));\n\t\t});\n\t}, \"function\" != typeof e.return && (this.return = void 0);\n}\nAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function() {\n\treturn this;\n}, AsyncGenerator.prototype.next = function(e) {\n\treturn this._invoke(\"next\", e);\n}, AsyncGenerator.prototype.throw = function(e) {\n\treturn this._invoke(\"throw\", e);\n}, AsyncGenerator.prototype.return = function(e) {\n\treturn this._invoke(\"return\", e);\n};\nconst entries = Object.entries;\nconst setPrototypeOf = Object.setPrototypeOf;\nconst isFrozen = Object.isFrozen;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nlet freeze = Object.freeze;\nlet seal = Object.seal;\nlet create = Object.create;\nlet _ref = typeof Reflect !== \"undefined\" && Reflect;\nlet apply = _ref.apply;\nlet construct = _ref.construct;\nif (!freeze) freeze = function freeze(x) {\n\treturn x;\n};\nif (!seal) seal = function seal(x) {\n\treturn x;\n};\nif (!apply) apply = function apply(func, thisArg) {\n\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\treturn func.apply(thisArg, args);\n};\nif (!construct) construct = function construct(Func) {\n\tfor (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];\n\treturn new Func(...args);\n};\nconst arrayForEach = unapply(Array.prototype.forEach);\nArray.prototype.indexOf;\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\nconst arraySplice = unapply(Array.prototype.splice);\nconst arrayIsArray = Array.isArray;\nconst setCreate = unconstruct(Set);\nconst setAdd = unapply(Set.prototype.add);\nconst setHas = unapply(Set.prototype.has);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst numberToString = unapply(Number.prototype.toString);\nconst booleanToString = unapply(Boolean.prototype.toString);\nconst bigintToString = typeof BigInt === \"undefined\" ? null : unapply(BigInt.prototype.toString);\nconst symbolToString = typeof Symbol === \"undefined\" ? null : unapply(Symbol.prototype.toString);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst objectToString = unapply(Object.prototype.toString);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n* Creates a new function that calls the given function with a specified thisArg and arguments.\n*\n* @param func - The function to be wrapped and called.\n* @returns A new function that calls the given function with a specified thisArg and arguments.\n*/\nfunction unapply(func) {\n\treturn function(thisArg) {\n\t\tif (thisArg instanceof RegExp) thisArg.lastIndex = 0;\n\t\tfor (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];\n\t\treturn apply(func, thisArg, args);\n\t};\n}\n/**\n* Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n*\n* @param func - The constructor function to be wrapped and called.\n* @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n*/\nfunction unconstruct(Func) {\n\treturn function() {\n\t\tfor (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4];\n\t\treturn construct(Func, args);\n\t};\n}\n/**\n* Add properties to a lookup table\n*\n* @param set - The set to which elements will be added.\n* @param array - The array containing elements to be added to the set.\n* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n* @returns The modified set with added elements.\n*/\nfunction addToSet(set, array) {\n\tlet transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;\n\tif (setPrototypeOf) setPrototypeOf(set, null);\n\tif (!arrayIsArray(array)) return set;\n\tlet l = array.length;\n\twhile (l--) {\n\t\tlet element = array[l];\n\t\tif (typeof element === \"string\") {\n\t\t\tconst lcElement = transformCaseFunc(element);\n\t\t\tif (lcElement !== element) {\n\t\t\t\tif (!isFrozen(array)) array[l] = lcElement;\n\t\t\t\telement = lcElement;\n\t\t\t}\n\t\t}\n\t\tset[element] = true;\n\t}\n\treturn set;\n}\n/**\n* Clean up an array to harden against CSPP\n*\n* @param array - The array to be cleaned.\n* @returns The cleaned version of the array\n*/\nfunction cleanArray(array) {\n\tfor (let index = 0; index < array.length; index++) if (!objectHasOwnProperty(array, index)) array[index] = null;\n\treturn array;\n}\n/**\n* Shallow clone an object\n*\n* @param object - The object to be cloned.\n* @returns A new object that copies the original.\n*/\nfunction clone(object) {\n\tconst newObject = create(null);\n\tfor (const _ref2 of entries(object)) {\n\t\tvar _ref3 = _slicedToArray(_ref2, 2);\n\t\tconst property = _ref3[0];\n\t\tconst value = _ref3[1];\n\t\tif (objectHasOwnProperty(object, property)) {\n\t\t\tif (arrayIsArray(value)) newObject[property] = cleanArray(value);\n\t\t\telse if (value && typeof value === \"object\" && value.constructor === Object) newObject[property] = clone(value);\n\t\t\telse newObject[property] = value;\n\t\t}\n\t}\n\treturn newObject;\n}\n/**\n* Convert non-node values into strings without depending on direct property access.\n*\n* @param value - The value to stringify.\n* @returns A string representation of the provided value.\n*/\nfunction stringifyValue(value) {\n\tswitch (typeof value) {\n\t\tcase \"string\": return value;\n\t\tcase \"number\": return numberToString(value);\n\t\tcase \"boolean\": return booleanToString(value);\n\t\tcase \"bigint\": return bigintToString ? bigintToString(value) : \"0\";\n\t\tcase \"symbol\": return symbolToString ? symbolToString(value) : \"Symbol()\";\n\t\tcase \"undefined\": return objectToString(value);\n\t\tcase \"function\":\n\t\tcase \"object\": {\n\t\t\tif (value === null) return objectToString(value);\n\t\t\tconst valueAsRecord = value;\n\t\t\tconst valueToString = lookupGetter(valueAsRecord, \"toString\");\n\t\t\tif (typeof valueToString === \"function\") {\n\t\t\t\tconst stringified = valueToString(valueAsRecord);\n\t\t\t\treturn typeof stringified === \"string\" ? stringified : objectToString(stringified);\n\t\t\t}\n\t\t\treturn objectToString(value);\n\t\t}\n\t\tdefault: return objectToString(value);\n\t}\n}\n/**\n* This method automatically checks if the prop is function or getter and behaves accordingly.\n*\n* @param object - The object to look up the getter function in its prototype chain.\n* @param prop - The property name for which to find the getter function.\n* @returns The getter function found in the prototype chain or a fallback function.\n*/\nfunction lookupGetter(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\t\tif (desc) {\n\t\t\tif (desc.get) return unapply(desc.get);\n\t\t\tif (typeof desc.value === \"function\") return unapply(desc.value);\n\t\t}\n\t\tobject = getPrototypeOf(object);\n\t}\n\tfunction fallbackValue() {\n\t\treturn null;\n\t}\n\treturn fallbackValue;\n}\n/**\n* Like lookupGetter, but for accessor properties only, and returns null\n* instead of a null-returning fallback when no getter exists on the chain.\n* Lets a caller fall back to a direct property read in environments that\n* lack the getter, where a fallback returning null would be indistinguishable\n* from a legitimate null value (e.g. namespaceURI of a no-namespace element).\n*\n* @param object - The object (usually a prototype) to start the lookup at.\n* @param prop - The accessor property name.\n* @returns The unapplied getter, or null if none was found.\n*/\nfunction lookupAccessor(object, prop) {\n\twhile (object !== null) {\n\t\tconst desc = getOwnPropertyDescriptor(object, prop);\n\t\tif (desc) return desc.get ? unapply(desc.get) : null;\n\t\tobject = getPrototypeOf(object);\n\t}\n\treturn null;\n}\nfunction isRegex(value) {\n\ttry {\n\t\tregExpTest(value, \"\");\n\t\treturn true;\n\t} catch (_unused) {\n\t\treturn false;\n\t}\n}\nconst html$1 = freeze([\n\t\"a\",\n\t\"abbr\",\n\t\"acronym\",\n\t\"address\",\n\t\"area\",\n\t\"article\",\n\t\"aside\",\n\t\"audio\",\n\t\"b\",\n\t\"bdi\",\n\t\"bdo\",\n\t\"big\",\n\t\"blink\",\n\t\"blockquote\",\n\t\"body\",\n\t\"br\",\n\t\"button\",\n\t\"canvas\",\n\t\"caption\",\n\t\"center\",\n\t\"cite\",\n\t\"code\",\n\t\"col\",\n\t\"colgroup\",\n\t\"content\",\n\t\"data\",\n\t\"datalist\",\n\t\"dd\",\n\t\"decorator\",\n\t\"del\",\n\t\"details\",\n\t\"dfn\",\n\t\"dialog\",\n\t\"dir\",\n\t\"div\",\n\t\"dl\",\n\t\"dt\",\n\t\"element\",\n\t\"em\",\n\t\"fieldset\",\n\t\"figcaption\",\n\t\"figure\",\n\t\"font\",\n\t\"footer\",\n\t\"form\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"head\",\n\t\"header\",\n\t\"hgroup\",\n\t\"hr\",\n\t\"html\",\n\t\"i\",\n\t\"img\",\n\t\"input\",\n\t\"ins\",\n\t\"kbd\",\n\t\"label\",\n\t\"legend\",\n\t\"li\",\n\t\"main\",\n\t\"map\",\n\t\"mark\",\n\t\"marquee\",\n\t\"menu\",\n\t\"menuitem\",\n\t\"meter\",\n\t\"nav\",\n\t\"nobr\",\n\t\"ol\",\n\t\"optgroup\",\n\t\"option\",\n\t\"output\",\n\t\"p\",\n\t\"picture\",\n\t\"pre\",\n\t\"progress\",\n\t\"q\",\n\t\"rp\",\n\t\"rt\",\n\t\"ruby\",\n\t\"s\",\n\t\"samp\",\n\t\"search\",\n\t\"section\",\n\t\"select\",\n\t\"shadow\",\n\t\"slot\",\n\t\"small\",\n\t\"source\",\n\t\"spacer\",\n\t\"span\",\n\t\"strike\",\n\t\"strong\",\n\t\"style\",\n\t\"sub\",\n\t\"summary\",\n\t\"sup\",\n\t\"table\",\n\t\"tbody\",\n\t\"td\",\n\t\"template\",\n\t\"textarea\",\n\t\"tfoot\",\n\t\"th\",\n\t\"thead\",\n\t\"time\",\n\t\"tr\",\n\t\"track\",\n\t\"tt\",\n\t\"u\",\n\t\"ul\",\n\t\"var\",\n\t\"video\",\n\t\"wbr\"\n]);\nconst svg$1 = freeze([\n\t\"svg\",\n\t\"a\",\n\t\"altglyph\",\n\t\"altglyphdef\",\n\t\"altglyphitem\",\n\t\"animatecolor\",\n\t\"animatemotion\",\n\t\"animatetransform\",\n\t\"circle\",\n\t\"clippath\",\n\t\"defs\",\n\t\"desc\",\n\t\"ellipse\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"filter\",\n\t\"font\",\n\t\"g\",\n\t\"glyph\",\n\t\"glyphref\",\n\t\"hkern\",\n\t\"image\",\n\t\"inputmode\",\n\t\"line\",\n\t\"lineargradient\",\n\t\"marker\",\n\t\"mask\",\n\t\"metadata\",\n\t\"mpath\",\n\t\"part\",\n\t\"path\",\n\t\"pattern\",\n\t\"polygon\",\n\t\"polyline\",\n\t\"radialgradient\",\n\t\"rect\",\n\t\"stop\",\n\t\"style\",\n\t\"switch\",\n\t\"symbol\",\n\t\"text\",\n\t\"textpath\",\n\t\"title\",\n\t\"tref\",\n\t\"tspan\",\n\t\"view\",\n\t\"vkern\"\n]);\nconst svgFilters = freeze([\n\t\"feBlend\",\n\t\"feColorMatrix\",\n\t\"feComponentTransfer\",\n\t\"feComposite\",\n\t\"feConvolveMatrix\",\n\t\"feDiffuseLighting\",\n\t\"feDisplacementMap\",\n\t\"feDistantLight\",\n\t\"feDropShadow\",\n\t\"feFlood\",\n\t\"feFuncA\",\n\t\"feFuncB\",\n\t\"feFuncG\",\n\t\"feFuncR\",\n\t\"feGaussianBlur\",\n\t\"feImage\",\n\t\"feMerge\",\n\t\"feMergeNode\",\n\t\"feMorphology\",\n\t\"feOffset\",\n\t\"fePointLight\",\n\t\"feSpecularLighting\",\n\t\"feSpotLight\",\n\t\"feTile\",\n\t\"feTurbulence\"\n]);\nconst svgDisallowed = freeze([\n\t\"animate\",\n\t\"color-profile\",\n\t\"cursor\",\n\t\"discard\",\n\t\"font-face\",\n\t\"font-face-format\",\n\t\"font-face-name\",\n\t\"font-face-src\",\n\t\"font-face-uri\",\n\t\"foreignobject\",\n\t\"hatch\",\n\t\"hatchpath\",\n\t\"mesh\",\n\t\"meshgradient\",\n\t\"meshpatch\",\n\t\"meshrow\",\n\t\"missing-glyph\",\n\t\"script\",\n\t\"set\",\n\t\"solidcolor\",\n\t\"unknown\",\n\t\"use\"\n]);\nconst mathMl$1 = freeze([\n\t\"math\",\n\t\"menclose\",\n\t\"merror\",\n\t\"mfenced\",\n\t\"mfrac\",\n\t\"mglyph\",\n\t\"mi\",\n\t\"mlabeledtr\",\n\t\"mmultiscripts\",\n\t\"mn\",\n\t\"mo\",\n\t\"mover\",\n\t\"mpadded\",\n\t\"mphantom\",\n\t\"mroot\",\n\t\"mrow\",\n\t\"ms\",\n\t\"mspace\",\n\t\"msqrt\",\n\t\"mstyle\",\n\t\"msub\",\n\t\"msup\",\n\t\"msubsup\",\n\t\"mtable\",\n\t\"mtd\",\n\t\"mtext\",\n\t\"mtr\",\n\t\"munder\",\n\t\"munderover\",\n\t\"mprescripts\"\n]);\nconst mathMlDisallowed = freeze([\n\t\"maction\",\n\t\"maligngroup\",\n\t\"malignmark\",\n\t\"mlongdiv\",\n\t\"mscarries\",\n\t\"mscarry\",\n\t\"msgroup\",\n\t\"mstack\",\n\t\"msline\",\n\t\"msrow\",\n\t\"semantics\",\n\t\"annotation\",\n\t\"annotation-xml\",\n\t\"mprescripts\",\n\t\"none\"\n]);\nconst text = freeze([\"#text\"]);\nconst html = freeze([\n\t\"accept\",\n\t\"action\",\n\t\"align\",\n\t\"alt\",\n\t\"autocapitalize\",\n\t\"autocomplete\",\n\t\"autopictureinpicture\",\n\t\"autoplay\",\n\t\"background\",\n\t\"bgcolor\",\n\t\"border\",\n\t\"capture\",\n\t\"cellpadding\",\n\t\"cellspacing\",\n\t\"checked\",\n\t\"cite\",\n\t\"class\",\n\t\"clear\",\n\t\"color\",\n\t\"cols\",\n\t\"colspan\",\n\t\"command\",\n\t\"commandfor\",\n\t\"controls\",\n\t\"controlslist\",\n\t\"coords\",\n\t\"crossorigin\",\n\t\"datetime\",\n\t\"decoding\",\n\t\"default\",\n\t\"dir\",\n\t\"disabled\",\n\t\"disablepictureinpicture\",\n\t\"disableremoteplayback\",\n\t\"download\",\n\t\"draggable\",\n\t\"enctype\",\n\t\"enterkeyhint\",\n\t\"exportparts\",\n\t\"face\",\n\t\"for\",\n\t\"headers\",\n\t\"height\",\n\t\"hidden\",\n\t\"high\",\n\t\"href\",\n\t\"hreflang\",\n\t\"id\",\n\t\"inert\",\n\t\"inputmode\",\n\t\"integrity\",\n\t\"ismap\",\n\t\"kind\",\n\t\"label\",\n\t\"lang\",\n\t\"list\",\n\t\"loading\",\n\t\"loop\",\n\t\"low\",\n\t\"max\",\n\t\"maxlength\",\n\t\"media\",\n\t\"method\",\n\t\"min\",\n\t\"minlength\",\n\t\"multiple\",\n\t\"muted\",\n\t\"name\",\n\t\"nonce\",\n\t\"noshade\",\n\t\"novalidate\",\n\t\"nowrap\",\n\t\"open\",\n\t\"optimum\",\n\t\"part\",\n\t\"pattern\",\n\t\"placeholder\",\n\t\"playsinline\",\n\t\"popover\",\n\t\"popovertarget\",\n\t\"popovertargetaction\",\n\t\"poster\",\n\t\"preload\",\n\t\"pubdate\",\n\t\"radiogroup\",\n\t\"readonly\",\n\t\"rel\",\n\t\"required\",\n\t\"rev\",\n\t\"reversed\",\n\t\"role\",\n\t\"rows\",\n\t\"rowspan\",\n\t\"spellcheck\",\n\t\"scope\",\n\t\"selected\",\n\t\"shape\",\n\t\"size\",\n\t\"sizes\",\n\t\"slot\",\n\t\"span\",\n\t\"srclang\",\n\t\"start\",\n\t\"src\",\n\t\"srcset\",\n\t\"step\",\n\t\"style\",\n\t\"summary\",\n\t\"tabindex\",\n\t\"title\",\n\t\"translate\",\n\t\"type\",\n\t\"usemap\",\n\t\"valign\",\n\t\"value\",\n\t\"width\",\n\t\"wrap\",\n\t\"xmlns\"\n]);\nconst svg = freeze([\n\t\"accent-height\",\n\t\"accumulate\",\n\t\"additive\",\n\t\"alignment-baseline\",\n\t\"amplitude\",\n\t\"ascent\",\n\t\"attributename\",\n\t\"attributetype\",\n\t\"azimuth\",\n\t\"basefrequency\",\n\t\"baseline-shift\",\n\t\"begin\",\n\t\"bias\",\n\t\"by\",\n\t\"class\",\n\t\"clip\",\n\t\"clippathunits\",\n\t\"clip-path\",\n\t\"clip-rule\",\n\t\"color\",\n\t\"color-interpolation\",\n\t\"color-interpolation-filters\",\n\t\"color-profile\",\n\t\"color-rendering\",\n\t\"cx\",\n\t\"cy\",\n\t\"d\",\n\t\"dx\",\n\t\"dy\",\n\t\"diffuseconstant\",\n\t\"direction\",\n\t\"display\",\n\t\"divisor\",\n\t\"dominant-baseline\",\n\t\"dur\",\n\t\"edgemode\",\n\t\"elevation\",\n\t\"end\",\n\t\"exponent\",\n\t\"fill\",\n\t\"fill-opacity\",\n\t\"fill-rule\",\n\t\"filter\",\n\t\"filterunits\",\n\t\"flood-color\",\n\t\"flood-opacity\",\n\t\"font-family\",\n\t\"font-size\",\n\t\"font-size-adjust\",\n\t\"font-stretch\",\n\t\"font-style\",\n\t\"font-variant\",\n\t\"font-weight\",\n\t\"fx\",\n\t\"fy\",\n\t\"g1\",\n\t\"g2\",\n\t\"glyph-name\",\n\t\"glyphref\",\n\t\"gradientunits\",\n\t\"gradienttransform\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"image-rendering\",\n\t\"in\",\n\t\"in2\",\n\t\"intercept\",\n\t\"k\",\n\t\"k1\",\n\t\"k2\",\n\t\"k3\",\n\t\"k4\",\n\t\"kerning\",\n\t\"keypoints\",\n\t\"keysplines\",\n\t\"keytimes\",\n\t\"lang\",\n\t\"lengthadjust\",\n\t\"letter-spacing\",\n\t\"kernelmatrix\",\n\t\"kernelunitlength\",\n\t\"lighting-color\",\n\t\"local\",\n\t\"marker-end\",\n\t\"marker-mid\",\n\t\"marker-start\",\n\t\"markerheight\",\n\t\"markerunits\",\n\t\"markerwidth\",\n\t\"maskcontentunits\",\n\t\"maskunits\",\n\t\"max\",\n\t\"mask\",\n\t\"mask-type\",\n\t\"media\",\n\t\"method\",\n\t\"mode\",\n\t\"min\",\n\t\"name\",\n\t\"numoctaves\",\n\t\"offset\",\n\t\"operator\",\n\t\"opacity\",\n\t\"order\",\n\t\"orient\",\n\t\"orientation\",\n\t\"origin\",\n\t\"overflow\",\n\t\"paint-order\",\n\t\"path\",\n\t\"pathlength\",\n\t\"patterncontentunits\",\n\t\"patterntransform\",\n\t\"patternunits\",\n\t\"pointer-events\",\n\t\"points\",\n\t\"preservealpha\",\n\t\"preserveaspectratio\",\n\t\"primitiveunits\",\n\t\"r\",\n\t\"rx\",\n\t\"ry\",\n\t\"radius\",\n\t\"refx\",\n\t\"refy\",\n\t\"repeatcount\",\n\t\"repeatdur\",\n\t\"restart\",\n\t\"result\",\n\t\"rotate\",\n\t\"scale\",\n\t\"seed\",\n\t\"shape-rendering\",\n\t\"slope\",\n\t\"specularconstant\",\n\t\"specularexponent\",\n\t\"spreadmethod\",\n\t\"startoffset\",\n\t\"stddeviation\",\n\t\"stitchtiles\",\n\t\"stop-color\",\n\t\"stop-opacity\",\n\t\"stroke-dasharray\",\n\t\"stroke-dashoffset\",\n\t\"stroke-linecap\",\n\t\"stroke-linejoin\",\n\t\"stroke-miterlimit\",\n\t\"stroke-opacity\",\n\t\"stroke\",\n\t\"stroke-width\",\n\t\"style\",\n\t\"surfacescale\",\n\t\"systemlanguage\",\n\t\"tabindex\",\n\t\"tablevalues\",\n\t\"targetx\",\n\t\"targety\",\n\t\"transform\",\n\t\"transform-origin\",\n\t\"text-anchor\",\n\t\"text-decoration\",\n\t\"text-orientation\",\n\t\"text-rendering\",\n\t\"textlength\",\n\t\"type\",\n\t\"u1\",\n\t\"u2\",\n\t\"unicode\",\n\t\"values\",\n\t\"vector-effect\",\n\t\"viewbox\",\n\t\"visibility\",\n\t\"version\",\n\t\"vert-adv-y\",\n\t\"vert-origin-x\",\n\t\"vert-origin-y\",\n\t\"width\",\n\t\"word-spacing\",\n\t\"wrap\",\n\t\"writing-mode\",\n\t\"xchannelselector\",\n\t\"ychannelselector\",\n\t\"x\",\n\t\"x1\",\n\t\"x2\",\n\t\"xmlns\",\n\t\"y\",\n\t\"y1\",\n\t\"y2\",\n\t\"z\",\n\t\"zoomandpan\"\n]);\nconst mathMl = freeze([\n\t\"accent\",\n\t\"accentunder\",\n\t\"align\",\n\t\"bevelled\",\n\t\"close\",\n\t\"columnalign\",\n\t\"columnlines\",\n\t\"columnspacing\",\n\t\"columnspan\",\n\t\"denomalign\",\n\t\"depth\",\n\t\"dir\",\n\t\"display\",\n\t\"displaystyle\",\n\t\"encoding\",\n\t\"fence\",\n\t\"frame\",\n\t\"height\",\n\t\"href\",\n\t\"id\",\n\t\"largeop\",\n\t\"length\",\n\t\"linethickness\",\n\t\"lquote\",\n\t\"lspace\",\n\t\"mathbackground\",\n\t\"mathcolor\",\n\t\"mathsize\",\n\t\"mathvariant\",\n\t\"maxsize\",\n\t\"minsize\",\n\t\"movablelimits\",\n\t\"notation\",\n\t\"numalign\",\n\t\"open\",\n\t\"rowalign\",\n\t\"rowlines\",\n\t\"rowspacing\",\n\t\"rowspan\",\n\t\"rspace\",\n\t\"rquote\",\n\t\"scriptlevel\",\n\t\"scriptminsize\",\n\t\"scriptsizemultiplier\",\n\t\"selection\",\n\t\"separator\",\n\t\"separators\",\n\t\"stretchy\",\n\t\"subscriptshift\",\n\t\"supscriptshift\",\n\t\"symmetric\",\n\t\"voffset\",\n\t\"width\",\n\t\"xmlns\"\n]);\nconst xml = freeze([\n\t\"xlink:href\",\n\t\"xml:id\",\n\t\"xlink:title\",\n\t\"xml:space\",\n\t\"xmlns:xlink\"\n]);\nconst MUSTACHE_EXPR = seal(/{{[\\w\\W]*|^[\\w\\W]*}}/g);\nconst ERB_EXPR = seal(/<%[\\w\\W]*|^[\\w\\W]*%>/g);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*/g);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/);\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/);\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\nconst ELEMENT_MARKUP_PROBE = seal(/<[/\\w!]/g);\nconst COMMENT_MARKUP_PROBE = seal(/<[/\\w]/g);\nconst FALLBACK_TAG_CLOSE = seal(/<\\/no(script|embed|frames)/i);\nconst SELF_CLOSING_TAG = seal(/\\/>/i);\nconst NODE_TYPE = {\n\telement: 1,\n\tattribute: 2,\n\ttext: 3,\n\tcdataSection: 4,\n\tentityReference: 5,\n\tentityNode: 6,\n\tprocessingInstruction: 7,\n\tcomment: 8,\n\tdocument: 9,\n\tdocumentType: 10,\n\tdocumentFragment: 11,\n\tnotation: 12\n};\nconst LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, [\n\t\"style\",\n\t\"script\",\n\t\"xmp\",\n\t\"iframe\",\n\t\"noembed\",\n\t\"noframes\",\n\t\"plaintext\",\n\t\"noscript\"\n]));\nconst getGlobal = function getGlobal() {\n\treturn typeof window === \"undefined\" ? null : window;\n};\n/**\n* Creates a no-op policy for internal use only.\n* Don't export this function outside this module!\n* @param trustedTypes The policy factory.\n* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n* @return The policy created (or null, if Trusted Types\n* are not supported or creating the policy failed).\n*/\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n\tif (typeof trustedTypes !== \"object\" || typeof trustedTypes.createPolicy !== \"function\") return null;\n\tlet suffix = null;\n\tconst ATTR_NAME = \"data-tt-policy-suffix\";\n\tif (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) suffix = purifyHostElement.getAttribute(ATTR_NAME);\n\tconst policyName = \"dompurify\" + (suffix ? \"#\" + suffix : \"\");\n\ttry {\n\t\treturn trustedTypes.createPolicy(policyName, {\n\t\t\tcreateHTML(html) {\n\t\t\t\treturn html;\n\t\t\t},\n\t\t\tcreateScriptURL(scriptUrl) {\n\t\t\t\treturn scriptUrl;\n\t\t\t}\n\t\t});\n\t} catch (_) {\n\t\tconsole.warn(\"TrustedTypes policy \" + policyName + \" could not be created.\");\n\t\treturn null;\n\t}\n};\nconst _createHooksMap = function _createHooksMap() {\n\treturn {\n\t\tafterSanitizeAttributes: [],\n\t\tafterSanitizeElements: [],\n\t\tafterSanitizeShadowDOM: [],\n\t\tbeforeSanitizeAttributes: [],\n\t\tbeforeSanitizeElements: [],\n\t\tbeforeSanitizeShadowDOM: [],\n\t\tuponSanitizeAttribute: [],\n\t\tuponSanitizeElement: [],\n\t\tuponSanitizeShadowNode: []\n\t};\n};\n/**\n* Resolve a set-valued configuration option: a fresh set built from\n* cfg[key] when it is an own array property (seeded with a clone of\n* options.base when given, case-normalized via options.transform),\n* the fallback set otherwise.\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param fallback the set to use when the option is absent or not an array\n* @param options transform and optional base set to merge into\n* @returns the resolved set\n*/\nconst _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {\n\treturn objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;\n};\n/**\n* Resolve an object-valued configuration option: a prototype-free clone\n* of cfg[key] when it is an own, truthy object property, else a fresh\n* fallback built by makeFallback (fresh on every parse, so a previous\n* parse can never leak state into the next one).\n*\n* @param cfg the cloned, prototype-free configuration object\n* @param key the configuration property to read\n* @param makeFallback builds the fallback value when the option is absent\n* @returns the resolved object\n*/\nconst _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback) {\n\tconst value = objectHasOwnProperty(cfg, key) ? cfg[key] : void 0;\n\treturn value && typeof value === \"object\" ? clone(value) : makeFallback();\n};\nfunction createDOMPurify() {\n\tlet window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();\n\tconst DOMPurify = (root) => createDOMPurify(root);\n\tDOMPurify.version = \"3.4.17\";\n\tDOMPurify.removed = [];\n\tif (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n\t\tDOMPurify.isSupported = false;\n\t\treturn DOMPurify;\n\t}\n\tlet document = window.document;\n\tconst originalDocument = document;\n\tconst currentScript = originalDocument.currentScript;\n\twindow.DocumentFragment;\n\tconst HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter;\n\twindow.NamedNodeMap === void 0 && (window.NamedNodeMap || window.MozNamedAttrMap);\n\twindow.HTMLFormElement;\n\tconst DOMParser = window.DOMParser, trustedTypes = window.trustedTypes;\n\tconst ElementPrototype = Element.prototype;\n\tconst cloneNode = lookupGetter(ElementPrototype, \"cloneNode\");\n\tconst remove = lookupGetter(ElementPrototype, \"remove\");\n\tconst removeAttributeNode = lookupGetter(ElementPrototype, \"removeAttributeNode\");\n\tconst getNextSibling = lookupGetter(ElementPrototype, \"nextSibling\");\n\tconst getChildNodes = lookupGetter(ElementPrototype, \"childNodes\");\n\tconst getParentNode = lookupGetter(ElementPrototype, \"parentNode\");\n\tconst getShadowRoot = lookupGetter(ElementPrototype, \"shadowRoot\");\n\tconst getAttributes = lookupGetter(ElementPrototype, \"attributes\");\n\tconst getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeType\") : null;\n\tconst getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, \"nodeName\") : null;\n\tconst getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, \"ownerDocument\") : null;\n\tconst _readNodeType = function _readNodeType(node) {\n\t\treturn getNodeType ? getNodeType(node) : node.nodeType;\n\t};\n\tconst _readNodeName = function _readNodeName(node) {\n\t\treturn getNodeName ? getNodeName(node) : node.nodeName;\n\t};\n\tconst getNamespaceURI = lookupAccessor(ElementPrototype, \"namespaceURI\");\n\tconst _readNamespaceURI = function _readNamespaceURI(element) {\n\t\treturn getNamespaceURI ? getNamespaceURI(element) : element.namespaceURI;\n\t};\n\tif (typeof HTMLTemplateElement === \"function\") {\n\t\tconst template = document.createElement(\"template\");\n\t\tif (template.content && template.content.ownerDocument) document = template.content.ownerDocument;\n\t}\n\tlet trustedTypesPolicy;\n\tlet emptyHTML = \"\";\n\tlet defaultTrustedTypesPolicy;\n\tlet defaultTrustedTypesPolicyResolved = false;\n\tlet IN_TRUSTED_TYPES_POLICY = 0;\n\tconst _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {\n\t\tif (IN_TRUSTED_TYPES_POLICY > 0) throw typeErrorCreate(\"A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \\\"DOMPurify and Trusted Types\\\" section of the README.\");\n\t};\n\tconst _createTrustedHTML = function _createTrustedHTML(html) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createHTML(html);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {\n\t\t_assertNotInTrustedTypesPolicy();\n\t\tIN_TRUSTED_TYPES_POLICY++;\n\t\ttry {\n\t\t\treturn trustedTypesPolicy.createScriptURL(scriptUrl);\n\t\t} finally {\n\t\t\tIN_TRUSTED_TYPES_POLICY--;\n\t\t}\n\t};\n\tconst _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {\n\t\tif (!defaultTrustedTypesPolicyResolved) {\n\t\t\tdefaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n\t\t\tdefaultTrustedTypesPolicyResolved = true;\n\t\t}\n\t\treturn defaultTrustedTypesPolicy;\n\t};\n\tconst _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;\n\tconst importNode = originalDocument.importNode;\n\tlet hooks = _createHooksMap();\n\t/**\n\t* Expose whether this browser supports running the full DOMPurify.\n\t*/\n\tDOMPurify.isSupported = typeof entries === \"function\" && typeof getParentNode === \"function\" && implementation && implementation.createHTMLDocument !== void 0;\n\tconst MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;\n\tlet IS_ALLOWED_URI$1 = IS_ALLOWED_URI;\n\t/**\n\t* We consider the elements and attributes below to be safe. Ideally\n\t* don't add any new ones but feel free to remove unwanted ones.\n\t*/\n\tlet ALLOWED_TAGS = null;\n\tconst DEFAULT_ALLOWED_TAGS = addToSet({}, [\n\t\t...html$1,\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...mathMl$1,\n\t\t...text\n\t]);\n\tlet ALLOWED_ATTR = null;\n\tconst DEFAULT_ALLOWED_ATTR = addToSet({}, [\n\t\t...html,\n\t\t...svg,\n\t\t...mathMl,\n\t\t...xml\n\t]);\n\tlet CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeNameCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tallowCustomizedBuiltInElements: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: false\n\t\t}\n\t}));\n\tlet FORBID_TAGS = null;\n\tlet FORBID_ATTR = null;\n\tconst EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {\n\t\ttagCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t},\n\t\tattributeCheck: {\n\t\t\twritable: true,\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t\tvalue: null\n\t\t}\n\t}));\n\tlet ALLOW_ARIA_ATTR = true;\n\tlet ALLOW_DATA_ATTR = true;\n\tlet ALLOW_UNKNOWN_PROTOCOLS = false;\n\tlet ALLOW_SELF_CLOSE_IN_ATTR = true;\n\tlet SAFE_FOR_TEMPLATES = false;\n\tlet SAFE_FOR_XML = true;\n\tlet WHOLE_DOCUMENT = false;\n\tlet SET_CONFIG = false;\n\tlet SET_CONFIG_ALLOWED_TAGS = null;\n\tlet SET_CONFIG_ALLOWED_ATTR = null;\n\tlet FORCE_BODY = false;\n\tlet RETURN_DOM = false;\n\tlet RETURN_DOM_FRAGMENT = false;\n\tlet RETURN_TRUSTED_TYPE = false;\n\tlet SANITIZE_DOM = true;\n\tlet SANITIZE_NAMED_PROPS = false;\n\tconst SANITIZE_NAMED_PROPS_PREFIX = \"user-content-\";\n\tlet KEEP_CONTENT = true;\n\tlet IN_PLACE = false;\n\tlet IN_PLACE_VISITED = null;\n\tlet USE_PROFILES = {};\n\tlet FORBID_CONTENTS = null;\n\tconst DEFAULT_FORBID_CONTENTS = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"audio\",\n\t\t\"colgroup\",\n\t\t\"desc\",\n\t\t\"foreignobject\",\n\t\t\"head\",\n\t\t\"iframe\",\n\t\t\"math\",\n\t\t\"mi\",\n\t\t\"mn\",\n\t\t\"mo\",\n\t\t\"ms\",\n\t\t\"mtext\",\n\t\t\"noembed\",\n\t\t\"noframes\",\n\t\t\"noscript\",\n\t\t\"plaintext\",\n\t\t\"script\",\n\t\t\"selectedcontent\",\n\t\t\"style\",\n\t\t\"svg\",\n\t\t\"template\",\n\t\t\"thead\",\n\t\t\"title\",\n\t\t\"video\",\n\t\t\"xmp\"\n\t]);\n\tlet DATA_URI_TAGS = null;\n\tconst DEFAULT_DATA_URI_TAGS = addToSet({}, [\n\t\t\"audio\",\n\t\t\"video\",\n\t\t\"img\",\n\t\t\"source\",\n\t\t\"image\",\n\t\t\"track\"\n\t]);\n\tlet URI_SAFE_ATTRIBUTES = null;\n\tconst DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n\t\t\"alt\",\n\t\t\"class\",\n\t\t\"for\",\n\t\t\"id\",\n\t\t\"label\",\n\t\t\"name\",\n\t\t\"pattern\",\n\t\t\"placeholder\",\n\t\t\"role\",\n\t\t\"summary\",\n\t\t\"title\",\n\t\t\"value\",\n\t\t\"style\",\n\t\t\"xmlns\"\n\t]);\n\tconst MATHML_NAMESPACE = \"http://www.w3.org/1998/Math/MathML\";\n\tconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\n\tconst HTML_NAMESPACE = \"http://www.w3.org/1999/xhtml\";\n\tlet NAMESPACE = HTML_NAMESPACE;\n\tlet IS_EMPTY_INPUT = false;\n\tlet ALLOWED_NAMESPACES = null;\n\tconst DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [\n\t\tMATHML_NAMESPACE,\n\t\tSVG_NAMESPACE,\n\t\tHTML_NAMESPACE\n\t], stringToString);\n\tconst DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([\n\t\t\"mi\",\n\t\t\"mo\",\n\t\t\"mn\",\n\t\t\"ms\",\n\t\t\"mtext\"\n\t]);\n\tlet MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);\n\tconst DEFAULT_HTML_INTEGRATION_POINTS = freeze([\"annotation-xml\"]);\n\tlet HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);\n\tconst COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n\t\t\"title\",\n\t\t\"style\",\n\t\t\"font\",\n\t\t\"a\",\n\t\t\"script\"\n\t]);\n\tlet PARSER_MEDIA_TYPE = null;\n\tconst SUPPORTED_PARSER_MEDIA_TYPES = [\"application/xhtml+xml\", \"text/html\"];\n\tconst DEFAULT_PARSER_MEDIA_TYPE = \"text/html\";\n\tlet transformCaseFunc = null;\n\tlet CONFIG = null;\n\tconst formElement = document.createElement(\"form\");\n\tconst isRegexOrFunction = function isRegexOrFunction(testValue) {\n\t\treturn testValue instanceof RegExp || testValue instanceof Function;\n\t};\n\t/**\n\t* _parseConfig\n\t*\n\t* @param cfg optional config literal\n\t*/\n\tconst _parseConfig = function _parseConfig() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\tif (CONFIG && CONFIG === cfg) return;\n\t\tif (!cfg || typeof cfg !== \"object\") cfg = {};\n\t\tcfg = clone(cfg);\n\t\tPARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\t\ttransformCaseFunc = PARSER_MEDIA_TYPE === \"application/xhtml+xml\" ? stringToString : stringToLowerCase;\n\t\tALLOWED_TAGS = _resolveSetOption(cfg, \"ALLOWED_TAGS\", DEFAULT_ALLOWED_TAGS, { transform: transformCaseFunc });\n\t\tALLOWED_ATTR = _resolveSetOption(cfg, \"ALLOWED_ATTR\", DEFAULT_ALLOWED_ATTR, { transform: transformCaseFunc });\n\t\tALLOWED_NAMESPACES = _resolveSetOption(cfg, \"ALLOWED_NAMESPACES\", DEFAULT_ALLOWED_NAMESPACES, { transform: stringToString });\n\t\tURI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, \"ADD_URI_SAFE_ATTR\", DEFAULT_URI_SAFE_ATTRIBUTES, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_URI_SAFE_ATTRIBUTES\n\t\t});\n\t\tDATA_URI_TAGS = _resolveSetOption(cfg, \"ADD_DATA_URI_TAGS\", DEFAULT_DATA_URI_TAGS, {\n\t\t\ttransform: transformCaseFunc,\n\t\t\tbase: DEFAULT_DATA_URI_TAGS\n\t\t});\n\t\tFORBID_CONTENTS = _resolveSetOption(cfg, \"FORBID_CONTENTS\", DEFAULT_FORBID_CONTENTS, { transform: transformCaseFunc });\n\t\tFORBID_TAGS = _resolveSetOption(cfg, \"FORBID_TAGS\", clone({}), { transform: transformCaseFunc });\n\t\tFORBID_ATTR = _resolveSetOption(cfg, \"FORBID_ATTR\", clone({}), { transform: transformCaseFunc });\n\t\tUSE_PROFILES = objectHasOwnProperty(cfg, \"USE_PROFILES\") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === \"object\" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;\n\t\tALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;\n\t\tALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;\n\t\tALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;\n\t\tALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;\n\t\tSAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;\n\t\tSAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;\n\t\tWHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;\n\t\tRETURN_DOM = cfg.RETURN_DOM || false;\n\t\tRETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;\n\t\tRETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;\n\t\tFORCE_BODY = cfg.FORCE_BODY || false;\n\t\tSANITIZE_DOM = cfg.SANITIZE_DOM !== false;\n\t\tSANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;\n\t\tKEEP_CONTENT = cfg.KEEP_CONTENT !== false;\n\t\tIN_PLACE = cfg.IN_PLACE || false;\n\t\tIS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;\n\t\tNAMESPACE = typeof cfg.NAMESPACE === \"string\" ? cfg.NAMESPACE : HTML_NAMESPACE;\n\t\tMATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"MATHML_TEXT_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS));\n\t\tHTML_INTEGRATION_POINTS = _resolveObjectOption(cfg, \"HTML_INTEGRATION_POINTS\", () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS));\n\t\tconst customElementHandling = _resolveObjectOption(cfg, \"CUSTOM_ELEMENT_HANDLING\", () => create(null));\n\t\tCUSTOM_ELEMENT_HANDLING = create(null);\n\t\tif (objectHasOwnProperty(customElementHandling, \"tagNameCheck\") && isRegexOrFunction(customElementHandling.tagNameCheck)) CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"attributeNameCheck\") && isRegexOrFunction(customElementHandling.attributeNameCheck)) CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;\n\t\tif (objectHasOwnProperty(customElementHandling, \"allowCustomizedBuiltInElements\") && typeof customElementHandling.allowCustomizedBuiltInElements === \"boolean\") CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;\n\t\tseal(CUSTOM_ELEMENT_HANDLING);\n\t\tif (SAFE_FOR_TEMPLATES) ALLOW_DATA_ATTR = false;\n\t\tif (RETURN_DOM_FRAGMENT) RETURN_DOM = true;\n\t\tif (USE_PROFILES) {\n\t\t\tALLOWED_TAGS = addToSet({}, text);\n\t\t\tALLOWED_ATTR = create(null);\n\t\t\tif (USE_PROFILES.html === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, html$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, html);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svg === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svg$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.svgFilters === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, svgFilters);\n\t\t\t\taddToSet(ALLOWED_ATTR, svg);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t\tif (USE_PROFILES.mathMl === true) {\n\t\t\t\taddToSet(ALLOWED_TAGS, mathMl$1);\n\t\t\t\taddToSet(ALLOWED_ATTR, mathMl);\n\t\t\t\taddToSet(ALLOWED_ATTR, xml);\n\t\t\t}\n\t\t}\n\t\tEXTRA_ELEMENT_HANDLING.tagCheck = null;\n\t\tEXTRA_ELEMENT_HANDLING.attributeCheck = null;\n\t\tif (objectHasOwnProperty(cfg, \"ADD_TAGS\")) {\n\t\t\tif (typeof cfg.ADD_TAGS === \"function\") EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n\t\t\telse if (arrayIsArray(cfg.ADD_TAGS)) {\n\t\t\t\tif (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\t\t\taddToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_ATTR\")) {\n\t\t\tif (typeof cfg.ADD_ATTR === \"function\") EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n\t\t\telse if (arrayIsArray(cfg.ADD_ATTR)) {\n\t\t\t\tif (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\t\t\taddToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n\t\t\t}\n\t\t}\n\t\tif (objectHasOwnProperty(cfg, \"ADD_FORBID_CONTENTS\") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {\n\t\t\tif (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) FORBID_CONTENTS = clone(FORBID_CONTENTS);\n\t\t\taddToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n\t\t}\n\t\tif (KEEP_CONTENT) ALLOWED_TAGS[\"#text\"] = true;\n\t\tif (WHOLE_DOCUMENT) addToSet(ALLOWED_TAGS, [\n\t\t\t\"html\",\n\t\t\t\"head\",\n\t\t\t\"body\"\n\t\t]);\n\t\tif (ALLOWED_TAGS.table) {\n\t\t\taddToSet(ALLOWED_TAGS, [\"tbody\"]);\n\t\t\tdelete FORBID_TAGS.tbody;\n\t\t}\n\t\tif (cfg.TRUSTED_TYPES_POLICY) {\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createHTML\\\" hook.\");\n\t\t\tif (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== \"function\") throw typeErrorCreate(\"TRUSTED_TYPES_POLICY configuration option must provide a \\\"createScriptURL\\\" hook.\");\n\t\t\tconst previousTrustedTypesPolicy = trustedTypesPolicy;\n\t\t\ttrustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\t\t\ttry {\n\t\t\t\temptyHTML = _createTrustedHTML(\"\");\n\t\t\t} catch (error) {\n\t\t\t\ttrustedTypesPolicy = previousTrustedTypesPolicy;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t} else if (cfg.TRUSTED_TYPES_POLICY === null) {\n\t\t\ttrustedTypesPolicy = void 0;\n\t\t\temptyHTML = \"\";\n\t\t} else {\n\t\t\tif (trustedTypesPolicy === void 0) trustedTypesPolicy = _getDefaultTrustedTypesPolicy();\n\t\t\tif (trustedTypesPolicy && typeof emptyHTML === \"string\") emptyHTML = _createTrustedHTML(\"\");\n\t\t}\n\t\tif (freeze) freeze(cfg);\n\t\tCONFIG = cfg;\n\t};\n\tconst ALL_SVG_TAGS = addToSet({}, [\n\t\t...svg$1,\n\t\t...svgFilters,\n\t\t...svgDisallowed\n\t]);\n\tconst ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\t/**\n\t* Namespace rules for an element in the SVG namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"svg\";\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE) return tagName === \"svg\" && (parentTagName === \"annotation-xml\" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n\t\treturn Boolean(ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the MathML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === HTML_NAMESPACE) return tagName === \"math\";\n\t\tif (parent.namespaceURI === SVG_NAMESPACE) return tagName === \"math\" && HTML_INTEGRATION_POINTS[parentTagName];\n\t\treturn Boolean(ALL_MATHML_TAGS[tagName]);\n\t};\n\t/**\n\t* Namespace rules for an element in the HTML namespace.\n\t*\n\t* @param tagName the element's lowercase tag name\n\t* @param parent the (possibly simulated) parent node\n\t* @param parentTagName the parent's lowercase tag name\n\t* @returns true if a spec-compliant parser could produce this element\n\t*/\n\tconst _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {\n\t\tif (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) return false;\n\t\tif (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) return false;\n\t\treturn !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n\t};\n\t/**\n\t* @param element a DOM element whose namespace is being checked\n\t* @returns Return false if the element has a\n\t* namespace that a spec-compliant parser would never\n\t* return. Return true otherwise.\n\t*/\n\tconst _checkValidNamespace = function _checkValidNamespace(element) {\n\t\tconst elementNamespace = _readNamespaceURI(element);\n\t\tconst tagName = stringToLowerCase(_readNodeName(element));\n\t\tconst parentNode = getParentNode(element);\n\t\tlet parent;\n\t\tlet parentTagName;\n\t\tif (parentNode && _readNodeType(parentNode) === NODE_TYPE.element) {\n\t\t\tparent = { namespaceURI: _readNamespaceURI(parentNode) };\n\t\t\tparentTagName = stringToLowerCase(_readNodeName(parentNode));\n\t\t} else {\n\t\t\tparent = { namespaceURI: NAMESPACE };\n\t\t\tparentTagName = \"template\";\n\t\t}\n\t\tif (!ALLOWED_NAMESPACES[elementNamespace]) return false;\n\t\tif (elementNamespace === SVG_NAMESPACE) return _checkSvgNamespace(tagName, parent, parentTagName);\n\t\tif (elementNamespace === MATHML_NAMESPACE) return _checkMathMlNamespace(tagName, parent, parentTagName);\n\t\tif (elementNamespace === HTML_NAMESPACE) return _checkHtmlNamespace(tagName, parent, parentTagName);\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && ALLOWED_NAMESPACES[elementNamespace]) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* _forceRemove\n\t*\n\t* @param node a DOM node\n\t*/\n\tconst _forceRemove = function _forceRemove(node) {\n\t\tarrayPush(DOMPurify.removed, { element: node });\n\t\ttry {\n\t\t\tgetParentNode(node).removeChild(node);\n\t\t} catch (_) {\n\t\t\tremove(node);\n\t\t\tif (!getParentNode(node)) throw typeErrorCreate(\"a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place\");\n\t\t}\n\t};\n\t/**\n\t* _stripAttributeNode\n\t*\n\t* Remove a single Attr node case/namespace-exactly on an attribute-teardown\n\t* path. Name-based removeAttribute() ASCII-lowercases its lookup key for an\n\t* HTML element in an HTML document and so silently misses a case-preserved\n\t* handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect\n\t* _removeAttribute() was fixed for, which a name-based call would reintroduce\n\t* on these IN_PLACE teardown paths. Unlike _removeAttribute this does not\n\t* record into DOMPurify.removed: the neutralize passes intentionally do not\n\t* book-keep. A clobbered/detached node falls back to best-effort name-based\n\t* removal.\n\t*\n\t* @param element the element to strip the attribute from\n\t* @param attribute the Attr node to remove\n\t* @param name the attribute's name, for the fallback path\n\t*/\n\tconst _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {\n\t\ttry {\n\t\t\tremoveAttributeNode(element, attribute);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* Fail-closed teardown of an in-place root: strip every disallowed attribute\n\t* in the subtree first, so nothing armed is left behind, then remove all\n\t* children and the root's own attributes.\n\t*\n\t* @param root the in-place root to empty\n\t*/\n\tconst _neutralizeRoot = function _neutralizeRoot(root) {\n\t\t_neutralizeSubtree(root);\n\t\tconst childNodes = getChildNodes(root);\n\t\tif (childNodes) arrayForEach(arraySlice(childNodes), (child) => {\n\t\t\ttry {\n\t\t\t\tremove(child);\n\t\t\t} catch (_) {}\n\t\t});\n\t\tconst attributes = _readNodeType(root) === NODE_TYPE.element ? getAttributes(root) : null;\n\t\tif (attributes) for (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name === \"string\") _stripAttributeNode(root, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* Removes an attribute, preferably as its exact Attr node: name-based\n\t* removal lowercases the name in HTML documents and misses case-preserved\n\t* names, e.g. from imported XHTML.\n\t*\n\t* @param name an Attribute name\n\t* @param element a DOM node\n\t* @param attr the exact Attr node to remove, when the caller has it\n\t*/\n\tconst _removeAttribute = function _removeAttribute(name, element, attr) {\n\t\tif (!attr) try {\n\t\t\tattr = element.getAttributeNode(name);\n\t\t} catch (_) {\n\t\t\tattr = null;\n\t\t}\n\t\tarrayPush(DOMPurify.removed, {\n\t\t\tattribute: attr || null,\n\t\t\tfrom: element\n\t\t});\n\t\ttry {\n\t\t\tif (attr) removeAttributeNode(element, attr);\n\t\t\telse element.removeAttribute(name);\n\t\t} catch (_) {\n\t\t\ttry {\n\t\t\t\telement.removeAttribute(name);\n\t\t\t} catch (_) {}\n\t\t}\n\t\tif (name === \"is\") {\n\t\t\tif (RETURN_DOM || RETURN_DOM_FRAGMENT) try {\n\t\t\t\t_forceRemove(element);\n\t\t\t} catch (_) {}\n\t\t\telse try {\n\t\t\t\telement.setAttribute(name, \"\");\n\t\t\t} catch (_) {}\n\t\t}\n\t};\n\t/**\n\t* Removes every attribute the configuration does not allow. Used to\n\t* neutralize nodes discarded from an in-place tree.\n\t*\n\t* @param element the element to strip\n\t*/\n\tconst _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {\n\t\tconst attributes = getAttributes(element);\n\t\tif (!attributes) return;\n\t\tfor (let i = attributes.length - 1; i >= 0; --i) {\n\t\t\tconst attribute = attributes[i];\n\t\t\tconst name = attribute && attribute.name;\n\t\t\tif (typeof name !== \"string\" || ALLOWED_ATTR[transformCaseFunc(name)]) continue;\n\t\t\t_stripAttributeNode(element, attribute, name);\n\t\t}\n\t};\n\t/**\n\t* Iterative depth-first walk, so deep trees cannot overflow the call stack,\n\t* reading through the cached getters, so clobbering cannot hide children.\n\t* When `visit` returns false, the node's children are skipped. With\n\t* `intoShadow`, open shadow roots are walked after their host's children.\n\t*\n\t* @param root where to start\n\t* @param visit called for every node\n\t* @param intoShadow whether to enter open shadow roots\n\t*/\n\tconst _walkTree = function _walkTree(root, visit) {\n\t\tlet intoShadow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n\t\tconst stack = [root];\n\t\twhile (stack.length > 0) {\n\t\t\tconst node = stack.pop();\n\t\t\tif (visit(node) === false) continue;\n\t\t\tif (intoShadow && _readNodeType(node) === NODE_TYPE.element) {\n\t\t\t\tconst shadowRoot = getShadowRoot(node);\n\t\t\t\tif (_isDocumentFragment(shadowRoot)) stack.push(shadowRoot);\n\t\t\t}\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push(childNodes[i]);\n\t\t}\n\t};\n\t/**\n\t* Strips disallowed attributes from every element of a discarded subtree,\n\t* so a handler that is already queued (a loading image) cannot fire.\n\t*\n\t* @param root the root of a removed subtree\n\t*/\n\tconst _neutralizeSubtree = function _neutralizeSubtree(root) {\n\t\t_walkTree(root, (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element) _stripDisallowedAttributes(node);\n\t\t});\n\t};\n\t/**\n\t* All nodes under `root`, root first, including open shadow roots. Template\n\t* content is not entered, it is inert.\n\t*\n\t* @param root the in-place root\n\t* @return the nodes\n\t*/\n\tconst _collectLiveNodes = function _collectLiveNodes(root) {\n\t\tconst nodes = [];\n\t\t_walkTree(root, (node) => {\n\t\t\tnodes.push(node);\n\t\t}, true);\n\t\treturn nodes;\n\t};\n\t/**\n\t* Strips disallowed attributes from every element that was under the\n\t* in-place root when the call started and no longer is, whatever removed\n\t* or moved it.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t*/\n\tconst _neutralizeEscapedElements = function _neutralizeEscapedElements(root, before) {\n\t\tconst reachable = setCreate();\n\t\tarrayForEach(_collectLiveNodes(root), (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element) setAdd(reachable, node);\n\t\t});\n\t\tarrayForEach(before, (node) => {\n\t\t\tif (_readNodeType(node) === NODE_TYPE.element && !setHas(reachable, node)) _stripDisallowedAttributes(node);\n\t\t});\n\t};\n\t/**\n\t* Neutralizes everything that left the in-place tree during the call: what\n\t* DOMPurify removed, and what hooks or custom elements removed or moved out.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t* @return true if the root itself was removed\n\t*/\n\tconst _neutralizeDiscarded = function _neutralizeDiscarded(root, before) {\n\t\tlet rootRemoved = false;\n\t\tarrayForEach(DOMPurify.removed, (entry) => {\n\t\t\tif (entry.element) {\n\t\t\t\trootRemoved = rootRemoved || entry.element === root;\n\t\t\t\t_neutralizeSubtree(entry.element);\n\t\t\t}\n\t\t});\n\t\t_neutralizeEscapedElements(root, before);\n\t\treturn rootRemoved;\n\t};\n\tconst MAX_UNVISITED_ROUNDS = 8;\n\t/**\n\t* The walk only moves forward, so a node moved to a position it already\n\t* passed is never visited. Give every original node that is still in the\n\t* tree but unvisited the normal treatment, hooks included. Nodes created\n\t* during the call are left alone. Fails closed if the tree keeps changing.\n\t*\n\t* @param root the in-place root\n\t* @param before the root's nodes, collected before the walk\n\t*/\n\tconst _sanitizeUnvisitedNodes = function _sanitizeUnvisitedNodes(root, before) {\n\t\tconst visited = IN_PLACE_VISITED;\n\t\tlet original = null;\n\t\tconst getOriginal = () => {\n\t\t\tif (!original) {\n\t\t\t\toriginal = setCreate();\n\t\t\t\tarrayForEach(before, (beforeNode) => {\n\t\t\t\t\tsetAdd(original, beforeNode);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn original;\n\t\t};\n\t\tfor (let round = 0;; round++) {\n\t\t\tconst live = _collectLiveNodes(root);\n\t\t\tconst containers = [root];\n\t\t\tlet pending = false;\n\t\t\tarrayForEach(live, (node) => {\n\t\t\t\tif (_readNodeType(node) === NODE_TYPE.documentFragment) arrayPush(containers, node);\n\t\t\t\telse if (!pending && !setHas(visited, node)) pending = setHas(getOriginal(), node);\n\t\t\t});\n\t\t\tif (!pending) return;\n\t\t\tif (round >= MAX_UNVISITED_ROUNDS) throw typeErrorCreate(\"the tree kept changing during in-place sanitization; refusing to return it\");\n\t\t\tarrayForEach(containers, (container, index) => {\n\t\t\t\t_sanitizeUnvisitedIn(container, index > 0, root, getOriginal());\n\t\t\t});\n\t\t}\n\t};\n\t/**\n\t* One _sanitizeUnvisitedNodes pass over the root or an open shadow root.\n\t*\n\t* @param container the root or an open shadow root\n\t* @param inShadow whether container is a shadow root\n\t* @param root the in-place root\n\t* @param original the root's nodes collected before the walk, as a set\n\t*/\n\tconst _sanitizeUnvisitedIn = function _sanitizeUnvisitedIn(container, inShadow, root, original) {\n\t\tconst iterator = _createNodeIterator(container);\n\t\tlet node;\n\t\twhile (node = iterator.nextNode()) {\n\t\t\tif (!setHas(original, node) || setHas(IN_PLACE_VISITED, node)) continue;\n\t\t\tif (inShadow) _executeHooks(hooks.uponSanitizeShadowNode, node, null);\n\t\t\t_sanitizeElements(node, root);\n\t\t\t_sanitizeAttributes(node, root);\n\t\t\tif (_isDocumentFragment(node.content)) _sanitizeShadowDOM2(node.content);\n\t\t}\n\t};\n\t/**\n\t* Records that _sanitizeElements processed `node`. No-op outside IN_PLACE.\n\t*\n\t* @param node the node being processed\n\t*/\n\tconst _markVisited = function _markVisited(node) {\n\t\tif (IN_PLACE_VISITED) setAdd(IN_PLACE_VISITED, node);\n\t};\n\t/**\n\t* Patch-linkage attributes (declarative partial updates): `patchsrc`\n\t* always, `for` everywhere except on <label> and <output>. Gated on\n\t* SAFE_FOR_XML. Shared by the IN_PLACE pre-pass and _isValidAttribute.\n\t*\n\t* @param lcName the transformCaseFunc'd attribute name\n\t* @param lcTag the transformCaseFunc'd tag name of the carrying element\n\t* @return true if the attribute is patch linkage and must be dropped\n\t*/\n\tconst _isPatchLinkageAttribute = function _isPatchLinkageAttribute(lcName, lcTag) {\n\t\tif (!SAFE_FOR_XML) return false;\n\t\tif (lcName === \"patchsrc\") return true;\n\t\treturn lcName === \"for\" && lcTag !== \"label\" && lcTag !== \"output\";\n\t};\n\t/**\n\t* IN_PLACE pre-pass: sever all patch linkage before the walk, so no patch\n\t* can fire mid-walk into a part of the tree the walker already passed.\n\t* Removes range markers (processing instructions, comments with markup)\n\t* and strips linkage attributes. It cannot undo a patch that already fired.\n\t*\n\t* TODO: if the shipped feature can patch through `for` on <label>/<output>,\n\t* drop that pair here too (see test/declarative-patch-probe.html).\n\t*\n\t* @param root the in-place root to sweep\n\t*/\n\tconst _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {\n\t\tif (!SAFE_FOR_XML) return;\n\t\t_walkTree(root, (node) => {\n\t\t\tconst nodeType = _readNodeType(node);\n\t\t\tif (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {\n\t\t\t\ttry {\n\t\t\t\t\tremove(node);\n\t\t\t\t} catch (_) {}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (nodeType === NODE_TYPE.element) {\n\t\t\t\tconst element = node;\n\t\t\t\tconst lcTag = transformCaseFunc(_readNodeName(node));\n\t\t\t\ttry {\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"patchsrc\")) element.removeAttribute(\"patchsrc\");\n\t\t\t\t\tif (element.hasAttribute && element.hasAttribute(\"for\") && _isPatchLinkageAttribute(\"for\", lcTag)) element.removeAttribute(\"for\");\n\t\t\t\t} catch (_) {}\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* _initDocument\n\t*\n\t* @param dirty - a string of dirty markup\n\t* @return a DOM, filled with the dirty markup\n\t*/\n\tconst _initDocument = function _initDocument(dirty) {\n\t\tlet doc = null;\n\t\tlet leadingWhitespace = null;\n\t\tif (FORCE_BODY) dirty = \"<remove></remove>\" + dirty;\n\t\telse {\n\t\t\tconst matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n\t\t\tleadingWhitespace = matches && matches[0];\n\t\t}\n\t\tif (PARSER_MEDIA_TYPE === \"application/xhtml+xml\" && NAMESPACE === HTML_NAMESPACE) dirty = \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\"><head></head><body>\" + dirty + \"</body></html>\";\n\t\tconst dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;\n\t\tif (NAMESPACE === HTML_NAMESPACE) try {\n\t\t\tdoc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n\t\t} catch (_) {}\n\t\tif (!doc || !doc.documentElement) {\n\t\t\tdoc = implementation.createDocument(NAMESPACE, \"template\", null);\n\t\t\ttry {\n\t\t\t\tdoc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n\t\t\t} catch (_) {}\n\t\t}\n\t\tconst body = doc.body || doc.documentElement;\n\t\tif (dirty && leadingWhitespace) body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n\t\tif (NAMESPACE === HTML_NAMESPACE) return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? \"html\" : \"body\")[0];\n\t\treturn WHOLE_DOCUMENT ? doc.documentElement : body;\n\t};\n\t/**\n\t* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n\t*\n\t* @param root The root element or node to start traversing on.\n\t* @return The created NodeIterator\n\t*/\n\tconst _createNodeIterator = function _createNodeIterator(root) {\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;\n\t\treturn createNodeIterator.call(doc || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n\t};\n\t/**\n\t* Replace template expression syntax (mustache, ERB, template\n\t* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub\n\t* sites. Order matters: mustache, then ERB, then template literal.\n\t*\n\t* @param value the string to scrub\n\t* @returns the scrubbed string\n\t*/\n\tconst _stripTemplateExpressions = function _stripTemplateExpressions(value) {\n\t\tvalue = stringReplace(value, MUSTACHE_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, ERB_EXPR$1, \" \");\n\t\tvalue = stringReplace(value, TMPLIT_EXPR$1, \" \");\n\t\treturn value;\n\t};\n\t/**\n\t* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the\n\t* character data of an element subtree. Used as the final safety net for\n\t* SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions\n\t* which only form after text-node normalization (e.g. fragments split across\n\t* stripped elements) cannot survive into a template-evaluating framework.\n\t*\n\t* Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`\n\t* in place rather than round-tripping through innerHTML. This preserves\n\t* descendant node references (important for IN_PLACE callers), avoids a\n\t* serialize/reparse cycle, and reads literal character data — which means\n\t* `<%...%>` in text content matches the ERB regex against its real bytes\n\t* instead of the HTML-entity-escaped form innerHTML would produce.\n\t*\n\t* Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for\n\t* attributes is performed during the per-node `_sanitizeAttributes` pass.\n\t*\n\t* @param node The root element whose character data should be scrubbed.\n\t*/\n\tconst _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {\n\t\tvar _node$querySelectorAl;\n\t\t_scrubOwnCharacterData(node);\n\t\tconst templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, \"template\");\n\t\tif (templates) arrayForEach(templates, (tmpl) => {\n\t\t\tif (_isDocumentFragment(tmpl.content)) _scrubTemplateExpressions2(tmpl.content);\n\t\t});\n\t};\n\t/**\n\t* _scrubOwnCharacterData\n\t*\n\t* Non-recursive core of _scrubTemplateExpressions: normalize `node` and\n\t* strip template expressions from its own character data only. Does not\n\t* enter <template>.content or attached shadow roots (NodeIterator never\n\t* does). Used by _sanitizeShadowDOM, where every nested template content\n\t* and shadow root is already walked - and therefore scrubbed - by its own\n\t* recursive _sanitizeShadowDOM call; recursing here as well would rescrub\n\t* each nested fragment once per ancestor, which is quadratic in nesting\n\t* depth.\n\t*\n\t* @param node The root whose own character data should be scrubbed.\n\t*/\n\tconst _scrubOwnCharacterData = function _scrubOwnCharacterData(node) {\n\t\tnode.normalize();\n\t\tconst doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;\n\t\tconst walker = createNodeIterator.call(doc || node, node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);\n\t\tlet currentNode = walker.nextNode();\n\t\twhile (currentNode) {\n\t\t\tcurrentNode.data = _stripTemplateExpressions(currentNode.data);\n\t\t\tcurrentNode = walker.nextNode();\n\t\t}\n\t};\n\t/**\n\t* _isClobbered\n\t*\n\t* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML\n\t* interface with [LegacyOverrideBuiltIns]; a descendant element with a\n\t* `name` attribute matching a prototype property shadows that property\n\t* on direct reads. We use this check at the IN_PLACE entry-point and\n\t* during attribute sanitization to refuse clobbered forms.\n\t*\n\t* @param element element to check for clobbering attacks\n\t* @return true if clobbered, false if safe\n\t*/\n\tconst _isClobbered = function _isClobbered(element) {\n\t\tconst realTagName = getNodeName ? getNodeName(element) : null;\n\t\tif (typeof realTagName !== \"string\") return false;\n\t\tif (transformCaseFunc(realTagName) !== \"form\") return false;\n\t\treturn typeof element.nodeName !== \"string\" || typeof element.textContent !== \"string\" || typeof element.removeChild !== \"function\" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== \"function\" || typeof element.removeAttributeNode !== \"function\" || typeof element.getAttributeNode !== \"function\" || typeof element.setAttribute !== \"function\" || typeof element.namespaceURI !== \"string\" || typeof element.insertBefore !== \"function\" || typeof element.hasChildNodes !== \"function\" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);\n\t};\n\t/**\n\t* Checks whether the given value is a DocumentFragment from any realm.\n\t*\n\t* The realm-independent replacement reads `nodeType` through the cached\n\t* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE\n\t* constant (11). nodeType is a numeric value resolved from the node's\n\t* internal slot, identical across realms for the same kind of node.\n\t*\n\t* @param value object to check\n\t* @return true if value is a DocumentFragment-shaped node from any realm\n\t*/\n\tconst _isDocumentFragment = function _isDocumentFragment(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn getNodeType(value) === NODE_TYPE.documentFragment;\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* Checks whether the given object is a DOM node, including nodes that\n\t* originate from a different window/realm (e.g. an iframe's\n\t* contentDocument). The previous `value instanceof Node` check was\n\t* realm-bound: nodes from a different window failed it, causing\n\t* sanitize() to silently stringify them and reset IN_PLACE to false,\n\t* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.\n\t*\n\t* @param value object to check whether it's a DOM node\n\t* @return true if value is a DOM node from any realm\n\t*/\n\tconst _isNode = function _isNode(value) {\n\t\tif (!getNodeType || typeof value !== \"object\" || value === null) return false;\n\t\ttry {\n\t\t\treturn typeof getNodeType(value) === \"number\";\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t};\n\tfunction _executeHooks(hooks, currentNode, data) {\n\t\tif (hooks.length === 0) return;\n\t\tarrayForEach(hooks, (hook) => {\n\t\t\thook.call(DOMPurify, currentNode, data, CONFIG);\n\t\t});\n\t}\n\t/**\n\t* Structural-threat checks that condemn a node regardless of the\n\t* allowlists: mXSS via namespace confusion, risky CSS construction,\n\t* processing instructions, markup-bearing comments. Pure predicate;\n\t* the caller removes. Check order is load-bearing.\n\t*\n\t* @param currentNode the node to inspect\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node must be removed\n\t*/\n\tconst _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {\n\t\tif (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) return true;\n\t\tif (SAFE_FOR_XML && LITERAL_TEXT_ELEMENTS[tagName] && _readNodeType(currentNode) === NODE_TYPE.element && _readNamespaceURI(currentNode) === HTML_NAMESPACE && (_isNode(currentNode.firstElementChild) || typeof currentNode.textContent === \"string\" && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent))) return true;\n\t\tif (currentNode.nodeType === NODE_TYPE.processingInstruction) return true;\n\t\tif (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) return true;\n\t\treturn false;\n\t};\n\t/**\n\t* Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate\n\t* function, per the validation in _parseConfig) against a name.\n\t* Additional arguments are forwarded to predicate functions - the\n\t* attributeNameCheck predicate receives the tag name as its second\n\t* argument. A null/absent check never matches.\n\t*\n\t* @param check the configured tagNameCheck / attributeNameCheck value\n\t* @param name the name to test\n\t* @param args extra arguments forwarded to a predicate function\n\t* @return true if the check matches the name\n\t*/\n\tconst _matchesNameCheck = function _matchesNameCheck(check, name) {\n\t\tif (check instanceof RegExp) return regExpTest(check, name);\n\t\tif (check instanceof Function) {\n\t\t\tfor (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];\n\t\t\treturn Boolean(check(name, ...args));\n\t\t}\n\t\treturn false;\n\t};\n\t/**\n\t* Handle a node whose tag is forbidden or not allowlisted: keep\n\t* allowed custom elements (false return exits _sanitizeElements\n\t* early - the namespace and fallback-tag removal checks are\n\t* intentionally skipped for kept custom elements), else hoist\n\t* content per KEEP_CONTENT and remove.\n\t*\n\t* A kept custom element is the ONLY case in which this function\n\t* returns false, so the caller uses that return value to run the\n\t* afterSanitizeElements hook on the kept element and keep the\n\t* element-hook lifecycle consistent with normal allowlisted\n\t* elements (GHSA-c2j3-45gr-mqc4).\n\t*\n\t* @param currentNode the disallowed node\n\t* @param tagName the node's transformCaseFunc'd tag name\n\t* @return true if the node was removed, false if kept\n\t*/\n\tconst _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {\n\t\tif (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) return false;\n\t\tif (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && !FORBID_CONTENTS[stringToLowerCase(tagName)]) {\n\t\t\tconst parentNode = getParentNode(currentNode);\n\t\t\tconst childNodes = getChildNodes(currentNode);\n\t\t\tif (childNodes && parentNode) {\n\t\t\t\tconst childCount = childNodes.length;\n\t\t\t\tfor (let i = childCount - 1; i >= 0; --i) {\n\t\t\t\t\tconst hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];\n\t\t\t\t\tparentNode.insertBefore(hoisted, getNextSibling(currentNode));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_forceRemove(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* Fork a hook-mutable allowlist off its shared binding the first time a\n\t* (possibly lazily-installed) uponSanitize* hook is about to see it, so the\n\t* hook cannot widen the per-instance default or the setConfig binding by\n\t* reference and leak past the call. Returns the set unchanged once it is\n\t* already call-local, so repeated calls across elements are idempotent.\n\t*\n\t* @param hookList the uponSanitize* hook array for this event\n\t* @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding\n\t* @param defaultSet the per-instance DEFAULT_ALLOWED_* constant\n\t* @param setConfigSet the captured setConfig() binding, or null\n\t* @return a call-local clone if a hook is present and set is still shared,\n\t* else set unchanged\n\t*/\n\tconst _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {\n\t\tif (hookList.length === 0) return set;\n\t\treturn set === defaultSet || set === setConfigSet ? clone(set) : set;\n\t};\n\t/**\n\t* A hook may have detached the node it was called for. If so, treat it as\n\t* removed and stop processing it; the walk root is exempt. On the IN_PLACE\n\t* path the detached subtree is neutralized right away.\n\t*\n\t* @param currentNode the node a hook may have detached\n\t* @param root the current walk root\n\t* @return true if the node was detached\n\t*/\n\tconst _handleHookDetachedNode = function _handleHookDetachedNode(currentNode, root) {\n\t\tif (currentNode === root || getParentNode(currentNode) !== null) return false;\n\t\tif (IN_PLACE) _neutralizeSubtree(currentNode);\n\t\treturn true;\n\t};\n\t/**\n\t* _sanitizeElements\n\t*\n\t* @protect nodeName\n\t* @protect textContent\n\t* @protect removeChild\n\t* @param currentNode to check for permission to exist\n\t* @return true if node was killed, false if left alive\n\t*/\n\tconst _sanitizeElements = function _sanitizeElements(currentNode, root) {\n\t\t_markVisited(currentNode);\n\t\t_executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isClobbered(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tconst tagName = transformCaseFunc(_readNodeName(currentNode));\n\t\tALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);\n\t\t_executeHooks(hooks.uponSanitizeElement, currentNode, {\n\t\t\ttagName,\n\t\t\tallowedTags: ALLOWED_TAGS\n\t\t});\n\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\tif (_isUnsafeNode(currentNode, tagName)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {\n\t\t\tconst removed = _sanitizeDisallowedNode(currentNode, tagName, root);\n\t\t\tif (removed === false) {\n\t\t\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\t\t\tif (_handleHookDetachedNode(currentNode, root)) return true;\n\t\t\t}\n\t\t\treturn removed;\n\t\t}\n\t\tif (_readNodeType(currentNode) === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif ((tagName === \"noscript\" || tagName === \"noembed\" || tagName === \"noframes\") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {\n\t\t\t_forceRemove(currentNode);\n\t\t\treturn true;\n\t\t}\n\t\tif (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n\t\t\tconst content = _stripTemplateExpressions(currentNode.textContent);\n\t\t\tif (currentNode.textContent !== content) {\n\t\t\t\tarrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n\t\t\t\tcurrentNode.textContent = content;\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\t\treturn _handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _isValidAttribute\n\t*\n\t* @param lcTag Lowercase tag name of containing element.\n\t* @param lcName Lowercase attribute name.\n\t* @param value Attribute value.\n\t* @return Returns true if `value` is valid, otherwise false.\n\t*/\n\tconst _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n\t\tif (FORBID_ATTR[lcName]) return false;\n\t\tif (_isPatchLinkageAttribute(lcName, lcTag)) return false;\n\t\tif (SANITIZE_DOM && (lcName === \"id\" || lcName === \"name\") && (value in document || value in formElement)) return false;\n\t\tconst nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);\n\t\tif (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) return true;\n\t\tif (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) return true;\n\t\tif (!nameIsPermitted) return _isBasicCustomElement(lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName, lcTag) || lcName === \"is\" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value);\n\t\tif (URI_SAFE_ATTRIBUTES[lcName]) return true;\n\t\tif (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\tif ((lcName === \"src\" || lcName === \"xlink:href\" || lcName === \"href\") && lcTag !== \"script\" && stringIndexOf(value, \"data:\") === 0 && DATA_URI_TAGS[lcTag]) return true;\n\t\tif (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, \"\"))) return true;\n\t\treturn !value;\n\t};\n\tconst RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [\n\t\t\"annotation-xml\",\n\t\t\"color-profile\",\n\t\t\"font-face\",\n\t\t\"font-face-format\",\n\t\t\"font-face-name\",\n\t\t\"font-face-src\",\n\t\t\"font-face-uri\",\n\t\t\"missing-glyph\"\n\t]);\n\t/**\n\t* _isBasicCustomElement\n\t* checks if at least one dash is included in tagName, and it's not the first char\n\t* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n\t*\n\t* @param tagName name of the tag of the node to sanitize\n\t* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n\t*/\n\tconst _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n\t\treturn !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);\n\t};\n\t/**\n\t* Wrap an attribute value in the matching Trusted Types object when\n\t* the active policy requires it. Namespaced attributes pass through\n\t* unchanged (no TT support yet, see\n\t* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).\n\t*\n\t* @param lcTag lowercase tag name of the containing element\n\t* @param lcName lowercase attribute name\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the attribute value to wrap\n\t* @return the value, wrapped when Trusted Types demand it\n\t*/\n\tconst _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {\n\t\tif (trustedTypesPolicy && typeof trustedTypes === \"object\" && typeof trustedTypes.getAttributeType === \"function\" && !namespaceURI) switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n\t\t\tcase \"TrustedHTML\": return _createTrustedHTML(value);\n\t\t\tcase \"TrustedScriptURL\": return _createTrustedScriptURL(value);\n\t\t}\n\t\treturn value;\n\t};\n\t/**\n\t* Write a modified attribute value back onto the element. On\n\t* success, re-probe for clobbering introduced by the new value and\n\t* remove the element when found; otherwise, when this writeback is the\n\t* recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the\n\t* removal entry that path recorded so it does not show as removed. On\n\t* failure, remove the attribute instead.\n\t*\n\t* Returns true only on a clean write (the value was set and the new value\n\t* introduced no clobbering). The caller uses that, together with its own\n\t* knowledge of whether this attribute pushed a DOMPurify.removed record, to\n\t* decide whether to pop that record. The pop must happen ONLY for the\n\t* named-prop remove-and-recreate; popping on any other value change (trim,\n\t* template scrubbing, Trusted Types) would consume an unrelated _forceRemove\n\t* subtree-cleanup record and let that detached subtree keep a live event\n\t* handler through the IN_PLACE neutralization pass (SO-001).\n\t*\n\t* @param currentNode the element carrying the attribute\n\t* @param name the attribute name as present on the element\n\t* @param namespaceURI the attribute's namespace, if any\n\t* @param value the new attribute value\n\t* @return true if the value was written without introducing clobbering\n\t*/\n\tconst _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {\n\t\ttry {\n\t\t\tif (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);\n\t\t\telse currentNode.setAttribute(name, value);\n\t\t\tif (_isClobbered(currentNode)) {\n\t\t\t\t_forceRemove(currentNode);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (_) {\n\t\t\t_removeAttribute(name, currentNode);\n\t\t\treturn false;\n\t\t}\n\t};\n\t/**\n\t* _isUnsafeAttributeValue\n\t*\n\t* Value-based attribute checks that the attribute walk applies before any\n\t* hook can force-keep an attribute, shared with the public\n\t* isValidAttribute() so that it never approves a value sanitize() would\n\t* strip.\n\t*\n\t* @param name the attribute name as found on the node (case preserved)\n\t* @param value the attribute value\n\t* @returns true if the attribute must be removed because of its value\n\t*/\n\tconst _isUnsafeAttributeValue = function _isUnsafeAttributeValue(name, value) {\n\t\tif (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) return true;\n\t\treturn stringToLowerCase(name) === \"attributename\" && stringMatch(value, \"href\") !== null;\n\t};\n\t/**\n\t* _sanitizeAttributes\n\t*\n\t* @protect attributes\n\t* @protect nodeName\n\t* @protect removeAttribute\n\t* @protect setAttribute\n\t*\n\t* @param currentNode to sanitize\n\t* @param root the current walk root\n\t*/\n\tconst _sanitizeAttributes = function _sanitizeAttributes(currentNode, root) {\n\t\t_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n\t\tif (_handleHookDetachedNode(currentNode, root)) return;\n\t\tconst attributes = currentNode.attributes;\n\t\tif (!attributes || _isClobbered(currentNode)) return;\n\t\tALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);\n\t\tconst hookEvent = {\n\t\t\tattrName: \"\",\n\t\t\tattrValue: \"\",\n\t\t\tkeepAttr: true,\n\t\t\tallowedAttributes: ALLOWED_ATTR,\n\t\t\tforceKeepAttr: void 0\n\t\t};\n\t\tlet l = attributes.length;\n\t\tconst lcTag = transformCaseFunc(currentNode.nodeName);\n\t\twhile (l--) {\n\t\t\tconst attr = attributes[l];\n\t\t\tconst name = attr.name, namespaceURI = attr.namespaceURI, attrValue = attr.value;\n\t\t\tconst lcName = transformCaseFunc(name);\n\t\t\tconst initValue = attrValue;\n\t\t\tlet value = name === \"value\" ? initValue : stringTrim(initValue);\n\t\t\tlet recreatedNamedProp = false;\n\t\t\thookEvent.attrName = lcName;\n\t\t\thookEvent.attrValue = value;\n\t\t\thookEvent.keepAttr = true;\n\t\t\thookEvent.forceKeepAttr = void 0;\n\t\t\t_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n\t\t\tvalue = hookEvent.attrValue;\n\t\t\tif (SANITIZE_NAMED_PROPS && (lcName === \"id\" || lcName === \"name\") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tvalue = SANITIZE_NAMED_PROPS_PREFIX + value;\n\t\t\t\trecreatedNamedProp = true;\n\t\t\t}\n\t\t\tif (_isUnsafeAttributeValue(name, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hookEvent.forceKeepAttr) continue;\n\t\t\tif (!hookEvent.keepAttr) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (SAFE_FOR_TEMPLATES) value = _stripTemplateExpressions(value);\n\t\t\tif (!_isValidAttribute(lcTag, lcName, value)) {\n\t\t\t\t_removeAttribute(name, currentNode, attr);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvalue = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);\n\t\t\tif (value !== initValue) {\n\t\t\t\tif (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);\n\t\t\t}\n\t\t}\n\t\t_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n\t\t_handleHookDetachedNode(currentNode, root);\n\t};\n\t/**\n\t* _sanitizeShadowDOM\n\t*\n\t* @param fragment to iterate over recursively\n\t*/\n\tconst _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {\n\t\tlet shadowNode = null;\n\t\tconst shadowIterator = _createNodeIterator(fragment);\n\t\t_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n\t\twhile (shadowNode = shadowIterator.nextNode()) {\n\t\t\t_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n\t\t\t_sanitizeElements(shadowNode, fragment);\n\t\t\t_sanitizeAttributes(shadowNode, fragment);\n\t\t\tif (_isDocumentFragment(shadowNode.content)) _sanitizeShadowDOM2(shadowNode.content);\n\t\t\tif (_readNodeType(shadowNode) === NODE_TYPE.element) {\n\t\t\t\tconst innerSr = getShadowRoot(shadowNode);\n\t\t\t\tif (_isDocumentFragment(innerSr)) {\n\t\t\t\t\t_sanitizeAttachedShadowRoots(innerSr);\n\t\t\t\t\t_sanitizeShadowDOM2(innerSr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (SAFE_FOR_TEMPLATES) _scrubOwnCharacterData(fragment);\n\t\t_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n\t};\n\t/**\n\t* Sanitizes every attached shadow root under `root`, since the node\n\t* iterator does not enter shadow trees. Needed for IN_PLACE input and for\n\t* DOM input whose clonable shadow roots were copied by importNode().\n\t*\n\t* @param root the subtree root to walk for attached shadow roots\n\t*/\n\tconst _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {\n\t\tconst stack = [{\n\t\t\tnode: root,\n\t\t\tshadow: null\n\t\t}];\n\t\twhile (stack.length > 0) {\n\t\t\tconst item = stack.pop();\n\t\t\tif (item.shadow) {\n\t\t\t\t_sanitizeShadowDOM2(item.shadow);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst node = item.node;\n\t\t\tconst isElement = _readNodeType(node) === NODE_TYPE.element;\n\t\t\tconst childNodes = getChildNodes(node);\n\t\t\tif (childNodes) for (let i = childNodes.length - 1; i >= 0; --i) stack.push({\n\t\t\t\tnode: childNodes[i],\n\t\t\t\tshadow: null\n\t\t\t});\n\t\t\tif (isElement) {\n\t\t\t\tconst rootName = getNodeName ? getNodeName(node) : null;\n\t\t\t\tif (typeof rootName === \"string\" && transformCaseFunc(rootName) === \"template\") {\n\t\t\t\t\tconst content = node.content;\n\t\t\t\t\tif (_isDocumentFragment(content)) stack.push({\n\t\t\t\t\t\tnode: content,\n\t\t\t\t\t\tshadow: null\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isElement) {\n\t\t\t\tconst sr = getShadowRoot(node);\n\t\t\t\tif (_isDocumentFragment(sr)) stack.push({\n\t\t\t\t\tnode: null,\n\t\t\t\t\tshadow: sr\n\t\t\t\t}, {\n\t\t\t\t\tnode: sr,\n\t\t\t\t\tshadow: null\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\tDOMPurify.sanitize = function(dirty) {\n\t\tlet cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n\t\tlet body = null;\n\t\tlet importedNode = null;\n\t\tlet currentNode = null;\n\t\tlet returnNode = null;\n\t\tIS_EMPTY_INPUT = !dirty;\n\t\tif (IS_EMPTY_INPUT) dirty = \"<!-->\";\n\t\tif (typeof dirty !== \"string\" && !_isNode(dirty)) {\n\t\t\tdirty = stringifyValue(dirty);\n\t\t\tif (typeof dirty !== \"string\") throw typeErrorCreate(\"dirty is not a string, aborting\");\n\t\t}\n\t\tif (!DOMPurify.isSupported) return dirty;\n\t\tif (SET_CONFIG) {\n\t\t\tALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;\n\t\t\tALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;\n\t\t} else _parseConfig(cfg);\n\t\tif (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) ALLOWED_TAGS = clone(ALLOWED_TAGS);\n\t\tif (hooks.uponSanitizeAttribute.length > 0) ALLOWED_ATTR = clone(ALLOWED_ATTR);\n\t\tDOMPurify.removed = [];\n\t\tconst inPlace = IN_PLACE && typeof dirty !== \"string\" && _isNode(dirty);\n\t\tlet inPlaceNodes = [];\n\t\tconst outerVisited = IN_PLACE_VISITED;\n\t\tif (inPlace) {\n\t\t\t_neutralizePatchLinkage(dirty);\n\t\t\tconst nn = _readNodeName(dirty);\n\t\t\tif (typeof nn === \"string\") {\n\t\t\t\tconst tagName = transformCaseFunc(nn);\n\t\t\t\tif (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n\t\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\t\tthrow typeErrorCreate(\"root node is forbidden and cannot be sanitized in-place\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_isClobbered(dirty)) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\tthrow typeErrorCreate(\"root node is clobbered and cannot be sanitized in-place\");\n\t\t\t}\n\t\t\tinPlaceNodes = _collectLiveNodes(dirty);\n\t\t\tIN_PLACE_VISITED = setCreate();\n\t\t} else if (_isNode(dirty)) {\n\t\t\tbody = _initDocument(\"<!---->\");\n\t\t\timportedNode = body.ownerDocument.importNode(dirty, true);\n\t\t\tif (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === \"BODY\") body = importedNode;\n\t\t\telse if (importedNode.nodeName === \"HTML\") body = importedNode;\n\t\t\telse body.appendChild(importedNode);\n\t\t\t_sanitizeAttachedShadowRoots(body);\n\t\t} else {\n\t\t\tif (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf(\"<\") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;\n\t\t\tbody = _initDocument(dirty);\n\t\t\tif (!body) return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : \"\";\n\t\t}\n\t\tif (body && FORCE_BODY) _forceRemove(body.firstChild);\n\t\tconst walkRoot = inPlace ? dirty : body;\n\t\ttry {\n\t\t\tif (inPlace) _sanitizeAttachedShadowRoots(dirty);\n\t\t\tconst nodeIterator = _createNodeIterator(walkRoot);\n\t\t\twhile (currentNode = nodeIterator.nextNode()) {\n\t\t\t\t_sanitizeElements(currentNode, walkRoot);\n\t\t\t\t_sanitizeAttributes(currentNode, walkRoot);\n\t\t\t\tif (_isDocumentFragment(currentNode.content)) _sanitizeShadowDOM2(currentNode.content);\n\t\t\t}\n\t\t\tif (inPlace) _sanitizeUnvisitedNodes(dirty, inPlaceNodes);\n\t\t} catch (error) {\n\t\t\tif (inPlace) {\n\t\t\t\t_neutralizeRoot(dirty);\n\t\t\t\t_neutralizeDiscarded(dirty, inPlaceNodes);\n\t\t\t}\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tIN_PLACE_VISITED = outerVisited;\n\t\t}\n\t\tif (inPlace) {\n\t\t\tif (_neutralizeDiscarded(dirty, inPlaceNodes)) throw typeErrorCreate(\"a node selected for removal could not be safely returned; refusing to sanitize in place\");\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(dirty);\n\t\t\treturn dirty;\n\t\t}\n\t\tif (RETURN_DOM) {\n\t\t\tif (SAFE_FOR_TEMPLATES) _scrubTemplateExpressions2(body);\n\t\t\tif (RETURN_DOM_FRAGMENT) {\n\t\t\t\treturnNode = createDocumentFragment.call(body.ownerDocument);\n\t\t\t\twhile (body.firstChild) returnNode.appendChild(body.firstChild);\n\t\t\t} else returnNode = body;\n\t\t\tif (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) returnNode = importNode.call(originalDocument, returnNode, true);\n\t\t\treturn returnNode;\n\t\t}\n\t\tlet serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\t\tif (WHOLE_DOCUMENT && ALLOWED_TAGS[\"!doctype\"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) serializedHTML = \"<!DOCTYPE \" + body.ownerDocument.doctype.name + \">\\n\" + serializedHTML;\n\t\tif (SAFE_FOR_TEMPLATES) serializedHTML = _stripTemplateExpressions(serializedHTML);\n\t\treturn trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;\n\t};\n\tDOMPurify.setConfig = function() {\n\t\tlet cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\t_parseConfig(cfg);\n\t\tSET_CONFIG = true;\n\t\tSET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;\n\t\tSET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;\n\t};\n\tDOMPurify.clearConfig = function() {\n\t\tCONFIG = null;\n\t\tSET_CONFIG = false;\n\t\tSET_CONFIG_ALLOWED_TAGS = null;\n\t\tSET_CONFIG_ALLOWED_ATTR = null;\n\t\ttrustedTypesPolicy = defaultTrustedTypesPolicy;\n\t\temptyHTML = \"\";\n\t};\n\tDOMPurify.isValidAttribute = function(tag, attr, value) {\n\t\tif (!CONFIG) _parseConfig({});\n\t\tconst lcTag = transformCaseFunc(tag);\n\t\tconst lcName = transformCaseFunc(attr);\n\t\tif (typeof value === \"string\" && (_isUnsafeAttributeValue(attr, value) || !ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value))) return false;\n\t\treturn _isValidAttribute(lcTag, lcName, value);\n\t};\n\tDOMPurify.addHook = function(entryPoint, hookFunction) {\n\t\tif (typeof hookFunction !== \"function\") return;\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tarrayPush(hooks[entryPoint], hookFunction);\n\t};\n\tDOMPurify.removeHook = function(entryPoint, hookFunction) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\tif (hookFunction !== void 0) {\n\t\t\tconst index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n\t\t\treturn index === -1 ? void 0 : arraySplice(hooks[entryPoint], index, 1)[0];\n\t\t}\n\t\treturn arrayPop(hooks[entryPoint]);\n\t};\n\tDOMPurify.removeHooks = function(entryPoint) {\n\t\tif (!objectHasOwnProperty(hooks, entryPoint)) return;\n\t\thooks[entryPoint] = [];\n\t};\n\tDOMPurify.removeAllHooks = function() {\n\t\thooks = _createHooksMap();\n\t};\n\treturn DOMPurify;\n}\nvar purify_default = createDOMPurify();\nexport { purify_default as default };\n\n//# sourceMappingURL=purify.es.mjs.map","import { getDate, getMonth, getYear, isAfter, isBefore, isValid, set } from \"date-fns\";\nimport prettyBytes from \"pretty-bytes\";\nimport DomPurify from \"dompurify\";\n//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\n//#region src/capitalize.ts\n/**\n* Uppercases first letter of string\n* @param string to be capitalized first string, e.g. \"workflow\"\n* @return Capitalized String, e.g. \"Workflow\"\n*/\nvar capitalize = (input) => input.charAt(0).toUpperCase() + input.substring(1);\nvar formats = {\n\tcustomFormat: (input, delimiter) => capitalize(input.replace(delimiter, \" \").toLowerCase()),\n\tkebabFormat: (input) => formats.customFormat(input, \"-\"),\n\tsnakeFormat: (input) => formats.customFormat(input, \"_\"),\n\tcamelPascalCase: (input) => capitalize((input.match(/([A-Z]?[^A-Z]*)/g) ?? []).slice(0, -1).join(\" \").toLowerCase())\n};\nvar caseFormatter = ({ string, delimiter, format }) => {\n\tif (delimiter) return formats.customFormat(string, delimiter);\n\tif (format) return formats[format](string, delimiter ?? \"\");\n\treturn capitalize(string);\n};\n//#endregion\n//#region src/updateDate.ts\n/**\n* Updates the date part (year, day and month) of a date object (base)\n* time, offset (timezone) and so on will be left untouched.\n*\n* @param base - Date which will be used (copied) to set day, month and year.\n* @param date - Extract day, month and year from this date object.\n* @returns Copy of base with day, month and year of date.\n*/\nvar updateDate_default = (base, date) => {\n\tif (date) {\n\t\tbase = isValid(base) ? base : new Date(Date.UTC(0, 0));\n\t\treturn set(base, {\n\t\t\tyear: getYear(date),\n\t\t\tmonth: getMonth(date),\n\t\t\tdate: getDate(date)\n\t\t});\n\t}\n\treturn base;\n};\n//#endregion\n//#region src/updateTime.ts\n/**\n* Updates the time part (hour, minute, second and millisecond) of a date object (base)\n* date, offset (timezone) and so on will be left untouched.\n*\n* @param base - Date which will be used (copied) to set day, month and year.\n* @param date - Extract hour, minute, second and millisecond from this date object.\n* @returns Copy of base with hour, minute, second and millisecond changed.\n*/\nvar updateTime_default = (base, date) => {\n\tconst d = new Date(base);\n\tif (date) {\n\t\td.setHours(date.getHours());\n\t\td.setMinutes(date.getMinutes());\n\t\td.setSeconds(date.getSeconds());\n\t\td.setMilliseconds(date.getMilliseconds());\n\t}\n\treturn d;\n};\n//#endregion\n//#region src/dateMinMaxCheck.ts\n/**\n* Check if date is before min.\n* @param date\n* @param min\n* @param checkDate - check date part (year, day, month).\n* @param checkTime - check time part (hour, minutes etc.).\n* @returns whether limit is kept or not.\n*/\nvar isBeforeMinDate = (date, min, checkDate, checkTime) => {\n\tif (min) {\n\t\tif (checkTime && checkDate) return isBefore(date, min);\n\t\tif (checkTime) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isBefore(updateTime_default(base, date), updateTime_default(base, min));\n\t\t}\n\t\tif (checkDate) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isBefore(updateDate_default(base, date), updateDate_default(base, min));\n\t\t}\n\t}\n\treturn false;\n};\n/**\n* Check\n* @param date - date to check.\n* @param max - maximum date.\n* @param checkDate - check date part (year, day, month).\n* @param checkTime - check time part (hour, minutes etc.).\n* @returns whether limit is kept or not.\n*/\nvar isAfterMaxDate = (date, max, checkDate, checkTime) => {\n\tif (max) {\n\t\tif (checkTime && checkDate) return isAfter(date, max);\n\t\tif (checkTime) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isAfter(updateTime_default(base, date), updateTime_default(base, max));\n\t\t}\n\t\tif (checkDate) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isAfter(updateDate_default(base, date), updateDate_default(base, max));\n\t\t}\n\t}\n\treturn false;\n};\n//#endregion\n//#region src/debounce.ts\nvar debounce = (callback, wait) => {\n\tlet timer;\n\tlet lastCall = 0;\n\treturn (...args) => {\n\t\tconst [value, index] = args;\n\t\tclearTimeout(timer);\n\t\tconst now = Date.now();\n\t\tif (now - lastCall > wait) {\n\t\t\tlastCall = now;\n\t\t\tcallback(value, index);\n\t\t} else timer = setTimeout(() => {\n\t\t\tlastCall = now;\n\t\t\tcallback(value, index);\n\t\t}, wait);\n\t};\n};\nvar filters = Object.assign({}, ...[\n\t{\n\t\tid: \"search\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\treturn caseSensitiveSearch ? searchTerm : searchTerm.toLowerCase();\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = (caseSensitiveSearch ? text : text.toLowerCase()).includes(normalizedSearchTerm);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"wildcard\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\tif (searchTerm.length > 0) searchTerm = `^${searchTerm.replace(/[-[\\]{}()+.,\\\\^$|#\\s]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/\\?/g, \".?\")}$`;\n\t\t\telse return { test: () => false };\n\t\t\ttry {\n\t\t\t\treturn new RegExp(searchTerm, caseSensitiveSearch ? \"\" : \"i\");\n\t\t\t} catch (_error) {\n\t\t\t\treturn /$^/;\n\t\t\t}\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = normalizedSearchTerm.test(text);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"regex\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\ttry {\n\t\t\t\tconst flags = caseSensitiveSearch ? \"\" : \"i\";\n\t\t\t\treturn new RegExp(`^(${searchTerm})$`, flags);\n\t\t\t} catch (_error) {\n\t\t\t\treturn /$^/;\n\t\t\t}\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = normalizedSearchTerm.test(text);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"type\",\n\t\tnormalize(selectedTypes) {\n\t\t\treturn { test: (type) => selectedTypes.includes(type) };\n\t\t},\n\t\ttest(type, normalizedSearchTerm) {\n\t\t\tif (typeof type === \"undefined\") return false;\n\t\t\treturn normalizedSearchTerm.test(type);\n\t\t}\n\t}\n].map((obj) => ({ [obj.id]: obj })));\n//#endregion\n//#region src/localTimezone.ts\n/**\n* Get the users local timezone.\n*\n* @returns current users timezone (browser based) tz db string (e. g. Europe/Berlin).\n*/\nvar localTimezone_default = () => Intl.DateTimeFormat().resolvedOptions().timeZone;\n//#endregion\n//#region src/format.ts\n/**\n* Converts the specified date String to human readable text containing the day, month, and year.\n* Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018'\n*\n* @param dateString String representation of the Date to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable date String\n*/\nvar formatDateString = (dateString, useTimeZone = false) => {\n\tconst date = new Date(dateString);\n\tif (isNaN(date)) throw Error(\"Invalid Date format\");\n\tconst baseDateOptions = {\n\t\tday: \"numeric\",\n\t\tmonth: \"short\",\n\t\tyear: \"numeric\"\n\t};\n\tconst dateOptions = useTimeZone ? {\n\t\t...baseDateOptions,\n\t\ttimeZone: localTimezone_default()\n\t} : baseDateOptions;\n\treturn date.toLocaleDateString(\"en-US\", dateOptions);\n};\n/**\n* Converts the specified time String to human readable text containing the hour (12-hour) and minute.\n* Example: '2018-07-31T09:44:31+00:00' => '9:44 AM'\n*\n* @param timeString String representation of the Date (including time) to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable time String\n*/\nvar formatTimeString = (timeString, useTimeZone = false) => {\n\tconst time = new Date(timeString);\n\tif (isNaN(time)) throw Error(\"Invalid Date format\");\n\tconst baseTimeOptions = {\n\t\thour: \"numeric\",\n\t\tminute: \"2-digit\"\n\t};\n\tconst timeOptions = useTimeZone ? {\n\t\t...baseTimeOptions,\n\t\ttimeZone: localTimezone_default()\n\t} : baseTimeOptions;\n\treturn time.toLocaleTimeString(\"en-US\", timeOptions);\n};\n/**\n* Converts the specified time String to human readable text containing the date (day, month, year) and time (hour,\n* minute; 12-hour).\n* Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018 9:44 AM'\n*\n* @param dateTimeString String representation of the Date (including time and date) to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable date/time String\n*/\nvar formatDateTimeString = (dateTimeString, useTimeZone = false) => {\n\treturn `${formatDateString(dateTimeString, useTimeZone)} ${formatTimeString(dateTimeString, useTimeZone)}`;\n};\n/**\n* Converts the specified date and time to the user time zone with option to display (day, month, year) only or with time (hour,\n* minute; 12-hour).\n*\n* @param showTime String representation of the Date to convert and format\n* @param String | number} date String representation of the Date to convert and format\n* @returns human readable date/time String converted to user time zone\n*/\nvar formatLocalDateTimeString = (date, showTime) => showTime ? formatDateTimeString(date, true) : formatDateString(date, true);\nvar formatFileSize = (bytes) => {\n\treturn prettyBytes(Number.isFinite(bytes) && bytes >= 0 ? bytes : 0);\n};\n//#endregion\n//#region src/getDeepActiveElement.ts\nvar getDeepActiveElement = () => {\n\tlet element = document?.activeElement;\n\twhile (element?.shadowRoot) element = element?.shadowRoot?.activeElement;\n\treturn element;\n};\n//#endregion\n//#region src/getWrappedAroundIndex.ts\n/**\n* Since (a % b) yields a negative outcome for negative a, we need this method in order\n* to correctly compute wrapped around indices in lists\n* @param {number} index an arbitrary integer\n* @param {number} length a positive integer\n* @returns {number} the non-negative modulo outcome\n*/\nvar getWrappedAroundIndex_default = (index, length) => (index % length + length) % length;\n//#endregion\n//#region src/intervalUtils.ts\nvar intervalUtils_exports = /* @__PURE__ */ __exportAll({\n\tformatIntervalToHumanReadableIntervalString: () => formatIntervalToHumanReadableIntervalString,\n\tformatIntervalToISOIntervalString: () => formatIntervalToISOIntervalString,\n\tisValidHumanReadableIntervalString: () => isValidHumanReadableIntervalString,\n\tisValidISOIntervalString: () => isValidISOIntervalString,\n\tisValidIntervalString: () => isValidIntervalString,\n\tisZero: () => isZero,\n\tparseGenericIntervalString: () => parseGenericIntervalString,\n\tparseHumanReadableIntervalString: () => parseHumanReadableIntervalString,\n\tparseISOIntervalString: () => parseISOIntervalString\n});\nvar extractPeriodFromRegexMatch = (negative, match) => {\n\treturn {\n\t\tnegative,\n\t\tyears: parseInt(match[1] ?? \"0\", 10),\n\t\tmonths: parseInt(match[2] ?? \"0\", 10),\n\t\tweeks: parseInt(match[3] ?? \"0\", 10),\n\t\tdays: parseInt(match[4] ?? \"0\", 10)\n\t};\n};\nvar extractDurationFromRegexMatch = (negative, match) => {\n\tconst milliseconds = parseInt(match[4]?.padEnd(3, \"0\") ?? \"0\", 10);\n\treturn {\n\t\tnegative,\n\t\thours: parseInt(match[1] ?? \"0\", 10),\n\t\tminutes: parseInt(match[2] ?? \"0\", 10),\n\t\tseconds: parseInt(match[3] ?? \"0\", 10),\n\t\tmilliseconds\n\t};\n};\nvar isZero = (interval) => {\n\tif (interval.type === \"DATE\") return interval.interval.years === 0 && interval.interval.months === 0 && interval.interval.weeks === 0 && interval.interval.days === 0;\n\telse return interval.interval.hours === 0 && interval.interval.minutes === 0 && interval.interval.seconds === 0 && interval.interval.milliseconds === 0;\n};\n/**\n* Take an interval object and convert it to an ISO duration or period string. All parts of the\n* relevant part of the Interval object are included in the output, even if they are zero.\n*\n* Technically the ISO standard allows to mix period and duration parts, but we don't support that\n* here because it's incredibly hard to deal with all the edge cases. Maybe in a future ticket.\n*\n* The output here is allowed to be negative, in which case the minus sign is prepended to the\n* output.\n*\n* @param toFormat The PeriodOrDuration object to format\n*/\nvar formatIntervalToISOIntervalString = (toFormat) => {\n\tlet output = \"P\";\n\tif (toFormat.type === \"DATE\") output += `${toFormat.interval.years}Y${toFormat.interval.months}M${toFormat.interval.weeks}W${toFormat.interval.days}D`;\n\telse output += `T${toFormat.interval.hours}H${toFormat.interval.minutes}M${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")}S`;\n\tif (toFormat.interval.negative) output = `-${output}`;\n\treturn output;\n};\n/**\n* Take an interval object and convert it to a human readable string. Only non-zero parts are\n* included in the output (unless all parts are 0).\n*\n* The output here is allowed to be negative, in which case the minus sign is prepended to the\n* output and we wrap the whole thing in brackets e.g. -(1 year 2 days).\n*\n* @param toFormat The PeriodOrDuration object to format\n*/\nvar formatIntervalToHumanReadableIntervalString = (toFormat) => {\n\tconst formatPart = (value, unit) => {\n\t\tif (value === 0) return \"\";\n\t\telse if (value === 1) return `${value} ${unit} `;\n\t\telse return `${value} ${unit}s `;\n\t};\n\tlet output = \"\";\n\tif (toFormat.type === \"DATE\") {\n\t\tif (isZero(toFormat)) return \"0 days\";\n\t\toutput += formatPart(toFormat.interval.years, \"year\");\n\t\toutput += formatPart(toFormat.interval.months, \"month\");\n\t\toutput += formatPart(toFormat.interval.weeks, \"week\");\n\t\toutput += formatPart(toFormat.interval.days, \"day\");\n\t} else {\n\t\tif (isZero(toFormat)) return \"0 seconds\";\n\t\toutput += formatPart(toFormat.interval.hours, \"hour\");\n\t\toutput += formatPart(toFormat.interval.minutes, \"minute\");\n\t\tconst milliSecondsZero = toFormat.interval.milliseconds === 0;\n\t\tif (toFormat.interval.seconds !== 0 || !milliSecondsZero) if (milliSecondsZero) output += formatPart(toFormat.interval.seconds, \"second\");\n\t\telse output += `${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")} seconds `;\n\t}\n\tif (toFormat.interval.negative) output = `-(${output.trim()})`;\n\treturn output.trim();\n};\nvar yearsPart = \"(\\\\d+)\\\\s*y(?:ears?)?\";\nvar monthsPart = \"(\\\\d+)\\\\s*m(?:o(?:nths?)?)?\";\nvar weeksPart = \"(\\\\d+)\\\\s*w(?:eeks?)?\";\nvar daysPart = \"(\\\\d+)\\\\s*d(?:ays?)?\";\nvar hoursPart = \"(\\\\d+)\\\\s*h(?:ours?)?\";\nvar minutesPart = \"(\\\\d+)\\\\s*m(?:in(?:s|utes?)?)?\";\nvar secondsPart = \"(\\\\d+)(?:[,.](\\\\d{1,3}))?\\\\s*s(?:ec(?:s|onds?)?)?\";\n/**\n* Matches a human readable period string, e.g. \"1y 2mo 3weeks 4day\" (each part is optional)\n*/\nvar humanReadablePeriodRegex = new RegExp(`^(?:${yearsPart})?\\\\s*(?:${monthsPart})?\\\\s*(?:${weeksPart})?\\\\s*(?:${daysPart})?\\\\s*$`, \"i\");\n/**\n* Matches a human readable duration string, e.g. \"1h 2m 3.456s\" (each part is optional)\n*/\nvar humanReadableDurationRegex = new RegExp(`^(?:${hoursPart})?\\\\s*(?:${minutesPart})?\\\\s*(?:${secondsPart})?$`, \"i\");\n/**\n* Matches a negative human readable period string, e.g. \"-(1y 2mo 3weeks 4day)\" (each part is optional)\n*/\nvar negativeHumanReadablePeriodRegex = new RegExp(`^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadablePeriodRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable period string with one field like \"-1y\" or \"-1w\"\n*/\nvar negativeHumanReadablePeriodRegexWithSingleField = new RegExp(`^\\\\s*-\\\\s*(?:\\\\s*${yearsPart}|${monthsPart}|${weeksPart}|${daysPart})\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable duration string, e.g. \"-(1h 2m 3.456s)\" (each part is optional)\n*/\nvar negativeHumanReadableDurationRegex = new RegExp(`^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadableDurationRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable duration string with one field like \"-1h\" or \"-1.5s\"\n*/\nvar negativeHumanReadableDurationRegexWithSingleField = new RegExp(`^\\\\s*-\\\\s*(?:\\\\s*${hoursPart}|${minutesPart}|${secondsPart})\\\\s*$`, \"i\");\n/**\n* Try to parse a human readable interval string into an Interval object. Any parts not specified\n* are assumed to be zero. Note that the string must be either a period or a duration, not a mix of\n* both. So for example, \"1y 2mo 3weeks 4day\" is fine, as is \"1h 2m 3.456s\". However, \"1y 2mo 1sec\"\n* is not, since it's a mix of both.\n*\n* Negative intervals are allowed, although if multiple fields are provided the string must include\n* brackets, so \"-(1y 2mo)\" is also valid, as is \"-5 seconds\".\n*\n* The string is required to have at least some content, any string that is blank will throw an error.\n*\n* @param intervalString The human readable time string\n*/\nvar parseHumanReadableIntervalString = (intervalString) => {\n\tintervalString = intervalString?.trim();\n\tif (!intervalString) throw new Error(\"Empty interval string\");\n\tconst matchPositivePeriod = humanReadablePeriodRegex.exec(intervalString);\n\tconst matchNegativePeriod = negativeHumanReadablePeriodRegex.exec(intervalString) ?? negativeHumanReadablePeriodRegexWithSingleField.exec(intervalString);\n\tconst matchPositiveDuration = humanReadableDurationRegex.exec(intervalString);\n\tconst matchNegativeDuration = negativeHumanReadableDurationRegex.exec(intervalString) ?? negativeHumanReadableDurationRegexWithSingleField.exec(intervalString);\n\tconst matchPeriod = matchPositivePeriod ?? matchNegativePeriod;\n\tconst matchDuration = matchPositiveDuration ?? matchNegativeDuration;\n\tconst negative = (matchNegativePeriod ?? matchNegativeDuration) !== null;\n\tif (matchDuration && matchPeriod) throw new Error(\"Ambiguous time format\");\n\tif (matchPeriod) return {\n\t\ttype: \"DATE\",\n\t\tinterval: extractPeriodFromRegexMatch(negative, matchPeriod)\n\t};\n\telse if (matchDuration) return {\n\t\ttype: \"TIME\",\n\t\tinterval: extractDurationFromRegexMatch(negative, matchDuration)\n\t};\n\telse throw new Error(`Invalid human readable time: ${intervalString}`);\n};\n/**\n* Check if the given string can be understood as a human readable duration or period string. The\n* type parameter specifies whether the string should be a date, time, or either.\n*\n* @param time the string to check\n* @param expectedType the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidHumanReadableIntervalString = (time, expectedType) => {\n\ttry {\n\t\tconst validationResult = parseHumanReadableIntervalString(time);\n\t\tconst actualType = validationResult.type;\n\t\tconst negative = validationResult.interval.negative;\n\t\tif (actualType === expectedType || expectedType === \"DATE_OR_TIME\") return {\n\t\t\tvalid: true,\n\t\t\ttype: actualType,\n\t\t\tnegative\n\t\t};\n\t\telse return { valid: false };\n\t} catch (_e) {\n\t\treturn { valid: false };\n\t}\n};\n/**\n* Convert an ISO duration OR period string to an Interval object. So for example,\n* \"P1Y2M3W4D\" is fine, as is \"PT1H2M3.456S\". However, \"P1Y2M3W4D1H2M3.456S\" is not, since\n* it's a mix of both. We're more forgiving than the ISO standard, so we allow for missing parts.\n* Also, the string is allowed to be negative, so \"-P1Y2M3W4D\" is also valid.\n*\n* The string is required to have at least some content, so the strings \"\", \"P\", and \"PT\" are\n* considered invalid (also if they start with a -).\n*\n* @param isoString The ISO duration or period string.\n*/\nvar parseISOIntervalString = (isoString) => {\n\tisoString = isoString?.trim();\n\tif ([\n\t\t\"\",\n\t\t\"P\",\n\t\t\"PT\",\n\t\t\"-\",\n\t\t\"-P\",\n\t\t\"-PT\"\n\t].includes(isoString)) throw new Error(\"Empty ISO duration\");\n\tconst periodRegex = /^-?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?$/;\n\tconst durationRegex = /^-?PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(?:[,.](\\d{1,3}))?S)?$/;\n\tconst matchPeriod = periodRegex.exec(isoString);\n\tconst matchDuration = durationRegex.exec(isoString);\n\tif (matchPeriod) return {\n\t\ttype: \"DATE\",\n\t\tinterval: extractPeriodFromRegexMatch(isoString.startsWith(\"-\"), matchPeriod)\n\t};\n\telse if (matchDuration) return {\n\t\ttype: \"TIME\",\n\t\tinterval: extractDurationFromRegexMatch(isoString.startsWith(\"-\"), matchDuration)\n\t};\n\telse throw new Error(`Invalid ISO duration: ${isoString}`);\n};\n/**\n* Check if the given string is a valid duration or period ISO string. The type parameter\n* specifies whether the string should be a date, time, or either.\n*\n* @param isoString the string to check\n* @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidISOIntervalString = (isoString, type) => {\n\ttry {\n\t\tconst validationResult = parseISOIntervalString(isoString);\n\t\tconst actualType = validationResult.type;\n\t\tconst negative = validationResult.interval.negative;\n\t\tif (actualType === type || type === \"DATE_OR_TIME\") return {\n\t\t\tvalid: true,\n\t\t\ttype: actualType,\n\t\t\tnegative\n\t\t};\n\t\telse return { valid: false };\n\t} catch (_e) {\n\t\treturn { valid: false };\n\t}\n};\n/**\n* Try to convert an interval string to an Interval object. The string can be either an ISO\n* duration/period string or a human readable string. If the string is not valid, an error is\n* thrown.\n*\n* @param time the time string, either ISO or human readable\n*/\nvar parseGenericIntervalString = (time) => {\n\tconst validISO = isValidISOIntervalString(time, \"DATE_OR_TIME\");\n\tconst validHumanReadable = isValidHumanReadableIntervalString(time, \"DATE_OR_TIME\");\n\tif (validISO.valid) return parseISOIntervalString(time);\n\telse if (validHumanReadable.valid) return parseHumanReadableIntervalString(time);\n\telse throw new Error(`Invalid interval string: ${time}`);\n};\n/**\n* Check if the given string is a valid interval string, either human readable or ISO. The type parameter\n* specifies whether the string should be a period, duration, or either.\n*\n* @param time the time string to check\n* @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidIntervalString = (time, type) => {\n\tconst validISO = isValidISOIntervalString(time, type);\n\tconst validHumanReadable = isValidHumanReadableIntervalString(time, type);\n\tif (validISO.valid) return validISO;\n\telse if (validHumanReadable.valid) return validHumanReadable;\n\telse return { valid: false };\n};\n//#endregion\n//#region src/numIntegerDigits.ts\n/**\n* Count the number of integer digits for a given number.\n*\n* @param input number.\n* @returns number of integer digits x has. 1234 = 4 but 1234.44 is also 4.\n*/\nvar numIntegerDigits_default = (input) => Math.max(Math.floor(Math.log10(Math.abs(input))), 0) + 1;\n//#endregion\n//#region src/promise/createAbortablePromise.ts\nvar AbortError = class extends Error {};\n/**\n* Helper to create an abortable promise. Returns an AbortController and a Function\n* that you can pass your async handler to. Whenever the AbortController signal is\n* aborted then the async handler's promise will reject with an AbortError\n*\n* Example:\n* ```\n* import { abortUtils } from \"@knime/utils\"\n* const myFetchCall = async (params...) => {...};\n*\n* try {\n* const { runAbortablePromise, abortController } = createAbortablePromise(() =>\n* myFetchCall(params...),\n* );\n* } catch (e) {\n* if (e instanceof abortUtils.AbortError) {\n* console.info('ignore due to abort');\n* return;\n* }\n* }\n*\n* // somewhere else (while request is in-flight)\n* abortController.abort(new abortUtils.AbortError('reason here'))\n* ```\n*/\nvar createAbortablePromise = () => {\n\tconst abortController = new AbortController();\n\tconst runAbortablePromise = (request) => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst abortListener = ({ target }) => {\n\t\t\t\tabortController.signal.removeEventListener(\"abort\", abortListener);\n\t\t\t\tconst reason = target.reason;\n\t\t\t\treject(reason instanceof AbortError ? reason : new AbortError(reason));\n\t\t\t};\n\t\t\trequest().then(resolve).catch((error) => {\n\t\t\t\tif (error instanceof AbortError) return;\n\t\t\t\treject(error);\n\t\t\t});\n\t\t\tabortController.signal.addEventListener(\"abort\", abortListener);\n\t\t});\n\t};\n\treturn {\n\t\tabortController,\n\t\trunAbortablePromise\n\t};\n};\n//#endregion\n//#region src/promise/createUnwrappedPromise.ts\nvar createUnwrappedPromise = () => {\n\tlet resolve = () => {};\n\tlet reject = () => {};\n\tconst promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\treturn {\n\t\tresolve,\n\t\treject,\n\t\tpromise\n\t};\n};\n//#endregion\n//#region src/sleep.ts\n/**\n* Returns promise that resolves after ms.\n*/\nfunction sleep(ms) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n/**\n* Helper to add retry capability to an async function\n* @param fn async function\n* @param retryCount max number of retries. defaults to 5\n* @param retryDelayMS delay in-between retries in millisecs. defaults to 0\n* @param excludeError predicate fn to exclude specific errors from causing a retry\n*/\nasync function retryPromise({ fn, retryCount = 5, retryDelayMS = 0, excludeError }) {\n\ttry {\n\t\treturn await fn();\n\t} catch (error) {\n\t\tif (excludeError?.(error)) throw error;\n\t\tif (retryCount > 0) {\n\t\t\tawait sleep(retryDelayMS);\n\t\t\treturn await retryPromise({\n\t\t\t\tfn,\n\t\t\t\tretryCount: retryCount - 1,\n\t\t\t\tretryDelayMS,\n\t\t\t\texcludeError\n\t\t\t});\n\t\t}\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/promise/index.ts\nvar promise_exports = /* @__PURE__ */ __exportAll({\n\tAbortError: () => AbortError,\n\tDEFAULT_RETRY_COUNT: () => 5,\n\tDEFAULT_RETRY_DELAY_MS: () => 0,\n\tcreateAbortablePromise: () => createAbortablePromise,\n\tcreateUnwrappedPromise: () => createUnwrappedPromise,\n\tretryPromise: () => retryPromise\n});\n//#endregion\n//#region src/sanitization.ts\nvar ALLOWED_TAGS = [\n\t\"p\",\n\t\"div\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"ul\",\n\t\"ol\",\n\t\"li\",\n\t\"blockquote\",\n\t\"b\",\n\t\"i\",\n\t\"s\",\n\t\"u\",\n\t\"sup\",\n\t\"sub\",\n\t\"ins\",\n\t\"del\",\n\t\"strong\",\n\t\"strike\",\n\t\"tt\",\n\t\"code\",\n\t\"big\",\n\t\"small\",\n\t\"br\",\n\t\"span\",\n\t\"em\"\n];\n/**\n* Sanitizes Raw HTML and only allow specific tags to be used, as per OWASP standards.\n* @param rawHTML\n* @param options.allowStyleAttribute - Allow the style attribute on elements\n* @param options.allowHyperlinks - Allow anchor tags with href attribute\n* @returns sanitized html\n*/\nvar sanitizeHTML = (rawHTML, options = {\n\tallowStyleAttribute: false,\n\tallowHyperlinks: false\n}) => {\n\tconst { allowStyleAttribute, allowHyperlinks } = options;\n\tconst ALLOWED_ATTR = [...allowStyleAttribute ? [\"style\"] : [], ...allowHyperlinks ? [\"href\"] : []];\n\tconst allowedTags = allowHyperlinks ? [...ALLOWED_TAGS, \"a\"] : ALLOWED_TAGS;\n\treturn DomPurify.sanitize(rawHTML, {\n\t\tALLOWED_TAGS: allowedTags,\n\t\tALLOWED_ATTR\n\t});\n};\n/**\n* Removes any HTML tag from the input string. Keeps HTML entities\n* (e.g because these can be considered plain text)\n* @param rawHTML\n* @returns plain text\n*/\nvar stripHTML = (rawHTML) => {\n\treturn DomPurify.sanitize(rawHTML, {\n\t\tALLOWED_TAGS: [],\n\t\tALLOWED_ATTR: []\n\t});\n};\nvar sanitization = {\n\tsanitizeHTML,\n\tstripHTML\n};\n//#endregion\n//#region src/truncateString.ts\nvar defaultMaxLength = 160;\nvar truncateString_default = (string = \"\", maxLength = defaultMaxLength) => {\n\tconst dots = string.length > maxLength ? \"…\" : \"\";\n\treturn `${string.substring(0, maxLength - 1)}${dots}`;\n};\n//#endregion\n//#region src/fileExtensions.ts\n/**\n* Gets the file extension\n* @param nameOrPath can take a full file name (e.g \"file.txt\") or a path to a file\n* (e.g \"file://path/to/file.txt\" OR \"/path/to/file.txt\")\n* @returns just the file extension (e.g \"txt\")\n*/\nvar getFileExtension = (nameOrPath) => {\n\tconst basename = nameOrPath.split(/[\\\\/]/).pop() ?? \"\";\n\tconst parts = basename.split(\".\");\n\tif (basename === \"\" || parts.length === 1) return \"\";\n\treturn parts.at(-1) ?? \"\";\n};\n/**\n* Metadata for .knar files, which corresponds to exported KNIME Workflow Groups\n* or Components\n*/\nvar KNAR = Object.freeze({\n\textension: \"knar\",\n\tmimeType: \"application/vnd.knime.workflow-group+zip\",\n\tmatches(file) {\n\t\treturn getFileExtension(file.name) === this.extension;\n\t}\n});\n/**\n* Metadata for .knwf files, which corresponds to exported KNIME Workflows\n*/\nvar KNWF = Object.freeze({\n\textension: \"knwf\",\n\tmimeType: \"application/vnd.knime.workflow+zip\",\n\tmatches(file) {\n\t\treturn getFileExtension(file.name) === this.extension;\n\t},\n\t/**\n\t* Gets the name of a .knwf file without the extension. If the file is not\n\t* matched as a .knwf file then this function will return the default value,\n\t* which is empty string (\"\") if param is not provided\n\t*/\n\tgetNameOrDefault(file, defaultValue = \"\") {\n\t\tif (!this.matches(file)) return defaultValue;\n\t\treturn file.name.replace(`.${this.extension}`, \"\");\n\t}\n});\nvar knimeFileFormats = {\n\tKNAR,\n\tKNWF\n};\n/**\n* Gets the mime type from a given file. Defaults to `application/octet-stream`\n* if mimeType cannot be detected\n* @param file File\n* @returns mimeType\n*/\nvar getFileMimeType = (file) => {\n\tconst DEFAULT_MIMETYPE = \"application/octet-stream\";\n\tif (!getFileExtension(file.name)) return DEFAULT_MIMETYPE;\n\tif (KNWF.matches(file)) return KNWF.mimeType;\n\tif (KNAR.matches(file)) return KNAR.mimeType;\n\tif (!file.type) return DEFAULT_MIMETYPE;\n\treturn file.type;\n};\n//#endregion\n//#region src/hotkeys/enums.ts\n/**\n* Platforms that influence how modifier keys are rendered. macOS substitutes\n* dedicated glyphs (`⌘`, `⌥`, `⇧`, …), every other platform uses the textual\n* rendering (`Ctrl`, `Alt`, `Shift`, …).\n*/\nvar hotkeyPlatform = {\n\tMAC_OS: \"macOS\",\n\tOTHER: \"other\"\n};\nObject.values(hotkeyPlatform);\n//#endregion\n//#region src/platform/navigator.ts\nvar navigator_exports = /* @__PURE__ */ __exportAll({\n\tisMac: () => isMac,\n\tisWindows: () => isWindows\n});\n/**\n*\n* @returns true if the platform of the user is Mac\n*/\nvar isMac = () => navigator?.userAgent?.toLowerCase()?.includes(\"mac\");\n/**\n*\n* @returns true if the platform of the user is Windows\n*/\nvar isWindows = () => navigator?.userAgent?.toLowerCase()?.includes(\"windows\");\n//#endregion\n//#region src/hotkeys/format.ts\nvar globalKeyMap = {\n\tArrowUp: \"↑\",\n\tArrowDown: \"↓\",\n\tArrowLeft: \"←\",\n\tArrowRight: \"→\",\n\tEnter: \"↵\",\n\t\" \": \"Space\",\n\tCtrlOrCmd: \"Ctrl\"\n};\nvar MacOSkeyMap = {\n\tShift: \"⇧\",\n\tDelete: \"⌫\",\n\tCtrlOrCmd: \"⌘\",\n\tCtrl: \"⌃\",\n\tAlt: \"⌥\",\n\tEnter: \"↩\"\n};\n/**\n* Returns a string representation of a single hotkey. Replaces some special key names with symbols.\n*\n* By default the platform is auto-detected from the user agent via `isMac()`.\n* Pass `platform` to force a specific platform's glyphs — useful for SSR,\n* tests, or rendering multiple platforms on the same page.\n*/\nvar formatHotkey = (hotkey, platform) => {\n\t/**\n\t* Returns the symbol corresponding to the `key` based on the given\n\t* `formatMap`. Otherwise, if not found, returns the same `key` value given\n\t*/\n\tconst mapSymbols = (formatMap) => (key) => formatMap[key] ?? key;\n\t/**\n\t* Pipe function implementation. Receives a list of functions to execute in order\n\t* and will pipe the parameter passed at the end to each function returning the final output\n\t*/\n\tconst pipe = (...fns) => fns.reduce((f, g) => (arg) => g(f(arg)), (arg) => arg);\n\tconst macKeyFormatter = pipe(mapSymbols(MacOSkeyMap), mapSymbols(globalKeyMap));\n\tconst generalKeyFormatter = mapSymbols(globalKeyMap);\n\treturn (platform === void 0 ? isMac() : platform === hotkeyPlatform.MAC_OS) ? macKeyFormatter(hotkey) : generalKeyFormatter(hotkey);\n};\nvar getDefaultSeparator = () => isMac() ? \" \" : \"+\";\n/**\n* Returns a string representation of a list of hotkeys. Replaces some special key names with symbols\n*/\nvar formatHotkeys = (hotkeys, getSeparator = getDefaultSeparator) => hotkeys.map((hotkey) => formatHotkey(hotkey)).join(getSeparator());\n/**\n* Appends a formatted hotkey shortcut to the given string. Useful for tooltips\n*/\nvar textWithHotkeys = (text, hotkeys) => {\n\treturn `${text} – ${formatHotkeys(hotkeys)}`;\n};\n//#endregion\n//#region src/hotkeys/match.ts\n/**\n* Checks whether a pressed `Digit` key falls within a numeric hotkey range such\n* as `1-9`.\n* @param keyCode - The `KeyboardEvent.code` to check (e.g. `Digit5`).\n* @param hotkey - The hotkey token, expected to be a single-digit range like `1-9`.\n* @returns True if the pressed digit lies within the inclusive range.\n*/\nvar isDigitKeyInRange = (keyCode, hotkey) => {\n\tif (hotkey.length !== 3 || !keyCode?.startsWith(\"Digit\")) return false;\n\tconst keyNumber = Number(keyCode.slice(5));\n\tconst [lower, upper] = hotkey.split(\"-\");\n\treturn Boolean(lower) && Boolean(upper) && Number.parseInt(lower, 10) <= keyNumber && keyNumber <= Number.parseInt(upper, 10);\n};\n/**\n* Checks whether a keyboard event matches a hotkey definition. The last token is\n* treated as the character; any preceding tokens are modifiers. The special\n* `CtrlOrCmd` modifier resolves to the platform's primary modifier (Meta/`⌘` on\n* macOS, Ctrl elsewhere).\n* @param event - The keyboard event to check.\n* @param hotkeys - The ordered hotkey tokens (modifiers followed by the character).\n* @returns True if the event matches the given hotkey, otherwise false.\n*/\nvar match = (event, hotkeys) => {\n\tconst { key, code, metaKey, ctrlKey, shiftKey, altKey } = event;\n\tconst modifiers = hotkeys.slice();\n\tconst character = modifiers.pop() ?? \"\";\n\tconst ctrlOrMeta = isMac() ? \"Meta\" : \"Ctrl\";\n\tconst platformModifiers = new Set(modifiers.map((modifier) => modifier === \"CtrlOrCmd\" ? ctrlOrMeta : modifier));\n\tconst metaMatches = Boolean(metaKey) === platformModifiers.has(\"Meta\");\n\tconst ctrlMatches = Boolean(ctrlKey) === platformModifiers.has(\"Ctrl\");\n\tconst shiftMatches = Boolean(shiftKey) === platformModifiers.has(\"Shift\");\n\tconst altMatches = Boolean(altKey) === platformModifiers.has(\"Alt\");\n\tconst keysMatch = key.toUpperCase() === character.toUpperCase() || character.includes(\"-\") && isDigitKeyInRange(code, character) || isMac() && character === \"Delete\" && key === \"Backspace\";\n\treturn metaMatches && ctrlMatches && shiftMatches && altMatches && keysMatch;\n};\n//#endregion\n//#region src/hotkeys/modifiers.ts\n/**\n* Checks if any modifier key (Ctrl, Meta, Alt, or Shift) is pressed.\n* @param event - The keyboard event to check.\n* @returns True if a modifier key is pressed, otherwise false.\n*/\nvar isModifierKeyPressed = (event) => {\n\treturn event.ctrlKey || event.metaKey || event.altKey || event.shiftKey;\n};\n/**\n* Checks if a specific key (or keys) were pressed without any modifier keys.\n* @param event - The keyboard event to check.\n* @param keys - The key or keys to check for.\n* @returns True if the specified key(s) were pressed without modifiers, otherwise false.\n*/\nvar isKeyWithoutModifiers = (event, keys) => {\n\treturn (Array.isArray(keys) ? keys : [keys]).includes(event.key) && !isModifierKeyPressed(event);\n};\n/**\n* Returns the name of the primary modifier key for the current platform.\n*/\nvar getMetaOrCtrlKey = () => {\n\treturn isMac() ? \"metaKey\" : \"ctrlKey\";\n};\n//#endregion\n//#region src/hotkeys/index.ts\n/**\n* Grouped keyboard-shortcut helpers, exposed as a single namespace for\n* ergonomic access (e.g. `hotkeys.formatHotkey`).\n*/\nvar hotkeys = {\n\tformatHotkeys,\n\tformatHotkey,\n\tgetDefaultSeparator,\n\thotkeyPlatform,\n\ttextWithHotkeys,\n\tmatch\n};\n//#endregion\nexport { capitalize, caseFormatter, debounce, filters, formatDateString, formatDateTimeString, formatFileSize, formatLocalDateTimeString, formatTimeString, getDeepActiveElement, getFileExtension, getFileMimeType, localTimezone_default as getLocalTimeZone, getMetaOrCtrlKey, getWrappedAroundIndex_default as getWrappedAroundIndex, hotkeys, intervalUtils_exports as intervalUtils, isAfterMaxDate, isBeforeMinDate, isKeyWithoutModifiers, isModifierKeyPressed, knimeFileFormats, match, navigator_exports as navigatorUtils, numIntegerDigits_default as numIntegerDigits, promise_exports as promise, sanitization, sleep, truncateString_default as truncateString, updateDate_default as updateDate, updateTime_default as updateTime };\n\n//# sourceMappingURL=index.js.map","import { type InjectionKey, type Ref, computed, inject, provide } from \"vue\";\n\nimport type { TableState } from \"../../types/TableConfig\";\n\n/**\n * Exported for testing purposes\n */\nexport const injectionKey: InjectionKey<{\n isShown: Ref<boolean>;\n close: () => void;\n}> = Symbol(\"dataValueViewsIsShown\");\n\nexport const useDataValueViews = () => inject(injectionKey)!;\n\nexport const provideDataValueViewsIsShown = (\n tableState: Ref<TableState>,\n closeDataValueView: () => void,\n) =>\n provide(injectionKey, {\n isShown: computed(() => Boolean(tableState.value.dataValueViewIsShown)),\n close: closeDataValueView,\n });\n","import { getMetaOrCtrlKey } from \"@knime/utils\";\n\nconst isNavigationKey = (event: KeyboardEvent) =>\n event.key.includes(\"Arrow\") || event.key === \"Tab\" || event.key === \"Escape\";\n\n/**\n * Creates a keydown handler that detects editing-trigger keys and calls the\n * appropriate callback:\n * - Enter (without Shift) / Space → `onExpandAndStartEditing`\n * - Backspace / printable characters (key.length === 1, no Ctrl/Cmd, no Alt)\n * → `onStartEditing`\n *\n * Navigation keys (Arrow, Tab, Escape) and modifier combos (Ctrl/Cmd, Alt)\n * are ignored and left for other handlers.\n */\nexport const useStartEditingKeydown = ({\n onExpandAndStartEditing,\n onStartEditing,\n}: {\n onExpandAndStartEditing: (initialValue?: string) => void;\n onStartEditing: (initialValue?: string) => void;\n}) => {\n const onKeydown = (event: KeyboardEvent) => {\n if (isNavigationKey(event) || event[getMetaOrCtrlKey()]) {\n return;\n }\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n event.stopPropagation();\n onExpandAndStartEditing();\n } else if (event.key === \" \") {\n event.preventDefault();\n onExpandAndStartEditing(\" \");\n } else if (event.key === \"Backspace\") {\n onStartEditing(\"\");\n } else if (!event.altKey && event.key.length === 1) {\n event.preventDefault();\n onStartEditing(event.key);\n }\n };\n\n return { onKeydown };\n};\n","<script setup lang=\"ts\">\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport { useDataValueViews } from \"./composables/useDataValueViews\";\nimport { useStartEditingKeydown } from \"./composables/useStartEditingKeydown\";\n\nconst emit = defineEmits<{\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst onArrowKeyDown = (event: KeyboardEvent) => {\n let horizontal = 0;\n let vertical = 0;\n switch (event.key) {\n case \"ArrowLeft\":\n horizontal = -1;\n break;\n case \"ArrowRight\":\n horizontal = 1;\n break;\n case \"ArrowUp\":\n vertical = -1;\n break;\n case \"ArrowDown\":\n vertical = 1;\n break;\n }\n if (horizontal || vertical) {\n event.preventDefault();\n emit(\"moveSelection\", horizontal, vertical, event.shiftKey);\n }\n};\n\nconst { isShown: selectedCellIsExpanded, close: closeExpandedSelectedCell } =\n useDataValueViews();\n\nconst onEscape = (event: KeyboardEvent) => {\n if (selectedCellIsExpanded.value) {\n event.preventDefault();\n event.stopPropagation();\n closeExpandedSelectedCell();\n }\n};\n\nconst onTab = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n emit(\"moveSelection\", horizontalMove, 0, false);\n};\n\nconst { onKeydown: onStartEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: (initialValue?: string) => {\n emit(\"expandSelectedCell\");\n emit(\"startEditing\", initialValue);\n },\n onStartEditing: (initialValue?: string) => {\n emit(\"startEditing\", initialValue);\n },\n});\n\nconst onKeyDown = (event: KeyboardEvent) => {\n if (!event[getMetaOrCtrlKey()] && event.key.includes(\"Arrow\")) {\n onArrowKeyDown(event);\n } else if (event.key === \"Tab\") {\n onTab(event);\n } else if (event.key === \"Escape\") {\n onEscape(event);\n } else {\n onStartEditingKeydown(event);\n }\n};\n</script>\n\n<template>\n <tbody\n :tabindex=\"-1\"\n @keydown.self=\"onKeyDown\"\n @focusin=\"emit('bodyFocusin')\"\n @focusout=\"emit('bodyFocusout')\"\n >\n <slot name=\"bodyContent\" />\n <slot name=\"belowBody\" />\n </tbody>\n</template>\n\n<style scoped>\ntbody {\n outline: none;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport { useDataValueViews } from \"./composables/useDataValueViews\";\nimport { useStartEditingKeydown } from \"./composables/useStartEditingKeydown\";\n\nconst emit = defineEmits<{\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst onArrowKeyDown = (event: KeyboardEvent) => {\n let horizontal = 0;\n let vertical = 0;\n switch (event.key) {\n case \"ArrowLeft\":\n horizontal = -1;\n break;\n case \"ArrowRight\":\n horizontal = 1;\n break;\n case \"ArrowUp\":\n vertical = -1;\n break;\n case \"ArrowDown\":\n vertical = 1;\n break;\n }\n if (horizontal || vertical) {\n event.preventDefault();\n emit(\"moveSelection\", horizontal, vertical, event.shiftKey);\n }\n};\n\nconst { isShown: selectedCellIsExpanded, close: closeExpandedSelectedCell } =\n useDataValueViews();\n\nconst onEscape = (event: KeyboardEvent) => {\n if (selectedCellIsExpanded.value) {\n event.preventDefault();\n event.stopPropagation();\n closeExpandedSelectedCell();\n }\n};\n\nconst onTab = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n emit(\"moveSelection\", horizontalMove, 0, false);\n};\n\nconst { onKeydown: onStartEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: (initialValue?: string) => {\n emit(\"expandSelectedCell\");\n emit(\"startEditing\", initialValue);\n },\n onStartEditing: (initialValue?: string) => {\n emit(\"startEditing\", initialValue);\n },\n});\n\nconst onKeyDown = (event: KeyboardEvent) => {\n if (!event[getMetaOrCtrlKey()] && event.key.includes(\"Arrow\")) {\n onArrowKeyDown(event);\n } else if (event.key === \"Tab\") {\n onTab(event);\n } else if (event.key === \"Escape\") {\n onEscape(event);\n } else {\n onStartEditingKeydown(event);\n }\n};\n</script>\n\n<template>\n <tbody\n :tabindex=\"-1\"\n @keydown.self=\"onKeyDown\"\n @focusin=\"emit('bodyFocusin')\"\n @focusout=\"emit('bodyFocusout')\"\n >\n <slot name=\"bodyContent\" />\n <slot name=\"belowBody\" />\n </tbody>\n</template>\n\n<style scoped>\ntbody {\n outline: none;\n}\n</style>\n","import {\n type CSSProperties,\n type InjectionKey,\n type MaybeRef,\n type Ref,\n computed,\n inject,\n provide,\n} from \"vue\";\n\nimport type { IndexStartEnd } from \"@knime/vue-headless-virtual-scroller\";\n\nexport interface Payload {\n horizontal: Ref<IndexStartEnd>;\n horizontalStyles: CSSProperties;\n}\n\nconst injectionKey: InjectionKey<Payload> = Symbol(\n \"useHorizontalIndicesAndStyles.ts\",\n);\n\nexport const provideForHorizontalVirtualScrolling = (payload: Payload) =>\n provide(injectionKey, payload);\n\n/**\n * The horizontal column indices to render plus the style positioning the\n * horizontally virtualized window. While horizontal virtual scrolling is\n * provided the indices are the currently visible column range; otherwise\n * `fallbackIndices` (e.g. all columns) is used.\n */\nconst useHorizontalIndices = (\n fallbackIndices: () => number[],\n): {\n indices: Ref<number[]>;\n style: MaybeRef<CSSProperties>;\n} => {\n const providedForVirtualScrolling = inject(injectionKey, null);\n if (providedForVirtualScrolling) {\n return {\n indices: computed(() =>\n providedForVirtualScrolling.horizontal.value.toArray(),\n ),\n style: providedForVirtualScrolling.horizontalStyles,\n };\n }\n return {\n indices: computed(fallbackIndices),\n style: {},\n };\n};\n\nexport const useIndicesAndStylesFor = <T>(\n data: Ref<T[]>,\n): {\n indexedData: Ref<[T, number][]>;\n style: MaybeRef<CSSProperties>;\n} => {\n const { indices, style } = useHorizontalIndices(() =>\n data.value.map((_, index) => index),\n );\n return {\n indexedData: computed(() =>\n indices.value.map((index) => [data.value[index], index]),\n ),\n style,\n };\n};\n\n/**\n * Like {@link useIndicesAndStylesFor} but for consumers that only need the\n * column indices (not per-column data), e.g. {@link EmptyRow} whose skeleton\n * cells read their width from the `--col-size-<index>` CSS variable rather than\n * from a render-time read of the numeric column sizes. The fallback renders all\n * `numColumns` columns when horizontal virtual scrolling is not provided.\n */\nexport const useColumnIndicesFor = (\n numColumns: Ref<number>,\n): {\n indices: Ref<number[]>;\n style: MaybeRef<CSSProperties>;\n} =>\n useHorizontalIndices(() =>\n Array.from({ length: numColumns.value }, (_, index) => index),\n );\n","import {\n type InjectionKey,\n type Ref,\n computed,\n inject,\n provide,\n ref,\n watch,\n} from \"vue\";\n\nexport const getColSizeCSSVar = (index: number) => `--col-size-${index}`;\n\ninterface ColumnSizesContext {\n /**\n * The live numeric column sizes, updated per drag frame during a column\n * resize. Only consume them where this update frequency is wanted (e.g.\n * imperative CSS variable writes), not at render time above the cell tree.\n */\n colSizes: Ref<number[]>;\n /**\n * The column sizes captured at drag start while a column resize is active,\n * identical to the live sizes otherwise. Consumers whose render output must\n * not update per drag frame (e.g. Row's slotted cell width,\n * TableCoreVirtual's column window) read these instead of freezing the live\n * sizes themselves.\n */\n colSizesFrozenWhenResizing: Ref<number[]>;\n /**\n * Whether a column resize drag is currently active. Set by TableUI (the\n * owner of the column resize events); drives the freezing above.\n */\n columnResizeActive: Ref<boolean>;\n}\n\nexport const columnSizesInjectionKey: InjectionKey<ColumnSizesContext> =\n Symbol(\"columnSizes\");\n\n/**\n * Non-reactive override for the injected column sizes. While its `value` is a\n * sizes array, {@link injectColumnSizes} returns those sizes instead of the\n * live ones. Used by the hidden auto-size calculation table so it can render at\n * its own (e.g. maximum) widths without affecting the visible table. It does\n * not need to be reactive: each consumer reads the sizes once when it is set\n * up, and the calculation table is (re)mounted for every calculation, so the\n * override only needs to be set before it mounts and reset to `null` after.\n */\ninterface AutoSizeColumnSizes {\n value: number[] | null;\n}\n\nconst autoSizeColumnSizesInjectionKey: InjectionKey<AutoSizeColumnSizes> =\n Symbol(\"autoSizeColumnSizes\");\n\n/**\n * Provides the {@link AutoSizeColumnSizes} override to descendants and returns\n * methods to set/unset it around an auto-size calculation. Has to be called\n * above the components whose injected sizes should be overridden (i.e. the\n * auto-size calculation table).\n */\nexport const provideAutoSizeColumnSizes = () => {\n const holder: AutoSizeColumnSizes = { value: null };\n provide(autoSizeColumnSizesInjectionKey, holder);\n return {\n setAutoSizeColumnSizes: (sizes: number[]) => {\n holder.value = sizes;\n },\n unsetAutoSizeColumnSizes: () => {\n holder.value = null;\n },\n };\n};\n\n/**\n * Owns the column-size handling for the table. Using a provide/inject pattern to share\n * live sizes with descendants instead of a property, we avoid memory issues arising\n * on column resizing.\n * When switching to @vue/vapor virtualizer, we can remove this again.\n */\nexport const useColumnSizes = (\n colSizes: Ref<number[]>,\n /**\n * An element reference that is either the root of the table or a parent.\n * This element will be used to define the global css variables controlling\n * column widths.\n */\n element: Ref<HTMLElement | null>,\n) => {\n let previousColumnCount = 0;\n watch(\n [colSizes, element],\n ([sizes]) => {\n const el = element.value;\n if (!el) {\n return;\n }\n sizes.forEach((size, index) => {\n el.style.setProperty(getColSizeCSSVar(index), `${size}px`);\n });\n // Remove the CSS variables of columns that no longer exist so they do not\n // linger on the element after the column count shrinks.\n for (let index = sizes.length; index < previousColumnCount; index++) {\n el.style.removeProperty(getColSizeCSSVar(index));\n }\n previousColumnCount = sizes.length;\n },\n { immediate: true },\n );\n\n const columnResizeActive = ref(false);\n const colSizesOnStartColResize = ref<number[] | null>(null);\n watch(columnResizeActive, (active) => {\n colSizesOnStartColResize.value = active ? [...colSizes.value] : null;\n });\n const colSizesFrozenWhenResizing = computed(\n () => colSizesOnStartColResize.value ?? colSizes.value,\n );\n\n const context: ColumnSizesContext = {\n colSizes,\n colSizesFrozenWhenResizing,\n columnResizeActive,\n };\n provide(columnSizesInjectionKey, context);\n return context;\n};\n\nexport const injectColumnSizes = (): ColumnSizesContext => {\n const context = inject(columnSizesInjectionKey);\n if (!context) {\n throw new Error(\n \"No column-size context found. Components from @knime/kds-table must be \" +\n \"rendered below a useColumnSizes provider (see useColumnSizes). Without \" +\n \"it the column-width CSS variables are never set and columns collapse.\",\n );\n }\n // If an auto-size calculation is in progress, transparently override the\n // injected sizes with the ones it wants to render at.\n const autoSizeColumnSizes = inject(autoSizeColumnSizesInjectionKey, null);\n if (autoSizeColumnSizes && autoSizeColumnSizes.value !== null) {\n const sizes = ref(autoSizeColumnSizes.value);\n return {\n ...context,\n colSizes: sizes,\n colSizesFrozenWhenResizing: sizes,\n };\n }\n return context;\n};\n","<script setup lang=\"ts\">\nimport { computed, toRef } from \"vue\";\n\nimport { KdsCheckbox, KdsLoadingSkeleton } from \"@knime/kds-components\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useColumnIndicesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar } from \"../useColumnSizes\";\n\nconst props = defineProps<{\n height: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n\nconst { indices: columnIndices, style: rowStyles } = useColumnIndicesFor(\n toRef(props, \"numColumns\"),\n);\n\nconst paddingTopBottom = computed(() =>\n props.compact\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\n</script>\n\n<template>\n <!--class \"row\" required for deep selector from knime-core-ui-->\n <tr\n :class=\"`row${compact ? ' compact-mode' : ''}`\"\n :style=\"{\n ...rowStyles,\n height: `${height}px`,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell-spacer\" />\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox tooltip=\"Selection\" disabled class=\"select-checkbox\" />\n </td>\n <td\n v-for=\"cellIndex of columnIndices\"\n :key=\"cellIndex\"\n :style=\"{\n width: `var(${getColSizeCSSVar(cellIndex)})`,\n padding: `${paddingTopBottom}px ${CELL_PADDING_HORIZONTAL}px`,\n }\"\n >\n <KdsLoadingSkeleton loading class=\"skeleton\" />\n </td>\n </tr>\n</template>\n\n<style scoped>\ntr {\n display: flex;\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n\n & .skeleton {\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, toRef } from \"vue\";\n\nimport { KdsCheckbox, KdsLoadingSkeleton } from \"@knime/kds-components\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useColumnIndicesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar } from \"../useColumnSizes\";\n\nconst props = defineProps<{\n height: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n\nconst { indices: columnIndices, style: rowStyles } = useColumnIndicesFor(\n toRef(props, \"numColumns\"),\n);\n\nconst paddingTopBottom = computed(() =>\n props.compact\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\n</script>\n\n<template>\n <!--class \"row\" required for deep selector from knime-core-ui-->\n <tr\n :class=\"`row${compact ? ' compact-mode' : ''}`\"\n :style=\"{\n ...rowStyles,\n height: `${height}px`,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell-spacer\" />\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox tooltip=\"Selection\" disabled class=\"select-checkbox\" />\n </td>\n <td\n v-for=\"cellIndex of columnIndices\"\n :key=\"cellIndex\"\n :style=\"{\n width: `var(${getColSizeCSSVar(cellIndex)})`,\n padding: `${paddingTopBottom}px ${CELL_PADDING_HORIZONTAL}px`,\n }\"\n >\n <KdsLoadingSkeleton loading class=\"skeleton\" />\n </td>\n </tr>\n</template>\n\n<style scoped>\ntr {\n display: flex;\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n\n & .skeleton {\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\ndefineProps<{ height: number }>();\n</script>\n\n<template>\n <div class=\"dots\" :style=\"{ height: `${height}px` }\">\n <span> ⋮ </span>\n </div>\n</template>\n\n<style scoped>\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font: var(--kds-font-base-interactive-large);\n color: var(--kds-color-text-and-icon-neutral);\n border-bottom: var(--kds-border-base-subtle);\n\n & span {\n text-align: center;\n pointer-events: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\ndefineProps<{ height: number }>();\n</script>\n\n<template>\n <div class=\"dots\" :style=\"{ height: `${height}px` }\">\n <span> ⋮ </span>\n </div>\n</template>\n\n<style scoped>\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font: var(--kds-font-base-interactive-large);\n color: var(--kds-color-text-and-icon-neutral);\n border-bottom: var(--kds-border-base-subtle);\n\n & span {\n text-align: center;\n pointer-events: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport type { DataItem } from \"./TableUI.vue\";\nimport EmptyRow from \"./ui/EmptyRow.vue\";\nimport PlaceholderRow from \"./ui/PlaceholderRow.vue\";\n\ndefineProps<{\n dataItem?: DataItem;\n rowHeight: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n</script>\n\n<template>\n <template v-if=\"dataItem\">\n <template v-if=\"dataItem.dots\">\n <PlaceholderRow :height=\"rowHeight\" />\n </template>\n <slot v-else :row=\"dataItem.data\" />\n </template>\n <EmptyRow\n v-else\n :height=\"rowHeight\"\n :compact=\"compact\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport type { DataItem } from \"./TableUI.vue\";\nimport EmptyRow from \"./ui/EmptyRow.vue\";\nimport PlaceholderRow from \"./ui/PlaceholderRow.vue\";\n\ndefineProps<{\n dataItem?: DataItem;\n rowHeight: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n</script>\n\n<template>\n <template v-if=\"dataItem\">\n <template v-if=\"dataItem.dots\">\n <PlaceholderRow :height=\"rowHeight\" />\n </template>\n <slot v-else :row=\"dataItem.data\" />\n </template>\n <EmptyRow\n v-else\n :height=\"rowHeight\"\n :compact=\"compact\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n />\n</template>\n","import {\n type InjectionKey,\n type Ref,\n inject,\n provide,\n ref,\n watchEffect,\n} from \"vue\";\n\n/**\n * CSS variable holding the current table body width (in px). It is written\n * imperatively to the scroll container by {@link useBodyWidth} so that style\n * consumers (the sticky header, the resize scroll spacer) can read the body\n * width via `var(...)` instead of via a render-time read of the live\n * column-size array.\n */\nexport const BODY_WIDTH_CSS_VAR = \"--current-body-width\";\n\nconst bodyWidthInjectionKey: InjectionKey<Ref<number>> = Symbol(\"bodyWidth\");\n\n/**\n * Owns the table body width. Given the live numeric body width and the scroll\n * container element, it\n * - writes the width to {@link BODY_WIDTH_CSS_VAR} on the element (the single\n * source the sticky header and the resize scroll spacer read their width\n * from), and\n * - provides the live numeric body width for the few descendants that genuinely\n * need a number in JS but must not read it every frame (they inject via\n * {@link injectBodyWidth}).\n */\nexport const useBodyWidth = (\n bodyWidth: Ref<number>,\n element: Ref<HTMLElement | null>,\n) => {\n watchEffect(() => {\n element.value?.style.setProperty(\n BODY_WIDTH_CSS_VAR,\n `${bodyWidth.value}px`,\n );\n });\n\n provide(bodyWidthInjectionKey, bodyWidth);\n};\n\nexport const injectBodyWidth = () => inject(bodyWidthInjectionKey, ref(0));\n","import { type InjectionKey, inject, provide, ref } from \"vue\";\n\nconst setup = () => {\n const currentCallback = ref<(() => void) | null>(null);\n\n const registerExpandedSubMenu = (callback: () => void) => {\n // Timeout to prevent the sub menu to be closed due to scroll event triggered by clicking a row/group\n setTimeout(() => {\n currentCallback.value = () => {\n callback();\n currentCallback.value = null;\n };\n }, 100);\n };\n return {\n closeExpandedSubMenu: () => currentCallback.value?.(),\n registerExpandedSubMenu,\n };\n};\n\ntype Provided = ReturnType<typeof setup>;\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Provided> = Symbol(\n \"useCloseSubMenusOnScroll.ts\",\n);\n\nexport const provideForCloseSubMenusOnScroll = () =>\n provide(injectionKey, setup());\n\nexport const injectCloseExpandedSubMenu = () =>\n inject(injectionKey)!.closeExpandedSubMenu;\nexport const injectRegisterExpandedSubMenu = () =>\n inject(injectionKey)!.registerExpandedSubMenu;\n","import {\n type CSSProperties,\n type InjectionKey,\n type Ref,\n computed,\n inject,\n provide,\n ref,\n watch,\n} from \"vue\";\n\ntype Provided = Ref<CSSProperties>;\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Provided> = Symbol(\n \"useOverflowStyles.ts\",\n);\n\nconst elIsPresent = (el: HTMLElement | null): el is HTMLElement => Boolean(el);\n\nexport const provideOverflowStyles = ({\n columnResizeActive,\n fitsWithoutHorizontalScrollbar,\n scrolledElement,\n}: {\n fitsWithoutHorizontalScrollbar: Ref<boolean>;\n columnResizeActive: Ref<boolean>;\n scrolledElement: Ref<HTMLElement | null>;\n}) => {\n // Captured at the moment column resize starts: was a vertical scrollbar\n // visible at that instant? If yes, we keep it as `overflow-y: scroll` during\n // the resize so that toggling the horizontal scrollbar cannot make the\n // vertical scrollbar appear/disappear (which would cause flickering).\n const verticalScrollbarVisibleAtResizeStart = ref(false);\n // flush: 'sync' so we read scrollHeight/clientHeight the instant\n // columnResizeActive flips true — before any other reactive consumer\n // (notably our own overflow computed) can mutate the DOM and thereby\n // change which scrollbars are visible.\n watch(\n columnResizeActive,\n (active) => {\n if (active) {\n const el = scrolledElement.value;\n verticalScrollbarVisibleAtResizeStart.value =\n elIsPresent(el) && el.scrollHeight > el.clientHeight;\n }\n },\n { flush: \"sync\" },\n );\n\n provide(\n injectionKey,\n computed(() => ({\n overflowX:\n !columnResizeActive.value && !fitsWithoutHorizontalScrollbar.value\n ? \"auto\"\n : \"hidden\",\n overflowY:\n columnResizeActive.value && verticalScrollbarVisibleAtResizeStart.value\n ? \"scroll\"\n : \"auto\",\n })),\n );\n};\n\nexport const useOverflowStyles = () => inject(injectionKey)!;\n","import { type InjectionKey, type Ref, inject, provide, ref } from \"vue\";\n\nimport {\n injectCloseExpandedSubMenu,\n provideForCloseSubMenusOnScroll,\n} from \"./useCloseSubMenusOnScroll\";\nimport { provideOverflowStyles, useOverflowStyles } from \"./useOverflowStyles\";\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Ref<HTMLElement | null>> =\n Symbol(\"scrollContainerRed\");\n\nexport const provideCommonScrollContainerProps = (\n containerRef: Ref<HTMLElement | null>,\n params: {\n fitsWithoutHorizontalScrollbar: Ref<boolean>;\n columnResizeActive: Ref<boolean>;\n },\n) => {\n provideOverflowStyles({ ...params, scrolledElement: containerRef });\n provideForCloseSubMenusOnScroll();\n provide(injectionKey, containerRef);\n};\n\n/**\n * Thin helper that injects only the scroll container ref provided by\n * {@link provideCommonScrollContainerProps}, without pulling in the overflow\n * and sub-menu providers that {@link useCommonScrollContainerProps} requires.\n * Falls back to a null ref when no provider is present (e.g. in isolated tests).\n */\nexport const useScrollContainer = () => inject(injectionKey, ref(null));\n\nexport const useCommonScrollContainerProps = () => {\n const closeExpandedSubMenu = injectCloseExpandedSubMenu();\n const overflowStyles = useOverflowStyles();\n return {\n overflowStyles,\n closeExpandedSubMenu,\n containerRef: useScrollContainer(),\n };\n};\n","import { type Ref, nextTick, ref, watch } from \"vue\";\n\n/**\n * While a column resize is active a screen-wide spacer is rendered to the right of the\n * table content, guaranteeing there is always horizontal scroll room so the edge\n * auto-scroll (see Header.vue) can keep growing a column past the current table width.\n *\n * This composable owns the spacer's lifecycle: when the resize ends it only animates the\n * spacer's width back down to the current body width if the extra scroll room is actually\n * on screen (the container is scrolled past the body's right edge) - otherwise there is\n * nothing to see and the spacer is dropped immediately. Once the collapse animation has\n * finished, `onResizeScrollSpacerTransitionEnd` unmounts it.\n */\nexport const useResizeScrollSpacer = ({\n columnResizeActive,\n currentBodyWidth,\n scrollContainer,\n}: {\n columnResizeActive: Ref<boolean>;\n currentBodyWidth: Ref<number>;\n scrollContainer: Ref<HTMLElement | null>;\n}) => {\n const showResizeScrollSpacer = ref(false);\n const collapseResizeScrollSpacer = ref(false);\n const additionalSpacerWidth = ref(\"0px\");\n\n // True when the area beyond the body's right edge (i.e. part of the spacer) is within\n // the currently visible viewport of the scroll container.\n const getVisibleWidthBeyondBody = () => {\n const container = scrollContainer.value;\n if (container === null) {\n return 0;\n }\n return Math.max(\n 0,\n container.scrollLeft + container.clientWidth - currentBodyWidth.value,\n );\n };\n\n watch(columnResizeActive, (active) => {\n if (active) {\n collapseResizeScrollSpacer.value = false;\n showResizeScrollSpacer.value = true;\n additionalSpacerWidth.value = \"100vw\";\n } else if (showResizeScrollSpacer.value) {\n const visibleWidthBeyondBody = getVisibleWidthBeyondBody();\n if (visibleWidthBeyondBody > 0) {\n additionalSpacerWidth.value = `${visibleWidthBeyondBody}px`;\n nextTick(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n scrollContainer.value?.offsetWidth; // force layout so the width change above is registered before we collapse\n additionalSpacerWidth.value = \"0px\";\n collapseResizeScrollSpacer.value = true;\n });\n } else {\n // the spacer is scrolled out of view, so just drop it without animating\n showResizeScrollSpacer.value = false;\n additionalSpacerWidth.value = \"0px\";\n }\n }\n });\n\n const onResizeScrollSpacerTransitionEnd = () => {\n if (collapseResizeScrollSpacer.value) {\n showResizeScrollSpacer.value = false;\n collapseResizeScrollSpacer.value = false;\n }\n };\n\n return {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n };\n};\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, toRef, watch } from \"vue\";\nimport { useResizeObserver } from \"@vueuse/core\";\nimport \"../assets/global-z-indices.css\";\n\nimport {\n ArraySizeManager,\n SameSizeManager,\n type SizeManager,\n WithSpaceAfter,\n WithSpaceBefore,\n useVirtualGrid,\n} from \"@knime/vue-headless-virtual-scroller\";\n\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableBodyNavigatable from \"./TableBodyNavigatable.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport VirtualRow from \"./VirtualRow.vue\";\nimport {\n BODY_WIDTH_CSS_VAR,\n injectBodyWidth,\n} from \"./composables/useBodyWidth\";\nimport { useCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { provideForHorizontalVirtualScrolling } from \"./composables/useHorizontalIndicesAndStyles\";\nimport { useResizeScrollSpacer } from \"./composables/useResizeScrollSpacer\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport interface Props {\n scrollData: DataItem[];\n scrollConfig: {\n numRowsAbove: number;\n numRowsBelow: number;\n itemSize: number;\n compact: boolean;\n };\n specialColumnSizes: {\n selectionSize: number;\n deletionSize: number;\n rightSideSize: number;\n };\n tableConfig: TableConfig;\n columnResizeActive: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst withLeftSideSize = (sizeManager: SizeManager) =>\n new WithSpaceBefore(\n {\n spaceBefore: computed(\n () =>\n props.specialColumnSizes.selectionSize +\n props.specialColumnSizes.deletionSize,\n ),\n spaceBeforeIsOffset: false,\n },\n sizeManager,\n );\nconst withRightSideSize = (sizeManager: SizeManager) =>\n new WithSpaceAfter(\n computed(() => props.specialColumnSizes.rightSideSize),\n sizeManager,\n );\n\n/**\n * The size manager input is split by output:\n * - `toOffset`/`getTotalSize` are applied imperatively (as CSS variables, see\n * useVirtualLine) and never read at render time, so they track the live\n * (per-frame) column sizes during a resize drag — the scrolled-area width and\n * offset stay correct while dragging without causing any re-render.\n * - `toIndex` determines the rendered column window (`indices`), which every\n * row and the header consume at render time. With live sizes the window\n * shifts whenever a column boundary crosses the buffered viewport edge\n * mid-drag, re-rendering all visible cells each time. It therefore uses the\n * resize-frozen sizes of the column-size context (frozen at drag start);\n * the window is corrected once when the resize ends.\n */\nconst { colSizes: liveColSizes, colSizesFrozenWhenResizing: indexColSizes } =\n injectColumnSizes();\n\nconst decorateWithSideSizes = (sizeManager: SizeManager) =>\n withLeftSideSize(withRightSideSize(sizeManager));\nconst liveSizeManager = decorateWithSideSizes(\n new ArraySizeManager(liveColSizes),\n);\nconst indexSizeManager = decorateWithSideSizes(\n new ArraySizeManager(indexColSizes),\n);\nconst columnSizeManager: SizeManager = {\n toIndex: (position) => indexSizeManager.toIndex(position),\n toOffset: (index) => liveSizeManager.toOffset(index),\n getTotalSize: () => liveSizeManager.getTotalSize(),\n getNumItems: () => liveSizeManager.getNumItems(),\n onUpdate: (callback) => liveSizeManager.onUpdate(callback),\n};\n\n/**\n * The number of columns is passed to the (empty) rows instead of the live\n * numeric `colSizes`: the rows read each cell width from the `--col-size-<index>`\n * CSS variable, so they only need the column count. Deriving it as a computed\n * means a per-frame `colSizes` change during a resize does not re-render this\n * component (and therefore does not re-invoke the forwarded row slot) as long as\n * the count is unchanged.\n */\nconst numColumns = computed(() => liveColSizes.value.length);\n\n/**\n * Buffer (in px) of additionally rendered columns on each side of the visible\n * viewport, larger than the scroller's 500px default: the rendered column\n * window is frozen while a column resize drag is active (see above), so when a\n * column is shrunk, the columns sliding in from the right are only those\n * already rendered into this buffer. Up to this many pixels of net shrink no\n * white space appears before the resize ends; the price is rendering the extra\n * buffered columns at all times.\n */\nconst HORIZONTAL_BUFFER_PX = 1000;\n\nconst numRows: Ref<number> = computed(\n () =>\n props.scrollData.length +\n props.scrollConfig.numRowsAbove +\n props.scrollConfig.numRowsBelow,\n);\nconst rowHeight = computed(() => props.scrollConfig.itemSize);\nconst rowSizeManager = new SameSizeManager(numRows, rowHeight);\n\nconst {\n containerProps,\n indices: { vertical, horizontal },\n scrolledAreaStyles: {\n vertical: verticalStyles,\n horizontal: horizontalStyles,\n },\n} = useVirtualGrid({\n rows: { sizeManager: rowSizeManager },\n columns: { sizeManager: columnSizeManager, buffer: HORIZONTAL_BUFFER_PX },\n});\n\nwatch(\n () => vertical.value,\n ({ endIndex, startIndex }) => {\n if (Number.isNaN(endIndex) || Number.isNaN(startIndex)) {\n return;\n }\n emit(\"scrollerUpdate\", startIndex, endIndex);\n },\n { immediate: true },\n);\n\nif (!props.tableConfig.forceRenderAll) {\n provideForHorizontalVirtualScrolling({\n horizontal,\n horizontalStyles,\n });\n}\n\nconst renderedRowIndices = computed(() =>\n props.tableConfig.forceRenderAll\n ? Array.from({ length: numRows.value }, (_, i) => i)\n : vertical.value.toArray(),\n);\n\n// DRAG HANDLE\n\nconst headerContainer: Ref<null | HTMLElement> = ref(null);\nconst getHeaderHeight = () => {\n return headerContainer.value?.offsetHeight ?? 0;\n};\n\nconst getBody = () => containerProps.ref.value?.querySelector(\"tbody\");\n\nconst getDragHandleHeight = () => {\n const scrollContainer = containerProps.ref.value;\n if (scrollContainer === null) {\n return 0;\n }\n const headerHeight = getHeaderHeight();\n /**\n * If the second argument is the smaller one, this means that the scroller is\n * not scrollable at the moment, i.e. adding the header height to the body height\n * is the desired height, as they cannot overlap.\n */\n return Math.min(\n scrollContainer.offsetHeight,\n Math.floor(getBody()!.offsetHeight + headerHeight),\n );\n};\n\nconst headerHeight = ref(0);\nconst updateHeaderHeight = () => {\n headerHeight.value = getHeaderHeight();\n};\nonMounted(updateHeaderHeight);\nuseResizeObserver(headerContainer, updateHeaderHeight);\n\nconst emptyStateStyle = computed(() => ({\n height: `calc(100% - ${headerHeight.value}px)`,\n}));\n\nconst isEmpty = computed(() => numRows.value === 0);\n\n/**\n * With all rows rendered there is nothing to scroll, so the container only takes\n * the space it needs. Without any rows it keeps the full height nonetheless: the\n * empty state fills the space the rows would have occupied, and the container's\n * horizontal scrollbar belongs at the bottom of the table rather than directly\n * below the header.\n */\nconst fitContent = computed(\n () => props.tableConfig.forceRenderAll && !isEmpty.value,\n);\n\nconst {\n closeExpandedSubMenu,\n containerRef: injectedContainerRef,\n overflowStyles,\n} = useCommonScrollContainerProps();\n\nconst {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n} = useResizeScrollSpacer({\n columnResizeActive: toRef(props, \"columnResizeActive\"),\n currentBodyWidth: injectBodyWidth(),\n scrollContainer: containerProps.ref,\n});\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n scrollToPosition: ({ top, left }: { top?: number; left?: number }) => {\n if (top !== undefined) {\n containerProps.ref.value!.scrollTop = top;\n }\n if (left !== undefined) {\n containerProps.ref.value!.scrollLeft = left;\n }\n containerProps.onScroll();\n },\n getScrollStart: () => containerProps.ref.value!.scrollTop,\n getBody,\n getContainer: () => containerProps.ref.value,\n});\n</script>\n\n<template>\n <div\n v-if=\"containerProps\"\n :ref=\"\n (element) => {\n containerProps.ref.value = injectedContainerRef =\n element as HTMLElement | null;\n }\n \"\n :style=\"overflowStyles\"\n :class=\"['container', { 'fit-content': fitContent }]\"\n @scroll=\"() => [containerProps.onScroll(), closeExpandedSubMenu()]\"\n >\n <div ref=\"headerContainer\" class=\"header-container\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </div>\n <TableBodyNavigatable\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @expand-selected-cell=\"emit('expandSelectedCell')\"\n @start-editing=\"(initialValue) => emit('startEditing', initialValue)\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #bodyContent>\n <slot name=\"cell-selection-overlay\" />\n <div :style=\"tableConfig.forceRenderAll ? {} : verticalStyles\">\n <VirtualRow\n v-for=\"rowInd in renderedRowIndices\"\n :key=\"rowInd\"\n #default=\"{ row }\"\n :row-height=\"scrollConfig.itemSize\"\n :compact=\"scrollConfig.compact\"\n :data-item=\"scrollData[rowInd - scrollConfig.numRowsAbove]\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n >\n <slot name=\"row\" :row-ind=\"rowInd\" :row=\"row\" />\n </VirtualRow>\n </div>\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n </TableBodyNavigatable>\n <!--\n The empty state takes over the space left over by the empty body. It is\n sticky rather than part of the scrolled content, so that it stays put while\n scrolling horizontally through the (row-less) columns.\n -->\n <div\n v-if=\"isEmpty && $slots['empty-state']\"\n class=\"empty-state-container\"\n :style=\"emptyStateStyle\"\n >\n <slot name=\"empty-state\" />\n </div>\n <!--\n While a column is being resized we add a screen-wide spacer to the right of\n the table content. This guarantees there is always horizontal scroll room\n so the edge auto-scroll (see Header.vue) can keep growing a column - in\n particular the last one - past the current table width. When the resize ends\n we animate its width back down to the current body width so the extra scroll\n room collapses smoothly, then unmount it (see onResizeScrollSpacerTransitionEnd).\n -->\n <div\n v-if=\"showResizeScrollSpacer\"\n :class=\"[\n 'resize-scroll-spacer',\n { collapsing: collapseResizeScrollSpacer },\n ]\"\n aria-hidden=\"true\"\n :style=\"{\n width: `calc(var(${BODY_WIDTH_CSS_VAR}) + ${additionalSpacerWidth})`,\n }\"\n @transitionend=\"onResizeScrollSpacerTransitionEnd\"\n />\n </div>\n</template>\n\n<style scoped>\n.container {\n flex: 1 1 0;\n\n &.fit-content {\n flex: 0 0 auto;\n }\n\n & .header-container {\n position: sticky;\n top: 0;\n z-index: var(--z-index-sticky-header);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n & tbody {\n /**\n * Necessary for the absolutely placed elements inside of it (e.g. cell selection overlay)\n * to scroll with the body.\n */\n position: relative;\n\n /**\n * Otherwise there is a small margin from the left that leads to an unnecessary scrollbar\n */\n display: block;\n\n /**\n * Necessary so that non-virtual elements (like drag handles) are wide enough\n */\n width: fit-content;\n }\n}\n\n.empty-state-container {\n position: sticky;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n\n /*\n The two spacers share the space around the empty state equally, i.e. they\n center it - but the upper one is capped, so with plenty of space the message\n stays close to the header instead of drifting into the middle of the table.\n */\n &::before,\n &::after {\n flex: 1 1 0;\n content: \"\";\n }\n\n &::before {\n max-height: var(--kds-spacing-container-5x);\n }\n\n /* Rather overflow than squeeze the message when the space gets tight. */\n & > * {\n flex: 0 0 auto;\n }\n}\n\n.resize-scroll-spacer {\n /* Only animate when collapsing back after a resize ends; while resizing the width\n tracks the growing column and must update instantly. */\n &.collapsing {\n transition: width 0.2s ease;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, toRef, watch } from \"vue\";\nimport { useResizeObserver } from \"@vueuse/core\";\nimport \"../assets/global-z-indices.css\";\n\nimport {\n ArraySizeManager,\n SameSizeManager,\n type SizeManager,\n WithSpaceAfter,\n WithSpaceBefore,\n useVirtualGrid,\n} from \"@knime/vue-headless-virtual-scroller\";\n\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableBodyNavigatable from \"./TableBodyNavigatable.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport VirtualRow from \"./VirtualRow.vue\";\nimport {\n BODY_WIDTH_CSS_VAR,\n injectBodyWidth,\n} from \"./composables/useBodyWidth\";\nimport { useCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { provideForHorizontalVirtualScrolling } from \"./composables/useHorizontalIndicesAndStyles\";\nimport { useResizeScrollSpacer } from \"./composables/useResizeScrollSpacer\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport interface Props {\n scrollData: DataItem[];\n scrollConfig: {\n numRowsAbove: number;\n numRowsBelow: number;\n itemSize: number;\n compact: boolean;\n };\n specialColumnSizes: {\n selectionSize: number;\n deletionSize: number;\n rightSideSize: number;\n };\n tableConfig: TableConfig;\n columnResizeActive: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst withLeftSideSize = (sizeManager: SizeManager) =>\n new WithSpaceBefore(\n {\n spaceBefore: computed(\n () =>\n props.specialColumnSizes.selectionSize +\n props.specialColumnSizes.deletionSize,\n ),\n spaceBeforeIsOffset: false,\n },\n sizeManager,\n );\nconst withRightSideSize = (sizeManager: SizeManager) =>\n new WithSpaceAfter(\n computed(() => props.specialColumnSizes.rightSideSize),\n sizeManager,\n );\n\n/**\n * The size manager input is split by output:\n * - `toOffset`/`getTotalSize` are applied imperatively (as CSS variables, see\n * useVirtualLine) and never read at render time, so they track the live\n * (per-frame) column sizes during a resize drag — the scrolled-area width and\n * offset stay correct while dragging without causing any re-render.\n * - `toIndex` determines the rendered column window (`indices`), which every\n * row and the header consume at render time. With live sizes the window\n * shifts whenever a column boundary crosses the buffered viewport edge\n * mid-drag, re-rendering all visible cells each time. It therefore uses the\n * resize-frozen sizes of the column-size context (frozen at drag start);\n * the window is corrected once when the resize ends.\n */\nconst { colSizes: liveColSizes, colSizesFrozenWhenResizing: indexColSizes } =\n injectColumnSizes();\n\nconst decorateWithSideSizes = (sizeManager: SizeManager) =>\n withLeftSideSize(withRightSideSize(sizeManager));\nconst liveSizeManager = decorateWithSideSizes(\n new ArraySizeManager(liveColSizes),\n);\nconst indexSizeManager = decorateWithSideSizes(\n new ArraySizeManager(indexColSizes),\n);\nconst columnSizeManager: SizeManager = {\n toIndex: (position) => indexSizeManager.toIndex(position),\n toOffset: (index) => liveSizeManager.toOffset(index),\n getTotalSize: () => liveSizeManager.getTotalSize(),\n getNumItems: () => liveSizeManager.getNumItems(),\n onUpdate: (callback) => liveSizeManager.onUpdate(callback),\n};\n\n/**\n * The number of columns is passed to the (empty) rows instead of the live\n * numeric `colSizes`: the rows read each cell width from the `--col-size-<index>`\n * CSS variable, so they only need the column count. Deriving it as a computed\n * means a per-frame `colSizes` change during a resize does not re-render this\n * component (and therefore does not re-invoke the forwarded row slot) as long as\n * the count is unchanged.\n */\nconst numColumns = computed(() => liveColSizes.value.length);\n\n/**\n * Buffer (in px) of additionally rendered columns on each side of the visible\n * viewport, larger than the scroller's 500px default: the rendered column\n * window is frozen while a column resize drag is active (see above), so when a\n * column is shrunk, the columns sliding in from the right are only those\n * already rendered into this buffer. Up to this many pixels of net shrink no\n * white space appears before the resize ends; the price is rendering the extra\n * buffered columns at all times.\n */\nconst HORIZONTAL_BUFFER_PX = 1000;\n\nconst numRows: Ref<number> = computed(\n () =>\n props.scrollData.length +\n props.scrollConfig.numRowsAbove +\n props.scrollConfig.numRowsBelow,\n);\nconst rowHeight = computed(() => props.scrollConfig.itemSize);\nconst rowSizeManager = new SameSizeManager(numRows, rowHeight);\n\nconst {\n containerProps,\n indices: { vertical, horizontal },\n scrolledAreaStyles: {\n vertical: verticalStyles,\n horizontal: horizontalStyles,\n },\n} = useVirtualGrid({\n rows: { sizeManager: rowSizeManager },\n columns: { sizeManager: columnSizeManager, buffer: HORIZONTAL_BUFFER_PX },\n});\n\nwatch(\n () => vertical.value,\n ({ endIndex, startIndex }) => {\n if (Number.isNaN(endIndex) || Number.isNaN(startIndex)) {\n return;\n }\n emit(\"scrollerUpdate\", startIndex, endIndex);\n },\n { immediate: true },\n);\n\nif (!props.tableConfig.forceRenderAll) {\n provideForHorizontalVirtualScrolling({\n horizontal,\n horizontalStyles,\n });\n}\n\nconst renderedRowIndices = computed(() =>\n props.tableConfig.forceRenderAll\n ? Array.from({ length: numRows.value }, (_, i) => i)\n : vertical.value.toArray(),\n);\n\n// DRAG HANDLE\n\nconst headerContainer: Ref<null | HTMLElement> = ref(null);\nconst getHeaderHeight = () => {\n return headerContainer.value?.offsetHeight ?? 0;\n};\n\nconst getBody = () => containerProps.ref.value?.querySelector(\"tbody\");\n\nconst getDragHandleHeight = () => {\n const scrollContainer = containerProps.ref.value;\n if (scrollContainer === null) {\n return 0;\n }\n const headerHeight = getHeaderHeight();\n /**\n * If the second argument is the smaller one, this means that the scroller is\n * not scrollable at the moment, i.e. adding the header height to the body height\n * is the desired height, as they cannot overlap.\n */\n return Math.min(\n scrollContainer.offsetHeight,\n Math.floor(getBody()!.offsetHeight + headerHeight),\n );\n};\n\nconst headerHeight = ref(0);\nconst updateHeaderHeight = () => {\n headerHeight.value = getHeaderHeight();\n};\nonMounted(updateHeaderHeight);\nuseResizeObserver(headerContainer, updateHeaderHeight);\n\nconst emptyStateStyle = computed(() => ({\n height: `calc(100% - ${headerHeight.value}px)`,\n}));\n\nconst isEmpty = computed(() => numRows.value === 0);\n\n/**\n * With all rows rendered there is nothing to scroll, so the container only takes\n * the space it needs. Without any rows it keeps the full height nonetheless: the\n * empty state fills the space the rows would have occupied, and the container's\n * horizontal scrollbar belongs at the bottom of the table rather than directly\n * below the header.\n */\nconst fitContent = computed(\n () => props.tableConfig.forceRenderAll && !isEmpty.value,\n);\n\nconst {\n closeExpandedSubMenu,\n containerRef: injectedContainerRef,\n overflowStyles,\n} = useCommonScrollContainerProps();\n\nconst {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n} = useResizeScrollSpacer({\n columnResizeActive: toRef(props, \"columnResizeActive\"),\n currentBodyWidth: injectBodyWidth(),\n scrollContainer: containerProps.ref,\n});\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n scrollToPosition: ({ top, left }: { top?: number; left?: number }) => {\n if (top !== undefined) {\n containerProps.ref.value!.scrollTop = top;\n }\n if (left !== undefined) {\n containerProps.ref.value!.scrollLeft = left;\n }\n containerProps.onScroll();\n },\n getScrollStart: () => containerProps.ref.value!.scrollTop,\n getBody,\n getContainer: () => containerProps.ref.value,\n});\n</script>\n\n<template>\n <div\n v-if=\"containerProps\"\n :ref=\"\n (element) => {\n containerProps.ref.value = injectedContainerRef =\n element as HTMLElement | null;\n }\n \"\n :style=\"overflowStyles\"\n :class=\"['container', { 'fit-content': fitContent }]\"\n @scroll=\"() => [containerProps.onScroll(), closeExpandedSubMenu()]\"\n >\n <div ref=\"headerContainer\" class=\"header-container\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </div>\n <TableBodyNavigatable\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @expand-selected-cell=\"emit('expandSelectedCell')\"\n @start-editing=\"(initialValue) => emit('startEditing', initialValue)\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #bodyContent>\n <slot name=\"cell-selection-overlay\" />\n <div :style=\"tableConfig.forceRenderAll ? {} : verticalStyles\">\n <VirtualRow\n v-for=\"rowInd in renderedRowIndices\"\n :key=\"rowInd\"\n #default=\"{ row }\"\n :row-height=\"scrollConfig.itemSize\"\n :compact=\"scrollConfig.compact\"\n :data-item=\"scrollData[rowInd - scrollConfig.numRowsAbove]\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n >\n <slot name=\"row\" :row-ind=\"rowInd\" :row=\"row\" />\n </VirtualRow>\n </div>\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n </TableBodyNavigatable>\n <!--\n The empty state takes over the space left over by the empty body. It is\n sticky rather than part of the scrolled content, so that it stays put while\n scrolling horizontally through the (row-less) columns.\n -->\n <div\n v-if=\"isEmpty && $slots['empty-state']\"\n class=\"empty-state-container\"\n :style=\"emptyStateStyle\"\n >\n <slot name=\"empty-state\" />\n </div>\n <!--\n While a column is being resized we add a screen-wide spacer to the right of\n the table content. This guarantees there is always horizontal scroll room\n so the edge auto-scroll (see Header.vue) can keep growing a column - in\n particular the last one - past the current table width. When the resize ends\n we animate its width back down to the current body width so the extra scroll\n room collapses smoothly, then unmount it (see onResizeScrollSpacerTransitionEnd).\n -->\n <div\n v-if=\"showResizeScrollSpacer\"\n :class=\"[\n 'resize-scroll-spacer',\n { collapsing: collapseResizeScrollSpacer },\n ]\"\n aria-hidden=\"true\"\n :style=\"{\n width: `calc(var(${BODY_WIDTH_CSS_VAR}) + ${additionalSpacerWidth})`,\n }\"\n @transitionend=\"onResizeScrollSpacerTransitionEnd\"\n />\n </div>\n</template>\n\n<style scoped>\n.container {\n flex: 1 1 0;\n\n &.fit-content {\n flex: 0 0 auto;\n }\n\n & .header-container {\n position: sticky;\n top: 0;\n z-index: var(--z-index-sticky-header);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n & tbody {\n /**\n * Necessary for the absolutely placed elements inside of it (e.g. cell selection overlay)\n * to scroll with the body.\n */\n position: relative;\n\n /**\n * Otherwise there is a small margin from the left that leads to an unnecessary scrollbar\n */\n display: block;\n\n /**\n * Necessary so that non-virtual elements (like drag handles) are wide enough\n */\n width: fit-content;\n }\n}\n\n.empty-state-container {\n position: sticky;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n\n /*\n The two spacers share the space around the empty state equally, i.e. they\n center it - but the upper one is capped, so with plenty of space the message\n stays close to the header instead of drifting into the middle of the table.\n */\n &::before,\n &::after {\n flex: 1 1 0;\n content: \"\";\n }\n\n &::before {\n max-height: var(--kds-spacing-container-5x);\n }\n\n /* Rather overflow than squeeze the message when the space gets tight. */\n & > * {\n flex: 0 0 auto;\n }\n}\n\n.resize-scroll-spacer {\n /* Only animate when collapsing back after a resize ends; while resizing the width\n tracks the growing column and must update instantly. */\n &.collapsing {\n transition: width 0.2s ease;\n }\n}\n</style>\n","'use strict';\n\nvar rafThrottle = function rafThrottle(callback) {\n var requestId = null;\n var lastArgs;\n var later = function later(context) {\n return function () {\n requestId = null;\n callback.apply(context, lastArgs);\n };\n };\n var throttled = function throttled() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n lastArgs = args;\n if (requestId === null) {\n requestId = requestAnimationFrame(later(this));\n }\n };\n throttled.cancel = function () {\n cancelAnimationFrame(requestId);\n requestId = null;\n };\n return throttled;\n};\n\nmodule.exports = rafThrottle;\n","// a vue composable for the capability of the the TableUI to detect the available width for all columns.\nimport {\n type Ref,\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from \"vue\";\nimport throttle from \"raf-throttle\";\n\nexport const useTotalWidth = (root: Ref<null | HTMLElement>) => {\n const totalWidth: Ref<null | number> = ref(null);\n\n const rootResizeCallback = throttle((entries) => {\n const rect = entries[0].contentRect;\n totalWidth.value = rect.width;\n });\n const rootResizeObserver = new ResizeObserver(rootResizeCallback);\n\n onMounted(() => {\n if (root.value) {\n rootResizeObserver.observe(root.value);\n }\n });\n\n onBeforeUnmount(() => {\n if (root.value) {\n rootResizeObserver.unobserve(root.value);\n }\n });\n\n return totalWidth;\n};\n\nconst useScrollbarSizes = (scrolledElement: Ref<null | HTMLElement>) => {\n const currentScrollBarWidth = ref<null | number>(null);\n const currentScrollBarHeight = ref<null | number>(null);\n\n const scrollbarWidthCallback = throttle((entries) => {\n const totalWidth = entries[0].borderBoxSize[0].inlineSize;\n const innerWidth = entries[0].contentRect.width;\n const totalHeight = entries[0].borderBoxSize[0].blockSize;\n const innerHeight = entries[0].contentRect.height;\n currentScrollBarHeight.value = Math.ceil(totalHeight - innerHeight);\n currentScrollBarWidth.value = Math.ceil(totalWidth - innerWidth);\n });\n const scrollbarWidthObserver = new ResizeObserver(scrollbarWidthCallback);\n\n onMounted(() => {\n // next tick necessary for the virtual scroller to be rendered\n nextTick(() => {\n if (scrolledElement.value) {\n scrollbarWidthObserver.observe(scrolledElement.value);\n }\n });\n });\n\n /**\n * If the scroller is refreshed, the scrollbar width observer needs to be updated.\n */\n watch(\n () => scrolledElement.value,\n (newEl, oldEl) => {\n if (oldEl !== null) {\n scrollbarWidthObserver.unobserve(oldEl);\n }\n if (newEl !== null) {\n scrollbarWidthObserver.observe(newEl);\n }\n },\n );\n\n onBeforeUnmount(() => {\n if (scrolledElement.value) {\n scrollbarWidthObserver.unobserve(scrolledElement.value);\n }\n });\n\n return { currentScrollBarWidth, currentScrollBarHeight };\n};\n\nexport const useAvailableWidth = ({\n emitAvailableWidth,\n specialColumnsSizeTotal,\n refs: { scrolledElement },\n totalWidth,\n}: {\n emitAvailableWidth: (availableWidth: number) => void;\n specialColumnsSizeTotal: Ref<number>;\n refs: {\n scrolledElement: Ref<null | HTMLElement>;\n };\n totalWidth: Ref<null | number>;\n}) => {\n const { currentScrollBarWidth, currentScrollBarHeight } =\n useScrollbarSizes(scrolledElement);\n\n const totalWidthWithoutSpecialColumns = computed(() => {\n if (totalWidth.value === null) {\n return null;\n }\n return totalWidth.value - specialColumnsSizeTotal.value;\n });\n const currentDataWidth = computed(() => {\n if (\n totalWidthWithoutSpecialColumns.value === null ||\n currentScrollBarWidth.value === null\n ) {\n return null;\n }\n return totalWidthWithoutSpecialColumns.value - currentScrollBarWidth.value;\n });\n\n const innerWidthToBodyWidth = (columnsWidth: number) => {\n return columnsWidth + specialColumnsSizeTotal.value;\n };\n\n const fitsInsideTotalWidth = (bodyWidth: number) => {\n let width = totalWidth.value ?? 0;\n if (currentScrollBarWidth.value) {\n width -= currentScrollBarWidth.value;\n }\n return Math.floor(bodyWidth) <= width;\n };\n\n const allSizes = computed(() => ({\n currentDataWidth: currentDataWidth.value,\n totalWidthWithoutSpecialColumns: totalWidthWithoutSpecialColumns.value,\n }));\n\n watch(\n allSizes,\n (\n {\n currentDataWidth: newCurrentDataWidth,\n totalWidthWithoutSpecialColumns: newTotalWidthWithoutSpecialColumns,\n },\n {\n currentDataWidth: oldCurrentDataWidth,\n totalWidthWithoutSpecialColumns: oldTotalWidthWithoutSpecialColumns,\n },\n ) => {\n if (newCurrentDataWidth !== null) {\n const changeIsInducedByAppearingScrollbar =\n oldTotalWidthWithoutSpecialColumns ===\n newTotalWidthWithoutSpecialColumns &&\n oldCurrentDataWidth !== null &&\n oldCurrentDataWidth > newCurrentDataWidth;\n const yScrollBarExistsBecauseOfXScrollBar =\n currentScrollBarHeight.value &&\n scrolledElement.value!.scrollHeight <=\n scrolledElement.value!.clientHeight + currentScrollBarHeight.value;\n if (\n changeIsInducedByAppearingScrollbar &&\n yScrollBarExistsBecauseOfXScrollBar\n ) {\n /**\n * Updating the available width in this case can lead to an endless flicker loop:\n * 1. An x-scrollbar appears, because the content is too wide\n * 2. A y-scrollbar appears, because the x-scrollbar appeared\n * 3. The available width is updated, because the y-scrollbar appeared\n * 4. The content is scaled accordingly\n * 5. The x-scrollbar disappears, because the content is now smaller\n * 6. The y-scrollbar disappears, because the x-scrollbar disappeared\n * 7. The available width is updated, because the y-scrollbar disappeared\n * 8. The content is scaled accordingly\n * 9. Go to 1.\n *\n * To prevent this, we do not update the available width, if the y-scrollbar only exists because of the x-scrollbar.\n */\n return;\n }\n emitAvailableWidth(newCurrentDataWidth);\n }\n },\n );\n\n return { innerWidthToBodyWidth, fitsInsideTotalWidth };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, toRef } from \"vue\";\n\nimport \"../assets/global-z-indices.css\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../constants\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableCoreVirtual from \"./TableCoreVirtual.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport { useAvailableWidth } from \"./composables/useAvailableWidth\";\nimport { useBodyWidth } from \"./composables/useBodyWidth\";\nimport { provideCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nconst props = defineProps<{\n scrollData: DataItem[][];\n scrollConfig: {\n itemSize: number;\n numRowsAbove: number;\n numRowsBelow: number;\n compact: boolean;\n };\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n totalWidth: null | number;\n currentRowHeight: number | \"dynamic\";\n columnResize: {\n active: boolean;\n };\n newColumnButtonWidth: number;\n}>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n \"update:available-width\": [newAvailableWidth: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst tableCoreVirtual = ref<InstanceType<typeof TableCoreVirtual> | null>(\n null,\n);\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n virtualScrollToPosition: (position: { top?: number; left?: number }) =>\n tableCoreVirtual.value?.scrollToPosition(position),\n getVirtualScrollStart: () => tableCoreVirtual.value?.getScrollStart(),\n getVirtualBody: () => tableCoreVirtual.value?.getBody(),\n getVirtualContainer: () => tableCoreVirtual.value?.getContainer(),\n});\n\nconst selectionSize = computed(() =>\n props.tableConfig.showSelection ? SPECIAL_COLUMNS_SIZE : 0,\n);\nconst deletionSize = computed(() =>\n props.tableConfig.enableRowDeletion ? SPECIAL_COLUMNS_SIZE : 0,\n);\n\nconst rightSideSize = computed(() => {\n const rowSubMenuSpace =\n (props.subMenuConfig.subMenuItems ?? []).length > 0 ||\n props.subMenuConfig.reserveSpaceForSubMenu === \"always\"\n ? SPECIAL_COLUMNS_SIZE\n : 0;\n return rowSubMenuSpace + props.newColumnButtonWidth;\n});\n\nconst scrolledElement = ref<HTMLElement | null>(null);\nconst { fitsInsideTotalWidth, innerWidthToBodyWidth } = useAvailableWidth({\n emitAvailableWidth: (newWidth) => emit(\"update:available-width\", newWidth),\n specialColumnsSizeTotal: computed(\n () => selectionSize.value + deletionSize.value + rightSideSize.value,\n ),\n refs: { scrolledElement },\n totalWidth: toRef(props, \"totalWidth\"),\n});\n\nconst { colSizes } = injectColumnSizes();\n\n/**\n * Note that this currentBodyWidth is currently smaller than the actual content width of the scrolled container\n * in case column resizing is active, since the resize handle area does not fit within a headers cell completely.\n *\n * It is intentionally not read in this component's template: instead it is written to a CSS variable on the\n * scroll container by {@link useBodyWidth} (consumed by the sticky header and the resize scroll spacer) and\n * provided as a numeric ref for the few JS-only consumers. This keeps TableCore from re-rendering whenever the\n * live column sizes change (e.g. per frame during a column resize).\n */\nconst currentBodyWidth = computed(() => {\n const widthContentColumns = colSizes.value.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (prev: any, curr: any) => prev + curr,\n 0,\n );\n return innerWidthToBodyWidth(widthContentColumns);\n});\nuseBodyWidth(currentBodyWidth, scrolledElement);\n\nconst fitsWithoutHorizontalScrollbar = computed(() =>\n fitsInsideTotalWidth(currentBodyWidth.value),\n);\n\nprovideCommonScrollContainerProps(scrolledElement, {\n fitsWithoutHorizontalScrollbar,\n columnResizeActive: computed(() => props.columnResize.active),\n});\n</script>\n\n<template>\n <TableCoreVirtual\n ref=\"tableCoreVirtual\"\n :scroll-data=\"scrollData[0]\"\n :scroll-config=\"scrollConfig\"\n :special-column-sizes=\"{\n selectionSize,\n deletionSize,\n rightSideSize,\n }\"\n :table-config=\"tableConfig\"\n :column-resize-active=\"columnResize.active\"\n @scroller-update=\"\n (startIndex, endIndex) => emit('scrollerUpdate', startIndex, endIndex)\n \"\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #header=\"{ getDragHandleHeight }\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </template>\n <template #row=\"{ row, rowInd }\">\n <slot name=\"row\" :row=\"row\" :row-ind=\"rowInd\" :group-ind=\"null\" />\n </template>\n <template #cell-selection-overlay>\n <slot name=\"cell-selection-overlay\" />\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n <template v-if=\"$slots['empty-state']\" #empty-state>\n <slot name=\"empty-state\" />\n </template>\n </TableCoreVirtual>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, toRef } from \"vue\";\n\nimport \"../assets/global-z-indices.css\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../constants\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableCoreVirtual from \"./TableCoreVirtual.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport { useAvailableWidth } from \"./composables/useAvailableWidth\";\nimport { useBodyWidth } from \"./composables/useBodyWidth\";\nimport { provideCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nconst props = defineProps<{\n scrollData: DataItem[][];\n scrollConfig: {\n itemSize: number;\n numRowsAbove: number;\n numRowsBelow: number;\n compact: boolean;\n };\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n totalWidth: null | number;\n currentRowHeight: number | \"dynamic\";\n columnResize: {\n active: boolean;\n };\n newColumnButtonWidth: number;\n}>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n \"update:available-width\": [newAvailableWidth: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst tableCoreVirtual = ref<InstanceType<typeof TableCoreVirtual> | null>(\n null,\n);\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n virtualScrollToPosition: (position: { top?: number; left?: number }) =>\n tableCoreVirtual.value?.scrollToPosition(position),\n getVirtualScrollStart: () => tableCoreVirtual.value?.getScrollStart(),\n getVirtualBody: () => tableCoreVirtual.value?.getBody(),\n getVirtualContainer: () => tableCoreVirtual.value?.getContainer(),\n});\n\nconst selectionSize = computed(() =>\n props.tableConfig.showSelection ? SPECIAL_COLUMNS_SIZE : 0,\n);\nconst deletionSize = computed(() =>\n props.tableConfig.enableRowDeletion ? SPECIAL_COLUMNS_SIZE : 0,\n);\n\nconst rightSideSize = computed(() => {\n const rowSubMenuSpace =\n (props.subMenuConfig.subMenuItems ?? []).length > 0 ||\n props.subMenuConfig.reserveSpaceForSubMenu === \"always\"\n ? SPECIAL_COLUMNS_SIZE\n : 0;\n return rowSubMenuSpace + props.newColumnButtonWidth;\n});\n\nconst scrolledElement = ref<HTMLElement | null>(null);\nconst { fitsInsideTotalWidth, innerWidthToBodyWidth } = useAvailableWidth({\n emitAvailableWidth: (newWidth) => emit(\"update:available-width\", newWidth),\n specialColumnsSizeTotal: computed(\n () => selectionSize.value + deletionSize.value + rightSideSize.value,\n ),\n refs: { scrolledElement },\n totalWidth: toRef(props, \"totalWidth\"),\n});\n\nconst { colSizes } = injectColumnSizes();\n\n/**\n * Note that this currentBodyWidth is currently smaller than the actual content width of the scrolled container\n * in case column resizing is active, since the resize handle area does not fit within a headers cell completely.\n *\n * It is intentionally not read in this component's template: instead it is written to a CSS variable on the\n * scroll container by {@link useBodyWidth} (consumed by the sticky header and the resize scroll spacer) and\n * provided as a numeric ref for the few JS-only consumers. This keeps TableCore from re-rendering whenever the\n * live column sizes change (e.g. per frame during a column resize).\n */\nconst currentBodyWidth = computed(() => {\n const widthContentColumns = colSizes.value.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (prev: any, curr: any) => prev + curr,\n 0,\n );\n return innerWidthToBodyWidth(widthContentColumns);\n});\nuseBodyWidth(currentBodyWidth, scrolledElement);\n\nconst fitsWithoutHorizontalScrollbar = computed(() =>\n fitsInsideTotalWidth(currentBodyWidth.value),\n);\n\nprovideCommonScrollContainerProps(scrolledElement, {\n fitsWithoutHorizontalScrollbar,\n columnResizeActive: computed(() => props.columnResize.active),\n});\n</script>\n\n<template>\n <TableCoreVirtual\n ref=\"tableCoreVirtual\"\n :scroll-data=\"scrollData[0]\"\n :scroll-config=\"scrollConfig\"\n :special-column-sizes=\"{\n selectionSize,\n deletionSize,\n rightSideSize,\n }\"\n :table-config=\"tableConfig\"\n :column-resize-active=\"columnResize.active\"\n @scroller-update=\"\n (startIndex, endIndex) => emit('scrollerUpdate', startIndex, endIndex)\n \"\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #header=\"{ getDragHandleHeight }\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </template>\n <template #row=\"{ row, rowInd }\">\n <slot name=\"row\" :row=\"row\" :row-ind=\"rowInd\" :group-ind=\"null\" />\n </template>\n <template #cell-selection-overlay>\n <slot name=\"cell-selection-overlay\" />\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n <template v-if=\"$slots['empty-state']\" #empty-state>\n <slot name=\"empty-state\" />\n </template>\n </TableCoreVirtual>\n</template>\n","import { reactive, ref } from \"vue\";\n\nexport const useBoolean = (initialValue = false) => {\n const state = ref(initialValue);\n const setTrue = () => {\n state.value = true;\n };\n const setFalse = () => {\n state.value = false;\n };\n return reactive({ state, setTrue, setFalse });\n};\n","import { type ComputedRef, type Ref, onMounted, onUnmounted } from \"vue\";\n\nimport type CellSelectionOverlay from \"../ui/CellSelectionOverlay.vue\";\n\nimport type { CellPosition } from \"./useCellSelection\";\n\nexport const useCellCopyPaste = ({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy,\n onPaste,\n onDelete,\n onCut,\n}: {\n focusWithin: Ref<boolean>;\n isEditingCell: Ref<boolean>;\n selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n >;\n selectedCell: ComputedRef<CellPosition | undefined>;\n isEditingEnabled: ComputedRef<boolean>;\n onCopy: ({ withHeaders }: { withHeaders: boolean }) => void;\n onPaste?: () => void;\n onCut?: () => void;\n onDelete?: () => void;\n}) => {\n const isHeaderCellSelected = () => selectedCell.value?.y === -1;\n\n const triggerCopyAnimation = () => {\n if (Array.isArray(selectionOverlay.value)) {\n selectionOverlay.value[0]?.triggerCopied();\n } else if (selectionOverlay.value) {\n selectionOverlay.value.triggerCopied();\n }\n };\n\n const isBodySelected = () => {\n return focusWithin.value && !isHeaderCellSelected() && !isEditingCell.value;\n };\n\n const onCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (!isBodySelected()) {\n return;\n }\n triggerCopyAnimation();\n onCopy({ withHeaders });\n };\n\n const onCutSelection = () => {\n if (isEditingEnabled.value && onCut && isBodySelected()) {\n triggerCopyAnimation();\n onCut();\n }\n };\n\n const onDeleteSelection = () => {\n if (isEditingEnabled.value && onDelete && isBodySelected()) {\n onDelete();\n }\n };\n\n const onPasteSelection = () => {\n if (isEditingEnabled.value && onPaste && isBodySelected()) {\n onPaste();\n }\n };\n\n const handleDefaultCopyEvent = () => {\n onCopySelection({ withHeaders: false });\n };\n\n const handleCopyOnKeydown = (e: KeyboardEvent) => {\n // Checks the physical key, since Option+C on macOS yields e.key \"ç\"\n if (e.code === \"KeyC\") {\n onCopySelection({ withHeaders: true });\n }\n };\n\n onMounted(() => {\n globalThis.addEventListener(\"copy\", handleDefaultCopyEvent);\n if (onPaste) {\n globalThis.addEventListener(\"paste\", onPasteSelection);\n }\n if (onCut) {\n globalThis.addEventListener(\"cut\", onCutSelection);\n }\n });\n\n onUnmounted(() => {\n globalThis.removeEventListener(\"copy\", handleDefaultCopyEvent);\n if (onPaste) {\n globalThis.removeEventListener(\"paste\", onPasteSelection);\n }\n if (onCut) {\n globalThis.removeEventListener(\"cut\", onCutSelection);\n }\n });\n\n return { handleCopyOnKeydown, handleDeleteSelection: onDeleteSelection };\n};\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { type Ref, computed, ref, watch } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nexport type CellPosition = {\n x: number;\n y: number;\n};\n\nclass CellRect {\n anchor: CellPosition;\n opposite: CellPosition;\n\n constructor(anchorPosition: CellPosition) {\n this.anchor = this.opposite = anchorPosition;\n }\n\n setCorner(cellPos: CellPosition) {\n if (isEqual(this.opposite, cellPos)) {\n return;\n }\n this.opposite = cellPos;\n }\n\n getMinMax(coord: keyof CellPosition) {\n const coords = [this.anchor[coord], this.opposite[coord]];\n return { min: Math.min(...coords), max: Math.max(...coords) };\n }\n}\n\nexport type MinMax = { min: number; max: number };\n\nexport type Rect = { x: MinMax; y: MinMax };\n\nexport type RectId = number;\n\nexport const useCellSelection = (enableCellSelection: Ref<boolean>) => {\n const cellRect = ref<CellRect | null>(null);\n const currentRectId: Ref<RectId | null> = ref(null);\n\n const rectMinMax = computed<Rect | null>(() => {\n const rectValue = cellRect.value;\n if (rectValue === null) {\n return null;\n }\n return {\n x: rectValue.getMinMax(\"x\"),\n y: rectValue.getMinMax(\"y\"),\n };\n });\n\n const selectedCell = computed(() => cellRect.value?.opposite);\n\n const isSingleSelectedCell = (cellPosition: CellPosition) => {\n return (\n cellRect.value !== null &&\n isEqual(cellRect.value.anchor, cellRect.value.opposite) &&\n isEqual(cellRect.value.anchor, cellPosition)\n );\n };\n\n const clearCellSelection = () => {\n cellRect.value = null;\n currentRectId.value = null;\n };\n\n watch(\n () => enableCellSelection.value,\n (isEnabled) => {\n if (!isEnabled) {\n clearCellSelection();\n }\n },\n );\n\n const selectCell = (\n cellPosition: CellPosition,\n rectId: RectId,\n ignoreIfSelected: boolean = false,\n ) => {\n if (\n rectId === currentRectId.value &&\n isSingleSelectedCell(cellPosition) &&\n !ignoreIfSelected\n ) {\n clearCellSelection();\n return;\n }\n cellRect.value = new CellRect(cellPosition);\n currentRectId.value = rectId;\n };\n\n const expandCellSelection = (cellPosition: CellPosition, rectId: RectId) => {\n if (cellRect.value === null || currentRectId.value !== rectId) {\n selectCell(cellPosition, rectId);\n return;\n }\n cellRect.value.setCorner(cellPosition);\n };\n\n const applyIfEnabled = (method: (...args: any[]) => void) => {\n return (...args: any[]) => {\n if (enableCellSelection.value) {\n method(...args);\n }\n };\n };\n\n return {\n selectCell: applyIfEnabled(selectCell),\n expandCellSelection: applyIfEnabled(expandCellSelection),\n clearCellSelection,\n rectMinMax,\n selectedCell,\n currentRectId,\n isSingleSelectedCell,\n };\n};\n","/**\n * This method returns true if we should stop processing the key event since it is\n * to be ignored outside of the editing context.\n */\nconst isToBeIgnoredKeyEvent = (keyEvent: KeyboardEvent) => {\n // Ignore backspace and delete to prevent clearing the cell value while editing\n return keyEvent.key === \"Backspace\" || keyEvent.key === \"Delete\";\n};\n\nexport const createEditingCellKeydownHandler = ({\n moveSelection,\n}: {\n moveSelection: (\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) => void;\n}) => {\n return (event: KeyboardEvent) => {\n if (isToBeIgnoredKeyEvent(event)) {\n event.stopPropagation();\n return;\n }\n if (event.key === \"Tab\") {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n moveSelection(horizontalMove, 0, false);\n } else if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n event.stopPropagation();\n moveSelection(0, 1, false);\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n // Select the underlying cell again to stop editing\n moveSelection(0, 0, false);\n }\n };\n};\n","import { nextTick, ref } from \"vue\";\n\n/**\n * Keeps the table hidden until one tick after the available width has been\n * reported for the first time.\n *\n * Column sizes that are derived from the available width (see the\n * `update:available-width` emit) can only be applied once that width is known,\n * i.e. anything rendered before that is rendered at sizes which are about to\n * change — a visible jump on every initial load. Waiting one tick after the\n * report lets the reaction to it (and with it the column-size CSS variables)\n * reach the DOM first, so the first frame the user sees is the final one.\n */\nexport const useVisibleAfterAvailableWidth = () => {\n const isVisible = ref(false);\n\n const onAvailableWidthReported = async () => {\n if (isVisible.value) {\n return;\n }\n await nextTick();\n isVisible.value = true;\n };\n\n return { isVisible, onAvailableWidthReported };\n};\n","<template>\n <div class=\"popover\">\n <span class=\"header\">\n <slot name=\"header\" />\n </span>\n <div class=\"body\">\n <slot name=\"body\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.popover {\n display: flex;\n flex-direction: column;\n gap: var(--kds-spacing-container-0-5x);\n align-items: flex-start;\n max-height: var(--kds-dimension-component-height-25x);\n padding: var(--kds-spacing-container-0-75x);\n background-color: var(--kds-color-surface-default);\n border-radius: var(--kds-border-radius-container-0-50x);\n box-shadow: var(--kds-elevation-level-3);\n\n & .header {\n font: var(--kds-font-base-title-xsmall);\n color: var(--kds-color-text-and-icon-muted);\n }\n\n & .body {\n width: 100%;\n }\n}\n</style>\n","import { type Ref, ref, watch } from \"vue\";\n\nexport const useButtonPopoverInteraction = ({\n keepButtonActive,\n}: {\n keepButtonActive: Ref<boolean>;\n}) => {\n const buttonIsActive = ref(keepButtonActive.value);\n const showPopover = ref(false);\n\n watch(keepButtonActive, (newValue) => {\n buttonIsActive.value = newValue || showPopover.value;\n });\n\n const onButtonClick = (isActive: boolean) => {\n showPopover.value = !showPopover.value;\n buttonIsActive.value = keepButtonActive.value || isActive;\n };\n\n const onPopoverToggle = (isOpen: boolean) => {\n buttonIsActive.value = keepButtonActive.value || isOpen;\n showPopover.value = isOpen;\n };\n\n const openPopover = () => {\n showPopover.value = true;\n buttonIsActive.value = true;\n };\n\n return {\n onButtonClick,\n onPopoverToggle,\n buttonIsActive,\n showPopover,\n openPopover,\n };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport {\n KdsDropdown,\n type KdsDropdownOption,\n KdsIcon,\n KdsPopover,\n KdsToggleButton,\n} from \"@knime/kds-components\";\nimport { dimension } from \"@knime/kds-styles/tokens\";\n\nimport type { ColSortValue } from \"../../..\";\n\nimport PopoverContainer from \"./PopoverContainer.vue\";\nimport { useButtonPopoverInteraction } from \"./useButtonPopoverInteraction\";\n\nconst POPOVER_MAX_INLINE_SIZE = dimension.component.width[\"20x\"].css.variable;\n\nexport type SortControlOptions = {\n selectableColumns: KdsDropdownOption[];\n selectableDirections: Record<string, KdsDropdownOption[]>;\n};\n\nconst NONE_COLUMN_VALUE = \"None\";\n\nconst props = defineProps<{\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst emit = defineEmits<{\n columnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n}>();\n\nconst sortPopoverRef = useTemplateRef(\"sortPopoverRef\");\nconst sortButtonEl = useTemplateRef(\"sortButton\");\n\n// Local column selection: tracks the user's in-progress pick independently of\n// whether a sort has been emitted yet. Synced from props when external state\n// changes (e.g. sort triggered from column header).\nconst selectedColumn = ref(\n props.colSortValues?.[0]?.id?.toString() ?? NONE_COLUMN_VALUE,\n);\nwatch(\n () => props.colSortValues?.[0]?.id,\n (val) => {\n if (val === undefined && selectedColumn.value !== undefined) {\n return;\n }\n selectedColumn.value = val?.toString() ?? NONE_COLUMN_VALUE;\n },\n);\n\nconst hasSortConfig = computed(\n () =>\n props.colSortValues !== undefined &&\n props.colSortValues[0]?.id !== undefined &&\n props.colSortValues[0]?.direction !== undefined,\n);\n\nconst possibleColumns = computed(() => [\n { id: NONE_COLUMN_VALUE, text: NONE_COLUMN_VALUE },\n ...props.sortControlOptions.selectableColumns,\n]);\n\nconst possibleDirections = computed(() =>\n selectedColumn.value === NONE_COLUMN_VALUE\n ? []\n : (props.sortControlOptions.selectableDirections[selectedColumn.value] ??\n []),\n);\n\nconst selectedSortDirection = computed(\n () => props.colSortValues?.[0]?.direction?.toString() ?? \"\",\n);\n\nconst { buttonIsActive, showPopover, onButtonClick, onPopoverToggle } =\n useButtonPopoverInteraction({ keepButtonActive: hasSortConfig });\n\nconst onSortColumnChange = (columnId: string) => {\n selectedColumn.value = columnId;\n if (columnId === NONE_COLUMN_VALUE) {\n emit(\"columnSort\", undefined, 0);\n return;\n }\n emit(\n \"columnSort\",\n columnId,\n (props.colSortValues?.[0]?.direction || 1) as 1 | -1,\n );\n};\n\nconst onSortDirectionChange = (direction: string) => {\n emit(\n \"columnSort\",\n selectedColumn.value,\n Number.parseInt(direction, 10) as 0 | 1 | -1,\n );\n};\n</script>\n\n<template>\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"buttonIsActive\"\n label=\"Sorting\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"sort-ascending\"\n :aria-controls=\"sortPopoverRef?.popoverId\"\n :aria-expanded=\"showPopover\"\n aria-haspopup=\"dialog\"\n @update:model-value=\"onButtonClick\"\n />\n\n <KdsPopover\n ref=\"sortPopoverRef\"\n :anchor=\"sortButtonEl?.$el\"\n :model-value=\"showPopover\"\n aria-label=\"Sort\"\n popover-type=\"auto\"\n role=\"dialog\"\n class=\"sort-popover\"\n stretch-inline\n :max-inline-size=\"POPOVER_MAX_INLINE_SIZE\"\n @update:model-value=\"onPopoverToggle\"\n >\n <PopoverContainer class=\"popover-container\">\n <template #header>\n <KdsIcon name=\"sort-ascending\" size=\"small\" /> Sorting\n </template>\n <template #body>\n <div class=\"body\">\n <KdsDropdown\n :model-value=\"selectedColumn\"\n :possible-values=\"possibleColumns\"\n ariaLabel=\"Column to sort by\"\n @update:model-value=\"onSortColumnChange\"\n />\n <KdsDropdown\n :model-value=\"selectedSortDirection\"\n :possible-values=\"possibleDirections\"\n ariaLabel=\"Sort direction\"\n :disabled=\"selectedColumn === NONE_COLUMN_VALUE\"\n placeholder=\"No sorting\"\n @update:model-value=\"onSortDirectionChange\"\n />\n </div>\n </template>\n </PopoverContainer>\n </KdsPopover>\n</template>\n\n<style scoped>\n.sort-popover {\n position-try-order: most-inline-size;\n}\n\n.popover-container {\n .body {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--kds-spacing-container-0-5x);\n\n & > * {\n min-width: 0;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport {\n KdsDropdown,\n type KdsDropdownOption,\n KdsIcon,\n KdsPopover,\n KdsToggleButton,\n} from \"@knime/kds-components\";\nimport { dimension } from \"@knime/kds-styles/tokens\";\n\nimport type { ColSortValue } from \"../../..\";\n\nimport PopoverContainer from \"./PopoverContainer.vue\";\nimport { useButtonPopoverInteraction } from \"./useButtonPopoverInteraction\";\n\nconst POPOVER_MAX_INLINE_SIZE = dimension.component.width[\"20x\"].css.variable;\n\nexport type SortControlOptions = {\n selectableColumns: KdsDropdownOption[];\n selectableDirections: Record<string, KdsDropdownOption[]>;\n};\n\nconst NONE_COLUMN_VALUE = \"None\";\n\nconst props = defineProps<{\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst emit = defineEmits<{\n columnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n}>();\n\nconst sortPopoverRef = useTemplateRef(\"sortPopoverRef\");\nconst sortButtonEl = useTemplateRef(\"sortButton\");\n\n// Local column selection: tracks the user's in-progress pick independently of\n// whether a sort has been emitted yet. Synced from props when external state\n// changes (e.g. sort triggered from column header).\nconst selectedColumn = ref(\n props.colSortValues?.[0]?.id?.toString() ?? NONE_COLUMN_VALUE,\n);\nwatch(\n () => props.colSortValues?.[0]?.id,\n (val) => {\n if (val === undefined && selectedColumn.value !== undefined) {\n return;\n }\n selectedColumn.value = val?.toString() ?? NONE_COLUMN_VALUE;\n },\n);\n\nconst hasSortConfig = computed(\n () =>\n props.colSortValues !== undefined &&\n props.colSortValues[0]?.id !== undefined &&\n props.colSortValues[0]?.direction !== undefined,\n);\n\nconst possibleColumns = computed(() => [\n { id: NONE_COLUMN_VALUE, text: NONE_COLUMN_VALUE },\n ...props.sortControlOptions.selectableColumns,\n]);\n\nconst possibleDirections = computed(() =>\n selectedColumn.value === NONE_COLUMN_VALUE\n ? []\n : (props.sortControlOptions.selectableDirections[selectedColumn.value] ??\n []),\n);\n\nconst selectedSortDirection = computed(\n () => props.colSortValues?.[0]?.direction?.toString() ?? \"\",\n);\n\nconst { buttonIsActive, showPopover, onButtonClick, onPopoverToggle } =\n useButtonPopoverInteraction({ keepButtonActive: hasSortConfig });\n\nconst onSortColumnChange = (columnId: string) => {\n selectedColumn.value = columnId;\n if (columnId === NONE_COLUMN_VALUE) {\n emit(\"columnSort\", undefined, 0);\n return;\n }\n emit(\n \"columnSort\",\n columnId,\n (props.colSortValues?.[0]?.direction || 1) as 1 | -1,\n );\n};\n\nconst onSortDirectionChange = (direction: string) => {\n emit(\n \"columnSort\",\n selectedColumn.value,\n Number.parseInt(direction, 10) as 0 | 1 | -1,\n );\n};\n</script>\n\n<template>\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"buttonIsActive\"\n label=\"Sorting\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"sort-ascending\"\n :aria-controls=\"sortPopoverRef?.popoverId\"\n :aria-expanded=\"showPopover\"\n aria-haspopup=\"dialog\"\n @update:model-value=\"onButtonClick\"\n />\n\n <KdsPopover\n ref=\"sortPopoverRef\"\n :anchor=\"sortButtonEl?.$el\"\n :model-value=\"showPopover\"\n aria-label=\"Sort\"\n popover-type=\"auto\"\n role=\"dialog\"\n class=\"sort-popover\"\n stretch-inline\n :max-inline-size=\"POPOVER_MAX_INLINE_SIZE\"\n @update:model-value=\"onPopoverToggle\"\n >\n <PopoverContainer class=\"popover-container\">\n <template #header>\n <KdsIcon name=\"sort-ascending\" size=\"small\" /> Sorting\n </template>\n <template #body>\n <div class=\"body\">\n <KdsDropdown\n :model-value=\"selectedColumn\"\n :possible-values=\"possibleColumns\"\n ariaLabel=\"Column to sort by\"\n @update:model-value=\"onSortColumnChange\"\n />\n <KdsDropdown\n :model-value=\"selectedSortDirection\"\n :possible-values=\"possibleDirections\"\n ariaLabel=\"Sort direction\"\n :disabled=\"selectedColumn === NONE_COLUMN_VALUE\"\n placeholder=\"No sorting\"\n @update:model-value=\"onSortDirectionChange\"\n />\n </div>\n </template>\n </PopoverContainer>\n </KdsPopover>\n</template>\n\n<style scoped>\n.sort-popover {\n position-try-order: most-inline-size;\n}\n\n.popover-container {\n .body {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--kds-spacing-container-0-5x);\n\n & > * {\n min-width: 0;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from \"vue\";\n\nimport {\n KdsButton,\n KdsInfoToggleButton,\n KdsMenuButton,\n KdsSearchInput,\n} from \"@knime/kds-components\";\n\nimport type { ActionConfig, ActionState, ColSortValue } from \"../../\";\nimport type { TableState } from \"../../types/TableConfig\";\n\nimport SortControl, {\n type SortControlOptions,\n} from \"./actionbar/SortControl.vue\";\n\nconst {\n tableSizes,\n rowLabel = \"Rows\",\n actionState,\n showTableSize = true,\n colSortValues = [],\n actionConfig,\n} = defineProps<{\n tableSizes?: TableState[\"tableSizes\"];\n rowLabel?: string;\n actionState?: ActionState;\n showTableSize?: boolean;\n actionConfig: ActionConfig;\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst slots = useSlots();\n\nconst viewType = computed(() => actionState?.viewType ?? \"DEFAULT\");\n\nconst isTemporaryView = computed(\n () => viewType.value === \"TEMP_VIEW\" || viewType.value === \"PREVIEW\",\n);\nconst isPreview = computed(() => viewType.value === \"PREVIEW\");\nconst showResetButton = computed(() => viewType.value === \"TEMP_VIEW\");\n\nconst hasContent = computed(\n () =>\n isTemporaryView.value ||\n showTableSize ||\n (actionConfig.enableSorting && !actionConfig.hideSortingButton) ||\n actionConfig.enableSearch ||\n actionConfig.forceShow ||\n Boolean(slots[\"action-bar-left\"]),\n);\n\n/**\n * Renders \"total\" by default, and \"current of total\" only when `current` is\n * given and strictly below `total`. The `current >= total` guard prevents an\n * inconsistent \"m of n\" where m would not be smaller than n. An unknown total\n * (`null`) renders as \"-\".\n */\nconst formatCount = (label: string, total: number | null, current?: number) => {\n if (total === null) {\n return `${label}: -`;\n }\n const appendTotal = current !== undefined && current < total;\n return `${label}: ${appendTotal ? `${current} of ${total}` : total}`;\n};\n\nconst rowText = computed(() =>\n formatCount(\n rowLabel,\n tableSizes ? tableSizes.totalNumRows : 0,\n tableSizes?.currentNumRows,\n ),\n);\n\nconst columnText = computed(() => {\n const totalNumColumns = tableSizes?.totalNumColumns ?? 0;\n if (totalNumColumns < 2) {\n return undefined;\n }\n return formatCount(\"Cols\", totalNumColumns, tableSizes?.currentNumColumns);\n});\n\nconst dimensionText = computed(() => {\n if (columnText.value === undefined) {\n return rowText.value;\n }\n return `${rowText.value} | ${columnText.value}`;\n});\n\nconst showRowCountDropdown = computed(() =>\n Boolean(actionConfig.rowCountItems?.length),\n);\n\nconst emit = defineEmits<{\n resetTemporaryView: [];\n onColumnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n \"update:searchTerm\": [newSearchTerm: string];\n}>();\n</script>\n\n<template>\n <div\n v-if=\"hasContent\"\n :class=\"['kds-table-action-bar', { 'temporary-view': isTemporaryView }]\"\n >\n <div class=\"left\">\n <SortControl\n v-if=\"actionConfig.enableSorting && !actionConfig.hideSortingButton\"\n :col-sort-values\n :sort-control-options\n @column-sort=\"\n (columnId, colDir) => emit('onColumnSort', columnId, colDir)\n \"\n />\n <slot name=\"action-bar-left\" />\n </div>\n <div class=\"center\">\n <div v-if=\"isPreview\" class=\"preview\">\n <span class=\"preview-label\">Preview</span>\n <KdsInfoToggleButton\n v-if=\"actionState?.previewDescription\"\n :content=\"actionState.previewDescription\"\n />\n </div>\n <span\n v-if=\"showTableSize && showRowCountDropdown\"\n class=\"dimension with-row-count-dropdown\"\n >\n <KdsMenuButton\n class=\"row-count-menu-button\"\n :label=\"rowText\"\n size=\"small\"\n variant=\"transparent\"\n trailing-icon=\"chevron-down\"\n :items=\"actionConfig.rowCountItems ?? []\"\n /><template v-if=\"columnText\">{{ ` | ${columnText}` }}</template>\n </span>\n <span v-else-if=\"showTableSize\" class=\"dimension\">\n {{ dimensionText }}\n </span>\n </div>\n <div class=\"right\">\n <KdsSearchInput\n v-if=\"actionConfig.enableSearch\"\n ariaLabel=\"Search table\"\n size=\"small\"\n :model-value=\"actionState?.searchTerm ?? ''\"\n @update:model-value=\"$emit('update:searchTerm', $event)\"\n />\n <KdsMenuButton\n v-if=\"actionConfig.settingsItems?.length\"\n ariaLabel=\"Table settings\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"parameter\"\n :items=\"actionConfig.settingsItems\"\n />\n <KdsButton\n v-if=\"showResetButton\"\n ariaLabel=\"Reset table\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"x-close\"\n @click=\"emit('resetTemporaryView')\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.kds-table-action-bar {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n min-height: var(--kds-dimension-component-height-2-5x);\n padding-right: var(--kds-spacing-container-0-25x);\n padding-left: var(--kds-spacing-container-0-5x);\n border-bottom: var(--kds-border-base-subtle);\n\n &.temporary-view {\n background-color: var(--kds-color-background-static-info-muted);\n }\n\n & .dimension {\n --dimension-font: var(--kds-font-base-title-small);\n --dimension-color: var(--kds-color-text-and-icon-muted);\n\n font: var(--dimension-font);\n color: var(--dimension-color);\n white-space: pre;\n\n &.with-row-count-dropdown {\n display: inline-flex;\n align-items: center;\n }\n\n /*\n * Match the row-count dropdown trigger's label to the dimension text.\n * :deep() is needed since KdsMenuButton is a multi-root component, so the\n * scope id is not inherited by the button element the class lands on.\n */\n & :deep(.row-count-menu-button) {\n font: var(--dimension-font);\n color: var(--dimension-color);\n }\n }\n\n & .preview {\n display: flex;\n gap: var(--kds-spacing-container-0-12x);\n align-items: center;\n\n & .preview-label {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-neutral);\n }\n }\n\n & .left,\n & .center,\n & .right {\n display: flex;\n flex: 1;\n align-items: center;\n min-width: 0;\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n & .left,\n & .center {\n gap: var(--kds-spacing-container-0-5x);\n }\n\n & .center {\n justify-content: center;\n }\n\n & .right {\n gap: var(--kds-spacing-container-0-25x);\n justify-content: flex-end;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from \"vue\";\n\nimport {\n KdsButton,\n KdsInfoToggleButton,\n KdsMenuButton,\n KdsSearchInput,\n} from \"@knime/kds-components\";\n\nimport type { ActionConfig, ActionState, ColSortValue } from \"../../\";\nimport type { TableState } from \"../../types/TableConfig\";\n\nimport SortControl, {\n type SortControlOptions,\n} from \"./actionbar/SortControl.vue\";\n\nconst {\n tableSizes,\n rowLabel = \"Rows\",\n actionState,\n showTableSize = true,\n colSortValues = [],\n actionConfig,\n} = defineProps<{\n tableSizes?: TableState[\"tableSizes\"];\n rowLabel?: string;\n actionState?: ActionState;\n showTableSize?: boolean;\n actionConfig: ActionConfig;\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst slots = useSlots();\n\nconst viewType = computed(() => actionState?.viewType ?? \"DEFAULT\");\n\nconst isTemporaryView = computed(\n () => viewType.value === \"TEMP_VIEW\" || viewType.value === \"PREVIEW\",\n);\nconst isPreview = computed(() => viewType.value === \"PREVIEW\");\nconst showResetButton = computed(() => viewType.value === \"TEMP_VIEW\");\n\nconst hasContent = computed(\n () =>\n isTemporaryView.value ||\n showTableSize ||\n (actionConfig.enableSorting && !actionConfig.hideSortingButton) ||\n actionConfig.enableSearch ||\n actionConfig.forceShow ||\n Boolean(slots[\"action-bar-left\"]),\n);\n\n/**\n * Renders \"total\" by default, and \"current of total\" only when `current` is\n * given and strictly below `total`. The `current >= total` guard prevents an\n * inconsistent \"m of n\" where m would not be smaller than n. An unknown total\n * (`null`) renders as \"-\".\n */\nconst formatCount = (label: string, total: number | null, current?: number) => {\n if (total === null) {\n return `${label}: -`;\n }\n const appendTotal = current !== undefined && current < total;\n return `${label}: ${appendTotal ? `${current} of ${total}` : total}`;\n};\n\nconst rowText = computed(() =>\n formatCount(\n rowLabel,\n tableSizes ? tableSizes.totalNumRows : 0,\n tableSizes?.currentNumRows,\n ),\n);\n\nconst columnText = computed(() => {\n const totalNumColumns = tableSizes?.totalNumColumns ?? 0;\n if (totalNumColumns < 2) {\n return undefined;\n }\n return formatCount(\"Cols\", totalNumColumns, tableSizes?.currentNumColumns);\n});\n\nconst dimensionText = computed(() => {\n if (columnText.value === undefined) {\n return rowText.value;\n }\n return `${rowText.value} | ${columnText.value}`;\n});\n\nconst showRowCountDropdown = computed(() =>\n Boolean(actionConfig.rowCountItems?.length),\n);\n\nconst emit = defineEmits<{\n resetTemporaryView: [];\n onColumnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n \"update:searchTerm\": [newSearchTerm: string];\n}>();\n</script>\n\n<template>\n <div\n v-if=\"hasContent\"\n :class=\"['kds-table-action-bar', { 'temporary-view': isTemporaryView }]\"\n >\n <div class=\"left\">\n <SortControl\n v-if=\"actionConfig.enableSorting && !actionConfig.hideSortingButton\"\n :col-sort-values\n :sort-control-options\n @column-sort=\"\n (columnId, colDir) => emit('onColumnSort', columnId, colDir)\n \"\n />\n <slot name=\"action-bar-left\" />\n </div>\n <div class=\"center\">\n <div v-if=\"isPreview\" class=\"preview\">\n <span class=\"preview-label\">Preview</span>\n <KdsInfoToggleButton\n v-if=\"actionState?.previewDescription\"\n :content=\"actionState.previewDescription\"\n />\n </div>\n <span\n v-if=\"showTableSize && showRowCountDropdown\"\n class=\"dimension with-row-count-dropdown\"\n >\n <KdsMenuButton\n class=\"row-count-menu-button\"\n :label=\"rowText\"\n size=\"small\"\n variant=\"transparent\"\n trailing-icon=\"chevron-down\"\n :items=\"actionConfig.rowCountItems ?? []\"\n /><template v-if=\"columnText\">{{ ` | ${columnText}` }}</template>\n </span>\n <span v-else-if=\"showTableSize\" class=\"dimension\">\n {{ dimensionText }}\n </span>\n </div>\n <div class=\"right\">\n <KdsSearchInput\n v-if=\"actionConfig.enableSearch\"\n ariaLabel=\"Search table\"\n size=\"small\"\n :model-value=\"actionState?.searchTerm ?? ''\"\n @update:model-value=\"$emit('update:searchTerm', $event)\"\n />\n <KdsMenuButton\n v-if=\"actionConfig.settingsItems?.length\"\n ariaLabel=\"Table settings\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"parameter\"\n :items=\"actionConfig.settingsItems\"\n />\n <KdsButton\n v-if=\"showResetButton\"\n ariaLabel=\"Reset table\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"x-close\"\n @click=\"emit('resetTemporaryView')\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.kds-table-action-bar {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n min-height: var(--kds-dimension-component-height-2-5x);\n padding-right: var(--kds-spacing-container-0-25x);\n padding-left: var(--kds-spacing-container-0-5x);\n border-bottom: var(--kds-border-base-subtle);\n\n &.temporary-view {\n background-color: var(--kds-color-background-static-info-muted);\n }\n\n & .dimension {\n --dimension-font: var(--kds-font-base-title-small);\n --dimension-color: var(--kds-color-text-and-icon-muted);\n\n font: var(--dimension-font);\n color: var(--dimension-color);\n white-space: pre;\n\n &.with-row-count-dropdown {\n display: inline-flex;\n align-items: center;\n }\n\n /*\n * Match the row-count dropdown trigger's label to the dimension text.\n * :deep() is needed since KdsMenuButton is a multi-root component, so the\n * scope id is not inherited by the button element the class lands on.\n */\n & :deep(.row-count-menu-button) {\n font: var(--dimension-font);\n color: var(--dimension-color);\n }\n }\n\n & .preview {\n display: flex;\n gap: var(--kds-spacing-container-0-12x);\n align-items: center;\n\n & .preview-label {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-neutral);\n }\n }\n\n & .left,\n & .center,\n & .right {\n display: flex;\n flex: 1;\n align-items: center;\n min-width: 0;\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n & .left,\n & .center {\n gap: var(--kds-spacing-container-0-5x);\n }\n\n & .center {\n justify-content: center;\n }\n\n & .right {\n gap: var(--kds-spacing-container-0-25x);\n justify-content: flex-end;\n }\n}\n</style>\n","import type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport { minColumnSize } from \"../constants\";\nimport type { ActionConfig } from \"../types/ActionConfig\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\n\n/**\n * Which action buttons the header of the given column shows. Mirrors the\n * conditions HeaderCell.vue renders them under, for the places that need to\n * know a column's buttons without rendering its header — namely the minimum\n * width the column needs (see {@link minColumnSize}).\n */\nexport const columnHeaderActionButtons = ({\n column,\n actionConfig,\n additionalMenuItems,\n}: {\n column: ColumnConfig;\n actionConfig?: ActionConfig;\n additionalMenuItems?: KdsMenuItem[];\n}) => ({\n menuButton: Boolean(additionalMenuItems?.length),\n sortButton: Boolean(actionConfig?.enableSorting) && !column.isNotSortable,\n deleteButton: Boolean(column.deletable),\n});\n\n/** The minimum width the given column needs for its header action buttons. */\nexport const minSizeOfColumn = (\n params: Parameters<typeof columnHeaderActionButtons>[0],\n) => minColumnSize(columnHeaderActionButtons(params));\n","import { type Ref, nextTick } from \"vue\";\nimport { useRafFn } from \"@vueuse/core\";\n\n// while resizing a column, auto-scroll engages when the pointer is within this many\n// px inward of the scroll container's right edge (or anywhere past it)\nexport const AUTO_SCROLL_EDGE_SIZE = 20;\n\n// the speed (in px/s) at which the column grows and the container scrolls while\n// auto-scrolling during a column resize drag\nexport const AUTO_SCROLL_SPEED = 250;\n\n/**\n * While a column is being resized, this composable grows the dragged column and scrolls\n * the container to the right in lockstep whenever the pointer is near (or past) the\n * container's right edge. This lets the last column be widened beyond the visible area\n * without having to release and re-grab the handle.\n *\n * The accumulated px gained via auto-scrolling is added to the caller-owned\n * `autoScrollOffset` ref (and reset to 0 on pointer-up); the caller must include it in the\n * emitted column width. `onAutoScroll` is invoked on every animation frame so the caller\n * can re-emit the (now wider) column width.\n */\nexport const useAutoScrollOnRightEdge = ({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll,\n}: {\n scrollContainer: Ref<HTMLElement | null>;\n autoScrollOffset: Ref<number>;\n onAutoScroll: () => void;\n}) => {\n let pointerClientX = 0;\n // target scroll position is `scrollLeftBase + autoScrollOffset` (see below).\n let scrollLeftBase = 0;\n\n const isInTriggerZone = () => {\n const container = scrollContainer.value;\n if (!container) {\n return false;\n }\n const { right } = container.getBoundingClientRect();\n return pointerClientX >= right - AUTO_SCROLL_EDGE_SIZE;\n };\n\n // `delta` is the ms since the previous frame, so the speed is time-based and thus\n // identical across e.g. 60Hz / 120Hz displays. The loop steps unconditionally.\n const { pause, resume } = useRafFn(\n ({ delta }) => {\n const deltaPx = (AUTO_SCROLL_SPEED * delta) / 1000;\n autoScrollOffset.value += deltaPx;\n const container = scrollContainer.value;\n onAutoScroll();\n // We wait one tick assuming that the wider width is applied then\n // Otherwise we cannot scroll further right when resizing the last column\n // which leads to a flickering since the scroll is lagging behind one frame\n nextTick(() => {\n if (container) {\n container.scrollLeft = scrollLeftBase + autoScrollOffset.value;\n }\n });\n },\n { immediate: false },\n );\n\n const updateZone = (clientX: number) => {\n pointerClientX = clientX;\n if (isInTriggerZone()) {\n resume();\n } else {\n pause();\n }\n };\n\n const onPointerDown = (clientX: number) => {\n scrollLeftBase = scrollContainer.value?.scrollLeft ?? 0;\n updateZone(clientX);\n };\n\n const onPointerMove = (clientX: number) => {\n updateZone(clientX);\n };\n\n const onPointerUp = () => {\n pause();\n autoScrollOffset.value = 0;\n };\n\n return { onPointerDown, onPointerMove, onPointerUp };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsMenuButton,\n KdsToggleButton,\n vKdsTooltip,\n} from \"@knime/kds-components\";\nimport type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport {\n COLUMN_RESIZE_DRAG_HANDLE_WIDTH,\n HEADER_HEIGHT,\n minColumnSize,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useScrollContainer } from \"../composables/useCommonScrollContainerProps\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport { useAutoScrollOnRightEdge } from \"./useAutoScrollOnRightEdge\";\n\nconst props = defineProps<{\n column: ColumnConfig;\n additionalMenuItems?: KdsMenuItem[];\n tableConfig: TableConfig;\n actionConfig: ActionConfig;\n sortDirection: -1 | 0 | 1;\n index: number;\n focused: boolean;\n selected: boolean;\n otherColumnResizing: boolean;\n /** Returns the height the drag handle should span while resizing. */\n getDragHandleHeight: () => number;\n}>();\n\n/**\n * The cell reads its width from this CSS variable (the single source of truth\n * for column widths), so the header subtree does not re-render when the numeric\n * `colSizes` change.\n */\nconst colSizeCSSVar = computed(() => getColSizeCSSVar(props.index));\n\n/**\n * Live numeric column sizes, needed only imperatively at drag start (see\n * {@link onPointerDown}). Injected rather than passed as a prop so that reading\n * it does not create a render-time dependency on `colSizes`.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst emit = defineEmits<{\n onColumnSort: [direction: -1 | 0 | 1];\n onHeaderCellFocus: [];\n onHeaderCellBlur: [];\n onHeaderClick: [];\n onKeydownTab: [];\n onKeydownLeft: [];\n onKeydownRight: [];\n onKeydownDown: [];\n onHeaderCellKeydown: [event: KeyboardEvent];\n onDeleteColumn: [];\n columnResizeStart: [];\n columnResizeEnd: [];\n columnResize: [newSize: number];\n allColumnsResize: [newSize: number];\n}>();\n\nconst columnHeader = useTemplateRef<HTMLTableCellElement>(\"columnHeader\");\nconst content = useTemplateRef<HTMLDivElement>(\"content\");\nconst mainHeader = useTemplateRef<HTMLDivElement>(\"mainHeader\");\nconst headerText = useTemplateRef<HTMLSpanElement>(\"headerText\");\nconst columnDeleteButton =\n useTemplateRef<InstanceType<typeof KdsButton>>(\"columnDeleteButton\");\nconst sortButton =\n useTemplateRef<InstanceType<typeof KdsToggleButton>>(\"sortButton\");\nconst columnMenuButtonRef = \"columnMenuButton\";\nconst columnMenuButton =\n useTemplateRef<InstanceType<typeof KdsMenuButton>>(columnMenuButtonRef);\n\n/**\n * Every sortable column of a table with sorting enabled offers the sort button;\n * there is no separate opt-in for it.\n */\nconst showSortButton = computed(\n () =>\n Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable,\n);\n\nconst isSorted = computed(() => props.sortDirection !== 0);\n\nconst SORT_NEXT_DIRECTION = { 0: 1, 1: -1, [-1]: 0 } as const;\n\n/** Cycles unsorted -> ascending -> descending -> unsorted on each click. */\nconst sortNextDirection = computed<-1 | 0 | 1>(\n () => SORT_NEXT_DIRECTION[props.sortDirection],\n);\n\nconst onSortToggle = () => emit(\"onColumnSort\", sortNextDirection.value);\n\n/** The width below which this header's action buttons would not fit. */\nconst minSize = computed(() =>\n minColumnSize({\n menuButton: Boolean(props.additionalMenuItems?.length),\n sortButton: showSortButton.value,\n deleteButton: Boolean(props.column.deletable),\n }),\n);\n\nconst resizeHandleHovered = ref(false);\nconst headerHovered = ref(false);\nconst menuOpen = ref(false);\nconst nativeFocusInsideHeader = ref(false);\nconst onThFocusOut = (event: FocusEvent) => {\n if (!columnHeader.value?.contains(event.relatedTarget as Node)) {\n nativeFocusInsideHeader.value = false;\n }\n};\nconst onThFocusIn = (event: FocusEvent) => {\n if ((event.target as HTMLElement).matches(\":focus-visible\")) {\n nativeFocusInsideHeader.value = true;\n }\n};\n\n/* Column-resize-via-drag state, local to this header cell. */\nconst dragging = ref(false);\nlet columnSizeOnDragStart = 0; // the original width of the column when the resize drag started\nlet pageXOnDragStart = 0; // the x coordinate at which the pointer was pressed when starting the resize drag\nlet currentPageX = 0; // latest pointer pageX during the drag\nlet currentDragHandlerHeight = 0; // the height the drag handle spans while resizing\n\nconst scrollContainer = useScrollContainer();\nconst autoScrollOffset = ref(0); // px gained via auto-scrolling during the drag\n\n/**\n * Emits the new width of the dragged column. Called both on pointermove and on every\n * auto-scroll frame, so it derives the width from stored state (latest pointer position\n * plus accumulated auto-scroll offset) rather than from an event.\n */\nconst emitColumnResize = () => {\n if (!dragging.value) {\n return;\n }\n const newColumnSize =\n columnSizeOnDragStart +\n (currentPageX - pageXOnDragStart) +\n autoScrollOffset.value;\n emit(\"columnResize\", Math.max(newColumnSize, minSize.value));\n};\n\nconst {\n onPointerDown: startAutoScroll,\n onPointerMove: updateAutoScroll,\n onPointerUp: stopAutoScroll,\n} = useAutoScrollOnRightEdge({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll: emitColumnResize,\n});\n\nconst currentResizeDragHandleWidth = computed(() =>\n props.tableConfig.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0,\n);\n\nconst dragHandleHeight = (isDragging: boolean) =>\n isDragging ? currentDragHandlerHeight : HEADER_HEIGHT;\n\nconst onPointerDown = (event: PointerEvent & { target: HTMLElement }) => {\n menuOpen.value = false;\n consola.debug(\"Resize via drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n event.target.setPointerCapture(event.pointerId);\n dragging.value = true;\n currentDragHandlerHeight = props.getDragHandleHeight();\n columnSizeOnDragStart = colSizes.value[props.index] ?? minSize.value;\n pageXOnDragStart = event.pageX;\n currentPageX = event.pageX;\n emit(\"columnResizeStart\");\n // Engage auto-scroll right away if the handle already sits in the trigger zone\n // (notably the last column, whose handle is at the container's right edge), so it\n // does not wait for a pointermove that the OS edge-clamp would never deliver.\n startAutoScroll(event.clientX);\n};\n\nconst onPointerUp = (event: PointerEvent) => {\n emit(\"columnResizeEnd\");\n if (event.shiftKey) {\n const newColumnSize =\n columnSizeOnDragStart +\n event.pageX -\n pageXOnDragStart +\n autoScrollOffset.value;\n emit(\"allColumnsResize\", newColumnSize);\n }\n // Read the offset above before this zeroes it.\n stopAutoScroll();\n};\n\nconst unthrottledOnPointerMove = (event: PointerEvent) => {\n if (dragging.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n currentPageX = event.pageX;\n emitColumnResize();\n updateAutoScroll(event.clientX);\n }\n};\n\nconst onPointerMove = throttle((event: PointerEvent) => {\n unthrottledOnPointerMove(event);\n});\n\n/* The lostpointercapture event is triggered if the pointer capture is lost for any reason, including its\n orderly release via a pointerup event. Because the onPointerMove function is throttled we also need to throttle\n the onLostPointerCapture function to guarantee order of event handling. */\nconst onLostPointerCapture = throttle((event: PointerEvent) => {\n consola.debug(\"Resize via drag finished: \", event);\n stopAutoScroll();\n dragging.value = false;\n /* Also have to reset resizeHandleHovered since we might no longer be hovering over the drag handle */\n resizeHandleHovered.value = false;\n});\n\nconst getHeaderCellWidth = () => {\n const widthCompleteHeader = Math.ceil(\n columnHeader.value!.getBoundingClientRect().width,\n );\n const widthMainHeader = Math.ceil(\n mainHeader.value!.getBoundingClientRect().width,\n );\n const widthHeaderText = headerText.value!.getBoundingClientRect().width;\n return (\n widthCompleteHeader -\n widthMainHeader +\n widthHeaderText +\n currentResizeDragHandleWidth.value\n );\n};\n\nconst focus = () => {\n if (props.tableConfig.enableHeaderCellSelection || props.column.editable) {\n content.value?.focus();\n } else if (props.additionalMenuItems?.length) {\n nativeFocusInsideHeader.value = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (columnMenuButton.value as any)?.menuButtonEl?.$el?.focus();\n } else if (props.column.deletable) {\n columnDeleteButton.value?.$el?.focus();\n } else if (showSortButton.value) {\n sortButton.value?.$el?.focus();\n }\n};\n\nconst isFocusable = () =>\n Boolean(\n props.tableConfig.enableHeaderCellSelection ||\n props.column.editable ||\n props.additionalMenuItems?.length ||\n props.column.deletable ||\n showSortButton.value,\n );\n\nconst showMenuButton = computed(() => {\n return (\n props.additionalMenuItems?.length &&\n (headerHovered.value || menuOpen.value || nativeFocusInsideHeader.value) &&\n !dragging.value\n );\n});\n\nconst sortButtonVisible = computed(\n () =>\n showSortButton.value &&\n (headerHovered.value || nativeFocusInsideHeader.value || isSorted.value) &&\n !dragging.value,\n);\n\ndefineExpose({ getHeaderCellWidth, focus, isFocusable });\n</script>\n\n<template>\n <th\n ref=\"columnHeader\"\n scope=\"col\"\n :style=\"{\n width: `var(${colSizeCSSVar})`,\n ...(column.headerColor\n ? { '--data-cell-color': column.headerColor }\n : {}),\n }\"\n :class=\"[\n 'column-header',\n {\n 'colored-header': column.headerColor,\n 'header-focused': focused || selected,\n },\n ]\"\n @pointerenter=\"headerHovered = true\"\n @pointerleave=\"headerHovered = false\"\n @focusin=\"onThFocusIn\"\n @focusout=\"onThFocusOut\"\n >\n <div\n ref=\"content\"\n :class=\"[\n 'column-header-content',\n {\n 'with-button-in-header':\n showMenuButton || column.deletable || sortButtonVisible,\n },\n ]\"\n :tabindex=\"\n tableConfig.enableHeaderCellSelection || column.editable ? 0 : -1\n \"\n @focus=\"emit('onHeaderCellFocus')\"\n @blur=\"emit('onHeaderCellBlur')\"\n @click=\"emit('onHeaderClick')\"\n @keydown.space=\"emit('onHeaderClick')\"\n @keydown.tab=\"emit('onKeydownTab')\"\n @keydown.left.prevent=\"emit('onKeydownLeft')\"\n @keydown.right.prevent=\"emit('onKeydownRight')\"\n @keydown.down.self.prevent=\"emit('onKeydownDown')\"\n @keydown=\"emit('onHeaderCellKeydown', $event)\"\n >\n <div ref=\"mainHeader\" class=\"main-header\">\n <div\n v-kds-tooltip:truncated=\"column.header\"\n class=\"header-text-container\"\n >\n <span ref=\"headerText\">{{ column.header }}</span>\n </div>\n </div>\n <div v-if=\"column.subHeader\" class=\"sub-header-text-container\">\n <slot name=\"subHeader\" :sub-header=\"column.subHeader\">{{\n column.subHeader\n }}</slot>\n </div>\n </div>\n <div\n v-if=\"additionalMenuItems?.length\"\n :class=\"[\n 'header-action-button',\n 'menu-button',\n { 'action-button-hidden': !showMenuButton },\n ]\"\n >\n <KdsMenuButton\n :ref=\"columnMenuButtonRef\"\n v-model=\"menuOpen\"\n ariaLabel=\"Table column options\"\n :items=\"additionalMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"showSortButton\"\n :class=\"[\n 'header-action-button',\n 'sort-button',\n { 'action-button-hidden': !sortButtonVisible },\n ]\"\n >\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"isSorted\"\n variant=\"transparent\"\n size=\"small\"\n :leading-icon=\"\n sortDirection === -1 ? 'sort-descending' : 'sort-ascending'\n \"\n ariaLabel=\"Sort\"\n tooltip=\"Sort\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n @update:model-value=\"onSortToggle\"\n />\n </div>\n <!-- Rightmost, since unlike the other two it is permanently visible. -->\n <div\n v-if=\"column.deletable\"\n class=\"header-action-button delete-column-button\"\n >\n <KdsButton\n ref=\"columnDeleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n ariaLabel=\"Delete column\"\n @click.stop=\"emit('onDeleteColumn')\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"tableConfig.enableColumnResizing\"\n :class=\"[\n 'resize-handle-area',\n { hover: resizeHandleHovered && !otherColumnResizing, drag: dragging },\n ]\"\n :style=\"{\n height: `${dragHandleHeight(dragging)}px`,\n }\"\n @pointerover=\"resizeHandleHovered = true\"\n @pointerleave=\"resizeHandleHovered = false\"\n @pointerdown.passive=\"onPointerDown($event as any)\"\n @pointerup.passive=\"onPointerUp($event)\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n >\n <span class=\"resize-handle\" />\n </div>\n </th>\n</template>\n\n<style scoped>\n.column-header {\n /* Need to set position relative here to position the resize handle absolutely within the header cell */\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n padding-right: var(--kds-spacing-container-0-37x);\n padding-left: var(--kds-spacing-container-0-5x);\n color: var(--kds-color-text-and-icon-neutral);\n text-align: left;\n white-space: nowrap;\n\n &.header-focused {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-header {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .column-header-content {\n display: flex;\n flex-shrink: 1;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n\n /* Allows this flex item to shrink below its content's width, so the\n column name truncates (and, if there is no room left at all,\n disappears) instead of pushing the header-action buttons outside. */\n min-width: 0;\n\n &:focus {\n outline: none;\n }\n\n &.with-button-in-header {\n width: calc(\n 100% - var(--kds-dimension-component-width-1-5x)\n ); /* due to .sub-menu-select-header / .delete-column-button: width */\n }\n\n & .main-header {\n display: flex;\n min-width: 0;\n\n & .header-text-container {\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-title-medium-strong);\n }\n }\n\n & .sub-header-text-container {\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-subtext-small);\n }\n }\n\n & .header-action-button {\n flex-shrink: 0;\n\n & + .header-action-button {\n margin-left: var(--kds-spacing-container-0-12x);\n }\n\n /* Collapsed to zero width by default so it reserves no space in the\n header; it only claims room once hovered/focused (or sorted), at\n which point the column name shrinks/truncates to make room for it. */\n &.action-button-hidden {\n width: 0;\n overflow: hidden;\n pointer-events: none;\n opacity: 0;\n }\n }\n\n & .delete-column-button {\n display: flex;\n align-items: center;\n width: var(--kds-dimension-component-width-2x);\n }\n\n & .resize-handle-area {\n position: absolute;\n\n /* resize handle should range into top border */\n top: calc(-1 * var(--kds-core-border-width-xs));\n\n /* resize handle should be at the very right of the header cell, but not range into the next cell, which is\n why we need to remove half of the .resize-handles' border */\n right: calc(\n -1 *\n (\n var(--kds-spacing-container-0-25x) - var(--kds-core-border-width-l) /\n 2\n )\n );\n\n /* otherwise the handle will be behind rows when virtual scrolling */\n z-index: var(--z-index-column-resize-drag-handle);\n display: flex;\n justify-content: center;\n width: 0;\n height: 100%;\n padding-inline: var(--kds-spacing-container-0-25x);\n cursor: col-resize;\n opacity: 0;\n\n & .resize-handle {\n border-right: var(--kds-border-resize-handle-hover);\n border-radius: var(--kds-border-radius-container-0-25x);\n }\n\n &.hover {\n opacity: 1;\n }\n\n &.drag {\n opacity: 1;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsMenuButton,\n KdsToggleButton,\n vKdsTooltip,\n} from \"@knime/kds-components\";\nimport type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport {\n COLUMN_RESIZE_DRAG_HANDLE_WIDTH,\n HEADER_HEIGHT,\n minColumnSize,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useScrollContainer } from \"../composables/useCommonScrollContainerProps\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport { useAutoScrollOnRightEdge } from \"./useAutoScrollOnRightEdge\";\n\nconst props = defineProps<{\n column: ColumnConfig;\n additionalMenuItems?: KdsMenuItem[];\n tableConfig: TableConfig;\n actionConfig: ActionConfig;\n sortDirection: -1 | 0 | 1;\n index: number;\n focused: boolean;\n selected: boolean;\n otherColumnResizing: boolean;\n /** Returns the height the drag handle should span while resizing. */\n getDragHandleHeight: () => number;\n}>();\n\n/**\n * The cell reads its width from this CSS variable (the single source of truth\n * for column widths), so the header subtree does not re-render when the numeric\n * `colSizes` change.\n */\nconst colSizeCSSVar = computed(() => getColSizeCSSVar(props.index));\n\n/**\n * Live numeric column sizes, needed only imperatively at drag start (see\n * {@link onPointerDown}). Injected rather than passed as a prop so that reading\n * it does not create a render-time dependency on `colSizes`.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst emit = defineEmits<{\n onColumnSort: [direction: -1 | 0 | 1];\n onHeaderCellFocus: [];\n onHeaderCellBlur: [];\n onHeaderClick: [];\n onKeydownTab: [];\n onKeydownLeft: [];\n onKeydownRight: [];\n onKeydownDown: [];\n onHeaderCellKeydown: [event: KeyboardEvent];\n onDeleteColumn: [];\n columnResizeStart: [];\n columnResizeEnd: [];\n columnResize: [newSize: number];\n allColumnsResize: [newSize: number];\n}>();\n\nconst columnHeader = useTemplateRef<HTMLTableCellElement>(\"columnHeader\");\nconst content = useTemplateRef<HTMLDivElement>(\"content\");\nconst mainHeader = useTemplateRef<HTMLDivElement>(\"mainHeader\");\nconst headerText = useTemplateRef<HTMLSpanElement>(\"headerText\");\nconst columnDeleteButton =\n useTemplateRef<InstanceType<typeof KdsButton>>(\"columnDeleteButton\");\nconst sortButton =\n useTemplateRef<InstanceType<typeof KdsToggleButton>>(\"sortButton\");\nconst columnMenuButtonRef = \"columnMenuButton\";\nconst columnMenuButton =\n useTemplateRef<InstanceType<typeof KdsMenuButton>>(columnMenuButtonRef);\n\n/**\n * Every sortable column of a table with sorting enabled offers the sort button;\n * there is no separate opt-in for it.\n */\nconst showSortButton = computed(\n () =>\n Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable,\n);\n\nconst isSorted = computed(() => props.sortDirection !== 0);\n\nconst SORT_NEXT_DIRECTION = { 0: 1, 1: -1, [-1]: 0 } as const;\n\n/** Cycles unsorted -> ascending -> descending -> unsorted on each click. */\nconst sortNextDirection = computed<-1 | 0 | 1>(\n () => SORT_NEXT_DIRECTION[props.sortDirection],\n);\n\nconst onSortToggle = () => emit(\"onColumnSort\", sortNextDirection.value);\n\n/** The width below which this header's action buttons would not fit. */\nconst minSize = computed(() =>\n minColumnSize({\n menuButton: Boolean(props.additionalMenuItems?.length),\n sortButton: showSortButton.value,\n deleteButton: Boolean(props.column.deletable),\n }),\n);\n\nconst resizeHandleHovered = ref(false);\nconst headerHovered = ref(false);\nconst menuOpen = ref(false);\nconst nativeFocusInsideHeader = ref(false);\nconst onThFocusOut = (event: FocusEvent) => {\n if (!columnHeader.value?.contains(event.relatedTarget as Node)) {\n nativeFocusInsideHeader.value = false;\n }\n};\nconst onThFocusIn = (event: FocusEvent) => {\n if ((event.target as HTMLElement).matches(\":focus-visible\")) {\n nativeFocusInsideHeader.value = true;\n }\n};\n\n/* Column-resize-via-drag state, local to this header cell. */\nconst dragging = ref(false);\nlet columnSizeOnDragStart = 0; // the original width of the column when the resize drag started\nlet pageXOnDragStart = 0; // the x coordinate at which the pointer was pressed when starting the resize drag\nlet currentPageX = 0; // latest pointer pageX during the drag\nlet currentDragHandlerHeight = 0; // the height the drag handle spans while resizing\n\nconst scrollContainer = useScrollContainer();\nconst autoScrollOffset = ref(0); // px gained via auto-scrolling during the drag\n\n/**\n * Emits the new width of the dragged column. Called both on pointermove and on every\n * auto-scroll frame, so it derives the width from stored state (latest pointer position\n * plus accumulated auto-scroll offset) rather than from an event.\n */\nconst emitColumnResize = () => {\n if (!dragging.value) {\n return;\n }\n const newColumnSize =\n columnSizeOnDragStart +\n (currentPageX - pageXOnDragStart) +\n autoScrollOffset.value;\n emit(\"columnResize\", Math.max(newColumnSize, minSize.value));\n};\n\nconst {\n onPointerDown: startAutoScroll,\n onPointerMove: updateAutoScroll,\n onPointerUp: stopAutoScroll,\n} = useAutoScrollOnRightEdge({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll: emitColumnResize,\n});\n\nconst currentResizeDragHandleWidth = computed(() =>\n props.tableConfig.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0,\n);\n\nconst dragHandleHeight = (isDragging: boolean) =>\n isDragging ? currentDragHandlerHeight : HEADER_HEIGHT;\n\nconst onPointerDown = (event: PointerEvent & { target: HTMLElement }) => {\n menuOpen.value = false;\n consola.debug(\"Resize via drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n event.target.setPointerCapture(event.pointerId);\n dragging.value = true;\n currentDragHandlerHeight = props.getDragHandleHeight();\n columnSizeOnDragStart = colSizes.value[props.index] ?? minSize.value;\n pageXOnDragStart = event.pageX;\n currentPageX = event.pageX;\n emit(\"columnResizeStart\");\n // Engage auto-scroll right away if the handle already sits in the trigger zone\n // (notably the last column, whose handle is at the container's right edge), so it\n // does not wait for a pointermove that the OS edge-clamp would never deliver.\n startAutoScroll(event.clientX);\n};\n\nconst onPointerUp = (event: PointerEvent) => {\n emit(\"columnResizeEnd\");\n if (event.shiftKey) {\n const newColumnSize =\n columnSizeOnDragStart +\n event.pageX -\n pageXOnDragStart +\n autoScrollOffset.value;\n emit(\"allColumnsResize\", newColumnSize);\n }\n // Read the offset above before this zeroes it.\n stopAutoScroll();\n};\n\nconst unthrottledOnPointerMove = (event: PointerEvent) => {\n if (dragging.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n currentPageX = event.pageX;\n emitColumnResize();\n updateAutoScroll(event.clientX);\n }\n};\n\nconst onPointerMove = throttle((event: PointerEvent) => {\n unthrottledOnPointerMove(event);\n});\n\n/* The lostpointercapture event is triggered if the pointer capture is lost for any reason, including its\n orderly release via a pointerup event. Because the onPointerMove function is throttled we also need to throttle\n the onLostPointerCapture function to guarantee order of event handling. */\nconst onLostPointerCapture = throttle((event: PointerEvent) => {\n consola.debug(\"Resize via drag finished: \", event);\n stopAutoScroll();\n dragging.value = false;\n /* Also have to reset resizeHandleHovered since we might no longer be hovering over the drag handle */\n resizeHandleHovered.value = false;\n});\n\nconst getHeaderCellWidth = () => {\n const widthCompleteHeader = Math.ceil(\n columnHeader.value!.getBoundingClientRect().width,\n );\n const widthMainHeader = Math.ceil(\n mainHeader.value!.getBoundingClientRect().width,\n );\n const widthHeaderText = headerText.value!.getBoundingClientRect().width;\n return (\n widthCompleteHeader -\n widthMainHeader +\n widthHeaderText +\n currentResizeDragHandleWidth.value\n );\n};\n\nconst focus = () => {\n if (props.tableConfig.enableHeaderCellSelection || props.column.editable) {\n content.value?.focus();\n } else if (props.additionalMenuItems?.length) {\n nativeFocusInsideHeader.value = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (columnMenuButton.value as any)?.menuButtonEl?.$el?.focus();\n } else if (props.column.deletable) {\n columnDeleteButton.value?.$el?.focus();\n } else if (showSortButton.value) {\n sortButton.value?.$el?.focus();\n }\n};\n\nconst isFocusable = () =>\n Boolean(\n props.tableConfig.enableHeaderCellSelection ||\n props.column.editable ||\n props.additionalMenuItems?.length ||\n props.column.deletable ||\n showSortButton.value,\n );\n\nconst showMenuButton = computed(() => {\n return (\n props.additionalMenuItems?.length &&\n (headerHovered.value || menuOpen.value || nativeFocusInsideHeader.value) &&\n !dragging.value\n );\n});\n\nconst sortButtonVisible = computed(\n () =>\n showSortButton.value &&\n (headerHovered.value || nativeFocusInsideHeader.value || isSorted.value) &&\n !dragging.value,\n);\n\ndefineExpose({ getHeaderCellWidth, focus, isFocusable });\n</script>\n\n<template>\n <th\n ref=\"columnHeader\"\n scope=\"col\"\n :style=\"{\n width: `var(${colSizeCSSVar})`,\n ...(column.headerColor\n ? { '--data-cell-color': column.headerColor }\n : {}),\n }\"\n :class=\"[\n 'column-header',\n {\n 'colored-header': column.headerColor,\n 'header-focused': focused || selected,\n },\n ]\"\n @pointerenter=\"headerHovered = true\"\n @pointerleave=\"headerHovered = false\"\n @focusin=\"onThFocusIn\"\n @focusout=\"onThFocusOut\"\n >\n <div\n ref=\"content\"\n :class=\"[\n 'column-header-content',\n {\n 'with-button-in-header':\n showMenuButton || column.deletable || sortButtonVisible,\n },\n ]\"\n :tabindex=\"\n tableConfig.enableHeaderCellSelection || column.editable ? 0 : -1\n \"\n @focus=\"emit('onHeaderCellFocus')\"\n @blur=\"emit('onHeaderCellBlur')\"\n @click=\"emit('onHeaderClick')\"\n @keydown.space=\"emit('onHeaderClick')\"\n @keydown.tab=\"emit('onKeydownTab')\"\n @keydown.left.prevent=\"emit('onKeydownLeft')\"\n @keydown.right.prevent=\"emit('onKeydownRight')\"\n @keydown.down.self.prevent=\"emit('onKeydownDown')\"\n @keydown=\"emit('onHeaderCellKeydown', $event)\"\n >\n <div ref=\"mainHeader\" class=\"main-header\">\n <div\n v-kds-tooltip:truncated=\"column.header\"\n class=\"header-text-container\"\n >\n <span ref=\"headerText\">{{ column.header }}</span>\n </div>\n </div>\n <div v-if=\"column.subHeader\" class=\"sub-header-text-container\">\n <slot name=\"subHeader\" :sub-header=\"column.subHeader\">{{\n column.subHeader\n }}</slot>\n </div>\n </div>\n <div\n v-if=\"additionalMenuItems?.length\"\n :class=\"[\n 'header-action-button',\n 'menu-button',\n { 'action-button-hidden': !showMenuButton },\n ]\"\n >\n <KdsMenuButton\n :ref=\"columnMenuButtonRef\"\n v-model=\"menuOpen\"\n ariaLabel=\"Table column options\"\n :items=\"additionalMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"showSortButton\"\n :class=\"[\n 'header-action-button',\n 'sort-button',\n { 'action-button-hidden': !sortButtonVisible },\n ]\"\n >\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"isSorted\"\n variant=\"transparent\"\n size=\"small\"\n :leading-icon=\"\n sortDirection === -1 ? 'sort-descending' : 'sort-ascending'\n \"\n ariaLabel=\"Sort\"\n tooltip=\"Sort\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n @update:model-value=\"onSortToggle\"\n />\n </div>\n <!-- Rightmost, since unlike the other two it is permanently visible. -->\n <div\n v-if=\"column.deletable\"\n class=\"header-action-button delete-column-button\"\n >\n <KdsButton\n ref=\"columnDeleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n ariaLabel=\"Delete column\"\n @click.stop=\"emit('onDeleteColumn')\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"tableConfig.enableColumnResizing\"\n :class=\"[\n 'resize-handle-area',\n { hover: resizeHandleHovered && !otherColumnResizing, drag: dragging },\n ]\"\n :style=\"{\n height: `${dragHandleHeight(dragging)}px`,\n }\"\n @pointerover=\"resizeHandleHovered = true\"\n @pointerleave=\"resizeHandleHovered = false\"\n @pointerdown.passive=\"onPointerDown($event as any)\"\n @pointerup.passive=\"onPointerUp($event)\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n >\n <span class=\"resize-handle\" />\n </div>\n </th>\n</template>\n\n<style scoped>\n.column-header {\n /* Need to set position relative here to position the resize handle absolutely within the header cell */\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n padding-right: var(--kds-spacing-container-0-37x);\n padding-left: var(--kds-spacing-container-0-5x);\n color: var(--kds-color-text-and-icon-neutral);\n text-align: left;\n white-space: nowrap;\n\n &.header-focused {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-header {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .column-header-content {\n display: flex;\n flex-shrink: 1;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n\n /* Allows this flex item to shrink below its content's width, so the\n column name truncates (and, if there is no room left at all,\n disappears) instead of pushing the header-action buttons outside. */\n min-width: 0;\n\n &:focus {\n outline: none;\n }\n\n &.with-button-in-header {\n width: calc(\n 100% - var(--kds-dimension-component-width-1-5x)\n ); /* due to .sub-menu-select-header / .delete-column-button: width */\n }\n\n & .main-header {\n display: flex;\n min-width: 0;\n\n & .header-text-container {\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-title-medium-strong);\n }\n }\n\n & .sub-header-text-container {\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-subtext-small);\n }\n }\n\n & .header-action-button {\n flex-shrink: 0;\n\n & + .header-action-button {\n margin-left: var(--kds-spacing-container-0-12x);\n }\n\n /* Collapsed to zero width by default so it reserves no space in the\n header; it only claims room once hovered/focused (or sorted), at\n which point the column name shrinks/truncates to make room for it. */\n &.action-button-hidden {\n width: 0;\n overflow: hidden;\n pointer-events: none;\n opacity: 0;\n }\n }\n\n & .delete-column-button {\n display: flex;\n align-items: center;\n width: var(--kds-dimension-component-width-2x);\n }\n\n & .resize-handle-area {\n position: absolute;\n\n /* resize handle should range into top border */\n top: calc(-1 * var(--kds-core-border-width-xs));\n\n /* resize handle should be at the very right of the header cell, but not range into the next cell, which is\n why we need to remove half of the .resize-handles' border */\n right: calc(\n -1 *\n (\n var(--kds-spacing-container-0-25x) - var(--kds-core-border-width-l) /\n 2\n )\n );\n\n /* otherwise the handle will be behind rows when virtual scrolling */\n z-index: var(--z-index-column-resize-drag-handle);\n display: flex;\n justify-content: center;\n width: 0;\n height: 100%;\n padding-inline: var(--kds-spacing-container-0-25x);\n cursor: col-resize;\n opacity: 0;\n\n & .resize-handle {\n border-right: var(--kds-border-resize-handle-hover);\n border-radius: var(--kds-border-radius-container-0-25x);\n }\n\n &.hover {\n opacity: 1;\n }\n\n &.drag {\n opacity: 1;\n }\n }\n}\n</style>\n","<!-- eslint-disable max-lines -->\n<script lang=\"ts\">\nimport { type PropType, toRef } from \"vue\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport {\n HEADER_HEIGHT,\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { ColSortValue } from \"../../types/ColumnState\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { minSizeOfColumn } from \"../../utils/columnHeaderActionButtons\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { useStartEditingKeydown } from \"../composables/useStartEditingKeydown\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport HeaderCell from \"./HeaderCell.vue\";\n\n/**\n * A table header element for displaying the column names in a table. This component\n * has a checkbox for selecting all rows in the table.\n *\n * @emits headerSelect event when the checkbox is selected for table-wide toggling of selection.\n * @emits subMenuItemSelection event when the selection of a submenu item is changed\n */\nexport default {\n components: {\n KdsCheckbox,\n KdsButton,\n HeaderCell,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n actionConfig: {\n type: Object as PropType<ActionConfig>,\n default: () => ({}),\n },\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n isSelected: {\n type: Boolean,\n default: false,\n },\n getDragHandleHeight: {\n type: Function as PropType<() => number>,\n default: () => HEADER_HEIGHT,\n },\n showNewColumnButton: {\n type: Boolean,\n default: false,\n },\n selectedHeaderIndex: {\n type: Number as PropType<number | null>,\n default: null,\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n headerSelect: (selected: boolean) => true,\n showColumnBorder: () => true,\n columnResize: (index: number, newSize: number) => true,\n hideColumnBorder: () => true,\n columnResizeEnd: () => true,\n columnResizeStart: () => true,\n allColumnsResize: (newSize: number) => true,\n columnSort: (index: number, direction: -1 | 0 | 1) => true,\n moveDownFromHeaderCell: (index: number) => true,\n headerCellSelect: (index: number) => true,\n \"update:newColumnButtonWidth\": (width: number) => true,\n newColumnButtonClick: (event: MouseEvent) => true,\n newColumnButtonKeydownLeft: (event: KeyboardEvent) => true,\n selectionKeydownDown: () => true,\n headerCellDeselect: () => true,\n headerCellStartEditing: (index: number, initialValue?: string) => true,\n deleteColumn: (index: number) => true,\n },\n setup(props, { emit }) {\n const { indexedData: indexedColumns, style: headerStyles } =\n useIndicesAndStylesFor(toRef(props, \"columns\"));\n\n let currentColumnIndex = 0;\n const onStartEditing = (initialValue?: string) => {\n emit(\"headerCellStartEditing\", currentColumnIndex, initialValue);\n };\n const { onKeydown: startEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: onStartEditing,\n onStartEditing,\n });\n\n const onHeaderCellKeydown = (event: KeyboardEvent, columnIndex: number) => {\n currentColumnIndex = columnIndex;\n startEditingKeydown(event);\n };\n\n const { colSizesFrozenWhenResizing } = injectColumnSizes();\n\n return {\n indexedColumns,\n headerStyles,\n onHeaderCellKeydown,\n colSizesFrozenWhenResizing,\n };\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n data() {\n return {\n minimumColumnWidth: MIN_COLUMN_SIZE, // need to add this here since it is referenced in the template\n resizingColumnIndex: null as null | number, // the index of the column that is currently being resized; null otherwise\n focusedHeaderIndex: null as null | number, // the index of the currently focused header cell\n };\n },\n computed: {\n headerBackgroundColor(): string {\n return `var(--kds-color-${this.renderedOnBackgroundColor}, var(--kds-color-page-default))`;\n },\n /**\n * The smallest size that can be given to all columns at once, i.e. the\n * largest of their individual minimums (see {@link minSizeOfColumn}).\n */\n minSizeForAllColumns(): number {\n return this.columns.reduce(\n (max, column, index) =>\n Math.max(\n max,\n minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n }),\n ),\n MIN_COLUMN_SIZE,\n );\n },\n headerSelectionOverlayStyle(): Record<string, string> | null {\n const columnIndex = this.selectedHeaderIndex;\n if (\n columnIndex === null ||\n !this.tableConfig.enableHeaderCellSelection ||\n // Positioned from the sizes frozen at drag start, so it would lag\n // behind the live column widths while a column is being resized.\n this.resizingColumnIndex !== null\n ) {\n return null;\n }\n let left = 0;\n if (this.tableConfig.showSelection) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n if (this.tableConfig.enableRowDeletion) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n for (let i = 0; i < columnIndex; i++) {\n left += this.columnSize(i);\n }\n const width = this.columnSize(columnIndex);\n return {\n left: `${left}px`,\n width: `${width}px`,\n };\n },\n },\n methods: {\n columnSize(columnIndex: number): number {\n return (\n this.colSizesFrozenWhenResizing[columnIndex] ?? this.minimumColumnWidth\n );\n },\n sortDirection(columnIndex: number): -1 | 0 | 1 {\n const columnId = this.columns[columnIndex].id;\n return (\n this.colSortValues.find(({ id }) => id === columnId)?.direction ?? 0\n );\n },\n onHeaderCellFocus(columnIndex: number) {\n if (\n !this.tableConfig.enableHeaderCellSelection &&\n !this.columns[columnIndex].editable\n ) {\n return;\n }\n this.focusedHeaderIndex = columnIndex;\n this.$emit(\"headerCellSelect\", columnIndex);\n },\n onHeaderCellBlur(columnIndex: number) {\n this.focusedHeaderIndex = null;\n if (!this.columns[columnIndex].editable) {\n this.$emit(\"headerCellDeselect\");\n }\n },\n emitNewColumnButtonWidth() {\n const newColumnButtonHead = this.$refs[\n \"new-column-button-head\"\n ] as HTMLElement;\n this.$emit(\n \"update:newColumnButtonWidth\",\n newColumnButtonHead.getBoundingClientRect().width ?? 0,\n );\n },\n onSelect() {\n this.$emit(\"headerSelect\", !this.isSelected);\n },\n onHeaderClick(ind: number) {\n if (\n this.tableConfig.enableHeaderCellSelection &&\n this.selectedHeaderIndex !== ind\n ) {\n this.$emit(\"headerCellSelect\", ind);\n }\n if (this.columns[ind].editable) {\n this.$emit(\"headerCellStartEditing\", ind);\n }\n },\n onColumnResizeStart(columnIndex: number) {\n this.resizingColumnIndex = columnIndex;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.resizingColumnIndex = null;\n this.$emit(\"columnResizeEnd\");\n },\n onColumnResize(columnIndex: number, newSize: number) {\n this.$emit(\"columnResize\", columnIndex, newSize);\n },\n onAllColumnsResize(newSize: number) {\n // One size for every column, so it has to clear the largest of their\n // minimums; the dragged cell cannot clamp this on its own.\n this.$emit(\n \"allColumnsResize\",\n Math.max(newSize, this.minSizeForAllColumns),\n );\n },\n onColumnSort(columnIndex: number, direction: -1 | 0 | 1) {\n this.$emit(\"columnSort\", columnIndex, direction);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n this.$emit(\"newColumnButtonClick\", event);\n },\n onNewColumnButtonKeydownLeft(event: KeyboardEvent) {\n this.$emit(\"newColumnButtonKeydownLeft\", event);\n },\n onDeleteColumn(ind: number) {\n this.$emit(\"deleteColumn\", ind);\n },\n getHeaderCellWidths() {\n return this.columns.map((_column, columnIndex) =>\n (\n this.$refs[`headerCell-${columnIndex}`] as InstanceType<\n typeof HeaderCell\n >[]\n )[0].getHeaderCellWidth(),\n );\n },\n /**\n * We deliberately only react on Tab and not on blur since we do\n * want to keep the header in a selected yet unfocused state when\n * the user clicks outside the table.\n */\n onKeydownTab() {\n this.$emit(\"headerCellDeselect\");\n },\n onKeydownLeft(columnIndex: number) {\n if (columnIndex > 0) {\n this.focusHeaderCell(columnIndex - 1);\n }\n },\n onKeydownRight(columnIndex: number) {\n if (columnIndex < this.columns.length - 1) {\n this.focusHeaderCell(columnIndex + 1);\n } else if (this.showNewColumnButton) {\n if (this.tableConfig.enableHeaderCellSelection) {\n this.$emit(\"headerCellDeselect\");\n }\n this.focusNewColumnButton();\n }\n },\n onKeydownDown(columnIndex: number) {\n if (this.tableConfig.enableCellSelection) {\n this.$emit(\"moveDownFromHeaderCell\", columnIndex);\n }\n },\n focusHeaderCell(cellInd: number) {\n (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].focus();\n },\n isColumnHeaderFocusable(cellInd: number): boolean {\n return (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].isFocusable();\n },\n focusNewColumnButton() {\n (\n this.$refs[\"new-column-button\"] as InstanceType<typeof KdsButton>\n )?.$el.focus();\n },\n focusSelectionCheckbox() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.$refs[\"selection-checkbox\"] as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n },\n },\n};\n</script>\n\n<template>\n <thead>\n <tr :style=\"{ ...headerStyles }\">\n <th\n v-if=\"tableConfig.enableRowDeletion\"\n scope=\"col\"\n class=\"deletion-cell-spacer\"\n aria-label=\"Delete row\"\n />\n <th\n v-if=\"tableConfig.showSelection\"\n scope=\"col\"\n class=\"select-cell\"\n @keydown.down.prevent.stop=\"$emit('selectionKeydownDown')\"\n >\n <KdsCheckbox\n ref=\"selection-checkbox\"\n class=\"select-checkbox\"\n tooltip=\"Select all rows\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n />\n </th>\n <HeaderCell\n v-for=\"[column, ind] in indexedColumns\"\n :key=\"ind\"\n :ref=\"`headerCell-${ind}`\"\n :column\n :additional-menu-items=\"additionalHeaderMenuItems[ind] ?? []\"\n :table-config\n :action-config\n :sort-direction=\"sortDirection(ind)\"\n :index=\"ind\"\n :focused=\"focusedHeaderIndex === ind\"\n :selected=\"selectedHeaderIndex === ind\"\n :other-column-resizing=\"\n resizingColumnIndex !== null && resizingColumnIndex !== ind\n \"\n :get-drag-handle-height=\"getDragHandleHeight\"\n @on-header-cell-focus=\"onHeaderCellFocus(ind)\"\n @on-header-cell-blur=\"onHeaderCellBlur(ind)\"\n @on-header-click=\"onHeaderClick(ind)\"\n @on-keydown-tab=\"onKeydownTab\"\n @on-keydown-left=\"onKeydownLeft(ind)\"\n @on-keydown-right=\"onKeydownRight(ind)\"\n @on-keydown-down=\"onKeydownDown(ind)\"\n @on-header-cell-keydown=\"onHeaderCellKeydown($event, ind)\"\n @on-delete-column=\"onDeleteColumn(ind)\"\n @on-column-sort=\"onColumnSort(ind, $event)\"\n @column-resize-start=\"onColumnResizeStart(ind)\"\n @column-resize-end=\"onColumnResizeEnd\"\n @column-resize=\"onColumnResize(ind, $event)\"\n @all-columns-resize=\"onAllColumnsResize\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" :column-index=\"ind\" />\n </template>\n </HeaderCell>\n <th\n v-if=\"showNewColumnButton\"\n ref=\"new-column-button-head\"\n scope=\"col\"\n class=\"new-column-head\"\n aria-label=\"Add column\"\n @vue:mounted=\"emitNewColumnButtonWidth\"\n >\n <KdsButton\n ref=\"new-column-button\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n @click=\"onNewColumnButtonClick\"\n @keydown.left.prevent.stop=\"onNewColumnButtonKeydownLeft\"\n />\n </th>\n </tr>\n <div\n v-if=\"headerSelectionOverlayStyle\"\n :class=\"[\n 'header-selection-overlay',\n { 'header-focused': focusedHeaderIndex !== null },\n ]\"\n :style=\"headerSelectionOverlayStyle\"\n />\n </thead>\n</template>\n\n<style scoped>\nthead {\n background-color: v-bind(headerBackgroundColor);\n border-bottom: var(--kds-border-base-subtle);\n\n & tr {\n display: flex;\n height: 100%;\n transition:\n height 0.3s,\n box-shadow 0.15s;\n\n & th {\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n text-align: left;\n white-space: nowrap;\n\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n padding: var(--kds-spacing-container-0-75x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.new-column-head {\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: var(--kds-spacing-container-0-5x);\n }\n }\n\n &:hover {\n outline: none;\n }\n }\n\n &.sub-menu-active tr {\n padding-right: var(--kds-dimension-component-width-2x);\n }\n}\n\n.header-selection-overlay {\n position: absolute;\n top: 0;\n height: 100%;\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.header-focused {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<!-- eslint-disable max-lines -->\n<script lang=\"ts\">\nimport { type PropType, toRef } from \"vue\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport {\n HEADER_HEIGHT,\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { ColSortValue } from \"../../types/ColumnState\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { minSizeOfColumn } from \"../../utils/columnHeaderActionButtons\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { useStartEditingKeydown } from \"../composables/useStartEditingKeydown\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport HeaderCell from \"./HeaderCell.vue\";\n\n/**\n * A table header element for displaying the column names in a table. This component\n * has a checkbox for selecting all rows in the table.\n *\n * @emits headerSelect event when the checkbox is selected for table-wide toggling of selection.\n * @emits subMenuItemSelection event when the selection of a submenu item is changed\n */\nexport default {\n components: {\n KdsCheckbox,\n KdsButton,\n HeaderCell,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n actionConfig: {\n type: Object as PropType<ActionConfig>,\n default: () => ({}),\n },\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n isSelected: {\n type: Boolean,\n default: false,\n },\n getDragHandleHeight: {\n type: Function as PropType<() => number>,\n default: () => HEADER_HEIGHT,\n },\n showNewColumnButton: {\n type: Boolean,\n default: false,\n },\n selectedHeaderIndex: {\n type: Number as PropType<number | null>,\n default: null,\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n headerSelect: (selected: boolean) => true,\n showColumnBorder: () => true,\n columnResize: (index: number, newSize: number) => true,\n hideColumnBorder: () => true,\n columnResizeEnd: () => true,\n columnResizeStart: () => true,\n allColumnsResize: (newSize: number) => true,\n columnSort: (index: number, direction: -1 | 0 | 1) => true,\n moveDownFromHeaderCell: (index: number) => true,\n headerCellSelect: (index: number) => true,\n \"update:newColumnButtonWidth\": (width: number) => true,\n newColumnButtonClick: (event: MouseEvent) => true,\n newColumnButtonKeydownLeft: (event: KeyboardEvent) => true,\n selectionKeydownDown: () => true,\n headerCellDeselect: () => true,\n headerCellStartEditing: (index: number, initialValue?: string) => true,\n deleteColumn: (index: number) => true,\n },\n setup(props, { emit }) {\n const { indexedData: indexedColumns, style: headerStyles } =\n useIndicesAndStylesFor(toRef(props, \"columns\"));\n\n let currentColumnIndex = 0;\n const onStartEditing = (initialValue?: string) => {\n emit(\"headerCellStartEditing\", currentColumnIndex, initialValue);\n };\n const { onKeydown: startEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: onStartEditing,\n onStartEditing,\n });\n\n const onHeaderCellKeydown = (event: KeyboardEvent, columnIndex: number) => {\n currentColumnIndex = columnIndex;\n startEditingKeydown(event);\n };\n\n const { colSizesFrozenWhenResizing } = injectColumnSizes();\n\n return {\n indexedColumns,\n headerStyles,\n onHeaderCellKeydown,\n colSizesFrozenWhenResizing,\n };\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n data() {\n return {\n minimumColumnWidth: MIN_COLUMN_SIZE, // need to add this here since it is referenced in the template\n resizingColumnIndex: null as null | number, // the index of the column that is currently being resized; null otherwise\n focusedHeaderIndex: null as null | number, // the index of the currently focused header cell\n };\n },\n computed: {\n headerBackgroundColor(): string {\n return `var(--kds-color-${this.renderedOnBackgroundColor}, var(--kds-color-page-default))`;\n },\n /**\n * The smallest size that can be given to all columns at once, i.e. the\n * largest of their individual minimums (see {@link minSizeOfColumn}).\n */\n minSizeForAllColumns(): number {\n return this.columns.reduce(\n (max, column, index) =>\n Math.max(\n max,\n minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n }),\n ),\n MIN_COLUMN_SIZE,\n );\n },\n headerSelectionOverlayStyle(): Record<string, string> | null {\n const columnIndex = this.selectedHeaderIndex;\n if (\n columnIndex === null ||\n !this.tableConfig.enableHeaderCellSelection ||\n // Positioned from the sizes frozen at drag start, so it would lag\n // behind the live column widths while a column is being resized.\n this.resizingColumnIndex !== null\n ) {\n return null;\n }\n let left = 0;\n if (this.tableConfig.showSelection) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n if (this.tableConfig.enableRowDeletion) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n for (let i = 0; i < columnIndex; i++) {\n left += this.columnSize(i);\n }\n const width = this.columnSize(columnIndex);\n return {\n left: `${left}px`,\n width: `${width}px`,\n };\n },\n },\n methods: {\n columnSize(columnIndex: number): number {\n return (\n this.colSizesFrozenWhenResizing[columnIndex] ?? this.minimumColumnWidth\n );\n },\n sortDirection(columnIndex: number): -1 | 0 | 1 {\n const columnId = this.columns[columnIndex].id;\n return (\n this.colSortValues.find(({ id }) => id === columnId)?.direction ?? 0\n );\n },\n onHeaderCellFocus(columnIndex: number) {\n if (\n !this.tableConfig.enableHeaderCellSelection &&\n !this.columns[columnIndex].editable\n ) {\n return;\n }\n this.focusedHeaderIndex = columnIndex;\n this.$emit(\"headerCellSelect\", columnIndex);\n },\n onHeaderCellBlur(columnIndex: number) {\n this.focusedHeaderIndex = null;\n if (!this.columns[columnIndex].editable) {\n this.$emit(\"headerCellDeselect\");\n }\n },\n emitNewColumnButtonWidth() {\n const newColumnButtonHead = this.$refs[\n \"new-column-button-head\"\n ] as HTMLElement;\n this.$emit(\n \"update:newColumnButtonWidth\",\n newColumnButtonHead.getBoundingClientRect().width ?? 0,\n );\n },\n onSelect() {\n this.$emit(\"headerSelect\", !this.isSelected);\n },\n onHeaderClick(ind: number) {\n if (\n this.tableConfig.enableHeaderCellSelection &&\n this.selectedHeaderIndex !== ind\n ) {\n this.$emit(\"headerCellSelect\", ind);\n }\n if (this.columns[ind].editable) {\n this.$emit(\"headerCellStartEditing\", ind);\n }\n },\n onColumnResizeStart(columnIndex: number) {\n this.resizingColumnIndex = columnIndex;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.resizingColumnIndex = null;\n this.$emit(\"columnResizeEnd\");\n },\n onColumnResize(columnIndex: number, newSize: number) {\n this.$emit(\"columnResize\", columnIndex, newSize);\n },\n onAllColumnsResize(newSize: number) {\n // One size for every column, so it has to clear the largest of their\n // minimums; the dragged cell cannot clamp this on its own.\n this.$emit(\n \"allColumnsResize\",\n Math.max(newSize, this.minSizeForAllColumns),\n );\n },\n onColumnSort(columnIndex: number, direction: -1 | 0 | 1) {\n this.$emit(\"columnSort\", columnIndex, direction);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n this.$emit(\"newColumnButtonClick\", event);\n },\n onNewColumnButtonKeydownLeft(event: KeyboardEvent) {\n this.$emit(\"newColumnButtonKeydownLeft\", event);\n },\n onDeleteColumn(ind: number) {\n this.$emit(\"deleteColumn\", ind);\n },\n getHeaderCellWidths() {\n return this.columns.map((_column, columnIndex) =>\n (\n this.$refs[`headerCell-${columnIndex}`] as InstanceType<\n typeof HeaderCell\n >[]\n )[0].getHeaderCellWidth(),\n );\n },\n /**\n * We deliberately only react on Tab and not on blur since we do\n * want to keep the header in a selected yet unfocused state when\n * the user clicks outside the table.\n */\n onKeydownTab() {\n this.$emit(\"headerCellDeselect\");\n },\n onKeydownLeft(columnIndex: number) {\n if (columnIndex > 0) {\n this.focusHeaderCell(columnIndex - 1);\n }\n },\n onKeydownRight(columnIndex: number) {\n if (columnIndex < this.columns.length - 1) {\n this.focusHeaderCell(columnIndex + 1);\n } else if (this.showNewColumnButton) {\n if (this.tableConfig.enableHeaderCellSelection) {\n this.$emit(\"headerCellDeselect\");\n }\n this.focusNewColumnButton();\n }\n },\n onKeydownDown(columnIndex: number) {\n if (this.tableConfig.enableCellSelection) {\n this.$emit(\"moveDownFromHeaderCell\", columnIndex);\n }\n },\n focusHeaderCell(cellInd: number) {\n (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].focus();\n },\n isColumnHeaderFocusable(cellInd: number): boolean {\n return (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].isFocusable();\n },\n focusNewColumnButton() {\n (\n this.$refs[\"new-column-button\"] as InstanceType<typeof KdsButton>\n )?.$el.focus();\n },\n focusSelectionCheckbox() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.$refs[\"selection-checkbox\"] as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n },\n },\n};\n</script>\n\n<template>\n <thead>\n <tr :style=\"{ ...headerStyles }\">\n <th\n v-if=\"tableConfig.enableRowDeletion\"\n scope=\"col\"\n class=\"deletion-cell-spacer\"\n aria-label=\"Delete row\"\n />\n <th\n v-if=\"tableConfig.showSelection\"\n scope=\"col\"\n class=\"select-cell\"\n @keydown.down.prevent.stop=\"$emit('selectionKeydownDown')\"\n >\n <KdsCheckbox\n ref=\"selection-checkbox\"\n class=\"select-checkbox\"\n tooltip=\"Select all rows\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n />\n </th>\n <HeaderCell\n v-for=\"[column, ind] in indexedColumns\"\n :key=\"ind\"\n :ref=\"`headerCell-${ind}`\"\n :column\n :additional-menu-items=\"additionalHeaderMenuItems[ind] ?? []\"\n :table-config\n :action-config\n :sort-direction=\"sortDirection(ind)\"\n :index=\"ind\"\n :focused=\"focusedHeaderIndex === ind\"\n :selected=\"selectedHeaderIndex === ind\"\n :other-column-resizing=\"\n resizingColumnIndex !== null && resizingColumnIndex !== ind\n \"\n :get-drag-handle-height=\"getDragHandleHeight\"\n @on-header-cell-focus=\"onHeaderCellFocus(ind)\"\n @on-header-cell-blur=\"onHeaderCellBlur(ind)\"\n @on-header-click=\"onHeaderClick(ind)\"\n @on-keydown-tab=\"onKeydownTab\"\n @on-keydown-left=\"onKeydownLeft(ind)\"\n @on-keydown-right=\"onKeydownRight(ind)\"\n @on-keydown-down=\"onKeydownDown(ind)\"\n @on-header-cell-keydown=\"onHeaderCellKeydown($event, ind)\"\n @on-delete-column=\"onDeleteColumn(ind)\"\n @on-column-sort=\"onColumnSort(ind, $event)\"\n @column-resize-start=\"onColumnResizeStart(ind)\"\n @column-resize-end=\"onColumnResizeEnd\"\n @column-resize=\"onColumnResize(ind, $event)\"\n @all-columns-resize=\"onAllColumnsResize\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" :column-index=\"ind\" />\n </template>\n </HeaderCell>\n <th\n v-if=\"showNewColumnButton\"\n ref=\"new-column-button-head\"\n scope=\"col\"\n class=\"new-column-head\"\n aria-label=\"Add column\"\n @vue:mounted=\"emitNewColumnButtonWidth\"\n >\n <KdsButton\n ref=\"new-column-button\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n @click=\"onNewColumnButtonClick\"\n @keydown.left.prevent.stop=\"onNewColumnButtonKeydownLeft\"\n />\n </th>\n </tr>\n <div\n v-if=\"headerSelectionOverlayStyle\"\n :class=\"[\n 'header-selection-overlay',\n { 'header-focused': focusedHeaderIndex !== null },\n ]\"\n :style=\"headerSelectionOverlayStyle\"\n />\n </thead>\n</template>\n\n<style scoped>\nthead {\n background-color: v-bind(headerBackgroundColor);\n border-bottom: var(--kds-border-base-subtle);\n\n & tr {\n display: flex;\n height: 100%;\n transition:\n height 0.3s,\n box-shadow 0.15s;\n\n & th {\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n text-align: left;\n white-space: nowrap;\n\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n padding: var(--kds-spacing-container-0-75x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.new-column-head {\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: var(--kds-spacing-container-0-5x);\n }\n }\n\n &:hover {\n outline: none;\n }\n }\n\n &.sub-menu-active tr {\n padding-right: var(--kds-dimension-component-width-2x);\n }\n}\n\n.header-selection-overlay {\n position: absolute;\n top: 0;\n height: 100%;\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.header-focused {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { useTemplateRef } from \"vue\";\n\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst emit = defineEmits<{\n click: [event: MouseEvent];\n \"keydown-up\": [event: KeyboardEvent];\n}>();\n\nconst buttonRef = \"button\";\nconst button = useTemplateRef<InstanceType<typeof KdsButton>>(buttonRef);\ndefineExpose({\n focus: () => {\n button.value?.$el.focus();\n },\n});\n</script>\n\n<template>\n <div class=\"sticky-container\">\n <KdsButton\n :ref=\"buttonRef\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n class=\"add-button\"\n @click=\"emit('click', $event)\"\n @keydown.up.prevent.stop=\"emit('keydown-up', $event)\"\n />\n </div>\n</template>\n\n<style scoped>\n.sticky-container {\n position: sticky;\n left: 0;\n width: fit-content;\n\n & .add-button {\n margin: var(--kds-spacing-container-0-25x);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { useTemplateRef } from \"vue\";\n\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst emit = defineEmits<{\n click: [event: MouseEvent];\n \"keydown-up\": [event: KeyboardEvent];\n}>();\n\nconst buttonRef = \"button\";\nconst button = useTemplateRef<InstanceType<typeof KdsButton>>(buttonRef);\ndefineExpose({\n focus: () => {\n button.value?.$el.focus();\n },\n});\n</script>\n\n<template>\n <div class=\"sticky-container\">\n <KdsButton\n :ref=\"buttonRef\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n class=\"add-button\"\n @click=\"emit('click', $event)\"\n @keydown.up.prevent.stop=\"emit('keydown-up', $event)\"\n />\n </div>\n</template>\n\n<style scoped>\n.sticky-container {\n position: sticky;\n left: 0;\n width: fit-content;\n\n & .add-button {\n margin: var(--kds-spacing-container-0-25x);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { KdsIcon } from \"@knime/kds-components\";\n\ndefineProps<{\n toggled?: boolean;\n}>();\n\ndefineEmits<{\n click: [event: MouseEvent];\n}>();\n</script>\n\n<template>\n <div\n role=\"button\"\n tabindex=\"-1\"\n :class=\"['expand-button', { toggled }]\"\n aria-label=\"Open data value view\"\n @click=\"$emit('click', $event)\"\n >\n <KdsIcon name=\"data-value-view\" size=\"small\" />\n </div>\n</template>\n\n<style scoped>\n.expand-button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-1x);\n height: var(--kds-dimension-component-height-1x);\n padding: 0;\n color: var(--kds-color-text-and-icon-info);\n cursor: pointer;\n background-color: var(--kds-color-background-neutral-initial);\n border: none;\n border-radius: var(--kds-border-radius-container-0-12x);\n\n &:hover {\n background-color: var(--kds-color-background-neutral-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-neutral-active);\n }\n\n &.toggled {\n color: var(--kds-color-text-and-icon-neutral-inverted);\n background-color: var(--kds-color-background-info-bold-initial);\n border: var(--kds-border-action-transparent);\n\n &:hover {\n background-color: var(--kds-color-background-info-bold-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-info-bold-active);\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { KdsIcon } from \"@knime/kds-components\";\n\ndefineProps<{\n toggled?: boolean;\n}>();\n\ndefineEmits<{\n click: [event: MouseEvent];\n}>();\n</script>\n\n<template>\n <div\n role=\"button\"\n tabindex=\"-1\"\n :class=\"['expand-button', { toggled }]\"\n aria-label=\"Open data value view\"\n @click=\"$emit('click', $event)\"\n >\n <KdsIcon name=\"data-value-view\" size=\"small\" />\n </div>\n</template>\n\n<style scoped>\n.expand-button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-1x);\n height: var(--kds-dimension-component-height-1x);\n padding: 0;\n color: var(--kds-color-text-and-icon-info);\n cursor: pointer;\n background-color: var(--kds-color-background-neutral-initial);\n border: none;\n border-radius: var(--kds-border-radius-container-0-12x);\n\n &:hover {\n background-color: var(--kds-color-background-neutral-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-neutral-active);\n }\n\n &.toggled {\n color: var(--kds-color-text-and-icon-neutral-inverted);\n background-color: var(--kds-color-background-info-bold-initial);\n border: var(--kds-border-action-transparent);\n\n &:hover {\n background-color: var(--kds-color-background-info-bold-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-info-bold-active);\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, useTemplateRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport { KdsMissingValueIcon, vKdsTooltip } from \"@knime/kds-components\";\n\nimport { EXPAND_BUTTON_WIDTH } from \"../../constants\";\nimport { useDataValueViews } from \"../composables/useDataValueViews\";\nimport CellExpandButton from \"../ui/CellExpandButton.vue\";\n\nimport type { CellRendererProps } from \"./CellRendererProps\";\n\nconst emit = defineEmits([\"click\", \"expand\", \"input\", \"select\"]);\nconst props = defineProps<CellRendererProps>();\n\nconst dataCellColorStyle = computed(() => {\n const { color } = props;\n return color === null\n ? {}\n : {\n \"--data-cell-color\": color,\n };\n});\n\nconst hasPaddingTopBottom = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingTopBottom));\n});\n\nconst hasPaddingLeftRight = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingLeftRight));\n});\n\nconst paddingTopBottom = computed(() => {\n if (!hasPaddingTopBottom.value) {\n return {};\n }\n\n let paddingTopBottom = props.defaultTopBottomPadding;\n if (props.isMissing) {\n // height of text is 16px, height of missing value icon is 14px => padding needs to be increased by 1px\n paddingTopBottom += 1;\n }\n\n return {\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n };\n});\n\nconst cellContent: Ref<HTMLElement | null> = useTemplateRef(\"cell-content\");\nconst getCellContentDimensions = () => {\n const firstElementChild = cellContent.value?.firstElementChild;\n let widthDataCellFirstChild = 0;\n let heightDataCellFirstChild = 0;\n if (firstElementChild) {\n widthDataCellFirstChild = Math.ceil(firstElementChild.scrollWidth);\n heightDataCellFirstChild = Math.ceil(firstElementChild.scrollHeight);\n }\n return {\n width: props.defaultLeftRightPadding * 2 + widthDataCellFirstChild,\n height:\n heightDataCellFirstChild +\n (hasPaddingTopBottom.value ? props.defaultTopBottomPadding * 2 : 0),\n };\n};\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst onPointerMove = throttle(() => {\n if (props.selectOnMove) {\n emit(\"select\", { expandSelection: true });\n }\n});\n\nconst onPointerDown = (event: MouseEvent) => {\n if (event.button === 0) {\n emit(\"select\", { expandSelection: event.shiftKey });\n }\n};\n\nconst { close: closeExpandedSelectedCell, isShown: isExpandedIfSelected } =\n useDataValueViews();\n\nconst expand = () => emit(\"expand\");\nconst expandAndSelect = (event: MouseEvent) => {\n expand();\n\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n};\n\nconst isExpanded = computed(\n () => props.isSelected && isExpandedIfSelected.value,\n);\nconst isHovered = ref(false);\nconst showCellExpandButton = computed(\n () => props.enableExpand && (isHovered.value || isExpanded.value),\n);\n\n// Snapshot taken on pointerdown — by the time `click` fires, selecting this\n// cell may have already auto-expanded it (when another cell's view was open),\n// flipping `props.isExpanded` to true and making us wrongly close.\nconst wasExpandedAtPointerDown = ref(false);\nconst onExpandButtonPointerDown = () => {\n wasExpandedAtPointerDown.value = isExpanded.value;\n};\nconst onExpandButtonClick = (event: MouseEvent) => {\n if (wasExpandedAtPointerDown.value) {\n closeExpandedSelectedCell();\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n } else {\n expandAndSelect(event);\n }\n};\n\nconst changeExpandedCellViewIfNecessary = () => {\n if (props.isToBeExpanded) {\n if (props.enableExpand) {\n expand();\n } else {\n closeExpandedSelectedCell();\n }\n }\n};\n\nwatch(() => props.isToBeExpanded, changeExpandedCellViewIfNecessary);\nonMounted(changeExpandedCellViewIfNecessary);\n</script>\n\n<template>\n <td\n v-kds-tooltip=\"isMissing ? props.tooltip : undefined\"\n :class=\"[\n 'data-cell',\n {\n 'colored-cell': color,\n 'in-cell-selection': isInCellSelection,\n },\n ]\"\n :style=\"{\n width: `var(${colSizeCssVar})`,\n ...(hasPaddingLeftRight\n ? {\n paddingLeft: `${props.defaultLeftRightPadding}px`,\n paddingRight: `${props.defaultLeftRightPadding}px`,\n }\n : {}),\n ...paddingTopBottom,\n ...dataCellColorStyle,\n }\"\n @dblclick=\"(event: MouseEvent) => enableExpand && expandAndSelect(event)\"\n @pointerenter=\"isHovered = true\"\n @pointerleave=\"isHovered = false\"\n @pointermove=\"onPointerMove\"\n @pointerdown=\"onPointerDown\"\n @input=\"(val: any) => emit('input', { value: val, cell: $el })\"\n >\n <div ref=\"cell-content\" class=\"cell-content\">\n <slot v-if=\"isEditing\" name=\"editable-cell\" :cell-element=\"$el\" />\n <KdsMissingValueIcon v-else-if=\"isMissing\" size=\"small\" />\n <slot\n v-else-if=\"isSlotted\"\n :width=\"\n size -\n props.defaultLeftRightPadding * 2 -\n (showCellExpandButton && !overlayExpandButton\n ? EXPAND_BUTTON_WIDTH\n : 0)\n \"\n />\n <span v-else v-kds-tooltip:truncated=\"props.tooltip\" class=\"cell-text\">\n {{ text }}\n </span>\n <CellExpandButton\n v-if=\"showCellExpandButton\"\n :class=\"{ overlaid: overlayExpandButton }\"\n :toggled=\"isExpanded\"\n @pointerdown=\"onExpandButtonPointerDown\"\n @click=\"onExpandButtonClick\"\n />\n </div>\n </td>\n</template>\n\n<style scoped>\n.data-cell {\n display: flex;\n font: var(--kds-font-base-interactive-small);\n color: var(--kds-color-text-and-icon-neutral);\n white-space: nowrap;\n user-select: none;\n background-clip: border-box;\n\n &.in-cell-selection {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-cell {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .cell-content {\n position: relative;\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-self: flex-start;\n justify-content: space-between;\n width: 100%;\n\n /* Anchored at the same height as the buttons of padded (non-slotted)\n cells, so it lines up with the other columns' buttons in the row. */\n & > .overlaid {\n position: absolute;\n top: v-bind(\"`${defaultTopBottomPadding}px`\");\n right: 0;\n }\n }\n\n & .cell-content .cell-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, useTemplateRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport { KdsMissingValueIcon, vKdsTooltip } from \"@knime/kds-components\";\n\nimport { EXPAND_BUTTON_WIDTH } from \"../../constants\";\nimport { useDataValueViews } from \"../composables/useDataValueViews\";\nimport CellExpandButton from \"../ui/CellExpandButton.vue\";\n\nimport type { CellRendererProps } from \"./CellRendererProps\";\n\nconst emit = defineEmits([\"click\", \"expand\", \"input\", \"select\"]);\nconst props = defineProps<CellRendererProps>();\n\nconst dataCellColorStyle = computed(() => {\n const { color } = props;\n return color === null\n ? {}\n : {\n \"--data-cell-color\": color,\n };\n});\n\nconst hasPaddingTopBottom = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingTopBottom));\n});\n\nconst hasPaddingLeftRight = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingLeftRight));\n});\n\nconst paddingTopBottom = computed(() => {\n if (!hasPaddingTopBottom.value) {\n return {};\n }\n\n let paddingTopBottom = props.defaultTopBottomPadding;\n if (props.isMissing) {\n // height of text is 16px, height of missing value icon is 14px => padding needs to be increased by 1px\n paddingTopBottom += 1;\n }\n\n return {\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n };\n});\n\nconst cellContent: Ref<HTMLElement | null> = useTemplateRef(\"cell-content\");\nconst getCellContentDimensions = () => {\n const firstElementChild = cellContent.value?.firstElementChild;\n let widthDataCellFirstChild = 0;\n let heightDataCellFirstChild = 0;\n if (firstElementChild) {\n widthDataCellFirstChild = Math.ceil(firstElementChild.scrollWidth);\n heightDataCellFirstChild = Math.ceil(firstElementChild.scrollHeight);\n }\n return {\n width: props.defaultLeftRightPadding * 2 + widthDataCellFirstChild,\n height:\n heightDataCellFirstChild +\n (hasPaddingTopBottom.value ? props.defaultTopBottomPadding * 2 : 0),\n };\n};\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst onPointerMove = throttle(() => {\n if (props.selectOnMove) {\n emit(\"select\", { expandSelection: true });\n }\n});\n\nconst onPointerDown = (event: MouseEvent) => {\n if (event.button === 0) {\n emit(\"select\", { expandSelection: event.shiftKey });\n }\n};\n\nconst { close: closeExpandedSelectedCell, isShown: isExpandedIfSelected } =\n useDataValueViews();\n\nconst expand = () => emit(\"expand\");\nconst expandAndSelect = (event: MouseEvent) => {\n expand();\n\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n};\n\nconst isExpanded = computed(\n () => props.isSelected && isExpandedIfSelected.value,\n);\nconst isHovered = ref(false);\nconst showCellExpandButton = computed(\n () => props.enableExpand && (isHovered.value || isExpanded.value),\n);\n\n// Snapshot taken on pointerdown — by the time `click` fires, selecting this\n// cell may have already auto-expanded it (when another cell's view was open),\n// flipping `props.isExpanded` to true and making us wrongly close.\nconst wasExpandedAtPointerDown = ref(false);\nconst onExpandButtonPointerDown = () => {\n wasExpandedAtPointerDown.value = isExpanded.value;\n};\nconst onExpandButtonClick = (event: MouseEvent) => {\n if (wasExpandedAtPointerDown.value) {\n closeExpandedSelectedCell();\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n } else {\n expandAndSelect(event);\n }\n};\n\nconst changeExpandedCellViewIfNecessary = () => {\n if (props.isToBeExpanded) {\n if (props.enableExpand) {\n expand();\n } else {\n closeExpandedSelectedCell();\n }\n }\n};\n\nwatch(() => props.isToBeExpanded, changeExpandedCellViewIfNecessary);\nonMounted(changeExpandedCellViewIfNecessary);\n</script>\n\n<template>\n <td\n v-kds-tooltip=\"isMissing ? props.tooltip : undefined\"\n :class=\"[\n 'data-cell',\n {\n 'colored-cell': color,\n 'in-cell-selection': isInCellSelection,\n },\n ]\"\n :style=\"{\n width: `var(${colSizeCssVar})`,\n ...(hasPaddingLeftRight\n ? {\n paddingLeft: `${props.defaultLeftRightPadding}px`,\n paddingRight: `${props.defaultLeftRightPadding}px`,\n }\n : {}),\n ...paddingTopBottom,\n ...dataCellColorStyle,\n }\"\n @dblclick=\"(event: MouseEvent) => enableExpand && expandAndSelect(event)\"\n @pointerenter=\"isHovered = true\"\n @pointerleave=\"isHovered = false\"\n @pointermove=\"onPointerMove\"\n @pointerdown=\"onPointerDown\"\n @input=\"(val: any) => emit('input', { value: val, cell: $el })\"\n >\n <div ref=\"cell-content\" class=\"cell-content\">\n <slot v-if=\"isEditing\" name=\"editable-cell\" :cell-element=\"$el\" />\n <KdsMissingValueIcon v-else-if=\"isMissing\" size=\"small\" />\n <slot\n v-else-if=\"isSlotted\"\n :width=\"\n size -\n props.defaultLeftRightPadding * 2 -\n (showCellExpandButton && !overlayExpandButton\n ? EXPAND_BUTTON_WIDTH\n : 0)\n \"\n />\n <span v-else v-kds-tooltip:truncated=\"props.tooltip\" class=\"cell-text\">\n {{ text }}\n </span>\n <CellExpandButton\n v-if=\"showCellExpandButton\"\n :class=\"{ overlaid: overlayExpandButton }\"\n :toggled=\"isExpanded\"\n @pointerdown=\"onExpandButtonPointerDown\"\n @click=\"onExpandButtonClick\"\n />\n </div>\n </td>\n</template>\n\n<style scoped>\n.data-cell {\n display: flex;\n font: var(--kds-font-base-interactive-small);\n color: var(--kds-color-text-and-icon-neutral);\n white-space: nowrap;\n user-select: none;\n background-clip: border-box;\n\n &.in-cell-selection {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-cell {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .cell-content {\n position: relative;\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-self: flex-start;\n justify-content: space-between;\n width: 100%;\n\n /* Anchored at the same height as the buttons of padded (non-slotted)\n cells, so it lines up with the other columns' buttons in the row. */\n & > .overlaid {\n position: absolute;\n top: v-bind(\"`${defaultTopBottomPadding}px`\");\n right: 0;\n }\n }\n\n & .cell-content .cell-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, type Slot, computed, ref } from \"vue\";\n\nimport {\n getColor,\n getMissingValueMessage,\n isMissingValue,\n unpackObjectRepresentation,\n} from \"../../utils\";\n\nimport type { CellProps } from \"./CellProps\";\nimport CellRenderer from \"./CellRenderer.vue\";\n\nconst emit = defineEmits([\"click\", \"input\", \"select\", \"dataValueView\"]);\nconst props = defineProps<CellProps>();\n\nconst color = computed(() => getColor(props.cellData));\n\n/* const isClickable = computed(() => {\n const { cellData, isClickableByConfig } = props;\n return isClickableByConfig && Boolean(cellData) && cellData !== \"-\";\n}); */\n\nconst isMissing = computed(() => isMissingValue(props.cellData));\n\nconst unpackedValue = computed(() =>\n unpackObjectRepresentation(props.cellData),\n);\n\nconst tooltip = computed(() => {\n const { cellData } = props;\n if (isMissingValue(cellData)) {\n return getMissingValueMessage(cellData);\n }\n if (unpackedValue.value === undefined) {\n return null;\n } else {\n return String(unpackedValue.value);\n }\n});\n\nconst cellRenderer: Ref<InstanceType<typeof CellRenderer> | null> = ref(null);\nconst getCellContentDimensions = () =>\n cellRenderer.value?.getCellContentDimensions();\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst slots = defineSlots<Record<string, Slot>>();\n\nconst forwardedSlotEntries = Object.entries(slots) as Array<[string, Slot]>;\n</script>\n\n<template>\n <CellRenderer\n ref=\"cellRenderer\"\n :is-missing\n :is-slotted=\"column.hasSlotContent ?? false\"\n :text=\"unpackedValue\"\n :tooltip=\"tooltip\"\n :color\n :select-on-move\n :default-top-bottom-padding\n :default-left-right-padding\n :no-padding-left-right=\"column.noPaddingLeftRight\"\n :no-padding-top-bottom=\"column.noPaddingTopBottom\"\n :col-size-css-var\n :size\n :enable-expand=\"\n !isMissing && enableDataValueView && column.hasDataValueView\n \"\n :overlay-expand-button=\"column.overlayDataValueViewButton\"\n :is-selected\n :is-in-cell-selection\n :is-to-be-expanded\n :is-editing\n @click=\"(value) => emit('click', value)\"\n @expand=\"() => emit('dataValueView')\"\n @select=\"(value) => emit('select', value)\"\n @input=\"(value) => emit('input', value)\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </CellRenderer>\n</template>\n","<script setup lang=\"ts\">\nimport { type Ref, type Slot, computed, ref } from \"vue\";\n\nimport {\n getColor,\n getMissingValueMessage,\n isMissingValue,\n unpackObjectRepresentation,\n} from \"../../utils\";\n\nimport type { CellProps } from \"./CellProps\";\nimport CellRenderer from \"./CellRenderer.vue\";\n\nconst emit = defineEmits([\"click\", \"input\", \"select\", \"dataValueView\"]);\nconst props = defineProps<CellProps>();\n\nconst color = computed(() => getColor(props.cellData));\n\n/* const isClickable = computed(() => {\n const { cellData, isClickableByConfig } = props;\n return isClickableByConfig && Boolean(cellData) && cellData !== \"-\";\n}); */\n\nconst isMissing = computed(() => isMissingValue(props.cellData));\n\nconst unpackedValue = computed(() =>\n unpackObjectRepresentation(props.cellData),\n);\n\nconst tooltip = computed(() => {\n const { cellData } = props;\n if (isMissingValue(cellData)) {\n return getMissingValueMessage(cellData);\n }\n if (unpackedValue.value === undefined) {\n return null;\n } else {\n return String(unpackedValue.value);\n }\n});\n\nconst cellRenderer: Ref<InstanceType<typeof CellRenderer> | null> = ref(null);\nconst getCellContentDimensions = () =>\n cellRenderer.value?.getCellContentDimensions();\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst slots = defineSlots<Record<string, Slot>>();\n\nconst forwardedSlotEntries = Object.entries(slots) as Array<[string, Slot]>;\n</script>\n\n<template>\n <CellRenderer\n ref=\"cellRenderer\"\n :is-missing\n :is-slotted=\"column.hasSlotContent ?? false\"\n :text=\"unpackedValue\"\n :tooltip=\"tooltip\"\n :color\n :select-on-move\n :default-top-bottom-padding\n :default-left-right-padding\n :no-padding-left-right=\"column.noPaddingLeftRight\"\n :no-padding-top-bottom=\"column.noPaddingTopBottom\"\n :col-size-css-var\n :size\n :enable-expand=\"\n !isMissing && enableDataValueView && column.hasDataValueView\n \"\n :overlay-expand-button=\"column.overlayDataValueViewButton\"\n :is-selected\n :is-in-cell-selection\n :is-to-be-expanded\n :is-editing\n @click=\"(value) => emit('click', value)\"\n @expand=\"() => emit('dataValueView')\"\n @select=\"(value) => emit('select', value)\"\n @input=\"(value) => emit('input', value)\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </CellRenderer>\n</template>\n","<script setup lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * A table row element which is used for displaying data in the table body. It offers a\n * wide range of functionality which is described in the following sections:\n *\n * Collapsible content:\n * This component can be optionally collapsible for showing row-specific details/content.\n * This expand capability is slotted for flexibility.\n *\n * Selection:\n * Each row can also be selectable- with a checkbox in the first position of the row.\n *\n * SubMenu:\n * A row can display a SubMenu in the last position of the row with row-specific actions\n * configured via props.\n *\n * Editable rows:\n * A cell in the row can be editable and render an input field or other component to allow\n * real time interactions and events.\n *\n * Cell events:\n * DOM events are triggered on a cell-by-cell basis for both clicking and hovering. These events\n * emit information about the data of the cell and the index of the column in the row.\n *\n * Dynamic cell content:\n * Specific columns can be slotted for dynamic rendering methods or configured to use a pre-determined\n * rendering component with the Vue Component/v-is API.\n *\n * @emits rowSelect event when selection is enabled and a row checkbox is toggled.\n * @emits rowInput event when table cells are clicked, cell input is triggered or a hover event is\n * detected.\n * @emits rowSubMenuClick event when a row SubMenu action is triggered.\n */\n\nimport { type Ref, computed, ref, toRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n KdsMenuButton,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport type { ColumnConfig, RowConfig, SubMenuConfig } from \"../..\";\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_HEIGHT,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { VirtualElementAnchor } from \"../../types/DataValueView\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport {\n getPropertiesFromColumns,\n unpackObjectRepresentation,\n} from \"../../utils\";\nimport { injectRegisterExpandedSubMenu } from \"../composables/useCloseSubMenusOnScroll\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport Cell from \"./Cell.vue\";\n\nexport interface RowProps {\n rowData?: { subMenuItemsForRow?: KdsMenuItem[] };\n row?: any[];\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n columns: ColumnConfig[];\n rowConfig?: RowConfig;\n rowHeight?: number | \"dynamic\";\n isSelected?: boolean;\n minRowHeight?: number;\n showDragHandle?: boolean;\n selectCellsOnMove?: boolean;\n disableRowHeightTransition?: boolean;\n selectedCellIndex?: number | null;\n cellSelectionRange?: { min: number; max: number } | null;\n toBeExpandedCellIndex?: number | null;\n toBeEditedCellIndex?: number | null;\n newColumnButtonWidth?: number;\n}\n\nconst props = withDefaults(defineProps<RowProps>(), {\n rowData: () => ({}),\n rowConfig: () => ({}),\n row: () => [],\n rowHeight: DEFAULT_ROW_HEIGHT,\n minRowHeight: 0,\n isSelected: false,\n selectCellsOnMove: false,\n showDragHandle: false,\n disableRowHeightTransition: false,\n selectedCellIndex: null,\n cellSelectionRange: null,\n toBeExpandedCellIndex: null,\n toBeEditedCellIndex: null,\n newColumnButtonWidth: 0,\n});\n\nconst { indexedData: indexedRow, style: rowStyles } = useIndicesAndStylesFor(\n toRef(props, \"row\"),\n);\n\nconst emit = defineEmits<{\n rowSelect: [value: any];\n rowInput: [event: any];\n rowSubMenuClick: [item: any];\n resizeAllRows: [size: number, rowElement: HTMLElement];\n resizeRow: [size: number];\n cellSelect: [index: number, ignoreIfSelected: boolean];\n expandCellSelect: [index: number];\n dataValueView: [index: number, anchor: VirtualElementAnchor];\n deleteRow: [];\n virtualColumnNav: [\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n ];\n}>();\n\nconst showContent = ref(false);\nconst currentRowHeight = ref(props.rowHeight);\nconst paddingTopBottom = computed(() =>\n props.rowConfig.compactMode\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\nconst paddingLeftRight = CELL_PADDING_HORIZONTAL;\n\nwatch(\n () => props.rowHeight,\n (newRowHeight) => {\n currentRowHeight.value = newRowHeight;\n },\n);\nconst activeDrag = ref(false);\nconst rowHeightOnDragStart = ref(0);\n\nconst columnKeys = computed(() =>\n getPropertiesFromColumns(props.columns, \"key\"),\n);\n\nconst DEFAULT_COLUMN_SIZE = 100;\n// The resize-frozen sizes are used so the slotted cell content does not\n// re-render on every drag frame of a column resize; while not resizing they\n// are identical to the live sizes.\nconst { colSizesFrozenWhenResizing } = injectColumnSizes();\nconst getCellSize = (index: number) =>\n colSizesFrozenWhenResizing.value[index] ?? DEFAULT_COLUMN_SIZE;\n\n// const clickableColumns = computed(() =>\n// getPropertiesFromColumns(props.columnConfigs, \"popoverRenderer\").map(\n// (config) => Boolean(config),\n// ),\n// );\nconst filteredSubMenuItems = computed(() => {\n if (\n !props.subMenuConfig.subMenuItems?.length &&\n !props.rowData?.subMenuItemsForRow?.length\n ) {\n return [];\n }\n\n return props.rowData?.subMenuItemsForRow?.length\n ? props.rowData?.subMenuItemsForRow\n : props.subMenuConfig.subMenuItems;\n});\nconst onDeleteRow = () => {\n emit(\"deleteRow\");\n};\nconst onRowExpand = () => {\n showContent.value = !showContent.value;\n};\nconst onSelect = (value: any) => {\n emit(\"rowSelect\", value);\n};\nconst onCellClick = (event: any, colInd: number, data: any) => {\n emit(\"rowInput\", {\n ...event,\n type: \"click\",\n value: null,\n colInd,\n data,\n });\n};\nconst onInput = (event: any) => {\n emit(\"rowInput\", { type: \"input\", ...event });\n};\nconst registerExpandedSubMenu = injectRegisterExpandedSubMenu();\nconst isMenuOpen = ref(false);\nwatch(isMenuOpen, (open) => {\n if (open) {\n registerExpandedSubMenu(() => {\n isMenuOpen.value = false;\n });\n }\n});\n// const isClickableByConfig = (ind: number) => {\n// return Boolean(props.tableConfig.showPopovers) && clickableColumns.value[ind];\n// };\nconst getCellContentSlotName = (columnKeys: any, columnId: any) => {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columnKeys[columnId]}`;\n};\nconst onPointerDown = (event: PointerEvent) => {\n if (currentRowHeight.value === \"dynamic\") {\n return;\n }\n consola.debug(\"Resize via row drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n (event.target as Element).setPointerCapture(event.pointerId);\n activeDrag.value = true;\n rowHeightOnDragStart.value = currentRowHeight.value;\n};\n\nconst rowElement: Ref<null | HTMLElement> = ref(null);\nconst onPointerUp = (event: PointerEvent) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via row drag ended: \", event);\n activeDrag.value = false;\n emit(\"resizeAllRows\", currentRowHeight.value as number, rowElement.value!);\n }\n};\nconst onPointerMove = throttle((event) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n const newRowHeight =\n event.clientY - rowElement.value!.getBoundingClientRect().top;\n currentRowHeight.value = Math.max(newRowHeight, props.minRowHeight);\n emit(\"resizeRow\", currentRowHeight.value - rowHeightOnDragStart.value);\n }\n});\nconst onLostPointerCapture = throttle(() => {\n activeDrag.value = false;\n});\nconst cells: Ref<Record<number, any>> = ref({});\nconst getCellComponents = () => {\n return props.row.map((_, columnIndex) => cells.value[columnIndex]);\n};\nconst onCellSelect = ({\n expandSelection,\n ind,\n ignoreIfSelected = false,\n}: {\n expandSelection: boolean;\n ind: number;\n ignoreIfSelected?: boolean;\n}) => {\n if (expandSelection) {\n emit(\"expandCellSelect\", ind);\n } else {\n emit(\"cellSelect\", ind, ignoreIfSelected);\n }\n};\n\nconst onDataValueView = (index: number) => {\n const anchor = cells.value[index].$el.getBoundingClientRect();\n emit(\"dataValueView\", index, anchor);\n};\n\nconst selectionCheckbox = ref<InstanceType<typeof KdsCheckbox> | null>(null);\nconst deleteButton = ref<InstanceType<typeof KdsButton> | null>(null);\nconst onVirtualColumnKeydown = (\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n) => {\n emit(\"virtualColumnNav\", type, direction);\n};\n\nconst focusDeleteButton = () => {\n deleteButton.value?.$el?.focus();\n};\nconst focusSelectionCheckbox = () => {\n (selectionCheckbox.value as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n};\n\nconst rowHeightStyle = computed(() =>\n currentRowHeight.value === \"dynamic\"\n ? {}\n : { height: `${currentRowHeight.value}px` },\n);\n\nconst transitionInactiveDrag = computed(() => {\n const rowHeightTransition = props.disableRowHeightTransition\n ? \"\"\n : \"height 0.3s, \";\n return { transition: `${rowHeightTransition}box-shadow 0.15s` };\n});\n\nconst transition = computed(() =>\n activeDrag.value ? {} : transitionInactiveDrag.value,\n);\n\ndefineExpose({\n getCellComponents,\n focusDeleteButton,\n focusSelectionCheckbox,\n /**\n * For TableUI test purposes only\n */\n onRowExpand,\n});\n</script>\n\n<template>\n <tr\n ref=\"rowElement\"\n :class=\"[\n 'row',\n {\n 'no-sub-menu': !filteredSubMenuItems?.length,\n 'compact-mode': rowConfig.compactMode,\n },\n ]\"\n :style=\"{\n ...rowStyles,\n ...transition,\n ...rowHeightStyle,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell\">\n <KdsButton\n ref=\"deleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n destructive\n ariaLabel=\"Delete row\"\n @click.stop=\"onDeleteRow\"\n @keydown.left.prevent.stop\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('delete', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('delete', 'down')\"\n @keydown.right.prevent.stop=\"onVirtualColumnKeydown('delete', 'right')\"\n />\n </td>\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox\n ref=\"selectionCheckbox\"\n tooltip=\"Select row\"\n class=\"select-checkbox\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('selection', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('selection', 'down')\"\n @keydown.left.prevent.stop=\"onVirtualColumnKeydown('selection', 'left')\"\n @keydown.right.prevent.stop=\"\n onVirtualColumnKeydown('selection', 'right')\n \"\n @focusout.stop\n />\n </td>\n <Cell\n v-for=\"[cell, ind] of indexedRow\"\n :ref=\"\n (el) => {\n cells[ind] = el;\n }\n \"\n :key=\"ind\"\n :column=\"columns[ind]\"\n :cell-data=\"cell\"\n :select-on-move=\"selectCellsOnMove\"\n :is-selected=\"selectedCellIndex === ind\"\n :is-in-cell-selection=\"\n cellSelectionRange !== null &&\n ind >= cellSelectionRange.min &&\n ind <= cellSelectionRange.max\n \"\n :is-to-be-expanded=\"toBeExpandedCellIndex === ind\"\n :enable-data-value-view=\"tableConfig.enableDataValueViews\"\n :is-editing=\"toBeEditedCellIndex === ind\"\n :col-size-css-var=\"getColSizeCSSVar(ind)\"\n :size=\"getCellSize(ind)\"\n :default-top-bottom-padding=\"paddingTopBottom\"\n :default-left-right-padding=\"paddingLeftRight\"\n @click=\"onCellClick($event, ind, cell)\"\n @select=\"onCellSelect({ ...$event, ind })\"\n @data-value-view=\"onDataValueView(ind)\"\n @input=\"onInput\"\n >\n <template #default=\"{ width }\">\n <slot\n :name=\"getCellContentSlotName(columnKeys, ind)\"\n :row=\"row\"\n :cell=\"unpackObjectRepresentation(cell)\"\n :height=\"rowHeight\"\n :width=\"width\"\n :ind=\"ind\"\n />\n </template>\n <template #editable-cell=\"{ cellElement }\">\n <slot name=\"editable-cell\" :cell-element=\"cellElement\" :ind=\"ind\" />\n </template>\n </Cell>\n <td v-if=\"filteredSubMenuItems?.length\" class=\"action\">\n <KdsMenuButton\n v-model=\"isMenuOpen\"\n ariaLabel=\"More actions\"\n :items=\"filteredSubMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @item-click=\"emit('rowSubMenuClick', $event)\"\n />\n </td>\n <td\n v-if=\"newColumnButtonWidth\"\n :style=\"{ minWidth: `${newColumnButtonWidth}px` }\"\n />\n </tr>\n <div\n v-if=\"showDragHandle && !selectCellsOnMove\"\n class=\"row-drag-handle\"\n @pointerdown.passive=\"onPointerDown\"\n @pointerup.passive=\"onPointerUp\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n />\n</template>\n\n<style scoped>\ntr {\n display: flex;\n}\n\ntr.row {\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n padding: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.deletion-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n overflow: visible;\n opacity: 0;\n\n &:focus-within {\n opacity: 1;\n }\n }\n\n &.action {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n }\n\n &:hover {\n outline: none;\n background-color: var(--kds-color-background-neutral-hover);\n\n /* stylelint-disable-next-line no-descending-specificity -- hover needs lower specificity but must come after base rule */\n & .deletion-cell {\n opacity: 1;\n }\n }\n\n & a {\n outline: none;\n }\n}\n\n.row-drag-handle {\n height: var(--kds-spacing-container-0-37x);\n margin-top: calc(-1 * var(--kds-spacing-container-0-37x));\n cursor: row-resize;\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * A table row element which is used for displaying data in the table body. It offers a\n * wide range of functionality which is described in the following sections:\n *\n * Collapsible content:\n * This component can be optionally collapsible for showing row-specific details/content.\n * This expand capability is slotted for flexibility.\n *\n * Selection:\n * Each row can also be selectable- with a checkbox in the first position of the row.\n *\n * SubMenu:\n * A row can display a SubMenu in the last position of the row with row-specific actions\n * configured via props.\n *\n * Editable rows:\n * A cell in the row can be editable and render an input field or other component to allow\n * real time interactions and events.\n *\n * Cell events:\n * DOM events are triggered on a cell-by-cell basis for both clicking and hovering. These events\n * emit information about the data of the cell and the index of the column in the row.\n *\n * Dynamic cell content:\n * Specific columns can be slotted for dynamic rendering methods or configured to use a pre-determined\n * rendering component with the Vue Component/v-is API.\n *\n * @emits rowSelect event when selection is enabled and a row checkbox is toggled.\n * @emits rowInput event when table cells are clicked, cell input is triggered or a hover event is\n * detected.\n * @emits rowSubMenuClick event when a row SubMenu action is triggered.\n */\n\nimport { type Ref, computed, ref, toRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n KdsMenuButton,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport type { ColumnConfig, RowConfig, SubMenuConfig } from \"../..\";\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_HEIGHT,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { VirtualElementAnchor } from \"../../types/DataValueView\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport {\n getPropertiesFromColumns,\n unpackObjectRepresentation,\n} from \"../../utils\";\nimport { injectRegisterExpandedSubMenu } from \"../composables/useCloseSubMenusOnScroll\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport Cell from \"./Cell.vue\";\n\nexport interface RowProps {\n rowData?: { subMenuItemsForRow?: KdsMenuItem[] };\n row?: any[];\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n columns: ColumnConfig[];\n rowConfig?: RowConfig;\n rowHeight?: number | \"dynamic\";\n isSelected?: boolean;\n minRowHeight?: number;\n showDragHandle?: boolean;\n selectCellsOnMove?: boolean;\n disableRowHeightTransition?: boolean;\n selectedCellIndex?: number | null;\n cellSelectionRange?: { min: number; max: number } | null;\n toBeExpandedCellIndex?: number | null;\n toBeEditedCellIndex?: number | null;\n newColumnButtonWidth?: number;\n}\n\nconst props = withDefaults(defineProps<RowProps>(), {\n rowData: () => ({}),\n rowConfig: () => ({}),\n row: () => [],\n rowHeight: DEFAULT_ROW_HEIGHT,\n minRowHeight: 0,\n isSelected: false,\n selectCellsOnMove: false,\n showDragHandle: false,\n disableRowHeightTransition: false,\n selectedCellIndex: null,\n cellSelectionRange: null,\n toBeExpandedCellIndex: null,\n toBeEditedCellIndex: null,\n newColumnButtonWidth: 0,\n});\n\nconst { indexedData: indexedRow, style: rowStyles } = useIndicesAndStylesFor(\n toRef(props, \"row\"),\n);\n\nconst emit = defineEmits<{\n rowSelect: [value: any];\n rowInput: [event: any];\n rowSubMenuClick: [item: any];\n resizeAllRows: [size: number, rowElement: HTMLElement];\n resizeRow: [size: number];\n cellSelect: [index: number, ignoreIfSelected: boolean];\n expandCellSelect: [index: number];\n dataValueView: [index: number, anchor: VirtualElementAnchor];\n deleteRow: [];\n virtualColumnNav: [\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n ];\n}>();\n\nconst showContent = ref(false);\nconst currentRowHeight = ref(props.rowHeight);\nconst paddingTopBottom = computed(() =>\n props.rowConfig.compactMode\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\nconst paddingLeftRight = CELL_PADDING_HORIZONTAL;\n\nwatch(\n () => props.rowHeight,\n (newRowHeight) => {\n currentRowHeight.value = newRowHeight;\n },\n);\nconst activeDrag = ref(false);\nconst rowHeightOnDragStart = ref(0);\n\nconst columnKeys = computed(() =>\n getPropertiesFromColumns(props.columns, \"key\"),\n);\n\nconst DEFAULT_COLUMN_SIZE = 100;\n// The resize-frozen sizes are used so the slotted cell content does not\n// re-render on every drag frame of a column resize; while not resizing they\n// are identical to the live sizes.\nconst { colSizesFrozenWhenResizing } = injectColumnSizes();\nconst getCellSize = (index: number) =>\n colSizesFrozenWhenResizing.value[index] ?? DEFAULT_COLUMN_SIZE;\n\n// const clickableColumns = computed(() =>\n// getPropertiesFromColumns(props.columnConfigs, \"popoverRenderer\").map(\n// (config) => Boolean(config),\n// ),\n// );\nconst filteredSubMenuItems = computed(() => {\n if (\n !props.subMenuConfig.subMenuItems?.length &&\n !props.rowData?.subMenuItemsForRow?.length\n ) {\n return [];\n }\n\n return props.rowData?.subMenuItemsForRow?.length\n ? props.rowData?.subMenuItemsForRow\n : props.subMenuConfig.subMenuItems;\n});\nconst onDeleteRow = () => {\n emit(\"deleteRow\");\n};\nconst onRowExpand = () => {\n showContent.value = !showContent.value;\n};\nconst onSelect = (value: any) => {\n emit(\"rowSelect\", value);\n};\nconst onCellClick = (event: any, colInd: number, data: any) => {\n emit(\"rowInput\", {\n ...event,\n type: \"click\",\n value: null,\n colInd,\n data,\n });\n};\nconst onInput = (event: any) => {\n emit(\"rowInput\", { type: \"input\", ...event });\n};\nconst registerExpandedSubMenu = injectRegisterExpandedSubMenu();\nconst isMenuOpen = ref(false);\nwatch(isMenuOpen, (open) => {\n if (open) {\n registerExpandedSubMenu(() => {\n isMenuOpen.value = false;\n });\n }\n});\n// const isClickableByConfig = (ind: number) => {\n// return Boolean(props.tableConfig.showPopovers) && clickableColumns.value[ind];\n// };\nconst getCellContentSlotName = (columnKeys: any, columnId: any) => {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columnKeys[columnId]}`;\n};\nconst onPointerDown = (event: PointerEvent) => {\n if (currentRowHeight.value === \"dynamic\") {\n return;\n }\n consola.debug(\"Resize via row drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n (event.target as Element).setPointerCapture(event.pointerId);\n activeDrag.value = true;\n rowHeightOnDragStart.value = currentRowHeight.value;\n};\n\nconst rowElement: Ref<null | HTMLElement> = ref(null);\nconst onPointerUp = (event: PointerEvent) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via row drag ended: \", event);\n activeDrag.value = false;\n emit(\"resizeAllRows\", currentRowHeight.value as number, rowElement.value!);\n }\n};\nconst onPointerMove = throttle((event) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n const newRowHeight =\n event.clientY - rowElement.value!.getBoundingClientRect().top;\n currentRowHeight.value = Math.max(newRowHeight, props.minRowHeight);\n emit(\"resizeRow\", currentRowHeight.value - rowHeightOnDragStart.value);\n }\n});\nconst onLostPointerCapture = throttle(() => {\n activeDrag.value = false;\n});\nconst cells: Ref<Record<number, any>> = ref({});\nconst getCellComponents = () => {\n return props.row.map((_, columnIndex) => cells.value[columnIndex]);\n};\nconst onCellSelect = ({\n expandSelection,\n ind,\n ignoreIfSelected = false,\n}: {\n expandSelection: boolean;\n ind: number;\n ignoreIfSelected?: boolean;\n}) => {\n if (expandSelection) {\n emit(\"expandCellSelect\", ind);\n } else {\n emit(\"cellSelect\", ind, ignoreIfSelected);\n }\n};\n\nconst onDataValueView = (index: number) => {\n const anchor = cells.value[index].$el.getBoundingClientRect();\n emit(\"dataValueView\", index, anchor);\n};\n\nconst selectionCheckbox = ref<InstanceType<typeof KdsCheckbox> | null>(null);\nconst deleteButton = ref<InstanceType<typeof KdsButton> | null>(null);\nconst onVirtualColumnKeydown = (\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n) => {\n emit(\"virtualColumnNav\", type, direction);\n};\n\nconst focusDeleteButton = () => {\n deleteButton.value?.$el?.focus();\n};\nconst focusSelectionCheckbox = () => {\n (selectionCheckbox.value as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n};\n\nconst rowHeightStyle = computed(() =>\n currentRowHeight.value === \"dynamic\"\n ? {}\n : { height: `${currentRowHeight.value}px` },\n);\n\nconst transitionInactiveDrag = computed(() => {\n const rowHeightTransition = props.disableRowHeightTransition\n ? \"\"\n : \"height 0.3s, \";\n return { transition: `${rowHeightTransition}box-shadow 0.15s` };\n});\n\nconst transition = computed(() =>\n activeDrag.value ? {} : transitionInactiveDrag.value,\n);\n\ndefineExpose({\n getCellComponents,\n focusDeleteButton,\n focusSelectionCheckbox,\n /**\n * For TableUI test purposes only\n */\n onRowExpand,\n});\n</script>\n\n<template>\n <tr\n ref=\"rowElement\"\n :class=\"[\n 'row',\n {\n 'no-sub-menu': !filteredSubMenuItems?.length,\n 'compact-mode': rowConfig.compactMode,\n },\n ]\"\n :style=\"{\n ...rowStyles,\n ...transition,\n ...rowHeightStyle,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell\">\n <KdsButton\n ref=\"deleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n destructive\n ariaLabel=\"Delete row\"\n @click.stop=\"onDeleteRow\"\n @keydown.left.prevent.stop\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('delete', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('delete', 'down')\"\n @keydown.right.prevent.stop=\"onVirtualColumnKeydown('delete', 'right')\"\n />\n </td>\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox\n ref=\"selectionCheckbox\"\n tooltip=\"Select row\"\n class=\"select-checkbox\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('selection', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('selection', 'down')\"\n @keydown.left.prevent.stop=\"onVirtualColumnKeydown('selection', 'left')\"\n @keydown.right.prevent.stop=\"\n onVirtualColumnKeydown('selection', 'right')\n \"\n @focusout.stop\n />\n </td>\n <Cell\n v-for=\"[cell, ind] of indexedRow\"\n :ref=\"\n (el) => {\n cells[ind] = el;\n }\n \"\n :key=\"ind\"\n :column=\"columns[ind]\"\n :cell-data=\"cell\"\n :select-on-move=\"selectCellsOnMove\"\n :is-selected=\"selectedCellIndex === ind\"\n :is-in-cell-selection=\"\n cellSelectionRange !== null &&\n ind >= cellSelectionRange.min &&\n ind <= cellSelectionRange.max\n \"\n :is-to-be-expanded=\"toBeExpandedCellIndex === ind\"\n :enable-data-value-view=\"tableConfig.enableDataValueViews\"\n :is-editing=\"toBeEditedCellIndex === ind\"\n :col-size-css-var=\"getColSizeCSSVar(ind)\"\n :size=\"getCellSize(ind)\"\n :default-top-bottom-padding=\"paddingTopBottom\"\n :default-left-right-padding=\"paddingLeftRight\"\n @click=\"onCellClick($event, ind, cell)\"\n @select=\"onCellSelect({ ...$event, ind })\"\n @data-value-view=\"onDataValueView(ind)\"\n @input=\"onInput\"\n >\n <template #default=\"{ width }\">\n <slot\n :name=\"getCellContentSlotName(columnKeys, ind)\"\n :row=\"row\"\n :cell=\"unpackObjectRepresentation(cell)\"\n :height=\"rowHeight\"\n :width=\"width\"\n :ind=\"ind\"\n />\n </template>\n <template #editable-cell=\"{ cellElement }\">\n <slot name=\"editable-cell\" :cell-element=\"cellElement\" :ind=\"ind\" />\n </template>\n </Cell>\n <td v-if=\"filteredSubMenuItems?.length\" class=\"action\">\n <KdsMenuButton\n v-model=\"isMenuOpen\"\n ariaLabel=\"More actions\"\n :items=\"filteredSubMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @item-click=\"emit('rowSubMenuClick', $event)\"\n />\n </td>\n <td\n v-if=\"newColumnButtonWidth\"\n :style=\"{ minWidth: `${newColumnButtonWidth}px` }\"\n />\n </tr>\n <div\n v-if=\"showDragHandle && !selectCellsOnMove\"\n class=\"row-drag-handle\"\n @pointerdown.passive=\"onPointerDown\"\n @pointerup.passive=\"onPointerUp\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n />\n</template>\n\n<style scoped>\ntr {\n display: flex;\n}\n\ntr.row {\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n padding: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.deletion-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n overflow: visible;\n opacity: 0;\n\n &:focus-within {\n opacity: 1;\n }\n }\n\n &.action {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n }\n\n &:hover {\n outline: none;\n background-color: var(--kds-color-background-neutral-hover);\n\n /* stylelint-disable-next-line no-descending-specificity -- hover needs lower specificity but must come after base rule */\n & .deletion-cell {\n opacity: 1;\n }\n }\n\n & a {\n outline: none;\n }\n}\n\n.row-drag-handle {\n height: var(--kds-spacing-container-0-37x);\n margin-top: calc(-1 * var(--kds-spacing-container-0-37x));\n cursor: row-resize;\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from \"vue\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../../constants\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport type { CellSelectionOverlayProps } from \"./CellSelectionOverlayProps\";\n\nconst props = defineProps<CellSelectionOverlayProps>();\n\n/**\n * Live numeric column sizes, injected rather than received as a prop. The\n * overlay is rendered as a sibling of the row/cell tree (in the\n * `cell-selection-overlay` slot), so re-rendering it when the sizes change\n * during a resize does not cascade to the cells. Reading the live sizes at\n * render time is therefore safe here and keeps the selection rectangle correct\n * while a column is being resized.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst getRowResizeOffset = computed(() => {\n const rowResizeIndex = props.rowResizeIndex;\n const rowResizeDelta = props.rowResizeDelta;\n if (rowResizeIndex === null || rowResizeDelta === null) {\n return () => 0;\n } else {\n return (index: number) => (index > rowResizeIndex ? rowResizeDelta : 0);\n }\n});\n\nconst top = computed(() => {\n const { min } = props.rect.y;\n return min * props.rowHeight + getRowResizeOffset.value(min);\n});\n\nconst bottom = computed(() => {\n const { max } = props.rect.y;\n return (max + 1) * props.rowHeight + getRowResizeOffset.value(max + 1);\n});\n\nconst columnOffsets = computed(() => {\n let currentOffset = 0;\n if (props.tableConfig.showSelection) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n if (props.tableConfig.enableRowDeletion) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n const offsets: number[] = [];\n colSizes.value.forEach((size) => {\n offsets.push(currentOffset);\n currentOffset += size;\n });\n offsets.push(currentOffset);\n return offsets;\n});\n\nconst left = computed(() => {\n const { min } = props.rect.x;\n return columnOffsets.value[min];\n});\n\nconst right = computed(() => {\n const { max } = props.rect.x;\n return columnOffsets.value[max + 1];\n});\n\nconst height = computed(() => {\n return bottom.value - top.value;\n});\n\nconst width = computed(() => {\n return right.value - left.value;\n});\n\nconst copied = ref(false);\nconst triggerCopied = () => {\n copied.value = true;\n};\n\nconst virtualFocusOverlay = ref<null | HTMLDivElement>(null);\nconst virtualFocusOverlayCoordinates = computed(() => {\n if (!props.cellSelectionRectFocusCorner) {\n return null;\n }\n const { x: left, y: top } = props.cellSelectionRectFocusCorner;\n const right = left + 1;\n const bottom = top + 1;\n return {\n left: columnOffsets.value[left],\n right: columnOffsets.value[right],\n top: top * props.rowHeight + getRowResizeOffset.value(top),\n bottom: bottom * props.rowHeight + getRowResizeOffset.value(bottom),\n };\n});\n\nconst virtualFocusOverlayHeight = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.bottom -\n virtualFocusOverlayCoordinates.value!.top\n );\n});\n\nconst virtualFocusOverlayWidth = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.right -\n virtualFocusOverlayCoordinates.value!.left\n );\n});\n\nconst isVirtualFocusOverlayInsideViewportOfBody = (\n containerBCR: DOMRect,\n focusOverlay: HTMLDivElement,\n headerHeight: number,\n) => {\n const virtualFocusOverlayBCR = focusOverlay.getBoundingClientRect();\n const bodyTop = containerBCR.top + headerHeight;\n\n return {\n verticalInside:\n bodyTop <= virtualFocusOverlayBCR.top &&\n virtualFocusOverlayBCR.bottom <= containerBCR.bottom,\n horizontalInside:\n containerBCR.left <= virtualFocusOverlayBCR.left &&\n virtualFocusOverlayBCR.right <= containerBCR.right,\n };\n};\n\nconst scrollFocusOverlayIntoView = async (\n params: null | {\n containerBCR: DOMRect | null;\n headerHeight: number;\n scrollTo: (scrollToValues: {\n top?: number;\n left?: number;\n }) => void | undefined;\n },\n) => {\n // wait for focusOverlay to render at new position to calculate bounding client rect\n await nextTick();\n if (params) {\n const { containerBCR, headerHeight, scrollTo } = params;\n if (\n containerBCR &&\n virtualFocusOverlay.value &&\n virtualFocusOverlayCoordinates.value\n ) {\n const { verticalInside, horizontalInside } =\n isVirtualFocusOverlayInsideViewportOfBody(\n containerBCR,\n virtualFocusOverlay.value,\n headerHeight,\n );\n\n if (!verticalInside) {\n scrollTo({\n top:\n virtualFocusOverlayCoordinates.value.top -\n containerBCR.height / 2 +\n virtualFocusOverlayHeight.value,\n });\n } else if (!horizontalInside) {\n scrollTo({\n left:\n virtualFocusOverlayCoordinates.value.left -\n containerBCR.width / 2 +\n virtualFocusOverlayWidth.value / 2,\n });\n }\n }\n } else {\n virtualFocusOverlay.value?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n });\n }\n};\n\nconst getFocusOverlayBoundingClientRect = () =>\n virtualFocusOverlay.value?.getBoundingClientRect();\n\ndefineExpose({\n triggerCopied,\n focus,\n scrollFocusOverlayIntoView,\n getFocusOverlayBoundingClientRect,\n});\n</script>\n\n<template>\n <div\n class=\"overlay\"\n :class=\"{ copied: copied }\"\n :style=\"{\n transform: `translateY(${top}px) translateX(${left}px)`,\n width: `${width}px`,\n height: `${height}px`,\n }\"\n @animationend=\"copied = false\"\n />\n <div\n v-if=\"virtualFocusOverlayCoordinates\"\n ref=\"virtualFocusOverlay\"\n class=\"overlay virtual-focus\"\n :style=\"{\n transform: `translateY(${virtualFocusOverlayCoordinates.top}px) translateX(${virtualFocusOverlayCoordinates.left}px)`,\n width: `${virtualFocusOverlayWidth}px`,\n height: `${virtualFocusOverlayHeight}px`,\n }\"\n />\n</template>\n\n<style scoped>\n.overlay {\n position: absolute;\n z-index: var(--z-index-cell-selection-overlay);\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.virtual-focus {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from \"vue\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../../constants\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport type { CellSelectionOverlayProps } from \"./CellSelectionOverlayProps\";\n\nconst props = defineProps<CellSelectionOverlayProps>();\n\n/**\n * Live numeric column sizes, injected rather than received as a prop. The\n * overlay is rendered as a sibling of the row/cell tree (in the\n * `cell-selection-overlay` slot), so re-rendering it when the sizes change\n * during a resize does not cascade to the cells. Reading the live sizes at\n * render time is therefore safe here and keeps the selection rectangle correct\n * while a column is being resized.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst getRowResizeOffset = computed(() => {\n const rowResizeIndex = props.rowResizeIndex;\n const rowResizeDelta = props.rowResizeDelta;\n if (rowResizeIndex === null || rowResizeDelta === null) {\n return () => 0;\n } else {\n return (index: number) => (index > rowResizeIndex ? rowResizeDelta : 0);\n }\n});\n\nconst top = computed(() => {\n const { min } = props.rect.y;\n return min * props.rowHeight + getRowResizeOffset.value(min);\n});\n\nconst bottom = computed(() => {\n const { max } = props.rect.y;\n return (max + 1) * props.rowHeight + getRowResizeOffset.value(max + 1);\n});\n\nconst columnOffsets = computed(() => {\n let currentOffset = 0;\n if (props.tableConfig.showSelection) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n if (props.tableConfig.enableRowDeletion) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n const offsets: number[] = [];\n colSizes.value.forEach((size) => {\n offsets.push(currentOffset);\n currentOffset += size;\n });\n offsets.push(currentOffset);\n return offsets;\n});\n\nconst left = computed(() => {\n const { min } = props.rect.x;\n return columnOffsets.value[min];\n});\n\nconst right = computed(() => {\n const { max } = props.rect.x;\n return columnOffsets.value[max + 1];\n});\n\nconst height = computed(() => {\n return bottom.value - top.value;\n});\n\nconst width = computed(() => {\n return right.value - left.value;\n});\n\nconst copied = ref(false);\nconst triggerCopied = () => {\n copied.value = true;\n};\n\nconst virtualFocusOverlay = ref<null | HTMLDivElement>(null);\nconst virtualFocusOverlayCoordinates = computed(() => {\n if (!props.cellSelectionRectFocusCorner) {\n return null;\n }\n const { x: left, y: top } = props.cellSelectionRectFocusCorner;\n const right = left + 1;\n const bottom = top + 1;\n return {\n left: columnOffsets.value[left],\n right: columnOffsets.value[right],\n top: top * props.rowHeight + getRowResizeOffset.value(top),\n bottom: bottom * props.rowHeight + getRowResizeOffset.value(bottom),\n };\n});\n\nconst virtualFocusOverlayHeight = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.bottom -\n virtualFocusOverlayCoordinates.value!.top\n );\n});\n\nconst virtualFocusOverlayWidth = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.right -\n virtualFocusOverlayCoordinates.value!.left\n );\n});\n\nconst isVirtualFocusOverlayInsideViewportOfBody = (\n containerBCR: DOMRect,\n focusOverlay: HTMLDivElement,\n headerHeight: number,\n) => {\n const virtualFocusOverlayBCR = focusOverlay.getBoundingClientRect();\n const bodyTop = containerBCR.top + headerHeight;\n\n return {\n verticalInside:\n bodyTop <= virtualFocusOverlayBCR.top &&\n virtualFocusOverlayBCR.bottom <= containerBCR.bottom,\n horizontalInside:\n containerBCR.left <= virtualFocusOverlayBCR.left &&\n virtualFocusOverlayBCR.right <= containerBCR.right,\n };\n};\n\nconst scrollFocusOverlayIntoView = async (\n params: null | {\n containerBCR: DOMRect | null;\n headerHeight: number;\n scrollTo: (scrollToValues: {\n top?: number;\n left?: number;\n }) => void | undefined;\n },\n) => {\n // wait for focusOverlay to render at new position to calculate bounding client rect\n await nextTick();\n if (params) {\n const { containerBCR, headerHeight, scrollTo } = params;\n if (\n containerBCR &&\n virtualFocusOverlay.value &&\n virtualFocusOverlayCoordinates.value\n ) {\n const { verticalInside, horizontalInside } =\n isVirtualFocusOverlayInsideViewportOfBody(\n containerBCR,\n virtualFocusOverlay.value,\n headerHeight,\n );\n\n if (!verticalInside) {\n scrollTo({\n top:\n virtualFocusOverlayCoordinates.value.top -\n containerBCR.height / 2 +\n virtualFocusOverlayHeight.value,\n });\n } else if (!horizontalInside) {\n scrollTo({\n left:\n virtualFocusOverlayCoordinates.value.left -\n containerBCR.width / 2 +\n virtualFocusOverlayWidth.value / 2,\n });\n }\n }\n } else {\n virtualFocusOverlay.value?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n });\n }\n};\n\nconst getFocusOverlayBoundingClientRect = () =>\n virtualFocusOverlay.value?.getBoundingClientRect();\n\ndefineExpose({\n triggerCopied,\n focus,\n scrollFocusOverlayIntoView,\n getFocusOverlayBoundingClientRect,\n});\n</script>\n\n<template>\n <div\n class=\"overlay\"\n :class=\"{ copied: copied }\"\n :style=\"{\n transform: `translateY(${top}px) translateX(${left}px)`,\n width: `${width}px`,\n height: `${height}px`,\n }\"\n @animationend=\"copied = false\"\n />\n <div\n v-if=\"virtualFocusOverlayCoordinates\"\n ref=\"virtualFocusOverlay\"\n class=\"overlay virtual-focus\"\n :style=\"{\n transform: `translateY(${virtualFocusOverlayCoordinates.top}px) translateX(${virtualFocusOverlayCoordinates.left}px)`,\n width: `${virtualFocusOverlayWidth}px`,\n height: `${virtualFocusOverlayHeight}px`,\n }\"\n />\n</template>\n\n<style scoped>\n.overlay {\n position: absolute;\n z-index: var(--z-index-cell-selection-overlay);\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.virtual-focus {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport {\n type PropType,\n type Ref,\n computed,\n nextTick,\n ref,\n toRef,\n watch,\n watchEffect,\n} from \"vue\";\n\nimport {\n KdsEmptyState,\n type KdsEmptyStateProps,\n type KdsMenuItem,\n KdsPagination,\n} from \"@knime/kds-components\";\n\nimport { columnSortText } from \"../config/table.config\";\nimport {\n COMPACT_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY,\n SPECIAL_COLUMNS_SIZE,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { VirtualElementAnchor } from \"../types/DataValueView\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\n\nimport TableCore from \"./TableCore.vue\";\nimport { useTotalWidth } from \"./composables/useAvailableWidth\";\nimport { BODY_WIDTH_CSS_VAR } from \"./composables/useBodyWidth\";\nimport { useBoolean } from \"./composables/useBoolean\";\nimport { useCellCopyPaste } from \"./composables/useCellCopyPaste\";\nimport {\n type CellPosition,\n type Rect,\n type RectId,\n useCellSelection,\n} from \"./composables/useCellSelection\";\nimport { provideDataValueViewsIsShown } from \"./composables/useDataValueViews\";\nimport { createEditingCellKeydownHandler } from \"./composables/useEditCellKeydown\";\nimport { useVisibleAfterAvailableWidth } from \"./composables/useVisibleAfterAvailableWidth\";\nimport TableActionBar from \"./control/TableActionBar.vue\";\nimport Header from \"./layout/Header.vue\";\nimport NewRowButton from \"./layout/NewRowButton.vue\";\nimport Row from \"./layout/Row.vue\";\nimport CellSelectionOverlay from \"./ui/CellSelectionOverlay.vue\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport type DataItem =\n | {\n data: any;\n dots?: false;\n }\n | {\n dots: true;\n };\n\n/**\n * @see README.md\n */\nexport default {\n components: {\n KdsPagination,\n Header,\n Row,\n // TablePopover,\n CellSelectionOverlay,\n TableCore,\n NewRowButton,\n TableActionBar,\n KdsEmptyState,\n },\n props: {\n /**\n * Data props.\n */\n data: {\n type: Array as PropType<Array<Array<any>>>,\n required: true,\n },\n /**\n * It specifies how many (empty) rows should be simultated above the given rows in this.data[0]\n */\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n /**\n * It specifies how many (empty) rows should be simultated below the given rows in this.data[0]\n */\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n /**\n * Data displayed when scrolling to the bottom of the table. Currently only supproted together\n * with virtual scrolling enabled.\n */\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /**\n * analogous to currentSelection but for the bottomData\n */\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n /** Stable per-column definitions. */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n required: true,\n },\n /** Additional per-column header menu items (index-aligned with columns), appended after sort items. */\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n /** Active sorts, ordered by sort priority. */\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n /** Feature switches for the table. */\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n /** Runtime totals and flags for the table. */\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n /** Pagination config; its presence enables pagination. */\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n /** Runtime pagination state. */\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n /** Action-bar config; its presence enables the action bar. */\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n /** Runtime state of the action bar. */\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n required: false,\n },\n /** Per-row and per-group submenu config. */\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** Appearance of the table's rows. */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n disableRowHeightTransition: {\n type: Boolean,\n default: false,\n },\n emptyState: {\n type: Object as PropType<KdsEmptyStateProps>,\n default: undefined,\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n resizeActive: (isActive: boolean) => true,\n columnUpdate: (newColumnList: string[]) => true,\n columnReorder: (colInd: number, newColInd: number) => true,\n pageChange: (newPageNumber: number) => true,\n pageSizeUpdate: (newPageSize: number) => true,\n columnSort: (colInd: number | undefined, sortDirection: -1 | 0 | 1) => true,\n selectAll: (selected: boolean) => true,\n rowSelect: (\n selected: boolean,\n rowInd: number,\n groupInd: number,\n isTop: boolean,\n ) => true,\n tableInput: (event: any) => true,\n columnResize: (columnIndex: number, newColumnSize: number) => true,\n lazyload: (lazyloadParams: {\n direction: 1 | -1;\n startIndex: number;\n endIndex: number;\n }) => true,\n allColumnsResize: (newColumnSize: number) => true,\n columnResizeStart: () => true,\n columnResizeEnd: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n \"update:searchTerm\": (newSearchTerm: string /** Might be empty */) => true,\n rowHeightUpdate: (newRowHeight: number | null | \"dynamic\") => true,\n copySelection: (copySelectionParams: {\n rect: Rect;\n id: RectId | null;\n withHeaders: boolean;\n }) => true,\n pasteSelection: (pasteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n updateSelection: (newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n }) => void;\n }) => true,\n cutSelection: (cutSelectionParams: { rect: Rect; id: RectId | null }) =>\n true,\n deleteSelection: (deleteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n }) => true,\n cellSelectionChange: (cellPosition: CellPosition | null) => true,\n dataValueView: (\n row: { indexInInput: number; isTop: boolean },\n columnIndex: number,\n rect: VirtualElementAnchor,\n ) => true,\n closeDataValueView: () => true,\n newColumnButtonClick: () => true,\n newRowButtonClick: (\n lastPosition: {\n columnInd: number;\n rectId: number | null;\n } | null,\n ) => true,\n headerCellStartEditing: (columnIndex: number, initialValue?: string) =>\n true,\n deleteColumn: (colInd: number) => true,\n deleteRow: (rowInd: number) => true,\n resetTemporaryView: () => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(props, { emit }) {\n const wrapper: Ref<any> = ref(null);\n const tableCore: Ref<InstanceType<typeof TableCore> | null> = ref(null);\n const header: Ref<InstanceType<typeof Header> | null> = ref(null);\n const selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n > = ref([]);\n const totalWidth = useTotalWidth(wrapper);\n const { isVisible: tableIsVisible, onAvailableWidthReported } =\n useVisibleAfterAvailableWidth();\n const onUpdateAvailableWidth = (newAvailableWidth: number) => {\n emit(\"update:available-width\", newAvailableWidth);\n onAvailableWidthReported();\n };\n const enableCellSelection = computed(() =>\n Boolean(props.tableConfig.enableCellSelection),\n );\n // cell selection\n const {\n selectCell,\n expandCellSelection,\n clearCellSelection,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n } = useCellSelection(enableCellSelection);\n\n watch(selectedCell, (newCell) =>\n emit(\"cellSelectionChange\", newCell ?? null),\n );\n\n const selectCellsOnMove = useBoolean(false);\n // cell copying\n const emitCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (rectMinMax.value) {\n emit(\"copySelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n withHeaders,\n });\n }\n };\n\n const scrollToCellSelectionOverlay = async () => {\n const tableCoreRef = tableCore.value;\n if (tableCoreRef === null) {\n return;\n }\n const scrollToViewParams = {\n containerBCR:\n tableCoreRef.getVirtualContainer()?.getBoundingClientRect() || null,\n headerHeight: header.value?.$el.clientHeight || 0,\n scrollTo: (position: { left?: number; top?: number }) =>\n tableCoreRef.virtualScrollToPosition(position),\n };\n\n if (Array.isArray(selectionOverlay.value)) {\n await selectionOverlay.value[0]?.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n } else if (selectionOverlay.value) {\n await selectionOverlay.value.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n }\n };\n\n const updateCellSelection = (\n newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n },\n newRectId: RectId | null = null,\n ) => {\n const rectId = newRectId ?? currentRectId.value ?? 0;\n selectCell({ x: newRect.maxX, y: newRect.maxY }, rectId, true);\n if (newRect.minX !== newRect.maxX || newRect.minY !== newRect.maxY) {\n expandCellSelection({ x: newRect.minX, y: newRect.minY }, rectId);\n }\n tableCore.value?.getVirtualBody()?.focus({ preventScroll: true });\n nextTick().then(scrollToCellSelectionOverlay);\n };\n\n const emitPasteSelection = () => {\n if (rectMinMax.value) {\n emit(\"pasteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n updateSelection: updateCellSelection,\n });\n }\n };\n const emitCutSelection = () => {\n if (rectMinMax.value) {\n emit(\"cutSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n const emitDeleteSelection = () => {\n if (rectMinMax.value) {\n emit(\"deleteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n\n const focusWithin = ref(false);\n const changeFocus = (newFocus: boolean) => {\n focusWithin.value = newFocus;\n };\n\n const toBeEditedCell = ref<null | CellPosition>(null);\n const editingCellInitialValue = ref<null | string>(null);\n const editingCell = computed(() =>\n selectCellsOnMove.state ? null : toBeEditedCell.value,\n );\n const isEditingCell = computed(() => editingCell.value !== null);\n\n const setToBeEditedCell = (\n cellPosition: CellPosition | null,\n initialValue?: string,\n ) => {\n toBeEditedCell.value = cellPosition;\n editingCellInitialValue.value = initialValue ?? null;\n };\n const isEditingEnabled = computed(() =>\n getPropertiesFromColumns(props.columns, \"editable\").some(Boolean),\n );\n const { handleCopyOnKeydown, handleDeleteSelection } = useCellCopyPaste({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy: emitCopySelection,\n onPaste: emitPasteSelection,\n onCut: emitCutSelection,\n onDelete: emitDeleteSelection,\n });\n\n const stopEditingCell = (rowInd?: number, colInd?: number) => {\n const toBeEditedCellValue = toBeEditedCell.value;\n if (\n rowInd !== undefined &&\n colInd !== undefined &&\n toBeEditedCellValue &&\n (toBeEditedCellValue.x !== colInd || toBeEditedCellValue.y !== rowInd)\n ) {\n return;\n }\n setToBeEditedCell(null);\n };\n\n const toBeShownCell = ref<null | CellPosition>(null);\n\n const closeDataValueView = () => {\n if (props.tableState.dataValueViewIsShown) {\n emit(\"closeDataValueView\");\n }\n toBeShownCell.value = null;\n };\n\n provideDataValueViewsIsShown(\n toRef(props, \"tableState\"),\n closeDataValueView,\n );\n\n const { columnResizeActive } = injectColumnSizes();\n watchEffect(() => emit(\"resizeActive\", columnResizeActive.value));\n\n const showNewColumnAndRowButton = computed(() =>\n Boolean(props.tableConfig.showNewColumnAndRowButton),\n );\n const newColumnButtonWidth = ref(0);\n\n return {\n wrapper,\n totalWidth,\n tableIsVisible,\n onUpdateAvailableWidth,\n tableCore,\n header,\n selectionOverlay,\n scrollToCellSelectionOverlay,\n selectCellsOnMove,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n selectCell,\n expandCellSelection,\n clearCellSelection: () => {\n clearCellSelection();\n closeDataValueView();\n },\n clearCellSelectionAndStopPropagation: (event: Event) => {\n if (rectMinMax.value === null) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n clearCellSelection();\n },\n setToBeEditedCell,\n editingCellInitialValue,\n stopEditingCell,\n updateCellSelection,\n changeFocus,\n focusWithin,\n handleCopyOnKeydown,\n handleDeleteSelection,\n toBeShownCell,\n toBeEditedCell,\n editingCell,\n isEditingCell,\n createEditingCellKeydownHandler,\n columnResizeActive,\n showNewColumnAndRowButton,\n newColumnButtonWidth,\n BODY_WIDTH_CSS_VAR,\n };\n },\n data() {\n return {\n popoverColumn: null as null | string | number | symbol,\n lastScrollIndex: 0,\n newVal: null,\n resizeCount: 0,\n updatedBefore: false,\n wrapperWidth: 0,\n closeExpandedSubMenu: () => {},\n scrollerId: \"scroller\",\n resizedRowHeight: null as null | number,\n currentResizedScrollIndex: null as null | number,\n currentRowSizeDelta: null as null | number,\n SPECIAL_COLUMNS_SIZE,\n lastRowAndRectIdBeforeMovingToNewColumnButton: null as null | {\n rowInd: number;\n rectId: RectId | null;\n },\n lastColumnAndRectIdBeforeMovingToNewRowButton: null as\n | null\n | {\n columnInd: number;\n rectId: RectId | null;\n }\n | {\n virtualColumn: \"delete\" | \"selection\";\n rectId: RectId | null;\n },\n };\n },\n computed: {\n showActionBar() {\n const viewType = this.actionState?.viewType;\n // A temporary view is highlighted via the action bar, so the bar must\n // render even when no action bar feature is enabled via actionConfig\n return (\n Boolean(this.actionConfig) ||\n viewType === \"TEMP_VIEW\" ||\n viewType === \"PREVIEW\"\n );\n },\n minRowHeight() {\n return this.rowConfig.compactMode\n ? COMPACT_ROW_HEIGHT\n : DEFAULT_ROW_HEIGHT;\n },\n initialRowHeight() {\n return this.rowConfig?.rowHeight || this.minRowHeight;\n },\n currentRowHeight() {\n return this.resizedRowHeight ?? this.initialRowHeight;\n },\n selectedHeaderIndex(): number | null {\n return this.selectedCell?.y === -1 ? this.selectedCell.x : null;\n },\n slottedColumns() {\n return getPropertiesFromColumns(this.columns, \"hasSlotContent\")\n .map((hasSlotContent: any, colInd: any) =>\n hasSlotContent ? colInd : null,\n )\n .filter((colInd: any) => colInd !== null);\n },\n topDataLength() {\n if (this.data === null || this.data.length === 0) {\n return 0;\n }\n return this.data[0].length;\n },\n totalTableLength() {\n return this.scrollData[0].length + this.numRowsAbove;\n },\n numPlaceholderRows() {\n return this.topDataLength ? 1 : 0;\n },\n placeholderRowRowIndex() {\n return this.data[0].length + this.numRowsAbove;\n },\n scrollData() {\n if (this.data === null || this.data.length === 0) {\n return [[]];\n }\n const dataItems: DataItem[][] = this.data?.map((groupData) =>\n groupData.map((data) => ({ data })),\n );\n if (this.bottomData.length > 0) {\n if (this.numPlaceholderRows) {\n dataItems[0].push({ dots: true });\n }\n dataItems[0].push(...this.bottomData.map((data) => ({ data })));\n }\n return dataItems;\n },\n currentSelectionMap() {\n if (!this.tableConfig.showSelection) {\n return () => false;\n }\n return (rowInd: number, groupInd: number) => {\n const { isTop, indexInInput } = this.resolveRowIndex(rowInd);\n return isTop\n ? this.currentSelection[groupInd][indexInInput]\n : this.currentBottomSelection[indexInInput];\n };\n },\n scrollerItemSize() {\n if (this.currentRowHeight === \"dynamic\") {\n return this.minRowHeight;\n }\n return this.currentRowHeight;\n },\n sortControlOptions() {\n const selectableColumns: { id: string; text: string }[] = [];\n const selectableDirections: Record<\n string,\n { id: string; text: string }[]\n > = {};\n this.columns.forEach((column) => {\n if (column.isNotSortable) {\n return;\n }\n selectableColumns.push({\n id: column.id as string,\n text: column.header,\n });\n const sortTexts = columnSortText[column.type ?? \"default\"];\n selectableDirections[column.id as string] = [\n { id: \"1\", text: sortTexts.ascending },\n { id: \"-1\", text: sortTexts.descending },\n ];\n });\n return { selectableColumns, selectableDirections };\n },\n },\n watch: {\n \"rowConfig.compactMode\": {\n handler() {\n this.resetRowHeight();\n },\n },\n \"rowConfig.rowHeight\": {\n handler() {\n this.resetRowHeight();\n },\n },\n currentRowHeight(newRowHeight) {\n this.$emit(\"rowHeightUpdate\", newRowHeight);\n },\n },\n methods: {\n // Utilities\n refreshScroller() {\n this.tableCore?.virtualScrollToPosition({ top: 0 });\n },\n resetRowHeight() {\n this.resizedRowHeight = null;\n },\n isTop(index: number) {\n return index < this.topDataLength + this.numRowsAbove;\n },\n resolveRowIndex(index: number) {\n if (index < this.numRowsAbove) {\n throw new Error(`Accessing invalid row index: ${index}`);\n }\n if (this.isTop(index)) {\n return {\n isTop: true,\n indexInInput: index - this.numRowsAbove,\n };\n }\n return {\n isTop: false,\n indexInInput:\n index -\n this.numRowsAbove -\n this.numPlaceholderRows -\n this.topDataLength,\n };\n },\n // Event handling\n onScroll(startIndex: number, endIndex: number) {\n if (\n this.lastScrollIndex === endIndex ||\n this.currentResizedScrollIndex !== null\n ) {\n return;\n }\n const direction: 1 | -1 = this.lastScrollIndex < endIndex ? 1 : -1;\n this.lastScrollIndex = endIndex;\n this.$emit(\"lazyload\", { direction, startIndex, endIndex });\n },\n onColumnUpdate(newColumnList: any) {\n consola.debug(`TableUI emitting: columnUpdate ${newColumnList}`);\n this.clearCellSelection();\n this.$emit(\"columnUpdate\", newColumnList);\n },\n onColumnReorder(colInd: number, newColInd: number) {\n consola.debug(`TableUI emitting: columnReorder ${colInd} ${newColInd}`);\n this.clearCellSelection();\n this.$emit(\"columnReorder\", colInd, newColInd);\n },\n onPageChange(newPageNumber: number) {\n consola.debug(`TableUI emitting: pageChange ${newPageNumber}`);\n this.clearCellSelection();\n this.$emit(\"pageChange\", newPageNumber);\n },\n onPageSizeUpdate(newPageSize: number) {\n consola.debug(`TableUI emitting: pageSizeUpdate ${newPageSize}`);\n this.clearCellSelection();\n this.$emit(\"pageSizeUpdate\", newPageSize);\n },\n clearAllCellInteractions() {\n this.clearCellSelection();\n this.stopEditingCell();\n },\n onDeleteColumn(colInd: number) {\n this.clearAllCellInteractions();\n this.$emit(\"deleteColumn\", colInd);\n },\n onDeleteRow(rowInd: number) {\n this.clearAllCellInteractions();\n const { indexInInput } = this.resolveRowIndex(rowInd);\n this.$emit(\"deleteRow\", indexInInput);\n },\n onColumnSort(colInd: number | undefined, sortDirection: -1 | 0 | 1) {\n consola.debug(`TableUI emitting: columnSort ${colInd} ${sortDirection}`);\n this.clearCellSelection();\n this.$emit(\"columnSort\", colInd, sortDirection);\n },\n onActionBarColumnSort(\n columnId: string | undefined,\n sortDirection: -1 | 0 | 1,\n ) {\n // The action bar's SortControl identifies columns by their stable id,\n // but the columnSort event is positional. Translate the id back to the\n // column's index before delegating to the shared handler.\n const colInd =\n columnId === undefined\n ? undefined\n : this.columns.findIndex((column) => column.id === columnId);\n this.onColumnSort(colInd, sortDirection);\n },\n onSelectAll(selected: boolean) {\n consola.debug(`TableUI emitting: selectAll ${selected}`);\n this.$emit(\"selectAll\", selected);\n },\n onDataValueView(\n cellInd: number,\n rowInd: number,\n anchor: VirtualElementAnchor,\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n this.toBeShownCell = null;\n this.$emit(\"dataValueView\", { indexInInput, isTop }, cellInd, anchor);\n },\n onRowSelect(selected: boolean, rowInd: number, groupInd: number) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n consola.debug(\n `TableUI emitting: rowSelect ${selected} ${indexInInput} ${groupInd} ${isTop}`,\n );\n this.$emit(\"rowSelect\", selected, indexInInput, groupInd, isTop);\n },\n onCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n const isTop = this.isTop(rowInd);\n this.selectCell(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n ignoreIfSelected || Boolean(this.columns[cellInd]?.editable),\n );\n this.stopEditingCell();\n },\n onCellSelectRowEvent(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n if (\n this.toBeEditedCell &&\n this.toBeEditedCell.x === cellInd &&\n this.toBeEditedCell.y === rowInd\n ) {\n // If the cell to be edited is clicked again, do not interrupt editing\n return;\n }\n const isEditable = Boolean(this.columns[cellInd]?.editable);\n if (isEditable && this.isSingleSelectedCell({ x: cellInd, y: rowInd })) {\n this.onStartEditingCell();\n } else {\n this.onCellSelect(cellInd, rowInd, groupInd, ignoreIfSelected);\n }\n },\n onExpandCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ) {\n const isTop = this.isTop(rowInd);\n this.expandCellSelection(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n );\n this.stopEditingCell();\n },\n focusBody() {\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n this.focusWithin = true;\n },\n onTableBodyFocusOut() {\n this.changeFocus(false);\n if (this.selectedCell) {\n if (this.columns[this.selectedCell.x]?.editable) {\n this.selectCell(this.selectedCell, this.currentRectId ?? 0, true);\n } else if (!this.tableState.dataValueViewIsShown) {\n this.clearCellSelection();\n }\n }\n },\n onHeaderCellSelect(columnIndex: number) {\n this.stopEditingCell();\n this.selectCell({ x: columnIndex, y: -1 }, 0, true);\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onHeaderCellDeselect() {\n if (this.selectedCell?.y === -1) {\n this.clearCellSelection();\n }\n },\n onMoveDownFromHeaderCell(columnIndex: number) {\n if (this.totalTableLength === 0) {\n if (this.showNewColumnAndRowButton) {\n this.clearCellSelection();\n this.focusNewRowButton();\n }\n return;\n }\n this.onCellSelect(columnIndex, 0, null);\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n tableCoreRef.virtualScrollToPosition({ top: 0 });\n },\n onUpdateNewColumnButtonWidth(width: number) {\n this.newColumnButtonWidth = width;\n },\n onKeyboardMoveSelectionVirtual(\n columnInd: number,\n rowInd: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n let adaptedRowInd = rowInd;\n if (rowInd === this.totalTableLength) {\n this.onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === this.placeholderRowRowIndex) {\n adaptedRowInd += verticalMove;\n }\n this[expandSelection ? \"onExpandCellSelect\" : \"onCellSelect\"](\n columnInd,\n adaptedRowInd,\n null,\n );\n },\n async onKeyboardMoveSelectionFromEditingCell(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n await this.onKeyboardMoveSelection(\n horizontalMove,\n verticalMove,\n expandSelection,\n );\n if (this.selectedCell) {\n this.focusBody();\n }\n this.stopEditingCell();\n },\n onMoveSelectionOutOfBodyUp({ columnInd }: { columnInd: number }) {\n if (!this.header?.isColumnHeaderFocusable(columnInd)) {\n return;\n }\n this.clearCellSelection();\n this.focusHeaderCell(columnInd);\n },\n focusNewRowButton() {\n (\n this.$refs[\"new-row-button\"] as InstanceType<typeof NewRowButton>\n )?.focus();\n },\n onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId,\n }: {\n columnInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.clearCellSelection();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n columnInd,\n rectId,\n };\n }\n },\n onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.getHeaderComponent().focusNewColumnButton();\n this.clearCellSelection();\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = { rowInd, rectId };\n }\n },\n onMoveIntoBodyFromRight() {\n const lastColumnInd = this.columns.length - 1;\n const lastRowAndRectId = this\n .lastRowAndRectIdBeforeMovingToNewColumnButton ?? {\n rowInd: -1,\n rectId: null,\n };\n if (lastRowAndRectId.rowInd === -1) {\n this.focusHeaderCell(lastColumnInd);\n } else {\n this.updateCellSelection(\n {\n minX: lastColumnInd,\n minY: lastRowAndRectId.rowInd,\n maxX: lastColumnInd,\n maxY: lastRowAndRectId.rowInd,\n },\n lastRowAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onMoveIntoBodyFromBottom() {\n const lastRowInd = this.totalTableLength - 1;\n const lastColumnAndRectId = this\n .lastColumnAndRectIdBeforeMovingToNewRowButton ?? {\n columnInd: 0,\n rectId: null,\n };\n if (\"virtualColumn\" in lastColumnAndRectId) {\n this.focusRowVirtualColumn(\n lastColumnAndRectId.virtualColumn,\n lastRowInd,\n lastColumnAndRectId.rectId,\n );\n } else {\n if (this.totalTableLength === 0) {\n this.focusHeaderCell(0);\n return;\n }\n this.updateCellSelection(\n {\n minX: lastColumnAndRectId.columnInd,\n minY: lastRowInd,\n maxX: lastColumnAndRectId.columnInd,\n maxY: lastRowInd,\n },\n lastColumnAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = null;\n },\n onMoveSelectionOutOfBodyLeft({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n this.clearCellSelection();\n } else if (this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n this.clearCellSelection();\n }\n },\n onMoveIntoBodyFromLeft(rowInd: number, groupInd: RectId | null) {\n this.updateCellSelection(\n {\n minX: 0,\n minY: rowInd,\n maxX: 0,\n maxY: rowInd,\n },\n groupInd,\n );\n this.focusBody();\n },\n focusRowVirtualColumn(\n type: \"delete\" | \"selection\",\n rowInd: number,\n _groupInd: RectId | null,\n ) {\n const refName = this.getRowRefName(null, rowInd);\n const rowComponent = this.$refs[refName] as InstanceType<typeof Row>;\n if (type === \"delete\") {\n rowComponent?.focusDeleteButton();\n } else {\n rowComponent?.focusSelectionCheckbox();\n }\n },\n onVirtualColumnNav(\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n rowInd: number,\n groupInd: null | number,\n ) {\n const rectId = groupInd ?? null;\n if (direction === \"right\") {\n if (type === \"delete\" && this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n } else if (this.columns.length > 0) {\n this.onMoveIntoBodyFromLeft(rowInd, rectId);\n }\n } else if (direction === \"left\") {\n if (type === \"selection\" && this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n }\n } else if (direction === \"up\") {\n if (rowInd > 0) {\n this.focusRowVirtualColumn(type, rowInd - 1, rectId);\n } else if (type === \"selection\") {\n this.getHeaderComponent().focusSelectionCheckbox();\n }\n } else if (direction === \"down\") {\n if (rowInd < this.totalTableLength - 1) {\n this.focusRowVirtualColumn(type, rowInd + 1, rectId);\n } else if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n virtualColumn: type,\n rectId,\n };\n }\n }\n },\n onHeaderSelectionKeydownDown() {\n this.focusRowVirtualColumn(\"selection\", 0, null);\n },\n async onKeyboardMoveSelection(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n if (!this.selectedCell) {\n return;\n }\n const columnInd = this.selectedCell.x + horizontalMove;\n const rowInd = this.selectedCell.y + verticalMove;\n if (columnInd === -1) {\n this.onMoveSelectionOutOfBodyLeft({\n rowInd: this.selectedCell!.y,\n rectId: this.currentRectId,\n });\n return;\n }\n if (columnInd === this.columns.length) {\n this.onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === -1) {\n this.onMoveSelectionOutOfBodyUp({ columnInd });\n return;\n }\n\n this.onKeyboardMoveSelectionVirtual(\n columnInd,\n rowInd,\n verticalMove,\n expandSelection,\n );\n\n await this.scrollToCellSelectionOverlay();\n\n this.toBeShownCell = this.tableState.dataValueViewIsShown\n ? this.selectedCell\n : null;\n },\n async expandSelectedCell() {\n if (this.selectedCell && this.tableConfig.enableDataValueViews) {\n // scroll current selection into view\n await this.onKeyboardMoveSelection(0, 0, true);\n this.toBeShownCell = this.selectedCell;\n }\n },\n\n onStartEditingCell(initialValue?: string) {\n if (this.selectedCell && this.columns[this.selectedCell.x]?.editable) {\n this.setToBeEditedCell(this.selectedCell, initialValue);\n }\n },\n onResizeRow(rowSizeDelta: number, scrollIndex: number) {\n this.currentRowSizeDelta = rowSizeDelta;\n this.currentResizedScrollIndex = scrollIndex;\n },\n onResizeAllRows(currentSize: number, row: HTMLElement, rowInd: number) {\n if (this.currentRowHeight === \"dynamic\") {\n return;\n }\n this.currentRowSizeDelta = 0;\n const previousScrollTop = this.tableCore?.getVirtualScrollStart();\n if (previousScrollTop === undefined) {\n return;\n }\n const heightAboveCurrentRow = rowInd * this.currentRowHeight;\n const offset = heightAboveCurrentRow - previousScrollTop;\n this.resizedRowHeight = currentSize;\n const scrollPosition = rowInd * this.currentRowHeight - offset;\n this.keepScrollerPositionOnRowResize(scrollPosition);\n },\n keepScrollerPositionOnRowResize(scrollPosition: number) {\n const resizeObserver = new ResizeObserver(() => {\n setTimeout(() => {\n // scroll was temporarily disabled to avoid sending scroll events during resize\n this.currentResizedScrollIndex = null;\n }, ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY);\n this.tableCore?.virtualScrollToPosition({ top: scrollPosition });\n resizeObserver.disconnect();\n });\n const virtualBody = this.tableCore?.getVirtualBody();\n if (virtualBody) {\n resizeObserver.observe(virtualBody);\n }\n },\n onRowInput(\n _event: any,\n rowInd: number,\n groupInd: number,\n row: { id: string },\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n const event = {\n ..._event,\n rowInd: indexInInput,\n id: row.id,\n groupInd,\n isTop,\n };\n consola.debug(`TableUI emitting: tableInput ${event}`);\n this.$emit(\"tableInput\", event);\n },\n onRowSubMenuClick(event: any, row: any) {\n consola.debug(`TableUI row submenu clicked ${event} ${row}`);\n if (event.callback) {\n event.callback(row, this);\n }\n },\n onColumnResize(columnIndex: number, newColumnSize: number) {\n this.$emit(\"columnResize\", columnIndex, newColumnSize);\n },\n onAllColumnsResize(newColumnSize: number) {\n this.$emit(\"allColumnsResize\", newColumnSize);\n },\n onColumnResizeStart() {\n this.columnResizeActive = true;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.columnResizeActive = false;\n this.$emit(\"columnResizeEnd\");\n },\n getCellContentSlotName(columns: ColumnConfig[], columnId: number) {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columns[columnId].key as unknown as string}`;\n },\n getHeaderComponent() {\n return this.$refs.header as InstanceType<typeof Header>;\n },\n getTableCoreComponent() {\n return this.$refs.tableCore as InstanceType<typeof TableCore>;\n },\n getSelectionOverlayComponent() {\n return this.$refs.selectionOverlay as InstanceType<\n typeof CellSelectionOverlay\n >;\n },\n focusHeaderCell(cellInd: number) {\n this.getHeaderComponent().focusHeaderCell(cellInd);\n },\n refocusSelection() {\n if (this.selectedHeaderIndex === null) {\n this.focusBody();\n } else {\n this.focusHeaderCell(this.selectedHeaderIndex);\n }\n },\n getRowComponents() {\n const rowComponents: any[] = [];\n this.data.forEach((group: any) => {\n group.forEach((_: any, rowIndex: number) =>\n rowComponents.push(this.$refs[this.getRowRefName(null, rowIndex)]),\n );\n });\n return rowComponents;\n },\n getRowData(row: Record<string, unknown> | Array<unknown>) {\n const isEmptyArray = Array.isArray(row) && row.length === 0;\n return isEmptyArray\n ? row\n : this.columns.map(\n (column) =>\n (row as Record<string, unknown>)[column.key as unknown as string],\n );\n },\n getRowRefName(groupInd: null | number, rowInd: number) {\n if (groupInd === null) {\n return `row-${rowInd}`;\n }\n return `group-${groupInd}-row-${rowInd}`;\n },\n getCellIndex(cell: CellPosition | null | undefined, rowInd: number) {\n if (cell && cell.y === rowInd) {\n return cell.x;\n }\n return null;\n },\n getCellSelectionRange(rowInd: number) {\n const rect = this.rectMinMax;\n if (!rect || rowInd < rect.y.min || rowInd > rect.y.max) {\n return null;\n }\n return { min: rect.x.min, max: rect.x.max };\n },\n onNewRowButtonClick(event: MouseEvent) {\n event.stopPropagation();\n const lastCellOrLastVirtualCell =\n this.lastColumnAndRectIdBeforeMovingToNewRowButton;\n const lastCellWasVirtualColumn =\n lastCellOrLastVirtualCell &&\n \"virtualColumn\" in lastCellOrLastVirtualCell;\n const lastCell = lastCellWasVirtualColumn\n ? null\n : lastCellOrLastVirtualCell;\n\n this.$emit(\"newRowButtonClick\", lastCell);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n event.stopPropagation();\n this.$emit(\"newColumnButtonClick\");\n },\n },\n};\n</script>\n\n<template>\n <div\n class=\"wrapper\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n >\n <TableActionBar\n v-if=\"showActionBar\"\n :table-sizes=\"tableState.tableSizes\"\n :action-state\n :row-label=\"tableConfig.rowLabel\"\n :show-table-size=\"tableConfig.showTableSize\"\n :action-config=\"actionConfig ?? {}\"\n :col-sort-values\n :sort-control-options\n @reset-temporary-view=\"$emit('resetTemporaryView')\"\n @on-column-sort=\"onActionBarColumnSort\"\n @update:search-term=\"$emit('update:searchTerm', $event)\"\n >\n <template v-if=\"$slots['action-bar-left']\" #action-bar-left>\n <slot name=\"action-bar-left\" />\n </template>\n </TableActionBar>\n <table\n ref=\"wrapper\"\n :tabindex=\"-1\"\n @pointerleave=\"selectCellsOnMove.setFalse\"\n @pointerdown.passive.stop=\"\n $event.button === 0 && selectCellsOnMove.setTrue()\n \"\n @pointerup.passive=\"$event.button === 0 && selectCellsOnMove.setFalse()\"\n @keydown.alt.exact=\"handleCopyOnKeydown\"\n @keydown.delete.exact=\"handleDeleteSelection\"\n @keydown.escape.exact=\"clearCellSelectionAndStopPropagation\"\n >\n <TableCore\n ref=\"tableCore\"\n :scroll-data=\"scrollData\"\n :total-width=\"totalWidth\"\n :column-resize=\"{ active: columnResizeActive }\"\n :table-config\n :sub-menu-config\n :scroll-config=\"{\n itemSize: scrollerItemSize,\n numRowsAbove,\n numRowsBelow,\n compact: Boolean(rowConfig.compactMode),\n }\"\n :current-row-height=\"currentRowHeight\"\n :new-column-button-width\n @scroller-update=\"onScroll\"\n @update:available-width=\"onUpdateAvailableWidth\"\n @move-selection=\"onKeyboardMoveSelection\"\n @clear-selection=\"clearCellSelection\"\n @expand-selected-cell=\"expandSelectedCell\"\n @start-editing=\"onStartEditingCell\"\n @body-focusin=\"changeFocus(true)\"\n @body-focusout=\"onTableBodyFocusOut()\"\n >\n <template #row=\"{ row, groupInd, rowInd }\">\n <Row\n :ref=\"getRowRefName(groupInd, rowInd)\"\n :row-data=\"row\"\n :row=\"getRowData(row)\"\n :table-config\n :sub-menu-config\n :show-drag-handle=\"tableConfig.enableRowResizing\"\n :columns\n :row-config=\"rowConfig\"\n :row-height=\"currentRowHeight\"\n :min-row-height=\"minRowHeight\"\n :is-selected=\"currentSelectionMap(rowInd, groupInd || 0)\"\n :select-cells-on-move=\"selectCellsOnMove.state\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n :selected-cell-index=\"getCellIndex(selectedCell, rowInd)\"\n :cell-selection-range=\"getCellSelectionRange(rowInd)\"\n :to-be-expanded-cell-index=\"getCellIndex(toBeShownCell, rowInd)\"\n :to-be-edited-cell-index=\"getCellIndex(editingCell, rowInd)\"\n :new-column-button-width\n @delete-row=\"() => onDeleteRow(rowInd)\"\n @row-select=\"onRowSelect($event, rowInd, groupInd || 0)\"\n @cell-select=\"\n (cellInd, ignoreIfSelected) =>\n onCellSelectRowEvent(\n cellInd,\n rowInd,\n groupInd,\n ignoreIfSelected,\n )\n \"\n @data-value-view=\"\n (cellInd, anchor) => onDataValueView(cellInd, rowInd, anchor)\n \"\n @expand-cell-select=\"\n (cellInd) => onExpandCellSelect(cellInd, rowInd, groupInd)\n \"\n @row-input=\"\n (event) => onRowInput(event, rowInd, groupInd ?? 0, row)\n \"\n @row-sub-menu-click=\"onRowSubMenuClick($event, row)\"\n @resize-all-rows=\"\n (currentSize, row) => onResizeAllRows(currentSize, row, rowInd)\n \"\n @resize-row=\"(rowSizeDelta) => onResizeRow(rowSizeDelta, rowInd)\"\n @virtual-column-nav=\"\n (type, direction) =>\n onVirtualColumnNav(type, direction, rowInd, groupInd)\n \"\n >\n <!-- Vue requires named slots on \"custom\" elements (i.e. template). -->\n <!-- eslint-disable vue/valid-v-slot -->\n <template\n v-for=\"colInd in slottedColumns\"\n #[getCellContentSlotName(columns,colInd)]=\"cellData\"\n :key=\"rowInd + '_' + colInd\"\n >\n <!-- \n TODO: UIEXT-1753:\n not yet working properly with empty and bottom rows, \n since rowInd is the actual scroll index and not the input in the input data\n in this case\n -->\n <slot\n :name=\"`cellContent-${columns[colInd].key as unknown as string}`\"\n :data=\"{\n ...cellData,\n key: columns[colInd].key,\n rowInd,\n colInd,\n }\"\n />\n </template>\n <template #editable-cell=\"{ ind, cellElement }\">\n <slot\n name=\"editable-cell\"\n :row-ind=\"rowInd\"\n :col-ind=\"ind\"\n :initial-value=\"editingCellInitialValue\"\n :cell-element=\"cellElement\"\n @keydown=\"\n (event: KeyboardEvent) =>\n createEditingCellKeydownHandler({\n moveSelection: onKeyboardMoveSelectionFromEditingCell,\n })(event)\n \"\n @click-away=\"stopEditingCell\"\n />\n </template>\n </Row>\n </template>\n <template #header=\"{ getDragHandleHeight }\">\n <Header\n ref=\"header\"\n :style=\"{ width: `var(${BODY_WIDTH_CSS_VAR})` }\"\n :table-config\n :action-config\n :columns\n :additional-header-menu-items\n :col-sort-values\n :is-selected=\"Boolean(tableState.totalSelected)\"\n :get-drag-handle-height=\"getDragHandleHeight\"\n :class=\"[\n 'table-header',\n {\n 'sub-menu-active': subMenuConfig.subMenuItems?.length,\n },\n ]\"\n :show-new-column-button=\"showNewColumnAndRowButton\"\n :selected-header-index=\"selectedHeaderIndex\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n @header-select=\"onSelectAll\"\n @column-sort=\"onColumnSort\"\n @delete-column=\"onDeleteColumn\"\n @column-resize=\"onColumnResize\"\n @all-columns-resize=\"onAllColumnsResize\"\n @column-resize-start=\"onColumnResizeStart\"\n @column-resize-end=\"onColumnResizeEnd\"\n @move-down-from-header-cell=\"onMoveDownFromHeaderCell\"\n @header-cell-select=\"onHeaderCellSelect\"\n @header-cell-deselect=\"onHeaderCellDeselect\"\n @header-cell-start-editing=\"\n (columnIndex: number, initialValue?: string) =>\n $emit('headerCellStartEditing', columnIndex, initialValue)\n \"\n @update:new-column-button-width=\"onUpdateNewColumnButtonWidth\"\n @new-column-button-click=\"onNewColumnButtonClick\"\n @selection-keydown-down=\"onHeaderSelectionKeydownDown()\"\n @new-column-button-keydown-left=\"onMoveIntoBodyFromRight()\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" />\n </template>\n </Header>\n </template>\n <template #cell-selection-overlay>\n <CellSelectionOverlay\n v-if=\"rectMinMax && !isEditingCell && selectedHeaderIndex === null\"\n ref=\"selectionOverlay\"\n :rect=\"rectMinMax\"\n :row-height=\"scrollerItemSize\"\n :table-config=\"tableConfig\"\n :row-resize-index=\"currentResizedScrollIndex\"\n :row-resize-delta=\"currentRowSizeDelta\"\n :cell-selection-rect-focus-corner=\"\n focusWithin ? selectedCell : undefined\n \"\n />\n </template>\n <template #belowBody>\n <NewRowButton\n v-if=\"showNewColumnAndRowButton\"\n ref=\"new-row-button\"\n @click=\"onNewRowButtonClick\"\n @pointerdown.stop\n @keydown-up=\"onMoveIntoBodyFromBottom\"\n />\n </template>\n <template v-if=\"emptyState\" #empty-state>\n <KdsEmptyState class=\"empty-state\" v-bind=\"emptyState\" />\n </template>\n </TableCore>\n <KdsPagination\n v-if=\"pageConfig && pageState\"\n class=\"pagination\"\n :current-page=\"pageState.currentPage\"\n :page-size=\"pageConfig.pageSize\"\n :possible-page-sizes=\"pageConfig.possiblePageSizes\"\n :total-rows=\"tableState.tableSizes?.currentNumRows ?? 0\"\n :show-table-size=\"tableConfig.showTableSize\"\n :row-label=\"tableConfig.rowLabel\"\n @update:current-page=\"onPageChange\"\n @update:page-size=\"onPageSizeUpdate\"\n />\n </table>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n @media screen {\n /* height 100% does not mix well with flex-box on print (https://issues.chromium.org/issues/365922171) */\n height: 100%;\n }\n}\n\ntable {\n position: relative;\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n\n &:focus {\n outline: none;\n }\n\n & .new-row-footer {\n width: 100%;\n }\n\n /* The table inherits its parent's background; the pagination footer is the\n one place Figma sets a surface token for (SLEEK-297). KdsPagination stays\n transparent so it can sit on any surface. */\n & .pagination {\n background: var(--kds-color-surface-default);\n }\n}\n\n/* The empty state is placed into the rows' area by TableCoreVirtual. */\n.empty-state {\n max-width: 100%;\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport {\n type PropType,\n type Ref,\n computed,\n nextTick,\n ref,\n toRef,\n watch,\n watchEffect,\n} from \"vue\";\n\nimport {\n KdsEmptyState,\n type KdsEmptyStateProps,\n type KdsMenuItem,\n KdsPagination,\n} from \"@knime/kds-components\";\n\nimport { columnSortText } from \"../config/table.config\";\nimport {\n COMPACT_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY,\n SPECIAL_COLUMNS_SIZE,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { VirtualElementAnchor } from \"../types/DataValueView\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\n\nimport TableCore from \"./TableCore.vue\";\nimport { useTotalWidth } from \"./composables/useAvailableWidth\";\nimport { BODY_WIDTH_CSS_VAR } from \"./composables/useBodyWidth\";\nimport { useBoolean } from \"./composables/useBoolean\";\nimport { useCellCopyPaste } from \"./composables/useCellCopyPaste\";\nimport {\n type CellPosition,\n type Rect,\n type RectId,\n useCellSelection,\n} from \"./composables/useCellSelection\";\nimport { provideDataValueViewsIsShown } from \"./composables/useDataValueViews\";\nimport { createEditingCellKeydownHandler } from \"./composables/useEditCellKeydown\";\nimport { useVisibleAfterAvailableWidth } from \"./composables/useVisibleAfterAvailableWidth\";\nimport TableActionBar from \"./control/TableActionBar.vue\";\nimport Header from \"./layout/Header.vue\";\nimport NewRowButton from \"./layout/NewRowButton.vue\";\nimport Row from \"./layout/Row.vue\";\nimport CellSelectionOverlay from \"./ui/CellSelectionOverlay.vue\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport type DataItem =\n | {\n data: any;\n dots?: false;\n }\n | {\n dots: true;\n };\n\n/**\n * @see README.md\n */\nexport default {\n components: {\n KdsPagination,\n Header,\n Row,\n // TablePopover,\n CellSelectionOverlay,\n TableCore,\n NewRowButton,\n TableActionBar,\n KdsEmptyState,\n },\n props: {\n /**\n * Data props.\n */\n data: {\n type: Array as PropType<Array<Array<any>>>,\n required: true,\n },\n /**\n * It specifies how many (empty) rows should be simultated above the given rows in this.data[0]\n */\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n /**\n * It specifies how many (empty) rows should be simultated below the given rows in this.data[0]\n */\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n /**\n * Data displayed when scrolling to the bottom of the table. Currently only supproted together\n * with virtual scrolling enabled.\n */\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /**\n * analogous to currentSelection but for the bottomData\n */\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n /** Stable per-column definitions. */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n required: true,\n },\n /** Additional per-column header menu items (index-aligned with columns), appended after sort items. */\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n /** Active sorts, ordered by sort priority. */\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n /** Feature switches for the table. */\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n /** Runtime totals and flags for the table. */\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n /** Pagination config; its presence enables pagination. */\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n /** Runtime pagination state. */\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n /** Action-bar config; its presence enables the action bar. */\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n /** Runtime state of the action bar. */\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n required: false,\n },\n /** Per-row and per-group submenu config. */\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** Appearance of the table's rows. */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n disableRowHeightTransition: {\n type: Boolean,\n default: false,\n },\n emptyState: {\n type: Object as PropType<KdsEmptyStateProps>,\n default: undefined,\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n resizeActive: (isActive: boolean) => true,\n columnUpdate: (newColumnList: string[]) => true,\n columnReorder: (colInd: number, newColInd: number) => true,\n pageChange: (newPageNumber: number) => true,\n pageSizeUpdate: (newPageSize: number) => true,\n columnSort: (colInd: number | undefined, sortDirection: -1 | 0 | 1) => true,\n selectAll: (selected: boolean) => true,\n rowSelect: (\n selected: boolean,\n rowInd: number,\n groupInd: number,\n isTop: boolean,\n ) => true,\n tableInput: (event: any) => true,\n columnResize: (columnIndex: number, newColumnSize: number) => true,\n lazyload: (lazyloadParams: {\n direction: 1 | -1;\n startIndex: number;\n endIndex: number;\n }) => true,\n allColumnsResize: (newColumnSize: number) => true,\n columnResizeStart: () => true,\n columnResizeEnd: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n \"update:searchTerm\": (newSearchTerm: string /** Might be empty */) => true,\n rowHeightUpdate: (newRowHeight: number | null | \"dynamic\") => true,\n copySelection: (copySelectionParams: {\n rect: Rect;\n id: RectId | null;\n withHeaders: boolean;\n }) => true,\n pasteSelection: (pasteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n updateSelection: (newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n }) => void;\n }) => true,\n cutSelection: (cutSelectionParams: { rect: Rect; id: RectId | null }) =>\n true,\n deleteSelection: (deleteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n }) => true,\n cellSelectionChange: (cellPosition: CellPosition | null) => true,\n dataValueView: (\n row: { indexInInput: number; isTop: boolean },\n columnIndex: number,\n rect: VirtualElementAnchor,\n ) => true,\n closeDataValueView: () => true,\n newColumnButtonClick: () => true,\n newRowButtonClick: (\n lastPosition: {\n columnInd: number;\n rectId: number | null;\n } | null,\n ) => true,\n headerCellStartEditing: (columnIndex: number, initialValue?: string) =>\n true,\n deleteColumn: (colInd: number) => true,\n deleteRow: (rowInd: number) => true,\n resetTemporaryView: () => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(props, { emit }) {\n const wrapper: Ref<any> = ref(null);\n const tableCore: Ref<InstanceType<typeof TableCore> | null> = ref(null);\n const header: Ref<InstanceType<typeof Header> | null> = ref(null);\n const selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n > = ref([]);\n const totalWidth = useTotalWidth(wrapper);\n const { isVisible: tableIsVisible, onAvailableWidthReported } =\n useVisibleAfterAvailableWidth();\n const onUpdateAvailableWidth = (newAvailableWidth: number) => {\n emit(\"update:available-width\", newAvailableWidth);\n onAvailableWidthReported();\n };\n const enableCellSelection = computed(() =>\n Boolean(props.tableConfig.enableCellSelection),\n );\n // cell selection\n const {\n selectCell,\n expandCellSelection,\n clearCellSelection,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n } = useCellSelection(enableCellSelection);\n\n watch(selectedCell, (newCell) =>\n emit(\"cellSelectionChange\", newCell ?? null),\n );\n\n const selectCellsOnMove = useBoolean(false);\n // cell copying\n const emitCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (rectMinMax.value) {\n emit(\"copySelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n withHeaders,\n });\n }\n };\n\n const scrollToCellSelectionOverlay = async () => {\n const tableCoreRef = tableCore.value;\n if (tableCoreRef === null) {\n return;\n }\n const scrollToViewParams = {\n containerBCR:\n tableCoreRef.getVirtualContainer()?.getBoundingClientRect() || null,\n headerHeight: header.value?.$el.clientHeight || 0,\n scrollTo: (position: { left?: number; top?: number }) =>\n tableCoreRef.virtualScrollToPosition(position),\n };\n\n if (Array.isArray(selectionOverlay.value)) {\n await selectionOverlay.value[0]?.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n } else if (selectionOverlay.value) {\n await selectionOverlay.value.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n }\n };\n\n const updateCellSelection = (\n newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n },\n newRectId: RectId | null = null,\n ) => {\n const rectId = newRectId ?? currentRectId.value ?? 0;\n selectCell({ x: newRect.maxX, y: newRect.maxY }, rectId, true);\n if (newRect.minX !== newRect.maxX || newRect.minY !== newRect.maxY) {\n expandCellSelection({ x: newRect.minX, y: newRect.minY }, rectId);\n }\n tableCore.value?.getVirtualBody()?.focus({ preventScroll: true });\n nextTick().then(scrollToCellSelectionOverlay);\n };\n\n const emitPasteSelection = () => {\n if (rectMinMax.value) {\n emit(\"pasteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n updateSelection: updateCellSelection,\n });\n }\n };\n const emitCutSelection = () => {\n if (rectMinMax.value) {\n emit(\"cutSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n const emitDeleteSelection = () => {\n if (rectMinMax.value) {\n emit(\"deleteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n\n const focusWithin = ref(false);\n const changeFocus = (newFocus: boolean) => {\n focusWithin.value = newFocus;\n };\n\n const toBeEditedCell = ref<null | CellPosition>(null);\n const editingCellInitialValue = ref<null | string>(null);\n const editingCell = computed(() =>\n selectCellsOnMove.state ? null : toBeEditedCell.value,\n );\n const isEditingCell = computed(() => editingCell.value !== null);\n\n const setToBeEditedCell = (\n cellPosition: CellPosition | null,\n initialValue?: string,\n ) => {\n toBeEditedCell.value = cellPosition;\n editingCellInitialValue.value = initialValue ?? null;\n };\n const isEditingEnabled = computed(() =>\n getPropertiesFromColumns(props.columns, \"editable\").some(Boolean),\n );\n const { handleCopyOnKeydown, handleDeleteSelection } = useCellCopyPaste({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy: emitCopySelection,\n onPaste: emitPasteSelection,\n onCut: emitCutSelection,\n onDelete: emitDeleteSelection,\n });\n\n const stopEditingCell = (rowInd?: number, colInd?: number) => {\n const toBeEditedCellValue = toBeEditedCell.value;\n if (\n rowInd !== undefined &&\n colInd !== undefined &&\n toBeEditedCellValue &&\n (toBeEditedCellValue.x !== colInd || toBeEditedCellValue.y !== rowInd)\n ) {\n return;\n }\n setToBeEditedCell(null);\n };\n\n const toBeShownCell = ref<null | CellPosition>(null);\n\n const closeDataValueView = () => {\n if (props.tableState.dataValueViewIsShown) {\n emit(\"closeDataValueView\");\n }\n toBeShownCell.value = null;\n };\n\n provideDataValueViewsIsShown(\n toRef(props, \"tableState\"),\n closeDataValueView,\n );\n\n const { columnResizeActive } = injectColumnSizes();\n watchEffect(() => emit(\"resizeActive\", columnResizeActive.value));\n\n const showNewColumnAndRowButton = computed(() =>\n Boolean(props.tableConfig.showNewColumnAndRowButton),\n );\n const newColumnButtonWidth = ref(0);\n\n return {\n wrapper,\n totalWidth,\n tableIsVisible,\n onUpdateAvailableWidth,\n tableCore,\n header,\n selectionOverlay,\n scrollToCellSelectionOverlay,\n selectCellsOnMove,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n selectCell,\n expandCellSelection,\n clearCellSelection: () => {\n clearCellSelection();\n closeDataValueView();\n },\n clearCellSelectionAndStopPropagation: (event: Event) => {\n if (rectMinMax.value === null) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n clearCellSelection();\n },\n setToBeEditedCell,\n editingCellInitialValue,\n stopEditingCell,\n updateCellSelection,\n changeFocus,\n focusWithin,\n handleCopyOnKeydown,\n handleDeleteSelection,\n toBeShownCell,\n toBeEditedCell,\n editingCell,\n isEditingCell,\n createEditingCellKeydownHandler,\n columnResizeActive,\n showNewColumnAndRowButton,\n newColumnButtonWidth,\n BODY_WIDTH_CSS_VAR,\n };\n },\n data() {\n return {\n popoverColumn: null as null | string | number | symbol,\n lastScrollIndex: 0,\n newVal: null,\n resizeCount: 0,\n updatedBefore: false,\n wrapperWidth: 0,\n closeExpandedSubMenu: () => {},\n scrollerId: \"scroller\",\n resizedRowHeight: null as null | number,\n currentResizedScrollIndex: null as null | number,\n currentRowSizeDelta: null as null | number,\n SPECIAL_COLUMNS_SIZE,\n lastRowAndRectIdBeforeMovingToNewColumnButton: null as null | {\n rowInd: number;\n rectId: RectId | null;\n },\n lastColumnAndRectIdBeforeMovingToNewRowButton: null as\n | null\n | {\n columnInd: number;\n rectId: RectId | null;\n }\n | {\n virtualColumn: \"delete\" | \"selection\";\n rectId: RectId | null;\n },\n };\n },\n computed: {\n showActionBar() {\n const viewType = this.actionState?.viewType;\n // A temporary view is highlighted via the action bar, so the bar must\n // render even when no action bar feature is enabled via actionConfig\n return (\n Boolean(this.actionConfig) ||\n viewType === \"TEMP_VIEW\" ||\n viewType === \"PREVIEW\"\n );\n },\n minRowHeight() {\n return this.rowConfig.compactMode\n ? COMPACT_ROW_HEIGHT\n : DEFAULT_ROW_HEIGHT;\n },\n initialRowHeight() {\n return this.rowConfig?.rowHeight || this.minRowHeight;\n },\n currentRowHeight() {\n return this.resizedRowHeight ?? this.initialRowHeight;\n },\n selectedHeaderIndex(): number | null {\n return this.selectedCell?.y === -1 ? this.selectedCell.x : null;\n },\n slottedColumns() {\n return getPropertiesFromColumns(this.columns, \"hasSlotContent\")\n .map((hasSlotContent: any, colInd: any) =>\n hasSlotContent ? colInd : null,\n )\n .filter((colInd: any) => colInd !== null);\n },\n topDataLength() {\n if (this.data === null || this.data.length === 0) {\n return 0;\n }\n return this.data[0].length;\n },\n totalTableLength() {\n return this.scrollData[0].length + this.numRowsAbove;\n },\n numPlaceholderRows() {\n return this.topDataLength ? 1 : 0;\n },\n placeholderRowRowIndex() {\n return this.data[0].length + this.numRowsAbove;\n },\n scrollData() {\n if (this.data === null || this.data.length === 0) {\n return [[]];\n }\n const dataItems: DataItem[][] = this.data?.map((groupData) =>\n groupData.map((data) => ({ data })),\n );\n if (this.bottomData.length > 0) {\n if (this.numPlaceholderRows) {\n dataItems[0].push({ dots: true });\n }\n dataItems[0].push(...this.bottomData.map((data) => ({ data })));\n }\n return dataItems;\n },\n currentSelectionMap() {\n if (!this.tableConfig.showSelection) {\n return () => false;\n }\n return (rowInd: number, groupInd: number) => {\n const { isTop, indexInInput } = this.resolveRowIndex(rowInd);\n return isTop\n ? this.currentSelection[groupInd][indexInInput]\n : this.currentBottomSelection[indexInInput];\n };\n },\n scrollerItemSize() {\n if (this.currentRowHeight === \"dynamic\") {\n return this.minRowHeight;\n }\n return this.currentRowHeight;\n },\n sortControlOptions() {\n const selectableColumns: { id: string; text: string }[] = [];\n const selectableDirections: Record<\n string,\n { id: string; text: string }[]\n > = {};\n this.columns.forEach((column) => {\n if (column.isNotSortable) {\n return;\n }\n selectableColumns.push({\n id: column.id as string,\n text: column.header,\n });\n const sortTexts = columnSortText[column.type ?? \"default\"];\n selectableDirections[column.id as string] = [\n { id: \"1\", text: sortTexts.ascending },\n { id: \"-1\", text: sortTexts.descending },\n ];\n });\n return { selectableColumns, selectableDirections };\n },\n },\n watch: {\n \"rowConfig.compactMode\": {\n handler() {\n this.resetRowHeight();\n },\n },\n \"rowConfig.rowHeight\": {\n handler() {\n this.resetRowHeight();\n },\n },\n currentRowHeight(newRowHeight) {\n this.$emit(\"rowHeightUpdate\", newRowHeight);\n },\n },\n methods: {\n // Utilities\n refreshScroller() {\n this.tableCore?.virtualScrollToPosition({ top: 0 });\n },\n resetRowHeight() {\n this.resizedRowHeight = null;\n },\n isTop(index: number) {\n return index < this.topDataLength + this.numRowsAbove;\n },\n resolveRowIndex(index: number) {\n if (index < this.numRowsAbove) {\n throw new Error(`Accessing invalid row index: ${index}`);\n }\n if (this.isTop(index)) {\n return {\n isTop: true,\n indexInInput: index - this.numRowsAbove,\n };\n }\n return {\n isTop: false,\n indexInInput:\n index -\n this.numRowsAbove -\n this.numPlaceholderRows -\n this.topDataLength,\n };\n },\n // Event handling\n onScroll(startIndex: number, endIndex: number) {\n if (\n this.lastScrollIndex === endIndex ||\n this.currentResizedScrollIndex !== null\n ) {\n return;\n }\n const direction: 1 | -1 = this.lastScrollIndex < endIndex ? 1 : -1;\n this.lastScrollIndex = endIndex;\n this.$emit(\"lazyload\", { direction, startIndex, endIndex });\n },\n onColumnUpdate(newColumnList: any) {\n consola.debug(`TableUI emitting: columnUpdate ${newColumnList}`);\n this.clearCellSelection();\n this.$emit(\"columnUpdate\", newColumnList);\n },\n onColumnReorder(colInd: number, newColInd: number) {\n consola.debug(`TableUI emitting: columnReorder ${colInd} ${newColInd}`);\n this.clearCellSelection();\n this.$emit(\"columnReorder\", colInd, newColInd);\n },\n onPageChange(newPageNumber: number) {\n consola.debug(`TableUI emitting: pageChange ${newPageNumber}`);\n this.clearCellSelection();\n this.$emit(\"pageChange\", newPageNumber);\n },\n onPageSizeUpdate(newPageSize: number) {\n consola.debug(`TableUI emitting: pageSizeUpdate ${newPageSize}`);\n this.clearCellSelection();\n this.$emit(\"pageSizeUpdate\", newPageSize);\n },\n clearAllCellInteractions() {\n this.clearCellSelection();\n this.stopEditingCell();\n },\n onDeleteColumn(colInd: number) {\n this.clearAllCellInteractions();\n this.$emit(\"deleteColumn\", colInd);\n },\n onDeleteRow(rowInd: number) {\n this.clearAllCellInteractions();\n const { indexInInput } = this.resolveRowIndex(rowInd);\n this.$emit(\"deleteRow\", indexInInput);\n },\n onColumnSort(colInd: number | undefined, sortDirection: -1 | 0 | 1) {\n consola.debug(`TableUI emitting: columnSort ${colInd} ${sortDirection}`);\n this.clearCellSelection();\n this.$emit(\"columnSort\", colInd, sortDirection);\n },\n onActionBarColumnSort(\n columnId: string | undefined,\n sortDirection: -1 | 0 | 1,\n ) {\n // The action bar's SortControl identifies columns by their stable id,\n // but the columnSort event is positional. Translate the id back to the\n // column's index before delegating to the shared handler.\n const colInd =\n columnId === undefined\n ? undefined\n : this.columns.findIndex((column) => column.id === columnId);\n this.onColumnSort(colInd, sortDirection);\n },\n onSelectAll(selected: boolean) {\n consola.debug(`TableUI emitting: selectAll ${selected}`);\n this.$emit(\"selectAll\", selected);\n },\n onDataValueView(\n cellInd: number,\n rowInd: number,\n anchor: VirtualElementAnchor,\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n this.toBeShownCell = null;\n this.$emit(\"dataValueView\", { indexInInput, isTop }, cellInd, anchor);\n },\n onRowSelect(selected: boolean, rowInd: number, groupInd: number) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n consola.debug(\n `TableUI emitting: rowSelect ${selected} ${indexInInput} ${groupInd} ${isTop}`,\n );\n this.$emit(\"rowSelect\", selected, indexInInput, groupInd, isTop);\n },\n onCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n const isTop = this.isTop(rowInd);\n this.selectCell(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n ignoreIfSelected || Boolean(this.columns[cellInd]?.editable),\n );\n this.stopEditingCell();\n },\n onCellSelectRowEvent(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n if (\n this.toBeEditedCell &&\n this.toBeEditedCell.x === cellInd &&\n this.toBeEditedCell.y === rowInd\n ) {\n // If the cell to be edited is clicked again, do not interrupt editing\n return;\n }\n const isEditable = Boolean(this.columns[cellInd]?.editable);\n if (isEditable && this.isSingleSelectedCell({ x: cellInd, y: rowInd })) {\n this.onStartEditingCell();\n } else {\n this.onCellSelect(cellInd, rowInd, groupInd, ignoreIfSelected);\n }\n },\n onExpandCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ) {\n const isTop = this.isTop(rowInd);\n this.expandCellSelection(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n );\n this.stopEditingCell();\n },\n focusBody() {\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n this.focusWithin = true;\n },\n onTableBodyFocusOut() {\n this.changeFocus(false);\n if (this.selectedCell) {\n if (this.columns[this.selectedCell.x]?.editable) {\n this.selectCell(this.selectedCell, this.currentRectId ?? 0, true);\n } else if (!this.tableState.dataValueViewIsShown) {\n this.clearCellSelection();\n }\n }\n },\n onHeaderCellSelect(columnIndex: number) {\n this.stopEditingCell();\n this.selectCell({ x: columnIndex, y: -1 }, 0, true);\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onHeaderCellDeselect() {\n if (this.selectedCell?.y === -1) {\n this.clearCellSelection();\n }\n },\n onMoveDownFromHeaderCell(columnIndex: number) {\n if (this.totalTableLength === 0) {\n if (this.showNewColumnAndRowButton) {\n this.clearCellSelection();\n this.focusNewRowButton();\n }\n return;\n }\n this.onCellSelect(columnIndex, 0, null);\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n tableCoreRef.virtualScrollToPosition({ top: 0 });\n },\n onUpdateNewColumnButtonWidth(width: number) {\n this.newColumnButtonWidth = width;\n },\n onKeyboardMoveSelectionVirtual(\n columnInd: number,\n rowInd: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n let adaptedRowInd = rowInd;\n if (rowInd === this.totalTableLength) {\n this.onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === this.placeholderRowRowIndex) {\n adaptedRowInd += verticalMove;\n }\n this[expandSelection ? \"onExpandCellSelect\" : \"onCellSelect\"](\n columnInd,\n adaptedRowInd,\n null,\n );\n },\n async onKeyboardMoveSelectionFromEditingCell(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n await this.onKeyboardMoveSelection(\n horizontalMove,\n verticalMove,\n expandSelection,\n );\n if (this.selectedCell) {\n this.focusBody();\n }\n this.stopEditingCell();\n },\n onMoveSelectionOutOfBodyUp({ columnInd }: { columnInd: number }) {\n if (!this.header?.isColumnHeaderFocusable(columnInd)) {\n return;\n }\n this.clearCellSelection();\n this.focusHeaderCell(columnInd);\n },\n focusNewRowButton() {\n (\n this.$refs[\"new-row-button\"] as InstanceType<typeof NewRowButton>\n )?.focus();\n },\n onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId,\n }: {\n columnInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.clearCellSelection();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n columnInd,\n rectId,\n };\n }\n },\n onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.getHeaderComponent().focusNewColumnButton();\n this.clearCellSelection();\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = { rowInd, rectId };\n }\n },\n onMoveIntoBodyFromRight() {\n const lastColumnInd = this.columns.length - 1;\n const lastRowAndRectId = this\n .lastRowAndRectIdBeforeMovingToNewColumnButton ?? {\n rowInd: -1,\n rectId: null,\n };\n if (lastRowAndRectId.rowInd === -1) {\n this.focusHeaderCell(lastColumnInd);\n } else {\n this.updateCellSelection(\n {\n minX: lastColumnInd,\n minY: lastRowAndRectId.rowInd,\n maxX: lastColumnInd,\n maxY: lastRowAndRectId.rowInd,\n },\n lastRowAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onMoveIntoBodyFromBottom() {\n const lastRowInd = this.totalTableLength - 1;\n const lastColumnAndRectId = this\n .lastColumnAndRectIdBeforeMovingToNewRowButton ?? {\n columnInd: 0,\n rectId: null,\n };\n if (\"virtualColumn\" in lastColumnAndRectId) {\n this.focusRowVirtualColumn(\n lastColumnAndRectId.virtualColumn,\n lastRowInd,\n lastColumnAndRectId.rectId,\n );\n } else {\n if (this.totalTableLength === 0) {\n this.focusHeaderCell(0);\n return;\n }\n this.updateCellSelection(\n {\n minX: lastColumnAndRectId.columnInd,\n minY: lastRowInd,\n maxX: lastColumnAndRectId.columnInd,\n maxY: lastRowInd,\n },\n lastColumnAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = null;\n },\n onMoveSelectionOutOfBodyLeft({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n this.clearCellSelection();\n } else if (this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n this.clearCellSelection();\n }\n },\n onMoveIntoBodyFromLeft(rowInd: number, groupInd: RectId | null) {\n this.updateCellSelection(\n {\n minX: 0,\n minY: rowInd,\n maxX: 0,\n maxY: rowInd,\n },\n groupInd,\n );\n this.focusBody();\n },\n focusRowVirtualColumn(\n type: \"delete\" | \"selection\",\n rowInd: number,\n _groupInd: RectId | null,\n ) {\n const refName = this.getRowRefName(null, rowInd);\n const rowComponent = this.$refs[refName] as InstanceType<typeof Row>;\n if (type === \"delete\") {\n rowComponent?.focusDeleteButton();\n } else {\n rowComponent?.focusSelectionCheckbox();\n }\n },\n onVirtualColumnNav(\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n rowInd: number,\n groupInd: null | number,\n ) {\n const rectId = groupInd ?? null;\n if (direction === \"right\") {\n if (type === \"delete\" && this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n } else if (this.columns.length > 0) {\n this.onMoveIntoBodyFromLeft(rowInd, rectId);\n }\n } else if (direction === \"left\") {\n if (type === \"selection\" && this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n }\n } else if (direction === \"up\") {\n if (rowInd > 0) {\n this.focusRowVirtualColumn(type, rowInd - 1, rectId);\n } else if (type === \"selection\") {\n this.getHeaderComponent().focusSelectionCheckbox();\n }\n } else if (direction === \"down\") {\n if (rowInd < this.totalTableLength - 1) {\n this.focusRowVirtualColumn(type, rowInd + 1, rectId);\n } else if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n virtualColumn: type,\n rectId,\n };\n }\n }\n },\n onHeaderSelectionKeydownDown() {\n this.focusRowVirtualColumn(\"selection\", 0, null);\n },\n async onKeyboardMoveSelection(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n if (!this.selectedCell) {\n return;\n }\n const columnInd = this.selectedCell.x + horizontalMove;\n const rowInd = this.selectedCell.y + verticalMove;\n if (columnInd === -1) {\n this.onMoveSelectionOutOfBodyLeft({\n rowInd: this.selectedCell!.y,\n rectId: this.currentRectId,\n });\n return;\n }\n if (columnInd === this.columns.length) {\n this.onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === -1) {\n this.onMoveSelectionOutOfBodyUp({ columnInd });\n return;\n }\n\n this.onKeyboardMoveSelectionVirtual(\n columnInd,\n rowInd,\n verticalMove,\n expandSelection,\n );\n\n await this.scrollToCellSelectionOverlay();\n\n this.toBeShownCell = this.tableState.dataValueViewIsShown\n ? this.selectedCell\n : null;\n },\n async expandSelectedCell() {\n if (this.selectedCell && this.tableConfig.enableDataValueViews) {\n // scroll current selection into view\n await this.onKeyboardMoveSelection(0, 0, true);\n this.toBeShownCell = this.selectedCell;\n }\n },\n\n onStartEditingCell(initialValue?: string) {\n if (this.selectedCell && this.columns[this.selectedCell.x]?.editable) {\n this.setToBeEditedCell(this.selectedCell, initialValue);\n }\n },\n onResizeRow(rowSizeDelta: number, scrollIndex: number) {\n this.currentRowSizeDelta = rowSizeDelta;\n this.currentResizedScrollIndex = scrollIndex;\n },\n onResizeAllRows(currentSize: number, row: HTMLElement, rowInd: number) {\n if (this.currentRowHeight === \"dynamic\") {\n return;\n }\n this.currentRowSizeDelta = 0;\n const previousScrollTop = this.tableCore?.getVirtualScrollStart();\n if (previousScrollTop === undefined) {\n return;\n }\n const heightAboveCurrentRow = rowInd * this.currentRowHeight;\n const offset = heightAboveCurrentRow - previousScrollTop;\n this.resizedRowHeight = currentSize;\n const scrollPosition = rowInd * this.currentRowHeight - offset;\n this.keepScrollerPositionOnRowResize(scrollPosition);\n },\n keepScrollerPositionOnRowResize(scrollPosition: number) {\n const resizeObserver = new ResizeObserver(() => {\n setTimeout(() => {\n // scroll was temporarily disabled to avoid sending scroll events during resize\n this.currentResizedScrollIndex = null;\n }, ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY);\n this.tableCore?.virtualScrollToPosition({ top: scrollPosition });\n resizeObserver.disconnect();\n });\n const virtualBody = this.tableCore?.getVirtualBody();\n if (virtualBody) {\n resizeObserver.observe(virtualBody);\n }\n },\n onRowInput(\n _event: any,\n rowInd: number,\n groupInd: number,\n row: { id: string },\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n const event = {\n ..._event,\n rowInd: indexInInput,\n id: row.id,\n groupInd,\n isTop,\n };\n consola.debug(`TableUI emitting: tableInput ${event}`);\n this.$emit(\"tableInput\", event);\n },\n onRowSubMenuClick(event: any, row: any) {\n consola.debug(`TableUI row submenu clicked ${event} ${row}`);\n if (event.callback) {\n event.callback(row, this);\n }\n },\n onColumnResize(columnIndex: number, newColumnSize: number) {\n this.$emit(\"columnResize\", columnIndex, newColumnSize);\n },\n onAllColumnsResize(newColumnSize: number) {\n this.$emit(\"allColumnsResize\", newColumnSize);\n },\n onColumnResizeStart() {\n this.columnResizeActive = true;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.columnResizeActive = false;\n this.$emit(\"columnResizeEnd\");\n },\n getCellContentSlotName(columns: ColumnConfig[], columnId: number) {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columns[columnId].key as unknown as string}`;\n },\n getHeaderComponent() {\n return this.$refs.header as InstanceType<typeof Header>;\n },\n getTableCoreComponent() {\n return this.$refs.tableCore as InstanceType<typeof TableCore>;\n },\n getSelectionOverlayComponent() {\n return this.$refs.selectionOverlay as InstanceType<\n typeof CellSelectionOverlay\n >;\n },\n focusHeaderCell(cellInd: number) {\n this.getHeaderComponent().focusHeaderCell(cellInd);\n },\n refocusSelection() {\n if (this.selectedHeaderIndex === null) {\n this.focusBody();\n } else {\n this.focusHeaderCell(this.selectedHeaderIndex);\n }\n },\n getRowComponents() {\n const rowComponents: any[] = [];\n this.data.forEach((group: any) => {\n group.forEach((_: any, rowIndex: number) =>\n rowComponents.push(this.$refs[this.getRowRefName(null, rowIndex)]),\n );\n });\n return rowComponents;\n },\n getRowData(row: Record<string, unknown> | Array<unknown>) {\n const isEmptyArray = Array.isArray(row) && row.length === 0;\n return isEmptyArray\n ? row\n : this.columns.map(\n (column) =>\n (row as Record<string, unknown>)[column.key as unknown as string],\n );\n },\n getRowRefName(groupInd: null | number, rowInd: number) {\n if (groupInd === null) {\n return `row-${rowInd}`;\n }\n return `group-${groupInd}-row-${rowInd}`;\n },\n getCellIndex(cell: CellPosition | null | undefined, rowInd: number) {\n if (cell && cell.y === rowInd) {\n return cell.x;\n }\n return null;\n },\n getCellSelectionRange(rowInd: number) {\n const rect = this.rectMinMax;\n if (!rect || rowInd < rect.y.min || rowInd > rect.y.max) {\n return null;\n }\n return { min: rect.x.min, max: rect.x.max };\n },\n onNewRowButtonClick(event: MouseEvent) {\n event.stopPropagation();\n const lastCellOrLastVirtualCell =\n this.lastColumnAndRectIdBeforeMovingToNewRowButton;\n const lastCellWasVirtualColumn =\n lastCellOrLastVirtualCell &&\n \"virtualColumn\" in lastCellOrLastVirtualCell;\n const lastCell = lastCellWasVirtualColumn\n ? null\n : lastCellOrLastVirtualCell;\n\n this.$emit(\"newRowButtonClick\", lastCell);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n event.stopPropagation();\n this.$emit(\"newColumnButtonClick\");\n },\n },\n};\n</script>\n\n<template>\n <div\n class=\"wrapper\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n >\n <TableActionBar\n v-if=\"showActionBar\"\n :table-sizes=\"tableState.tableSizes\"\n :action-state\n :row-label=\"tableConfig.rowLabel\"\n :show-table-size=\"tableConfig.showTableSize\"\n :action-config=\"actionConfig ?? {}\"\n :col-sort-values\n :sort-control-options\n @reset-temporary-view=\"$emit('resetTemporaryView')\"\n @on-column-sort=\"onActionBarColumnSort\"\n @update:search-term=\"$emit('update:searchTerm', $event)\"\n >\n <template v-if=\"$slots['action-bar-left']\" #action-bar-left>\n <slot name=\"action-bar-left\" />\n </template>\n </TableActionBar>\n <table\n ref=\"wrapper\"\n :tabindex=\"-1\"\n @pointerleave=\"selectCellsOnMove.setFalse\"\n @pointerdown.passive.stop=\"\n $event.button === 0 && selectCellsOnMove.setTrue()\n \"\n @pointerup.passive=\"$event.button === 0 && selectCellsOnMove.setFalse()\"\n @keydown.alt.exact=\"handleCopyOnKeydown\"\n @keydown.delete.exact=\"handleDeleteSelection\"\n @keydown.escape.exact=\"clearCellSelectionAndStopPropagation\"\n >\n <TableCore\n ref=\"tableCore\"\n :scroll-data=\"scrollData\"\n :total-width=\"totalWidth\"\n :column-resize=\"{ active: columnResizeActive }\"\n :table-config\n :sub-menu-config\n :scroll-config=\"{\n itemSize: scrollerItemSize,\n numRowsAbove,\n numRowsBelow,\n compact: Boolean(rowConfig.compactMode),\n }\"\n :current-row-height=\"currentRowHeight\"\n :new-column-button-width\n @scroller-update=\"onScroll\"\n @update:available-width=\"onUpdateAvailableWidth\"\n @move-selection=\"onKeyboardMoveSelection\"\n @clear-selection=\"clearCellSelection\"\n @expand-selected-cell=\"expandSelectedCell\"\n @start-editing=\"onStartEditingCell\"\n @body-focusin=\"changeFocus(true)\"\n @body-focusout=\"onTableBodyFocusOut()\"\n >\n <template #row=\"{ row, groupInd, rowInd }\">\n <Row\n :ref=\"getRowRefName(groupInd, rowInd)\"\n :row-data=\"row\"\n :row=\"getRowData(row)\"\n :table-config\n :sub-menu-config\n :show-drag-handle=\"tableConfig.enableRowResizing\"\n :columns\n :row-config=\"rowConfig\"\n :row-height=\"currentRowHeight\"\n :min-row-height=\"minRowHeight\"\n :is-selected=\"currentSelectionMap(rowInd, groupInd || 0)\"\n :select-cells-on-move=\"selectCellsOnMove.state\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n :selected-cell-index=\"getCellIndex(selectedCell, rowInd)\"\n :cell-selection-range=\"getCellSelectionRange(rowInd)\"\n :to-be-expanded-cell-index=\"getCellIndex(toBeShownCell, rowInd)\"\n :to-be-edited-cell-index=\"getCellIndex(editingCell, rowInd)\"\n :new-column-button-width\n @delete-row=\"() => onDeleteRow(rowInd)\"\n @row-select=\"onRowSelect($event, rowInd, groupInd || 0)\"\n @cell-select=\"\n (cellInd, ignoreIfSelected) =>\n onCellSelectRowEvent(\n cellInd,\n rowInd,\n groupInd,\n ignoreIfSelected,\n )\n \"\n @data-value-view=\"\n (cellInd, anchor) => onDataValueView(cellInd, rowInd, anchor)\n \"\n @expand-cell-select=\"\n (cellInd) => onExpandCellSelect(cellInd, rowInd, groupInd)\n \"\n @row-input=\"\n (event) => onRowInput(event, rowInd, groupInd ?? 0, row)\n \"\n @row-sub-menu-click=\"onRowSubMenuClick($event, row)\"\n @resize-all-rows=\"\n (currentSize, row) => onResizeAllRows(currentSize, row, rowInd)\n \"\n @resize-row=\"(rowSizeDelta) => onResizeRow(rowSizeDelta, rowInd)\"\n @virtual-column-nav=\"\n (type, direction) =>\n onVirtualColumnNav(type, direction, rowInd, groupInd)\n \"\n >\n <!-- Vue requires named slots on \"custom\" elements (i.e. template). -->\n <!-- eslint-disable vue/valid-v-slot -->\n <template\n v-for=\"colInd in slottedColumns\"\n #[getCellContentSlotName(columns,colInd)]=\"cellData\"\n :key=\"rowInd + '_' + colInd\"\n >\n <!-- \n TODO: UIEXT-1753:\n not yet working properly with empty and bottom rows, \n since rowInd is the actual scroll index and not the input in the input data\n in this case\n -->\n <slot\n :name=\"`cellContent-${columns[colInd].key as unknown as string}`\"\n :data=\"{\n ...cellData,\n key: columns[colInd].key,\n rowInd,\n colInd,\n }\"\n />\n </template>\n <template #editable-cell=\"{ ind, cellElement }\">\n <slot\n name=\"editable-cell\"\n :row-ind=\"rowInd\"\n :col-ind=\"ind\"\n :initial-value=\"editingCellInitialValue\"\n :cell-element=\"cellElement\"\n @keydown=\"\n (event: KeyboardEvent) =>\n createEditingCellKeydownHandler({\n moveSelection: onKeyboardMoveSelectionFromEditingCell,\n })(event)\n \"\n @click-away=\"stopEditingCell\"\n />\n </template>\n </Row>\n </template>\n <template #header=\"{ getDragHandleHeight }\">\n <Header\n ref=\"header\"\n :style=\"{ width: `var(${BODY_WIDTH_CSS_VAR})` }\"\n :table-config\n :action-config\n :columns\n :additional-header-menu-items\n :col-sort-values\n :is-selected=\"Boolean(tableState.totalSelected)\"\n :get-drag-handle-height=\"getDragHandleHeight\"\n :class=\"[\n 'table-header',\n {\n 'sub-menu-active': subMenuConfig.subMenuItems?.length,\n },\n ]\"\n :show-new-column-button=\"showNewColumnAndRowButton\"\n :selected-header-index=\"selectedHeaderIndex\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n @header-select=\"onSelectAll\"\n @column-sort=\"onColumnSort\"\n @delete-column=\"onDeleteColumn\"\n @column-resize=\"onColumnResize\"\n @all-columns-resize=\"onAllColumnsResize\"\n @column-resize-start=\"onColumnResizeStart\"\n @column-resize-end=\"onColumnResizeEnd\"\n @move-down-from-header-cell=\"onMoveDownFromHeaderCell\"\n @header-cell-select=\"onHeaderCellSelect\"\n @header-cell-deselect=\"onHeaderCellDeselect\"\n @header-cell-start-editing=\"\n (columnIndex: number, initialValue?: string) =>\n $emit('headerCellStartEditing', columnIndex, initialValue)\n \"\n @update:new-column-button-width=\"onUpdateNewColumnButtonWidth\"\n @new-column-button-click=\"onNewColumnButtonClick\"\n @selection-keydown-down=\"onHeaderSelectionKeydownDown()\"\n @new-column-button-keydown-left=\"onMoveIntoBodyFromRight()\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" />\n </template>\n </Header>\n </template>\n <template #cell-selection-overlay>\n <CellSelectionOverlay\n v-if=\"rectMinMax && !isEditingCell && selectedHeaderIndex === null\"\n ref=\"selectionOverlay\"\n :rect=\"rectMinMax\"\n :row-height=\"scrollerItemSize\"\n :table-config=\"tableConfig\"\n :row-resize-index=\"currentResizedScrollIndex\"\n :row-resize-delta=\"currentRowSizeDelta\"\n :cell-selection-rect-focus-corner=\"\n focusWithin ? selectedCell : undefined\n \"\n />\n </template>\n <template #belowBody>\n <NewRowButton\n v-if=\"showNewColumnAndRowButton\"\n ref=\"new-row-button\"\n @click=\"onNewRowButtonClick\"\n @pointerdown.stop\n @keydown-up=\"onMoveIntoBodyFromBottom\"\n />\n </template>\n <template v-if=\"emptyState\" #empty-state>\n <KdsEmptyState class=\"empty-state\" v-bind=\"emptyState\" />\n </template>\n </TableCore>\n <KdsPagination\n v-if=\"pageConfig && pageState\"\n class=\"pagination\"\n :current-page=\"pageState.currentPage\"\n :page-size=\"pageConfig.pageSize\"\n :possible-page-sizes=\"pageConfig.possiblePageSizes\"\n :total-rows=\"tableState.tableSizes?.currentNumRows ?? 0\"\n :show-table-size=\"tableConfig.showTableSize\"\n :row-label=\"tableConfig.rowLabel\"\n @update:current-page=\"onPageChange\"\n @update:page-size=\"onPageSizeUpdate\"\n />\n </table>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n @media screen {\n /* height 100% does not mix well with flex-box on print (https://issues.chromium.org/issues/365922171) */\n height: 100%;\n }\n}\n\ntable {\n position: relative;\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n\n &:focus {\n outline: none;\n }\n\n & .new-row-footer {\n width: 100%;\n }\n\n /* The table inherits its parent's background; the pagination footer is the\n one place Figma sets a surface token for (SLEEK-297). KdsPagination stays\n transparent so it can sit on any surface. */\n & .pagination {\n background: var(--kds-color-surface-default);\n }\n}\n\n/* The empty state is placed into the rows' area by TableCoreVirtual. */\n.empty-state {\n max-width: 100%;\n}\n</style>\n","import { computed, nextTick, ref, watchEffect } from \"vue\";\n\nexport const useTableReady = ({ onReady }: { onReady: () => void }) => {\n const autoSizesInitialized = ref(false);\n const availableWidthInitialized = ref(false);\n\n const tableIsVisible = computed(\n () => autoSizesInitialized.value && availableWidthInitialized.value,\n );\n\n const setAutoSizesInitialized = () => {\n autoSizesInitialized.value = true;\n };\n const setAvailableWidthInitialized = () => {\n availableWidthInitialized.value = true;\n };\n\n const waitUntilVisibleInDOMAndCallOnReady = async () => {\n await nextTick();\n onReady();\n };\n\n watchEffect(() => {\n if (tableIsVisible.value) {\n waitUntilVisibleInDOMAndCallOnReady();\n }\n });\n\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n };\n};\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This component contains the ability to size the columns in the tableUI according to the width of their content by\n * enforcing a maximum size of MAX_AUTO_COLUMN_SIZE. It takes the same props as the TableUI.vue and one additional prop,\n * the options for the calculation. The automatic row height relies on the column sizes and enforces a maximum\n * height given by the auto row height options.\n * To trigger the calculation of the auto sizes, the corresponding trigger method can be called from the parent. The\n * method is automatically called from within this component when:\n * - the component is mounted\n * - one property of the autoColumnSizesOptions changes\n * - one property of the autoRowHeightOptions changes\n * - columns were removed, added, or replaced\n * - the compact mode is toggled\n */\n\nimport type { PropType, Slot } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nimport type { KdsMenuItem } from \"@knime/kds-components\";\nimport { sleep } from \"@knime/utils\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n MAX_AUTO_COLUMN_SIZE,\n MIN_COLUMN_SIZE,\n MIN_ROW_HEIGHT,\n ROW_BORDER_BOTTOM_WIDTH,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig, ColumnId } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\nimport { minSizeOfColumn } from \"../utils/columnHeaderActionButtons\";\n\nimport TableUI from \"./TableUI.vue\";\nimport { useTableReady } from \"./composables/useTableReady\";\nimport { provideAutoSizeColumnSizes } from \"./useColumnSizes\";\n\ntype SizeByColumn = Record<string | symbol, number>;\n\n/**\n * In a lot of cases, the row ids are Row0, Row1, ....\n * With 11 rows taken into account, we respect \"Row10\".\n */\nconst DEFAULT_NUM_ROWS = 11;\n\nexport default {\n components: { TableUI },\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<Array<Array<any>>>, default: () => [] },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /** Stable per-column definitions (forwarded to TableUI). */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n /** Appearance of the table's rows (forwarded to TableUI). */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on (forwarded to TableUI). */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** This object contains all the options necessary to calculate the sizes based on the\n * content. In case only one of calculateForBody/calculateForHeader is true, the emitted object contains auto\n * sizes according to body/header. In case both are true, the maximum of both values is used. For fixedSizes only\n * header sizes are calculated and the body sizes will be increased by the horizontal cell padding.\n */\n autoColumnSizesOptions: {\n type: Object as PropType<{\n calculateForBody: boolean;\n calculateForHeader: boolean;\n fixedSizes: SizeByColumn;\n }>,\n default: () => ({}),\n },\n autoRowHeightOptions: {\n type: Object as PropType<{\n calculate: boolean;\n fixedHeights: SizeByColumn;\n maxHeight: number;\n }>,\n default: () => ({}),\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n autoColumnSizesUpdate: (sizes: SizeByColumn) => true,\n autoRowHeightUpdate: (height: number | null) => true,\n ready: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(_props, { emit }) {\n // The hidden auto-size calculation table renders below the same\n // useColumnSizes provider (mounted by the embedding app) as the visible\n // table, so by default it is injected the actual column sizes — which is\n // what we want when only the row heights are calculated. When the column\n // sizes themselves are calculated, setAutoSizeColumnSizes overrides them\n // with the maximum width while the calculation table is mounted (see\n // triggerCalculationOfAutoSizes and calculateAutoSizes).\n const {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n } = useTableReady({ onReady: () => emit(\"ready\") });\n const { setAutoSizeColumnSizes, unsetAutoSizeColumnSizes } =\n provideAutoSizeColumnSizes();\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n setAutoSizeColumnSizes,\n unsetAutoSizeColumnSizes,\n };\n },\n data() {\n return {\n currentColumnSizes: {} as SizeByColumn,\n currentHeightsByColumn: {} as SizeByColumn,\n calculateSizes: false,\n useSavedColumnSizes: false,\n disableRowHeightTransition: true,\n };\n },\n computed: {\n /**\n * Needed for a combined watcher for changes in case we change both\n * option parts at the same time.\n */\n combinedOptions() {\n return {\n columns: this.autoColumnSizesOptions,\n rows: this.autoRowHeightOptions,\n };\n },\n mountTableUIForAutoSizeCalculation() {\n return this.data !== null && this.calculateSizes;\n },\n columnIds() {\n return getPropertiesFromColumns(this.columns, \"id\");\n },\n /**\n * The width each column needs at the very least, i.e. the one at which the\n * action buttons of its header still fit (see {@link minSizeOfColumn}).\n */\n minColumnSizes(): Record<ColumnId, number> {\n return this.columns.reduce(\n (minSizes, column, index) => {\n minSizes[column.id] = minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n });\n return minSizes;\n },\n {} as Record<ColumnId, number>,\n );\n },\n currentColumnsWithAutoSize() {\n return new Set<ColumnId>([\n ...Reflect.ownKeys(this.currentColumnSizes),\n ...Reflect.ownKeys(this.currentHeightsByColumn),\n ]);\n },\n removedColumnIds() {\n const removedColumnIds = new Set<ColumnId>();\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (!this.columnIds.includes(columnId)) {\n removedColumnIds.add(columnId);\n }\n });\n return removedColumnIds;\n },\n addedColumnIds() {\n const addedColumnIds = new Set<ColumnId>();\n this.columnIds.forEach((columnId) => {\n if (!this.currentColumnsWithAutoSize.has(columnId)) {\n addedColumnIds.add(columnId);\n }\n });\n return addedColumnIds;\n },\n columnsWereOnlyRemoved() {\n return this.addedColumnIds.size === 0 && this.removedColumnIds.size > 0;\n },\n paginatedDataForAutoColumnSizesCalculation() {\n return [this.data.flat().slice(0, DEFAULT_NUM_ROWS)];\n },\n colSizesForCalculationWithAutoColumnSizes() {\n return this.columnIds.map(() => MAX_AUTO_COLUMN_SIZE);\n },\n tableConfigForAutoSizesCalculation() {\n return {\n ...this.tableConfig,\n forceRenderAll: true,\n };\n },\n autoColumnSizingActive() {\n return (\n this.autoColumnSizesOptions.calculateForBody ||\n this.autoColumnSizesOptions.calculateForHeader\n );\n },\n autoRowHeightSizingActive() {\n return this.autoRowHeightOptions.calculate;\n },\n autoColumnSizeCalculationRequired() {\n return this.autoColumnSizingActive && !this.useSavedColumnSizes;\n },\n columnPaddingsHorizontal() {\n return this.columnIds.reduce(\n (paddings, columnId) => {\n paddings[columnId] = CELL_PADDING_HORIZONTAL * 2;\n return paddings;\n },\n {} as Record<string | symbol | number, number>,\n );\n },\n currentRowHeight() {\n const rowHeights = Reflect.ownKeys(this.currentHeightsByColumn).map(\n (columnId) => this.currentHeightsByColumn[columnId],\n );\n return rowHeights.length === 0\n ? null\n : Math.min(\n Math.max(...rowHeights),\n this.autoRowHeightOptions.maxHeight,\n );\n },\n forwardedSlotEntries(): Array<[string, Slot]> {\n return Object.entries(this.$slots) as Array<[string, Slot]>;\n },\n },\n watch: {\n combinedOptions: {\n handler(newVal, oldVal) {\n const columnsIsEqual = isEqual(newVal.columns, oldVal.columns);\n const rowsIsEqual = isEqual(newVal.rows, oldVal.rows);\n if (!rowsIsEqual && columnsIsEqual) {\n this.useSavedColumnSizes = true;\n }\n if (!rowsIsEqual || !columnsIsEqual) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n deep: true,\n },\n columnIds(newIds, oldIds) {\n if (\n newIds.length !== oldIds.length ||\n !newIds.every((el: any, index: number) => el === oldIds[index])\n ) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n \"rowConfig.compactMode\": {\n handler() {\n if (this.autoRowHeightOptions.calculate) {\n this.useSavedColumnSizes = true;\n this.triggerCalculationOfAutoSizes();\n }\n },\n },\n },\n mounted() {\n if (this.autoRowHeightSizingActive) {\n const unwatchRowHeight = this.$watch(\n () => this.rowConfig.rowHeight,\n async () => {\n // wait until the DOM changes regarding the newRowHeight are completely rendered and enable the transition\n // otherwise, a table with auto row height calculation performs row height animations when being first mounted\n await sleep(0);\n this.disableRowHeightTransition = false;\n unwatchRowHeight();\n },\n );\n } else {\n this.disableRowHeightTransition = false;\n }\n this.triggerCalculationOfAutoSizes();\n },\n methods: {\n emitNewAutoSizes() {\n this.$emit(\"autoColumnSizesUpdate\", { ...this.currentColumnSizes });\n this.$emit(\"autoRowHeightUpdate\", this.currentRowHeight);\n this.useSavedColumnSizes = false;\n this.setAutoSizesInitialized();\n },\n triggerCalculationOfAutoSizes() {\n if (this.autoColumnSizingActive && this.columnsWereOnlyRemoved) {\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (this.removedColumnIds.has(columnId)) {\n delete this.currentColumnSizes[columnId];\n delete this.currentHeightsByColumn[columnId];\n }\n });\n this.emitNewAutoSizes();\n return;\n }\n\n if (!this.autoColumnSizingActive) {\n this.currentColumnSizes = {};\n }\n if (!this.autoRowHeightSizingActive) {\n this.currentHeightsByColumn = {};\n }\n\n const autoSizingRequired =\n this.autoRowHeightSizingActive ||\n this.autoColumnSizeCalculationRequired;\n if (autoSizingRequired) {\n if (this.autoColumnSizingActive) {\n // Override the injected sizes with the maximum width before the\n // calculation table mounts, so its content is measured untruncated\n // (unset again in calculateAutoSizes). When only the row heights are\n // calculated we keep the actual column sizes from the provider.\n this.setAutoSizeColumnSizes(\n this.colSizesForCalculationWithAutoColumnSizes,\n );\n }\n this.calculateSizes = true;\n } else {\n this.emitNewAutoSizes();\n }\n },\n setAutoColumnSizes(autoColumnSizes: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentColumnSizes,\n autoSizesByRow: autoColumnSizes,\n fixedSizes: this.autoColumnSizesOptions.fixedSizes,\n minSize: (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n paddings: this.columnPaddingsHorizontal,\n });\n },\n setAutoRowHeights(autoRowHeights: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentHeightsByColumn,\n autoSizesByRow: autoRowHeights,\n fixedSizes: this.autoRowHeightOptions.fixedHeights,\n minSize: () => MIN_ROW_HEIGHT,\n });\n },\n async calculateAutoSizes() {\n // Wait for the fonts to be loaded before calculating the column sizes based on the rendered table\n await Promise.all([\n document.fonts.load(\"400 1em Roboto\"),\n document.fonts.load(\"700 1em Roboto\"),\n ]);\n\n const bodyComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForBody;\n const headerComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForHeader;\n const bodyComputesRows = this.autoRowHeightSizingActive;\n const computeColumns = this.autoColumnSizeCalculationRequired;\n\n if (computeColumns) {\n this.currentColumnSizes = this.initializeSizesWithMinSize(\n (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n );\n }\n if (bodyComputesRows) {\n this.currentHeightsByColumn = this.initializeSizesWithMinSize(\n () => MIN_ROW_HEIGHT,\n );\n }\n\n if (bodyComputesColumns || bodyComputesRows) {\n const { autoColumnSizes, autoRowHeights } =\n this.calculateAutoSizesBody();\n\n if (bodyComputesRows) {\n this.setAutoRowHeights(autoRowHeights);\n }\n\n if (bodyComputesColumns) {\n this.setAutoColumnSizes(autoColumnSizes);\n }\n }\n\n if (headerComputesColumns) {\n this.calculateAndSetAutoColumnSizesHeader();\n }\n if (computeColumns) {\n this.enforceMaxColSize();\n }\n\n this.calculateSizes = false;\n this.unsetAutoSizeColumnSizes();\n this.emitNewAutoSizes();\n },\n initializeSizesWithMinSize(minSize: (columnId: ColumnId) => number) {\n return this.columnIds.reduce(\n (sizes, columnId) => ({\n ...sizes,\n [columnId]: minSize(columnId),\n }),\n {},\n );\n },\n addFixedAndAutoSizes({\n sizesToUpdate,\n autoSizesByRow,\n fixedSizes,\n minSize,\n paddings = null,\n }: {\n sizesToUpdate: SizeByColumn;\n autoSizesByRow: SizeByColumn[];\n fixedSizes: SizeByColumn;\n minSize: (columnId: ColumnId) => number;\n paddings?: SizeByColumn | null;\n }) {\n Reflect.ownKeys(fixedSizes).forEach((columnId) => {\n if (sizesToUpdate.hasOwnProperty(columnId)) {\n sizesToUpdate[columnId] = Math.max(\n minSize(columnId),\n fixedSizes[columnId] + (paddings?.[columnId] || 0),\n );\n }\n });\n\n autoSizesByRow.forEach((autoSizes) => {\n Reflect.ownKeys(autoSizes).forEach((columnId) => {\n sizesToUpdate[columnId] = Math.max(\n sizesToUpdate[columnId],\n autoSizes[columnId],\n );\n });\n });\n },\n calculateAutoSizesBody() {\n const rowComponents = (\n this.$refs.tableUIForAutoSize as any\n ).getRowComponents();\n\n const { fixedSizes } = this.autoColumnSizesOptions;\n\n const autoColumnSizes: SizeByColumn[] = [];\n const autoRowHeights: SizeByColumn[] = [];\n\n rowComponents.forEach((rowComponent: any) => {\n const sizesByColumn: SizeByColumn = {};\n const heightsByColumn: SizeByColumn = {};\n const cellComponents = rowComponent.getCellComponents();\n this.columnIds.forEach((columnId, columnIndex) => {\n if (!fixedSizes.hasOwnProperty(columnId)) {\n const { width, height } =\n cellComponents[columnIndex].getCellContentDimensions();\n sizesByColumn[columnId] = width;\n heightsByColumn[columnId] = height + ROW_BORDER_BOTTOM_WIDTH;\n }\n });\n autoColumnSizes.push(sizesByColumn);\n autoRowHeights.push(heightsByColumn);\n });\n return { autoColumnSizes, autoRowHeights };\n },\n calculateAndSetAutoColumnSizesHeader() {\n const headerCellSizes = (this.$refs.tableUIForAutoSize as any)\n .getHeaderComponent()\n .getHeaderCellWidths();\n this.columnIds.forEach((columnId, columnIndex) => {\n const headerWidth = headerCellSizes[columnIndex];\n if (this.currentColumnSizes[columnId] < headerWidth) {\n this.currentColumnSizes[columnId] = headerWidth;\n }\n });\n },\n enforceMaxColSize() {\n this.currentColumnSizes = Reflect.ownKeys(this.currentColumnSizes).reduce(\n (enforcedColSizes, columnId) => ({\n ...enforcedColSizes,\n [columnId]: Math.min(\n this.currentColumnSizes[columnId],\n MAX_AUTO_COLUMN_SIZE,\n ),\n }),\n {},\n );\n },\n onUpdateAvailableWidth(newAvailableWidth: number) {\n this.$emit(\"update:available-width\", newAvailableWidth);\n this.setAvailableWidthInitialized();\n },\n getTableUIElement() {\n return (this.$refs.tableUI as any).$el;\n },\n refreshScroller() {\n (this.$refs.tableUI as any)?.refreshScroller();\n },\n clearCellSelection() {\n (this.$refs.tableUI as any)?.clearCellSelection();\n },\n },\n};\n</script>\n\n<template>\n <TableUI\n ref=\"tableUI\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n v-bind=\"$attrs\"\n :data=\"data\"\n :current-selection=\"currentSelection\"\n :current-bottom-selection=\"currentBottomSelection\"\n :columns=\"columns\"\n :additional-header-menu-items\n :col-sort-values=\"colSortValues\"\n :num-rows-above=\"numRowsAbove\"\n :num-rows-below=\"numRowsBelow\"\n :bottom-data=\"bottomData\"\n :row-config=\"rowConfig\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n :table-config=\"tableConfig\"\n :table-state=\"tableState\"\n :page-config=\"pageConfig\"\n :page-state=\"pageState\"\n :action-config=\"actionConfig\"\n :action-state=\"actionState\"\n :sub-menu-config=\"subMenuConfig\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n @update:available-width=\"onUpdateAvailableWidth\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n <TableUI\n v-if=\"mountTableUIForAutoSizeCalculation\"\n ref=\"tableUIForAutoSize\"\n class=\"table-column-size-calculation\"\n :data=\"paginatedDataForAutoColumnSizesCalculation\"\n :current-selection=\"currentSelection\"\n :columns=\"columns\"\n :row-config=\"rowConfig\"\n :table-config=\"tableConfigForAutoSizesCalculation\"\n @vue:mounted=\"calculateAutoSizes\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <!-- The cells of this table are mounted at the maximum column width. Slot content\n that stretches to its cell (e.g. to align text) would then be measured at that\n width, so it gets told that it is being measured and can size itself to its content. -->\n <slot\n :name=\"slotName\"\n v-bind=\"{ ...(slotProps ?? {}), usedForAutoSizeCalculation: true }\"\n />\n </template>\n </TableUI>\n</template>\n\n<style scoped>\n.table-column-size-calculation {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: hidden;\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This component contains the ability to size the columns in the tableUI according to the width of their content by\n * enforcing a maximum size of MAX_AUTO_COLUMN_SIZE. It takes the same props as the TableUI.vue and one additional prop,\n * the options for the calculation. The automatic row height relies on the column sizes and enforces a maximum\n * height given by the auto row height options.\n * To trigger the calculation of the auto sizes, the corresponding trigger method can be called from the parent. The\n * method is automatically called from within this component when:\n * - the component is mounted\n * - one property of the autoColumnSizesOptions changes\n * - one property of the autoRowHeightOptions changes\n * - columns were removed, added, or replaced\n * - the compact mode is toggled\n */\n\nimport type { PropType, Slot } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nimport type { KdsMenuItem } from \"@knime/kds-components\";\nimport { sleep } from \"@knime/utils\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n MAX_AUTO_COLUMN_SIZE,\n MIN_COLUMN_SIZE,\n MIN_ROW_HEIGHT,\n ROW_BORDER_BOTTOM_WIDTH,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig, ColumnId } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\nimport { minSizeOfColumn } from \"../utils/columnHeaderActionButtons\";\n\nimport TableUI from \"./TableUI.vue\";\nimport { useTableReady } from \"./composables/useTableReady\";\nimport { provideAutoSizeColumnSizes } from \"./useColumnSizes\";\n\ntype SizeByColumn = Record<string | symbol, number>;\n\n/**\n * In a lot of cases, the row ids are Row0, Row1, ....\n * With 11 rows taken into account, we respect \"Row10\".\n */\nconst DEFAULT_NUM_ROWS = 11;\n\nexport default {\n components: { TableUI },\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<Array<Array<any>>>, default: () => [] },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /** Stable per-column definitions (forwarded to TableUI). */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n /** Appearance of the table's rows (forwarded to TableUI). */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on (forwarded to TableUI). */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** This object contains all the options necessary to calculate the sizes based on the\n * content. In case only one of calculateForBody/calculateForHeader is true, the emitted object contains auto\n * sizes according to body/header. In case both are true, the maximum of both values is used. For fixedSizes only\n * header sizes are calculated and the body sizes will be increased by the horizontal cell padding.\n */\n autoColumnSizesOptions: {\n type: Object as PropType<{\n calculateForBody: boolean;\n calculateForHeader: boolean;\n fixedSizes: SizeByColumn;\n }>,\n default: () => ({}),\n },\n autoRowHeightOptions: {\n type: Object as PropType<{\n calculate: boolean;\n fixedHeights: SizeByColumn;\n maxHeight: number;\n }>,\n default: () => ({}),\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n autoColumnSizesUpdate: (sizes: SizeByColumn) => true,\n autoRowHeightUpdate: (height: number | null) => true,\n ready: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(_props, { emit }) {\n // The hidden auto-size calculation table renders below the same\n // useColumnSizes provider (mounted by the embedding app) as the visible\n // table, so by default it is injected the actual column sizes — which is\n // what we want when only the row heights are calculated. When the column\n // sizes themselves are calculated, setAutoSizeColumnSizes overrides them\n // with the maximum width while the calculation table is mounted (see\n // triggerCalculationOfAutoSizes and calculateAutoSizes).\n const {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n } = useTableReady({ onReady: () => emit(\"ready\") });\n const { setAutoSizeColumnSizes, unsetAutoSizeColumnSizes } =\n provideAutoSizeColumnSizes();\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n setAutoSizeColumnSizes,\n unsetAutoSizeColumnSizes,\n };\n },\n data() {\n return {\n currentColumnSizes: {} as SizeByColumn,\n currentHeightsByColumn: {} as SizeByColumn,\n calculateSizes: false,\n useSavedColumnSizes: false,\n disableRowHeightTransition: true,\n };\n },\n computed: {\n /**\n * Needed for a combined watcher for changes in case we change both\n * option parts at the same time.\n */\n combinedOptions() {\n return {\n columns: this.autoColumnSizesOptions,\n rows: this.autoRowHeightOptions,\n };\n },\n mountTableUIForAutoSizeCalculation() {\n return this.data !== null && this.calculateSizes;\n },\n columnIds() {\n return getPropertiesFromColumns(this.columns, \"id\");\n },\n /**\n * The width each column needs at the very least, i.e. the one at which the\n * action buttons of its header still fit (see {@link minSizeOfColumn}).\n */\n minColumnSizes(): Record<ColumnId, number> {\n return this.columns.reduce(\n (minSizes, column, index) => {\n minSizes[column.id] = minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n });\n return minSizes;\n },\n {} as Record<ColumnId, number>,\n );\n },\n currentColumnsWithAutoSize() {\n return new Set<ColumnId>([\n ...Reflect.ownKeys(this.currentColumnSizes),\n ...Reflect.ownKeys(this.currentHeightsByColumn),\n ]);\n },\n removedColumnIds() {\n const removedColumnIds = new Set<ColumnId>();\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (!this.columnIds.includes(columnId)) {\n removedColumnIds.add(columnId);\n }\n });\n return removedColumnIds;\n },\n addedColumnIds() {\n const addedColumnIds = new Set<ColumnId>();\n this.columnIds.forEach((columnId) => {\n if (!this.currentColumnsWithAutoSize.has(columnId)) {\n addedColumnIds.add(columnId);\n }\n });\n return addedColumnIds;\n },\n columnsWereOnlyRemoved() {\n return this.addedColumnIds.size === 0 && this.removedColumnIds.size > 0;\n },\n paginatedDataForAutoColumnSizesCalculation() {\n return [this.data.flat().slice(0, DEFAULT_NUM_ROWS)];\n },\n colSizesForCalculationWithAutoColumnSizes() {\n return this.columnIds.map(() => MAX_AUTO_COLUMN_SIZE);\n },\n tableConfigForAutoSizesCalculation() {\n return {\n ...this.tableConfig,\n forceRenderAll: true,\n };\n },\n autoColumnSizingActive() {\n return (\n this.autoColumnSizesOptions.calculateForBody ||\n this.autoColumnSizesOptions.calculateForHeader\n );\n },\n autoRowHeightSizingActive() {\n return this.autoRowHeightOptions.calculate;\n },\n autoColumnSizeCalculationRequired() {\n return this.autoColumnSizingActive && !this.useSavedColumnSizes;\n },\n columnPaddingsHorizontal() {\n return this.columnIds.reduce(\n (paddings, columnId) => {\n paddings[columnId] = CELL_PADDING_HORIZONTAL * 2;\n return paddings;\n },\n {} as Record<string | symbol | number, number>,\n );\n },\n currentRowHeight() {\n const rowHeights = Reflect.ownKeys(this.currentHeightsByColumn).map(\n (columnId) => this.currentHeightsByColumn[columnId],\n );\n return rowHeights.length === 0\n ? null\n : Math.min(\n Math.max(...rowHeights),\n this.autoRowHeightOptions.maxHeight,\n );\n },\n forwardedSlotEntries(): Array<[string, Slot]> {\n return Object.entries(this.$slots) as Array<[string, Slot]>;\n },\n },\n watch: {\n combinedOptions: {\n handler(newVal, oldVal) {\n const columnsIsEqual = isEqual(newVal.columns, oldVal.columns);\n const rowsIsEqual = isEqual(newVal.rows, oldVal.rows);\n if (!rowsIsEqual && columnsIsEqual) {\n this.useSavedColumnSizes = true;\n }\n if (!rowsIsEqual || !columnsIsEqual) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n deep: true,\n },\n columnIds(newIds, oldIds) {\n if (\n newIds.length !== oldIds.length ||\n !newIds.every((el: any, index: number) => el === oldIds[index])\n ) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n \"rowConfig.compactMode\": {\n handler() {\n if (this.autoRowHeightOptions.calculate) {\n this.useSavedColumnSizes = true;\n this.triggerCalculationOfAutoSizes();\n }\n },\n },\n },\n mounted() {\n if (this.autoRowHeightSizingActive) {\n const unwatchRowHeight = this.$watch(\n () => this.rowConfig.rowHeight,\n async () => {\n // wait until the DOM changes regarding the newRowHeight are completely rendered and enable the transition\n // otherwise, a table with auto row height calculation performs row height animations when being first mounted\n await sleep(0);\n this.disableRowHeightTransition = false;\n unwatchRowHeight();\n },\n );\n } else {\n this.disableRowHeightTransition = false;\n }\n this.triggerCalculationOfAutoSizes();\n },\n methods: {\n emitNewAutoSizes() {\n this.$emit(\"autoColumnSizesUpdate\", { ...this.currentColumnSizes });\n this.$emit(\"autoRowHeightUpdate\", this.currentRowHeight);\n this.useSavedColumnSizes = false;\n this.setAutoSizesInitialized();\n },\n triggerCalculationOfAutoSizes() {\n if (this.autoColumnSizingActive && this.columnsWereOnlyRemoved) {\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (this.removedColumnIds.has(columnId)) {\n delete this.currentColumnSizes[columnId];\n delete this.currentHeightsByColumn[columnId];\n }\n });\n this.emitNewAutoSizes();\n return;\n }\n\n if (!this.autoColumnSizingActive) {\n this.currentColumnSizes = {};\n }\n if (!this.autoRowHeightSizingActive) {\n this.currentHeightsByColumn = {};\n }\n\n const autoSizingRequired =\n this.autoRowHeightSizingActive ||\n this.autoColumnSizeCalculationRequired;\n if (autoSizingRequired) {\n if (this.autoColumnSizingActive) {\n // Override the injected sizes with the maximum width before the\n // calculation table mounts, so its content is measured untruncated\n // (unset again in calculateAutoSizes). When only the row heights are\n // calculated we keep the actual column sizes from the provider.\n this.setAutoSizeColumnSizes(\n this.colSizesForCalculationWithAutoColumnSizes,\n );\n }\n this.calculateSizes = true;\n } else {\n this.emitNewAutoSizes();\n }\n },\n setAutoColumnSizes(autoColumnSizes: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentColumnSizes,\n autoSizesByRow: autoColumnSizes,\n fixedSizes: this.autoColumnSizesOptions.fixedSizes,\n minSize: (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n paddings: this.columnPaddingsHorizontal,\n });\n },\n setAutoRowHeights(autoRowHeights: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentHeightsByColumn,\n autoSizesByRow: autoRowHeights,\n fixedSizes: this.autoRowHeightOptions.fixedHeights,\n minSize: () => MIN_ROW_HEIGHT,\n });\n },\n async calculateAutoSizes() {\n // Wait for the fonts to be loaded before calculating the column sizes based on the rendered table\n await Promise.all([\n document.fonts.load(\"400 1em Roboto\"),\n document.fonts.load(\"700 1em Roboto\"),\n ]);\n\n const bodyComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForBody;\n const headerComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForHeader;\n const bodyComputesRows = this.autoRowHeightSizingActive;\n const computeColumns = this.autoColumnSizeCalculationRequired;\n\n if (computeColumns) {\n this.currentColumnSizes = this.initializeSizesWithMinSize(\n (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n );\n }\n if (bodyComputesRows) {\n this.currentHeightsByColumn = this.initializeSizesWithMinSize(\n () => MIN_ROW_HEIGHT,\n );\n }\n\n if (bodyComputesColumns || bodyComputesRows) {\n const { autoColumnSizes, autoRowHeights } =\n this.calculateAutoSizesBody();\n\n if (bodyComputesRows) {\n this.setAutoRowHeights(autoRowHeights);\n }\n\n if (bodyComputesColumns) {\n this.setAutoColumnSizes(autoColumnSizes);\n }\n }\n\n if (headerComputesColumns) {\n this.calculateAndSetAutoColumnSizesHeader();\n }\n if (computeColumns) {\n this.enforceMaxColSize();\n }\n\n this.calculateSizes = false;\n this.unsetAutoSizeColumnSizes();\n this.emitNewAutoSizes();\n },\n initializeSizesWithMinSize(minSize: (columnId: ColumnId) => number) {\n return this.columnIds.reduce(\n (sizes, columnId) => ({\n ...sizes,\n [columnId]: minSize(columnId),\n }),\n {},\n );\n },\n addFixedAndAutoSizes({\n sizesToUpdate,\n autoSizesByRow,\n fixedSizes,\n minSize,\n paddings = null,\n }: {\n sizesToUpdate: SizeByColumn;\n autoSizesByRow: SizeByColumn[];\n fixedSizes: SizeByColumn;\n minSize: (columnId: ColumnId) => number;\n paddings?: SizeByColumn | null;\n }) {\n Reflect.ownKeys(fixedSizes).forEach((columnId) => {\n if (sizesToUpdate.hasOwnProperty(columnId)) {\n sizesToUpdate[columnId] = Math.max(\n minSize(columnId),\n fixedSizes[columnId] + (paddings?.[columnId] || 0),\n );\n }\n });\n\n autoSizesByRow.forEach((autoSizes) => {\n Reflect.ownKeys(autoSizes).forEach((columnId) => {\n sizesToUpdate[columnId] = Math.max(\n sizesToUpdate[columnId],\n autoSizes[columnId],\n );\n });\n });\n },\n calculateAutoSizesBody() {\n const rowComponents = (\n this.$refs.tableUIForAutoSize as any\n ).getRowComponents();\n\n const { fixedSizes } = this.autoColumnSizesOptions;\n\n const autoColumnSizes: SizeByColumn[] = [];\n const autoRowHeights: SizeByColumn[] = [];\n\n rowComponents.forEach((rowComponent: any) => {\n const sizesByColumn: SizeByColumn = {};\n const heightsByColumn: SizeByColumn = {};\n const cellComponents = rowComponent.getCellComponents();\n this.columnIds.forEach((columnId, columnIndex) => {\n if (!fixedSizes.hasOwnProperty(columnId)) {\n const { width, height } =\n cellComponents[columnIndex].getCellContentDimensions();\n sizesByColumn[columnId] = width;\n heightsByColumn[columnId] = height + ROW_BORDER_BOTTOM_WIDTH;\n }\n });\n autoColumnSizes.push(sizesByColumn);\n autoRowHeights.push(heightsByColumn);\n });\n return { autoColumnSizes, autoRowHeights };\n },\n calculateAndSetAutoColumnSizesHeader() {\n const headerCellSizes = (this.$refs.tableUIForAutoSize as any)\n .getHeaderComponent()\n .getHeaderCellWidths();\n this.columnIds.forEach((columnId, columnIndex) => {\n const headerWidth = headerCellSizes[columnIndex];\n if (this.currentColumnSizes[columnId] < headerWidth) {\n this.currentColumnSizes[columnId] = headerWidth;\n }\n });\n },\n enforceMaxColSize() {\n this.currentColumnSizes = Reflect.ownKeys(this.currentColumnSizes).reduce(\n (enforcedColSizes, columnId) => ({\n ...enforcedColSizes,\n [columnId]: Math.min(\n this.currentColumnSizes[columnId],\n MAX_AUTO_COLUMN_SIZE,\n ),\n }),\n {},\n );\n },\n onUpdateAvailableWidth(newAvailableWidth: number) {\n this.$emit(\"update:available-width\", newAvailableWidth);\n this.setAvailableWidthInitialized();\n },\n getTableUIElement() {\n return (this.$refs.tableUI as any).$el;\n },\n refreshScroller() {\n (this.$refs.tableUI as any)?.refreshScroller();\n },\n clearCellSelection() {\n (this.$refs.tableUI as any)?.clearCellSelection();\n },\n },\n};\n</script>\n\n<template>\n <TableUI\n ref=\"tableUI\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n v-bind=\"$attrs\"\n :data=\"data\"\n :current-selection=\"currentSelection\"\n :current-bottom-selection=\"currentBottomSelection\"\n :columns=\"columns\"\n :additional-header-menu-items\n :col-sort-values=\"colSortValues\"\n :num-rows-above=\"numRowsAbove\"\n :num-rows-below=\"numRowsBelow\"\n :bottom-data=\"bottomData\"\n :row-config=\"rowConfig\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n :table-config=\"tableConfig\"\n :table-state=\"tableState\"\n :page-config=\"pageConfig\"\n :page-state=\"pageState\"\n :action-config=\"actionConfig\"\n :action-state=\"actionState\"\n :sub-menu-config=\"subMenuConfig\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n @update:available-width=\"onUpdateAvailableWidth\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n <TableUI\n v-if=\"mountTableUIForAutoSizeCalculation\"\n ref=\"tableUIForAutoSize\"\n class=\"table-column-size-calculation\"\n :data=\"paginatedDataForAutoColumnSizesCalculation\"\n :current-selection=\"currentSelection\"\n :columns=\"columns\"\n :row-config=\"rowConfig\"\n :table-config=\"tableConfigForAutoSizesCalculation\"\n @vue:mounted=\"calculateAutoSizes\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <!-- The cells of this table are mounted at the maximum column width. Slot content\n that stretches to its cell (e.g. to align text) would then be measured at that\n width, so it gets told that it is being measured and can size itself to its content. -->\n <slot\n :name=\"slotName\"\n v-bind=\"{ ...(slotProps ?? {}), usedForAutoSizeCalculation: true }\"\n />\n </template>\n </TableUI>\n</template>\n\n<style scoped>\n.table-column-size-calculation {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: hidden;\n}\n</style>\n"],"x_google_ignoreList":[7,8,29,35],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAa,kBAAkB;AAE/B,IAAa,cAAc;CACzB,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,QAAQ;CACR,SAAS;CACT,OAAO;CACP,QAAQ;CACR,OAAO;AACT;AAMA,IAAa,iBAAiB;EAC3B,YAAY,UAAU;EACrB,WAAW;EACX,YAAY;CACd;EACC,YAAY,SAAS;EACpB,WAAW;EACX,YAAY;CACd;EACC,YAAY,WAAW;EACtB,WAAW;EACX,YAAY;CACd;EACC,YAAY,WAAW;EACtB,WAAW;EACX,YAAY;CACd;EACC,YAAY,SAAS;EACpB,WAAW;EACX,YAAY;CACd;EACC,YAAY,UAAU;EACrB,WAAW;EACX,YAAY;CACd;EACC,YAAY,QAAQ;EACnB,WAAW;EACX,YAAY;CACd;EACC,YAAY,QAAQ;EACnB,WAAW;EACX,YAAY;CACd;EACC,YAAY,SAAS;EACpB,WAAW;EACX,YAAY;CACd;CACA,SAAS;EACP,WAAW;EACX,YAAY;CACd;AACF;;;;;;;ACvDA,IAAa,SAAS;CAClB,QAAQ;EACJ,aAAa;GACT,OAAO;IACH,OAAO;KAAE,GAAG;KAAG,GAAG;KAAG,GAAG;KAAM,GAAG;IAAE;IACnC,MAAM;KAAE,GAAG;KAAG,GAAG;KAAG,GAAG;KAAM,GAAG;IAAE;GACtC;GACA,OAAO;IAAE,OAAO;IAAG,MAAM;GAAK;GAC9B,OAAO;GACP,KAAK;IACD,OAAO;IACP,UAAU;GACd;EACJ;EACA,SAAS;GACL,OAAO;IACH,OAAO;KAAE,GAAG;KAAG,GAAG;KAAG,GAAG;KAAM,GAAG;IAAI;IACrC,MAAM;KAAE,GAAG;KAAG,GAAG;KAAG,GAAG;KAAI,GAAG;IAAI;GACtC;GACA,OAAO;IAAE,OAAO;IAAG,MAAM;GAAK;GAC9B,OAAO;GACP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IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;EACJ;EACA,OAAO;GACH,UAAU;IACN,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ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xB,OAAO;CACR;CACA,OAAO;AACR;;;;;;;;;;;;AAYA,SAAS,eAAe,QAAQ,MAAM;CACrC,OAAO,WAAW,MAAM;EACvB,MAAM,OAAO,yBAAyB,QAAQ,IAAI;EAClD,IAAI,MAAM,OAAO,KAAK,MAAM,QAAQ,KAAK,GAAG,IAAI;EAChD,SAAS,eAAe,MAAM;CAC/B;CACA,OAAO;AACR;AACA,SAAS,QAAQ,OAAO;CACvB,IAAI;EACH,WAAW,OAAO,EAAE;EACpB,OAAO;CACR,SAAS,SAAS;EACjB,OAAO;CACR;AACD;AACA,IAAM,SAAS,OAAO;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,QAAQ,OAAO;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,aAAa,OAAO;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,gBAAgB,OAAO;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,WAAW,OAAO;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,mBAAmB,OAAO;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,OAAO,OAAO,CAAC,OAAO,CAAC;AAC7B,IAAM,OAAO,OAAO;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,MAAM,OAAO;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAM,SAAS,OAAO;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;C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