@agnos-ui/core 0.1.1 → 0.3.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/README.md +3 -3
- package/accordion-BaWN0_n-.js +330 -0
- package/accordion-BuIgxZ0S.cjs +329 -0
- package/alert-C4jCg9Pl.cjs +8 -0
- package/alert-Dlf-BV98.js +9 -0
- package/common-DRdsw5m8.js +76 -0
- package/common-nJRMXbwj.cjs +75 -0
- package/components/accordion/accordion.d.ts +57 -64
- package/components/accordion/index.cjs +7 -0
- package/components/accordion/index.js +7 -1
- package/components/alert/alert.d.ts +3 -12
- package/components/alert/common.d.ts +4 -13
- package/components/alert/index.cjs +10 -0
- package/components/alert/index.js +10 -2
- package/components/modal/index.cjs +7 -0
- package/components/modal/index.js +7 -1
- package/components/modal/modal.d.ts +7 -49
- package/components/pagination/index.cjs +5 -0
- package/components/pagination/index.d.ts +0 -1
- package/components/pagination/index.js +5 -2
- package/components/pagination/pagination.d.ts +107 -128
- package/components/progressbar/index.cjs +5 -0
- package/components/progressbar/index.js +5 -1
- package/components/progressbar/progressbar.d.ts +6 -22
- package/components/rating/index.cjs +5 -0
- package/components/rating/index.js +5 -1
- package/components/rating/rating.d.ts +16 -11
- package/components/select/index.cjs +6 -0
- package/components/select/index.js +6 -1
- package/components/select/select.d.ts +45 -57
- package/components/slider/index.cjs +5 -0
- package/components/slider/index.js +5 -1
- package/components/slider/slider.d.ts +63 -5
- package/components/toast/index.cjs +5 -0
- package/components/toast/index.d.ts +1 -0
- package/components/toast/index.js +5 -0
- package/components/toast/toast.d.ts +47 -0
- package/config.cjs +38 -0
- package/config.d.ts +6 -1
- package/config.js +35 -50
- package/directive-BTSEYLF3.cjs +404 -0
- package/directive-DCYlDznf.js +405 -0
- package/func-DR0n-ShK.js +7 -0
- package/func-Qd3cD9a3.cjs +6 -0
- package/index.cjs +119 -0
- package/index.d.ts +3 -1
- package/index.js +119 -31
- package/modal-BI2qUu1M.js +251 -0
- package/modal-rzMpATf5.cjs +250 -0
- package/package.json +30 -22
- package/pagination--GkwduJn.js +263 -0
- package/pagination-EWSWQT1I.cjs +262 -0
- package/progressbar-DH7DHYMp.cjs +83 -0
- package/progressbar-DuRX7_my.js +84 -0
- package/promise-BMJ8qhA8.cjs +118 -0
- package/promise-CY2U8bTP.js +119 -0
- package/rating-BR5wD7y2.js +173 -0
- package/rating-CmuYUSxy.cjs +172 -0
- package/select-BCs6HQWn.js +358 -0
- package/select-CCIKn8WR.cjs +357 -0
- package/services/extendWidget.cjs +32 -0
- package/services/extendWidget.d.ts +10 -5
- package/services/extendWidget.js +31 -34
- package/services/floatingUI.cjs +131 -0
- package/services/floatingUI.d.ts +30 -14
- package/services/floatingUI.js +128 -102
- package/services/focustrack.cjs +47 -0
- package/services/focustrack.js +45 -44
- package/services/hash.cjs +15 -0
- package/services/hash.d.ts +2 -0
- package/services/hash.js +15 -0
- package/services/intersection.cjs +53 -0
- package/services/intersection.js +48 -50
- package/services/matchMedia.cjs +13 -0
- package/services/matchMedia.d.ts +7 -0
- package/services/matchMedia.js +13 -0
- package/services/navManager.cjs +196 -0
- package/services/navManager.d.ts +24 -17
- package/services/navManager.js +186 -162
- package/services/portal.cjs +43 -0
- package/services/portal.js +41 -42
- package/services/resizeObserver.cjs +32 -0
- package/services/resizeObserver.d.ts +14 -0
- package/services/resizeObserver.js +32 -0
- package/services/siblingsInert.cjs +40 -0
- package/services/siblingsInert.js +31 -31
- package/services/transitions/baseTransitions.cjs +171 -0
- package/services/transitions/baseTransitions.d.ts +16 -16
- package/services/transitions/baseTransitions.js +159 -170
- package/services/transitions/collapse.cjs +44 -0
- package/services/transitions/collapse.js +41 -49
- package/services/transitions/cssTransitions.cjs +32 -0
- package/services/transitions/cssTransitions.d.ts +2 -1
- package/services/transitions/cssTransitions.js +29 -39
- package/services/transitions/simpleClassTransition.cjs +31 -0
- package/services/transitions/simpleClassTransition.js +30 -41
- package/slider-CA_fszn7.js +536 -0
- package/slider-DsLvT87U.cjs +535 -0
- package/toast-8tWp6x89.js +63 -0
- package/toast-Aw8o0Iwe.cjs +62 -0
- package/types.cjs +12 -0
- package/types.d.ts +21 -1
- package/types.js +11 -13
- package/utils/directive.cjs +26 -0
- package/utils/directive.d.ts +155 -4
- package/utils/directive.js +25 -189
- package/utils/internal/dom.d.ts +57 -3
- package/utils/internal/promise.d.ts +2 -2
- package/utils/internal/ssrHTMLElement.d.ts +7 -0
- package/utils/internal/textDirection.d.ts +1 -1
- package/utils/stores.cjs +163 -0
- package/utils/stores.d.ts +23 -20
- package/utils/stores.js +151 -269
- package/utils/writables.cjs +13 -0
- package/utils/writables.js +12 -71
- package/writables-D46sFgGK.cjs +85 -0
- package/writables-DoU_XYTX.js +86 -0
- package/components/accordion/accordion.js +0 -267
- package/components/alert/alert.js +0 -22
- package/components/alert/common.js +0 -69
- package/components/commonProps.js +0 -1
- package/components/modal/modal.js +0 -186
- package/components/pagination/bootstrap.d.ts +0 -8
- package/components/pagination/bootstrap.js +0 -110
- package/components/pagination/pagination.js +0 -149
- package/components/progressbar/progressbar.js +0 -78
- package/components/rating/rating.js +0 -138
- package/components/select/select.js +0 -266
- package/components/slider/slider.js +0 -415
- package/services/transitions/bootstrap/collapse.d.ts +0 -2
- package/services/transitions/bootstrap/collapse.js +0 -15
- package/services/transitions/bootstrap/fade.d.ts +0 -1
- package/services/transitions/bootstrap/fade.js +0 -7
- package/services/transitions/bootstrap.d.ts +0 -2
- package/services/transitions/bootstrap.js +0 -2
- package/utils/internal/checks.js +0 -60
- package/utils/internal/dom.js +0 -61
- package/utils/internal/func.js +0 -11
- package/utils/internal/isFocusable.js +0 -35
- package/utils/internal/math.js +0 -13
- package/utils/internal/promise.js +0 -169
- package/utils/internal/scrollbars.js +0 -33
- package/utils/internal/sort.js +0 -28
- package/utils/internal/textDirection.js +0 -7
- package/utils/internal/traversal.js +0 -105
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { createTransition } from "./services/transitions/baseTransitions.js";
|
|
2
|
+
import { n as noop } from "./func-DR0n-ShK.js";
|
|
3
|
+
import { writablesForProps, stateStores } from "./utils/stores.js";
|
|
4
|
+
import { c as bindDirectiveNoArg } from "./directive-DCYlDznf.js";
|
|
5
|
+
import { c as typeBoolean } from "./writables-DoU_XYTX.js";
|
|
6
|
+
const defaultCommonAlertConfig = {
|
|
7
|
+
visible: true,
|
|
8
|
+
dismissible: true,
|
|
9
|
+
ariaCloseButtonLabel: "Close",
|
|
10
|
+
onVisibleChange: noop,
|
|
11
|
+
onShown: noop,
|
|
12
|
+
onHidden: noop,
|
|
13
|
+
animated: true,
|
|
14
|
+
animatedOnInit: false,
|
|
15
|
+
transition: async () => {
|
|
16
|
+
},
|
|
17
|
+
className: ""
|
|
18
|
+
};
|
|
19
|
+
function getCommonAlertDefaultConfig() {
|
|
20
|
+
return { ...defaultCommonAlertConfig };
|
|
21
|
+
}
|
|
22
|
+
const commonAlertConfigValidator = {
|
|
23
|
+
dismissible: typeBoolean
|
|
24
|
+
};
|
|
25
|
+
function createCommonAlert(config) {
|
|
26
|
+
const [
|
|
27
|
+
{
|
|
28
|
+
transition$,
|
|
29
|
+
animatedOnInit$,
|
|
30
|
+
animated$,
|
|
31
|
+
visible$: requestedVisible$,
|
|
32
|
+
onVisibleChange$,
|
|
33
|
+
onHidden$,
|
|
34
|
+
onShown$,
|
|
35
|
+
...stateProps
|
|
36
|
+
},
|
|
37
|
+
patch
|
|
38
|
+
] = writablesForProps(defaultCommonAlertConfig, config, commonAlertConfigValidator);
|
|
39
|
+
const transition = createTransition({
|
|
40
|
+
props: {
|
|
41
|
+
transition: transition$,
|
|
42
|
+
visible: requestedVisible$,
|
|
43
|
+
animated: animated$,
|
|
44
|
+
animatedOnInit: animatedOnInit$,
|
|
45
|
+
onVisibleChange: onVisibleChange$,
|
|
46
|
+
onHidden: onHidden$,
|
|
47
|
+
onShown: onShown$
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const close = () => {
|
|
51
|
+
patch({ visible: false });
|
|
52
|
+
};
|
|
53
|
+
const open = () => {
|
|
54
|
+
patch({ visible: true });
|
|
55
|
+
};
|
|
56
|
+
const visible$ = transition.stores.visible$;
|
|
57
|
+
const hidden$ = transition.stores.hidden$;
|
|
58
|
+
return {
|
|
59
|
+
...stateStores({ ...stateProps, visible$, hidden$ }),
|
|
60
|
+
patch,
|
|
61
|
+
api: {
|
|
62
|
+
open,
|
|
63
|
+
close
|
|
64
|
+
},
|
|
65
|
+
directives: {
|
|
66
|
+
transitionDirective: bindDirectiveNoArg(transition.directives.directive)
|
|
67
|
+
},
|
|
68
|
+
actions: {}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
createCommonAlert as a,
|
|
73
|
+
commonAlertConfigValidator as c,
|
|
74
|
+
defaultCommonAlertConfig as d,
|
|
75
|
+
getCommonAlertDefaultConfig as g
|
|
76
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const services_transitions_baseTransitions = require("./services/transitions/baseTransitions.cjs");
|
|
3
|
+
const func = require("./func-Qd3cD9a3.cjs");
|
|
4
|
+
const utils_stores = require("./utils/stores.cjs");
|
|
5
|
+
const utils_directive = require("./directive-BTSEYLF3.cjs");
|
|
6
|
+
const utils_writables = require("./writables-D46sFgGK.cjs");
|
|
7
|
+
const defaultCommonAlertConfig = {
|
|
8
|
+
visible: true,
|
|
9
|
+
dismissible: true,
|
|
10
|
+
ariaCloseButtonLabel: "Close",
|
|
11
|
+
onVisibleChange: func.noop,
|
|
12
|
+
onShown: func.noop,
|
|
13
|
+
onHidden: func.noop,
|
|
14
|
+
animated: true,
|
|
15
|
+
animatedOnInit: false,
|
|
16
|
+
transition: async () => {
|
|
17
|
+
},
|
|
18
|
+
className: ""
|
|
19
|
+
};
|
|
20
|
+
function getCommonAlertDefaultConfig() {
|
|
21
|
+
return { ...defaultCommonAlertConfig };
|
|
22
|
+
}
|
|
23
|
+
const commonAlertConfigValidator = {
|
|
24
|
+
dismissible: utils_writables.typeBoolean
|
|
25
|
+
};
|
|
26
|
+
function createCommonAlert(config) {
|
|
27
|
+
const [
|
|
28
|
+
{
|
|
29
|
+
transition$,
|
|
30
|
+
animatedOnInit$,
|
|
31
|
+
animated$,
|
|
32
|
+
visible$: requestedVisible$,
|
|
33
|
+
onVisibleChange$,
|
|
34
|
+
onHidden$,
|
|
35
|
+
onShown$,
|
|
36
|
+
...stateProps
|
|
37
|
+
},
|
|
38
|
+
patch
|
|
39
|
+
] = utils_stores.writablesForProps(defaultCommonAlertConfig, config, commonAlertConfigValidator);
|
|
40
|
+
const transition = services_transitions_baseTransitions.createTransition({
|
|
41
|
+
props: {
|
|
42
|
+
transition: transition$,
|
|
43
|
+
visible: requestedVisible$,
|
|
44
|
+
animated: animated$,
|
|
45
|
+
animatedOnInit: animatedOnInit$,
|
|
46
|
+
onVisibleChange: onVisibleChange$,
|
|
47
|
+
onHidden: onHidden$,
|
|
48
|
+
onShown: onShown$
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const close = () => {
|
|
52
|
+
patch({ visible: false });
|
|
53
|
+
};
|
|
54
|
+
const open = () => {
|
|
55
|
+
patch({ visible: true });
|
|
56
|
+
};
|
|
57
|
+
const visible$ = transition.stores.visible$;
|
|
58
|
+
const hidden$ = transition.stores.hidden$;
|
|
59
|
+
return {
|
|
60
|
+
...utils_stores.stateStores({ ...stateProps, visible$, hidden$ }),
|
|
61
|
+
patch,
|
|
62
|
+
api: {
|
|
63
|
+
open,
|
|
64
|
+
close
|
|
65
|
+
},
|
|
66
|
+
directives: {
|
|
67
|
+
transitionDirective: utils_directive.bindDirectiveNoArg(transition.directives.directive)
|
|
68
|
+
},
|
|
69
|
+
actions: {}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
exports.commonAlertConfigValidator = commonAlertConfigValidator;
|
|
73
|
+
exports.createCommonAlert = createCommonAlert;
|
|
74
|
+
exports.defaultCommonAlertConfig = defaultCommonAlertConfig;
|
|
75
|
+
exports.getCommonAlertDefaultConfig = getCommonAlertDefaultConfig;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { TransitionFn } from '../../services/transitions/baseTransitions';
|
|
2
|
-
import type { Directive, PropsConfig,
|
|
2
|
+
import type { ConfigValidator, Directive, PropsConfig, Widget, WidgetFactory } from '../../types';
|
|
3
3
|
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
4
4
|
export interface AccordionProps extends WidgetsCommonPropsAndState {
|
|
5
5
|
/**
|
|
6
|
-
* If `true`, only one item at the time can stay open.
|
|
6
|
+
* If `true`, only one accordion-item at the time can stay open.
|
|
7
7
|
*/
|
|
8
8
|
closeOthers: boolean;
|
|
9
9
|
/**
|
|
@@ -25,7 +25,7 @@ export interface AccordionProps extends WidgetsCommonPropsAndState {
|
|
|
25
25
|
*/
|
|
26
26
|
itemId: string;
|
|
27
27
|
/**
|
|
28
|
-
* If `true`, the
|
|
28
|
+
* If `true`, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
|
|
29
29
|
*
|
|
30
30
|
* It is a prop of the accordion-item.
|
|
31
31
|
*/
|
|
@@ -48,9 +48,9 @@ export interface AccordionProps extends WidgetsCommonPropsAndState {
|
|
|
48
48
|
*
|
|
49
49
|
* It is a prop of the accordion-item.
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
itemAnimated: boolean;
|
|
52
52
|
/**
|
|
53
|
-
* The transition to use for the accordion-item
|
|
53
|
+
* The transition to use for the accordion-item body-container when the accordion-item is toggled.
|
|
54
54
|
*
|
|
55
55
|
* It is a prop of the accordion-item.
|
|
56
56
|
*/
|
|
@@ -76,51 +76,32 @@ export interface AccordionProps extends WidgetsCommonPropsAndState {
|
|
|
76
76
|
*/
|
|
77
77
|
onItemVisibleChange: (visible: boolean) => void;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
80
|
-
* contains accordion header and accordion collapse; the accordion header contains the accordion button
|
|
81
|
-
* (that contains `slotItemHeader`), while the accordion collapse contains the accordion body (that contains slotItemBody).
|
|
82
|
-
*
|
|
83
|
-
* It is a prop of the accordion-item.
|
|
84
|
-
*/
|
|
85
|
-
slotItemStructure: SlotContent<AccordionItemContext>;
|
|
86
|
-
/**
|
|
87
|
-
* Content present in the accordion body.
|
|
88
|
-
*
|
|
89
|
-
* It is a prop of the accordion-item.
|
|
90
|
-
*/
|
|
91
|
-
slotItemBody: SlotContent<AccordionItemContext>;
|
|
92
|
-
/**
|
|
93
|
-
* Content present in the accordion button inside the accordion header.
|
|
94
|
-
*
|
|
95
|
-
* It is a prop of the accordion-item.
|
|
96
|
-
*/
|
|
97
|
-
slotItemHeader: SlotContent<AccordionItemContext>;
|
|
98
|
-
/**
|
|
99
|
-
* Classes to add on the accordion-item DOM element.
|
|
79
|
+
* CSS classes to add on the accordion-item DOM element.
|
|
100
80
|
*
|
|
101
81
|
* It is a prop of the accordion-item.
|
|
102
82
|
*/
|
|
103
83
|
itemClass: string;
|
|
104
84
|
/**
|
|
105
|
-
*
|
|
85
|
+
* CSS classes to add on the accordion-item header DOM element.
|
|
106
86
|
*
|
|
107
87
|
* It is a prop of the accordion-item.
|
|
108
88
|
*/
|
|
109
89
|
itemHeaderClass: string;
|
|
110
90
|
/**
|
|
111
|
-
*
|
|
91
|
+
* CSS classes to add on the accordion-item toggle button DOM element.
|
|
112
92
|
*
|
|
113
93
|
* It is a prop of the accordion-item.
|
|
114
94
|
*/
|
|
115
95
|
itemButtonClass: string;
|
|
116
96
|
/**
|
|
117
|
-
*
|
|
97
|
+
* CSS classes to add on the accordion-item body container DOM element.
|
|
98
|
+
* The accordion-item body container is the DOM element on what the itemTransition is applied.
|
|
118
99
|
*
|
|
119
100
|
* It is a prop of the accordion-item.
|
|
120
101
|
*/
|
|
121
|
-
|
|
102
|
+
itemBodyContainerClass: string;
|
|
122
103
|
/**
|
|
123
|
-
*
|
|
104
|
+
* CSS classes to add on the accordion-item body DOM element.
|
|
124
105
|
*
|
|
125
106
|
* It is a prop of the accordion-item.
|
|
126
107
|
*/
|
|
@@ -139,12 +120,6 @@ export interface AccordionState extends WidgetsCommonPropsAndState {
|
|
|
139
120
|
itemsWidget: AccordionItemWidget[];
|
|
140
121
|
}
|
|
141
122
|
export interface AccordionApi {
|
|
142
|
-
/**
|
|
143
|
-
* Given the itemId, it will return if such item is visible (expanded) or not.
|
|
144
|
-
*
|
|
145
|
-
* If the itemId is not a valid id it will return `false`.
|
|
146
|
-
*/
|
|
147
|
-
isExpanded(itemId: string): boolean;
|
|
148
123
|
/**
|
|
149
124
|
* Given the itemId, will expand the corresponding accordion-item.
|
|
150
125
|
*
|
|
@@ -185,7 +160,6 @@ export interface AccordionDirectives {
|
|
|
185
160
|
accordionDirective: Directive;
|
|
186
161
|
}
|
|
187
162
|
export type AccordionWidget = Widget<AccordionProps, AccordionState, AccordionApi, object, AccordionDirectives>;
|
|
188
|
-
export type AccordionItemContext = WidgetSlotContext<AccordionItemWidget>;
|
|
189
163
|
export interface AccordionItemActions {
|
|
190
164
|
/**
|
|
191
165
|
* Action to be called when the user clicks on the accordion-item button. If the accordion-item is disabled nothing will happen.
|
|
@@ -212,9 +186,25 @@ export interface AccordionItemApi {
|
|
|
212
186
|
}
|
|
213
187
|
export interface AccordionItemDirectives {
|
|
214
188
|
/**
|
|
215
|
-
* Directive to
|
|
189
|
+
* Directive to use in special cases, if the accordion header does not use a button element to control the collapsing.
|
|
190
|
+
*/
|
|
191
|
+
toggleDirective: Directive;
|
|
192
|
+
/**
|
|
193
|
+
* Directive to put on the button element that will control the collapsing of the accordion-item.
|
|
216
194
|
*/
|
|
217
|
-
|
|
195
|
+
buttonDirective: Directive;
|
|
196
|
+
/**
|
|
197
|
+
* Directive to put on the accordion-item header that will contain the button element.
|
|
198
|
+
*/
|
|
199
|
+
headerDirective: Directive;
|
|
200
|
+
/**
|
|
201
|
+
* Directive to put on the accordion-item body.
|
|
202
|
+
*/
|
|
203
|
+
bodyDirective: Directive;
|
|
204
|
+
/**
|
|
205
|
+
* Directive to be put on the accordion-item body container. It will handle the animation.
|
|
206
|
+
*/
|
|
207
|
+
bodyContainerDirective: Directive;
|
|
218
208
|
/**
|
|
219
209
|
* Directive to be put on the accordion-item. It will handle adding the accordion-item to the accordion.
|
|
220
210
|
*/
|
|
@@ -235,37 +225,24 @@ export interface AccordionItemCommonPropsAndState {
|
|
|
235
225
|
*/
|
|
236
226
|
itemId: string;
|
|
237
227
|
/**
|
|
238
|
-
*
|
|
239
|
-
*/
|
|
240
|
-
slotItemHeader: SlotContent<AccordionItemContext>;
|
|
241
|
-
/**
|
|
242
|
-
* Content present in the accordion body.
|
|
243
|
-
*/
|
|
244
|
-
slotItemBody: SlotContent<AccordionItemContext>;
|
|
245
|
-
/**
|
|
246
|
-
* Structure of the accordion-item. The default item structure is: accordion-item
|
|
247
|
-
* contains accordion header and accordion collapse; the accordion header contains the accordion button
|
|
248
|
-
* (that contains `slotItemHeader`), while the accordion collapse contains the accordion body (that contains slotItemBody).
|
|
249
|
-
*/
|
|
250
|
-
slotItemStructure: SlotContent<AccordionItemContext>;
|
|
251
|
-
/**
|
|
252
|
-
* Classes to add on the accordion-item DOM element.
|
|
228
|
+
* CSS classes to add on the accordion-item DOM element.
|
|
253
229
|
*/
|
|
254
230
|
itemClass: string;
|
|
255
231
|
/**
|
|
256
|
-
*
|
|
232
|
+
* CSS classes to add on the accordion-item header DOM element.
|
|
257
233
|
*/
|
|
258
234
|
itemHeaderClass: string;
|
|
259
235
|
/**
|
|
260
|
-
*
|
|
236
|
+
* CSS classes to add on the accordion-item collapse DOM element.
|
|
261
237
|
*/
|
|
262
238
|
itemButtonClass: string;
|
|
263
239
|
/**
|
|
264
|
-
*
|
|
240
|
+
* CSS classes to add on the accordion-item body container DOM element.
|
|
241
|
+
* The accordion-item body container is the DOM element on what the itemTransition is applied.
|
|
265
242
|
*/
|
|
266
|
-
|
|
243
|
+
itemBodyContainerClass: string;
|
|
267
244
|
/**
|
|
268
|
-
*
|
|
245
|
+
* CSS classes to add on the accordion-item body DOM element.
|
|
269
246
|
*/
|
|
270
247
|
itemBodyClass: string;
|
|
271
248
|
/**
|
|
@@ -277,13 +254,13 @@ export interface AccordionItemProps extends AccordionItemCommonPropsAndState {
|
|
|
277
254
|
/**
|
|
278
255
|
* If `true`, accordion-item will be animated.
|
|
279
256
|
*/
|
|
280
|
-
|
|
257
|
+
itemAnimated: boolean;
|
|
281
258
|
/**
|
|
282
|
-
* The transition to use for the accordion-item
|
|
259
|
+
* The transition to use for the accordion-item body-container when the accordion-item is toggled.
|
|
283
260
|
*/
|
|
284
261
|
itemTransition: TransitionFn;
|
|
285
262
|
/**
|
|
286
|
-
* If `true`, the
|
|
263
|
+
* If `true`, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
|
|
287
264
|
*/
|
|
288
265
|
itemDestroyOnHide: boolean;
|
|
289
266
|
/**
|
|
@@ -314,9 +291,25 @@ export type AccordionItemWidget = Widget<AccordionItemProps, AccordionItemState,
|
|
|
314
291
|
* @returns the default accordion config
|
|
315
292
|
*/
|
|
316
293
|
export declare function getAccordionDefaultConfig(): AccordionProps;
|
|
294
|
+
/**
|
|
295
|
+
* Creates a new AccordionItem widget instance.
|
|
296
|
+
* @param config - config of the accordion item, either as a store or as an object containing values or stores.
|
|
297
|
+
* @returns a new accordion item widget instance
|
|
298
|
+
*/
|
|
299
|
+
export declare function createAccordionItem(config?: PropsConfig<AccordionItemProps>): AccordionItemWidget;
|
|
300
|
+
/**
|
|
301
|
+
* Create an accordion WidgetFactory based on a item factory and the list of item props that should inherit from the parent accordion
|
|
302
|
+
*
|
|
303
|
+
* @param itemFactory - the item factory
|
|
304
|
+
* @param accordionItemProps - the list of item props
|
|
305
|
+
* @param accordionConfig - the default accordion config
|
|
306
|
+
* @param accordionValidator - the validator of props
|
|
307
|
+
* @returns the accordion widget factory
|
|
308
|
+
*/
|
|
309
|
+
export declare function factoryCreateAccordion(itemFactory?: WidgetFactory<AccordionItemWidget>, accordionItemProps?: string[], accordionConfig?: AccordionProps, accordionValidator?: ConfigValidator<AccordionProps>): WidgetFactory<AccordionWidget>;
|
|
317
310
|
/**
|
|
318
311
|
* Creates a new Accordion widget instance.
|
|
319
312
|
* @param config - config of the accordion, either as a store or as an object containing values or stores.
|
|
320
313
|
* @returns a new accordion widget instance
|
|
321
314
|
*/
|
|
322
|
-
export declare
|
|
315
|
+
export declare const createAccordion: WidgetFactory<AccordionWidget>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const accordion = require("../../accordion-BuIgxZ0S.cjs");
|
|
4
|
+
exports.createAccordion = accordion.createAccordion;
|
|
5
|
+
exports.createAccordionItem = accordion.createAccordionItem;
|
|
6
|
+
exports.factoryCreateAccordion = accordion.factoryCreateAccordion;
|
|
7
|
+
exports.getAccordionDefaultConfig = accordion.getAccordionDefaultConfig;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import type { CommonAlertApi, CommonAlertDirectives, CommonAlertProps, CommonAlertState } from './common';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export type AlertContext = WidgetSlotContext<AlertWidget>;
|
|
5
|
-
export interface AlertExtraProps {
|
|
6
|
-
/**
|
|
7
|
-
* Type of the alert.
|
|
8
|
-
* There are the following types: 'success', 'info', 'warning', 'danger', 'primary', 'secondary', 'light' and 'dark'.
|
|
9
|
-
*/
|
|
10
|
-
type: string;
|
|
2
|
+
import type { Widget, WidgetFactory } from '../../types';
|
|
3
|
+
export interface AlertState extends CommonAlertState {
|
|
11
4
|
}
|
|
12
|
-
export interface
|
|
13
|
-
}
|
|
14
|
-
export interface AlertProps extends ExtendWidgetAdaptSlotWidgetProps<CommonAlertProps, AlertExtraProps> {
|
|
5
|
+
export interface AlertProps extends CommonAlertProps {
|
|
15
6
|
}
|
|
16
7
|
export interface AlertApi extends CommonAlertApi {
|
|
17
8
|
}
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import type { TransitionFn } from '../../services/transitions/baseTransitions';
|
|
2
2
|
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
3
|
-
import type { ConfigValidator, Directive, PropsConfig,
|
|
4
|
-
export type CommonAlertContext = WidgetSlotContext<CommonAlertWidget>;
|
|
3
|
+
import type { ConfigValidator, Directive, PropsConfig, Widget } from '../../types';
|
|
5
4
|
export interface CommonAlertCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
6
5
|
/**
|
|
7
6
|
* If `true`, alert can be dismissed by the user.
|
|
8
7
|
* The close button (×) will be displayed and you can be notified of the event with the (close) output.
|
|
9
8
|
*/
|
|
10
9
|
dismissible: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Template for the alert content
|
|
13
|
-
*/
|
|
14
|
-
slotDefault: SlotContent<CommonAlertContext>;
|
|
15
|
-
/**
|
|
16
|
-
* Global template for the alert component
|
|
17
|
-
*/
|
|
18
|
-
slotStructure: SlotContent<CommonAlertContext>;
|
|
19
10
|
/**
|
|
20
11
|
* If `true` the alert is visible to the user
|
|
21
12
|
*/
|
|
@@ -47,7 +38,7 @@ export interface CommonAlertProps extends CommonAlertCommonPropsAndState {
|
|
|
47
38
|
/**
|
|
48
39
|
* The transition function will be executed when the alert is displayed or hidden.
|
|
49
40
|
*
|
|
50
|
-
* Depending on the value of {@link CommonAlertProps.
|
|
41
|
+
* Depending on the value of {@link CommonAlertProps.animatedOnInit}, the animation can be optionally skipped during the showing process.
|
|
51
42
|
*/
|
|
52
43
|
transition: TransitionFn;
|
|
53
44
|
/**
|
|
@@ -56,14 +47,14 @@ export interface CommonAlertProps extends CommonAlertCommonPropsAndState {
|
|
|
56
47
|
* Animation is triggered when the `.open()` function is called
|
|
57
48
|
* or the visible prop is changed
|
|
58
49
|
*/
|
|
59
|
-
|
|
50
|
+
animatedOnInit: boolean;
|
|
60
51
|
/**
|
|
61
52
|
* If `true`, alert closing will be animated.
|
|
62
53
|
*
|
|
63
54
|
* Animation is triggered when clicked on the close button (×),
|
|
64
55
|
* via the `.close()` function or the visible prop is changed
|
|
65
56
|
*/
|
|
66
|
-
|
|
57
|
+
animated: boolean;
|
|
67
58
|
}
|
|
68
59
|
export interface CommonAlertApi {
|
|
69
60
|
/**
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const common = require("../../common-nJRMXbwj.cjs");
|
|
4
|
+
const alert = require("../../alert-C4jCg9Pl.cjs");
|
|
5
|
+
exports.commonAlertConfigValidator = common.commonAlertConfigValidator;
|
|
6
|
+
exports.createCommonAlert = common.createCommonAlert;
|
|
7
|
+
exports.defaultCommonAlertConfig = common.defaultCommonAlertConfig;
|
|
8
|
+
exports.getCommonAlertDefaultConfig = common.getCommonAlertDefaultConfig;
|
|
9
|
+
exports.createAlert = alert.createAlert;
|
|
10
|
+
exports.getAlertDefaultConfig = alert.getAlertDefaultConfig;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { c, a, d, g } from "../../common-DRdsw5m8.js";
|
|
2
|
+
import { c as c2, g as g2 } from "../../alert-Dlf-BV98.js";
|
|
3
|
+
export {
|
|
4
|
+
c as commonAlertConfigValidator,
|
|
5
|
+
c2 as createAlert,
|
|
6
|
+
a as createCommonAlert,
|
|
7
|
+
d as defaultCommonAlertConfig,
|
|
8
|
+
g2 as getAlertDefaultConfig,
|
|
9
|
+
g as getCommonAlertDefaultConfig
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const modal = require("../../modal-rzMpATf5.cjs");
|
|
4
|
+
exports.createModal = modal.createModal;
|
|
5
|
+
exports.getModalDefaultConfig = modal.getModalDefaultConfig;
|
|
6
|
+
exports.modalCloseButtonClick = modal.modalCloseButtonClick;
|
|
7
|
+
exports.modalOutsideClick = modal.modalOutsideClick;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
2
2
|
import type { TransitionFn } from '../../services/transitions/baseTransitions';
|
|
3
|
-
import type { Directive, PropsConfig,
|
|
3
|
+
import type { Directive, PropsConfig, Widget } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* Value present in the {@link ModalBeforeCloseEvent.result|result} property of the {@link ModalProps.onBeforeClose|onBeforeClose} event
|
|
6
6
|
* and returned by the {@link ModalApi.open|open} method, when the modal is closed by a click inside the viewport but outside the modal.
|
|
@@ -11,10 +11,6 @@ export declare const modalOutsideClick: unique symbol;
|
|
|
11
11
|
* and returned by the {@link ModalApi.open|open} method, when the modal is closed by a click on the close button.
|
|
12
12
|
*/
|
|
13
13
|
export declare const modalCloseButtonClick: unique symbol;
|
|
14
|
-
/**
|
|
15
|
-
* Context of the modal slots.
|
|
16
|
-
*/
|
|
17
|
-
export type ModalContext<Data> = WidgetSlotContext<ModalWidget<Data>>;
|
|
18
14
|
/**
|
|
19
15
|
* Properties of the modal widget that are also in the state of the modal.
|
|
20
16
|
*/
|
|
@@ -37,27 +33,6 @@ export interface ModalCommonPropsAndState<Data> extends WidgetsCommonPropsAndSta
|
|
|
37
33
|
* Otherwise, they stay where the widget is located.
|
|
38
34
|
*/
|
|
39
35
|
container: HTMLElement | null;
|
|
40
|
-
/**
|
|
41
|
-
* Body of the modal.
|
|
42
|
-
*/
|
|
43
|
-
slotDefault: SlotContent<ModalContext<Data>>;
|
|
44
|
-
/**
|
|
45
|
-
* Footer of the modal.
|
|
46
|
-
*/
|
|
47
|
-
slotFooter: SlotContent<ModalContext<Data>>;
|
|
48
|
-
/**
|
|
49
|
-
* Header of the modal. The default header includes {@link ModalCommonPropsAndState.slotTitle|slotTitle}.
|
|
50
|
-
*/
|
|
51
|
-
slotHeader: SlotContent<ModalContext<Data>>;
|
|
52
|
-
/**
|
|
53
|
-
* Structure of the modal.
|
|
54
|
-
* The default structure uses {@link ModalCommonPropsAndState.slotHeader|slotHeader}, {@link ModalCommonPropsAndState.slotDefault|slotDefault} and {@link ModalCommonPropsAndState.slotFooter|slotFooter}.
|
|
55
|
-
*/
|
|
56
|
-
slotStructure: SlotContent<ModalContext<Data>>;
|
|
57
|
-
/**
|
|
58
|
-
* Title of the modal.
|
|
59
|
-
*/
|
|
60
|
-
slotTitle: SlotContent<ModalContext<Data>>;
|
|
61
36
|
/**
|
|
62
37
|
* Whether the modal should be visible when the transition is completed.
|
|
63
38
|
*/
|
|
@@ -90,7 +65,7 @@ export interface ModalProps<Data> extends ModalCommonPropsAndState<Data> {
|
|
|
90
65
|
/**
|
|
91
66
|
* Whether the modal and its backdrop (if present) should be animated when shown or hidden.
|
|
92
67
|
*/
|
|
93
|
-
|
|
68
|
+
animated: boolean;
|
|
94
69
|
/**
|
|
95
70
|
* Whether a backdrop should be created behind the modal.
|
|
96
71
|
*/
|
|
@@ -211,6 +186,10 @@ export interface ModalDirectives {
|
|
|
211
186
|
* Portal directive to put on the backdrop DOM element.
|
|
212
187
|
*/
|
|
213
188
|
backdropPortalDirective: Directive;
|
|
189
|
+
/**
|
|
190
|
+
* Directive that adds all the necessary attributes to the close button
|
|
191
|
+
*/
|
|
192
|
+
closeButtonDirective: Directive;
|
|
214
193
|
}
|
|
215
194
|
/**
|
|
216
195
|
* Modal widget.
|
|
@@ -224,7 +203,7 @@ export declare function getModalDefaultConfig(): {
|
|
|
224
203
|
/**
|
|
225
204
|
* Whether the modal and its backdrop (if present) should be animated when shown or hidden.
|
|
226
205
|
*/
|
|
227
|
-
|
|
206
|
+
animated: boolean;
|
|
228
207
|
/**
|
|
229
208
|
* Whether a backdrop should be created behind the modal.
|
|
230
209
|
*/
|
|
@@ -280,27 +259,6 @@ export declare function getModalDefaultConfig(): {
|
|
|
280
259
|
* Otherwise, they stay where the widget is located.
|
|
281
260
|
*/
|
|
282
261
|
container: HTMLElement | null;
|
|
283
|
-
/**
|
|
284
|
-
* Body of the modal.
|
|
285
|
-
*/
|
|
286
|
-
slotDefault: SlotContent<ModalContext<any>>;
|
|
287
|
-
/**
|
|
288
|
-
* Footer of the modal.
|
|
289
|
-
*/
|
|
290
|
-
slotFooter: SlotContent<ModalContext<any>>;
|
|
291
|
-
/**
|
|
292
|
-
* Header of the modal. The default header includes {@link ModalCommonPropsAndState.slotTitle|slotTitle}.
|
|
293
|
-
*/
|
|
294
|
-
slotHeader: SlotContent<ModalContext<any>>;
|
|
295
|
-
/**
|
|
296
|
-
* Structure of the modal.
|
|
297
|
-
* The default structure uses {@link ModalCommonPropsAndState.slotHeader|slotHeader}, {@link ModalCommonPropsAndState.slotDefault|slotDefault} and {@link ModalCommonPropsAndState.slotFooter|slotFooter}.
|
|
298
|
-
*/
|
|
299
|
-
slotStructure: SlotContent<ModalContext<any>>;
|
|
300
|
-
/**
|
|
301
|
-
* Title of the modal.
|
|
302
|
-
*/
|
|
303
|
-
slotTitle: SlotContent<ModalContext<any>>;
|
|
304
262
|
/**
|
|
305
263
|
* Whether the modal should be visible when the transition is completed.
|
|
306
264
|
*/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const pagination = require("../../pagination-EWSWQT1I.cjs");
|
|
4
|
+
exports.createPagination = pagination.createPagination;
|
|
5
|
+
exports.getPaginationDefaultConfig = pagination.getPaginationDefaultConfig;
|