@knime/kds-table 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/index.css +440 -284
  3. package/dist/index.js +1154 -1769
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/components/TableCore.vue.d.ts +5 -3
  6. package/dist/src/components/TableCore.vue.d.ts.map +1 -1
  7. package/dist/src/components/TableCoreVirtual.vue.d.ts +1 -1
  8. package/dist/src/components/TableCoreVirtual.vue.d.ts.map +1 -1
  9. package/dist/src/components/TableUI.vue.d.ts +1297 -1696
  10. package/dist/src/components/TableUI.vue.d.ts.map +1 -1
  11. package/dist/src/components/TableUIWithAutoSizeCalculation.vue.d.ts +2258 -8118
  12. package/dist/src/components/TableUIWithAutoSizeCalculation.vue.d.ts.map +1 -1
  13. package/dist/src/components/VirtualRow.vue.d.ts +1 -1
  14. package/dist/src/components/VirtualRow.vue.d.ts.map +1 -1
  15. package/dist/src/components/composables/useDataValueViews.d.ts +2 -2
  16. package/dist/src/components/composables/useDataValueViews.d.ts.map +1 -1
  17. package/dist/src/components/composables/useHeaderMenuItems.d.ts +4 -3
  18. package/dist/src/components/composables/useHeaderMenuItems.d.ts.map +1 -1
  19. package/dist/src/components/control/PageControls.vue.d.ts +29 -7
  20. package/dist/src/components/control/PageControls.vue.d.ts.map +1 -1
  21. package/dist/src/components/control/TableActionBar.vue.d.ts +24 -27
  22. package/dist/src/components/control/TableActionBar.vue.d.ts.map +1 -1
  23. package/dist/src/components/control/actionbar/FilterControl.vue.d.ts +12 -12
  24. package/dist/src/components/control/actionbar/FilterControl.vue.d.ts.map +1 -1
  25. package/dist/src/components/control/actionbar/FilterControlBody.vue.d.ts +5 -5
  26. package/dist/src/components/control/actionbar/FilterControlBody.vue.d.ts.map +1 -1
  27. package/dist/src/components/control/actionbar/SortControl.vue.d.ts +4 -4
  28. package/dist/src/components/control/actionbar/SortControl.vue.d.ts.map +1 -1
  29. package/dist/src/components/control/actionbar/filterConfigActive.d.ts +5 -5
  30. package/dist/src/components/control/actionbar/filterConfigActive.d.ts.map +1 -1
  31. package/dist/src/components/layout/Cell.vue.d.ts +0 -4
  32. package/dist/src/components/layout/Cell.vue.d.ts.map +1 -1
  33. package/dist/src/components/layout/CellProps.d.ts +3 -6
  34. package/dist/src/components/layout/CellProps.d.ts.map +1 -1
  35. package/dist/src/components/layout/CellRenderer.vue.d.ts.map +1 -1
  36. package/dist/src/components/layout/CellRendererProps.d.ts +0 -2
  37. package/dist/src/components/layout/CellRendererProps.d.ts.map +1 -1
  38. package/dist/src/components/layout/Header.vue.d.ts +252 -411
  39. package/dist/src/components/layout/Header.vue.d.ts.map +1 -1
  40. package/dist/src/components/layout/HeaderCell.vue.d.ts +190 -0
  41. package/dist/src/components/layout/HeaderCell.vue.d.ts.map +1 -0
  42. package/dist/src/components/layout/Row.vue.d.ts +4 -2
  43. package/dist/src/components/layout/Row.vue.d.ts.map +1 -1
  44. package/dist/src/components/ui/CellSelectionOverlay.vue.d.ts.map +1 -1
  45. package/dist/src/components/ui/CellSelectionOverlayProps.d.ts +1 -1
  46. package/dist/src/components/ui/CellSelectionOverlayProps.d.ts.map +1 -1
  47. package/dist/src/components/ui/EmptyRow.vue.d.ts +1 -1
  48. package/dist/src/components/ui/EmptyRow.vue.d.ts.map +1 -1
  49. package/dist/src/config/table.config.d.ts +11 -21
  50. package/dist/src/config/table.config.d.ts.map +1 -1
  51. package/dist/src/constants.d.ts.map +1 -0
  52. package/dist/src/index.d.ts +14 -17
  53. package/dist/src/index.d.ts.map +1 -1
  54. package/dist/src/types/ActionConfig.d.ts +16 -0
  55. package/dist/src/types/ActionConfig.d.ts.map +1 -0
  56. package/dist/src/types/ColumnConfig.d.ts +44 -0
  57. package/dist/src/types/ColumnConfig.d.ts.map +1 -0
  58. package/dist/src/types/ColumnState.d.ts +18 -0
  59. package/dist/src/types/ColumnState.d.ts.map +1 -0
  60. package/dist/src/types/FilterConfig.d.ts +10 -3
  61. package/dist/src/types/FilterConfig.d.ts.map +1 -1
  62. package/dist/src/types/PageConfig.d.ts +13 -0
  63. package/dist/src/types/PageConfig.d.ts.map +1 -0
  64. package/dist/src/types/RowConfig.d.ts +15 -0
  65. package/dist/src/types/RowConfig.d.ts.map +1 -0
  66. package/dist/src/types/SubMenuConfig.d.ts +11 -0
  67. package/dist/src/types/SubMenuConfig.d.ts.map +1 -0
  68. package/dist/src/types/TableConfig.d.ts +34 -39
  69. package/dist/src/types/TableConfig.d.ts.map +1 -1
  70. package/dist/src/{util → utils}/index.d.ts +1 -1
  71. package/dist/src/utils/index.d.ts.map +1 -0
  72. package/package.json +5 -5
  73. package/dist/src/config/time.config.d.ts +0 -53
  74. package/dist/src/config/time.config.d.ts.map +0 -1
  75. package/dist/src/types/DataConfig.d.ts +0 -40
  76. package/dist/src/types/DataConfig.d.ts.map +0 -1
  77. package/dist/src/util/constants.d.ts.map +0 -1
  78. package/dist/src/util/getColumnDomains.d.ts +0 -7
  79. package/dist/src/util/getColumnDomains.d.ts.map +0 -1
  80. package/dist/src/util/getFilterConfigs.d.ts +0 -11
  81. package/dist/src/util/getFilterConfigs.d.ts.map +0 -1
  82. package/dist/src/util/getNextPage.d.ts +0 -2
  83. package/dist/src/util/getNextPage.d.ts.map +0 -1
  84. package/dist/src/util/getWrappedArondNextElement.d.ts +0 -6
  85. package/dist/src/util/getWrappedArondNextElement.d.ts.map +0 -1
  86. package/dist/src/util/index.d.ts.map +0 -1
  87. package/dist/src/util/isSinglePage.d.ts +0 -3
  88. package/dist/src/util/isSinglePage.d.ts.map +0 -1
  89. package/dist/src/util/processSelection.d.ts +0 -2
  90. package/dist/src/util/processSelection.d.ts.map +0 -1
  91. package/dist/src/util/transform/filter.d.ts +0 -8
  92. package/dist/src/util/transform/filter.d.ts.map +0 -1
  93. package/dist/src/util/transform/group.d.ts +0 -7
  94. package/dist/src/util/transform/group.d.ts.map +0 -1
  95. package/dist/src/util/transform/paginate.d.ts +0 -4
  96. package/dist/src/util/transform/paginate.d.ts.map +0 -1
  97. package/dist/src/util/transform/search.d.ts +0 -3
  98. package/dist/src/util/transform/search.d.ts.map +0 -1
  99. package/dist/src/util/transform/sort.d.ts +0 -2
  100. package/dist/src/util/transform/sort.d.ts.map +0 -1
  101. /package/dist/src/{util/constants.d.ts → constants.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -1,74 +1,6 @@
1
- import { computed, unref, watch, ref, isRef, getCurrentScope, onScopeDispose, getCurrentInstance, onMounted, inject, provide, defineComponent, openBlock, createElementBlock, withModifiers, renderSlot, shallowRef, toValue, readonly, createPropsRestProxy, useModel, createBlock, mergeProps, mergeModels, useTemplateRef, watchEffect, nextTick, withCtx, createVNode, useAttrs, useId, Fragment, createCommentVNode, normalizeClass, createElementVNode, toDisplayString, resolveComponent, withKeys, normalizeStyle, renderList, onUnmounted, defineAsyncComponent, resolveDynamicComponent, h as h$1, useSlots, markRaw, createTextVNode, toRef, useCssVars, onBeforeUnmount, reactive, createSlots, normalizeProps, guardReactiveProps } from 'vue';
1
+ import { computed, unref, watch, ref, isRef, getCurrentScope, onScopeDispose, getCurrentInstance, onMounted, inject, provide, defineComponent, openBlock, createElementBlock, withModifiers, renderSlot, shallowRef, toValue, readonly, createPropsRestProxy, useModel, createBlock, mergeProps, mergeModels, useTemplateRef, watchEffect, withCtx, createVNode, createCommentVNode, useAttrs, useId, Fragment, normalizeClass, createElementVNode, toDisplayString, resolveComponent, withKeys, normalizeStyle, renderList, onUnmounted, defineAsyncComponent, nextTick, resolveDynamicComponent, h as h$1, useSlots, markRaw, createTextVNode, toRef, useCssVars, onBeforeUnmount, reactive, createSlots, normalizeProps, guardReactiveProps } from 'vue';
2
2
 
3
- import './index.css';const defaultTimeFilter = "All time";
4
- const checkTimeFilter = (inDateString, timeFilterConfig) => {
5
- try {
6
- const now = /* @__PURE__ */ new Date();
7
- if (typeof inDateString !== "string" || !("getFn" in timeFilterConfig) || !("setFn" in timeFilterConfig) || !("val" in timeFilterConfig)) {
8
- return true;
9
- }
10
- const utcDateTime = inDateString.split(".")[0];
11
- const di = new Date(utcDateTime);
12
- if (!(di instanceof Date) || Number.isNaN(di.getTime())) {
13
- return true;
14
- }
15
- const timeBoundsMs = now[timeFilterConfig.setFn](
16
- now[timeFilterConfig.getFn]() - timeFilterConfig.val
17
- );
18
- return di.getTime() - timeBoundsMs >= 0;
19
- } catch (_err) {
20
- return true;
21
- }
22
- };
23
- const tableTimeFilters = {
24
- "Last day": {
25
- getFn: "getDate",
26
- setFn: "setDate",
27
- val: 1
28
- },
29
- "Last week": {
30
- getFn: "getDate",
31
- setFn: "setDate",
32
- val: 7
33
- },
34
- "Last month": {
35
- getFn: "getMonth",
36
- setFn: "setMonth",
37
- val: 1
38
- },
39
- "Last 3 months": {
40
- getFn: "getMonth",
41
- setFn: "setMonth",
42
- val: 3
43
- },
44
- "Last 6 months": {
45
- getFn: "getMonth",
46
- setFn: "setMonth",
47
- val: 6
48
- },
49
- "Last year": {
50
- getFn: "getFullYear",
51
- setFn: "setFullYear",
52
- val: 1
53
- },
54
- "All time": {}
55
- };
56
- const months = {
57
- 1: "Jan.",
58
- 2: "Feb.",
59
- 3: "Mar.",
60
- 4: "Apr.",
61
- 5: "May",
62
- 6: "June",
63
- 7: "July",
64
- 8: "Aug.",
65
- 9: "Sept.",
66
- 10: "Oct.",
67
- 11: "Nov.",
68
- 12: "Dec."
69
- };
70
-
71
- const defaultPageSize = 10;
3
+ import './index.css';const defaultPageSize = 10;
72
4
  const tablePageSizes = [5, 10, 25, 50, 100];
73
5
  const filterComponents = {
74
6
  Multiselect: {
@@ -150,76 +82,12 @@ const columnSortText = {
150
82
  descending: "Descending"
151
83
  }
152
84
  };
153
- const valueTypeFormatters = {
154
- Nominal: (val) => val,
155
- String: (val) => val,
156
- DateTime: (val) => {
157
- try {
158
- const separator = val.includes(".") ? "." : "+";
159
- const utcDateTime = val.split(separator)[0];
160
- const di = new Date(utcDateTime);
161
- const hrdp = {
162
- month: di.getMonth() + 1,
163
- day: di.getDate(),
164
- year: di.getFullYear(),
165
- hour: di.getHours(),
166
- minute: di.getMinutes()
167
- };
168
- if (Object.values(hrdp).some((part) => !part && part !== 0)) {
169
- throw new SyntaxError("Can't parse date.");
170
- }
171
- const pad2 = (val2) => val2.toString().padStart(2, "0");
172
- return (
173
- // @ts-expect-error - we know that month is a valid index for the months array
174
- `${months[hrdp.month]} ${pad2(hrdp.day)}, ${hrdp.year}, ${pad2(hrdp.hour)}:${pad2(hrdp.minute)}`
175
- );
176
- } catch (_error) {
177
- return val;
178
- }
179
- },
180
- Number: (val) => val?.toString(),
181
- Boolean: (val) => val?.toString(),
182
- Array: (val) => val?.length ? `${val.length} items` : "-",
183
- Object: (val) => val ? `${Object.keys(val).length} items` : "-"
184
- };
185
- const typeFormatters = (type) => (val) => valueTypeFormatters[type](val);
186
-
187
- const isNonEmptyObject = (val) => val !== null && typeof val === "object" && Object.getOwnPropertyNames(val).length > 0;
188
- const isObjectRepresentation = (val) => {
189
- const possibleKeys = ["value", "metadata", "color"];
190
- return isNonEmptyObject(val) && Object.getOwnPropertyNames(val).every((key) => possibleKeys.includes(key));
191
- };
192
- const unpackObjectRepresentation = (val) => {
193
- if (isObjectRepresentation(val)) {
194
- if (val.hasOwnProperty("metadata") && !val.hasOwnProperty("value")) {
195
- return null;
196
- }
197
- return val.value;
198
- }
199
- return val;
200
- };
201
- const getColor = (val) => {
202
- if (isObjectRepresentation(val) && val.hasOwnProperty("color")) {
203
- const color = val.color;
204
- return typeof color === "undefined" ? null : color;
205
- }
206
- return null;
207
- };
208
- const isMissingValue = (val) => val === null || isObjectRepresentation(val) && val?.hasOwnProperty("metadata");
209
- const getMissingValueMessage = (cellData) => {
210
- const metadata = cellData?.metadata;
211
- const missingValueMsg = typeof metadata === "string" ? ` (${metadata})` : "";
212
- return `Missing Value${missingValueMsg}`;
213
- };
214
- const isEmpty = (val) => typeof unpackObjectRepresentation(val) === "undefined";
215
- const getPropertiesFromColumns = (columnConfigs, key) => columnConfigs.map((colConfig) => colConfig[key]);
216
85
 
217
86
  const kdsCoreBorderWidthXs = 1;
218
87
  const kdsDimensionComponentHeight1p75x = 28;
219
88
  const kdsDimensionComponentHeight2p5x = 40;
220
89
  const kdsDimensionComponentWidth1x = 16;
221
90
  const kdsDimensionComponentWidth2x = 32;
222
- const kdsSpacingContainer0p10x = 1;
223
91
  const kdsSpacingContainer0p37x = 6;
224
92
  const kdsSpacingContainer0p5x = 8;
225
93
  const kdsSpacingContainer0p75x = 12;
@@ -235,7 +103,6 @@ const COMPACT_ROW_PADDING_TOP_BOTTOM = kdsSpacingContainer0p37x;
235
103
  const CELL_PADDING_HORIZONTAL = kdsSpacingContainer0p5x;
236
104
  const MIN_ROW_HEIGHT = COMPACT_ROW_HEIGHT;
237
105
  const HEADER_HEIGHT = kdsDimensionComponentHeight2p5x + 2 * kdsCoreBorderWidthXs;
238
- const MAX_SUB_MENU_WIDTH = 160;
239
106
  const ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY = 100;
240
107
  const COLUMN_RESIZE_DRAG_HANDLE_WIDTH = 5;
241
108
  const EXPAND_BUTTON_WIDTH = kdsDimensionComponentWidth1x;
@@ -248,6 +115,35 @@ const constants = {
248
115
  CELL_PADDING_HORIZONTAL
249
116
  };
250
117
 
118
+ const isNonEmptyObject = (val) => val !== null && typeof val === "object" && Object.getOwnPropertyNames(val).length > 0;
119
+ const isObjectRepresentation = (val) => {
120
+ const possibleKeys = ["value", "metadata", "color"];
121
+ return isNonEmptyObject(val) && Object.getOwnPropertyNames(val).every((key) => possibleKeys.includes(key));
122
+ };
123
+ const unpackObjectRepresentation = (val) => {
124
+ if (isObjectRepresentation(val)) {
125
+ if (val.hasOwnProperty("metadata") && !val.hasOwnProperty("value")) {
126
+ return null;
127
+ }
128
+ return val.value;
129
+ }
130
+ return val;
131
+ };
132
+ const getColor = (val) => {
133
+ if (isObjectRepresentation(val) && val.hasOwnProperty("color")) {
134
+ const color = val.color;
135
+ return typeof color === "undefined" ? null : color;
136
+ }
137
+ return null;
138
+ };
139
+ const isMissingValue = (val) => val === null || isObjectRepresentation(val) && val?.hasOwnProperty("metadata");
140
+ const getMissingValueMessage = (cellData) => {
141
+ const metadata = cellData?.metadata;
142
+ const missingValueMsg = typeof metadata === "string" ? ` (${metadata})` : "";
143
+ return `Missing Value${missingValueMsg}`;
144
+ };
145
+ const getPropertiesFromColumns = (columnConfigs, key) => columnConfigs.map((colConfig) => colConfig[key]);
146
+
251
147
  var B$1 = Object.defineProperty;
252
148
  var b$1 = (t, e, r) => e in t ? B$1(t, e, { enumerable: true, configurable: true, writable: true, value: r }) : t[e] = r;
253
149
  var u$1 = (t, e, r) => b$1(t, typeof e != "symbol" ? e + "" : e, r);
@@ -507,8 +403,8 @@ const getMetaOrCtrlKey = () => {
507
403
 
508
404
  const injectionKey$4 = /* @__PURE__ */ Symbol("dataValueViewsIsShown");
509
405
  const useDataValueViews = () => inject(injectionKey$4);
510
- const provideDataValueViewsIsShown = (tableConfig, closeDataValueView) => provide(injectionKey$4, {
511
- isShown: computed(() => Boolean(tableConfig.value.dataValueViewIsShown)),
406
+ const provideDataValueViewsIsShown = (tableState, closeDataValueView) => provide(injectionKey$4, {
407
+ isShown: computed(() => Boolean(tableState.value.dataValueViewIsShown)),
512
408
  close: closeDataValueView
513
409
  });
514
410
 
@@ -538,7 +434,7 @@ const useStartEditingKeydown = ({
538
434
  return { onKeydown };
539
435
  };
540
436
 
541
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
437
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
542
438
  __name: "TableBodyNavigatable",
543
439
  emits: ["moveSelection", "clearSelection", "expandSelectedCell", "startEditing", "bodyFocusin", "bodyFocusout"],
544
440
  setup(__props, { emit: __emit }) {
@@ -621,7 +517,7 @@ const _export_sfc$1 = (sfc, props) => {
621
517
  return target;
622
518
  };
623
519
 
624
- const TableBodyNavigatable = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["__scopeId", "data-v-70f2c330"]]);
520
+ const TableBodyNavigatable = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__scopeId", "data-v-70f2c330"]]);
625
521
 
626
522
  //#endregion
627
523
  //#region tryOnScopeDispose/index.ts
@@ -851,14 +747,14 @@ const kdsAvatarSize = {
851
747
  XLARGE: "xlarge"
852
748
  };
853
749
 
854
- const _hoisted_1$15 = ["role", "title", "aria-hidden", "aria-label", "data-color"];
855
- const _hoisted_2$H = ["src"];
856
- const _hoisted_3$u = {
750
+ const _hoisted_1$18 = ["role", "title", "aria-hidden", "aria-label", "data-color"];
751
+ const _hoisted_2$J = ["src"];
752
+ const _hoisted_3$v = {
857
753
  key: 1,
858
754
  class: "kds-avatar-initials",
859
755
  "aria-hidden": "true"
860
756
  };
861
- const _sfc_main$1G = /* @__PURE__ */ defineComponent({
757
+ const _sfc_main$1J = /* @__PURE__ */ defineComponent({
862
758
  __name: "KdsAvatar",
863
759
  props: {
864
760
  initials: {},
@@ -922,10 +818,10 @@ const _sfc_main$1G = /* @__PURE__ */ defineComponent({
922
818
  alt: "",
923
819
  "aria-hidden": "true",
924
820
  onError: onImageError
925
- }, null, 40, _hoisted_2$H)) : (openBlock(), createElementBlock("div", _hoisted_3$u, [
821
+ }, null, 40, _hoisted_2$J)) : (openBlock(), createElementBlock("div", _hoisted_3$v, [
926
822
  createElementVNode("span", null, toDisplayString(displayedInitials.value), 1)
927
823
  ]))
928
- ], 10, _hoisted_1$15);
824
+ ], 10, _hoisted_1$18);
929
825
  };
930
826
  }
931
827
  });
@@ -938,7 +834,7 @@ const _export_sfc = (sfc, props) => {
938
834
  return target;
939
835
  };
940
836
 
941
- const KdsAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["__scopeId", "data-v-9e1a5abe"]]);
837
+ const KdsAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$1J, [["__scopeId", "data-v-9e1a5abe"]]);
942
838
 
943
839
  const __variableDynamicImportRuntimeHelper = (glob$1, path$13, segs) => {
944
840
  const v = glob$1[path$13];
@@ -995,7 +891,7 @@ function useIcon({
995
891
  };
996
892
  }
997
893
 
998
- const _sfc_main$1E = /* @__PURE__ */ defineComponent({
894
+ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
999
895
  __name: "KdsIcon",
1000
896
  props: {
1001
897
  name: {},
@@ -1025,7 +921,7 @@ const _sfc_main$1E = /* @__PURE__ */ defineComponent({
1025
921
  }
1026
922
  });
1027
923
 
1028
- const KdsIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["__scopeId", "data-v-bff4f419"]]);
924
+ const KdsIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["__scopeId", "data-v-bff4f419"]]);
1029
925
 
1030
926
  const ID_TO_ICON_MAP = {
1031
927
  // Flow Variables
@@ -1364,8 +1260,8 @@ Object.fromEntries(
1364
1260
  typeIconNames.map((name) => [toEnumKey(name), name])
1365
1261
  );
1366
1262
 
1367
- const _hoisted_1$13 = ["title"];
1368
- const _sfc_main$1D = /* @__PURE__ */ defineComponent({
1263
+ const _hoisted_1$16 = ["title"];
1264
+ const _sfc_main$1G = /* @__PURE__ */ defineComponent({
1369
1265
  __name: "KdsDataType",
1370
1266
  props: {
1371
1267
  iconName: { default: "unknown-datatype" },
@@ -1406,12 +1302,12 @@ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
1406
1302
  "aria-hidden": "true",
1407
1303
  focusable: "false"
1408
1304
  }, null, 8, ["class"]))
1409
- ], 10, _hoisted_1$13);
1305
+ ], 10, _hoisted_1$16);
1410
1306
  };
1411
1307
  }
1412
1308
  });
1413
1309
 
1414
- const KdsDataType = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["__scopeId", "data-v-38e9537f"]]);
1310
+ const KdsDataType = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["__scopeId", "data-v-38e9537f"]]);
1415
1311
 
1416
1312
  const kdsBadgeVariant = {
1417
1313
  NEUTRAL: "neutral"};
@@ -1419,8 +1315,8 @@ const kdsBadgeSize = {
1419
1315
  XSMALL: "xsmall"
1420
1316
  };
1421
1317
 
1422
- const _hoisted_1$12 = { class: "label-wrapper" };
1423
- const _sfc_main$1C = /* @__PURE__ */ defineComponent({
1318
+ const _hoisted_1$15 = { class: "label-wrapper" };
1319
+ const _sfc_main$1F = /* @__PURE__ */ defineComponent({
1424
1320
  __name: "KdsBadge",
1425
1321
  props: {
1426
1322
  label: {},
@@ -1442,24 +1338,24 @@ const _sfc_main$1C = /* @__PURE__ */ defineComponent({
1442
1338
  name: __props.leadingIcon,
1443
1339
  size: sizeToIconSize[__props.size]
1444
1340
  }, null, 8, ["name", "size"])) : createCommentVNode("", true),
1445
- createElementVNode("span", _hoisted_1$12, toDisplayString(__props.label), 1)
1341
+ createElementVNode("span", _hoisted_1$15, toDisplayString(__props.label), 1)
1446
1342
  ], 2);
1447
1343
  };
1448
1344
  }
1449
1345
  });
1450
1346
 
1451
- const KdsBadge = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["__scopeId", "data-v-df64f7cf"]]);
1347
+ const KdsBadge = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["__scopeId", "data-v-df64f7cf"]]);
1452
1348
  const kdsColorSwatchSize = {
1453
1349
  SMALL: "small"};
1454
1350
 
1455
- const _hoisted_1$10 = ["role", "title", "aria-hidden", "aria-label"];
1351
+ const _hoisted_1$13 = ["role", "title", "aria-hidden", "aria-label"];
1456
1352
  const RGBA_SHORT_HEX_LENGTH = 4;
1457
1353
  const RGBA_LONG_HEX_LENGTH = 8;
1458
1354
  const ALPHA_NIBBLE_INDEX = 3;
1459
1355
  const ALPHA_BYTE_START = 6;
1460
1356
  const RGB_SHORT_HEX_LENGTH = 3;
1461
1357
  const RGB_LONG_HEX_LENGTH = 6;
1462
- const _sfc_main$1A = /* @__PURE__ */ defineComponent({
1358
+ const _sfc_main$1D = /* @__PURE__ */ defineComponent({
1463
1359
  __name: "KdsColorSwatch",
1464
1360
  props: {
1465
1361
  color: {},
@@ -1534,12 +1430,12 @@ const _sfc_main$1A = /* @__PURE__ */ defineComponent({
1534
1430
  style: normalizeStyle(swatchStyle.value),
1535
1431
  "aria-hidden": hasTitle.value ? void 0 : "true",
1536
1432
  "aria-label": hasTitle.value ? accessibleTitle.value : void 0
1537
- }, null, 14, _hoisted_1$10);
1433
+ }, null, 14, _hoisted_1$13);
1538
1434
  };
1539
1435
  }
1540
1436
  });
1541
1437
 
1542
- const KdsColorSwatch = /* @__PURE__ */ _export_sfc(_sfc_main$1A, [["__scopeId", "data-v-91e0130d"]]);
1438
+ const KdsColorSwatch = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["__scopeId", "data-v-91e0130d"]]);
1543
1439
 
1544
1440
  ref(false);
1545
1441
 
@@ -1573,9 +1469,9 @@ function useKdsIsTruncated(elementRef) {
1573
1469
  return { isTruncated };
1574
1470
  }
1575
1471
 
1576
- const _hoisted_1$$ = ["title", "aria-label"];
1577
- const _hoisted_2$E = ["title"];
1578
- const _sfc_main$1z = /* @__PURE__ */ defineComponent({
1472
+ const _hoisted_1$12 = ["title", "aria-label"];
1473
+ const _hoisted_2$G = ["title"];
1474
+ const _sfc_main$1C = /* @__PURE__ */ defineComponent({
1579
1475
  __name: "KdsLiveStatus",
1580
1476
  props: {
1581
1477
  status: { default: "red" },
@@ -1594,7 +1490,7 @@ const _sfc_main$1z = /* @__PURE__ */ defineComponent({
1594
1490
  return openBlock(), createElementBlock("span", {
1595
1491
  class: normalizeClass(["kds-live-status", __props.status, `size-${__props.size}`]),
1596
1492
  role: "img",
1597
- title: accessibleTitle.value,
1493
+ title: !__props.label ? accessibleTitle.value : void 0,
1598
1494
  "aria-label": accessibleTitle.value
1599
1495
  }, [
1600
1496
  _cache[0] || (_cache[0] = createElementVNode("span", { class: "dot" }, null, -1)),
@@ -1604,16 +1500,16 @@ const _sfc_main$1z = /* @__PURE__ */ defineComponent({
1604
1500
  ref: labelEl,
1605
1501
  class: "label",
1606
1502
  title: unref(isTruncated) ? __props.label : void 0
1607
- }, toDisplayString(__props.label), 9, _hoisted_2$E)) : createCommentVNode("", true)
1608
- ], 10, _hoisted_1$$);
1503
+ }, toDisplayString(__props.label), 9, _hoisted_2$G)) : createCommentVNode("", true)
1504
+ ], 10, _hoisted_1$12);
1609
1505
  };
1610
1506
  }
1611
1507
  });
1612
1508
 
1613
- const KdsLiveStatus = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["__scopeId", "data-v-01555495"]]);
1509
+ const KdsLiveStatus = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["__scopeId", "data-v-f20c5c00"]]);
1614
1510
 
1615
- const _hoisted_1$_ = ["data-style"];
1616
- const _sfc_main$1y = /* @__PURE__ */ defineComponent({
1511
+ const _hoisted_1$11 = ["data-style"];
1512
+ const _sfc_main$1B = /* @__PURE__ */ defineComponent({
1617
1513
  __name: "KdsLoadingSpinner",
1618
1514
  props: {
1619
1515
  size: { default: "medium" },
@@ -1638,14 +1534,14 @@ const _sfc_main$1y = /* @__PURE__ */ defineComponent({
1638
1534
  cy: "60",
1639
1535
  r: "50"
1640
1536
  }, null, -1)
1641
- ])], 10, _hoisted_1$_);
1537
+ ])], 10, _hoisted_1$11);
1642
1538
  };
1643
1539
  }
1644
1540
  });
1645
1541
 
1646
- const KdsLoadingSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["__scopeId", "data-v-54835dc0"]]);
1542
+ const KdsLoadingSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["__scopeId", "data-v-54835dc0"]]);
1647
1543
 
1648
- const _sfc_main$1w = /* @__PURE__ */ defineComponent({
1544
+ const _sfc_main$1z = /* @__PURE__ */ defineComponent({
1649
1545
  __name: "KdsMissingValueIcon",
1650
1546
  props: {
1651
1547
  size: {}
@@ -1661,22 +1557,22 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
1661
1557
  }
1662
1558
  });
1663
1559
 
1664
- const KdsMissingValueIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["__scopeId", "data-v-df682150"]]);
1560
+ const KdsMissingValueIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["__scopeId", "data-v-df682150"]]);
1665
1561
 
1666
- const _sfc_main$1u = { };
1562
+ const _sfc_main$1x = { };
1667
1563
 
1668
- const _hoisted_1$X = { class: "kds-divider" };
1564
+ const _hoisted_1$_ = { class: "kds-divider" };
1669
1565
 
1670
1566
  function _sfc_render$1$1(_ctx, _cache) {
1671
- return (openBlock(), createElementBlock("hr", _hoisted_1$X))
1567
+ return (openBlock(), createElementBlock("hr", _hoisted_1$_))
1672
1568
  }
1673
- const KdsDivider = /*#__PURE__*/_export_sfc(_sfc_main$1u, [['render',_sfc_render$1$1],['__scopeId',"data-v-4d059bd3"]]);
1569
+ const KdsDivider = /*#__PURE__*/_export_sfc(_sfc_main$1x, [['render',_sfc_render$1$1],['__scopeId',"data-v-4d059bd3"]]);
1674
1570
 
1675
- const _hoisted_1$W = {
1571
+ const _hoisted_1$Z = {
1676
1572
  key: 0,
1677
1573
  class: "label"
1678
1574
  };
1679
- const _sfc_main$1t = /* @__PURE__ */ defineComponent({
1575
+ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
1680
1576
  __name: "BaseButton",
1681
1577
  props: {
1682
1578
  dataTestId: {},
@@ -1740,7 +1636,7 @@ const _sfc_main$1t = /* @__PURE__ */ defineComponent({
1740
1636
  size: iconSize.value
1741
1637
  }, null, 8, ["name", "size"])) : createCommentVNode("", true)
1742
1638
  ], true),
1743
- props.label ? (openBlock(), createElementBlock("span", _hoisted_1$W, toDisplayString(props.label), 1)) : createCommentVNode("", true),
1639
+ props.label ? (openBlock(), createElementBlock("span", _hoisted_1$Z, toDisplayString(props.label), 1)) : createCommentVNode("", true),
1744
1640
  props.trailingIcon && props.label ? (openBlock(), createBlock(KdsIcon, {
1745
1641
  key: 1,
1746
1642
  name: props.trailingIcon,
@@ -1753,9 +1649,9 @@ const _sfc_main$1t = /* @__PURE__ */ defineComponent({
1753
1649
  }
1754
1650
  });
1755
1651
 
1756
- const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["__scopeId", "data-v-24ade73a"]]);
1652
+ const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["__scopeId", "data-v-24ade73a"]]);
1757
1653
 
1758
- const _sfc_main$1s = /* @__PURE__ */ defineComponent({
1654
+ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
1759
1655
  __name: "KdsButton",
1760
1656
  props: {
1761
1657
  dataTestId: {},
@@ -1821,7 +1717,7 @@ function isExternalUrl(url) {
1821
1717
  return true;
1822
1718
  }
1823
1719
 
1824
- const _sfc_main$1r = /* @__PURE__ */ defineComponent({
1720
+ const _sfc_main$1u = /* @__PURE__ */ defineComponent({
1825
1721
  __name: "KdsLinkButton",
1826
1722
  props: {
1827
1723
  dataTestId: {},
@@ -1872,7 +1768,7 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
1872
1768
  }
1873
1769
  });
1874
1770
 
1875
- const _sfc_main$1p = /* @__PURE__ */ defineComponent({
1771
+ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
1876
1772
  __name: "KdsToggleButton",
1877
1773
  props: /* @__PURE__ */ mergeModels({
1878
1774
  dataTestId: {},
@@ -2129,7 +2025,7 @@ const useStableItemIds = (options) => {
2129
2025
  return { itemsWithPrefix, idPrefix, toUnprefixedId };
2130
2026
  };
2131
2027
 
2132
- const _sfc_main$1n = /* @__PURE__ */ defineComponent({
2028
+ const _sfc_main$1q = /* @__PURE__ */ defineComponent({
2133
2029
  __name: "ListItemAccessory",
2134
2030
  props: {
2135
2031
  accessory: {},
@@ -2175,14 +2071,14 @@ const kdsListItemAccessorySize = {
2175
2071
  LARGE: "large"
2176
2072
  };
2177
2073
 
2178
- const _hoisted_1$T = ["id", "role", "aria-selected", "aria-disabled"];
2179
- const _hoisted_2$z = {
2074
+ const _hoisted_1$W = ["id", "role", "aria-selected", "aria-disabled"];
2075
+ const _hoisted_2$B = {
2180
2076
  key: 0,
2181
2077
  class: "accessory"
2182
2078
  };
2183
- const _hoisted_3$q = { class: "content" };
2184
- const _hoisted_4$m = ["title"];
2185
- const _hoisted_5$c = {
2079
+ const _hoisted_3$r = { class: "content" };
2080
+ const _hoisted_4$n = ["title"];
2081
+ const _hoisted_5$d = {
2186
2082
  key: 0,
2187
2083
  class: "prefix"
2188
2084
  };
@@ -2196,7 +2092,7 @@ const _hoisted_9$2 = {
2196
2092
  key: 3,
2197
2093
  class: "trailing-item-reserve-space"
2198
2094
  };
2199
- const _sfc_main$1m = /* @__PURE__ */ defineComponent({
2095
+ const _sfc_main$1p = /* @__PURE__ */ defineComponent({
2200
2096
  __name: "KdsListItem",
2201
2097
  props: {
2202
2098
  id: {},
@@ -2254,25 +2150,25 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
2254
2150
  ]),
2255
2151
  onClick
2256
2152
  }, [
2257
- props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$z, [
2258
- createVNode(_sfc_main$1n, {
2153
+ props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$B, [
2154
+ createVNode(_sfc_main$1q, {
2259
2155
  accessory: props.accessory,
2260
2156
  size: accessorySize.value,
2261
2157
  disabled: __props.disabled
2262
2158
  }, null, 8, ["accessory", "size", "disabled"])
2263
2159
  ])) : createCommentVNode("", true),
2264
- createElementVNode("span", _hoisted_3$q, [
2160
+ createElementVNode("span", _hoisted_3$r, [
2265
2161
  createElementVNode("span", {
2266
2162
  ref_key: "labelEl",
2267
2163
  ref: labelEl,
2268
2164
  class: "label",
2269
2165
  title: unref(isLabelTruncated) ? props.text : void 0
2270
2166
  }, [
2271
- __props.missing ? (openBlock(), createElementBlock("span", _hoisted_5$c, "(Missing) ")) : createCommentVNode("", true),
2167
+ __props.missing ? (openBlock(), createElementBlock("span", _hoisted_5$d, "(Missing) ")) : createCommentVNode("", true),
2272
2168
  createElementVNode("span", {
2273
2169
  class: normalizeClass({ special: __props.special })
2274
2170
  }, toDisplayString(props.text), 3)
2275
- ], 8, _hoisted_4$m),
2171
+ ], 8, _hoisted_4$n),
2276
2172
  props.subText ? (openBlock(), createElementBlock("span", {
2277
2173
  key: 0,
2278
2174
  ref_key: "subtextEl",
@@ -2295,20 +2191,20 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
2295
2191
  }, null, 8, ["name"])) : createCommentVNode("", true),
2296
2192
  !props.shortcut && !props.trailingIcon && !props.badge ? (openBlock(), createElementBlock("span", _hoisted_9$2)) : createCommentVNode("", true)
2297
2193
  ])
2298
- ], 10, _hoisted_1$T);
2194
+ ], 10, _hoisted_1$W);
2299
2195
  };
2300
2196
  }
2301
2197
  });
2302
2198
 
2303
- const KdsListItem = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["__scopeId", "data-v-a3d6c86f"]]);
2199
+ const KdsListItem = /* @__PURE__ */ _export_sfc(_sfc_main$1p, [["__scopeId", "data-v-a3d6c86f"]]);
2304
2200
 
2305
- const _hoisted_1$S = { class: "kds-list-item-section-title" };
2306
- const _hoisted_2$y = {
2201
+ const _hoisted_1$V = { class: "kds-list-item-section-title" };
2202
+ const _hoisted_2$A = {
2307
2203
  key: 0,
2308
2204
  class: "icon"
2309
2205
  };
2310
- const _hoisted_3$p = ["title"];
2311
- const _sfc_main$1l = /* @__PURE__ */ defineComponent({
2206
+ const _hoisted_3$q = ["title"];
2207
+ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
2312
2208
  __name: "ListItemSectionTitle",
2313
2209
  props: {
2314
2210
  label: {},
@@ -2319,8 +2215,8 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
2319
2215
  const labelEl = useTemplateRef("labelEl");
2320
2216
  const { isTruncated } = useKdsIsTruncated(labelEl);
2321
2217
  return (_ctx, _cache) => {
2322
- return openBlock(), createElementBlock("div", _hoisted_1$S, [
2323
- props.leadingIcon ? (openBlock(), createElementBlock("span", _hoisted_2$y, [
2218
+ return openBlock(), createElementBlock("div", _hoisted_1$V, [
2219
+ props.leadingIcon ? (openBlock(), createElementBlock("span", _hoisted_2$A, [
2324
2220
  createVNode(KdsIcon, {
2325
2221
  name: props.leadingIcon,
2326
2222
  size: "small"
@@ -2331,15 +2227,15 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
2331
2227
  ref: labelEl,
2332
2228
  class: "label",
2333
2229
  title: unref(isTruncated) ? props.label : void 0
2334
- }, toDisplayString(props.label), 9, _hoisted_3$p)
2230
+ }, toDisplayString(props.label), 9, _hoisted_3$q)
2335
2231
  ]);
2336
2232
  };
2337
2233
  }
2338
2234
  });
2339
2235
 
2340
- const ListItemSectionTitle = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__scopeId", "data-v-5eeb1226"]]);
2236
+ const ListItemSectionTitle = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["__scopeId", "data-v-5eeb1226"]]);
2341
2237
 
2342
- const _sfc_main$1k = /* @__PURE__ */ defineComponent({
2238
+ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
2343
2239
  __name: "KdsMenuItem",
2344
2240
  props: {
2345
2241
  item: {},
@@ -2509,14 +2405,14 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
2509
2405
  }
2510
2406
  });
2511
2407
 
2512
- const KdsMenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["__scopeId", "data-v-96d9cfba"]]);
2408
+ const KdsMenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$1n, [["__scopeId", "data-v-96d9cfba"]]);
2513
2409
 
2514
2410
  const ContainerDepthKey = /* @__PURE__ */ Symbol("ContainerDepth");
2515
2411
  const ChildItemKey = /* @__PURE__ */ Symbol("ChildItem");
2516
2412
 
2517
- const _hoisted_1$R = ["id", "aria-label", "aria-activedescendant"];
2518
- const _hoisted_2$x = ["id"];
2519
- const _sfc_main$1j = /* @__PURE__ */ defineComponent({
2413
+ const _hoisted_1$U = ["id", "aria-label", "aria-activedescendant"];
2414
+ const _hoisted_2$z = ["id"];
2415
+ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
2520
2416
  __name: "KdsMenuContainer",
2521
2417
  props: {
2522
2418
  id: {},
@@ -2742,28 +2638,28 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
2742
2638
  items: item.children ?? [],
2743
2639
  onItemClick: _cache[0] || (_cache[0] = ($event) => emit("itemClick", $event))
2744
2640
  }, null, 8, ["id", "ariaLabel", "items"])
2745
- ], 44, _hoisted_2$x)
2641
+ ], 44, _hoisted_2$z)
2746
2642
  ]),
2747
2643
  _: 2
2748
2644
  }, 1032, ["item", "is-last", "active-id", "variant", "onClick", "onMouseenter"]);
2749
2645
  }), 128))
2750
- ], 44, _hoisted_1$R);
2646
+ ], 44, _hoisted_1$U);
2751
2647
  };
2752
2648
  }
2753
2649
  });
2754
2650
 
2755
- const KdsMenuContainer = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["__scopeId", "data-v-9dc6d3f6"]]);
2651
+ const KdsMenuContainer = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["__scopeId", "data-v-ae4f1dab"]]);
2756
2652
 
2757
2653
  const kdsPopoverPlacement = {
2758
2654
  CUSTOM: "custom"
2759
2655
  };
2760
2656
 
2761
- const _hoisted_1$Q = ["id", "popover", "role"];
2762
- const _hoisted_2$w = {
2657
+ const _hoisted_1$T = ["id", "popover", "role"];
2658
+ const _hoisted_2$y = {
2763
2659
  key: 0,
2764
2660
  class: "kds-popover-default-content"
2765
2661
  };
2766
- const _sfc_main$1i = /* @__PURE__ */ defineComponent({
2662
+ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
2767
2663
  __name: "KdsPopover",
2768
2664
  props: /* @__PURE__ */ mergeModels({
2769
2665
  role: {},
@@ -2821,16 +2717,16 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
2821
2717
  onToggle
2822
2718
  }, [
2823
2719
  renderSlot(_ctx.$slots, "default", {}, () => [
2824
- props.content?.trim().length ? (openBlock(), createElementBlock("div", _hoisted_2$w, toDisplayString(props.content), 1)) : createCommentVNode("", true)
2720
+ props.content?.trim().length ? (openBlock(), createElementBlock("div", _hoisted_2$y, toDisplayString(props.content), 1)) : createCommentVNode("", true)
2825
2721
  ], true)
2826
- ], 46, _hoisted_1$Q);
2722
+ ], 46, _hoisted_1$T);
2827
2723
  };
2828
2724
  }
2829
2725
  });
2830
2726
 
2831
- const KdsPopover = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["__scopeId", "data-v-3354d162"]]);
2727
+ const KdsPopover = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__scopeId", "data-v-f41f0af7"]]);
2832
2728
 
2833
- const _sfc_main$1h = /* @__PURE__ */ defineComponent({
2729
+ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
2834
2730
  ...{
2835
2731
  inheritAttrs: false
2836
2732
  },
@@ -2870,12 +2766,22 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
2870
2766
  const menuContainerEl = useTemplateRef("menuContainer");
2871
2767
  const menuButtonEl = useTemplateRef("menuButton");
2872
2768
  const menuId = useId();
2873
- watch(isMenuOpen, async (menuOpen) => {
2769
+ watch(isMenuOpen, (menuOpen, _oldVal, onCleanup) => {
2874
2770
  if (!menuOpen) {
2875
2771
  return;
2876
2772
  }
2877
- await nextTick();
2878
- menuContainerEl.value?.focus();
2773
+ if (menuContainerEl.value) {
2774
+ menuContainerEl.value.focus();
2775
+ return;
2776
+ }
2777
+ const stop = watch(
2778
+ menuContainerEl,
2779
+ (el) => {
2780
+ el?.focus();
2781
+ },
2782
+ { once: true }
2783
+ );
2784
+ onCleanup(stop);
2879
2785
  });
2880
2786
  const onItemClick = (itemId) => {
2881
2787
  isMenuOpen.value = false;
@@ -2884,12 +2790,12 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
2884
2790
  __expose({ menuButtonEl });
2885
2791
  return (_ctx, _cache) => {
2886
2792
  return openBlock(), createElementBlock(Fragment, null, [
2887
- createVNode(_sfc_main$1p, mergeProps({ ref: "menuButton" }, toggleButtonProps.value, {
2793
+ createVNode(_sfc_main$1s, mergeProps({ ref: "menuButton" }, toggleButtonProps.value, {
2888
2794
  modelValue: isMenuOpen.value,
2889
2795
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isMenuOpen.value = $event),
2890
2796
  "aria-haspopup": "menu",
2891
2797
  "aria-expanded": isMenuOpen.value,
2892
- "aria-controls": unref(menuId),
2798
+ "aria-controls": isMenuOpen.value ? unref(menuId) : void 0,
2893
2799
  style: popoverEl.value?.anchorStyle
2894
2800
  }), null, 16, ["modelValue", "aria-expanded", "aria-controls", "style"]),
2895
2801
  createVNode(KdsPopover, {
@@ -2900,13 +2806,14 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
2900
2806
  "aria-label": "Menu"
2901
2807
  }, {
2902
2808
  default: withCtx(() => [
2903
- createVNode(KdsMenuContainer, {
2809
+ isMenuOpen.value ? (openBlock(), createBlock(KdsMenuContainer, {
2810
+ key: 0,
2904
2811
  id: unref(menuId),
2905
2812
  ref: "menuContainer",
2906
2813
  items: props.items,
2907
2814
  "menu-max-height": __props.menuMaxHeight,
2908
2815
  onItemClick
2909
- }, null, 8, ["id", "items", "menu-max-height"])
2816
+ }, null, 8, ["id", "items", "menu-max-height"])) : createCommentVNode("", true)
2910
2817
  ]),
2911
2818
  _: 1
2912
2819
  }, 8, ["modelValue"])
@@ -2915,17 +2822,17 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
2915
2822
  }
2916
2823
  });
2917
2824
 
2918
- const _hoisted_1$P = ["aria-disabled"];
2919
- const _hoisted_2$v = { class: "kds-empty-state-headline" };
2920
- const _hoisted_3$o = {
2825
+ const _hoisted_1$S = ["aria-disabled"];
2826
+ const _hoisted_2$x = { class: "kds-empty-state-headline" };
2827
+ const _hoisted_3$p = {
2921
2828
  key: 1,
2922
2829
  class: "kds-empty-state-description"
2923
2830
  };
2924
- const _hoisted_4$l = {
2831
+ const _hoisted_4$m = {
2925
2832
  key: 2,
2926
2833
  class: "kds-empty-state-action"
2927
2834
  };
2928
- const _sfc_main$1f = /* @__PURE__ */ defineComponent({
2835
+ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
2929
2836
  __name: "KdsEmptyState",
2930
2837
  props: {
2931
2838
  headline: {},
@@ -2943,13 +2850,13 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
2943
2850
  () => props.button && "to" in props.button && props.button.to !== void 0
2944
2851
  );
2945
2852
  const buttonComponent = computed(
2946
- () => isLinkButton.value ? _sfc_main$1r : _sfc_main$1s
2853
+ () => isLinkButton.value ? _sfc_main$1u : _sfc_main$1v
2947
2854
  );
2948
2855
  const isSecondaryLinkButton = computed(
2949
2856
  () => props.secondaryButton && "to" in props.secondaryButton && props.secondaryButton.to !== void 0
2950
2857
  );
2951
2858
  const secondaryButtonComponent = computed(
2952
- () => isSecondaryLinkButton.value ? _sfc_main$1r : _sfc_main$1s
2859
+ () => isSecondaryLinkButton.value ? _sfc_main$1u : _sfc_main$1v
2953
2860
  );
2954
2861
  return (_ctx, _cache) => {
2955
2862
  return openBlock(), createElementBlock("div", {
@@ -2963,9 +2870,9 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
2963
2870
  variant: "onSurface",
2964
2871
  "aria-hidden": "true"
2965
2872
  })) : createCommentVNode("", true),
2966
- createElementVNode("p", _hoisted_2$v, toDisplayString(props.headline), 1),
2967
- props.description ? (openBlock(), createElementBlock("p", _hoisted_3$o, toDisplayString(props.description), 1)) : createCommentVNode("", true),
2968
- props.button ? (openBlock(), createElementBlock("div", _hoisted_4$l, [
2873
+ createElementVNode("p", _hoisted_2$x, toDisplayString(props.headline), 1),
2874
+ props.description ? (openBlock(), createElementBlock("p", _hoisted_3$p, toDisplayString(props.description), 1)) : createCommentVNode("", true),
2875
+ props.button ? (openBlock(), createElementBlock("div", _hoisted_4$m, [
2969
2876
  (openBlock(), createBlock(resolveDynamicComponent(buttonComponent.value), mergeProps(props.button, {
2970
2877
  disabled: props.button?.disabled || __props.disabled,
2971
2878
  onClick: _cache[0] || (_cache[0] = ($event) => !__props.disabled && emit("buttonClick", $event))
@@ -2975,16 +2882,16 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
2975
2882
  onClick: _cache[1] || (_cache[1] = ($event) => !__props.disabled && emit("secondaryButtonClick", $event))
2976
2883
  }), null, 16, ["disabled"])) : createCommentVNode("", true)
2977
2884
  ])) : createCommentVNode("", true)
2978
- ], 10, _hoisted_1$P);
2885
+ ], 10, _hoisted_1$S);
2979
2886
  };
2980
2887
  }
2981
2888
  });
2982
2889
 
2983
- const KdsEmptyState = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["__scopeId", "data-v-e913660a"]]);
2890
+ const KdsEmptyState = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["__scopeId", "data-v-e913660a"]]);
2984
2891
 
2985
- const _hoisted_1$O = ["aria-busy", "aria-label", "aria-activedescendant", "tabindex"];
2892
+ const _hoisted_1$R = ["aria-busy", "aria-label", "aria-activedescendant", "tabindex"];
2986
2893
  const loadingStateText = "Loading entries";
2987
- const _sfc_main$1e = /* @__PURE__ */ defineComponent({
2894
+ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
2988
2895
  __name: "KdsListContainer",
2989
2896
  props: {
2990
2897
  possibleValues: {},
@@ -3107,12 +3014,12 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
3107
3014
  "loading-spinner": __props.loading
3108
3015
  }, null, 8, ["headline", "loading-spinner"])
3109
3016
  ])) : createCommentVNode("", true)
3110
- ], 16, _hoisted_1$O);
3017
+ ], 16, _hoisted_1$R);
3111
3018
  };
3112
3019
  }
3113
3020
  });
3114
3021
 
3115
- const KdsListContainer = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["__scopeId", "data-v-118706ad"]]);
3022
+ const KdsListContainer = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__scopeId", "data-v-118706ad"]]);
3116
3023
 
3117
3024
  const createUnwrappedPromise = () => {
3118
3025
  let resolve = () => {
@@ -3125,11 +3032,10 @@ const createUnwrappedPromise = () => {
3125
3032
  });
3126
3033
  return { resolve, reject, promise };
3127
3034
  };
3128
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
3129
3035
 
3130
- const _hoisted_1$N = { class: "kds-label-wrapper" };
3131
- const _hoisted_2$u = ["id", "for", "title"];
3132
- const _sfc_main$1b = /* @__PURE__ */ defineComponent({
3036
+ const _hoisted_1$Q = { class: "kds-label-wrapper" };
3037
+ const _hoisted_2$w = ["id", "for", "title"];
3038
+ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
3133
3039
  __name: "KdsLabel",
3134
3040
  props: {
3135
3041
  label: {},
@@ -3146,7 +3052,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
3146
3052
  const labelEl = useTemplateRef("labelEl");
3147
3053
  const { isTruncated } = useKdsIsTruncated(labelEl);
3148
3054
  return (_ctx, _cache) => {
3149
- return openBlock(), createElementBlock("div", _hoisted_1$N, [
3055
+ return openBlock(), createElementBlock("div", _hoisted_1$Q, [
3150
3056
  createElementVNode("label", {
3151
3057
  id: props.id,
3152
3058
  ref_key: "labelEl",
@@ -3154,7 +3060,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
3154
3060
  for: props.for,
3155
3061
  class: "label",
3156
3062
  title: unref(isTruncated) ? props.label : void 0
3157
- }, toDisplayString(props.label), 9, _hoisted_2$u),
3063
+ }, toDisplayString(props.label), 9, _hoisted_2$w),
3158
3064
  props.description ? (openBlock(), createBlock(unref(KdsInfoToggleButton), {
3159
3065
  key: 0,
3160
3066
  content: props.description,
@@ -3165,11 +3071,11 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
3165
3071
  }
3166
3072
  });
3167
3073
 
3168
- const KdsLabel = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["__scopeId", "data-v-efe3313e"]]);
3074
+ const KdsLabel = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["__scopeId", "data-v-efe3313e"]]);
3169
3075
 
3170
- const _hoisted_1$M = ["id"];
3171
- const _hoisted_2$t = { class: "subtext-text" };
3172
- const _sfc_main$1a = /* @__PURE__ */ defineComponent({
3076
+ const _hoisted_1$P = ["id"];
3077
+ const _hoisted_2$v = { class: "subtext-text" };
3078
+ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
3173
3079
  __name: "KdsSubText",
3174
3080
  props: {
3175
3081
  id: {},
@@ -3200,15 +3106,15 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
3200
3106
  variant: "onSurface",
3201
3107
  "aria-hidden": "true"
3202
3108
  })) : createCommentVNode("", true),
3203
- createElementVNode("span", _hoisted_2$t, toDisplayString(props.subText), 1)
3204
- ], 10, _hoisted_1$M)) : createCommentVNode("", true);
3109
+ createElementVNode("span", _hoisted_2$v, toDisplayString(props.subText), 1)
3110
+ ], 10, _hoisted_1$P)) : createCommentVNode("", true);
3205
3111
  };
3206
3112
  }
3207
3113
  });
3208
3114
 
3209
- const KdsSubText = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-2e6ba10c"]]);
3115
+ const KdsSubText = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["__scopeId", "data-v-2e6ba10c"]]);
3210
3116
 
3211
- const _sfc_main$19 = /* @__PURE__ */ defineComponent({
3117
+ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
3212
3118
  __name: "BaseFormFieldWrapper",
3213
3119
  props: {
3214
3120
  id: {},
@@ -3260,7 +3166,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
3260
3166
  }
3261
3167
  });
3262
3168
 
3263
- const BaseFormFieldWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["__scopeId", "data-v-5d99c134"]]);
3169
+ const BaseFormFieldWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["__scopeId", "data-v-5d99c134"]]);
3264
3170
 
3265
3171
  const MIN_SEGMENT_INDEX = 0;
3266
3172
  const LARGE_STEP = 10;
@@ -3937,17 +3843,17 @@ const useInputSegments = (modelValue, getInputElement, configRef) => {
3937
3843
  };
3938
3844
  };
3939
3845
 
3940
- const _hoisted_1$L = {
3846
+ const _hoisted_1$O = {
3941
3847
  key: 0,
3942
3848
  class: "icon-wrapper leading"
3943
3849
  };
3944
- const _hoisted_2$s = {
3850
+ const _hoisted_2$u = {
3945
3851
  key: 1,
3946
3852
  class: "leading-slot"
3947
3853
  };
3948
- const _hoisted_3$n = ["id", "value", "type", "inputmode", "placeholder", "disabled", "autocomplete", "min", "max", "step", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "role", "pattern", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext", "aria-activedescendant", "aria-haspopup", "aria-controls", "aria-expanded", "aria-autocomplete"];
3949
- const _hoisted_4$k = ["aria-disabled"];
3950
- const _hoisted_5$b = {
3854
+ const _hoisted_3$o = ["id", "value", "type", "inputmode", "placeholder", "disabled", "autocomplete", "min", "max", "step", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "role", "pattern", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext", "aria-activedescendant", "aria-haspopup", "aria-controls", "aria-expanded", "aria-autocomplete"];
3855
+ const _hoisted_4$l = ["aria-disabled"];
3856
+ const _hoisted_5$c = {
3951
3857
  key: 4,
3952
3858
  class: "trailing-slot"
3953
3859
  };
@@ -3955,7 +3861,7 @@ const _hoisted_6$9 = {
3955
3861
  key: 5,
3956
3862
  class: "icon-wrapper trailing"
3957
3863
  };
3958
- const _sfc_main$18 = /* @__PURE__ */ defineComponent({
3864
+ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
3959
3865
  __name: "BaseInput",
3960
3866
  props: /* @__PURE__ */ mergeModels({
3961
3867
  id: {},
@@ -4106,13 +4012,13 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
4106
4012
  }),
4107
4013
  onClick: handleContainerClick
4108
4014
  }, [
4109
- props.leadingIcon ? (openBlock(), createElementBlock("div", _hoisted_1$L, [
4015
+ props.leadingIcon ? (openBlock(), createElementBlock("div", _hoisted_1$O, [
4110
4016
  props.leadingIcon ? (openBlock(), createBlock(KdsIcon, {
4111
4017
  key: 0,
4112
4018
  name: props.leadingIcon
4113
4019
  }, null, 8, ["name"])) : createCommentVNode("", true)
4114
4020
  ])) : createCommentVNode("", true),
4115
- _ctx.$slots.leading ? (openBlock(), createElementBlock("div", _hoisted_2$s, [
4021
+ _ctx.$slots.leading ? (openBlock(), createElementBlock("div", _hoisted_2$u, [
4116
4022
  renderSlot(_ctx.$slots, "leading", {}, void 0, true)
4117
4023
  ])) : createCommentVNode("", true),
4118
4024
  createElementVNode("input", {
@@ -4157,7 +4063,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
4157
4063
  onCut: handleInputCut,
4158
4064
  onDrop: handleInputDrop,
4159
4065
  onDragend: handleInputDragEnd
4160
- }, null, 42, _hoisted_3$n),
4066
+ }, null, 42, _hoisted_3$o),
4161
4067
  props.unit ? (openBlock(), createElementBlock("span", {
4162
4068
  key: 2,
4163
4069
  class: normalizeClass({
@@ -4166,8 +4072,8 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
4166
4072
  disabled: __props.disabled
4167
4073
  }),
4168
4074
  "aria-disabled": __props.disabled || void 0
4169
- }, toDisplayString(props.unit), 11, _hoisted_4$k)) : createCommentVNode("", true),
4170
- __props.clearable && hasValue.value && !__props.disabled ? (openBlock(), createBlock(_sfc_main$1s, {
4075
+ }, toDisplayString(props.unit), 11, _hoisted_4$l)) : createCommentVNode("", true),
4076
+ __props.clearable && hasValue.value && !__props.disabled ? (openBlock(), createBlock(_sfc_main$1v, {
4171
4077
  key: 3,
4172
4078
  class: "clear-button",
4173
4079
  size: "xsmall",
@@ -4177,7 +4083,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
4177
4083
  title: "Clear",
4178
4084
  onClick: withModifiers(clearAndFocusInput, ["stop"])
4179
4085
  })) : createCommentVNode("", true),
4180
- _ctx.$slots.trailing ? (openBlock(), createElementBlock("div", _hoisted_5$b, [
4086
+ _ctx.$slots.trailing ? (openBlock(), createElementBlock("div", _hoisted_5$c, [
4181
4087
  renderSlot(_ctx.$slots, "trailing", {}, void 0, true)
4182
4088
  ])) : createCommentVNode("", true),
4183
4089
  props.trailingIcon ? (openBlock(), createElementBlock("div", _hoisted_6$9, [
@@ -4190,9 +4096,9 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
4190
4096
  }
4191
4097
  });
4192
4098
 
4193
- const BaseInput = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["__scopeId", "data-v-93daa14e"]]);
4099
+ const BaseInput = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["__scopeId", "data-v-93daa14e"]]);
4194
4100
 
4195
- const _sfc_main$17 = /* @__PURE__ */ defineComponent({
4101
+ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
4196
4102
  __name: "KdsTextInput",
4197
4103
  props: /* @__PURE__ */ mergeModels({
4198
4104
  description: {},
@@ -4251,7 +4157,6 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
4251
4157
  isFocused.value = true;
4252
4158
  if (hasFilteredSuggestions.value) {
4253
4159
  popoverOpen.value = true;
4254
- listContainerRef.value?.handleFocus();
4255
4160
  }
4256
4161
  };
4257
4162
  const onBlur = () => {
@@ -4264,7 +4169,6 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
4264
4169
  }
4265
4170
  if (has) {
4266
4171
  popoverOpen.value = true;
4267
- listContainerRef.value?.handleFocus();
4268
4172
  } else {
4269
4173
  closePopover();
4270
4174
  }
@@ -4276,7 +4180,6 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
4276
4180
  if (!popoverOpen.value) {
4277
4181
  if (event.key !== "Enter" && event.key !== "Escape") {
4278
4182
  popoverOpen.value = true;
4279
- listContainerRef.value?.handleFocus();
4280
4183
  }
4281
4184
  return;
4282
4185
  } else if (event.key === "Escape") {
@@ -4324,7 +4227,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
4324
4227
  "aria-haspopup": hasSuggestions.value ? "listbox" : void 0,
4325
4228
  "aria-expanded": hasSuggestions.value ? popoverOpen.value : void 0,
4326
4229
  "aria-autocomplete": hasSuggestions.value ? "list" : void 0,
4327
- "aria-controls": hasSuggestions.value ? unref(suggestionId) : void 0,
4230
+ "aria-controls": hasSuggestions.value && popoverOpen.value ? unref(suggestionId) : void 0,
4328
4231
  "aria-activedescendant": listContainerRef.value?.activeDescendant,
4329
4232
  style: hasSuggestions.value ? popoverRef.value?.anchorStyle : void 0,
4330
4233
  onFocus,
@@ -4342,7 +4245,8 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
4342
4245
  "popover-type": "manual"
4343
4246
  }, {
4344
4247
  default: withCtx(() => [
4345
- createVNode(unref(KdsListContainer), {
4248
+ popoverOpen.value ? (openBlock(), createBlock(unref(KdsListContainer), {
4249
+ key: 0,
4346
4250
  id: unref(suggestionId),
4347
4251
  ref_key: "listContainerRef",
4348
4252
  ref: listContainerRef,
@@ -4351,7 +4255,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
4351
4255
  "controlled-externally": "",
4352
4256
  "aria-label": "Suggestions",
4353
4257
  onItemClick
4354
- }, null, 8, ["id", "possible-values"])
4258
+ }, null, 8, ["id", "possible-values"])) : createCommentVNode("", true)
4355
4259
  ]),
4356
4260
  _: 1
4357
4261
  }, 8, ["modelValue"])) : createCommentVNode("", true)
@@ -4362,7 +4266,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
4362
4266
  }
4363
4267
  });
4364
4268
 
4365
- const KdsTextInput = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["__scopeId", "data-v-83f45d15"]]);
4269
+ const KdsTextInput = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-dd35e2a4"]]);
4366
4270
 
4367
4271
  defineComponent({
4368
4272
  name: "FileExplorerItemBase",
@@ -8241,7 +8145,7 @@ function applyDefaultFilter(v) {
8241
8145
  return name + "(" + defaultValue + unit + ")";
8242
8146
  }
8243
8147
  const functionRegex = /\b([a-z-]*)\(.*?\)/gu;
8244
- const filter$1 = {
8148
+ const filter = {
8245
8149
  ...complex,
8246
8150
  getAnimatableNone: (v) => {
8247
8151
  const functions = v.match(functionRegex);
@@ -8371,8 +8275,8 @@ const defaultValueTypes = {
8371
8275
  borderRightColor: color,
8372
8276
  borderBottomColor: color,
8373
8277
  borderLeftColor: color,
8374
- filter: filter$1,
8375
- WebkitFilter: filter$1,
8278
+ filter,
8279
+ WebkitFilter: filter,
8376
8280
  mask,
8377
8281
  WebkitMask: mask,
8378
8282
  };
@@ -8381,7 +8285,7 @@ const defaultValueTypes = {
8381
8285
  */
8382
8286
  const getDefaultValueType = (key) => defaultValueTypes[key];
8383
8287
 
8384
- const customTypes = /*@__PURE__*/ new Set([filter$1, mask]);
8288
+ const customTypes = /*@__PURE__*/ new Set([filter, mask]);
8385
8289
  function getAnimatableNone(key, value) {
8386
8290
  let defaultValueType = getDefaultValueType(key);
8387
8291
  if (!customTypes.has(defaultValueType))
@@ -10384,19 +10288,19 @@ createScopedAnimate();
10384
10288
  return null;
10385
10289
  })();
10386
10290
 
10387
- const _hoisted_1$G = ["disabled", "title", "aria-label", "aria-checked", "aria-describedby", "aria-invalid"];
10388
- const _hoisted_2$o = { class: "control" };
10389
- const _hoisted_3$k = {
10291
+ const _hoisted_1$J = ["disabled", "title", "aria-label", "aria-checked", "aria-describedby", "aria-invalid"];
10292
+ const _hoisted_2$q = { class: "control" };
10293
+ const _hoisted_3$l = {
10390
10294
  key: 0,
10391
10295
  class: "content"
10392
10296
  };
10393
- const _hoisted_4$h = { class: "label" };
10394
- const _hoisted_5$8 = ["id"];
10297
+ const _hoisted_4$i = { class: "label" };
10298
+ const _hoisted_5$9 = ["id"];
10395
10299
  const _hoisted_6$6 = {
10396
10300
  key: 0,
10397
10301
  class: "subtext-wrapper"
10398
10302
  };
10399
- const _sfc_main$11 = /* @__PURE__ */ defineComponent({
10303
+ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
10400
10304
  __name: "BaseCheckbox",
10401
10305
  props: /* @__PURE__ */ mergeModels({
10402
10306
  disabled: { type: Boolean, default: false },
@@ -10469,7 +10373,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
10469
10373
  role: "checkbox",
10470
10374
  onClick: handleClick
10471
10375
  }, [
10472
- createElementVNode("div", _hoisted_2$o, [
10376
+ createElementVNode("div", _hoisted_2$q, [
10473
10377
  icon.value ? (openBlock(), createBlock(KdsIcon, {
10474
10378
  key: 0,
10475
10379
  name: icon.value,
@@ -10477,15 +10381,15 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
10477
10381
  size: "xsmall"
10478
10382
  }, null, 8, ["name"])) : createCommentVNode("", true)
10479
10383
  ]),
10480
- props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$k, [
10481
- createElementVNode("div", _hoisted_4$h, toDisplayString(props.label), 1),
10384
+ props.label || props.helperText ? (openBlock(), createElementBlock("div", _hoisted_3$l, [
10385
+ createElementVNode("div", _hoisted_4$i, toDisplayString(props.label), 1),
10482
10386
  props.helperText ? (openBlock(), createElementBlock("div", {
10483
10387
  key: 0,
10484
10388
  id: unref(helperId),
10485
10389
  class: "helper-text"
10486
- }, toDisplayString(props.helperText), 9, _hoisted_5$8)) : createCommentVNode("", true)
10390
+ }, toDisplayString(props.helperText), 9, _hoisted_5$9)) : createCommentVNode("", true)
10487
10391
  ])) : createCommentVNode("", true)
10488
- ], 10, _hoisted_1$G),
10392
+ ], 10, _hoisted_1$J),
10489
10393
  props.subText || props.preserveSubTextSpace ? (openBlock(), createElementBlock("div", _hoisted_6$6, [
10490
10394
  createVNode(KdsSubText, {
10491
10395
  id: unref(descriptionId),
@@ -10499,9 +10403,9 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
10499
10403
  }
10500
10404
  });
10501
10405
 
10502
- const BaseCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-0bec87ad"]]);
10406
+ const BaseCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-0bec87ad"]]);
10503
10407
 
10504
- const _sfc_main$10 = /* @__PURE__ */ defineComponent({
10408
+ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
10505
10409
  __name: "KdsCheckbox",
10506
10410
  props: /* @__PURE__ */ mergeModels({
10507
10411
  disabled: { type: Boolean, default: false },
@@ -14508,8 +14412,8 @@ new RegExp(
14508
14412
  "i"
14509
14413
  );
14510
14414
 
14511
- const _hoisted_1$s = ["id", "aria-expanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-controls", "disabled"];
14512
- const _hoisted_2$g = {
14415
+ const _hoisted_1$t = ["id", "aria-expanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-invalid", "aria-controls", "disabled"];
14416
+ const _hoisted_2$h = {
14513
14417
  key: 0,
14514
14418
  class: "leading",
14515
14419
  "aria-hidden": "true"
@@ -14520,7 +14424,7 @@ const _hoisted_4$a = {
14520
14424
  "aria-hidden": "true"
14521
14425
  };
14522
14426
  const TRIGGER_REF = "triggerEl";
14523
- const _sfc_main$B = /* @__PURE__ */ defineComponent({
14427
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
14524
14428
  __name: "BaseDropdown",
14525
14429
  props: /* @__PURE__ */ mergeModels({
14526
14430
  text: {},
@@ -14600,8 +14504,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
14600
14504
  onClick: _cache[0] || (_cache[0] = ($event) => !__props.disabled && emit("click")),
14601
14505
  onKeydown
14602
14506
  }, [
14603
- props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$g, [
14604
- createVNode(_sfc_main$1n, {
14507
+ props.accessory ? (openBlock(), createElementBlock("span", _hoisted_2$h, [
14508
+ createVNode(_sfc_main$1q, {
14605
14509
  accessory: props.accessory,
14606
14510
  size: "medium"
14607
14511
  }, null, 8, ["accessory"])
@@ -14619,21 +14523,21 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
14619
14523
  size: "small"
14620
14524
  }, null, 8, ["name"])
14621
14525
  ])
14622
- ], 42, _hoisted_1$s);
14526
+ ], 42, _hoisted_1$t);
14623
14527
  };
14624
14528
  }
14625
14529
  });
14626
14530
 
14627
- const BaseDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-1bb2d375"]]);
14531
+ const BaseDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-1bb2d375"]]);
14628
14532
 
14629
14533
  const DROPDOWN_SEARCH_THRESHOLD = 12;
14630
14534
 
14631
- const _hoisted_1$r = { class: "kds-dropdown-container" };
14632
- const _hoisted_2$f = {
14535
+ const _hoisted_1$s = { class: "kds-dropdown-container" };
14536
+ const _hoisted_2$g = {
14633
14537
  key: 0,
14634
14538
  class: "kds-dropdown-container-sticky-top"
14635
14539
  };
14636
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
14540
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
14637
14541
  __name: "DropdownContainer",
14638
14542
  props: /* @__PURE__ */ mergeModels({
14639
14543
  emptyText: {},
@@ -14717,8 +14621,8 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
14717
14621
  }
14718
14622
  });
14719
14623
  return (_ctx, _cache) => {
14720
- return openBlock(), createElementBlock("div", _hoisted_1$r, [
14721
- searchable.value ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
14624
+ return openBlock(), createElementBlock("div", _hoisted_1$s, [
14625
+ searchable.value ? (openBlock(), createElementBlock("div", _hoisted_2$g, [
14722
14626
  createVNode(BaseInput, {
14723
14627
  ref_key: "searchEl",
14724
14628
  ref: searchEl,
@@ -14750,9 +14654,9 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
14750
14654
  }
14751
14655
  });
14752
14656
 
14753
- const DropdownContainer = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-0a6ce241"]]);
14657
+ const DropdownContainer = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-0a6ce241"]]);
14754
14658
 
14755
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
14659
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
14756
14660
  __name: "KdsDropdown",
14757
14661
  props: /* @__PURE__ */ mergeModels({
14758
14662
  placeholder: { default: "Select" },
@@ -14782,9 +14686,20 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
14782
14686
  const selectedOption = computed(
14783
14687
  () => props.possibleValues.find((o) => o.id === modelValue.value)
14784
14688
  );
14785
- watchEffect(() => {
14689
+ watchEffect((onCleanup) => {
14786
14690
  if (open.value) {
14787
- nextTick(() => dropdownContainerEl.value?.focus());
14691
+ if (dropdownContainerEl.value) {
14692
+ dropdownContainerEl.value.focus();
14693
+ return;
14694
+ }
14695
+ const stop = watch(
14696
+ dropdownContainerEl,
14697
+ (el) => {
14698
+ el?.focus();
14699
+ },
14700
+ { once: true }
14701
+ );
14702
+ onCleanup(stop);
14788
14703
  }
14789
14704
  });
14790
14705
  const closeDropdown = () => {
@@ -14835,7 +14750,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
14835
14750
  "aria-label": "Dropdown menu"
14836
14751
  }, {
14837
14752
  default: withCtx(() => [
14838
- createVNode(DropdownContainer, {
14753
+ open.value ? (openBlock(), createBlock(DropdownContainer, {
14754
+ key: 0,
14839
14755
  ref_key: "dropdownContainerEl",
14840
14756
  ref: dropdownContainerEl,
14841
14757
  modelValue: modelValue.value,
@@ -14844,7 +14760,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
14844
14760
  loading: __props.loading,
14845
14761
  "empty-text": "No entries found",
14846
14762
  onSelect: closeDropdown
14847
- }, null, 8, ["modelValue", "possible-values", "loading"])
14763
+ }, null, 8, ["modelValue", "possible-values", "loading"])) : createCommentVNode("", true)
14848
14764
  ]),
14849
14765
  _: 1
14850
14766
  }, 8, ["modelValue"])
@@ -15100,9 +15016,20 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
15100
15016
  const dropdownContainerEl = useTemplateRef("dropdownContainerEl");
15101
15017
  const popoverEl = useTemplateRef("popoverEl");
15102
15018
  const baseDropdownEl = useTemplateRef("baseDropdownEl");
15103
- watchEffect(() => {
15019
+ watchEffect((onCleanup) => {
15104
15020
  if (open.value) {
15105
- nextTick(() => dropdownContainerEl.value?.focus());
15021
+ if (dropdownContainerEl.value) {
15022
+ dropdownContainerEl.value.focus();
15023
+ return;
15024
+ }
15025
+ const stop = watch(
15026
+ dropdownContainerEl,
15027
+ (el) => {
15028
+ el?.focus();
15029
+ },
15030
+ { once: true }
15031
+ );
15032
+ onCleanup(stop);
15106
15033
  }
15107
15034
  });
15108
15035
  const addedOptions = ref([]);
@@ -15182,7 +15109,8 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
15182
15109
  "aria-label": "Multi select dropdown options"
15183
15110
  }, {
15184
15111
  default: withCtx(() => [
15185
- createVNode(MultiSelectDropdownContainer, {
15112
+ open.value ? (openBlock(), createBlock(MultiSelectDropdownContainer, {
15113
+ key: 0,
15186
15114
  ref_key: "dropdownContainerEl",
15187
15115
  ref: dropdownContainerEl,
15188
15116
  modelValue: modelValue.value,
@@ -15192,7 +15120,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
15192
15120
  "allow-new-values": __props.allowNewValues,
15193
15121
  "empty-text": "No entries found",
15194
15122
  onAddValue
15195
- }, null, 8, ["modelValue", "possible-values", "loading", "allow-new-values"])
15123
+ }, null, 8, ["modelValue", "possible-values", "loading", "allow-new-values"])) : createCommentVNode("", true)
15196
15124
  ]),
15197
15125
  _: 1
15198
15126
  }, 8, ["modelValue"])
@@ -15278,14 +15206,15 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
15278
15206
  "aria-label": "Description"
15279
15207
  }, {
15280
15208
  default: withCtx(() => [
15281
- createVNode(InfoPopover, {
15209
+ modelValue.value ? (openBlock(), createBlock(InfoPopover, {
15210
+ key: 0,
15282
15211
  content: props.content
15283
15212
  }, {
15284
15213
  default: withCtx(() => [
15285
15214
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
15286
15215
  ]),
15287
15216
  _: 3
15288
- }, 8, ["content"])
15217
+ }, 8, ["content"])) : createCommentVNode("", true)
15289
15218
  ]),
15290
15219
  _: 3
15291
15220
  }, 8, ["modelValue"])
@@ -15294,7 +15223,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
15294
15223
  }
15295
15224
  });
15296
15225
 
15297
- const KdsInfoToggleButton = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-2e9ef96a"]]);
15226
+ const KdsInfoToggleButton = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-67a8974e"]]);
15298
15227
 
15299
15228
  const KdsInfoToggleButton$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
15300
15229
  __proto__: null,
@@ -15428,24 +15357,24 @@ const useIndicesAndStylesFor = (data) => {
15428
15357
  };
15429
15358
  };
15430
15359
 
15431
- const _hoisted_1$c = {
15360
+ const _hoisted_1$d = {
15432
15361
  key: 0,
15433
15362
  class: "deletion-cell-spacer"
15434
15363
  };
15435
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
15364
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
15436
15365
  __name: "EmptyRow",
15437
15366
  props: {
15438
15367
  width: {},
15439
15368
  height: {},
15440
15369
  compact: { type: Boolean },
15441
- columnSizes: {},
15370
+ colSizes: {},
15442
15371
  specialColumnSizes: {},
15443
15372
  tableConfig: {}
15444
15373
  },
15445
15374
  setup(__props) {
15446
15375
  const props = __props;
15447
15376
  const { indexedData: indexedRow, style: rowStyles } = useIndicesAndStylesFor(
15448
- toRef(props, "columnSizes")
15377
+ toRef(props, "colSizes")
15449
15378
  );
15450
15379
  const paddingTopBottom = computed(
15451
15380
  () => props.compact ? COMPACT_ROW_PADDING_TOP_BOTTOM : DEFAULT_ROW_PADDING_TOP_BOTTOM
@@ -15458,7 +15387,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
15458
15387
  height: `${__props.height}px`
15459
15388
  })
15460
15389
  }, [
15461
- __props.tableConfig.enableRowDeletion ? (openBlock(), createElementBlock("td", _hoisted_1$c)) : createCommentVNode("", true),
15390
+ __props.tableConfig.enableRowDeletion ? (openBlock(), createElementBlock("td", _hoisted_1$d)) : createCommentVNode("", true),
15462
15391
  __props.tableConfig.showSelection ? (openBlock(), createElementBlock("td", {
15463
15392
  key: 1,
15464
15393
  class: "select-cell",
@@ -15467,7 +15396,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
15467
15396
  paddingBottom: `${paddingTopBottom.value}px`
15468
15397
  })
15469
15398
  }, [
15470
- createVNode(unref(_sfc_main$10), {
15399
+ createVNode(unref(_sfc_main$13), {
15471
15400
  title: "Selection",
15472
15401
  disabled: "",
15473
15402
  class: "select-checkbox"
@@ -15492,9 +15421,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
15492
15421
  }
15493
15422
  });
15494
15423
 
15495
- const EmptyRow = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["__scopeId", "data-v-b1ac99a6"]]);
15424
+ const EmptyRow = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["__scopeId", "data-v-640baae1"]]);
15496
15425
 
15497
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
15426
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
15498
15427
  __name: "PlaceholderRow",
15499
15428
  props: {
15500
15429
  height: {}
@@ -15511,16 +15440,16 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
15511
15440
  }
15512
15441
  });
15513
15442
 
15514
- const PlaceholderRow = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__scopeId", "data-v-df158652"]]);
15443
+ const PlaceholderRow = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["__scopeId", "data-v-df158652"]]);
15515
15444
 
15516
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
15445
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
15517
15446
  __name: "VirtualRow",
15518
15447
  props: {
15519
15448
  dataItem: {},
15520
15449
  rowHeight: {},
15521
15450
  compact: { type: Boolean },
15522
15451
  bodyWidth: {},
15523
- columnSizes: {},
15452
+ colSizes: {},
15524
15453
  specialColumnSizes: {},
15525
15454
  tableConfig: {}
15526
15455
  },
@@ -15539,10 +15468,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
15539
15468
  height: __props.rowHeight,
15540
15469
  compact: __props.compact,
15541
15470
  width: __props.bodyWidth,
15542
- "column-sizes": __props.columnSizes,
15471
+ "col-sizes": __props.colSizes,
15543
15472
  "special-column-sizes": __props.specialColumnSizes,
15544
15473
  "table-config": __props.tableConfig
15545
- }, null, 8, ["height", "compact", "width", "column-sizes", "special-column-sizes", "table-config"]));
15474
+ }, null, 8, ["height", "compact", "width", "col-sizes", "special-column-sizes", "table-config"]));
15546
15475
  };
15547
15476
  }
15548
15477
  });
@@ -15668,12 +15597,12 @@ const useResizeScrollSpacer = ({
15668
15597
  };
15669
15598
  };
15670
15599
 
15671
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
15600
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
15672
15601
  __name: "TableCoreVirtual",
15673
15602
  props: {
15674
15603
  scrollData: {},
15675
15604
  scrollConfig: {},
15676
- columnSizes: {},
15605
+ colSizes: {},
15677
15606
  specialColumnSizes: {},
15678
15607
  currentBodyWidth: {},
15679
15608
  tableConfig: {},
@@ -15697,7 +15626,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
15697
15626
  sizeManager
15698
15627
  );
15699
15628
  const columnSizeManager = withLeftSideSize(
15700
- withRightSideSize(new Z$1(toRef(props, "columnSizes")))
15629
+ withRightSideSize(new Z$1(toRef(props, "colSizes")))
15701
15630
  );
15702
15631
  const numRows = computed(
15703
15632
  () => props.scrollData.length + props.scrollConfig.numRowsAbove + props.scrollConfig.numRowsBelow
@@ -15810,13 +15739,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
15810
15739
  style: normalizeStyle(__props.tableConfig.forceRenderAll ? {} : unref(verticalStyles))
15811
15740
  }, [
15812
15741
  (openBlock(true), createElementBlock(Fragment, null, renderList(renderedRowIndices.value, (rowInd) => {
15813
- return openBlock(), createBlock(_sfc_main$j, {
15742
+ return openBlock(), createBlock(_sfc_main$k, {
15814
15743
  key: rowInd,
15815
15744
  "row-height": __props.scrollConfig.itemSize,
15816
15745
  compact: __props.scrollConfig.compact,
15817
15746
  "body-width": __props.currentBodyWidth,
15818
15747
  "data-item": __props.scrollData[rowInd - __props.scrollConfig.numRowsAbove],
15819
- "column-sizes": __props.columnSizes,
15748
+ "col-sizes": __props.colSizes,
15820
15749
  "special-column-sizes": __props.specialColumnSizes,
15821
15750
  "table-config": __props.tableConfig
15822
15751
  }, {
@@ -15827,7 +15756,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
15827
15756
  }, void 0, true)
15828
15757
  ]),
15829
15758
  _: 2
15830
- }, 1032, ["row-height", "compact", "body-width", "data-item", "column-sizes", "special-column-sizes", "table-config"]);
15759
+ }, 1032, ["row-height", "compact", "body-width", "data-item", "col-sizes", "special-column-sizes", "table-config"]);
15831
15760
  }), 128))
15832
15761
  ], 4)
15833
15762
  ]),
@@ -15854,7 +15783,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
15854
15783
  }
15855
15784
  });
15856
15785
 
15857
- const TableCoreVirtual = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__scopeId", "data-v-fb9f9377"]]);
15786
+ const TableCoreVirtual = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__scopeId", "data-v-a66c9aef"]]);
15858
15787
 
15859
15788
  function getDefaultExportFromCjs (x) {
15860
15789
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -16010,14 +15939,15 @@ const useAvailableWidth = ({
16010
15939
  return { innerWidthToBodyWidth, fitsInsideTotalWidth };
16011
15940
  };
16012
15941
 
16013
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
15942
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
16014
15943
  __name: "TableCore",
16015
15944
  props: {
16016
15945
  scrollData: {},
16017
15946
  scrollConfig: {},
16018
15947
  tableConfig: {},
15948
+ subMenuConfig: {},
16019
15949
  totalWidth: {},
16020
- columnSizes: {},
15950
+ colSizes: {},
16021
15951
  currentRowHeight: {},
16022
15952
  columnResize: {},
16023
15953
  newColumnButtonWidth: {}
@@ -16042,7 +15972,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
16042
15972
  () => props.tableConfig.enableRowDeletion ? SPECIAL_COLUMNS_SIZE : 0
16043
15973
  );
16044
15974
  const rightSideSize = computed(() => {
16045
- const rowSubMenuSpace = (props.tableConfig.subMenuItems ?? []).length > 0 || props.tableConfig.reserveSpaceForSubMenu === "always" ? SPECIAL_COLUMNS_SIZE : 0;
15975
+ const rowSubMenuSpace = (props.subMenuConfig.subMenuItems ?? []).length > 0 || props.subMenuConfig.reserveSpaceForSubMenu === "always" ? SPECIAL_COLUMNS_SIZE : 0;
16046
15976
  return rowSubMenuSpace + props.newColumnButtonWidth;
16047
15977
  });
16048
15978
  const scrolledElement = ref(null);
@@ -16055,7 +15985,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
16055
15985
  totalWidth: toRef(props, "totalWidth")
16056
15986
  });
16057
15987
  const currentBodyWidth = computed(() => {
16058
- const widthContentColumns = props.columnSizes.reduce(
15988
+ const widthContentColumns = props.colSizes.reduce(
16059
15989
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16060
15990
  (prev, curr) => prev + curr,
16061
15991
  0
@@ -16074,7 +16004,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
16074
16004
  ref_key: "tableCoreVirtual",
16075
16005
  ref: tableCoreVirtual,
16076
16006
  "scroll-data": __props.scrollData[0],
16077
- "column-sizes": __props.columnSizes,
16007
+ "col-sizes": __props.colSizes,
16078
16008
  "scroll-config": __props.scrollConfig,
16079
16009
  "special-column-sizes": {
16080
16010
  selectionSize: selectionSize.value,
@@ -16110,7 +16040,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
16110
16040
  renderSlot(_ctx.$slots, "belowBody")
16111
16041
  ]),
16112
16042
  _: 3
16113
- }, 8, ["scroll-data", "column-sizes", "scroll-config", "special-column-sizes", "current-body-width", "table-config", "column-resize-active"]);
16043
+ }, 8, ["scroll-data", "col-sizes", "scroll-config", "special-column-sizes", "current-body-width", "table-config", "column-resize-active"]);
16114
16044
  };
16115
16045
  }
16116
16046
  });
@@ -16365,126 +16295,14 @@ const createEditingCellKeydownHandler = ({
16365
16295
  };
16366
16296
  };
16367
16297
 
16368
- const defaultValueFor = (is) => {
16369
- if (is === "ControlMultiselect") {
16370
- return [];
16371
- }
16372
- return "";
16373
- };
16374
- const missingValueFor = (is) => {
16375
- if (is === "ControlMultiselect") {
16376
- return [null];
16377
- }
16378
- return null;
16379
- };
16380
- const isMissingMode = (config) => {
16381
- if (config.is === "ControlMultiselect") {
16382
- return Array.isArray(config.modelValue) && config.modelValue.length === 1 && config.modelValue[0] === null;
16383
- }
16384
- return config.modelValue === null;
16385
- };
16386
- const isActive = (config) => {
16387
- if (!config) {
16388
- return false;
16389
- }
16390
- if (isMissingMode(config)) {
16391
- return true;
16392
- }
16393
- if (config.is === "ControlMultiselect") {
16394
- return Array.isArray(config.modelValue) && config.modelValue.length > 0;
16395
- }
16396
- return config.modelValue !== void 0 && config.modelValue !== "";
16397
- };
16398
-
16399
- const useHeaderMenuItems = ({
16400
- enableSorting,
16401
- enableFiltering,
16402
- filterConfig,
16403
- sortDirection,
16404
- headerSubMenuItems,
16405
- sortTexts,
16406
- onColumnSort,
16407
- openFilterControl,
16408
- clearFilter
16409
- }) => {
16410
- const staticItems = [];
16411
- const hasDynamicItems = Boolean(headerSubMenuItems?.length);
16412
- const showFilterItem = enableFiltering && filterConfig !== void 0;
16413
- const filterIsActive = showFilterItem && isActive(filterConfig);
16414
- if (enableSorting) {
16415
- staticItems.push({
16416
- id: "table-header-sort",
16417
- text: "Sort this column",
16418
- separator: !showFilterItem && hasDynamicItems,
16419
- sectionHeadline: true,
16420
- sectionHeadlineIcon: "sort-ascending"
16421
- });
16422
- staticItems.push({
16423
- id: "sort-asc",
16424
- text: sortTexts.ascending,
16425
- handler: (_item, _event) => {
16426
- onColumnSort(1);
16427
- },
16428
- trailingIcon: sortDirection === 1 ? "checkmark" : void 0
16429
- });
16430
- staticItems.push({
16431
- id: "sort-desc",
16432
- text: sortTexts.descending,
16433
- handler: (_item, _event) => {
16434
- onColumnSort(-1);
16435
- },
16436
- trailingIcon: sortDirection === -1 ? "checkmark" : void 0
16437
- });
16438
- staticItems.push({
16439
- id: "sort-none",
16440
- text: "No sorting",
16441
- handler: (_item, _event) => {
16442
- onColumnSort(0);
16443
- },
16444
- trailingIcon: sortDirection === 0 ? "checkmark" : void 0
16445
- });
16446
- }
16447
- if (showFilterItem) {
16448
- if (filterIsActive) {
16449
- staticItems.push({
16450
- id: "table-header-clear-filter",
16451
- text: "Clear filter",
16452
- separator: hasDynamicItems,
16453
- accessory: {
16454
- type: "icon",
16455
- name: "filter"
16456
- },
16457
- handler: (_item, _event) => {
16458
- clearFilter();
16459
- }
16460
- });
16461
- } else {
16462
- staticItems.push({
16463
- id: "table-header-filter",
16464
- text: "Filter by this column",
16465
- separator: hasDynamicItems,
16466
- accessory: {
16467
- type: "icon",
16468
- name: "filter"
16469
- },
16470
- handler: (_item, _event) => {
16471
- openFilterControl();
16472
- }
16473
- });
16474
- }
16475
- }
16476
- const menuItems = [...staticItems, ...headerSubMenuItems ?? []];
16477
- return menuItems.length ? menuItems : void 0;
16478
- };
16479
-
16480
- const _hoisted_1$b = {
16298
+ const _hoisted_1$c = {
16481
16299
  key: 0,
16482
16300
  class: "page-navigation"
16483
16301
  };
16484
16302
  const _hoisted_2$8 = { class: "navigation-buttons" };
16485
16303
  const _hoisted_3$5 = { class: "page-count" };
16486
16304
  const _hoisted_4$3 = { class: "navigation-buttons" };
16487
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
16305
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
16488
16306
  __name: "PageNavigation",
16489
16307
  props: {
16490
16308
  currentItems: { default: 0 },
@@ -16507,9 +16325,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16507
16325
  emit("pageChange", newPageNumber);
16508
16326
  };
16509
16327
  return (_ctx, _cache) => {
16510
- return hasNextPage.value || hasPreviousPage.value ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
16328
+ return hasNextPage.value || hasPreviousPage.value ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
16511
16329
  createElementVNode("div", _hoisted_2$8, [
16512
- createVNode(unref(_sfc_main$1s), {
16330
+ createVNode(unref(_sfc_main$1v), {
16513
16331
  variant: "transparent",
16514
16332
  size: "small",
16515
16333
  "leading-icon": "chevron-left-double",
@@ -16517,7 +16335,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16517
16335
  disabled: !hasPreviousPage.value,
16518
16336
  onClick: _cache[0] || (_cache[0] = ($event) => onPageChange(1))
16519
16337
  }, null, 8, ["disabled"]),
16520
- createVNode(unref(_sfc_main$1s), {
16338
+ createVNode(unref(_sfc_main$1v), {
16521
16339
  variant: "transparent",
16522
16340
  size: "small",
16523
16341
  "leading-icon": "chevron-left",
@@ -16528,7 +16346,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16528
16346
  ]),
16529
16347
  createElementVNode("span", _hoisted_3$5, toDisplayString(__props.currentPage) + " of " + toDisplayString(totalPages.value), 1),
16530
16348
  createElementVNode("div", _hoisted_4$3, [
16531
- createVNode(unref(_sfc_main$1s), {
16349
+ createVNode(unref(_sfc_main$1v), {
16532
16350
  variant: "transparent",
16533
16351
  size: "small",
16534
16352
  "leading-icon": "chevron-right",
@@ -16536,7 +16354,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16536
16354
  disabled: !hasNextPage.value,
16537
16355
  onClick: _cache[2] || (_cache[2] = ($event) => onPageChange(__props.currentPage + 1))
16538
16356
  }, null, 8, ["disabled"]),
16539
- createVNode(unref(_sfc_main$1s), {
16357
+ createVNode(unref(_sfc_main$1v), {
16540
16358
  variant: "transparent",
16541
16359
  size: "small",
16542
16360
  "leading-icon": "chevron-right-double",
@@ -16550,9 +16368,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16550
16368
  }
16551
16369
  });
16552
16370
 
16553
- const PageNavigation = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__scopeId", "data-v-f8714af0"]]);
16371
+ const PageNavigation = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__scopeId", "data-v-f8714af0"]]);
16554
16372
 
16555
- const _hoisted_1$a = {
16373
+ const _hoisted_1$b = {
16556
16374
  key: 0,
16557
16375
  class: "subtle"
16558
16376
  };
@@ -16566,7 +16384,7 @@ const _hoisted_4$2 = {
16566
16384
  class: "muted"
16567
16385
  };
16568
16386
  const _hoisted_5$1 = { class: "subtle" };
16569
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
16387
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16570
16388
  __name: "PageRowRange",
16571
16389
  props: {
16572
16390
  currentItems: { default: 0 },
@@ -16588,7 +16406,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
16588
16406
  () => hasMultiplePages.value && __props.currentItems ? `of ${__props.currentItems}` : __props.currentItems
16589
16407
  );
16590
16408
  return (_ctx, _cache) => {
16591
- return __props.showTableSize && __props.currentItems === 0 ? (openBlock(), createElementBlock("span", _hoisted_1$a, "No data")) : (openBlock(), createElementBlock("div", _hoisted_2$7, [
16409
+ return __props.showTableSize && __props.currentItems === 0 ? (openBlock(), createElementBlock("span", _hoisted_1$b, "No data")) : (openBlock(), createElementBlock("div", _hoisted_2$7, [
16592
16410
  createElementVNode("span", _hoisted_3$4, toDisplayString(__props.rowLabel) + ":", 1),
16593
16411
  hasMultiplePages.value && __props.currentItems ? (openBlock(), createElementBlock("span", _hoisted_4$2, toDisplayString(pageRangeStart.value) + "–" + toDisplayString(pageRangeEnd.value), 1)) : createCommentVNode("", true),
16594
16412
  createElementVNode("span", _hoisted_5$1, toDisplayString(rowCountText.value), 1)
@@ -16597,25 +16415,34 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
16597
16415
  }
16598
16416
  });
16599
16417
 
16600
- const PageRowRange = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__scopeId", "data-v-6cdf0c06"]]);
16418
+ const PageRowRange = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__scopeId", "data-v-6cdf0c06"]]);
16601
16419
 
16602
- const _sfc_main$e = {
16420
+ const _sfc_main$f = {
16603
16421
  components: {
16604
16422
  PageNavigation,
16605
16423
  PageRowRange,
16606
- KdsMenuButton: _sfc_main$1h
16424
+ KdsMenuButton: _sfc_main$1k
16607
16425
  },
16608
16426
  props: {
16427
+ tableConfig: {
16428
+ type: Object,
16429
+ required: true
16430
+ },
16609
16431
  pageConfig: {
16610
16432
  type: Object,
16611
- default: () => ({})
16612
- }
16613
- },
16614
- emits: ["pageSizeUpdate", "pageChange"],
16615
- computed: {
16616
- showPageNavigationControls() {
16617
- return this.pageConfig.showPageControls ?? true;
16433
+ required: true
16618
16434
  },
16435
+ tableState: {
16436
+ type: Object,
16437
+ required: true
16438
+ },
16439
+ pageState: {
16440
+ type: Object,
16441
+ required: true
16442
+ }
16443
+ },
16444
+ emits: ["pageSizeUpdate", "pageChange"],
16445
+ computed: {
16619
16446
  pageSizeItems() {
16620
16447
  return (this.pageConfig.possiblePageSizes ?? []).map((pageSize) => ({
16621
16448
  id: pageSize.toString(),
@@ -16634,28 +16461,27 @@ const _sfc_main$e = {
16634
16461
  }
16635
16462
  };
16636
16463
 
16637
- const _hoisted_1$9 = { class: "page-controls" };
16464
+ const _hoisted_1$a = { class: "page-controls" };
16638
16465
  const _hoisted_2$6 = { class: "page-size-menu" };
16639
16466
  function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
16640
16467
  const _component_PageRowRange = resolveComponent("PageRowRange");
16641
16468
  const _component_PageNavigation = resolveComponent("PageNavigation");
16642
16469
  const _component_KdsMenuButton = resolveComponent("KdsMenuButton");
16643
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
16470
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
16644
16471
  createVNode(_component_PageRowRange, {
16645
16472
  class: "page-row-range",
16646
- "current-items": $props.pageConfig.currentSize,
16473
+ "current-items": $props.tableState.currentSize,
16647
16474
  "page-size": $props.pageConfig.pageSize,
16648
- "current-page": $props.pageConfig.currentPage,
16649
- "show-table-size": $props.pageConfig.showTableSize,
16650
- "row-label": $props.pageConfig.rowLabel
16475
+ "current-page": $props.pageState.currentPage,
16476
+ "show-table-size": $props.tableConfig.showTableSize,
16477
+ "row-label": $props.tableConfig.rowLabel
16651
16478
  }, null, 8, ["current-items", "page-size", "current-page", "show-table-size", "row-label"]),
16652
- $options.showPageNavigationControls ? (openBlock(), createBlock(_component_PageNavigation, {
16653
- key: 0,
16654
- "current-items": $props.pageConfig.currentSize,
16479
+ createVNode(_component_PageNavigation, {
16480
+ "current-items": $props.tableState.currentSize,
16655
16481
  "page-size": $props.pageConfig.pageSize,
16656
- "current-page": $props.pageConfig.currentPage,
16482
+ "current-page": $props.pageState.currentPage,
16657
16483
  onPageChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("pageChange", $event))
16658
- }, null, 8, ["current-items", "page-size", "current-page"])) : createCommentVNode("", true),
16484
+ }, null, 8, ["current-items", "page-size", "current-page"]),
16659
16485
  createElementVNode("div", _hoisted_2$6, [
16660
16486
  createVNode(_component_KdsMenuButton, {
16661
16487
  items: $options.pageSizeItems,
@@ -16668,9 +16494,40 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
16668
16494
  ])
16669
16495
  ]);
16670
16496
  }
16671
- const PageControls = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["render", _sfc_render$4], ["__scopeId", "data-v-df9e464a"]]);
16497
+ const PageControls = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["render", _sfc_render$4], ["__scopeId", "data-v-10c111ef"]]);
16498
+
16499
+ const defaultValueFor = (is) => {
16500
+ if (is === "ControlMultiselect") {
16501
+ return [];
16502
+ }
16503
+ return "";
16504
+ };
16505
+ const missingValueFor = (is) => {
16506
+ if (is === "ControlMultiselect") {
16507
+ return [null];
16508
+ }
16509
+ return null;
16510
+ };
16511
+ const isMissingMode = (config, value) => {
16512
+ if (config.is === "ControlMultiselect") {
16513
+ return Array.isArray(value) && value.length === 1 && value[0] === null;
16514
+ }
16515
+ return value === null;
16516
+ };
16517
+ const isActive = (config, value) => {
16518
+ if (!config) {
16519
+ return false;
16520
+ }
16521
+ if (isMissingMode(config, value)) {
16522
+ return true;
16523
+ }
16524
+ if (config.is === "ControlMultiselect") {
16525
+ return Array.isArray(value) && value.length > 0;
16526
+ }
16527
+ return value !== void 0 && value !== "";
16528
+ };
16672
16529
 
16673
- const _hoisted_1$8 = {
16530
+ const _hoisted_1$9 = {
16674
16531
  key: 0,
16675
16532
  class: "rows"
16676
16533
  };
@@ -16678,11 +16535,11 @@ const _hoisted_2$5 = {
16678
16535
  key: 1,
16679
16536
  class: "value"
16680
16537
  };
16681
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
16538
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
16682
16539
  __name: "FilterControlBody",
16683
16540
  props: {
16684
- filterConfigs: {},
16685
- columnHeaders: {}
16541
+ columns: {},
16542
+ colFilterValues: {}
16686
16543
  },
16687
16544
  emits: ["columnFilter"],
16688
16545
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -16704,22 +16561,29 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
16704
16561
  return config;
16705
16562
  };
16706
16563
  const filterableColumnIndices = computed(
16707
- () => (props.filterConfigs ?? []).map((config, index) => ({ config, index })).filter(({ config }) => config !== void 0).map(({ index }) => index)
16564
+ () => (props.columns ?? []).map((column, index) => ({ config: column.filterConfig, index })).filter(({ config }) => config !== void 0).map(({ index }) => index)
16708
16565
  );
16709
16566
  const trackedIndices = ref([]);
16710
16567
  onMounted(() => {
16711
- trackedIndices.value = (props.filterConfigs ?? []).map((config, index) => ({ index, config })).filter(({ config }) => isActive(config)).map(({ index }) => index);
16568
+ trackedIndices.value = (props.columns ?? []).map((column, index) => ({
16569
+ index,
16570
+ config: column.filterConfig,
16571
+ value: props.colFilterValues[column.id]
16572
+ })).filter(({ config, value }) => isActive(config, value)).map(({ index }) => index);
16712
16573
  });
16713
16574
  const visibleFilters = computed(
16714
16575
  () => trackedIndices.value.map((index, rowPosition) => {
16715
- const config = props.filterConfigs?.[index];
16576
+ const column = props.columns?.[index];
16577
+ const config = column?.filterConfig;
16578
+ const value = props.colFilterValues[column.id];
16716
16579
  if (!config) {
16717
16580
  return null;
16718
16581
  }
16719
16582
  return {
16720
16583
  rowPosition,
16721
16584
  index,
16722
- config: withFilteredPossibleValues(config)
16585
+ config: withFilteredPossibleValues(config),
16586
+ value
16723
16587
  };
16724
16588
  }).filter(
16725
16589
  (entry) => entry !== null
@@ -16732,7 +16596,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
16732
16596
  (idx) => idx === currentIndex || !trackedIndices.value.includes(idx)
16733
16597
  ).map((idx) => ({
16734
16598
  id: String(idx),
16735
- text: props.columnHeaders[idx]
16599
+ text: props.columns?.[idx]?.header ?? ""
16736
16600
  }));
16737
16601
  const onColumnChange = (rowPosition, newIdAsString) => {
16738
16602
  const newIndex = Number(newIdAsString);
@@ -16740,8 +16604,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
16740
16604
  if (oldIndex === newIndex) {
16741
16605
  return;
16742
16606
  }
16743
- const oldConfig = props.filterConfigs?.[oldIndex];
16744
- if (oldConfig && isActive(oldConfig)) {
16607
+ const oldColumn = props.columns?.[oldIndex];
16608
+ const oldConfig = oldColumn?.filterConfig;
16609
+ const oldValue = props.colFilterValues[oldColumn?.id];
16610
+ if (oldConfig && isActive(oldConfig, oldValue)) {
16745
16611
  emit("columnFilter", oldIndex, defaultValueFor(oldConfig.is));
16746
16612
  }
16747
16613
  trackedIndices.value = trackedIndices.value.map(
@@ -16766,8 +16632,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
16766
16632
  };
16767
16633
  const onDeleteRow = (rowPosition) => {
16768
16634
  const index = trackedIndices.value[rowPosition];
16769
- const config = props.filterConfigs?.[index];
16770
- if (config && isActive(config)) {
16635
+ const column = props.columns?.[index];
16636
+ const config = column?.filterConfig;
16637
+ const value = props.colFilterValues[column?.id];
16638
+ if (isActive(config, value)) {
16771
16639
  emit("columnFilter", index, defaultValueFor(config.is));
16772
16640
  }
16773
16641
  trackedIndices.value = trackedIndices.value.filter(
@@ -16798,13 +16666,13 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
16798
16666
  __expose({ addAndFocusColumn });
16799
16667
  return (_ctx, _cache) => {
16800
16668
  return openBlock(), createElementBlock(Fragment, null, [
16801
- visibleFilters.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
16802
- (openBlock(true), createElementBlock(Fragment, null, renderList(visibleFilters.value, ({ rowPosition, index, config }) => {
16669
+ visibleFilters.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
16670
+ (openBlock(true), createElementBlock(Fragment, null, renderList(visibleFilters.value, ({ rowPosition, index, config, value }) => {
16803
16671
  return openBlock(), createElementBlock("div", {
16804
16672
  key: index,
16805
16673
  class: "row"
16806
16674
  }, [
16807
- createVNode(unref(_sfc_main$z), {
16675
+ createVNode(unref(_sfc_main$A), {
16808
16676
  class: "column",
16809
16677
  "model-value": String(index),
16810
16678
  placeholder: "Select",
@@ -16812,30 +16680,30 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
16812
16680
  ariaLabel: "Select column to filter",
16813
16681
  "onUpdate:modelValue": ($event) => onColumnChange(rowPosition, $event)
16814
16682
  }, null, 8, ["model-value", "possible-values", "onUpdate:modelValue"]),
16815
- createVNode(unref(_sfc_main$z), {
16683
+ createVNode(unref(_sfc_main$A), {
16816
16684
  class: "mode",
16817
- "model-value": unref(isMissingMode)(config) ? "missing" : "contains",
16685
+ "model-value": unref(isMissingMode)(config, value) ? "missing" : "contains",
16818
16686
  placeholder: "Mode",
16819
16687
  "possible-values": MODE_OPTIONS,
16820
16688
  ariaLabel: "Select filter mode",
16821
16689
  "onUpdate:modelValue": ($event) => onModeChange(index, config, $event)
16822
16690
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
16823
- !unref(isMissingMode)(config) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
16691
+ !unref(isMissingMode)(config, value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
16824
16692
  config.is === "FilterInputField" ? (openBlock(), createBlock(unref(KdsTextInput), {
16825
16693
  key: 0,
16826
16694
  ref_for: true,
16827
16695
  ref: (el) => setValueRef(index, el),
16828
16696
  class: "value",
16829
- "model-value": String(config.modelValue ?? ""),
16697
+ "model-value": value ?? "",
16830
16698
  placeholder: "value",
16831
16699
  ariaLabel: "Enter filter value",
16832
16700
  "onUpdate:modelValue": ($event) => emit("columnFilter", index, $event)
16833
- }, null, 8, ["model-value", "onUpdate:modelValue"])) : config.is === "ControlDropdown" ? (openBlock(), createBlock(unref(_sfc_main$z), {
16701
+ }, null, 8, ["model-value", "onUpdate:modelValue"])) : config.is === "ControlDropdown" ? (openBlock(), createBlock(unref(_sfc_main$A), {
16834
16702
  key: 1,
16835
16703
  ref_for: true,
16836
16704
  ref: (el) => setValueRef(index, el),
16837
16705
  class: "value",
16838
- "model-value": config.modelValue ?? "",
16706
+ "model-value": value ?? "",
16839
16707
  placeholder: "value",
16840
16708
  "possible-values": config.possibleValues,
16841
16709
  ariaLabel: "Select filter value",
@@ -16845,14 +16713,14 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
16845
16713
  ref_for: true,
16846
16714
  ref: (el) => setValueRef(index, el),
16847
16715
  class: "value",
16848
- "model-value": config.modelValue ?? [],
16716
+ "model-value": value ?? [],
16849
16717
  placeholder: "value",
16850
16718
  "possible-values": config.possibleValues,
16851
16719
  ariaLabel: "Select filter values",
16852
16720
  "onUpdate:modelValue": ($event) => emit("columnFilter", index, $event)
16853
16721
  }, null, 8, ["model-value", "possible-values", "onUpdate:modelValue"])) : createCommentVNode("", true)
16854
16722
  ], 64)) : (openBlock(), createElementBlock("span", _hoisted_2$5)),
16855
- createVNode(unref(_sfc_main$1s), {
16723
+ createVNode(unref(_sfc_main$1v), {
16856
16724
  class: "trash",
16857
16725
  "aria-label": "Remove filter",
16858
16726
  "leading-icon": "trash",
@@ -16864,7 +16732,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
16864
16732
  ]);
16865
16733
  }), 128))
16866
16734
  ])) : createCommentVNode("", true),
16867
- canAddMore.value ? (openBlock(), createBlock(unref(_sfc_main$1s), {
16735
+ canAddMore.value ? (openBlock(), createBlock(unref(_sfc_main$1v), {
16868
16736
  key: 1,
16869
16737
  class: "add",
16870
16738
  label: "Add criterion",
@@ -16878,16 +16746,16 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
16878
16746
  }
16879
16747
  });
16880
16748
 
16881
- const FilterControlBody = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__scopeId", "data-v-9653892f"]]);
16749
+ const FilterControlBody = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["__scopeId", "data-v-bd4cc5ec"]]);
16882
16750
 
16883
- const _sfc_main$c = { };
16751
+ const _sfc_main$d = { };
16884
16752
 
16885
- const _hoisted_1$7 = { class: "popover" };
16753
+ const _hoisted_1$8 = { class: "popover" };
16886
16754
  const _hoisted_2$4 = { class: "header" };
16887
16755
  const _hoisted_3$3 = { class: "body" };
16888
16756
 
16889
16757
  function _sfc_render$3(_ctx, _cache) {
16890
- return (openBlock(), createElementBlock("div", _hoisted_1$7, [
16758
+ return (openBlock(), createElementBlock("div", _hoisted_1$8, [
16891
16759
  createElementVNode("span", _hoisted_2$4, [
16892
16760
  renderSlot(_ctx.$slots, "header", {}, undefined, true)
16893
16761
  ]),
@@ -16896,7 +16764,7 @@ function _sfc_render$3(_ctx, _cache) {
16896
16764
  ])
16897
16765
  ]))
16898
16766
  }
16899
- const PopoverContainer = /*#__PURE__*/_export_sfc$1(_sfc_main$c, [['render',_sfc_render$3],['__scopeId',"data-v-349cd3ba"]]);
16767
+ const PopoverContainer = /*#__PURE__*/_export_sfc$1(_sfc_main$d, [['render',_sfc_render$3],['__scopeId',"data-v-349cd3ba"]]);
16900
16768
 
16901
16769
  const useButtonPopoverInteraction = ({
16902
16770
  keepButtonActive
@@ -16927,11 +16795,11 @@ const useButtonPopoverInteraction = ({
16927
16795
  };
16928
16796
  };
16929
16797
 
16930
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
16798
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
16931
16799
  __name: "FilterControl",
16932
16800
  props: {
16933
- filterConfigs: {},
16934
- columnHeaders: {}
16801
+ columns: {},
16802
+ colFilterValues: {}
16935
16803
  },
16936
16804
  emits: ["columnFilter"],
16937
16805
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -16940,7 +16808,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
16940
16808
  const filterPopoverRef = useTemplateRef("filterPopoverRef");
16941
16809
  const filterBodyRef = useTemplateRef("filterBodyRef");
16942
16810
  const hasActiveFilter = computed(
16943
- () => props.filterConfigs?.some(isActive) ?? false
16811
+ () => props.columns?.some(
16812
+ (column) => isActive(column.filterConfig, props.colFilterValues[column.id])
16813
+ ) ?? false
16944
16814
  );
16945
16815
  const {
16946
16816
  buttonIsActive,
@@ -16960,7 +16830,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
16960
16830
  __expose({ openPopover });
16961
16831
  return (_ctx, _cache) => {
16962
16832
  return openBlock(), createElementBlock(Fragment, null, [
16963
- createVNode(unref(_sfc_main$1p), {
16833
+ createVNode(unref(_sfc_main$1s), {
16964
16834
  modelValue: unref(buttonIsActive),
16965
16835
  "onUpdate:modelValue": [
16966
16836
  _cache[0] || (_cache[0] = ($event) => isRef(buttonIsActive) ? buttonIsActive.value = $event : null),
@@ -17001,10 +16871,10 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
17001
16871
  createVNode(FilterControlBody, {
17002
16872
  ref_key: "filterBodyRef",
17003
16873
  ref: filterBodyRef,
17004
- "filter-configs": __props.filterConfigs,
17005
- "column-headers": __props.columnHeaders,
16874
+ columns: __props.columns,
16875
+ "col-filter-values": __props.colFilterValues,
17006
16876
  onColumnFilter: _cache[1] || (_cache[1] = (colInd, value) => emit("columnFilter", colInd, value))
17007
- }, null, 8, ["filter-configs", "column-headers"])
16877
+ }, null, 8, ["columns", "col-filter-values"])
17008
16878
  ]),
17009
16879
  _: 1
17010
16880
  })
@@ -17016,14 +16886,14 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
17016
16886
  }
17017
16887
  });
17018
16888
 
17019
- const FilterControl = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__scopeId", "data-v-178504c8"]]);
16889
+ const FilterControl = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__scopeId", "data-v-3cd94230"]]);
17020
16890
 
17021
- const _hoisted_1$6 = { class: "body" };
16891
+ const _hoisted_1$7 = { class: "body" };
17022
16892
  const NONE_COLUMN_VALUE = "None";
17023
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
16893
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
17024
16894
  __name: "SortControl",
17025
16895
  props: {
17026
- sortConfig: {},
16896
+ colSortValues: {},
17027
16897
  sortControlOptions: {}
17028
16898
  },
17029
16899
  emits: ["columnSort"],
@@ -17032,10 +16902,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
17032
16902
  const emit = __emit;
17033
16903
  const sortPopoverRef = useTemplateRef("sortPopoverRef");
17034
16904
  const selectedColumn = ref(
17035
- props.sortConfig?.sortColumn?.toString() ?? NONE_COLUMN_VALUE
16905
+ props.colSortValues?.[0]?.id?.toString() ?? NONE_COLUMN_VALUE
17036
16906
  );
17037
16907
  watch(
17038
- () => props.sortConfig?.sortColumn,
16908
+ () => props.colSortValues?.[0]?.id,
17039
16909
  (val) => {
17040
16910
  if (val === void 0 && selectedColumn.value !== void 0) {
17041
16911
  return;
@@ -17044,7 +16914,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
17044
16914
  }
17045
16915
  );
17046
16916
  const hasSortConfig = computed(
17047
- () => props.sortConfig !== void 0 && props.sortConfig.sortColumn !== void 0 && props.sortConfig.sortDirection !== void 0
16917
+ () => props.colSortValues !== void 0 && props.colSortValues[0]?.id !== void 0 && props.colSortValues[0]?.direction !== void 0
17048
16918
  );
17049
16919
  const possibleColumns = computed(() => [
17050
16920
  { id: NONE_COLUMN_VALUE, text: NONE_COLUMN_VALUE },
@@ -17054,31 +16924,31 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
17054
16924
  () => selectedColumn.value === NONE_COLUMN_VALUE ? [] : props.sortControlOptions.selectableDirections[selectedColumn.value] ?? []
17055
16925
  );
17056
16926
  const selectedSortDirection = computed(
17057
- () => props.sortConfig?.sortDirection?.toString() ?? ""
16927
+ () => props.colSortValues?.[0]?.direction?.toString() ?? ""
17058
16928
  );
17059
16929
  const { buttonIsActive, showPopover, onButtonClick, onPopoverToggle } = useButtonPopoverInteraction({ keepButtonActive: hasSortConfig });
17060
- const onSortColumnChange = (colInd) => {
17061
- selectedColumn.value = colInd;
17062
- if (colInd === NONE_COLUMN_VALUE) {
16930
+ const onSortColumnChange = (columnId) => {
16931
+ selectedColumn.value = columnId;
16932
+ if (columnId === NONE_COLUMN_VALUE) {
17063
16933
  emit("columnSort", void 0, 0);
17064
16934
  return;
17065
16935
  }
17066
16936
  emit(
17067
16937
  "columnSort",
17068
- Number.parseInt(colInd, 10),
17069
- props.sortConfig?.sortDirection || 1
16938
+ columnId,
16939
+ props.colSortValues?.[0]?.direction || 1
17070
16940
  );
17071
16941
  };
17072
16942
  const onSortDirectionChange = (direction) => {
17073
16943
  emit(
17074
16944
  "columnSort",
17075
- Number.parseInt(selectedColumn.value, 10),
16945
+ selectedColumn.value,
17076
16946
  Number.parseInt(direction, 10)
17077
16947
  );
17078
16948
  };
17079
16949
  return (_ctx, _cache) => {
17080
16950
  return openBlock(), createElementBlock(Fragment, null, [
17081
- createVNode(unref(_sfc_main$1p), {
16951
+ createVNode(unref(_sfc_main$1s), {
17082
16952
  "model-value": unref(buttonIsActive),
17083
16953
  label: "Sorting",
17084
16954
  size: "small",
@@ -17111,14 +16981,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
17111
16981
  _cache[0] || (_cache[0] = createTextVNode(" Sorting ", -1))
17112
16982
  ]),
17113
16983
  body: withCtx(() => [
17114
- createElementVNode("div", _hoisted_1$6, [
17115
- createVNode(unref(_sfc_main$z), {
16984
+ createElementVNode("div", _hoisted_1$7, [
16985
+ createVNode(unref(_sfc_main$A), {
17116
16986
  "model-value": selectedColumn.value,
17117
16987
  "possible-values": possibleColumns.value,
17118
16988
  ariaLabel: "Column to sort by",
17119
16989
  "onUpdate:modelValue": onSortColumnChange
17120
16990
  }, null, 8, ["model-value", "possible-values"]),
17121
- createVNode(unref(_sfc_main$z), {
16991
+ createVNode(unref(_sfc_main$A), {
17122
16992
  "model-value": selectedSortDirection.value,
17123
16993
  "possible-values": possibleDirections.value,
17124
16994
  ariaLabel: "Sort direction",
@@ -17138,9 +17008,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
17138
17008
  }
17139
17009
  });
17140
17010
 
17141
- const SortControl = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__scopeId", "data-v-80bf221a"]]);
17011
+ const SortControl = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__scopeId", "data-v-ad5ee20c"]]);
17142
17012
 
17143
- const _hoisted_1$5 = { class: "left" };
17013
+ const _hoisted_1$6 = { class: "left" };
17144
17014
  const _hoisted_2$3 = {
17145
17015
  key: 0,
17146
17016
  class: "title"
@@ -17150,7 +17020,7 @@ const _hoisted_3$2 = {
17150
17020
  class: "dimension"
17151
17021
  };
17152
17022
  const _hoisted_4$1 = { class: "right" };
17153
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17023
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
17154
17024
  __name: "TableActionBar",
17155
17025
  props: {
17156
17026
  allRowsCount: { default: 0 },
@@ -17160,19 +17030,17 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17160
17030
  rowLabel: { default: "Rows" },
17161
17031
  title: { default: "" },
17162
17032
  showTableSize: { type: Boolean, default: true },
17163
- showFilterControl: { type: Boolean },
17164
- showSortControl: { type: Boolean },
17165
- sortConfig: {},
17033
+ actionConfig: {},
17034
+ colSortValues: { default: () => [] },
17035
+ colFilterValues: {},
17166
17036
  sortControlOptions: {},
17167
- filterConfigs: {},
17168
- columnHeaders: {},
17169
- settingsItems: { default: () => [] }
17037
+ columns: {}
17170
17038
  },
17171
17039
  emits: ["resetTemporaryView", "columnFilter", "onColumnSort"],
17172
17040
  setup(__props, { expose: __expose, emit: __emit }) {
17173
17041
  const isTemporaryView = computed(() => __props.title === "Temporary view");
17174
17042
  const hasContent = computed(
17175
- () => Boolean(__props.title) || __props.showTableSize || __props.showSortControl || __props.showFilterControl
17043
+ () => Boolean(__props.title) || __props.showTableSize || __props.actionConfig.enableSorting || __props.actionConfig.enableFilters
17176
17044
  );
17177
17045
  const hasRows = computed(() => __props.allRowsCount > 0);
17178
17046
  const shouldAppendOfRows = computed(() => __props.filteredRowsCount < __props.allRowsCount);
@@ -17181,7 +17049,6 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17181
17049
  const shouldAppendOfColumns = computed(
17182
17050
  () => __props.filteredColumnsCount < __props.allColumnsCount
17183
17051
  );
17184
- const hasSettingsItems = computed(() => __props.settingsItems.length > 0);
17185
17052
  const formatCount = (label, filteredCount, totalCount, appendTotal) => `${label}: ${filteredCount}${appendTotal ? ` of ${totalCount}` : ""}`;
17186
17053
  const dimensionText = computed(() => {
17187
17054
  if (!hasRows.value && !hasColumns.value) {
@@ -17217,34 +17084,34 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17217
17084
  key: 0,
17218
17085
  class: normalizeClass(["kds-table-action-bar", { "temporary-view": isTemporaryView.value }])
17219
17086
  }, [
17220
- createElementVNode("div", _hoisted_1$5, [
17087
+ createElementVNode("div", _hoisted_1$6, [
17221
17088
  __props.title ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
17222
17089
  __props.showTableSize ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(dimensionText.value), 1)) : createCommentVNode("", true),
17223
- __props.showSortControl ? (openBlock(), createBlock(SortControl, {
17090
+ __props.actionConfig.enableSorting ? (openBlock(), createBlock(SortControl, {
17224
17091
  key: 2,
17225
- "sort-config": __props.sortConfig,
17092
+ "col-sort-values": __props.colSortValues,
17226
17093
  "sort-control-options": __props.sortControlOptions,
17227
- onColumnSort: _cache[0] || (_cache[0] = (colInd, colDir) => emit("onColumnSort", colInd, colDir))
17228
- }, null, 8, ["sort-config", "sort-control-options"])) : createCommentVNode("", true),
17229
- __props.showFilterControl ? (openBlock(), createBlock(FilterControl, {
17094
+ onColumnSort: _cache[0] || (_cache[0] = (columnId, colDir) => emit("onColumnSort", columnId, colDir))
17095
+ }, null, 8, ["col-sort-values", "sort-control-options"])) : createCommentVNode("", true),
17096
+ __props.actionConfig.enableFilters ? (openBlock(), createBlock(FilterControl, {
17230
17097
  key: 3,
17231
17098
  ref_key: "filterControlRef",
17232
17099
  ref: filterControlRef,
17233
- "filter-configs": __props.filterConfigs,
17234
- "column-headers": __props.columnHeaders,
17100
+ columns: __props.columns,
17101
+ "col-filter-values": __props.colFilterValues,
17235
17102
  onColumnFilter: _cache[1] || (_cache[1] = (colInd, value) => emit("columnFilter", colInd, value))
17236
- }, null, 8, ["filter-configs", "column-headers"])) : createCommentVNode("", true)
17103
+ }, null, 8, ["columns", "col-filter-values"])) : createCommentVNode("", true)
17237
17104
  ]),
17238
17105
  createElementVNode("div", _hoisted_4$1, [
17239
- hasSettingsItems.value ? (openBlock(), createBlock(unref(_sfc_main$1h), {
17106
+ __props.actionConfig.settingsItems?.length ? (openBlock(), createBlock(unref(_sfc_main$1k), {
17240
17107
  key: 0,
17241
17108
  ariaLabel: "Table settings",
17242
17109
  size: "small",
17243
17110
  variant: "transparent",
17244
17111
  "leading-icon": "parameter",
17245
- items: __props.settingsItems
17112
+ items: __props.actionConfig.settingsItems
17246
17113
  }, null, 8, ["items"])) : createCommentVNode("", true),
17247
- isTemporaryView.value ? (openBlock(), createBlock(unref(_sfc_main$1s), {
17114
+ isTemporaryView.value ? (openBlock(), createBlock(unref(_sfc_main$1v), {
17248
17115
  key: 1,
17249
17116
  ariaLabel: "Reset to Nodeoutput",
17250
17117
  size: "small",
@@ -17258,7 +17125,93 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17258
17125
  }
17259
17126
  });
17260
17127
 
17261
- const TableActionBar = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__scopeId", "data-v-8cfb3c41"]]);
17128
+ const TableActionBar = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__scopeId", "data-v-4a59722f"]]);
17129
+
17130
+ const useHeaderMenuItems = ({
17131
+ enableSorting,
17132
+ enableFilters,
17133
+ filterConfig,
17134
+ filterValue,
17135
+ sortDirection,
17136
+ headerSubMenuItems,
17137
+ sortTexts,
17138
+ onColumnSort,
17139
+ openFilterControl,
17140
+ clearFilter
17141
+ }) => {
17142
+ const staticItems = [];
17143
+ const hasDynamicItems = Boolean(headerSubMenuItems?.length);
17144
+ const showFilterItem = enableFilters && filterConfig !== void 0;
17145
+ const filterIsActive = showFilterItem && isActive(filterConfig, filterValue);
17146
+ if (enableSorting) {
17147
+ staticItems.push({
17148
+ id: "table-header-sort",
17149
+ text: "Sort this column",
17150
+ accessory: {
17151
+ type: "icon",
17152
+ name: "sort-ascending"
17153
+ },
17154
+ separator: !showFilterItem && hasDynamicItems,
17155
+ children: [
17156
+ {
17157
+ id: "sort-asc",
17158
+ text: sortTexts.ascending,
17159
+ handler: (_item, _event) => {
17160
+ onColumnSort(1);
17161
+ },
17162
+ trailingIcon: sortDirection === 1 ? "checkmark" : void 0
17163
+ },
17164
+ {
17165
+ id: "sort-desc",
17166
+ text: sortTexts.descending,
17167
+ handler: (_item, _event) => {
17168
+ onColumnSort(-1);
17169
+ },
17170
+ trailingIcon: sortDirection === -1 ? "checkmark" : void 0
17171
+ },
17172
+ {
17173
+ id: "sort-none",
17174
+ text: "No sorting",
17175
+ handler: (_item, _event) => {
17176
+ onColumnSort(0);
17177
+ },
17178
+ trailingIcon: sortDirection === 0 ? "checkmark" : void 0
17179
+ }
17180
+ ]
17181
+ });
17182
+ }
17183
+ if (showFilterItem) {
17184
+ if (filterIsActive) {
17185
+ staticItems.push({
17186
+ id: "table-header-clear-filter",
17187
+ text: "Clear filter",
17188
+ separator: hasDynamicItems,
17189
+ accessory: {
17190
+ type: "icon",
17191
+ name: "filter"
17192
+ },
17193
+ handler: (_item, _event) => {
17194
+ clearFilter();
17195
+ }
17196
+ });
17197
+ } else {
17198
+ staticItems.push({
17199
+ id: "table-header-filter",
17200
+ text: "Filter by this column",
17201
+ separator: hasDynamicItems,
17202
+ accessory: {
17203
+ type: "icon",
17204
+ name: "filter"
17205
+ },
17206
+ handler: (_item, _event) => {
17207
+ openFilterControl();
17208
+ }
17209
+ });
17210
+ }
17211
+ }
17212
+ const menuItems = [...staticItems, ...headerSubMenuItems ?? []];
17213
+ return menuItems.length ? menuItems : void 0;
17214
+ };
17262
17215
 
17263
17216
  const AUTO_SCROLL_EDGE_SIZE = 20;
17264
17217
  const AUTO_SCROLL_SPEED = 250;
@@ -17313,42 +17266,289 @@ const useAutoScrollOnRightEdge = ({
17313
17266
  return { onPointerDown, onPointerMove, onPointerUp };
17314
17267
  };
17315
17268
 
17269
+ const _hoisted_1$5 = ["tabindex"];
17270
+ const _hoisted_2$2 = ["title"];
17271
+ const _hoisted_3$1 = {
17272
+ key: 0,
17273
+ class: "sub-header-text-container"
17274
+ };
17275
+ const _hoisted_4 = {
17276
+ key: 0,
17277
+ class: "delete-column-button"
17278
+ };
17279
+ const _hoisted_5 = { key: 1 };
17280
+ const columnMenuButtonRef = "columnMenuButton";
17281
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17282
+ __name: "HeaderCell",
17283
+ props: {
17284
+ column: {},
17285
+ colFilterValue: {},
17286
+ tableConfig: {},
17287
+ actionConfig: {},
17288
+ sortDirection: {},
17289
+ columnSize: {},
17290
+ focused: { type: Boolean },
17291
+ selected: { type: Boolean },
17292
+ otherColumnResizing: { type: Boolean },
17293
+ getDragHandleHeight: { type: Function }
17294
+ },
17295
+ emits: ["onColumnSort", "openActionBarFilterControl", "clearColumnFilter", "onHeaderCellFocus", "onHeaderCellBlur", "onHeaderClick", "onKeydownTab", "onKeydownLeft", "onKeydownRight", "onKeydownDown", "onHeaderCellKeydown", "onDeleteColumn", "columnResizeStart", "columnResizeEnd", "columnResize", "allColumnsResize"],
17296
+ setup(__props, { expose: __expose, emit: __emit }) {
17297
+ const props = __props;
17298
+ const emit = __emit;
17299
+ const columnHeader = useTemplateRef("columnHeader");
17300
+ const content = useTemplateRef("content");
17301
+ const mainHeader = useTemplateRef("mainHeader");
17302
+ const headerText = useTemplateRef("headerText");
17303
+ const columnDeleteButton = useTemplateRef("columnDeleteButton");
17304
+ const columnMenuButton = useTemplateRef(columnMenuButtonRef);
17305
+ const subMenuItems = computed(
17306
+ () => useHeaderMenuItems({
17307
+ enableFilters: Boolean(props.actionConfig.enableFilters),
17308
+ filterConfig: props.column.filterConfig,
17309
+ filterValue: props.colFilterValue,
17310
+ enableSorting: Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable,
17311
+ sortDirection: props.sortDirection,
17312
+ sortTexts: columnSortText[props.column.type ?? "default"],
17313
+ headerSubMenuItems: props.column.headerSubMenuItems,
17314
+ onColumnSort: (direction) => emit("onColumnSort", direction),
17315
+ openFilterControl: () => emit("openActionBarFilterControl"),
17316
+ clearFilter: () => emit("clearColumnFilter")
17317
+ })
17318
+ );
17319
+ const hovered = ref(false);
17320
+ const onPointerOver = () => {
17321
+ hovered.value = true;
17322
+ };
17323
+ const onPointerLeave = () => {
17324
+ hovered.value = false;
17325
+ };
17326
+ const dragging = ref(false);
17327
+ let columnSizeOnDragStart = 0;
17328
+ let pageXOnDragStart = 0;
17329
+ let currentPageX = 0;
17330
+ let currentDragHandlerHeight = 0;
17331
+ const scrollContainer = useScrollContainer();
17332
+ const autoScrollOffset = ref(0);
17333
+ const emitColumnResize = () => {
17334
+ if (!dragging.value) {
17335
+ return;
17336
+ }
17337
+ const newColumnSize = columnSizeOnDragStart + (currentPageX - pageXOnDragStart) + autoScrollOffset.value;
17338
+ emit("columnResize", Math.max(newColumnSize, MIN_COLUMN_SIZE));
17339
+ };
17340
+ const {
17341
+ onPointerDown: startAutoScroll,
17342
+ onPointerMove: updateAutoScroll,
17343
+ onPointerUp: stopAutoScroll
17344
+ } = useAutoScrollOnRightEdge({
17345
+ scrollContainer,
17346
+ autoScrollOffset,
17347
+ onAutoScroll: emitColumnResize
17348
+ });
17349
+ const currentResizeDragHandleWidth = computed(
17350
+ () => props.tableConfig.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0
17351
+ );
17352
+ const dragHandleHeight = (isDragging) => isDragging ? currentDragHandlerHeight : HEADER_HEIGHT;
17353
+ const onPointerDown = (event) => {
17354
+ consola.debug("Resize via drag triggered: ", event);
17355
+ event.stopPropagation();
17356
+ event.target.setPointerCapture(event.pointerId);
17357
+ dragging.value = true;
17358
+ currentDragHandlerHeight = props.getDragHandleHeight();
17359
+ columnSizeOnDragStart = props.columnSize ?? MIN_COLUMN_SIZE;
17360
+ pageXOnDragStart = event.pageX;
17361
+ currentPageX = event.pageX;
17362
+ emit("columnResizeStart");
17363
+ startAutoScroll(event.clientX);
17364
+ };
17365
+ const onPointerUp = (event) => {
17366
+ emit("columnResizeEnd");
17367
+ if (event.shiftKey) {
17368
+ const newColumnSize = columnSizeOnDragStart + event.pageX - pageXOnDragStart + autoScrollOffset.value;
17369
+ emit("allColumnsResize", Math.max(newColumnSize, MIN_COLUMN_SIZE));
17370
+ }
17371
+ stopAutoScroll();
17372
+ };
17373
+ const unthrottledOnPointerMove = (event) => {
17374
+ if (dragging.value) {
17375
+ consola.debug("Resize via drag ongoing: ", event);
17376
+ currentPageX = event.pageX;
17377
+ emitColumnResize();
17378
+ updateAutoScroll(event.clientX);
17379
+ }
17380
+ };
17381
+ const onPointerMove = throttle((event) => {
17382
+ unthrottledOnPointerMove(event);
17383
+ });
17384
+ const onLostPointerCapture = throttle((event) => {
17385
+ consola.debug("Resize via drag finished: ", event);
17386
+ stopAutoScroll();
17387
+ dragging.value = false;
17388
+ hovered.value = false;
17389
+ });
17390
+ const getHeaderCellWidth = () => {
17391
+ const widthCompleteHeader = Math.ceil(
17392
+ columnHeader.value.getBoundingClientRect().width
17393
+ );
17394
+ const widthMainHeader = Math.ceil(
17395
+ mainHeader.value.getBoundingClientRect().width
17396
+ );
17397
+ const widthHeaderText = headerText.value.getBoundingClientRect().width;
17398
+ return widthCompleteHeader - widthMainHeader + widthHeaderText + currentResizeDragHandleWidth.value;
17399
+ };
17400
+ const focus = () => {
17401
+ if (props.tableConfig.enableHeaderCellSelection || props.column.editable) {
17402
+ content.value?.focus();
17403
+ } else if (subMenuItems.value?.length) {
17404
+ columnMenuButton.value?.menuButtonEl?.$el?.focus();
17405
+ } else if (props.column.deletable) {
17406
+ columnDeleteButton.value?.$el?.focus();
17407
+ }
17408
+ };
17409
+ const isFocusable = () => Boolean(
17410
+ props.tableConfig.enableHeaderCellSelection || props.column.editable || subMenuItems.value?.length || props.column.deletable
17411
+ );
17412
+ __expose({ getHeaderCellWidth, focus, isFocusable });
17413
+ return (_ctx, _cache) => {
17414
+ return openBlock(), createElementBlock("th", {
17415
+ ref_key: "columnHeader",
17416
+ ref: columnHeader,
17417
+ scope: "col",
17418
+ style: normalizeStyle({
17419
+ width: `calc(${__props.columnSize || unref(MIN_COLUMN_SIZE)}px)`,
17420
+ ...__props.column.headerColor ? { "--data-cell-color": __props.column.headerColor } : {}
17421
+ }),
17422
+ class: normalizeClass([
17423
+ "column-header",
17424
+ {
17425
+ "colored-header": __props.column.headerColor,
17426
+ "header-focused": __props.focused || __props.selected
17427
+ }
17428
+ ])
17429
+ }, [
17430
+ createElementVNode("div", {
17431
+ ref_key: "content",
17432
+ ref: content,
17433
+ class: normalizeClass(["column-header-content", [
17434
+ {
17435
+ "with-button-in-header": subMenuItems.value?.length || __props.column.deletable
17436
+ }
17437
+ ]]),
17438
+ tabindex: __props.tableConfig.enableHeaderCellSelection || __props.column.editable ? 0 : -1,
17439
+ onFocus: _cache[0] || (_cache[0] = ($event) => emit("onHeaderCellFocus")),
17440
+ onBlur: _cache[1] || (_cache[1] = ($event) => emit("onHeaderCellBlur")),
17441
+ onClick: _cache[2] || (_cache[2] = ($event) => emit("onHeaderClick")),
17442
+ onKeydown: [
17443
+ _cache[3] || (_cache[3] = withKeys(($event) => emit("onHeaderClick"), ["space"])),
17444
+ _cache[4] || (_cache[4] = withKeys(($event) => emit("onKeydownTab"), ["tab"])),
17445
+ _cache[5] || (_cache[5] = withKeys(withModifiers(($event) => emit("onKeydownLeft"), ["prevent"]), ["left"])),
17446
+ _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => emit("onKeydownRight"), ["prevent"]), ["right"])),
17447
+ _cache[7] || (_cache[7] = withKeys(withModifiers(($event) => emit("onKeydownDown"), ["self", "prevent"]), ["down"])),
17448
+ _cache[8] || (_cache[8] = ($event) => emit("onHeaderCellKeydown", $event))
17449
+ ]
17450
+ }, [
17451
+ createElementVNode("div", {
17452
+ ref_key: "mainHeader",
17453
+ ref: mainHeader,
17454
+ class: "main-header"
17455
+ }, [
17456
+ createElementVNode("div", {
17457
+ class: "header-text-container",
17458
+ title: __props.column.header
17459
+ }, [
17460
+ createElementVNode("span", {
17461
+ ref_key: "headerText",
17462
+ ref: headerText
17463
+ }, toDisplayString(__props.column.header), 513)
17464
+ ], 8, _hoisted_2$2)
17465
+ ], 512),
17466
+ __props.column.subHeader ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
17467
+ renderSlot(_ctx.$slots, "subHeader", {
17468
+ subHeader: __props.column.subHeader
17469
+ }, () => [
17470
+ createTextVNode(toDisplayString(__props.column.subHeader), 1)
17471
+ ], true)
17472
+ ])) : createCommentVNode("", true)
17473
+ ], 42, _hoisted_1$5),
17474
+ __props.column.deletable ? (openBlock(), createElementBlock("div", _hoisted_4, [
17475
+ createVNode(unref(_sfc_main$1v), {
17476
+ ref_key: "columnDeleteButton",
17477
+ ref: columnDeleteButton,
17478
+ variant: "transparent",
17479
+ "leading-icon": "trash",
17480
+ size: "small",
17481
+ ariaLabel: "Delete column",
17482
+ onClick: _cache[9] || (_cache[9] = withModifiers(($event) => emit("onDeleteColumn"), ["stop"])),
17483
+ onKeydown: _cache[10] || (_cache[10] = withKeys(withModifiers(($event) => emit("onKeydownDown"), ["prevent", "stop"]), ["down"]))
17484
+ }, null, 512)
17485
+ ])) : createCommentVNode("", true),
17486
+ subMenuItems.value?.length ? (openBlock(), createElementBlock("div", _hoisted_5, [
17487
+ createVNode(unref(_sfc_main$1k), {
17488
+ ref: columnMenuButtonRef,
17489
+ ariaLabel: "Table column options",
17490
+ items: subMenuItems.value,
17491
+ size: "small",
17492
+ variant: "transparent",
17493
+ "leading-icon": "more-actions",
17494
+ onKeydown: _cache[11] || (_cache[11] = withKeys(withModifiers(($event) => emit("onKeydownDown"), ["prevent", "stop"]), ["down"]))
17495
+ }, null, 8, ["items"])
17496
+ ])) : createCommentVNode("", true),
17497
+ __props.tableConfig.enableColumnResizing ? (openBlock(), createElementBlock("div", {
17498
+ key: 2,
17499
+ class: normalizeClass([
17500
+ "resize-handle-area",
17501
+ { hover: hovered.value && !__props.otherColumnResizing, drag: dragging.value }
17502
+ ]),
17503
+ style: normalizeStyle({
17504
+ height: `${dragHandleHeight(dragging.value)}px`
17505
+ }),
17506
+ onPointerover: onPointerOver,
17507
+ onPointerleave: onPointerLeave,
17508
+ onPointerdownPassive: _cache[12] || (_cache[12] = ($event) => onPointerDown($event)),
17509
+ onPointerupPassive: _cache[13] || (_cache[13] = ($event) => onPointerUp($event)),
17510
+ onPointermove: _cache[14] || (_cache[14] = //@ts-ignore
17511
+ (...args) => unref(onPointerMove) && unref(onPointerMove)(...args)),
17512
+ onLostpointercapture: _cache[15] || (_cache[15] = //@ts-ignore
17513
+ (...args) => unref(onLostPointerCapture) && unref(onLostPointerCapture)(...args))
17514
+ }, [..._cache[16] || (_cache[16] = [
17515
+ createElementVNode("span", { class: "resize-handle" }, null, -1)
17516
+ ])], 38)) : createCommentVNode("", true)
17517
+ ], 6);
17518
+ };
17519
+ }
17520
+ });
17521
+
17522
+ const HeaderCell = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__scopeId", "data-v-b99ef494"]]);
17523
+
17316
17524
  const _sfc_main$8 = {
17317
17525
  components: {
17318
- KdsCheckbox: _sfc_main$10,
17319
- KdsButton: _sfc_main$1s,
17320
- KdsMenuButton: _sfc_main$1h
17526
+ KdsCheckbox: _sfc_main$13,
17527
+ KdsButton: _sfc_main$1v,
17528
+ HeaderCell
17321
17529
  },
17322
17530
  props: {
17323
17531
  tableConfig: {
17324
17532
  type: Object,
17325
17533
  default: () => ({})
17326
17534
  },
17327
- columnHeaders: {
17328
- type: Array,
17329
- default: () => []
17330
- },
17331
- columnSubHeaders: {
17332
- type: Array,
17333
- default: () => []
17334
- },
17335
- columnSizes: {
17336
- type: Array,
17337
- default: () => []
17535
+ actionConfig: {
17536
+ type: Object,
17537
+ default: () => ({})
17338
17538
  },
17339
- columnSubMenuItems: {
17539
+ columns: {
17340
17540
  type: Array,
17341
17541
  default: () => []
17342
17542
  },
17343
- columnHeaderColors: {
17344
- type: Array,
17345
- default: () => []
17543
+ colFilterValues: {
17544
+ type: Object,
17545
+ default: () => ({})
17346
17546
  },
17347
- columnDeletables: {
17547
+ colSizes: {
17348
17548
  type: Array,
17349
17549
  default: () => []
17350
17550
  },
17351
- columnEditables: {
17551
+ colSortValues: {
17352
17552
  type: Array,
17353
17553
  default: () => []
17354
17554
  },
@@ -17378,6 +17578,9 @@ const _sfc_main$8 = {
17378
17578
  columnResizeEnd: () => true,
17379
17579
  columnResizeStart: () => true,
17380
17580
  allColumnsResize: (newSize) => true,
17581
+ columnSort: (index, direction) => true,
17582
+ openActionBarFilterControl: (index) => true,
17583
+ clearColumnFilter: (index) => true,
17381
17584
  moveDownFromHeaderCell: (index) => true,
17382
17585
  headerCellSelect: (index) => true,
17383
17586
  "update:newColumnButtonWidth": (width) => true,
@@ -17389,33 +17592,7 @@ const _sfc_main$8 = {
17389
17592
  deleteColumn: (index) => true
17390
17593
  },
17391
17594
  setup(props, { emit }) {
17392
- const { indexedData: indexedColumnHeaders, style: headerStyles } = useIndicesAndStylesFor(toRef(props, "columnHeaders"));
17393
- const scrollContainer = useScrollContainer();
17394
- const dragIndex = ref(null);
17395
- const columnSizeOnDragStart = ref(0);
17396
- const pageXOnDragStart = ref(0);
17397
- const currentPageX = ref(0);
17398
- const autoScrollOffset = ref(0);
17399
- const emitColumnResize = () => {
17400
- if (dragIndex.value === null) {
17401
- return;
17402
- }
17403
- const newColumnSize = columnSizeOnDragStart.value + (currentPageX.value - pageXOnDragStart.value) + autoScrollOffset.value;
17404
- emit(
17405
- "columnResize",
17406
- dragIndex.value,
17407
- Math.max(newColumnSize, MIN_COLUMN_SIZE)
17408
- );
17409
- };
17410
- const {
17411
- onPointerDown: startAutoScroll,
17412
- onPointerMove: updateAutoScroll,
17413
- onPointerUp: stopAutoScroll
17414
- } = useAutoScrollOnRightEdge({
17415
- scrollContainer,
17416
- autoScrollOffset,
17417
- onAutoScroll: emitColumnResize
17418
- });
17595
+ const { indexedData: indexedColumns, style: headerStyles } = useIndicesAndStylesFor(toRef(props, "columns"));
17419
17596
  let currentColumnIndex = 0;
17420
17597
  const onStartEditing = (initialValue) => {
17421
17598
  emit("headerCellStartEditing", currentColumnIndex, initialValue);
@@ -17428,51 +17605,20 @@ const _sfc_main$8 = {
17428
17605
  currentColumnIndex = columnIndex;
17429
17606
  startEditingKeydown(event);
17430
17607
  };
17431
- return {
17432
- indexedColumnHeaders,
17433
- headerStyles,
17434
- onHeaderCellKeydown,
17435
- scrollContainer,
17436
- dragIndex,
17437
- columnSizeOnDragStart,
17438
- pageXOnDragStart,
17439
- currentPageX,
17440
- autoScrollOffset,
17441
- emitColumnResize,
17442
- startAutoScroll,
17443
- updateAutoScroll,
17444
- stopAutoScroll
17445
- };
17608
+ return { indexedColumns, headerStyles, onHeaderCellKeydown };
17446
17609
  },
17447
17610
  /* eslint-enable @typescript-eslint/no-unused-vars */
17448
17611
  data() {
17449
17612
  return {
17450
- hoverIndex: null,
17451
- // the index of the column that is currently being hovered over; null during resize
17452
17613
  minimumColumnWidth: MIN_COLUMN_SIZE,
17453
17614
  // need to add this here since it is referenced in the template
17454
- maximumSubMenuWidth: MAX_SUB_MENU_WIDTH,
17455
- currentDragHandlerHeight: 0,
17456
- borderTop: kdsSpacingContainer0p10x,
17615
+ resizingColumnIndex: null,
17616
+ // the index of the column that is currently being resized; null otherwise
17457
17617
  focusedHeaderIndex: null
17458
17618
  // the index of the currently focused header cell
17459
17619
  };
17460
17620
  },
17461
17621
  computed: {
17462
- enableColumnResizing() {
17463
- const enableColumnResizingSetting = this.tableConfig.enableColumnResizing;
17464
- if (enableColumnResizingSetting === void 0) {
17465
- return true;
17466
- } else {
17467
- return enableColumnResizingSetting;
17468
- }
17469
- },
17470
- hasSubHeaders() {
17471
- return this.columnSubHeaders.some(Boolean);
17472
- },
17473
- currentResizeDragHandleWidth() {
17474
- return this.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0;
17475
- },
17476
17622
  headerSelectionOverlayStyle() {
17477
17623
  const columnIndex = this.selectedHeaderIndex;
17478
17624
  if (columnIndex === null || !this.tableConfig.enableHeaderCellSelection) {
@@ -17482,16 +17628,13 @@ const _sfc_main$8 = {
17482
17628
  if (this.tableConfig.showSelection) {
17483
17629
  left += SPECIAL_COLUMNS_SIZE;
17484
17630
  }
17485
- if (this.tableConfig.showCollapser) {
17486
- left += SPECIAL_COLUMNS_SIZE;
17487
- }
17488
17631
  if (this.tableConfig.enableRowDeletion) {
17489
17632
  left += SPECIAL_COLUMNS_SIZE;
17490
17633
  }
17491
17634
  for (let i = 0; i < columnIndex; i++) {
17492
- left += this.columnSizes[i];
17635
+ left += this.columnSize(i);
17493
17636
  }
17494
- const width = this.columnSizes[columnIndex];
17637
+ const width = this.columnSize(columnIndex);
17495
17638
  return {
17496
17639
  left: `${left}px`,
17497
17640
  width: `${width}px`
@@ -17499,8 +17642,15 @@ const _sfc_main$8 = {
17499
17642
  }
17500
17643
  },
17501
17644
  methods: {
17645
+ columnSize(columnIndex) {
17646
+ return this.colSizes[columnIndex] ?? this.minimumColumnWidth;
17647
+ },
17648
+ sortDirection(columnIndex) {
17649
+ const columnId = this.columns[columnIndex].id;
17650
+ return this.colSortValues.find(({ id }) => id === columnId)?.direction ?? 0;
17651
+ },
17502
17652
  onHeaderCellFocus(columnIndex) {
17503
- if (!this.tableConfig.enableHeaderCellSelection && !this.columnEditables[columnIndex]) {
17653
+ if (!this.tableConfig.enableHeaderCellSelection && !this.columns[columnIndex].editable) {
17504
17654
  return;
17505
17655
  }
17506
17656
  this.focusedHeaderIndex = columnIndex;
@@ -17508,7 +17658,7 @@ const _sfc_main$8 = {
17508
17658
  },
17509
17659
  onHeaderCellBlur(columnIndex) {
17510
17660
  this.focusedHeaderIndex = null;
17511
- if (!this.columnEditables[columnIndex]) {
17661
+ if (!this.columns[columnIndex].editable) {
17512
17662
  this.$emit("headerCellDeselect");
17513
17663
  }
17514
17664
  },
@@ -17526,90 +17676,46 @@ const _sfc_main$8 = {
17526
17676
  if (this.tableConfig.enableHeaderCellSelection && this.selectedHeaderIndex !== ind) {
17527
17677
  this.$emit("headerCellSelect", ind);
17528
17678
  }
17529
- if (this.columnEditables[ind]) {
17679
+ if (this.columns[ind].editable) {
17530
17680
  this.$emit("headerCellStartEditing", ind);
17531
17681
  }
17532
17682
  },
17533
- onPointerOver(event, columnIndex) {
17534
- consola.debug("Begin hover over drag handle: ", event);
17535
- if (this.dragIndex === null) {
17536
- this.hoverIndex = columnIndex;
17537
- }
17538
- },
17539
- onPointerLeave(event) {
17540
- consola.debug("End hover over drag handle: ", event);
17541
- if (this.dragIndex === null) {
17542
- this.hoverIndex = null;
17543
- }
17544
- },
17545
- onPointerDown(event, columnIndex) {
17546
- consola.debug("Resize via drag triggered: ", event);
17547
- event.stopPropagation();
17548
- event.target.setPointerCapture(event.pointerId);
17549
- this.dragIndex = columnIndex;
17550
- this.currentDragHandlerHeight = this.getDragHandleHeight();
17551
- this.columnSizeOnDragStart = this.columnSizes[columnIndex];
17552
- this.pageXOnDragStart = event.pageX;
17553
- this.currentPageX = event.pageX;
17683
+ onColumnResizeStart(columnIndex) {
17684
+ this.resizingColumnIndex = columnIndex;
17554
17685
  this.$emit("columnResizeStart");
17555
- this.startAutoScroll(event.clientX);
17556
17686
  },
17557
- onPointerUp(event) {
17687
+ onColumnResizeEnd() {
17688
+ this.resizingColumnIndex = null;
17558
17689
  this.$emit("columnResizeEnd");
17559
- if (event.shiftKey) {
17560
- const newColumnSize = this.columnSizeOnDragStart + event.pageX - this.pageXOnDragStart + this.autoScrollOffset;
17561
- this.$emit(
17562
- "allColumnsResize",
17563
- Math.max(newColumnSize, this.minimumColumnWidth)
17564
- );
17565
- }
17566
- this.stopAutoScroll();
17567
17690
  },
17568
- /* eslint-disable no-invalid-this */
17569
- onPointerMove: throttle(function(event) {
17570
- this.unthrottledOnPointerMove(event);
17571
- }),
17691
+ onColumnResize(columnIndex, newSize) {
17692
+ this.$emit("columnResize", columnIndex, newSize);
17693
+ },
17694
+ onAllColumnsResize(newSize) {
17695
+ this.$emit("allColumnsResize", newSize);
17696
+ },
17697
+ onColumnSort(columnIndex, direction) {
17698
+ this.$emit("columnSort", columnIndex, direction);
17699
+ },
17700
+ onOpenActionBarFilterControl(columnIndex) {
17701
+ this.$emit("openActionBarFilterControl", columnIndex);
17702
+ },
17703
+ onClearColumnFilter(columnIndex) {
17704
+ this.$emit("clearColumnFilter", columnIndex);
17705
+ },
17572
17706
  onNewColumnButtonClick(event) {
17573
17707
  this.$emit("newColumnButtonClick", event);
17574
17708
  },
17575
17709
  onNewColumnButtonKeydownLeft(event) {
17576
17710
  this.$emit("newColumnButtonKeydownLeft", event);
17577
17711
  },
17578
- unthrottledOnPointerMove(event) {
17579
- if (this.dragIndex !== null) {
17580
- consola.debug("Resize via drag ongoing: ", event);
17581
- this.currentPageX = event.pageX;
17582
- this.emitColumnResize();
17583
- this.updateAutoScroll(event.clientX);
17584
- }
17585
- },
17586
- /* The lostpointercapture event is triggered if the pointer capture is lost for any reason, including its
17587
- orderly release via a pointerup event. Because the onPointerMove function is throttled we also need to throttle
17588
- the onLostPointerCapture function to guarantee order of event handling. */
17589
- onLostPointerCapture: throttle(function(event) {
17590
- consola.debug("Resize via drag finished: ", event);
17591
- this.stopAutoScroll();
17592
- this.dragIndex = null;
17593
- this.hoverIndex = null;
17594
- }),
17595
- /* eslint-enable no-invalid-this */
17596
- dragHandleHeight(isDragging) {
17597
- return isDragging ? this.currentDragHandlerHeight : HEADER_HEIGHT;
17598
- },
17599
17712
  onDeleteColumn(ind) {
17600
17713
  this.$emit("deleteColumn", ind);
17601
17714
  },
17602
17715
  getHeaderCellWidths() {
17603
- return this.columnHeaders.map((_, columnIndex) => {
17604
- const widthCompleteHeader = Math.ceil(
17605
- this.$refs[`columnHeader-${columnIndex}`][0].getBoundingClientRect().width
17606
- );
17607
- const widthMainHeader = Math.ceil(
17608
- this.$refs[`mainHeader-${columnIndex}`][0].getBoundingClientRect().width
17609
- );
17610
- const widthHeaderText = this.$refs[`headerText-${columnIndex}`][0].getBoundingClientRect().width;
17611
- return widthCompleteHeader - widthMainHeader + widthHeaderText + this.currentResizeDragHandleWidth;
17612
- });
17716
+ return this.columns.map(
17717
+ (_column, columnIndex) => this.$refs[`headerCell-${columnIndex}`][0].getHeaderCellWidth()
17718
+ );
17613
17719
  },
17614
17720
  /**
17615
17721
  * We deliberately only react on Tab and not on blur since we do
@@ -17625,7 +17731,7 @@ const _sfc_main$8 = {
17625
17731
  }
17626
17732
  },
17627
17733
  onKeydownRight(columnIndex) {
17628
- if (columnIndex < this.columnHeaders.length - 1) {
17734
+ if (columnIndex < this.columns.length - 1) {
17629
17735
  this.focusHeaderCell(columnIndex + 1);
17630
17736
  } else if (this.showNewColumnButton) {
17631
17737
  if (this.tableConfig.enableHeaderCellSelection) {
@@ -17640,13 +17746,10 @@ const _sfc_main$8 = {
17640
17746
  }
17641
17747
  },
17642
17748
  focusHeaderCell(cellInd) {
17643
- if (this.tableConfig.enableHeaderCellSelection || this.columnEditables[cellInd]) {
17644
- this.$refs[`columnHeaderContent-${cellInd}`][0].focus();
17645
- } else if (this.columnSubMenuItems[cellInd]?.length) {
17646
- this.$refs[`columnMenuButton-${cellInd}`]?.[0]?.menuButtonEl?.$el?.focus();
17647
- } else if (this.columnDeletables[cellInd]) {
17648
- this.$refs[`columnDeleteButton-${cellInd}`]?.[0]?.$el?.focus();
17649
- }
17749
+ this.$refs[`headerCell-${cellInd}`][0].focus();
17750
+ },
17751
+ isColumnHeaderFocusable(cellInd) {
17752
+ return this.$refs[`headerCell-${cellInd}`][0].isFocusable();
17650
17753
  },
17651
17754
  focusNewColumnButton() {
17652
17755
  this.$refs["new-column-button"]?.$el.focus();
@@ -17663,22 +17766,10 @@ const _hoisted_1$4 = {
17663
17766
  class: "deletion-cell-spacer",
17664
17767
  "aria-label": "Delete row"
17665
17768
  };
17666
- const _hoisted_2$2 = ["tabindex", "onFocus", "onBlur", "onClick", "onKeydown"];
17667
- const _hoisted_3$1 = ["title"];
17668
- const _hoisted_4 = {
17669
- key: 0,
17670
- class: "sub-header-text-container"
17671
- };
17672
- const _hoisted_5 = {
17673
- key: 0,
17674
- class: "delete-column-button"
17675
- };
17676
- const _hoisted_6 = { key: 1 };
17677
- const _hoisted_7 = ["onPointerover", "onPointerdownPassive"];
17678
17769
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
17679
17770
  const _component_KdsCheckbox = resolveComponent("KdsCheckbox");
17771
+ const _component_HeaderCell = resolveComponent("HeaderCell");
17680
17772
  const _component_KdsButton = resolveComponent("KdsButton");
17681
- const _component_KdsMenuButton = resolveComponent("KdsMenuButton");
17682
17773
  return openBlock(), createElementBlock("thead", null, [
17683
17774
  createElementVNode("tr", {
17684
17775
  style: normalizeStyle({ ...$setup.headerStyles })
@@ -17699,112 +17790,43 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
17699
17790
  "onUpdate:modelValue": $options.onSelect
17700
17791
  }, null, 8, ["model-value", "disabled", "onUpdate:modelValue"])
17701
17792
  ], 32)) : createCommentVNode("", true),
17702
- (openBlock(true), createElementBlock(Fragment, null, renderList($setup.indexedColumnHeaders, ([header, ind]) => {
17703
- return openBlock(), createElementBlock("th", {
17793
+ (openBlock(true), createElementBlock(Fragment, null, renderList($setup.indexedColumns, ([column, ind]) => {
17794
+ return openBlock(), createBlock(_component_HeaderCell, {
17704
17795
  key: ind,
17705
17796
  ref_for: true,
17706
- ref: `columnHeader-${ind}`,
17707
- scope: "col",
17708
- style: normalizeStyle({
17709
- width: `calc(${$props.columnSizes[ind] || $data.minimumColumnWidth}px)`,
17710
- ...$props.columnHeaderColors[ind] ? { "--data-cell-color": $props.columnHeaderColors[ind] } : {}
17711
- }),
17712
- class: normalizeClass([
17713
- "column-header",
17714
- {
17715
- "colored-header": $props.columnHeaderColors[ind],
17716
- "header-focused": $data.focusedHeaderIndex === ind || $props.selectedHeaderIndex === ind
17717
- }
17718
- ])
17719
- }, [
17720
- createElementVNode("div", {
17721
- ref_for: true,
17722
- ref: `columnHeaderContent-${ind}`,
17723
- class: normalizeClass(["column-header-content", [
17724
- {
17725
- "with-button-in-header": $props.columnSubMenuItems[ind] || $props.columnDeletables[ind]
17726
- }
17727
- ]]),
17728
- tabindex: $props.tableConfig.enableHeaderCellSelection || $props.columnEditables[ind] ? 0 : -1,
17729
- onFocus: ($event) => $options.onHeaderCellFocus(ind),
17730
- onBlur: ($event) => $options.onHeaderCellBlur(ind),
17731
- onClick: ($event) => $options.onHeaderClick(ind),
17732
- onKeydown: [
17733
- withKeys(($event) => $options.onHeaderClick(ind), ["space"]),
17734
- _cache[1] || (_cache[1] = withKeys((...args) => $options.onKeydownTab && $options.onKeydownTab(...args), ["tab"])),
17735
- withKeys(withModifiers(($event) => $options.onKeydownLeft(ind), ["prevent"]), ["left"]),
17736
- withKeys(withModifiers(($event) => $options.onKeydownRight(ind), ["prevent"]), ["right"]),
17737
- withKeys(withModifiers(($event) => $options.onKeydownDown(ind), ["self", "prevent"]), ["down"]),
17738
- ($event) => $setup.onHeaderCellKeydown($event, ind)
17739
- ]
17740
- }, [
17741
- createElementVNode("div", {
17742
- ref_for: true,
17743
- ref: `mainHeader-${ind}`,
17744
- class: "main-header"
17745
- }, [
17746
- createElementVNode("div", {
17747
- class: "header-text-container",
17748
- title: header
17749
- }, [
17750
- createElementVNode("span", {
17751
- ref_for: true,
17752
- ref: `headerText-${ind}`
17753
- }, toDisplayString(header), 513)
17754
- ], 8, _hoisted_3$1)
17755
- ], 512),
17756
- $props.columnSubHeaders[ind] ? (openBlock(), createElementBlock("div", _hoisted_4, [
17757
- renderSlot(_ctx.$slots, "subHeader", {
17758
- subHeader: $props.columnSubHeaders[ind],
17759
- columnIndex: ind
17760
- }, () => [
17761
- createTextVNode(toDisplayString($props.columnSubHeaders[ind]), 1)
17762
- ], true)
17763
- ])) : createCommentVNode("", true)
17764
- ], 42, _hoisted_2$2),
17765
- $props.columnDeletables[ind] ? (openBlock(), createElementBlock("div", _hoisted_5, [
17766
- createVNode(_component_KdsButton, {
17767
- ref_for: true,
17768
- ref: `columnDeleteButton-${ind}`,
17769
- variant: "transparent",
17770
- "leading-icon": "trash",
17771
- size: "small",
17772
- ariaLabel: "Delete column",
17773
- onClick: withModifiers(($event) => $options.onDeleteColumn(ind), ["stop"]),
17774
- onKeydown: withKeys(withModifiers(($event) => $options.onKeydownDown(ind), ["prevent", "stop"]), ["down"])
17775
- }, null, 8, ["onClick", "onKeydown"])
17776
- ])) : createCommentVNode("", true),
17777
- $props.columnSubMenuItems[ind]?.length ? (openBlock(), createElementBlock("div", _hoisted_6, [
17778
- createVNode(_component_KdsMenuButton, {
17779
- ref_for: true,
17780
- ref: `columnMenuButton-${ind}`,
17781
- ariaLabel: "Table column options",
17782
- items: $props.columnSubMenuItems[ind],
17783
- size: "small",
17784
- variant: "transparent",
17785
- "leading-icon": "more-actions",
17786
- onKeydown: withKeys(withModifiers(($event) => $options.onKeydownDown(ind), ["prevent", "stop"]), ["down"])
17787
- }, null, 8, ["items", "onKeydown"])
17788
- ])) : createCommentVNode("", true),
17789
- $options.enableColumnResizing ? (openBlock(), createElementBlock("div", {
17790
- key: 2,
17791
- class: normalizeClass([
17792
- "resize-handle-area",
17793
- { hover: $data.hoverIndex === ind, drag: $setup.dragIndex === ind }
17794
- ]),
17795
- style: normalizeStyle({
17796
- height: `${$options.dragHandleHeight($setup.dragIndex === ind)}px`
17797
- }),
17798
- onPointerover: ($event) => $options.onPointerOver($event, ind),
17799
- onPointerleave: _cache[2] || (_cache[2] = (...args) => $options.onPointerLeave && $options.onPointerLeave(...args)),
17800
- onPointerdownPassive: ($event) => $options.onPointerDown($event, ind),
17801
- onPointerupPassive: _cache[3] || (_cache[3] = ($event) => $options.onPointerUp($event)),
17802
- onPointermove: _cache[4] || (_cache[4] = (...args) => $options.onPointerMove && $options.onPointerMove(...args)),
17803
- onLostpointercapture: _cache[5] || (_cache[5] = (...args) => $options.onLostPointerCapture && $options.onLostPointerCapture(...args))
17804
- }, [..._cache[7] || (_cache[7] = [
17805
- createElementVNode("span", { class: "resize-handle" }, null, -1)
17806
- ])], 46, _hoisted_7)) : createCommentVNode("", true)
17807
- ], 6);
17797
+ ref: `headerCell-${ind}`,
17798
+ column,
17799
+ "col-filter-value": $props.colFilterValues[column.id],
17800
+ "table-config": $props.tableConfig,
17801
+ "action-config": $props.actionConfig,
17802
+ "sort-direction": $options.sortDirection(ind),
17803
+ "column-size": $options.columnSize(ind),
17804
+ focused: $data.focusedHeaderIndex === ind,
17805
+ selected: $props.selectedHeaderIndex === ind,
17806
+ "other-column-resizing": $data.resizingColumnIndex !== null && $data.resizingColumnIndex !== ind,
17807
+ "get-drag-handle-height": $props.getDragHandleHeight,
17808
+ onOnHeaderCellFocus: ($event) => $options.onHeaderCellFocus(ind),
17809
+ onOnHeaderCellBlur: ($event) => $options.onHeaderCellBlur(ind),
17810
+ onOnHeaderClick: ($event) => $options.onHeaderClick(ind),
17811
+ onOnKeydownTab: $options.onKeydownTab,
17812
+ onOnKeydownLeft: ($event) => $options.onKeydownLeft(ind),
17813
+ onOnKeydownRight: ($event) => $options.onKeydownRight(ind),
17814
+ onOnKeydownDown: ($event) => $options.onKeydownDown(ind),
17815
+ onOnHeaderCellKeydown: ($event) => $setup.onHeaderCellKeydown($event, ind),
17816
+ onOnDeleteColumn: ($event) => $options.onDeleteColumn(ind),
17817
+ onOnColumnSort: ($event) => $options.onColumnSort(ind, $event),
17818
+ onOpenActionBarFilterControl: ($event) => $options.onOpenActionBarFilterControl(ind),
17819
+ onClearColumnFilter: ($event) => $options.onClearColumnFilter(ind),
17820
+ onColumnResizeStart: ($event) => $options.onColumnResizeStart(ind),
17821
+ onColumnResizeEnd: $options.onColumnResizeEnd,
17822
+ onColumnResize: ($event) => $options.onColumnResize(ind, $event),
17823
+ onAllColumnsResize: $options.onAllColumnsResize
17824
+ }, {
17825
+ subHeader: withCtx((slotProps) => [
17826
+ renderSlot(_ctx.$slots, "subHeader", mergeProps({ ref_for: true }, slotProps, { columnIndex: ind }), void 0, true)
17827
+ ]),
17828
+ _: 2
17829
+ }, 1032, ["column", "col-filter-value", "table-config", "action-config", "sort-direction", "column-size", "focused", "selected", "other-column-resizing", "get-drag-handle-height", "onOnHeaderCellFocus", "onOnHeaderCellBlur", "onOnHeaderClick", "onOnKeydownTab", "onOnKeydownLeft", "onOnKeydownRight", "onOnKeydownDown", "onOnHeaderCellKeydown", "onOnDeleteColumn", "onOnColumnSort", "onOpenActionBarFilterControl", "onClearColumnFilter", "onColumnResizeStart", "onColumnResizeEnd", "onColumnResize", "onAllColumnsResize"]);
17808
17830
  }), 128)),
17809
17831
  $props.showNewColumnButton ? (openBlock(), createElementBlock("th", {
17810
17832
  key: 2,
@@ -17812,7 +17834,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
17812
17834
  scope: "col",
17813
17835
  class: "new-column-head",
17814
17836
  "aria-label": "Add column",
17815
- onVnodeMounted: _cache[6] || (_cache[6] = (...args) => $options.emitNewColumnButtonWidth && $options.emitNewColumnButtonWidth(...args))
17837
+ onVnodeMounted: _cache[1] || (_cache[1] = (...args) => $options.emitNewColumnButtonWidth && $options.emitNewColumnButtonWidth(...args))
17816
17838
  }, [
17817
17839
  createVNode(_component_KdsButton, {
17818
17840
  ref: "new-column-button",
@@ -17834,7 +17856,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
17834
17856
  }, null, 6)) : createCommentVNode("", true)
17835
17857
  ]);
17836
17858
  }
17837
- const Header = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$2], ["__scopeId", "data-v-3b63e327"]]);
17859
+ const Header = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$2], ["__scopeId", "data-v-e7068bdf"]]);
17838
17860
 
17839
17861
  const _hoisted_1$3 = { class: "sticky-container" };
17840
17862
  const buttonRef = "button";
@@ -17851,7 +17873,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
17851
17873
  });
17852
17874
  return (_ctx, _cache) => {
17853
17875
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
17854
- createVNode(unref(_sfc_main$1s), {
17876
+ createVNode(unref(_sfc_main$1v), {
17855
17877
  ref: buttonRef,
17856
17878
  label: "Add",
17857
17879
  "leading-icon": "plus",
@@ -17915,14 +17937,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
17915
17937
  text: {},
17916
17938
  title: {},
17917
17939
  color: {},
17918
- classes: {},
17919
17940
  selectOnMove: { type: Boolean },
17920
17941
  size: {},
17921
17942
  defaultTopBottomPadding: {},
17922
17943
  defaultLeftRightPadding: {},
17923
17944
  enableExpand: { type: Boolean },
17924
- isEditing: { type: Boolean },
17925
- inlineBlock: { type: Boolean }
17945
+ isEditing: { type: Boolean }
17926
17946
  },
17927
17947
  emits: ["click", "expand", "input", "select"],
17928
17948
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -18037,11 +18057,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
18037
18057
  return (_ctx, _cache) => {
18038
18058
  return openBlock(), createElementBlock("td", {
18039
18059
  class: normalizeClass([
18040
- __props.classes,
18041
18060
  "data-cell",
18042
18061
  {
18043
18062
  "colored-cell": __props.color,
18044
- "inline-block": __props.inlineBlock,
18045
18063
  "in-cell-selection": __props.isInCellSelection
18046
18064
  }
18047
18065
  ]),
@@ -18086,25 +18104,22 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
18086
18104
  }
18087
18105
  });
18088
18106
 
18089
- const CellRenderer = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["__scopeId", "data-v-698a5d81"]]);
18107
+ const CellRenderer = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["__scopeId", "data-v-84b77b2e"]]);
18090
18108
 
18091
18109
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
18092
18110
  __name: "Cell",
18093
18111
  props: {
18112
+ column: {},
18094
18113
  cellData: {},
18095
18114
  selectOnMove: { type: Boolean },
18096
- isSlotted: { type: Boolean },
18097
18115
  isSelected: { type: Boolean },
18098
18116
  isInCellSelection: { type: Boolean },
18099
18117
  isToBeExpanded: { type: Boolean },
18100
18118
  size: {},
18101
- classGenerators: {},
18102
- formatter: { type: Function },
18103
18119
  defaultTopBottomPadding: {},
18104
18120
  defaultLeftRightPadding: {},
18105
- hasDataValueView: { type: Boolean },
18106
18121
  isEditing: { type: Boolean },
18107
- inlineBlock: { type: Boolean }
18122
+ enableDataValueView: { type: Boolean }
18108
18123
  },
18109
18124
  emits: ["click", "input", "select", "dataValueView"],
18110
18125
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -18115,35 +18130,17 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
18115
18130
  const unpackedValue = computed(
18116
18131
  () => unpackObjectRepresentation(props.cellData)
18117
18132
  );
18118
- const formattedValue = computed(
18119
- () => props.formatter(unpackObjectRepresentation(unpackedValue.value))
18120
- );
18121
18133
  const title = computed(() => {
18122
18134
  const { cellData } = props;
18123
18135
  if (isMissingValue(cellData)) {
18124
18136
  return getMissingValueMessage(cellData);
18125
18137
  }
18126
- if (formattedValue.value === void 0) {
18138
+ if (unpackedValue.value === void 0) {
18127
18139
  return null;
18128
18140
  } else {
18129
- return String(formattedValue.value);
18141
+ return String(unpackedValue.value);
18130
18142
  }
18131
18143
  });
18132
- const classes = computed(() => {
18133
- const { classGenerators } = props;
18134
- if (classGenerators === void 0) {
18135
- return [];
18136
- }
18137
- return classGenerators.map((classItem) => {
18138
- if (typeof classItem === "function") {
18139
- return unpackedValue.value === void 0 ? null : classItem(unpackedValue.value);
18140
- }
18141
- if (typeof classItem === "object") {
18142
- return classItem[unpackedValue.value];
18143
- }
18144
- return classItem;
18145
- }).filter((obj) => obj !== null);
18146
- });
18147
18144
  const cellRenderer = ref(null);
18148
18145
  const getCellContentDimensions = () => cellRenderer.value?.getCellContentDimensions();
18149
18146
  __expose({
@@ -18156,21 +18153,21 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
18156
18153
  ref_key: "cellRenderer",
18157
18154
  ref: cellRenderer,
18158
18155
  "is-missing": isMissing.value,
18159
- "is-slotted": __props.isSlotted,
18160
- text: formattedValue.value,
18156
+ "is-slotted": __props.column.hasSlotContent ?? false,
18157
+ text: unpackedValue.value,
18161
18158
  title: title.value,
18162
18159
  color: color.value,
18163
- classes: classes.value,
18164
18160
  "select-on-move": __props.selectOnMove,
18165
18161
  "default-top-bottom-padding": __props.defaultTopBottomPadding,
18166
18162
  "default-left-right-padding": __props.defaultLeftRightPadding,
18163
+ "no-padding-left-right": __props.column.noPaddingLeftRight,
18164
+ "no-padding-top-bottom": __props.column.noPaddingTopBottom,
18167
18165
  size: __props.size,
18168
- "enable-expand": !isMissing.value && props.hasDataValueView,
18166
+ "enable-expand": !isMissing.value && __props.enableDataValueView && __props.column.hasDataValueView,
18169
18167
  "is-selected": __props.isSelected,
18170
18168
  "is-in-cell-selection": __props.isInCellSelection,
18171
18169
  "is-to-be-expanded": __props.isToBeExpanded,
18172
18170
  "is-editing": __props.isEditing,
18173
- "inline-block": __props.inlineBlock,
18174
18171
  onClick: _cache[0] || (_cache[0] = (value) => emit("click", value)),
18175
18172
  onExpand: _cache[1] || (_cache[1] = () => emit("dataValueView")),
18176
18173
  onSelect: _cache[2] || (_cache[2] = (value) => emit("select", value)),
@@ -18184,7 +18181,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
18184
18181
  ])
18185
18182
  };
18186
18183
  })
18187
- ]), 1032, ["is-missing", "is-slotted", "text", "title", "color", "classes", "select-on-move", "default-top-bottom-padding", "default-left-right-padding", "size", "enable-expand", "is-selected", "is-in-cell-selection", "is-to-be-expanded", "is-editing", "inline-block"]);
18184
+ ]), 1032, ["is-missing", "is-slotted", "text", "title", "color", "select-on-move", "default-top-bottom-padding", "default-left-right-padding", "no-padding-left-right", "no-padding-top-bottom", "size", "enable-expand", "is-selected", "is-in-cell-selection", "is-to-be-expanded", "is-editing"]);
18188
18185
  };
18189
18186
  }
18190
18187
  });
@@ -18203,7 +18200,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
18203
18200
  rowData: { default: () => ({}) },
18204
18201
  row: { default: () => [] },
18205
18202
  tableConfig: {},
18206
- columnConfigs: {},
18203
+ subMenuConfig: {},
18204
+ columns: {},
18205
+ colSizes: {},
18207
18206
  rowConfig: { default: () => ({}) },
18208
18207
  rowHeight: { default: DEFAULT_ROW_HEIGHT },
18209
18208
  isSelected: { type: Boolean, default: false },
@@ -18239,34 +18238,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
18239
18238
  const activeDrag = ref(false);
18240
18239
  const rowHeightOnDragStart = ref(0);
18241
18240
  const columnKeys = computed(
18242
- () => getPropertiesFromColumns(props.columnConfigs, "key")
18243
- );
18244
- const columnSizes = computed(
18245
- () => getPropertiesFromColumns(props.columnConfigs, "size")
18246
- );
18247
- const formatters = computed(
18248
- () => getPropertiesFromColumns(props.columnConfigs, "formatter")
18249
- );
18250
- const classGenerators = computed(
18251
- () => getPropertiesFromColumns(props.columnConfigs, "classGenerator")
18252
- );
18253
- const slottedColumns = computed(
18254
- () => getPropertiesFromColumns(props.columnConfigs, "hasSlotContent")
18255
- );
18256
- const hasDataValueView = computed(
18257
- () => getPropertiesFromColumns(props.columnConfigs, "hasDataValueView")
18258
- );
18259
- const noPaddingTopBottom = computed(
18260
- () => getPropertiesFromColumns(props.columnConfigs, "noPaddingTopBottom")
18261
- );
18262
- const noPaddingLeftRight = computed(
18263
- () => getPropertiesFromColumns(props.columnConfigs, "noPaddingLeftRight")
18241
+ () => getPropertiesFromColumns(props.columns, "key")
18264
18242
  );
18265
18243
  const filteredSubMenuItems = computed(() => {
18266
- if (!props.tableConfig.subMenuItems?.length && !props.rowData?.subMenuItemsForRow?.length) {
18244
+ if (!props.subMenuConfig.subMenuItems?.length && !props.rowData?.subMenuItemsForRow?.length) {
18267
18245
  return [];
18268
18246
  }
18269
- return props.rowData?.subMenuItemsForRow?.length ? props.rowData?.subMenuItemsForRow : props.tableConfig.subMenuItems;
18247
+ return props.rowData?.subMenuItemsForRow?.length ? props.rowData?.subMenuItemsForRow : props.subMenuConfig.subMenuItems;
18270
18248
  });
18271
18249
  const onDeleteRow = () => {
18272
18250
  emit("deleteRow");
@@ -18398,7 +18376,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
18398
18376
  })
18399
18377
  }, [
18400
18378
  __props.tableConfig.enableRowDeletion ? (openBlock(), createElementBlock("td", _hoisted_1$1, [
18401
- createVNode(unref(_sfc_main$1s), {
18379
+ createVNode(unref(_sfc_main$1v), {
18402
18380
  ref_key: "deleteButton",
18403
18381
  ref: deleteButton,
18404
18382
  variant: "transparent",
@@ -18424,7 +18402,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
18424
18402
  paddingBottom: `${paddingTopBottom.value}px`
18425
18403
  })
18426
18404
  }, [
18427
- createVNode(unref(_sfc_main$10), {
18405
+ createVNode(unref(_sfc_main$13), {
18428
18406
  ref_key: "selectionCheckbox",
18429
18407
  ref: selectionCheckbox,
18430
18408
  title: "Select row",
@@ -18449,20 +18427,15 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
18449
18427
  cells.value[ind] = el;
18450
18428
  },
18451
18429
  key: ind,
18430
+ column: __props.columns[ind],
18452
18431
  "cell-data": cell,
18453
18432
  "select-on-move": __props.selectCellsOnMove,
18454
18433
  "is-selected": __props.selectedCellIndex === ind,
18455
18434
  "is-in-cell-selection": __props.cellSelectionRange !== null && ind >= __props.cellSelectionRange.min && ind <= __props.cellSelectionRange.max,
18456
18435
  "is-to-be-expanded": __props.toBeExpandedCellIndex === ind,
18457
- "is-slotted": Boolean(slottedColumns.value[ind]),
18458
- "has-data-value-view": __props.tableConfig.enableDataValueViews && Boolean(hasDataValueView.value[ind]),
18436
+ "enable-data-value-view": __props.tableConfig.enableDataValueViews,
18459
18437
  "is-editing": __props.toBeEditedCellIndex === ind,
18460
- "no-padding-top-bottom": noPaddingTopBottom.value[ind],
18461
- "no-padding-left-right": noPaddingLeftRight.value[ind],
18462
- "inline-block": __props.tableConfig.cellRendererInlineBlock,
18463
- size: columnSizes.value[ind] ?? 100,
18464
- "class-generators": classGenerators.value[ind],
18465
- formatter: formatters.value[ind],
18438
+ size: __props.colSizes[ind] ?? 100,
18466
18439
  "default-top-bottom-padding": paddingTopBottom.value,
18467
18440
  "default-left-right-padding": unref(paddingLeftRight),
18468
18441
  onClick: ($event) => onCellClick($event, ind, cell),
@@ -18486,10 +18459,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
18486
18459
  }, void 0, true)
18487
18460
  ]),
18488
18461
  _: 2
18489
- }, 1032, ["cell-data", "select-on-move", "is-selected", "is-in-cell-selection", "is-to-be-expanded", "is-slotted", "has-data-value-view", "is-editing", "no-padding-top-bottom", "no-padding-left-right", "inline-block", "size", "class-generators", "formatter", "default-top-bottom-padding", "default-left-right-padding", "onClick", "onSelect", "onDataValueView"]);
18462
+ }, 1032, ["column", "cell-data", "select-on-move", "is-selected", "is-in-cell-selection", "is-to-be-expanded", "enable-data-value-view", "is-editing", "size", "default-top-bottom-padding", "default-left-right-padding", "onClick", "onSelect", "onDataValueView"]);
18490
18463
  }), 128)),
18491
18464
  filteredSubMenuItems.value?.length ? (openBlock(), createElementBlock("td", _hoisted_2, [
18492
- createVNode(unref(_sfc_main$1h), {
18465
+ createVNode(unref(_sfc_main$1k), {
18493
18466
  modelValue: isMenuOpen.value,
18494
18467
  "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => isMenuOpen.value = $event),
18495
18468
  ariaLabel: "More actions",
@@ -18520,14 +18493,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
18520
18493
  }
18521
18494
  });
18522
18495
 
18523
- const Row = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__scopeId", "data-v-0ad921a2"]]);
18496
+ const Row = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__scopeId", "data-v-24dd5f3c"]]);
18524
18497
 
18525
18498
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
18526
18499
  __name: "CellSelectionOverlay",
18527
18500
  props: {
18528
18501
  rect: {},
18529
18502
  rowHeight: {},
18530
- columnSizes: {},
18503
+ colSizes: {},
18531
18504
  rowResizeIndex: {},
18532
18505
  rowResizeDelta: {},
18533
18506
  tableConfig: {},
@@ -18557,14 +18530,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
18557
18530
  if (props.tableConfig.showSelection) {
18558
18531
  currentOffset += SPECIAL_COLUMNS_SIZE;
18559
18532
  }
18560
- if (props.tableConfig.showCollapser) {
18561
- currentOffset += SPECIAL_COLUMNS_SIZE;
18562
- }
18563
18533
  if (props.tableConfig.enableRowDeletion) {
18564
18534
  currentOffset += SPECIAL_COLUMNS_SIZE;
18565
18535
  }
18566
18536
  const offsets = [];
18567
- props.columnSizes.forEach((size) => {
18537
+ props.colSizes.forEach((size) => {
18568
18538
  offsets.push(currentOffset);
18569
18539
  currentOffset += size;
18570
18540
  });
@@ -18679,7 +18649,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
18679
18649
  }
18680
18650
  });
18681
18651
 
18682
- const CellSelectionOverlay = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__scopeId", "data-v-f7862e17"]]);
18652
+ const CellSelectionOverlay = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__scopeId", "data-v-4eeb1626"]]);
18683
18653
 
18684
18654
  const _sfc_main$1 = {
18685
18655
  components: {
@@ -18688,21 +18658,17 @@ const _sfc_main$1 = {
18688
18658
  Row,
18689
18659
  // TablePopover,
18690
18660
  CellSelectionOverlay,
18691
- TableCore: _sfc_main$h,
18661
+ TableCore: _sfc_main$i,
18692
18662
  NewRowButton,
18693
18663
  TableActionBar
18694
18664
  },
18695
18665
  props: {
18696
18666
  /**
18697
18667
  * Data props.
18698
- */
18699
- data: {
18700
- type: Array,
18701
- default: () => []
18702
- },
18703
- currentSelection: {
18668
+ */
18669
+ data: {
18704
18670
  type: Array,
18705
- default: () => []
18671
+ required: true
18706
18672
  },
18707
18673
  /**
18708
18674
  * It specifies how many (empty) rows should be simultated above the given rows in this.data[0]
@@ -18726,6 +18692,10 @@ const _sfc_main$1 = {
18726
18692
  type: Array,
18727
18693
  default: () => []
18728
18694
  },
18695
+ currentSelection: {
18696
+ type: Array,
18697
+ default: () => []
18698
+ },
18729
18699
  /**
18730
18700
  * analogous to currentSelection but for the bottomData
18731
18701
  */
@@ -18733,53 +18703,66 @@ const _sfc_main$1 = {
18733
18703
  type: Array,
18734
18704
  default: () => []
18735
18705
  },
18736
- totalSelected: {
18737
- type: Number,
18738
- default: 0
18706
+ /** Stable per-column definitions. */
18707
+ columns: {
18708
+ type: Array,
18709
+ required: true
18739
18710
  },
18740
- /**
18741
- * Config props.
18742
- */
18743
- dataConfig: {
18711
+ /** Per-column widths, keyed by column id. */
18712
+ colSizes: {
18713
+ type: Array,
18714
+ default: () => []
18715
+ },
18716
+ /** Per-column filter values, keyed by column id. */
18717
+ colFilterValues: {
18744
18718
  type: Object,
18745
18719
  default: () => ({})
18746
18720
  },
18721
+ /** Active sorts, ordered by sort priority. */
18722
+ colSortValues: {
18723
+ type: Array,
18724
+ default: () => []
18725
+ },
18726
+ /** Feature switches for the table. */
18747
18727
  tableConfig: {
18748
18728
  type: Object,
18749
- default: () => ({}),
18750
- validate(tableConfig) {
18751
- if (typeof tableConfig !== "object") {
18752
- return false;
18753
- }
18754
- const requiredProperties = [
18755
- "showSelection",
18756
- "showCollapser",
18757
- "subMenuItems",
18758
- "groupSubMenuItems"
18759
- ];
18760
- const isValid = requiredProperties.every(
18761
- (key) => tableConfig.hasOwnProperty(key)
18762
- );
18763
- const requiredConfigs = {
18764
- pageConfig: [
18765
- "currentSize",
18766
- "tableSize",
18767
- "pageSize",
18768
- "possiblePageSizes",
18769
- "currentPage"
18770
- ],
18771
- columnSelectionConfig: ["possibleColumns", "currentColumns"],
18772
- sortConfig: ["sortColumn", "sortDirection"]
18773
- };
18774
- return isValid && Object.entries(requiredConfigs).every((key, values) => {
18775
- if (tableConfig[key]) {
18776
- return values.every(
18777
- (configOption) => tableConfig[key].hasOwnProperty(configOption)
18778
- );
18779
- }
18780
- return true;
18781
- });
18782
- }
18729
+ default: () => ({})
18730
+ },
18731
+ /** Runtime totals and flags for the table. */
18732
+ tableState: {
18733
+ type: Object,
18734
+ default: () => ({})
18735
+ },
18736
+ /** Pagination config; its presence enables pagination. */
18737
+ pageConfig: {
18738
+ type: Object,
18739
+ default: void 0
18740
+ },
18741
+ /** Runtime pagination state. */
18742
+ pageState: {
18743
+ type: Object,
18744
+ default: void 0
18745
+ },
18746
+ /** Action-bar config; its presence enables the action bar. */
18747
+ actionConfig: {
18748
+ type: Object,
18749
+ default: void 0
18750
+ },
18751
+ /** Runtime state of the action bar. */
18752
+ actionState: {
18753
+ type: Object,
18754
+ default: void 0,
18755
+ required: false
18756
+ },
18757
+ /** Per-row and per-group submenu config. */
18758
+ subMenuConfig: {
18759
+ type: Object,
18760
+ default: () => ({})
18761
+ },
18762
+ /** Appearance of the table's rows. */
18763
+ rowConfig: {
18764
+ type: Object,
18765
+ default: () => ({})
18783
18766
  },
18784
18767
  disableRowHeightTransition: {
18785
18768
  type: Boolean,
@@ -18920,9 +18903,7 @@ const _sfc_main$1 = {
18920
18903
  editingCellInitialValue.value = initialValue ?? null;
18921
18904
  };
18922
18905
  const isEditingEnabled = computed(
18923
- () => getPropertiesFromColumns(props.dataConfig.columnConfigs, "editable").some(
18924
- Boolean
18925
- )
18906
+ () => getPropertiesFromColumns(props.columns, "editable").some(Boolean)
18926
18907
  );
18927
18908
  const { handleCopyOnKeydown, handleDeleteSelection } = useCellCopyPaste({
18928
18909
  focusWithin,
@@ -18944,13 +18925,13 @@ const _sfc_main$1 = {
18944
18925
  };
18945
18926
  const toBeShownCell = ref(null);
18946
18927
  const closeDataValueView = () => {
18947
- if (props.tableConfig.dataValueViewIsShown) {
18928
+ if (props.tableState.dataValueViewIsShown) {
18948
18929
  emit("closeDataValueView");
18949
18930
  }
18950
18931
  toBeShownCell.value = null;
18951
18932
  };
18952
18933
  provideDataValueViewsIsShown(
18953
- toRef(props, "tableConfig"),
18934
+ toRef(props, "tableState"),
18954
18935
  closeDataValueView
18955
18936
  );
18956
18937
  const showNewColumnAndRowButton = computed(
@@ -19023,102 +19004,22 @@ const _sfc_main$1 = {
19023
19004
  },
19024
19005
  computed: {
19025
19006
  minRowHeight() {
19026
- return this.dataConfig.rowConfig.compactMode ? COMPACT_ROW_HEIGHT : DEFAULT_ROW_HEIGHT;
19007
+ return this.rowConfig.compactMode ? COMPACT_ROW_HEIGHT : DEFAULT_ROW_HEIGHT;
19027
19008
  },
19028
19009
  initialRowHeight() {
19029
- return this.dataConfig.rowConfig?.rowHeight || this.minRowHeight;
19010
+ return this.rowConfig?.rowHeight || this.minRowHeight;
19030
19011
  },
19031
19012
  currentRowHeight() {
19032
19013
  return this.resizedRowHeight ?? this.initialRowHeight;
19033
19014
  },
19034
- /*
19035
- * Current table config. E.g. if 4/10 columns displayed, 'current' fields return values w/ length 4.
19036
- */
19037
- columnHeaders() {
19038
- return getPropertiesFromColumns(this.dataConfig.columnConfigs, "header");
19039
- },
19040
- columnSubHeaders() {
19041
- return getPropertiesFromColumns(
19042
- this.dataConfig.columnConfigs,
19043
- "subHeader"
19044
- );
19045
- },
19046
- columnHeaderSubMenuItems() {
19047
- return getPropertiesFromColumns(
19048
- this.dataConfig.columnConfigs,
19049
- "headerSubMenuItems"
19050
- ).map(
19051
- (menuItems, index) => useHeaderMenuItems({
19052
- enableFiltering: Boolean(this.tableConfig.showColumnFilters),
19053
- filterConfig: this.columnFilterConfigs[index],
19054
- enableSorting: Boolean(this.tableConfig.sortConfig) && Boolean(this.columnSortConfigs[index]),
19055
- sortDirection: this.tableConfig.sortConfig?.sortColumn === index ? this.tableConfig.sortConfig?.sortDirection ?? 0 : 0,
19056
- headerSubMenuItems: menuItems,
19057
- sortTexts: columnSortText[this.columnTypes[index] ?? "default"],
19058
- onColumnSort: (direction) => this.onColumnSort(index, direction),
19059
- openFilterControl: () => this.openActionBarFilterControl(index),
19060
- clearFilter: () => this.clearColumnFilter(index)
19061
- })
19062
- );
19063
- },
19064
- columnSizes() {
19065
- return getPropertiesFromColumns(this.dataConfig.columnConfigs, "size");
19066
- },
19067
- columnTypes() {
19068
- return getPropertiesFromColumns(this.dataConfig.columnConfigs, "type");
19069
- },
19070
19015
  selectedHeaderIndex() {
19071
19016
  return this.selectedCell?.y === -1 ? this.selectedCell.x : null;
19072
19017
  },
19073
- columnKeys() {
19074
- return getPropertiesFromColumns(this.dataConfig.columnConfigs, "key");
19075
- },
19076
- columnSortConfigs() {
19077
- return getPropertiesFromColumns(
19078
- this.dataConfig.columnConfigs,
19079
- "isSortable"
19080
- ).map((isSortable) => isSortable ?? true);
19081
- },
19082
- columnFilterConfigs() {
19083
- return getPropertiesFromColumns(
19084
- this.dataConfig.columnConfigs,
19085
- "filterConfig"
19086
- );
19087
- },
19088
- columnHeaderColors() {
19089
- return getPropertiesFromColumns(
19090
- this.dataConfig.columnConfigs,
19091
- "headerColor"
19092
- ).map((color) => color ?? null);
19093
- },
19094
- columnDeletables() {
19095
- return getPropertiesFromColumns(
19096
- this.dataConfig.columnConfigs,
19097
- "deletable"
19098
- );
19099
- },
19100
- columnEditables() {
19101
- return getPropertiesFromColumns(
19102
- this.dataConfig.columnConfigs,
19103
- "editable"
19104
- );
19105
- },
19106
19018
  slottedColumns() {
19107
- return getPropertiesFromColumns(
19108
- this.dataConfig.columnConfigs,
19109
- "hasSlotContent"
19110
- ).map(
19019
+ return getPropertiesFromColumns(this.columns, "hasSlotContent").map(
19111
19020
  (hasSlotContent, colInd) => hasSlotContent ? colInd : null
19112
19021
  ).filter((colInd) => colInd !== null);
19113
19022
  },
19114
- tableHeaderClass() {
19115
- return [
19116
- "table-header",
19117
- {
19118
- "sub-menu-active": this.tableConfig.subMenuItems?.length
19119
- }
19120
- ];
19121
- },
19122
19023
  topDataLength() {
19123
19024
  if (this.data === null || this.data.length === 0) {
19124
19025
  return 0;
@@ -19158,9 +19059,6 @@ const _sfc_main$1 = {
19158
19059
  return isTop ? this.currentSelection[groupInd][indexInInput] : this.currentBottomSelection[indexInInput];
19159
19060
  };
19160
19061
  },
19161
- enableRowResize() {
19162
- return this.dataConfig.rowConfig.enableResizing;
19163
- },
19164
19062
  scrollerItemSize() {
19165
19063
  if (this.currentRowHeight === "dynamic") {
19166
19064
  return this.minRowHeight;
@@ -19170,14 +19068,16 @@ const _sfc_main$1 = {
19170
19068
  sortControlOptions() {
19171
19069
  const selectableColumns = [];
19172
19070
  const selectableDirections = {};
19173
- this.columnHeaders.forEach((header, index) => {
19174
- if (!this.columnSortConfigs[index]) {
19071
+ this.columns.forEach((column) => {
19072
+ if (column.isNotSortable) {
19175
19073
  return;
19176
19074
  }
19177
- const stringIndex = index.toString();
19178
- selectableColumns.push({ id: stringIndex, text: header });
19179
- const sortTexts = columnSortText[this.columnTypes[index] ?? "default"];
19180
- selectableDirections[stringIndex] = [
19075
+ selectableColumns.push({
19076
+ id: column.id,
19077
+ text: column.header
19078
+ });
19079
+ const sortTexts = columnSortText[column.type ?? "default"];
19080
+ selectableDirections[column.id] = [
19181
19081
  { id: "1", text: sortTexts.ascending },
19182
19082
  { id: "-1", text: sortTexts.descending }
19183
19083
  ];
@@ -19186,12 +19086,12 @@ const _sfc_main$1 = {
19186
19086
  }
19187
19087
  },
19188
19088
  watch: {
19189
- "dataConfig.rowConfig.compactMode": {
19089
+ "rowConfig.compactMode": {
19190
19090
  handler() {
19191
19091
  this.resetRowHeight();
19192
19092
  }
19193
19093
  },
19194
- "dataConfig.rowConfig.rowHeight": {
19094
+ "rowConfig.rowHeight": {
19195
19095
  handler() {
19196
19096
  this.resetRowHeight();
19197
19097
  }
@@ -19273,6 +19173,10 @@ const _sfc_main$1 = {
19273
19173
  this.clearCellSelection();
19274
19174
  this.$emit("columnSort", colInd, sortDirection);
19275
19175
  },
19176
+ onActionBarColumnSort(columnId, sortDirection) {
19177
+ const colInd = columnId === void 0 ? void 0 : this.columns.findIndex((column) => column.id === columnId);
19178
+ this.onColumnSort(colInd, sortDirection);
19179
+ },
19276
19180
  onSelectAll(selected) {
19277
19181
  consola.debug(`TableUI emitting: selectAll ${selected}`);
19278
19182
  this.$emit("selectAll", selected);
@@ -19294,7 +19198,7 @@ const _sfc_main$1 = {
19294
19198
  this.selectCell(
19295
19199
  { x: cellInd, y: rowInd },
19296
19200
  groupInd === null ? isTop : groupInd,
19297
- ignoreIfSelected || Boolean(this.dataConfig.columnConfigs[cellInd]?.editable)
19201
+ ignoreIfSelected || Boolean(this.columns[cellInd]?.editable)
19298
19202
  );
19299
19203
  this.stopEditingCell();
19300
19204
  },
@@ -19302,9 +19206,7 @@ const _sfc_main$1 = {
19302
19206
  if (this.toBeEditedCell && this.toBeEditedCell.x === cellInd && this.toBeEditedCell.y === rowInd) {
19303
19207
  return;
19304
19208
  }
19305
- const isEditable = Boolean(
19306
- this.dataConfig.columnConfigs[cellInd]?.editable
19307
- );
19209
+ const isEditable = Boolean(this.columns[cellInd]?.editable);
19308
19210
  if (isEditable && this.isSingleSelectedCell({ x: cellInd, y: rowInd })) {
19309
19211
  this.onStartEditingCell();
19310
19212
  } else {
@@ -19327,7 +19229,7 @@ const _sfc_main$1 = {
19327
19229
  onTableBodyFocusOut() {
19328
19230
  this.changeFocus(false);
19329
19231
  if (this.selectedCell) {
19330
- if (this.columnEditables[this.selectedCell.x]) {
19232
+ if (this.columns[this.selectedCell.x]?.editable) {
19331
19233
  this.selectCell(this.selectedCell, this.currentRectId ?? 0, true);
19332
19234
  } else {
19333
19235
  this.clearCellSelection();
@@ -19390,8 +19292,7 @@ const _sfc_main$1 = {
19390
19292
  this.stopEditingCell();
19391
19293
  },
19392
19294
  onMoveSelectionOutOfBodyUp({ columnInd }) {
19393
- const isHeaderFocusable = this.tableConfig.enableHeaderCellSelection || Boolean(this.columnHeaderSubMenuItems[columnInd]?.length) || Boolean(this.columnDeletables[columnInd]) || Boolean(this.columnEditables[columnInd]);
19394
- if (!isHeaderFocusable) {
19295
+ if (!this.header?.isColumnHeaderFocusable(columnInd)) {
19395
19296
  return;
19396
19297
  }
19397
19298
  this.clearCellSelection();
@@ -19424,7 +19325,7 @@ const _sfc_main$1 = {
19424
19325
  }
19425
19326
  },
19426
19327
  onMoveIntoBodyFromRight() {
19427
- const lastColumnInd = this.columnHeaders.length - 1;
19328
+ const lastColumnInd = this.columns.length - 1;
19428
19329
  const lastRowAndRectId = this.lastRowAndRectIdBeforeMovingToNewColumnButton ?? {
19429
19330
  rowInd: -1,
19430
19331
  rectId: null
@@ -19513,7 +19414,7 @@ const _sfc_main$1 = {
19513
19414
  if (direction === "right") {
19514
19415
  if (type === "delete" && this.tableConfig.showSelection) {
19515
19416
  this.focusRowVirtualColumn("selection", rowInd, rectId);
19516
- } else if (this.columnHeaders.length > 0) {
19417
+ } else if (this.columns.length > 0) {
19517
19418
  this.onMoveIntoBodyFromLeft(rowInd, rectId);
19518
19419
  }
19519
19420
  } else if (direction === "left") {
@@ -19554,7 +19455,7 @@ const _sfc_main$1 = {
19554
19455
  });
19555
19456
  return;
19556
19457
  }
19557
- if (columnInd === this.columnHeaders.length) {
19458
+ if (columnInd === this.columns.length) {
19558
19459
  this.onMoveSelectionOutOfBodyRight({
19559
19460
  rowInd,
19560
19461
  rectId: this.currentRectId
@@ -19572,7 +19473,7 @@ const _sfc_main$1 = {
19572
19473
  expandSelection
19573
19474
  );
19574
19475
  await this.scrollToCellSelectionOverlay();
19575
- this.toBeShownCell = this.tableConfig.dataValueViewIsShown ? this.selectedCell : null;
19476
+ this.toBeShownCell = this.tableState.dataValueViewIsShown ? this.selectedCell : null;
19576
19477
  },
19577
19478
  async expandSelectedCell() {
19578
19479
  if (this.selectedCell && this.tableConfig.enableDataValueViews) {
@@ -19581,7 +19482,7 @@ const _sfc_main$1 = {
19581
19482
  }
19582
19483
  },
19583
19484
  onStartEditingCell(initialValue) {
19584
- if (this.selectedCell && this.dataConfig.columnConfigs[this.selectedCell.x]?.editable) {
19485
+ if (this.selectedCell && this.columns[this.selectedCell.x]?.editable) {
19585
19486
  this.setToBeEditedCell(this.selectedCell, initialValue);
19586
19487
  }
19587
19488
  },
@@ -19649,8 +19550,8 @@ const _sfc_main$1 = {
19649
19550
  this.columnResizeActive = false;
19650
19551
  this.$emit("columnResizeEnd");
19651
19552
  },
19652
- getCellContentSlotName(columnKeys, columnId) {
19653
- return `cellContent-${columnKeys[columnId]}`;
19553
+ getCellContentSlotName(columns, columnId) {
19554
+ return `cellContent-${columns[columnId].key}`;
19654
19555
  },
19655
19556
  getHeaderComponent() {
19656
19557
  return this.$refs.header;
@@ -19682,8 +19583,8 @@ const _sfc_main$1 = {
19682
19583
  },
19683
19584
  getRowData(row) {
19684
19585
  const isEmptyArray = Array.isArray(row) && row.length === 0;
19685
- return isEmptyArray ? row : this.columnKeys.map(
19686
- (column) => row[column]
19586
+ return isEmptyArray ? row : this.columns.map(
19587
+ (column) => row[column.key]
19687
19588
  );
19688
19589
  },
19689
19590
  getRowRefName(groupInd, rowInd) {
@@ -19720,7 +19621,7 @@ const _sfc_main$1 = {
19720
19621
  this.$refs.actionBar?.openFilterControl(columnIndex);
19721
19622
  },
19722
19623
  clearColumnFilter(columnIndex) {
19723
- const config = this.columnFilterConfigs[columnIndex];
19624
+ const config = this.columns[columnIndex].filterConfig;
19724
19625
  if (config) {
19725
19626
  this.$emit("columnFilter", columnIndex, defaultValueFor(config.is));
19726
19627
  }
@@ -19738,26 +19639,25 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
19738
19639
  const _component_TableCore = resolveComponent("TableCore");
19739
19640
  const _component_PageControls = resolveComponent("PageControls");
19740
19641
  return openBlock(), createElementBlock("div", _hoisted_1, [
19741
- createVNode(_component_TableActionBar, {
19642
+ $props.actionConfig ? (openBlock(), createBlock(_component_TableActionBar, {
19643
+ key: 0,
19742
19644
  ref: "actionBar",
19743
- "all-rows-count": $props.tableConfig.pageConfig?.tableSize,
19744
- "filtered-rows-count": $props.tableConfig.pageConfig?.currentSize,
19745
- "all-columns-count": $props.tableConfig.pageConfig?.columnCount,
19746
- "filtered-columns-count": $options.columnHeaders.length,
19747
- title: $props.tableConfig.pageConfig?.actionBarTitle,
19748
- "row-label": $props.tableConfig.pageConfig?.rowLabel,
19749
- "show-table-size": $props.tableConfig.pageConfig?.showTableSize,
19750
- "show-filter-control": Boolean($props.tableConfig.showColumnFilters),
19751
- "show-sort-control": Boolean($props.tableConfig.sortConfig),
19752
- "sort-config": $props.tableConfig.sortConfig,
19645
+ "all-rows-count": $props.tableState.tableSize,
19646
+ "filtered-rows-count": $props.tableState.currentSize,
19647
+ "all-columns-count": $props.tableState.columnCount,
19648
+ "filtered-columns-count": $props.columns.length,
19649
+ title: $props.actionState?.actionBarTitle,
19650
+ "row-label": $props.tableConfig.rowLabel,
19651
+ "show-table-size": $props.tableConfig.showTableSize,
19652
+ "action-config": $props.actionConfig,
19653
+ "col-sort-values": $props.colSortValues,
19654
+ "col-filter-values": $props.colFilterValues,
19753
19655
  "sort-control-options": $options.sortControlOptions,
19754
- "filter-configs": $options.columnFilterConfigs,
19755
- "column-headers": $options.columnHeaders,
19756
- "settings-items": $props.tableConfig.settingsItems,
19656
+ columns: $props.columns,
19757
19657
  onResetTemporaryView: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("resetTemporaryView")),
19758
19658
  onColumnFilter: _cache[1] || (_cache[1] = (colInd, value) => _ctx.$emit("columnFilter", colInd, value)),
19759
- onOnColumnSort: $options.onColumnSort
19760
- }, null, 8, ["all-rows-count", "filtered-rows-count", "all-columns-count", "filtered-columns-count", "title", "row-label", "show-table-size", "show-filter-control", "show-sort-control", "sort-config", "sort-control-options", "filter-configs", "column-headers", "settings-items", "onOnColumnSort"]),
19659
+ onOnColumnSort: $options.onActionBarColumnSort
19660
+ }, null, 8, ["all-rows-count", "filtered-rows-count", "all-columns-count", "filtered-columns-count", "title", "row-label", "show-table-size", "action-config", "col-sort-values", "col-filter-values", "sort-control-options", "columns", "onOnColumnSort"])) : createCommentVNode("", true),
19761
19661
  createElementVNode("table", {
19762
19662
  ref: "wrapper",
19763
19663
  tabindex: -1,
@@ -19775,14 +19675,15 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
19775
19675
  ref: "tableCore",
19776
19676
  "scroll-data": $options.scrollData,
19777
19677
  "total-width": $setup.totalWidth,
19778
- "column-sizes": $options.columnSizes,
19678
+ "col-sizes": $props.colSizes,
19779
19679
  "column-resize": { active: $data.columnResizeActive },
19780
19680
  "table-config": $props.tableConfig,
19681
+ "sub-menu-config": $props.subMenuConfig,
19781
19682
  "scroll-config": {
19782
19683
  itemSize: $options.scrollerItemSize,
19783
19684
  numRowsAbove: $props.numRowsAbove,
19784
19685
  numRowsBelow: $props.numRowsBelow,
19785
- compact: Boolean($props.dataConfig.rowConfig.compactMode)
19686
+ compact: Boolean($props.rowConfig.compactMode)
19786
19687
  },
19787
19688
  "current-row-height": $options.currentRowHeight,
19788
19689
  "new-column-button-width": $setup.newColumnButtonWidth,
@@ -19801,9 +19702,11 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
19801
19702
  "row-data": row,
19802
19703
  row: $options.getRowData(row),
19803
19704
  "table-config": $props.tableConfig,
19804
- "show-drag-handle": $options.enableRowResize,
19805
- "column-configs": $props.dataConfig.columnConfigs,
19806
- "row-config": $props.dataConfig.rowConfig,
19705
+ "sub-menu-config": $props.subMenuConfig,
19706
+ "show-drag-handle": $props.tableConfig.enableRowResizing,
19707
+ columns: $props.columns,
19708
+ "col-sizes": $props.colSizes,
19709
+ "row-config": $props.rowConfig,
19807
19710
  "row-height": $options.currentRowHeight,
19808
19711
  "min-row-height": $options.minRowHeight,
19809
19712
  "is-selected": $options.currentSelectionMap(rowInd, groupInd || 0),
@@ -19846,12 +19749,12 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
19846
19749
  }, [
19847
19750
  renderList($options.slottedColumns, (colInd) => {
19848
19751
  return {
19849
- name: $options.getCellContentSlotName($options.columnKeys, colInd),
19752
+ name: $options.getCellContentSlotName($props.columns, colInd),
19850
19753
  fn: withCtx((cellData) => [
19851
- renderSlot(_ctx.$slots, `cellContent-${$options.columnKeys[colInd].toString()}`, {
19754
+ renderSlot(_ctx.$slots, `cellContent-${$props.columns[colInd].key}`, {
19852
19755
  data: {
19853
19756
  ...cellData,
19854
- key: $options.columnKeys[colInd],
19757
+ key: $props.columns[colInd].key,
19855
19758
  rowInd,
19856
19759
  colInd
19857
19760
  }
@@ -19859,26 +19762,32 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
19859
19762
  ])
19860
19763
  };
19861
19764
  })
19862
- ]), 1032, ["row-data", "row", "table-config", "show-drag-handle", "column-configs", "row-config", "row-height", "min-row-height", "is-selected", "select-cells-on-move", "disable-row-height-transition", "selected-cell-index", "cell-selection-range", "to-be-expanded-cell-index", "to-be-edited-cell-index", "new-column-button-width", "onDeleteRow", "onRowSelect", "onCellSelect", "onDataValueView", "onExpandCellSelect", "onRowInput", "onRowSubMenuClick", "onResizeAllRows", "onResizeRow", "onVirtualColumnNav"])
19765
+ ]), 1032, ["row-data", "row", "table-config", "sub-menu-config", "show-drag-handle", "columns", "col-sizes", "row-config", "row-height", "min-row-height", "is-selected", "select-cells-on-move", "disable-row-height-transition", "selected-cell-index", "cell-selection-range", "to-be-expanded-cell-index", "to-be-edited-cell-index", "new-column-button-width", "onDeleteRow", "onRowSelect", "onCellSelect", "onDataValueView", "onExpandCellSelect", "onRowInput", "onRowSubMenuClick", "onResizeAllRows", "onResizeRow", "onVirtualColumnNav"])
19863
19766
  ]),
19864
19767
  header: withCtx(({ getDragHandleHeight, width = null }) => [
19865
19768
  createVNode(_component_Header, {
19866
19769
  ref: "header",
19867
19770
  style: normalizeStyle(width === null ? {} : { width: `${width}px` }),
19868
19771
  "table-config": $props.tableConfig,
19869
- "column-headers": $options.columnHeaders,
19870
- "column-sub-headers": $options.columnSubHeaders,
19871
- "column-sizes": $options.columnSizes,
19872
- "column-sub-menu-items": $options.columnHeaderSubMenuItems,
19873
- "column-header-colors": $options.columnHeaderColors,
19874
- "column-deletables": $options.columnDeletables,
19875
- "column-editables": $options.columnEditables,
19876
- "is-selected": $props.totalSelected > 0,
19772
+ "action-config": $props.actionConfig,
19773
+ columns: $props.columns,
19774
+ "col-filter-values": $props.colFilterValues,
19775
+ "col-sizes": $props.colSizes,
19776
+ "col-sort-values": $props.colSortValues,
19777
+ "is-selected": $props.tableState.totalSelected > 0,
19877
19778
  "get-drag-handle-height": getDragHandleHeight,
19878
- class: normalizeClass($options.tableHeaderClass),
19779
+ class: normalizeClass([
19780
+ "table-header",
19781
+ {
19782
+ "sub-menu-active": $props.subMenuConfig.subMenuItems?.length
19783
+ }
19784
+ ]),
19879
19785
  "show-new-column-button": $setup.showNewColumnAndRowButton,
19880
19786
  "selected-header-index": $options.selectedHeaderIndex,
19881
19787
  onHeaderSelect: $options.onSelectAll,
19788
+ onColumnSort: $options.onColumnSort,
19789
+ onOpenActionBarFilterControl: $options.openActionBarFilterControl,
19790
+ onClearColumnFilter: $options.clearColumnFilter,
19882
19791
  onDeleteColumn: $options.onDeleteColumn,
19883
19792
  onColumnResize: $options.onColumnResize,
19884
19793
  onAllColumnsResize: $options.onAllColumnsResize,
@@ -19897,7 +19806,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
19897
19806
  renderSlot(_ctx.$slots, "subHeader", normalizeProps(guardReactiveProps(slotProps)), void 0, true)
19898
19807
  ]),
19899
19808
  _: 3
19900
- }, 8, ["style", "table-config", "column-headers", "column-sub-headers", "column-sizes", "column-sub-menu-items", "column-header-colors", "column-deletables", "column-editables", "is-selected", "get-drag-handle-height", "class", "show-new-column-button", "selected-header-index", "onHeaderSelect", "onDeleteColumn", "onColumnResize", "onAllColumnsResize", "onColumnResizeStart", "onColumnResizeEnd", "onMoveDownFromHeaderCell", "onHeaderCellSelect", "onHeaderCellDeselect", "onUpdate:newColumnButtonWidth", "onNewColumnButtonClick"])
19809
+ }, 8, ["style", "table-config", "action-config", "columns", "col-filter-values", "col-sizes", "col-sort-values", "is-selected", "get-drag-handle-height", "class", "show-new-column-button", "selected-header-index", "onHeaderSelect", "onColumnSort", "onOpenActionBarFilterControl", "onClearColumnFilter", "onDeleteColumn", "onColumnResize", "onAllColumnsResize", "onColumnResizeStart", "onColumnResizeEnd", "onMoveDownFromHeaderCell", "onHeaderCellSelect", "onHeaderCellDeselect", "onUpdate:newColumnButtonWidth", "onNewColumnButtonClick"])
19901
19810
  ]),
19902
19811
  "cell-selection-overlay": withCtx(() => [
19903
19812
  $setup.rectMinMax && !$setup.isEditingCell && $options.selectedHeaderIndex === null ? (openBlock(), createBlock(_component_CellSelectionOverlay, {
@@ -19908,9 +19817,9 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
19908
19817
  "table-config": $props.tableConfig,
19909
19818
  "row-resize-index": $data.currentResizedScrollIndex,
19910
19819
  "row-resize-delta": $data.currentRowSizeDelta,
19911
- "column-sizes": $options.columnSizes,
19820
+ "col-sizes": $props.colSizes,
19912
19821
  "cell-selection-rect-focus-corner": $setup.focusWithin ? $setup.selectedCell : void 0
19913
- }, null, 8, ["rect", "row-height", "table-config", "row-resize-index", "row-resize-delta", "column-sizes", "cell-selection-rect-focus-corner"])) : createCommentVNode("", true)
19822
+ }, null, 8, ["rect", "row-height", "table-config", "row-resize-index", "row-resize-delta", "col-sizes", "cell-selection-rect-focus-corner"])) : createCommentVNode("", true)
19914
19823
  ]),
19915
19824
  belowBody: withCtx(() => [
19916
19825
  $setup.showNewColumnAndRowButton ? (openBlock(), createBlock(_component_NewRowButton, {
@@ -19923,17 +19832,20 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
19923
19832
  }, null, 8, ["onClick", "onKeydownUp"])) : createCommentVNode("", true)
19924
19833
  ]),
19925
19834
  _: 3
19926
- }, 8, ["scroll-data", "total-width", "column-sizes", "column-resize", "table-config", "scroll-config", "current-row-height", "new-column-button-width", "onScrollerUpdate", "onMoveSelection", "onClearSelection", "onExpandSelectedCell", "onStartEditing"]),
19927
- $props.tableConfig.pageConfig?.showPageControls ?? true ? (openBlock(), createBlock(_component_PageControls, {
19835
+ }, 8, ["scroll-data", "total-width", "col-sizes", "column-resize", "table-config", "sub-menu-config", "scroll-config", "current-row-height", "new-column-button-width", "onScrollerUpdate", "onMoveSelection", "onClearSelection", "onExpandSelectedCell", "onStartEditing"]),
19836
+ $props.pageConfig && $props.pageState ? (openBlock(), createBlock(_component_PageControls, {
19928
19837
  key: 0,
19929
- "page-config": $props.tableConfig.pageConfig,
19838
+ "page-config": $props.pageConfig,
19839
+ "table-config": $props.tableConfig,
19840
+ "page-state": $props.pageState,
19841
+ "table-state": $props.tableState,
19930
19842
  onPageChange: $options.onPageChange,
19931
19843
  onPageSizeUpdate: $options.onPageSizeUpdate
19932
- }, null, 8, ["page-config", "onPageChange", "onPageSizeUpdate"])) : createCommentVNode("", true)
19844
+ }, null, 8, ["page-config", "table-config", "page-state", "table-state", "onPageChange", "onPageSizeUpdate"])) : createCommentVNode("", true)
19933
19845
  ], 544)
19934
19846
  ]);
19935
19847
  }
19936
- const TableUI = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-829ae68c"]]);
19848
+ const TableUI = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-fa3f06f3"]]);
19937
19849
 
19938
19850
  const useTableReady = ({ onReady }) => {
19939
19851
  const autoSizesInitialized = ref(false);
@@ -19973,7 +19885,18 @@ const _sfc_main = {
19973
19885
  type: Array,
19974
19886
  default: () => []
19975
19887
  },
19976
- dataConfig: {
19888
+ /** Stable per-column definitions (forwarded to TableUI). */
19889
+ columns: {
19890
+ type: Array,
19891
+ default: () => []
19892
+ },
19893
+ /** Per-column widths, ordered by displayed column (forwarded to TableUI). */
19894
+ colSizes: {
19895
+ type: Array,
19896
+ default: () => []
19897
+ },
19898
+ /** Appearance of the table's rows (forwarded to TableUI). */
19899
+ rowConfig: {
19977
19900
  type: Object,
19978
19901
  default: () => ({})
19979
19902
  },
@@ -19981,6 +19904,54 @@ const _sfc_main = {
19981
19904
  type: Object,
19982
19905
  default: () => ({})
19983
19906
  },
19907
+ tableState: {
19908
+ type: Object,
19909
+ default: () => ({})
19910
+ },
19911
+ pageConfig: {
19912
+ type: Object,
19913
+ default: void 0
19914
+ },
19915
+ pageState: {
19916
+ type: Object,
19917
+ default: void 0
19918
+ },
19919
+ actionConfig: {
19920
+ type: Object,
19921
+ default: void 0
19922
+ },
19923
+ actionState: {
19924
+ type: Object,
19925
+ default: void 0
19926
+ },
19927
+ colFilterValues: {
19928
+ type: Object,
19929
+ default: () => ({})
19930
+ },
19931
+ colSortValues: {
19932
+ type: Array,
19933
+ default: () => []
19934
+ },
19935
+ numRowsAbove: {
19936
+ type: Number,
19937
+ default: 0
19938
+ },
19939
+ numRowsBelow: {
19940
+ type: Number,
19941
+ default: 0
19942
+ },
19943
+ bottomData: {
19944
+ type: Array,
19945
+ default: () => []
19946
+ },
19947
+ currentBottomSelection: {
19948
+ type: Array,
19949
+ default: () => []
19950
+ },
19951
+ subMenuConfig: {
19952
+ type: Object,
19953
+ default: () => ({})
19954
+ },
19984
19955
  /** This object contains all the options necessary to calculate the sizes based on the
19985
19956
  * content. In case only one of calculateForBody/calculateForHeader is true, the emitted object contains auto
19986
19957
  * sizes according to body/header. In case both are true, the maximum of both values is used. For fixedSizes only
@@ -20029,8 +20000,8 @@ const _sfc_main = {
20029
20000
  mountTableUIForAutoSizeCalculation() {
20030
20001
  return this.data !== null && this.calculateSizes;
20031
20002
  },
20032
- dataConfigIds() {
20033
- return getPropertiesFromColumns(this.dataConfig.columnConfigs, "id");
20003
+ columnIds() {
20004
+ return getPropertiesFromColumns(this.columns, "id");
20034
20005
  },
20035
20006
  currentColumnsWithAutoSize() {
20036
20007
  return /* @__PURE__ */ new Set([
@@ -20041,7 +20012,7 @@ const _sfc_main = {
20041
20012
  removedColumnIds() {
20042
20013
  const removedColumnIds = /* @__PURE__ */ new Set();
20043
20014
  this.currentColumnsWithAutoSize.forEach((columnId) => {
20044
- if (!this.dataConfigIds.includes(columnId)) {
20015
+ if (!this.columnIds.includes(columnId)) {
20045
20016
  removedColumnIds.add(columnId);
20046
20017
  }
20047
20018
  });
@@ -20049,7 +20020,7 @@ const _sfc_main = {
20049
20020
  },
20050
20021
  addedColumnIds() {
20051
20022
  const addedColumnIds = /* @__PURE__ */ new Set();
20052
- this.dataConfigIds.forEach((columnId) => {
20023
+ this.columnIds.forEach((columnId) => {
20053
20024
  if (!this.currentColumnsWithAutoSize.has(columnId)) {
20054
20025
  addedColumnIds.add(columnId);
20055
20026
  }
@@ -20062,25 +20033,16 @@ const _sfc_main = {
20062
20033
  paginatedDataForAutoColumnSizesCalculation() {
20063
20034
  return [this.data.flat().slice(0, DEFAULT_NUM_ROWS)];
20064
20035
  },
20065
- dataConfigForCalculationWithAutoColumnSizes() {
20066
- return {
20067
- ...this.dataConfig,
20068
- columnConfigs: this.dataConfig.columnConfigs.map(
20069
- (columnConfig) => ({
20070
- ...columnConfig,
20071
- size: MAX_AUTO_COLUMN_SIZE
20072
- })
20073
- )
20074
- };
20036
+ colSizesForCalculationWithAutoColumnSizes() {
20037
+ return this.columnIds.map(() => MAX_AUTO_COLUMN_SIZE);
20075
20038
  },
20076
- dataConfigForAutoSizesCalculation() {
20077
- return this.autoColumnSizingActive ? this.dataConfigForCalculationWithAutoColumnSizes : this.dataConfig;
20039
+ colSizesForAutoSizesCalculation() {
20040
+ return this.autoColumnSizingActive ? this.colSizesForCalculationWithAutoColumnSizes : this.colSizes;
20078
20041
  },
20079
20042
  tableConfigForAutoSizesCalculation() {
20080
20043
  return {
20081
20044
  ...this.tableConfig,
20082
- forceRenderAll: true,
20083
- cellRendererInlineBlock: true
20045
+ forceRenderAll: true
20084
20046
  };
20085
20047
  },
20086
20048
  autoColumnSizingActive() {
@@ -20093,7 +20055,7 @@ const _sfc_main = {
20093
20055
  return this.autoColumnSizingActive && !this.useSavedColumnSizes;
20094
20056
  },
20095
20057
  columnPaddingsHorizontal() {
20096
- return this.dataConfigIds.reduce(
20058
+ return this.columnIds.reduce(
20097
20059
  (paddings, columnId) => {
20098
20060
  paddings[columnId] = CELL_PADDING_HORIZONTAL * 2;
20099
20061
  return paddings;
@@ -20128,12 +20090,12 @@ const _sfc_main = {
20128
20090
  },
20129
20091
  deep: true
20130
20092
  },
20131
- dataConfigIds(newIds, oldIds) {
20093
+ columnIds(newIds, oldIds) {
20132
20094
  if (newIds.length !== oldIds.length || !newIds.every((el, index) => el === oldIds[index])) {
20133
20095
  this.triggerCalculationOfAutoSizes();
20134
20096
  }
20135
20097
  },
20136
- "dataConfig.rowConfig.compactMode": {
20098
+ "rowConfig.compactMode": {
20137
20099
  handler() {
20138
20100
  if (this.autoRowHeightOptions.calculate) {
20139
20101
  this.useSavedColumnSizes = true;
@@ -20145,7 +20107,7 @@ const _sfc_main = {
20145
20107
  mounted() {
20146
20108
  if (this.autoRowHeightSizingActive) {
20147
20109
  const unwatchRowHeight = this.$watch(
20148
- () => this.dataConfig.rowConfig.rowHeight,
20110
+ () => this.rowConfig.rowHeight,
20149
20111
  async () => {
20150
20112
  await sleep(0);
20151
20113
  this.disableRowHeightTransition = false;
@@ -20239,7 +20201,7 @@ const _sfc_main = {
20239
20201
  this.emitNewAutoSizes();
20240
20202
  },
20241
20203
  initializeSizesWithMinSize(minSize) {
20242
- return this.dataConfigIds.reduce(
20204
+ return this.columnIds.reduce(
20243
20205
  (sizes, columnId) => ({
20244
20206
  ...sizes,
20245
20207
  [columnId]: minSize
@@ -20280,7 +20242,7 @@ const _sfc_main = {
20280
20242
  const sizesByColumn = {};
20281
20243
  const heightsByColumn = {};
20282
20244
  const cellComponents = rowComponent.getCellComponents();
20283
- this.dataConfigIds.forEach((columnId, columnIndex) => {
20245
+ this.columnIds.forEach((columnId, columnIndex) => {
20284
20246
  if (!fixedSizes.hasOwnProperty(columnId)) {
20285
20247
  const { width, height } = cellComponents[columnIndex].getCellContentDimensions();
20286
20248
  sizesByColumn[columnId] = width;
@@ -20294,7 +20256,7 @@ const _sfc_main = {
20294
20256
  },
20295
20257
  calculateAndSetAutoColumnSizesHeader() {
20296
20258
  const headerCellSizes = this.$refs.tableUIForAutoSize.getHeaderComponent().getHeaderCellWidths();
20297
- this.dataConfigIds.forEach((columnId, columnIndex) => {
20259
+ this.columnIds.forEach((columnId, columnIndex) => {
20298
20260
  const headerWidth = headerCellSizes[columnIndex];
20299
20261
  if (this.currentColumnSizes[columnId] < headerWidth) {
20300
20262
  this.currentColumnSizes[columnId] = headerWidth;
@@ -20340,8 +20302,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
20340
20302
  }, _ctx.$attrs, {
20341
20303
  data: $props.data,
20342
20304
  "current-selection": $props.currentSelection,
20343
- "data-config": $props.dataConfig,
20305
+ "current-bottom-selection": $props.currentBottomSelection,
20306
+ columns: $props.columns,
20307
+ "col-sizes": $props.colSizes,
20308
+ "col-filter-values": $props.colFilterValues,
20309
+ "col-sort-values": $props.colSortValues,
20310
+ "num-rows-above": $props.numRowsAbove,
20311
+ "num-rows-below": $props.numRowsBelow,
20312
+ "bottom-data": $props.bottomData,
20313
+ "row-config": $props.rowConfig,
20344
20314
  "table-config": $props.tableConfig,
20315
+ "table-state": $props.tableState,
20316
+ "page-config": $props.pageConfig,
20317
+ "page-state": $props.pageState,
20318
+ "action-config": $props.actionConfig,
20319
+ "action-state": $props.actionState,
20320
+ "sub-menu-config": $props.subMenuConfig,
20345
20321
  "disable-row-height-transition": $data.disableRowHeightTransition,
20346
20322
  "onUpdate:availableWidth": $options.onUpdateAvailableWidth
20347
20323
  }), createSlots({ _: 2 }, [
@@ -20353,14 +20329,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
20353
20329
  ])
20354
20330
  };
20355
20331
  })
20356
- ]), 1040, ["style", "data", "current-selection", "data-config", "table-config", "disable-row-height-transition", "onUpdate:availableWidth"]),
20332
+ ]), 1040, ["style", "data", "current-selection", "current-bottom-selection", "columns", "col-sizes", "col-filter-values", "col-sort-values", "num-rows-above", "num-rows-below", "bottom-data", "row-config", "table-config", "table-state", "page-config", "page-state", "action-config", "action-state", "sub-menu-config", "disable-row-height-transition", "onUpdate:availableWidth"]),
20357
20333
  $options.mountTableUIForAutoSizeCalculation ? (openBlock(), createBlock(_component_TableUI, {
20358
20334
  key: 0,
20359
20335
  ref: "tableUIForAutoSize",
20360
20336
  class: "table-column-size-calculation",
20361
20337
  data: $options.paginatedDataForAutoColumnSizesCalculation,
20362
20338
  "current-selection": $props.currentSelection,
20363
- "data-config": $options.dataConfigForAutoSizesCalculation,
20339
+ columns: $props.columns,
20340
+ "col-sizes": $options.colSizesForAutoSizesCalculation,
20341
+ "row-config": $props.rowConfig,
20364
20342
  "table-config": $options.tableConfigForAutoSizesCalculation,
20365
20343
  onVnodeMounted: $options.calculateAutoSizes
20366
20344
  }, createSlots({ _: 2 }, [
@@ -20372,603 +20350,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
20372
20350
  ])
20373
20351
  };
20374
20352
  })
20375
- ]), 1032, ["data", "current-selection", "data-config", "table-config", "onVnodeMounted"])) : createCommentVNode("", true)
20353
+ ]), 1032, ["data", "current-selection", "columns", "col-sizes", "row-config", "table-config", "onVnodeMounted"])) : createCommentVNode("", true)
20376
20354
  ], 64);
20377
20355
  }
20378
- const TableUIWithAutoSizeCalculation = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ea7bec0f"]]);
20379
-
20380
- const getColumnDomains = ({ data, formatters, types }) => {
20381
- let domainMap = {};
20382
- let nominalColumns = [];
20383
- Object.entries(types).forEach((entry) => {
20384
- let [col, colType] = entry;
20385
- // treat boolean as nominal (as they can have formatted domains)
20386
- if ([columnTypes.Boolean, columnTypes.Nominal].includes(colType)) {
20387
- nominalColumns.push(col);
20388
- domainMap[col] = [];
20389
- }
20390
- });
20391
- data.forEach((row) => {
20392
- nominalColumns.forEach((col) => {
20393
- const cellValue = unpackObjectRepresentation(row[col]);
20394
- const formattedCellValue = formatters?.[col]?.(cellValue) || cellValue;
20395
- if (!domainMap[col].includes(formattedCellValue)) {
20396
- domainMap[col].push(formattedCellValue);
20397
- }
20398
- });
20399
- });
20400
- return domainMap;
20401
- };
20402
-
20403
- const getDefaultFilterValues = (columns, types) => columns.reduce((obj, col) => {
20404
- obj[col] = columnFilterConfigs[types[col]].getInitialValue();
20405
- return obj;
20406
- }, {});
20407
- const getInitialFilterValues = (columns, types, initialFilterValues) => columns.reduce((obj, col) => {
20408
- obj[col] = initialFilterValues.hasOwnProperty(col) ? initialFilterValues[col] : columnFilterConfigs[types[col]].getInitialValue();
20409
- return obj;
20410
- }, {});
20411
- const getFilterConfigs = ({
20412
- domains,
20413
- columns,
20414
- types,
20415
- values
20416
- }) => columns.map((col) => {
20417
- const is = columnFilterConfigs[types[col]].is;
20418
- if (is === "FilterInputField") {
20419
- return {
20420
- is,
20421
- modelValue: values[col]
20422
- };
20423
- }
20424
- return {
20425
- is,
20426
- modelValue: values[col],
20427
- possibleValues: (domains[col] ?? []).map((val) => ({
20428
- id: val,
20429
- text: val
20430
- }))
20431
- };
20432
- });
20433
-
20434
- /**
20435
- * Utility for checking the current pagination state and providing the correct page
20436
- * number if the current state is invalid. Invalid page states include a current page
20437
- * number which is outside of the range of the filtered data, a page size which is
20438
- * larger than the total number of rows in the data or a paginated data set size of 0.
20439
- *
20440
- * @param {Number} pageSize - the current page size (in number of rows per page).
20441
- * @param {Number} currentPage - the current page number to check.
20442
- * @param {Number} availableRows - the number of rows in the filtered data set.
20443
- * @param {Number} pageRows - the number of rows in the current paginated data set.
20444
- * @returns {Number|null} new page number or null of no update is needed.
20445
- */
20446
- const getNextPage = (pageSize, currentPage, availableRows, pageRows) => {
20447
- if (pageSize > availableRows) {
20448
- return 1;
20449
- } else if (pageSize * currentPage > availableRows || pageRows < 1) {
20450
- let newPageNumber = currentPage;
20451
- while (newPageNumber >= 1) {
20452
- if (pageSize * newPageNumber > availableRows) {
20453
- newPageNumber -= 1;
20454
- } else {
20455
- break;
20456
- }
20457
- }
20458
- return newPageNumber;
20459
- }
20460
- return null;
20461
- };
20462
-
20463
- /**
20464
- * Take a relative row id from a selection event and return the processed index.
20465
- *
20466
- * @param {*} param
20467
- * @param {Number} param.relativeInd - row index provided by event.
20468
- * @param {Number} param.groupInd - row group index provided by event.
20469
- * @param {Number} param.currentPage - the current page number from the table.
20470
- * @param {Number} param.currentPageSize - the current page size from the table.
20471
- * @param {Number} [param.currentGroup] - the current group-by group (if present).
20472
- * @param {Array<Array<Number>>} param.processedIndicies - the grouped and sorted index mapping.
20473
- * @returns {number} index from processed mapping
20474
- */
20475
- const getProcessedRowInd = ({
20476
- relativeInd,
20477
- groupInd,
20478
- currentPage,
20479
- currentPageSize,
20480
- currentGroup,
20481
- processedIndicies,
20482
- }) => {
20483
- let pageStart = currentPageSize * (currentPage - 1);
20484
- if (pageStart === 0) {
20485
- return relativeInd;
20486
- }
20487
- if (currentGroup) {
20488
- let indCount = 0;
20489
- processedIndicies.forEach((group, gInd) => {
20490
- if (gInd < groupInd) {
20491
- indCount += group.length;
20492
- }
20493
- });
20494
- if (indCount <= pageStart) {
20495
- return pageStart - indCount + relativeInd;
20496
- }
20497
- return relativeInd;
20498
- }
20499
- return relativeInd + pageStart;
20500
- };
20501
-
20502
- /**
20503
- * Utility function to search a single cell. Formatters are required for the following table data types:
20504
- * Number, String, Nominal, DateTime, Boolean. Errors thrown during search will assume no match was found
20505
- * and return false. Additionally, if no type is supplied, `toString` will be called on the item. Objects
20506
- * and Arrays are stringified to perform a 'deep search'.
20507
- *
20508
- * ** All searches are case insensitive **
20509
- *
20510
- * @param {*} field - the item to search.
20511
- * @param {String} type - the table data type for the search item.
20512
- * @param {Function} formatter - the formatting function to apply to the item before searching.
20513
- * @param {String} query - the search term to locate in the item.
20514
- * @returns {Boolean} - if a match was found.
20515
- */
20516
- const searchCell = (field, type, formatter, query) => {
20517
- if (typeof field === "undefined") {
20518
- return false;
20519
- }
20520
- try {
20521
- let formattedData;
20522
- switch (type) {
20523
- case columnTypes.Number:
20524
- case columnTypes.String:
20525
- case columnTypes.Nominal:
20526
- case columnTypes.DateTime:
20527
- case columnTypes.Boolean:
20528
- formattedData = formatter(field);
20529
- break;
20530
- case columnTypes.Array:
20531
- case columnTypes.Object:
20532
- formattedData = JSON.stringify(field);
20533
- // search both JSON data and displayed value if custom formatter provided
20534
- if (formatter?.name && !columnTypes[formatter.name]) {
20535
- formattedData += formatter(field);
20536
- }
20537
- break;
20538
- default:
20539
- formattedData = field.toString();
20540
- }
20541
- return formattedData.search(new RegExp(query.trim(), "i")) > -1;
20542
- } catch (_err) {
20543
- return false;
20544
- }
20545
- };
20546
-
20547
- /**
20548
- * Utility for searching an entire row of values. For specifics of the search dynamics, please @see searchCell.
20549
- *
20550
- * @param {*[]} row - an array of values to search.
20551
- * @param {String[]} types - an array of types for the values in the row.
20552
- * @param {Function[]} formatters - an array of formatting functions for values.
20553
- * @param {String} query - the search query to locate in the provided row.
20554
- * @returns {Boolean} - if the query has been matched with an item in the row.
20555
- */
20556
- const searchRow = (row, types, formatters, query) =>
20557
- row.some((data, colInd) =>
20558
- searchCell(
20559
- unpackObjectRepresentation(data),
20560
- types[colInd],
20561
- formatters[colInd],
20562
- query,
20563
- ),
20564
- );
20565
-
20566
- /**
20567
- * Utility function designed to consume an entire data set and output only the rows which match the provided
20568
- * filter state. This filtering happens on three levels:
20569
- *
20570
- * 1.) Time filtering- if a time filter is provided with a DateTime column, any data outside of this range
20571
- * will be excluded from the returned data subset. If either parameter is omitted, then no filtering on
20572
- * DateTime will be performed.
20573
- * 2.) Search filtering- if a search query is provided, the data set will be checked for matching rows on a
20574
- * global level- meaning any match in any column will satisfy this condition and move on for further
20575
- * filtering. If this search query is omitted, all data which passed the time filter (if provided), will
20576
- * continue on to column filtering.
20577
- * 3.) Column filtering- if there are active column filters for the data set, each row will be checked on a
20578
- * columnar basis for values matching the filter configuration for that column. This filtering is type
20579
- * sensitive (defined in @see table.config.js ).
20580
- *
20581
- * @param {Object} filterConfig - the object mapping of the required fields for filtering the data.
20582
- * @param {Object[]} filterConfig.data - the data set to process.
20583
- * @param {String[]} filterConfig.columnKeys - the column keys for the row Objects of the currently displayed data.
20584
- * Should only be the currently displayed columns, because users only want to filter based on the information
20585
- * currently displayed.
20586
- * @param {Object} filterConfig.formatters - a columnKey/function mapping for the formatting functions of the column
20587
- * data. Enables filtering on the data the user is viewing, as opposed to the raw data values which may have
20588
- * undergone some point-wise transformations depending on the table configuration.
20589
- * @param {Object} filterConfig.types - a columnKey/type (@see table.config.js ) mapping for the columns in the data
20590
- * set. Allows data-type specific filtering.
20591
- * @param {String} filterConfig.timeFilter - the optional active time filter value. Possible values are the keys
20592
- * found in @see time.config.js . If none is provided, no time filtering will be performed.
20593
- * @param {String} filterConfig.timeFilterKey - the optional columnKey of the DateTime column which should be used
20594
- * for time filtering. Require IFF a timeFilter has been provided.
20595
- * @param {String} filterConfig.searchQuery - the optional global search query active for the dataset. If none is
20596
- * provided, no global search or filtering will be performed.
20597
- * @param {Object} filterConfig.filterValues - the columnKey/value mapping for any currently active column-specific
20598
- * filters. If no filters are active, an empty Object should be provided.
20599
- * @returns {Object} filteredDataConfig - contains the results of the filtering operations.
20600
- * @returns {Object[]} filteredDataConfig.filteredData - the rows which passed all provided filtering operations.
20601
- * @returns {Number[]} filteredDataConfig.filteredIndicies - an array of the original row indicies for the filtered
20602
- * data subset. Can be used for tracking transformations of the data.
20603
- */
20604
- const filter = (filterConfig) => {
20605
- let {
20606
- data,
20607
- columnKeys,
20608
- formatters,
20609
- types,
20610
- timeFilter,
20611
- timeFilterKey,
20612
- searchQuery,
20613
- filterValues,
20614
- } = filterConfig;
20615
- let localColumnTypes = columnKeys.map((colKey) => types[colKey]);
20616
- let filters = Object.entries(filterValues);
20617
- let columnFormatters = Object.values(formatters);
20618
- let filteredIndicies = [];
20619
- let filteredData = data.filter((row, rowInd) => {
20620
- if (timeFilter) {
20621
- let inTimeFilter = checkTimeFilter(
20622
- row[timeFilterKey],
20623
- tableTimeFilters[timeFilter],
20624
- );
20625
- if (!inTimeFilter) {
20626
- return false;
20627
- }
20628
- }
20629
- let rowValues = columnKeys.map((colKey) => row[colKey]);
20630
- let shouldSearch = searchQuery && searchQuery.length;
20631
- if (
20632
- shouldSearch &&
20633
- !searchRow(rowValues, localColumnTypes, columnFormatters, searchQuery)
20634
- ) {
20635
- return false;
20636
- }
20637
- if (filters.length === 0) {
20638
- filteredIndicies.push(rowInd);
20639
- return true;
20640
- }
20641
- let inFilter = filters.every((entry) => {
20642
- let colKey = entry[0];
20643
- let filterVal = entry[1];
20644
- let colInd = columnKeys.indexOf(colKey);
20645
- let columnType = localColumnTypes[colInd];
20646
- let colFormatter = columnFormatters[colInd];
20647
- let rowValue = unpackObjectRepresentation(row[colKey]);
20648
- const formattedRowValue = colFormatter
20649
- ? colFormatter(rowValue)
20650
- : rowValue;
20651
- if (filterVal === null) {
20652
- return rowValue === null;
20653
- }
20654
- if (
20655
- typeof filterVal === "undefined" ||
20656
- filterVal === "" ||
20657
- (Array.isArray(filterVal) && filterVal.length === 0)
20658
- ) {
20659
- return true;
20660
- }
20661
- if (isEmpty(rowValue)) {
20662
- return false;
20663
- }
20664
- switch (columnType) {
20665
- case columnTypes.Nominal: {
20666
- return filterVal.includes(formattedRowValue);
20667
- }
20668
- case columnTypes.Number:
20669
- case columnTypes.String:
20670
- case columnTypes.DateTime:
20671
- case columnTypes.Object:
20672
- case columnTypes.Array:
20673
- return searchCell(rowValue, columnType, colFormatter, filterVal);
20674
- case columnTypes.Boolean:
20675
- return filterVal.includes(
20676
- colFormatter ? colFormatter(rowValue) : rowValue.toString(),
20677
- );
20678
- // return filterVal.includes(rowValue.toString());
20679
- default:
20680
- return true;
20681
- }
20682
- });
20683
- if (inFilter) {
20684
- filteredIndicies.push(rowInd);
20685
- }
20686
- return inFilter;
20687
- });
20688
- return { filteredData, filteredIndicies };
20689
- };
20690
-
20691
- const missingValueSymbol = Symbol("Missing");
20692
-
20693
- /**
20694
- * Utility function for grouping rows in the provided data based on nominal group membership. This group membership
20695
- * is determined by the provided column name and key. If there is no group currently, the function will return a
20696
- * formatted object mapping for the placeholder group 'None' which can then be ignored, but processed in the same
20697
- * way as grouped data. For rows with a missing nominal column value, they will be mapped to the group 'Missing'
20698
- * unless there is already a nominal group mapped to missing (as is sometimes the case with pre-processed data).
20699
- * In this case, a fallback group will be created for 'No group'.
20700
- *
20701
- * This method also expects to receive an array of indicies corresponding to the rows in the master dataset. This
20702
- * allows for transformation tracking during grouping to enable selection or other row-specific actions and events
20703
- * on the returned grouped data.
20704
- *
20705
- * @param {Object} groupConfig - the configuration options to use during grouping.
20706
- * @param {Object[]} groupConfig.sortedData - an array of row data as individual JSON objects in the array.
20707
- * @param {String} groupConfig.groupColumn - the group-by column name (as displayed in the header).
20708
- * @param {String} groupConfig.groupColumnKey - the key representation of the group-by column as found in the row
20709
- * JSON objects of the sortedData.
20710
- * @param {Number[]} groupConfig.filteredIndicies - the original row indicies of the data filtered/sorted/mutated in
20711
- * in the same transformation as the sortedData. Used to track method transformations.
20712
- * @returns {Object} groupedDataConfig - a map of group transformation information.
20713
- * @returns {Object} groupedDataConfig.groupedData - an object mapping of group data and the index of the group name in
20714
- * the groupTitles list.
20715
- * @returns {Array[]} groupedDataConfig.groupedData.data - an array of arrays, each containing a single group of row
20716
- * JSON objects.
20717
- * @returns {Number} groupedDataConfig.groupedData.groupInd - the index of the group in the groupTitles list.
20718
- * @returns {Array[]} groupedDataConfig.groupedIndicies - an array of arrays of numbers; the arrays representing groups
20719
- * and the numbers the original indicies.
20720
- * @returns {Array} groupedDataConfig.groupTitles - a list of Group names
20721
- */
20722
- const group = (groupConfig) => {
20723
- let { filteredData, groupColumn, groupColumnKey, filteredIndicies } =
20724
- groupConfig;
20725
- let returnValue = {
20726
- groupedData: {},
20727
- groupedIndicies: [],
20728
- groupTitles: [],
20729
- };
20730
- if (!groupColumn || groupColumn === "None") {
20731
- returnValue.groupedIndicies.push(filteredIndicies);
20732
- returnValue.groupTitles.push("None");
20733
- returnValue.groupedData = [
20734
- {
20735
- data: filteredData,
20736
- groupInd: 0,
20737
- },
20738
- ];
20739
- return returnValue;
20740
- }
20741
- let containsMissingGroupFromString = false;
20742
- returnValue.groupedData = filteredData.reduce((map, row, rowInd) => {
20743
- let rowGroup = unpackObjectRepresentation(row[groupColumnKey]);
20744
- if (isEmpty(rowGroup) || isMissingValue(rowGroup)) {
20745
- rowGroup = missingValueSymbol;
20746
- } else if (rowGroup === missingValueSymbol.description) {
20747
- containsMissingGroupFromString = true;
20748
- }
20749
- if (typeof map[rowGroup] === "undefined") {
20750
- returnValue.groupTitles.push(rowGroup);
20751
- let indexTracker = returnValue.groupedIndicies.push([]);
20752
- map[rowGroup] = {
20753
- data: [],
20754
- groupInd: indexTracker - 1,
20755
- };
20756
- }
20757
- returnValue.groupedIndicies[map[rowGroup].groupInd].push(
20758
- filteredIndicies[rowInd],
20759
- );
20760
- map[rowGroup].data.push(row);
20761
- return map;
20762
- }, {});
20763
- let orderedGroups = [];
20764
- returnValue.groupTitles = returnValue.groupTitles
20765
- .sort((group1, group2) => {
20766
- if (group1 === missingValueSymbol) {
20767
- return 1;
20768
- } else if (group2 === missingValueSymbol) {
20769
- return -1;
20770
- }
20771
- return group1.toLowerCase() > group2.toLowerCase() ? 1 : -1;
20772
- })
20773
- .map((group) => {
20774
- orderedGroups.push(returnValue.groupedData[group]);
20775
- if (group === missingValueSymbol) {
20776
- return containsMissingGroupFromString
20777
- ? "No group"
20778
- : missingValueSymbol.description;
20779
- }
20780
- return group;
20781
- });
20782
- returnValue.groupedData = orderedGroups;
20783
-
20784
- return returnValue;
20785
- };
20786
-
20787
- /**
20788
- * Utility function to process grouped data into a single page of grouped data based on the current page size
20789
- * and the start and end row indicies. Also creates an updated array for both paginated selection and indicies.
20790
- *
20791
- * @param {Object} paginationConfig - the configuration options to use during pagination.
20792
- * @param {Array[]} paginationConfig.sortedData - a double-nested array containing the full set of filtered,
20793
- * grouped and sorted data.
20794
- * @example: [
20795
- * [row1, row2,...], // group1
20796
- * ...,
20797
- * [rowN, rowN+1, ...], // group2
20798
- * ]
20799
- * @param {Array[]} paginationConfig.processedIndicies - a double-nested array containing the full set of filtered,
20800
- * grouped,and sorted indicies which map to the indicies of the previously filtered, grouped and sorted row in
20801
- * the original data.
20802
- * @param {Array[]} paginationConfig.processedSelection - a double-nested array containing the full set of filtered,
20803
- * grouped and sorted selection state.
20804
- * @param {Number} paginationConfig.pageSize - the current number of items which should be shown per page.
20805
- * @param {Number} paginationConfig.pageStart - the starting row index to include (zero indexed; inclusive).
20806
- * @param {Number} paginationConfig.pageEnd - the row index of the first row to *exclude* from the page.
20807
- * @returns {Object} paginatedResults - the results of the pagination. All values are double-nested arrays and excluded
20808
- * groups will be returned as empty arrays and empty data or empty pages will be represented as empty arrays as well.
20809
- * @returns {Array[]} paginatedResults.paginatedData - the paginated data to display on the page.
20810
- * @returns {Array[]} paginatedResults.paginatedSelection - the paginated selection to pass to the TableUI.vue component.
20811
- * @returns {Array[]} paginatedResults.paginatedIndicies - the paginated indicies to map TableUI selection events to their
20812
- * original indicies.
20813
- */
20814
- const paginate = (paginationConfig) => {
20815
- let {
20816
- sortedData,
20817
- processedIndicies,
20818
- processedSelection = [],
20819
- pageSize,
20820
- pageStart,
20821
- pageEnd,
20822
- } = paginationConfig;
20823
- let includedRows = 0;
20824
- let totalRows = 0;
20825
- let paginatedSelection = [];
20826
- let paginatedIndicies = [];
20827
- let paginatedData = sortedData.map((dataGroup, groupInd) => {
20828
- let groupCount = dataGroup.length;
20829
- let groupStart = totalRows;
20830
- let groupEnd = groupStart + groupCount;
20831
- let remainingRows = pageSize - includedRows;
20832
- let returnValue = [];
20833
- let skipGroup =
20834
- remainingRows <= 0 || groupEnd < pageStart || groupStart > pageEnd;
20835
- let includeEntireGroup =
20836
- remainingRows >= groupCount &&
20837
- groupStart >= pageStart &&
20838
- groupEnd <= pageEnd;
20839
- if (skipGroup) {
20840
- returnValue = [];
20841
- paginatedSelection.push([]);
20842
- paginatedIndicies.push([]);
20843
- } else if (includeEntireGroup) {
20844
- returnValue = dataGroup;
20845
- paginatedSelection.push(processedSelection[groupInd]);
20846
- paginatedIndicies.push(processedIndicies[groupInd]);
20847
- } else {
20848
- let groupSliceStart = 0;
20849
- let groupSliceEnd = groupCount;
20850
- if (groupStart < pageStart) {
20851
- groupSliceStart = pageStart - groupStart;
20852
- if (groupCount - groupSliceStart > remainingRows) {
20853
- groupSliceEnd = groupSliceStart + remainingRows;
20854
- }
20855
- } else if (groupSliceStart + remainingRows < groupCount) {
20856
- groupSliceEnd = groupSliceStart + remainingRows;
20857
- }
20858
- returnValue = dataGroup.slice(groupSliceStart, groupSliceEnd);
20859
- paginatedSelection.push(
20860
- processedSelection[groupInd]?.slice(groupSliceStart, groupSliceEnd),
20861
- );
20862
- paginatedIndicies.push(
20863
- processedIndicies[groupInd].slice(groupSliceStart, groupSliceEnd),
20864
- );
20865
- }
20866
- includedRows += returnValue.length;
20867
- totalRows += groupCount;
20868
- return returnValue;
20869
- });
20870
- return { paginatedData, paginatedSelection, paginatedIndicies };
20871
- };
20872
-
20873
- /**
20874
- * Utility function for sorting a data set. This functionality sorts the entire dataset, but also performs sorts within
20875
- * the grouped data. Additionally, transformations of the row order are tracked on an index level so original row order
20876
- * can be tracked.
20877
- *
20878
- * @param {*} sortConfig - the object mapping of the required fields for sorting the data.
20879
- * @param {Array[]} sortConfig.groupedData - an array of arrays, each containing a single group of row JSON objects.
20880
- * @param {Array[]} sortConfig.groupedIndicies - an array of arrays of numbers; the arrays representing groups
20881
- * and the numbers the original indicies.
20882
- * @param {String} sortConfig.groupColumnKey - the columnKey of the column currently being used as the "group-by"
20883
- * column.
20884
- * @param {String[]} sortConfig.columnKeys - the column keys for the row Objects of the currently displayed data.
20885
- * @param {Object} sortConfig.columnTypes - a columnKey/type (@see table.config.js ) mapping for the columns in the data
20886
- * set. Allows data-type specific sorting.
20887
- * @param {String} [sortConfig.sortColumn] - the optional columnKey for the column which should be used to sort the data.
20888
- * If none is provided, no sorting will be performed.
20889
- * @param {String} sortConfig.sortDirection - either 1 or -1 which correspond to ascending/descending respectively.
20890
- * @returns {Object} sortedDataConfig - contains the results of the sorting operations.
20891
- * @returns {Array[]} sortedDataConfig.sortedData - an array of arrays of row Objects. This data set will be grouped and
20892
- * sorted according to the provided configuration.
20893
- * @returns {Number[]} sortedDataConfig.sortedIndicies - an array of the original row indicies grouped and sorted according
20894
- * to the previous grouping and the current sorting transformations which were performed.
20895
- */
20896
- const sort = (sortConfig) => {
20897
- let {
20898
- groupedData,
20899
- groupedIndicies,
20900
- groupColumnKey,
20901
- columnKeys,
20902
- columnTypes: currentColumnTypes,
20903
- sortColumn,
20904
- sortDirection,
20905
- } = sortConfig;
20906
-
20907
- return groupedData
20908
- .map(({ data, groupInd }) =>
20909
- data
20910
- .map((row, rowInd) => ({
20911
- row,
20912
- rowInd: groupedIndicies[groupInd][rowInd],
20913
- }))
20914
- .sort(({ row: row1 }, { row: row2 }) => {
20915
- // only sort within groups
20916
- if (
20917
- sortColumn === null ||
20918
- (groupColumnKey && row1[groupColumnKey] !== row2[groupColumnKey])
20919
- ) {
20920
- return 0;
20921
- }
20922
- let columnKey = columnKeys[sortColumn];
20923
- let columnType = currentColumnTypes[sortColumn];
20924
- let rawVal1 = row1[columnKey];
20925
- let rawVal2 = row2[columnKey];
20926
- const val1EmptyOrMissing =
20927
- isEmpty(rawVal1) || isMissingValue(rawVal1);
20928
- const val2EmptyOrMissing =
20929
- isEmpty(rawVal2) || isMissingValue(rawVal2);
20930
-
20931
- if (val1EmptyOrMissing && val2EmptyOrMissing) {
20932
- return 0;
20933
- } else if (val1EmptyOrMissing) {
20934
- return 1;
20935
- } else if (val2EmptyOrMissing) {
20936
- return -1;
20937
- } else {
20938
- let order = 0;
20939
- if (
20940
- columnType === columnTypes.Array &&
20941
- rawVal1.length !== rawVal2.length
20942
- ) {
20943
- order = rawVal1.length > rawVal2.length ? 1 : -1;
20944
- } else {
20945
- let val1comparison = JSON.stringify(row1[columnKey]);
20946
- let val2comparison = JSON.stringify(row2[columnKey]);
20947
- if (val1comparison !== val2comparison) {
20948
- order = val1comparison > val2comparison ? 1 : -1;
20949
- }
20950
- }
20951
- return order * sortDirection;
20952
- }
20953
- })
20954
- .reduce(
20955
- (acc, mapItem) => {
20956
- acc.data.push(mapItem.row);
20957
- acc.indicies.push(mapItem.rowInd);
20958
- return acc;
20959
- },
20960
- { data: [], indicies: [] },
20961
- ),
20962
- )
20963
- .reduce(
20964
- (acc, { data, indicies }) => {
20965
- acc.sortedData.push(data);
20966
- acc.sortedIndicies.push(indicies);
20967
- return acc;
20968
- },
20969
- { sortedData: [], sortedIndicies: [] },
20970
- );
20971
- };
20356
+ const TableUIWithAutoSizeCalculation = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-72cc3068"]]);
20972
20357
 
20973
- export { TableActionBar, TableUI, TableUIWithAutoSizeCalculation, checkTimeFilter, columnFilterConfigs, columnSortText, columnTypes, constants, defaultPageSize, defaultTimeFilter, filter, filterComponents, getColumnDomains, getDefaultFilterValues, getFilterConfigs, getInitialFilterValues, getMissingValueMessage, getNextPage, getProcessedRowInd, group, isMissingValue, months, paginate, sort, tablePageSizes, tableTimeFilters, typeFormatters, unpackObjectRepresentation, valueTypeFormatters };
20358
+ export { TableActionBar, TableUI, TableUIWithAutoSizeCalculation, columnFilterConfigs, columnSortText, columnTypes, constants, defaultPageSize, filterComponents, getMissingValueMessage, isMissingValue, tablePageSizes, unpackObjectRepresentation };
20974
20359
  //# sourceMappingURL=index.js.map