@fkui/vue-labs 6.40.0 → 6.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2601,7 +2601,7 @@ const _hoisted_1$e = {
2601
2601
  class: "table-ng__cell table-ng__cell--expand"
2602
2602
  };
2603
2603
  const _hoisted_2$9 = ["aria-label", "aria-expanded"];
2604
- const _hoisted_3$5 = {
2604
+ const _hoisted_3$4 = {
2605
2605
  key: 1,
2606
2606
  ref: "expandable",
2607
2607
  tabindex: "-1",
@@ -2647,7 +2647,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
2647
2647
  }, [vue.createVNode(vue.unref(vue$1.FIcon), {
2648
2648
  class: "button__icon",
2649
2649
  name: toggleIcon.value
2650
- }, null, 8, ["name"])], 8, _hoisted_2$9)])) : (vue.openBlock(), vue.createElementBlock("td", _hoisted_3$5, null, 512));
2650
+ }, null, 8, ["name"])], 8, _hoisted_2$9)])) : (vue.openBlock(), vue.createElementBlock("td", _hoisted_3$4, null, 512));
2651
2651
  };
2652
2652
  }
2653
2653
  });
@@ -2993,7 +2993,7 @@ const inputFieldConfig = {
2993
2993
  }
2994
2994
  }
2995
2995
  };
2996
- const _hoisted_1$c = ["aria-sort"];
2996
+ const _hoisted_1$c = ["aria-sort", "onKeydown"];
2997
2997
  const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
2998
2998
  __name: "ITableHeader",
2999
2999
  props: {
@@ -3057,19 +3057,13 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
3057
3057
  }
3058
3058
  emit("toggleSortOrder", String(__props.column.sortable));
3059
3059
  }
3060
- function onKeydownCell(e) {
3061
- if (e.key === "Enter") {
3062
- e.preventDefault();
3063
- onClickCell();
3064
- }
3065
- }
3066
3060
  return (_ctx, _cache) => {
3067
3061
  return vue.openBlock(), vue.createElementBlock("th", {
3068
3062
  ref: "th",
3069
3063
  "aria-sort": sortValue.value,
3070
3064
  class: vue.normalizeClass(columnClasses.value),
3071
3065
  tabindex: "-1",
3072
- onKeydown: onKeydownCell,
3066
+ onKeydown: vue.withKeys(vue.withModifiers(onClickCell, ["prevent"]), ["enter", "space"]),
3073
3067
  onClick: vue.withModifiers(onClickCell, ["stop"])
3074
3068
  }, [vue.createVNode(vue.unref(vue$1.IFlex), {
3075
3069
  gap: "1x",
@@ -3763,12 +3757,8 @@ function requireEs_iterator_map() {
3763
3757
  return es_iterator_map;
3764
3758
  }
3765
3759
  requireEs_iterator_map();
3766
- const _hoisted_1$7 = {
3767
- key: 0,
3768
- class: "table-ng__cell table-ng__cell--anchor"
3769
- };
3770
- const _hoisted_2$5 = ["href"];
3771
- const _hoisted_3$4 = {
3760
+ const _hoisted_1$7 = ["href"];
3761
+ const _hoisted_2$5 = {
3772
3762
  key: 1,
3773
3763
  ref: "target",
3774
3764
  tabindex: "-1",
@@ -3789,13 +3779,18 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
3789
3779
  };
3790
3780
  __expose(expose);
3791
3781
  return (_ctx, _cache) => {
3792
- return __props.column.text(__props.row) ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_1$7, [vue.createElementVNode("a", {
3782
+ return __props.column.text(__props.row) ? (vue.openBlock(), vue.createElementBlock("td", {
3783
+ key: 0,
3784
+ class: "table-ng__cell table-ng__cell--anchor",
3785
+ onKeydown: _cache[0] || (_cache[0] = vue.withKeys(vue.withModifiers(() => {
3786
+ }, ["prevent"]), ["space"]))
3787
+ }, [vue.createElementVNode("a", {
3793
3788
  ref: "target",
3794
3789
  class: "anchor anchor--block",
3795
3790
  target: "_blank",
3796
3791
  href: __props.column.href,
3797
3792
  tabindex: "-1"
3798
- }, vue.toDisplayString(__props.column.text(__props.row)), 9, _hoisted_2$5)])) : (vue.openBlock(), vue.createElementBlock("td", _hoisted_3$4, null, 512));
3793
+ }, vue.toDisplayString(__props.column.text(__props.row)), 9, _hoisted_1$7)], 32)) : (vue.openBlock(), vue.createElementBlock("td", _hoisted_2$5, null, 512));
3799
3794
  };
3800
3795
  }
3801
3796
  });
@@ -3989,7 +3984,7 @@ const _hoisted_3$3 = ["aria-expanded", "aria-controls", "aria-activedescendant",
3989
3984
  const _hoisted_4$3 = {
3990
3985
  class: "table-ng__editable__text"
3991
3986
  };
3992
- const _hoisted_5$2 = {
3987
+ const _hoisted_5$3 = {
3993
3988
  key: 1,
3994
3989
  tabindex: "-1",
3995
3990
  class: "table-ng__cell table-ng__cell--static"
@@ -4016,7 +4011,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
4016
4011
  const activeOptionId = logic.ElementIdService.generateElementId();
4017
4012
  const activeOption = vue.ref(null);
4018
4013
  async function onCellKeyDown(e) {
4019
- if (e.code === "Enter" || e.code === "NumpadEnter") {
4014
+ if (e.code === "Enter" || e.code === "NumpadEnter" || e.code === "Space") {
4020
4015
  await startEditing(e);
4021
4016
  }
4022
4017
  }
@@ -4167,7 +4162,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
4167
4162
  "input-node": editRef.value,
4168
4163
  onSelect: selectDropdownOption,
4169
4164
  onClose: onDropdownClose
4170
- }, null, 8, ["id", "is-open", "options", "active-option", "active-option-id", "input-node"]), [[vue.vShow, editing.value]])], 32)) : (vue.openBlock(), vue.createElementBlock("td", _hoisted_5$2, vue.toDisplayString(__props.column.selected(__props.row)), 1));
4165
+ }, null, 8, ["id", "is-open", "options", "active-option", "active-option-id", "input-node"]), [[vue.vShow, editing.value]])], 32)) : (vue.openBlock(), vue.createElementBlock("td", _hoisted_5$3, vue.toDisplayString(__props.column.selected(__props.row)), 1));
4171
4166
  };
4172
4167
  }
4173
4168
  });
@@ -4225,6 +4220,10 @@ const _hoisted_3$2 = {
4225
4220
  class: "sr-only"
4226
4221
  };
4227
4222
  const _hoisted_4$2 = ["id", "aria-label", "aria-hidden"];
4223
+ const _hoisted_5$2 = {
4224
+ ref: "arrowAnchor",
4225
+ "aria-hidden": "true"
4226
+ };
4228
4227
  const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4229
4228
  __name: "ITableText",
4230
4229
  props: {
@@ -4317,6 +4316,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4317
4316
  });
4318
4317
  const tdElement = vue.useTemplateRef("td");
4319
4318
  const inputElement = vue.useTemplateRef("input");
4319
+ const arrowAnchorElement = vue.useTemplateRef("arrowAnchor");
4320
4320
  const {
4321
4321
  stopEdit: stopEdit2
4322
4322
  } = useStartStopEdit();
@@ -4344,22 +4344,38 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4344
4344
  }
4345
4345
  function setUpFakeValidation(el) {
4346
4346
  logic.assertRef(inputElement);
4347
+ const input = inputElement.value;
4348
+ function emitFakeValidity(nativeEvent) {
4349
+ const fakeEvent = new CustomEvent("validity", {
4350
+ detail: {
4351
+ isValid: true,
4352
+ nativeEvent,
4353
+ validityMode: "INITIAL",
4354
+ validationMessage: "",
4355
+ target: input,
4356
+ elementId: String(input.id)
4357
+ }
4358
+ });
4359
+ onValidity(fakeEvent);
4360
+ }
4347
4361
  const nativeEvents = ["change", "blur"];
4348
4362
  for (const nativeEvent of nativeEvents) {
4349
4363
  core.useEventListener(el, nativeEvent, () => {
4350
- const fakeEvent = new CustomEvent("validity", {
4351
- detail: {
4352
- isValid: true,
4353
- nativeEvent,
4354
- validityMode: "INITIAL",
4355
- validationMessage: "",
4356
- target: inputElement.value,
4357
- elementId: String(inputElement.value.id)
4358
- }
4359
- });
4360
- onValidity(fakeEvent);
4364
+ emitFakeValidity(nativeEvent);
4361
4365
  });
4362
4366
  }
4367
+ validationFacade = {
4368
+ validateElement: () => {
4369
+ emitFakeValidity("validate");
4370
+ return Promise.resolve({
4371
+ isValid: true,
4372
+ error: "",
4373
+ isSubmitted: false,
4374
+ isTouched: false
4375
+ });
4376
+ },
4377
+ dispatchComponentValidityEvent: () => void 0
4378
+ };
4363
4379
  core.useEventListener(el, "input", onPendingValidity);
4364
4380
  core.useEventListener(el, "component-validity", (e) => {
4365
4381
  e.stopPropagation();
@@ -4378,20 +4394,20 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4378
4394
  });
4379
4395
  vue.watchEffect(() => {
4380
4396
  if (hasError.value) {
4381
- var _tdElement$value, _inputElement$value;
4397
+ var _tdElement$value, _arrowAnchorElement$v;
4382
4398
  emit("onError", {
4383
4399
  anchor: (_tdElement$value = tdElement.value) !== null && _tdElement$value !== void 0 ? _tdElement$value : void 0,
4384
- arrowAnchor: (_inputElement$value = inputElement.value) !== null && _inputElement$value !== void 0 ? _inputElement$value : void 0,
4400
+ arrowAnchor: (_arrowAnchorElement$v = arrowAnchorElement.value) !== null && _arrowAnchorElement$v !== void 0 ? _arrowAnchorElement$v : void 0,
4385
4401
  message: validity.value.validationMessage,
4386
4402
  hasFocus: focused.value,
4387
4403
  hasHover: isHovered.value,
4388
4404
  inEdit: inEdit.value
4389
4405
  });
4390
4406
  } else {
4391
- var _tdElement$value2, _inputElement$value2;
4407
+ var _tdElement$value2, _arrowAnchorElement$v2;
4392
4408
  emit("closeError", {
4393
4409
  anchor: (_tdElement$value2 = tdElement.value) !== null && _tdElement$value2 !== void 0 ? _tdElement$value2 : void 0,
4394
- arrowAnchor: (_inputElement$value2 = inputElement.value) !== null && _inputElement$value2 !== void 0 ? _inputElement$value2 : void 0,
4410
+ arrowAnchor: (_arrowAnchorElement$v2 = arrowAnchorElement.value) !== null && _arrowAnchorElement$v2 !== void 0 ? _arrowAnchorElement$v2 : void 0,
4395
4411
  message: validity.value.validationMessage,
4396
4412
  hasFocus: focused.value,
4397
4413
  hasHover: isHovered.value,
@@ -4427,6 +4443,9 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4427
4443
  inputElement.value.tabIndex = -1;
4428
4444
  logic.assertRef(tdElement);
4429
4445
  tdElement.value.style.removeProperty("width");
4446
+ if (reason === "blur") {
4447
+ tdElement.value.tabIndex = 0;
4448
+ }
4430
4449
  void stopEdit2(inputElement.value, reason);
4431
4450
  }
4432
4451
  function fromColumnValue() {
@@ -4483,6 +4502,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4483
4502
  });
4484
4503
  } else {
4485
4504
  pendingStopEditReason = "enter";
4505
+ void validationFacade.validateElement(inputElement.value);
4486
4506
  }
4487
4507
  break;
4488
4508
  }
@@ -4564,7 +4584,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4564
4584
  onKeydown
4565
4585
  }, [vue.createElementVNode("div", {
4566
4586
  class: vue.normalizeClass(divClasses.value)
4567
- }, [vue.createElementVNode("span", _hoisted_2$2, vue.toDisplayString(fromColumnValue()), 1), _cache[1] || (_cache[1] = vue.createTextVNode()), viewModeErrorMessage.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$2, vue.toDisplayString(viewModeErrorMessage.value), 1)) : vue.createCommentVNode("", true), _cache[2] || (_cache[2] = vue.createTextVNode()), vue.withDirectives(vue.createElementVNode("input", vue.mergeProps({
4587
+ }, [vue.createElementVNode("span", _hoisted_2$2, vue.toDisplayString(fromColumnValue()), 1), _cache[2] || (_cache[2] = vue.createTextVNode()), viewModeErrorMessage.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$2, vue.toDisplayString(viewModeErrorMessage.value), 1)) : vue.createCommentVNode("", true), _cache[3] || (_cache[3] = vue.createTextVNode()), vue.withDirectives(vue.createElementVNode("input", vue.mergeProps({
4568
4588
  id: vue.unref(inputId),
4569
4589
  ref: "input",
4570
4590
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => viewValue.value = $event),
@@ -4580,18 +4600,20 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4580
4600
  "aria-hidden": !inEdit.value,
4581
4601
  onValidity,
4582
4602
  onPendingValidity
4583
- }), null, 16, _hoisted_4$2), [[vue.vModelText, viewValue.value]])], 2), _cache[3] || (_cache[3] = vue.createTextVNode()), vue.createVNode(vue.unref(vue$1.IPopupError), {
4603
+ }), null, 16, _hoisted_4$2), [[vue.vModelText, viewValue.value]]), _cache[4] || (_cache[4] = vue.createTextVNode()), vue.createElementVNode("span", _hoisted_5$2, null, 512)], 2), _cache[5] || (_cache[5] = vue.createTextVNode()), vue.createVNode(vue.unref(vue$1.IPopupError), {
4584
4604
  anchor: tdElement.value,
4585
4605
  "is-open": openPopupError.value,
4586
4606
  "error-message": validity.value.validationMessage,
4587
- "arrow-anchor": inputElement.value,
4607
+ "arrow-anchor": arrowAnchorElement.value,
4588
4608
  layout: "f-table"
4589
4609
  }, null, 8, ["anchor", "is-open", "error-message", "arrow-anchor"])], 42, _hoisted_1$3)) : (vue.openBlock(), vue.createElementBlock("td", {
4590
4610
  key: 1,
4591
4611
  ref: "td",
4592
4612
  tabindex: "-1",
4593
- class: vue.normalizeClass(staticClasses.value)
4594
- }, vue.toDisplayString(fromColumnValue()), 3));
4613
+ class: vue.normalizeClass(staticClasses.value),
4614
+ onKeydown: _cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers(() => {
4615
+ }, ["prevent"]), ["space"]))
4616
+ }, vue.toDisplayString(fromColumnValue()), 35));
4595
4617
  };
4596
4618
  }
4597
4619
  });
@@ -5070,8 +5092,8 @@ function useSelectable(options) {
5070
5092
  };
5071
5093
  }
5072
5094
  function matching(needle) {
5073
- const id = vue$1.getItemIdentifier(needle);
5074
- return (item) => vue$1.getItemIdentifier(item) === id;
5095
+ const id = vue$1.getItemIdentifier(needle.row);
5096
+ return (item) => vue$1.getItemIdentifier(item.row) === id;
5075
5097
  }
5076
5098
  function useTabstop(tableRef, metaRows) {
5077
5099
  let pendingRowRemoval = false;
@@ -5236,9 +5258,6 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
5236
5258
  keyAttribute: {
5237
5259
  default: () => void 0
5238
5260
  },
5239
- expandableAttribute: {
5240
- default: () => void 0
5241
- },
5242
5261
  rowClass: {
5243
5262
  type: Function,
5244
5263
  default: void 0
@@ -5269,9 +5288,12 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
5269
5288
  } = vue$1.useSlotUtils();
5270
5289
  const tableRef = vue.useTemplateRef("table");
5271
5290
  const expandedKeys = vue.ref(/* @__PURE__ */ new Set());
5272
- const keyedRows = vue.computed(() => vue$1.setItemIdentifiers(__props.rows, __props.keyAttribute, __props.expandableAttribute));
5273
- const metaRows = vue.computed(() => getMetaRows(keyedRows.value, expandedKeys.value, __props.expandableAttribute));
5274
- const isTreegrid = vue.computed(() => Boolean(__props.expandableAttribute));
5291
+ const expandableAttribute = vue.computed(() => {
5292
+ return vue$1.getDatasetMetadata(__props.rows).nestedAttribute;
5293
+ });
5294
+ const keyedRows = vue.computed(() => vue$1.setItemIdentifiers(__props.rows, __props.keyAttribute, expandableAttribute.value));
5295
+ const metaRows = vue.computed(() => getMetaRows(keyedRows.value, expandedKeys.value, expandableAttribute.value));
5296
+ const isTreegrid = vue.computed(() => Boolean(expandableAttribute.value));
5275
5297
  const role = vue.computed(() => isTreegrid.value ? "treegrid" : "grid");
5276
5298
  const hasCaption = vue.computed(() => {
5277
5299
  return hasSlot("caption", {}, {
@@ -5287,7 +5309,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
5287
5309
  return footerRow;
5288
5310
  }
5289
5311
  const headerRow = 1;
5290
- const bodyRows = getBodyRowCount(keyedRows.value, __props.expandableAttribute);
5312
+ const bodyRows = getBodyRowCount(keyedRows.value, expandableAttribute.value);
5291
5313
  return bodyRows + headerRow + footerRow;
5292
5314
  });
5293
5315
  const fullColspan = vue.computed(() => {
@@ -5459,7 +5481,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
5459
5481
  selectedRows,
5460
5482
  rows: keyedRows
5461
5483
  });
5462
- const tableApi = useTabstop(tableRef, keyedRows);
5484
+ const tableApi = useTabstop(tableRef, metaRows);
5463
5485
  __expose(tableApi);
5464
5486
  vue.onMounted(() => {
5465
5487
  logic.assertRef(tableRef);
@@ -5477,13 +5499,13 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
5477
5499
  onFocusout: onTableFocusout,
5478
5500
  onClick,
5479
5501
  onKeydown
5480
- }, [hasCaption.value ? (vue.openBlock(), vue.createElementBlock("caption", _hoisted_2$1, [vue.renderSlot(_ctx.$slots, "caption")])) : vue.createCommentVNode("", true), _cache[4] || (_cache[4] = vue.createTextVNode()), hasColumns.value ? (vue.openBlock(), vue.createElementBlock("thead", _hoisted_3$1, [vue.createElementVNode("tr", _hoisted_4$1, [isTreegrid.value ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_5$1)) : vue.createCommentVNode("", true), _cache[0] || (_cache[0] = vue.createTextVNode()), __props.selectable ? (vue.openBlock(), vue.createBlock(_sfc_main$d, {
5502
+ }, [hasCaption.value ? (vue.openBlock(), vue.createElementBlock("caption", _hoisted_2$1, [vue.renderSlot(_ctx.$slots, "caption")])) : vue.createCommentVNode("", true), _cache[6] || (_cache[6] = vue.createTextVNode()), hasColumns.value ? (vue.openBlock(), vue.createElementBlock("thead", _hoisted_3$1, [vue.createElementVNode("tr", _hoisted_4$1, [isTreegrid.value ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_5$1)) : vue.createCommentVNode("", true), _cache[2] || (_cache[2] = vue.createTextVNode()), __props.selectable ? (vue.openBlock(), vue.createBlock(_sfc_main$d, {
5481
5503
  key: 1,
5482
5504
  ref: bindCellApiRef,
5483
5505
  state: vue.unref(selectableHeaderState)(),
5484
5506
  selectable: __props.selectable,
5485
5507
  onToggle: vue.unref(toggleSelectableHeader)
5486
- }, null, 8, ["state", "selectable", "onToggle"])) : vue.createCommentVNode("", true), _cache[1] || (_cache[1] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(columns.value, (column) => {
5508
+ }, null, 8, ["state", "selectable", "onToggle"])) : vue.createCommentVNode("", true), _cache[3] || (_cache[3] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(columns.value, (column) => {
5487
5509
  return vue.openBlock(), vue.createBlock(_sfc_main$e, {
5488
5510
  key: column.id,
5489
5511
  column,
@@ -5492,10 +5514,12 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
5492
5514
  scope: "col",
5493
5515
  onToggleSortOrder
5494
5516
  }, null, 8, ["column", "sort-enabled", "sort-order"]);
5495
- }), 128))])])) : vue.createCommentVNode("", true), _cache[5] || (_cache[5] = vue.createTextVNode()), hasColumns.value ? (vue.openBlock(), vue.createElementBlock("tbody", _hoisted_6$1, [isEmpty.value ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_7$1, [vue.createElementVNode("td", {
5517
+ }), 128))])])) : vue.createCommentVNode("", true), _cache[7] || (_cache[7] = vue.createTextVNode()), hasColumns.value ? (vue.openBlock(), vue.createElementBlock("tbody", _hoisted_6$1, [isEmpty.value ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_7$1, [vue.createElementVNode("td", {
5496
5518
  colspan: fullColspan.value,
5497
- class: "table-ng__cell"
5498
- }, [vue.renderSlot(_ctx.$slots, "empty", {}, () => [vue.createTextVNode(vue.toDisplayString(vue.unref($t)("fkui.ftable.empty.text", "Tabellen är tom")), 1)])], 8, _hoisted_8)])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, {
5519
+ class: "table-ng__cell",
5520
+ onKeydown: _cache[0] || (_cache[0] = vue.withKeys(vue.withModifiers(() => {
5521
+ }, ["prevent"]), ["space"]))
5522
+ }, [vue.renderSlot(_ctx.$slots, "empty", {}, () => [vue.createTextVNode(vue.toDisplayString(vue.unref($t)("fkui.ftable.empty.text", "Tabellen är tom")), 1)])], 40, _hoisted_8)])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, {
5499
5523
  key: 1
5500
5524
  }, vue.renderList(metaRows.value, ({
5501
5525
  key,
@@ -5523,7 +5547,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
5523
5547
  "is-expanded": isExpanded,
5524
5548
  "row-key": key,
5525
5549
  onToggle: onToggleExpanded
5526
- }, null, 8, ["is-expandable", "is-expanded", "row-key"])) : vue.createCommentVNode("", true), _cache[3] || (_cache[3] = vue.createTextVNode()), level > 1 && hasExpandableSlot.value ? (vue.openBlock(), vue.createBlock(_sfc_main$f, {
5550
+ }, null, 8, ["is-expandable", "is-expanded", "row-key"])) : vue.createCommentVNode("", true), _cache[5] || (_cache[5] = vue.createTextVNode()), level > 1 && hasExpandableSlot.value ? (vue.openBlock(), vue.createBlock(_sfc_main$f, {
5527
5551
  key: 1,
5528
5552
  colspan: expandedColspan.value
5529
5553
  }, {
@@ -5544,7 +5568,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
5544
5568
  state: vue.unref(selectableRowState)(row),
5545
5569
  row,
5546
5570
  onToggle: vue.unref(toggleSelectableRow)
5547
- }, null, 8, ["level", "selectable", "state", "row", "onToggle"])) : vue.createCommentVNode("", true), _cache[2] || (_cache[2] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(columns.value, (column) => {
5571
+ }, null, 8, ["level", "selectable", "state", "row", "onToggle"])) : vue.createCommentVNode("", true), _cache[4] || (_cache[4] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(columns.value, (column) => {
5548
5572
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
5549
5573
  key: column.id
5550
5574
  }, ["component" in column ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(column.component), {
@@ -5561,16 +5585,29 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
5561
5585
  row
5562
5586
  }, null, 8, ["row"])) : vue.createCommentVNode("", true)], 64);
5563
5587
  }), 128))], 64))], 10, _hoisted_9);
5564
- }), 128))])) : vue.createCommentVNode("", true), _cache[6] || (_cache[6] = vue.createTextVNode()), hasFooter.value ? (vue.openBlock(), vue.createElementBlock("tfoot", _hoisted_10, [vue.createElementVNode("tr", {
5588
+ }), 128))])) : vue.createCommentVNode("", true), _cache[8] || (_cache[8] = vue.createTextVNode()), hasFooter.value ? (vue.openBlock(), vue.createElementBlock("tfoot", _hoisted_10, [vue.createElementVNode("tr", {
5565
5589
  class: "table-ng__row",
5566
5590
  "aria-rowindex": ariaRowcount.value
5567
5591
  }, [vue.createElementVNode("td", {
5568
5592
  colspan: fullColspan.value,
5569
- class: "table-ng__cell--custom"
5570
- }, [vue.renderSlot(_ctx.$slots, "footer")], 8, _hoisted_12)], 8, _hoisted_11)])) : vue.createCommentVNode("", true)], 42, _hoisted_1$2);
5593
+ class: "table-ng__cell--custom",
5594
+ onKeydown: _cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers(() => {
5595
+ }, ["prevent"]), ["space"]))
5596
+ }, [vue.renderSlot(_ctx.$slots, "footer")], 40, _hoisted_12)], 8, _hoisted_11)])) : vue.createCommentVNode("", true)], 42, _hoisted_1$2);
5571
5597
  };
5572
5598
  }
5573
5599
  });
5600
+ function isSortable(column) {
5601
+ return "key" in column && column.key !== void 0 && column.sort !== false;
5602
+ }
5603
+ function toEntry(column) {
5604
+ return [column.key, column.header];
5605
+ }
5606
+ function getTableSortableAttributes(columns) {
5607
+ const sortable = columns.filter(isSortable);
5608
+ const attributes = sortable.map(toEntry);
5609
+ return Object.fromEntries(attributes);
5610
+ }
5574
5611
  var es_array_toSpliced = {};
5575
5612
  var hasRequiredEs_array_toSpliced;
5576
5613
  function requireEs_array_toSpliced() {
@@ -7497,7 +7534,7 @@ const validators = [hoursMinutesValidator, greaterThanTimeValidator, lessThanTim
7497
7534
  for (const validator of validators) {
7498
7535
  logic.ValidationService.registerValidator(validator);
7499
7536
  }
7500
- const _sfc_main = vue.defineComponent({
7537
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
7501
7538
  name: "XTimeTextField",
7502
7539
  extends: vue$1.FTextField,
7503
7540
  mixins: [vue$1.TranslationMixin],
@@ -7544,6 +7581,7 @@ exports.baseTypes = baseTypes;
7544
7581
  exports.defineTableColumns = defineTableColumns;
7545
7582
  exports.forgivingParseTimeToNumber = forgivingParseTimeToNumber;
7546
7583
  exports.formatNumberToTime = formatNumberToTime;
7584
+ exports.getTableSortableAttributes = getTableSortableAttributes;
7547
7585
  exports.hoursMinutesStringToMinutes = hoursMinutesStringToMinutes;
7548
7586
  exports.matchPropertyValue = matchPropertyValue;
7549
7587
  exports.minutesToHoursFloat = minutesToHoursFloat;