@fkui/vue 6.0.0 → 6.1.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 { defineComponent, computed, createElementBlock, openBlock, normalizeClass, renderSlot, mergeProps, createTextVNode, createElementVNode, createApp, resolveComponent, createCommentVNode, withKeys, createVNode, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, isVNode, Comment, getCurrentInstance, resolveDynamicComponent, onMounted, toValue, onUnmounted, useSlots, ref, normalizeProps, guardReactiveProps, unref, Transition, Teleport, normalizeStyle, useTemplateRef, watchEffect, watch, nextTick, withDirectives, vShow, readonly, inject, toRef, provide, createSlots, vModelSelect, vModelDynamic, toHandlers, shallowRef, toRefs } from "vue";
1
+ import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, renderSlot, mergeProps, createTextVNode, createElementVNode, createApp, resolveComponent, createCommentVNode, withKeys, createVNode, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, isVNode, Comment, getCurrentInstance, resolveDynamicComponent, onMounted, toValue, onUnmounted, useSlots, ref, normalizeProps, guardReactiveProps, unref, Transition, Teleport, normalizeStyle, useTemplateRef, watchEffect, watch, nextTick, withDirectives, vShow, readonly, inject, toRef, provide, createSlots, vModelSelect, vModelDynamic, toHandlers, shallowRef, onUpdated, toRefs } from "vue";
2
2
  import { TranslationService, isSet, configLogic, focus as focus$1, ElementIdService, findTabbableElements, popFocus, pushFocus, scrollTo, documentOrderComparator, ValidationService, isValidatableHTMLElement, alertScreenReader, debounce, handleTab, isEmpty, deepClone, parseNumber, formatNumber, parseBankAccountNumber, parseBankgiro, parseClearingNumber, parsePersonnummer, formatPersonnummer, parsePlusgiro, formatPostalCode, parsePercent, formatPercent, parseOrganisationsnummer, isInvalidDatesConfig, isInvalidWeekdaysConfig, parseDate, waitForScreenReader, focusFirst, removeFocusListener, restoreFocus, saveFocus, addFocusListener, DomUtils } from "@fkui/logic";
3
3
  import { groupByWeek, getWeekdayNamings, FDate, DateFormat } from "@fkui/date";
4
4
  const statuses = ["default", "warning", "error", "success", "info"];
@@ -35,11 +35,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
35
35
  };
36
36
  }
37
37
  });
38
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
39
- function getDefaultExportFromCjs(x) {
40
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
41
- }
42
- var es_array_push = {};
38
+ var es_iterator_constructor = {};
43
39
  var globalThis_1;
44
40
  var hasRequiredGlobalThis;
45
41
  function requireGlobalThis() {
@@ -178,13 +174,13 @@ function requireIndexedObject() {
178
174
  hasRequiredIndexedObject = 1;
179
175
  var uncurryThis = requireFunctionUncurryThis();
180
176
  var fails2 = requireFails();
181
- var classof = requireClassofRaw();
177
+ var classof2 = requireClassofRaw();
182
178
  var $Object = Object;
183
179
  var split = uncurryThis("".split);
184
180
  indexedObject = fails2(function() {
185
181
  return !$Object("z").propertyIsEnumerable(0);
186
182
  }) ? function(it) {
187
- return classof(it) === "String" ? split(it, "") : $Object(it);
183
+ return classof2(it) === "String" ? split(it, "") : $Object(it);
188
184
  } : $Object;
189
185
  return indexedObject;
190
186
  }
@@ -1217,14 +1213,579 @@ function require_export() {
1217
1213
  };
1218
1214
  return _export;
1219
1215
  }
1216
+ var anInstance;
1217
+ var hasRequiredAnInstance;
1218
+ function requireAnInstance() {
1219
+ if (hasRequiredAnInstance) return anInstance;
1220
+ hasRequiredAnInstance = 1;
1221
+ var isPrototypeOf = requireObjectIsPrototypeOf();
1222
+ var $TypeError = TypeError;
1223
+ anInstance = function(it, Prototype) {
1224
+ if (isPrototypeOf(Prototype, it)) return it;
1225
+ throw new $TypeError("Incorrect invocation");
1226
+ };
1227
+ return anInstance;
1228
+ }
1229
+ var correctPrototypeGetter;
1230
+ var hasRequiredCorrectPrototypeGetter;
1231
+ function requireCorrectPrototypeGetter() {
1232
+ if (hasRequiredCorrectPrototypeGetter) return correctPrototypeGetter;
1233
+ hasRequiredCorrectPrototypeGetter = 1;
1234
+ var fails2 = requireFails();
1235
+ correctPrototypeGetter = !fails2(function() {
1236
+ function F() {
1237
+ }
1238
+ F.prototype.constructor = null;
1239
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1240
+ });
1241
+ return correctPrototypeGetter;
1242
+ }
1243
+ var objectGetPrototypeOf;
1244
+ var hasRequiredObjectGetPrototypeOf;
1245
+ function requireObjectGetPrototypeOf() {
1246
+ if (hasRequiredObjectGetPrototypeOf) return objectGetPrototypeOf;
1247
+ hasRequiredObjectGetPrototypeOf = 1;
1248
+ var hasOwn = requireHasOwnProperty();
1249
+ var isCallable2 = requireIsCallable();
1250
+ var toObject2 = requireToObject();
1251
+ var sharedKey2 = requireSharedKey();
1252
+ var CORRECT_PROTOTYPE_GETTER = requireCorrectPrototypeGetter();
1253
+ var IE_PROTO = sharedKey2("IE_PROTO");
1254
+ var $Object = Object;
1255
+ var ObjectPrototype = $Object.prototype;
1256
+ objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function(O) {
1257
+ var object = toObject2(O);
1258
+ if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
1259
+ var constructor = object.constructor;
1260
+ if (isCallable2(constructor) && object instanceof constructor) {
1261
+ return constructor.prototype;
1262
+ }
1263
+ return object instanceof $Object ? ObjectPrototype : null;
1264
+ };
1265
+ return objectGetPrototypeOf;
1266
+ }
1267
+ var defineBuiltInAccessor;
1268
+ var hasRequiredDefineBuiltInAccessor;
1269
+ function requireDefineBuiltInAccessor() {
1270
+ if (hasRequiredDefineBuiltInAccessor) return defineBuiltInAccessor;
1271
+ hasRequiredDefineBuiltInAccessor = 1;
1272
+ var makeBuiltIn2 = requireMakeBuiltIn();
1273
+ var defineProperty = requireObjectDefineProperty();
1274
+ defineBuiltInAccessor = function(target, name, descriptor) {
1275
+ if (descriptor.get) makeBuiltIn2(descriptor.get, name, {
1276
+ getter: true
1277
+ });
1278
+ if (descriptor.set) makeBuiltIn2(descriptor.set, name, {
1279
+ setter: true
1280
+ });
1281
+ return defineProperty.f(target, name, descriptor);
1282
+ };
1283
+ return defineBuiltInAccessor;
1284
+ }
1285
+ var createProperty;
1286
+ var hasRequiredCreateProperty;
1287
+ function requireCreateProperty() {
1288
+ if (hasRequiredCreateProperty) return createProperty;
1289
+ hasRequiredCreateProperty = 1;
1290
+ var DESCRIPTORS = requireDescriptors();
1291
+ var definePropertyModule = requireObjectDefineProperty();
1292
+ var createPropertyDescriptor2 = requireCreatePropertyDescriptor();
1293
+ createProperty = function(object, key, value) {
1294
+ if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor2(0, value));
1295
+ else object[key] = value;
1296
+ };
1297
+ return createProperty;
1298
+ }
1299
+ var objectDefineProperties = {};
1300
+ var objectKeys;
1301
+ var hasRequiredObjectKeys;
1302
+ function requireObjectKeys() {
1303
+ if (hasRequiredObjectKeys) return objectKeys;
1304
+ hasRequiredObjectKeys = 1;
1305
+ var internalObjectKeys = requireObjectKeysInternal();
1306
+ var enumBugKeys2 = requireEnumBugKeys();
1307
+ objectKeys = Object.keys || function keys(O) {
1308
+ return internalObjectKeys(O, enumBugKeys2);
1309
+ };
1310
+ return objectKeys;
1311
+ }
1312
+ var hasRequiredObjectDefineProperties;
1313
+ function requireObjectDefineProperties() {
1314
+ if (hasRequiredObjectDefineProperties) return objectDefineProperties;
1315
+ hasRequiredObjectDefineProperties = 1;
1316
+ var DESCRIPTORS = requireDescriptors();
1317
+ var V8_PROTOTYPE_DEFINE_BUG = requireV8PrototypeDefineBug();
1318
+ var definePropertyModule = requireObjectDefineProperty();
1319
+ var anObject2 = requireAnObject();
1320
+ var toIndexedObject2 = requireToIndexedObject();
1321
+ var objectKeys2 = requireObjectKeys();
1322
+ objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1323
+ anObject2(O);
1324
+ var props = toIndexedObject2(Properties);
1325
+ var keys = objectKeys2(Properties);
1326
+ var length = keys.length;
1327
+ var index = 0;
1328
+ var key;
1329
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1330
+ return O;
1331
+ };
1332
+ return objectDefineProperties;
1333
+ }
1334
+ var html;
1335
+ var hasRequiredHtml;
1336
+ function requireHtml() {
1337
+ if (hasRequiredHtml) return html;
1338
+ hasRequiredHtml = 1;
1339
+ var getBuiltIn2 = requireGetBuiltIn();
1340
+ html = getBuiltIn2("document", "documentElement");
1341
+ return html;
1342
+ }
1343
+ var objectCreate;
1344
+ var hasRequiredObjectCreate;
1345
+ function requireObjectCreate() {
1346
+ if (hasRequiredObjectCreate) return objectCreate;
1347
+ hasRequiredObjectCreate = 1;
1348
+ var anObject2 = requireAnObject();
1349
+ var definePropertiesModule = requireObjectDefineProperties();
1350
+ var enumBugKeys2 = requireEnumBugKeys();
1351
+ var hiddenKeys2 = requireHiddenKeys();
1352
+ var html2 = requireHtml();
1353
+ var documentCreateElement2 = requireDocumentCreateElement();
1354
+ var sharedKey2 = requireSharedKey();
1355
+ var GT = ">";
1356
+ var LT = "<";
1357
+ var PROTOTYPE = "prototype";
1358
+ var SCRIPT = "script";
1359
+ var IE_PROTO = sharedKey2("IE_PROTO");
1360
+ var EmptyConstructor = function() {
1361
+ };
1362
+ var scriptTag = function(content) {
1363
+ return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT;
1364
+ };
1365
+ var NullProtoObjectViaActiveX = function(activeXDocument2) {
1366
+ activeXDocument2.write(scriptTag(""));
1367
+ activeXDocument2.close();
1368
+ var temp = activeXDocument2.parentWindow.Object;
1369
+ activeXDocument2 = null;
1370
+ return temp;
1371
+ };
1372
+ var NullProtoObjectViaIFrame = function() {
1373
+ var iframe = documentCreateElement2("iframe");
1374
+ var JS = "java" + SCRIPT + ":";
1375
+ var iframeDocument;
1376
+ iframe.style.display = "none";
1377
+ html2.appendChild(iframe);
1378
+ iframe.src = String(JS);
1379
+ iframeDocument = iframe.contentWindow.document;
1380
+ iframeDocument.open();
1381
+ iframeDocument.write(scriptTag("document.F=Object"));
1382
+ iframeDocument.close();
1383
+ return iframeDocument.F;
1384
+ };
1385
+ var activeXDocument;
1386
+ var NullProtoObject = function() {
1387
+ try {
1388
+ activeXDocument = new ActiveXObject("htmlfile");
1389
+ } catch (error) {
1390
+ }
1391
+ NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
1392
+ var length = enumBugKeys2.length;
1393
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys2[length]];
1394
+ return NullProtoObject();
1395
+ };
1396
+ hiddenKeys2[IE_PROTO] = true;
1397
+ objectCreate = Object.create || function create(O, Properties) {
1398
+ var result;
1399
+ if (O !== null) {
1400
+ EmptyConstructor[PROTOTYPE] = anObject2(O);
1401
+ result = new EmptyConstructor();
1402
+ EmptyConstructor[PROTOTYPE] = null;
1403
+ result[IE_PROTO] = O;
1404
+ } else result = NullProtoObject();
1405
+ return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
1406
+ };
1407
+ return objectCreate;
1408
+ }
1409
+ var iteratorsCore;
1410
+ var hasRequiredIteratorsCore;
1411
+ function requireIteratorsCore() {
1412
+ if (hasRequiredIteratorsCore) return iteratorsCore;
1413
+ hasRequiredIteratorsCore = 1;
1414
+ var fails2 = requireFails();
1415
+ var isCallable2 = requireIsCallable();
1416
+ var isObject2 = requireIsObject$1();
1417
+ var create = requireObjectCreate();
1418
+ var getPrototypeOf = requireObjectGetPrototypeOf();
1419
+ var defineBuiltIn2 = requireDefineBuiltIn();
1420
+ var wellKnownSymbol2 = requireWellKnownSymbol();
1421
+ var IS_PURE = requireIsPure();
1422
+ var ITERATOR = wellKnownSymbol2("iterator");
1423
+ var BUGGY_SAFARI_ITERATORS = false;
1424
+ var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
1425
+ if ([].keys) {
1426
+ arrayIterator = [].keys();
1427
+ if (!("next" in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
1428
+ else {
1429
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
1430
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
1431
+ }
1432
+ }
1433
+ var NEW_ITERATOR_PROTOTYPE = !isObject2(IteratorPrototype) || fails2(function() {
1434
+ var test = {};
1435
+ return IteratorPrototype[ITERATOR].call(test) !== test;
1436
+ });
1437
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
1438
+ else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
1439
+ if (!isCallable2(IteratorPrototype[ITERATOR])) {
1440
+ defineBuiltIn2(IteratorPrototype, ITERATOR, function() {
1441
+ return this;
1442
+ });
1443
+ }
1444
+ iteratorsCore = {
1445
+ IteratorPrototype,
1446
+ BUGGY_SAFARI_ITERATORS
1447
+ };
1448
+ return iteratorsCore;
1449
+ }
1450
+ var hasRequiredEs_iterator_constructor;
1451
+ function requireEs_iterator_constructor() {
1452
+ if (hasRequiredEs_iterator_constructor) return es_iterator_constructor;
1453
+ hasRequiredEs_iterator_constructor = 1;
1454
+ var $ = require_export();
1455
+ var globalThis2 = requireGlobalThis();
1456
+ var anInstance2 = requireAnInstance();
1457
+ var anObject2 = requireAnObject();
1458
+ var isCallable2 = requireIsCallable();
1459
+ var getPrototypeOf = requireObjectGetPrototypeOf();
1460
+ var defineBuiltInAccessor2 = requireDefineBuiltInAccessor();
1461
+ var createProperty2 = requireCreateProperty();
1462
+ var fails2 = requireFails();
1463
+ var hasOwn = requireHasOwnProperty();
1464
+ var wellKnownSymbol2 = requireWellKnownSymbol();
1465
+ var IteratorPrototype = requireIteratorsCore().IteratorPrototype;
1466
+ var DESCRIPTORS = requireDescriptors();
1467
+ var IS_PURE = requireIsPure();
1468
+ var CONSTRUCTOR = "constructor";
1469
+ var ITERATOR = "Iterator";
1470
+ var TO_STRING_TAG = wellKnownSymbol2("toStringTag");
1471
+ var $TypeError = TypeError;
1472
+ var NativeIterator = globalThis2[ITERATOR];
1473
+ var FORCED = IS_PURE || !isCallable2(NativeIterator) || NativeIterator.prototype !== IteratorPrototype || !fails2(function() {
1474
+ NativeIterator({});
1475
+ });
1476
+ var IteratorConstructor = function Iterator() {
1477
+ anInstance2(this, IteratorPrototype);
1478
+ if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError("Abstract class Iterator not directly constructable");
1479
+ };
1480
+ var defineIteratorPrototypeAccessor = function(key, value) {
1481
+ if (DESCRIPTORS) {
1482
+ defineBuiltInAccessor2(IteratorPrototype, key, {
1483
+ configurable: true,
1484
+ get: function() {
1485
+ return value;
1486
+ },
1487
+ set: function(replacement) {
1488
+ anObject2(this);
1489
+ if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property");
1490
+ if (hasOwn(this, key)) this[key] = replacement;
1491
+ else createProperty2(this, key, replacement);
1492
+ }
1493
+ });
1494
+ } else IteratorPrototype[key] = value;
1495
+ };
1496
+ if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);
1497
+ if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
1498
+ defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
1499
+ }
1500
+ IteratorConstructor.prototype = IteratorPrototype;
1501
+ $({
1502
+ global: true,
1503
+ constructor: true,
1504
+ forced: FORCED
1505
+ }, {
1506
+ Iterator: IteratorConstructor
1507
+ });
1508
+ return es_iterator_constructor;
1509
+ }
1510
+ requireEs_iterator_constructor();
1511
+ var es_iterator_forEach = {};
1512
+ var functionUncurryThisClause;
1513
+ var hasRequiredFunctionUncurryThisClause;
1514
+ function requireFunctionUncurryThisClause() {
1515
+ if (hasRequiredFunctionUncurryThisClause) return functionUncurryThisClause;
1516
+ hasRequiredFunctionUncurryThisClause = 1;
1517
+ var classofRaw2 = requireClassofRaw();
1518
+ var uncurryThis = requireFunctionUncurryThis();
1519
+ functionUncurryThisClause = function(fn2) {
1520
+ if (classofRaw2(fn2) === "Function") return uncurryThis(fn2);
1521
+ };
1522
+ return functionUncurryThisClause;
1523
+ }
1524
+ var functionBindContext;
1525
+ var hasRequiredFunctionBindContext;
1526
+ function requireFunctionBindContext() {
1527
+ if (hasRequiredFunctionBindContext) return functionBindContext;
1528
+ hasRequiredFunctionBindContext = 1;
1529
+ var uncurryThis = requireFunctionUncurryThisClause();
1530
+ var aCallable2 = requireACallable();
1531
+ var NATIVE_BIND = requireFunctionBindNative();
1532
+ var bind = uncurryThis(uncurryThis.bind);
1533
+ functionBindContext = function(fn2, that) {
1534
+ aCallable2(fn2);
1535
+ return that === void 0 ? fn2 : NATIVE_BIND ? bind(fn2, that) : function() {
1536
+ return fn2.apply(that, arguments);
1537
+ };
1538
+ };
1539
+ return functionBindContext;
1540
+ }
1541
+ var iterators;
1542
+ var hasRequiredIterators;
1543
+ function requireIterators() {
1544
+ if (hasRequiredIterators) return iterators;
1545
+ hasRequiredIterators = 1;
1546
+ iterators = {};
1547
+ return iterators;
1548
+ }
1549
+ var isArrayIteratorMethod;
1550
+ var hasRequiredIsArrayIteratorMethod;
1551
+ function requireIsArrayIteratorMethod() {
1552
+ if (hasRequiredIsArrayIteratorMethod) return isArrayIteratorMethod;
1553
+ hasRequiredIsArrayIteratorMethod = 1;
1554
+ var wellKnownSymbol2 = requireWellKnownSymbol();
1555
+ var Iterators = requireIterators();
1556
+ var ITERATOR = wellKnownSymbol2("iterator");
1557
+ var ArrayPrototype = Array.prototype;
1558
+ isArrayIteratorMethod = function(it) {
1559
+ return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
1560
+ };
1561
+ return isArrayIteratorMethod;
1562
+ }
1563
+ var toStringTagSupport;
1564
+ var hasRequiredToStringTagSupport;
1565
+ function requireToStringTagSupport() {
1566
+ if (hasRequiredToStringTagSupport) return toStringTagSupport;
1567
+ hasRequiredToStringTagSupport = 1;
1568
+ var wellKnownSymbol2 = requireWellKnownSymbol();
1569
+ var TO_STRING_TAG = wellKnownSymbol2("toStringTag");
1570
+ var test = {};
1571
+ test[TO_STRING_TAG] = "z";
1572
+ toStringTagSupport = String(test) === "[object z]";
1573
+ return toStringTagSupport;
1574
+ }
1575
+ var classof;
1576
+ var hasRequiredClassof;
1577
+ function requireClassof() {
1578
+ if (hasRequiredClassof) return classof;
1579
+ hasRequiredClassof = 1;
1580
+ var TO_STRING_TAG_SUPPORT = requireToStringTagSupport();
1581
+ var isCallable2 = requireIsCallable();
1582
+ var classofRaw2 = requireClassofRaw();
1583
+ var wellKnownSymbol2 = requireWellKnownSymbol();
1584
+ var TO_STRING_TAG = wellKnownSymbol2("toStringTag");
1585
+ var $Object = Object;
1586
+ var CORRECT_ARGUMENTS = classofRaw2(/* @__PURE__ */ function() {
1587
+ return arguments;
1588
+ }()) === "Arguments";
1589
+ var tryGet = function(it, key) {
1590
+ try {
1591
+ return it[key];
1592
+ } catch (error) {
1593
+ }
1594
+ };
1595
+ classof = TO_STRING_TAG_SUPPORT ? classofRaw2 : function(it) {
1596
+ var O, tag, result;
1597
+ return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw2(O) : (result = classofRaw2(O)) === "Object" && isCallable2(O.callee) ? "Arguments" : result;
1598
+ };
1599
+ return classof;
1600
+ }
1601
+ var getIteratorMethod;
1602
+ var hasRequiredGetIteratorMethod;
1603
+ function requireGetIteratorMethod() {
1604
+ if (hasRequiredGetIteratorMethod) return getIteratorMethod;
1605
+ hasRequiredGetIteratorMethod = 1;
1606
+ var classof2 = requireClassof();
1607
+ var getMethod2 = requireGetMethod();
1608
+ var isNullOrUndefined2 = requireIsNullOrUndefined();
1609
+ var Iterators = requireIterators();
1610
+ var wellKnownSymbol2 = requireWellKnownSymbol();
1611
+ var ITERATOR = wellKnownSymbol2("iterator");
1612
+ getIteratorMethod = function(it) {
1613
+ if (!isNullOrUndefined2(it)) return getMethod2(it, ITERATOR) || getMethod2(it, "@@iterator") || Iterators[classof2(it)];
1614
+ };
1615
+ return getIteratorMethod;
1616
+ }
1617
+ var getIterator;
1618
+ var hasRequiredGetIterator;
1619
+ function requireGetIterator() {
1620
+ if (hasRequiredGetIterator) return getIterator;
1621
+ hasRequiredGetIterator = 1;
1622
+ var call = requireFunctionCall();
1623
+ var aCallable2 = requireACallable();
1624
+ var anObject2 = requireAnObject();
1625
+ var tryToString2 = requireTryToString();
1626
+ var getIteratorMethod2 = requireGetIteratorMethod();
1627
+ var $TypeError = TypeError;
1628
+ getIterator = function(argument, usingIterator) {
1629
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod2(argument) : usingIterator;
1630
+ if (aCallable2(iteratorMethod)) return anObject2(call(iteratorMethod, argument));
1631
+ throw new $TypeError(tryToString2(argument) + " is not iterable");
1632
+ };
1633
+ return getIterator;
1634
+ }
1635
+ var iteratorClose;
1636
+ var hasRequiredIteratorClose;
1637
+ function requireIteratorClose() {
1638
+ if (hasRequiredIteratorClose) return iteratorClose;
1639
+ hasRequiredIteratorClose = 1;
1640
+ var call = requireFunctionCall();
1641
+ var anObject2 = requireAnObject();
1642
+ var getMethod2 = requireGetMethod();
1643
+ iteratorClose = function(iterator, kind, value) {
1644
+ var innerResult, innerError;
1645
+ anObject2(iterator);
1646
+ try {
1647
+ innerResult = getMethod2(iterator, "return");
1648
+ if (!innerResult) {
1649
+ if (kind === "throw") throw value;
1650
+ return value;
1651
+ }
1652
+ innerResult = call(innerResult, iterator);
1653
+ } catch (error) {
1654
+ innerError = true;
1655
+ innerResult = error;
1656
+ }
1657
+ if (kind === "throw") throw value;
1658
+ if (innerError) throw innerResult;
1659
+ anObject2(innerResult);
1660
+ return value;
1661
+ };
1662
+ return iteratorClose;
1663
+ }
1664
+ var iterate;
1665
+ var hasRequiredIterate;
1666
+ function requireIterate() {
1667
+ if (hasRequiredIterate) return iterate;
1668
+ hasRequiredIterate = 1;
1669
+ var bind = requireFunctionBindContext();
1670
+ var call = requireFunctionCall();
1671
+ var anObject2 = requireAnObject();
1672
+ var tryToString2 = requireTryToString();
1673
+ var isArrayIteratorMethod2 = requireIsArrayIteratorMethod();
1674
+ var lengthOfArrayLike2 = requireLengthOfArrayLike();
1675
+ var isPrototypeOf = requireObjectIsPrototypeOf();
1676
+ var getIterator2 = requireGetIterator();
1677
+ var getIteratorMethod2 = requireGetIteratorMethod();
1678
+ var iteratorClose2 = requireIteratorClose();
1679
+ var $TypeError = TypeError;
1680
+ var Result = function(stopped, result) {
1681
+ this.stopped = stopped;
1682
+ this.result = result;
1683
+ };
1684
+ var ResultPrototype = Result.prototype;
1685
+ iterate = function(iterable, unboundFunction, options) {
1686
+ var that = options && options.that;
1687
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1688
+ var IS_RECORD = !!(options && options.IS_RECORD);
1689
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
1690
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
1691
+ var fn2 = bind(unboundFunction, that);
1692
+ var iterator, iterFn, index, length, result, next, step;
1693
+ var stop = function(condition) {
1694
+ if (iterator) iteratorClose2(iterator, "normal", condition);
1695
+ return new Result(true, condition);
1696
+ };
1697
+ var callFn = function(value) {
1698
+ if (AS_ENTRIES) {
1699
+ anObject2(value);
1700
+ return INTERRUPTED ? fn2(value[0], value[1], stop) : fn2(value[0], value[1]);
1701
+ }
1702
+ return INTERRUPTED ? fn2(value, stop) : fn2(value);
1703
+ };
1704
+ if (IS_RECORD) {
1705
+ iterator = iterable.iterator;
1706
+ } else if (IS_ITERATOR) {
1707
+ iterator = iterable;
1708
+ } else {
1709
+ iterFn = getIteratorMethod2(iterable);
1710
+ if (!iterFn) throw new $TypeError(tryToString2(iterable) + " is not iterable");
1711
+ if (isArrayIteratorMethod2(iterFn)) {
1712
+ for (index = 0, length = lengthOfArrayLike2(iterable); length > index; index++) {
1713
+ result = callFn(iterable[index]);
1714
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
1715
+ }
1716
+ return new Result(false);
1717
+ }
1718
+ iterator = getIterator2(iterable, iterFn);
1719
+ }
1720
+ next = IS_RECORD ? iterable.next : iterator.next;
1721
+ while (!(step = call(next, iterator)).done) {
1722
+ try {
1723
+ result = callFn(step.value);
1724
+ } catch (error) {
1725
+ iteratorClose2(iterator, "throw", error);
1726
+ }
1727
+ if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result)) return result;
1728
+ }
1729
+ return new Result(false);
1730
+ };
1731
+ return iterate;
1732
+ }
1733
+ var getIteratorDirect;
1734
+ var hasRequiredGetIteratorDirect;
1735
+ function requireGetIteratorDirect() {
1736
+ if (hasRequiredGetIteratorDirect) return getIteratorDirect;
1737
+ hasRequiredGetIteratorDirect = 1;
1738
+ getIteratorDirect = function(obj) {
1739
+ return {
1740
+ iterator: obj,
1741
+ next: obj.next,
1742
+ done: false
1743
+ };
1744
+ };
1745
+ return getIteratorDirect;
1746
+ }
1747
+ var hasRequiredEs_iterator_forEach;
1748
+ function requireEs_iterator_forEach() {
1749
+ if (hasRequiredEs_iterator_forEach) return es_iterator_forEach;
1750
+ hasRequiredEs_iterator_forEach = 1;
1751
+ var $ = require_export();
1752
+ var iterate2 = requireIterate();
1753
+ var aCallable2 = requireACallable();
1754
+ var anObject2 = requireAnObject();
1755
+ var getIteratorDirect2 = requireGetIteratorDirect();
1756
+ $({
1757
+ target: "Iterator",
1758
+ proto: true,
1759
+ real: true
1760
+ }, {
1761
+ forEach: function forEach(fn2) {
1762
+ anObject2(this);
1763
+ aCallable2(fn2);
1764
+ var record = getIteratorDirect2(this);
1765
+ var counter = 0;
1766
+ iterate2(record, function(value) {
1767
+ fn2(value, counter++);
1768
+ }, {
1769
+ IS_RECORD: true
1770
+ });
1771
+ }
1772
+ });
1773
+ return es_iterator_forEach;
1774
+ }
1775
+ requireEs_iterator_forEach();
1776
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1777
+ function getDefaultExportFromCjs(x) {
1778
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1779
+ }
1780
+ var es_array_push = {};
1220
1781
  var isArray;
1221
1782
  var hasRequiredIsArray$1;
1222
1783
  function requireIsArray$1() {
1223
1784
  if (hasRequiredIsArray$1) return isArray;
1224
1785
  hasRequiredIsArray$1 = 1;
1225
- var classof = requireClassofRaw();
1786
+ var classof2 = requireClassofRaw();
1226
1787
  isArray = Array.isArray || function isArray2(argument) {
1227
- return classof(argument) === "Array";
1788
+ return classof2(argument) === "Array";
1228
1789
  };
1229
1790
  return isArray;
1230
1791
  }
@@ -1410,7 +1971,7 @@ const _export_sfc = (sfc, props) => {
1410
1971
  };
1411
1972
  const _hoisted_1$U = ["aria-hidden"];
1412
1973
  const _hoisted_2$F = ["xlink:href"];
1413
- function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) {
1974
+ function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) {
1414
1975
  return openBlock(), createElementBlock("svg", mergeProps(_ctx.$attrs, {
1415
1976
  focusable: "false",
1416
1977
  class: ["icon", [_ctx.spriteKey, ..._ctx.modifiers]],
@@ -1419,7 +1980,7 @@ function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) {
1419
1980
  "xlink:href": _ctx.spriteId
1420
1981
  }, null, 8, _hoisted_2$F)], 16, _hoisted_1$U);
1421
1982
  }
1422
- const FIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["render", _sfc_render$W]]);
1983
+ const FIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["render", _sfc_render$R]]);
1423
1984
  const DATA_TEST_ATTRIBUTE_NAME = "data-test";
1424
1985
  function throwErrorIfEmpty(value) {
1425
1986
  if (!value) {
@@ -1994,6 +2555,165 @@ function require_mapCacheClear() {
1994
2555
  _mapCacheClear = mapCacheClear;
1995
2556
  return _mapCacheClear;
1996
2557
  }
2558
+ var es_iterator_map = {};
2559
+ var defineBuiltIns;
2560
+ var hasRequiredDefineBuiltIns;
2561
+ function requireDefineBuiltIns() {
2562
+ if (hasRequiredDefineBuiltIns) return defineBuiltIns;
2563
+ hasRequiredDefineBuiltIns = 1;
2564
+ var defineBuiltIn2 = requireDefineBuiltIn();
2565
+ defineBuiltIns = function(target, src, options) {
2566
+ for (var key in src) defineBuiltIn2(target, key, src[key], options);
2567
+ return target;
2568
+ };
2569
+ return defineBuiltIns;
2570
+ }
2571
+ var createIterResultObject;
2572
+ var hasRequiredCreateIterResultObject;
2573
+ function requireCreateIterResultObject() {
2574
+ if (hasRequiredCreateIterResultObject) return createIterResultObject;
2575
+ hasRequiredCreateIterResultObject = 1;
2576
+ createIterResultObject = function(value, done) {
2577
+ return {
2578
+ value,
2579
+ done
2580
+ };
2581
+ };
2582
+ return createIterResultObject;
2583
+ }
2584
+ var iteratorCreateProxy;
2585
+ var hasRequiredIteratorCreateProxy;
2586
+ function requireIteratorCreateProxy() {
2587
+ if (hasRequiredIteratorCreateProxy) return iteratorCreateProxy;
2588
+ hasRequiredIteratorCreateProxy = 1;
2589
+ var call = requireFunctionCall();
2590
+ var create = requireObjectCreate();
2591
+ var createNonEnumerableProperty2 = requireCreateNonEnumerableProperty();
2592
+ var defineBuiltIns2 = requireDefineBuiltIns();
2593
+ var wellKnownSymbol2 = requireWellKnownSymbol();
2594
+ var InternalStateModule = requireInternalState();
2595
+ var getMethod2 = requireGetMethod();
2596
+ var IteratorPrototype = requireIteratorsCore().IteratorPrototype;
2597
+ var createIterResultObject2 = requireCreateIterResultObject();
2598
+ var iteratorClose2 = requireIteratorClose();
2599
+ var TO_STRING_TAG = wellKnownSymbol2("toStringTag");
2600
+ var ITERATOR_HELPER = "IteratorHelper";
2601
+ var WRAP_FOR_VALID_ITERATOR = "WrapForValidIterator";
2602
+ var setInternalState = InternalStateModule.set;
2603
+ var createIteratorProxyPrototype = function(IS_ITERATOR) {
2604
+ var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
2605
+ return defineBuiltIns2(create(IteratorPrototype), {
2606
+ next: function next() {
2607
+ var state = getInternalState(this);
2608
+ if (IS_ITERATOR) return state.nextHandler();
2609
+ if (state.done) return createIterResultObject2(void 0, true);
2610
+ try {
2611
+ var result = state.nextHandler();
2612
+ return state.returnHandlerResult ? result : createIterResultObject2(result, state.done);
2613
+ } catch (error) {
2614
+ state.done = true;
2615
+ throw error;
2616
+ }
2617
+ },
2618
+ "return": function() {
2619
+ var state = getInternalState(this);
2620
+ var iterator = state.iterator;
2621
+ state.done = true;
2622
+ if (IS_ITERATOR) {
2623
+ var returnMethod = getMethod2(iterator, "return");
2624
+ return returnMethod ? call(returnMethod, iterator) : createIterResultObject2(void 0, true);
2625
+ }
2626
+ if (state.inner) try {
2627
+ iteratorClose2(state.inner.iterator, "normal");
2628
+ } catch (error) {
2629
+ return iteratorClose2(iterator, "throw", error);
2630
+ }
2631
+ if (iterator) iteratorClose2(iterator, "normal");
2632
+ return createIterResultObject2(void 0, true);
2633
+ }
2634
+ });
2635
+ };
2636
+ var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
2637
+ var IteratorHelperPrototype = createIteratorProxyPrototype(false);
2638
+ createNonEnumerableProperty2(IteratorHelperPrototype, TO_STRING_TAG, "Iterator Helper");
2639
+ iteratorCreateProxy = function(nextHandler, IS_ITERATOR, RETURN_HANDLER_RESULT) {
2640
+ var IteratorProxy = function Iterator(record, state) {
2641
+ if (state) {
2642
+ state.iterator = record.iterator;
2643
+ state.next = record.next;
2644
+ } else state = record;
2645
+ state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
2646
+ state.returnHandlerResult = !!RETURN_HANDLER_RESULT;
2647
+ state.nextHandler = nextHandler;
2648
+ state.counter = 0;
2649
+ state.done = false;
2650
+ setInternalState(this, state);
2651
+ };
2652
+ IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
2653
+ return IteratorProxy;
2654
+ };
2655
+ return iteratorCreateProxy;
2656
+ }
2657
+ var callWithSafeIterationClosing;
2658
+ var hasRequiredCallWithSafeIterationClosing;
2659
+ function requireCallWithSafeIterationClosing() {
2660
+ if (hasRequiredCallWithSafeIterationClosing) return callWithSafeIterationClosing;
2661
+ hasRequiredCallWithSafeIterationClosing = 1;
2662
+ var anObject2 = requireAnObject();
2663
+ var iteratorClose2 = requireIteratorClose();
2664
+ callWithSafeIterationClosing = function(iterator, fn2, value, ENTRIES) {
2665
+ try {
2666
+ return ENTRIES ? fn2(anObject2(value)[0], value[1]) : fn2(value);
2667
+ } catch (error) {
2668
+ iteratorClose2(iterator, "throw", error);
2669
+ }
2670
+ };
2671
+ return callWithSafeIterationClosing;
2672
+ }
2673
+ var iteratorMap;
2674
+ var hasRequiredIteratorMap;
2675
+ function requireIteratorMap() {
2676
+ if (hasRequiredIteratorMap) return iteratorMap;
2677
+ hasRequiredIteratorMap = 1;
2678
+ var call = requireFunctionCall();
2679
+ var aCallable2 = requireACallable();
2680
+ var anObject2 = requireAnObject();
2681
+ var getIteratorDirect2 = requireGetIteratorDirect();
2682
+ var createIteratorProxy = requireIteratorCreateProxy();
2683
+ var callWithSafeIterationClosing2 = requireCallWithSafeIterationClosing();
2684
+ var IteratorProxy = createIteratorProxy(function() {
2685
+ var iterator = this.iterator;
2686
+ var result = anObject2(call(this.next, iterator));
2687
+ var done = this.done = !!result.done;
2688
+ if (!done) return callWithSafeIterationClosing2(iterator, this.mapper, [result.value, this.counter++], true);
2689
+ });
2690
+ iteratorMap = function map(mapper) {
2691
+ anObject2(this);
2692
+ aCallable2(mapper);
2693
+ return new IteratorProxy(getIteratorDirect2(this), {
2694
+ mapper
2695
+ });
2696
+ };
2697
+ return iteratorMap;
2698
+ }
2699
+ var hasRequiredEs_iterator_map;
2700
+ function requireEs_iterator_map() {
2701
+ if (hasRequiredEs_iterator_map) return es_iterator_map;
2702
+ hasRequiredEs_iterator_map = 1;
2703
+ var $ = require_export();
2704
+ var map = requireIteratorMap();
2705
+ var IS_PURE = requireIsPure();
2706
+ $({
2707
+ target: "Iterator",
2708
+ proto: true,
2709
+ real: true,
2710
+ forced: IS_PURE
2711
+ }, {
2712
+ map
2713
+ });
2714
+ return es_iterator_map;
2715
+ }
2716
+ requireEs_iterator_map();
1997
2717
  var _isKeyable;
1998
2718
  var hasRequired_isKeyable;
1999
2719
  function require_isKeyable() {
@@ -2804,24 +3524,6 @@ function require_equalObjects() {
2804
3524
  return _equalObjects;
2805
3525
  }
2806
3526
  var es_arrayBuffer_detached = {};
2807
- var defineBuiltInAccessor;
2808
- var hasRequiredDefineBuiltInAccessor;
2809
- function requireDefineBuiltInAccessor() {
2810
- if (hasRequiredDefineBuiltInAccessor) return defineBuiltInAccessor;
2811
- hasRequiredDefineBuiltInAccessor = 1;
2812
- var makeBuiltIn2 = requireMakeBuiltIn();
2813
- var defineProperty = requireObjectDefineProperty();
2814
- defineBuiltInAccessor = function(target, name, descriptor) {
2815
- if (descriptor.get) makeBuiltIn2(descriptor.get, name, {
2816
- getter: true
2817
- });
2818
- if (descriptor.set) makeBuiltIn2(descriptor.set, name, {
2819
- setter: true
2820
- });
2821
- return defineProperty.f(target, name, descriptor);
2822
- };
2823
- return defineBuiltInAccessor;
2824
- }
2825
3527
  var arrayBufferBasicDetection;
2826
3528
  var hasRequiredArrayBufferBasicDetection;
2827
3529
  function requireArrayBufferBasicDetection() {
@@ -2852,11 +3554,11 @@ function requireArrayBufferByteLength() {
2852
3554
  hasRequiredArrayBufferByteLength = 1;
2853
3555
  var globalThis2 = requireGlobalThis();
2854
3556
  var uncurryThisAccessor = requireFunctionUncurryThisAccessor();
2855
- var classof = requireClassofRaw();
3557
+ var classof2 = requireClassofRaw();
2856
3558
  var ArrayBuffer2 = globalThis2.ArrayBuffer;
2857
3559
  var TypeError2 = globalThis2.TypeError;
2858
3560
  arrayBufferByteLength = ArrayBuffer2 && uncurryThisAccessor(ArrayBuffer2.prototype, "byteLength", "get") || function(O) {
2859
- if (classof(O) !== "ArrayBuffer") throw new TypeError2("ArrayBuffer expected");
3561
+ if (classof2(O) !== "ArrayBuffer") throw new TypeError2("ArrayBuffer expected");
2860
3562
  return O.byteLength;
2861
3563
  };
2862
3564
  return arrayBufferByteLength;
@@ -2938,7 +3640,7 @@ function requireEnvironment() {
2938
3640
  hasRequiredEnvironment = 1;
2939
3641
  var globalThis2 = requireGlobalThis();
2940
3642
  var userAgent = requireEnvironmentUserAgent();
2941
- var classof = requireClassofRaw();
3643
+ var classof2 = requireClassofRaw();
2942
3644
  var userAgentStartsWith = function(string) {
2943
3645
  return userAgent.slice(0, string.length) === string;
2944
3646
  };
@@ -2949,7 +3651,7 @@ function requireEnvironment() {
2949
3651
  if (userAgentStartsWith("Node.js/")) return "NODE";
2950
3652
  if (globalThis2.Bun && typeof Bun.version == "string") return "BUN";
2951
3653
  if (globalThis2.Deno && typeof Deno.version == "object") return "DENO";
2952
- if (classof(globalThis2.process) === "process") return "NODE";
3654
+ if (classof2(globalThis2.process) === "process") return "NODE";
2953
3655
  if (globalThis2.window && globalThis2.document) return "BROWSER";
2954
3656
  return "REST";
2955
3657
  }();
@@ -3281,15 +3983,46 @@ function requireIsEqual() {
3281
3983
  }
3282
3984
  var isEqualExports = requireIsEqual();
3283
3985
  const isEqual$1 = /* @__PURE__ */ getDefaultExportFromCjs(isEqualExports);
3284
- function itemEquals(item1, item2, compareAttribute) {
3285
- if (!isSet(item1) || !isSet(item2)) {
3286
- return false;
3287
- }
3288
- if (item1 === item2) {
3289
- return true;
3290
- }
3291
- return item1[compareAttribute] === item2[compareAttribute];
3292
- }
3986
+ var es_iterator_find = {};
3987
+ var hasRequiredEs_iterator_find;
3988
+ function requireEs_iterator_find() {
3989
+ if (hasRequiredEs_iterator_find) return es_iterator_find;
3990
+ hasRequiredEs_iterator_find = 1;
3991
+ var $ = require_export();
3992
+ var iterate2 = requireIterate();
3993
+ var aCallable2 = requireACallable();
3994
+ var anObject2 = requireAnObject();
3995
+ var getIteratorDirect2 = requireGetIteratorDirect();
3996
+ $({
3997
+ target: "Iterator",
3998
+ proto: true,
3999
+ real: true
4000
+ }, {
4001
+ find: function find(predicate) {
4002
+ anObject2(this);
4003
+ aCallable2(predicate);
4004
+ var record = getIteratorDirect2(this);
4005
+ var counter = 0;
4006
+ return iterate2(record, function(value, stop) {
4007
+ if (predicate(value, counter++)) return stop(value);
4008
+ }, {
4009
+ IS_RECORD: true,
4010
+ INTERRUPTED: true
4011
+ }).result;
4012
+ }
4013
+ });
4014
+ return es_iterator_find;
4015
+ }
4016
+ requireEs_iterator_find();
4017
+ function itemEquals(item1, item2, compareAttribute) {
4018
+ if (!isSet(item1) || !isSet(item2)) {
4019
+ return false;
4020
+ }
4021
+ if (item1 === item2) {
4022
+ return true;
4023
+ }
4024
+ return item1[compareAttribute] === item2[compareAttribute];
4025
+ }
3293
4026
  function includeItem(item, itemList, compareAttribute) {
3294
4027
  if (!isSet(item) || !isSet(itemList)) {
3295
4028
  return false;
@@ -3899,7 +4632,7 @@ const _hoisted_10$4 = {
3899
4632
  class: "modal__shelf"
3900
4633
  };
3901
4634
  const _hoisted_11$3 = ["aria-label"];
3902
- function _sfc_render$V(_ctx, _cache, $props, $setup, $data, $options) {
4635
+ function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) {
3903
4636
  const _component_f_icon = resolveComponent("f-icon");
3904
4637
  return _ctx.isOpen ? (openBlock(), createElementBlock("div", {
3905
4638
  key: 0,
@@ -3929,7 +4662,7 @@ function _sfc_render$V(_ctx, _cache, $props, $setup, $data, $options) {
3929
4662
  onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.onFocusLast && _ctx.onFocusLast(...args))
3930
4663
  }, null, 32)])])], 2)])], 32)])], 10, _hoisted_1$T)) : createCommentVNode("", true);
3931
4664
  }
3932
- const FModal = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["render", _sfc_render$V]]);
4665
+ const FModal = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["render", _sfc_render$Q]]);
3933
4666
  function prepareButtonList(src, buttonOrder = config.buttonOrder) {
3934
4667
  const list = src.map((it) => {
3935
4668
  var _it$event, _ref, _it$reason, _it$type;
@@ -4070,7 +4803,7 @@ const _hoisted_3$v = {
4070
4803
  key: 0,
4071
4804
  class: "sr-only"
4072
4805
  };
4073
- function _sfc_render$U(_ctx, _cache, $props, $setup, $data, $options) {
4806
+ function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
4074
4807
  const _component_f_modal = resolveComponent("f-modal");
4075
4808
  return openBlock(), createBlock(_component_f_modal, {
4076
4809
  fullscreen: _ctx.fullscreen,
@@ -4094,7 +4827,7 @@ function _sfc_render$U(_ctx, _cache, $props, $setup, $data, $options) {
4094
4827
  _: 3
4095
4828
  }, 8, ["fullscreen", "is-open", "aria-close-text", "size", "focus", "onClose"]);
4096
4829
  }
4097
- const FConfirmModal = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["render", _sfc_render$U]]);
4830
+ const FConfirmModal = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["render", _sfc_render$P]]);
4098
4831
  const GAP = ["1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x"];
4099
4832
  const ALIGNMENT = ["top", "center", "bottom"];
4100
4833
  const FLOAT = ["left", "center", "right"];
@@ -4173,12 +4906,12 @@ const _sfc_main$17 = defineComponent({
4173
4906
  }
4174
4907
  }
4175
4908
  });
4176
- function _sfc_render$T(_ctx, _cache, $props, $setup, $data, $options) {
4909
+ function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) {
4177
4910
  return openBlock(), createElementBlock("div", {
4178
4911
  class: normalizeClass(["iflex", _ctx.classList])
4179
4912
  }, [renderSlot(_ctx.$slots, "default")], 2);
4180
4913
  }
4181
- const IFlex = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$T]]);
4914
+ const IFlex = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$O]]);
4182
4915
  const _sfc_main$16 = defineComponent({
4183
4916
  name: "IFlexItem",
4184
4917
  inheritAttrs: true,
@@ -4226,12 +4959,12 @@ const _sfc_main$16 = defineComponent({
4226
4959
  }
4227
4960
  }
4228
4961
  });
4229
- function _sfc_render$S(_ctx, _cache, $props, $setup, $data, $options) {
4962
+ function _sfc_render$N(_ctx, _cache, $props, $setup, $data, $options) {
4230
4963
  return openBlock(), createElementBlock("div", {
4231
4964
  class: normalizeClass(["iflex__item", _ctx.classList])
4232
4965
  }, [renderSlot(_ctx.$slots, "default")], 2);
4233
4966
  }
4234
- const IFlexItem = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["render", _sfc_render$S]]);
4967
+ const IFlexItem = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["render", _sfc_render$N]]);
4235
4968
  function focusError(item) {
4236
4969
  const element = document.querySelector(`#${item.id}`);
4237
4970
  if (!element) {
@@ -4310,7 +5043,7 @@ const _hoisted_4$p = ["onClick"];
4310
5043
  const _hoisted_5$k = {
4311
5044
  class: "error-list__link"
4312
5045
  };
4313
- function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) {
5046
+ function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) {
4314
5047
  const _component_f_icon = resolveComponent("f-icon");
4315
5048
  const _component_i_flex_item = resolveComponent("i-flex-item");
4316
5049
  const _component_i_flex = resolveComponent("i-flex");
@@ -4364,7 +5097,81 @@ function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) {
4364
5097
  _: 3
4365
5098
  })]);
4366
5099
  }
4367
- const FErrorList = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["render", _sfc_render$R]]);
5100
+ const FErrorList = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["render", _sfc_render$M]]);
5101
+ var es_iterator_every = {};
5102
+ var hasRequiredEs_iterator_every;
5103
+ function requireEs_iterator_every() {
5104
+ if (hasRequiredEs_iterator_every) return es_iterator_every;
5105
+ hasRequiredEs_iterator_every = 1;
5106
+ var $ = require_export();
5107
+ var iterate2 = requireIterate();
5108
+ var aCallable2 = requireACallable();
5109
+ var anObject2 = requireAnObject();
5110
+ var getIteratorDirect2 = requireGetIteratorDirect();
5111
+ $({
5112
+ target: "Iterator",
5113
+ proto: true,
5114
+ real: true
5115
+ }, {
5116
+ every: function every(predicate) {
5117
+ anObject2(this);
5118
+ aCallable2(predicate);
5119
+ var record = getIteratorDirect2(this);
5120
+ var counter = 0;
5121
+ return !iterate2(record, function(value, stop) {
5122
+ if (!predicate(value, counter++)) return stop();
5123
+ }, {
5124
+ IS_RECORD: true,
5125
+ INTERRUPTED: true
5126
+ }).stopped;
5127
+ }
5128
+ });
5129
+ return es_iterator_every;
5130
+ }
5131
+ requireEs_iterator_every();
5132
+ var es_iterator_filter = {};
5133
+ var hasRequiredEs_iterator_filter;
5134
+ function requireEs_iterator_filter() {
5135
+ if (hasRequiredEs_iterator_filter) return es_iterator_filter;
5136
+ hasRequiredEs_iterator_filter = 1;
5137
+ var $ = require_export();
5138
+ var call = requireFunctionCall();
5139
+ var aCallable2 = requireACallable();
5140
+ var anObject2 = requireAnObject();
5141
+ var getIteratorDirect2 = requireGetIteratorDirect();
5142
+ var createIteratorProxy = requireIteratorCreateProxy();
5143
+ var callWithSafeIterationClosing2 = requireCallWithSafeIterationClosing();
5144
+ var IS_PURE = requireIsPure();
5145
+ var IteratorProxy = createIteratorProxy(function() {
5146
+ var iterator = this.iterator;
5147
+ var predicate = this.predicate;
5148
+ var next = this.next;
5149
+ var result, done, value;
5150
+ while (true) {
5151
+ result = anObject2(call(next, iterator));
5152
+ done = this.done = !!result.done;
5153
+ if (done) return;
5154
+ value = result.value;
5155
+ if (callWithSafeIterationClosing2(iterator, predicate, [value, this.counter++], true)) return value;
5156
+ }
5157
+ });
5158
+ $({
5159
+ target: "Iterator",
5160
+ proto: true,
5161
+ real: true,
5162
+ forced: IS_PURE
5163
+ }, {
5164
+ filter: function filter2(predicate) {
5165
+ anObject2(this);
5166
+ aCallable2(predicate);
5167
+ return new IteratorProxy(getIteratorDirect2(this), {
5168
+ predicate
5169
+ });
5170
+ }
5171
+ });
5172
+ return es_iterator_filter;
5173
+ }
5174
+ requireEs_iterator_filter();
4368
5175
  function cleanUpElements(vm) {
4369
5176
  return new Promise((resolve) => {
4370
5177
  window.setTimeout(() => {
@@ -4448,13 +5255,13 @@ const _sfc_main$14 = defineComponent({
4448
5255
  }
4449
5256
  }
4450
5257
  });
4451
- function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) {
5258
+ function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
4452
5259
  return openBlock(), createElementBlock("div", {
4453
5260
  onComponentValidity: _cache[0] || (_cache[0] = (...args) => _ctx.onComponentValidity && _ctx.onComponentValidity(...args)),
4454
5261
  onComponentUnmount: _cache[1] || (_cache[1] = (...args) => _ctx.onComponentUnmount && _ctx.onComponentUnmount(...args))
4455
5262
  }, [renderSlot(_ctx.$slots, "default")], 32);
4456
5263
  }
4457
- const FValidationGroup = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["render", _sfc_render$Q]]);
5264
+ const FValidationGroup = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["render", _sfc_render$L]]);
4458
5265
  var FValidationFormAction = /* @__PURE__ */ ((FValidationFormAction2) => {
4459
5266
  FValidationFormAction2[FValidationFormAction2["CONTINUE"] = 0] = "CONTINUE";
4460
5267
  FValidationFormAction2[FValidationFormAction2["CANCEL"] = 1] = "CANCEL";
@@ -4606,7 +5413,7 @@ const _hoisted_2$B = {
4606
5413
  tabindex: "-1",
4607
5414
  role: "group"
4608
5415
  };
4609
- function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
5416
+ function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
4610
5417
  const _component_f_error_list = resolveComponent("f-error-list");
4611
5418
  const _component_f_validation_group = resolveComponent("f-validation-group");
4612
5419
  return openBlock(), createBlock(_component_f_validation_group, {
@@ -4632,7 +5439,7 @@ function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
4632
5439
  _: 3
4633
5440
  }, 8, ["modelValue"]);
4634
5441
  }
4635
- const FValidationForm = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["render", _sfc_render$P]]);
5442
+ const FValidationForm = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["render", _sfc_render$K]]);
4636
5443
  const _sfc_main$12 = defineComponent({
4637
5444
  name: "FFormModal",
4638
5445
  components: {
@@ -4790,7 +5597,7 @@ const _hoisted_3$t = {
4790
5597
  key: 0,
4791
5598
  class: "sr-only"
4792
5599
  };
4793
- function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) {
5600
+ function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
4794
5601
  const _component_f_validation_form = resolveComponent("f-validation-form");
4795
5602
  const _component_f_modal = resolveComponent("f-modal");
4796
5603
  return openBlock(), createBlock(_component_f_modal, {
@@ -4826,7 +5633,7 @@ function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) {
4826
5633
  _: 3
4827
5634
  }, 8, ["data-test", "fullscreen", "is-open", "size", "aria-close-text", "onClose"]);
4828
5635
  }
4829
- const FFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$O]]);
5636
+ const FFormModal = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$J]]);
4830
5637
  async function confirmModal(callingInstance, texts) {
4831
5638
  const buttons = [{
4832
5639
  label: texts.confirm,
@@ -5199,12 +6006,12 @@ const _sfc_main$11 = defineComponent({
5199
6006
  const _hoisted_1$O = {
5200
6007
  "data-test": "f-error-page"
5201
6008
  };
5202
- function _sfc_render$N(_ctx, _cache, $props, $setup, $data, $options) {
6009
+ function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
5203
6010
  return openBlock(), createElementBlock("div", _hoisted_1$O, _cache[0] || (_cache[0] = [createElementVNode("h1", null, "Fel", -1), createTextVNode(), createElementVNode("p", null, "Ett fel har uppstått.", -1), createTextVNode(), createElementVNode("a", {
5204
6011
  href: "/"
5205
6012
  }, "Gå till startsidan", -1)]));
5206
6013
  }
5207
- const FErrorPage = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$N]]);
6014
+ const FErrorPage = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$I]]);
5208
6015
  const _sfc_main$10 = defineComponent({
5209
6016
  name: "FErrorHandlingApp",
5210
6017
  props: {
@@ -5234,7 +6041,7 @@ const _sfc_main$10 = defineComponent({
5234
6041
  });
5235
6042
  }
5236
6043
  });
5237
- function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) {
6044
+ function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
5238
6045
  return openBlock(), createElementBlock("div", null, [_ctx.hasError ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.errorComponent), {
5239
6046
  key: 0,
5240
6047
  payload: _ctx.payload
@@ -5244,7 +6051,7 @@ function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) {
5244
6051
  key: 2
5245
6052
  })]);
5246
6053
  }
5247
- const FErrorHandlingApp = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$M]]);
6054
+ const FErrorHandlingApp = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$H]]);
5248
6055
  function isMonthBefore(date, minDate) {
5249
6056
  return Boolean(minDate && date.isBefore(minDate.startOfMonth()));
5250
6057
  }
@@ -5413,7 +6220,7 @@ const _hoisted_5$j = ["aria-disabled", "aria-live"];
5413
6220
  const _hoisted_6$f = {
5414
6221
  class: "sr-only"
5415
6222
  };
5416
- function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
6223
+ function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
5417
6224
  const _component_f_icon = resolveComponent("f-icon");
5418
6225
  return openBlock(), createElementBlock("div", _hoisted_1$N, [createElementVNode("div", _hoisted_2$z, toDisplayString(_ctx.currentText), 1), _cache[4] || (_cache[4] = createTextVNode()), createElementVNode("button", {
5419
6226
  ref: "previousButton",
@@ -5437,7 +6244,7 @@ function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
5437
6244
  name: "arrow-right"
5438
6245
  }, null, 8, ["class"])], 8, _hoisted_5$j)]);
5439
6246
  }
5440
- const ICalendarNavbar = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["render", _sfc_render$L]]);
6247
+ const ICalendarNavbar = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["render", _sfc_render$G]]);
5441
6248
  function getDayStartOffset(days) {
5442
6249
  return days[0].weekDay - 1;
5443
6250
  }
@@ -5531,23 +6338,26 @@ const _hoisted_3$r = {
5531
6338
  };
5532
6339
  const _hoisted_4$n = ["title"];
5533
6340
  const _hoisted_5$i = {
6341
+ key: 1
6342
+ };
6343
+ const _hoisted_6$e = {
5534
6344
  key: 0,
5535
6345
  class: "calendar-month__cell calendar-month__cell--week-number",
5536
6346
  "aria-hidden": "true"
5537
6347
  };
5538
- const _hoisted_6$e = ["colspan"];
5539
6348
  const _hoisted_7$c = ["colspan"];
5540
- const _hoisted_8$7 = {
6349
+ const _hoisted_8$7 = ["colspan"];
6350
+ const _hoisted_9$5 = {
5541
6351
  key: 0,
5542
6352
  "aria-hidden": "true"
5543
6353
  };
5544
- const _hoisted_9$5 = ["colspan"];
5545
- const _hoisted_10$3 = {
6354
+ const _hoisted_10$3 = ["colspan"];
6355
+ const _hoisted_11$2 = {
5546
6356
  key: 1,
5547
6357
  "aria-hidden": "true"
5548
6358
  };
5549
- const _hoisted_11$2 = ["colspan"];
5550
- function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
6359
+ const _hoisted_12$2 = ["colspan"];
6360
+ function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
5551
6361
  return openBlock(), createElementBlock("table", {
5552
6362
  class: "calendar-month__table",
5553
6363
  role: "grid",
@@ -5572,19 +6382,20 @@ function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
5572
6382
  return openBlock(), createElementBlock("th", {
5573
6383
  key: weekday.name,
5574
6384
  scope: "col",
6385
+ "aria-hidden": "true",
5575
6386
  class: "calendar-month__header-cell"
5576
- }, [createElementVNode("abbr", {
6387
+ }, [_ctx.showShortWeekdays ? (openBlock(), createElementBlock("abbr", {
6388
+ key: 0,
5577
6389
  title: weekday.name
5578
- }, toDisplayString(_ctx.showShortWeekdays ? weekday.shortName : weekday.name), 9, _hoisted_4$n)]);
6390
+ }, toDisplayString(weekday.shortName), 9, _hoisted_4$n)) : (openBlock(), createElementBlock("span", _hoisted_5$i, toDisplayString(weekday.name), 1))]);
5579
6391
  }), 128))])]), _cache[23] || (_cache[23] = createTextVNode()), createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.weeks, (week) => {
5580
6392
  return openBlock(), createElementBlock("tr", {
5581
6393
  key: week.week
5582
- }, [!_ctx.internalHideWeekNumbers ? (openBlock(), createElementBlock("td", _hoisted_5$i, toDisplayString(week.week), 1)) : createCommentVNode("", true), _cache[17] || (_cache[17] = createTextVNode()), _ctx.getDayStartOffset(week.days) ? (openBlock(), createElementBlock("td", {
6394
+ }, [!_ctx.internalHideWeekNumbers ? (openBlock(), createElementBlock("td", _hoisted_6$e, toDisplayString(week.week), 1)) : createCommentVNode("", true), _cache[17] || (_cache[17] = createTextVNode()), _ctx.getDayStartOffset(week.days) ? (openBlock(), createElementBlock("td", {
5583
6395
  key: 1,
5584
6396
  class: "calendar-month__cell",
5585
- colspan: _ctx.getDayStartOffset(week.days),
5586
- "aria-hidden": "true"
5587
- }, null, 8, _hoisted_6$e)) : createCommentVNode("", true), _cache[18] || (_cache[18] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(week.days, (day) => {
6397
+ colspan: _ctx.getDayStartOffset(week.days)
6398
+ }, null, 8, _hoisted_7$c)) : createCommentVNode("", true), _cache[18] || (_cache[18] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(week.days, (day) => {
5588
6399
  return openBlock(), createElementBlock("td", {
5589
6400
  key: day.toString(),
5590
6401
  class: "calendar-month__cell",
@@ -5598,18 +6409,18 @@ function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
5598
6409
  class: "calendar-month__cell",
5599
6410
  colspan: _ctx.getDayEndOffset(week.days),
5600
6411
  "aria-hidden": "true"
5601
- }, null, 8, _hoisted_7$c)) : createCommentVNode("", true)]);
5602
- }), 128)), _cache[20] || (_cache[20] = createTextVNode()), _ctx.weeks.length < 5 ? (openBlock(), createElementBlock("tr", _hoisted_8$7, [createElementVNode("td", {
6412
+ }, null, 8, _hoisted_8$7)) : createCommentVNode("", true)]);
6413
+ }), 128)), _cache[20] || (_cache[20] = createTextVNode()), _ctx.weeks.length < 5 ? (openBlock(), createElementBlock("tr", _hoisted_9$5, [createElementVNode("td", {
5603
6414
  class: "calendar-month__cell",
5604
6415
  colspan: _ctx.totalCols,
5605
6416
  "aria-hidden": "true"
5606
- }, null, 8, _hoisted_9$5)])) : createCommentVNode("", true), _cache[21] || (_cache[21] = createTextVNode()), _ctx.weeks.length < 6 ? (openBlock(), createElementBlock("tr", _hoisted_10$3, [createElementVNode("td", {
6417
+ }, null, 8, _hoisted_10$3)])) : createCommentVNode("", true), _cache[21] || (_cache[21] = createTextVNode()), _ctx.weeks.length < 6 ? (openBlock(), createElementBlock("tr", _hoisted_11$2, [createElementVNode("td", {
5607
6418
  class: "calendar-month__cell",
5608
6419
  colspan: _ctx.totalCols,
5609
6420
  "aria-hidden": "true"
5610
- }, null, 8, _hoisted_11$2)])) : createCommentVNode("", true)])], 40, _hoisted_1$M);
6421
+ }, null, 8, _hoisted_12$2)])) : createCommentVNode("", true)])], 40, _hoisted_1$M);
5611
6422
  }
5612
- const ICalendarMonthGrid = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$K]]);
6423
+ const ICalendarMonthGrid = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$F]]);
5613
6424
  const DayStep = {
5614
6425
  ArrowRight: 1,
5615
6426
  ArrowLeft: -1,
@@ -5724,7 +6535,7 @@ const _sfc_main$Z = defineComponent({
5724
6535
  }
5725
6536
  });
5726
6537
  const _hoisted_1$L = ["data-date", "tabindex", "onClick", "onKeydown"];
5727
- function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
6538
+ function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
5728
6539
  const _component_i_calendar_month_grid = resolveComponent("i-calendar-month-grid");
5729
6540
  return openBlock(), createBlock(_component_i_calendar_month_grid, {
5730
6541
  value: _ctx.modelValue
@@ -5747,7 +6558,7 @@ function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
5747
6558
  _: 3
5748
6559
  }, 8, ["value"]);
5749
6560
  }
5750
- const ICalendarMonth = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$J]]);
6561
+ const ICalendarMonth = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$E]]);
5751
6562
  const _sfc_main$Y = defineComponent({
5752
6563
  name: "FCalendar",
5753
6564
  components: {
@@ -5802,7 +6613,7 @@ const _sfc_main$Y = defineComponent({
5802
6613
  const _hoisted_1$K = {
5803
6614
  class: "calendar__wrapper"
5804
6615
  };
5805
- function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
6616
+ function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
5806
6617
  const _component_i_calendar_navbar = resolveComponent("i-calendar-navbar");
5807
6618
  const _component_i_calendar_month = resolveComponent("i-calendar-month");
5808
6619
  return openBlock(), createElementBlock("div", _hoisted_1$K, [createVNode(_component_i_calendar_navbar, {
@@ -5828,7 +6639,7 @@ function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
5828
6639
  _: 3
5829
6640
  }, 8, ["model-value", "min-date", "max-date", "tab-date", "onClick", "onUpdate:modelValue"])]);
5830
6641
  }
5831
- const FCalendar = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$I]]);
6642
+ const FCalendar = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$D]]);
5832
6643
  function getCalendarDaySrText(day, enabled, selected, t) {
5833
6644
  const parts = [];
5834
6645
  if (!enabled) {
@@ -5918,12 +6729,12 @@ const _hoisted_1$J = {
5918
6729
  const _hoisted_2$x = {
5919
6730
  class: "sr-only"
5920
6731
  };
5921
- function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
6732
+ function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
5922
6733
  return openBlock(), createElementBlock("span", {
5923
6734
  class: normalizeClass(_ctx.dayClasses)
5924
6735
  }, [createElementVNode("span", _hoisted_1$J, toDisplayString(_ctx.day.day), 1), _cache[0] || (_cache[0] = createTextVNode()), createElementVNode("span", _hoisted_2$x, toDisplayString(_ctx.srText), 1)], 2);
5925
6736
  }
5926
- const FCalendarDay = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["render", _sfc_render$H]]);
6737
+ const FCalendarDay = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["render", _sfc_render$C]]);
5927
6738
  function useEventListener(target, event, callback) {
5928
6739
  onMounted(() => {
5929
6740
  var _a;
@@ -5937,10 +6748,10 @@ function useEventListener(target, event, callback) {
5937
6748
  function useSlotUtils() {
5938
6749
  const $slots = useSlots();
5939
6750
  return {
5940
- hasSlot(name) {
6751
+ hasSlot(...args) {
5941
6752
  return hasSlot({
5942
6753
  $slots
5943
- }, name);
6754
+ }, ...args);
5944
6755
  }
5945
6756
  };
5946
6757
  }
@@ -6100,7 +6911,7 @@ const _sfc_main$V = defineComponent({
6100
6911
  }
6101
6912
  }
6102
6913
  });
6103
- function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
6914
+ function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
6104
6915
  return openBlock(), createBlock(Transition, {
6105
6916
  onEnter: _ctx.enter,
6106
6917
  onAfterEnter: _ctx.afterEnter,
@@ -6112,7 +6923,7 @@ function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
6112
6923
  _: 3
6113
6924
  }, 8, ["onEnter", "onAfterEnter", "onLeave"]);
6114
6925
  }
6115
- const FExpand = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$G]]);
6926
+ const FExpand = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$B]]);
6116
6927
  function offset(page, el) {
6117
6928
  const rect = el.getBoundingClientRect();
6118
6929
  return {
@@ -6678,7 +7489,7 @@ const _sfc_main$U = defineComponent({
6678
7489
  }
6679
7490
  }
6680
7491
  });
6681
- function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
7492
+ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
6682
7493
  return _ctx.isOpen ? (openBlock(), createBlock(Teleport, {
6683
7494
  key: 0,
6684
7495
  to: _ctx.teleportTarget,
@@ -6699,7 +7510,7 @@ function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
6699
7510
  placement: _ctx.placement
6700
7511
  })))], 544)], 16)], 8, ["to", "disabled"])) : createCommentVNode("", true);
6701
7512
  }
6702
- const IPopup = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["render", _sfc_render$F]]);
7513
+ const IPopup = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["render", _sfc_render$A]]);
6703
7514
  function computeArrowOffset(placement, inputIconRect, wrapperRect) {
6704
7515
  switch (placement) {
6705
7516
  case Placement.A: {
@@ -6814,6 +7625,9 @@ const _sfc_main$T = defineComponent({
6814
7625
  },
6815
7626
  errorStyle() {
6816
7627
  return `--i-popup-error-offset: ${this.arrowOffset}px`;
7628
+ },
7629
+ teleportTarget() {
7630
+ return config.teleportTarget;
6817
7631
  }
6818
7632
  },
6819
7633
  watch: {
@@ -6902,11 +7716,11 @@ const _hoisted_1$H = {
6902
7716
  ref: "wrapper",
6903
7717
  class: "popup-error__wrapper"
6904
7718
  };
6905
- function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
7719
+ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
6906
7720
  const _component_f_icon = resolveComponent("f-icon");
6907
7721
  return _ctx.isOpen ? (openBlock(), createBlock(Teleport, {
6908
7722
  key: 0,
6909
- to: "body",
7723
+ to: _ctx.teleportTarget,
6910
7724
  disabled: _ctx.teleportDisabled
6911
7725
  }, [createElementVNode("div", {
6912
7726
  ref: "popup",
@@ -6924,9 +7738,9 @@ function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
6924
7738
  }, [createVNode(_component_f_icon, {
6925
7739
  name: "close",
6926
7740
  class: "button__icon"
6927
- })])], 6)], 512)], 2)], 8, ["disabled"])) : createCommentVNode("", true);
7741
+ })])], 6)], 512)], 2)], 8, ["to", "disabled"])) : createCommentVNode("", true);
6928
7742
  }
6929
- const IPopupError = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$E]]);
7743
+ const IPopupError = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$z]]);
6930
7744
  function numItems(itemHeight, availableHeight, verticalSpacing) {
6931
7745
  const itemsFit = Math.floor((availableHeight - verticalSpacing) / itemHeight);
6932
7746
  return Math.min(itemsFit, 7);
@@ -7457,7 +8271,7 @@ const _hoisted_5$h = {
7457
8271
  key: 0,
7458
8272
  class: "sr-only"
7459
8273
  };
7460
- function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
8274
+ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
7461
8275
  const _component_i_popup = resolveComponent("i-popup");
7462
8276
  return openBlock(), createBlock(_component_i_popup, {
7463
8277
  class: "ipopupmenu",
@@ -7493,7 +8307,7 @@ function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
7493
8307
  _: 1
7494
8308
  }, 8, ["is-open", "anchor", "focus-element", "onKeyup", "onKeydown"]);
7495
8309
  }
7496
- const IPopupMenu = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$D]]);
8310
+ const IPopupMenu = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$y]]);
7497
8311
  const ANIMATION_DURATION = 500;
7498
8312
  const NO_CSS_CLASSES = "";
7499
8313
  const CLOSED_CSS_CLASS_OPACITY = "animate-expand animate-expand--opacity";
@@ -7696,13 +8510,13 @@ const _hoisted_1$E = {
7696
8510
  ref: "content",
7697
8511
  "data-test": "animation-content"
7698
8512
  };
7699
- function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
8513
+ function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
7700
8514
  return openBlock(), createElementBlock("div", {
7701
8515
  class: normalizeClass(_ctx.animationClasses),
7702
8516
  style: normalizeStyle(_ctx.heightStyle)
7703
8517
  }, [_ctx.shouldVIf ? withDirectives((openBlock(), createElementBlock("div", _hoisted_1$E, [renderSlot(_ctx.$slots, "default")], 512)), [[vShow, _ctx.shouldVShow]]) : createCommentVNode("", true)], 6);
7704
8518
  }
7705
- const IAnimateExpand = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["render", _sfc_render$C]]);
8519
+ const IAnimateExpand = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["render", _sfc_render$x]]);
7706
8520
  const _sfc_main$P = defineComponent({
7707
8521
  name: "ISkipLink",
7708
8522
  mixins: [TranslationMixin],
@@ -7718,13 +8532,13 @@ const _sfc_main$P = defineComponent({
7718
8532
  }
7719
8533
  });
7720
8534
  const _hoisted_1$D = ["href"];
7721
- function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
8535
+ function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
7722
8536
  return openBlock(), createElementBlock("a", {
7723
8537
  class: "iskiplink",
7724
8538
  href: _ctx.href
7725
8539
  }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(_ctx.$t("fkui.skip-link.text", "Gå direkt till innehåll")), 1)])], 8, _hoisted_1$D);
7726
8540
  }
7727
- const ISkipLink = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$B]]);
8541
+ const ISkipLink = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$w]]);
7728
8542
  function filterOptions(options, filter2, selectMode) {
7729
8543
  if (isEmpty(filter2) || selectMode) {
7730
8544
  return options;
@@ -8342,7 +9156,7 @@ const _hoisted_5$g = {
8342
9156
  const _hoisted_6$d = {
8343
9157
  class: "tooltip__footer"
8344
9158
  };
8345
- function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
9159
+ function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
8346
9160
  const _component_f_icon = resolveComponent("f-icon");
8347
9161
  return openBlock(), createElementBlock(Fragment, null, [(openBlock(), createBlock(Teleport, {
8348
9162
  disabled: _ctx.iconTarget === null,
@@ -8375,7 +9189,7 @@ function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
8375
9189
  name: "close"
8376
9190
  })])])])) : createCommentVNode("", true)], 16)], 64);
8377
9191
  }
8378
- const FTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$A]]);
9192
+ const FTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$v]]);
8379
9193
  function* labelClasses(options) {
8380
9194
  const {
8381
9195
  labelClass
@@ -8676,7 +9490,7 @@ const _hoisted_9$4 = {
8676
9490
  key: 0,
8677
9491
  class: "label__message label__message--error"
8678
9492
  };
8679
- function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
9493
+ function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
8680
9494
  const _component_f_icon = resolveComponent("f-icon");
8681
9495
  return openBlock(), createElementBlock("fieldset", {
8682
9496
  id: _ctx.id,
@@ -8713,7 +9527,7 @@ function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
8713
9527
  class: normalizeClass(_ctx.groupContentClass)
8714
9528
  }, [renderSlot(_ctx.$slots, "default")], 2)], 42, _hoisted_1$z);
8715
9529
  }
8716
- const FFieldset = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$z]]);
9530
+ const FFieldset = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$u]]);
8717
9531
  const anyType$1 = [String, Object, Array, Number, Date, Boolean];
8718
9532
  const _sfc_main$K = defineComponent({
8719
9533
  name: "FCheckboxField",
@@ -8911,7 +9725,7 @@ const _hoisted_4$i = {
8911
9725
  key: 0,
8912
9726
  class: "checkbox__details"
8913
9727
  };
8914
- function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
9728
+ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
8915
9729
  return openBlock(), createElementBlock("div", {
8916
9730
  class: normalizeClass(["checkbox", _ctx.disabledClass]),
8917
9731
  onValidity: _cache[2] || (_cache[2] = (...args) => _ctx.onValidity && _ctx.onValidity(...args))
@@ -8941,7 +9755,38 @@ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
8941
9755
  _: 3
8942
9756
  }, 8, ["onEnter", "onAfterEnter", "onLeave"])) : createCommentVNode("", true)], 64)) : createCommentVNode("", true)], 10, _hoisted_2$q)], 34);
8943
9757
  }
8944
- const FCheckboxField = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$y]]);
9758
+ const FCheckboxField = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$t]]);
9759
+ var es_iterator_some = {};
9760
+ var hasRequiredEs_iterator_some;
9761
+ function requireEs_iterator_some() {
9762
+ if (hasRequiredEs_iterator_some) return es_iterator_some;
9763
+ hasRequiredEs_iterator_some = 1;
9764
+ var $ = require_export();
9765
+ var iterate2 = requireIterate();
9766
+ var aCallable2 = requireACallable();
9767
+ var anObject2 = requireAnObject();
9768
+ var getIteratorDirect2 = requireGetIteratorDirect();
9769
+ $({
9770
+ target: "Iterator",
9771
+ proto: true,
9772
+ real: true
9773
+ }, {
9774
+ some: function some(predicate) {
9775
+ anObject2(this);
9776
+ aCallable2(predicate);
9777
+ var record = getIteratorDirect2(this);
9778
+ var counter = 0;
9779
+ return iterate2(record, function(value, stop) {
9780
+ if (predicate(value, counter++)) return stop();
9781
+ }, {
9782
+ IS_RECORD: true,
9783
+ INTERRUPTED: true
9784
+ }).stopped;
9785
+ }
9786
+ });
9787
+ return es_iterator_some;
9788
+ }
9789
+ requireEs_iterator_some();
8945
9790
  function isContextMenuTextItem(value) {
8946
9791
  return typeof value.key === "string";
8947
9792
  }
@@ -9166,7 +10011,7 @@ const _hoisted_5$e = {
9166
10011
  key: 0,
9167
10012
  class: "contextmenu__separator"
9168
10013
  };
9169
- function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
10014
+ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
9170
10015
  const _component_f_icon = resolveComponent("f-icon");
9171
10016
  const _component_i_popup = resolveComponent("i-popup");
9172
10017
  return openBlock(), createBlock(_component_i_popup, {
@@ -9206,7 +10051,7 @@ function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
9206
10051
  _: 1
9207
10052
  }, 8, ["is-open", "anchor", "focus-element"]);
9208
10053
  }
9209
- const FContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$x]]);
10054
+ const FContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$s]]);
9210
10055
  var Operation = /* @__PURE__ */ ((Operation2) => {
9211
10056
  Operation2[Operation2["ADD"] = 0] = "ADD";
9212
10057
  Operation2[Operation2["DELETE"] = 1] = "DELETE";
@@ -9214,30 +10059,14 @@ var Operation = /* @__PURE__ */ ((Operation2) => {
9214
10059
  Operation2[Operation2["NONE"] = 3] = "NONE";
9215
10060
  return Operation2;
9216
10061
  })(Operation || {});
9217
- const _sfc_main$I = defineComponent({
9218
- name: "FCrudDataset",
9219
- components: {
9220
- FFormModal,
9221
- FConfirmModal,
9222
- FIcon
9223
- },
9224
- mixins: [TranslationMixin],
9225
- provide() {
9226
- return {
9227
- delete: (item) => {
9228
- this.deleteItem(item);
9229
- },
9230
- modify: (item) => {
9231
- this.updateItem(item);
9232
- },
9233
- registerCallbackAfterItemAdd: (callback) => {
9234
- this.callbackAfterItemAdd = callback;
9235
- },
9236
- registerCallbackBeforeItemDelete: (callback) => {
9237
- this.callbackBeforeItemDelete = callback;
9238
- }
9239
- };
9240
- },
10062
+ const _hoisted_1$w = {
10063
+ class: "crud-dataset"
10064
+ };
10065
+ const _hoisted_2$o = {
10066
+ key: 0
10067
+ };
10068
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
10069
+ __name: "FCrudDataset",
9241
10070
  props: {
9242
10071
  /**
9243
10072
  * The list of items that should be deleted, modified or added to.
@@ -9321,25 +10150,24 @@ const _sfc_main$I = defineComponent({
9321
10150
  }
9322
10151
  },
9323
10152
  emits: ["created", "deleted", "updated", "update:modelValue"],
9324
- data() {
9325
- return {
9326
- result: [],
9327
- Operation,
9328
- operation: Operation.NONE,
9329
- item: null,
9330
- originalItemToUpdate: null,
9331
- isFormModalOpen: false,
9332
- isConfirmModalOpen: false,
9333
- callbackAfterItemAdd() {
9334
- },
9335
- callbackBeforeItemDelete() {
9336
- }
9337
- };
9338
- },
9339
- computed: {
9340
- formModalButtons() {
9341
- const confirmButtonText = this.operation === Operation.ADD ? this.$t("fkui.crud-dataset.modal.confirm.add", "Lägg till") : this.$t("fkui.crud-dataset.modal.confirm.modify", "Spara");
9342
- const cancelButtonText = this.operation === Operation.ADD ? this.$t("fkui.crud-dataset.modal.cancel.add", "Avbryt") : this.$t("fkui.crud-dataset.modal.cancel.modify", "Avbryt");
10153
+ setup(__props, {
10154
+ emit: __emit
10155
+ }) {
10156
+ const $t2 = useTranslate();
10157
+ const slots = useSlots();
10158
+ const result = ref([]);
10159
+ const operation = ref(Operation.NONE);
10160
+ const item = ref(null);
10161
+ const originalItemToUpdate = ref(null);
10162
+ const isFormModalOpen = ref(false);
10163
+ const isConfirmModalOpen = ref(false);
10164
+ const callbackAfterItemAdd = ref(() => ({}));
10165
+ const callbackBeforeItemDelete = ref(() => ({}));
10166
+ const props = __props;
10167
+ const emit = __emit;
10168
+ const formModalButtons = computed(() => {
10169
+ const confirmButtonText = operation.value === Operation.ADD ? $t2("fkui.crud-dataset.modal.confirm.add", "Lägg till") : $t2("fkui.crud-dataset.modal.confirm.modify", "Spara");
10170
+ const cancelButtonText = operation.value === Operation.ADD ? $t2("fkui.crud-dataset.modal.cancel.add", "Avbryt") : $t2("fkui.crud-dataset.modal.cancel.modify", "Avbryt");
9343
10171
  return [{
9344
10172
  label: confirmButtonText,
9345
10173
  event: "confirm",
@@ -9351,175 +10179,168 @@ const _sfc_main$I = defineComponent({
9351
10179
  type: "secondary",
9352
10180
  submitButton: false
9353
10181
  }];
9354
- },
9355
- confirmDeleteButtons() {
10182
+ });
10183
+ const confirmDeleteButtons = computed(() => {
9356
10184
  return [{
9357
- label: this.$t("fkui.crud-dataset.modal.confirm.delete", "Ja, ta bort"),
10185
+ label: $t2("fkui.crud-dataset.modal.confirm.delete", "Ja, ta bort"),
9358
10186
  type: "primary",
9359
10187
  event: "confirm"
9360
10188
  }, {
9361
- label: this.$t("fkui.crud-dataset.modal.cancel.delete", "Nej, avbryt"),
10189
+ label: $t2("fkui.crud-dataset.modal.cancel.delete", "Nej, avbryt"),
9362
10190
  type: "secondary"
9363
10191
  }];
9364
- },
9365
- hasAddSlot() {
9366
- return Boolean(this.$slots.add);
9367
- },
9368
- hasDeleteSlot() {
9369
- return Boolean(this.$slots.delete);
9370
- },
9371
- hasModifySlot() {
9372
- return Boolean(this.$slots.modify);
9373
- },
9374
- formModalHeader() {
9375
- return this.operation === Operation.ADD ? this.addNewModalHeader : this.modifyModalHeader;
9376
- }
9377
- },
9378
- watch: {
9379
- modelValue: {
9380
- immediate: true,
9381
- deep: true,
9382
- handler(data) {
9383
- this.result = [...data];
10192
+ });
10193
+ const hasAddSlot = computed(() => {
10194
+ return Boolean(slots.add);
10195
+ });
10196
+ const hasDeleteSlot = computed(() => {
10197
+ return Boolean(slots.delete);
10198
+ });
10199
+ const hasModifySlot = computed(() => {
10200
+ return Boolean(slots.modify);
10201
+ });
10202
+ const formModalHeader = computed(() => {
10203
+ return operation.value === Operation.ADD ? props.addNewModalHeader : props.modifyModalHeader;
10204
+ });
10205
+ provide("delete", deleteItem);
10206
+ provide("modify", updateItem);
10207
+ provide("registerCallbackAfterItemAdd", (callback) => {
10208
+ callbackAfterItemAdd.value = callback;
10209
+ });
10210
+ provide("registerCallbackBeforeItemDelete", (callback) => {
10211
+ callbackBeforeItemDelete.value = callback;
10212
+ });
10213
+ onMounted(() => {
10214
+ if (!hasAddSlot.value && !hasDeleteSlot.value && !hasModifySlot.value) {
10215
+ throw Error("At least one template of the following must be defined. #add, #delete or #modify");
9384
10216
  }
9385
- }
9386
- },
9387
- mounted() {
9388
- if (!this.hasAddSlot && !this.hasDeleteSlot && !this.hasModifySlot) {
9389
- throw Error("Atleast one template of the following must be defined. #add, #delete or #modify");
9390
- }
9391
- },
9392
- methods: {
9393
- createItem() {
9394
- if (!this.hasAddSlot) {
10217
+ });
10218
+ watch(() => props.modelValue, (data) => {
10219
+ result.value = [...data];
10220
+ }, {
10221
+ immediate: true,
10222
+ deep: true
10223
+ });
10224
+ function createItem() {
10225
+ if (!hasAddSlot.value) {
9395
10226
  throw Error("No template is defined for #add");
9396
10227
  }
9397
- this.operation = Operation.ADD;
9398
- this.item = this.beforeCreate ? this.beforeCreate() : {};
9399
- this.isFormModalOpen = true;
9400
- },
9401
- deleteItem(item) {
9402
- if (!this.hasDeleteSlot) {
10228
+ operation.value = Operation.ADD;
10229
+ item.value = props.beforeCreate ? props.beforeCreate() : {};
10230
+ isFormModalOpen.value = true;
10231
+ }
10232
+ function deleteItem(current) {
10233
+ if (!hasDeleteSlot.value) {
9403
10234
  throw Error("No template is defined for #delete");
9404
10235
  }
9405
- this.operation = Operation.DELETE;
9406
- this.item = item;
9407
- this.isConfirmModalOpen = true;
9408
- },
9409
- onDeleteConfirm() {
9410
- if (!this.item) {
10236
+ operation.value = Operation.DELETE;
10237
+ item.value = current;
10238
+ isConfirmModalOpen.value = true;
10239
+ }
10240
+ function onDeleteConfirm() {
10241
+ if (!item.value) {
9411
10242
  return;
9412
10243
  }
9413
- this.callbackBeforeItemDelete(this.item);
9414
- this.result = this.result.filter((item) => item !== this.item);
9415
- this.$emit("deleted", this.item);
9416
- this.$emit("update:modelValue", this.result);
9417
- alertScreenReader(this.$t("fkui.crud-dataset.aria-live.delete", "Raden har tagits bort"), {
10244
+ callbackBeforeItemDelete.value(item.value);
10245
+ result.value = result.value.filter((it) => it !== item.value);
10246
+ emit("deleted", item.value);
10247
+ emit("update:modelValue", result.value);
10248
+ alertScreenReader($t2("fkui.crud-dataset.aria-live.delete", "Raden har tagits bort"), {
9418
10249
  assertive: true
9419
10250
  });
9420
- },
9421
- onDeleteClose(e) {
9422
- this.onModalClose();
9423
- if (e.reason === "close" && this.onCancel) {
9424
- this.onCancel();
10251
+ }
10252
+ function onDeleteClose(e) {
10253
+ onModalClose();
10254
+ if (e.reason === "close" && props.onCancel) {
10255
+ props.onCancel();
9425
10256
  }
9426
- },
9427
- onModalClose() {
9428
- this.isFormModalOpen = false;
9429
- this.isConfirmModalOpen = false;
9430
- },
9431
- onFormModalSubmit() {
9432
- if (!this.item) {
10257
+ }
10258
+ function onModalClose() {
10259
+ isFormModalOpen.value = false;
10260
+ isConfirmModalOpen.value = false;
10261
+ }
10262
+ function onFormModalSubmit() {
10263
+ if (!item.value) {
9433
10264
  return;
9434
10265
  }
9435
- if (this.operation === Operation.ADD) {
9436
- this.result.push(this.item);
9437
- this.$emit("created", this.item);
9438
- this.$emit("update:modelValue", this.result);
9439
- this.callbackAfterItemAdd(this.item);
9440
- alertScreenReader(this.$t("fkui.crud-dataset.aria-live.add", "En rad har lagts till"), {
10266
+ if (operation.value === Operation.ADD) {
10267
+ result.value.push(item.value);
10268
+ emit("created", item.value);
10269
+ emit("update:modelValue", result.value);
10270
+ callbackAfterItemAdd.value(item.value);
10271
+ alertScreenReader($t2("fkui.crud-dataset.aria-live.add", "En rad har lagts till"), {
9441
10272
  assertive: true
9442
10273
  });
9443
- } else if (this.operation === Operation.MODIFY) {
9444
- if (this.originalItemToUpdate) {
9445
- Object.assign(this.originalItemToUpdate, this.item);
10274
+ } else if (operation.value === Operation.MODIFY) {
10275
+ if (originalItemToUpdate.value) {
10276
+ Object.assign(originalItemToUpdate.value, item.value);
9446
10277
  } else {
9447
- this.originalItemToUpdate = this.item;
10278
+ originalItemToUpdate.value = item.value;
9448
10279
  }
9449
- this.$emit("updated", this.originalItemToUpdate);
9450
- this.$emit("update:modelValue", this.result);
9451
- alertScreenReader(this.$t("fkui.crud-dataset.aria-live.modify", "Raden har ändrats"), {
10280
+ emit("updated", originalItemToUpdate.value);
10281
+ emit("update:modelValue", result.value);
10282
+ alertScreenReader($t2("fkui.crud-dataset.aria-live.modify", "Raden har ändrats"), {
9452
10283
  assertive: true
9453
10284
  });
9454
10285
  }
9455
- this.isFormModalOpen = false;
9456
- },
9457
- updateItem(item) {
9458
- if (!this.hasModifySlot) {
10286
+ isFormModalOpen.value = false;
10287
+ }
10288
+ function updateItem(current) {
10289
+ if (!hasModifySlot.value) {
9459
10290
  throw Error("No template is defined for #modify");
9460
10291
  }
9461
- this.operation = Operation.MODIFY;
9462
- this.originalItemToUpdate = item;
9463
- this.item = deepClone(item);
9464
- this.isFormModalOpen = true;
10292
+ operation.value = Operation.MODIFY;
10293
+ originalItemToUpdate.value = current;
10294
+ item.value = deepClone(current);
10295
+ isFormModalOpen.value = true;
9465
10296
  }
10297
+ return (_ctx, _cache) => {
10298
+ return openBlock(), createElementBlock("div", _hoisted_1$w, [renderSlot(_ctx.$slots, "default"), _cache[5] || (_cache[5] = createTextVNode()), hasAddSlot.value ? (openBlock(), createElementBlock("div", _hoisted_2$o, [createElementVNode("button", {
10299
+ "data-test": "f-crud-dataset-add-button",
10300
+ type: "button",
10301
+ class: "button button--tertiary crud-dataset__add-button",
10302
+ onClick: _cache[0] || (_cache[0] = ($event) => createItem())
10303
+ }, [createVNode(unref(FIcon), {
10304
+ class: "button__icon",
10305
+ name: "plus"
10306
+ }), _cache[1] || (_cache[1] = createTextVNode()), renderSlot(_ctx.$slots, "add-button", {}, () => [createTextVNode(toDisplayString(unref($t2)("fkui.crud-dataset.button.add", "Lägg till ny")), 1)])])])) : createCommentVNode("", true), _cache[6] || (_cache[6] = createTextVNode()), createVNode(unref(FFormModal), {
10307
+ "is-open": isFormModalOpen.value,
10308
+ "aria-close-text": unref($t2)("fkui.crud-dataset.modal.close", "Stäng"),
10309
+ buttons: formModalButtons.value,
10310
+ "use-error-list": false,
10311
+ "before-submit": __props.beforeSubmit,
10312
+ "before-validation": __props.beforeValidation,
10313
+ "on-cancel": __props.onCancel,
10314
+ onClose: onModalClose,
10315
+ onCancel: __props.onCancel,
10316
+ onSubmit: onFormModalSubmit
10317
+ }, {
10318
+ header: withCtx(() => [createTextVNode(toDisplayString(formModalHeader.value), 1)]),
10319
+ "input-text-fields": withCtx(() => [operation.value === unref(Operation).ADD ? renderSlot(_ctx.$slots, "add", normalizeProps(mergeProps({
10320
+ key: 0
10321
+ }, {
10322
+ item: item.value
10323
+ }))) : createCommentVNode("", true), _cache[2] || (_cache[2] = createTextVNode()), operation.value === unref(Operation).MODIFY ? renderSlot(_ctx.$slots, "modify", normalizeProps(mergeProps({
10324
+ key: 1
10325
+ }, {
10326
+ item: item.value
10327
+ }))) : createCommentVNode("", true)]),
10328
+ _: 3
10329
+ }, 8, ["is-open", "aria-close-text", "buttons", "before-submit", "before-validation", "on-cancel", "onCancel"]), _cache[7] || (_cache[7] = createTextVNode()), createVNode(unref(FConfirmModal), {
10330
+ "is-open": isConfirmModalOpen.value,
10331
+ buttons: confirmDeleteButtons.value,
10332
+ onConfirm: onDeleteConfirm,
10333
+ onClose: onDeleteClose
10334
+ }, {
10335
+ heading: withCtx(() => [createTextVNode(toDisplayString(__props.deleteModalHeader), 1)]),
10336
+ content: withCtx(() => [renderSlot(_ctx.$slots, "delete", normalizeProps(guardReactiveProps({
10337
+ item: item.value
10338
+ })))]),
10339
+ _: 3
10340
+ }, 8, ["is-open", "buttons"])]);
10341
+ };
9466
10342
  }
9467
10343
  });
9468
- const _hoisted_1$w = {
9469
- class: "crud-dataset"
9470
- };
9471
- const _hoisted_2$o = {
9472
- key: 0
9473
- };
9474
- function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
9475
- const _component_f_icon = resolveComponent("f-icon");
9476
- const _component_f_form_modal = resolveComponent("f-form-modal");
9477
- const _component_f_confirm_modal = resolveComponent("f-confirm-modal");
9478
- return openBlock(), createElementBlock("div", _hoisted_1$w, [renderSlot(_ctx.$slots, "default"), _cache[5] || (_cache[5] = createTextVNode()), _ctx.hasAddSlot ? (openBlock(), createElementBlock("div", _hoisted_2$o, [createElementVNode("button", {
9479
- "data-test": "f-crud-dataset-add-button",
9480
- type: "button",
9481
- class: "button button--tertiary crud-dataset__add-button",
9482
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.createItem())
9483
- }, [createVNode(_component_f_icon, {
9484
- class: "button__icon",
9485
- name: "plus"
9486
- }), _cache[1] || (_cache[1] = createTextVNode()), renderSlot(_ctx.$slots, "add-button", {}, () => [createTextVNode(toDisplayString(_ctx.$t("fkui.crud-dataset.button.add", "Lägg till ny")), 1)])])])) : createCommentVNode("", true), _cache[6] || (_cache[6] = createTextVNode()), createVNode(_component_f_form_modal, {
9487
- "is-open": _ctx.isFormModalOpen,
9488
- "aria-close-text": _ctx.$t("fkui.crud-dataset.modal.close", "Stäng"),
9489
- buttons: _ctx.formModalButtons,
9490
- "use-error-list": false,
9491
- "before-submit": _ctx.beforeSubmit,
9492
- "before-validation": _ctx.beforeValidation,
9493
- "on-cancel": _ctx.onCancel,
9494
- onClose: _ctx.onModalClose,
9495
- onCancel: _ctx.onCancel,
9496
- onSubmit: _ctx.onFormModalSubmit
9497
- }, {
9498
- header: withCtx(() => [createTextVNode(toDisplayString(_ctx.formModalHeader), 1)]),
9499
- "input-text-fields": withCtx(() => [_ctx.operation === _ctx.Operation.ADD ? renderSlot(_ctx.$slots, "add", normalizeProps(mergeProps({
9500
- key: 0
9501
- }, {
9502
- item: _ctx.item
9503
- }))) : createCommentVNode("", true), _cache[2] || (_cache[2] = createTextVNode()), _ctx.operation === _ctx.Operation.MODIFY ? renderSlot(_ctx.$slots, "modify", normalizeProps(mergeProps({
9504
- key: 1
9505
- }, {
9506
- item: _ctx.item
9507
- }))) : createCommentVNode("", true)]),
9508
- _: 3
9509
- }, 8, ["is-open", "aria-close-text", "buttons", "before-submit", "before-validation", "on-cancel", "onClose", "onCancel", "onSubmit"]), _cache[7] || (_cache[7] = createTextVNode()), createVNode(_component_f_confirm_modal, {
9510
- "is-open": _ctx.isConfirmModalOpen,
9511
- buttons: _ctx.confirmDeleteButtons,
9512
- onConfirm: _ctx.onDeleteConfirm,
9513
- onClose: _ctx.onDeleteClose
9514
- }, {
9515
- heading: withCtx(() => [createTextVNode(toDisplayString(_ctx.deleteModalHeader), 1)]),
9516
- content: withCtx(() => [renderSlot(_ctx.$slots, "delete", normalizeProps(guardReactiveProps({
9517
- item: _ctx.item
9518
- })))]),
9519
- _: 3
9520
- }, 8, ["is-open", "buttons", "onConfirm", "onClose"])]);
9521
- }
9522
- const FCrudDataset = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$w]]);
9523
10344
  function FCrudDatasetInjected() {
9524
10345
  return {
9525
10346
  delete: inject("delete"),
@@ -9586,7 +10407,7 @@ const _hoisted_1$v = {
9586
10407
  key: 1,
9587
10408
  class: "sr-only"
9588
10409
  };
9589
- function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
10410
+ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
9590
10411
  const _component_f_icon = resolveComponent("f-icon");
9591
10412
  return openBlock(), createElementBlock("button", {
9592
10413
  type: "button",
@@ -9600,7 +10421,7 @@ function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
9600
10421
  key: 2
9601
10422
  }, () => [createTextVNode(toDisplayString(_ctx.buttonText), 1)]) : createCommentVNode("", true)]);
9602
10423
  }
9603
- const FCrudButton = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$v]]);
10424
+ const FCrudButton = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$r]]);
9604
10425
  function ActivateItemInjected() {
9605
10426
  return {
9606
10427
  registerCallbackAfterItemAdd: inject("registerCallbackAfterItemAdd", () => void 0),
@@ -9825,7 +10646,7 @@ const _sfc_main$G = defineComponent({
9825
10646
  });
9826
10647
  }
9827
10648
  });
9828
- function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
10649
+ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
9829
10650
  return _ctx.renderColumns && _ctx.visible ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.tagName), mergeProps({
9830
10651
  key: 0,
9831
10652
  class: _ctx.classes,
@@ -9837,7 +10658,7 @@ function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
9837
10658
  _: 3
9838
10659
  }, 16, ["class", "scope"])) : createCommentVNode("", true);
9839
10660
  }
9840
- const FTableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$u]]);
10661
+ const FTableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$q]]);
9841
10662
  function FSortFilterDatasetInjected() {
9842
10663
  return {
9843
10664
  sort: inject("sort", () => void 0),
@@ -9902,7 +10723,7 @@ const _hoisted_7$a = {
9902
10723
  key: 0,
9903
10724
  class: "label__message label__message--error"
9904
10725
  };
9905
- function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
10726
+ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
9906
10727
  const _component_f_icon = resolveComponent("f-icon");
9907
10728
  return _ctx.$slots.tooltip ? (openBlock(), createElementBlock("div", _hoisted_1$u, [_ctx.hasDefaultSlot ? (openBlock(), createElementBlock("div", _hoisted_2$n, [createElementVNode("label", {
9908
10729
  class: "label",
@@ -9929,7 +10750,7 @@ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
9929
10750
  name: "error"
9930
10751
  }), _cache[4] || (_cache[4] = createTextVNode()), renderSlot(_ctx.$slots, "error-message")])) : createCommentVNode("", true)], 8, _hoisted_6$b));
9931
10752
  }
9932
- const FLabel = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$t]]);
10753
+ const FLabel = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$p]]);
9933
10754
  function resolveWidthClass$1(words, inline) {
9934
10755
  return inline ? void 0 : words.split(" ").map((word) => `i-width-${word}`).join(" ");
9935
10756
  }
@@ -10065,7 +10886,7 @@ const _sfc_main$E = defineComponent({
10065
10886
  }
10066
10887
  });
10067
10888
  const _hoisted_1$t = ["id"];
10068
- function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
10889
+ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
10069
10890
  const _component_f_label = resolveComponent("f-label");
10070
10891
  const _component_f_icon = resolveComponent("f-icon");
10071
10892
  return openBlock(), createElementBlock("div", {
@@ -10112,7 +10933,7 @@ function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
10112
10933
  name: "arrow-down"
10113
10934
  })], 2)], 34);
10114
10935
  }
10115
- const FSelectField = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$s]]);
10936
+ const FSelectField = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$o]]);
10116
10937
  function resolveWidthClass(words, inline) {
10117
10938
  return inline ? void 0 : words.split(" ").map((word) => `i-width-${word}`).join(" ");
10118
10939
  }
@@ -10517,7 +11338,7 @@ const _hoisted_7$9 = {
10517
11338
  key: 3,
10518
11339
  class: "text-field__append-inner"
10519
11340
  };
10520
- function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
11341
+ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
10521
11342
  const _component_f_label = resolveComponent("f-label");
10522
11343
  const _component_f_icon = resolveComponent("f-icon");
10523
11344
  const _component_i_popup_error = resolveComponent("i-popup-error");
@@ -10600,7 +11421,7 @@ function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
10600
11421
  onClose: _ctx.onDropdownClose
10601
11422
  }, null, 8, ["id", "is-open", "options", "active-option", "active-option-id", "input-node", "onSelect", "onClose"])) : createCommentVNode("", true)], 2);
10602
11423
  }
10603
- const FTextField = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$r]]);
11424
+ const FTextField = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$n]]);
10604
11425
  const _sfc_main$C = defineComponent({
10605
11426
  name: "FEmailTextField",
10606
11427
  components: {
@@ -10720,7 +11541,7 @@ const _sfc_main$C = defineComponent({
10720
11541
  const _hoisted_1$r = {
10721
11542
  key: 0
10722
11543
  };
10723
- function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
11544
+ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
10724
11545
  const _component_f_text_field = resolveComponent("f-text-field");
10725
11546
  return openBlock(), createElementBlock("div", null, [createVNode(_component_f_text_field, mergeProps({
10726
11547
  id: _ctx.id,
@@ -10750,7 +11571,7 @@ function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
10750
11571
  _: 3
10751
11572
  }, 8, ["modelValue", "maxlength", "onPaste"])) : createCommentVNode("", true)]);
10752
11573
  }
10753
- const FEmailTextField = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$q]]);
11574
+ const FEmailTextField = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$m]]);
10754
11575
  const _sfc_main$B = defineComponent({
10755
11576
  name: "FPhoneTextField",
10756
11577
  components: {
@@ -10851,7 +11672,7 @@ const _sfc_main$B = defineComponent({
10851
11672
  }
10852
11673
  }
10853
11674
  });
10854
- function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
11675
+ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
10855
11676
  const _component_f_text_field = resolveComponent("f-text-field");
10856
11677
  return openBlock(), createElementBlock("div", null, [createVNode(_component_f_text_field, mergeProps({
10857
11678
  id: _ctx.id,
@@ -10878,7 +11699,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
10878
11699
  _: 3
10879
11700
  }, 8, ["modelValue", "maxlength"])) : createCommentVNode("", true)]);
10880
11701
  }
10881
- const FPhoneTextField = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$p]]);
11702
+ const FPhoneTextField = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$l]]);
10882
11703
  const _sfc_main$A = defineComponent({
10883
11704
  name: "FCurrencyTextField",
10884
11705
  extends: FTextField,
@@ -10977,7 +11798,7 @@ const _sfc_main$z = defineComponent({
10977
11798
  const _hoisted_1$q = {
10978
11799
  class: "sr-only"
10979
11800
  };
10980
- function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
11801
+ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
10981
11802
  const _component_f_icon = resolveComponent("f-icon");
10982
11803
  const _component_f_text_field = resolveComponent("f-text-field");
10983
11804
  return openBlock(), createElementBlock("div", null, [createVNode(_component_f_text_field, mergeProps({
@@ -11027,7 +11848,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
11027
11848
  key: "1"
11028
11849
  } : void 0]), 1040, ["id", "maxlength", "model-value", "onChange", "onInput", "onBlur", "onUpdate"])]);
11029
11850
  }
11030
- const FSearchTextField = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$o]]);
11851
+ const FSearchTextField = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$k]]);
11031
11852
  const _sfc_main$y = defineComponent({
11032
11853
  name: "FBankAccountNumberTextField",
11033
11854
  extends: FTextField,
@@ -11423,51 +12244,40 @@ function filter(list, filterAttributes, searchString) {
11423
12244
  const searchTerms = searchString.split(/\s+/).map((word) => word.toLocaleLowerCase());
11424
12245
  return list.filter((item) => includesAllSearchTerms(item, filterAttributes, searchTerms));
11425
12246
  }
11426
- const _sfc_main$p = defineComponent({
11427
- name: "FSortFilterDataset",
11428
- components: {
11429
- FSelectField,
11430
- FTextField,
11431
- FIcon,
11432
- IFlex,
11433
- IFlexItem
11434
- },
11435
- mixins: [TranslationMixin],
11436
- provide() {
11437
- return {
11438
- sort: (attribute, ascending) => {
11439
- const foundAttribute = this.sortOrders.find((item) => item.attribute === attribute && item.ascending === ascending);
11440
- if (foundAttribute) {
11441
- this.sortAttribute = foundAttribute;
11442
- } else {
11443
- this.sortAttribute = {
11444
- attribute: "",
11445
- ascending: false
11446
- };
11447
- }
11448
- this.sortFilterData();
11449
- this.$emit("usedSortAttributes", this.sortAttribute);
11450
- },
11451
- registerCallbackOnSort: (callback) => {
11452
- this.tableCallbackOnSort = callback;
11453
- },
11454
- registerCallbackOnMount: (callback) => {
11455
- this.tableCallbackSortableColumns = callback;
11456
- }
11457
- };
11458
- },
11459
- props: {
11460
- /**
11461
- * The data that you wish to sort or filter.
11462
- */
11463
- data: {
11464
- type: Array,
11465
- required: true,
11466
- default: () => []
11467
- },
11468
- /**
11469
- * All the attributes you want to enable sorting for and the corresponding name to display in the dropdown.
11470
- * Structured as `{attributeName: "Name for dropdown", secondAttributeName: "Name for dropdown"}`
12247
+ const _hoisted_1$p = {
12248
+ class: "sort-filter-dataset"
12249
+ };
12250
+ const _hoisted_2$l = {
12251
+ class: "sort-filter-dataset__search"
12252
+ };
12253
+ const _hoisted_3$h = {
12254
+ class: "sr-only"
12255
+ };
12256
+ const _hoisted_4$e = ["title"];
12257
+ const _hoisted_5$b = {
12258
+ class: "sr-only"
12259
+ };
12260
+ const _hoisted_6$9 = {
12261
+ value: {
12262
+ attribute: "",
12263
+ ascending: false
12264
+ }
12265
+ };
12266
+ const _hoisted_7$8 = ["value"];
12267
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
12268
+ __name: "FSortFilterDataset",
12269
+ props: {
12270
+ /**
12271
+ * The data that you wish to sort or filter.
12272
+ */
12273
+ data: {
12274
+ type: Array,
12275
+ required: true,
12276
+ default: () => []
12277
+ },
12278
+ /**
12279
+ * All the attributes you want to enable sorting for and the corresponding name to display in the dropdown.
12280
+ * Structured as `{attributeName: "Name for dropdown", secondAttributeName: "Name for dropdown"}`
11471
12281
  */
11472
12282
  sortableAttributes: {
11473
12283
  type: Object,
@@ -11504,7 +12314,7 @@ const _sfc_main$p = defineComponent({
11504
12314
  placeholderFilter: {
11505
12315
  type: String,
11506
12316
  required: false,
11507
- default: TranslationMixin.methods.$t("fkui.sort-filter-dataset.placeholder.filter", "Sök")
12317
+ default: TranslationService.provider.translate("fkui.sort-filter-dataset.placeholder.filter", "Sök")
11508
12318
  },
11509
12319
  /**
11510
12320
  * The order the data will be sorted by if defaultSortAttribute has been set.
@@ -11516,243 +12326,237 @@ const _sfc_main$p = defineComponent({
11516
12326
  }
11517
12327
  },
11518
12328
  emits: ["datasetSorted", "usedSortAttributes"],
11519
- data() {
11520
- return {
11521
- searchString: "",
11522
- sortAttribute: {
11523
- attribute: "",
11524
- ascending: false
11525
- },
11526
- sortFilterResult: [],
11527
- tableCallbackOnSort: () => {
11528
- return;
11529
- },
11530
- tableCallbackSortableColumns: () => {
11531
- return;
11532
- }
12329
+ setup(__props, {
12330
+ emit: __emit
12331
+ }) {
12332
+ const $t2 = useTranslate();
12333
+ const searchString = ref("");
12334
+ const sortAttribute = ref({
12335
+ attribute: "",
12336
+ name: "",
12337
+ ascendingName: "",
12338
+ ascending: false,
12339
+ id: 0
12340
+ });
12341
+ const sortFilterResult = ref([]);
12342
+ const debouncedFilterResultset = debounce(filterResultset, 250);
12343
+ let tableCallbackOnSort = () => {
11533
12344
  };
11534
- },
11535
- computed: {
11536
- showClearButton() {
11537
- return this.searchString.length > 0;
11538
- },
11539
- sortOrders() {
12345
+ let tableCallbackSortableColumns = () => {
12346
+ };
12347
+ const props = __props;
12348
+ const emit = __emit;
12349
+ const showClearButton = computed(() => {
12350
+ return searchString.value.length > 0;
12351
+ });
12352
+ const sortOrders = computed(() => {
11540
12353
  const arr = [];
11541
12354
  let id = 0;
11542
- Object.keys(this.sortableAttributes).forEach((key) => {
12355
+ Object.keys(props.sortableAttributes).forEach((key) => {
11543
12356
  arr.push({
11544
12357
  attribute: key,
11545
- name: this.sortableAttributes[key],
11546
- ascendingName: this.$t("fkui.sort-filter-dataset.label.ascending", "stigande"),
12358
+ name: props.sortableAttributes[key],
12359
+ ascendingName: $t2("fkui.sort-filter-dataset.label.ascending", "stigande"),
11547
12360
  ascending: true,
11548
12361
  id: id++
11549
12362
  });
11550
12363
  arr.push({
11551
12364
  attribute: key,
11552
- name: this.sortableAttributes[key],
11553
- ascendingName: this.$t("fkui.sort-filter-dataset.label.descending", "fallande"),
12365
+ name: props.sortableAttributes[key],
12366
+ ascendingName: $t2("fkui.sort-filter-dataset.label.descending", "fallande"),
11554
12367
  ascending: false,
11555
12368
  id: id++
11556
12369
  });
11557
12370
  });
11558
12371
  return arr;
11559
- },
11560
- filterAttributes() {
11561
- return Object.keys(this.sortableAttributes);
11562
- }
11563
- },
11564
- watch: {
11565
- data: {
11566
- immediate: true,
11567
- deep: true,
11568
- handler: function() {
11569
- if (this.defaultSortAttribute !== "") {
11570
- const foundAttribute = this.sortOrders.find((item) => item.attribute === this.defaultSortAttribute && item.ascending === this.defaultSortAscending);
11571
- if (foundAttribute) {
11572
- this.sortAttribute = foundAttribute;
11573
- }
12372
+ });
12373
+ const filterAttributes = computed(() => {
12374
+ return Object.keys(props.sortableAttributes);
12375
+ });
12376
+ provide("sort", (attribute, ascending) => {
12377
+ const foundAttribute = sortOrders.value.find((item) => {
12378
+ return item.attribute === attribute && item.ascending === ascending;
12379
+ });
12380
+ if (foundAttribute) {
12381
+ sortAttribute.value = foundAttribute;
12382
+ } else {
12383
+ sortAttribute.value = {
12384
+ attribute: "",
12385
+ ascending: false
12386
+ };
12387
+ }
12388
+ sortFilterData();
12389
+ emit("usedSortAttributes", sortAttribute.value);
12390
+ });
12391
+ provide("registerCallbackOnSort", (callback) => {
12392
+ tableCallbackOnSort = callback;
12393
+ });
12394
+ provide("registerCallbackOnMount", (callback) => {
12395
+ tableCallbackSortableColumns = callback;
12396
+ });
12397
+ onMounted(() => {
12398
+ tableCallbackSortableColumns(Object.keys(props.sortableAttributes));
12399
+ });
12400
+ watch(() => props.data, () => {
12401
+ if (props.defaultSortAttribute !== "") {
12402
+ const foundAttribute = sortOrders.value.find((item) => {
12403
+ return item.attribute === props.defaultSortAttribute && item.ascending === props.defaultSortAscending;
12404
+ });
12405
+ if (foundAttribute) {
12406
+ sortAttribute.value = foundAttribute;
11574
12407
  }
11575
- this.sortFilterData();
11576
12408
  }
11577
- }
11578
- },
11579
- created() {
11580
- this.debouncedFilterResultset = debounce(this.filterResultset, 250).bind(this);
11581
- },
11582
- mounted() {
11583
- this.tableCallbackSortableColumns(Object.keys(this.sortableAttributes));
11584
- },
11585
- methods: {
11586
- sortFilterData() {
11587
- const filteredData = filter(this.data, this.filterAttributes, this.searchString);
11588
- if (this.sortAttribute.attribute === "") {
11589
- this.sortFilterResult = filteredData;
12409
+ sortFilterData();
12410
+ }, {
12411
+ immediate: true,
12412
+ deep: true
12413
+ });
12414
+ function sortFilterData() {
12415
+ const filteredData = filter(props.data, filterAttributes.value, searchString.value);
12416
+ if (sortAttribute.value.attribute === "") {
12417
+ sortFilterResult.value = filteredData;
11590
12418
  } else {
11591
- this.sortFilterResult = sort([...filteredData], this.sortAttribute.attribute, this.sortAttribute.ascending);
12419
+ sortFilterResult.value = sort([...filteredData], sortAttribute.value.attribute, sortAttribute.value.ascending);
11592
12420
  }
11593
- this.$nextTick(() => {
11594
- this.tableCallbackOnSort(this.sortAttribute.attribute, this.sortAttribute.ascending);
12421
+ nextTick(() => {
12422
+ tableCallbackOnSort(sortAttribute.value.attribute, sortAttribute.value.ascending);
11595
12423
  });
11596
- this.$emit("datasetSorted", this.sortFilterResult);
11597
- },
11598
- onChangeSortAttribute() {
11599
- this.sortFilterData();
11600
- this.$emit("usedSortAttributes", this.sortAttribute);
11601
- },
11602
- onSearchInput(event) {
11603
- this.searchString = event.target.value;
11604
- this.debouncedFilterResultset();
11605
- },
11606
- onClickClearSearch() {
11607
- this.searchString = "";
11608
- this.sortFilterData();
11609
- const input = this.$el.querySelector(".text-field--inline input");
12424
+ emit("datasetSorted", sortFilterResult.value);
12425
+ }
12426
+ function onChangeSortAttribute() {
12427
+ sortFilterData();
12428
+ emit("usedSortAttributes", sortAttribute.value);
12429
+ }
12430
+ function onSearchInput(event) {
12431
+ searchString.value = event.target.value;
12432
+ debouncedFilterResultset();
12433
+ }
12434
+ function onClickClearSearch() {
12435
+ searchString.value = "";
12436
+ sortFilterData();
12437
+ const input = useTemplateRef("search-field").value;
11610
12438
  focus$1(input);
11611
- },
11612
- debouncedFilterResultset() {
11613
- },
11614
- filterResultset() {
11615
- this.sortFilterData();
11616
- if (this.searchString === "") {
11617
- alertScreenReader(this.$t("fkui.sort-filter-dataset.aria-live.empty", "Sök redigera Sök tom"));
12439
+ }
12440
+ function filterResultset() {
12441
+ sortFilterData();
12442
+ if (searchString.value === "") {
12443
+ alertScreenReader($t2("fkui.sort-filter-dataset.aria-live.empty", "Sök redigera Sök tom"));
11618
12444
  } else {
11619
- const searchAriaLive = this.$t("fkui.sort-filter-dataset.aria-live.search", `Din sökning på "{{ search }}" gav {{ result }} träffar.`, {
11620
- result: this.sortFilterResult.length,
11621
- search: this.searchString
12445
+ const searchAriaLive = $t2("fkui.sort-filter-dataset.aria-live.search", `Din sökning på "{{ search }}" gav {{ result }} träffar.`, {
12446
+ result: sortFilterResult.value.length,
12447
+ search: searchString.value
11622
12448
  });
11623
12449
  alertScreenReader(searchAriaLive);
11624
12450
  }
11625
12451
  }
11626
- }
11627
- });
11628
- const _hoisted_1$p = {
11629
- class: "sort-filter-dataset"
11630
- };
11631
- const _hoisted_2$l = {
11632
- class: "sort-filter-dataset__search"
11633
- };
11634
- const _hoisted_3$h = {
11635
- class: "sr-only"
11636
- };
11637
- const _hoisted_4$e = ["title"];
11638
- const _hoisted_5$b = {
11639
- class: "sr-only"
11640
- };
11641
- const _hoisted_6$9 = {
11642
- value: {
11643
- attribute: "",
11644
- ascending: false
11645
- }
11646
- };
11647
- const _hoisted_7$8 = ["value"];
11648
- function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
11649
- const _component_i_flex_item = resolveComponent("i-flex-item");
11650
- const _component_f_icon = resolveComponent("f-icon");
11651
- const _component_f_text_field = resolveComponent("f-text-field");
11652
- const _component_f_select_field = resolveComponent("f-select-field");
11653
- const _component_i_flex = resolveComponent("i-flex");
11654
- return openBlock(), createElementBlock("div", _hoisted_1$p, [createVNode(_component_i_flex, {
11655
- collapse: "",
11656
- gap: "3x",
11657
- wrap: ""
11658
- }, {
11659
- default: withCtx(() => [createVNode(_component_i_flex_item, {
11660
- shrink: "",
11661
- align: "center"
11662
- }, {
11663
- default: withCtx(() => [renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps({
11664
- slotClass: "sort-filter-dataset__toolbar__header"
11665
- })))]),
11666
- _: 3
11667
- }), _cache[9] || (_cache[9] = createTextVNode()), createVNode(_component_i_flex_item, {
11668
- grow: ""
11669
- }, {
11670
- default: withCtx(() => [createVNode(_component_i_flex, {
12452
+ return (_ctx, _cache) => {
12453
+ return openBlock(), createElementBlock("div", _hoisted_1$p, [createVNode(unref(IFlex), {
11671
12454
  collapse: "",
11672
- float: "right"
12455
+ gap: "3x",
12456
+ wrap: ""
11673
12457
  }, {
11674
- default: withCtx(() => [_ctx.showFilter ? (openBlock(), createBlock(_component_i_flex_item, {
11675
- key: 0,
12458
+ default: withCtx(() => [createVNode(unref(IFlexItem), {
11676
12459
  shrink: "",
11677
12460
  align: "center"
11678
12461
  }, {
11679
- default: withCtx(() => [createElementVNode("div", _hoisted_2$l, [createVNode(_component_f_icon, {
11680
- name: "search",
11681
- class: "sort-filter-dataset__search__magnify-icon"
11682
- }), _cache[4] || (_cache[4] = createTextVNode()), createVNode(_component_f_text_field, {
11683
- modelValue: _ctx.searchString,
11684
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.searchString = $event),
11685
- inline: "",
11686
- placeholder: _ctx.placeholderFilter,
11687
- maxlength: "64",
11688
- onInput: _ctx.onSearchInput
11689
- }, {
11690
- default: withCtx(() => [createElementVNode("span", _hoisted_3$h, toDisplayString(_ctx.placeholderFilter), 1)]),
11691
- _: 1
11692
- }, 8, ["modelValue", "placeholder", "onInput"]), _cache[5] || (_cache[5] = createTextVNode()), _ctx.showClearButton ? (openBlock(), createElementBlock("button", {
11693
- key: 0,
11694
- type: "button",
11695
- class: "button button--discrete sort-filter-dataset__search__close-icon",
11696
- title: _ctx.$t("fkui.sort-filter-dataset.clear.filter", "Rensa sökfält"),
11697
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClickClearSearch && _ctx.onClickClearSearch(...args))
11698
- }, [createVNode(_component_f_icon, {
11699
- name: "close"
11700
- }), _cache[3] || (_cache[3] = createTextVNode()), createElementVNode("span", _hoisted_5$b, toDisplayString(_ctx.$t("fkui.sort-filter-dataset.clear.filter", "Rensa sökfält")), 1)], 8, _hoisted_4$e)) : createCommentVNode("", true)])]),
11701
- _: 1
11702
- })) : createCommentVNode("", true), _cache[8] || (_cache[8] = createTextVNode()), _ctx.showSort ? (openBlock(), createBlock(_component_i_flex_item, {
11703
- key: 1,
11704
- shrink: "",
11705
- align: "center"
12462
+ default: withCtx(() => [renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps({
12463
+ slotClass: "sort-filter-dataset__toolbar__header"
12464
+ })))]),
12465
+ _: 3
12466
+ }), _cache[8] || (_cache[8] = createTextVNode()), createVNode(unref(IFlexItem), {
12467
+ grow: ""
11706
12468
  }, {
11707
- default: withCtx(() => [createVNode(_component_f_select_field, {
11708
- modelValue: _ctx.sortAttribute,
11709
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.sortAttribute = $event),
11710
- class: "sort-filter-dataset__sort",
11711
- inline: "",
11712
- onChange: _ctx.onChangeSortAttribute
12469
+ default: withCtx(() => [createVNode(unref(IFlex), {
12470
+ collapse: "",
12471
+ float: "right"
11713
12472
  }, {
11714
- label: withCtx(() => [createTextVNode(toDisplayString(_ctx.$t("fkui.sort-filter-dataset.label.sort", "Sortera på")), 1)]),
11715
- default: withCtx(() => [_cache[6] || (_cache[6] = createTextVNode()), createElementVNode("option", _hoisted_6$9, toDisplayString(_ctx.$t("fkui.sort-filter-dataset.label.unsorted", "Välj")), 1), _cache[7] || (_cache[7] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.sortOrders, (sortOrder) => {
11716
- return openBlock(), createElementBlock("option", {
11717
- key: sortOrder.id,
11718
- value: sortOrder
11719
- }, toDisplayString(sortOrder.name) + " (" + toDisplayString(sortOrder.ascendingName) + ")\n ", 9, _hoisted_7$8);
11720
- }), 128))]),
12473
+ default: withCtx(() => [__props.showFilter ? (openBlock(), createBlock(unref(IFlexItem), {
12474
+ key: 0,
12475
+ shrink: "",
12476
+ align: "center"
12477
+ }, {
12478
+ default: withCtx(() => [createElementVNode("div", _hoisted_2$l, [createVNode(unref(FIcon), {
12479
+ name: "search",
12480
+ class: "sort-filter-dataset__search__magnify-icon"
12481
+ }), _cache[3] || (_cache[3] = createTextVNode()), createVNode(unref(FTextField), {
12482
+ ref: "search-field",
12483
+ modelValue: searchString.value,
12484
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchString.value = $event),
12485
+ inline: "",
12486
+ placeholder: __props.placeholderFilter,
12487
+ maxlength: "64",
12488
+ onInput: onSearchInput
12489
+ }, {
12490
+ default: withCtx(() => [createElementVNode("span", _hoisted_3$h, toDisplayString(__props.placeholderFilter), 1)]),
12491
+ _: 1
12492
+ }, 8, ["modelValue", "placeholder"]), _cache[4] || (_cache[4] = createTextVNode()), showClearButton.value ? (openBlock(), createElementBlock("button", {
12493
+ key: 0,
12494
+ type: "button",
12495
+ class: "button button--discrete sort-filter-dataset__search__close-icon",
12496
+ title: unref($t2)("fkui.sort-filter-dataset.clear.filter", "Rensa sökfält"),
12497
+ onClick: onClickClearSearch
12498
+ }, [createVNode(unref(FIcon), {
12499
+ name: "close"
12500
+ }), _cache[2] || (_cache[2] = createTextVNode()), createElementVNode("span", _hoisted_5$b, toDisplayString(unref($t2)("fkui.sort-filter-dataset.clear.filter", "Rensa sökfält")), 1)], 8, _hoisted_4$e)) : createCommentVNode("", true)])]),
12501
+ _: 1
12502
+ })) : createCommentVNode("", true), _cache[7] || (_cache[7] = createTextVNode()), __props.showSort ? (openBlock(), createBlock(unref(IFlexItem), {
12503
+ key: 1,
12504
+ shrink: "",
12505
+ align: "center"
12506
+ }, {
12507
+ default: withCtx(() => [createVNode(unref(FSelectField), {
12508
+ modelValue: sortAttribute.value,
12509
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => sortAttribute.value = $event),
12510
+ class: "sort-filter-dataset__sort",
12511
+ inline: "",
12512
+ onChange: onChangeSortAttribute
12513
+ }, {
12514
+ label: withCtx(() => [createTextVNode(toDisplayString(unref($t2)("fkui.sort-filter-dataset.label.sort", "Sortera på")), 1)]),
12515
+ default: withCtx(() => [_cache[5] || (_cache[5] = createTextVNode()), createElementVNode("option", _hoisted_6$9, toDisplayString(unref($t2)("fkui.sort-filter-dataset.label.unsorted", "Välj")), 1), _cache[6] || (_cache[6] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(sortOrders.value, (sortOrder) => {
12516
+ return openBlock(), createElementBlock("option", {
12517
+ key: sortOrder.id,
12518
+ value: sortOrder
12519
+ }, toDisplayString(sortOrder.name) + " (" + toDisplayString(sortOrder.ascendingName) + ")\n ", 9, _hoisted_7$8);
12520
+ }), 128))]),
12521
+ _: 1
12522
+ }, 8, ["modelValue"])]),
12523
+ _: 1
12524
+ })) : createCommentVNode("", true)]),
11721
12525
  _: 1
11722
- }, 8, ["modelValue", "onChange"])]),
12526
+ })]),
11723
12527
  _: 1
11724
- })) : createCommentVNode("", true)]),
11725
- _: 1
11726
- })]),
11727
- _: 1
11728
- })]),
11729
- _: 3
11730
- }), _cache[10] || (_cache[10] = createTextVNode()), renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
11731
- sortFilterResult: _ctx.sortFilterResult
11732
- })))]);
11733
- }
11734
- const FSortFilterDataset = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$n]]);
11735
- const _sfc_main$o = defineComponent({
11736
- name: "FDataTable",
11737
- components: {
11738
- FIcon
11739
- },
11740
- mixins: [TranslationMixin],
11741
- provide() {
11742
- return {
11743
- addColumn: (column) => {
11744
- if (column.type === FTableColumnType.ACTION) {
11745
- throw new Error("Cannot use action column in FDataTable component");
11746
- }
11747
- this.columns = addColumn(this.columns, column);
11748
- },
11749
- setVisibilityColumn: (id, visible) => {
11750
- setVisibilityColumn(this.columns, id, visible);
11751
- },
11752
- textFieldTableMode: true
12528
+ })]),
12529
+ _: 3
12530
+ }), _cache[9] || (_cache[9] = createTextVNode()), renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
12531
+ sortFilterResult: sortFilterResult.value
12532
+ })))]);
11753
12533
  };
12534
+ }
12535
+ });
12536
+ const _hoisted_1$o = ["tabindex"];
12537
+ const _hoisted_2$k = {
12538
+ key: 0
12539
+ };
12540
+ const _hoisted_3$g = {
12541
+ class: "table__row"
12542
+ };
12543
+ const _hoisted_4$d = ["innerHTML"];
12544
+ const _hoisted_5$a = {
12545
+ key: 1,
12546
+ class: "table__column__description"
12547
+ };
12548
+ const _hoisted_6$8 = {
12549
+ key: 0
12550
+ };
12551
+ const _hoisted_7$7 = {
12552
+ key: 1
12553
+ };
12554
+ const _hoisted_8$5 = ["colspan"];
12555
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
12556
+ ...{
12557
+ inheritAttrs: false
11754
12558
  },
11755
- inheritAttrs: false,
12559
+ __name: "FDataTable",
11756
12560
  props: {
11757
12561
  /**
11758
12562
  * The rows to be listed.
@@ -11795,67 +12599,80 @@ const _sfc_main$o = defineComponent({
11795
12599
  }
11796
12600
  }
11797
12601
  },
11798
- setup(props) {
11799
- provide("renderColumns", computed(() => props.rows.length > 0));
11800
- return FSortFilterDatasetInjected();
11801
- },
11802
- data() {
11803
- return {
11804
- columns: []
11805
- };
11806
- },
11807
- computed: {
11808
- hasCaption() {
11809
- return hasSlot(this, "caption", {}, {
12602
+ setup(__props) {
12603
+ const $t2 = useTranslate();
12604
+ const {
12605
+ hasSlot: hasSlot2
12606
+ } = useSlotUtils();
12607
+ const {
12608
+ sort: sort2,
12609
+ registerCallbackOnSort,
12610
+ registerCallbackOnMount
12611
+ } = FSortFilterDatasetInjected();
12612
+ const columns = ref([]);
12613
+ const props = __props;
12614
+ const hasCaption = computed(() => {
12615
+ return hasSlot2("caption", {}, {
11810
12616
  stripClasses: []
11811
12617
  });
11812
- },
11813
- tableClasses() {
12618
+ });
12619
+ const tableClasses = computed(() => {
11814
12620
  const classes = [];
11815
- if (this.striped) {
12621
+ if (props.striped) {
11816
12622
  classes.push("table--striped");
11817
12623
  }
11818
12624
  return classes;
11819
- },
11820
- isEmpty() {
11821
- return this.rows.length === 0;
11822
- },
11823
- visibleColumns() {
11824
- return this.columns.filter((col) => col.visible);
11825
- },
11826
- wrapperClasses() {
11827
- return tableScrollClasses(this.scroll);
11828
- },
11829
- tabindex() {
11830
- return this.scroll !== TableScroll.NONE ? 0 : void 0;
11831
- }
11832
- },
11833
- mounted() {
11834
- this.registerCallbackOnSort(this.callbackOnSort);
11835
- this.registerCallbackOnMount(this.callbackSortableColumns);
11836
- },
11837
- methods: {
11838
- rowKey(item) {
11839
- const key = item[this.keyAttribute];
12625
+ });
12626
+ const isEmpty2 = computed(() => {
12627
+ return props.rows.length === 0;
12628
+ });
12629
+ const visibleColumns = computed(() => {
12630
+ return columns.value.filter((col) => col.visible);
12631
+ });
12632
+ const wrapperClasses = computed(() => {
12633
+ return tableScrollClasses(props.scroll);
12634
+ });
12635
+ const tabindex = computed(() => {
12636
+ return props.scroll !== TableScroll.NONE ? 0 : void 0;
12637
+ });
12638
+ provide("addColumn", (column) => {
12639
+ if (column.type === FTableColumnType.ACTION) {
12640
+ throw new Error("Cannot use action column in FDataTable component");
12641
+ }
12642
+ columns.value = addColumn(columns.value, column);
12643
+ });
12644
+ provide("setVisibilityColumn", (id, visible) => {
12645
+ setVisibilityColumn(columns.value, id, visible);
12646
+ });
12647
+ provide("textFieldTableMode", true);
12648
+ provide("renderColumns", computed(() => {
12649
+ return props.rows.length > 0;
12650
+ }));
12651
+ onMounted(() => {
12652
+ registerCallbackOnSort(callbackOnSort);
12653
+ registerCallbackOnMount(callbackSortableColumns);
12654
+ });
12655
+ function rowKey(item) {
12656
+ const key = item[props.keyAttribute];
11840
12657
  if (typeof key === "undefined") {
11841
- throw new Error(`Key attribute [${this.keyAttribute}]' is missing in row`);
12658
+ throw new Error(`Key attribute [${props.keyAttribute}]' is missing in row`);
11842
12659
  }
11843
12660
  return String(key);
11844
- },
11845
- columnClasses(column) {
12661
+ }
12662
+ function columnClasses(column) {
11846
12663
  const classes = ["table__column", `table__column--${column.type}`, column.size];
11847
12664
  if (column.sortable) {
11848
12665
  classes.push("table__column--sortable");
11849
12666
  }
11850
12667
  return classes;
11851
- },
11852
- iconClasses(column) {
12668
+ }
12669
+ function iconClasses2(column) {
11853
12670
  return getSortableIconClasses(column);
11854
- },
11855
- iconName(column) {
12671
+ }
12672
+ function iconName(column) {
11856
12673
  return getSortableIconName(column);
11857
- },
11858
- onClickColumnHeader(column) {
12674
+ }
12675
+ function onClickColumnHeader(column) {
11859
12676
  if (!column.sortable) {
11860
12677
  return;
11861
12678
  }
@@ -11864,81 +12681,60 @@ const _sfc_main$o = defineComponent({
11864
12681
  columnName = "";
11865
12682
  column.sort = FTableColumnSort.UNSORTED;
11866
12683
  }
11867
- this.sort(columnName, column.sort !== FTableColumnSort.ASCENDING);
11868
- },
11869
- callbackOnSort(columnName, ascending) {
11870
- updateSortOrder(this.columns, columnName, ascending);
11871
- },
11872
- callbackSortableColumns(columnNames) {
11873
- setSortableColumns(this.columns, columnNames);
11874
- },
11875
- escapeNewlines(value) {
12684
+ sort2(columnName, column.sort !== FTableColumnSort.ASCENDING);
12685
+ }
12686
+ function callbackOnSort(columnName, ascending) {
12687
+ updateSortOrder(columns.value, columnName, ascending);
12688
+ }
12689
+ function callbackSortableColumns(columnNames) {
12690
+ setSortableColumns(columns.value, columnNames);
12691
+ }
12692
+ function escapeNewlines(value) {
11876
12693
  return value.replace(/\n/g, "<br/>");
11877
12694
  }
12695
+ return (_ctx, _cache) => {
12696
+ return openBlock(), createElementBlock("div", {
12697
+ class: normalizeClass(wrapperClasses.value)
12698
+ }, [createElementVNode("table", mergeProps({
12699
+ class: ["table", tableClasses.value],
12700
+ tabindex: tabindex.value
12701
+ }, _ctx.$attrs), [hasCaption.value ? (openBlock(), createElementBlock("caption", _hoisted_2$k, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), createElementVNode("colgroup", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
12702
+ return openBlock(), createElementBlock("col", {
12703
+ key: column.id,
12704
+ class: normalizeClass(column.size)
12705
+ }, null, 2);
12706
+ }), 128))]), _cache[5] || (_cache[5] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_3$g, [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (column) => {
12707
+ return openBlock(), createElementBlock("th", mergeProps({
12708
+ key: column.id,
12709
+ scope: "col",
12710
+ class: columnClasses(column)
12711
+ }, toHandlers(column.sortable ? {
12712
+ click: () => onClickColumnHeader(column)
12713
+ } : {}, true)), [createElementVNode("span", {
12714
+ innerHTML: escapeNewlines(column.title)
12715
+ }, null, 8, _hoisted_4$d), _cache[0] || (_cache[0] = createTextVNode()), column.sortable ? (openBlock(), createBlock(unref(FIcon), {
12716
+ key: 0,
12717
+ class: normalizeClass(iconClasses2(column)),
12718
+ name: iconName(column)
12719
+ }, null, 8, ["class", "name"])) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), column.description ? (openBlock(), createElementBlock("span", _hoisted_5$a, toDisplayString(column.description), 1)) : createCommentVNode("", true)], 16);
12720
+ }), 128))])]), _cache[6] || (_cache[6] = createTextVNode()), createElementVNode("tbody", null, [isEmpty2.value && columns.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_6$8, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
12721
+ row: {}
12722
+ })))])) : createCommentVNode("", true), _cache[2] || (_cache[2] = createTextVNode()), isEmpty2.value ? (openBlock(), createElementBlock("tr", _hoisted_7$7, [createElementVNode("td", {
12723
+ class: "table__column table__column--action",
12724
+ colspan: columns.value.length
12725
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref($t2)("fkui.data-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_8$5)])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.rows, (row) => {
12726
+ return openBlock(), createElementBlock("tr", {
12727
+ key: rowKey(row),
12728
+ class: "table__row"
12729
+ }, [renderSlot(_ctx.$slots, "default", mergeProps({
12730
+ ref_for: true
12731
+ }, {
12732
+ row
12733
+ }))]);
12734
+ }), 128))])], 16, _hoisted_1$o)], 2);
12735
+ };
11878
12736
  }
11879
12737
  });
11880
- const _hoisted_1$o = ["tabindex"];
11881
- const _hoisted_2$k = {
11882
- key: 0
11883
- };
11884
- const _hoisted_3$g = {
11885
- class: "table__row"
11886
- };
11887
- const _hoisted_4$d = ["innerHTML"];
11888
- const _hoisted_5$a = {
11889
- key: 1,
11890
- class: "table__column__description"
11891
- };
11892
- const _hoisted_6$8 = {
11893
- key: 0
11894
- };
11895
- const _hoisted_7$7 = {
11896
- key: 1
11897
- };
11898
- const _hoisted_8$5 = ["colspan"];
11899
- function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
11900
- const _component_f_icon = resolveComponent("f-icon");
11901
- return openBlock(), createElementBlock("div", {
11902
- class: normalizeClass(_ctx.wrapperClasses)
11903
- }, [createElementVNode("table", mergeProps({
11904
- class: ["table", _ctx.tableClasses],
11905
- tabindex: _ctx.tabindex
11906
- }, _ctx.$attrs), [_ctx.hasCaption ? (openBlock(), createElementBlock("caption", _hoisted_2$k, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), createElementVNode("colgroup", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (column) => {
11907
- return openBlock(), createElementBlock("col", {
11908
- key: column.id,
11909
- class: normalizeClass(column.size)
11910
- }, null, 2);
11911
- }), 128))]), _cache[5] || (_cache[5] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_3$g, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.visibleColumns, (column) => {
11912
- return openBlock(), createElementBlock("th", mergeProps({
11913
- key: column.id,
11914
- scope: "col",
11915
- class: _ctx.columnClasses(column)
11916
- }, toHandlers(column.sortable ? {
11917
- click: () => _ctx.onClickColumnHeader(column)
11918
- } : {}, true)), [createElementVNode("span", {
11919
- innerHTML: _ctx.escapeNewlines(column.title)
11920
- }, null, 8, _hoisted_4$d), _cache[0] || (_cache[0] = createTextVNode()), column.sortable ? (openBlock(), createBlock(_component_f_icon, {
11921
- key: 0,
11922
- class: normalizeClass(_ctx.iconClasses(column)),
11923
- name: _ctx.iconName(column)
11924
- }, null, 8, ["class", "name"])) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), column.description ? (openBlock(), createElementBlock("span", _hoisted_5$a, toDisplayString(column.description), 1)) : createCommentVNode("", true)], 16);
11925
- }), 128))])]), _cache[6] || (_cache[6] = createTextVNode()), createElementVNode("tbody", null, [_ctx.isEmpty && _ctx.columns.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_6$8, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
11926
- row: {}
11927
- })))])) : createCommentVNode("", true), _cache[2] || (_cache[2] = createTextVNode()), _ctx.isEmpty ? (openBlock(), createElementBlock("tr", _hoisted_7$7, [createElementVNode("td", {
11928
- class: "table__column table__column--action",
11929
- colspan: _ctx.columns.length
11930
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(_ctx.$t("fkui.data-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_8$5)])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (row) => {
11931
- return openBlock(), createElementBlock("tr", {
11932
- key: _ctx.rowKey(row),
11933
- class: "table__row"
11934
- }, [renderSlot(_ctx.$slots, "default", mergeProps({
11935
- ref_for: true
11936
- }, {
11937
- row
11938
- }))]);
11939
- }), 128))])], 16, _hoisted_1$o)], 2);
11940
- }
11941
- const FDataTable = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$m]]);
11942
12738
  function isDayEnabled(day, config2) {
11943
12739
  return passesMinDate(day, config2.minDate) && passesMaxDate(day, config2.maxDate) && passesInvalidDates(day, config2.invalidDates) && passesInvalidWeekdays(day, config2.invalidWeekdays);
11944
12740
  }
@@ -12283,7 +13079,7 @@ const _hoisted_3$f = {
12283
13079
  const _hoisted_4$c = {
12284
13080
  class: "datepicker-field__close"
12285
13081
  };
12286
- function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
13082
+ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
12287
13083
  const _component_f_icon = resolveComponent("f-icon");
12288
13084
  const _component_f_text_field = resolveComponent("f-text-field");
12289
13085
  const _component_f_calendar_day = resolveComponent("f-calendar-day");
@@ -12353,7 +13149,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
12353
13149
  "min-date": _ctx.minDate,
12354
13150
  "max-date": _ctx.maxDate,
12355
13151
  onClick: _ctx.onSelectCalendarDay,
12356
- onKeyup: withKeys(withModifiers(_ctx.onKeyupEsc, ["stop"]), ["esc", "native"])
13152
+ onKeyup: withKeys(withModifiers(_ctx.onKeyupEsc, ["stop"]), ["esc"])
12357
13153
  }, {
12358
13154
  default: withCtx(({
12359
13155
  date,
@@ -12379,7 +13175,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
12379
13175
  _: 1
12380
13176
  }, 8, ["is-open", "anchor", "inline", "onOpen", "onClose"])], 512);
12381
13177
  }
12382
- const FDatepickerField = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$l]]);
13178
+ const FDatepickerField = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$j]]);
12383
13179
  function isDialogueTreeEndQuestion(value) {
12384
13180
  return Boolean(value.userData);
12385
13181
  }
@@ -12469,7 +13265,7 @@ const _hoisted_2$i = {
12469
13265
  class: "dialogue-tree__list"
12470
13266
  };
12471
13267
  const _hoisted_3$e = ["onClick"];
12472
- function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
13268
+ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
12473
13269
  const _component_f_icon = resolveComponent("f-icon");
12474
13270
  return openBlock(), createElementBlock("div", _hoisted_1$m, [_ctx.options.length > 0 ? (openBlock(), createElementBlock("ul", _hoisted_2$i, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index) => {
12475
13271
  return openBlock(), createElementBlock("li", {
@@ -12489,7 +13285,7 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
12489
13285
  userData: _ctx.userData
12490
13286
  })))]);
12491
13287
  }
12492
- const FDialogueTree = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$k]]);
13288
+ const FDialogueTree = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$i]]);
12493
13289
  const _sfc_main$l = defineComponent({
12494
13290
  name: "FExpandablePanel",
12495
13291
  components: {
@@ -12583,7 +13379,7 @@ const _hoisted_8$4 = {
12583
13379
  key: 0,
12584
13380
  class: "expandable-panel__outside"
12585
13381
  };
12586
- function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
13382
+ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
12587
13383
  const _component_f_icon = resolveComponent("f-icon");
12588
13384
  const _component_f_expand = resolveComponent("f-expand");
12589
13385
  return openBlock(), createElementBlock("div", {
@@ -12620,7 +13416,7 @@ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
12620
13416
  _: 3
12621
13417
  })], 2);
12622
13418
  }
12623
- const FExpandablePanel = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$j]]);
13419
+ const FExpandablePanel = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$h]]);
12624
13420
  const _sfc_main$k = defineComponent({
12625
13421
  name: "FExpandableParagraph",
12626
13422
  components: {
@@ -12722,7 +13518,7 @@ const _hoisted_7$5 = {
12722
13518
  key: 0,
12723
13519
  class: "expandable-paragraph__separator"
12724
13520
  };
12725
- function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
13521
+ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
12726
13522
  const _component_f_icon = resolveComponent("f-icon");
12727
13523
  const _component_f_expand = resolveComponent("f-expand");
12728
13524
  return openBlock(), createElementBlock("div", {
@@ -12753,7 +13549,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
12753
13549
  _: 3
12754
13550
  })], 2);
12755
13551
  }
12756
- const FExpandableParagraph = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$i]]);
13552
+ const FExpandableParagraph = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$g]]);
12757
13553
  const DEFAULT_ICON = "file";
12758
13554
  const iconMap = {
12759
13555
  "image/*": "pic",
@@ -12861,7 +13657,7 @@ const _hoisted_7$4 = {
12861
13657
  key: 0,
12862
13658
  class: "file-item__change-info"
12863
13659
  };
12864
- function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
13660
+ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
12865
13661
  const _component_f_icon = resolveComponent("f-icon");
12866
13662
  return openBlock(), createElementBlock("div", _hoisted_1$j, [createElementVNode("div", _hoisted_2$f, [createElementVNode("a", mergeProps({
12867
13663
  id: _ctx.id,
@@ -12874,7 +13670,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
12874
13670
  class: "file-item__separator"
12875
13671
  }, null, -1))]);
12876
13672
  }
12877
- const FFileItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$h]]);
13673
+ const FFileItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$f]]);
12878
13674
  const _sfc_main$i = defineComponent({
12879
13675
  name: "FFileSelector",
12880
13676
  components: {
@@ -12941,7 +13737,7 @@ const _hoisted_1$i = {
12941
13737
  };
12942
13738
  const _hoisted_2$e = ["id", "aria-labelledby", "aria-disabled"];
12943
13739
  const _hoisted_3$a = ["id", "for"];
12944
- function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
13740
+ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
12945
13741
  const _component_f_icon = resolveComponent("f-icon");
12946
13742
  return openBlock(), createElementBlock("div", _hoisted_1$i, [createElementVNode("input", mergeProps({
12947
13743
  id: _ctx.id,
@@ -12962,32 +13758,41 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
12962
13758
  name: "paper-clip"
12963
13759
  }), _cache[1] || (_cache[1] = createTextVNode()), renderSlot(_ctx.$slots, "default")], 10, _hoisted_3$a)]);
12964
13760
  }
12965
- const FFileSelector = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$g]]);
12966
- const keybindings = Object.fromEntries([["Up", focusTrAbove], ["Down", focusTrBelow], ["ArrowUp", focusTrAbove], ["ArrowDown", focusTrBelow], [" ", activateRow], ["Spacebar", activateRow]]);
12967
- function focusTrAbove(current) {
13761
+ const FFileSelector = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$e]]);
13762
+ const keybindings = {
13763
+ Up: focusTrAbove,
13764
+ Down: focusTrBelow,
13765
+ ArrowUp: focusTrAbove,
13766
+ ArrowDown: focusTrBelow,
13767
+ " ": activateRow,
13768
+ Spacebar: activateRow
13769
+ };
13770
+ function focusTrAbove(table, current) {
13771
+ const tr = table.tr.value;
12968
13772
  if (current > 0) {
12969
- this.tr[current - 1].focus();
13773
+ tr[current - 1].focus();
12970
13774
  } else {
12971
- this.tr[this.tr.length - 1].focus();
13775
+ tr[tr.length - 1].focus();
12972
13776
  }
12973
13777
  }
12974
- function focusTrBelow(current) {
12975
- if (current < this.tr.length - 1) {
12976
- this.tr[current + 1].focus();
13778
+ function focusTrBelow(table, current) {
13779
+ const tr = table.tr.value;
13780
+ if (current < tr.length - 1) {
13781
+ tr[current + 1].focus();
12977
13782
  } else {
12978
- this.tr[0].focus();
13783
+ tr[0].focus();
12979
13784
  }
12980
13785
  }
12981
- function activateRow(current) {
12982
- const row = this.rows[current];
12983
- const element = this.tr[current];
12984
- this.activate(row, element);
13786
+ function activateRow(table, current) {
13787
+ const row = table.rows[current];
13788
+ const element = table.tr.value[current];
13789
+ table.activate(row, element);
12985
13790
  }
12986
- function onKeydown(event, current) {
13791
+ function onKeydown(table, event, current) {
12987
13792
  const fn2 = keybindings[event.key];
12988
13793
  if (fn2) {
12989
13794
  event.preventDefault();
12990
- fn2.call(this, current);
13795
+ fn2(table, current);
12991
13796
  }
12992
13797
  }
12993
13798
  function useExpandableTable(expandableAttribute, keyAttribute, describedby, emit, slots) {
@@ -13051,7 +13856,6 @@ function useExpandableTable(expandableAttribute, keyAttribute, describedby, emit
13051
13856
  return Boolean(expandableRows(row));
13052
13857
  }
13053
13858
  return {
13054
- expandedRows,
13055
13859
  isExpandableTable,
13056
13860
  hasExpandableSlot,
13057
13861
  toggleExpanded,
@@ -13063,32 +13867,76 @@ function useExpandableTable(expandableAttribute, keyAttribute, describedby, emit
13063
13867
  hasExpandableContent
13064
13868
  };
13065
13869
  }
13066
- function forceRepaintIE11(target) {
13067
- if (navigator.userAgent.includes("Trident")) {
13068
- target.style.display = "none";
13069
- target.offsetHeight;
13070
- target.style.removeProperty("display");
13071
- }
13072
- }
13073
- const _sfc_main$h = defineComponent({
13074
- name: "FInteractiveTable",
13075
- components: {
13076
- FCheckboxField,
13077
- FIcon
13078
- },
13079
- mixins: [TranslationMixin],
13080
- provide() {
13081
- return {
13082
- addColumn: (column) => {
13083
- this.columns = addColumn(this.columns, column);
13084
- },
13085
- setVisibilityColumn: (id, visible) => {
13086
- setVisibilityColumn(this.columns, id, visible);
13087
- },
13088
- textFieldTableMode: true
13089
- };
13870
+ const _hoisted_1$h = ["role"];
13871
+ const _hoisted_2$d = {
13872
+ key: 0
13873
+ };
13874
+ const _hoisted_3$9 = {
13875
+ key: 0,
13876
+ class: "table__column--shrink"
13877
+ };
13878
+ const _hoisted_4$8 = {
13879
+ key: 1,
13880
+ class: "table__column--shrink"
13881
+ };
13882
+ const _hoisted_5$6 = {
13883
+ class: "table__row"
13884
+ };
13885
+ const _hoisted_6$4 = {
13886
+ key: 0,
13887
+ scope: "col"
13888
+ };
13889
+ const _hoisted_7$3 = {
13890
+ class: "sr-only"
13891
+ };
13892
+ const _hoisted_8$3 = {
13893
+ key: 1,
13894
+ scope: "col"
13895
+ };
13896
+ const _hoisted_9$3 = {
13897
+ class: "sr-only"
13898
+ };
13899
+ const _hoisted_10$2 = ["innerHTML"];
13900
+ const _hoisted_11$1 = {
13901
+ key: 1,
13902
+ class: "table__column__description"
13903
+ };
13904
+ const _hoisted_12$1 = ["aria-label", "aria-expanded", "aria-level", "aria-describedby", "onKeydown", "onClick"];
13905
+ const _hoisted_13 = {
13906
+ key: 0
13907
+ };
13908
+ const _hoisted_14 = {
13909
+ key: 0,
13910
+ class: "table__expand-icon"
13911
+ };
13912
+ const _hoisted_15 = {
13913
+ key: 1,
13914
+ class: "table__column--selectable"
13915
+ };
13916
+ const _hoisted_16 = {
13917
+ class: "table__input"
13918
+ };
13919
+ const _hoisted_17 = {
13920
+ key: 0,
13921
+ class: "sr-only"
13922
+ };
13923
+ const _hoisted_18 = {
13924
+ key: 0,
13925
+ class: "table__column--placeholder"
13926
+ };
13927
+ const _hoisted_19 = ["colspan"];
13928
+ const _hoisted_20 = {
13929
+ key: 0
13930
+ };
13931
+ const _hoisted_21 = {
13932
+ key: 1
13933
+ };
13934
+ const _hoisted_22 = ["colspan"];
13935
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
13936
+ ...{
13937
+ inheritAttrs: false
13090
13938
  },
13091
- inheritAttrs: false,
13939
+ __name: "FInteractiveTable",
13092
13940
  props: {
13093
13941
  /**
13094
13942
  * The rows to be listed.
@@ -13185,437 +14033,376 @@ const _sfc_main$h = defineComponent({
13185
14033
  default: () => void 0
13186
14034
  }
13187
14035
  },
13188
- emits: [
13189
- "change",
13190
- "click",
13191
- "unselect",
13192
- "update:modelValue",
13193
- "update:active",
13194
- "select",
13195
- /**
13196
- * Emitted when row is expanded.
13197
- *
13198
- * @event expand
13199
- * @param row
13200
- * @type {ListItem}
13201
- */
13202
- "expand",
13203
- /**
13204
- * Emitted when row is collapsed.
13205
- *
13206
- * @event collapse
13207
- * @param row
13208
- * @type {ListItem}
13209
- */
13210
- "collapse"
13211
- ],
13212
- setup(props, context) {
13213
- provide("renderColumns", computed(() => props.rows.length > 0));
13214
- const sortFilterDatasetInjected = FSortFilterDatasetInjected();
13215
- const activateItemInjected = ActivateItemInjected();
13216
- const expandableTable = useExpandableTable(props.expandableAttribute, props.keyAttribute, props.expandableDescribedby, context.emit, context.slots);
13217
- return {
13218
- ...sortFilterDatasetInjected,
13219
- ...activateItemInjected,
13220
- ...expandableTable
13221
- };
13222
- },
13223
- data() {
13224
- return {
13225
- activeRow: void 0,
13226
- columns: [],
13227
- selectedRows: [],
13228
- tr: [],
13229
- tbodyKey: 0
13230
- };
13231
- },
13232
- computed: {
13233
- hasCaption() {
13234
- return hasSlot(this, "caption", {}, {
14036
+ emits: ["change", "click", "unselect", "update:modelValue", "update:active", "select", "expand", "collapse"],
14037
+ setup(__props, {
14038
+ emit: __emit
14039
+ }) {
14040
+ const $t2 = useTranslate();
14041
+ const slots = useSlots();
14042
+ const {
14043
+ hasSlot: hasSlot2
14044
+ } = useSlotUtils();
14045
+ const {
14046
+ sort: sort2,
14047
+ registerCallbackOnSort,
14048
+ registerCallbackOnMount
14049
+ } = FSortFilterDatasetInjected();
14050
+ const {
14051
+ registerCallbackAfterItemAdd,
14052
+ registerCallbackBeforeItemDelete
14053
+ } = ActivateItemInjected();
14054
+ const activeRow = ref(void 0);
14055
+ const columns = ref([]);
14056
+ const selectedRows = ref([]);
14057
+ const tr = shallowRef([]);
14058
+ const tbodyKey = ref(0);
14059
+ const props = __props;
14060
+ const emit = __emit;
14061
+ const expandableTable = useExpandableTable(props.expandableAttribute, props.keyAttribute, props.expandableDescribedby, emit, slots);
14062
+ const {
14063
+ isExpandableTable,
14064
+ hasExpandableSlot,
14065
+ toggleExpanded,
14066
+ isExpanded,
14067
+ rowAriaExpanded,
14068
+ expandableRowClasses,
14069
+ getExpandableDescribedby,
14070
+ expandableRows,
14071
+ hasExpandableContent
14072
+ } = expandableTable;
14073
+ const hasCaption = computed(() => {
14074
+ return hasSlot2("caption", {}, {
13235
14075
  stripClasses: []
13236
14076
  });
13237
- },
13238
- hasCheckboxDescription() {
13239
- const firstRow = this.rows[0];
13240
- return hasSlot(this, "checkbox-description", {
14077
+ });
14078
+ const hasCheckboxDescription = computed(() => {
14079
+ const firstRow = props.rows[0];
14080
+ return hasSlot2("checkbox-description", {
13241
14081
  row: firstRow
13242
14082
  });
13243
- },
13244
- isEmpty() {
13245
- return this.rows.length === 0;
13246
- },
13247
- visibleColumns() {
13248
- return this.columns.filter((col) => col.visible);
13249
- },
13250
- tableClasses() {
14083
+ });
14084
+ const isEmpty2 = computed(() => {
14085
+ return props.rows.length === 0;
14086
+ });
14087
+ const visibleColumns = computed(() => {
14088
+ return columns.value.filter((col) => col.visible);
14089
+ });
14090
+ const tableClasses = computed(() => {
13251
14091
  const classes = [];
13252
- if (this.selectable) {
14092
+ if (props.selectable) {
13253
14093
  classes.push("table--selectable");
13254
14094
  }
13255
- if (this.hover) {
14095
+ if (props.hover) {
13256
14096
  classes.push("table--hover");
13257
14097
  }
13258
14098
  return classes;
13259
- },
13260
- tableRole() {
13261
- return this.isExpandableTable ? "treegrid" : "grid";
13262
- },
13263
- wrapperClasses() {
13264
- return tableScrollClasses(this.scroll);
13265
- },
13266
- nbOfColumns() {
13267
- let columnCount = this.visibleColumns.length;
13268
- if (this.selectable) {
14099
+ });
14100
+ const tableRole = computed(() => {
14101
+ return isExpandableTable.value ? "treegrid" : "grid";
14102
+ });
14103
+ const wrapperClasses = computed(() => {
14104
+ return tableScrollClasses(props.scroll);
14105
+ });
14106
+ const nbOfColumns = computed(() => {
14107
+ let columnCount = visibleColumns.value.length;
14108
+ if (props.selectable) {
13269
14109
  columnCount++;
13270
14110
  }
13271
- if (this.isExpandableTable) {
14111
+ if (isExpandableTable.value) {
13272
14112
  columnCount++;
13273
14113
  }
13274
14114
  return columnCount;
13275
- }
13276
- },
13277
- watch: {
13278
- rows: {
13279
- immediate: true,
13280
- deep: true,
13281
- handler: function() {
13282
- if (this.modelValue) {
13283
- this.selectedRows = this.modelValue.filter((row) => {
13284
- return includeItem(row, this.rows, this.keyAttribute);
13285
- });
13286
- }
13287
- }
13288
- },
13289
- active: {
13290
- immediate: true,
13291
- handler: function() {
13292
- this.updateActiveRowFromVModel();
14115
+ });
14116
+ provide("addColumn", (column) => {
14117
+ columns.value = addColumn(columns.value, column);
14118
+ });
14119
+ provide("setVisibilityColumn", (id, visible) => {
14120
+ setVisibilityColumn(columns.value, id, visible);
14121
+ });
14122
+ provide("textFieldTableMode", true);
14123
+ provide("renderColumns", computed(() => props.rows.length > 0));
14124
+ watch(() => props.rows, () => {
14125
+ if (props.modelValue) {
14126
+ selectedRows.value = props.modelValue.filter((row) => {
14127
+ return includeItem(row, props.rows, props.keyAttribute);
14128
+ });
13293
14129
  }
13294
- },
13295
- showActive: {
14130
+ }, {
13296
14131
  immediate: true,
13297
- handler: function(val) {
13298
- if (!val) {
13299
- this.tbodyKey ^= 1;
13300
- }
13301
- }
13302
- }
13303
- },
13304
- updated() {
13305
- const tbodyElement = this.$refs["tbodyElement"];
13306
- const trElements = [].slice.call(tbodyElement.children);
13307
- const trInteractableElements = trElements.filter((tr) => {
13308
- return tr.tabIndex === 0;
14132
+ deep: true
13309
14133
  });
13310
- this.tr = trInteractableElements;
13311
- },
13312
- mounted() {
13313
- this.registerCallbackOnSort(this.callbackOnSort);
13314
- this.registerCallbackOnMount(this.callbackSortableColumns);
13315
- this.registerCallbackAfterItemAdd(this.callbackAfterItemAdd);
13316
- this.registerCallbackBeforeItemDelete(this.callbackBeforeItemDelete);
13317
- },
13318
- methods: {
13319
- isActive(row) {
13320
- if (!this.showActive) {
13321
- return false;
13322
- }
13323
- return itemEquals(row, this.activeRow, this.keyAttribute);
13324
- },
13325
- isSelected(row) {
13326
- return includeItem(row, this.selectedRows, this.keyAttribute);
13327
- },
13328
- onKeydownExpandable(event, index) {
13329
- if (event.key === " " || event.key === "Spacebar") {
13330
- event.preventDefault();
13331
- return;
13332
- }
13333
- onKeydown.call(this, event, index);
13334
- },
13335
- onKeydown(event, index) {
13336
- onKeydown.call(this, event, index);
13337
- },
13338
- onClick(event, row) {
13339
- const {
13340
- target
13341
- } = event;
13342
- const isRelevant = ["TD", "TH"].includes(target.nodeName);
13343
- if (isRelevant) {
13344
- const parent = target.parentElement;
13345
- this.activate(row, parent);
13346
- }
13347
- },
13348
- activate(row, tr) {
13349
- this.$emit("click", row);
13350
- if (this.isExpandableTable && this.hasExpandableContent(row)) {
13351
- this.toggleExpanded(row);
13352
- }
13353
- if (!itemEquals(row, this.activeRow, this.keyAttribute)) {
13354
- this.$emit("change", row);
13355
- this.setActiveRow(row);
13356
- if (tr) {
13357
- tr.focus();
13358
- const td = tr.children[0];
13359
- forceRepaintIE11(td);
13360
- }
14134
+ watch(() => props.active, () => {
14135
+ updateActiveRowFromVModel();
14136
+ }, {
14137
+ immediate: true
14138
+ });
14139
+ watch(() => props.showActive, (val) => {
14140
+ if (!val) {
14141
+ tbodyKey.value ^= 1;
13361
14142
  }
13362
- },
13363
- rowDescription(row) {
13364
- const slot = this.$slots["row-description"];
13365
- return renderSlotText(slot, {
13366
- row
14143
+ }, {
14144
+ immediate: true
14145
+ });
14146
+ function updateTr(tbodyElement) {
14147
+ const trElements = [].slice.call(tbodyElement.children);
14148
+ const trInteractableElements = trElements.filter((tr2) => {
14149
+ return tr2.tabIndex === 0;
13367
14150
  });
13368
- },
13369
- onSelect(row) {
13370
- if (includeItem(row, this.selectedRows, this.keyAttribute)) {
13371
- this.selectedRows = this.selectedRows.filter((i) => !itemEquals(i, row, this.keyAttribute));
13372
- this.$emit("unselect", row);
13373
- } else {
13374
- this.selectedRows.push(row);
13375
- this.$emit("select", row);
13376
- }
13377
- this.updateVModelWithSelectedRows();
13378
- this.$forceUpdate();
13379
- },
13380
- updateVModelWithSelectedRows() {
13381
- if (this.modelValue) {
13382
- this.$emit("update:modelValue", this.selectedRows);
13383
- }
13384
- },
13385
- rowClasses(row, index) {
13386
- const active = this.isActive(row) ? ["table__row--active"] : [];
13387
- const selected = this.isSelected(row) ? ["table__row--selected"] : [];
13388
- const isExpandableRow = this.isExpandableTable && this.hasExpandableContent(row);
13389
- const expandable = isExpandableRow ? ["table__row--expandable"] : [];
13390
- const expanded = this.isExpanded(row) ? ["table__row--expanded-border"] : [];
13391
- const striped = this.striped && index % 2 !== 0 ? ["table__row--striped"] : [];
13392
- return ["table__row", ...active, ...selected, ...striped, ...expandable, ...expanded];
13393
- },
13394
- rowKey(row) {
13395
- const key = row[this.keyAttribute];
13396
- if (typeof key === "undefined") {
13397
- throw new Error(`Key attribute [${this.keyAttribute}]' is missing in row`);
13398
- }
13399
- return String(key);
13400
- },
13401
- columnClasses(column) {
13402
- const sortable = column.sortable ? ["table__column--sortable"] : [];
13403
- return ["table__column", `table__column--${column.type}`, ...sortable, column.size];
13404
- },
13405
- iconClasses(column) {
13406
- return getSortableIconClasses(column);
13407
- },
13408
- iconName(column) {
13409
- return getSortableIconName(column);
13410
- },
13411
- onClickColumnHeader(column) {
13412
- if (!column.sortable) {
13413
- return;
13414
- }
13415
- let columnName = column.name;
13416
- if (column.sort === FTableColumnSort.DESCENDING) {
13417
- columnName = "";
13418
- column.sort = FTableColumnSort.UNSORTED;
13419
- }
13420
- this.sort(columnName, column.sort !== FTableColumnSort.ASCENDING);
13421
- },
13422
- callbackOnSort(columnName, ascending) {
13423
- updateSortOrder(this.columns, columnName, ascending);
13424
- },
13425
- callbackSortableColumns(columnNames) {
13426
- setSortableColumns(this.columns, columnNames);
13427
- },
13428
- callbackAfterItemAdd(item) {
13429
- this.activate(item, null);
13430
- },
13431
- callbackBeforeItemDelete(item) {
13432
- if (this.rows.length === 0) {
13433
- return;
14151
+ tr.value = trInteractableElements;
14152
+ }
14153
+ onUpdated(() => {
14154
+ const tbodyElement = useTemplateRef("tbodyElement");
14155
+ if (tbodyElement.value) {
14156
+ updateTr(tbodyElement.value);
13434
14157
  }
13435
- let targetIndex = this.rows.indexOf(item) - 1;
13436
- if (targetIndex < 0 && this.rows.length > 1) {
13437
- targetIndex = 1;
13438
- } else if (targetIndex < 0) {
13439
- targetIndex = 0;
14158
+ });
14159
+ onMounted(() => {
14160
+ const tbodyElement = useTemplateRef("tbodyElement");
14161
+ if (tbodyElement.value) {
14162
+ updateTr(tbodyElement.value);
14163
+ }
14164
+ registerCallbackOnSort(callbackOnSort);
14165
+ registerCallbackOnMount(callbackSortableColumns);
14166
+ registerCallbackAfterItemAdd(callbackAfterItemAdd);
14167
+ registerCallbackBeforeItemDelete(callbackBeforeItemDelete);
14168
+ });
14169
+ function forceRepaintIE11(target) {
14170
+ if (navigator.userAgent.includes("Trident")) {
14171
+ target.style.display = "none";
14172
+ target.offsetHeight;
14173
+ target.style.removeProperty("display");
13440
14174
  }
13441
- this.activate(this.rows[targetIndex], this.tr[targetIndex]);
13442
- },
13443
- escapeNewlines(value) {
13444
- return value.replace(/\n/g, "<br/>");
13445
- },
13446
- updateActiveRowFromVModel() {
13447
- if (this.active === void 0) {
13448
- this.setActiveRow(void 0);
13449
- } else if (!itemEquals(this.active, this.activeRow, this.keyAttribute)) {
13450
- this.setActiveRow(this.active);
14175
+ }
14176
+ function isActive(row) {
14177
+ if (!props.showActive) {
14178
+ return false;
13451
14179
  }
13452
- },
13453
- setActiveRow(row) {
13454
- this.activeRow = row;
13455
- this.$emit("update:active", this.activeRow);
14180
+ return itemEquals(row, activeRow.value, props.keyAttribute);
13456
14181
  }
13457
- }
13458
- });
13459
- const _hoisted_1$h = ["role"];
13460
- const _hoisted_2$d = {
13461
- key: 0
13462
- };
13463
- const _hoisted_3$9 = {
13464
- key: 0,
13465
- class: "table__column--shrink"
13466
- };
13467
- const _hoisted_4$8 = {
13468
- key: 1,
13469
- class: "table__column--shrink"
13470
- };
13471
- const _hoisted_5$6 = {
13472
- class: "table__row"
13473
- };
13474
- const _hoisted_6$4 = {
13475
- key: 0,
13476
- scope: "col"
13477
- };
13478
- const _hoisted_7$3 = {
13479
- class: "sr-only"
13480
- };
13481
- const _hoisted_8$3 = {
13482
- key: 1,
13483
- scope: "col"
13484
- };
13485
- const _hoisted_9$3 = {
13486
- class: "sr-only"
13487
- };
13488
- const _hoisted_10$2 = ["innerHTML"];
13489
- const _hoisted_11$1 = {
13490
- key: 1,
13491
- class: "table__column__description"
13492
- };
13493
- const _hoisted_12$1 = ["aria-label", "aria-expanded", "aria-level", "aria-describedby", "onKeydown", "onClick"];
13494
- const _hoisted_13 = {
13495
- key: 0
13496
- };
13497
- const _hoisted_14 = {
13498
- key: 0,
13499
- class: "table__expand-icon"
13500
- };
13501
- const _hoisted_15 = {
13502
- key: 1,
13503
- class: "table__column--selectable"
13504
- };
13505
- const _hoisted_16 = {
13506
- class: "table__input"
13507
- };
13508
- const _hoisted_17 = {
13509
- key: 0,
13510
- class: "sr-only"
13511
- };
13512
- const _hoisted_18 = {
13513
- key: 0,
13514
- class: "table__column--placeholder"
13515
- };
13516
- const _hoisted_19 = ["colspan"];
13517
- const _hoisted_20 = {
13518
- key: 0
13519
- };
13520
- const _hoisted_21 = {
13521
- key: 1
13522
- };
13523
- const _hoisted_22 = ["colspan"];
13524
- function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
13525
- const _component_f_icon = resolveComponent("f-icon");
13526
- const _component_f_checkbox_field = resolveComponent("f-checkbox-field");
13527
- return openBlock(), createElementBlock("div", {
13528
- class: normalizeClass(_ctx.wrapperClasses)
13529
- }, [createElementVNode("table", mergeProps({
13530
- class: ["table", _ctx.tableClasses],
13531
- role: _ctx.tableRole
13532
- }, _ctx.$attrs), [_ctx.hasCaption ? (openBlock(), createElementBlock("caption", _hoisted_2$d, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[15] || (_cache[15] = createTextVNode()), createElementVNode("colgroup", null, [_ctx.isExpandableTable ? (openBlock(), createElementBlock("col", _hoisted_3$9)) : createCommentVNode("", true), _cache[0] || (_cache[0] = createTextVNode()), _ctx.selectable ? (openBlock(), createElementBlock("col", _hoisted_4$8)) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (column) => {
13533
- return openBlock(), createElementBlock("col", {
13534
- key: column.id,
13535
- class: normalizeClass(column.size)
13536
- }, null, 2);
13537
- }), 128))]), _cache[16] || (_cache[16] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_5$6, [_ctx.isExpandableTable ? (openBlock(), createElementBlock("th", _hoisted_6$4, [createElementVNode("span", _hoisted_7$3, toDisplayString(_ctx.$t("fkui.interactive-table.select", "Expandera")), 1)])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), _ctx.selectable ? (openBlock(), createElementBlock("th", _hoisted_8$3, [createElementVNode("span", _hoisted_9$3, toDisplayString(_ctx.$t("fkui.interactive-table.select", "Markera")), 1)])) : createCommentVNode("", true), _cache[5] || (_cache[5] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.visibleColumns, (column) => {
13538
- return openBlock(), createElementBlock("th", mergeProps({
13539
- key: column.id,
13540
- scope: "col",
13541
- class: _ctx.columnClasses(column)
13542
- }, toHandlers(column.sortable ? {
13543
- click: () => _ctx.onClickColumnHeader(column)
13544
- } : {}, true)), [createElementVNode("span", {
13545
- innerHTML: _ctx.escapeNewlines(column.title)
13546
- }, null, 8, _hoisted_10$2), _cache[2] || (_cache[2] = createTextVNode()), column.sortable ? (openBlock(), createBlock(_component_f_icon, {
13547
- key: 0,
13548
- class: normalizeClass(_ctx.iconClasses(column)),
13549
- name: _ctx.iconName(column)
13550
- }, null, 8, ["class", "name"])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), column.description ? (openBlock(), createElementBlock("span", _hoisted_11$1, toDisplayString(column.description), 1)) : createCommentVNode("", true)], 16);
13551
- }), 128))])]), _cache[17] || (_cache[17] = createTextVNode()), (openBlock(), createElementBlock("tbody", {
13552
- ref: "tbodyElement",
13553
- key: _ctx.tbodyKey
13554
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (row, index) => {
13555
- return openBlock(), createElementBlock(Fragment, {
13556
- key: _ctx.rowKey(row)
13557
- }, [createElementVNode("tr", {
13558
- class: normalizeClass(_ctx.rowClasses(row, index)),
13559
- "aria-label": _ctx.rowDescription(row),
13560
- "aria-expanded": _ctx.rowAriaExpanded(row),
13561
- "aria-level": _ctx.isExpandableTable ? 1 : void 0,
13562
- "aria-describedby": _ctx.getExpandableDescribedby(row),
13563
- tabindex: "0",
13564
- onKeydown: withModifiers(($event) => _ctx.onKeydown($event, index), ["self"]),
13565
- onClick: ($event) => _ctx.onClick($event, row, index)
13566
- }, [_ctx.isExpandableTable ? (openBlock(), createElementBlock("td", _hoisted_13, [_ctx.hasExpandableContent(row) ? (openBlock(), createElementBlock("div", _hoisted_14, [createVNode(_component_f_icon, {
13567
- name: "arrow-right",
13568
- rotate: _ctx.isExpanded(row) ? "270" : "90"
13569
- }, null, 8, ["rotate"])])) : createCommentVNode("", true)])) : createCommentVNode("", true), _cache[6] || (_cache[6] = createTextVNode()), _ctx.selectable ? (openBlock(), createElementBlock("td", _hoisted_15, [createElementVNode("div", _hoisted_16, [createVNode(_component_f_checkbox_field, {
13570
- value: true,
13571
- "model-value": _ctx.isSelected(row),
13572
- onClick: withModifiers(($event) => _ctx.onSelect(row), ["self"])
13573
- }, {
13574
- default: withCtx(() => [_ctx.hasCheckboxDescription ? (openBlock(), createElementBlock("span", _hoisted_17, [renderSlot(_ctx.$slots, "checkbox-description", mergeProps({
13575
- ref_for: true
13576
- }, {
14182
+ function isSelected(row) {
14183
+ return includeItem(row, selectedRows.value, props.keyAttribute);
14184
+ }
14185
+ function onKeydown$1(event, index) {
14186
+ onKeydown({
14187
+ rows: props.rows,
14188
+ tr,
14189
+ activate
14190
+ }, event, index);
14191
+ }
14192
+ function onClick(event, row) {
14193
+ const {
14194
+ target
14195
+ } = event;
14196
+ const isRelevant = ["TD", "TH"].includes(target.nodeName);
14197
+ if (isRelevant) {
14198
+ const parent = target.parentElement;
14199
+ activate(row, parent);
14200
+ }
14201
+ }
14202
+ function activate(row, tr2) {
14203
+ emit("click", row);
14204
+ if (isExpandableTable.value && hasExpandableContent(row)) {
14205
+ toggleExpanded(row);
14206
+ }
14207
+ if (!itemEquals(row, activeRow.value, props.keyAttribute)) {
14208
+ emit("change", row);
14209
+ setActiveRow(row);
14210
+ if (tr2) {
14211
+ tr2.focus();
14212
+ const td = tr2.children[0];
14213
+ forceRepaintIE11(td);
14214
+ }
14215
+ }
14216
+ }
14217
+ function rowDescription(row) {
14218
+ const slot = slots["row-description"];
14219
+ return renderSlotText(slot, {
13577
14220
  row
13578
- }))])) : createCommentVNode("", true)]),
13579
- _: 2
13580
- }, 1032, ["model-value", "onClick"])])])) : createCommentVNode("", true), _cache[7] || (_cache[7] = createTextVNode()), renderSlot(_ctx.$slots, "default", mergeProps({
13581
- ref_for: true
13582
- }, {
13583
- row
13584
- }))], 42, _hoisted_12$1), _cache[11] || (_cache[11] = createTextVNode()), _ctx.isExpandableTable && _ctx.hasExpandableContent(row) ? (openBlock(true), createElementBlock(Fragment, {
13585
- key: 0
13586
- }, renderList(_ctx.expandableRows(row), (expandableRow, expandableIndex) => {
13587
- return openBlock(), createElementBlock("tr", {
13588
- key: _ctx.rowKey(expandableRow),
13589
- "aria-level": "2",
13590
- class: normalizeClass(_ctx.expandableRowClasses(row, expandableIndex))
13591
- }, [_cache[8] || (_cache[8] = createElementVNode("td", {
13592
- class: "table__column--placeholder"
13593
- }, null, -1)), _cache[9] || (_cache[9] = createTextVNode()), _ctx.selectable ? (openBlock(), createElementBlock("td", _hoisted_18)) : createCommentVNode("", true), _cache[10] || (_cache[10] = createTextVNode()), !_ctx.hasExpandableSlot ? renderSlot(_ctx.$slots, "default", mergeProps({
13594
- key: 1,
13595
- ref_for: true
13596
- }, {
13597
- row: expandableRow
13598
- })) : (openBlock(), createElementBlock("td", {
13599
- key: 2,
13600
- class: "table__column table__column--indented",
13601
- colspan: _ctx.columns.length
13602
- }, [renderSlot(_ctx.$slots, "expandable", mergeProps({
13603
- ref_for: true
13604
- }, {
13605
- expandableRow,
13606
- parentRow: row
13607
- }))], 8, _hoisted_19))], 2);
13608
- }), 128)) : createCommentVNode("", true)], 64);
13609
- }), 128)), _cache[13] || (_cache[13] = createTextVNode()), _ctx.isEmpty && _ctx.columns.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_20, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
13610
- row: {}
13611
- })))])) : createCommentVNode("", true), _cache[14] || (_cache[14] = createTextVNode()), _ctx.isEmpty ? (openBlock(), createElementBlock("tr", _hoisted_21, [createElementVNode("td", {
13612
- class: "table__column table__column--action",
13613
- colspan: _ctx.nbOfColumns
13614
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(_ctx.$t("fkui.interactive-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_22), _cache[12] || (_cache[12] = createTextVNode()), renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
13615
- row: {}
13616
- })))])) : createCommentVNode("", true)]))], 16, _hoisted_1$h)], 2);
13617
- }
13618
- const FInteractiveTable = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$f]]);
14221
+ });
14222
+ }
14223
+ function onSelect(row) {
14224
+ var _a, _b;
14225
+ if (includeItem(row, selectedRows.value, props.keyAttribute)) {
14226
+ selectedRows.value = selectedRows.value.filter((i) => !itemEquals(i, row, props.keyAttribute));
14227
+ emit("unselect", row);
14228
+ } else {
14229
+ selectedRows.value.push(row);
14230
+ emit("select", row);
14231
+ }
14232
+ updateVModelWithSelectedRows();
14233
+ (_b = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy) == null ? void 0 : _b.$forceUpdate();
14234
+ }
14235
+ function updateVModelWithSelectedRows() {
14236
+ if (props.modelValue) {
14237
+ emit("update:modelValue", selectedRows.value);
14238
+ }
14239
+ }
14240
+ function rowClasses(row, index) {
14241
+ const active = isActive(row) ? ["table__row--active"] : [];
14242
+ const selected = isSelected(row) ? ["table__row--selected"] : [];
14243
+ const isExpandableRow = isExpandableTable.value && hasExpandableContent(row);
14244
+ const expandable = isExpandableRow ? ["table__row--expandable"] : [];
14245
+ const expanded = isExpanded(row) ? ["table__row--expanded-border"] : [];
14246
+ const striped = props.striped && index % 2 !== 0 ? ["table__row--striped"] : [];
14247
+ return ["table__row", ...active, ...selected, ...striped, ...expandable, ...expanded];
14248
+ }
14249
+ function rowKey(row) {
14250
+ const key = row[props.keyAttribute];
14251
+ if (typeof key === "undefined") {
14252
+ throw new Error(`Key attribute [${props.keyAttribute}]' is missing in row`);
14253
+ }
14254
+ return String(key);
14255
+ }
14256
+ function columnClasses(column) {
14257
+ const sortable = column.sortable ? ["table__column--sortable"] : [];
14258
+ return ["table__column", `table__column--${column.type}`, ...sortable, column.size];
14259
+ }
14260
+ function iconClasses2(column) {
14261
+ return getSortableIconClasses(column);
14262
+ }
14263
+ function iconName(column) {
14264
+ return getSortableIconName(column);
14265
+ }
14266
+ function onClickColumnHeader(column) {
14267
+ if (!column.sortable) {
14268
+ return;
14269
+ }
14270
+ let columnName = column.name;
14271
+ if (column.sort === FTableColumnSort.DESCENDING) {
14272
+ columnName = "";
14273
+ column.sort = FTableColumnSort.UNSORTED;
14274
+ }
14275
+ sort2(columnName, column.sort !== FTableColumnSort.ASCENDING);
14276
+ }
14277
+ function callbackOnSort(columnName, ascending) {
14278
+ updateSortOrder(columns.value, columnName, ascending);
14279
+ }
14280
+ function callbackSortableColumns(columnNames) {
14281
+ setSortableColumns(columns.value, columnNames);
14282
+ }
14283
+ function callbackAfterItemAdd(item) {
14284
+ activate(item, null);
14285
+ }
14286
+ function callbackBeforeItemDelete(item) {
14287
+ if (props.rows.length === 0) {
14288
+ return;
14289
+ }
14290
+ let targetIndex = props.rows.indexOf(item) - 1;
14291
+ if (targetIndex < 0 && props.rows.length > 1) {
14292
+ targetIndex = 1;
14293
+ } else if (targetIndex < 0) {
14294
+ targetIndex = 0;
14295
+ }
14296
+ activate(props.rows[targetIndex], tr.value[targetIndex]);
14297
+ }
14298
+ function escapeNewlines(value) {
14299
+ return value.replace(/\n/g, "<br/>");
14300
+ }
14301
+ function updateActiveRowFromVModel() {
14302
+ if (props.active === void 0) {
14303
+ setActiveRow(void 0);
14304
+ } else if (!itemEquals(props.active, activeRow.value, props.keyAttribute)) {
14305
+ setActiveRow(props.active);
14306
+ }
14307
+ }
14308
+ function setActiveRow(row) {
14309
+ activeRow.value = row;
14310
+ emit("update:active", activeRow.value);
14311
+ }
14312
+ return (_ctx, _cache) => {
14313
+ return openBlock(), createElementBlock("div", {
14314
+ class: normalizeClass(wrapperClasses.value)
14315
+ }, [createCommentVNode("", true), _cache[18] || (_cache[18] = createTextVNode()), createElementVNode("table", mergeProps({
14316
+ class: ["table", tableClasses.value],
14317
+ role: tableRole.value
14318
+ }, _ctx.$attrs), [hasCaption.value ? (openBlock(), createElementBlock("caption", _hoisted_2$d, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[15] || (_cache[15] = createTextVNode()), createElementVNode("colgroup", null, [unref(isExpandableTable) ? (openBlock(), createElementBlock("col", _hoisted_3$9)) : createCommentVNode("", true), _cache[0] || (_cache[0] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("col", _hoisted_4$8)) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
14319
+ return openBlock(), createElementBlock("col", {
14320
+ key: column.id,
14321
+ class: normalizeClass(column.size)
14322
+ }, null, 2);
14323
+ }), 128))]), _cache[16] || (_cache[16] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_5$6, [unref(isExpandableTable) ? (openBlock(), createElementBlock("th", _hoisted_6$4, [createElementVNode("span", _hoisted_7$3, toDisplayString(unref($t2)("fkui.interactive-table.select", "Expandera")), 1)])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("th", _hoisted_8$3, [createElementVNode("span", _hoisted_9$3, toDisplayString(unref($t2)("fkui.interactive-table.select", "Markera")), 1)])) : createCommentVNode("", true), _cache[5] || (_cache[5] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(visibleColumns.value, (column) => {
14324
+ return openBlock(), createElementBlock("th", mergeProps({
14325
+ key: column.id,
14326
+ scope: "col",
14327
+ class: columnClasses(column)
14328
+ }, toHandlers(column.sortable ? {
14329
+ click: () => onClickColumnHeader(column)
14330
+ } : {}, true)), [createElementVNode("span", {
14331
+ innerHTML: escapeNewlines(column.title)
14332
+ }, null, 8, _hoisted_10$2), _cache[2] || (_cache[2] = createTextVNode()), column.sortable ? (openBlock(), createBlock(unref(FIcon), {
14333
+ key: 0,
14334
+ class: normalizeClass(iconClasses2(column)),
14335
+ name: iconName(column)
14336
+ }, null, 8, ["class", "name"])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), column.description ? (openBlock(), createElementBlock("span", _hoisted_11$1, toDisplayString(column.description), 1)) : createCommentVNode("", true)], 16);
14337
+ }), 128))])]), _cache[17] || (_cache[17] = createTextVNode()), (openBlock(), createElementBlock("tbody", {
14338
+ ref: "tbodyElement",
14339
+ key: tbodyKey.value
14340
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.rows, (row, index) => {
14341
+ return openBlock(), createElementBlock(Fragment, {
14342
+ key: rowKey(row)
14343
+ }, [createElementVNode("tr", {
14344
+ class: normalizeClass(rowClasses(row, index)),
14345
+ "aria-label": rowDescription(row),
14346
+ "aria-expanded": unref(rowAriaExpanded)(row),
14347
+ "aria-level": unref(isExpandableTable) ? 1 : void 0,
14348
+ "aria-describedby": unref(getExpandableDescribedby)(row),
14349
+ tabindex: "0",
14350
+ onKeydown: withModifiers(($event) => onKeydown$1($event, index), ["self"]),
14351
+ onClick: ($event) => onClick($event, row)
14352
+ }, [unref(isExpandableTable) ? (openBlock(), createElementBlock("td", _hoisted_13, [unref(hasExpandableContent)(row) ? (openBlock(), createElementBlock("div", _hoisted_14, [createVNode(unref(FIcon), {
14353
+ name: "arrow-right",
14354
+ rotate: unref(isExpanded)(row) ? "270" : "90"
14355
+ }, null, 8, ["rotate"])])) : createCommentVNode("", true)])) : createCommentVNode("", true), _cache[6] || (_cache[6] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("td", _hoisted_15, [createElementVNode("div", _hoisted_16, [createVNode(unref(FCheckboxField), {
14356
+ value: true,
14357
+ "model-value": isSelected(row),
14358
+ onClick: withModifiers(($event) => onSelect(row), ["self"])
14359
+ }, {
14360
+ default: withCtx(() => [hasCheckboxDescription.value ? (openBlock(), createElementBlock("span", _hoisted_17, [renderSlot(_ctx.$slots, "checkbox-description", mergeProps({
14361
+ ref_for: true
14362
+ }, {
14363
+ row
14364
+ }))])) : createCommentVNode("", true)]),
14365
+ _: 2
14366
+ }, 1032, ["model-value", "onClick"])])])) : createCommentVNode("", true), _cache[7] || (_cache[7] = createTextVNode()), renderSlot(_ctx.$slots, "default", mergeProps({
14367
+ ref_for: true
14368
+ }, {
14369
+ row
14370
+ }))], 42, _hoisted_12$1), _cache[11] || (_cache[11] = createTextVNode()), unref(isExpandableTable) && unref(hasExpandableContent)(row) ? (openBlock(true), createElementBlock(Fragment, {
14371
+ key: 0
14372
+ }, renderList(unref(expandableRows)(row), (expandableRow, expandableIndex) => {
14373
+ return openBlock(), createElementBlock("tr", {
14374
+ key: rowKey(expandableRow),
14375
+ "aria-level": "2",
14376
+ class: normalizeClass(unref(expandableRowClasses)(row, expandableIndex))
14377
+ }, [_cache[8] || (_cache[8] = createElementVNode("td", {
14378
+ class: "table__column--placeholder"
14379
+ }, null, -1)), _cache[9] || (_cache[9] = createTextVNode()), __props.selectable ? (openBlock(), createElementBlock("td", _hoisted_18)) : createCommentVNode("", true), _cache[10] || (_cache[10] = createTextVNode()), !unref(hasExpandableSlot) ? renderSlot(_ctx.$slots, "default", mergeProps({
14380
+ key: 1,
14381
+ ref_for: true
14382
+ }, {
14383
+ row: expandableRow
14384
+ })) : (openBlock(), createElementBlock("td", {
14385
+ key: 2,
14386
+ class: "table__column table__column--indented",
14387
+ colspan: columns.value.length
14388
+ }, [renderSlot(_ctx.$slots, "expandable", mergeProps({
14389
+ ref_for: true
14390
+ }, {
14391
+ expandableRow,
14392
+ parentRow: row
14393
+ }))], 8, _hoisted_19))], 2);
14394
+ }), 128)) : createCommentVNode("", true)], 64);
14395
+ }), 128)), _cache[13] || (_cache[13] = createTextVNode()), isEmpty2.value && columns.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_20, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
14396
+ row: {}
14397
+ })))])) : createCommentVNode("", true), _cache[14] || (_cache[14] = createTextVNode()), isEmpty2.value ? (openBlock(), createElementBlock("tr", _hoisted_21, [createElementVNode("td", {
14398
+ class: "table__column table__column--action",
14399
+ colspan: nbOfColumns.value
14400
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref($t2)("fkui.interactive-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_22), _cache[12] || (_cache[12] = createTextVNode()), renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
14401
+ row: {}
14402
+ })))])) : createCommentVNode("", true)]))], 16, _hoisted_1$h)], 2);
14403
+ };
14404
+ }
14405
+ });
13619
14406
  const _sfc_main$g = defineComponent({
13620
14407
  name: "FLayoutApplicationTemplate",
13621
14408
  computed: {
@@ -13660,12 +14447,12 @@ const _hoisted_5$5 = {
13660
14447
  key: 0,
13661
14448
  class: "layout-application-template__footer"
13662
14449
  };
13663
- function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
14450
+ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
13664
14451
  return openBlock(), createElementBlock("div", _hoisted_1$g, [_ctx.showHeader || _ctx.showTopNavigation ? (openBlock(), createElementBlock("header", _hoisted_2$c, [_ctx.showHeader ? renderSlot(_ctx.$slots, "header", {
13665
14452
  key: 0
13666
14453
  }) : createCommentVNode("", true), _cache[0] || (_cache[0] = createTextVNode()), _ctx.showTopNavigation ? (openBlock(), createElementBlock("nav", _hoisted_3$8, [renderSlot(_ctx.$slots, "top-navigation")])) : createCommentVNode("", true)], 512)) : createCommentVNode("", true), _cache[2] || (_cache[2] = createTextVNode()), createElementVNode("main", _hoisted_4$7, [renderSlot(_ctx.$slots, "default"), _cache[1] || (_cache[1] = createTextVNode()), _ctx.showFooter ? (openBlock(), createElementBlock("footer", _hoisted_5$5, [renderSlot(_ctx.$slots, "footer")])) : createCommentVNode("", true)], 512)]);
13667
14454
  }
13668
- const FLayoutApplicationTemplate = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$e]]);
14455
+ const FLayoutApplicationTemplate = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$d]]);
13669
14456
  function getGridClasses(target) {
13670
14457
  if (target === null) {
13671
14458
  return {};
@@ -13862,7 +14649,7 @@ const _hoisted_4$6 = {
13862
14649
  key: 1,
13863
14650
  class: "layout-navigation__navigation__inner--minimized"
13864
14651
  };
13865
- function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
14652
+ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
13866
14653
  const _component_f_icon = resolveComponent("f-icon");
13867
14654
  return openBlock(), createElementBlock("div", _hoisted_1$f, [createElementVNode("nav", {
13868
14655
  id: "layout-navigation__navigation",
@@ -13913,7 +14700,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
13913
14700
  style: normalizeStyle(_ctx.primaryStyle)
13914
14701
  }, [renderSlot(_ctx.$slots, "default")], 6)]);
13915
14702
  }
13916
- const FLayoutLeftPanel = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$d]]);
14703
+ const FLayoutLeftPanel = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$c]]);
13917
14704
  class FRightPanelServiceImpl {
13918
14705
  constructor() {
13919
14706
  _defineProperty(this, "focusedElementBeforeOpenining", null);
@@ -14066,7 +14853,7 @@ const _hoisted_1$e = {
14066
14853
  const _hoisted_2$a = {
14067
14854
  class: "layout-secondary__secondary__inner"
14068
14855
  };
14069
- function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
14856
+ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
14070
14857
  const _component_f_icon = resolveComponent("f-icon");
14071
14858
  return openBlock(), createElementBlock("div", _hoisted_1$e, [createElementVNode("div", {
14072
14859
  id: "layout-secondary__primary",
@@ -14105,13 +14892,34 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
14105
14892
  name: "close"
14106
14893
  })])], 6)])], 4)) : createCommentVNode("", true)]);
14107
14894
  }
14108
- const FLayoutRightPanel = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$c]]);
14109
- const _sfc_main$d = defineComponent({
14110
- name: "FList",
14111
- components: {
14112
- FCheckboxField
14113
- },
14114
- mixins: [TranslationMixin],
14895
+ const FLayoutRightPanel = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$b]]);
14896
+ const _hoisted_1$d = {
14897
+ key: 0,
14898
+ class: "list"
14899
+ };
14900
+ const _hoisted_2$9 = {
14901
+ key: 0,
14902
+ class: "list__item"
14903
+ };
14904
+ const _hoisted_3$6 = {
14905
+ class: "list__item__itempane"
14906
+ };
14907
+ const _hoisted_4$5 = ["tabindex"];
14908
+ const _hoisted_5$4 = ["id", "aria-labelledby", "tabindex", "onKeydown"];
14909
+ const _hoisted_6$3 = ["onClick"];
14910
+ const _hoisted_7$2 = {
14911
+ class: "list__item__selectpane__input"
14912
+ };
14913
+ const _hoisted_8$2 = ["id"];
14914
+ const _hoisted_9$2 = {
14915
+ key: 0,
14916
+ class: "list__item"
14917
+ };
14918
+ const _hoisted_10$1 = {
14919
+ class: "list__item__itempane"
14920
+ };
14921
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
14922
+ __name: "FList",
14115
14923
  props: {
14116
14924
  /**
14117
14925
  * The items to be listed.
@@ -14171,273 +14979,234 @@ const _sfc_main$d = defineComponent({
14171
14979
  default: () => ElementIdService.generateElementId()
14172
14980
  }
14173
14981
  },
14174
- emits: ["change", "click", "unselect", "update:modelValue", "select", "update:active"],
14175
- setup() {
14176
- return ActivateItemInjected();
14177
- },
14178
- data() {
14179
- return {
14180
- selectedItems: [],
14181
- activeItem: void 0
14182
- };
14183
- },
14184
- computed: {
14185
- isEmpty() {
14186
- return this.items.length === 0;
14187
- },
14188
- ariaActiveDescendant() {
14189
- return this.activeItem ? this.getItemId(this.activeItem) : void 0;
14190
- }
14191
- },
14192
- watch: {
14193
- items: {
14982
+ emits: ["change", "click", "select", "unselect", "update:active", "update:modelValue"],
14983
+ setup(__props, {
14984
+ emit: __emit
14985
+ }) {
14986
+ const $t2 = useTranslate();
14987
+ const slots = useSlots();
14988
+ const {
14989
+ registerCallbackAfterItemAdd,
14990
+ registerCallbackBeforeItemDelete
14991
+ } = ActivateItemInjected();
14992
+ const selectedItems = ref([]);
14993
+ const activeItem = ref(void 0);
14994
+ const ulElement = ref();
14995
+ const props = __props;
14996
+ const emit = __emit;
14997
+ const isEmpty2 = computed(() => {
14998
+ return props.items.length === 0;
14999
+ });
15000
+ watch(() => props.items, () => {
15001
+ updateSelectedItemsFromVModel();
15002
+ }, {
14194
15003
  deep: true,
14195
- immediate: true,
14196
- handler: function() {
14197
- this.updateSelectedItemsFromVModel();
14198
- }
14199
- },
14200
- modelValue: {
15004
+ immediate: true
15005
+ });
15006
+ watch(() => props.modelValue, () => {
15007
+ updateSelectedItemsFromVModel();
15008
+ }, {
14201
15009
  deep: true,
14202
- immediate: true,
14203
- handler: function() {
14204
- this.updateSelectedItemsFromVModel();
14205
- }
14206
- },
14207
- active: {
14208
- immediate: true,
14209
- handler: function() {
14210
- this.updateActiveItemFromVModel();
14211
- }
14212
- }
14213
- },
14214
- mounted() {
14215
- if (this.selectable && this.checkbox) {
14216
- if (!this.$slots["screenreader"]) {
14217
- throw Error('Slot "screenreader" is required when having "selectable" & "checkbox" option.');
15010
+ immediate: true
15011
+ });
15012
+ watch(() => props.active, () => {
15013
+ updateActiveItemFromVModel();
15014
+ }, {
15015
+ immediate: true
15016
+ });
15017
+ onMounted(() => {
15018
+ if (props.selectable && props.checkbox) {
15019
+ if (!slots["screenreader"]) {
15020
+ throw Error('Slot "screenreader" is required when having "selectable" & "checkbox" option.');
15021
+ }
15022
+ registerCallbackAfterItemAdd(callbackAfterItemAdd);
15023
+ registerCallbackBeforeItemDelete(callbackBeforeItemDelete);
14218
15024
  }
14219
- this.registerCallbackAfterItemAdd(this.callbackAfterItemAdd);
14220
- this.registerCallbackBeforeItemDelete(this.callbackBeforeItemDelete);
15025
+ });
15026
+ function getLiElements() {
15027
+ const element = getElementFromVueRef(ulElement.value);
15028
+ return Array.from(element.children);
14221
15029
  }
14222
- },
14223
- methods: {
14224
- getLiElements() {
14225
- const ulElement = getElementFromVueRef(this.$refs["ulElement"]);
14226
- return Array.from(ulElement.children);
14227
- },
14228
- itemKey(item) {
14229
- const key = item[this.keyAttribute];
15030
+ function itemKey(item) {
15031
+ const key = item[props.keyAttribute];
14230
15032
  if (typeof key === "undefined") {
14231
- throw new Error(`Key attribute [${this.keyAttribute}]' is missing in item`);
15033
+ throw new Error(`Key attribute [${props.keyAttribute}]' is missing in item`);
14232
15034
  }
14233
15035
  return String(key);
14234
- },
14235
- isSelected(item) {
14236
- return includeItem(item, this.selectedItems, this.keyAttribute);
14237
- },
14238
- itemClasses(item) {
15036
+ }
15037
+ function isSelected(item) {
15038
+ return includeItem(item, selectedItems.value, props.keyAttribute);
15039
+ }
15040
+ function itemClasses(item) {
14239
15041
  return {
14240
- "list__item--selected": this.isSelected(item),
14241
- "list__item--active": this.isActive(item)
15042
+ "list__item--selected": isSelected(item),
15043
+ "list__item--active": isActive(item)
14242
15044
  };
14243
- },
14244
- getAriaSelected(item) {
14245
- return String(itemEquals(this.activeItem, item, this.keyAttribute));
14246
- },
14247
- onSelect(item) {
14248
- if (includeItem(item, this.selectedItems, this.keyAttribute)) {
14249
- this.selectedItems = this.selectedItems.filter((i) => !itemEquals(i, item, this.keyAttribute));
14250
- this.$emit("unselect", item);
15045
+ }
15046
+ function onSelect(item) {
15047
+ var _a, _b;
15048
+ if (includeItem(item, selectedItems.value, props.keyAttribute)) {
15049
+ selectedItems.value = selectedItems.value.filter((i) => !itemEquals(i, item, props.keyAttribute));
15050
+ emit("unselect", item);
14251
15051
  } else {
14252
- this.selectedItems.push(item);
14253
- this.$emit("select", item);
15052
+ selectedItems.value.push(item);
15053
+ emit("select", item);
14254
15054
  }
14255
- this.updateVModelWithSelectedItems();
14256
- this.$forceUpdate();
14257
- },
14258
- setActiveItem(item) {
14259
- this.$emit("click", item);
14260
- if (!itemEquals(item, this.activeItem, this.keyAttribute)) {
14261
- this.$emit("change", item);
14262
- this.activeItem = item;
14263
- this.$emit("update:active", this.activeItem);
15055
+ updateVModelWithSelectedItems();
15056
+ (_b = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy) == null ? void 0 : _b.$forceUpdate();
15057
+ }
15058
+ function setActiveItem(item) {
15059
+ emit("click", item);
15060
+ if (!itemEquals(item, activeItem.value, props.keyAttribute)) {
15061
+ emit("change", item);
15062
+ activeItem.value = item;
15063
+ emit("update:active", activeItem.value);
14264
15064
  }
14265
- },
14266
- onItemClick(event, index, item) {
14267
- this.setActiveItem(item);
14268
- },
14269
- updateVModelWithSelectedItems() {
14270
- if (this.modelValue) {
14271
- this.$emit("update:modelValue", this.selectedItems);
15065
+ }
15066
+ function onItemClick(event, index, item) {
15067
+ setActiveItem(item);
15068
+ }
15069
+ function updateVModelWithSelectedItems() {
15070
+ if (props.modelValue) {
15071
+ emit("update:modelValue", selectedItems.value);
14272
15072
  }
14273
- },
14274
- updateSelectedItemsFromVModel() {
14275
- if (Array.isArray(this.modelValue)) {
14276
- this.selectedItems = this.modelValue.filter((item) => {
14277
- return includeItem(item, this.items, this.keyAttribute);
15073
+ }
15074
+ function updateSelectedItemsFromVModel() {
15075
+ if (Array.isArray(props.modelValue)) {
15076
+ selectedItems.value = props.modelValue.filter((item) => {
15077
+ return includeItem(item, props.items, props.keyAttribute);
14278
15078
  });
14279
15079
  } else {
14280
- this.selectedItems = [];
15080
+ selectedItems.value = [];
14281
15081
  }
14282
- },
14283
- updateActiveItemFromVModel() {
14284
- if (this.active === void 0) {
14285
- this.activeItem = void 0;
14286
- } else if (!itemEquals(this.active, this.activeItem, this.keyAttribute)) {
14287
- this.activeItem = this.active;
15082
+ }
15083
+ function updateActiveItemFromVModel() {
15084
+ if (props.active === void 0) {
15085
+ activeItem.value = void 0;
15086
+ } else if (!itemEquals(props.active, activeItem.value, props.keyAttribute)) {
15087
+ activeItem.value = props.active;
14288
15088
  }
14289
- },
14290
- onItemKeyDown(event, item) {
15089
+ }
15090
+ function onItemKeyDown(event, item) {
14291
15091
  switch (event.key) {
14292
15092
  case "Up":
14293
15093
  case "Down":
14294
15094
  case "ArrowUp":
14295
15095
  case "ArrowDown":
14296
15096
  event.preventDefault();
14297
- handleKeyboardFocusNavigation(event.key, event.target, this.getLiElements());
15097
+ handleKeyboardFocusNavigation(event.key, event.target, getLiElements());
14298
15098
  break;
14299
15099
  case " ":
14300
15100
  case "Spacebar":
14301
15101
  event.preventDefault();
14302
- this.setActiveItem(item);
15102
+ setActiveItem(item);
14303
15103
  break;
14304
15104
  }
14305
- },
14306
- // Unique id to connect aria-labelledby with readonly label
14307
- getAriaLabelledbyId(item) {
14308
- return `${this.elementId}_${this.itemKey(item)}`;
14309
- },
14310
- // Unique id to connect aria-labelledby with readonly label
14311
- getItemId(item) {
14312
- return `${this.elementId}_item_${this.itemKey(item)}`;
14313
- },
14314
- // Focus effect is done with box-shadow.
14315
- // By setting position to relative the
14316
- // item and box-shadow is drawn with a higher z-index,
14317
- // thus no focus border under other list items.
14318
- onItemFocus(event) {
15105
+ }
15106
+ function getAriaLabelledbyId(item) {
15107
+ return `${props.elementId}_${itemKey(item)}`;
15108
+ }
15109
+ function getItemId(item) {
15110
+ return `${props.elementId}_item_${itemKey(item)}`;
15111
+ }
15112
+ function onItemFocus(event) {
14319
15113
  if (event && event.target) {
14320
15114
  event.target.style.position = "relative";
14321
15115
  }
14322
- },
14323
- onItemBlur(event) {
15116
+ }
15117
+ function onItemBlur(event) {
14324
15118
  if (event && event.target) {
14325
15119
  event.target.style.position = "static";
14326
15120
  }
14327
- },
14328
- callbackAfterItemAdd(item) {
14329
- this.setActiveItem(item);
14330
- },
14331
- callbackBeforeItemDelete(item) {
14332
- if (this.items.length === 0) {
15121
+ }
15122
+ function callbackAfterItemAdd(item) {
15123
+ setActiveItem(item);
15124
+ }
15125
+ function callbackBeforeItemDelete(item) {
15126
+ if (props.items.length === 0) {
14333
15127
  return;
14334
15128
  }
14335
- let targetIndex = this.items.indexOf(item) - 1;
14336
- if (targetIndex < 0 && this.items.length > 1) {
15129
+ let targetIndex = props.items.indexOf(item) - 1;
15130
+ if (targetIndex < 0 && props.items.length > 1) {
14337
15131
  targetIndex = 1;
14338
15132
  } else if (targetIndex < 0) {
14339
15133
  targetIndex = 0;
14340
15134
  }
14341
- this.setActiveItem(this.items[targetIndex]);
14342
- if (this.getLiElements()[targetIndex]) {
14343
- this.getLiElements()[targetIndex].focus();
15135
+ setActiveItem(props.items[targetIndex]);
15136
+ const targetElement = getLiElements()[targetIndex];
15137
+ if (targetElement) {
15138
+ targetElement.focus();
14344
15139
  }
14345
- },
14346
- isActive(item) {
14347
- return this.checkbox && itemEquals(this.activeItem, item, this.keyAttribute);
14348
15140
  }
15141
+ function isActive(item) {
15142
+ return props.checkbox && itemEquals(activeItem.value, item, props.keyAttribute);
15143
+ }
15144
+ return (_ctx, _cache) => {
15145
+ return !__props.selectable ? (openBlock(), createElementBlock("ul", _hoisted_1$d, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
15146
+ return openBlock(), createElementBlock("li", {
15147
+ key: itemKey(item),
15148
+ class: "list__item"
15149
+ }, [createElementVNode("div", {
15150
+ ref_for: true,
15151
+ ref: "listItemPanes",
15152
+ class: "list__item__itempane"
15153
+ }, [renderSlot(_ctx.$slots, "default", mergeProps({
15154
+ ref_for: true
15155
+ }, {
15156
+ item
15157
+ }))], 512)]);
15158
+ }), 128)), _cache[0] || (_cache[0] = createTextVNode()), isEmpty2.value ? (openBlock(), createElementBlock("li", _hoisted_2$9, [createElementVNode("div", _hoisted_3$6, [renderSlot(_ctx.$slots, "empty", {}, () => [createElementVNode("em", null, toDisplayString(unref($t2)("fkui.list.empty", "Listan är tom")), 1)])])])) : createCommentVNode("", true)])) : (openBlock(), createElementBlock("ul", {
15159
+ key: 1,
15160
+ ref_key: "ulElement",
15161
+ ref: ulElement,
15162
+ class: "list list--hover",
15163
+ tabindex: __props.checkbox ? 0 : void 0
15164
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
15165
+ return openBlock(), createElementBlock("li", {
15166
+ id: getItemId(item),
15167
+ key: itemKey(item),
15168
+ "aria-labelledby": getItemId(item),
15169
+ class: normalizeClass([itemClasses(item), "list__item"]),
15170
+ tabindex: __props.checkbox ? 0 : void 0,
15171
+ onKeydown: withModifiers(($event) => onItemKeyDown($event, item), ["self"]),
15172
+ onFocus: withModifiers(onItemFocus, ["self"]),
15173
+ onBlur: withModifiers(onItemBlur, ["self"])
15174
+ }, [__props.checkbox ? (openBlock(), createElementBlock("div", {
15175
+ key: 0,
15176
+ class: "list__item__selectpane",
15177
+ onClick: withModifiers(($event) => onSelect(item), ["self"])
15178
+ }, [createElementVNode("div", _hoisted_7$2, [createVNode(unref(FCheckboxField), {
15179
+ value: true,
15180
+ "model-value": isSelected(item),
15181
+ onClick: withModifiers(($event) => onSelect(item), ["self"])
15182
+ }, {
15183
+ default: withCtx(() => [createElementVNode("span", {
15184
+ id: getAriaLabelledbyId(item),
15185
+ class: "sr-only"
15186
+ }, [renderSlot(_ctx.$slots, "screenreader", mergeProps({
15187
+ ref_for: true
15188
+ }, {
15189
+ item
15190
+ }))], 8, _hoisted_8$2)]),
15191
+ _: 2
15192
+ }, 1032, ["model-value", "onClick"])])], 8, _hoisted_6$3)) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), (openBlock(), createBlock(resolveDynamicComponent(__props.checkbox ? "div" : "a"), {
15193
+ ref_for: true,
15194
+ ref: "listItemPanes",
15195
+ href: !__props.checkbox ? "javascript:" : void 0,
15196
+ class: "list__item__itempane",
15197
+ onClick: ($event) => onItemClick($event, index, item)
15198
+ }, {
15199
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", mergeProps({
15200
+ ref_for: true
15201
+ }, {
15202
+ item
15203
+ }))]),
15204
+ _: 2
15205
+ }, 1032, ["href", "onClick"]))], 42, _hoisted_5$4);
15206
+ }), 128)), _cache[2] || (_cache[2] = createTextVNode()), isEmpty2.value ? (openBlock(), createElementBlock("li", _hoisted_9$2, [createElementVNode("div", _hoisted_10$1, [renderSlot(_ctx.$slots, "empty", {}, () => [createElementVNode("em", null, toDisplayString(unref($t2)("fkui.list.empty", "Listan är tom")), 1)])])])) : createCommentVNode("", true)], 8, _hoisted_4$5));
15207
+ };
14349
15208
  }
14350
15209
  });
14351
- const _hoisted_1$d = {
14352
- key: 0,
14353
- class: "list"
14354
- };
14355
- const _hoisted_2$9 = {
14356
- key: 0,
14357
- class: "list__item"
14358
- };
14359
- const _hoisted_3$6 = {
14360
- class: "list__item__itempane"
14361
- };
14362
- const _hoisted_4$5 = ["tabindex"];
14363
- const _hoisted_5$4 = ["id", "aria-labelledby", "tabindex", "onKeydown"];
14364
- const _hoisted_6$3 = ["onClick"];
14365
- const _hoisted_7$2 = {
14366
- class: "list__item__selectpane__input"
14367
- };
14368
- const _hoisted_8$2 = ["id"];
14369
- const _hoisted_9$2 = {
14370
- key: 0,
14371
- class: "list__item"
14372
- };
14373
- const _hoisted_10$1 = {
14374
- class: "list__item__itempane"
14375
- };
14376
- function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
14377
- const _component_f_checkbox_field = resolveComponent("f-checkbox-field");
14378
- return !_ctx.selectable ? (openBlock(), createElementBlock("ul", _hoisted_1$d, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item) => {
14379
- return openBlock(), createElementBlock("li", {
14380
- key: _ctx.itemKey(item),
14381
- class: "list__item"
14382
- }, [createElementVNode("div", {
14383
- ref_for: true,
14384
- ref: "listItemPanes",
14385
- class: "list__item__itempane"
14386
- }, [renderSlot(_ctx.$slots, "default", mergeProps({
14387
- ref_for: true
14388
- }, {
14389
- item
14390
- }))], 512)]);
14391
- }), 128)), _cache[2] || (_cache[2] = createTextVNode()), _ctx.isEmpty ? (openBlock(), createElementBlock("li", _hoisted_2$9, [createElementVNode("div", _hoisted_3$6, [renderSlot(_ctx.$slots, "empty", {}, () => [createElementVNode("em", null, toDisplayString(_ctx.$t("fkui.list.empty", "Listan är tom")), 1)])])])) : createCommentVNode("", true)])) : (openBlock(), createElementBlock("ul", {
14392
- key: 1,
14393
- ref: "ulElement",
14394
- class: "list list--hover",
14395
- tabindex: _ctx.checkbox ? 0 : void 0
14396
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item, index) => {
14397
- return openBlock(), createElementBlock("li", {
14398
- id: _ctx.getItemId(item),
14399
- key: _ctx.itemKey(item),
14400
- "aria-labelledby": _ctx.getItemId(item),
14401
- class: normalizeClass([_ctx.itemClasses(item), "list__item"]),
14402
- tabindex: _ctx.checkbox ? 0 : void 0,
14403
- onKeydown: withModifiers(($event) => _ctx.onItemKeyDown($event, item), ["self"]),
14404
- onFocus: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.onItemFocus && _ctx.onItemFocus(...args), ["self"])),
14405
- onBlur: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.onItemBlur && _ctx.onItemBlur(...args), ["self"]))
14406
- }, [_ctx.checkbox ? (openBlock(), createElementBlock("div", {
14407
- key: 0,
14408
- class: "list__item__selectpane",
14409
- onClick: withModifiers(($event) => _ctx.onSelect(item), ["self"])
14410
- }, [createElementVNode("div", _hoisted_7$2, [createVNode(_component_f_checkbox_field, {
14411
- value: true,
14412
- "model-value": _ctx.isSelected(item),
14413
- onClick: withModifiers(($event) => _ctx.onSelect(item), ["self"])
14414
- }, {
14415
- default: withCtx(() => [createElementVNode("span", {
14416
- id: _ctx.getAriaLabelledbyId(item),
14417
- class: "sr-only"
14418
- }, [renderSlot(_ctx.$slots, "screenreader", mergeProps({
14419
- ref_for: true
14420
- }, {
14421
- item
14422
- }))], 8, _hoisted_8$2)]),
14423
- _: 2
14424
- }, 1032, ["model-value", "onClick"])])], 8, _hoisted_6$3)) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), (openBlock(), createBlock(resolveDynamicComponent(_ctx.checkbox ? "div" : "a"), {
14425
- ref_for: true,
14426
- ref: "listItemPanes",
14427
- href: !_ctx.checkbox ? "javascript:" : void 0,
14428
- class: "list__item__itempane",
14429
- onClick: ($event) => _ctx.onItemClick($event, index, item)
14430
- }, {
14431
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", mergeProps({
14432
- ref_for: true
14433
- }, {
14434
- item
14435
- }))]),
14436
- _: 2
14437
- }, 1032, ["href", "onClick"]))], 42, _hoisted_5$4);
14438
- }), 128)), _cache[4] || (_cache[4] = createTextVNode()), _ctx.isEmpty ? (openBlock(), createElementBlock("li", _hoisted_9$2, [createElementVNode("div", _hoisted_10$1, [renderSlot(_ctx.$slots, "empty", {}, () => [createElementVNode("em", null, toDisplayString(_ctx.$t("fkui.list.empty", "Listan är tom")), 1)])])])) : createCommentVNode("", true)], 8, _hoisted_4$5));
14439
- }
14440
- const FList = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
14441
15210
  const _sfc_main$c = defineComponent({
14442
15211
  name: "FLoader",
14443
15212
  mixins: [TranslationMixin],
@@ -16514,10 +17283,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
16514
17283
  class: "wizard-step-body",
16515
17284
  onSubmit: _ctx.onSubmit
16516
17285
  }, {
16517
- "error-message": withCtx(() => [renderSlot(_ctx.$slots, "error-message", normalizeProps(guardReactiveProps({
16518
- stepNumber: _ctx.stepNumber,
16519
- totalSteps: _ctx.totalSteps
16520
- })), () => [createTextVNode(toDisplayString(_ctx.$t("fkui.wizard-step.errorlist.title", "Oj, du har glömt att fylla i något. Gå till:")), 1)])]),
17286
+ "error-message": withCtx(() => [renderSlot(_ctx.$slots, "error-message", {}, () => [createTextVNode(toDisplayString(_ctx.$t("fkui.wizard-step.errorlist.title", "Oj, du har glömt att fylla i något. Gå till:")), 1)])]),
16521
17287
  default: withCtx(() => [renderSlot(_ctx.$slots, "default"), _cache[14] || (_cache[14] = createTextVNode()), createElementVNode("div", _hoisted_10, [createElementVNode("button", {
16522
17288
  "data-test": "submit-button",
16523
17289
  "data-disabled": _ctx.ignoreClick ? "true" : "false",
@@ -16535,7 +17301,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
16535
17301
  type: "button",
16536
17302
  class: "button button--secondary button-group__item button--large",
16537
17303
  onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onCancel && _ctx.onCancel(...args))
16538
- }, [renderSlot(_ctx.$slots, "cancel-button-text", {}, () => [createTextVNode(toDisplayString(_ctx.$t("fkui.wizard-step.button.cancel.text", "Avbryt")), 1)])])])]),
17304
+ }, [renderSlot(_ctx.$slots, "cancel-button-text", normalizeProps(guardReactiveProps({
17305
+ stepNumber: _ctx.stepNumber,
17306
+ totalSteps: _ctx.totalSteps
17307
+ })), () => [createTextVNode(toDisplayString(_ctx.$t("fkui.wizard-step.button.cancel.text", "Avbryt")), 1)])])])]),
16539
17308
  _: 3
16540
17309
  }, 8, ["id", "before-submit", "before-validation", "use-error-list", "onSubmit"])]),
16541
17310
  _: 3
@@ -16559,9 +17328,9 @@ export {
16559
17328
  FConfirmModal,
16560
17329
  FContextMenu,
16561
17330
  FCrudButton,
16562
- FCrudDataset,
17331
+ _sfc_main$I as FCrudDataset,
16563
17332
  _sfc_main$A as FCurrencyTextField,
16564
- FDataTable,
17333
+ _sfc_main$o as FDataTable,
16565
17334
  FDatepickerField,
16566
17335
  FDialogueTree,
16567
17336
  FEmailTextField,
@@ -16576,14 +17345,14 @@ export {
16576
17345
  FFormModal,
16577
17346
  FValidationFormAction as FFormModalAction,
16578
17347
  FIcon,
16579
- FInteractiveTable,
17348
+ _sfc_main$h as FInteractiveTable,
16580
17349
  FKUIConfigButtonOrder,
16581
17350
  FLabel,
16582
17351
  FLayoutApplicationTemplate,
16583
17352
  FLayoutLeftPanel,
16584
17353
  FLayoutRightPanel,
16585
17354
  FLayoutRightPanelService,
16586
- FList,
17355
+ _sfc_main$d as FList,
16587
17356
  FLoader,
16588
17357
  _sfc_main$b as FLogo,
16589
17358
  FMessageBox,
@@ -16603,7 +17372,7 @@ export {
16603
17372
  FRadioField,
16604
17373
  FSearchTextField,
16605
17374
  FSelectField,
16606
- FSortFilterDataset,
17375
+ _sfc_main$p as FSortFilterDataset,
16607
17376
  FSortFilterDatasetInjected,
16608
17377
  FStaticField,
16609
17378
  FTableColumn,