@fkui/vue-labs 6.39.0 → 6.41.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, withKeys, 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$4 = {
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$4, null, 512));
2882
2649
  };
2883
2650
  }
2884
2651
  });
@@ -2898,7 +2665,56 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2898
2665
  };
2899
2666
  }
2900
2667
  });
2901
- const baseTypes = ["anchor", "button", "checkbox", "radio", "render", "rowheader", "select"];
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"];
2902
2718
  const textTypes = ["text:bankAccountNumber", "text:bankgiro", "text:clearingNumber", "text:date", "text:email", "text:organisationsnummer", "text:personnummer", "text:phoneNumber", "text:plusgiro", "text:postalCode", "text"];
2903
2719
  const numberTypes = ["text:currency", "text:number", "text:percent"];
2904
2720
  function isInputTypeNumber(value) {
@@ -3175,7 +2991,7 @@ const inputFieldConfig = {
3175
2991
  }
3176
2992
  }
3177
2993
  };
3178
- const _hoisted_1$c = ["aria-sort"];
2994
+ const _hoisted_1$c = ["aria-sort", "onKeydown"];
3179
2995
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
3180
2996
  __name: "ITableHeader",
3181
2997
  props: {
@@ -3239,19 +3055,13 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
3239
3055
  }
3240
3056
  emit("toggleSortOrder", String(__props.column.sortable));
3241
3057
  }
3242
- function onKeydownCell(e) {
3243
- if (e.key === "Enter") {
3244
- e.preventDefault();
3245
- onClickCell();
3246
- }
3247
- }
3248
3058
  return (_ctx, _cache) => {
3249
3059
  return openBlock(), createElementBlock("th", {
3250
3060
  ref: "th",
3251
3061
  "aria-sort": sortValue.value,
3252
3062
  class: normalizeClass(columnClasses.value),
3253
3063
  tabindex: "-1",
3254
- onKeydown: onKeydownCell,
3064
+ onKeydown: withKeys(withModifiers(onClickCell, ["prevent"]), ["enter", "space"]),
3255
3065
  onClick: withModifiers(onClickCell, ["stop"])
3256
3066
  }, [createVNode(unref(IFlex), {
3257
3067
  gap: "1x",
@@ -3338,17 +3148,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
3338
3148
  }
3339
3149
  });
3340
3150
  const _hoisted_1$a = {
3341
- key: 0,
3342
3151
  class: "table-ng__cell table-ng__cell--checkbox"
3343
3152
  };
3344
3153
  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
3154
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
3353
3155
  __name: "ITableCheckbox",
3354
3156
  props: {
@@ -3372,18 +3174,14 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
3372
3174
  };
3373
3175
  __expose(expose);
3374
3176
  return (_ctx, _cache) => {
3375
- return __props.column.editable(__props.row) ? (openBlock(), createElementBlock("td", _hoisted_1$a, [createElementVNode("input", {
3177
+ return openBlock(), createElementBlock("td", _hoisted_1$a, [createElementVNode("input", {
3376
3178
  ref: "target",
3377
3179
  checked: Boolean(__props.column.checked(__props.row)),
3378
3180
  type: "checkbox",
3379
3181
  "aria-label": ariaLabel.value,
3380
3182
  tabindex: "-1",
3381
3183
  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));
3184
+ }, null, 40, _hoisted_2$7)]);
3387
3185
  };
3388
3186
  }
3389
3187
  });
@@ -3472,9 +3270,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3472
3270
  checked() {
3473
3271
  return __props.state;
3474
3272
  },
3475
- editable() {
3476
- return true;
3477
- },
3478
3273
  update() {
3479
3274
  emit("toggle", __props.row);
3480
3275
  },
@@ -3516,6 +3311,249 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
3516
3311
  };
3517
3312
  }
3518
3313
  });
3314
+ function isFTableCellApi(value) {
3315
+ return value !== null && typeof value === "object" && Boolean(value.tabstopEl);
3316
+ }
3317
+ const tableCellApiSymbol = /* @__PURE__ */ Symbol("table:cell-api");
3318
+ const navKeys = /* @__PURE__ */ new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"]);
3319
+ let prevCellIndex = void 0;
3320
+ function getCellTarget(tableElement, rowIndex, cellIndex) {
3321
+ return tableElement.rows[rowIndex].cells[cellIndex];
3322
+ }
3323
+ function getTr(td) {
3324
+ return td.parentElement;
3325
+ }
3326
+ function getTable(tr) {
3327
+ return tr.closest("table");
3328
+ }
3329
+ function getLastRowIndex(tableElement) {
3330
+ return tableElement.rows.length - 1;
3331
+ }
3332
+ function getLastCellIndex(tableElement) {
3333
+ return tableElement.rows[0].cells.length - 1;
3334
+ }
3335
+ function getVerticalNavIndex(table, from, to) {
3336
+ const target = {
3337
+ ...to
3338
+ };
3339
+ const currentMax = table.rows[from.row].cells.length - 1;
3340
+ const targetMax = table.rows[to.row].cells.length - 1;
3341
+ if (prevCellIndex && currentMax < targetMax) {
3342
+ target.cell = prevCellIndex;
3343
+ prevCellIndex = void 0;
3344
+ } else {
3345
+ target.cell = Math.min(targetMax, from.cell);
3346
+ }
3347
+ if (targetMax < from.cell) {
3348
+ prevCellIndex = from.cell;
3349
+ }
3350
+ return target;
3351
+ }
3352
+ function isDefined(value) {
3353
+ return value.row !== void 0 && value.cell !== void 0;
3354
+ }
3355
+ function navigate(e, table, from, last) {
3356
+ if (!isDefined(from) || !isDefined(last)) {
3357
+ return;
3358
+ }
3359
+ if (!navKeys.has(e.code)) {
3360
+ return;
3361
+ }
3362
+ e.preventDefault();
3363
+ if (e.code === "ArrowLeft") {
3364
+ if (from.cell === 0) {
3365
+ return;
3366
+ }
3367
+ prevCellIndex = void 0;
3368
+ return {
3369
+ row: from.row,
3370
+ cell: from.cell - 1
3371
+ };
3372
+ }
3373
+ if (e.code === "ArrowRight") {
3374
+ if (from.cell === last.cell) {
3375
+ return;
3376
+ }
3377
+ const lastCellIndex = table.rows[from.row].cells.length - 1;
3378
+ if (lastCellIndex <= from.cell) {
3379
+ return;
3380
+ }
3381
+ prevCellIndex = void 0;
3382
+ return {
3383
+ row: from.row,
3384
+ cell: from.cell + 1
3385
+ };
3386
+ }
3387
+ if (e.code === "ArrowUp") {
3388
+ if (from.row === 0) {
3389
+ return;
3390
+ }
3391
+ const to = {
3392
+ row: from.row - 1,
3393
+ cell: from.cell
3394
+ };
3395
+ return getVerticalNavIndex(table, from, to);
3396
+ }
3397
+ if (e.code === "ArrowDown") {
3398
+ if (from.row === last.row) {
3399
+ return;
3400
+ }
3401
+ const to = {
3402
+ row: from.row + 1,
3403
+ cell: from.cell
3404
+ };
3405
+ return getVerticalNavIndex(table, from, to);
3406
+ }
3407
+ if (e.code === "Home") {
3408
+ if (e.ctrlKey) {
3409
+ return {
3410
+ row: 1,
3411
+ cell: 0
3412
+ };
3413
+ } else {
3414
+ return {
3415
+ row: from.row,
3416
+ cell: 0
3417
+ };
3418
+ }
3419
+ }
3420
+ if (e.code === "End") {
3421
+ if (e.ctrlKey) {
3422
+ return {
3423
+ row: last.row,
3424
+ cell: table.rows[last.row].cells.length - 1
3425
+ };
3426
+ } else {
3427
+ return {
3428
+ row: from.row,
3429
+ cell: table.rows[from.row].cells.length - 1
3430
+ };
3431
+ }
3432
+ }
3433
+ }
3434
+ function getCell(element) {
3435
+ const closest = element.closest("td, th");
3436
+ if (!closest) {
3437
+ throw new Error("expected th or td parent");
3438
+ }
3439
+ return closest;
3440
+ }
3441
+ async function setDefaultCellTarget(table) {
3442
+ await nextTick();
3443
+ if (!table.tHead) {
3444
+ return null;
3445
+ }
3446
+ const target = getCellTarget(table, 1, 0);
3447
+ activateCell(target, {
3448
+ focus: false
3449
+ });
3450
+ return target;
3451
+ }
3452
+ function maybeNavigateToCell(e) {
3453
+ let newCellTarget = e.target;
3454
+ const cell = getCell(e.target);
3455
+ const tr = getTr(cell);
3456
+ const table = getTable(tr);
3457
+ const fromIndex = {
3458
+ row: tr.rowIndex,
3459
+ cell: cell.cellIndex
3460
+ };
3461
+ const lastIndex = {
3462
+ row: getLastRowIndex(table),
3463
+ cell: getLastCellIndex(table)
3464
+ };
3465
+ const navigateTo = navigate(e, table, fromIndex, lastIndex);
3466
+ if (navigateTo) {
3467
+ newCellTarget = getCellTarget(table, navigateTo.row, navigateTo.cell);
3468
+ activateCell(newCellTarget, {
3469
+ focus: true
3470
+ });
3471
+ }
3472
+ }
3473
+ function activateCell(element, options) {
3474
+ var _toValue;
3475
+ const api = element[tableCellApiSymbol];
3476
+ const targetEl = (_toValue = toValue(api?.tabstopEl)) !== null && _toValue !== void 0 ? _toValue : element;
3477
+ targetEl.tabIndex = 0;
3478
+ if (options?.focus) {
3479
+ targetEl.focus();
3480
+ }
3481
+ return targetEl;
3482
+ }
3483
+ function stopEdit(element, reason) {
3484
+ const td = getCell(element);
3485
+ const tr = getTr(td);
3486
+ const table = getTable(tr);
3487
+ const rowIndex = tr.rowIndex;
3488
+ const cellIndex = td.cellIndex;
3489
+ const lastRowIndex = getLastRowIndex(table);
3490
+ const lastCellIndex = getLastCellIndex(table);
3491
+ let newCellTarget = td;
3492
+ switch (reason) {
3493
+ case "enter": {
3494
+ const nextRowIndex = rowIndex + 1;
3495
+ const hasFooter = Boolean(table.tFoot);
3496
+ const isLastRow = rowIndex === lastRowIndex;
3497
+ const footerNext = hasFooter && nextRowIndex === lastRowIndex;
3498
+ if (!isLastRow && !footerNext) {
3499
+ newCellTarget = getCellTarget(table, nextRowIndex, cellIndex);
3500
+ activateCell(newCellTarget, {
3501
+ focus: true
3502
+ });
3503
+ } else {
3504
+ activateCell(newCellTarget, {
3505
+ focus: true
3506
+ });
3507
+ }
3508
+ return newCellTarget;
3509
+ }
3510
+ case "escape": {
3511
+ activateCell(newCellTarget, {
3512
+ focus: true
3513
+ });
3514
+ return newCellTarget;
3515
+ }
3516
+ case "tab": {
3517
+ if (cellIndex === lastCellIndex && rowIndex === lastRowIndex) {
3518
+ activateCell(newCellTarget, {
3519
+ focus: true
3520
+ });
3521
+ } else if (cellIndex === lastCellIndex) {
3522
+ newCellTarget = getCellTarget(table, rowIndex + 1, 0);
3523
+ activateCell(newCellTarget, {
3524
+ focus: true
3525
+ });
3526
+ } else {
3527
+ newCellTarget = getCellTarget(table, rowIndex, cellIndex + 1);
3528
+ activateCell(newCellTarget, {
3529
+ focus: true
3530
+ });
3531
+ }
3532
+ return newCellTarget;
3533
+ }
3534
+ case "shift-tab": {
3535
+ if (cellIndex === 0 && rowIndex === 1) {
3536
+ activateCell(newCellTarget, {
3537
+ focus: true
3538
+ });
3539
+ } else if (cellIndex === 0) {
3540
+ newCellTarget = getCellTarget(table, rowIndex - 1, 0);
3541
+ activateCell(newCellTarget, {
3542
+ focus: true
3543
+ });
3544
+ } else {
3545
+ newCellTarget = getCellTarget(table, rowIndex, cellIndex - 1);
3546
+ activateCell(newCellTarget, {
3547
+ focus: true
3548
+ });
3549
+ }
3550
+ return newCellTarget;
3551
+ }
3552
+ case "blur": {
3553
+ return newCellTarget;
3554
+ }
3555
+ }
3556
+ }
3519
3557
  function walk(array, childKey, visit, level = 1) {
3520
3558
  for (const item of array) {
3521
3559
  const visitChildren = visit(item, level);
@@ -3581,7 +3619,7 @@ function requireDoesNotExceedSafeInteger() {
3581
3619
  var $TypeError = TypeError;
3582
3620
  var MAX_SAFE_INTEGER = 9007199254740991;
3583
3621
  doesNotExceedSafeInteger = function(it) {
3584
- if (it > MAX_SAFE_INTEGER) throw $TypeError("Maximum allowed index exceeded");
3622
+ if (it > MAX_SAFE_INTEGER) throw new $TypeError("Maximum allowed index exceeded");
3585
3623
  return it;
3586
3624
  };
3587
3625
  return doesNotExceedSafeInteger;
@@ -3717,12 +3755,8 @@ function requireEs_iterator_map() {
3717
3755
  return es_iterator_map;
3718
3756
  }
3719
3757
  requireEs_iterator_map();
3720
- const _hoisted_1$7 = {
3721
- key: 0,
3722
- class: "table-ng__cell table-ng__cell--anchor"
3723
- };
3724
- const _hoisted_2$5 = ["href"];
3725
- const _hoisted_3$4 = {
3758
+ const _hoisted_1$7 = ["href"];
3759
+ const _hoisted_2$5 = {
3726
3760
  key: 1,
3727
3761
  ref: "target",
3728
3762
  tabindex: "-1",
@@ -3743,13 +3777,18 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3743
3777
  };
3744
3778
  __expose(expose);
3745
3779
  return (_ctx, _cache) => {
3746
- return __props.column.text(__props.row) ? (openBlock(), createElementBlock("td", _hoisted_1$7, [createElementVNode("a", {
3780
+ return __props.column.text(__props.row) ? (openBlock(), createElementBlock("td", {
3781
+ key: 0,
3782
+ class: "table-ng__cell table-ng__cell--anchor",
3783
+ onKeydown: _cache[0] || (_cache[0] = withKeys(withModifiers(() => {
3784
+ }, ["prevent"]), ["space"]))
3785
+ }, [createElementVNode("a", {
3747
3786
  ref: "target",
3748
3787
  class: "anchor anchor--block",
3749
3788
  target: "_blank",
3750
3789
  href: __props.column.href,
3751
3790
  tabindex: "-1"
3752
- }, toDisplayString(__props.column.text(__props.row)), 9, _hoisted_2$5)])) : (openBlock(), createElementBlock("td", _hoisted_3$4, null, 512));
3791
+ }, toDisplayString(__props.column.text(__props.row)), 9, _hoisted_1$7)], 32)) : (openBlock(), createElementBlock("td", _hoisted_2$5, null, 512));
3753
3792
  };
3754
3793
  }
3755
3794
  });
@@ -3970,7 +4009,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3970
4009
  const activeOptionId = ElementIdService.generateElementId();
3971
4010
  const activeOption = ref(null);
3972
4011
  async function onCellKeyDown(e) {
3973
- if (e.code === "Enter" || e.code === "NumpadEnter") {
4012
+ if (e.code === "Enter" || e.code === "NumpadEnter" || e.code === "Space") {
3974
4013
  await startEditing(e);
3975
4014
  }
3976
4015
  }
@@ -4214,6 +4253,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4214
4253
  const hasError = computed(() => validity.value.validityMode === "ERROR");
4215
4254
  const viewModeAriaInvalid = computed(() => !inEdit.value && hasError.value ? true : void 0);
4216
4255
  const viewModeErrorMessage = computed(() => !inEdit.value && hasError.value ? validity.value.validationMessage : void 0);
4256
+ let initialValidity = {
4257
+ ...validity.value
4258
+ };
4217
4259
  const divClasses = computed(() => {
4218
4260
  return {
4219
4261
  "table-ng__editable": true,
@@ -4295,22 +4337,38 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4295
4337
  }
4296
4338
  function setUpFakeValidation(el) {
4297
4339
  assertRef(inputElement);
4340
+ const input = inputElement.value;
4341
+ function emitFakeValidity(nativeEvent) {
4342
+ const fakeEvent = new CustomEvent("validity", {
4343
+ detail: {
4344
+ isValid: true,
4345
+ nativeEvent,
4346
+ validityMode: "INITIAL",
4347
+ validationMessage: "",
4348
+ target: input,
4349
+ elementId: String(input.id)
4350
+ }
4351
+ });
4352
+ onValidity(fakeEvent);
4353
+ }
4298
4354
  const nativeEvents = ["change", "blur"];
4299
4355
  for (const nativeEvent of nativeEvents) {
4300
4356
  useEventListener(el, nativeEvent, () => {
4301
- const fakeEvent = new CustomEvent("validity", {
4302
- detail: {
4303
- isValid: true,
4304
- nativeEvent,
4305
- validityMode: "INITIAL",
4306
- validationMessage: "",
4307
- target: inputElement.value,
4308
- elementId: String(inputElement.value.id)
4309
- }
4310
- });
4311
- onValidity(fakeEvent);
4357
+ emitFakeValidity(nativeEvent);
4312
4358
  });
4313
4359
  }
4360
+ validationFacade = {
4361
+ validateElement: () => {
4362
+ emitFakeValidity("validate");
4363
+ return Promise.resolve({
4364
+ isValid: true,
4365
+ error: "",
4366
+ isSubmitted: false,
4367
+ isTouched: false
4368
+ });
4369
+ },
4370
+ dispatchComponentValidityEvent: () => void 0
4371
+ };
4314
4372
  useEventListener(el, "input", onPendingValidity);
4315
4373
  useEventListener(el, "component-validity", (e) => {
4316
4374
  e.stopPropagation();
@@ -4361,6 +4419,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4361
4419
  width
4362
4420
  } = tdElement.value.getBoundingClientRect();
4363
4421
  initialViewValue = viewValue.value;
4422
+ initialValidity = {
4423
+ ...validity.value
4424
+ };
4364
4425
  viewValue.value = value;
4365
4426
  tdElement.value.style.setProperty("width", `${String(width)}px`);
4366
4427
  inputElement.value.tabIndex = 0;
@@ -4375,6 +4436,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4375
4436
  inputElement.value.tabIndex = -1;
4376
4437
  assertRef(tdElement);
4377
4438
  tdElement.value.style.removeProperty("width");
4439
+ if (reason === "blur") {
4440
+ tdElement.value.tabIndex = 0;
4441
+ }
4378
4442
  void stopEdit2(inputElement.value, reason);
4379
4443
  }
4380
4444
  function fromColumnValue() {
@@ -4423,11 +4487,15 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4423
4487
  switch (event.key) {
4424
4488
  case "Enter": {
4425
4489
  if (viewValue.value === initialViewValue) {
4490
+ validity.value = {
4491
+ ...initialValidity
4492
+ };
4426
4493
  onStopEdit({
4427
4494
  reason: "enter"
4428
4495
  });
4429
4496
  } else {
4430
4497
  pendingStopEditReason = "enter";
4498
+ void validationFacade.validateElement(inputElement.value);
4431
4499
  }
4432
4500
  break;
4433
4501
  }
@@ -4509,7 +4577,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4509
4577
  onKeydown
4510
4578
  }, [createElementVNode("div", {
4511
4579
  class: normalizeClass(divClasses.value)
4512
- }, [createElementVNode("span", _hoisted_2$2, toDisplayString(fromColumnValue()), 1), _cache[1] || (_cache[1] = createTextVNode()), viewModeErrorMessage.value ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(viewModeErrorMessage.value), 1)) : createCommentVNode("", true), _cache[2] || (_cache[2] = createTextVNode()), withDirectives(createElementVNode("input", mergeProps({
4580
+ }, [createElementVNode("span", _hoisted_2$2, toDisplayString(fromColumnValue()), 1), _cache[2] || (_cache[2] = createTextVNode()), viewModeErrorMessage.value ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(viewModeErrorMessage.value), 1)) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), withDirectives(createElementVNode("input", mergeProps({
4513
4581
  id: unref(inputId),
4514
4582
  ref: "input",
4515
4583
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => viewValue.value = $event),
@@ -4525,7 +4593,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4525
4593
  "aria-hidden": !inEdit.value,
4526
4594
  onValidity,
4527
4595
  onPendingValidity
4528
- }), null, 16, _hoisted_4$2), [[vModelText, viewValue.value]])], 2), _cache[3] || (_cache[3] = createTextVNode()), createVNode(unref(IPopupError), {
4596
+ }), null, 16, _hoisted_4$2), [[vModelText, viewValue.value]])], 2), _cache[4] || (_cache[4] = createTextVNode()), createVNode(unref(IPopupError), {
4529
4597
  anchor: tdElement.value,
4530
4598
  "is-open": openPopupError.value,
4531
4599
  "error-message": validity.value.validationMessage,
@@ -4535,57 +4603,57 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
4535
4603
  key: 1,
4536
4604
  ref: "td",
4537
4605
  tabindex: "-1",
4538
- class: normalizeClass(staticClasses.value)
4539
- }, toDisplayString(fromColumnValue()), 3));
4606
+ class: normalizeClass(staticClasses.value),
4607
+ onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
4608
+ }, ["prevent"]), ["space"]))
4609
+ }, toDisplayString(fromColumnValue()), 35));
4540
4610
  };
4541
4611
  }
4542
4612
  });
4543
4613
  function normalizeAnchorColumn(column) {
4544
- var _column$key;
4545
4614
  return {
4546
4615
  type: "anchor",
4547
4616
  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
4617
+ href: column.href
4550
4618
  };
4551
4619
  }
4620
+ function getSortable(column) {
4621
+ var _column$sort, _column$key;
4622
+ const shouldSort = (_column$sort = column.sort) !== null && _column$sort !== void 0 ? _column$sort : !!column.key;
4623
+ return shouldSort ? (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null : null;
4624
+ }
4552
4625
  function normalizeBaseColumn(column) {
4553
4626
  var _column$enabled;
4554
4627
  const id = /* @__PURE__ */ Symbol();
4555
4628
  const header = toRef(column.header);
4556
4629
  const description = column.description !== void 0 ? toRef(column.description) : ref("");
4557
4630
  const size = column.size !== void 0 ? toRef(column.size) : ref("grow");
4631
+ const sortable = getSortable(column);
4558
4632
  return {
4559
4633
  id,
4560
4634
  header,
4561
4635
  description,
4636
+ sortable,
4562
4637
  size,
4563
4638
  enabled: (_column$enabled = column.enabled) !== null && _column$enabled !== void 0 ? _column$enabled : true
4564
4639
  };
4565
4640
  }
4566
4641
  function normalizeButtonColumn(column) {
4567
- var _column$icon, _column$key;
4642
+ var _column$icon;
4568
4643
  return {
4569
4644
  type: "button",
4570
4645
  text: getValueFn(column.text, column.key, String, ""),
4571
4646
  onClick: column.onClick,
4572
4647
  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
4648
+ iconLibrary: column.iconLibrary
4575
4649
  };
4576
4650
  }
4577
4651
  function normalizeCheckboxColumn(column) {
4578
- var _column$key;
4579
4652
  return {
4580
4653
  type: "checkbox",
4581
4654
  label: getLabelFn(column.label),
4582
4655
  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
4656
+ update: getUpdateFn(column.update, column.key)
4589
4657
  };
4590
4658
  }
4591
4659
  function noop() {
@@ -4595,7 +4663,6 @@ function normalizeMenuColumn(column) {
4595
4663
  return {
4596
4664
  type: "menu",
4597
4665
  text: getValueFn(column.text, void 0, String, ""),
4598
- sortable: null,
4599
4666
  actions: ((_column$actions = column.actions) !== null && _column$actions !== void 0 ? _column$actions : []).map((it) => {
4600
4667
  var _it$icon, _it$onClick;
4601
4668
  return {
@@ -4607,7 +4674,7 @@ function normalizeMenuColumn(column) {
4607
4674
  };
4608
4675
  }
4609
4676
  function normalizeNumberColumn(column) {
4610
- var _column$parser, _column$formatter, _column$tnum, _column$align, _column$validation, _column$key;
4677
+ var _column$parser, _column$formatter, _column$tnum, _column$align, _column$validation;
4611
4678
  const type = column.type;
4612
4679
  const config = inputFieldConfig[type];
4613
4680
  const parser = (_column$parser = column.parser) !== null && _column$parser !== void 0 ? _column$parser : config.parser.bind(column);
@@ -4628,21 +4695,10 @@ function normalizeNumberColumn(column) {
4628
4695
  },
4629
4696
  validation: (_column$validation = column.validation) !== null && _column$validation !== void 0 ? _column$validation : {},
4630
4697
  hasValidation: column.type.startsWith("text:") || Boolean(column.validation),
4631
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null,
4632
4698
  formatter,
4633
4699
  parser
4634
4700
  };
4635
4701
  }
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
4702
  function normalizeRenderColumn(column) {
4647
4703
  return {
4648
4704
  type: void 0,
@@ -4651,15 +4707,12 @@ function normalizeRenderColumn(column) {
4651
4707
  };
4652
4708
  }
4653
4709
  function normalizeRowHeaderColumn(column) {
4654
- var _column$key;
4655
4710
  return {
4656
4711
  type: "rowheader",
4657
- text: getValueFn(column.text, column.key, String, ""),
4658
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null
4712
+ text: getValueFn(column.text, column.key, String, "")
4659
4713
  };
4660
4714
  }
4661
4715
  function normalizeSelectColumn(column) {
4662
- var _column$key;
4663
4716
  return {
4664
4717
  type: "select",
4665
4718
  label: getLabelFn(column.label),
@@ -4669,12 +4722,10 @@ function normalizeSelectColumn(column) {
4669
4722
  var _column$editable;
4670
4723
  return Boolean((_column$editable = column.editable) !== null && _column$editable !== void 0 ? _column$editable : false);
4671
4724
  },
4672
- options: column.options,
4673
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null
4725
+ options: column.options
4674
4726
  };
4675
4727
  }
4676
4728
  function normalizeSimpleColumn(column) {
4677
- var _column$key;
4678
4729
  return {
4679
4730
  type: "text",
4680
4731
  label: () => "",
@@ -4684,7 +4735,6 @@ function normalizeSimpleColumn(column) {
4684
4735
  update() {
4685
4736
  },
4686
4737
  editable: () => false,
4687
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null,
4688
4738
  validation: {},
4689
4739
  hasValidation: false,
4690
4740
  formatter: (value) => value,
@@ -4692,7 +4742,7 @@ function normalizeSimpleColumn(column) {
4692
4742
  };
4693
4743
  }
4694
4744
  function normalizeTextColumn(column) {
4695
- var _column$parser, _column$formatter, _column$tnum, _column$align, _column$validation, _column$key;
4745
+ var _column$parser, _column$formatter, _column$tnum, _column$align, _column$validation;
4696
4746
  const type = column.type;
4697
4747
  const config = inputFieldConfig[type];
4698
4748
  const parser = (_column$parser = column.parser) !== null && _column$parser !== void 0 ? _column$parser : config.parser;
@@ -4711,7 +4761,6 @@ function normalizeTextColumn(column) {
4711
4761
  },
4712
4762
  validation: (_column$validation = column.validation) !== null && _column$validation !== void 0 ? _column$validation : {},
4713
4763
  hasValidation: column.type.startsWith("text:") || Boolean(column.validation),
4714
- sortable: (_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : null,
4715
4764
  formatter,
4716
4765
  parser
4717
4766
  };
@@ -4719,32 +4768,26 @@ function normalizeTextColumn(column) {
4719
4768
  function normalizeTableColumn(column) {
4720
4769
  const base = normalizeBaseColumn(column);
4721
4770
  if ("render" in column) {
4722
- return {
4771
+ return Object.freeze({
4723
4772
  ...normalizeRenderColumn(column),
4724
4773
  ...base
4725
- };
4774
+ });
4726
4775
  }
4727
4776
  switch (column.type) {
4728
4777
  case "checkbox":
4729
- return {
4778
+ return Object.freeze({
4730
4779
  ...normalizeCheckboxColumn(column),
4731
4780
  ...base,
4732
4781
  component: _sfc_main$c
4733
- };
4734
- case "radio":
4735
- return {
4736
- ...normalizeRadioColumn(column),
4737
- ...base,
4738
- component: _sfc_main$b
4739
- };
4782
+ });
4740
4783
  case "text:currency":
4741
4784
  case "text:number":
4742
4785
  case "text:percent":
4743
- return {
4786
+ return Object.freeze({
4744
4787
  ...normalizeNumberColumn(column),
4745
4788
  ...base,
4746
4789
  component: _sfc_main$4
4747
- };
4790
+ });
4748
4791
  case "text":
4749
4792
  case "text:bankAccountNumber":
4750
4793
  case "text:bankgiro":
@@ -4756,47 +4799,47 @@ function normalizeTableColumn(column) {
4756
4799
  case "text:phoneNumber":
4757
4800
  case "text:plusgiro":
4758
4801
  case "text:postalCode":
4759
- return {
4802
+ return Object.freeze({
4760
4803
  ...normalizeTextColumn(column),
4761
4804
  ...base,
4762
4805
  component: _sfc_main$4
4763
- };
4806
+ });
4764
4807
  case "rowheader":
4765
- return {
4808
+ return Object.freeze({
4766
4809
  ...normalizeRowHeaderColumn(column),
4767
4810
  ...base,
4768
4811
  component: _sfc_main$6
4769
- };
4812
+ });
4770
4813
  case "anchor":
4771
- return {
4814
+ return Object.freeze({
4772
4815
  ...normalizeAnchorColumn(column),
4773
4816
  ...base,
4774
4817
  component: _sfc_main$9
4775
- };
4818
+ });
4776
4819
  case "button":
4777
- return {
4820
+ return Object.freeze({
4778
4821
  ...normalizeButtonColumn(column),
4779
4822
  ...base,
4780
4823
  component: _sfc_main$8
4781
- };
4824
+ });
4782
4825
  case "select":
4783
- return {
4826
+ return Object.freeze({
4784
4827
  ...normalizeSelectColumn(column),
4785
4828
  ...base,
4786
4829
  component: _sfc_main$5
4787
- };
4830
+ });
4788
4831
  case "menu":
4789
- return {
4832
+ return Object.freeze({
4790
4833
  ...normalizeMenuColumn(column),
4791
4834
  ...base,
4792
4835
  component: _sfc_main$7
4793
- };
4836
+ });
4794
4837
  case void 0:
4795
- return {
4838
+ return Object.freeze({
4796
4839
  ...normalizeSimpleColumn(column),
4797
4840
  ...base,
4798
4841
  component: _sfc_main$4
4799
- };
4842
+ });
4800
4843
  }
4801
4844
  }
4802
4845
  function defineTableColumns(columns) {
@@ -4817,16 +4860,11 @@ function usePopupError() {
4817
4860
  anchor,
4818
4861
  arrowAnchor,
4819
4862
  hasFocus,
4820
- hasHover,
4821
- inEdit
4863
+ hasHover
4822
4864
  } = popupError;
4823
4865
  if (!anchor || !arrowAnchor) {
4824
4866
  return;
4825
4867
  }
4826
- if (inEdit) {
4827
- onClosePopupError(popupError);
4828
- return;
4829
- }
4830
4868
  if (hasFocus || hasHover) {
4831
4869
  await open(popupError);
4832
4870
  } else {
@@ -4899,27 +4937,6 @@ function requireGetBuiltInPrototypeMethod() {
4899
4937
  };
4900
4938
  return getBuiltInPrototypeMethod;
4901
4939
  }
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
4940
  var hasRequiredEs_array_toSorted;
4924
4941
  function requireEs_array_toSorted() {
4925
4942
  if (hasRequiredEs_array_toSorted) return es_array_toSorted;
@@ -5068,8 +5085,8 @@ function useSelectable(options) {
5068
5085
  };
5069
5086
  }
5070
5087
  function matching(needle) {
5071
- const id = getItemIdentifier(needle);
5072
- return (item) => getItemIdentifier(item) === id;
5088
+ const id = getItemIdentifier(needle.row);
5089
+ return (item) => getItemIdentifier(item.row) === id;
5073
5090
  }
5074
5091
  function useTabstop(tableRef, metaRows) {
5075
5092
  let pendingRowRemoval = false;
@@ -5200,26 +5217,32 @@ const _hoisted_2$1 = {
5200
5217
  "data-test": "caption"
5201
5218
  };
5202
5219
  const _hoisted_3$1 = {
5220
+ key: 1
5221
+ };
5222
+ const _hoisted_4$1 = {
5203
5223
  class: "table-ng__row",
5204
5224
  "aria-rowindex": "1"
5205
5225
  };
5206
- const _hoisted_4$1 = {
5226
+ const _hoisted_5$1 = {
5207
5227
  key: 0,
5208
5228
  scope: "col",
5209
5229
  tabindex: "-1",
5210
5230
  class: "table-ng__column"
5211
5231
  };
5212
- const _hoisted_5$1 = {
5232
+ const _hoisted_6$1 = {
5233
+ key: 2
5234
+ };
5235
+ const _hoisted_7$1 = {
5213
5236
  key: 0,
5214
5237
  class: "table-ng__row--empty"
5215
5238
  };
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
5239
+ const _hoisted_8 = ["colspan"];
5240
+ const _hoisted_9 = ["aria-level", "aria-rowindex", "aria-setsize", "aria-posinset", "aria-selected"];
5241
+ const _hoisted_10 = {
5242
+ key: 3
5220
5243
  };
5221
- const _hoisted_9 = ["aria-rowindex"];
5222
- const _hoisted_10 = ["colspan"];
5244
+ const _hoisted_11 = ["aria-rowindex"];
5245
+ const _hoisted_12 = ["colspan"];
5223
5246
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5224
5247
  __name: "FTable",
5225
5248
  props: /* @__PURE__ */ mergeModels({
@@ -5231,6 +5254,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5231
5254
  expandableAttribute: {
5232
5255
  default: () => void 0
5233
5256
  },
5257
+ rowClass: {
5258
+ type: Function,
5259
+ default: void 0
5260
+ },
5234
5261
  striped: {
5235
5262
  type: Boolean
5236
5263
  },
@@ -5270,20 +5297,35 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5270
5297
  return metaRows.value.length === 0;
5271
5298
  });
5272
5299
  const ariaRowcount = computed(() => {
5273
- const headerRow = 1;
5274
5300
  const footerRow = hasFooter.value ? 1 : 0;
5275
- return getBodyRowCount(keyedRows.value, __props.expandableAttribute) + headerRow + footerRow;
5301
+ if (!hasColumns.value) {
5302
+ return footerRow;
5303
+ }
5304
+ const headerRow = 1;
5305
+ const bodyRows = getBodyRowCount(keyedRows.value, __props.expandableAttribute);
5306
+ return bodyRows + headerRow + footerRow;
5307
+ });
5308
+ const fullColspan = computed(() => {
5309
+ if (!hasColumns.value) {
5310
+ return 0;
5311
+ }
5312
+ let count = columns.value.length;
5313
+ if (isTreegrid.value) {
5314
+ count += 1;
5315
+ }
5316
+ if (__props.selectable) {
5317
+ count += 1;
5318
+ }
5319
+ return count;
5276
5320
  });
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);
5321
+ const expandedColspan = computed(() => {
5322
+ return fullColspan.value - 1;
5282
5323
  });
5283
5324
  const hasFooter = computed(() => {
5284
5325
  return hasSlot("footer");
5285
5326
  });
5286
5327
  const columns = computed(() => normalizeTableColumns(__props.columns).filter((col) => toValue(col.enabled)));
5328
+ const hasColumns = computed(() => columns.value.length > 0);
5287
5329
  const tableClasses = computed(() => {
5288
5330
  return ["table-ng", {
5289
5331
  "table-ng--striped": __props.striped,
@@ -5298,6 +5340,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5298
5340
  stopEdit(element, reason);
5299
5341
  }
5300
5342
  provide(stopEditKey, stopEditHandler);
5343
+ function getRowClass(row) {
5344
+ return typeof __props.rowClass === "function" ? __props.rowClass(row) : void 0;
5345
+ }
5301
5346
  function onToggleExpanded(key) {
5302
5347
  if (expandedKeys.value.has(key)) {
5303
5348
  expandedKeys.value.delete(key);
@@ -5429,7 +5474,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5429
5474
  selectedRows,
5430
5475
  rows: keyedRows
5431
5476
  });
5432
- const tableApi = useTabstop(tableRef, keyedRows);
5477
+ const tableApi = useTabstop(tableRef, metaRows);
5433
5478
  __expose(tableApi);
5434
5479
  onMounted(() => {
5435
5480
  assertRef(tableRef);
@@ -5447,13 +5492,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5447
5492
  onFocusout: onTableFocusout,
5448
5493
  onClick,
5449
5494
  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, {
5495
+ }, [hasCaption.value ? (openBlock(), createElementBlock("caption", _hoisted_2$1, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[6] || (_cache[6] = 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[2] || (_cache[2] = createTextVNode()), __props.selectable ? (openBlock(), createBlock(_sfc_main$d, {
5451
5496
  key: 1,
5452
5497
  ref: bindCellApiRef,
5453
5498
  state: unref(selectableHeaderState)(),
5454
5499
  selectable: __props.selectable,
5455
5500
  onToggle: unref(toggleSelectableHeader)
5456
- }, null, 8, ["state", "selectable", "onToggle"])) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
5501
+ }, null, 8, ["state", "selectable", "onToggle"])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
5457
5502
  return openBlock(), createBlock(_sfc_main$e, {
5458
5503
  key: column.id,
5459
5504
  column,
@@ -5462,10 +5507,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5462
5507
  scope: "col",
5463
5508
  onToggleSortOrder
5464
5509
  }, 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,
5467
- 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, {
5510
+ }), 128))])])) : createCommentVNode("", true), _cache[7] || (_cache[7] = createTextVNode()), hasColumns.value ? (openBlock(), createElementBlock("tbody", _hoisted_6$1, [isEmpty2.value ? (openBlock(), createElementBlock("tr", _hoisted_7$1, [createElementVNode("td", {
5511
+ colspan: fullColspan.value,
5512
+ class: "table-ng__cell",
5513
+ onKeydown: _cache[0] || (_cache[0] = withKeys(withModifiers(() => {
5514
+ }, ["prevent"]), ["space"]))
5515
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref($t)("fkui.ftable.empty.text", "Tabellen är tom")), 1)])], 40, _hoisted_8)])) : (openBlock(true), createElementBlock(Fragment, {
5469
5516
  key: 1
5470
5517
  }, renderList(metaRows.value, ({
5471
5518
  key,
@@ -5479,7 +5526,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5479
5526
  }) => {
5480
5527
  return openBlock(), createElementBlock("tr", {
5481
5528
  key,
5482
- class: "table-ng__row",
5529
+ class: normalizeClass(["table-ng__row", getRowClass(row)]),
5483
5530
  "aria-level": level,
5484
5531
  "aria-rowindex": rowIndex,
5485
5532
  "aria-setsize": setsize,
@@ -5493,9 +5540,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5493
5540
  "is-expanded": isExpanded,
5494
5541
  "row-key": key,
5495
5542
  onToggle: onToggleExpanded
5496
- }, null, 8, ["is-expandable", "is-expanded", "row-key"])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), level > 1 && hasExpandableSlot.value ? (openBlock(), createBlock(_sfc_main$f, {
5543
+ }, null, 8, ["is-expandable", "is-expanded", "row-key"])) : createCommentVNode("", true), _cache[5] || (_cache[5] = createTextVNode()), level > 1 && hasExpandableSlot.value ? (openBlock(), createBlock(_sfc_main$f, {
5497
5544
  key: 1,
5498
- colspan: columns.value.length
5545
+ colspan: expandedColspan.value
5499
5546
  }, {
5500
5547
  default: withCtx(() => [renderSlot(_ctx.$slots, "expandable", mergeProps({
5501
5548
  ref_for: true
@@ -5514,7 +5561,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5514
5561
  state: unref(selectableRowState)(row),
5515
5562
  row,
5516
5563
  onToggle: unref(toggleSelectableRow)
5517
- }, null, 8, ["level", "selectable", "state", "row", "onToggle"])) : createCommentVNode("", true), _cache[2] || (_cache[2] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
5564
+ }, null, 8, ["level", "selectable", "state", "row", "onToggle"])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
5518
5565
  return openBlock(), createElementBlock(Fragment, {
5519
5566
  key: column.id
5520
5567
  }, ["component" in column ? (openBlock(), createBlock(resolveDynamicComponent(column.component), {
@@ -5530,17 +5577,30 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
5530
5577
  key: 1,
5531
5578
  row
5532
5579
  }, 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", {
5580
+ }), 128))], 64))], 10, _hoisted_9);
5581
+ }), 128))])) : createCommentVNode("", true), _cache[8] || (_cache[8] = createTextVNode()), hasFooter.value ? (openBlock(), createElementBlock("tfoot", _hoisted_10, [createElementVNode("tr", {
5535
5582
  class: "table-ng__row",
5536
5583
  "aria-rowindex": ariaRowcount.value
5537
5584
  }, [createElementVNode("td", {
5538
- colspan: columnCount.value,
5539
- class: "table-ng__cell--custom"
5540
- }, [renderSlot(_ctx.$slots, "footer")], 8, _hoisted_10)], 8, _hoisted_9)])) : createCommentVNode("", true)], 42, _hoisted_1$2);
5585
+ colspan: fullColspan.value,
5586
+ class: "table-ng__cell--custom",
5587
+ onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
5588
+ }, ["prevent"]), ["space"]))
5589
+ }, [renderSlot(_ctx.$slots, "footer")], 40, _hoisted_12)], 8, _hoisted_11)])) : createCommentVNode("", true)], 42, _hoisted_1$2);
5541
5590
  };
5542
5591
  }
5543
5592
  });
5593
+ function isSortable(column) {
5594
+ return "key" in column && column.key !== void 0 && column.sort !== false;
5595
+ }
5596
+ function toEntry(column) {
5597
+ return [column.key, column.header];
5598
+ }
5599
+ function getTableSortableAttributes(columns) {
5600
+ const sortable = columns.filter(isSortable);
5601
+ const attributes = sortable.map(toEntry);
5602
+ return Object.fromEntries(attributes);
5603
+ }
5544
5604
  var es_array_toSpliced = {};
5545
5605
  var hasRequiredEs_array_toSpliced;
5546
5606
  function requireEs_array_toSpliced() {
@@ -5839,6 +5899,7 @@ function requireArrayBufferTransfer() {
5839
5899
  var structuredClone = globalThis2.structuredClone;
5840
5900
  var ArrayBuffer2 = globalThis2.ArrayBuffer;
5841
5901
  var DataView2 = globalThis2.DataView;
5902
+ var max = Math.max;
5842
5903
  var min = Math.min;
5843
5904
  var ArrayBufferPrototype = ArrayBuffer2.prototype;
5844
5905
  var DataViewPrototype = DataView2.prototype;
@@ -5863,7 +5924,7 @@ function requireArrayBufferTransfer() {
5863
5924
  newBuffer = slice(arrayBuffer, 0, newByteLength);
5864
5925
  } else {
5865
5926
  var options = preserveResizability && !fixedLength && maxByteLength ? {
5866
- maxByteLength: maxByteLength(arrayBuffer)
5927
+ maxByteLength: max(newByteLength, maxByteLength(arrayBuffer))
5867
5928
  } : void 0;
5868
5929
  newBuffer = new ArrayBuffer2(newByteLength, options);
5869
5930
  var a = new DataView2(arrayBuffer);
@@ -5911,78 +5972,6 @@ function requireEs_arrayBuffer_transferToFixedLength() {
5911
5972
  return es_arrayBuffer_transferToFixedLength;
5912
5973
  }
5913
5974
  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
5975
  var es_typedArray_toReversed = {};
5987
5976
  var isPossiblePrototype;
5988
5977
  var hasRequiredIsPossiblePrototype;
@@ -6195,7 +6184,7 @@ function requireArrayBufferViewCore() {
6195
6184
  }
6196
6185
  });
6197
6186
  for (NAME in TypedArrayConstructorsList) if (globalThis2[NAME]) {
6198
- createNonEnumerableProperty2(globalThis2[NAME], TYPED_ARRAY_TAG, NAME);
6187
+ createNonEnumerableProperty2(globalThis2[NAME].prototype, TYPED_ARRAY_TAG, NAME);
6199
6188
  }
6200
6189
  }
6201
6190
  arrayBufferViewCore = {
@@ -6599,26 +6588,25 @@ function requireUint8FromHex() {
6599
6588
  var uncurryThis = requireFunctionUncurryThis();
6600
6589
  var Uint8Array2 = globalThis2.Uint8Array;
6601
6590
  var SyntaxError = globalThis2.SyntaxError;
6602
- var parseInt = globalThis2.parseInt;
6603
6591
  var min = Math.min;
6604
- var NOT_HEX = /[^\da-f]/i;
6605
- var exec = uncurryThis(NOT_HEX.exec);
6606
- var stringSlice = uncurryThis("".slice);
6592
+ var stringMatch = uncurryThis("".match);
6607
6593
  uint8FromHex = function(string, into) {
6608
6594
  var stringLength = string.length;
6609
6595
  if (stringLength % 2 !== 0) throw new SyntaxError("String should be an even number of characters");
6610
6596
  var maxLength = into ? min(into.length, stringLength / 2) : stringLength / 2;
6611
6597
  var bytes = into || new Uint8Array2(maxLength);
6612
- var read = 0;
6598
+ var segments = stringMatch(string, /.{2}/g);
6613
6599
  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);
6600
+ for (; written < maxLength; written++) {
6601
+ var result = +("0x" + segments[written] + "0");
6602
+ if (result !== result) {
6603
+ throw new SyntaxError("String should only contain hex characters");
6604
+ }
6605
+ bytes[written] = result >> 4;
6618
6606
  }
6619
6607
  return {
6620
6608
  bytes,
6621
- read
6609
+ read: written << 1
6622
6610
  };
6623
6611
  };
6624
6612
  return uint8FromHex;
@@ -6733,6 +6721,8 @@ function requireEs_uint8Array_toHex() {
6733
6721
  var anUint8Array2 = requireAnUint8Array();
6734
6722
  var notDetached = requireArrayBufferNotDetached();
6735
6723
  var numberToString = uncurryThis(1.1.toString);
6724
+ var join = uncurryThis([].join);
6725
+ var $Array = Array;
6736
6726
  var Uint8Array2 = globalThis2.Uint8Array;
6737
6727
  var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array2 || !Uint8Array2.prototype.toHex || !(function() {
6738
6728
  try {
@@ -6750,12 +6740,12 @@ function requireEs_uint8Array_toHex() {
6750
6740
  toHex: function toHex() {
6751
6741
  anUint8Array2(this);
6752
6742
  notDetached(this.buffer);
6753
- var result = "";
6743
+ var result = $Array(this.length);
6754
6744
  for (var i = 0, length = this.length; i < length; i++) {
6755
6745
  var hex = numberToString(this[i], 16);
6756
- result += hex.length === 1 ? "0" + hex : hex;
6746
+ result[i] = hex.length === 1 ? "0" + hex : hex;
6757
6747
  }
6758
- return result;
6748
+ return join(result, "");
6759
6749
  }
6760
6750
  });
6761
6751
  return es_uint8Array_toHex;
@@ -7314,6 +7304,78 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7314
7304
  });
7315
7305
  const HOURS_MINUTES_REGEXP = /^(?<hours>\d+)?(:(?<minutes>[0-5]\d))?$/;
7316
7306
  const HOURS_MINUTES_WITHOUT_COLON_REGEXP = /^(?<hours>\d{2})(?<minutes>[0-5]\d)$/;
7307
+ var es_iterator_reduce = {};
7308
+ var functionApply;
7309
+ var hasRequiredFunctionApply;
7310
+ function requireFunctionApply() {
7311
+ if (hasRequiredFunctionApply) return functionApply;
7312
+ hasRequiredFunctionApply = 1;
7313
+ var NATIVE_BIND = requireFunctionBindNative();
7314
+ var FunctionPrototype = Function.prototype;
7315
+ var apply = FunctionPrototype.apply;
7316
+ var call = FunctionPrototype.call;
7317
+ functionApply = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() {
7318
+ return call.apply(apply, arguments);
7319
+ });
7320
+ return functionApply;
7321
+ }
7322
+ var hasRequiredEs_iterator_reduce;
7323
+ function requireEs_iterator_reduce() {
7324
+ if (hasRequiredEs_iterator_reduce) return es_iterator_reduce;
7325
+ hasRequiredEs_iterator_reduce = 1;
7326
+ var $ = require_export();
7327
+ var iterate2 = requireIterate();
7328
+ var aCallable2 = requireACallable();
7329
+ var anObject2 = requireAnObject();
7330
+ var getIteratorDirect2 = requireGetIteratorDirect();
7331
+ var iteratorClose2 = requireIteratorClose();
7332
+ var iteratorHelperWithoutClosingOnEarlyError2 = requireIteratorHelperWithoutClosingOnEarlyError();
7333
+ var apply = requireFunctionApply();
7334
+ var fails2 = requireFails();
7335
+ var $TypeError = TypeError;
7336
+ var FAILS_ON_INITIAL_UNDEFINED = fails2(function() {
7337
+ [].keys().reduce(function() {
7338
+ }, void 0);
7339
+ });
7340
+ var reduceWithoutClosingOnEarlyError = !FAILS_ON_INITIAL_UNDEFINED && iteratorHelperWithoutClosingOnEarlyError2("reduce", $TypeError);
7341
+ $({
7342
+ target: "Iterator",
7343
+ proto: true,
7344
+ real: true,
7345
+ forced: FAILS_ON_INITIAL_UNDEFINED || reduceWithoutClosingOnEarlyError
7346
+ }, {
7347
+ reduce: function reduce(reducer) {
7348
+ anObject2(this);
7349
+ try {
7350
+ aCallable2(reducer);
7351
+ } catch (error) {
7352
+ iteratorClose2(this, "throw", error);
7353
+ }
7354
+ var noInitial = arguments.length < 2;
7355
+ var accumulator = noInitial ? void 0 : arguments[1];
7356
+ if (reduceWithoutClosingOnEarlyError) {
7357
+ return apply(reduceWithoutClosingOnEarlyError, this, noInitial ? [reducer] : [reducer, accumulator]);
7358
+ }
7359
+ var record = getIteratorDirect2(this);
7360
+ var counter = 0;
7361
+ iterate2(record, function(value) {
7362
+ if (noInitial) {
7363
+ noInitial = false;
7364
+ accumulator = value;
7365
+ } else {
7366
+ accumulator = reducer(accumulator, value, counter);
7367
+ }
7368
+ counter++;
7369
+ }, {
7370
+ IS_RECORD: true
7371
+ });
7372
+ if (noInitial) throw new $TypeError("Reduce of empty iterator with no initial value");
7373
+ return accumulator;
7374
+ }
7375
+ });
7376
+ return es_iterator_reduce;
7377
+ }
7378
+ requireEs_iterator_reduce();
7317
7379
  function findMatch(regexps, value) {
7318
7380
  for (const regexp of regexps) {
7319
7381
  const match = value.match(regexp);
@@ -7465,7 +7527,7 @@ const validators = [hoursMinutesValidator, greaterThanTimeValidator, lessThanTim
7465
7527
  for (const validator of validators) {
7466
7528
  ValidationService.registerValidator(validator);
7467
7529
  }
7468
- const _sfc_main = defineComponent({
7530
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7469
7531
  name: "XTimeTextField",
7470
7532
  extends: FTextField,
7471
7533
  mixins: [TranslationMixin],
@@ -7513,6 +7575,7 @@ export {
7513
7575
  defineTableColumns,
7514
7576
  forgivingParseTimeToNumber,
7515
7577
  formatNumberToTime,
7578
+ getTableSortableAttributes,
7516
7579
  hoursMinutesStringToMinutes,
7517
7580
  matchPropertyValue,
7518
7581
  minutesToHoursFloat,