@fkui/vue-labs 6.39.0 → 6.40.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.
@@ -1,4 +1,4 @@
1
- import { nextTick, toValue, defineComponent, useTemplateRef, computed, openBlock, createElementBlock, createElementVNode, createVNode, unref, renderSlot, withModifiers, normalizeClass, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, ref, inject, withDirectives, vShow, onMounted, watchEffect, mergeProps, vModelText, toRef, watch, onUpdated, useModel, useSlots, provide, Fragment, renderList, resolveDynamicComponent, mergeModels, resolveDirective, normalizeProps, guardReactiveProps } from "vue";
1
+ import { defineComponent, useTemplateRef, computed, openBlock, createElementBlock, createElementVNode, createVNode, unref, renderSlot, withModifiers, normalizeClass, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, ref, nextTick, toValue, inject, withDirectives, vShow, onMounted, watchEffect, mergeProps, vModelText, toRef, watch, onUpdated, useModel, useSlots, provide, Fragment, renderList, resolveDynamicComponent, mergeModels, resolveDirective, normalizeProps, guardReactiveProps } from "vue";
2
2
  import { assertRef, formatPostalCode, parsePlusgiro, parseNumber, formatNumber, parseOrganisationsnummer, parseDate, parseClearingNumber, parseBankgiro, parseBankAccountNumber, parsePersonnummer, formatPersonnummer, ElementIdService, assertSet, ValidationService, alertScreenReader, debounce, isEmpty, stripWhitespace, isSet, TranslationService } from "@fkui/logic";
3
3
  import { FIcon, IFlex, IFlexItem, useTranslate, getItemIdentifier, FContextMenu, IComboboxDropdown, IPopupError, dispatchComponentValidityEvent, findItemIdentifier, useSlotUtils, setItemIdentifiers, FSortFilterDatasetInjected, EventBus, FFileSelector, FFileItem, TranslationMixin, FTextField, useTextFieldSetup } from "@fkui/vue";
4
4
  import { useElementHover, useFocusWithin, useEventListener } from "@vueuse/core";
@@ -416,10 +416,10 @@ function requireSharedStore() {
416
416
  var SHARED = "__core-js_shared__";
417
417
  var store = sharedStore.exports = globalThis2[SHARED] || defineGlobalProperty2(SHARED, {});
418
418
  (store.versions || (store.versions = [])).push({
419
- version: "3.48.0",
419
+ version: "3.49.0",
420
420
  mode: IS_PURE ? "pure" : "global",
421
421
  copyright: "© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",
422
- license: "https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE",
422
+ license: "https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",
423
423
  source: "https://github.com/zloirock/core-js"
424
424
  });
425
425
  return sharedStore.exports;
@@ -1362,15 +1362,17 @@ function requireIterate() {
1362
1362
  var fn = bind(unboundFunction, that);
1363
1363
  var iterator, iterFn, index, length, result, next, step;
1364
1364
  var stop = function(condition) {
1365
- if (iterator) iteratorClose2(iterator, "normal");
1365
+ var $iterator = iterator;
1366
+ iterator = void 0;
1367
+ if ($iterator) iteratorClose2($iterator, "normal");
1366
1368
  return new Result(true, condition);
1367
1369
  };
1368
- var callFn = function(value) {
1370
+ var callFn = function(value2) {
1369
1371
  if (AS_ENTRIES) {
1370
- anObject2(value);
1371
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
1372
+ anObject2(value2);
1373
+ return INTERRUPTED ? fn(value2[0], value2[1], stop) : fn(value2[0], value2[1]);
1372
1374
  }
1373
- return INTERRUPTED ? fn(value, stop) : fn(value);
1375
+ return INTERRUPTED ? fn(value2, stop) : fn(value2);
1374
1376
  };
1375
1377
  if (IS_RECORD) {
1376
1378
  iterator = iterable.iterator;
@@ -1390,10 +1392,12 @@ function requireIterate() {
1390
1392
  }
1391
1393
  next = IS_RECORD ? iterable.next : iterator.next;
1392
1394
  while (!(step = call(next, iterator)).done) {
1395
+ var value = step.value;
1393
1396
  try {
1394
- result = callFn(step.value);
1397
+ result = callFn(value);
1395
1398
  } catch (error) {
1396
- iteratorClose2(iterator, "throw", error);
1399
+ if (iterator) iteratorClose2(iterator, "throw", error);
1400
+ else throw error;
1397
1401
  }
1398
1402
  if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result)) return result;
1399
1403
  }
@@ -1867,11 +1871,13 @@ function requireIteratorCreateProxy() {
1867
1871
  "return": function() {
1868
1872
  var state = getInternalState(this);
1869
1873
  var iterator = state.iterator;
1874
+ var done = state.done;
1870
1875
  state.done = true;
1871
1876
  if (IS_ITERATOR) {
1872
1877
  var returnMethod = getMethod2(iterator, "return");
1873
1878
  return returnMethod ? call(returnMethod, iterator) : createIterResultObject2(void 0, true);
1874
1879
  }
1880
+ if (done) return createIterResultObject2(void 0, true);
1875
1881
  if (state.inner) try {
1876
1882
  iteratorClose2(state.inner.iterator, NORMAL);
1877
1883
  } catch (error) {
@@ -1880,7 +1886,8 @@ function requireIteratorCreateProxy() {
1880
1886
  if (state.openIters) try {
1881
1887
  iteratorCloseAll2(state.openIters, NORMAL);
1882
1888
  } catch (error) {
1883
- return iteratorClose2(iterator, THROW, error);
1889
+ if (iterator) return iteratorClose2(iterator, THROW, error);
1890
+ throw error;
1884
1891
  }
1885
1892
  if (iterator) iteratorClose2(iterator, NORMAL);
1886
1893
  return createIterResultObject2(void 0, true);
@@ -2164,7 +2171,7 @@ function requireSetDifference() {
2164
2171
  var O = aSet2(this);
2165
2172
  var otherRec = getSetRecord2(other);
2166
2173
  var result = clone(O);
2167
- if (size(O) <= otherRec.size) iterateSet(O, function(e) {
2174
+ if (size(result) <= otherRec.size) iterateSet(result, function(e) {
2168
2175
  if (otherRec.includes(e)) remove(result, e);
2169
2176
  });
2170
2177
  else iterateSimple2(otherRec.getIterator(), function(e) {
@@ -2353,7 +2360,7 @@ function requireSetIsDisjointFrom() {
2353
2360
  }, true) !== false;
2354
2361
  var iterator = otherRec.getIterator();
2355
2362
  return iterateSimple2(iterator, function(e) {
2356
- if (has(O, e)) return iteratorClose2(iterator, "normal", false);
2363
+ if (has(O, e)) return iteratorClose2(iterator.iterator, "normal", false);
2357
2364
  }) !== false;
2358
2365
  };
2359
2366
  return setIsDisjointFrom;
@@ -2438,7 +2445,7 @@ function requireSetIsSupersetOf() {
2438
2445
  if (size(O) < otherRec.size) return false;
2439
2446
  var iterator = otherRec.getIterator();
2440
2447
  return iterateSimple2(iterator, function(e) {
2441
- if (!has(O, e)) return iteratorClose2(iterator, "normal", false);
2448
+ if (!has(O, e)) return iteratorClose2(iterator.iterator, "normal", false);
2442
2449
  }) !== false;
2443
2450
  };
2444
2451
  return setIsSupersetOf;
@@ -2587,252 +2594,12 @@ function requireEs_set_union_v2() {
2587
2594
  return es_set_union_v2;
2588
2595
  }
2589
2596
  requireEs_set_union_v2();
2590
- function isFTableCellApi(value) {
2591
- return value !== null && typeof value === "object" && Boolean(value.tabstopEl);
2592
- }
2593
- const tableCellApiSymbol = /* @__PURE__ */ Symbol("table:cell-api");
2594
- const navKeys = /* @__PURE__ */ new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"]);
2595
- let prevCellIndex = void 0;
2596
- function getCellTarget(tableElement, rowIndex, cellIndex) {
2597
- return tableElement.rows[rowIndex].cells[cellIndex];
2598
- }
2599
- function getTr(td) {
2600
- return td.parentElement;
2601
- }
2602
- function getTable(tr) {
2603
- return tr.closest("table");
2604
- }
2605
- function getLastRowIndex(tableElement) {
2606
- return tableElement.rows.length - 1;
2607
- }
2608
- function getLastCellIndex(tableElement) {
2609
- return tableElement.rows[0].cells.length - 1;
2610
- }
2611
- function getVerticalNavIndex(table, from, to) {
2612
- const target = {
2613
- ...to
2614
- };
2615
- const currentMax = table.rows[from.row].cells.length - 1;
2616
- const targetMax = table.rows[to.row].cells.length - 1;
2617
- if (prevCellIndex && currentMax < targetMax) {
2618
- target.cell = prevCellIndex;
2619
- prevCellIndex = void 0;
2620
- } else {
2621
- target.cell = Math.min(targetMax, from.cell);
2622
- }
2623
- if (targetMax < from.cell) {
2624
- prevCellIndex = from.cell;
2625
- }
2626
- return target;
2627
- }
2628
- function isDefined(value) {
2629
- return value.row !== void 0 && value.cell !== void 0;
2630
- }
2631
- function navigate(e, table, from, last) {
2632
- if (!isDefined(from) || !isDefined(last)) {
2633
- return;
2634
- }
2635
- if (!navKeys.has(e.code)) {
2636
- return;
2637
- }
2638
- e.preventDefault();
2639
- if (e.code === "ArrowLeft") {
2640
- if (from.cell === 0) {
2641
- return;
2642
- }
2643
- prevCellIndex = void 0;
2644
- return {
2645
- row: from.row,
2646
- cell: from.cell - 1
2647
- };
2648
- }
2649
- if (e.code === "ArrowRight") {
2650
- if (from.cell === last.cell) {
2651
- return;
2652
- }
2653
- const lastCellIndex = table.rows[from.row].cells.length - 1;
2654
- if (lastCellIndex <= from.cell) {
2655
- return;
2656
- }
2657
- prevCellIndex = void 0;
2658
- return {
2659
- row: from.row,
2660
- cell: from.cell + 1
2661
- };
2662
- }
2663
- if (e.code === "ArrowUp") {
2664
- if (from.row === 0) {
2665
- return;
2666
- }
2667
- const to = {
2668
- row: from.row - 1,
2669
- cell: from.cell
2670
- };
2671
- return getVerticalNavIndex(table, from, to);
2672
- }
2673
- if (e.code === "ArrowDown") {
2674
- if (from.row === last.row) {
2675
- return;
2676
- }
2677
- const to = {
2678
- row: from.row + 1,
2679
- cell: from.cell
2680
- };
2681
- return getVerticalNavIndex(table, from, to);
2682
- }
2683
- if (e.code === "Home") {
2684
- if (e.ctrlKey) {
2685
- return {
2686
- row: 1,
2687
- cell: 0
2688
- };
2689
- } else {
2690
- return {
2691
- row: from.row,
2692
- cell: 0
2693
- };
2694
- }
2695
- }
2696
- if (e.code === "End") {
2697
- if (e.ctrlKey) {
2698
- return {
2699
- row: last.row,
2700
- cell: table.rows[last.row].cells.length - 1
2701
- };
2702
- } else {
2703
- return {
2704
- row: from.row,
2705
- cell: table.rows[from.row].cells.length - 1
2706
- };
2707
- }
2708
- }
2709
- }
2710
- function getCell(element) {
2711
- const closest = element.closest("td, th");
2712
- if (!closest) {
2713
- throw new Error("expected th or td parent");
2714
- }
2715
- return closest;
2716
- }
2717
- async function setDefaultCellTarget(table) {
2718
- await nextTick();
2719
- const target = getCellTarget(table, 1, 0);
2720
- activateCell(target, {
2721
- focus: false
2722
- });
2723
- return target;
2724
- }
2725
- function maybeNavigateToCell(e) {
2726
- let newCellTarget = e.target;
2727
- const cell = getCell(e.target);
2728
- const tr = getTr(cell);
2729
- const table = getTable(tr);
2730
- const fromIndex = {
2731
- row: tr.rowIndex,
2732
- cell: cell.cellIndex
2733
- };
2734
- const lastIndex = {
2735
- row: getLastRowIndex(table),
2736
- cell: getLastCellIndex(table)
2737
- };
2738
- const navigateTo = navigate(e, table, fromIndex, lastIndex);
2739
- if (navigateTo) {
2740
- newCellTarget = getCellTarget(table, navigateTo.row, navigateTo.cell);
2741
- activateCell(newCellTarget, {
2742
- focus: true
2743
- });
2744
- }
2745
- }
2746
- function activateCell(element, options) {
2747
- var _toValue;
2748
- const api = element[tableCellApiSymbol];
2749
- const targetEl = (_toValue = toValue(api?.tabstopEl)) !== null && _toValue !== void 0 ? _toValue : element;
2750
- targetEl.tabIndex = 0;
2751
- if (options?.focus) {
2752
- targetEl.focus();
2753
- }
2754
- return targetEl;
2755
- }
2756
- function stopEdit(element, reason) {
2757
- const td = getCell(element);
2758
- const tr = getTr(td);
2759
- const table = getTable(tr);
2760
- const rowIndex = tr.rowIndex;
2761
- const cellIndex = td.cellIndex;
2762
- const lastRowIndex = getLastRowIndex(table);
2763
- const lastCellIndex = getLastCellIndex(table);
2764
- let newCellTarget = td;
2765
- switch (reason) {
2766
- case "enter": {
2767
- const nextRowIndex = rowIndex + 1;
2768
- const hasFooter = Boolean(table.tFoot);
2769
- const isLastRow = rowIndex === lastRowIndex;
2770
- const footerNext = hasFooter && nextRowIndex === lastRowIndex;
2771
- if (!isLastRow && !footerNext) {
2772
- newCellTarget = getCellTarget(table, nextRowIndex, cellIndex);
2773
- activateCell(newCellTarget, {
2774
- focus: true
2775
- });
2776
- } else {
2777
- activateCell(newCellTarget, {
2778
- focus: true
2779
- });
2780
- }
2781
- return newCellTarget;
2782
- }
2783
- case "escape": {
2784
- activateCell(newCellTarget, {
2785
- focus: true
2786
- });
2787
- return newCellTarget;
2788
- }
2789
- case "tab": {
2790
- if (cellIndex === lastCellIndex && rowIndex === lastRowIndex) {
2791
- activateCell(newCellTarget, {
2792
- focus: true
2793
- });
2794
- } else if (cellIndex === lastCellIndex) {
2795
- newCellTarget = getCellTarget(table, rowIndex + 1, 0);
2796
- activateCell(newCellTarget, {
2797
- focus: true
2798
- });
2799
- } else {
2800
- newCellTarget = getCellTarget(table, rowIndex, cellIndex + 1);
2801
- activateCell(newCellTarget, {
2802
- focus: true
2803
- });
2804
- }
2805
- return newCellTarget;
2806
- }
2807
- case "shift-tab": {
2808
- if (cellIndex === 0 && rowIndex === 1) {
2809
- activateCell(newCellTarget, {
2810
- focus: true
2811
- });
2812
- } else if (cellIndex === 0) {
2813
- newCellTarget = getCellTarget(table, rowIndex - 1, 0);
2814
- activateCell(newCellTarget, {
2815
- focus: true
2816
- });
2817
- } else {
2818
- newCellTarget = getCellTarget(table, rowIndex, cellIndex - 1);
2819
- activateCell(newCellTarget, {
2820
- focus: true
2821
- });
2822
- }
2823
- return newCellTarget;
2824
- }
2825
- case "blur": {
2826
- return newCellTarget;
2827
- }
2828
- }
2829
- }
2830
2597
  const _hoisted_1$e = {
2831
2598
  key: 0,
2832
2599
  class: "table-ng__cell table-ng__cell--expand"
2833
2600
  };
2834
2601
  const _hoisted_2$9 = ["aria-label", "aria-expanded"];
2835
- const _hoisted_3$6 = {
2602
+ const _hoisted_3$5 = {
2836
2603
  key: 1,
2837
2604
  ref: "expandable",
2838
2605
  tabindex: "-1",
@@ -2878,7 +2645,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2878
2645
  }, [createVNode(unref(FIcon), {
2879
2646
  class: "button__icon",
2880
2647
  name: toggleIcon.value
2881
- }, null, 8, ["name"])], 8, _hoisted_2$9)])) : (openBlock(), createElementBlock("td", _hoisted_3$6, null, 512));
2648
+ }, null, 8, ["name"])], 8, _hoisted_2$9)])) : (openBlock(), createElementBlock("td", _hoisted_3$5, null, 512));
2882
2649
  };
2883
2650
  }
2884
2651
  });
@@ -2898,20 +2665,69 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2898
2665
  };
2899
2666
  }
2900
2667
  });
2901
- const baseTypes = ["anchor", "button", "checkbox", "radio", "render", "rowheader", "select"];
2902
- const textTypes = ["text:bankAccountNumber", "text:bankgiro", "text:clearingNumber", "text:date", "text:email", "text:organisationsnummer", "text:personnummer", "text:phoneNumber", "text:plusgiro", "text:postalCode", "text"];
2903
- const numberTypes = ["text:currency", "text:number", "text:percent"];
2904
- function isInputTypeNumber(value) {
2905
- return numberTypes.includes(value);
2906
- }
2907
- function isInputTypeText(value) {
2908
- return textTypes.includes(value);
2909
- }
2910
- const inputFieldConfig = {
2911
- "text:personnummer": {
2912
- formatter(value) {
2913
- return formatPersonnummer(parsePersonnummer(value));
2914
- },
2668
+ var es_array_includes = {};
2669
+ var addToUnscopables;
2670
+ var hasRequiredAddToUnscopables;
2671
+ function requireAddToUnscopables() {
2672
+ if (hasRequiredAddToUnscopables) return addToUnscopables;
2673
+ hasRequiredAddToUnscopables = 1;
2674
+ var wellKnownSymbol2 = requireWellKnownSymbol();
2675
+ var create = requireObjectCreate();
2676
+ var defineProperty = requireObjectDefineProperty().f;
2677
+ var UNSCOPABLES = wellKnownSymbol2("unscopables");
2678
+ var ArrayPrototype = Array.prototype;
2679
+ if (ArrayPrototype[UNSCOPABLES] === void 0) {
2680
+ defineProperty(ArrayPrototype, UNSCOPABLES, {
2681
+ configurable: true,
2682
+ value: create(null)
2683
+ });
2684
+ }
2685
+ addToUnscopables = function(key) {
2686
+ ArrayPrototype[UNSCOPABLES][key] = true;
2687
+ };
2688
+ return addToUnscopables;
2689
+ }
2690
+ var hasRequiredEs_array_includes;
2691
+ function requireEs_array_includes() {
2692
+ if (hasRequiredEs_array_includes) return es_array_includes;
2693
+ hasRequiredEs_array_includes = 1;
2694
+ var $ = require_export();
2695
+ var $includes = requireArrayIncludes().includes;
2696
+ var fails2 = requireFails();
2697
+ var addToUnscopables2 = requireAddToUnscopables();
2698
+ var BROKEN_ON_SPARSE = fails2(function() {
2699
+ return !Array(1).includes();
2700
+ });
2701
+ var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails2(function() {
2702
+ return [, 1].includes(void 0, 1);
2703
+ });
2704
+ $({
2705
+ target: "Array",
2706
+ proto: true,
2707
+ forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX
2708
+ }, {
2709
+ includes: function includes(el) {
2710
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
2711
+ }
2712
+ });
2713
+ addToUnscopables2("includes");
2714
+ return es_array_includes;
2715
+ }
2716
+ requireEs_array_includes();
2717
+ const baseTypes = ["anchor", "button", "checkbox", "render", "rowheader", "select"];
2718
+ const textTypes = ["text:bankAccountNumber", "text:bankgiro", "text:clearingNumber", "text:date", "text:email", "text:organisationsnummer", "text:personnummer", "text:phoneNumber", "text:plusgiro", "text:postalCode", "text"];
2719
+ const numberTypes = ["text:currency", "text:number", "text:percent"];
2720
+ function isInputTypeNumber(value) {
2721
+ return numberTypes.includes(value);
2722
+ }
2723
+ function isInputTypeText(value) {
2724
+ return textTypes.includes(value);
2725
+ }
2726
+ const inputFieldConfig = {
2727
+ "text:personnummer": {
2728
+ formatter(value) {
2729
+ return formatPersonnummer(parsePersonnummer(value));
2730
+ },
2915
2731
  parser(value) {
2916
2732
  return parsePersonnummer(value);
2917
2733
  },
@@ -3338,17 +3154,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3338
3154
  }
3339
3155
  });
3340
3156
  const _hoisted_1$a = {
3341
- key: 0,
3342
3157
  class: "table-ng__cell table-ng__cell--checkbox"
3343
3158
  };
3344
3159
  const _hoisted_2$7 = ["checked", "aria-label"];
3345
- const _hoisted_3$5 = {
3346
- key: 1,
3347
- ref: "target",
3348
- tabindex: "-1",
3349
- class: "table-ng__cell table-ng__cell--checkbox"
3350
- };
3351
- const _hoisted_4$4 = ["checked", "aria-label"];
3352
3160
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
3353
3161
  __name: "ITableCheckbox",
3354
3162
  props: {
@@ -3372,18 +3180,14 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3372
3180
  };
3373
3181
  __expose(expose);
3374
3182
  return (_ctx, _cache) => {
3375
- return __props.column.editable(__props.row) ? (openBlock(), createElementBlock("td", _hoisted_1$a, [createElementVNode("input", {
3183
+ return openBlock(), createElementBlock("td", _hoisted_1$a, [createElementVNode("input", {
3376
3184
  ref: "target",
3377
3185
  checked: Boolean(__props.column.checked(__props.row)),
3378
3186
  type: "checkbox",
3379
3187
  "aria-label": ariaLabel.value,
3380
3188
  tabindex: "-1",
3381
3189
  onChange
3382
- }, null, 40, _hoisted_2$7)])) : (openBlock(), createElementBlock("td", _hoisted_3$5, [createElementVNode("input", {
3383
- checked: Boolean(__props.column.checked(__props.row)),
3384
- type: "checkbox",
3385
- "aria-label": ariaLabel.value
3386
- }, null, 8, _hoisted_4$4)], 512));
3190
+ }, null, 40, _hoisted_2$7)]);
3387
3191
  };
3388
3192
  }
3389
3193
  });
@@ -3472,9 +3276,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3472
3276
  checked() {
3473
3277
  return __props.state;
3474
3278
  },
3475
- editable() {
3476
- return true;
3477
- },
3478
3279
  update() {
3479
3280
  emit("toggle", __props.row);
3480
3281
  },
@@ -3515,7 +3316,250 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3515
3316
  }, null, 8, ["row"])) : createCommentVNode("", true);
3516
3317
  };
3517
3318
  }
3518
- });
3319
+ });
3320
+ function isFTableCellApi(value) {
3321
+ return value !== null && typeof value === "object" && Boolean(value.tabstopEl);
3322
+ }
3323
+ const tableCellApiSymbol = /* @__PURE__ */ Symbol("table:cell-api");
3324
+ const navKeys = /* @__PURE__ */ new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"]);
3325
+ let prevCellIndex = void 0;
3326
+ function getCellTarget(tableElement, rowIndex, cellIndex) {
3327
+ return tableElement.rows[rowIndex].cells[cellIndex];
3328
+ }
3329
+ function getTr(td) {
3330
+ return td.parentElement;
3331
+ }
3332
+ function getTable(tr) {
3333
+ return tr.closest("table");
3334
+ }
3335
+ function getLastRowIndex(tableElement) {
3336
+ return tableElement.rows.length - 1;
3337
+ }
3338
+ function getLastCellIndex(tableElement) {
3339
+ return tableElement.rows[0].cells.length - 1;
3340
+ }
3341
+ function getVerticalNavIndex(table, from, to) {
3342
+ const target = {
3343
+ ...to
3344
+ };
3345
+ const currentMax = table.rows[from.row].cells.length - 1;
3346
+ const targetMax = table.rows[to.row].cells.length - 1;
3347
+ if (prevCellIndex && currentMax < targetMax) {
3348
+ target.cell = prevCellIndex;
3349
+ prevCellIndex = void 0;
3350
+ } else {
3351
+ target.cell = Math.min(targetMax, from.cell);
3352
+ }
3353
+ if (targetMax < from.cell) {
3354
+ prevCellIndex = from.cell;
3355
+ }
3356
+ return target;
3357
+ }
3358
+ function isDefined(value) {
3359
+ return value.row !== void 0 && value.cell !== void 0;
3360
+ }
3361
+ function navigate(e, table, from, last) {
3362
+ if (!isDefined(from) || !isDefined(last)) {
3363
+ return;
3364
+ }
3365
+ if (!navKeys.has(e.code)) {
3366
+ return;
3367
+ }
3368
+ e.preventDefault();
3369
+ if (e.code === "ArrowLeft") {
3370
+ if (from.cell === 0) {
3371
+ return;
3372
+ }
3373
+ prevCellIndex = void 0;
3374
+ return {
3375
+ row: from.row,
3376
+ cell: from.cell - 1
3377
+ };
3378
+ }
3379
+ if (e.code === "ArrowRight") {
3380
+ if (from.cell === last.cell) {
3381
+ return;
3382
+ }
3383
+ const lastCellIndex = table.rows[from.row].cells.length - 1;
3384
+ if (lastCellIndex <= from.cell) {
3385
+ return;
3386
+ }
3387
+ prevCellIndex = void 0;
3388
+ return {
3389
+ row: from.row,
3390
+ cell: from.cell + 1
3391
+ };
3392
+ }
3393
+ if (e.code === "ArrowUp") {
3394
+ if (from.row === 0) {
3395
+ return;
3396
+ }
3397
+ const to = {
3398
+ row: from.row - 1,
3399
+ cell: from.cell
3400
+ };
3401
+ return getVerticalNavIndex(table, from, to);
3402
+ }
3403
+ if (e.code === "ArrowDown") {
3404
+ if (from.row === last.row) {
3405
+ return;
3406
+ }
3407
+ const to = {
3408
+ row: from.row + 1,
3409
+ cell: from.cell
3410
+ };
3411
+ return getVerticalNavIndex(table, from, to);
3412
+ }
3413
+ if (e.code === "Home") {
3414
+ if (e.ctrlKey) {
3415
+ return {
3416
+ row: 1,
3417
+ cell: 0
3418
+ };
3419
+ } else {
3420
+ return {
3421
+ row: from.row,
3422
+ cell: 0
3423
+ };
3424
+ }
3425
+ }
3426
+ if (e.code === "End") {
3427
+ if (e.ctrlKey) {
3428
+ return {
3429
+ row: last.row,
3430
+ cell: table.rows[last.row].cells.length - 1
3431
+ };
3432
+ } else {
3433
+ return {
3434
+ row: from.row,
3435
+ cell: table.rows[from.row].cells.length - 1
3436
+ };
3437
+ }
3438
+ }
3439
+ }
3440
+ function getCell(element) {
3441
+ const closest = element.closest("td, th");
3442
+ if (!closest) {
3443
+ throw new Error("expected th or td parent");
3444
+ }
3445
+ return closest;
3446
+ }
3447
+ async function setDefaultCellTarget(table) {
3448
+ await nextTick();
3449
+ if (!table.tHead) {
3450
+ return null;
3451
+ }
3452
+ const target = getCellTarget(table, 1, 0);
3453
+ activateCell(target, {
3454
+ focus: false
3455
+ });
3456
+ return target;
3457
+ }
3458
+ function maybeNavigateToCell(e) {
3459
+ let newCellTarget = e.target;
3460
+ const cell = getCell(e.target);
3461
+ const tr = getTr(cell);
3462
+ const table = getTable(tr);
3463
+ const fromIndex = {
3464
+ row: tr.rowIndex,
3465
+ cell: cell.cellIndex
3466
+ };
3467
+ const lastIndex = {
3468
+ row: getLastRowIndex(table),
3469
+ cell: getLastCellIndex(table)
3470
+ };
3471
+ const navigateTo = navigate(e, table, fromIndex, lastIndex);
3472
+ if (navigateTo) {
3473
+ newCellTarget = getCellTarget(table, navigateTo.row, navigateTo.cell);
3474
+ activateCell(newCellTarget, {
3475
+ focus: true
3476
+ });
3477
+ }
3478
+ }
3479
+ function activateCell(element, options) {
3480
+ var _toValue;
3481
+ const api = element[tableCellApiSymbol];
3482
+ const targetEl = (_toValue = toValue(api?.tabstopEl)) !== null && _toValue !== void 0 ? _toValue : element;
3483
+ targetEl.tabIndex = 0;
3484
+ if (options?.focus) {
3485
+ targetEl.focus();
3486
+ }
3487
+ return targetEl;
3488
+ }
3489
+ function stopEdit(element, reason) {
3490
+ const td = getCell(element);
3491
+ const tr = getTr(td);
3492
+ const table = getTable(tr);
3493
+ const rowIndex = tr.rowIndex;
3494
+ const cellIndex = td.cellIndex;
3495
+ const lastRowIndex = getLastRowIndex(table);
3496
+ const lastCellIndex = getLastCellIndex(table);
3497
+ let newCellTarget = td;
3498
+ switch (reason) {
3499
+ case "enter": {
3500
+ const nextRowIndex = rowIndex + 1;
3501
+ const hasFooter = Boolean(table.tFoot);
3502
+ const isLastRow = rowIndex === lastRowIndex;
3503
+ const footerNext = hasFooter && nextRowIndex === lastRowIndex;
3504
+ if (!isLastRow && !footerNext) {
3505
+ newCellTarget = getCellTarget(table, nextRowIndex, cellIndex);
3506
+ activateCell(newCellTarget, {
3507
+ focus: true
3508
+ });
3509
+ } else {
3510
+ activateCell(newCellTarget, {
3511
+ focus: true
3512
+ });
3513
+ }
3514
+ return newCellTarget;
3515
+ }
3516
+ case "escape": {
3517
+ activateCell(newCellTarget, {
3518
+ focus: true
3519
+ });
3520
+ return newCellTarget;
3521
+ }
3522
+ case "tab": {
3523
+ if (cellIndex === lastCellIndex && rowIndex === lastRowIndex) {
3524
+ activateCell(newCellTarget, {
3525
+ focus: true
3526
+ });
3527
+ } else if (cellIndex === lastCellIndex) {
3528
+ newCellTarget = getCellTarget(table, rowIndex + 1, 0);
3529
+ activateCell(newCellTarget, {
3530
+ focus: true
3531
+ });
3532
+ } else {
3533
+ newCellTarget = getCellTarget(table, rowIndex, cellIndex + 1);
3534
+ activateCell(newCellTarget, {
3535
+ focus: true
3536
+ });
3537
+ }
3538
+ return newCellTarget;
3539
+ }
3540
+ case "shift-tab": {
3541
+ if (cellIndex === 0 && rowIndex === 1) {
3542
+ activateCell(newCellTarget, {
3543
+ focus: true
3544
+ });
3545
+ } else if (cellIndex === 0) {
3546
+ newCellTarget = getCellTarget(table, rowIndex - 1, 0);
3547
+ activateCell(newCellTarget, {
3548
+ focus: true
3549
+ });
3550
+ } else {
3551
+ newCellTarget = getCellTarget(table, rowIndex, cellIndex - 1);
3552
+ activateCell(newCellTarget, {
3553
+ focus: true
3554
+ });
3555
+ }
3556
+ return newCellTarget;
3557
+ }
3558
+ case "blur": {
3559
+ return newCellTarget;
3560
+ }
3561
+ }
3562
+ }
3519
3563
  function walk(array, childKey, visit, level = 1) {
3520
3564
  for (const item of array) {
3521
3565
  const visitChildren = visit(item, level);
@@ -3581,7 +3625,7 @@ function requireDoesNotExceedSafeInteger() {
3581
3625
  var $TypeError = TypeError;
3582
3626
  var MAX_SAFE_INTEGER = 9007199254740991;
3583
3627
  doesNotExceedSafeInteger = function(it) {
3584
- if (it > MAX_SAFE_INTEGER) throw $TypeError("Maximum allowed index exceeded");
3628
+ if (it > MAX_SAFE_INTEGER) throw new $TypeError("Maximum allowed index exceeded");
3585
3629
  return it;
3586
3630
  };
3587
3631
  return doesNotExceedSafeInteger;
@@ -4214,6 +4258,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4214
4258
  const hasError = computed(() => validity.value.validityMode === "ERROR");
4215
4259
  const viewModeAriaInvalid = computed(() => !inEdit.value && hasError.value ? true : void 0);
4216
4260
  const viewModeErrorMessage = computed(() => !inEdit.value && hasError.value ? validity.value.validationMessage : void 0);
4261
+ let initialValidity = {
4262
+ ...validity.value
4263
+ };
4217
4264
  const divClasses = computed(() => {
4218
4265
  return {
4219
4266
  "table-ng__editable": true,
@@ -4361,6 +4408,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4361
4408
  width
4362
4409
  } = tdElement.value.getBoundingClientRect();
4363
4410
  initialViewValue = viewValue.value;
4411
+ initialValidity = {
4412
+ ...validity.value
4413
+ };
4364
4414
  viewValue.value = value;
4365
4415
  tdElement.value.style.setProperty("width", `${String(width)}px`);
4366
4416
  inputElement.value.tabIndex = 0;
@@ -4423,6 +4473,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4423
4473
  switch (event.key) {
4424
4474
  case "Enter": {
4425
4475
  if (viewValue.value === initialViewValue) {
4476
+ validity.value = {
4477
+ ...initialValidity
4478
+ };
4426
4479
  onStopEdit({
4427
4480
  reason: "enter"
4428
4481
  });
@@ -4541,51 +4594,49 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4541
4594
  }
4542
4595
  });
4543
4596
  function normalizeAnchorColumn(column) {
4544
- var _column$key;
4545
4597
  return {
4546
4598
  type: "anchor",
4547
4599
  text: getValueFn(column.text, column.key, String, ""),
4548
- href: column.href,
4549
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null
4600
+ href: column.href
4550
4601
  };
4551
4602
  }
4603
+ function getSortable(column) {
4604
+ var _column$sort, _column$key;
4605
+ const shouldSort = (_column$sort = column.sort) !== null && _column$sort !== void 0 ? _column$sort : !!column.key;
4606
+ return shouldSort ? (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null : null;
4607
+ }
4552
4608
  function normalizeBaseColumn(column) {
4553
4609
  var _column$enabled;
4554
4610
  const id = /* @__PURE__ */ Symbol();
4555
4611
  const header = toRef(column.header);
4556
4612
  const description = column.description !== void 0 ? toRef(column.description) : ref("");
4557
4613
  const size = column.size !== void 0 ? toRef(column.size) : ref("grow");
4614
+ const sortable = getSortable(column);
4558
4615
  return {
4559
4616
  id,
4560
4617
  header,
4561
4618
  description,
4619
+ sortable,
4562
4620
  size,
4563
4621
  enabled: (_column$enabled = column.enabled) !== null && _column$enabled !== void 0 ? _column$enabled : true
4564
4622
  };
4565
4623
  }
4566
4624
  function normalizeButtonColumn(column) {
4567
- var _column$icon, _column$key;
4625
+ var _column$icon;
4568
4626
  return {
4569
4627
  type: "button",
4570
4628
  text: getValueFn(column.text, column.key, String, ""),
4571
4629
  onClick: column.onClick,
4572
4630
  icon: (_column$icon = column.icon) !== null && _column$icon !== void 0 ? _column$icon : null,
4573
- iconLibrary: column.iconLibrary,
4574
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null
4631
+ iconLibrary: column.iconLibrary
4575
4632
  };
4576
4633
  }
4577
4634
  function normalizeCheckboxColumn(column) {
4578
- var _column$key;
4579
4635
  return {
4580
4636
  type: "checkbox",
4581
4637
  label: getLabelFn(column.label),
4582
4638
  checked: getValueFn(column.checked, column.key, Boolean, false),
4583
- update: getUpdateFn(column.update, column.key),
4584
- editable: typeof column.editable === "function" ? column.editable : () => {
4585
- var _column$editable;
4586
- return Boolean((_column$editable = column.editable) !== null && _column$editable !== void 0 ? _column$editable : false);
4587
- },
4588
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null
4639
+ update: getUpdateFn(column.update, column.key)
4589
4640
  };
4590
4641
  }
4591
4642
  function noop() {
@@ -4595,7 +4646,6 @@ function normalizeMenuColumn(column) {
4595
4646
  return {
4596
4647
  type: "menu",
4597
4648
  text: getValueFn(column.text, void 0, String, ""),
4598
- sortable: null,
4599
4649
  actions: ((_column$actions = column.actions) !== null && _column$actions !== void 0 ? _column$actions : []).map((it) => {
4600
4650
  var _it$icon, _it$onClick;
4601
4651
  return {
@@ -4607,7 +4657,7 @@ function normalizeMenuColumn(column) {
4607
4657
  };
4608
4658
  }
4609
4659
  function normalizeNumberColumn(column) {
4610
- var _column$parser, _column$formatter, _column$tnum, _column$align, _column$validation, _column$key;
4660
+ var _column$parser, _column$formatter, _column$tnum, _column$align, _column$validation;
4611
4661
  const type = column.type;
4612
4662
  const config = inputFieldConfig[type];
4613
4663
  const parser = (_column$parser = column.parser) !== null && _column$parser !== void 0 ? _column$parser : config.parser.bind(column);
@@ -4628,21 +4678,10 @@ function normalizeNumberColumn(column) {
4628
4678
  },
4629
4679
  validation: (_column$validation = column.validation) !== null && _column$validation !== void 0 ? _column$validation : {},
4630
4680
  hasValidation: column.type.startsWith("text:") || Boolean(column.validation),
4631
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null,
4632
4681
  formatter,
4633
4682
  parser
4634
4683
  };
4635
4684
  }
4636
- function normalizeRadioColumn(column) {
4637
- var _column$key;
4638
- return {
4639
- type: "radio",
4640
- label: getLabelFn(column.label),
4641
- checked: getValueFn(column.checked, column.key, Boolean, false),
4642
- update: getUpdateFn(column.update, column.key),
4643
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null
4644
- };
4645
- }
4646
4685
  function normalizeRenderColumn(column) {
4647
4686
  return {
4648
4687
  type: void 0,
@@ -4651,15 +4690,12 @@ function normalizeRenderColumn(column) {
4651
4690
  };
4652
4691
  }
4653
4692
  function normalizeRowHeaderColumn(column) {
4654
- var _column$key;
4655
4693
  return {
4656
4694
  type: "rowheader",
4657
- text: getValueFn(column.text, column.key, String, ""),
4658
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null
4695
+ text: getValueFn(column.text, column.key, String, "")
4659
4696
  };
4660
4697
  }
4661
4698
  function normalizeSelectColumn(column) {
4662
- var _column$key;
4663
4699
  return {
4664
4700
  type: "select",
4665
4701
  label: getLabelFn(column.label),
@@ -4669,12 +4705,10 @@ function normalizeSelectColumn(column) {
4669
4705
  var _column$editable;
4670
4706
  return Boolean((_column$editable = column.editable) !== null && _column$editable !== void 0 ? _column$editable : false);
4671
4707
  },
4672
- options: column.options,
4673
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null
4708
+ options: column.options
4674
4709
  };
4675
4710
  }
4676
4711
  function normalizeSimpleColumn(column) {
4677
- var _column$key;
4678
4712
  return {
4679
4713
  type: "text",
4680
4714
  label: () => "",
@@ -4684,7 +4718,6 @@ function normalizeSimpleColumn(column) {
4684
4718
  update() {
4685
4719
  },
4686
4720
  editable: () => false,
4687
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null,
4688
4721
  validation: {},
4689
4722
  hasValidation: false,
4690
4723
  formatter: (value) => value,
@@ -4692,7 +4725,7 @@ function normalizeSimpleColumn(column) {
4692
4725
  };
4693
4726
  }
4694
4727
  function normalizeTextColumn(column) {
4695
- var _column$parser, _column$formatter, _column$tnum, _column$align, _column$validation, _column$key;
4728
+ var _column$parser, _column$formatter, _column$tnum, _column$align, _column$validation;
4696
4729
  const type = column.type;
4697
4730
  const config = inputFieldConfig[type];
4698
4731
  const parser = (_column$parser = column.parser) !== null && _column$parser !== void 0 ? _column$parser : config.parser;
@@ -4711,7 +4744,6 @@ function normalizeTextColumn(column) {
4711
4744
  },
4712
4745
  validation: (_column$validation = column.validation) !== null && _column$validation !== void 0 ? _column$validation : {},
4713
4746
  hasValidation: column.type.startsWith("text:") || Boolean(column.validation),
4714
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null,
4715
4747
  formatter,
4716
4748
  parser
4717
4749
  };
@@ -4719,32 +4751,26 @@ function normalizeTextColumn(column) {
4719
4751
  function normalizeTableColumn(column) {
4720
4752
  const base = normalizeBaseColumn(column);
4721
4753
  if ("render" in column) {
4722
- return {
4754
+ return Object.freeze({
4723
4755
  ...normalizeRenderColumn(column),
4724
4756
  ...base
4725
- };
4757
+ });
4726
4758
  }
4727
4759
  switch (column.type) {
4728
4760
  case "checkbox":
4729
- return {
4761
+ return Object.freeze({
4730
4762
  ...normalizeCheckboxColumn(column),
4731
4763
  ...base,
4732
4764
  component: _sfc_main$c
4733
- };
4734
- case "radio":
4735
- return {
4736
- ...normalizeRadioColumn(column),
4737
- ...base,
4738
- component: _sfc_main$b
4739
- };
4765
+ });
4740
4766
  case "text:currency":
4741
4767
  case "text:number":
4742
4768
  case "text:percent":
4743
- return {
4769
+ return Object.freeze({
4744
4770
  ...normalizeNumberColumn(column),
4745
4771
  ...base,
4746
4772
  component: _sfc_main$4
4747
- };
4773
+ });
4748
4774
  case "text":
4749
4775
  case "text:bankAccountNumber":
4750
4776
  case "text:bankgiro":
@@ -4756,47 +4782,47 @@ function normalizeTableColumn(column) {
4756
4782
  case "text:phoneNumber":
4757
4783
  case "text:plusgiro":
4758
4784
  case "text:postalCode":
4759
- return {
4785
+ return Object.freeze({
4760
4786
  ...normalizeTextColumn(column),
4761
4787
  ...base,
4762
4788
  component: _sfc_main$4
4763
- };
4789
+ });
4764
4790
  case "rowheader":
4765
- return {
4791
+ return Object.freeze({
4766
4792
  ...normalizeRowHeaderColumn(column),
4767
4793
  ...base,
4768
4794
  component: _sfc_main$6
4769
- };
4795
+ });
4770
4796
  case "anchor":
4771
- return {
4797
+ return Object.freeze({
4772
4798
  ...normalizeAnchorColumn(column),
4773
4799
  ...base,
4774
4800
  component: _sfc_main$9
4775
- };
4801
+ });
4776
4802
  case "button":
4777
- return {
4803
+ return Object.freeze({
4778
4804
  ...normalizeButtonColumn(column),
4779
4805
  ...base,
4780
4806
  component: _sfc_main$8
4781
- };
4807
+ });
4782
4808
  case "select":
4783
- return {
4809
+ return Object.freeze({
4784
4810
  ...normalizeSelectColumn(column),
4785
4811
  ...base,
4786
4812
  component: _sfc_main$5
4787
- };
4813
+ });
4788
4814
  case "menu":
4789
- return {
4815
+ return Object.freeze({
4790
4816
  ...normalizeMenuColumn(column),
4791
4817
  ...base,
4792
4818
  component: _sfc_main$7
4793
- };
4819
+ });
4794
4820
  case void 0:
4795
- return {
4821
+ return Object.freeze({
4796
4822
  ...normalizeSimpleColumn(column),
4797
4823
  ...base,
4798
4824
  component: _sfc_main$4
4799
- };
4825
+ });
4800
4826
  }
4801
4827
  }
4802
4828
  function defineTableColumns(columns) {
@@ -4817,16 +4843,11 @@ function usePopupError() {
4817
4843
  anchor,
4818
4844
  arrowAnchor,
4819
4845
  hasFocus,
4820
- hasHover,
4821
- inEdit
4846
+ hasHover
4822
4847
  } = popupError;
4823
4848
  if (!anchor || !arrowAnchor) {
4824
4849
  return;
4825
4850
  }
4826
- if (inEdit) {
4827
- onClosePopupError(popupError);
4828
- return;
4829
- }
4830
4851
  if (hasFocus || hasHover) {
4831
4852
  await open(popupError);
4832
4853
  } else {
@@ -4899,27 +4920,6 @@ function requireGetBuiltInPrototypeMethod() {
4899
4920
  };
4900
4921
  return getBuiltInPrototypeMethod;
4901
4922
  }
4902
- var addToUnscopables;
4903
- var hasRequiredAddToUnscopables;
4904
- function requireAddToUnscopables() {
4905
- if (hasRequiredAddToUnscopables) return addToUnscopables;
4906
- hasRequiredAddToUnscopables = 1;
4907
- var wellKnownSymbol2 = requireWellKnownSymbol();
4908
- var create = requireObjectCreate();
4909
- var defineProperty = requireObjectDefineProperty().f;
4910
- var UNSCOPABLES = wellKnownSymbol2("unscopables");
4911
- var ArrayPrototype = Array.prototype;
4912
- if (ArrayPrototype[UNSCOPABLES] === void 0) {
4913
- defineProperty(ArrayPrototype, UNSCOPABLES, {
4914
- configurable: true,
4915
- value: create(null)
4916
- });
4917
- }
4918
- addToUnscopables = function(key) {
4919
- ArrayPrototype[UNSCOPABLES][key] = true;
4920
- };
4921
- return addToUnscopables;
4922
- }
4923
4923
  var hasRequiredEs_array_toSorted;
4924
4924
  function requireEs_array_toSorted() {
4925
4925
  if (hasRequiredEs_array_toSorted) return es_array_toSorted;
@@ -5200,26 +5200,32 @@ const _hoisted_2$1 = {
5200
5200
  "data-test": "caption"
5201
5201
  };
5202
5202
  const _hoisted_3$1 = {
5203
+ key: 1
5204
+ };
5205
+ const _hoisted_4$1 = {
5203
5206
  class: "table-ng__row",
5204
5207
  "aria-rowindex": "1"
5205
5208
  };
5206
- const _hoisted_4$1 = {
5209
+ const _hoisted_5$1 = {
5207
5210
  key: 0,
5208
5211
  scope: "col",
5209
5212
  tabindex: "-1",
5210
5213
  class: "table-ng__column"
5211
5214
  };
5212
- const _hoisted_5$1 = {
5215
+ const _hoisted_6$1 = {
5216
+ key: 2
5217
+ };
5218
+ const _hoisted_7$1 = {
5213
5219
  key: 0,
5214
5220
  class: "table-ng__row--empty"
5215
5221
  };
5216
- const _hoisted_6$1 = ["colspan"];
5217
- const _hoisted_7$1 = ["aria-level", "aria-rowindex", "aria-setsize", "aria-posinset", "aria-selected"];
5218
- const _hoisted_8 = {
5219
- key: 1
5222
+ const _hoisted_8 = ["colspan"];
5223
+ const _hoisted_9 = ["aria-level", "aria-rowindex", "aria-setsize", "aria-posinset", "aria-selected"];
5224
+ const _hoisted_10 = {
5225
+ key: 3
5220
5226
  };
5221
- const _hoisted_9 = ["aria-rowindex"];
5222
- const _hoisted_10 = ["colspan"];
5227
+ const _hoisted_11 = ["aria-rowindex"];
5228
+ const _hoisted_12 = ["colspan"];
5223
5229
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5224
5230
  __name: "FTable",
5225
5231
  props: /* @__PURE__ */ mergeModels({
@@ -5231,6 +5237,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5231
5237
  expandableAttribute: {
5232
5238
  default: () => void 0
5233
5239
  },
5240
+ rowClass: {
5241
+ type: Function,
5242
+ default: void 0
5243
+ },
5234
5244
  striped: {
5235
5245
  type: Boolean
5236
5246
  },
@@ -5270,20 +5280,35 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5270
5280
  return metaRows.value.length === 0;
5271
5281
  });
5272
5282
  const ariaRowcount = computed(() => {
5273
- const headerRow = 1;
5274
5283
  const footerRow = hasFooter.value ? 1 : 0;
5275
- return getBodyRowCount(keyedRows.value, __props.expandableAttribute) + headerRow + footerRow;
5284
+ if (!hasColumns.value) {
5285
+ return footerRow;
5286
+ }
5287
+ const headerRow = 1;
5288
+ const bodyRows = getBodyRowCount(keyedRows.value, __props.expandableAttribute);
5289
+ return bodyRows + headerRow + footerRow;
5290
+ });
5291
+ const fullColspan = computed(() => {
5292
+ if (!hasColumns.value) {
5293
+ return 0;
5294
+ }
5295
+ let count = columns.value.length;
5296
+ if (isTreegrid.value) {
5297
+ count += 1;
5298
+ }
5299
+ if (__props.selectable) {
5300
+ count += 1;
5301
+ }
5302
+ return count;
5276
5303
  });
5277
- const columnCount = computed(() => {
5278
- const expandCol = isTreegrid.value ? 1 : 0;
5279
- const selectCol = __props.selectable ? 1 : 0;
5280
- const count = columns.value.length + expandCol + selectCol;
5281
- return Math.max(1, count);
5304
+ const expandedColspan = computed(() => {
5305
+ return fullColspan.value - 1;
5282
5306
  });
5283
5307
  const hasFooter = computed(() => {
5284
5308
  return hasSlot("footer");
5285
5309
  });
5286
5310
  const columns = computed(() => normalizeTableColumns(__props.columns).filter((col) => toValue(col.enabled)));
5311
+ const hasColumns = computed(() => columns.value.length > 0);
5287
5312
  const tableClasses = computed(() => {
5288
5313
  return ["table-ng", {
5289
5314
  "table-ng--striped": __props.striped,
@@ -5298,6 +5323,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5298
5323
  stopEdit(element, reason);
5299
5324
  }
5300
5325
  provide(stopEditKey, stopEditHandler);
5326
+ function getRowClass(row) {
5327
+ return typeof __props.rowClass === "function" ? __props.rowClass(row) : void 0;
5328
+ }
5301
5329
  function onToggleExpanded(key) {
5302
5330
  if (expandedKeys.value.has(key)) {
5303
5331
  expandedKeys.value.delete(key);
@@ -5447,7 +5475,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5447
5475
  onFocusout: onTableFocusout,
5448
5476
  onClick,
5449
5477
  onKeydown
5450
- }, [hasCaption.value ? (openBlock(), createElementBlock("caption", _hoisted_2$1, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_3$1, [isTreegrid.value ? (openBlock(), createElementBlock("th", _hoisted_4$1)) : createCommentVNode("", true), _cache[0] || (_cache[0] = createTextVNode()), __props.selectable ? (openBlock(), createBlock(_sfc_main$d, {
5478
+ }, [hasCaption.value ? (openBlock(), createElementBlock("caption", _hoisted_2$1, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), hasColumns.value ? (openBlock(), createElementBlock("thead", _hoisted_3$1, [createElementVNode("tr", _hoisted_4$1, [isTreegrid.value ? (openBlock(), createElementBlock("th", _hoisted_5$1)) : createCommentVNode("", true), _cache[0] || (_cache[0] = createTextVNode()), __props.selectable ? (openBlock(), createBlock(_sfc_main$d, {
5451
5479
  key: 1,
5452
5480
  ref: bindCellApiRef,
5453
5481
  state: unref(selectableHeaderState)(),
@@ -5462,10 +5490,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5462
5490
  scope: "col",
5463
5491
  onToggleSortOrder
5464
5492
  }, null, 8, ["column", "sort-enabled", "sort-order"]);
5465
- }), 128))])]), _cache[5] || (_cache[5] = createTextVNode()), createElementVNode("tbody", null, [isEmpty2.value ? (openBlock(), createElementBlock("tr", _hoisted_5$1, [createElementVNode("td", {
5466
- colspan: columnCount.value,
5493
+ }), 128))])])) : createCommentVNode("", true), _cache[5] || (_cache[5] = createTextVNode()), hasColumns.value ? (openBlock(), createElementBlock("tbody", _hoisted_6$1, [isEmpty2.value ? (openBlock(), createElementBlock("tr", _hoisted_7$1, [createElementVNode("td", {
5494
+ colspan: fullColspan.value,
5467
5495
  class: "table-ng__cell"
5468
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref($t)("fkui.ftable.empty.text", "Tabellen är tom")), 1)])], 8, _hoisted_6$1)])) : (openBlock(true), createElementBlock(Fragment, {
5496
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref($t)("fkui.ftable.empty.text", "Tabellen är tom")), 1)])], 8, _hoisted_8)])) : (openBlock(true), createElementBlock(Fragment, {
5469
5497
  key: 1
5470
5498
  }, renderList(metaRows.value, ({
5471
5499
  key,
@@ -5479,7 +5507,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5479
5507
  }) => {
5480
5508
  return openBlock(), createElementBlock("tr", {
5481
5509
  key,
5482
- class: "table-ng__row",
5510
+ class: normalizeClass(["table-ng__row", getRowClass(row)]),
5483
5511
  "aria-level": level,
5484
5512
  "aria-rowindex": rowIndex,
5485
5513
  "aria-setsize": setsize,
@@ -5495,7 +5523,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5495
5523
  onToggle: onToggleExpanded
5496
5524
  }, null, 8, ["is-expandable", "is-expanded", "row-key"])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), level > 1 && hasExpandableSlot.value ? (openBlock(), createBlock(_sfc_main$f, {
5497
5525
  key: 1,
5498
- colspan: columns.value.length
5526
+ colspan: expandedColspan.value
5499
5527
  }, {
5500
5528
  default: withCtx(() => [renderSlot(_ctx.$slots, "expandable", mergeProps({
5501
5529
  ref_for: true
@@ -5530,14 +5558,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5530
5558
  key: 1,
5531
5559
  row
5532
5560
  }, null, 8, ["row"])) : createCommentVNode("", true)], 64);
5533
- }), 128))], 64))], 8, _hoisted_7$1);
5534
- }), 128))]), _cache[6] || (_cache[6] = createTextVNode()), hasFooter.value ? (openBlock(), createElementBlock("tfoot", _hoisted_8, [createElementVNode("tr", {
5561
+ }), 128))], 64))], 10, _hoisted_9);
5562
+ }), 128))])) : createCommentVNode("", true), _cache[6] || (_cache[6] = createTextVNode()), hasFooter.value ? (openBlock(), createElementBlock("tfoot", _hoisted_10, [createElementVNode("tr", {
5535
5563
  class: "table-ng__row",
5536
5564
  "aria-rowindex": ariaRowcount.value
5537
5565
  }, [createElementVNode("td", {
5538
- colspan: columnCount.value,
5566
+ colspan: fullColspan.value,
5539
5567
  class: "table-ng__cell--custom"
5540
- }, [renderSlot(_ctx.$slots, "footer")], 8, _hoisted_10)], 8, _hoisted_9)])) : createCommentVNode("", true)], 42, _hoisted_1$2);
5568
+ }, [renderSlot(_ctx.$slots, "footer")], 8, _hoisted_12)], 8, _hoisted_11)])) : createCommentVNode("", true)], 42, _hoisted_1$2);
5541
5569
  };
5542
5570
  }
5543
5571
  });
@@ -5839,6 +5867,7 @@ function requireArrayBufferTransfer() {
5839
5867
  var structuredClone = globalThis2.structuredClone;
5840
5868
  var ArrayBuffer2 = globalThis2.ArrayBuffer;
5841
5869
  var DataView2 = globalThis2.DataView;
5870
+ var max = Math.max;
5842
5871
  var min = Math.min;
5843
5872
  var ArrayBufferPrototype = ArrayBuffer2.prototype;
5844
5873
  var DataViewPrototype = DataView2.prototype;
@@ -5863,7 +5892,7 @@ function requireArrayBufferTransfer() {
5863
5892
  newBuffer = slice(arrayBuffer, 0, newByteLength);
5864
5893
  } else {
5865
5894
  var options = preserveResizability && !fixedLength && maxByteLength ? {
5866
- maxByteLength: maxByteLength(arrayBuffer)
5895
+ maxByteLength: max(newByteLength, maxByteLength(arrayBuffer))
5867
5896
  } : void 0;
5868
5897
  newBuffer = new ArrayBuffer2(newByteLength, options);
5869
5898
  var a = new DataView2(arrayBuffer);
@@ -5911,78 +5940,6 @@ function requireEs_arrayBuffer_transferToFixedLength() {
5911
5940
  return es_arrayBuffer_transferToFixedLength;
5912
5941
  }
5913
5942
  requireEs_arrayBuffer_transferToFixedLength();
5914
- var es_iterator_reduce = {};
5915
- var functionApply;
5916
- var hasRequiredFunctionApply;
5917
- function requireFunctionApply() {
5918
- if (hasRequiredFunctionApply) return functionApply;
5919
- hasRequiredFunctionApply = 1;
5920
- var NATIVE_BIND = requireFunctionBindNative();
5921
- var FunctionPrototype = Function.prototype;
5922
- var apply = FunctionPrototype.apply;
5923
- var call = FunctionPrototype.call;
5924
- functionApply = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() {
5925
- return call.apply(apply, arguments);
5926
- });
5927
- return functionApply;
5928
- }
5929
- var hasRequiredEs_iterator_reduce;
5930
- function requireEs_iterator_reduce() {
5931
- if (hasRequiredEs_iterator_reduce) return es_iterator_reduce;
5932
- hasRequiredEs_iterator_reduce = 1;
5933
- var $ = require_export();
5934
- var iterate2 = requireIterate();
5935
- var aCallable2 = requireACallable();
5936
- var anObject2 = requireAnObject();
5937
- var getIteratorDirect2 = requireGetIteratorDirect();
5938
- var iteratorClose2 = requireIteratorClose();
5939
- var iteratorHelperWithoutClosingOnEarlyError2 = requireIteratorHelperWithoutClosingOnEarlyError();
5940
- var apply = requireFunctionApply();
5941
- var fails2 = requireFails();
5942
- var $TypeError = TypeError;
5943
- var FAILS_ON_INITIAL_UNDEFINED = fails2(function() {
5944
- [].keys().reduce(function() {
5945
- }, void 0);
5946
- });
5947
- var reduceWithoutClosingOnEarlyError = !FAILS_ON_INITIAL_UNDEFINED && iteratorHelperWithoutClosingOnEarlyError2("reduce", $TypeError);
5948
- $({
5949
- target: "Iterator",
5950
- proto: true,
5951
- real: true,
5952
- forced: FAILS_ON_INITIAL_UNDEFINED || reduceWithoutClosingOnEarlyError
5953
- }, {
5954
- reduce: function reduce(reducer) {
5955
- anObject2(this);
5956
- try {
5957
- aCallable2(reducer);
5958
- } catch (error) {
5959
- iteratorClose2(this, "throw", error);
5960
- }
5961
- var noInitial = arguments.length < 2;
5962
- var accumulator = noInitial ? void 0 : arguments[1];
5963
- if (reduceWithoutClosingOnEarlyError) {
5964
- return apply(reduceWithoutClosingOnEarlyError, this, noInitial ? [reducer] : [reducer, accumulator]);
5965
- }
5966
- var record = getIteratorDirect2(this);
5967
- var counter = 0;
5968
- iterate2(record, function(value) {
5969
- if (noInitial) {
5970
- noInitial = false;
5971
- accumulator = value;
5972
- } else {
5973
- accumulator = reducer(accumulator, value, counter);
5974
- }
5975
- counter++;
5976
- }, {
5977
- IS_RECORD: true
5978
- });
5979
- if (noInitial) throw new $TypeError("Reduce of empty iterator with no initial value");
5980
- return accumulator;
5981
- }
5982
- });
5983
- return es_iterator_reduce;
5984
- }
5985
- requireEs_iterator_reduce();
5986
5943
  var es_typedArray_toReversed = {};
5987
5944
  var isPossiblePrototype;
5988
5945
  var hasRequiredIsPossiblePrototype;
@@ -6195,7 +6152,7 @@ function requireArrayBufferViewCore() {
6195
6152
  }
6196
6153
  });
6197
6154
  for (NAME in TypedArrayConstructorsList) if (globalThis2[NAME]) {
6198
- createNonEnumerableProperty2(globalThis2[NAME], TYPED_ARRAY_TAG, NAME);
6155
+ createNonEnumerableProperty2(globalThis2[NAME].prototype, TYPED_ARRAY_TAG, NAME);
6199
6156
  }
6200
6157
  }
6201
6158
  arrayBufferViewCore = {
@@ -6599,26 +6556,25 @@ function requireUint8FromHex() {
6599
6556
  var uncurryThis = requireFunctionUncurryThis();
6600
6557
  var Uint8Array2 = globalThis2.Uint8Array;
6601
6558
  var SyntaxError = globalThis2.SyntaxError;
6602
- var parseInt = globalThis2.parseInt;
6603
6559
  var min = Math.min;
6604
- var NOT_HEX = /[^\da-f]/i;
6605
- var exec = uncurryThis(NOT_HEX.exec);
6606
- var stringSlice = uncurryThis("".slice);
6560
+ var stringMatch = uncurryThis("".match);
6607
6561
  uint8FromHex = function(string, into) {
6608
6562
  var stringLength = string.length;
6609
6563
  if (stringLength % 2 !== 0) throw new SyntaxError("String should be an even number of characters");
6610
6564
  var maxLength = into ? min(into.length, stringLength / 2) : stringLength / 2;
6611
6565
  var bytes = into || new Uint8Array2(maxLength);
6612
- var read = 0;
6566
+ var segments = stringMatch(string, /.{2}/g);
6613
6567
  var written = 0;
6614
- while (written < maxLength) {
6615
- var hexits = stringSlice(string, read, read += 2);
6616
- if (exec(NOT_HEX, hexits)) throw new SyntaxError("String should only contain hex characters");
6617
- bytes[written++] = parseInt(hexits, 16);
6568
+ for (; written < maxLength; written++) {
6569
+ var result = +("0x" + segments[written] + "0");
6570
+ if (result !== result) {
6571
+ throw new SyntaxError("String should only contain hex characters");
6572
+ }
6573
+ bytes[written] = result >> 4;
6618
6574
  }
6619
6575
  return {
6620
6576
  bytes,
6621
- read
6577
+ read: written << 1
6622
6578
  };
6623
6579
  };
6624
6580
  return uint8FromHex;
@@ -6733,6 +6689,8 @@ function requireEs_uint8Array_toHex() {
6733
6689
  var anUint8Array2 = requireAnUint8Array();
6734
6690
  var notDetached = requireArrayBufferNotDetached();
6735
6691
  var numberToString = uncurryThis(1.1.toString);
6692
+ var join = uncurryThis([].join);
6693
+ var $Array = Array;
6736
6694
  var Uint8Array2 = globalThis2.Uint8Array;
6737
6695
  var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array2 || !Uint8Array2.prototype.toHex || !(function() {
6738
6696
  try {
@@ -6750,12 +6708,12 @@ function requireEs_uint8Array_toHex() {
6750
6708
  toHex: function toHex() {
6751
6709
  anUint8Array2(this);
6752
6710
  notDetached(this.buffer);
6753
- var result = "";
6711
+ var result = $Array(this.length);
6754
6712
  for (var i = 0, length = this.length; i < length; i++) {
6755
6713
  var hex = numberToString(this[i], 16);
6756
- result += hex.length === 1 ? "0" + hex : hex;
6714
+ result[i] = hex.length === 1 ? "0" + hex : hex;
6757
6715
  }
6758
- return result;
6716
+ return join(result, "");
6759
6717
  }
6760
6718
  });
6761
6719
  return es_uint8Array_toHex;
@@ -7314,6 +7272,78 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7314
7272
  });
7315
7273
  const HOURS_MINUTES_REGEXP = /^(?<hours>\d+)?(:(?<minutes>[0-5]\d))?$/;
7316
7274
  const HOURS_MINUTES_WITHOUT_COLON_REGEXP = /^(?<hours>\d{2})(?<minutes>[0-5]\d)$/;
7275
+ var es_iterator_reduce = {};
7276
+ var functionApply;
7277
+ var hasRequiredFunctionApply;
7278
+ function requireFunctionApply() {
7279
+ if (hasRequiredFunctionApply) return functionApply;
7280
+ hasRequiredFunctionApply = 1;
7281
+ var NATIVE_BIND = requireFunctionBindNative();
7282
+ var FunctionPrototype = Function.prototype;
7283
+ var apply = FunctionPrototype.apply;
7284
+ var call = FunctionPrototype.call;
7285
+ functionApply = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() {
7286
+ return call.apply(apply, arguments);
7287
+ });
7288
+ return functionApply;
7289
+ }
7290
+ var hasRequiredEs_iterator_reduce;
7291
+ function requireEs_iterator_reduce() {
7292
+ if (hasRequiredEs_iterator_reduce) return es_iterator_reduce;
7293
+ hasRequiredEs_iterator_reduce = 1;
7294
+ var $ = require_export();
7295
+ var iterate2 = requireIterate();
7296
+ var aCallable2 = requireACallable();
7297
+ var anObject2 = requireAnObject();
7298
+ var getIteratorDirect2 = requireGetIteratorDirect();
7299
+ var iteratorClose2 = requireIteratorClose();
7300
+ var iteratorHelperWithoutClosingOnEarlyError2 = requireIteratorHelperWithoutClosingOnEarlyError();
7301
+ var apply = requireFunctionApply();
7302
+ var fails2 = requireFails();
7303
+ var $TypeError = TypeError;
7304
+ var FAILS_ON_INITIAL_UNDEFINED = fails2(function() {
7305
+ [].keys().reduce(function() {
7306
+ }, void 0);
7307
+ });
7308
+ var reduceWithoutClosingOnEarlyError = !FAILS_ON_INITIAL_UNDEFINED && iteratorHelperWithoutClosingOnEarlyError2("reduce", $TypeError);
7309
+ $({
7310
+ target: "Iterator",
7311
+ proto: true,
7312
+ real: true,
7313
+ forced: FAILS_ON_INITIAL_UNDEFINED || reduceWithoutClosingOnEarlyError
7314
+ }, {
7315
+ reduce: function reduce(reducer) {
7316
+ anObject2(this);
7317
+ try {
7318
+ aCallable2(reducer);
7319
+ } catch (error) {
7320
+ iteratorClose2(this, "throw", error);
7321
+ }
7322
+ var noInitial = arguments.length < 2;
7323
+ var accumulator = noInitial ? void 0 : arguments[1];
7324
+ if (reduceWithoutClosingOnEarlyError) {
7325
+ return apply(reduceWithoutClosingOnEarlyError, this, noInitial ? [reducer] : [reducer, accumulator]);
7326
+ }
7327
+ var record = getIteratorDirect2(this);
7328
+ var counter = 0;
7329
+ iterate2(record, function(value) {
7330
+ if (noInitial) {
7331
+ noInitial = false;
7332
+ accumulator = value;
7333
+ } else {
7334
+ accumulator = reducer(accumulator, value, counter);
7335
+ }
7336
+ counter++;
7337
+ }, {
7338
+ IS_RECORD: true
7339
+ });
7340
+ if (noInitial) throw new $TypeError("Reduce of empty iterator with no initial value");
7341
+ return accumulator;
7342
+ }
7343
+ });
7344
+ return es_iterator_reduce;
7345
+ }
7346
+ requireEs_iterator_reduce();
7317
7347
  function findMatch(regexps, value) {
7318
7348
  for (const regexp of regexps) {
7319
7349
  const match = value.match(regexp);