@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,253 +0,0 @@
1
- import { computed, readable } from "@amadeus-it-group/tansu";
2
- import { b as typeBoolean, e as typeFunction, j as typeString, f as typeHTMLElementOrNull } from "./writables-DYGjj5T3.js";
3
- import { writablesForProps, stateStores } from "./utils/stores.js";
4
- import { createTransition } from "./services/transitions/baseTransitions.js";
5
- import { p as promiseFromStore } from "./promise-D-RZVPuv.js";
6
- import { noop } from "./utils/func.js";
7
- import { r as removeScrollbars, a as revertScrollbars } from "./scrollbars-CcxSrnCx.js";
8
- import { u as registrationArray, b as bindDirective, g as createAttributesDirective, d as browserDirective, s as mergeDirectives, o as directiveSubscribe, c as bindDirectiveNoArg } from "./directive-Bsreu2z1.js";
9
- import { portal } from "./services/portal.js";
10
- import { siblingsInert } from "./services/siblingsInert.js";
11
- import { createWidgetFactory } from "./utils/widget.js";
12
- import { focusElement } from "./services/focusElement.js";
13
- const modalOutsideClick = /* @__PURE__ */ Symbol();
14
- const modalCloseButtonClick = /* @__PURE__ */ Symbol();
15
- const modalCloseEscape = /* @__PURE__ */ Symbol();
16
- const defaultConfig = {
17
- animated: true,
18
- ariaCloseButtonLabel: "Close",
19
- backdrop: true,
20
- backdropClass: "",
21
- backdropTransition: noop,
22
- closeButton: true,
23
- closeOnOutsideClick: true,
24
- container: typeof window !== "undefined" ? document.body : null,
25
- className: "",
26
- modalTransition: noop,
27
- onBeforeClose: noop,
28
- onVisibleChange: noop,
29
- onHidden: noop,
30
- onShown: noop,
31
- visible: false
32
- };
33
- const configValidator = {
34
- animated: typeBoolean,
35
- ariaCloseButtonLabel: typeString,
36
- backdrop: typeBoolean,
37
- backdropClass: typeString,
38
- backdropTransition: typeFunction,
39
- closeButton: typeBoolean,
40
- closeOnOutsideClick: typeBoolean,
41
- container: typeHTMLElementOrNull,
42
- className: typeString,
43
- modalTransition: typeFunction,
44
- onBeforeClose: typeFunction,
45
- onVisibleChange: typeFunction,
46
- onHidden: typeFunction,
47
- onShown: typeFunction,
48
- visible: typeBoolean
49
- };
50
- function getModalDefaultConfig() {
51
- return { ...defaultConfig };
52
- }
53
- const modals$ = registrationArray();
54
- const hasModals$ = computed(() => modals$().length > 0);
55
- const scrollbarsAction$ = computed(() => {
56
- if (hasModals$()) {
57
- removeScrollbars();
58
- } else {
59
- revertScrollbars();
60
- }
61
- });
62
- const modalsAction$ = computed(() => {
63
- scrollbarsAction$();
64
- });
65
- const createModal = createWidgetFactory(
66
- "modal",
67
- (config$) => {
68
- const [
69
- {
70
- animated$,
71
- backdrop$,
72
- backdropTransition$,
73
- closeOnOutsideClick$,
74
- container$,
75
- modalTransition$,
76
- onBeforeClose$,
77
- onVisibleChange$,
78
- onHidden$,
79
- onShown$,
80
- ariaCloseButtonLabel$,
81
- className$,
82
- backdropClass$,
83
- visible$: requestedVisible$,
84
- ...stateProps
85
- },
86
- patch
87
- ] = writablesForProps(defaultConfig, config$, configValidator);
88
- const modalTransition = createTransition({
89
- props: {
90
- transition: modalTransition$,
91
- visible: requestedVisible$,
92
- animated: animated$,
93
- animatedOnInit: animated$,
94
- onVisibleChange: onVisibleChange$,
95
- // TODO: for onHidden and onShown, should we combine with information from the backdrop transition?
96
- // (especially in case one of the two transitions takes more time than the other)
97
- onHidden: onHidden$,
98
- onShown: onShown$
99
- }
100
- });
101
- const visible$ = modalTransition.stores.visible$;
102
- const backdropTransition = createTransition({
103
- props: {
104
- transition: backdropTransition$,
105
- visible: requestedVisible$,
106
- animated: animated$,
107
- animatedOnInit: animated$
108
- }
109
- });
110
- const transitioning$ = computed(
111
- () => modalTransition.stores.transitioning$() || backdrop$() && backdropTransition.stores.transitioning$()
112
- );
113
- const hidden$ = computed(() => !transitioning$() && !visible$());
114
- const backdropHidden$ = computed(() => !backdrop$() || hidden$());
115
- let hideResult;
116
- const close = (result) => {
117
- hideResult = result;
118
- const beforeCloseEvent = {
119
- get result() {
120
- return hideResult;
121
- },
122
- set result(value) {
123
- hideResult = value;
124
- },
125
- cancel: false
126
- };
127
- onBeforeClose$()(beforeCloseEvent);
128
- if (beforeCloseEvent.cancel) {
129
- return;
130
- }
131
- patch({ visible: false });
132
- };
133
- const modalPortalDirective = bindDirective(
134
- portal,
135
- computed(() => ({ container: container$() }))
136
- );
137
- const backdropPortalDirective = bindDirective(
138
- portal,
139
- computed(() => {
140
- const container = container$();
141
- const element = container ? modalTransition.stores.element$() : void 0;
142
- return {
143
- container,
144
- insertBefore: element?.parentElement === container ? element : void 0
145
- };
146
- })
147
- );
148
- const registerModalAction$ = readable(void 0, () => modals$.register(res));
149
- const action$ = computed(() => {
150
- if (modalTransition.stores.elementPresent$() && !hidden$()) {
151
- registerModalAction$();
152
- }
153
- modalsAction$();
154
- });
155
- const closeButtonDirective = createAttributesDirective(() => ({
156
- attributes: {
157
- type: readable("button"),
158
- "aria-label": ariaCloseButtonLabel$
159
- },
160
- events: {
161
- click: () => close(modalCloseButtonClick)
162
- }
163
- }));
164
- const backdropAttributeDirective = createAttributesDirective(() => ({
165
- attributes: {
166
- class: backdropClass$
167
- }
168
- }));
169
- const modalAttributeDirective = createAttributesDirective(() => ({
170
- attributes: {
171
- class: className$,
172
- tabIndex: readable("-1")
173
- },
174
- events: {
175
- click: (event) => {
176
- if (event.currentTarget === event.target && closeOnOutsideClick$()) {
177
- close(modalOutsideClick);
178
- }
179
- },
180
- keydown: (event) => {
181
- const { key } = event;
182
- switch (key) {
183
- case "Escape":
184
- close(modalCloseEscape);
185
- event.stopPropagation();
186
- break;
187
- }
188
- }
189
- }
190
- }));
191
- const res = {
192
- ...stateStores({
193
- backdropHidden$,
194
- container$,
195
- hidden$,
196
- transitioning$,
197
- visible$,
198
- modalElement$: modalTransition.stores.element$,
199
- ariaCloseButtonLabel$,
200
- className$,
201
- backdropClass$,
202
- ...stateProps
203
- }),
204
- directives: {
205
- modalPortalDirective,
206
- backdropPortalDirective,
207
- backdropDirective: mergeDirectives(backdropTransition.directives.directive, backdropAttributeDirective),
208
- modalDirective: mergeDirectives(
209
- modalTransition.directives.directive,
210
- bindDirectiveNoArg(siblingsInert),
211
- directiveSubscribe(action$),
212
- modalAttributeDirective,
213
- focusElement
214
- ),
215
- closeButtonDirective,
216
- dialogDirective: bindDirective(
217
- browserDirective((dialog, visible) => {
218
- const update = (visible2) => {
219
- if (visible2) {
220
- dialog.showModal();
221
- } else {
222
- dialog.close();
223
- }
224
- };
225
- update(visible);
226
- return {
227
- update
228
- };
229
- }),
230
- visible$
231
- )
232
- },
233
- patch,
234
- api: {
235
- close,
236
- async open() {
237
- patch({ visible: true });
238
- await promiseFromStore(hidden$).promise;
239
- return hideResult;
240
- },
241
- patch
242
- }
243
- };
244
- return res;
245
- }
246
- );
247
- export {
248
- modalCloseEscape as a,
249
- modalOutsideClick as b,
250
- createModal as c,
251
- getModalDefaultConfig as g,
252
- modalCloseButtonClick as m
253
- };
@@ -1,57 +0,0 @@
1
- {
2
- "name": "@agnos-ui/core",
3
- "description": "Framework-agnostic headless component library.",
4
- "version": "0.0.0",
5
- "private": true,
6
- "type": "module",
7
- "main": "./index.cjs",
8
- "module": "./index.js",
9
- "types": "./index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./index.d.ts",
13
- "require": "./index.cjs",
14
- "default": "./index.js"
15
- },
16
- "./components/*": {
17
- "types": "./components/*/index.d.ts",
18
- "require": "./components/*/index.cjs",
19
- "default": "./components/*/index.js"
20
- },
21
- "./config": {
22
- "types": "./config.d.ts",
23
- "require": "./config.cjs",
24
- "default": "./config.js"
25
- },
26
- "./types": {
27
- "types": "./types.d.ts",
28
- "require": "./types.cjs",
29
- "default": "./types.js"
30
- },
31
- "./services/*": {
32
- "types": "./services/*.d.ts",
33
- "require": "./services/*.cjs",
34
- "default": "./services/*.js"
35
- },
36
- "./services/transitions/*": {
37
- "types": "./services/transitions/*.d.ts",
38
- "require": "./services/transitions/*.cjs",
39
- "default": "./services/transitions/*.js"
40
- },
41
- "./utils/*": {
42
- "types": "./utils/*.d.ts",
43
- "require": "./utils/*.cjs",
44
- "default": "./utils/*.js"
45
- }
46
- },
47
- "dependencies": {
48
- "clsx": "^2.1.1"
49
- },
50
- "peerDependencies": {
51
- "@amadeus-it-group/tansu": "^2.0.0",
52
- "@floating-ui/dom": "^1.6.12",
53
- "embla-carousel": "^8.5.2",
54
- "esm-env": "^1.2.1"
55
- },
56
- "sideEffects": false
57
- }
@@ -1,255 +0,0 @@
1
- import { computed } from "@amadeus-it-group/tansu";
2
- import { writablesForProps, bindableProp, stateStores, true$ } from "./utils/stores.js";
3
- import { j as typeString, e as typeFunction, b as typeBoolean, g as typeNumber, l as clamp, m as isNumber } from "./writables-DYGjj5T3.js";
4
- import { noop } from "./utils/func.js";
5
- import { g as createAttributesDirective } from "./directive-Bsreu2z1.js";
6
- import { createWidgetFactory } from "./utils/widget.js";
7
- const PAGE_LINK_DEFAULT = "#";
8
- const defaultConfig = {
9
- page: 1,
10
- collectionSize: 0,
11
- pageSize: 10,
12
- disabled: false,
13
- directionLinks: true,
14
- boundaryLinks: false,
15
- onPageChange: noop,
16
- pagesFactory: (_page, pageCount) => {
17
- const pages = [];
18
- for (let i = 1; i <= pageCount; i++) {
19
- pages.push(i);
20
- }
21
- return pages;
22
- },
23
- ariaLabel: "Page navigation",
24
- activeLabel: "(current)",
25
- ariaPageLabel: (processPage, pageCount) => `Page ${processPage} of ${pageCount}`,
26
- ariaFirstLabel: "Action link for first page",
27
- ariaPreviousLabel: "Action link for previous page",
28
- ariaNextLabel: "Action link for next page",
29
- ariaLastLabel: "Action link for last page",
30
- ariaEllipsisLabel: "Ellipsis page element",
31
- ariaLiveLabel: (currentPage) => `Current page is ${currentPage}`,
32
- className: "",
33
- pageLink: (_page) => PAGE_LINK_DEFAULT
34
- };
35
- function getPaginationDefaultConfig() {
36
- return { ...defaultConfig };
37
- }
38
- const configValidator = {
39
- page: typeNumber,
40
- collectionSize: typeNumber,
41
- pageSize: typeNumber,
42
- disabled: typeBoolean,
43
- directionLinks: typeBoolean,
44
- boundaryLinks: typeBoolean,
45
- onPageChange: typeFunction,
46
- pagesFactory: typeFunction,
47
- ariaLabel: typeString,
48
- activeLabel: typeString,
49
- ariaPageLabel: typeFunction,
50
- ariaFirstLabel: typeString,
51
- ariaPreviousLabel: typeString,
52
- ariaNextLabel: typeString,
53
- ariaLastLabel: typeString,
54
- ariaLiveLabel: typeFunction,
55
- className: typeString,
56
- pageLink: typeFunction,
57
- ariaEllipsisLabel: typeString
58
- };
59
- const createPagination = createWidgetFactory(
60
- "pagination",
61
- (config) => {
62
- const [
63
- {
64
- // dirty inputs that need adjustment:
65
- page$: _dirtyPage$,
66
- // clean inputs with value validation:
67
- collectionSize$,
68
- pageSize$,
69
- onPageChange$,
70
- pagesFactory$,
71
- ariaPageLabel$,
72
- ariaLiveLabel$,
73
- pageLink$,
74
- disabled$,
75
- ariaFirstLabel$,
76
- ariaLastLabel$,
77
- ariaNextLabel$,
78
- ariaPreviousLabel$,
79
- ...stateProps
80
- },
81
- patch
82
- ] = writablesForProps(defaultConfig, config, configValidator);
83
- const pageCount$ = computed(() => {
84
- let pageCount = Math.ceil(collectionSize$() / pageSize$());
85
- if (!isNumber(pageCount) || pageCount < 1) {
86
- pageCount = 1;
87
- }
88
- return pageCount;
89
- });
90
- const page$ = bindableProp(_dirtyPage$, onPageChange$, (dirtyPage) => clamp(dirtyPage, pageCount$(), 1));
91
- const pages$ = computed(() => pagesFactory$()(page$(), pageCount$()));
92
- const nextDisabled$ = computed(() => page$() === pageCount$() || disabled$());
93
- const previousDisabled$ = computed(() => page$() === 1 || disabled$());
94
- const pagesLabel$ = computed(() => {
95
- const ariaPageLabel = ariaPageLabel$();
96
- const pageCount = pageCount$();
97
- return pages$().map((page) => ariaPageLabel(page, pageCount));
98
- });
99
- const pagesHrefs$ = computed(() => {
100
- const pageLinkFactory = pageLink$();
101
- const pageCount = pageCount$();
102
- return Array.from({ length: pageCount }, (_, index) => pageLinkFactory(index + 1));
103
- });
104
- const directionsHrefs$ = computed(() => {
105
- const pagesHrefs = pagesHrefs$();
106
- const pageIndex = page$() - 1;
107
- return {
108
- previous: pagesHrefs.at(pageIndex > 0 ? pageIndex - 1 : 0),
109
- next: pagesHrefs.at(pageIndex + 1) ?? pagesHrefs.at(-1)
110
- };
111
- });
112
- const ariaLiveLabelText$ = computed(() => ariaLiveLabel$()(page$(), pageCount$()));
113
- function handleNavigation(pageNumber, event) {
114
- if (pagesHrefs$()[pageNumber - 1] === PAGE_LINK_DEFAULT) {
115
- event?.preventDefault();
116
- }
117
- if (!event || !(event.ctrlKey || event.metaKey)) {
118
- event?.preventDefault();
119
- page$.set(pageNumber);
120
- }
121
- }
122
- const widget = {
123
- ...stateStores({
124
- pageCount$,
125
- page$,
126
- pages$,
127
- nextDisabled$,
128
- previousDisabled$,
129
- pagesLabel$,
130
- pagesHrefs$,
131
- directionsHrefs$,
132
- disabled$,
133
- ariaFirstLabel$,
134
- ariaLastLabel$,
135
- ariaNextLabel$,
136
- ariaPreviousLabel$,
137
- ariaLiveLabelText$,
138
- ...stateProps
139
- }),
140
- patch,
141
- api: {
142
- /**
143
- * Set the current page pageNumber (starting from 1)
144
- * @param pageNumber - Current page number to set.
145
- * Value is normalized between 1 and the number of page
146
- */
147
- select(pageNumber) {
148
- page$.set(pageNumber);
149
- },
150
- /**
151
- * Select the first page
152
- */
153
- first() {
154
- page$.set(1);
155
- },
156
- /**
157
- * Select the previous page
158
- */
159
- previous() {
160
- page$.update((p) => p - 1);
161
- },
162
- /**
163
- * Select the next page
164
- */
165
- next() {
166
- page$.update((p) => p + 1);
167
- },
168
- /**
169
- * Select the last page
170
- */
171
- last() {
172
- page$.set(pageCount$());
173
- }
174
- },
175
- directives: {
176
- pageLink: createAttributesDirective((pageLinkContext$) => ({
177
- events: {
178
- click: (e) => handleNavigation(pageLinkContext$().page, e)
179
- },
180
- attributes: {
181
- "aria-current": computed(() => page$() === pageLinkContext$().page ? "page" : void 0),
182
- "aria-label": computed(() => pagesLabel$()[pageLinkContext$().page - 1]),
183
- href: computed(() => pagesHrefs$()[pageLinkContext$().page - 1]),
184
- tabindex: computed(() => disabled$() ? "-1" : void 0),
185
- "aria-disabled": computed(() => disabled$() ? "true" : void 0)
186
- },
187
- classNames: {
188
- "au-page": true$
189
- }
190
- })),
191
- pageFirst: createAttributesDirective(() => ({
192
- events: {
193
- click: (e) => handleNavigation(1, e)
194
- },
195
- attributes: {
196
- "aria-label": ariaFirstLabel$,
197
- href: computed(() => pagesHrefs$()[0]),
198
- tabindex: computed(() => previousDisabled$() ? "-1" : void 0),
199
- "aria-disabled": computed(() => previousDisabled$() ? "true" : void 0)
200
- },
201
- classNames: {
202
- "au-first": true$
203
- }
204
- })),
205
- pagePrev: createAttributesDirective(() => ({
206
- events: {
207
- click: (e) => handleNavigation(page$() - 1, e)
208
- },
209
- attributes: {
210
- "aria-label": ariaPreviousLabel$,
211
- href: computed(() => directionsHrefs$().previous),
212
- tabindex: computed(() => previousDisabled$() ? "-1" : void 0),
213
- "aria-disabled": computed(() => previousDisabled$() ? "true" : void 0)
214
- },
215
- classNames: {
216
- "au-previous": true$
217
- }
218
- })),
219
- pageNext: createAttributesDirective(() => ({
220
- events: {
221
- click: (e) => handleNavigation(page$() + 1, e)
222
- },
223
- attributes: {
224
- "aria-label": ariaNextLabel$,
225
- href: computed(() => directionsHrefs$().next),
226
- tabindex: computed(() => nextDisabled$() ? "-1" : void 0),
227
- "aria-disabled": computed(() => nextDisabled$() ? "true" : void 0)
228
- },
229
- classNames: {
230
- "au-next": true$
231
- }
232
- })),
233
- pageLast: createAttributesDirective(() => ({
234
- events: {
235
- click: (e) => handleNavigation(pageCount$(), e)
236
- },
237
- attributes: {
238
- "aria-label": ariaLastLabel$,
239
- href: computed(() => pagesHrefs$().at(-1)),
240
- tabindex: computed(() => nextDisabled$() ? "-1" : void 0),
241
- "aria-disabled": computed(() => nextDisabled$() ? "true" : void 0)
242
- },
243
- classNames: {
244
- "au-last": true$
245
- }
246
- }))
247
- }
248
- };
249
- return widget;
250
- }
251
- );
252
- export {
253
- createPagination as c,
254
- getPaginationDefaultConfig as g
255
- };