@agnos-ui/core 0.9.3 → 0.10.0-next.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.
Files changed (108) hide show
  1. package/{accordion-CoM4efp-.js → accordion-CcirvrjR.js} +10 -15
  2. package/{accordion-cR5JqWJ8.cjs → accordion-yD-czBna.cjs} +10 -15
  3. package/{alert-DtDozJal.cjs → alert-B-jQDQcB.cjs} +1 -1
  4. package/{alert-YIlqdEPO.js → alert-gGz2CDS9.js} +1 -1
  5. package/{collapse-DwXz2kNw.js → collapse-BV4kD3j9.js} +2 -2
  6. package/{collapse-DRp53EuG.cjs → collapse-gLiT080Y.cjs} +2 -2
  7. package/{common-BToNPUDq.cjs → common-D3QcdJ6S.cjs} +1 -1
  8. package/{common-BqUjUBPy.js → common-DK0ADNTX.js} +1 -1
  9. package/components/accordion/index.cjs +1 -1
  10. package/components/accordion/index.js +1 -1
  11. package/components/alert/index.cjs +1 -1
  12. package/components/alert/index.js +1 -1
  13. package/components/carousel/index.cjs +10 -23
  14. package/components/carousel/index.js +10 -23
  15. package/components/collapse/index.cjs +1 -1
  16. package/components/collapse/index.js +1 -1
  17. package/components/drawer/drawer.d.ts +222 -0
  18. package/components/drawer/index.cjs +5 -0
  19. package/components/drawer/index.d.ts +1 -0
  20. package/components/drawer/index.js +5 -0
  21. package/components/modal/index.cjs +2 -1
  22. package/components/modal/index.js +2 -1
  23. package/components/modal/modal.d.ts +5 -0
  24. package/components/pagination/index.cjs +1 -1
  25. package/components/pagination/index.js +1 -1
  26. package/components/progressbar/index.cjs +1 -1
  27. package/components/progressbar/index.js +1 -1
  28. package/components/rating/index.cjs +1 -1
  29. package/components/rating/index.js +1 -1
  30. package/components/select/index.cjs +1 -1
  31. package/components/select/index.js +1 -1
  32. package/components/slider/index.cjs +1 -1
  33. package/components/slider/index.js +1 -1
  34. package/components/toast/index.cjs +1 -1
  35. package/components/toast/index.js +1 -1
  36. package/components/tree/index.cjs +1 -1
  37. package/components/tree/index.js +1 -1
  38. package/config.cjs +2 -2
  39. package/config.d.ts +5 -0
  40. package/config.js +2 -2
  41. package/{dom-gfxqXJpK.js → dom-Bcg9ORcA.js} +64 -54
  42. package/{dom-CuBx1JPZ.cjs → dom-C2gi9OCP.cjs} +47 -37
  43. package/drawer-D5SO73ew.js +251 -0
  44. package/drawer-DP7UPojk.cjs +250 -0
  45. package/index.cjs +19 -13
  46. package/index.d.ts +1 -0
  47. package/index.js +36 -30
  48. package/isFocusable-Ckwus82R.js +32 -0
  49. package/isFocusable-DfzDLeAN.cjs +31 -0
  50. package/{modal-D3wGIDlj.js → modal-CAvQW-vo.js} +26 -32
  51. package/{modal-BEnQ6c5M.cjs → modal-DiXZXYjR.cjs} +27 -33
  52. package/package.json +1 -1
  53. package/{pagination-B97wBLok.js → pagination-BKbMROV6.js} +4 -4
  54. package/{pagination-C1TT-oea.cjs → pagination-DvZ2rLsz.cjs} +4 -4
  55. package/{progressbar-BWBlRk_Y.js → progressbar-D8zIcm9n.js} +2 -2
  56. package/{progressbar-CRvhNB5R.cjs → progressbar-i9xfAxb7.cjs} +2 -2
  57. package/{promise-XSP94FjG.js → promise-Y53vc4Ia.js} +5 -5
  58. package/{rating-BXvy9kXq.js → rating-DEXTGWCU.js} +2 -2
  59. package/{rating-DAb6nR67.cjs → rating-DmG4oUkr.cjs} +2 -2
  60. package/scrollbars-CT87iv_6.cjs +30 -0
  61. package/scrollbars-CcxSrnCx.js +31 -0
  62. package/{select-BdjpnE7_.js → select-Bw68Xdu5.js} +4 -5
  63. package/{select-C0rJJQfl.cjs → select-MFjAnIt7.cjs} +4 -5
  64. package/services/extendWidget.cjs +2 -2
  65. package/services/extendWidget.js +2 -2
  66. package/services/floatingUI.cjs +8 -29
  67. package/services/floatingUI.js +9 -30
  68. package/services/focusElement.cjs +46 -0
  69. package/services/focusElement.d.ts +9 -0
  70. package/services/focusElement.js +46 -0
  71. package/services/focustrack.cjs +1 -1
  72. package/services/focustrack.js +1 -1
  73. package/services/matchMedia.cjs +1 -1
  74. package/services/matchMedia.js +1 -1
  75. package/services/navManager.cjs +7 -37
  76. package/services/navManager.js +6 -36
  77. package/services/portal.cjs +7 -10
  78. package/services/portal.js +7 -10
  79. package/services/resizeObserver.cjs +2 -2
  80. package/services/resizeObserver.js +2 -2
  81. package/services/siblingsInert.cjs +9 -8
  82. package/services/siblingsInert.d.ts +13 -3
  83. package/services/siblingsInert.js +9 -8
  84. package/services/transitions/baseTransitions.cjs +9 -10
  85. package/services/transitions/baseTransitions.js +10 -11
  86. package/services/transitions/collapse.cjs +1 -1
  87. package/services/transitions/collapse.js +1 -1
  88. package/services/transitions/cssTransitions.cjs +1 -1
  89. package/services/transitions/cssTransitions.js +2 -2
  90. package/services/transitions/simpleClassTransition.cjs +1 -1
  91. package/services/transitions/simpleClassTransition.js +1 -1
  92. package/{slider-BmxQ3A_u.js → slider-Cx50Eghd.js} +14 -24
  93. package/{slider-DSx5CAce.cjs → slider-Dl4Trh32.cjs} +14 -24
  94. package/toaster-UDglac7x.cjs +187 -0
  95. package/toaster-_p1GTtHI.js +188 -0
  96. package/{tree-BFrXdJox.js → tree-DV0tfPlZ.js} +7 -11
  97. package/{tree-Pvr2rZ-D.cjs → tree-rGHtmCnS.cjs} +7 -11
  98. package/utils/directive.cjs +3 -1
  99. package/utils/directive.d.ts +47 -0
  100. package/utils/directive.js +14 -12
  101. package/utils/stores.cjs +8 -9
  102. package/utils/stores.js +8 -9
  103. package/utils/writables.cjs +1 -1
  104. package/utils/writables.js +1 -1
  105. package/{writables-Bn3uhKEG.cjs → writables-DcGT98a7.cjs} +1 -1
  106. package/{writables-CgpOQ4hA.js → writables-e0tyaQpe.js} +1 -1
  107. package/toaster-Cayg6Lbq.cjs +0 -209
  108. package/toaster-XfzHDqz_.js +0 -210
@@ -1,6 +1,16 @@
1
1
  import type { Directive } from '../types';
2
2
  /**
3
- * A directive that sets the `inert` attribute on all sibling elements of the given element recursively up the DOM tree,
4
- * excluding the element itself and any `<script>` elements.
3
+ * Directive to manage focus trapping by setting the `inert` attribute on sibling elements.
4
+ * This is useful for modal dialogs or overlays where interaction should be limited to a specific subtree.
5
+ *
6
+ * - Recursively traverses up the DOM tree.
7
+ * - Sets `inert` on all siblings except the target element and `<script>` tags.
8
+ * - Use `data-agnos-ignore-inert` to avoid inert attribute for a specified element.
9
+ *
10
+ * Takes boolean or undefined as value:
11
+ * - `true` or `undefined`: Apply inert to siblings.
12
+ * - `false`: Do not apply inert to siblings.
13
+ *
14
+ * Automatically reverts when the target element changes or is removed.
5
15
  */
6
- export declare const siblingsInert: Directive;
16
+ export declare const siblingsInert: Directive<boolean | undefined>;
@@ -1,13 +1,14 @@
1
1
  import { computed } from "@amadeus-it-group/tansu";
2
+ import { j as createConditionalBrowserStoreArrayDirective, n as mergeDirectives, d as directiveSubscribe } from "../dom-Bcg9ORcA.js";
2
3
  import { noop } from "../utils/func.js";
3
- import { g as createBrowserStoreArrayDirective, k as mergeDirectives, d as directiveSubscribe } from "../dom-gfxqXJpK.js";
4
- const internalSetSiblingsInert = (element) => {
4
+ const ignoreInertAttributeName = "data-agnos-ignore-inert";
5
+ const applyInertToSiblingsRecursively = (element) => {
5
6
  const inertValues = /* @__PURE__ */ new Map();
6
7
  const recursiveHelper = (element2) => {
7
8
  const parent = element2.parentElement;
8
9
  if (parent && element2 !== document.body) {
9
10
  Array.from(parent.children).forEach((sibling) => {
10
- if (sibling !== element2 && sibling.nodeName !== "SCRIPT") {
11
+ if (sibling !== element2 && sibling.nodeName !== "SCRIPT" && !sibling.hasAttribute(ignoreInertAttributeName)) {
11
12
  inertValues.set(sibling, sibling.hasAttribute("inert"));
12
13
  sibling.toggleAttribute("inert", true);
13
14
  }
@@ -23,18 +24,18 @@ const internalSetSiblingsInert = (element) => {
23
24
  let internalRevert = noop;
24
25
  const setSiblingsInert = (element) => {
25
26
  internalRevert();
26
- internalRevert = element ? internalSetSiblingsInert(element) : noop;
27
+ internalRevert = element ? applyInertToSiblingsRecursively(element) : noop;
27
28
  };
28
- const { directive: storeArrayDirective, elements$ } = createBrowserStoreArrayDirective();
29
- const lastElement$ = computed(
29
+ const { directive: storeArrayDirective, elements$ } = createConditionalBrowserStoreArrayDirective();
30
+ const lastTrackedElement$ = computed(
30
31
  () => {
31
32
  const elements = elements$();
32
33
  return elements[elements.length - 1];
33
34
  },
34
35
  { equal: Object.is }
35
36
  );
36
- const inertAction$ = computed(() => setSiblingsInert(lastElement$()));
37
- const siblingsInert = mergeDirectives(storeArrayDirective, directiveSubscribe(inertAction$));
37
+ const updateInertState$ = computed(() => setSiblingsInert(lastTrackedElement$()));
38
+ const siblingsInert = mergeDirectives(storeArrayDirective, directiveSubscribe(updateInertState$));
38
39
  export {
39
40
  siblingsInert
40
41
  };
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const tansu = require("@amadeus-it-group/tansu");
4
- const utils_writables = require("../../writables-Bn3uhKEG.cjs");
4
+ const utils_writables = require("../../writables-DcGT98a7.cjs");
5
5
  const promise = require("../../promise-CxCD3NYv.cjs");
6
6
  const utils_func = require("../../utils/func.cjs");
7
7
  const utils_stores = require("../../utils/stores.cjs");
8
- const utils_directive = require("../../dom-CuBx1JPZ.cjs");
8
+ const utils_directive = require("../../dom-C2gi9OCP.cjs");
9
9
  const neverEndingPromise = new Promise(utils_func.noop);
10
10
  const noAnimation = (element, direction) => {
11
11
  element.style.display = direction === "show" ? "" : "none";
@@ -41,8 +41,8 @@ const createTransition = (config) => {
41
41
  const stop = () => {
42
42
  let context;
43
43
  currentTransition$.update((currentTransition) => {
44
- currentTransition == null ? void 0 : currentTransition.abort.abort();
45
- context = currentTransition == null ? void 0 : currentTransition.context;
44
+ currentTransition?.abort.abort();
45
+ context = currentTransition?.context;
46
46
  return null;
47
47
  });
48
48
  return context;
@@ -64,7 +64,6 @@ const createTransition = (config) => {
64
64
  currentTransition$.set(currentTransition);
65
65
  resolve(
66
66
  (async () => {
67
- var _a;
68
67
  try {
69
68
  await transitionFn(element, visible ? "show" : "hide", animated, signal, context);
70
69
  } finally {
@@ -72,7 +71,7 @@ const createTransition = (config) => {
72
71
  await neverEndingPromise;
73
72
  } else {
74
73
  currentTransition$.set(null);
75
- (_a = (visible ? onShown$ : onHidden$)()) == null ? void 0 : _a();
74
+ (visible ? onShown$ : onHidden$)()?.();
76
75
  }
77
76
  }
78
77
  })()
@@ -100,9 +99,9 @@ const createTransition = (config) => {
100
99
  if (visibleChanged || animationFromToggle != null) {
101
100
  pendingTransition = null;
102
101
  }
103
- const animate = animationFromToggle ?? (pendingTransition == null ? void 0 : pendingTransition.animated) ?? (elementChanged && !visible ? false : animated);
102
+ const animate = animationFromToggle ?? pendingTransition?.animated ?? (elementChanged && !visible ? false : animated);
104
103
  currentTransition = runTransition(visible, animate, element, transition);
105
- pendingTransition == null ? void 0 : pendingTransition.resolve(currentTransition.promise);
104
+ pendingTransition?.resolve(currentTransition.promise);
106
105
  pendingTransition = null;
107
106
  }
108
107
  } else {
@@ -110,7 +109,7 @@ const createTransition = (config) => {
110
109
  stop();
111
110
  currentTransition = null;
112
111
  }
113
- if (visibleChanged || visible && (pendingTransition == null ? void 0 : pendingTransition.animated) !== animationFromToggle) {
112
+ if (visibleChanged || visible && pendingTransition?.animated !== animationFromToggle) {
114
113
  pendingTransition = visible && animationFromToggle != null ? {
115
114
  // toggle was called to display the element, but the element is not yet in the DOM
116
115
  // let's keep the animation setting from toggle and provide the promise for the end of toggle
@@ -119,7 +118,7 @@ const createTransition = (config) => {
119
118
  } : null;
120
119
  }
121
120
  }
122
- return (pendingTransition == null ? void 0 : pendingTransition.promise) ?? (currentTransition == null ? void 0 : currentTransition.promise);
121
+ return pendingTransition?.promise ?? currentTransition?.promise;
123
122
  }
124
123
  );
125
124
  let lastToggle = {};
@@ -1,9 +1,9 @@
1
1
  import { computed, writable, derived, batch } from "@amadeus-it-group/tansu";
2
- import { d as typeBooleanOrNull, g as typeFunction, c as typeBoolean } from "../../writables-CgpOQ4hA.js";
3
- import { c as promiseWithResolve } from "../../promise-XSP94FjG.js";
2
+ import { d as typeBooleanOrNull, g as typeFunction, c as typeBoolean } from "../../writables-e0tyaQpe.js";
3
+ import { d as promiseWithResolve } from "../../promise-Y53vc4Ia.js";
4
4
  import { noop } from "../../utils/func.js";
5
5
  import { writablesForProps, bindableDerived, stateStores } from "../../utils/stores.js";
6
- import { h as createStoreDirective, k as mergeDirectives, d as directiveSubscribe } from "../../dom-gfxqXJpK.js";
6
+ import { k as createStoreDirective, n as mergeDirectives, d as directiveSubscribe } from "../../dom-Bcg9ORcA.js";
7
7
  const neverEndingPromise = new Promise(noop);
8
8
  const noAnimation = (element, direction) => {
9
9
  element.style.display = direction === "show" ? "" : "none";
@@ -39,8 +39,8 @@ const createTransition = (config) => {
39
39
  const stop = () => {
40
40
  let context;
41
41
  currentTransition$.update((currentTransition) => {
42
- currentTransition == null ? void 0 : currentTransition.abort.abort();
43
- context = currentTransition == null ? void 0 : currentTransition.context;
42
+ currentTransition?.abort.abort();
43
+ context = currentTransition?.context;
44
44
  return null;
45
45
  });
46
46
  return context;
@@ -62,7 +62,6 @@ const createTransition = (config) => {
62
62
  currentTransition$.set(currentTransition);
63
63
  resolve(
64
64
  (async () => {
65
- var _a;
66
65
  try {
67
66
  await transitionFn(element, visible ? "show" : "hide", animated, signal, context);
68
67
  } finally {
@@ -70,7 +69,7 @@ const createTransition = (config) => {
70
69
  await neverEndingPromise;
71
70
  } else {
72
71
  currentTransition$.set(null);
73
- (_a = (visible ? onShown$ : onHidden$)()) == null ? void 0 : _a();
72
+ (visible ? onShown$ : onHidden$)()?.();
74
73
  }
75
74
  }
76
75
  })()
@@ -98,9 +97,9 @@ const createTransition = (config) => {
98
97
  if (visibleChanged || animationFromToggle != null) {
99
98
  pendingTransition = null;
100
99
  }
101
- const animate = animationFromToggle ?? (pendingTransition == null ? void 0 : pendingTransition.animated) ?? (elementChanged && !visible ? false : animated);
100
+ const animate = animationFromToggle ?? pendingTransition?.animated ?? (elementChanged && !visible ? false : animated);
102
101
  currentTransition = runTransition(visible, animate, element, transition);
103
- pendingTransition == null ? void 0 : pendingTransition.resolve(currentTransition.promise);
102
+ pendingTransition?.resolve(currentTransition.promise);
104
103
  pendingTransition = null;
105
104
  }
106
105
  } else {
@@ -108,7 +107,7 @@ const createTransition = (config) => {
108
107
  stop();
109
108
  currentTransition = null;
110
109
  }
111
- if (visibleChanged || visible && (pendingTransition == null ? void 0 : pendingTransition.animated) !== animationFromToggle) {
110
+ if (visibleChanged || visible && pendingTransition?.animated !== animationFromToggle) {
112
111
  pendingTransition = visible && animationFromToggle != null ? {
113
112
  // toggle was called to display the element, but the element is not yet in the DOM
114
113
  // let's keep the animation setting from toggle and provide the promise for the end of toggle
@@ -117,7 +116,7 @@ const createTransition = (config) => {
117
116
  } : null;
118
117
  }
119
118
  }
120
- return (pendingTransition == null ? void 0 : pendingTransition.promise) ?? (currentTransition == null ? void 0 : currentTransition.promise);
119
+ return pendingTransition?.promise ?? currentTransition?.promise;
121
120
  }
122
121
  );
123
122
  let lastToggle = {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const utils_directive = require("../../dom-CuBx1JPZ.cjs");
3
+ const utils_directive = require("../../dom-C2gi9OCP.cjs");
4
4
  const services_transitions_cssTransitions = require("./cssTransitions.cjs");
5
5
  const createCollapseTransition = ({
6
6
  dimension = "height",
@@ -1,4 +1,4 @@
1
- import { i as isBrowserHTMLElement, v as removeClasses, w as addClasses, x as reflow } from "../../dom-gfxqXJpK.js";
1
+ import { i as isBrowserHTMLElement, x as removeClasses, y as addClasses, z as reflow } from "../../dom-Bcg9ORcA.js";
2
2
  import { createCSSTransition } from "./cssTransitions.js";
3
3
  const createCollapseTransition = ({
4
4
  dimension = "height",
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const utils_directive = require("../../dom-CuBx1JPZ.cjs");
3
+ const utils_directive = require("../../dom-C2gi9OCP.cjs");
4
4
  const utils_func = require("../../utils/func.cjs");
5
5
  const promise = require("../../promise-CxCD3NYv.cjs");
6
6
  function hasTransition(element) {
@@ -1,6 +1,6 @@
1
- import { i as isBrowserHTMLElement } from "../../dom-gfxqXJpK.js";
1
+ import { i as isBrowserHTMLElement } from "../../dom-Bcg9ORcA.js";
2
2
  import { noop } from "../../utils/func.js";
3
- import { a as promiseFromEvent, b as promiseFromTimeout } from "../../promise-XSP94FjG.js";
3
+ import { b as promiseFromEvent, c as promiseFromTimeout } from "../../promise-Y53vc4Ia.js";
4
4
  function hasTransition(element) {
5
5
  return window.getComputedStyle(element).transitionProperty !== "none";
6
6
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const services_transitions_cssTransitions = require("./cssTransitions.cjs");
4
- const utils_directive = require("../../dom-CuBx1JPZ.cjs");
4
+ const utils_directive = require("../../dom-C2gi9OCP.cjs");
5
5
  const createSimpleClassTransition = (config) => {
6
6
  const { animationPendingClasses, animationPendingShowClasses, animationPendingHideClasses, showClasses, hideClasses } = config;
7
7
  return services_transitions_cssTransitions.createCSSTransition((element, direction, animated, context) => {
@@ -1,5 +1,5 @@
1
1
  import { createCSSTransition } from "./cssTransitions.js";
2
- import { v as removeClasses, w as addClasses, x as reflow } from "../../dom-gfxqXJpK.js";
2
+ import { x as removeClasses, y as addClasses, z as reflow } from "../../dom-Bcg9ORcA.js";
3
3
  const createSimpleClassTransition = (config) => {
4
4
  const { animationPendingClasses, animationPendingShowClasses, animationPendingHideClasses, showClasses, hideClasses } = config;
5
5
  return createCSSTransition((element, direction, animated, context) => {
@@ -1,18 +1,17 @@
1
1
  import { computed, writable, readable } from "@amadeus-it-group/tansu";
2
- import { j as createBrowserStoreDirective, g as createBrowserStoreArrayDirective, k as mergeDirectives, n as createAttributesDirective, b as browserDirective } from "./dom-gfxqXJpK.js";
2
+ import { l as createBrowserStoreDirective, h as createBrowserStoreArrayDirective, n as mergeDirectives, p as createAttributesDirective, b as browserDirective } from "./dom-Bcg9ORcA.js";
3
3
  import { noop } from "./utils/func.js";
4
4
  import { writablesForProps, bindableProp, stateStores, true$ } from "./utils/stores.js";
5
- import { i as typeArray, c as typeBoolean, b as typeNumberInRangeFactory, e as typeString, g as typeFunction, a as typeNumber } from "./writables-CgpOQ4hA.js";
5
+ import { i as typeArray, c as typeBoolean, b as typeNumberInRangeFactory, e as typeString, g as typeFunction, a as typeNumber } from "./writables-e0tyaQpe.js";
6
6
  import { createResizeObserver } from "./services/resizeObserver.js";
7
7
  import { createWidgetFactory } from "./utils/widget.js";
8
8
  const decimalRegExp = /(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/;
9
9
  function getDecimalPrecision(number) {
10
- var _a;
11
10
  const matches = ("" + number).match(decimalRegExp);
12
11
  return Math.max(
13
12
  0,
14
13
  // Number of digits right of decimal point.
15
- (((_a = matches[1]) == null ? void 0 : _a.length) ?? 0) - // Adjust for exponential notation.
14
+ (matches[1]?.length ?? 0) - // Adjust for exponential notation.
16
15
  (+matches[2] || 0)
17
16
  );
18
17
  }
@@ -255,10 +254,9 @@ const createSlider = createWidgetFactory("slider", (config) => {
255
254
  );
256
255
  const sliderDomRect$ = computed(
257
256
  () => {
258
- var _a;
259
257
  dimensions$();
260
258
  updateSliderSize$();
261
- return ((_a = sliderDom$()) == null ? void 0 : _a.getBoundingClientRect()) ?? {};
259
+ return sliderDom$()?.getBoundingClientRect() ?? {};
262
260
  },
263
261
  {
264
262
  equal: Object.is
@@ -266,10 +264,9 @@ const createSlider = createWidgetFactory("slider", (config) => {
266
264
  );
267
265
  const minLabelDomRect$ = computed(
268
266
  () => {
269
- var _a;
270
267
  dimensions$();
271
268
  updateSliderSize$();
272
- return ((_a = minLabelDom$()) == null ? void 0 : _a.getBoundingClientRect()) ?? {};
269
+ return minLabelDom$()?.getBoundingClientRect() ?? {};
273
270
  },
274
271
  {
275
272
  equal: (a, b) => Object.is(a, b)
@@ -277,10 +274,9 @@ const createSlider = createWidgetFactory("slider", (config) => {
277
274
  );
278
275
  const maxLabelDomRect$ = computed(
279
276
  () => {
280
- var _a;
281
277
  dimensions$();
282
278
  updateSliderSize$();
283
- return ((_a = maxLabelDom$()) == null ? void 0 : _a.getBoundingClientRect()) ?? {};
279
+ return maxLabelDom$()?.getBoundingClientRect() ?? {};
284
280
  },
285
281
  {
286
282
  equal: (a, b) => Object.is(a, b)
@@ -318,16 +314,10 @@ const createSlider = createWidgetFactory("slider", (config) => {
318
314
  const adjustedShowValueLabels$ = computed(() => showValueLabels$() && (!showTicks$() || !showTickValues$()));
319
315
  const pixelToPercent = (pixels) => pixels ? pixels / sliderDomRectSize$() * 100 : 0;
320
316
  const combinedLabelSize$ = computed(
321
- () => {
322
- var _a, _b;
323
- return pixelToPercent(vertical$() ? (_a = combinedLabelDom$()) == null ? void 0 : _a.getBoundingClientRect().height : (_b = combinedLabelDom$()) == null ? void 0 : _b.getBoundingClientRect().width);
324
- }
317
+ () => pixelToPercent(vertical$() ? combinedLabelDom$()?.getBoundingClientRect().height : combinedLabelDom$()?.getBoundingClientRect().width)
325
318
  );
326
319
  const combinedLabelPosition$ = computed(() => vertical$() ? combinedLabelPositionTop$() : combinedLabelPositionLeft$());
327
- const currentLabelSizeByIndex = (index) => {
328
- var _a, _b;
329
- return pixelToPercent(vertical$() ? (_a = currentLabelDomsRect$()[index]) == null ? void 0 : _a.height : (_b = currentLabelDomsRect$()[index]) == null ? void 0 : _b.width);
330
- };
320
+ const currentLabelSizeByIndex = (index) => pixelToPercent(vertical$() ? currentLabelDomsRect$()[index]?.height : currentLabelDomsRect$()[index]?.width);
331
321
  const minValueLabelDisplay$ = computed(() => {
332
322
  if (!showMinMaxLabels$() || showTicks$() && showTickValues$()) {
333
323
  return false;
@@ -369,8 +359,8 @@ const createSlider = createWidgetFactory("slider", (config) => {
369
359
  storedLabelSize$.set(values.map((_, index) => currentLabelSizeByIndex(index) / 2));
370
360
  }
371
361
  const storedLabelSize = storedLabelSize$();
372
- const firstLabelSize = (storedLabelSize == null ? void 0 : storedLabelSize[0]) ?? 0;
373
- const secondLabelSize = (storedLabelSize == null ? void 0 : storedLabelSize[1]) ?? 0;
362
+ const firstLabelSize = storedLabelSize?.[0] ?? 0;
363
+ const secondLabelSize = storedLabelSize?.[1] ?? 0;
374
364
  const biggestLabelSize = Math.max(firstLabelSize, secondLabelSize);
375
365
  const intersectionLimit = biggestLabelSize !== 50 ? biggestLabelSize * 2 + 2 : 15;
376
366
  return values.length == 2 && values[1] - secondLabelSize - values[0] + firstLabelSize < intersectionLimit;
@@ -567,7 +557,7 @@ const createSlider = createWidgetFactory("slider", (config) => {
567
557
  const handleDrag = (e) => {
568
558
  e.preventDefault();
569
559
  const newCoord = vertical$() ? e.clientY : e.clientX;
570
- currentTarget == null ? void 0 : currentTarget.focus();
560
+ currentTarget?.focus();
571
561
  if (_prevCoordinate !== newCoord) {
572
562
  _prevCoordinate = newCoord;
573
563
  adjustCoordinate(newCoord, handleId);
@@ -575,7 +565,7 @@ const createSlider = createWidgetFactory("slider", (config) => {
575
565
  };
576
566
  if (interactive$()) {
577
567
  updateSliderSize$.set({});
578
- currentTarget == null ? void 0 : currentTarget.focus();
568
+ currentTarget?.focus();
579
569
  document.addEventListener("mousemove", handleDrag);
580
570
  document.addEventListener(
581
571
  "mouseup",
@@ -591,7 +581,7 @@ const createSlider = createWidgetFactory("slider", (config) => {
591
581
  const handleDrag = (e) => {
592
582
  e.preventDefault();
593
583
  const newCoord = vertical$() ? e.touches[0].clientY : e.touches[0].clientX;
594
- currentTarget == null ? void 0 : currentTarget.focus();
584
+ currentTarget?.focus();
595
585
  if (_prevCoordinate !== newCoord) {
596
586
  _prevCoordinate = newCoord;
597
587
  adjustCoordinate(newCoord, handleId);
@@ -599,7 +589,7 @@ const createSlider = createWidgetFactory("slider", (config) => {
599
589
  };
600
590
  if (interactive$()) {
601
591
  updateSliderSize$.set({});
602
- currentTarget == null ? void 0 : currentTarget.focus();
592
+ currentTarget?.focus();
603
593
  document.addEventListener("touchmove", handleDrag, { passive: false });
604
594
  document.addEventListener(
605
595
  "touchend",
@@ -1,19 +1,18 @@
1
1
  "use strict";
2
2
  const tansu = require("@amadeus-it-group/tansu");
3
- const utils_directive = require("./dom-CuBx1JPZ.cjs");
3
+ const utils_directive = require("./dom-C2gi9OCP.cjs");
4
4
  const utils_func = require("./utils/func.cjs");
5
5
  const utils_stores = require("./utils/stores.cjs");
6
- const utils_writables = require("./writables-Bn3uhKEG.cjs");
6
+ const utils_writables = require("./writables-DcGT98a7.cjs");
7
7
  const services_resizeObserver = require("./services/resizeObserver.cjs");
8
8
  const utils_widget = require("./utils/widget.cjs");
9
9
  const decimalRegExp = /(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/;
10
10
  function getDecimalPrecision(number) {
11
- var _a;
12
11
  const matches = ("" + number).match(decimalRegExp);
13
12
  return Math.max(
14
13
  0,
15
14
  // Number of digits right of decimal point.
16
- (((_a = matches[1]) == null ? void 0 : _a.length) ?? 0) - // Adjust for exponential notation.
15
+ (matches[1]?.length ?? 0) - // Adjust for exponential notation.
17
16
  (+matches[2] || 0)
18
17
  );
19
18
  }
@@ -256,10 +255,9 @@ const createSlider = utils_widget.createWidgetFactory("slider", (config) => {
256
255
  );
257
256
  const sliderDomRect$ = tansu.computed(
258
257
  () => {
259
- var _a;
260
258
  dimensions$();
261
259
  updateSliderSize$();
262
- return ((_a = sliderDom$()) == null ? void 0 : _a.getBoundingClientRect()) ?? {};
260
+ return sliderDom$()?.getBoundingClientRect() ?? {};
263
261
  },
264
262
  {
265
263
  equal: Object.is
@@ -267,10 +265,9 @@ const createSlider = utils_widget.createWidgetFactory("slider", (config) => {
267
265
  );
268
266
  const minLabelDomRect$ = tansu.computed(
269
267
  () => {
270
- var _a;
271
268
  dimensions$();
272
269
  updateSliderSize$();
273
- return ((_a = minLabelDom$()) == null ? void 0 : _a.getBoundingClientRect()) ?? {};
270
+ return minLabelDom$()?.getBoundingClientRect() ?? {};
274
271
  },
275
272
  {
276
273
  equal: (a, b) => Object.is(a, b)
@@ -278,10 +275,9 @@ const createSlider = utils_widget.createWidgetFactory("slider", (config) => {
278
275
  );
279
276
  const maxLabelDomRect$ = tansu.computed(
280
277
  () => {
281
- var _a;
282
278
  dimensions$();
283
279
  updateSliderSize$();
284
- return ((_a = maxLabelDom$()) == null ? void 0 : _a.getBoundingClientRect()) ?? {};
280
+ return maxLabelDom$()?.getBoundingClientRect() ?? {};
285
281
  },
286
282
  {
287
283
  equal: (a, b) => Object.is(a, b)
@@ -319,16 +315,10 @@ const createSlider = utils_widget.createWidgetFactory("slider", (config) => {
319
315
  const adjustedShowValueLabels$ = tansu.computed(() => showValueLabels$() && (!showTicks$() || !showTickValues$()));
320
316
  const pixelToPercent = (pixels) => pixels ? pixels / sliderDomRectSize$() * 100 : 0;
321
317
  const combinedLabelSize$ = tansu.computed(
322
- () => {
323
- var _a, _b;
324
- return pixelToPercent(vertical$() ? (_a = combinedLabelDom$()) == null ? void 0 : _a.getBoundingClientRect().height : (_b = combinedLabelDom$()) == null ? void 0 : _b.getBoundingClientRect().width);
325
- }
318
+ () => pixelToPercent(vertical$() ? combinedLabelDom$()?.getBoundingClientRect().height : combinedLabelDom$()?.getBoundingClientRect().width)
326
319
  );
327
320
  const combinedLabelPosition$ = tansu.computed(() => vertical$() ? combinedLabelPositionTop$() : combinedLabelPositionLeft$());
328
- const currentLabelSizeByIndex = (index) => {
329
- var _a, _b;
330
- return pixelToPercent(vertical$() ? (_a = currentLabelDomsRect$()[index]) == null ? void 0 : _a.height : (_b = currentLabelDomsRect$()[index]) == null ? void 0 : _b.width);
331
- };
321
+ const currentLabelSizeByIndex = (index) => pixelToPercent(vertical$() ? currentLabelDomsRect$()[index]?.height : currentLabelDomsRect$()[index]?.width);
332
322
  const minValueLabelDisplay$ = tansu.computed(() => {
333
323
  if (!showMinMaxLabels$() || showTicks$() && showTickValues$()) {
334
324
  return false;
@@ -370,8 +360,8 @@ const createSlider = utils_widget.createWidgetFactory("slider", (config) => {
370
360
  storedLabelSize$.set(values.map((_, index) => currentLabelSizeByIndex(index) / 2));
371
361
  }
372
362
  const storedLabelSize = storedLabelSize$();
373
- const firstLabelSize = (storedLabelSize == null ? void 0 : storedLabelSize[0]) ?? 0;
374
- const secondLabelSize = (storedLabelSize == null ? void 0 : storedLabelSize[1]) ?? 0;
363
+ const firstLabelSize = storedLabelSize?.[0] ?? 0;
364
+ const secondLabelSize = storedLabelSize?.[1] ?? 0;
375
365
  const biggestLabelSize = Math.max(firstLabelSize, secondLabelSize);
376
366
  const intersectionLimit = biggestLabelSize !== 50 ? biggestLabelSize * 2 + 2 : 15;
377
367
  return values.length == 2 && values[1] - secondLabelSize - values[0] + firstLabelSize < intersectionLimit;
@@ -568,7 +558,7 @@ const createSlider = utils_widget.createWidgetFactory("slider", (config) => {
568
558
  const handleDrag = (e) => {
569
559
  e.preventDefault();
570
560
  const newCoord = vertical$() ? e.clientY : e.clientX;
571
- currentTarget == null ? void 0 : currentTarget.focus();
561
+ currentTarget?.focus();
572
562
  if (_prevCoordinate !== newCoord) {
573
563
  _prevCoordinate = newCoord;
574
564
  adjustCoordinate(newCoord, handleId);
@@ -576,7 +566,7 @@ const createSlider = utils_widget.createWidgetFactory("slider", (config) => {
576
566
  };
577
567
  if (interactive$()) {
578
568
  updateSliderSize$.set({});
579
- currentTarget == null ? void 0 : currentTarget.focus();
569
+ currentTarget?.focus();
580
570
  document.addEventListener("mousemove", handleDrag);
581
571
  document.addEventListener(
582
572
  "mouseup",
@@ -592,7 +582,7 @@ const createSlider = utils_widget.createWidgetFactory("slider", (config) => {
592
582
  const handleDrag = (e) => {
593
583
  e.preventDefault();
594
584
  const newCoord = vertical$() ? e.touches[0].clientY : e.touches[0].clientX;
595
- currentTarget == null ? void 0 : currentTarget.focus();
585
+ currentTarget?.focus();
596
586
  if (_prevCoordinate !== newCoord) {
597
587
  _prevCoordinate = newCoord;
598
588
  adjustCoordinate(newCoord, handleId);
@@ -600,7 +590,7 @@ const createSlider = utils_widget.createWidgetFactory("slider", (config) => {
600
590
  };
601
591
  if (interactive$()) {
602
592
  updateSliderSize$.set({});
603
- currentTarget == null ? void 0 : currentTarget.focus();
593
+ currentTarget?.focus();
604
594
  document.addEventListener("touchmove", handleDrag, { passive: false });
605
595
  document.addEventListener(
606
596
  "touchend",