fds-vue-core 2.0.3 → 2.0.4

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.
@@ -46,6 +46,7 @@
46
46
  --tw-drop-shadow-alpha: 100%;
47
47
  --tw-drop-shadow-size: initial;
48
48
  --tw-duration: initial;
49
+ --tw-ease: initial;
49
50
  }
50
51
  }
51
52
  }
@@ -127,6 +128,7 @@
127
128
  --font-weight-bold: 700;
128
129
  --font-weight-extrabold: 800;
129
130
  --leading-tight: 1.25;
131
+ --ease-in-out: cubic-bezier(.4, 0, .2, 1);
130
132
  --animate-spin: spin 1s linear infinite;
131
133
  --default-transition-duration: .15s;
132
134
  --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
@@ -1778,6 +1780,10 @@
1778
1780
  accent-color: var(--color-gray-600);
1779
1781
  }
1780
1782
 
1783
+ .opacity-0 {
1784
+ opacity: 0;
1785
+ }
1786
+
1781
1787
  .opacity-20 {
1782
1788
  opacity: .2;
1783
1789
  }
@@ -1790,6 +1796,10 @@
1790
1796
  opacity: .5;
1791
1797
  }
1792
1798
 
1799
+ .opacity-100 {
1800
+ opacity: 1;
1801
+ }
1802
+
1793
1803
  .shadow-\[0_2px_4px_rgba\(12\,72\,153\,0\.12\)\] {
1794
1804
  --tw-shadow: 0 2px 4px var(--tw-shadow-color, #0c48991f);
1795
1805
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -1905,6 +1915,16 @@
1905
1915
  transition-duration: .2s;
1906
1916
  }
1907
1917
 
1918
+ .duration-500 {
1919
+ --tw-duration: .5s;
1920
+ transition-duration: .5s;
1921
+ }
1922
+
1923
+ .ease-in-out {
1924
+ --tw-ease: var(--ease-in-out);
1925
+ transition-timing-function: var(--ease-in-out);
1926
+ }
1927
+
1908
1928
  .outline-dashed {
1909
1929
  --tw-outline-style: dashed;
1910
1930
  outline-style: dashed;
@@ -2524,6 +2544,11 @@
2524
2544
  inherits: false
2525
2545
  }
2526
2546
 
2547
+ @property --tw-ease {
2548
+ syntax: "*";
2549
+ inherits: false
2550
+ }
2551
+
2527
2552
  @keyframes spin {
2528
2553
  to {
2529
2554
  transform: rotate(360deg);
@@ -1,4 +1,4 @@
1
- import { reactive, ref, watch, computed, defineComponent, useSlots, nextTick, createElementBlock, openBlock, normalizeClass, withDirectives, createCommentVNode, createElementVNode, vModelCheckbox, renderSlot, normalizeStyle, createBlock, inject, resolveComponent, createVNode, unref, withCtx, Fragment, createTextVNode, toDisplayString, withModifiers, renderList, withKeys, watchEffect, resolveDynamicComponent, mergeProps, vModelDynamic, provide, onMounted, vModelText, vModelSelect, vShow, onBeforeUnmount, Teleport } from "vue";
1
+ import { reactive, ref, watch, computed, defineComponent, useSlots, nextTick, createElementBlock, openBlock, normalizeClass, withDirectives, createCommentVNode, createElementVNode, vModelCheckbox, renderSlot, normalizeStyle, createBlock, inject, resolveComponent, createVNode, unref, withCtx, Fragment, createTextVNode, toDisplayString, Transition, withModifiers, renderList, withKeys, watchEffect, resolveDynamicComponent, mergeProps, vModelDynamic, provide, onMounted, vModelText, vModelSelect, vShow, onBeforeUnmount, Teleport } from "vue";
2
2
  const getTitleFromProperties = (node, titleTemplate) => {
3
3
  if (!titleTemplate) {
4
4
  return node.title;
@@ -1186,7 +1186,8 @@ const _hoisted_4$8 = {
1186
1186
  style: { "max-height": "28px" }
1187
1187
  };
1188
1188
  const _hoisted_5$6 = { class: "flex flex-col gap-2" };
1189
- const _hoisted_6$5 = { key: 0 };
1189
+ const _hoisted_6$5 = ["onClick"];
1190
+ const _hoisted_7$3 = { key: 0 };
1190
1191
  const popoverWidth = 327;
1191
1192
  const popoverHeight = 80;
1192
1193
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
@@ -1301,13 +1302,13 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
1301
1302
  firstRadio?.focus();
1302
1303
  };
1303
1304
  const closePopover = () => {
1304
- setTimeout(() => {
1305
- isOpen.value = false;
1306
- window.removeEventListener("scroll", computePopoverCoords, true);
1307
- window.removeEventListener("resize", computePopoverCoords);
1308
- document.removeEventListener("pointerdown", handleGlobalPointerDown);
1309
- document.removeEventListener("keydown", handleGlobalKeydown);
1310
- }, 300);
1305
+ isOpen.value = false;
1306
+ };
1307
+ const onAfterPopoverLeave = () => {
1308
+ window.removeEventListener("scroll", computePopoverCoords, true);
1309
+ window.removeEventListener("resize", computePopoverCoords);
1310
+ document.removeEventListener("pointerdown", handleGlobalPointerDown);
1311
+ document.removeEventListener("keydown", handleGlobalKeydown);
1311
1312
  };
1312
1313
  const togglePopover = () => {
1313
1314
  if (isOpen.value) closePopover();
@@ -1354,14 +1355,12 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
1354
1355
  return "";
1355
1356
  });
1356
1357
  const handleOptionClick = (option) => {
1357
- setTimeout(() => {
1358
- if (option === "parent_and_children") {
1359
- treeState?.selectNodeAndAllChildren(props.nodeId);
1360
- } else if (option === "parent") {
1361
- treeState?.deselectChildrenOnly(props.nodeId);
1362
- }
1363
- isOpen.value = false;
1364
- }, 300);
1358
+ if (option === "parent_and_children") {
1359
+ treeState?.selectNodeAndAllChildren(props.nodeId);
1360
+ } else if (option === "parent") {
1361
+ treeState?.deselectChildrenOnly(props.nodeId);
1362
+ }
1363
+ closePopover();
1365
1364
  };
1366
1365
  return (_ctx, _cache) => {
1367
1366
  const _component_TreeNode = resolveComponent("TreeNode", true);
@@ -1430,65 +1429,84 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
1430
1429
  onClick: togglePopover,
1431
1430
  ariaLabel: `Fler val för ${_ctx.title}`
1432
1431
  }, null, 8, ["ariaLabel"]),
1433
- isOpen.value ? (openBlock(), createElementBlock("div", {
1434
- key: 0,
1435
- class: "fixed z-9999",
1436
- style: normalizeStyle({
1437
- top: popoverCoords.top + "px",
1438
- left: popoverCoords.right - popoverWidth - (popoverCoords.right - popoverCoords.left) + "px"
1439
- })
1440
- }, [
1441
- createElementVNode("div", {
1442
- ref_key: "popoverPanelRef",
1443
- ref: popoverPanelRef,
1444
- class: "bg-white rounded-md p-4 shadow-lg flex flex-row justify-between items-start gap-3",
1445
- style: normalizeStyle({
1446
- width: popoverWidth + "px",
1447
- minHeight: popoverHeight + "px"
1448
- }),
1449
- onClick: _cache[3] || (_cache[3] = withModifiers(() => {
1450
- }, ["stop"])),
1451
- onFocusout: onPanelFocusOut
1452
- }, [
1453
- createElementVNode("div", _hoisted_5$6, [
1454
- (openBlock(), createElementBlock(Fragment, null, renderList(options, (option) => {
1455
- return createElementVNode("div", {
1456
- key: option.value
1457
- }, [
1458
- createVNode(_sfc_main$p, {
1459
- checked: currentOption.value === option.value,
1460
- id: `tree-popover-${props.nodeId}-${option.value}`,
1461
- name: `tree-popover-${props.nodeId}`,
1462
- value: option.value,
1463
- onChange: ($event) => handleOptionClick(option.value),
1464
- onBlur: closePopover,
1465
- onKeydown: [
1466
- withKeys(withModifiers(($event) => handleOptionClick(option.value), ["prevent"]), ["enter"]),
1467
- withKeys(withModifiers(($event) => handleOptionClick(option.value), ["prevent"]), ["space"])
1468
- ]
1469
- }, {
1470
- default: withCtx(() => [
1471
- createTextVNode(toDisplayString(option.label), 1)
1472
- ]),
1473
- _: 2
1474
- }, 1032, ["checked", "id", "name", "value", "onChange", "onKeydown"])
1475
- ]);
1476
- }), 64))
1477
- ]),
1478
- createVNode(_sfc_main$r, {
1479
- icon: "cross",
1480
- id: "tree-popover-close-button",
1481
- size: "24px",
1482
- onClick: _cache[2] || (_cache[2] = ($event) => closePopover()),
1483
- class: "fill-blue-500",
1484
- ariaLabel: "Stäng"
1485
- })
1486
- ], 36)
1487
- ], 4)) : createCommentVNode("", true)
1432
+ createVNode(Transition, {
1433
+ "enter-active-class": "transition-opacity duration-200 ease-in-out",
1434
+ "enter-from-class": "opacity-0",
1435
+ "enter-to-class": "opacity-100",
1436
+ "leave-active-class": "transition-opacity duration-500 ease-in-out",
1437
+ "leave-from-class": "opacity-100",
1438
+ "leave-to-class": "opacity-0",
1439
+ onAfterLeave: onAfterPopoverLeave
1440
+ }, {
1441
+ default: withCtx(() => [
1442
+ isOpen.value ? (openBlock(), createElementBlock("div", {
1443
+ key: 0,
1444
+ class: "fixed z-9999",
1445
+ style: normalizeStyle({
1446
+ top: popoverCoords.top + "px",
1447
+ left: popoverCoords.right - popoverWidth - (popoverCoords.right - popoverCoords.left) + "px"
1448
+ })
1449
+ }, [
1450
+ createElementVNode("div", {
1451
+ ref_key: "popoverPanelRef",
1452
+ ref: popoverPanelRef,
1453
+ class: "bg-white rounded-md p-4 shadow-lg flex flex-row justify-between items-start gap-3",
1454
+ style: normalizeStyle({
1455
+ width: popoverWidth + "px",
1456
+ minHeight: popoverHeight + "px"
1457
+ }),
1458
+ onClick: _cache[3] || (_cache[3] = withModifiers(() => {
1459
+ }, ["stop"])),
1460
+ onFocusout: onPanelFocusOut
1461
+ }, [
1462
+ createElementVNode("div", _hoisted_5$6, [
1463
+ (openBlock(), createElementBlock(Fragment, null, renderList(options, (option) => {
1464
+ return createElementVNode("div", {
1465
+ key: option.value,
1466
+ onClick: (e) => {
1467
+ if (e.target.tagName !== "INPUT") {
1468
+ handleOptionClick(option.value);
1469
+ }
1470
+ },
1471
+ class: "cursor-pointer"
1472
+ }, [
1473
+ createVNode(_sfc_main$p, {
1474
+ checked: currentOption.value === option.value,
1475
+ id: `tree-popover-${props.nodeId}-${option.value}`,
1476
+ name: `tree-popover-${props.nodeId}`,
1477
+ value: option.value,
1478
+ onChange: () => handleOptionClick(option.value),
1479
+ onBlur: closePopover,
1480
+ onKeydown: [
1481
+ withKeys(withModifiers(($event) => handleOptionClick(option.value), ["prevent"]), ["enter"]),
1482
+ withKeys(withModifiers(($event) => handleOptionClick(option.value), ["prevent"]), ["space"])
1483
+ ]
1484
+ }, {
1485
+ default: withCtx(() => [
1486
+ createTextVNode(toDisplayString(option.label), 1)
1487
+ ]),
1488
+ _: 2
1489
+ }, 1032, ["checked", "id", "name", "value", "onChange", "onKeydown"])
1490
+ ], 8, _hoisted_6$5);
1491
+ }), 64))
1492
+ ]),
1493
+ createVNode(_sfc_main$r, {
1494
+ icon: "cross",
1495
+ id: "tree-popover-close-button",
1496
+ size: "24px",
1497
+ onClick: _cache[2] || (_cache[2] = ($event) => closePopover()),
1498
+ class: "fill-blue-500",
1499
+ ariaLabel: "Stäng"
1500
+ })
1501
+ ], 36)
1502
+ ], 4)) : createCommentVNode("", true)
1503
+ ]),
1504
+ _: 1
1505
+ })
1488
1506
  ])) : createCommentVNode("", true)
1489
1507
  ])
1490
1508
  ], 4),
1491
- unref(expandedNodes).has(props.nodeId) ? (openBlock(), createElementBlock("div", _hoisted_6$5, [
1509
+ unref(expandedNodes).has(props.nodeId) ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
1492
1510
  (openBlock(true), createElementBlock(Fragment, null, renderList(filteredNodes.value, (child) => {
1493
1511
  return openBlock(), createBlock(_component_TreeNode, {
1494
1512
  key: child.nodeId,
@@ -1661,12 +1679,17 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1661
1679
  }
1662
1680
  emit("click", ev);
1663
1681
  }
1682
+ const linkAttrs = computed(() => {
1683
+ if (props.as === "a") return { href: props.href };
1684
+ if (props.as === "router-link") return { to: props.href };
1685
+ return {};
1686
+ });
1664
1687
  return (_ctx, _cache) => {
1665
1688
  return openBlock(), createElementBlock("div", {
1666
1689
  class: normalizeClass(rootClasses.value),
1667
1690
  "aria-disabled": _ctx.disabled ? "true" : null
1668
1691
  }, [
1669
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ href: _ctx.as === "a" ? _ctx.href : void 0, to: _ctx.as === "router-link" ? _ctx.href : void 0 }, {
1692
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps(linkAttrs.value, {
1670
1693
  type: _ctx.as === "button" ? _ctx.type : void 0,
1671
1694
  disabled: _ctx.as === "button" ? _ctx.disabled : void 0,
1672
1695
  class: buttonClasses.value,
@@ -2172,18 +2195,22 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2172
2195
  }
2173
2196
  emit("click", ev);
2174
2197
  }
2198
+ const linkAttrs = computed(() => {
2199
+ if (props.as === "a") return { href: props.href };
2200
+ if (props.as === "router-link") return { to: props.href };
2201
+ return {};
2202
+ });
2175
2203
  return (_ctx, _cache) => {
2176
2204
  return openBlock(), createElementBlock("div", {
2177
2205
  class: normalizeClass(rootClasses.value),
2178
2206
  "aria-disabled": _ctx.disabled ? "true" : null
2179
2207
  }, [
2180
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), {
2181
- href: _ctx.as === "a" ? _ctx.href : void 0,
2208
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps(linkAttrs.value, {
2182
2209
  type: _ctx.as === "button" ? _ctx.type : void 0,
2183
2210
  disabled: _ctx.as === "button" ? _ctx.disabled : void 0,
2184
- class: normalizeClass(buttonClasses.value),
2211
+ class: buttonClasses.value,
2185
2212
  onClick
2186
- }, {
2213
+ }), {
2187
2214
  default: withCtx(() => [
2188
2215
  _ctx.loading ? (openBlock(), createBlock(_sfc_main$n, {
2189
2216
  key: 0,
@@ -2204,7 +2231,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2204
2231
  createTextVNode(" " + toDisplayString(_ctx.text), 1)
2205
2232
  ]),
2206
2233
  _: 1
2207
- }, 8, ["href", "type", "disabled", "class"]))
2234
+ }, 16, ["type", "disabled", "class"]))
2208
2235
  ], 10, _hoisted_1$d);
2209
2236
  };
2210
2237
  }
@@ -2261,18 +2288,22 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2261
2288
  }
2262
2289
  emit("click", ev);
2263
2290
  }
2291
+ const linkAttrs = computed(() => {
2292
+ if (props.as === "a") return { href: props.href };
2293
+ if (props.as === "router-link") return { to: props.href };
2294
+ return {};
2295
+ });
2264
2296
  return (_ctx, _cache) => {
2265
2297
  return openBlock(), createElementBlock("div", {
2266
2298
  class: normalizeClass(rootClasses.value),
2267
2299
  "aria-disabled": _ctx.disabled ? "true" : null
2268
2300
  }, [
2269
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), {
2270
- href: _ctx.as === "a" ? _ctx.href : void 0,
2301
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps(linkAttrs.value, {
2271
2302
  type: _ctx.as === "button" ? _ctx.type : void 0,
2272
2303
  disabled: _ctx.as === "button" ? _ctx.disabled : void 0,
2273
- class: normalizeClass(buttonClasses.value),
2304
+ class: buttonClasses.value,
2274
2305
  onClick
2275
- }, {
2306
+ }), {
2276
2307
  default: withCtx(() => [
2277
2308
  _ctx.loading ? (openBlock(), createBlock(_sfc_main$n, {
2278
2309
  key: 0,
@@ -2293,7 +2324,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2293
2324
  createTextVNode(" " + toDisplayString(_ctx.text), 1)
2294
2325
  ]),
2295
2326
  _: 1
2296
- }, 8, ["href", "type", "disabled", "class"]))
2327
+ }, 16, ["type", "disabled", "class"]))
2297
2328
  ], 10, _hoisted_1$c);
2298
2329
  };
2299
2330
  }