@design-factory/angular 21.1.0-next.0 → 21.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/fesm2022/design-factory-angular-drawer.mjs +22 -29
  2. package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
  3. package/fesm2022/design-factory-angular-internals.mjs +5 -5
  4. package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
  5. package/fesm2022/design-factory-angular-sidenav.mjs +139 -62
  6. package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
  7. package/fesm2022/design-factory-angular-theme.mjs +1 -1
  8. package/fesm2022/design-factory-angular-theme.mjs.map +1 -1
  9. package/fesm2022/design-factory-angular-topnav.mjs +152 -75
  10. package/fesm2022/design-factory-angular-topnav.mjs.map +1 -1
  11. package/package.json +3 -6
  12. package/types/design-factory-angular-drawer.d.ts +13 -14
  13. package/types/design-factory-angular-internals.d.ts +3 -3
  14. package/types/design-factory-angular-sidenav.d.ts +19 -6
  15. package/types/design-factory-angular-topnav.d.ts +13 -6
  16. package/node_modules/@agnos-ui/core/README.md +0 -5
  17. package/node_modules/@agnos-ui/core/accordion-BC_9xn23.cjs +0 -314
  18. package/node_modules/@agnos-ui/core/accordion-Ca_0T8Bc.js +0 -315
  19. package/node_modules/@agnos-ui/core/alert-AhaliJ17.cjs +0 -9
  20. package/node_modules/@agnos-ui/core/alert-Cb9FhbFQ.js +0 -10
  21. package/node_modules/@agnos-ui/core/collapse-COriZO7o.cjs +0 -94
  22. package/node_modules/@agnos-ui/core/collapse-CP79atna.js +0 -95
  23. package/node_modules/@agnos-ui/core/common-B5jS-Ih_.cjs +0 -73
  24. package/node_modules/@agnos-ui/core/common-DFyZvkII.js +0 -74
  25. package/node_modules/@agnos-ui/core/components/accordion/accordion.d.ts +0 -333
  26. package/node_modules/@agnos-ui/core/components/accordion/index.cjs +0 -7
  27. package/node_modules/@agnos-ui/core/components/accordion/index.d.ts +0 -1
  28. package/node_modules/@agnos-ui/core/components/accordion/index.js +0 -7
  29. package/node_modules/@agnos-ui/core/components/alert/alert.d.ts +0 -37
  30. package/node_modules/@agnos-ui/core/components/alert/common.d.ts +0 -138
  31. package/node_modules/@agnos-ui/core/components/alert/index.cjs +0 -5
  32. package/node_modules/@agnos-ui/core/components/alert/index.d.ts +0 -1
  33. package/node_modules/@agnos-ui/core/components/alert/index.js +0 -5
  34. package/node_modules/@agnos-ui/core/components/carousel/carousel.d.ts +0 -247
  35. package/node_modules/@agnos-ui/core/components/carousel/index.cjs +0 -292
  36. package/node_modules/@agnos-ui/core/components/carousel/index.d.ts +0 -1
  37. package/node_modules/@agnos-ui/core/components/carousel/index.js +0 -292
  38. package/node_modules/@agnos-ui/core/components/collapse/collapse.d.ts +0 -135
  39. package/node_modules/@agnos-ui/core/components/collapse/index.cjs +0 -5
  40. package/node_modules/@agnos-ui/core/components/collapse/index.d.ts +0 -1
  41. package/node_modules/@agnos-ui/core/components/collapse/index.js +0 -5
  42. package/node_modules/@agnos-ui/core/components/commonProps.d.ts +0 -11
  43. package/node_modules/@agnos-ui/core/components/drawer/drawer.d.ts +0 -279
  44. package/node_modules/@agnos-ui/core/components/drawer/index.cjs +0 -5
  45. package/node_modules/@agnos-ui/core/components/drawer/index.d.ts +0 -1
  46. package/node_modules/@agnos-ui/core/components/drawer/index.js +0 -5
  47. package/node_modules/@agnos-ui/core/components/modal/index.cjs +0 -8
  48. package/node_modules/@agnos-ui/core/components/modal/index.d.ts +0 -1
  49. package/node_modules/@agnos-ui/core/components/modal/index.js +0 -8
  50. package/node_modules/@agnos-ui/core/components/modal/modal.d.ts +0 -245
  51. package/node_modules/@agnos-ui/core/components/pagination/index.cjs +0 -5
  52. package/node_modules/@agnos-ui/core/components/pagination/index.d.ts +0 -1
  53. package/node_modules/@agnos-ui/core/components/pagination/index.js +0 -5
  54. package/node_modules/@agnos-ui/core/components/pagination/pagination.d.ts +0 -313
  55. package/node_modules/@agnos-ui/core/components/progressbar/index.cjs +0 -5
  56. package/node_modules/@agnos-ui/core/components/progressbar/index.d.ts +0 -1
  57. package/node_modules/@agnos-ui/core/components/progressbar/index.js +0 -5
  58. package/node_modules/@agnos-ui/core/components/progressbar/progressbar.d.ts +0 -91
  59. package/node_modules/@agnos-ui/core/components/rating/index.cjs +0 -5
  60. package/node_modules/@agnos-ui/core/components/rating/index.d.ts +0 -1
  61. package/node_modules/@agnos-ui/core/components/rating/index.js +0 -5
  62. package/node_modules/@agnos-ui/core/components/rating/rating.d.ts +0 -191
  63. package/node_modules/@agnos-ui/core/components/slider/index.cjs +0 -5
  64. package/node_modules/@agnos-ui/core/components/slider/index.d.ts +0 -1
  65. package/node_modules/@agnos-ui/core/components/slider/index.js +0 -5
  66. package/node_modules/@agnos-ui/core/components/slider/slider-utils.d.ts +0 -25
  67. package/node_modules/@agnos-ui/core/components/slider/slider.d.ts +0 -383
  68. package/node_modules/@agnos-ui/core/components/toast/index.cjs +0 -7
  69. package/node_modules/@agnos-ui/core/components/toast/index.d.ts +0 -2
  70. package/node_modules/@agnos-ui/core/components/toast/index.js +0 -7
  71. package/node_modules/@agnos-ui/core/components/toast/toast.d.ts +0 -66
  72. package/node_modules/@agnos-ui/core/components/toast/toaster.d.ts +0 -128
  73. package/node_modules/@agnos-ui/core/components/tree/index.cjs +0 -5
  74. package/node_modules/@agnos-ui/core/components/tree/index.d.ts +0 -1
  75. package/node_modules/@agnos-ui/core/components/tree/index.js +0 -5
  76. package/node_modules/@agnos-ui/core/components/tree/tree.d.ts +0 -143
  77. package/node_modules/@agnos-ui/core/config.cjs +0 -36
  78. package/node_modules/@agnos-ui/core/config.d.ts +0 -117
  79. package/node_modules/@agnos-ui/core/config.js +0 -36
  80. package/node_modules/@agnos-ui/core/directive-Bsreu2z1.js +0 -523
  81. package/node_modules/@agnos-ui/core/directive-DCaXmRe_.cjs +0 -522
  82. package/node_modules/@agnos-ui/core/drawer-BbFAHV07.cjs +0 -328
  83. package/node_modules/@agnos-ui/core/drawer-C6Qa0xEu.js +0 -329
  84. package/node_modules/@agnos-ui/core/index.cjs +0 -134
  85. package/node_modules/@agnos-ui/core/index.d.ts +0 -29
  86. package/node_modules/@agnos-ui/core/index.js +0 -134
  87. package/node_modules/@agnos-ui/core/isFocusable-Ckwus82R.js +0 -32
  88. package/node_modules/@agnos-ui/core/isFocusable-DfzDLeAN.cjs +0 -31
  89. package/node_modules/@agnos-ui/core/modal-BsNuHhT7.cjs +0 -252
  90. package/node_modules/@agnos-ui/core/modal-CgzY8ezz.js +0 -253
  91. package/node_modules/@agnos-ui/core/package.json +0 -57
  92. package/node_modules/@agnos-ui/core/pagination-ZxGaNWZz.js +0 -255
  93. package/node_modules/@agnos-ui/core/pagination-xbcOHnhd.cjs +0 -254
  94. package/node_modules/@agnos-ui/core/progressbar-CRbMKp4b.cjs +0 -86
  95. package/node_modules/@agnos-ui/core/progressbar-CSEIFnlD.js +0 -87
  96. package/node_modules/@agnos-ui/core/promise-CxCD3NYv.cjs +0 -118
  97. package/node_modules/@agnos-ui/core/promise-D-RZVPuv.js +0 -119
  98. package/node_modules/@agnos-ui/core/rating-BIdiiPUo.js +0 -184
  99. package/node_modules/@agnos-ui/core/rating-qx1xaBmz.cjs +0 -183
  100. package/node_modules/@agnos-ui/core/scrollbars-CT87iv_6.cjs +0 -30
  101. package/node_modules/@agnos-ui/core/scrollbars-CcxSrnCx.js +0 -31
  102. package/node_modules/@agnos-ui/core/services/extendWidget.cjs +0 -41
  103. package/node_modules/@agnos-ui/core/services/extendWidget.d.ts +0 -31
  104. package/node_modules/@agnos-ui/core/services/extendWidget.js +0 -41
  105. package/node_modules/@agnos-ui/core/services/floatingUI.cjs +0 -111
  106. package/node_modules/@agnos-ui/core/services/floatingUI.d.ts +0 -76
  107. package/node_modules/@agnos-ui/core/services/floatingUI.js +0 -111
  108. package/node_modules/@agnos-ui/core/services/focusElement.cjs +0 -46
  109. package/node_modules/@agnos-ui/core/services/focusElement.d.ts +0 -9
  110. package/node_modules/@agnos-ui/core/services/focusElement.js +0 -46
  111. package/node_modules/@agnos-ui/core/services/focustrack.cjs +0 -47
  112. package/node_modules/@agnos-ui/core/services/focustrack.d.ts +0 -40
  113. package/node_modules/@agnos-ui/core/services/focustrack.js +0 -47
  114. package/node_modules/@agnos-ui/core/services/hash.cjs +0 -15
  115. package/node_modules/@agnos-ui/core/services/hash.d.ts +0 -3
  116. package/node_modules/@agnos-ui/core/services/hash.js +0 -15
  117. package/node_modules/@agnos-ui/core/services/intersection.cjs +0 -53
  118. package/node_modules/@agnos-ui/core/services/intersection.d.ts +0 -30
  119. package/node_modules/@agnos-ui/core/services/intersection.js +0 -53
  120. package/node_modules/@agnos-ui/core/services/matchMedia.cjs +0 -14
  121. package/node_modules/@agnos-ui/core/services/matchMedia.d.ts +0 -8
  122. package/node_modules/@agnos-ui/core/services/matchMedia.js +0 -14
  123. package/node_modules/@agnos-ui/core/services/navManager.cjs +0 -166
  124. package/node_modules/@agnos-ui/core/services/navManager.d.ts +0 -144
  125. package/node_modules/@agnos-ui/core/services/navManager.js +0 -166
  126. package/node_modules/@agnos-ui/core/services/pointerdownPosition.cjs +0 -60
  127. package/node_modules/@agnos-ui/core/services/pointerdownPosition.d.ts +0 -42
  128. package/node_modules/@agnos-ui/core/services/pointerdownPosition.js +0 -60
  129. package/node_modules/@agnos-ui/core/services/portal.cjs +0 -42
  130. package/node_modules/@agnos-ui/core/services/portal.d.ts +0 -16
  131. package/node_modules/@agnos-ui/core/services/portal.js +0 -42
  132. package/node_modules/@agnos-ui/core/services/resizeObserver.cjs +0 -54
  133. package/node_modules/@agnos-ui/core/services/resizeObserver.d.ts +0 -18
  134. package/node_modules/@agnos-ui/core/services/resizeObserver.js +0 -54
  135. package/node_modules/@agnos-ui/core/services/siblingsInert.cjs +0 -44
  136. package/node_modules/@agnos-ui/core/services/siblingsInert.d.ts +0 -16
  137. package/node_modules/@agnos-ui/core/services/siblingsInert.js +0 -44
  138. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.cjs +0 -186
  139. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.d.ts +0 -166
  140. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.js +0 -186
  141. package/node_modules/@agnos-ui/core/services/transitions/collapse.cjs +0 -40
  142. package/node_modules/@agnos-ui/core/services/transitions/collapse.d.ts +0 -49
  143. package/node_modules/@agnos-ui/core/services/transitions/collapse.js +0 -40
  144. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.cjs +0 -32
  145. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.d.ts +0 -25
  146. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.js +0 -32
  147. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.cjs +0 -37
  148. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.d.ts +0 -47
  149. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.js +0 -37
  150. package/node_modules/@agnos-ui/core/slider-B93hE0ag.cjs +0 -807
  151. package/node_modules/@agnos-ui/core/slider-Cjiq9FgI.js +0 -808
  152. package/node_modules/@agnos-ui/core/textDirection-cNgt24LJ.js +0 -4
  153. package/node_modules/@agnos-ui/core/textDirection-zqcZ5-eK.cjs +0 -3
  154. package/node_modules/@agnos-ui/core/toaster-BQWqxYv-.cjs +0 -190
  155. package/node_modules/@agnos-ui/core/toaster-BzEkshT2.js +0 -191
  156. package/node_modules/@agnos-ui/core/tree-DY04XPPg.cjs +0 -228
  157. package/node_modules/@agnos-ui/core/tree-HwcvZ0_p.js +0 -229
  158. package/node_modules/@agnos-ui/core/types.cjs +0 -6
  159. package/node_modules/@agnos-ui/core/types.d.ts +0 -246
  160. package/node_modules/@agnos-ui/core/types.js +0 -6
  161. package/node_modules/@agnos-ui/core/utils/directive.cjs +0 -28
  162. package/node_modules/@agnos-ui/core/utils/directive.d.ts +0 -352
  163. package/node_modules/@agnos-ui/core/utils/directive.js +0 -28
  164. package/node_modules/@agnos-ui/core/utils/func.cjs +0 -7
  165. package/node_modules/@agnos-ui/core/utils/func.d.ts +0 -11
  166. package/node_modules/@agnos-ui/core/utils/func.js +0 -7
  167. package/node_modules/@agnos-ui/core/utils/id.cjs +0 -5
  168. package/node_modules/@agnos-ui/core/utils/id.d.ts +0 -6
  169. package/node_modules/@agnos-ui/core/utils/id.js +0 -5
  170. package/node_modules/@agnos-ui/core/utils/internal/assign.d.ts +0 -10
  171. package/node_modules/@agnos-ui/core/utils/internal/checks.d.ts +0 -57
  172. package/node_modules/@agnos-ui/core/utils/internal/dom.d.ts +0 -75
  173. package/node_modules/@agnos-ui/core/utils/internal/isFocusable.d.ts +0 -9
  174. package/node_modules/@agnos-ui/core/utils/internal/math.d.ts +0 -5
  175. package/node_modules/@agnos-ui/core/utils/internal/promise.d.ts +0 -98
  176. package/node_modules/@agnos-ui/core/utils/internal/scrollbars.d.ts +0 -8
  177. package/node_modules/@agnos-ui/core/utils/internal/sort.d.ts +0 -16
  178. package/node_modules/@agnos-ui/core/utils/internal/ssrHTMLElement.d.ts +0 -17
  179. package/node_modules/@agnos-ui/core/utils/internal/textDirection.d.ts +0 -7
  180. package/node_modules/@agnos-ui/core/utils/internal/traversal.d.ts +0 -54
  181. package/node_modules/@agnos-ui/core/utils/stores.cjs +0 -172
  182. package/node_modules/@agnos-ui/core/utils/stores.d.ts +0 -224
  183. package/node_modules/@agnos-ui/core/utils/stores.js +0 -172
  184. package/node_modules/@agnos-ui/core/utils/widget.cjs +0 -8
  185. package/node_modules/@agnos-ui/core/utils/widget.d.ts +0 -11
  186. package/node_modules/@agnos-ui/core/utils/widget.js +0 -8
  187. package/node_modules/@agnos-ui/core/utils/writables.cjs +0 -16
  188. package/node_modules/@agnos-ui/core/utils/writables.d.ts +0 -95
  189. package/node_modules/@agnos-ui/core/utils/writables.js +0 -16
  190. package/node_modules/@agnos-ui/core/writables-DYGjj5T3.js +0 -103
  191. package/node_modules/@agnos-ui/core/writables-Dt68gADJ.cjs +0 -102
@@ -1,328 +0,0 @@
1
- "use strict";
2
- const tansu = require("@amadeus-it-group/tansu");
3
- const services_focusElement = require("./services/focusElement.cjs");
4
- const services_pointerdownPosition = require("./services/pointerdownPosition.cjs");
5
- const services_portal = require("./services/portal.cjs");
6
- const services_siblingsInert = require("./services/siblingsInert.cjs");
7
- const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
8
- const utils_directive = require("./directive-DCaXmRe_.cjs");
9
- const utils_func = require("./utils/func.cjs");
10
- const scrollbars = require("./scrollbars-CT87iv_6.cjs");
11
- const utils_stores = require("./utils/stores.cjs");
12
- const utils_widget = require("./utils/widget.cjs");
13
- const utils_writables = require("./writables-Dt68gADJ.cjs");
14
- const textDirection = require("./textDirection-zqcZ5-eK.cjs");
15
- function getDrawerDefaultConfig() {
16
- return {
17
- ...defaultDrawerConfig
18
- };
19
- }
20
- const defaultDrawerConfig = {
21
- animated: true,
22
- ariaDescribedBy: "",
23
- ariaLabelledBy: "",
24
- backdropClass: "",
25
- backdropTransition: utils_func.noop,
26
- className: "",
27
- visible: false,
28
- container: typeof window !== "undefined" ? document.body : null,
29
- transition: utils_func.noop,
30
- verticalTransition: utils_func.noop,
31
- onHidden: utils_func.noop,
32
- onShown: utils_func.noop,
33
- onSizeChange: utils_func.noop,
34
- onVisibleChange: utils_func.noop,
35
- onMinimizedChange: utils_func.noop,
36
- onMaximizedChange: utils_func.noop,
37
- onResizingChange: utils_func.noop,
38
- resizable: false,
39
- backdrop: true,
40
- bodyScroll: false,
41
- size: null,
42
- focusOnInit: true,
43
- configuration: "overlay",
44
- position: "inline-start"
45
- };
46
- const configValidator = {
47
- animated: utils_writables.typeBoolean,
48
- ariaDescribedBy: utils_writables.typeString,
49
- ariaLabelledBy: utils_writables.typeString,
50
- backdropClass: utils_writables.typeString,
51
- backdropTransition: utils_writables.typeFunction,
52
- className: utils_writables.typeString,
53
- visible: utils_writables.typeBoolean,
54
- transition: utils_writables.typeFunction,
55
- verticalTransition: utils_writables.typeFunction,
56
- container: utils_writables.typeHTMLElementOrNull,
57
- onHidden: utils_writables.typeFunction,
58
- onShown: utils_writables.typeFunction,
59
- onSizeChange: utils_writables.typeFunction,
60
- onVisibleChange: utils_writables.typeFunction,
61
- onMinimizedChange: utils_writables.typeFunction,
62
- onMaximizedChange: utils_writables.typeFunction,
63
- onResizingChange: utils_writables.typeFunction,
64
- resizable: utils_writables.typeBoolean,
65
- backdrop: utils_writables.typeBoolean,
66
- bodyScroll: utils_writables.typeBoolean,
67
- size: utils_writables.typeNumberOrNull,
68
- focusOnInit: utils_writables.typeBoolean,
69
- configuration: utils_writables.createTypeEnum(["inline", "overlay"]),
70
- position: utils_writables.createTypeEnum(["inline-start", "inline-end", "block-start", "block-end"])
71
- };
72
- const createDrawer = utils_widget.createWidgetFactory(
73
- "drawer",
74
- (config) => {
75
- const [
76
- {
77
- backdrop$: _backdrop$,
78
- backdropTransition$,
79
- backdropClass$,
80
- bodyScroll$: _bodyScroll$,
81
- transition$,
82
- verticalTransition$,
83
- visible$: requestedVisible$,
84
- container$: _container$,
85
- className$,
86
- size$: _dirtySize$,
87
- animated$,
88
- ariaDescribedBy$,
89
- ariaLabelledBy$,
90
- onHidden$,
91
- onShown$,
92
- onSizeChange$,
93
- onVisibleChange$,
94
- onMinimizedChange$,
95
- onMaximizedChange$,
96
- onResizingChange$,
97
- focusOnInit$,
98
- configuration$,
99
- position$,
100
- ...stateProps
101
- },
102
- patch
103
- ] = utils_stores.writablesForProps(defaultDrawerConfig, config, configValidator);
104
- const inline$ = tansu.computed(() => configuration$() === "inline");
105
- const backdrop$ = tansu.computed(() => inline$() ? false : _backdrop$());
106
- const bodyScroll$ = tansu.computed(() => inline$() ? true : _bodyScroll$());
107
- const container$ = tansu.computed(() => inline$() ? null : _container$());
108
- const size$ = utils_stores.bindableProp(_dirtySize$, onSizeChange$, (value) => value ? Math.round(value) : value);
109
- const isVertical$ = tansu.computed(() => {
110
- const position = position$();
111
- return position === "block-start" || position === "block-end";
112
- });
113
- const combinedClass$ = tansu.computed(() => `df-${position$()} ${className$()}`);
114
- const transition = services_transitions_baseTransitions.createTransition({
115
- props: {
116
- animated: animated$,
117
- animatedOnInit: animated$,
118
- transition: tansu.asWritable(tansu.computed(() => isVertical$() ? verticalTransition$() : transition$())),
119
- visible: requestedVisible$,
120
- onVisibleChange: onVisibleChange$,
121
- onHidden: onHidden$,
122
- onShown: onShown$
123
- }
124
- });
125
- const drawerPortalDirective = utils_directive.bindDirective(
126
- services_portal.portal,
127
- tansu.computed(() => ({ container: container$() }))
128
- );
129
- const { directive: drawerElementDirective, element$: drawerElement$ } = utils_directive.createBrowserStoreDirective();
130
- const drawerAttributeDirective = utils_directive.mergeDirectives(
131
- drawerElementDirective,
132
- utils_directive.createAttributesDirective(() => ({
133
- attributes: {
134
- class: combinedClass$,
135
- role: tansu.computed(() => inline$() ? "complementary" : "dialog"),
136
- "aria-describedby": tansu.computed(() => ariaDescribedBy$() || void 0),
137
- "aria-labelledby": tansu.computed(() => ariaLabelledBy$() || void 0),
138
- "aria-modal": tansu.computed(() => inline$() ? void 0 : "true"),
139
- tabIndex: tansu.readable("-1")
140
- },
141
- styles: {
142
- position: tansu.computed(() => {
143
- if (inline$()) {
144
- return "relative";
145
- }
146
- const container = container$();
147
- return container && utils_directive.isBrowserHTMLElement(container) && container !== document.body ? "relative" : "fixed";
148
- }),
149
- outline: tansu.readable("none")
150
- },
151
- events: {
152
- keydown: (e) => {
153
- if (e.key === "Escape") {
154
- void transition.api.hide();
155
- }
156
- }
157
- }
158
- }))
159
- );
160
- const backdropTransition = services_transitions_baseTransitions.createTransition({
161
- props: {
162
- animated: animated$,
163
- transition: backdropTransition$
164
- }
165
- });
166
- const backdropPortalDirective = utils_directive.bindDirective(
167
- services_portal.portal,
168
- tansu.computed(() => {
169
- const container = container$();
170
- const element = container ? transition.stores.element$() : void 0;
171
- return {
172
- container,
173
- insertBefore: element?.parentElement === container ? element : void 0
174
- };
175
- })
176
- );
177
- const backdropHidden$ = tansu.computed(() => {
178
- if (!bodyScroll$()) {
179
- if (hidden$()) {
180
- scrollbars.revertScrollbars();
181
- } else {
182
- scrollbars.removeScrollbars();
183
- }
184
- }
185
- return !backdrop$() || hidden$();
186
- });
187
- const backdropAttributeDirective = utils_directive.createAttributesDirective(() => ({
188
- attributes: {
189
- class: backdropClass$,
190
- "data-agnos-ignore-inert": utils_stores.true$
191
- },
192
- events: {
193
- click: () => void transition.api.hide()
194
- }
195
- }));
196
- const direction$ = tansu.computed(() => {
197
- const position = position$();
198
- return position === "inline-start" || position === "block-start" ? 1 : -1;
199
- });
200
- const isMinimized$ = tansu.writable(void 0);
201
- const isMaximized$ = tansu.writable(void 0);
202
- function setSize(size) {
203
- const drawerElement = drawerElement$();
204
- const isVertical = isVertical$();
205
- size = Math.round(Math.max(0, size));
206
- drawerElement.style[isVertical ? "height" : "width"] = `${size}px`;
207
- const elementSize = Math.round(drawerElement[isVertical ? "offsetHeight" : "offsetWidth"]);
208
- size$.set(elementSize);
209
- isMinimized$.set(size != null && (size < elementSize || size === 0));
210
- isMaximized$.set(!!size && size > elementSize);
211
- return elementSize;
212
- }
213
- const splitterDirective = utils_directive.mergeDirectives(
214
- services_pointerdownPosition.createPointerdownPositionDirective((event) => {
215
- const drawerElement = drawerElement$();
216
- const isVertical = isVertical$();
217
- const documentDirection = textDirection.getTextDirection(drawerElement) === "ltr" ? 1 : -1;
218
- const directionFactor = isVertical ? 1 : documentDirection;
219
- const startSize = drawerElement[isVertical ? "offsetHeight" : "offsetWidth"];
220
- const clientXorY = isVertical ? "clientY" : "clientX";
221
- const startPos = event[clientXorY];
222
- const direction = direction$();
223
- let isResizing = false;
224
- return {
225
- onMove(event2) {
226
- setSize(startSize + directionFactor * direction * (event2[clientXorY] - startPos));
227
- if (!isResizing) {
228
- isResizing = true;
229
- onResizingChange$()(true);
230
- }
231
- },
232
- onEnd() {
233
- drawerElement.style[isVertical ? "height" : "width"] = "";
234
- if (isResizing) {
235
- onResizingChange$()(false);
236
- isResizing = false;
237
- }
238
- }
239
- };
240
- }),
241
- utils_directive.createAttributesDirective(() => ({
242
- events: {
243
- keydown: (e) => {
244
- const { key } = e;
245
- const size = size$() || drawerElement$()?.[isVertical$() ? "offsetHeight" : "offsetWidth"];
246
- if (size != null) {
247
- switch (key) {
248
- case "ArrowLeft":
249
- case "ArrowDown":
250
- onResizingChange$()(true);
251
- setSize(size - 10);
252
- onResizingChange$()(false);
253
- break;
254
- case "ArrowRight":
255
- case "ArrowUp":
256
- onResizingChange$()(true);
257
- setSize(size + 10);
258
- onResizingChange$()(false);
259
- break;
260
- }
261
- }
262
- }
263
- }
264
- }))
265
- );
266
- const visible$ = transition.stores.visible$;
267
- const transitioning$ = tansu.computed(
268
- () => transition.stores.transitioning$() || backdropTransition.stores.transitioning$()
269
- );
270
- const hidden$ = tansu.computed(() => !transitioning$() && !visible$());
271
- const minSizeAction$ = tansu.computed(() => {
272
- const isMinimized = isMinimized$();
273
- if (isMinimized != null) {
274
- tansu.untrack(() => onMinimizedChange$()(isMinimized));
275
- }
276
- });
277
- const maxSizeAction$ = tansu.computed(() => {
278
- const isMaximized = isMaximized$();
279
- if (isMaximized != null) {
280
- tansu.untrack(() => onMaximizedChange$()(isMaximized));
281
- }
282
- });
283
- const action$ = tansu.computed(() => {
284
- minSizeAction$();
285
- maxSizeAction$();
286
- });
287
- const widget = {
288
- ...utils_stores.stateStores({
289
- ...stateProps,
290
- backdropClass$,
291
- className$,
292
- position$,
293
- container$,
294
- size$,
295
- visible$,
296
- backdropHidden$,
297
- hidden$,
298
- isVertical$,
299
- configuration$
300
- }),
301
- patch,
302
- api: {
303
- open: transition.api.show,
304
- close: transition.api.hide
305
- },
306
- directives: {
307
- drawerPortalDirective,
308
- drawerDirective: utils_directive.mergeDirectives(
309
- utils_directive.directiveSubscribe(action$),
310
- drawerAttributeDirective,
311
- utils_directive.bindDirective(
312
- services_siblingsInert.siblingsInert,
313
- tansu.computed(() => !bodyScroll$())
314
- ),
315
- // This directive must come after the attribute directive, to ensure that all the classes and attributes are applied for the transition
316
- transition.directives.directive,
317
- utils_directive.conditionalDirective(services_focusElement.focusElement, focusOnInit$)
318
- ),
319
- backdropPortalDirective,
320
- backdropDirective: utils_directive.mergeDirectives(backdropTransition.directives.directive, backdropAttributeDirective),
321
- splitterDirective
322
- }
323
- };
324
- return widget;
325
- }
326
- );
327
- exports.createDrawer = createDrawer;
328
- exports.getDrawerDefaultConfig = getDrawerDefaultConfig;
@@ -1,329 +0,0 @@
1
- import { computed, asWritable, readable, writable, untrack } from "@amadeus-it-group/tansu";
2
- import { focusElement } from "./services/focusElement.js";
3
- import { createPointerdownPositionDirective } from "./services/pointerdownPosition.js";
4
- import { portal } from "./services/portal.js";
5
- import { siblingsInert } from "./services/siblingsInert.js";
6
- import { createTransition } from "./services/transitions/baseTransitions.js";
7
- import { b as bindDirective, i as createBrowserStoreDirective, s as mergeDirectives, g as createAttributesDirective, q as isBrowserHTMLElement, f as conditionalDirective, o as directiveSubscribe } from "./directive-Bsreu2z1.js";
8
- import { noop } from "./utils/func.js";
9
- import { a as revertScrollbars, r as removeScrollbars } from "./scrollbars-CcxSrnCx.js";
10
- import { writablesForProps, bindableProp, stateStores, true$ } from "./utils/stores.js";
11
- import { createWidgetFactory } from "./utils/widget.js";
12
- import { b as typeBoolean, i as typeNumberOrNull, e as typeFunction, f as typeHTMLElementOrNull, j as typeString, c as createTypeEnum } from "./writables-DYGjj5T3.js";
13
- import { g as getTextDirection } from "./textDirection-cNgt24LJ.js";
14
- function getDrawerDefaultConfig() {
15
- return {
16
- ...defaultDrawerConfig
17
- };
18
- }
19
- const defaultDrawerConfig = {
20
- animated: true,
21
- ariaDescribedBy: "",
22
- ariaLabelledBy: "",
23
- backdropClass: "",
24
- backdropTransition: noop,
25
- className: "",
26
- visible: false,
27
- container: typeof window !== "undefined" ? document.body : null,
28
- transition: noop,
29
- verticalTransition: noop,
30
- onHidden: noop,
31
- onShown: noop,
32
- onSizeChange: noop,
33
- onVisibleChange: noop,
34
- onMinimizedChange: noop,
35
- onMaximizedChange: noop,
36
- onResizingChange: noop,
37
- resizable: false,
38
- backdrop: true,
39
- bodyScroll: false,
40
- size: null,
41
- focusOnInit: true,
42
- configuration: "overlay",
43
- position: "inline-start"
44
- };
45
- const configValidator = {
46
- animated: typeBoolean,
47
- ariaDescribedBy: typeString,
48
- ariaLabelledBy: typeString,
49
- backdropClass: typeString,
50
- backdropTransition: typeFunction,
51
- className: typeString,
52
- visible: typeBoolean,
53
- transition: typeFunction,
54
- verticalTransition: typeFunction,
55
- container: typeHTMLElementOrNull,
56
- onHidden: typeFunction,
57
- onShown: typeFunction,
58
- onSizeChange: typeFunction,
59
- onVisibleChange: typeFunction,
60
- onMinimizedChange: typeFunction,
61
- onMaximizedChange: typeFunction,
62
- onResizingChange: typeFunction,
63
- resizable: typeBoolean,
64
- backdrop: typeBoolean,
65
- bodyScroll: typeBoolean,
66
- size: typeNumberOrNull,
67
- focusOnInit: typeBoolean,
68
- configuration: createTypeEnum(["inline", "overlay"]),
69
- position: createTypeEnum(["inline-start", "inline-end", "block-start", "block-end"])
70
- };
71
- const createDrawer = createWidgetFactory(
72
- "drawer",
73
- (config) => {
74
- const [
75
- {
76
- backdrop$: _backdrop$,
77
- backdropTransition$,
78
- backdropClass$,
79
- bodyScroll$: _bodyScroll$,
80
- transition$,
81
- verticalTransition$,
82
- visible$: requestedVisible$,
83
- container$: _container$,
84
- className$,
85
- size$: _dirtySize$,
86
- animated$,
87
- ariaDescribedBy$,
88
- ariaLabelledBy$,
89
- onHidden$,
90
- onShown$,
91
- onSizeChange$,
92
- onVisibleChange$,
93
- onMinimizedChange$,
94
- onMaximizedChange$,
95
- onResizingChange$,
96
- focusOnInit$,
97
- configuration$,
98
- position$,
99
- ...stateProps
100
- },
101
- patch
102
- ] = writablesForProps(defaultDrawerConfig, config, configValidator);
103
- const inline$ = computed(() => configuration$() === "inline");
104
- const backdrop$ = computed(() => inline$() ? false : _backdrop$());
105
- const bodyScroll$ = computed(() => inline$() ? true : _bodyScroll$());
106
- const container$ = computed(() => inline$() ? null : _container$());
107
- const size$ = bindableProp(_dirtySize$, onSizeChange$, (value) => value ? Math.round(value) : value);
108
- const isVertical$ = computed(() => {
109
- const position = position$();
110
- return position === "block-start" || position === "block-end";
111
- });
112
- const combinedClass$ = computed(() => `df-${position$()} ${className$()}`);
113
- const transition = createTransition({
114
- props: {
115
- animated: animated$,
116
- animatedOnInit: animated$,
117
- transition: asWritable(computed(() => isVertical$() ? verticalTransition$() : transition$())),
118
- visible: requestedVisible$,
119
- onVisibleChange: onVisibleChange$,
120
- onHidden: onHidden$,
121
- onShown: onShown$
122
- }
123
- });
124
- const drawerPortalDirective = bindDirective(
125
- portal,
126
- computed(() => ({ container: container$() }))
127
- );
128
- const { directive: drawerElementDirective, element$: drawerElement$ } = createBrowserStoreDirective();
129
- const drawerAttributeDirective = mergeDirectives(
130
- drawerElementDirective,
131
- createAttributesDirective(() => ({
132
- attributes: {
133
- class: combinedClass$,
134
- role: computed(() => inline$() ? "complementary" : "dialog"),
135
- "aria-describedby": computed(() => ariaDescribedBy$() || void 0),
136
- "aria-labelledby": computed(() => ariaLabelledBy$() || void 0),
137
- "aria-modal": computed(() => inline$() ? void 0 : "true"),
138
- tabIndex: readable("-1")
139
- },
140
- styles: {
141
- position: computed(() => {
142
- if (inline$()) {
143
- return "relative";
144
- }
145
- const container = container$();
146
- return container && isBrowserHTMLElement(container) && container !== document.body ? "relative" : "fixed";
147
- }),
148
- outline: readable("none")
149
- },
150
- events: {
151
- keydown: (e) => {
152
- if (e.key === "Escape") {
153
- void transition.api.hide();
154
- }
155
- }
156
- }
157
- }))
158
- );
159
- const backdropTransition = createTransition({
160
- props: {
161
- animated: animated$,
162
- transition: backdropTransition$
163
- }
164
- });
165
- const backdropPortalDirective = bindDirective(
166
- portal,
167
- computed(() => {
168
- const container = container$();
169
- const element = container ? transition.stores.element$() : void 0;
170
- return {
171
- container,
172
- insertBefore: element?.parentElement === container ? element : void 0
173
- };
174
- })
175
- );
176
- const backdropHidden$ = computed(() => {
177
- if (!bodyScroll$()) {
178
- if (hidden$()) {
179
- revertScrollbars();
180
- } else {
181
- removeScrollbars();
182
- }
183
- }
184
- return !backdrop$() || hidden$();
185
- });
186
- const backdropAttributeDirective = createAttributesDirective(() => ({
187
- attributes: {
188
- class: backdropClass$,
189
- "data-agnos-ignore-inert": true$
190
- },
191
- events: {
192
- click: () => void transition.api.hide()
193
- }
194
- }));
195
- const direction$ = computed(() => {
196
- const position = position$();
197
- return position === "inline-start" || position === "block-start" ? 1 : -1;
198
- });
199
- const isMinimized$ = writable(void 0);
200
- const isMaximized$ = writable(void 0);
201
- function setSize(size) {
202
- const drawerElement = drawerElement$();
203
- const isVertical = isVertical$();
204
- size = Math.round(Math.max(0, size));
205
- drawerElement.style[isVertical ? "height" : "width"] = `${size}px`;
206
- const elementSize = Math.round(drawerElement[isVertical ? "offsetHeight" : "offsetWidth"]);
207
- size$.set(elementSize);
208
- isMinimized$.set(size != null && (size < elementSize || size === 0));
209
- isMaximized$.set(!!size && size > elementSize);
210
- return elementSize;
211
- }
212
- const splitterDirective = mergeDirectives(
213
- createPointerdownPositionDirective((event) => {
214
- const drawerElement = drawerElement$();
215
- const isVertical = isVertical$();
216
- const documentDirection = getTextDirection(drawerElement) === "ltr" ? 1 : -1;
217
- const directionFactor = isVertical ? 1 : documentDirection;
218
- const startSize = drawerElement[isVertical ? "offsetHeight" : "offsetWidth"];
219
- const clientXorY = isVertical ? "clientY" : "clientX";
220
- const startPos = event[clientXorY];
221
- const direction = direction$();
222
- let isResizing = false;
223
- return {
224
- onMove(event2) {
225
- setSize(startSize + directionFactor * direction * (event2[clientXorY] - startPos));
226
- if (!isResizing) {
227
- isResizing = true;
228
- onResizingChange$()(true);
229
- }
230
- },
231
- onEnd() {
232
- drawerElement.style[isVertical ? "height" : "width"] = "";
233
- if (isResizing) {
234
- onResizingChange$()(false);
235
- isResizing = false;
236
- }
237
- }
238
- };
239
- }),
240
- createAttributesDirective(() => ({
241
- events: {
242
- keydown: (e) => {
243
- const { key } = e;
244
- const size = size$() || drawerElement$()?.[isVertical$() ? "offsetHeight" : "offsetWidth"];
245
- if (size != null) {
246
- switch (key) {
247
- case "ArrowLeft":
248
- case "ArrowDown":
249
- onResizingChange$()(true);
250
- setSize(size - 10);
251
- onResizingChange$()(false);
252
- break;
253
- case "ArrowRight":
254
- case "ArrowUp":
255
- onResizingChange$()(true);
256
- setSize(size + 10);
257
- onResizingChange$()(false);
258
- break;
259
- }
260
- }
261
- }
262
- }
263
- }))
264
- );
265
- const visible$ = transition.stores.visible$;
266
- const transitioning$ = computed(
267
- () => transition.stores.transitioning$() || backdropTransition.stores.transitioning$()
268
- );
269
- const hidden$ = computed(() => !transitioning$() && !visible$());
270
- const minSizeAction$ = computed(() => {
271
- const isMinimized = isMinimized$();
272
- if (isMinimized != null) {
273
- untrack(() => onMinimizedChange$()(isMinimized));
274
- }
275
- });
276
- const maxSizeAction$ = computed(() => {
277
- const isMaximized = isMaximized$();
278
- if (isMaximized != null) {
279
- untrack(() => onMaximizedChange$()(isMaximized));
280
- }
281
- });
282
- const action$ = computed(() => {
283
- minSizeAction$();
284
- maxSizeAction$();
285
- });
286
- const widget = {
287
- ...stateStores({
288
- ...stateProps,
289
- backdropClass$,
290
- className$,
291
- position$,
292
- container$,
293
- size$,
294
- visible$,
295
- backdropHidden$,
296
- hidden$,
297
- isVertical$,
298
- configuration$
299
- }),
300
- patch,
301
- api: {
302
- open: transition.api.show,
303
- close: transition.api.hide
304
- },
305
- directives: {
306
- drawerPortalDirective,
307
- drawerDirective: mergeDirectives(
308
- directiveSubscribe(action$),
309
- drawerAttributeDirective,
310
- bindDirective(
311
- siblingsInert,
312
- computed(() => !bodyScroll$())
313
- ),
314
- // This directive must come after the attribute directive, to ensure that all the classes and attributes are applied for the transition
315
- transition.directives.directive,
316
- conditionalDirective(focusElement, focusOnInit$)
317
- ),
318
- backdropPortalDirective,
319
- backdropDirective: mergeDirectives(backdropTransition.directives.directive, backdropAttributeDirective),
320
- splitterDirective
321
- }
322
- };
323
- return widget;
324
- }
325
- );
326
- export {
327
- createDrawer as c,
328
- getDrawerDefaultConfig as g
329
- };