@agnos-ui/angular-bootstrap 0.8.1 → 0.9.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/fesm2022/agnos-ui-angular-bootstrap.mjs +164 -110
- package/fesm2022/agnos-ui-angular-bootstrap.mjs.map +1 -1
- package/index.d.ts +6450 -40
- package/package.json +5 -5
- package/agnos-ui-angular.module.d.ts +0 -20
- package/components/accordion/accordion.component.d.ts +0 -257
- package/components/accordion/accordion.gen.d.ts +0 -442
- package/components/accordion/index.d.ts +0 -2
- package/components/alert/alert.component.d.ts +0 -140
- package/components/alert/alert.gen.d.ts +0 -191
- package/components/alert/index.d.ts +0 -2
- package/components/carousel/carousel.component.d.ts +0 -207
- package/components/carousel/carousel.gen.d.ts +0 -358
- package/components/carousel/index.d.ts +0 -2
- package/components/collapse/collapse.component.d.ts +0 -83
- package/components/collapse/collapse.gen.d.ts +0 -150
- package/components/collapse/index.d.ts +0 -2
- package/components/modal/index.d.ts +0 -3
- package/components/modal/modal.component.d.ts +0 -220
- package/components/modal/modal.gen.d.ts +0 -355
- package/components/modal/modal.service.d.ts +0 -21
- package/components/pagination/index.d.ts +0 -2
- package/components/pagination/pagination.component.d.ts +0 -379
- package/components/pagination/pagination.gen.d.ts +0 -584
- package/components/progressbar/index.d.ts +0 -2
- package/components/progressbar/progressbar.component.d.ts +0 -118
- package/components/progressbar/progressbar.gen.d.ts +0 -196
- package/components/rating/index.d.ts +0 -2
- package/components/rating/rating.component.d.ts +0 -144
- package/components/rating/rating.gen.d.ts +0 -270
- package/components/select/index.d.ts +0 -2
- package/components/select/select.component.d.ts +0 -198
- package/components/select/select.gen.d.ts +0 -433
- package/components/slider/index.d.ts +0 -2
- package/components/slider/slider.component.d.ts +0 -234
- package/components/slider/slider.gen.d.ts +0 -511
- package/components/toast/index.d.ts +0 -4
- package/components/toast/toast.component.d.ts +0 -155
- package/components/toast/toast.gen.d.ts +0 -308
- package/components/toast/toaster.component.d.ts +0 -17
- package/components/toast/toaster.service.d.ts +0 -7
- package/components/tree/index.d.ts +0 -2
- package/components/tree/tree.component.d.ts +0 -145
- package/components/tree/tree.gen.d.ts +0 -216
- package/config.d.ts +0 -27
- package/config.gen.d.ts +0 -62
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import type { SlotContent, TransitionFn } from '@agnos-ui/angular-headless';
|
|
2
|
-
import { BaseWidgetDirective } from '@agnos-ui/angular-headless';
|
|
3
|
-
import type { ModalContext, ModalWidget, ModalBeforeCloseEvent } from './modal.gen';
|
|
4
|
-
import { TemplateRef } from '@angular/core';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* Directive to provide the slot structure for the modal widget.
|
|
8
|
-
* This directive provides a template reference for the {@link ModalContext<Data>}.
|
|
9
|
-
*/
|
|
10
|
-
export declare class ModalStructureDirective<Data> {
|
|
11
|
-
templateRef: TemplateRef<any>;
|
|
12
|
-
static ngTemplateContextGuard<Data>(_dir: ModalStructureDirective<Data>, context: unknown): context is ModalContext<Data>;
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ModalStructureDirective<any>, never>;
|
|
14
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ModalStructureDirective<any>, "ng-template[auModalStructure]", never, {}, {}, never, never, true, never>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Directive to provide the slot header for the modal widget.
|
|
18
|
-
* This directive provides a template reference for the {@link ModalContext<Data>}.
|
|
19
|
-
*/
|
|
20
|
-
export declare class ModalHeaderDirective<Data> {
|
|
21
|
-
templateRef: TemplateRef<any>;
|
|
22
|
-
static ngTemplateContextGuard<Data>(_dir: ModalHeaderDirective<Data>, context: unknown): context is ModalContext<Data>;
|
|
23
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ModalHeaderDirective<any>, never>;
|
|
24
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ModalHeaderDirective<any>, "ng-template[auModalHeader]", never, {}, {}, never, never, true, never>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Directive to provide the slot title for the modal widget.
|
|
28
|
-
* This directive provides a template reference for the {@link ModalContext<Data>}.
|
|
29
|
-
*/
|
|
30
|
-
export declare class ModalTitleDirective<Data> {
|
|
31
|
-
templateRef: TemplateRef<any>;
|
|
32
|
-
static ngTemplateContextGuard<Data>(_dir: ModalTitleDirective<Data>, context: unknown): context is ModalContext<Data>;
|
|
33
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ModalTitleDirective<any>, never>;
|
|
34
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ModalTitleDirective<any>, "ng-template[auModalTitle]", never, {}, {}, never, never, true, never>;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Directive to provide the default slot for the modal widget.
|
|
38
|
-
* This directive provides a template reference for the {@link ModalContext<Data>}.
|
|
39
|
-
*/
|
|
40
|
-
export declare class ModalBodyDirective<Data> {
|
|
41
|
-
templateRef: TemplateRef<any>;
|
|
42
|
-
static ngTemplateContextGuard<Data>(_dir: ModalBodyDirective<Data>, context: unknown): context is ModalContext<Data>;
|
|
43
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ModalBodyDirective<any>, never>;
|
|
44
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ModalBodyDirective<any>, "ng-template[auModalBody]", never, {}, {}, never, never, true, never>;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Directive to provide the slot footer for the modal widget.
|
|
48
|
-
* This directive provides a template reference for the {@link ModalContext<Data>}.
|
|
49
|
-
*/
|
|
50
|
-
export declare class ModalFooterDirective<Data> {
|
|
51
|
-
templateRef: TemplateRef<any>;
|
|
52
|
-
static ngTemplateContextGuard<Data>(_dir: ModalFooterDirective<Data>, context: unknown): context is ModalContext<Data>;
|
|
53
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ModalFooterDirective<any>, never>;
|
|
54
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ModalFooterDirective<any>, "ng-template[auModalFooter]", never, {}, {}, never, never, true, never>;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Default slot for modal header.
|
|
58
|
-
*/
|
|
59
|
-
export declare const modalDefaultSlotHeader: SlotContent<ModalContext<any>>;
|
|
60
|
-
/**
|
|
61
|
-
* Default slot for modal structure.
|
|
62
|
-
*/
|
|
63
|
-
export declare const modalDefaultSlotStructure: SlotContent<ModalContext<any>>;
|
|
64
|
-
/**
|
|
65
|
-
* Modal component.
|
|
66
|
-
*/
|
|
67
|
-
export declare class ModalComponent<Data> extends BaseWidgetDirective<ModalWidget<Data>> {
|
|
68
|
-
/**
|
|
69
|
-
* Whether the modal and its backdrop (if present) should be animated when shown or hidden.
|
|
70
|
-
*
|
|
71
|
-
* @defaultValue `true`
|
|
72
|
-
*/
|
|
73
|
-
readonly animated: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
74
|
-
/**
|
|
75
|
-
* The transition to use for the backdrop behind the modal (if present).
|
|
76
|
-
*
|
|
77
|
-
* @defaultValue `fadeTransition`
|
|
78
|
-
*/
|
|
79
|
-
readonly backdropTransition: import("@angular/core").InputSignal<TransitionFn | undefined>;
|
|
80
|
-
/**
|
|
81
|
-
* The transition to use for the modal.
|
|
82
|
-
*
|
|
83
|
-
* @defaultValue `fadeTransition`
|
|
84
|
-
*/
|
|
85
|
-
readonly modalTransition: import("@angular/core").InputSignal<TransitionFn | undefined>;
|
|
86
|
-
/**
|
|
87
|
-
* Whether the modal should be visible when the transition is completed.
|
|
88
|
-
*
|
|
89
|
-
* @defaultValue `false`
|
|
90
|
-
*/
|
|
91
|
-
readonly visible: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
92
|
-
/**
|
|
93
|
-
* Whether a backdrop should be created behind the modal.
|
|
94
|
-
*
|
|
95
|
-
* @defaultValue `true`
|
|
96
|
-
*/
|
|
97
|
-
readonly backdrop: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
98
|
-
/**
|
|
99
|
-
* Whether the modal should be closed when clicking on the viewport outside the modal.
|
|
100
|
-
*
|
|
101
|
-
* @defaultValue `true`
|
|
102
|
-
*/
|
|
103
|
-
readonly closeOnOutsideClick: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
104
|
-
/**
|
|
105
|
-
* Which element should contain the modal and backdrop DOM elements.
|
|
106
|
-
* If it is not null, the modal and backdrop DOM elements are moved to the specified container.
|
|
107
|
-
* Otherwise, they stay where the widget is located.
|
|
108
|
-
*
|
|
109
|
-
* @defaultValue
|
|
110
|
-
* ```ts
|
|
111
|
-
* typeof window !== 'undefined' ? document.body : null
|
|
112
|
-
* ```
|
|
113
|
-
*/
|
|
114
|
-
readonly container: import("@angular/core").InputSignal<HTMLElement | null | undefined>;
|
|
115
|
-
/**
|
|
116
|
-
* Value of the aria-label attribute to put on the close button.
|
|
117
|
-
*
|
|
118
|
-
* @defaultValue `'Close'`
|
|
119
|
-
*/
|
|
120
|
-
readonly ariaCloseButtonLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
121
|
-
/**
|
|
122
|
-
* Classes to add on the backdrop DOM element.
|
|
123
|
-
*
|
|
124
|
-
* @defaultValue `''`
|
|
125
|
-
*/
|
|
126
|
-
readonly backdropClass: import("@angular/core").InputSignal<string | undefined>;
|
|
127
|
-
/**
|
|
128
|
-
* Whether to display the close button.
|
|
129
|
-
*
|
|
130
|
-
* @defaultValue `true`
|
|
131
|
-
*/
|
|
132
|
-
readonly closeButton: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
133
|
-
/**
|
|
134
|
-
* CSS classes to be applied on the widget main container
|
|
135
|
-
*
|
|
136
|
-
* @defaultValue `''`
|
|
137
|
-
*/
|
|
138
|
-
readonly className: import("@angular/core").InputSignal<string | undefined>;
|
|
139
|
-
/**
|
|
140
|
-
* Option to create a fullscreen modal, according to the bootstrap documentation.
|
|
141
|
-
*
|
|
142
|
-
* @defaultValue `false`
|
|
143
|
-
*/
|
|
144
|
-
readonly fullscreen: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
145
|
-
/**
|
|
146
|
-
* Structure of the modal.
|
|
147
|
-
* The default structure uses {@link ModalProps.header|header}, {@link ModalProps.children|children} and {@link ModalProps.footer|footer}.
|
|
148
|
-
*/
|
|
149
|
-
readonly structure: import("@angular/core").InputSignal<SlotContent<ModalContext<Data>>>;
|
|
150
|
-
readonly slotStructureFromContent: import("@angular/core").Signal<ModalStructureDirective<any> | undefined>;
|
|
151
|
-
/**
|
|
152
|
-
* Header of the modal. The default header includes {@link ModalProps.title|title}.
|
|
153
|
-
*/
|
|
154
|
-
readonly header: import("@angular/core").InputSignal<SlotContent<ModalContext<Data>>>;
|
|
155
|
-
readonly slotHeaderFromContent: import("@angular/core").Signal<ModalHeaderDirective<any> | undefined>;
|
|
156
|
-
/**
|
|
157
|
-
* Title of the modal.
|
|
158
|
-
*/
|
|
159
|
-
readonly title: import("@angular/core").InputSignal<SlotContent<ModalContext<Data>>>;
|
|
160
|
-
readonly slotTitleFromContent: import("@angular/core").Signal<ModalTitleDirective<any> | undefined>;
|
|
161
|
-
/**
|
|
162
|
-
* Body of the modal.
|
|
163
|
-
*/
|
|
164
|
-
readonly children: import("@angular/core").InputSignal<SlotContent<ModalContext<Data>>>;
|
|
165
|
-
readonly slotDefaultFromContent: import("@angular/core").Signal<ModalBodyDirective<any> | undefined>;
|
|
166
|
-
/**
|
|
167
|
-
* Footer of the modal.
|
|
168
|
-
*/
|
|
169
|
-
readonly footer: import("@angular/core").InputSignal<SlotContent<ModalContext<Data>>>;
|
|
170
|
-
readonly slotFooterFromContent: import("@angular/core").Signal<ModalFooterDirective<any> | undefined>;
|
|
171
|
-
/**
|
|
172
|
-
* Data to use in content slots
|
|
173
|
-
*/
|
|
174
|
-
readonly contentData: import("@angular/core").InputSignal<Data | undefined>;
|
|
175
|
-
/**
|
|
176
|
-
* Event to be triggered when the visible property changes.
|
|
177
|
-
*
|
|
178
|
-
* @param visible - new value of the visible propery
|
|
179
|
-
*
|
|
180
|
-
* @defaultValue
|
|
181
|
-
* ```ts
|
|
182
|
-
* () => {}
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
readonly visibleChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
186
|
-
/**
|
|
187
|
-
* Event to be triggered when the modal is about to be closed (i.e. the {@link ModalApi.close|close} method was called).
|
|
188
|
-
*
|
|
189
|
-
* @param event - event giving access to the argument given to the {@link ModalApi.close|close} method and allowing
|
|
190
|
-
* to cancel the close process.
|
|
191
|
-
*
|
|
192
|
-
* @defaultValue
|
|
193
|
-
* ```ts
|
|
194
|
-
* () => {}
|
|
195
|
-
* ```
|
|
196
|
-
*/
|
|
197
|
-
readonly beforeClose: import("@angular/core").OutputEmitterRef<ModalBeforeCloseEvent>;
|
|
198
|
-
/**
|
|
199
|
-
* Event to be triggered when the transition is completed and the modal is not visible.
|
|
200
|
-
*
|
|
201
|
-
* @defaultValue
|
|
202
|
-
* ```ts
|
|
203
|
-
* () => {}
|
|
204
|
-
* ```
|
|
205
|
-
*/
|
|
206
|
-
readonly hidden: import("@angular/core").OutputEmitterRef<void>;
|
|
207
|
-
/**
|
|
208
|
-
* Event to be triggered when the transition is completed and the modal is visible.
|
|
209
|
-
*
|
|
210
|
-
* @defaultValue
|
|
211
|
-
* ```ts
|
|
212
|
-
* () => {}
|
|
213
|
-
* ```
|
|
214
|
-
*/
|
|
215
|
-
readonly shown: import("@angular/core").OutputEmitterRef<void>;
|
|
216
|
-
readonly slotChildren: import("@angular/core").Signal<TemplateRef<void> | undefined>;
|
|
217
|
-
constructor();
|
|
218
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent<any>, never>;
|
|
219
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent<any>, "[auModal]", never, { "animated": { "alias": "auAnimated"; "required": false; "isSignal": true; }; "backdropTransition": { "alias": "auBackdropTransition"; "required": false; "isSignal": true; }; "modalTransition": { "alias": "auModalTransition"; "required": false; "isSignal": true; }; "visible": { "alias": "auVisible"; "required": false; "isSignal": true; }; "backdrop": { "alias": "auBackdrop"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "auCloseOnOutsideClick"; "required": false; "isSignal": true; }; "container": { "alias": "auContainer"; "required": false; "isSignal": true; }; "ariaCloseButtonLabel": { "alias": "auAriaCloseButtonLabel"; "required": false; "isSignal": true; }; "backdropClass": { "alias": "auBackdropClass"; "required": false; "isSignal": true; }; "closeButton": { "alias": "auCloseButton"; "required": false; "isSignal": true; }; "className": { "alias": "auClassName"; "required": false; "isSignal": true; }; "fullscreen": { "alias": "auFullscreen"; "required": false; "isSignal": true; }; "structure": { "alias": "auStructure"; "required": false; "isSignal": true; }; "header": { "alias": "auHeader"; "required": false; "isSignal": true; }; "title": { "alias": "auTitle"; "required": false; "isSignal": true; }; "children": { "alias": "auChildren"; "required": false; "isSignal": true; }; "footer": { "alias": "auFooter"; "required": false; "isSignal": true; }; "contentData": { "alias": "auContentData"; "required": false; "isSignal": true; }; }, { "visibleChange": "auVisibleChange"; "beforeClose": "auBeforeClose"; "hidden": "auHidden"; "shown": "auShown"; }, ["slotStructureFromContent", "slotHeaderFromContent", "slotTitleFromContent", "slotDefaultFromContent", "slotFooterFromContent"], ["*"], true, never>;
|
|
220
|
-
}
|
|
@@ -1,355 +0,0 @@
|
|
|
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 };
|
|
9
|
-
/**
|
|
10
|
-
* Represents the context for a modal component.
|
|
11
|
-
*
|
|
12
|
-
* @template Data - The type of data associated with the modal.
|
|
13
|
-
*/
|
|
14
|
-
export interface ModalContext<Data> extends WidgetSlotContext<ModalWidget<Data>> {
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Represents the state of a modal component.
|
|
18
|
-
*
|
|
19
|
-
* @template Data - The type of the data associated with the modal.
|
|
20
|
-
*/
|
|
21
|
-
export interface ModalState<Data> {
|
|
22
|
-
/**
|
|
23
|
-
* Whether the backdrop is fully hidden. This can be true either because {@link ModalProps.backdrop|backdrop} is false or
|
|
24
|
-
* because {@link ModalProps.visible|visible} is false and there is no current transition.
|
|
25
|
-
*/
|
|
26
|
-
backdropHidden: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Whether the modal is fully hidden.
|
|
29
|
-
*/
|
|
30
|
-
hidden: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Whether there is an active transition to either display or hide the modal.
|
|
33
|
-
*/
|
|
34
|
-
transitioning: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* DOM element of the modal.
|
|
37
|
-
*/
|
|
38
|
-
modalElement: HTMLElement | null;
|
|
39
|
-
/**
|
|
40
|
-
* Value of the aria-label attribute to put on the close button.
|
|
41
|
-
*
|
|
42
|
-
* @defaultValue `'Close'`
|
|
43
|
-
*/
|
|
44
|
-
ariaCloseButtonLabel: string;
|
|
45
|
-
/**
|
|
46
|
-
* Classes to add on the backdrop DOM element.
|
|
47
|
-
*
|
|
48
|
-
* @defaultValue `''`
|
|
49
|
-
*/
|
|
50
|
-
backdropClass: string;
|
|
51
|
-
/**
|
|
52
|
-
* Whether to display the close button.
|
|
53
|
-
*
|
|
54
|
-
* @defaultValue `true`
|
|
55
|
-
*/
|
|
56
|
-
closeButton: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Which element should contain the modal and backdrop DOM elements.
|
|
59
|
-
* If it is not null, the modal and backdrop DOM elements are moved to the specified container.
|
|
60
|
-
* Otherwise, they stay where the widget is located.
|
|
61
|
-
*
|
|
62
|
-
* @defaultValue
|
|
63
|
-
* ```ts
|
|
64
|
-
* typeof window !== 'undefined' ? document.body : null
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
container: HTMLElement | null;
|
|
68
|
-
/**
|
|
69
|
-
* Whether the modal should be visible when the transition is completed.
|
|
70
|
-
*
|
|
71
|
-
* @defaultValue `false`
|
|
72
|
-
*/
|
|
73
|
-
visible: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* CSS classes to be applied on the widget main container
|
|
76
|
-
*
|
|
77
|
-
* @defaultValue `''`
|
|
78
|
-
*/
|
|
79
|
-
className: string;
|
|
80
|
-
/**
|
|
81
|
-
* Data to use in content slots
|
|
82
|
-
*/
|
|
83
|
-
contentData: Data;
|
|
84
|
-
/**
|
|
85
|
-
* Body of the modal.
|
|
86
|
-
*/
|
|
87
|
-
children: SlotContent<ModalContext<Data>>;
|
|
88
|
-
/**
|
|
89
|
-
* Footer of the modal.
|
|
90
|
-
*/
|
|
91
|
-
footer: SlotContent<ModalContext<Data>>;
|
|
92
|
-
/**
|
|
93
|
-
* Header of the modal. The default header includes {@link ModalProps.title|title}.
|
|
94
|
-
*/
|
|
95
|
-
header: SlotContent<ModalContext<Data>>;
|
|
96
|
-
/**
|
|
97
|
-
* Structure of the modal.
|
|
98
|
-
* The default structure uses {@link ModalProps.header|header}, {@link ModalProps.children|children} and {@link ModalProps.footer|footer}.
|
|
99
|
-
*/
|
|
100
|
-
structure: SlotContent<ModalContext<Data>>;
|
|
101
|
-
/**
|
|
102
|
-
* Title of the modal.
|
|
103
|
-
*/
|
|
104
|
-
title: SlotContent<ModalContext<Data>>;
|
|
105
|
-
/**
|
|
106
|
-
* Option to create a fullscreen modal, according to the bootstrap documentation.
|
|
107
|
-
*
|
|
108
|
-
* @defaultValue `false`
|
|
109
|
-
*/
|
|
110
|
-
fullscreen: boolean;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Interface representing the properties for a modal component.
|
|
114
|
-
*
|
|
115
|
-
* @template Data - The type of data that the modal will handle.
|
|
116
|
-
*/
|
|
117
|
-
export interface ModalProps<Data> {
|
|
118
|
-
/**
|
|
119
|
-
* The transition to use for the backdrop behind the modal (if present).
|
|
120
|
-
*
|
|
121
|
-
* @defaultValue `fadeTransition`
|
|
122
|
-
*/
|
|
123
|
-
backdropTransition: TransitionFn;
|
|
124
|
-
/**
|
|
125
|
-
* The transition to use for the modal.
|
|
126
|
-
*
|
|
127
|
-
* @defaultValue `fadeTransition`
|
|
128
|
-
*/
|
|
129
|
-
modalTransition: TransitionFn;
|
|
130
|
-
/**
|
|
131
|
-
* Whether the modal and its backdrop (if present) should be animated when shown or hidden.
|
|
132
|
-
*
|
|
133
|
-
* @defaultValue `true`
|
|
134
|
-
*/
|
|
135
|
-
animated: boolean;
|
|
136
|
-
/**
|
|
137
|
-
* Whether a backdrop should be created behind the modal.
|
|
138
|
-
*
|
|
139
|
-
* @defaultValue `true`
|
|
140
|
-
*/
|
|
141
|
-
backdrop: boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Whether the modal should be closed when clicking on the viewport outside the modal.
|
|
144
|
-
*
|
|
145
|
-
* @defaultValue `true`
|
|
146
|
-
*/
|
|
147
|
-
closeOnOutsideClick: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Event to be triggered when the modal is about to be closed (i.e. the {@link ModalApi.close|close} method was called).
|
|
150
|
-
*
|
|
151
|
-
* @param event - event giving access to the argument given to the {@link ModalApi.close|close} method and allowing
|
|
152
|
-
* to cancel the close process.
|
|
153
|
-
*
|
|
154
|
-
* @defaultValue
|
|
155
|
-
* ```ts
|
|
156
|
-
* () => {}
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
onBeforeClose: (event: ModalBeforeCloseEvent) => void;
|
|
160
|
-
/**
|
|
161
|
-
* Event to be triggered when the visible property changes.
|
|
162
|
-
*
|
|
163
|
-
* @param visible - new value of the visible propery
|
|
164
|
-
*
|
|
165
|
-
* @defaultValue
|
|
166
|
-
* ```ts
|
|
167
|
-
* () => {}
|
|
168
|
-
* ```
|
|
169
|
-
*/
|
|
170
|
-
onVisibleChange: (visible: boolean) => void;
|
|
171
|
-
/**
|
|
172
|
-
* Event to be triggered when the transition is completed and the modal is not visible.
|
|
173
|
-
*
|
|
174
|
-
* @defaultValue
|
|
175
|
-
* ```ts
|
|
176
|
-
* () => {}
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
onHidden: () => void;
|
|
180
|
-
/**
|
|
181
|
-
* Event to be triggered when the transition is completed and the modal is visible.
|
|
182
|
-
*
|
|
183
|
-
* @defaultValue
|
|
184
|
-
* ```ts
|
|
185
|
-
* () => {}
|
|
186
|
-
* ```
|
|
187
|
-
*/
|
|
188
|
-
onShown: () => void;
|
|
189
|
-
/**
|
|
190
|
-
* Value of the aria-label attribute to put on the close button.
|
|
191
|
-
*
|
|
192
|
-
* @defaultValue `'Close'`
|
|
193
|
-
*/
|
|
194
|
-
ariaCloseButtonLabel: string;
|
|
195
|
-
/**
|
|
196
|
-
* Classes to add on the backdrop DOM element.
|
|
197
|
-
*
|
|
198
|
-
* @defaultValue `''`
|
|
199
|
-
*/
|
|
200
|
-
backdropClass: string;
|
|
201
|
-
/**
|
|
202
|
-
* Whether to display the close button.
|
|
203
|
-
*
|
|
204
|
-
* @defaultValue `true`
|
|
205
|
-
*/
|
|
206
|
-
closeButton: boolean;
|
|
207
|
-
/**
|
|
208
|
-
* Which element should contain the modal and backdrop DOM elements.
|
|
209
|
-
* If it is not null, the modal and backdrop DOM elements are moved to the specified container.
|
|
210
|
-
* Otherwise, they stay where the widget is located.
|
|
211
|
-
*
|
|
212
|
-
* @defaultValue
|
|
213
|
-
* ```ts
|
|
214
|
-
* typeof window !== 'undefined' ? document.body : null
|
|
215
|
-
* ```
|
|
216
|
-
*/
|
|
217
|
-
container: HTMLElement | null;
|
|
218
|
-
/**
|
|
219
|
-
* Whether the modal should be visible when the transition is completed.
|
|
220
|
-
*
|
|
221
|
-
* @defaultValue `false`
|
|
222
|
-
*/
|
|
223
|
-
visible: boolean;
|
|
224
|
-
/**
|
|
225
|
-
* CSS classes to be applied on the widget main container
|
|
226
|
-
*
|
|
227
|
-
* @defaultValue `''`
|
|
228
|
-
*/
|
|
229
|
-
className: string;
|
|
230
|
-
/**
|
|
231
|
-
* Data to use in content slots
|
|
232
|
-
*/
|
|
233
|
-
contentData: Data;
|
|
234
|
-
/**
|
|
235
|
-
* Body of the modal.
|
|
236
|
-
*/
|
|
237
|
-
children: SlotContent<ModalContext<Data>>;
|
|
238
|
-
/**
|
|
239
|
-
* Footer of the modal.
|
|
240
|
-
*/
|
|
241
|
-
footer: SlotContent<ModalContext<Data>>;
|
|
242
|
-
/**
|
|
243
|
-
* Header of the modal. The default header includes {@link ModalProps.title|title}.
|
|
244
|
-
*/
|
|
245
|
-
header: SlotContent<ModalContext<Data>>;
|
|
246
|
-
/**
|
|
247
|
-
* Structure of the modal.
|
|
248
|
-
* The default structure uses {@link ModalProps.header|header}, {@link ModalProps.children|children} and {@link ModalProps.footer|footer}.
|
|
249
|
-
*/
|
|
250
|
-
structure: SlotContent<ModalContext<Data>>;
|
|
251
|
-
/**
|
|
252
|
-
* Title of the modal.
|
|
253
|
-
*/
|
|
254
|
-
title: SlotContent<ModalContext<Data>>;
|
|
255
|
-
/**
|
|
256
|
-
* Option to create a fullscreen modal, according to the bootstrap documentation.
|
|
257
|
-
*
|
|
258
|
-
* @defaultValue `false`
|
|
259
|
-
*/
|
|
260
|
-
fullscreen: boolean;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Interface representing the API for a modal component.
|
|
264
|
-
*
|
|
265
|
-
* @template Data - The type of data associated with the modal.
|
|
266
|
-
*/
|
|
267
|
-
export interface ModalApi<Data> {
|
|
268
|
-
/**
|
|
269
|
-
* Method to change some modal properties.
|
|
270
|
-
*/
|
|
271
|
-
patch: ModalWidget<Data>['patch'];
|
|
272
|
-
/**
|
|
273
|
-
* Closes the modal with the given result.
|
|
274
|
-
*
|
|
275
|
-
* @param result - result of the modal, as passed in the {@link ModalBeforeCloseEvent.result|result} property of the event passed to the
|
|
276
|
-
* {@link ModalProps.onBeforeClose|onBeforeClose} event handler (and possibly changed by it) and resolved by the promise returned by the {@link ModalApi.open|open} method.
|
|
277
|
-
*/
|
|
278
|
-
close(result?: any): void;
|
|
279
|
-
/**
|
|
280
|
-
* Opens the modal and returns a promise that is resolved when the modal is closed.
|
|
281
|
-
* The resolved value is the result passed to the {@link ModalApi.close|close} method and possibly changed by the
|
|
282
|
-
* {@link ModalProps.onBeforeClose|onBeforeClose} event handler
|
|
283
|
-
*/
|
|
284
|
-
open(): Promise<any>;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Represents a modal widget with specific data type.
|
|
288
|
-
*
|
|
289
|
-
* @template Data - The type of data that the modal widget will handle.
|
|
290
|
-
*/
|
|
291
|
-
export type ModalWidget<Data> = Widget<ModalProps<Data>, ModalState<Data>, ModalApi<Data>, ModalDirectives>;
|
|
292
|
-
/**
|
|
293
|
-
* Creates a new modal widget instance.
|
|
294
|
-
* @param config - config of the modal, either as a store or as an object containing values or stores.
|
|
295
|
-
* @returns a new modal widget instance
|
|
296
|
-
*/
|
|
297
|
-
declare const export_createModal: <Data>(config?: PropsConfig<ModalProps<Data>>) => ModalWidget<Data>;
|
|
298
|
-
export { export_createModal as createModal };
|
|
299
|
-
/**
|
|
300
|
-
* Value present in the {@link ModalBeforeCloseEvent.result|result} property of the {@link ModalProps.onBeforeClose|onBeforeClose} event
|
|
301
|
-
* and returned by the {@link ModalApi.open|open} method, when the modal is closed by a click inside the viewport but outside the modal.
|
|
302
|
-
*/
|
|
303
|
-
declare const export_modalOutsideClick: typeof modalOutsideClick;
|
|
304
|
-
export { export_modalOutsideClick as modalOutsideClick };
|
|
305
|
-
/**
|
|
306
|
-
* Value present in the {@link ModalBeforeCloseEvent.result|result} property of the {@link ModalProps.onBeforeClose|onBeforeClose} event
|
|
307
|
-
* and returned by the {@link ModalApi.open|open} method, when the modal is closed by a click on the close button.
|
|
308
|
-
*/
|
|
309
|
-
declare const export_modalCloseButtonClick: typeof modalCloseButtonClick;
|
|
310
|
-
export { export_modalCloseButtonClick as modalCloseButtonClick };
|
|
311
|
-
/**
|
|
312
|
-
* Type of the parameter of {@link ModalProps.onBeforeClose|onBeforeClose}.
|
|
313
|
-
*/
|
|
314
|
-
export interface ModalBeforeCloseEvent {
|
|
315
|
-
/**
|
|
316
|
-
* Result of the modal, which is the value passed to the {@link ModalApi.close|close} method
|
|
317
|
-
* and later resolved by the promise returned by the {@link ModalApi.open|open} method.
|
|
318
|
-
* If needed, it can be changed from the {@link ModalProps.onBeforeClose|onBeforeClose} event handler.
|
|
319
|
-
*/
|
|
320
|
-
result: any;
|
|
321
|
-
/**
|
|
322
|
-
* Whether to cancel the close of the modal.
|
|
323
|
-
* It can be changed from the {@link ModalProps.onBeforeClose|onBeforeClose} event handler.
|
|
324
|
-
*/
|
|
325
|
-
cancel: boolean;
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Directives of the modal widget.
|
|
329
|
-
*/
|
|
330
|
-
export interface ModalDirectives {
|
|
331
|
-
/**
|
|
332
|
-
* Directive to put on the modal DOM element.
|
|
333
|
-
*/
|
|
334
|
-
modalDirective: Directive;
|
|
335
|
-
/**
|
|
336
|
-
* Directive to put on the backdrop DOM element.
|
|
337
|
-
*/
|
|
338
|
-
backdropDirective: Directive;
|
|
339
|
-
/**
|
|
340
|
-
* Portal directive to put on the modal DOM element.
|
|
341
|
-
*/
|
|
342
|
-
modalPortalDirective: Directive;
|
|
343
|
-
/**
|
|
344
|
-
* Portal directive to put on the backdrop DOM element.
|
|
345
|
-
*/
|
|
346
|
-
backdropPortalDirective: Directive;
|
|
347
|
-
/**
|
|
348
|
-
* Directive that adds all the necessary attributes to the close button
|
|
349
|
-
*/
|
|
350
|
-
closeButtonDirective: Directive;
|
|
351
|
-
/**
|
|
352
|
-
* Directive to apply to the dialog element when using the native {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement | HTMLDialogElement}
|
|
353
|
-
*/
|
|
354
|
-
dialogDirective: Directive;
|
|
355
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Injector } from '@angular/core';
|
|
2
|
-
import type { ModalProps } from './modal.gen';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* Service to handle the opening and management of modal components.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ModalService {
|
|
8
|
-
private readonly _injector;
|
|
9
|
-
private readonly _applicationRef;
|
|
10
|
-
/**
|
|
11
|
-
* Opens a modal dialog with the specified options.
|
|
12
|
-
*
|
|
13
|
-
* @template Data - The type of data that the modal will handle.
|
|
14
|
-
* @param options - The options to configure the modal.
|
|
15
|
-
* @param injector - The injector to use when creating the modal component
|
|
16
|
-
* @returns A promise that resolves when the modal is closed.
|
|
17
|
-
*/
|
|
18
|
-
open<Data>(options: Partial<ModalProps<Data>>, injector?: Injector): Promise<any>;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ModalService, never>;
|
|
20
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ModalService>;
|
|
21
|
-
}
|