@fkui/vue 6.4.0 → 6.5.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.
@@ -4614,7 +4614,7 @@ const _hoisted_5$l = {
4614
4614
  const _hoisted_6$g = {
4615
4615
  class: "modal__header"
4616
4616
  };
4617
- const _hoisted_7$d = {
4617
+ const _hoisted_7$c = {
4618
4618
  key: 0,
4619
4619
  ref: "modalTitle",
4620
4620
  class: "modal__title",
@@ -4650,7 +4650,7 @@ function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
4650
4650
  }, [createElementVNode("div", _hoisted_4$q, [createElementVNode("div", _hoisted_5$l, [createElementVNode("div", _hoisted_6$g, [createElementVNode("div", {
4651
4651
  tabindex: "0",
4652
4652
  onFocus: _cache[0] || (_cache[0] = (...args) => _ctx.onFocusFirst && _ctx.onFocusFirst(...args))
4653
- }, null, 32), _cache[4] || (_cache[4] = createTextVNode()), _ctx.hasHeaderSlot ? (openBlock(), createElementBlock("h1", _hoisted_7$d, [renderSlot(_ctx.$slots, "header")], 512)) : createCommentVNode("", true)]), _cache[5] || (_cache[5] = createTextVNode()), createElementVNode("div", _hoisted_8$8, [renderSlot(_ctx.$slots, "content")], 512), _cache[6] || (_cache[6] = createTextVNode()), createElementVNode("div", _hoisted_9$6, [renderSlot(_ctx.$slots, "footer")])]), _cache[9] || (_cache[9] = createTextVNode()), createElementVNode("div", _hoisted_10$3, [createElementVNode("button", {
4653
+ }, null, 32), _cache[4] || (_cache[4] = createTextVNode()), _ctx.hasHeaderSlot ? (openBlock(), createElementBlock("h1", _hoisted_7$c, [renderSlot(_ctx.$slots, "header")], 512)) : createCommentVNode("", true)]), _cache[5] || (_cache[5] = createTextVNode()), createElementVNode("div", _hoisted_8$8, [renderSlot(_ctx.$slots, "content")], 512), _cache[6] || (_cache[6] = createTextVNode()), createElementVNode("div", _hoisted_9$6, [renderSlot(_ctx.$slots, "footer")])]), _cache[9] || (_cache[9] = createTextVNode()), createElementVNode("div", _hoisted_10$3, [createElementVNode("button", {
4654
4654
  type: "button",
4655
4655
  class: "close-button",
4656
4656
  "aria-label": _ctx.ariaCloseText,
@@ -4663,8 +4663,8 @@ function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
4663
4663
  }, null, 32)])])], 2)])], 32)])], 10, _hoisted_1$W)) : createCommentVNode("", true);
4664
4664
  }
4665
4665
  const FModal = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["render", _sfc_render$P]]);
4666
- function prepareButtonList(src, buttonOrder = config.buttonOrder) {
4667
- const list = src.map((it) => {
4666
+ function prepareButtonList(src) {
4667
+ return src.map((it) => {
4668
4668
  var _it$event, _ref, _it$reason, _it$type;
4669
4669
  return {
4670
4670
  label: it.label,
@@ -4675,12 +4675,6 @@ function prepareButtonList(src, buttonOrder = config.buttonOrder) {
4675
4675
  buttonType: it.submitButton ? "submit" : "button"
4676
4676
  };
4677
4677
  });
4678
- switch (buttonOrder) {
4679
- case FKUIConfigButtonOrder.LEFT_TO_RIGHT:
4680
- return list;
4681
- case FKUIConfigButtonOrder.RIGHT_TO_LEFT:
4682
- return list.reverse();
4683
- }
4684
4678
  }
4685
4679
  const defaultButtons = [{
4686
4680
  label: "Primärknapp",
@@ -4778,7 +4772,8 @@ const _sfc_main$1b = defineComponent({
4778
4772
  })],
4779
4773
  computed: {
4780
4774
  preparedButtons() {
4781
- return prepareButtonList(this.buttons);
4775
+ const preparedButtonList = prepareButtonList(this.buttons);
4776
+ return config.buttonOrder === FKUIConfigButtonOrder.RIGHT_TO_LEFT ? preparedButtonList.reverse() : preparedButtonList;
4782
4777
  }
4783
4778
  },
4784
4779
  methods: {
@@ -5567,7 +5562,7 @@ const _sfc_main$15 = defineComponent({
5567
5562
  },
5568
5563
  computed: {
5569
5564
  preparedButtons() {
5570
- return prepareButtonList(this.buttons, FKUIConfigButtonOrder.RIGHT_TO_LEFT);
5565
+ return prepareButtonList(this.buttons);
5571
5566
  }
5572
5567
  },
5573
5568
  methods: {
@@ -6356,7 +6351,7 @@ const _hoisted_6$e = {
6356
6351
  class: "calendar-month__cell calendar-month__cell--week-number",
6357
6352
  "aria-hidden": "true"
6358
6353
  };
6359
- const _hoisted_7$c = ["colspan"];
6354
+ const _hoisted_7$b = ["colspan"];
6360
6355
  const _hoisted_8$7 = ["colspan"];
6361
6356
  const _hoisted_9$5 = {
6362
6357
  key: 0,
@@ -6406,7 +6401,7 @@ function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
6406
6401
  key: 1,
6407
6402
  class: "calendar-month__cell",
6408
6403
  colspan: _ctx.getDayStartOffset(week.days)
6409
- }, null, 8, _hoisted_7$c)) : createCommentVNode("", true), _cache[18] || (_cache[18] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(week.days, (day) => {
6404
+ }, null, 8, _hoisted_7$b)) : createCommentVNode("", true), _cache[18] || (_cache[18] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(week.days, (day) => {
6410
6405
  return openBlock(), createElementBlock("td", {
6411
6406
  key: day.toString(),
6412
6407
  class: "calendar-month__cell",
@@ -9498,7 +9493,7 @@ const _hoisted_5$f = {
9498
9493
  const _hoisted_6$c = {
9499
9494
  key: 1
9500
9495
  };
9501
- const _hoisted_7$b = {
9496
+ const _hoisted_7$a = {
9502
9497
  ref: "tooltipAttachTo",
9503
9498
  class: "label"
9504
9499
  };
@@ -9529,7 +9524,7 @@ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
9529
9524
  name: "error"
9530
9525
  }), createTextVNode(" " + toDisplayString(_ctx.validity.validationMessage), 1)])) : createCommentVNode("", true)])], 2)), _cache[7] || (_cache[7] = createTextVNode()), _ctx.hasCheckbox ? (openBlock(), createElementBlock("span", _hoisted_4$j, [_ctx.children.length === 1 ? (openBlock(), createElementBlock("span", _hoisted_5$f, toDisplayString(_ctx.checkboxCheckedScreenReaderText), 1)) : (openBlock(), createElementBlock("span", _hoisted_6$c, toDisplayString(_ctx.numberOfCheckedCheckboxesScreenText), 1))])) : createCommentVNode("", true), _cache[8] || (_cache[8] = createTextVNode()), _ctx.hasTooltipSlot ? (openBlock(), createElementBlock(Fragment, {
9531
9526
  key: 1
9532
- }, [createElementVNode("div", _hoisted_7$b, [createElementVNode("span", _hoisted_8$6, [renderSlot(_ctx.$slots, "label")])], 512), _cache[5] || (_cache[5] = createTextVNode()), renderSlot(_ctx.$slots, "tooltip"), _cache[6] || (_cache[6] = createTextVNode()), _ctx.hasDescriptionSlot || _ctx.hasErrorMessageSlot || _ctx.hasError ? (openBlock(), createElementBlock("div", {
9527
+ }, [createElementVNode("div", _hoisted_7$a, [createElementVNode("span", _hoisted_8$6, [renderSlot(_ctx.$slots, "label")])], 512), _cache[5] || (_cache[5] = createTextVNode()), renderSlot(_ctx.$slots, "tooltip"), _cache[6] || (_cache[6] = createTextVNode()), _ctx.hasDescriptionSlot || _ctx.hasErrorMessageSlot || _ctx.hasError ? (openBlock(), createElementBlock("div", {
9533
9528
  key: 0,
9534
9529
  class: normalizeClass(["label", _ctx.groupLabelClass]),
9535
9530
  "aria-hidden": "true"
@@ -11047,13 +11042,19 @@ var FTableColumnSort = /* @__PURE__ */ ((FTableColumnSort2) => {
11047
11042
  return FTableColumnSort2;
11048
11043
  })(FTableColumnSort || {});
11049
11044
  function addColumn(src, column) {
11050
- if (!src.some((col) => col.name === column.name)) {
11045
+ if (column.name) {
11046
+ const hasDuplicateName = src.some((it) => it.name === column.name);
11047
+ if (hasDuplicateName) {
11048
+ throw new Error(`Expected FTableColumn to have a unique name but encountered duplicate of "${column.name}"`);
11049
+ }
11050
+ }
11051
+ if (!src.some((col) => col.id === column.id)) {
11051
11052
  return [...src, column];
11052
11053
  }
11053
11054
  return src;
11054
11055
  }
11055
11056
  function setVisibilityColumn(src, id, visible) {
11056
- const column = src.find((col) => col.name === id);
11057
+ const column = src.find((col) => col.id === id);
11057
11058
  if (column) {
11058
11059
  column.visible = visible;
11059
11060
  }
@@ -11112,14 +11113,14 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
11112
11113
  __name: "FTableColumn",
11113
11114
  props: {
11114
11115
  /**
11115
- * Unique (per-table) identifier.
11116
+ * Unique (per-table) identifier. Typically set to the row
11117
+ * property displayed but any unique string can be used.
11116
11118
  *
11117
- * Typically set to the row property displayed but any unique string can
11118
- * be used.
11119
+ * Only required when used with `FSortFilterDataset`.
11119
11120
  */
11120
11121
  name: {
11121
11122
  type: String,
11122
- required: true
11123
+ default: void 0
11123
11124
  },
11124
11125
  /**
11125
11126
  * If set to true, display the column, set to false to hide it.
@@ -11202,6 +11203,10 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
11202
11203
  setVisibilityColumn: setVisibilityColumn2,
11203
11204
  addColumn: addColumn2
11204
11205
  } = FTableInjected();
11206
+ const internalVisible = ref(true);
11207
+ const renderElement = ref(true);
11208
+ const id = ElementIdService.generateElementId("column");
11209
+ const el = useTemplateRef("element");
11205
11210
  const props = __props;
11206
11211
  const classes = computed(() => {
11207
11212
  return ["table__column", `table__column--${props.type}`];
@@ -11216,33 +11221,51 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
11216
11221
  return "td";
11217
11222
  }
11218
11223
  });
11219
- watch(() => props.visible, () => setVisibilityColumn2(props.name, props.visible));
11224
+ watch(() => props.visible, () => {
11225
+ internalVisible.value = props.visible;
11226
+ setVisibilityColumn2(id, props.visible);
11227
+ });
11220
11228
  onMounted(() => {
11221
11229
  if (props.shrink && props.expand) {
11222
11230
  throw new Error("Table cannot have both shrink and expand enabled at the same time");
11223
11231
  }
11224
11232
  const size = props.shrink ? FTableColumnSize.SHRINK : FTableColumnSize.EXPAND;
11225
- addColumn2({
11226
- name: props.name,
11227
- title: props.title,
11228
- description: props.description || void 0,
11229
- id: ElementIdService.generateElementId("column"),
11230
- size,
11231
- type: props.type,
11232
- visible: props.visible,
11233
- sortable: false,
11234
- sort: FTableColumnSort.UNSORTED
11235
- });
11233
+ const header = isHeader();
11234
+ if (header) {
11235
+ addColumn2({
11236
+ name: props.name,
11237
+ title: props.title,
11238
+ description: props.description || void 0,
11239
+ id,
11240
+ size,
11241
+ type: props.type,
11242
+ visible: props.visible,
11243
+ sortable: false,
11244
+ sort: FTableColumnSort.UNSORTED
11245
+ });
11246
+ }
11247
+ renderElement.value = renderColumns && !header;
11248
+ internalVisible.value = props.visible;
11236
11249
  });
11250
+ function isHeader() {
11251
+ if (!el.value || !(el.value instanceof HTMLElement)) {
11252
+ return false;
11253
+ }
11254
+ const closest = el.value.closest("thead, tbody");
11255
+ return (closest == null ? void 0 : closest.tagName) === "THEAD";
11256
+ }
11237
11257
  return (_ctx, _cache) => {
11238
- return unref(renderColumns) && __props.visible ? (openBlock(), createBlock(resolveDynamicComponent(tagName2.value), mergeProps({
11258
+ return renderElement.value && internalVisible.value ? (openBlock(), createBlock(resolveDynamicComponent(tagName2.value), mergeProps({
11239
11259
  key: 0,
11260
+ ref: "element",
11240
11261
  class: classes.value,
11241
11262
  scope: scope.value
11242
11263
  }, _ctx.$attrs), {
11243
- default: withCtx(() => [renderSlot(_ctx.$slots, "default"), _cache[0] || (_cache[0] = createTextVNode()), _cache[1] || (_cache[1] = createElementVNode("span", {
11264
+ default: withCtx(() => [unref(renderColumns) ? (openBlock(), createElementBlock(Fragment, {
11265
+ key: 0
11266
+ }, [renderSlot(_ctx.$slots, "default"), _cache[0] || (_cache[0] = createTextVNode()), _cache[1] || (_cache[1] = createElementVNode("span", {
11244
11267
  class: "sr-only"
11245
- }, " ", -1))]),
11268
+ }, " ", -1))], 64)) : createCommentVNode("", true)]),
11246
11269
  _: 3
11247
11270
  }, 16, ["class", "scope"])) : createCommentVNode("", true);
11248
11271
  };
@@ -11308,7 +11331,7 @@ const _hoisted_5$d = {
11308
11331
  class: "label__message label__message--error"
11309
11332
  };
11310
11333
  const _hoisted_6$b = ["for"];
11311
- const _hoisted_7$a = {
11334
+ const _hoisted_7$9 = {
11312
11335
  key: 0,
11313
11336
  class: "label__message label__message--error"
11314
11337
  };
@@ -11334,7 +11357,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
11334
11357
  }, [renderSlot(_ctx.$slots, "default"), _cache[5] || (_cache[5] = createTextVNode()), renderSlot(_ctx.$slots, "description", {
11335
11358
  descriptionClass: _ctx.descriptionClass,
11336
11359
  formatDescriptionClass: _ctx.formatDescriptionClass
11337
- }), _cache[6] || (_cache[6] = createTextVNode()), _ctx.hasErrorMessageSlot ? (openBlock(), createElementBlock("span", _hoisted_7$a, [createVNode(_component_f_icon, {
11360
+ }), _cache[6] || (_cache[6] = createTextVNode()), _ctx.hasErrorMessageSlot ? (openBlock(), createElementBlock("span", _hoisted_7$9, [createVNode(_component_f_icon, {
11338
11361
  class: "label__icon--left",
11339
11362
  name: "error"
11340
11363
  }), _cache[4] || (_cache[4] = createTextVNode()), renderSlot(_ctx.$slots, "error-message")])) : createCommentVNode("", true)], 8, _hoisted_6$b));
@@ -11924,7 +11947,7 @@ const _hoisted_6$a = {
11924
11947
  key: 2,
11925
11948
  class: "text-field__append-inner"
11926
11949
  };
11927
- const _hoisted_7$9 = {
11950
+ const _hoisted_7$8 = {
11928
11951
  key: 3,
11929
11952
  class: "text-field__append-inner"
11930
11953
  };
@@ -11994,7 +12017,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
11994
12017
  "is-open": _ctx.showPopupError,
11995
12018
  "error-message": _ctx.validationMessage,
11996
12019
  onClose: _ctx.closePopupError
11997
- }, null, 8, ["anchor", "is-open", "error-message", "onClose"])) : createCommentVNode("", true), _cache[15] || (_cache[15] = createTextVNode()), _ctx.$slots["append-inner"] ? (openBlock(), createElementBlock("div", _hoisted_6$a, [renderSlot(_ctx.$slots, "append-inner")])) : createCommentVNode("", true), _cache[16] || (_cache[16] = createTextVNode()), _ctx.options ? (openBlock(), createElementBlock("div", _hoisted_7$9, [createVNode(_component_i_combobox_toggle_button, {
12020
+ }, null, 8, ["anchor", "is-open", "error-message", "onClose"])) : createCommentVNode("", true), _cache[15] || (_cache[15] = createTextVNode()), _ctx.$slots["append-inner"] ? (openBlock(), createElementBlock("div", _hoisted_6$a, [renderSlot(_ctx.$slots, "append-inner")])) : createCommentVNode("", true), _cache[16] || (_cache[16] = createTextVNode()), _ctx.options ? (openBlock(), createElementBlock("div", _hoisted_7$8, [createVNode(_component_i_combobox_toggle_button, {
11998
12021
  disabled: _ctx.disabled,
11999
12022
  "aria-controls": _ctx.dropdownIsOpen ? _ctx.dropdownId : void 0,
12000
12023
  "aria-expanded": _ctx.dropdownIsOpen,
@@ -12849,13 +12872,7 @@ const _hoisted_4$e = ["title"];
12849
12872
  const _hoisted_5$b = {
12850
12873
  class: "sr-only"
12851
12874
  };
12852
- const _hoisted_6$9 = {
12853
- value: {
12854
- attribute: "",
12855
- ascending: false
12856
- }
12857
- };
12858
- const _hoisted_7$8 = ["value"];
12875
+ const _hoisted_6$9 = ["value"];
12859
12876
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
12860
12877
  __name: "FSortFilterDataset",
12861
12878
  props: {
@@ -12923,13 +12940,14 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
12923
12940
  }) {
12924
12941
  const $t2 = useTranslate();
12925
12942
  const searchString = ref("");
12926
- const sortAttribute = ref({
12943
+ const defaultSortValue = {
12927
12944
  attribute: "",
12928
12945
  name: "",
12929
12946
  ascendingName: "",
12930
12947
  ascending: false,
12931
12948
  id: 0
12932
- });
12949
+ };
12950
+ const sortAttribute = ref(defaultSortValue);
12933
12951
  const sortFilterResult = ref([]);
12934
12952
  const debouncedFilterResultset = debounce(filterResultset, 250);
12935
12953
  let tableCallbackOnSort = () => {
@@ -13104,11 +13122,13 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
13104
13122
  onChange: onChangeSortAttribute
13105
13123
  }, {
13106
13124
  label: withCtx(() => [createTextVNode(toDisplayString(unref($t2)("fkui.sort-filter-dataset.label.sort", "Sortera på")), 1)]),
13107
- default: withCtx(() => [_cache[5] || (_cache[5] = createTextVNode()), createElementVNode("option", _hoisted_6$9, toDisplayString(unref($t2)("fkui.sort-filter-dataset.label.unsorted", "Välj")), 1), _cache[6] || (_cache[6] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(sortOrders.value, (sortOrder) => {
13125
+ default: withCtx(() => [_cache[5] || (_cache[5] = createTextVNode()), createElementVNode("option", {
13126
+ value: defaultSortValue
13127
+ }, toDisplayString(unref($t2)("fkui.sort-filter-dataset.label.unsorted", "Välj")), 1), _cache[6] || (_cache[6] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(sortOrders.value, (sortOrder) => {
13108
13128
  return openBlock(), createElementBlock("option", {
13109
13129
  key: sortOrder.id,
13110
13130
  value: sortOrder
13111
- }, toDisplayString(sortOrder.name) + " (" + toDisplayString(sortOrder.ascendingName) + ")\n ", 9, _hoisted_7$8);
13131
+ }, toDisplayString(sortOrder.name) + " (" + toDisplayString(sortOrder.ascendingName) + ")\n ", 9, _hoisted_6$9);
13112
13132
  }), 128))]),
13113
13133
  _: 1
13114
13134
  }, 8, ["modelValue"])]),
@@ -13276,6 +13296,9 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
13276
13296
  return;
13277
13297
  }
13278
13298
  let columnName = column.name;
13299
+ if (!columnName) {
13300
+ throw new Error("`FTableColumn` must have a unique `name` when used with `FSortFilterDataset`");
13301
+ }
13279
13302
  if (column.sort === FTableColumnSort.DESCENDING) {
13280
13303
  columnName = "";
13281
13304
  column.sort = FTableColumnSort.UNSORTED;
@@ -13297,12 +13320,14 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
13297
13320
  }, [createElementVNode("table", mergeProps({
13298
13321
  class: ["table", tableClasses.value],
13299
13322
  tabindex: tabindex.value
13300
- }, _ctx.$attrs), [hasCaption.value ? (openBlock(), createElementBlock("caption", _hoisted_2$l, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), createElementVNode("colgroup", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
13323
+ }, _ctx.$attrs), [hasCaption.value ? (openBlock(), createElementBlock("caption", _hoisted_2$l, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[5] || (_cache[5] = createTextVNode()), createElementVNode("colgroup", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
13301
13324
  return openBlock(), createElementBlock("col", {
13302
13325
  key: column.id,
13303
13326
  class: normalizeClass(column.size)
13304
13327
  }, null, 2);
13305
- }), 128))]), _cache[5] || (_cache[5] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_3$h, [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (column) => {
13328
+ }), 128))]), _cache[6] || (_cache[6] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_3$h, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
13329
+ row: {}
13330
+ }))), _cache[2] || (_cache[2] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (column) => {
13306
13331
  return openBlock(), createElementBlock("th", mergeProps({
13307
13332
  key: column.id,
13308
13333
  scope: "col",
@@ -13316,12 +13341,12 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
13316
13341
  class: normalizeClass(iconClasses2(column)),
13317
13342
  name: iconName(column)
13318
13343
  }, null, 8, ["class", "name"])) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), column.description ? (openBlock(), createElementBlock("span", _hoisted_5$a, toDisplayString(column.description), 1)) : createCommentVNode("", true)], 16);
13319
- }), 128))])]), _cache[6] || (_cache[6] = createTextVNode()), createElementVNode("tbody", null, [isEmpty2.value && columns.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_6$8, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
13344
+ }), 128))])]), _cache[7] || (_cache[7] = createTextVNode()), createElementVNode("tbody", null, [isEmpty2.value && columns.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_6$8, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
13320
13345
  row: {}
13321
- })))])) : createCommentVNode("", true), _cache[2] || (_cache[2] = createTextVNode()), isEmpty2.value ? (openBlock(), createElementBlock("tr", _hoisted_7$7, [createElementVNode("td", {
13346
+ })))])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), isEmpty2.value ? (openBlock(), createElementBlock("tr", _hoisted_7$7, [createElementVNode("td", {
13322
13347
  class: "table__column table__column--action",
13323
13348
  colspan: columns.value.length
13324
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref($t2)("fkui.data-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_8$5)])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(internalRows.value, (row) => {
13349
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref($t2)("fkui.data-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_8$5)])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(internalRows.value, (row) => {
13325
13350
  return openBlock(), createElementBlock("tr", {
13326
13351
  key: rowKey(row),
13327
13352
  class: "table__row"
@@ -14682,7 +14707,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
14682
14707
  expandableRows,
14683
14708
  hasExpandableContent
14684
14709
  } = expandableTable;
14685
- const tbodyElement = useTemplateRef("tbodyElement");
14710
+ const tbody = useTemplateRef("tbodyElement");
14686
14711
  const hasCaption = computed(() => {
14687
14712
  return hasSlot2("caption", {}, {
14688
14713
  stripClasses: []
@@ -14764,21 +14789,21 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
14764
14789
  immediate: true,
14765
14790
  deep: true
14766
14791
  });
14767
- function updateTr(tbodyElement2) {
14768
- const trElements = [].slice.call(tbodyElement2.children);
14792
+ function updateTr(tbodyElement) {
14793
+ const trElements = [].slice.call(tbodyElement.children);
14769
14794
  const trInteractableElements = trElements.filter((tr2) => {
14770
14795
  return tr2.tabIndex === 0;
14771
14796
  });
14772
14797
  tr.value = trInteractableElements;
14773
14798
  }
14774
14799
  onUpdated(() => {
14775
- if (tbodyElement.value) {
14776
- updateTr(tbodyElement.value);
14800
+ if (tbody.value) {
14801
+ updateTr(tbody.value);
14777
14802
  }
14778
14803
  });
14779
14804
  onMounted(() => {
14780
- if (tbodyElement.value) {
14781
- updateTr(tbodyElement.value);
14805
+ if (tbody.value) {
14806
+ updateTr(tbody.value);
14782
14807
  }
14783
14808
  registerCallbackOnSort(callbackOnSort);
14784
14809
  registerCallbackOnMount(callbackSortableColumns);
@@ -14892,6 +14917,9 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
14892
14917
  return;
14893
14918
  }
14894
14919
  let columnName = column.name;
14920
+ if (!columnName) {
14921
+ throw new Error("`FTableColumn` must have a unique `name` when used with `FSortFilterDataset`");
14922
+ }
14895
14923
  if (column.sort === FTableColumnSort.DESCENDING) {
14896
14924
  columnName = "";
14897
14925
  column.sort = FTableColumnSort.UNSORTED;
@@ -14936,15 +14964,17 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
14936
14964
  return (_ctx, _cache) => {
14937
14965
  return openBlock(), createElementBlock("div", {
14938
14966
  class: normalizeClass(wrapperClasses.value)
14939
- }, [createCommentVNode("", true), _cache[18] || (_cache[18] = createTextVNode()), createElementVNode("table", mergeProps({
14967
+ }, [createCommentVNode("", true), _cache[19] || (_cache[19] = createTextVNode()), createElementVNode("table", mergeProps({
14940
14968
  class: ["table", tableClasses.value],
14941
14969
  role: tableRole.value
14942
- }, _ctx.$attrs), [hasCaption.value ? (openBlock(), createElementBlock("caption", _hoisted_2$e, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[15] || (_cache[15] = createTextVNode()), createElementVNode("colgroup", null, [unref(isExpandableTable) ? (openBlock(), createElementBlock("col", _hoisted_3$a)) : createCommentVNode("", true), _cache[0] || (_cache[0] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("col", _hoisted_4$8)) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
14970
+ }, _ctx.$attrs), [hasCaption.value ? (openBlock(), createElementBlock("caption", _hoisted_2$e, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[16] || (_cache[16] = createTextVNode()), createElementVNode("colgroup", null, [unref(isExpandableTable) ? (openBlock(), createElementBlock("col", _hoisted_3$a)) : createCommentVNode("", true), _cache[0] || (_cache[0] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("col", _hoisted_4$8)) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
14943
14971
  return openBlock(), createElementBlock("col", {
14944
14972
  key: column.id,
14945
14973
  class: normalizeClass(column.size)
14946
14974
  }, null, 2);
14947
- }), 128))]), _cache[16] || (_cache[16] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_5$6, [unref(isExpandableTable) ? (openBlock(), createElementBlock("th", _hoisted_6$4, [createElementVNode("span", _hoisted_7$3, toDisplayString(unref($t2)("fkui.interactive-table.select", "Expandera")), 1)])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("th", _hoisted_8$3, [createElementVNode("span", _hoisted_9$3, toDisplayString(unref($t2)("fkui.interactive-table.select", "Markera")), 1)])) : createCommentVNode("", true), _cache[5] || (_cache[5] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (column) => {
14975
+ }), 128))]), _cache[17] || (_cache[17] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_5$6, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
14976
+ row: {}
14977
+ }))), _cache[4] || (_cache[4] = createTextVNode()), unref(isExpandableTable) ? (openBlock(), createElementBlock("th", _hoisted_6$4, [createElementVNode("span", _hoisted_7$3, toDisplayString(unref($t2)("fkui.interactive-table.select", "Expandera")), 1)])) : createCommentVNode("", true), _cache[5] || (_cache[5] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("th", _hoisted_8$3, [createElementVNode("span", _hoisted_9$3, toDisplayString(unref($t2)("fkui.interactive-table.select", "Markera")), 1)])) : createCommentVNode("", true), _cache[6] || (_cache[6] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (column) => {
14948
14978
  return openBlock(), createElementBlock("th", mergeProps({
14949
14979
  key: column.id,
14950
14980
  scope: "col",
@@ -14958,9 +14988,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
14958
14988
  class: normalizeClass(iconClasses2(column)),
14959
14989
  name: iconName(column)
14960
14990
  }, null, 8, ["class", "name"])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), column.description ? (openBlock(), createElementBlock("span", _hoisted_11$1, toDisplayString(column.description), 1)) : createCommentVNode("", true)], 16);
14961
- }), 128))])]), _cache[17] || (_cache[17] = createTextVNode()), (openBlock(), createElementBlock("tbody", {
14962
- ref_key: "tbodyElement",
14963
- ref: tbodyElement,
14991
+ }), 128))])]), _cache[18] || (_cache[18] = createTextVNode()), (openBlock(), createElementBlock("tbody", {
14992
+ ref: "tbodyElement",
14964
14993
  key: tbodyKey.value
14965
14994
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(internalRows.value, (row, index) => {
14966
14995
  return openBlock(), createElementBlock(Fragment, {
@@ -14977,7 +15006,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
14977
15006
  }, [unref(isExpandableTable) ? (openBlock(), createElementBlock("td", _hoisted_13, [unref(hasExpandableContent)(row) ? (openBlock(), createElementBlock("div", _hoisted_14, [createVNode(unref(FIcon), {
14978
15007
  name: "arrow-right",
14979
15008
  rotate: unref(isExpanded)(row) ? "270" : "90"
14980
- }, null, 8, ["rotate"])])) : createCommentVNode("", true)])) : createCommentVNode("", true), _cache[6] || (_cache[6] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("td", _hoisted_15, [createElementVNode("div", _hoisted_16, [createVNode(unref(FCheckboxField), {
15009
+ }, null, 8, ["rotate"])])) : createCommentVNode("", true)])) : createCommentVNode("", true), _cache[7] || (_cache[7] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("td", _hoisted_15, [createElementVNode("div", _hoisted_16, [createVNode(unref(FCheckboxField), {
14981
15010
  value: true,
14982
15011
  "model-value": isSelected(row),
14983
15012
  onClick: withModifiers(($event) => onSelect(row), ["self"])
@@ -14988,20 +15017,20 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
14988
15017
  row
14989
15018
  }))])) : createCommentVNode("", true)]),
14990
15019
  _: 2
14991
- }, 1032, ["model-value", "onClick"])])])) : createCommentVNode("", true), _cache[7] || (_cache[7] = createTextVNode()), renderSlot(_ctx.$slots, "default", mergeProps({
15020
+ }, 1032, ["model-value", "onClick"])])])) : createCommentVNode("", true), _cache[8] || (_cache[8] = createTextVNode()), renderSlot(_ctx.$slots, "default", mergeProps({
14992
15021
  ref_for: true
14993
15022
  }, {
14994
15023
  row
14995
- }))], 42, _hoisted_12$1), _cache[11] || (_cache[11] = createTextVNode()), unref(isExpandableTable) && unref(hasExpandableContent)(row) ? (openBlock(true), createElementBlock(Fragment, {
15024
+ }))], 42, _hoisted_12$1), _cache[12] || (_cache[12] = createTextVNode()), unref(isExpandableTable) && unref(hasExpandableContent)(row) ? (openBlock(true), createElementBlock(Fragment, {
14996
15025
  key: 0
14997
15026
  }, renderList(unref(expandableRows)(row), (expandableRow, expandableIndex) => {
14998
15027
  return openBlock(), createElementBlock("tr", {
14999
15028
  key: rowKey(expandableRow),
15000
15029
  "aria-level": "2",
15001
15030
  class: normalizeClass(unref(expandableRowClasses)(row, expandableIndex))
15002
- }, [_cache[8] || (_cache[8] = createElementVNode("td", {
15031
+ }, [_cache[9] || (_cache[9] = createElementVNode("td", {
15003
15032
  class: "table__column--placeholder"
15004
- }, null, -1)), _cache[9] || (_cache[9] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("td", _hoisted_18)) : createCommentVNode("", true), _cache[10] || (_cache[10] = createTextVNode()), !unref(hasExpandableSlot) ? renderSlot(_ctx.$slots, "default", mergeProps({
15033
+ }, null, -1)), _cache[10] || (_cache[10] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("td", _hoisted_18)) : createCommentVNode("", true), _cache[11] || (_cache[11] = createTextVNode()), !unref(hasExpandableSlot) ? renderSlot(_ctx.$slots, "default", mergeProps({
15005
15034
  key: 1,
15006
15035
  ref_for: true
15007
15036
  }, {
@@ -15017,12 +15046,12 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
15017
15046
  parentRow: row
15018
15047
  }))], 8, _hoisted_19))], 2);
15019
15048
  }), 128)) : createCommentVNode("", true)], 64);
15020
- }), 128)), _cache[13] || (_cache[13] = createTextVNode()), isEmpty2.value && columns.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_20, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
15049
+ }), 128)), _cache[14] || (_cache[14] = createTextVNode()), isEmpty2.value && columns.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_20, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
15021
15050
  row: {}
15022
- })))])) : createCommentVNode("", true), _cache[14] || (_cache[14] = createTextVNode()), isEmpty2.value ? (openBlock(), createElementBlock("tr", _hoisted_21, [createElementVNode("td", {
15051
+ })))])) : createCommentVNode("", true), _cache[15] || (_cache[15] = createTextVNode()), isEmpty2.value ? (openBlock(), createElementBlock("tr", _hoisted_21, [createElementVNode("td", {
15023
15052
  class: "table__column table__column--action",
15024
15053
  colspan: nbOfColumns.value
15025
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref($t2)("fkui.interactive-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_22), _cache[12] || (_cache[12] = createTextVNode()), renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
15054
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref($t2)("fkui.interactive-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_22), _cache[13] || (_cache[13] = createTextVNode()), renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
15026
15055
  row: {}
15027
15056
  })))])) : createCommentVNode("", true)]))], 16, _hoisted_1$k)], 2);
15028
15057
  };