@agnos-ui/core 0.7.0 → 0.8.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 (88) hide show
  1. package/{accordion-Lp-LEbZ2.cjs → accordion-DTQj-TQ1.cjs} +16 -18
  2. package/{accordion-BGv150k9.js → accordion-hVi2XRk-.js} +12 -14
  3. package/{alert-DJ2l7bcA.js → alert-BSixS_cz.js} +1 -1
  4. package/{alert-Bq101evB.cjs → alert-BrVkxOnA.cjs} +1 -1
  5. package/{common-DvPjK7SS.cjs → common-CcQOJ_hf.cjs} +5 -6
  6. package/{common-Banw3FYN.js → common-CuZAeECD.js} +2 -3
  7. package/components/accordion/accordion.d.ts +1 -1
  8. package/components/accordion/index.cjs +1 -1
  9. package/components/accordion/index.js +1 -1
  10. package/components/alert/common.d.ts +1 -1
  11. package/components/alert/index.cjs +1 -1
  12. package/components/alert/index.js +1 -1
  13. package/components/modal/index.cjs +1 -1
  14. package/components/modal/index.js +1 -1
  15. package/components/modal/modal.d.ts +2 -2
  16. package/components/pagination/index.cjs +1 -1
  17. package/components/pagination/index.js +1 -1
  18. package/components/progressbar/index.cjs +1 -1
  19. package/components/progressbar/index.js +1 -1
  20. package/components/rating/index.cjs +1 -1
  21. package/components/rating/index.js +1 -1
  22. package/components/select/index.cjs +1 -1
  23. package/components/select/index.js +1 -1
  24. package/components/slider/index.cjs +1 -1
  25. package/components/slider/index.js +1 -1
  26. package/components/slider/slider.d.ts +84 -9
  27. package/components/toast/index.cjs +1 -1
  28. package/components/toast/index.js +1 -1
  29. package/components/tree/index.cjs +1 -1
  30. package/components/tree/index.js +1 -1
  31. package/config.cjs +3 -3
  32. package/config.js +1 -1
  33. package/{directive-CKEccryv.js → dom-BB9jLllr.js} +115 -102
  34. package/{directive-DdlwGFtf.cjs → dom-CuBx1JPZ.cjs} +116 -103
  35. package/index.cjs +14 -11
  36. package/index.js +15 -12
  37. package/{modal-DDHcrykD.cjs → modal-B7bYoubx.cjs} +12 -14
  38. package/{modal-DP-4I7vf.js → modal-BQcw6bnM.js} +6 -8
  39. package/package.json +4 -1
  40. package/{pagination-CBysiPUs.cjs → pagination-5YARuB3V.cjs} +8 -8
  41. package/{pagination-DwDRot6q.js → pagination-BwaZEokc.js} +8 -8
  42. package/{progressbar-DghzCJ6_.cjs → progressbar-BpSrg4HG.cjs} +2 -2
  43. package/{progressbar-CGmNq0cS.js → progressbar-b_kXzGPc.js} +3 -3
  44. package/{promise-CY2U8bTP.js → promise-CBh_HbSK.js} +1 -1
  45. package/{promise-BMJ8qhA8.cjs → promise-CxCD3NYv.cjs} +5 -5
  46. package/{rating-Da38uaZz.js → rating-B1JLZgIR.js} +8 -8
  47. package/{rating-DlfOuwuX.cjs → rating-C8tn9xTO.cjs} +9 -9
  48. package/{select-CAEPqdz1.js → select-Bb2RAVs0.js} +20 -20
  49. package/{select-LBVhNdrd.cjs → select-D1pBz4CM.cjs} +21 -21
  50. package/services/floatingUI.cjs +2 -2
  51. package/services/floatingUI.js +2 -2
  52. package/services/focustrack.cjs +1 -1
  53. package/services/focustrack.js +1 -1
  54. package/services/intersection.cjs +2 -2
  55. package/services/intersection.js +1 -1
  56. package/services/matchMedia.cjs +3 -2
  57. package/services/matchMedia.js +3 -2
  58. package/services/navManager.cjs +1 -1
  59. package/services/navManager.js +1 -1
  60. package/services/portal.cjs +1 -1
  61. package/services/portal.js +1 -1
  62. package/services/resizeObserver.cjs +3 -3
  63. package/services/resizeObserver.js +2 -2
  64. package/services/siblingsInert.cjs +4 -4
  65. package/services/siblingsInert.js +2 -2
  66. package/services/transitions/baseTransitions.cjs +7 -7
  67. package/services/transitions/baseTransitions.js +3 -3
  68. package/services/transitions/collapse.cjs +1 -1
  69. package/services/transitions/collapse.js +1 -1
  70. package/services/transitions/cssTransitions.cjs +4 -4
  71. package/services/transitions/cssTransitions.js +3 -3
  72. package/services/transitions/simpleClassTransition.cjs +1 -1
  73. package/services/transitions/simpleClassTransition.js +1 -1
  74. package/{slider-1OSwok7u.cjs → slider-B2JFXDLt.cjs} +125 -24
  75. package/{slider-6LI4-f5s.js → slider-C-BSdQ0b.js} +126 -25
  76. package/{toast-CpvsibAI.js → toast-Bw2QSzBX.js} +9 -8
  77. package/{toast-D_uSrRZL.cjs → toast-CaIcB2sD.cjs} +8 -7
  78. package/{tree-Bb5KFqXp.cjs → tree-D4t2SOql.cjs} +7 -7
  79. package/{tree-B2Mr8b31.js → tree-DWv0zwFJ.js} +8 -8
  80. package/utils/directive.cjs +2 -3
  81. package/utils/directive.d.ts +7 -5
  82. package/utils/directive.js +2 -3
  83. package/{func-Qd3cD9a3.cjs → utils/func.cjs} +1 -0
  84. package/{func-DR0n-ShK.js → utils/func.js} +2 -2
  85. package/utils/stores.cjs +13 -3
  86. package/utils/stores.d.ts +9 -0
  87. package/utils/stores.js +12 -2
  88. /package/utils/{internal/func.d.ts → func.d.ts} +0 -0
@@ -2,9 +2,9 @@
2
2
  const utils_stores = require("./utils/stores.cjs");
3
3
  const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
4
4
  const tansu = require("@amadeus-it-group/tansu");
5
- const func = require("./func-Qd3cD9a3.cjs");
5
+ const utils_func = require("./utils/func.cjs");
6
6
  const utils_writables = require("./writables-BPAJvaL_.cjs");
7
- const utils_directive = require("./directive-DdlwGFtf.cjs");
7
+ const utils_directive = require("./dom-CuBx1JPZ.cjs");
8
8
  function adjustItemsCloseOthers(items, openItems, oldOpen) {
9
9
  let keepOpen;
10
10
  if (openItems.length == 2) {
@@ -27,13 +27,12 @@ function getItem(items, id) {
27
27
  }
28
28
  const defaultAccordionConfig = {
29
29
  closeOthers: false,
30
- onItemShown: func.noop,
31
- onItemHidden: func.noop,
30
+ onItemShown: utils_func.noop,
31
+ onItemHidden: utils_func.noop,
32
32
  className: "",
33
33
  itemDestroyOnHide: true,
34
34
  itemAnimated: true,
35
- itemTransition: async () => {
36
- },
35
+ itemTransition: utils_func.noop,
37
36
  itemHeadingTag: "",
38
37
  itemClassName: "",
39
38
  itemHeaderClassName: "",
@@ -48,9 +47,9 @@ const defaultItemConfig = {
48
47
  visible: false,
49
48
  animated: defaultAccordionConfig.itemAnimated,
50
49
  transition: defaultAccordionConfig.itemTransition,
51
- onShown: func.noop,
52
- onHidden: func.noop,
53
- onVisibleChange: func.noop,
50
+ onShown: utils_func.noop,
51
+ onHidden: utils_func.noop,
52
+ onVisibleChange: utils_func.noop,
54
53
  className: defaultAccordionConfig.itemClassName,
55
54
  headerClassName: defaultAccordionConfig.itemHeaderClassName,
56
55
  buttonClassName: defaultAccordionConfig.itemButtonClassName,
@@ -115,8 +114,7 @@ function createAccordionItem(config) {
115
114
  patch
116
115
  ] = utils_stores.writablesForProps(defaultItemConfig, config, configItemValidator);
117
116
  const initDone$ = tansu.writable(false);
118
- const _autoId$ = tansu.computed(() => utils_directive.generateId());
119
- const id$ = tansu.computed(() => _dirtyId$() || _autoId$());
117
+ const id$ = utils_stores.idWithDefault(_dirtyId$);
120
118
  const transition = services_transitions_baseTransitions.createTransition({
121
119
  props: {
122
120
  transition: transition$,
@@ -155,7 +153,7 @@ function createAccordionItem(config) {
155
153
  const bodyContainerAttrsDirective = utils_directive.createAttributesDirective(() => ({
156
154
  attributes: {
157
155
  id: tansu.computed(() => `${id$()}-body-container`),
158
- class: bodyContainerClassName$(),
156
+ class: bodyContainerClassName$,
159
157
  "aria-labelledby": tansu.computed(() => `${id$()}-toggle`)
160
158
  }
161
159
  }));
@@ -192,17 +190,17 @@ function createAccordionItem(config) {
192
190
  toggleDirective,
193
191
  utils_directive.createAttributesDirective(() => ({
194
192
  attributes: {
195
- type: "button",
196
- class: buttonClassName$()
193
+ type: tansu.readable("button"),
194
+ class: buttonClassName$
197
195
  }
198
196
  }))
199
197
  ),
200
- headerDirective: utils_directive.createAttributesDirective(() => ({ attributes: { class: headerClassName$() } })),
201
- bodyDirective: utils_directive.createAttributesDirective(() => ({ attributes: { class: bodyClassName$() } })),
198
+ headerDirective: utils_directive.createAttributesDirective(() => ({ attributes: { class: headerClassName$ } })),
199
+ bodyDirective: utils_directive.createAttributesDirective(() => ({ attributes: { class: bodyClassName$ } })),
202
200
  transitionDirective,
203
201
  bodyContainerAttrsDirective,
204
202
  bodyContainerDirective: utils_directive.mergeDirectives(transitionDirective, bodyContainerAttrsDirective),
205
- itemDirective: func.noop
203
+ itemDirective: utils_func.noop
206
204
  }
207
205
  };
208
206
  }
@@ -305,7 +303,7 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
305
303
  directives: {
306
304
  accordionDirective: utils_directive.mergeDirectives(
307
305
  utils_directive.directiveSubscribe(action$),
308
- utils_directive.createAttributesDirective(() => ({ attributes: { class: className$() }, classNames: { "au-accordion": true } }))
306
+ utils_directive.createAttributesDirective(() => ({ attributes: { class: className$ }, classNames: { "au-accordion": utils_stores.true$ } }))
309
307
  )
310
308
  }
311
309
  };
@@ -1,9 +1,9 @@
1
- import { writablesForProps, stateStores, mergeConfigStores, normalizeConfigStores } from "./utils/stores.js";
1
+ import { writablesForProps, idWithDefault, stateStores, mergeConfigStores, normalizeConfigStores, true$ } from "./utils/stores.js";
2
2
  import { createTransition } from "./services/transitions/baseTransitions.js";
3
- import { writable, computed, asWritable, readable } from "@amadeus-it-group/tansu";
4
- import { n as noop } from "./func-DR0n-ShK.js";
3
+ import { writable, computed, readable, asWritable } from "@amadeus-it-group/tansu";
4
+ import { noop } from "./utils/func.js";
5
5
  import { c as typeBoolean, f as typeFunction, e as typeString } from "./writables-DCiBdIBK.js";
6
- import { t as generateId, k as mergeDirectives, n as createAttributesDirective, r as registrationArray, d as directiveSubscribe } from "./directive-CKEccryv.js";
6
+ import { k as mergeDirectives, n as createAttributesDirective, r as registrationArray, d as directiveSubscribe } from "./dom-BB9jLllr.js";
7
7
  function adjustItemsCloseOthers(items, openItems, oldOpen) {
8
8
  let keepOpen;
9
9
  if (openItems.length == 2) {
@@ -31,8 +31,7 @@ const defaultAccordionConfig = {
31
31
  className: "",
32
32
  itemDestroyOnHide: true,
33
33
  itemAnimated: true,
34
- itemTransition: async () => {
35
- },
34
+ itemTransition: noop,
36
35
  itemHeadingTag: "",
37
36
  itemClassName: "",
38
37
  itemHeaderClassName: "",
@@ -114,8 +113,7 @@ function createAccordionItem(config) {
114
113
  patch
115
114
  ] = writablesForProps(defaultItemConfig, config, configItemValidator);
116
115
  const initDone$ = writable(false);
117
- const _autoId$ = computed(() => generateId());
118
- const id$ = computed(() => _dirtyId$() || _autoId$());
116
+ const id$ = idWithDefault(_dirtyId$);
119
117
  const transition = createTransition({
120
118
  props: {
121
119
  transition: transition$,
@@ -154,7 +152,7 @@ function createAccordionItem(config) {
154
152
  const bodyContainerAttrsDirective = createAttributesDirective(() => ({
155
153
  attributes: {
156
154
  id: computed(() => `${id$()}-body-container`),
157
- class: bodyContainerClassName$(),
155
+ class: bodyContainerClassName$,
158
156
  "aria-labelledby": computed(() => `${id$()}-toggle`)
159
157
  }
160
158
  }));
@@ -191,13 +189,13 @@ function createAccordionItem(config) {
191
189
  toggleDirective,
192
190
  createAttributesDirective(() => ({
193
191
  attributes: {
194
- type: "button",
195
- class: buttonClassName$()
192
+ type: readable("button"),
193
+ class: buttonClassName$
196
194
  }
197
195
  }))
198
196
  ),
199
- headerDirective: createAttributesDirective(() => ({ attributes: { class: headerClassName$() } })),
200
- bodyDirective: createAttributesDirective(() => ({ attributes: { class: bodyClassName$() } })),
197
+ headerDirective: createAttributesDirective(() => ({ attributes: { class: headerClassName$ } })),
198
+ bodyDirective: createAttributesDirective(() => ({ attributes: { class: bodyClassName$ } })),
201
199
  transitionDirective,
202
200
  bodyContainerAttrsDirective,
203
201
  bodyContainerDirective: mergeDirectives(transitionDirective, bodyContainerAttrsDirective),
@@ -304,7 +302,7 @@ function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItem
304
302
  directives: {
305
303
  accordionDirective: mergeDirectives(
306
304
  directiveSubscribe(action$),
307
- createAttributesDirective(() => ({ attributes: { class: className$() }, classNames: { "au-accordion": true } }))
305
+ createAttributesDirective(() => ({ attributes: { class: className$ }, classNames: { "au-accordion": true$ } }))
308
306
  )
309
307
  }
310
308
  };
@@ -1,4 +1,4 @@
1
- import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-Banw3FYN.js";
1
+ import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-CuZAeECD.js";
2
2
  function getAlertDefaultConfig() {
3
3
  return { ...getCommonAlertDefaultConfig() };
4
4
  }
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const common = require("./common-DvPjK7SS.cjs");
2
+ const common = require("./common-CcQOJ_hf.cjs");
3
3
  function getAlertDefaultConfig() {
4
4
  return { ...common.getCommonAlertDefaultConfig() };
5
5
  }
@@ -1,19 +1,18 @@
1
1
  "use strict";
2
2
  const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
3
- const func = require("./func-Qd3cD9a3.cjs");
3
+ const utils_func = require("./utils/func.cjs");
4
4
  const utils_stores = require("./utils/stores.cjs");
5
5
  const utils_writables = require("./writables-BPAJvaL_.cjs");
6
6
  const defaultCommonAlertConfig = {
7
7
  visible: true,
8
8
  dismissible: true,
9
9
  ariaCloseButtonLabel: "Close",
10
- onVisibleChange: func.noop,
11
- onShown: func.noop,
12
- onHidden: func.noop,
10
+ onVisibleChange: utils_func.noop,
11
+ onShown: utils_func.noop,
12
+ onHidden: utils_func.noop,
13
13
  animated: true,
14
14
  animatedOnInit: false,
15
- transition: async () => {
16
- },
15
+ transition: utils_func.noop,
17
16
  className: ""
18
17
  };
19
18
  function getCommonAlertDefaultConfig() {
@@ -1,5 +1,5 @@
1
1
  import { createTransition } from "./services/transitions/baseTransitions.js";
2
- import { n as noop } from "./func-DR0n-ShK.js";
2
+ import { noop } from "./utils/func.js";
3
3
  import { writablesForProps, stateStores } from "./utils/stores.js";
4
4
  import { c as typeBoolean, f as typeFunction, e as typeString } from "./writables-DCiBdIBK.js";
5
5
  const defaultCommonAlertConfig = {
@@ -11,8 +11,7 @@ const defaultCommonAlertConfig = {
11
11
  onHidden: noop,
12
12
  animated: true,
13
13
  animatedOnInit: false,
14
- transition: async () => {
15
- },
14
+ transition: noop,
16
15
  className: ""
17
16
  };
18
17
  function getCommonAlertDefaultConfig() {
@@ -50,7 +50,7 @@ export interface AccordionProps extends WidgetsCommonPropsAndState {
50
50
  *
51
51
  * @defaultValue
52
52
  * ```ts
53
- * async () => {}
53
+ * () => {}
54
54
  * ```
55
55
  */
56
56
  itemTransition: TransitionFn;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const accordion = require("../../accordion-Lp-LEbZ2.cjs");
3
+ const accordion = require("../../accordion-DTQj-TQ1.cjs");
4
4
  exports.createAccordion = accordion.createAccordion;
5
5
  exports.createAccordionItem = accordion.createAccordionItem;
6
6
  exports.factoryCreateAccordion = accordion.factoryCreateAccordion;
@@ -1,4 +1,4 @@
1
- import { a, c, f, g } from "../../accordion-BGv150k9.js";
1
+ import { a, c, f, g } from "../../accordion-hVi2XRk-.js";
2
2
  export {
3
3
  a as createAccordion,
4
4
  c as createAccordionItem,
@@ -72,7 +72,7 @@ export interface CommonAlertProps extends CommonAlertCommonPropsAndState {
72
72
  *
73
73
  * @defaultValue
74
74
  * ```ts
75
- * async () => {}
75
+ * () => {}
76
76
  * ```
77
77
  */
78
78
  transition: TransitionFn;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const alert = require("../../alert-Bq101evB.cjs");
3
+ const alert = require("../../alert-BrVkxOnA.cjs");
4
4
  exports.createAlert = alert.createAlert;
5
5
  exports.getAlertDefaultConfig = alert.getAlertDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../alert-DJ2l7bcA.js";
1
+ import { c, g } from "../../alert-BSixS_cz.js";
2
2
  export {
3
3
  c as createAlert,
4
4
  g as getAlertDefaultConfig
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const modal = require("../../modal-DDHcrykD.cjs");
3
+ const modal = require("../../modal-B7bYoubx.cjs");
4
4
  exports.createModal = modal.createModal;
5
5
  exports.getModalDefaultConfig = modal.getModalDefaultConfig;
6
6
  exports.modalCloseButtonClick = modal.modalCloseButtonClick;
@@ -1,4 +1,4 @@
1
- import { c, g, a, m } from "../../modal-DP-4I7vf.js";
1
+ import { c, g, a, m } from "../../modal-BQcw6bnM.js";
2
2
  export {
3
3
  c as createModal,
4
4
  g as getModalDefaultConfig,
@@ -88,7 +88,7 @@ export interface ModalProps extends ModalCommonPropsAndState {
88
88
  *
89
89
  * @defaultValue
90
90
  * ```ts
91
- * async () => {}
91
+ * () => {}
92
92
  * ```
93
93
  */
94
94
  backdropTransition: TransitionFn;
@@ -103,7 +103,7 @@ export interface ModalProps extends ModalCommonPropsAndState {
103
103
  *
104
104
  * @defaultValue
105
105
  * ```ts
106
- * async () => {}
106
+ * () => {}
107
107
  * ```
108
108
  */
109
109
  modalTransition: TransitionFn;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const pagination = require("../../pagination-CBysiPUs.cjs");
3
+ const pagination = require("../../pagination-5YARuB3V.cjs");
4
4
  exports.createPagination = pagination.createPagination;
5
5
  exports.getPaginationDefaultConfig = pagination.getPaginationDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../pagination-DwDRot6q.js";
1
+ import { c, g } from "../../pagination-BwaZEokc.js";
2
2
  export {
3
3
  c as createPagination,
4
4
  g as getPaginationDefaultConfig
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const progressbar = require("../../progressbar-DghzCJ6_.cjs");
3
+ const progressbar = require("../../progressbar-BpSrg4HG.cjs");
4
4
  exports.createProgressbar = progressbar.createProgressbar;
5
5
  exports.getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../progressbar-CGmNq0cS.js";
1
+ import { c, g } from "../../progressbar-b_kXzGPc.js";
2
2
  export {
3
3
  c as createProgressbar,
4
4
  g as getProgressbarDefaultConfig
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const rating = require("../../rating-DlfOuwuX.cjs");
3
+ const rating = require("../../rating-C8tn9xTO.cjs");
4
4
  exports.createRating = rating.createRating;
5
5
  exports.getRatingDefaultConfig = rating.getRatingDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../rating-Da38uaZz.js";
1
+ import { c, g } from "../../rating-B1JLZgIR.js";
2
2
  export {
3
3
  c as createRating,
4
4
  g as getRatingDefaultConfig
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const select = require("../../select-LBVhNdrd.cjs");
3
+ const select = require("../../select-D1pBz4CM.cjs");
4
4
  exports.createSelect = select.createSelect;
5
5
  exports.getSelectDefaultConfig = select.getSelectDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../select-CAEPqdz1.js";
1
+ import { c, g } from "../../select-Bb2RAVs0.js";
2
2
  export {
3
3
  c as createSelect,
4
4
  g as getSelectDefaultConfig
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const slider = require("../../slider-1OSwok7u.cjs");
3
+ const slider = require("../../slider-B2JFXDLt.cjs");
4
4
  exports.createSlider = slider.createSlider;
5
5
  exports.getSliderDefaultConfig = slider.getSliderDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../slider-6LI4-f5s.js";
1
+ import { c, g } from "../../slider-C-BSdQ0b.js";
2
2
  export {
3
3
  c as createSlider,
4
4
  g as getSliderDefaultConfig
@@ -61,11 +61,44 @@ export interface SliderHandle {
61
61
  /**
62
62
  * ariaLabel of the handle
63
63
  */
64
- ariaLabel: string;
64
+ ariaLabel: string | undefined;
65
65
  /**
66
66
  * ariaValueText of the handle
67
67
  */
68
- ariaValueText: string;
68
+ ariaValueText: string | undefined;
69
+ /**
70
+ * aria-labelledBy of the handle
71
+ */
72
+ ariaLabelledBy: string | undefined;
73
+ }
74
+ /**
75
+ * Represents a tick in a slider component.
76
+ */
77
+ export interface SliderTick {
78
+ /**
79
+ * CSS classes to be applied on the tick
80
+ */
81
+ className?: string | null;
82
+ /**
83
+ * Visualized optional explanation of the label
84
+ */
85
+ legend?: string | null;
86
+ /**
87
+ * Position of the tick in percent
88
+ */
89
+ position: number;
90
+ /**
91
+ * If `true` the tick has selected style
92
+ */
93
+ selected: boolean;
94
+ /**
95
+ * Value of the tick
96
+ */
97
+ value: number;
98
+ /**
99
+ * If `true` the tick label is displayed
100
+ */
101
+ displayLabel: boolean;
69
102
  }
70
103
  interface SliderCommonPropsAndState extends WidgetsCommonPropsAndState {
71
104
  /**
@@ -122,6 +155,12 @@ interface SliderCommonPropsAndState extends WidgetsCommonPropsAndState {
122
155
  * @defaultValue `true`
123
156
  */
124
157
  showMinMaxLabels: boolean;
158
+ /**
159
+ * If `true` the ticks are displayed on the slider
160
+ *
161
+ * @defaultValue `false`
162
+ */
163
+ showTicks: boolean;
125
164
  /**
126
165
  * It `true` slider display is inversed
127
166
  *
@@ -173,6 +212,10 @@ export interface SliderState extends SliderCommonPropsAndState {
173
212
  * Check if the slider is interactive, meaning it is not disabled or readonly
174
213
  */
175
214
  interactive: boolean;
215
+ /**
216
+ * Array of ticks to display on the slider component
217
+ */
218
+ ticks: SliderTick[];
176
219
  }
177
220
  /**
178
221
  * Interface representing the properties for the Slider component.
@@ -180,28 +223,35 @@ export interface SliderState extends SliderCommonPropsAndState {
180
223
  export interface SliderProps extends SliderCommonPropsAndState {
181
224
  /**
182
225
  * Return the value for the 'aria-label' attribute for the handle
183
- * @param value - value of the handle
184
226
  * @param sortedIndex - index of the handle in the sorted list
185
- * @param index - index of the handle in the original list
186
227
  *
187
228
  * @defaultValue
188
229
  * ```ts
189
- * (value: number) => '' + value
230
+ * () => 'Value'
231
+ * ```
232
+ */
233
+ ariaLabel: (sortedIndex: number) => string;
234
+ /**
235
+ * Return the value for the 'aria-labelledBy' attribute for the handle
236
+ * @param sortedIndex - index of the handle in the sorted list
237
+ *
238
+ * @defaultValue
239
+ * ```ts
240
+ * () => ''
190
241
  * ```
191
242
  */
192
- ariaLabelHandle: (value: number, sortedIndex: number, index: number) => string;
243
+ ariaLabelledBy: (sortedIndex: number) => string;
193
244
  /**
194
245
  * Return the value for the 'aria-valuetext' attribute for the handle
195
246
  * @param value - value of the handle
196
247
  * @param sortedIndex - index of the handle in the sorted list
197
- * @param index - index of the handle in the original list
198
248
  *
199
249
  * @defaultValue
200
250
  * ```ts
201
- * (value: number) => '' + value
251
+ * (value: number) => ''
202
252
  * ```
203
253
  */
204
- ariaValueText: (value: number, sortedIndex: number, index: number) => string;
254
+ ariaValueText: (value: number, sortedIndex: number) => string;
205
255
  /**
206
256
  * An event emitted when slider values are changed
207
257
  *
@@ -213,6 +263,19 @@ export interface SliderProps extends SliderCommonPropsAndState {
213
263
  * ```
214
264
  */
215
265
  onValuesChange: (values: number[]) => void;
266
+ /**
267
+ * Unit value between the ticks
268
+ * If value is set to `0` the {@link stepSize} is used to space the ticks
269
+ *
270
+ * @defaultValue `0`
271
+ */
272
+ tickInterval: number;
273
+ /**
274
+ * If `true` the tick values are displayed on the slider
275
+ *
276
+ * @defaultValue `true`
277
+ */
278
+ showTickValues: boolean;
216
279
  }
217
280
  /**
218
281
  * Interface representing various directives used in the slider component.
@@ -264,6 +327,18 @@ export interface SliderDirectives {
264
327
  handleLabelDisplayDirective: Directive<{
265
328
  index: number;
266
329
  }>;
330
+ /**
331
+ * Directive to apply to the slider tick
332
+ */
333
+ tickDirective: Directive<{
334
+ tick: SliderTick;
335
+ }>;
336
+ /**
337
+ * Directive to apply to the slider tick label
338
+ */
339
+ tickLabelDirective: Directive<{
340
+ tick: SliderTick;
341
+ }>;
267
342
  }
268
343
  /**
269
344
  * Represents a slider widget component.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const toast = require("../../toast-D_uSrRZL.cjs");
3
+ const toast = require("../../toast-CaIcB2sD.cjs");
4
4
  exports.createToast = toast.createToast;
5
5
  exports.getToastDefaultConfig = toast.getToastDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../toast-CpvsibAI.js";
1
+ import { c, g } from "../../toast-Bw2QSzBX.js";
2
2
  export {
3
3
  c as createToast,
4
4
  g as getToastDefaultConfig
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const tree = require("../../tree-Bb5KFqXp.cjs");
3
+ const tree = require("../../tree-D4t2SOql.cjs");
4
4
  exports.createTree = tree.createTree;
5
5
  exports.getTreeDefaultConfig = tree.getTreeDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../tree-B2Mr8b31.js";
1
+ import { c, g } from "../../tree-DWv0zwFJ.js";
2
2
  export {
3
3
  c as createTree,
4
4
  g as getTreeDefaultConfig
package/config.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const tansu = require("@amadeus-it-group/tansu");
4
- const func = require("./func-Qd3cD9a3.cjs");
4
+ const utils_func = require("./utils/func.cjs");
5
5
  const mergeInto = (destination, source, levels = Infinity) => {
6
6
  if (source !== void 0) {
7
7
  if (typeof source === "object" && source && levels >= 1) {
@@ -19,9 +19,9 @@ const mergeInto = (destination, source, levels = Infinity) => {
19
19
  }
20
20
  return destination;
21
21
  };
22
- const createWidgetsConfig = (parent$, adaptParentConfig = func.identity) => {
22
+ const createWidgetsConfig = (parent$, adaptParentConfig = utils_func.identity) => {
23
23
  const own$ = tansu.writable({});
24
- const adaptedParent$ = adaptParentConfig === func.identity ? parent$ : tansu.computed(() => adaptParentConfig(mergeInto({}, parent$ == null ? void 0 : parent$(), 2)));
24
+ const adaptedParent$ = adaptParentConfig === utils_func.identity ? parent$ : tansu.computed(() => adaptParentConfig(mergeInto({}, parent$ == null ? void 0 : parent$(), 2)));
25
25
  return tansu.asWritable(
26
26
  tansu.computed(() => mergeInto(mergeInto({}, adaptedParent$ == null ? void 0 : adaptedParent$(), 2), own$(), 2)),
27
27
  {
package/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { writable, computed, asWritable } from "@amadeus-it-group/tansu";
2
- import { i as identity } from "./func-DR0n-ShK.js";
2
+ import { identity } from "./utils/func.js";
3
3
  const mergeInto = (destination, source, levels = Infinity) => {
4
4
  if (source !== void 0) {
5
5
  if (typeof source === "object" && source && levels >= 1) {