@agnos-ui/core 0.10.0-next.3 → 0.10.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 (83) hide show
  1. package/{accordion-nxveC0GZ.cjs → accordion-D9AonDII.cjs} +1 -1
  2. package/{accordion-47EpOD36.js → accordion-qJyqAAwZ.js} +1 -1
  3. package/{collapse-CrfvGo_T.js → collapse-CPXAHvle.js} +1 -1
  4. package/{collapse-Da_27YUU.cjs → collapse-DVb_2jIl.cjs} +1 -1
  5. package/components/accordion/index.cjs +1 -1
  6. package/components/accordion/index.js +1 -1
  7. package/components/carousel/index.cjs +1 -1
  8. package/components/carousel/index.js +1 -1
  9. package/components/collapse/index.cjs +1 -1
  10. package/components/collapse/index.js +1 -1
  11. package/components/drawer/drawer.d.ts +10 -0
  12. package/components/drawer/index.cjs +1 -1
  13. package/components/drawer/index.js +1 -1
  14. package/components/modal/index.cjs +1 -1
  15. package/components/modal/index.js +1 -1
  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/toast/index.cjs +1 -1
  27. package/components/toast/index.js +1 -1
  28. package/components/tree/index.cjs +1 -1
  29. package/components/tree/index.js +1 -1
  30. package/{dom-Cm9_uROp.cjs → dom-R8VxJgdK.cjs} +21 -0
  31. package/{dom-DD1hAVZy.js → dom-iY0R3D7u.js} +35 -14
  32. package/{drawer-DOi0TqZC.cjs → drawer-77u4kG4M.cjs} +18 -7
  33. package/{drawer-Caz4Uypu.js → drawer-CVoNTDrc.js} +19 -8
  34. package/index.cjs +13 -12
  35. package/index.js +20 -19
  36. package/{modal-cKd3qUn1.js → modal-CJVVF65o.js} +1 -1
  37. package/{modal-B_3Uxplo.cjs → modal-ywc6mk_R.cjs} +1 -1
  38. package/package.json +1 -1
  39. package/{pagination-2Vor6JPZ.cjs → pagination-CRMoSXs3.cjs} +1 -1
  40. package/{pagination-DlOyP_2C.js → pagination-D19l6t0x.js} +1 -1
  41. package/{progressbar-DyBRINco.cjs → progressbar-DeqZeuKP.cjs} +1 -1
  42. package/{progressbar-B5g76eMV.js → progressbar-r0zha1kn.js} +1 -1
  43. package/{rating-C7C4-p4B.js → rating-D5Usb5P6.js} +1 -1
  44. package/{rating-C0y1j4SC.cjs → rating-DOPnxyms.cjs} +1 -1
  45. package/{select-nnl00UWY.js → select-BLA3Onle.js} +1 -1
  46. package/{select-Dhsb9msC.cjs → select-Dx3GWZPt.cjs} +1 -1
  47. package/services/floatingUI.cjs +1 -1
  48. package/services/floatingUI.js +1 -1
  49. package/services/focusElement.cjs +1 -1
  50. package/services/focusElement.js +1 -1
  51. package/services/focustrack.cjs +1 -1
  52. package/services/focustrack.js +1 -1
  53. package/services/matchMedia.cjs +1 -1
  54. package/services/matchMedia.js +1 -1
  55. package/services/navManager.cjs +1 -1
  56. package/services/navManager.js +1 -1
  57. package/services/pointerdownPosition.cjs +1 -1
  58. package/services/pointerdownPosition.js +1 -1
  59. package/services/portal.cjs +1 -1
  60. package/services/portal.js +1 -1
  61. package/services/resizeObserver.cjs +1 -1
  62. package/services/resizeObserver.js +1 -1
  63. package/services/siblingsInert.cjs +1 -1
  64. package/services/siblingsInert.js +1 -1
  65. package/services/transitions/baseTransitions.cjs +1 -1
  66. package/services/transitions/baseTransitions.js +1 -1
  67. package/services/transitions/collapse.cjs +1 -1
  68. package/services/transitions/collapse.js +1 -1
  69. package/services/transitions/cssTransitions.cjs +1 -1
  70. package/services/transitions/cssTransitions.js +1 -1
  71. package/services/transitions/simpleClassTransition.cjs +1 -1
  72. package/services/transitions/simpleClassTransition.js +1 -1
  73. package/{slider-B4WrdTeE.js → slider--fcvBfF0.js} +1 -1
  74. package/{slider-DTO58syz.cjs → slider-CJIW2sDq.cjs} +1 -1
  75. package/{toaster-CT148JSJ.cjs → toaster-BjBdgZGB.cjs} +1 -1
  76. package/{toaster-CRPErgI2.js → toaster-D1b7QvRg.js} +1 -1
  77. package/{tree-CHpFqJPx.js → tree-CUtbJPZT.js} +1 -1
  78. package/{tree-C4l2Wqny.cjs → tree-Pj-WcKId.cjs} +1 -1
  79. package/utils/directive.cjs +2 -1
  80. package/utils/directive.d.ts +8 -0
  81. package/utils/directive.js +9 -8
  82. package/utils/stores.cjs +1 -1
  83. package/utils/stores.js +1 -1
@@ -4,7 +4,7 @@ const services_transitions_baseTransitions = require("./services/transitions/bas
4
4
  const tansu = require("@amadeus-it-group/tansu");
5
5
  const utils_func = require("./utils/func.cjs");
6
6
  const utils_writables = require("./writables-Dt68gADJ.cjs");
7
- const utils_directive = require("./dom-Cm9_uROp.cjs");
7
+ const utils_directive = require("./dom-R8VxJgdK.cjs");
8
8
  const utils_widget = require("./utils/widget.cjs");
9
9
  function adjustItemsCloseOthers(items, openItems, oldOpen) {
10
10
  let keepOpen;
@@ -3,7 +3,7 @@ import { createTransition } from "./services/transitions/baseTransitions.js";
3
3
  import { writable, computed, readable, asWritable } from "@amadeus-it-group/tansu";
4
4
  import { noop } from "./utils/func.js";
5
5
  import { k as createTypeEnum, e as typeString, h as typeFunction, c as typeBoolean } from "./writables-Is1bF1Vt.js";
6
- import { n as mergeDirectives, p as createAttributesDirective, r as registrationArray, d as directiveSubscribe } from "./dom-DD1hAVZy.js";
6
+ import { o as mergeDirectives, q as createAttributesDirective, r as registrationArray, d as directiveSubscribe } from "./dom-iY0R3D7u.js";
7
7
  import { createWidgetFactory } from "./utils/widget.js";
8
8
  function adjustItemsCloseOthers(items, openItems, oldOpen) {
9
9
  let keepOpen;
@@ -1,6 +1,6 @@
1
1
  import { createTransition } from "./services/transitions/baseTransitions.js";
2
2
  import { writablesForProps, idWithDefault, stateStores } from "./utils/stores.js";
3
- import { p as createAttributesDirective, n as mergeDirectives } from "./dom-DD1hAVZy.js";
3
+ import { q as createAttributesDirective, o as mergeDirectives } from "./dom-iY0R3D7u.js";
4
4
  import { h as typeFunction, e as typeString, c as typeBoolean } from "./writables-Is1bF1Vt.js";
5
5
  import { computed } from "@amadeus-it-group/tansu";
6
6
  import { noop } from "./utils/func.js";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
3
3
  const utils_stores = require("./utils/stores.cjs");
4
- const utils_directive = require("./dom-Cm9_uROp.cjs");
4
+ const utils_directive = require("./dom-R8VxJgdK.cjs");
5
5
  const utils_writables = require("./writables-Dt68gADJ.cjs");
6
6
  const tansu = require("@amadeus-it-group/tansu");
7
7
  const utils_func = require("./utils/func.cjs");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const accordion = require("../../accordion-nxveC0GZ.cjs");
3
+ const accordion = require("../../accordion-D9AonDII.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-47EpOD36.js";
1
+ import { a, c, f, g } from "../../accordion-qJyqAAwZ.js";
2
2
  export {
3
3
  a as createAccordion,
4
4
  c as createAccordionItem,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const utils_stores = require("../../utils/stores.cjs");
4
- const utils_directive = require("../../dom-Cm9_uROp.cjs");
4
+ const utils_directive = require("../../dom-R8VxJgdK.cjs");
5
5
  const EmblaCarousel = require("embla-carousel");
6
6
  const tansu = require("@amadeus-it-group/tansu");
7
7
  const utils_writables = require("../../writables-Dt68gADJ.cjs");
@@ -1,5 +1,5 @@
1
1
  import { writablesForProps, stateStores, true$ } from "../../utils/stores.js";
2
- import { a as bindDirective, b as browserDirective, p as createAttributesDirective, n as mergeDirectives } from "../../dom-DD1hAVZy.js";
2
+ import { a as bindDirective, b as browserDirective, q as createAttributesDirective, o as mergeDirectives } from "../../dom-iY0R3D7u.js";
3
3
  import EmblaCarousel from "embla-carousel";
4
4
  import { writable, computed, asReadable, readable } from "@amadeus-it-group/tansu";
5
5
  import { h as typeFunction, e as typeString, c as typeBoolean, a as typeNumber, k as createTypeEnum, f as typeStringOrNull, j as typeArray } from "../../writables-Is1bF1Vt.js";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const collapse = require("../../collapse-Da_27YUU.cjs");
3
+ const collapse = require("../../collapse-DVb_2jIl.cjs");
4
4
  exports.createCollapse = collapse.createCollapse;
5
5
  exports.getCollapseDefaultConfig = collapse.getCollapseDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../collapse-CrfvGo_T.js";
1
+ import { c, g } from "../../collapse-CPXAHvle.js";
2
2
  export {
3
3
  c as createCollapse,
4
4
  g as getCollapseDefaultConfig
@@ -111,6 +111,12 @@ export interface DrawerProps extends DrawerCommonPropsAndState {
111
111
  * @defaultValue `false`
112
112
  */
113
113
  bodyScroll: boolean;
114
+ /**
115
+ * If `true` focuses the drawer when it is opened.
116
+ *
117
+ * @defaultValue `true`
118
+ */
119
+ focusOnInit: boolean;
114
120
  /**
115
121
  * Event to be triggered when the transition is completed and the drawer is not visible.
116
122
  *
@@ -192,6 +198,10 @@ export interface DrawerState extends DrawerCommonPropsAndState {
192
198
  * Flag to show whether the drawer is fully hidden.
193
199
  */
194
200
  hidden: boolean;
201
+ /**
202
+ * Flag to show whether the drawer is vertically positioned.
203
+ */
204
+ isVertical: boolean;
195
205
  }
196
206
  /**
197
207
  * Interface representing the API for a Drawer component.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const drawer = require("../../drawer-DOi0TqZC.cjs");
3
+ const drawer = require("../../drawer-77u4kG4M.cjs");
4
4
  exports.createDrawer = drawer.createDrawer;
5
5
  exports.getDrawerDefaultConfig = drawer.getDrawerDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../drawer-Caz4Uypu.js";
1
+ import { c, g } from "../../drawer-CVoNTDrc.js";
2
2
  export {
3
3
  c as createDrawer,
4
4
  g as getDrawerDefaultConfig
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const modal = require("../../modal-B_3Uxplo.cjs");
3
+ const modal = require("../../modal-ywc6mk_R.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, b, m } from "../../modal-cKd3qUn1.js";
1
+ import { c, g, a, b, m } from "../../modal-CJVVF65o.js";
2
2
  export {
3
3
  c as createModal,
4
4
  g as getModalDefaultConfig,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const pagination = require("../../pagination-2Vor6JPZ.cjs");
3
+ const pagination = require("../../pagination-CRMoSXs3.cjs");
4
4
  exports.createPagination = pagination.createPagination;
5
5
  exports.getPaginationDefaultConfig = pagination.getPaginationDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../pagination-DlOyP_2C.js";
1
+ import { c, g } from "../../pagination-D19l6t0x.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-DyBRINco.cjs");
3
+ const progressbar = require("../../progressbar-DeqZeuKP.cjs");
4
4
  exports.createProgressbar = progressbar.createProgressbar;
5
5
  exports.getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../progressbar-B5g76eMV.js";
1
+ import { c, g } from "../../progressbar-r0zha1kn.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-C0y1j4SC.cjs");
3
+ const rating = require("../../rating-DOPnxyms.cjs");
4
4
  exports.createRating = rating.createRating;
5
5
  exports.getRatingDefaultConfig = rating.getRatingDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../rating-C7C4-p4B.js";
1
+ import { c, g } from "../../rating-D5Usb5P6.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-Dhsb9msC.cjs");
3
+ const select = require("../../select-Dx3GWZPt.cjs");
4
4
  exports.createSelect = select.createSelect;
5
5
  exports.getSelectDefaultConfig = select.getSelectDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../select-nnl00UWY.js";
1
+ import { c, g } from "../../select-BLA3Onle.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-DTO58syz.cjs");
3
+ const slider = require("../../slider-CJIW2sDq.cjs");
4
4
  exports.createSlider = slider.createSlider;
5
5
  exports.getSliderDefaultConfig = slider.getSliderDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../slider-B4WrdTeE.js";
1
+ import { c, g } from "../../slider--fcvBfF0.js";
2
2
  export {
3
3
  c as createSlider,
4
4
  g as getSliderDefaultConfig
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const toaster = require("../../toaster-CT148JSJ.cjs");
3
+ const toaster = require("../../toaster-BjBdgZGB.cjs");
4
4
  exports.Toaster = toaster.Toaster;
5
5
  exports.createToast = toaster.createToast;
6
6
  exports.defaultToasterProps = toaster.defaultToasterProps;
@@ -1,4 +1,4 @@
1
- import { T, c, d, g } from "../../toaster-CRPErgI2.js";
1
+ import { T, c, d, g } from "../../toaster-D1b7QvRg.js";
2
2
  export {
3
3
  T as Toaster,
4
4
  c as createToast,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const tree = require("../../tree-C4l2Wqny.cjs");
3
+ const tree = require("../../tree-Pj-WcKId.cjs");
4
4
  exports.createTree = tree.createTree;
5
5
  exports.getTreeDefaultConfig = tree.getTreeDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../tree-CHpFqJPx.js";
1
+ import { c, g } from "../../tree-CUtbJPZT.js";
2
2
  export {
3
3
  c as createTree,
4
4
  g as getTreeDefaultConfig
@@ -277,6 +277,26 @@ const createBrowserStoreDirective = () => {
277
277
  const { directive, element$ } = createStoreDirective();
278
278
  return { directive: browserDirective(directive), element$ };
279
279
  };
280
+ const conditionalDirective = (directive, condition) => (element, arg) => {
281
+ const instance$ = tansu.derived(
282
+ condition,
283
+ (enabled, set) => {
284
+ const instance = enabled ? directive(element, arg) : void 0;
285
+ set(instance);
286
+ return () => instance?.destroy?.();
287
+ },
288
+ void 0
289
+ );
290
+ const destroy = instance$.subscribe(() => {
291
+ });
292
+ return {
293
+ update(newArg) {
294
+ arg = newArg;
295
+ instance$()?.update?.(newArg);
296
+ },
297
+ destroy
298
+ };
299
+ };
280
300
  const mergeDirectives = (...args) => (element, arg) => {
281
301
  const instances = tansu.batch(() => args.map((directive) => directive(element, arg)));
282
302
  return {
@@ -481,6 +501,7 @@ exports.bindDirectiveNoArg = bindDirectiveNoArg;
481
501
  exports.browserDirective = browserDirective;
482
502
  exports.classDirective = classDirective;
483
503
  exports.computeCommonAncestor = computeCommonAncestor;
504
+ exports.conditionalDirective = conditionalDirective;
484
505
  exports.createAttributesDirective = createAttributesDirective;
485
506
  exports.createBrowserStoreArrayDirective = createBrowserStoreArrayDirective;
486
507
  exports.createBrowserStoreDirective = createBrowserStoreDirective;
@@ -1,5 +1,5 @@
1
1
  import { BROWSER } from "esm-env";
2
- import { readable, batch, asReadable, writable, computed } from "@amadeus-it-group/tansu";
2
+ import { readable, batch, asReadable, writable, derived, computed } from "@amadeus-it-group/tansu";
3
3
  import { noop } from "./utils/func.js";
4
4
  const importantSuffixRegExp = /\s*!important$/;
5
5
  const withoutImportant = (value) => value?.replace(importantSuffixRegExp, "") ?? "";
@@ -276,6 +276,26 @@ const createBrowserStoreDirective = () => {
276
276
  const { directive, element$ } = createStoreDirective();
277
277
  return { directive: browserDirective(directive), element$ };
278
278
  };
279
+ const conditionalDirective = (directive, condition) => (element, arg) => {
280
+ const instance$ = derived(
281
+ condition,
282
+ (enabled, set) => {
283
+ const instance = enabled ? directive(element, arg) : void 0;
284
+ set(instance);
285
+ return () => instance?.destroy?.();
286
+ },
287
+ void 0
288
+ );
289
+ const destroy = instance$.subscribe(() => {
290
+ });
291
+ return {
292
+ update(newArg) {
293
+ arg = newArg;
294
+ instance$()?.update?.(newArg);
295
+ },
296
+ destroy
297
+ };
298
+ };
279
299
  const mergeDirectives = (...args) => (element, arg) => {
280
300
  const instances = batch(() => args.map((directive) => directive(element, arg)));
281
301
  return {
@@ -473,7 +493,8 @@ function bindClassName(node, className, value$) {
473
493
  };
474
494
  }
475
495
  export {
476
- computeCommonAncestor as A,
496
+ reflow as A,
497
+ computeCommonAncestor as B,
477
498
  bindDirective as a,
478
499
  browserDirective as b,
479
500
  bindDirectiveNoArg as c,
@@ -487,17 +508,17 @@ export {
487
508
  createStoreDirective as k,
488
509
  createBrowserStoreDirective as l,
489
510
  mapDirectiveArg as m,
490
- mergeDirectives as n,
491
- multiDirective as o,
492
- createAttributesDirective as p,
493
- attributesData as q,
511
+ conditionalDirective as n,
512
+ mergeDirectives as o,
513
+ multiDirective as p,
514
+ createAttributesDirective as q,
494
515
  registrationArray as r,
495
- classDirective as s,
496
- directiveAttributes as t,
497
- ssrAttributes as u,
498
- generateId as v,
499
- addEvent as w,
500
- removeClasses as x,
501
- addClasses as y,
502
- reflow as z
516
+ attributesData as s,
517
+ classDirective as t,
518
+ directiveAttributes as u,
519
+ ssrAttributes as v,
520
+ generateId as w,
521
+ addEvent as x,
522
+ removeClasses as y,
523
+ addClasses as z
503
524
  };
@@ -5,7 +5,7 @@ const services_pointerdownPosition = require("./services/pointerdownPosition.cjs
5
5
  const services_portal = require("./services/portal.cjs");
6
6
  const services_siblingsInert = require("./services/siblingsInert.cjs");
7
7
  const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
8
- const utils_directive = require("./dom-Cm9_uROp.cjs");
8
+ const utils_directive = require("./dom-R8VxJgdK.cjs");
9
9
  const utils_func = require("./utils/func.cjs");
10
10
  const scrollbars = require("./scrollbars-CT87iv_6.cjs");
11
11
  const utils_stores = require("./utils/stores.cjs");
@@ -37,7 +37,8 @@ const defaultDrawerConfig = {
37
37
  resizable: false,
38
38
  backdrop: true,
39
39
  bodyScroll: false,
40
- size: null
40
+ size: null,
41
+ focusOnInit: true
41
42
  };
42
43
  const configValidator = {
43
44
  animated: utils_writables.typeBoolean,
@@ -60,7 +61,8 @@ const configValidator = {
60
61
  resizable: utils_writables.typeBoolean,
61
62
  backdrop: utils_writables.typeBoolean,
62
63
  bodyScroll: utils_writables.typeBoolean,
63
- size: utils_writables.typeNumberOrNull
64
+ size: utils_writables.typeNumberOrNull,
65
+ focusOnInit: utils_writables.typeBoolean
64
66
  };
65
67
  const createDrawer = utils_widget.createWidgetFactory("drawer", (config) => {
66
68
  const [
@@ -85,6 +87,7 @@ const createDrawer = utils_widget.createWidgetFactory("drawer", (config) => {
85
87
  onMinimizedChange$,
86
88
  onMaximizedChange$,
87
89
  onResizingChange$,
90
+ focusOnInit$,
88
91
  ...stateProps
89
92
  },
90
93
  patch
@@ -195,14 +198,21 @@ const createDrawer = utils_widget.createWidgetFactory("drawer", (config) => {
195
198
  const clientXorY = isVertical ? "clientY" : "clientX";
196
199
  const startPos = event[clientXorY];
197
200
  const direction = direction$();
198
- onResizingChange$()(true);
201
+ let isResizing = false;
199
202
  return {
200
203
  onMove(event2) {
201
204
  setSize(startSize + direction * (event2[clientXorY] - startPos));
205
+ if (!isResizing) {
206
+ isResizing = true;
207
+ onResizingChange$()(true);
208
+ }
202
209
  },
203
210
  onEnd() {
204
211
  drawerElement.style[isVertical ? "height" : "width"] = "";
205
- onResizingChange$()(false);
212
+ if (isResizing) {
213
+ onResizingChange$()(false);
214
+ isResizing = false;
215
+ }
206
216
  }
207
217
  };
208
218
  }),
@@ -259,7 +269,8 @@ const createDrawer = utils_widget.createWidgetFactory("drawer", (config) => {
259
269
  size$,
260
270
  visible$,
261
271
  backdropHidden$,
262
- hidden$
272
+ hidden$,
273
+ isVertical$
263
274
  }),
264
275
  patch,
265
276
  api: {
@@ -277,7 +288,7 @@ const createDrawer = utils_widget.createWidgetFactory("drawer", (config) => {
277
288
  ),
278
289
  // This directive must come after the attribute directive, to ensure that all the classes and attributes are applied for the transition
279
290
  transition.directives.directive,
280
- services_focusElement.focusElement
291
+ utils_directive.conditionalDirective(services_focusElement.focusElement, focusOnInit$)
281
292
  ),
282
293
  backdropPortalDirective,
283
294
  backdropDirective: utils_directive.mergeDirectives(backdropTransition.directives.directive, backdropAttributeDirective),
@@ -4,12 +4,12 @@ import { createPointerdownPositionDirective } from "./services/pointerdownPositi
4
4
  import { portal } from "./services/portal.js";
5
5
  import { siblingsInert } from "./services/siblingsInert.js";
6
6
  import { createTransition } from "./services/transitions/baseTransitions.js";
7
- import { a as bindDirective, l as createBrowserStoreDirective, n as mergeDirectives, p as createAttributesDirective, d as directiveSubscribe, i as isBrowserHTMLElement } from "./dom-DD1hAVZy.js";
7
+ import { a as bindDirective, l as createBrowserStoreDirective, o as mergeDirectives, q as createAttributesDirective, n as conditionalDirective, d as directiveSubscribe, i as isBrowserHTMLElement } from "./dom-iY0R3D7u.js";
8
8
  import { noop } from "./utils/func.js";
9
9
  import { r as removeScrollbars, a as revertScrollbars } from "./scrollbars-CcxSrnCx.js";
10
10
  import { writablesForProps, bindableProp, stateStores, true$ } from "./utils/stores.js";
11
11
  import { createWidgetFactory } from "./utils/widget.js";
12
- import { g as typeNumberOrNull, c as typeBoolean, h as typeFunction, i as typeHTMLElementOrNull, e as typeString } from "./writables-Is1bF1Vt.js";
12
+ import { c as typeBoolean, g as typeNumberOrNull, h as typeFunction, i as typeHTMLElementOrNull, e as typeString } from "./writables-Is1bF1Vt.js";
13
13
  function getDrawerDefaultConfig() {
14
14
  return {
15
15
  ...defaultDrawerConfig
@@ -36,7 +36,8 @@ const defaultDrawerConfig = {
36
36
  resizable: false,
37
37
  backdrop: true,
38
38
  bodyScroll: false,
39
- size: null
39
+ size: null,
40
+ focusOnInit: true
40
41
  };
41
42
  const configValidator = {
42
43
  animated: typeBoolean,
@@ -59,7 +60,8 @@ const configValidator = {
59
60
  resizable: typeBoolean,
60
61
  backdrop: typeBoolean,
61
62
  bodyScroll: typeBoolean,
62
- size: typeNumberOrNull
63
+ size: typeNumberOrNull,
64
+ focusOnInit: typeBoolean
63
65
  };
64
66
  const createDrawer = createWidgetFactory("drawer", (config) => {
65
67
  const [
@@ -84,6 +86,7 @@ const createDrawer = createWidgetFactory("drawer", (config) => {
84
86
  onMinimizedChange$,
85
87
  onMaximizedChange$,
86
88
  onResizingChange$,
89
+ focusOnInit$,
87
90
  ...stateProps
88
91
  },
89
92
  patch
@@ -194,14 +197,21 @@ const createDrawer = createWidgetFactory("drawer", (config) => {
194
197
  const clientXorY = isVertical ? "clientY" : "clientX";
195
198
  const startPos = event[clientXorY];
196
199
  const direction = direction$();
197
- onResizingChange$()(true);
200
+ let isResizing = false;
198
201
  return {
199
202
  onMove(event2) {
200
203
  setSize(startSize + direction * (event2[clientXorY] - startPos));
204
+ if (!isResizing) {
205
+ isResizing = true;
206
+ onResizingChange$()(true);
207
+ }
201
208
  },
202
209
  onEnd() {
203
210
  drawerElement.style[isVertical ? "height" : "width"] = "";
204
- onResizingChange$()(false);
211
+ if (isResizing) {
212
+ onResizingChange$()(false);
213
+ isResizing = false;
214
+ }
205
215
  }
206
216
  };
207
217
  }),
@@ -258,7 +268,8 @@ const createDrawer = createWidgetFactory("drawer", (config) => {
258
268
  size$,
259
269
  visible$,
260
270
  backdropHidden$,
261
- hidden$
271
+ hidden$,
272
+ isVertical$
262
273
  }),
263
274
  patch,
264
275
  api: {
@@ -276,7 +287,7 @@ const createDrawer = createWidgetFactory("drawer", (config) => {
276
287
  ),
277
288
  // This directive must come after the attribute directive, to ensure that all the classes and attributes are applied for the transition
278
289
  transition.directives.directive,
279
- focusElement
290
+ conditionalDirective(focusElement, focusOnInit$)
280
291
  ),
281
292
  backdropPortalDirective,
282
293
  backdropDirective: mergeDirectives(backdropTransition.directives.directive, backdropAttributeDirective),
package/index.cjs CHANGED
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const types = require("./types.cjs");
4
- const accordion = require("./accordion-nxveC0GZ.cjs");
4
+ const accordion = require("./accordion-D9AonDII.cjs");
5
5
  const alert = require("./alert-AhaliJ17.cjs");
6
- const collapse = require("./collapse-Da_27YUU.cjs");
7
- const modal = require("./modal-B_3Uxplo.cjs");
8
- const pagination = require("./pagination-2Vor6JPZ.cjs");
9
- const progressbar = require("./progressbar-DyBRINco.cjs");
10
- const rating = require("./rating-C0y1j4SC.cjs");
11
- const select = require("./select-Dhsb9msC.cjs");
12
- const slider = require("./slider-DTO58syz.cjs");
13
- const toaster = require("./toaster-CT148JSJ.cjs");
14
- const tree = require("./tree-C4l2Wqny.cjs");
15
- const drawer = require("./drawer-DOi0TqZC.cjs");
6
+ const collapse = require("./collapse-DVb_2jIl.cjs");
7
+ const modal = require("./modal-ywc6mk_R.cjs");
8
+ const pagination = require("./pagination-CRMoSXs3.cjs");
9
+ const progressbar = require("./progressbar-DeqZeuKP.cjs");
10
+ const rating = require("./rating-DOPnxyms.cjs");
11
+ const select = require("./select-Dx3GWZPt.cjs");
12
+ const slider = require("./slider-CJIW2sDq.cjs");
13
+ const toaster = require("./toaster-BjBdgZGB.cjs");
14
+ const tree = require("./tree-Pj-WcKId.cjs");
15
+ const drawer = require("./drawer-77u4kG4M.cjs");
16
16
  const config = require("./config.cjs");
17
17
  const services_extendWidget = require("./services/extendWidget.cjs");
18
18
  const services_floatingUI = require("./services/floatingUI.cjs");
@@ -27,7 +27,7 @@ const services_hash = require("./services/hash.cjs");
27
27
  const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
28
28
  const services_transitions_cssTransitions = require("./services/transitions/cssTransitions.cjs");
29
29
  const services_transitions_simpleClassTransition = require("./services/transitions/simpleClassTransition.cjs");
30
- const utils_directive = require("./dom-Cm9_uROp.cjs");
30
+ const utils_directive = require("./dom-R8VxJgdK.cjs");
31
31
  const utils_stores = require("./utils/stores.cjs");
32
32
  const utils_writables = require("./writables-Dt68gADJ.cjs");
33
33
  exports.FACTORY_WIDGET_NAME = types.FACTORY_WIDGET_NAME;
@@ -90,6 +90,7 @@ exports.bindDirective = utils_directive.bindDirective;
90
90
  exports.bindDirectiveNoArg = utils_directive.bindDirectiveNoArg;
91
91
  exports.browserDirective = utils_directive.browserDirective;
92
92
  exports.classDirective = utils_directive.classDirective;
93
+ exports.conditionalDirective = utils_directive.conditionalDirective;
93
94
  exports.createAttributesDirective = utils_directive.createAttributesDirective;
94
95
  exports.createBrowserStoreArrayDirective = utils_directive.createBrowserStoreArrayDirective;
95
96
  exports.createBrowserStoreDirective = utils_directive.createBrowserStoreDirective;