@agnos-ui/angular-bootstrap 0.4.0-next.0 → 0.4.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 +1 -1
- package/components/accordion/accordion.component.d.ts +38 -1
- package/components/accordion/accordion.gen.d.ts +77 -5
- package/components/accordion/index.d.ts +1 -1
- package/components/alert/alert.component.d.ts +32 -1
- package/components/alert/alert.gen.d.ts +61 -7
- package/components/alert/index.d.ts +1 -1
- package/components/modal/index.d.ts +1 -1
- package/components/modal/modal.component.d.ts +61 -9
- package/components/modal/modal.gen.d.ts +131 -31
- package/components/modal/modal.service.d.ts +1 -1
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/pagination.component.d.ts +113 -27
- package/components/pagination/pagination.gen.d.ts +204 -34
- package/components/progressbar/index.d.ts +1 -1
- package/components/progressbar/progressbar.component.d.ts +27 -3
- package/components/progressbar/progressbar.gen.d.ts +56 -3
- package/components/rating/index.d.ts +1 -1
- package/components/rating/rating.component.d.ts +46 -1
- package/components/rating/rating.gen.d.ts +84 -1
- package/components/select/index.d.ts +1 -1
- package/components/select/select.component.d.ts +67 -1
- package/components/select/select.gen.d.ts +121 -1
- package/components/slider/index.d.ts +1 -1
- package/components/slider/slider.component.d.ts +49 -1
- package/components/slider/slider.gen.d.ts +98 -3
- package/components/toast/index.d.ts +1 -1
- package/components/toast/toast.component.d.ts +35 -1
- package/components/toast/toast.gen.d.ts +65 -7
- package/esm2022/components/accordion/accordion.component.mjs +12 -2
- package/esm2022/components/accordion/accordion.gen.mjs +33 -2
- package/esm2022/components/accordion/index.mjs +2 -2
- package/esm2022/components/alert/alert.component.mjs +17 -2
- package/esm2022/components/alert/alert.gen.mjs +15 -2
- package/esm2022/components/alert/index.mjs +2 -2
- package/esm2022/components/modal/index.mjs +2 -2
- package/esm2022/components/modal/modal.component.mjs +55 -30
- package/esm2022/components/modal/modal.gen.mjs +27 -2
- package/esm2022/components/modal/modal.service.mjs +1 -1
- package/esm2022/components/pagination/index.mjs +2 -2
- package/esm2022/components/pagination/pagination.component.mjs +49 -45
- package/esm2022/components/pagination/pagination.gen.mjs +15 -2
- package/esm2022/components/progressbar/index.mjs +2 -2
- package/esm2022/components/progressbar/progressbar.component.mjs +9 -9
- package/esm2022/components/progressbar/progressbar.gen.mjs +15 -2
- package/esm2022/components/rating/index.mjs +2 -2
- package/esm2022/components/rating/rating.component.mjs +17 -2
- package/esm2022/components/rating/rating.gen.mjs +15 -2
- package/esm2022/components/select/index.mjs +2 -2
- package/esm2022/components/select/select.component.mjs +19 -2
- package/esm2022/components/select/select.gen.mjs +15 -2
- package/esm2022/components/slider/index.mjs +2 -2
- package/esm2022/components/slider/slider.component.mjs +7 -2
- package/esm2022/components/slider/slider.gen.mjs +15 -2
- package/esm2022/components/toast/index.mjs +2 -2
- package/esm2022/components/toast/toast.component.mjs +17 -2
- package/esm2022/components/toast/toast.gen.mjs +15 -2
- package/esm2022/index.mjs +3 -3
- package/fesm2022/agnos-ui-angular-bootstrap.mjs +328 -117
- package/fesm2022/agnos-ui-angular-bootstrap.mjs.map +1 -1
- package/index.d.ts +2 -2
- package/package.json +5 -5
- package/components/accordion/accordion.d.ts +0 -6
- package/components/alert/alert.d.ts +0 -5
- package/components/modal/modal.d.ts +0 -6
- package/components/pagination/pagination.d.ts +0 -5
- package/components/progressbar/progressbar.d.ts +0 -5
- package/components/rating/rating.d.ts +0 -5
- package/components/select/select.d.ts +0 -5
- package/components/slider/slider.d.ts +0 -5
- package/components/toast/toast.d.ts +0 -5
- package/esm2022/components/accordion/accordion.mjs +0 -5
- package/esm2022/components/alert/alert.mjs +0 -4
- package/esm2022/components/modal/modal.mjs +0 -5
- package/esm2022/components/pagination/pagination.mjs +0 -4
- package/esm2022/components/progressbar/progressbar.mjs +0 -4
- package/esm2022/components/rating/rating.mjs +0 -4
- package/esm2022/components/select/select.mjs +0 -4
- package/esm2022/components/slider/slider.mjs +0 -4
- package/esm2022/components/toast/toast.mjs +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SlotContent, TransitionFn } from '@agnos-ui/angular-headless';
|
|
2
2
|
import { BaseWidgetDirective, ComponentTemplate } from '@agnos-ui/angular-headless';
|
|
3
|
-
import type { ModalContext, ModalProps, ModalWidget, ModalBeforeCloseEvent } from './modal';
|
|
3
|
+
import type { ModalContext, ModalProps, ModalWidget, ModalBeforeCloseEvent } from './modal.gen';
|
|
4
4
|
import type { AfterContentChecked } from '@angular/core';
|
|
5
5
|
import { EventEmitter, TemplateRef } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
@@ -72,69 +72,96 @@ export declare const modalDefaultSlotStructure: ComponentTemplate<unknown, "stru
|
|
|
72
72
|
export declare class ModalComponent<Data> extends BaseWidgetDirective<ModalWidget<Data>> implements AfterContentChecked {
|
|
73
73
|
/**
|
|
74
74
|
* Whether the modal and its backdrop (if present) should be animated when shown or hidden.
|
|
75
|
+
*
|
|
76
|
+
* @defaultValue `true`
|
|
75
77
|
*/
|
|
76
78
|
animated: boolean | undefined;
|
|
77
79
|
/**
|
|
78
80
|
* The transition to use for the backdrop behind the modal (if present).
|
|
81
|
+
*
|
|
82
|
+
* @defaultValue `fadeTransition`
|
|
79
83
|
*/
|
|
80
84
|
backdropTransition: TransitionFn | undefined;
|
|
81
85
|
/**
|
|
82
86
|
* The transition to use for the modal.
|
|
87
|
+
*
|
|
88
|
+
* @defaultValue `fadeTransition`
|
|
83
89
|
*/
|
|
84
90
|
modalTransition: TransitionFn | undefined;
|
|
85
91
|
/**
|
|
86
92
|
* Whether the modal should be visible when the transition is completed.
|
|
93
|
+
*
|
|
94
|
+
* @defaultValue `false`
|
|
87
95
|
*/
|
|
88
96
|
visible: boolean | undefined;
|
|
89
97
|
/**
|
|
90
98
|
* Whether a backdrop should be created behind the modal.
|
|
99
|
+
*
|
|
100
|
+
* @defaultValue `true`
|
|
91
101
|
*/
|
|
92
102
|
backdrop: boolean | undefined;
|
|
93
103
|
/**
|
|
94
104
|
* Whether the modal should be closed when clicking on the viewport outside the modal.
|
|
105
|
+
*
|
|
106
|
+
* @defaultValue `true`
|
|
95
107
|
*/
|
|
96
108
|
closeOnOutsideClick: boolean | undefined;
|
|
97
109
|
/**
|
|
98
110
|
* Which element should contain the modal and backdrop DOM elements.
|
|
99
111
|
* If it is not null, the modal and backdrop DOM elements are moved to the specified container.
|
|
100
112
|
* Otherwise, they stay where the widget is located.
|
|
113
|
+
*
|
|
114
|
+
* @defaultValue
|
|
115
|
+
* ```ts
|
|
116
|
+
* typeof window !== 'undefined' ? document.body : null
|
|
117
|
+
* ```
|
|
101
118
|
*/
|
|
102
119
|
container: HTMLElement | null | undefined;
|
|
103
120
|
/**
|
|
104
121
|
* Value of the aria-label attribute to put on the close button.
|
|
122
|
+
*
|
|
123
|
+
* @defaultValue `'Close'`
|
|
105
124
|
*/
|
|
106
125
|
ariaCloseButtonLabel: string | undefined;
|
|
107
126
|
/**
|
|
108
127
|
* Classes to add on the backdrop DOM element.
|
|
128
|
+
*
|
|
129
|
+
* @defaultValue `''`
|
|
109
130
|
*/
|
|
110
131
|
backdropClass: string | undefined;
|
|
111
132
|
/**
|
|
112
133
|
* Whether to display the close button.
|
|
134
|
+
*
|
|
135
|
+
* @defaultValue `true`
|
|
113
136
|
*/
|
|
114
137
|
closeButton: boolean | undefined;
|
|
115
138
|
/**
|
|
116
139
|
* CSS classes to be applied on the widget main container
|
|
140
|
+
*
|
|
141
|
+
* @defaultValue `''`
|
|
117
142
|
*/
|
|
118
143
|
className: string | undefined;
|
|
119
144
|
/**
|
|
120
145
|
* Option to create a fullscreen modal, according to the bootstrap documentation.
|
|
146
|
+
*
|
|
147
|
+
* @defaultValue `false`
|
|
121
148
|
*/
|
|
122
149
|
fullscreen: boolean | undefined;
|
|
123
150
|
/**
|
|
124
151
|
* Structure of the modal.
|
|
125
|
-
* The default structure uses
|
|
152
|
+
* The default structure uses {@link ModalProps.header|header}, {@link ModalProps.children|children} and {@link ModalProps.footer|footer}.
|
|
126
153
|
*/
|
|
127
|
-
|
|
154
|
+
structure: SlotContent<ModalContext<Data>>;
|
|
128
155
|
slotStructureFromContent: ModalStructureDirective<Data> | undefined;
|
|
129
156
|
/**
|
|
130
|
-
* Header of the modal. The default header includes
|
|
157
|
+
* Header of the modal. The default header includes {@link ModalProps.title|title}.
|
|
131
158
|
*/
|
|
132
|
-
|
|
159
|
+
header: SlotContent<ModalContext<Data>>;
|
|
133
160
|
slotHeaderFromContent: ModalHeaderDirective<Data> | undefined;
|
|
134
161
|
/**
|
|
135
162
|
* Title of the modal.
|
|
136
163
|
*/
|
|
137
|
-
|
|
164
|
+
title: SlotContent<ModalContext<Data>>;
|
|
138
165
|
slotTitleFromContent: ModalTitleDirective<Data> | undefined;
|
|
139
166
|
/**
|
|
140
167
|
* Body of the modal.
|
|
@@ -144,7 +171,7 @@ export declare class ModalComponent<Data> extends BaseWidgetDirective<ModalWidge
|
|
|
144
171
|
/**
|
|
145
172
|
* Footer of the modal.
|
|
146
173
|
*/
|
|
147
|
-
|
|
174
|
+
footer: SlotContent<ModalContext<Data>>;
|
|
148
175
|
slotFooterFromContent: ModalFooterDirective<Data> | undefined;
|
|
149
176
|
/**
|
|
150
177
|
* Data to use in content slots
|
|
@@ -152,25 +179,50 @@ export declare class ModalComponent<Data> extends BaseWidgetDirective<ModalWidge
|
|
|
152
179
|
contentData: Data | undefined;
|
|
153
180
|
/**
|
|
154
181
|
* Event to be triggered when the visible property changes.
|
|
182
|
+
*
|
|
183
|
+
* @param visible - new value of the visible propery
|
|
184
|
+
*
|
|
185
|
+
* @defaultValue
|
|
186
|
+
* ```ts
|
|
187
|
+
* () => {}
|
|
188
|
+
* ```
|
|
155
189
|
*/
|
|
156
190
|
visibleChange: EventEmitter<boolean>;
|
|
157
191
|
/**
|
|
158
|
-
* Event to be triggered when the modal is about to be closed (i.e. the ModalApi.
|
|
192
|
+
* Event to be triggered when the modal is about to be closed (i.e. the {@link ModalApi.close|close} method was called).
|
|
193
|
+
*
|
|
194
|
+
* @param event - event giving access to the argument given to the {@link ModalApi.close|close} method and allowing
|
|
195
|
+
* to cancel the close process.
|
|
196
|
+
*
|
|
197
|
+
* @defaultValue
|
|
198
|
+
* ```ts
|
|
199
|
+
* () => {}
|
|
200
|
+
* ```
|
|
159
201
|
*/
|
|
160
202
|
beforeClose: EventEmitter<ModalBeforeCloseEvent>;
|
|
161
203
|
/**
|
|
162
204
|
* Event to be triggered when the transition is completed and the modal is not visible.
|
|
205
|
+
*
|
|
206
|
+
* @defaultValue
|
|
207
|
+
* ```ts
|
|
208
|
+
* () => {}
|
|
209
|
+
* ```
|
|
163
210
|
*/
|
|
164
211
|
hidden: EventEmitter<void>;
|
|
165
212
|
/**
|
|
166
213
|
* Event to be triggered when the transition is completed and the modal is visible.
|
|
214
|
+
*
|
|
215
|
+
* @defaultValue
|
|
216
|
+
* ```ts
|
|
217
|
+
* () => {}
|
|
218
|
+
* ```
|
|
167
219
|
*/
|
|
168
220
|
shown: EventEmitter<void>;
|
|
169
221
|
readonly defaultSlots: import("@amadeus-it-group/tansu").WritableSignal<Partial<ModalProps<any>>, Partial<ModalProps<any>>>;
|
|
170
222
|
readonly _widget: import("@agnos-ui/angular-headless").AngularWidget<ModalWidget<Data>>;
|
|
171
223
|
ngAfterContentChecked(): void;
|
|
172
224
|
static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent<any>, never>;
|
|
173
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent<any>, "[auModal]", never, { "animated": { "alias": "auAnimated"; "required": false; }; "backdropTransition": { "alias": "auBackdropTransition"; "required": false; }; "modalTransition": { "alias": "auModalTransition"; "required": false; }; "visible": { "alias": "auVisible"; "required": false; }; "backdrop": { "alias": "auBackdrop"; "required": false; }; "closeOnOutsideClick": { "alias": "auCloseOnOutsideClick"; "required": false; }; "container": { "alias": "auContainer"; "required": false; }; "ariaCloseButtonLabel": { "alias": "auAriaCloseButtonLabel"; "required": false; }; "backdropClass": { "alias": "auBackdropClass"; "required": false; }; "closeButton": { "alias": "auCloseButton"; "required": false; }; "className": { "alias": "auClassName"; "required": false; }; "fullscreen": { "alias": "auFullscreen"; "required": false; }; "
|
|
225
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent<any>, "[auModal]", never, { "animated": { "alias": "auAnimated"; "required": false; }; "backdropTransition": { "alias": "auBackdropTransition"; "required": false; }; "modalTransition": { "alias": "auModalTransition"; "required": false; }; "visible": { "alias": "auVisible"; "required": false; }; "backdrop": { "alias": "auBackdrop"; "required": false; }; "closeOnOutsideClick": { "alias": "auCloseOnOutsideClick"; "required": false; }; "container": { "alias": "auContainer"; "required": false; }; "ariaCloseButtonLabel": { "alias": "auAriaCloseButtonLabel"; "required": false; }; "backdropClass": { "alias": "auBackdropClass"; "required": false; }; "closeButton": { "alias": "auCloseButton"; "required": false; }; "className": { "alias": "auClassName"; "required": false; }; "fullscreen": { "alias": "auFullscreen"; "required": false; }; "structure": { "alias": "auStructure"; "required": false; }; "header": { "alias": "auHeader"; "required": false; }; "title": { "alias": "auTitle"; "required": false; }; "children": { "alias": "auChildren"; "required": false; }; "footer": { "alias": "auFooter"; "required": false; }; "contentData": { "alias": "auContentData"; "required": false; }; }, { "visibleChange": "auVisibleChange"; "beforeClose": "auBeforeClose"; "hidden": "auHidden"; "shown": "auShown"; }, ["slotStructureFromContent", "slotHeaderFromContent", "slotTitleFromContent", "slotDefaultFromContent", "slotFooterFromContent"], ["*"], true, never>;
|
|
174
226
|
static ngAcceptInputType_animated: unknown;
|
|
175
227
|
static ngAcceptInputType_visible: unknown;
|
|
176
228
|
static ngAcceptInputType_backdrop: unknown;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { modalOutsideClick, modalCloseButtonClick } from '@agnos-ui/core-bootstrap/components/modal';
|
|
2
|
+
import type { WidgetSlotContext, SlotContent, TransitionFn, Widget, PropsConfig, Directive } from '@agnos-ui/angular-headless';
|
|
3
|
+
/**
|
|
4
|
+
* Retrieve a shallow copy of the default modal config
|
|
5
|
+
* @returns the default modal config
|
|
6
|
+
*/
|
|
7
|
+
declare const export_getModalDefaultConfig: () => ModalProps<any>;
|
|
8
|
+
export { export_getModalDefaultConfig as getModalDefaultConfig };
|
|
2
9
|
export type ModalContext<Data> = WidgetSlotContext<ModalWidget<Data>>;
|
|
3
10
|
export interface ModalState<Data> {
|
|
4
11
|
/**
|
|
5
|
-
* Whether the backdrop is fully hidden. This can be true either because {@link ModalProps.
|
|
6
|
-
* because {@link
|
|
12
|
+
* Whether the backdrop is fully hidden. This can be true either because {@link ModalProps.backdrop|backdrop} is false or
|
|
13
|
+
* because {@link ModalProps.visible|visible} is false and there is no current transition.
|
|
7
14
|
*/
|
|
8
15
|
backdropHidden: boolean;
|
|
9
16
|
/**
|
|
@@ -20,28 +27,43 @@ export interface ModalState<Data> {
|
|
|
20
27
|
modalElement: HTMLElement | null;
|
|
21
28
|
/**
|
|
22
29
|
* Value of the aria-label attribute to put on the close button.
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue `'Close'`
|
|
23
32
|
*/
|
|
24
33
|
ariaCloseButtonLabel: string;
|
|
25
34
|
/**
|
|
26
35
|
* Classes to add on the backdrop DOM element.
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue `''`
|
|
27
38
|
*/
|
|
28
39
|
backdropClass: string;
|
|
29
40
|
/**
|
|
30
41
|
* Whether to display the close button.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue `true`
|
|
31
44
|
*/
|
|
32
45
|
closeButton: boolean;
|
|
33
46
|
/**
|
|
34
47
|
* Which element should contain the modal and backdrop DOM elements.
|
|
35
48
|
* If it is not null, the modal and backdrop DOM elements are moved to the specified container.
|
|
36
49
|
* Otherwise, they stay where the widget is located.
|
|
50
|
+
*
|
|
51
|
+
* @defaultValue
|
|
52
|
+
* ```ts
|
|
53
|
+
* typeof window !== 'undefined' ? document.body : null
|
|
54
|
+
* ```
|
|
37
55
|
*/
|
|
38
56
|
container: HTMLElement | null;
|
|
39
57
|
/**
|
|
40
58
|
* Whether the modal should be visible when the transition is completed.
|
|
59
|
+
*
|
|
60
|
+
* @defaultValue `false`
|
|
41
61
|
*/
|
|
42
62
|
visible: boolean;
|
|
43
63
|
/**
|
|
44
64
|
* CSS classes to be applied on the widget main container
|
|
65
|
+
*
|
|
66
|
+
* @defaultValue `''`
|
|
45
67
|
*/
|
|
46
68
|
className: string;
|
|
47
69
|
/**
|
|
@@ -55,86 +77,138 @@ export interface ModalState<Data> {
|
|
|
55
77
|
/**
|
|
56
78
|
* Footer of the modal.
|
|
57
79
|
*/
|
|
58
|
-
|
|
80
|
+
footer: SlotContent<ModalContext<Data>>;
|
|
59
81
|
/**
|
|
60
|
-
* Header of the modal. The default header includes {@link
|
|
82
|
+
* Header of the modal. The default header includes {@link ModalProps.title|title}.
|
|
61
83
|
*/
|
|
62
|
-
|
|
84
|
+
header: SlotContent<ModalContext<Data>>;
|
|
63
85
|
/**
|
|
64
86
|
* Structure of the modal.
|
|
65
|
-
* The default structure uses {@link
|
|
87
|
+
* The default structure uses {@link ModalProps.header|header}, {@link ModalProps.children|children} and {@link ModalProps.footer|footer}.
|
|
66
88
|
*/
|
|
67
|
-
|
|
89
|
+
structure: SlotContent<ModalContext<Data>>;
|
|
68
90
|
/**
|
|
69
91
|
* Title of the modal.
|
|
70
92
|
*/
|
|
71
|
-
|
|
93
|
+
title: SlotContent<ModalContext<Data>>;
|
|
72
94
|
/**
|
|
73
95
|
* Option to create a fullscreen modal, according to the bootstrap documentation.
|
|
96
|
+
*
|
|
97
|
+
* @defaultValue `false`
|
|
74
98
|
*/
|
|
75
99
|
fullscreen: boolean;
|
|
76
100
|
}
|
|
77
101
|
export interface ModalProps<Data> {
|
|
102
|
+
/**
|
|
103
|
+
* The transition to use for the backdrop behind the modal (if present).
|
|
104
|
+
*
|
|
105
|
+
* @defaultValue `fadeTransition`
|
|
106
|
+
*/
|
|
107
|
+
backdropTransition: TransitionFn;
|
|
108
|
+
/**
|
|
109
|
+
* The transition to use for the modal.
|
|
110
|
+
*
|
|
111
|
+
* @defaultValue `fadeTransition`
|
|
112
|
+
*/
|
|
113
|
+
modalTransition: TransitionFn;
|
|
78
114
|
/**
|
|
79
115
|
* Whether the modal and its backdrop (if present) should be animated when shown or hidden.
|
|
116
|
+
*
|
|
117
|
+
* @defaultValue `true`
|
|
80
118
|
*/
|
|
81
119
|
animated: boolean;
|
|
82
120
|
/**
|
|
83
121
|
* Whether a backdrop should be created behind the modal.
|
|
122
|
+
*
|
|
123
|
+
* @defaultValue `true`
|
|
84
124
|
*/
|
|
85
125
|
backdrop: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* The transition to use for the backdrop behind the modal (if present).
|
|
88
|
-
*/
|
|
89
|
-
backdropTransition: TransitionFn;
|
|
90
126
|
/**
|
|
91
127
|
* Whether the modal should be closed when clicking on the viewport outside the modal.
|
|
128
|
+
*
|
|
129
|
+
* @defaultValue `true`
|
|
92
130
|
*/
|
|
93
131
|
closeOnOutsideClick: boolean;
|
|
94
132
|
/**
|
|
95
|
-
*
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
133
|
+
* Event to be triggered when the modal is about to be closed (i.e. the {@link ModalApi.close|close} method was called).
|
|
134
|
+
*
|
|
135
|
+
* @param event - event giving access to the argument given to the {@link ModalApi.close|close} method and allowing
|
|
136
|
+
* to cancel the close process.
|
|
137
|
+
*
|
|
138
|
+
* @defaultValue
|
|
139
|
+
* ```ts
|
|
140
|
+
* () => {}
|
|
141
|
+
* ```
|
|
100
142
|
*/
|
|
101
143
|
onBeforeClose: (event: ModalBeforeCloseEvent) => void;
|
|
102
144
|
/**
|
|
103
145
|
* Event to be triggered when the visible property changes.
|
|
146
|
+
*
|
|
147
|
+
* @param visible - new value of the visible propery
|
|
148
|
+
*
|
|
149
|
+
* @defaultValue
|
|
150
|
+
* ```ts
|
|
151
|
+
* () => {}
|
|
152
|
+
* ```
|
|
104
153
|
*/
|
|
105
154
|
onVisibleChange: (visible: boolean) => void;
|
|
106
155
|
/**
|
|
107
156
|
* Event to be triggered when the transition is completed and the modal is not visible.
|
|
157
|
+
*
|
|
158
|
+
* @defaultValue
|
|
159
|
+
* ```ts
|
|
160
|
+
* () => {}
|
|
161
|
+
* ```
|
|
108
162
|
*/
|
|
109
163
|
onHidden: () => void;
|
|
110
164
|
/**
|
|
111
165
|
* Event to be triggered when the transition is completed and the modal is visible.
|
|
166
|
+
*
|
|
167
|
+
* @defaultValue
|
|
168
|
+
* ```ts
|
|
169
|
+
* () => {}
|
|
170
|
+
* ```
|
|
112
171
|
*/
|
|
113
172
|
onShown: () => void;
|
|
114
173
|
/**
|
|
115
174
|
* Value of the aria-label attribute to put on the close button.
|
|
175
|
+
*
|
|
176
|
+
* @defaultValue `'Close'`
|
|
116
177
|
*/
|
|
117
178
|
ariaCloseButtonLabel: string;
|
|
118
179
|
/**
|
|
119
180
|
* Classes to add on the backdrop DOM element.
|
|
181
|
+
*
|
|
182
|
+
* @defaultValue `''`
|
|
120
183
|
*/
|
|
121
184
|
backdropClass: string;
|
|
122
185
|
/**
|
|
123
186
|
* Whether to display the close button.
|
|
187
|
+
*
|
|
188
|
+
* @defaultValue `true`
|
|
124
189
|
*/
|
|
125
190
|
closeButton: boolean;
|
|
126
191
|
/**
|
|
127
192
|
* Which element should contain the modal and backdrop DOM elements.
|
|
128
193
|
* If it is not null, the modal and backdrop DOM elements are moved to the specified container.
|
|
129
194
|
* Otherwise, they stay where the widget is located.
|
|
195
|
+
*
|
|
196
|
+
* @defaultValue
|
|
197
|
+
* ```ts
|
|
198
|
+
* typeof window !== 'undefined' ? document.body : null
|
|
199
|
+
* ```
|
|
130
200
|
*/
|
|
131
201
|
container: HTMLElement | null;
|
|
132
202
|
/**
|
|
133
203
|
* Whether the modal should be visible when the transition is completed.
|
|
204
|
+
*
|
|
205
|
+
* @defaultValue `false`
|
|
134
206
|
*/
|
|
135
207
|
visible: boolean;
|
|
136
208
|
/**
|
|
137
209
|
* CSS classes to be applied on the widget main container
|
|
210
|
+
*
|
|
211
|
+
* @defaultValue `''`
|
|
138
212
|
*/
|
|
139
213
|
className: string;
|
|
140
214
|
/**
|
|
@@ -148,22 +222,24 @@ export interface ModalProps<Data> {
|
|
|
148
222
|
/**
|
|
149
223
|
* Footer of the modal.
|
|
150
224
|
*/
|
|
151
|
-
|
|
225
|
+
footer: SlotContent<ModalContext<Data>>;
|
|
152
226
|
/**
|
|
153
|
-
* Header of the modal. The default header includes {@link
|
|
227
|
+
* Header of the modal. The default header includes {@link ModalProps.title|title}.
|
|
154
228
|
*/
|
|
155
|
-
|
|
229
|
+
header: SlotContent<ModalContext<Data>>;
|
|
156
230
|
/**
|
|
157
231
|
* Structure of the modal.
|
|
158
|
-
* The default structure uses {@link
|
|
232
|
+
* The default structure uses {@link ModalProps.header|header}, {@link ModalProps.children|children} and {@link ModalProps.footer|footer}.
|
|
159
233
|
*/
|
|
160
|
-
|
|
234
|
+
structure: SlotContent<ModalContext<Data>>;
|
|
161
235
|
/**
|
|
162
236
|
* Title of the modal.
|
|
163
237
|
*/
|
|
164
|
-
|
|
238
|
+
title: SlotContent<ModalContext<Data>>;
|
|
165
239
|
/**
|
|
166
240
|
* Option to create a fullscreen modal, according to the bootstrap documentation.
|
|
241
|
+
*
|
|
242
|
+
* @defaultValue `false`
|
|
167
243
|
*/
|
|
168
244
|
fullscreen: boolean;
|
|
169
245
|
}
|
|
@@ -174,39 +250,63 @@ export interface ModalApi<Data> {
|
|
|
174
250
|
patch: ModalWidget<Data>['patch'];
|
|
175
251
|
/**
|
|
176
252
|
* Closes the modal with the given result.
|
|
253
|
+
*
|
|
254
|
+
* @param result - result of the modal, as passed in the {@link ModalBeforeCloseEvent.result|result} property of the event passed to the
|
|
255
|
+
* {@link ModalProps.onBeforeClose|onBeforeClose} event handler (and possibly changed by it) and resolved by the promise returned by the {@link ModalApi.open|open} method.
|
|
177
256
|
*/
|
|
178
257
|
close(result?: any): void;
|
|
179
258
|
/**
|
|
180
259
|
* Opens the modal and returns a promise that is resolved when the modal is closed.
|
|
181
|
-
* The resolved value is the result passed to the {@link ModalApi.
|
|
182
|
-
* {@link ModalProps.
|
|
260
|
+
* The resolved value is the result passed to the {@link ModalApi.close|close} method and possibly changed by the
|
|
261
|
+
* {@link ModalProps.onBeforeClose|onBeforeClose} event handler
|
|
183
262
|
*/
|
|
184
263
|
open(): Promise<any>;
|
|
185
264
|
}
|
|
186
265
|
export type ModalWidget<Data> = Widget<ModalProps<Data>, ModalState<Data>, ModalApi<Data>, ModalActions, ModalDirectives>;
|
|
266
|
+
/**
|
|
267
|
+
* Creates a new modal widget instance.
|
|
268
|
+
* @param config - config of the modal, either as a store or as an object containing values or stores.
|
|
269
|
+
* @returns a new modal widget instance
|
|
270
|
+
*/
|
|
271
|
+
declare const export_createModal: <Data>(config?: PropsConfig<ModalProps<Data>>) => ModalWidget<Data>;
|
|
272
|
+
export { export_createModal as createModal };
|
|
273
|
+
/**
|
|
274
|
+
* Value present in the {@link ModalBeforeCloseEvent.result|result} property of the {@link ModalProps.onBeforeClose|onBeforeClose} event
|
|
275
|
+
* and returned by the {@link ModalApi.open|open} method, when the modal is closed by a click inside the viewport but outside the modal.
|
|
276
|
+
*/
|
|
277
|
+
declare const export_modalOutsideClick: typeof modalOutsideClick;
|
|
278
|
+
export { export_modalOutsideClick as modalOutsideClick };
|
|
279
|
+
/**
|
|
280
|
+
* Value present in the {@link ModalBeforeCloseEvent.result|result} property of the {@link ModalProps.onBeforeClose|onBeforeClose} event
|
|
281
|
+
* and returned by the {@link ModalApi.open|open} method, when the modal is closed by a click on the close button.
|
|
282
|
+
*/
|
|
283
|
+
declare const export_modalCloseButtonClick: typeof modalCloseButtonClick;
|
|
284
|
+
export { export_modalCloseButtonClick as modalCloseButtonClick };
|
|
187
285
|
export interface ModalBeforeCloseEvent {
|
|
188
286
|
/**
|
|
189
|
-
* Result of the modal, which is the value passed to the {@link ModalApi.
|
|
190
|
-
* and later resolved by the promise returned by the {@link ModalApi.
|
|
191
|
-
* If needed, it can be changed from the {@link ModalProps.
|
|
287
|
+
* Result of the modal, which is the value passed to the {@link ModalApi.close|close} method
|
|
288
|
+
* and later resolved by the promise returned by the {@link ModalApi.open|open} method.
|
|
289
|
+
* If needed, it can be changed from the {@link ModalProps.onBeforeClose|onBeforeClose} event handler.
|
|
192
290
|
*/
|
|
193
291
|
result: any;
|
|
194
292
|
/**
|
|
195
293
|
* Whether to cancel the close of the modal.
|
|
196
|
-
* It can be changed from the {@link ModalProps.
|
|
294
|
+
* It can be changed from the {@link ModalProps.onBeforeClose|onBeforeClose} event handler.
|
|
197
295
|
*/
|
|
198
296
|
cancel: boolean;
|
|
199
297
|
}
|
|
200
298
|
export interface ModalActions {
|
|
201
299
|
/**
|
|
202
300
|
* Action to be called when the user clicks on the close button. It closes the modal with the {@link modalCloseButtonClick} result.
|
|
301
|
+
* @param event - mouse event
|
|
203
302
|
*/
|
|
204
303
|
closeButtonClick(event: Pick<MouseEvent, never>): void;
|
|
205
304
|
/**
|
|
206
305
|
* Action to be called when the user clicks on the modal DOM element (which is supposed to have the size of the full viewport).
|
|
207
306
|
* If the click is not done on a descendant of the modal DOM element, it is considered to be done outside the modal
|
|
208
|
-
* and, depending on the value of the {@link ModalProps.
|
|
307
|
+
* and, depending on the value of the {@link ModalProps.closeOnOutsideClick|closeOnOutsideClick} prop, the modal is or isn't closed
|
|
209
308
|
* (with the {@link modalOutsideClick} result).
|
|
309
|
+
* @param event - mouse event
|
|
210
310
|
*/
|
|
211
311
|
modalClick(event: Pick<MouseEvent, 'target' | 'currentTarget'>): void;
|
|
212
312
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './pagination.component';
|
|
2
|
-
export * from './pagination';
|
|
2
|
+
export * from './pagination.gen';
|