@design-factory/angular 21.0.4 → 21.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/drawer/README.md +54 -0
- package/fesm2022/design-factory-angular-drawer.mjs +202 -67
- package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
- package/fesm2022/design-factory-angular-internals.mjs +439 -17
- package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
- package/fesm2022/design-factory-angular-sidenav.mjs +223 -210
- package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
- package/fesm2022/design-factory-angular-theme.mjs +198 -0
- package/fesm2022/design-factory-angular-theme.mjs.map +1 -0
- package/fesm2022/design-factory-angular-topnav.mjs +1538 -0
- package/fesm2022/design-factory-angular-topnav.mjs.map +1 -0
- package/node_modules/@agnos-ui/core/README.md +5 -0
- package/node_modules/@agnos-ui/core/accordion-BC_9xn23.cjs +314 -0
- package/node_modules/@agnos-ui/core/accordion-Ca_0T8Bc.js +315 -0
- package/node_modules/@agnos-ui/core/alert-AhaliJ17.cjs +9 -0
- package/node_modules/@agnos-ui/core/alert-Cb9FhbFQ.js +10 -0
- package/node_modules/@agnos-ui/core/collapse-COriZO7o.cjs +94 -0
- package/node_modules/@agnos-ui/core/collapse-CP79atna.js +95 -0
- package/node_modules/@agnos-ui/core/common-B5jS-Ih_.cjs +73 -0
- package/node_modules/@agnos-ui/core/common-DFyZvkII.js +74 -0
- package/node_modules/@agnos-ui/core/components/accordion/accordion.d.ts +333 -0
- package/node_modules/@agnos-ui/core/components/accordion/index.cjs +7 -0
- package/node_modules/@agnos-ui/core/components/accordion/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/accordion/index.js +7 -0
- package/node_modules/@agnos-ui/core/components/alert/alert.d.ts +37 -0
- package/node_modules/@agnos-ui/core/components/alert/common.d.ts +138 -0
- package/node_modules/@agnos-ui/core/components/alert/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/alert/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/alert/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/carousel/carousel.d.ts +247 -0
- package/node_modules/@agnos-ui/core/components/carousel/index.cjs +292 -0
- package/node_modules/@agnos-ui/core/components/carousel/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/carousel/index.js +292 -0
- package/node_modules/@agnos-ui/core/components/collapse/collapse.d.ts +135 -0
- package/node_modules/@agnos-ui/core/components/collapse/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/collapse/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/collapse/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/commonProps.d.ts +11 -0
- package/node_modules/@agnos-ui/core/components/drawer/drawer.d.ts +279 -0
- package/node_modules/@agnos-ui/core/components/drawer/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/drawer/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/drawer/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/modal/index.cjs +8 -0
- package/node_modules/@agnos-ui/core/components/modal/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/modal/index.js +8 -0
- package/node_modules/@agnos-ui/core/components/modal/modal.d.ts +245 -0
- package/node_modules/@agnos-ui/core/components/pagination/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/pagination/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/pagination/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/pagination/pagination.d.ts +313 -0
- package/node_modules/@agnos-ui/core/components/progressbar/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/progressbar/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/progressbar/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/progressbar/progressbar.d.ts +91 -0
- package/node_modules/@agnos-ui/core/components/rating/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/rating/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/rating/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/rating/rating.d.ts +191 -0
- package/node_modules/@agnos-ui/core/components/slider/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/slider/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/slider/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/slider/slider-utils.d.ts +25 -0
- package/node_modules/@agnos-ui/core/components/slider/slider.d.ts +383 -0
- package/node_modules/@agnos-ui/core/components/toast/index.cjs +7 -0
- package/node_modules/@agnos-ui/core/components/toast/index.d.ts +2 -0
- package/node_modules/@agnos-ui/core/components/toast/index.js +7 -0
- package/node_modules/@agnos-ui/core/components/toast/toast.d.ts +66 -0
- package/node_modules/@agnos-ui/core/components/toast/toaster.d.ts +128 -0
- package/node_modules/@agnos-ui/core/components/tree/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/tree/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/tree/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/tree/tree.d.ts +143 -0
- package/node_modules/@agnos-ui/core/config.cjs +36 -0
- package/node_modules/@agnos-ui/core/config.d.ts +117 -0
- package/node_modules/@agnos-ui/core/config.js +36 -0
- package/node_modules/@agnos-ui/core/directive-Bsreu2z1.js +523 -0
- package/node_modules/@agnos-ui/core/directive-DCaXmRe_.cjs +522 -0
- package/node_modules/@agnos-ui/core/drawer-BbFAHV07.cjs +328 -0
- package/node_modules/@agnos-ui/core/drawer-C6Qa0xEu.js +329 -0
- package/node_modules/@agnos-ui/core/index.cjs +134 -0
- package/node_modules/@agnos-ui/core/index.d.ts +29 -0
- package/node_modules/@agnos-ui/core/index.js +134 -0
- package/node_modules/@agnos-ui/core/isFocusable-Ckwus82R.js +32 -0
- package/node_modules/@agnos-ui/core/isFocusable-DfzDLeAN.cjs +31 -0
- package/node_modules/@agnos-ui/core/modal-BsNuHhT7.cjs +252 -0
- package/node_modules/@agnos-ui/core/modal-CgzY8ezz.js +253 -0
- package/node_modules/@agnos-ui/core/package.json +57 -0
- package/node_modules/@agnos-ui/core/pagination-ZxGaNWZz.js +255 -0
- package/node_modules/@agnos-ui/core/pagination-xbcOHnhd.cjs +254 -0
- package/node_modules/@agnos-ui/core/progressbar-CRbMKp4b.cjs +86 -0
- package/node_modules/@agnos-ui/core/progressbar-CSEIFnlD.js +87 -0
- package/node_modules/@agnos-ui/core/promise-CxCD3NYv.cjs +118 -0
- package/node_modules/@agnos-ui/core/promise-D-RZVPuv.js +119 -0
- package/node_modules/@agnos-ui/core/rating-BIdiiPUo.js +184 -0
- package/node_modules/@agnos-ui/core/rating-qx1xaBmz.cjs +183 -0
- package/node_modules/@agnos-ui/core/scrollbars-CT87iv_6.cjs +30 -0
- package/node_modules/@agnos-ui/core/scrollbars-CcxSrnCx.js +31 -0
- package/node_modules/@agnos-ui/core/services/extendWidget.cjs +41 -0
- package/node_modules/@agnos-ui/core/services/extendWidget.d.ts +31 -0
- package/node_modules/@agnos-ui/core/services/extendWidget.js +41 -0
- package/node_modules/@agnos-ui/core/services/floatingUI.cjs +111 -0
- package/node_modules/@agnos-ui/core/services/floatingUI.d.ts +76 -0
- package/node_modules/@agnos-ui/core/services/floatingUI.js +111 -0
- package/node_modules/@agnos-ui/core/services/focusElement.cjs +46 -0
- package/node_modules/@agnos-ui/core/services/focusElement.d.ts +9 -0
- package/node_modules/@agnos-ui/core/services/focusElement.js +46 -0
- package/node_modules/@agnos-ui/core/services/focustrack.cjs +47 -0
- package/node_modules/@agnos-ui/core/services/focustrack.d.ts +40 -0
- package/node_modules/@agnos-ui/core/services/focustrack.js +47 -0
- package/node_modules/@agnos-ui/core/services/hash.cjs +15 -0
- package/node_modules/@agnos-ui/core/services/hash.d.ts +3 -0
- package/node_modules/@agnos-ui/core/services/hash.js +15 -0
- package/node_modules/@agnos-ui/core/services/intersection.cjs +53 -0
- package/node_modules/@agnos-ui/core/services/intersection.d.ts +30 -0
- package/node_modules/@agnos-ui/core/services/intersection.js +53 -0
- package/node_modules/@agnos-ui/core/services/matchMedia.cjs +14 -0
- package/node_modules/@agnos-ui/core/services/matchMedia.d.ts +8 -0
- package/node_modules/@agnos-ui/core/services/matchMedia.js +14 -0
- package/node_modules/@agnos-ui/core/services/navManager.cjs +166 -0
- package/node_modules/@agnos-ui/core/services/navManager.d.ts +144 -0
- package/node_modules/@agnos-ui/core/services/navManager.js +166 -0
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.cjs +60 -0
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.d.ts +42 -0
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.js +60 -0
- package/node_modules/@agnos-ui/core/services/portal.cjs +42 -0
- package/node_modules/@agnos-ui/core/services/portal.d.ts +16 -0
- package/node_modules/@agnos-ui/core/services/portal.js +42 -0
- package/node_modules/@agnos-ui/core/services/resizeObserver.cjs +54 -0
- package/node_modules/@agnos-ui/core/services/resizeObserver.d.ts +18 -0
- package/node_modules/@agnos-ui/core/services/resizeObserver.js +54 -0
- package/node_modules/@agnos-ui/core/services/siblingsInert.cjs +44 -0
- package/node_modules/@agnos-ui/core/services/siblingsInert.d.ts +16 -0
- package/node_modules/@agnos-ui/core/services/siblingsInert.js +44 -0
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.cjs +186 -0
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.d.ts +166 -0
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.js +186 -0
- package/node_modules/@agnos-ui/core/services/transitions/collapse.cjs +40 -0
- package/node_modules/@agnos-ui/core/services/transitions/collapse.d.ts +49 -0
- package/node_modules/@agnos-ui/core/services/transitions/collapse.js +40 -0
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.cjs +32 -0
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.d.ts +25 -0
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.js +32 -0
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.cjs +37 -0
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.d.ts +47 -0
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.js +37 -0
- package/node_modules/@agnos-ui/core/slider-B93hE0ag.cjs +807 -0
- package/node_modules/@agnos-ui/core/slider-Cjiq9FgI.js +808 -0
- package/node_modules/@agnos-ui/core/textDirection-cNgt24LJ.js +4 -0
- package/node_modules/@agnos-ui/core/textDirection-zqcZ5-eK.cjs +3 -0
- package/node_modules/@agnos-ui/core/toaster-BQWqxYv-.cjs +190 -0
- package/node_modules/@agnos-ui/core/toaster-BzEkshT2.js +191 -0
- package/node_modules/@agnos-ui/core/tree-DY04XPPg.cjs +228 -0
- package/node_modules/@agnos-ui/core/tree-HwcvZ0_p.js +229 -0
- package/node_modules/@agnos-ui/core/types.cjs +6 -0
- package/node_modules/@agnos-ui/core/types.d.ts +246 -0
- package/node_modules/@agnos-ui/core/types.js +6 -0
- package/node_modules/@agnos-ui/core/utils/directive.cjs +28 -0
- package/node_modules/@agnos-ui/core/utils/directive.d.ts +352 -0
- package/node_modules/@agnos-ui/core/utils/directive.js +28 -0
- package/node_modules/@agnos-ui/core/utils/func.cjs +7 -0
- package/node_modules/@agnos-ui/core/utils/func.d.ts +11 -0
- package/node_modules/@agnos-ui/core/utils/func.js +7 -0
- package/node_modules/@agnos-ui/core/utils/id.cjs +5 -0
- package/node_modules/@agnos-ui/core/utils/id.d.ts +6 -0
- package/node_modules/@agnos-ui/core/utils/id.js +5 -0
- package/node_modules/@agnos-ui/core/utils/internal/assign.d.ts +10 -0
- package/node_modules/@agnos-ui/core/utils/internal/checks.d.ts +57 -0
- package/node_modules/@agnos-ui/core/utils/internal/dom.d.ts +75 -0
- package/node_modules/@agnos-ui/core/utils/internal/isFocusable.d.ts +9 -0
- package/node_modules/@agnos-ui/core/utils/internal/math.d.ts +5 -0
- package/node_modules/@agnos-ui/core/utils/internal/promise.d.ts +98 -0
- package/node_modules/@agnos-ui/core/utils/internal/scrollbars.d.ts +8 -0
- package/node_modules/@agnos-ui/core/utils/internal/sort.d.ts +16 -0
- package/node_modules/@agnos-ui/core/utils/internal/ssrHTMLElement.d.ts +17 -0
- package/node_modules/@agnos-ui/core/utils/internal/textDirection.d.ts +7 -0
- package/node_modules/@agnos-ui/core/utils/internal/traversal.d.ts +54 -0
- package/node_modules/@agnos-ui/core/utils/stores.cjs +172 -0
- package/node_modules/@agnos-ui/core/utils/stores.d.ts +224 -0
- package/node_modules/@agnos-ui/core/utils/stores.js +172 -0
- package/node_modules/@agnos-ui/core/utils/widget.cjs +8 -0
- package/node_modules/@agnos-ui/core/utils/widget.d.ts +11 -0
- package/node_modules/@agnos-ui/core/utils/widget.js +8 -0
- package/node_modules/@agnos-ui/core/utils/writables.cjs +16 -0
- package/node_modules/@agnos-ui/core/utils/writables.d.ts +95 -0
- package/node_modules/@agnos-ui/core/utils/writables.js +16 -0
- package/node_modules/@agnos-ui/core/writables-DYGjj5T3.js +103 -0
- package/node_modules/@agnos-ui/core/writables-Dt68gADJ.cjs +102 -0
- package/package.json +25 -6
- package/schematics/collection.json +1 -1
- package/types/design-factory-angular-drawer.d.ts +71 -13
- package/types/design-factory-angular-internals.d.ts +220 -31
- package/types/design-factory-angular-sidenav.d.ts +15 -7
- package/types/design-factory-angular-theme.d.ts +122 -0
- package/types/design-factory-angular-topnav.d.ts +435 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { writablesForProps, idWithDefault, stateStores, true$, mergeConfigStores, normalizeConfigStores } from "./utils/stores.js";
|
|
2
|
+
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
3
|
+
import { writable, computed, readable, asWritable } from "@amadeus-it-group/tansu";
|
|
4
|
+
import { noop } from "./utils/func.js";
|
|
5
|
+
import { j as typeString, e as typeFunction, b as typeBoolean, c as createTypeEnum } from "./writables-DYGjj5T3.js";
|
|
6
|
+
import { s as mergeDirectives, g as createAttributesDirective, u as registrationArray, o as directiveSubscribe } from "./directive-Bsreu2z1.js";
|
|
7
|
+
import { createWidgetFactory } from "./utils/widget.js";
|
|
8
|
+
function adjustItemsCloseOthers(items, openItems, oldOpen) {
|
|
9
|
+
let keepOpen;
|
|
10
|
+
if (openItems.length == 2) {
|
|
11
|
+
oldOpen = oldOpen ?? openItems[0];
|
|
12
|
+
keepOpen = openItems.find((id) => id !== oldOpen);
|
|
13
|
+
} else if (openItems.length > 2) {
|
|
14
|
+
keepOpen = openItems[0];
|
|
15
|
+
}
|
|
16
|
+
if (keepOpen) {
|
|
17
|
+
items.forEach((item) => {
|
|
18
|
+
if (item.stores.id$() !== keepOpen && item.stores.visible$()) {
|
|
19
|
+
item.patch({ visible: false });
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return items;
|
|
24
|
+
}
|
|
25
|
+
function getItem(items, id) {
|
|
26
|
+
return items.find((item) => item.stores.id$() === id);
|
|
27
|
+
}
|
|
28
|
+
const defaultAccordionConfig = {
|
|
29
|
+
closeOthers: false,
|
|
30
|
+
onItemShown: noop,
|
|
31
|
+
onItemHidden: noop,
|
|
32
|
+
className: "",
|
|
33
|
+
itemDestroyOnHide: true,
|
|
34
|
+
itemAnimated: true,
|
|
35
|
+
itemTransition: noop,
|
|
36
|
+
itemHeadingLevel: 2,
|
|
37
|
+
itemClassName: "",
|
|
38
|
+
itemHeaderClassName: "",
|
|
39
|
+
itemButtonClassName: "",
|
|
40
|
+
itemBodyContainerClassName: "",
|
|
41
|
+
itemBodyClassName: ""
|
|
42
|
+
};
|
|
43
|
+
const defaultItemConfig = {
|
|
44
|
+
id: "",
|
|
45
|
+
destroyOnHide: defaultAccordionConfig.itemDestroyOnHide,
|
|
46
|
+
disabled: false,
|
|
47
|
+
visible: false,
|
|
48
|
+
animated: defaultAccordionConfig.itemAnimated,
|
|
49
|
+
transition: defaultAccordionConfig.itemTransition,
|
|
50
|
+
onShown: noop,
|
|
51
|
+
onHidden: noop,
|
|
52
|
+
onVisibleChange: noop,
|
|
53
|
+
className: defaultAccordionConfig.itemClassName,
|
|
54
|
+
headerClassName: defaultAccordionConfig.itemHeaderClassName,
|
|
55
|
+
buttonClassName: defaultAccordionConfig.itemButtonClassName,
|
|
56
|
+
bodyContainerClassName: defaultAccordionConfig.itemBodyContainerClassName,
|
|
57
|
+
bodyClassName: defaultAccordionConfig.itemBodyClassName,
|
|
58
|
+
headingLevel: defaultAccordionConfig.itemHeadingLevel
|
|
59
|
+
};
|
|
60
|
+
const coreAccordionItemProps = Object.keys(defaultItemConfig);
|
|
61
|
+
function getAccordionDefaultConfig() {
|
|
62
|
+
return { ...defaultAccordionConfig };
|
|
63
|
+
}
|
|
64
|
+
const configAccordionValidator = {
|
|
65
|
+
closeOthers: typeBoolean,
|
|
66
|
+
onItemShown: typeFunction,
|
|
67
|
+
onItemHidden: typeFunction,
|
|
68
|
+
className: typeString,
|
|
69
|
+
itemDestroyOnHide: typeBoolean,
|
|
70
|
+
itemAnimated: typeBoolean,
|
|
71
|
+
itemTransition: typeFunction,
|
|
72
|
+
itemClassName: typeString,
|
|
73
|
+
itemHeaderClassName: typeString,
|
|
74
|
+
itemButtonClassName: typeString,
|
|
75
|
+
itemBodyContainerClassName: typeString,
|
|
76
|
+
itemBodyClassName: typeString,
|
|
77
|
+
itemHeadingLevel: createTypeEnum([1, 2, 3, 4, 5, 6])
|
|
78
|
+
};
|
|
79
|
+
const configItemValidator = {
|
|
80
|
+
id: typeString,
|
|
81
|
+
destroyOnHide: typeBoolean,
|
|
82
|
+
disabled: typeBoolean,
|
|
83
|
+
visible: typeBoolean,
|
|
84
|
+
animated: typeBoolean,
|
|
85
|
+
transition: typeFunction,
|
|
86
|
+
onShown: typeFunction,
|
|
87
|
+
onHidden: typeFunction,
|
|
88
|
+
onVisibleChange: typeFunction,
|
|
89
|
+
className: typeString,
|
|
90
|
+
headerClassName: typeString,
|
|
91
|
+
buttonClassName: typeString,
|
|
92
|
+
bodyContainerClassName: typeString,
|
|
93
|
+
bodyClassName: typeString,
|
|
94
|
+
headingLevel: createTypeEnum([1, 2, 3, 4, 5, 6])
|
|
95
|
+
};
|
|
96
|
+
function createAccordionItem(config) {
|
|
97
|
+
const [
|
|
98
|
+
{
|
|
99
|
+
bodyClassName$,
|
|
100
|
+
buttonClassName$,
|
|
101
|
+
bodyContainerClassName$,
|
|
102
|
+
headerClassName$,
|
|
103
|
+
animated$,
|
|
104
|
+
transition$,
|
|
105
|
+
destroyOnHide$,
|
|
106
|
+
onShown$,
|
|
107
|
+
onHidden$,
|
|
108
|
+
onVisibleChange$,
|
|
109
|
+
visible$,
|
|
110
|
+
id$: _dirtyId$,
|
|
111
|
+
disabled$,
|
|
112
|
+
...stateProps
|
|
113
|
+
},
|
|
114
|
+
patch
|
|
115
|
+
] = writablesForProps(defaultItemConfig, config, configItemValidator);
|
|
116
|
+
const initDone$ = writable(false);
|
|
117
|
+
const id$ = idWithDefault(_dirtyId$);
|
|
118
|
+
const transition = createTransition({
|
|
119
|
+
props: {
|
|
120
|
+
transition: transition$,
|
|
121
|
+
visible: visible$,
|
|
122
|
+
onVisibleChange: onVisibleChange$,
|
|
123
|
+
animated: animated$,
|
|
124
|
+
animatedOnInit: false,
|
|
125
|
+
initDone: initDone$,
|
|
126
|
+
onHidden: () => {
|
|
127
|
+
onHidden$()();
|
|
128
|
+
},
|
|
129
|
+
onShown: () => {
|
|
130
|
+
onShown$()();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
const shouldBeInDOM$ = computed(() => !destroyOnHide$() || !transition.stores.hidden$());
|
|
135
|
+
const toggleDirective = createAttributesDirective(() => ({
|
|
136
|
+
attributes: {
|
|
137
|
+
id: computed(() => `${id$()}-toggle`),
|
|
138
|
+
"aria-expanded": computed(() => `${visible$()}`),
|
|
139
|
+
"aria-disabled": computed(() => `${disabled$()}`),
|
|
140
|
+
"aria-controls": computed(() => `${id$()}-body-container`),
|
|
141
|
+
disabled: disabled$
|
|
142
|
+
},
|
|
143
|
+
classNames: { collapsed: computed(() => !visible$()) },
|
|
144
|
+
events: {
|
|
145
|
+
click: () => {
|
|
146
|
+
if (!disabled$()) {
|
|
147
|
+
void transition.api.toggle();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}));
|
|
152
|
+
const transitionDirective = transition.directives.directive;
|
|
153
|
+
const bodyContainerAttrsDirective = createAttributesDirective(() => ({
|
|
154
|
+
attributes: {
|
|
155
|
+
id: computed(() => `${id$()}-body-container`),
|
|
156
|
+
class: bodyContainerClassName$,
|
|
157
|
+
"aria-labelledby": computed(() => `${id$()}-toggle`),
|
|
158
|
+
role: readable("region")
|
|
159
|
+
}
|
|
160
|
+
}));
|
|
161
|
+
return {
|
|
162
|
+
...stateStores({
|
|
163
|
+
visible$,
|
|
164
|
+
id$,
|
|
165
|
+
shouldBeInDOM$,
|
|
166
|
+
disabled$,
|
|
167
|
+
bodyClassName$,
|
|
168
|
+
buttonClassName$,
|
|
169
|
+
bodyContainerClassName$,
|
|
170
|
+
headerClassName$,
|
|
171
|
+
...stateProps
|
|
172
|
+
}),
|
|
173
|
+
patch,
|
|
174
|
+
api: {
|
|
175
|
+
initDone: () => {
|
|
176
|
+
initDone$.set(true);
|
|
177
|
+
},
|
|
178
|
+
collapse: transition.api.hide,
|
|
179
|
+
expand: transition.api.show,
|
|
180
|
+
toggle: (animated) => transition.api.toggle(void 0, animated)
|
|
181
|
+
},
|
|
182
|
+
directives: {
|
|
183
|
+
toggleDirective,
|
|
184
|
+
buttonDirective: mergeDirectives(
|
|
185
|
+
toggleDirective,
|
|
186
|
+
createAttributesDirective(() => ({
|
|
187
|
+
attributes: {
|
|
188
|
+
type: readable("button"),
|
|
189
|
+
class: buttonClassName$
|
|
190
|
+
}
|
|
191
|
+
}))
|
|
192
|
+
),
|
|
193
|
+
headerDirective: createAttributesDirective(() => ({ attributes: { class: headerClassName$ } })),
|
|
194
|
+
bodyDirective: createAttributesDirective(() => ({ attributes: { class: bodyClassName$ } })),
|
|
195
|
+
transitionDirective,
|
|
196
|
+
bodyContainerAttrsDirective,
|
|
197
|
+
bodyContainerDirective: mergeDirectives(transitionDirective, bodyContainerAttrsDirective),
|
|
198
|
+
itemDirective: noop
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function factoryCreateAccordion(itemFactory = createAccordionItem, accordionItemProps = coreAccordionItemProps, accordionConfig = defaultAccordionConfig, accordionValidator = configAccordionValidator) {
|
|
203
|
+
return createWidgetFactory("accordion", (config) => {
|
|
204
|
+
const [writables, patch] = writablesForProps(accordionConfig, config, accordionValidator);
|
|
205
|
+
const { closeOthers$, onItemShown$, onItemHidden$, className$ } = writables;
|
|
206
|
+
const accordionItemConfig = Object.fromEntries(
|
|
207
|
+
Object.entries(writables).filter((entry) => entry[0].startsWith("item")).map((entry) => [entry[0].charAt(4).toLowerCase() + entry[0].slice(5, -1), entry[1]])
|
|
208
|
+
);
|
|
209
|
+
const itemWidgets$ = registrationArray();
|
|
210
|
+
const openItems$ = computed(() => {
|
|
211
|
+
const openItems = [];
|
|
212
|
+
itemWidgets$().forEach((item) => {
|
|
213
|
+
if (item.stores.visible$()) {
|
|
214
|
+
openItems.push(item.stores.id$());
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
return openItems;
|
|
218
|
+
});
|
|
219
|
+
const oldOpenItem$ = writable(openItems$()[0]);
|
|
220
|
+
const checkCloseOthersAction$ = computed(() => {
|
|
221
|
+
if (closeOthers$()) {
|
|
222
|
+
adjustItemsCloseOthers(itemWidgets$(), openItems$(), oldOpenItem$());
|
|
223
|
+
oldOpenItem$.set(openItems$()[0]);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
const action$ = computed(() => {
|
|
227
|
+
checkCloseOthersAction$();
|
|
228
|
+
});
|
|
229
|
+
return {
|
|
230
|
+
...stateStores({ itemWidgets$, className$ }),
|
|
231
|
+
patch,
|
|
232
|
+
api: {
|
|
233
|
+
expand: async (id, animated) => {
|
|
234
|
+
await getItem(itemWidgets$(), id)?.api.expand(animated);
|
|
235
|
+
},
|
|
236
|
+
collapse: async (id, animated) => {
|
|
237
|
+
await getItem(itemWidgets$(), id)?.api.collapse(animated);
|
|
238
|
+
},
|
|
239
|
+
toggle: async (id, animated) => {
|
|
240
|
+
await getItem(itemWidgets$(), id)?.api.toggle(animated);
|
|
241
|
+
},
|
|
242
|
+
expandAll: async (animated) => {
|
|
243
|
+
await Promise.all(itemWidgets$().map((i) => i.api.expand(animated)));
|
|
244
|
+
},
|
|
245
|
+
collapseAll: async (animated) => {
|
|
246
|
+
await Promise.all(itemWidgets$().map((i) => i.api.collapse(animated)));
|
|
247
|
+
},
|
|
248
|
+
registerItem: (propsConfig) => {
|
|
249
|
+
const itemProps = accordionItemProps;
|
|
250
|
+
const config2 = mergeConfigStores(
|
|
251
|
+
itemProps,
|
|
252
|
+
normalizeConfigStores(itemProps, propsConfig?.config),
|
|
253
|
+
accordionItemConfig
|
|
254
|
+
);
|
|
255
|
+
const [{ onHidden$, onShown$ }] = writablesForProps(
|
|
256
|
+
{
|
|
257
|
+
onHidden: defaultItemConfig.onHidden,
|
|
258
|
+
onShown: defaultItemConfig.onShown
|
|
259
|
+
},
|
|
260
|
+
{ config: config2, props: propsConfig?.props }
|
|
261
|
+
);
|
|
262
|
+
const item = itemFactory({
|
|
263
|
+
config: config2,
|
|
264
|
+
props: {
|
|
265
|
+
...propsConfig?.props,
|
|
266
|
+
onHidden: asWritable(
|
|
267
|
+
readable(() => {
|
|
268
|
+
onItemHidden$()(item.stores.id$());
|
|
269
|
+
onHidden$()?.();
|
|
270
|
+
}),
|
|
271
|
+
(val) => {
|
|
272
|
+
onItemHidden$.set(val);
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
onShown: asWritable(
|
|
276
|
+
readable(() => {
|
|
277
|
+
onItemShown$()(item.stores.id$());
|
|
278
|
+
onShown$()?.();
|
|
279
|
+
}),
|
|
280
|
+
(val) => {
|
|
281
|
+
onItemShown$.set(val);
|
|
282
|
+
}
|
|
283
|
+
)
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
item.directives.itemDirective = mergeDirectives(
|
|
287
|
+
() => ({
|
|
288
|
+
destroy: itemWidgets$.register(item)
|
|
289
|
+
}),
|
|
290
|
+
createAttributesDirective(() => ({
|
|
291
|
+
attributes: { class: item.stores.className$, id: item.stores.id$ }
|
|
292
|
+
}))
|
|
293
|
+
);
|
|
294
|
+
return item;
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
directives: {
|
|
298
|
+
accordionDirective: mergeDirectives(
|
|
299
|
+
directiveSubscribe(action$),
|
|
300
|
+
createAttributesDirective(() => ({
|
|
301
|
+
attributes: { class: className$ },
|
|
302
|
+
classNames: { "au-accordion": true$ }
|
|
303
|
+
}))
|
|
304
|
+
)
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
const createAccordion = factoryCreateAccordion();
|
|
310
|
+
export {
|
|
311
|
+
createAccordionItem as a,
|
|
312
|
+
createAccordion as c,
|
|
313
|
+
factoryCreateAccordion as f,
|
|
314
|
+
getAccordionDefaultConfig as g
|
|
315
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const common = require("./common-B5jS-Ih_.cjs");
|
|
3
|
+
const utils_widget = require("./utils/widget.cjs");
|
|
4
|
+
function getAlertDefaultConfig() {
|
|
5
|
+
return { ...common.getCommonAlertDefaultConfig() };
|
|
6
|
+
}
|
|
7
|
+
const createAlert = utils_widget.createWidgetFactory("alert", common.createCommonAlert);
|
|
8
|
+
exports.createAlert = createAlert;
|
|
9
|
+
exports.getAlertDefaultConfig = getAlertDefaultConfig;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { g as getCommonAlertDefaultConfig, c as createCommonAlert } from "./common-DFyZvkII.js";
|
|
2
|
+
import { createWidgetFactory } from "./utils/widget.js";
|
|
3
|
+
function getAlertDefaultConfig() {
|
|
4
|
+
return { ...getCommonAlertDefaultConfig() };
|
|
5
|
+
}
|
|
6
|
+
const createAlert = createWidgetFactory("alert", createCommonAlert);
|
|
7
|
+
export {
|
|
8
|
+
createAlert as c,
|
|
9
|
+
getAlertDefaultConfig as g
|
|
10
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
3
|
+
const utils_stores = require("./utils/stores.cjs");
|
|
4
|
+
const utils_directive = require("./directive-DCaXmRe_.cjs");
|
|
5
|
+
const utils_writables = require("./writables-Dt68gADJ.cjs");
|
|
6
|
+
const tansu = require("@amadeus-it-group/tansu");
|
|
7
|
+
const utils_func = require("./utils/func.cjs");
|
|
8
|
+
const utils_widget = require("./utils/widget.cjs");
|
|
9
|
+
const defaultCollapseConfig = {
|
|
10
|
+
visible: false,
|
|
11
|
+
onVisibleChange: utils_func.noop,
|
|
12
|
+
onShown: utils_func.noop,
|
|
13
|
+
onHidden: utils_func.noop,
|
|
14
|
+
animated: true,
|
|
15
|
+
animatedOnInit: false,
|
|
16
|
+
id: "",
|
|
17
|
+
transition: utils_func.noop
|
|
18
|
+
};
|
|
19
|
+
function getCollapseDefaultConfig() {
|
|
20
|
+
return { ...defaultCollapseConfig };
|
|
21
|
+
}
|
|
22
|
+
const commonCollapseConfigValidator = {
|
|
23
|
+
onVisibleChange: utils_writables.typeFunction,
|
|
24
|
+
onHidden: utils_writables.typeFunction,
|
|
25
|
+
onShown: utils_writables.typeFunction,
|
|
26
|
+
animatedOnInit: utils_writables.typeBoolean,
|
|
27
|
+
animated: utils_writables.typeBoolean,
|
|
28
|
+
visible: utils_writables.typeBoolean,
|
|
29
|
+
id: utils_writables.typeString,
|
|
30
|
+
transition: utils_writables.typeFunction
|
|
31
|
+
};
|
|
32
|
+
const createCollapse = utils_widget.createWidgetFactory(
|
|
33
|
+
"collapse",
|
|
34
|
+
(config) => {
|
|
35
|
+
const [
|
|
36
|
+
{
|
|
37
|
+
transition$,
|
|
38
|
+
animatedOnInit$,
|
|
39
|
+
animated$,
|
|
40
|
+
visible$: requestedVisible$,
|
|
41
|
+
onVisibleChange$,
|
|
42
|
+
onHidden$,
|
|
43
|
+
onShown$,
|
|
44
|
+
id$: _dirtyId$,
|
|
45
|
+
...stateProps
|
|
46
|
+
},
|
|
47
|
+
patch
|
|
48
|
+
] = utils_stores.writablesForProps(defaultCollapseConfig, config, commonCollapseConfigValidator);
|
|
49
|
+
const id$ = utils_stores.idWithDefault(_dirtyId$);
|
|
50
|
+
const transition = services_transitions_baseTransitions.createTransition({
|
|
51
|
+
props: {
|
|
52
|
+
transition: transition$,
|
|
53
|
+
visible: requestedVisible$,
|
|
54
|
+
animated: animated$,
|
|
55
|
+
animatedOnInit: animatedOnInit$,
|
|
56
|
+
onVisibleChange: onVisibleChange$,
|
|
57
|
+
onHidden: onHidden$,
|
|
58
|
+
onShown: onShown$
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const visible$ = transition.stores.visible$;
|
|
62
|
+
const hidden$ = transition.stores.hidden$;
|
|
63
|
+
return {
|
|
64
|
+
...utils_stores.stateStores({ ...stateProps, visible$, hidden$ }),
|
|
65
|
+
patch,
|
|
66
|
+
api: {
|
|
67
|
+
open: transition.api.show,
|
|
68
|
+
close: transition.api.hide,
|
|
69
|
+
toggle: (animated) => transition.api.toggle(void 0, animated)
|
|
70
|
+
},
|
|
71
|
+
directives: {
|
|
72
|
+
collapseDirective: utils_directive.mergeDirectives(
|
|
73
|
+
transition.directives.directive,
|
|
74
|
+
utils_directive.createAttributesDirective(() => ({
|
|
75
|
+
attributes: {
|
|
76
|
+
id: id$
|
|
77
|
+
}
|
|
78
|
+
}))
|
|
79
|
+
),
|
|
80
|
+
triggerDirective: utils_directive.createAttributesDirective(() => ({
|
|
81
|
+
attributes: {
|
|
82
|
+
"aria-expanded": tansu.computed(() => `${visible$()}`),
|
|
83
|
+
"aria-controls": id$
|
|
84
|
+
},
|
|
85
|
+
events: {
|
|
86
|
+
click: () => void transition.api.toggle()
|
|
87
|
+
}
|
|
88
|
+
}))
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
exports.createCollapse = createCollapse;
|
|
94
|
+
exports.getCollapseDefaultConfig = getCollapseDefaultConfig;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
2
|
+
import { writablesForProps, idWithDefault, stateStores } from "./utils/stores.js";
|
|
3
|
+
import { g as createAttributesDirective, s as mergeDirectives } from "./directive-Bsreu2z1.js";
|
|
4
|
+
import { e as typeFunction, j as typeString, b as typeBoolean } from "./writables-DYGjj5T3.js";
|
|
5
|
+
import { computed } from "@amadeus-it-group/tansu";
|
|
6
|
+
import { noop } from "./utils/func.js";
|
|
7
|
+
import { createWidgetFactory } from "./utils/widget.js";
|
|
8
|
+
const defaultCollapseConfig = {
|
|
9
|
+
visible: false,
|
|
10
|
+
onVisibleChange: noop,
|
|
11
|
+
onShown: noop,
|
|
12
|
+
onHidden: noop,
|
|
13
|
+
animated: true,
|
|
14
|
+
animatedOnInit: false,
|
|
15
|
+
id: "",
|
|
16
|
+
transition: noop
|
|
17
|
+
};
|
|
18
|
+
function getCollapseDefaultConfig() {
|
|
19
|
+
return { ...defaultCollapseConfig };
|
|
20
|
+
}
|
|
21
|
+
const commonCollapseConfigValidator = {
|
|
22
|
+
onVisibleChange: typeFunction,
|
|
23
|
+
onHidden: typeFunction,
|
|
24
|
+
onShown: typeFunction,
|
|
25
|
+
animatedOnInit: typeBoolean,
|
|
26
|
+
animated: typeBoolean,
|
|
27
|
+
visible: typeBoolean,
|
|
28
|
+
id: typeString,
|
|
29
|
+
transition: typeFunction
|
|
30
|
+
};
|
|
31
|
+
const createCollapse = createWidgetFactory(
|
|
32
|
+
"collapse",
|
|
33
|
+
(config) => {
|
|
34
|
+
const [
|
|
35
|
+
{
|
|
36
|
+
transition$,
|
|
37
|
+
animatedOnInit$,
|
|
38
|
+
animated$,
|
|
39
|
+
visible$: requestedVisible$,
|
|
40
|
+
onVisibleChange$,
|
|
41
|
+
onHidden$,
|
|
42
|
+
onShown$,
|
|
43
|
+
id$: _dirtyId$,
|
|
44
|
+
...stateProps
|
|
45
|
+
},
|
|
46
|
+
patch
|
|
47
|
+
] = writablesForProps(defaultCollapseConfig, config, commonCollapseConfigValidator);
|
|
48
|
+
const id$ = idWithDefault(_dirtyId$);
|
|
49
|
+
const transition = createTransition({
|
|
50
|
+
props: {
|
|
51
|
+
transition: transition$,
|
|
52
|
+
visible: requestedVisible$,
|
|
53
|
+
animated: animated$,
|
|
54
|
+
animatedOnInit: animatedOnInit$,
|
|
55
|
+
onVisibleChange: onVisibleChange$,
|
|
56
|
+
onHidden: onHidden$,
|
|
57
|
+
onShown: onShown$
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const visible$ = transition.stores.visible$;
|
|
61
|
+
const hidden$ = transition.stores.hidden$;
|
|
62
|
+
return {
|
|
63
|
+
...stateStores({ ...stateProps, visible$, hidden$ }),
|
|
64
|
+
patch,
|
|
65
|
+
api: {
|
|
66
|
+
open: transition.api.show,
|
|
67
|
+
close: transition.api.hide,
|
|
68
|
+
toggle: (animated) => transition.api.toggle(void 0, animated)
|
|
69
|
+
},
|
|
70
|
+
directives: {
|
|
71
|
+
collapseDirective: mergeDirectives(
|
|
72
|
+
transition.directives.directive,
|
|
73
|
+
createAttributesDirective(() => ({
|
|
74
|
+
attributes: {
|
|
75
|
+
id: id$
|
|
76
|
+
}
|
|
77
|
+
}))
|
|
78
|
+
),
|
|
79
|
+
triggerDirective: createAttributesDirective(() => ({
|
|
80
|
+
attributes: {
|
|
81
|
+
"aria-expanded": computed(() => `${visible$()}`),
|
|
82
|
+
"aria-controls": id$
|
|
83
|
+
},
|
|
84
|
+
events: {
|
|
85
|
+
click: () => void transition.api.toggle()
|
|
86
|
+
}
|
|
87
|
+
}))
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
export {
|
|
93
|
+
createCollapse as c,
|
|
94
|
+
getCollapseDefaultConfig as g
|
|
95
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
3
|
+
const utils_func = require("./utils/func.cjs");
|
|
4
|
+
const utils_stores = require("./utils/stores.cjs");
|
|
5
|
+
const utils_writables = require("./writables-Dt68gADJ.cjs");
|
|
6
|
+
const defaultCommonAlertConfig = {
|
|
7
|
+
visible: true,
|
|
8
|
+
dismissible: true,
|
|
9
|
+
ariaCloseButtonLabel: "Close",
|
|
10
|
+
onVisibleChange: utils_func.noop,
|
|
11
|
+
onShown: utils_func.noop,
|
|
12
|
+
onHidden: utils_func.noop,
|
|
13
|
+
animated: true,
|
|
14
|
+
animatedOnInit: false,
|
|
15
|
+
transition: utils_func.noop,
|
|
16
|
+
className: ""
|
|
17
|
+
};
|
|
18
|
+
function getCommonAlertDefaultConfig() {
|
|
19
|
+
return { ...defaultCommonAlertConfig };
|
|
20
|
+
}
|
|
21
|
+
const commonAlertConfigValidator = {
|
|
22
|
+
dismissible: utils_writables.typeBoolean,
|
|
23
|
+
onVisibleChange: utils_writables.typeFunction,
|
|
24
|
+
onHidden: utils_writables.typeFunction,
|
|
25
|
+
onShown: utils_writables.typeFunction,
|
|
26
|
+
transition: utils_writables.typeFunction,
|
|
27
|
+
animatedOnInit: utils_writables.typeBoolean,
|
|
28
|
+
animated: utils_writables.typeBoolean,
|
|
29
|
+
visible: utils_writables.typeBoolean,
|
|
30
|
+
ariaCloseButtonLabel: utils_writables.typeString,
|
|
31
|
+
className: utils_writables.typeString
|
|
32
|
+
};
|
|
33
|
+
function createCommonAlert(config) {
|
|
34
|
+
const [
|
|
35
|
+
{
|
|
36
|
+
transition$,
|
|
37
|
+
animatedOnInit$,
|
|
38
|
+
animated$,
|
|
39
|
+
visible$: requestedVisible$,
|
|
40
|
+
onVisibleChange$,
|
|
41
|
+
onHidden$,
|
|
42
|
+
onShown$,
|
|
43
|
+
...stateProps
|
|
44
|
+
},
|
|
45
|
+
patch
|
|
46
|
+
] = utils_stores.writablesForProps(defaultCommonAlertConfig, config, commonAlertConfigValidator);
|
|
47
|
+
const transition = services_transitions_baseTransitions.createTransition({
|
|
48
|
+
props: {
|
|
49
|
+
transition: transition$,
|
|
50
|
+
visible: requestedVisible$,
|
|
51
|
+
animated: animated$,
|
|
52
|
+
animatedOnInit: animatedOnInit$,
|
|
53
|
+
onVisibleChange: onVisibleChange$,
|
|
54
|
+
onHidden: onHidden$,
|
|
55
|
+
onShown: onShown$
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const visible$ = transition.stores.visible$;
|
|
59
|
+
const hidden$ = transition.stores.hidden$;
|
|
60
|
+
return {
|
|
61
|
+
...utils_stores.stateStores({ ...stateProps, visible$, hidden$ }),
|
|
62
|
+
patch,
|
|
63
|
+
api: {
|
|
64
|
+
open: transition.api.show,
|
|
65
|
+
close: transition.api.hide
|
|
66
|
+
},
|
|
67
|
+
directives: {
|
|
68
|
+
transitionDirective: transition.directives.directive
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
exports.createCommonAlert = createCommonAlert;
|
|
73
|
+
exports.getCommonAlertDefaultConfig = getCommonAlertDefaultConfig;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
2
|
+
import { noop } from "./utils/func.js";
|
|
3
|
+
import { writablesForProps, stateStores } from "./utils/stores.js";
|
|
4
|
+
import { j as typeString, b as typeBoolean, e as typeFunction } from "./writables-DYGjj5T3.js";
|
|
5
|
+
const defaultCommonAlertConfig = {
|
|
6
|
+
visible: true,
|
|
7
|
+
dismissible: true,
|
|
8
|
+
ariaCloseButtonLabel: "Close",
|
|
9
|
+
onVisibleChange: noop,
|
|
10
|
+
onShown: noop,
|
|
11
|
+
onHidden: noop,
|
|
12
|
+
animated: true,
|
|
13
|
+
animatedOnInit: false,
|
|
14
|
+
transition: noop,
|
|
15
|
+
className: ""
|
|
16
|
+
};
|
|
17
|
+
function getCommonAlertDefaultConfig() {
|
|
18
|
+
return { ...defaultCommonAlertConfig };
|
|
19
|
+
}
|
|
20
|
+
const commonAlertConfigValidator = {
|
|
21
|
+
dismissible: typeBoolean,
|
|
22
|
+
onVisibleChange: typeFunction,
|
|
23
|
+
onHidden: typeFunction,
|
|
24
|
+
onShown: typeFunction,
|
|
25
|
+
transition: typeFunction,
|
|
26
|
+
animatedOnInit: typeBoolean,
|
|
27
|
+
animated: typeBoolean,
|
|
28
|
+
visible: typeBoolean,
|
|
29
|
+
ariaCloseButtonLabel: typeString,
|
|
30
|
+
className: typeString
|
|
31
|
+
};
|
|
32
|
+
function createCommonAlert(config) {
|
|
33
|
+
const [
|
|
34
|
+
{
|
|
35
|
+
transition$,
|
|
36
|
+
animatedOnInit$,
|
|
37
|
+
animated$,
|
|
38
|
+
visible$: requestedVisible$,
|
|
39
|
+
onVisibleChange$,
|
|
40
|
+
onHidden$,
|
|
41
|
+
onShown$,
|
|
42
|
+
...stateProps
|
|
43
|
+
},
|
|
44
|
+
patch
|
|
45
|
+
] = writablesForProps(defaultCommonAlertConfig, config, commonAlertConfigValidator);
|
|
46
|
+
const transition = createTransition({
|
|
47
|
+
props: {
|
|
48
|
+
transition: transition$,
|
|
49
|
+
visible: requestedVisible$,
|
|
50
|
+
animated: animated$,
|
|
51
|
+
animatedOnInit: animatedOnInit$,
|
|
52
|
+
onVisibleChange: onVisibleChange$,
|
|
53
|
+
onHidden: onHidden$,
|
|
54
|
+
onShown: onShown$
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const visible$ = transition.stores.visible$;
|
|
58
|
+
const hidden$ = transition.stores.hidden$;
|
|
59
|
+
return {
|
|
60
|
+
...stateStores({ ...stateProps, visible$, hidden$ }),
|
|
61
|
+
patch,
|
|
62
|
+
api: {
|
|
63
|
+
open: transition.api.show,
|
|
64
|
+
close: transition.api.hide
|
|
65
|
+
},
|
|
66
|
+
directives: {
|
|
67
|
+
transitionDirective: transition.directives.directive
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
createCommonAlert as c,
|
|
73
|
+
getCommonAlertDefaultConfig as g
|
|
74
|
+
};
|