@agnos-ui/angular-bootstrap 0.4.0-next.1 → 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 +56 -4
- package/components/modal/modal.gen.d.ts +123 -23
- package/components/modal/modal.service.d.ts +1 -1
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/pagination.component.d.ts +104 -18
- package/components/pagination/pagination.gen.d.ts +188 -18
- package/components/progressbar/index.d.ts +1 -1
- package/components/progressbar/progressbar.component.d.ts +25 -1
- package/components/progressbar/progressbar.gen.d.ts +54 -1
- 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 +28 -3
- 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 +6 -2
- package/esm2022/components/pagination/pagination.gen.mjs +15 -2
- package/esm2022/components/progressbar/index.mjs +2 -2
- package/esm2022/components/progressbar/progressbar.component.mjs +2 -2
- 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 +251 -40
- 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,5 +1,14 @@
|
|
|
1
|
-
import type { WidgetSlotContext, SlotContent, Widget, HasFocus, FloatingUI, Directive } from '@agnos-ui/angular-headless';
|
|
1
|
+
import type { WidgetSlotContext, SlotContent, Widget, PropsConfig, HasFocus, FloatingUI, Directive } from '@agnos-ui/angular-headless';
|
|
2
2
|
import type { Placement } from '@floating-ui/dom';
|
|
3
|
+
/**
|
|
4
|
+
* Retrieve a shallow copy of the default Select config
|
|
5
|
+
* @returns the default Select config
|
|
6
|
+
*/
|
|
7
|
+
declare const export_getSelectDefaultConfig: () => SelectProps<any>;
|
|
8
|
+
export { export_getSelectDefaultConfig as getSelectDefaultConfig };
|
|
9
|
+
/**
|
|
10
|
+
* A type for the slot context of the pagination widget
|
|
11
|
+
*/
|
|
3
12
|
export type SelectContext<Item> = WidgetSlotContext<SelectWidget<Item>>;
|
|
4
13
|
export type SelectItemContext<Item> = SelectContext<Item> & {
|
|
5
14
|
/**
|
|
@@ -31,84 +40,150 @@ export interface SelectState<Item> {
|
|
|
31
40
|
id: string | undefined;
|
|
32
41
|
/**
|
|
33
42
|
* aria-label used for the input inside the select
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue `'Select'`
|
|
34
45
|
*/
|
|
35
46
|
ariaLabel: string | undefined;
|
|
36
47
|
/**
|
|
37
48
|
* List of selected item ids
|
|
49
|
+
*
|
|
50
|
+
* @defaultValue `[]`
|
|
38
51
|
*/
|
|
39
52
|
selected: Item[];
|
|
40
53
|
/**
|
|
41
54
|
* Filtered text to be display in the filter input
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue `''`
|
|
42
57
|
*/
|
|
43
58
|
filterText: string;
|
|
44
59
|
/**
|
|
45
60
|
* true if the select is disabled
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue `false`
|
|
46
63
|
*/
|
|
47
64
|
disabled: boolean;
|
|
48
65
|
/**
|
|
49
66
|
* true if the select is open
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue `false`
|
|
50
69
|
*/
|
|
51
70
|
open: boolean;
|
|
52
71
|
/**
|
|
53
72
|
* Class to be added on the dropdown menu container
|
|
73
|
+
*
|
|
74
|
+
* @defaultValue `''`
|
|
54
75
|
*/
|
|
55
76
|
menuClassName: string;
|
|
56
77
|
/**
|
|
57
78
|
* Class to be added on menu items
|
|
79
|
+
*
|
|
80
|
+
* @defaultValue `''`
|
|
58
81
|
*/
|
|
59
82
|
menuItemClassName: string;
|
|
60
83
|
/**
|
|
61
84
|
* Class to be added on selected items (displayed in the input zone)
|
|
85
|
+
*
|
|
86
|
+
* @defaultValue `''`
|
|
62
87
|
*/
|
|
63
88
|
badgeClassName: string;
|
|
64
89
|
/**
|
|
65
90
|
* true if a loading process is being done
|
|
91
|
+
*
|
|
92
|
+
* @defaultValue `false`
|
|
66
93
|
*/
|
|
67
94
|
loading: boolean;
|
|
68
95
|
/**
|
|
69
96
|
* CSS classes to be applied on the widget main container
|
|
97
|
+
*
|
|
98
|
+
* @defaultValue `''`
|
|
70
99
|
*/
|
|
71
100
|
className: string;
|
|
72
101
|
/**
|
|
73
102
|
* The template to override the way each badge on the left of the input is displayed.
|
|
74
103
|
* This define the content of the badge inside the badge container.
|
|
104
|
+
*
|
|
105
|
+
* @defaultValue
|
|
106
|
+
* ```ts
|
|
107
|
+
* ({itemContext}: SelectItemContext<any>) => itemContext.item
|
|
108
|
+
* ```
|
|
75
109
|
*/
|
|
76
110
|
badgeLabel: SlotContent<SelectItemContext<Item>>;
|
|
77
111
|
/**
|
|
78
112
|
* The template to override the way each item is displayed in the list.
|
|
79
113
|
* This define the content of the badge inside the badge container.
|
|
114
|
+
*
|
|
115
|
+
* @defaultValue
|
|
116
|
+
* ```ts
|
|
117
|
+
* ({itemContext}: SelectItemContext<any>) => itemContext.item
|
|
118
|
+
* ```
|
|
80
119
|
*/
|
|
81
120
|
itemLabel: SlotContent<SelectItemContext<Item>>;
|
|
82
121
|
}
|
|
83
122
|
export interface SelectProps<Item> {
|
|
84
123
|
/**
|
|
85
124
|
* List of available items for the dropdown
|
|
125
|
+
*
|
|
126
|
+
* @defaultValue `[]`
|
|
86
127
|
*/
|
|
87
128
|
items: Item[];
|
|
88
129
|
/**
|
|
89
130
|
* List of allowed placements for the dropdown.
|
|
90
131
|
* This refers to the [allowedPlacements from floating UI](https://floating-ui.com/docs/autoPlacement#allowedplacements), given the different [Placement possibilities](https://floating-ui.com/docs/computePosition#placement).
|
|
132
|
+
*
|
|
133
|
+
* @defaultValue
|
|
134
|
+
* ```ts
|
|
135
|
+
* ['bottom-start', 'top-start', 'bottom-end', 'top-end']
|
|
136
|
+
* ```
|
|
91
137
|
*/
|
|
92
138
|
allowedPlacements: Placement[];
|
|
93
139
|
/**
|
|
94
140
|
* Custom function to get the id of an item
|
|
95
141
|
* By default, the item is returned
|
|
142
|
+
*
|
|
143
|
+
* @defaultValue
|
|
144
|
+
* ```ts
|
|
145
|
+
* (item: any) => '' + item
|
|
146
|
+
* ```
|
|
96
147
|
*/
|
|
97
148
|
itemIdFn(item: Item): string;
|
|
98
149
|
/**
|
|
99
150
|
* Retrieves navigable elements within an HTML element containing badges and the input.
|
|
151
|
+
*
|
|
152
|
+
* @param node - HTMLElement that contains the badges and the input
|
|
153
|
+
*
|
|
154
|
+
* @defaultValue
|
|
155
|
+
* ```ts
|
|
156
|
+
* (node: HTMLElement) => node.querySelectorAll('.au-select-badge,input')
|
|
157
|
+
* ```
|
|
100
158
|
*/
|
|
101
159
|
navSelector(node: HTMLElement): NodeListOf<HTMLSpanElement | HTMLInputElement>;
|
|
102
160
|
/**
|
|
103
161
|
* Callback called dropdown open state change
|
|
162
|
+
* @param isOpen - updated open state
|
|
163
|
+
*
|
|
164
|
+
* @defaultValue
|
|
165
|
+
* ```ts
|
|
166
|
+
* () => {}
|
|
167
|
+
* ```
|
|
104
168
|
*/
|
|
105
169
|
onOpenChange(isOpen: boolean): void;
|
|
106
170
|
/**
|
|
107
171
|
* Callback called when the text filter change
|
|
172
|
+
* @param text - Filtered text
|
|
173
|
+
*
|
|
174
|
+
* @defaultValue
|
|
175
|
+
* ```ts
|
|
176
|
+
* () => {}
|
|
177
|
+
* ```
|
|
108
178
|
*/
|
|
109
179
|
onFilterTextChange(text: string): void;
|
|
110
180
|
/**
|
|
111
181
|
* Callback called when the selection change
|
|
182
|
+
*
|
|
183
|
+
* @defaultValue
|
|
184
|
+
* ```ts
|
|
185
|
+
* () => {}
|
|
186
|
+
* ```
|
|
112
187
|
*/
|
|
113
188
|
onSelectedChange(selected: Item[]): void;
|
|
114
189
|
/**
|
|
@@ -117,56 +192,93 @@ export interface SelectProps<Item> {
|
|
|
117
192
|
id: string | undefined;
|
|
118
193
|
/**
|
|
119
194
|
* aria-label used for the input inside the select
|
|
195
|
+
*
|
|
196
|
+
* @defaultValue `'Select'`
|
|
120
197
|
*/
|
|
121
198
|
ariaLabel: string | undefined;
|
|
122
199
|
/**
|
|
123
200
|
* List of selected item ids
|
|
201
|
+
*
|
|
202
|
+
* @defaultValue `[]`
|
|
124
203
|
*/
|
|
125
204
|
selected: Item[];
|
|
126
205
|
/**
|
|
127
206
|
* Filtered text to be display in the filter input
|
|
207
|
+
*
|
|
208
|
+
* @defaultValue `''`
|
|
128
209
|
*/
|
|
129
210
|
filterText: string;
|
|
130
211
|
/**
|
|
131
212
|
* true if the select is disabled
|
|
213
|
+
*
|
|
214
|
+
* @defaultValue `false`
|
|
132
215
|
*/
|
|
133
216
|
disabled: boolean;
|
|
134
217
|
/**
|
|
135
218
|
* true if the select is open
|
|
219
|
+
*
|
|
220
|
+
* @defaultValue `false`
|
|
136
221
|
*/
|
|
137
222
|
open: boolean;
|
|
138
223
|
/**
|
|
139
224
|
* Class to be added on the dropdown menu container
|
|
225
|
+
*
|
|
226
|
+
* @defaultValue `''`
|
|
140
227
|
*/
|
|
141
228
|
menuClassName: string;
|
|
142
229
|
/**
|
|
143
230
|
* Class to be added on menu items
|
|
231
|
+
*
|
|
232
|
+
* @defaultValue `''`
|
|
144
233
|
*/
|
|
145
234
|
menuItemClassName: string;
|
|
146
235
|
/**
|
|
147
236
|
* Class to be added on selected items (displayed in the input zone)
|
|
237
|
+
*
|
|
238
|
+
* @defaultValue `''`
|
|
148
239
|
*/
|
|
149
240
|
badgeClassName: string;
|
|
150
241
|
/**
|
|
151
242
|
* true if a loading process is being done
|
|
243
|
+
*
|
|
244
|
+
* @defaultValue `false`
|
|
152
245
|
*/
|
|
153
246
|
loading: boolean;
|
|
154
247
|
/**
|
|
155
248
|
* CSS classes to be applied on the widget main container
|
|
249
|
+
*
|
|
250
|
+
* @defaultValue `''`
|
|
156
251
|
*/
|
|
157
252
|
className: string;
|
|
158
253
|
/**
|
|
159
254
|
* The template to override the way each badge on the left of the input is displayed.
|
|
160
255
|
* This define the content of the badge inside the badge container.
|
|
256
|
+
*
|
|
257
|
+
* @defaultValue
|
|
258
|
+
* ```ts
|
|
259
|
+
* ({itemContext}: SelectItemContext<any>) => itemContext.item
|
|
260
|
+
* ```
|
|
161
261
|
*/
|
|
162
262
|
badgeLabel: SlotContent<SelectItemContext<Item>>;
|
|
163
263
|
/**
|
|
164
264
|
* The template to override the way each item is displayed in the list.
|
|
165
265
|
* This define the content of the badge inside the badge container.
|
|
266
|
+
*
|
|
267
|
+
* @defaultValue
|
|
268
|
+
* ```ts
|
|
269
|
+
* ({itemContext}: SelectItemContext<any>) => itemContext.item
|
|
270
|
+
* ```
|
|
166
271
|
*/
|
|
167
272
|
itemLabel: SlotContent<SelectItemContext<Item>>;
|
|
168
273
|
}
|
|
169
274
|
export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, SelectApi<Item>, SelectActions<Item>, SelectDirectives<Item>>;
|
|
275
|
+
/**
|
|
276
|
+
* Creates a new select widget instance.
|
|
277
|
+
* @param config - config of the modal, either as a store or as an object containing values or stores.
|
|
278
|
+
* @returns a new select widget instance
|
|
279
|
+
*/
|
|
280
|
+
declare const export_createSelect: <Item>(config?: PropsConfig<SelectProps<Item>>) => SelectWidget<Item>;
|
|
281
|
+
export { export_createSelect as createSelect };
|
|
170
282
|
export interface ItemContext<T> {
|
|
171
283
|
/**
|
|
172
284
|
* Original item given in the parameters
|
|
@@ -215,14 +327,18 @@ export interface SelectApi<Item> {
|
|
|
215
327
|
/**
|
|
216
328
|
* Select the provided item.
|
|
217
329
|
* The selected list is used to
|
|
330
|
+
* @param item - the item to select
|
|
218
331
|
*/
|
|
219
332
|
select(item: Item): void;
|
|
220
333
|
/**
|
|
221
334
|
* Unselect the provided item.
|
|
335
|
+
* @param item - the item to unselect
|
|
222
336
|
*/
|
|
223
337
|
unselect(item: Item): void;
|
|
224
338
|
/**
|
|
225
339
|
* Toggle the selection of an item
|
|
340
|
+
* @param item - the item to toggle
|
|
341
|
+
* @param selected - an optional boolean to enforce the selected/unselected state instead of toggling
|
|
226
342
|
*/
|
|
227
343
|
toggleItem(item: Item, selected?: boolean): void;
|
|
228
344
|
/**
|
|
@@ -235,6 +351,7 @@ export interface SelectApi<Item> {
|
|
|
235
351
|
close(): void;
|
|
236
352
|
/**
|
|
237
353
|
* Toggle the dropdown menu
|
|
354
|
+
* @param isOpen - If specified, set the menu in the defined state.
|
|
238
355
|
*/
|
|
239
356
|
toggle(isOpen?: boolean): void;
|
|
240
357
|
}
|
|
@@ -286,6 +403,9 @@ export interface SelectActions<Item> {
|
|
|
286
403
|
onInputKeydown: (event: KeyboardEvent) => void;
|
|
287
404
|
/**
|
|
288
405
|
* Method to be plugged to on an keydown event of a badge container, in order to manage main actions on badges.
|
|
406
|
+
*
|
|
407
|
+
* @param event - keyboard event
|
|
408
|
+
* @param item - corresponding item
|
|
289
409
|
*/
|
|
290
410
|
onBadgeKeydown: (event: KeyboardEvent, item: Item) => void;
|
|
291
411
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './slider.component';
|
|
2
|
-
export * from './slider';
|
|
2
|
+
export * from './slider.gen';
|
|
@@ -3,7 +3,7 @@ import { BaseWidgetDirective, ComponentTemplate } from '@agnos-ui/angular-headle
|
|
|
3
3
|
import { type WritableSignal } from '@amadeus-it-group/tansu';
|
|
4
4
|
import type { AfterContentChecked } from '@angular/core';
|
|
5
5
|
import { EventEmitter, TemplateRef } from '@angular/core';
|
|
6
|
-
import type { SliderContext, SliderProps, SliderSlotHandleContext, SliderSlotLabelContext, SliderWidget } from './slider';
|
|
6
|
+
import type { SliderContext, SliderProps, SliderSlotHandleContext, SliderSlotLabelContext, SliderWidget } from './slider.gen';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class SliderLabelDirective {
|
|
9
9
|
templateRef: TemplateRef<any>;
|
|
@@ -43,64 +43,112 @@ export declare class SliderComponent extends BaseWidgetDirective<SliderWidget> i
|
|
|
43
43
|
readonly _widget: import("@agnos-ui/angular-headless").AngularWidget<SliderWidget>;
|
|
44
44
|
/**
|
|
45
45
|
* CSS classes to be applied on the widget main container
|
|
46
|
+
*
|
|
47
|
+
* @defaultValue `''`
|
|
46
48
|
*/
|
|
47
49
|
className: string | undefined;
|
|
48
50
|
/**
|
|
49
51
|
* Minimum value that can be assigned to the slider
|
|
52
|
+
*
|
|
53
|
+
* @defaultValue `0`
|
|
50
54
|
*/
|
|
51
55
|
min: number | undefined;
|
|
52
56
|
/**
|
|
53
57
|
* Maximum value that can be assigned to the slider
|
|
58
|
+
*
|
|
59
|
+
* @defaultValue `100`
|
|
54
60
|
*/
|
|
55
61
|
max: number | undefined;
|
|
56
62
|
/**
|
|
57
63
|
* Unit value between slider steps
|
|
64
|
+
*
|
|
65
|
+
* @defaultValue `1`
|
|
58
66
|
*/
|
|
59
67
|
stepSize: number | undefined;
|
|
60
68
|
/**
|
|
61
69
|
* Current slider values
|
|
70
|
+
*
|
|
71
|
+
* @defaultValue `[0]`
|
|
62
72
|
*/
|
|
63
73
|
values: number[] | undefined;
|
|
64
74
|
/**
|
|
65
75
|
* It `true` slider display is inversed
|
|
76
|
+
*
|
|
77
|
+
* @defaultValue `false`
|
|
66
78
|
*/
|
|
67
79
|
rtl: boolean | undefined;
|
|
68
80
|
/**
|
|
69
81
|
* If `true` the value labels are displayed on the slider
|
|
82
|
+
*
|
|
83
|
+
* @defaultValue `true`
|
|
70
84
|
*/
|
|
71
85
|
showValueLabels: boolean | undefined;
|
|
72
86
|
/**
|
|
73
87
|
* If `true` the min and max labels are displayed on the slider
|
|
88
|
+
*
|
|
89
|
+
* @defaultValue `true`
|
|
74
90
|
*/
|
|
75
91
|
showMinMaxLabels: boolean | undefined;
|
|
76
92
|
/**
|
|
77
93
|
* Return the value for the 'aria-label' attribute for the handle
|
|
94
|
+
* @param value - value of the handle
|
|
95
|
+
* @param sortedIndex - index of the handle in the sorted list
|
|
96
|
+
* @param index - index of the handle in the original list
|
|
97
|
+
*
|
|
98
|
+
* @defaultValue
|
|
99
|
+
* ```ts
|
|
100
|
+
* (value: number) => '' + value
|
|
101
|
+
* ```
|
|
78
102
|
*/
|
|
79
103
|
ariaLabelHandle: ((value: number, sortedIndex: number, index: number) => string) | undefined;
|
|
80
104
|
/**
|
|
81
105
|
* Return the value for the 'aria-valuetext' attribute for the handle
|
|
106
|
+
* @param value - value of the handle
|
|
107
|
+
* @param sortedIndex - index of the handle in the sorted list
|
|
108
|
+
* @param index - index of the handle in the original list
|
|
109
|
+
*
|
|
110
|
+
* @defaultValue
|
|
111
|
+
* ```ts
|
|
112
|
+
* (value: number) => '' + value
|
|
113
|
+
* ```
|
|
82
114
|
*/
|
|
83
115
|
ariaValueText: ((value: number, sortedIndex: number, index: number) => string) | undefined;
|
|
84
116
|
/**
|
|
85
117
|
* If `true` slider value cannot be changed but the slider is still focusable
|
|
118
|
+
*
|
|
119
|
+
* @defaultValue `false`
|
|
86
120
|
*/
|
|
87
121
|
readonly: boolean | undefined;
|
|
88
122
|
/**
|
|
89
123
|
* If `true` slider value cannot be changed and the slider cannot be focused
|
|
124
|
+
*
|
|
125
|
+
* @defaultValue `false`
|
|
90
126
|
*/
|
|
91
127
|
disabled: boolean | undefined;
|
|
92
128
|
/**
|
|
93
129
|
* If `true` is vertically positioned otherwise it is horizontal
|
|
130
|
+
*
|
|
131
|
+
* @defaultValue `false`
|
|
94
132
|
*/
|
|
95
133
|
vertical: boolean | undefined;
|
|
96
134
|
/**
|
|
97
135
|
* An event emitted when slider values are changed
|
|
98
136
|
*
|
|
99
137
|
* Event payload equals to the updated slider values
|
|
138
|
+
*
|
|
139
|
+
* @defaultValue
|
|
140
|
+
* ```ts
|
|
141
|
+
* () => {}
|
|
142
|
+
* ```
|
|
100
143
|
*/
|
|
101
144
|
valuesChange: EventEmitter<number[]>;
|
|
102
145
|
/**
|
|
103
146
|
* Slot to change the default labels of the slider
|
|
147
|
+
*
|
|
148
|
+
* @defaultValue
|
|
149
|
+
* ```ts
|
|
150
|
+
* ({value}: SliderSlotLabelContext) => '' + value
|
|
151
|
+
* ```
|
|
104
152
|
*/
|
|
105
153
|
label: SlotContent<SliderSlotLabelContext>;
|
|
106
154
|
slotLabelFromContent: SliderLabelDirective | undefined;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type { WidgetSlotContext, SlotContent, Widget, Directive } from '@agnos-ui/angular-headless';
|
|
1
|
+
import type { WidgetSlotContext, SlotContent, Widget, WidgetFactory, Directive } from '@agnos-ui/angular-headless';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieve a shallow copy of the default Slider config
|
|
4
|
+
* @returns the default Slider config
|
|
5
|
+
*/
|
|
6
|
+
declare const export_getSliderDefaultConfig: () => SliderProps;
|
|
7
|
+
export { export_getSliderDefaultConfig as getSliderDefaultConfig };
|
|
2
8
|
export type SliderContext = WidgetSlotContext<SliderWidget>;
|
|
3
9
|
export type SliderSlotLabelContext = SliderContext & {
|
|
4
10
|
value: number;
|
|
@@ -49,46 +55,68 @@ export interface SliderState {
|
|
|
49
55
|
interactive: boolean;
|
|
50
56
|
/**
|
|
51
57
|
* Minimum value that can be assigned to the slider
|
|
58
|
+
*
|
|
59
|
+
* @defaultValue `0`
|
|
52
60
|
*/
|
|
53
61
|
min: number;
|
|
54
62
|
/**
|
|
55
63
|
* Maximum value that can be assigned to the slider
|
|
64
|
+
*
|
|
65
|
+
* @defaultValue `100`
|
|
56
66
|
*/
|
|
57
67
|
max: number;
|
|
58
68
|
/**
|
|
59
69
|
* Unit value between slider steps
|
|
70
|
+
*
|
|
71
|
+
* @defaultValue `1`
|
|
60
72
|
*/
|
|
61
73
|
stepSize: number;
|
|
62
74
|
/**
|
|
63
75
|
* If `true` slider value cannot be changed but the slider is still focusable
|
|
76
|
+
*
|
|
77
|
+
* @defaultValue `false`
|
|
64
78
|
*/
|
|
65
79
|
readonly: boolean;
|
|
66
80
|
/**
|
|
67
81
|
* If `true` slider value cannot be changed and the slider cannot be focused
|
|
82
|
+
*
|
|
83
|
+
* @defaultValue `false`
|
|
68
84
|
*/
|
|
69
85
|
disabled: boolean;
|
|
70
86
|
/**
|
|
71
87
|
* If `true` is vertically positioned otherwise it is horizontal
|
|
88
|
+
*
|
|
89
|
+
* @defaultValue `false`
|
|
72
90
|
*/
|
|
73
91
|
vertical: boolean;
|
|
74
92
|
/**
|
|
75
93
|
* Current slider values
|
|
94
|
+
*
|
|
95
|
+
* @defaultValue `[0]`
|
|
76
96
|
*/
|
|
77
97
|
values: number[];
|
|
78
98
|
/**
|
|
79
99
|
* If `true` the value labels are displayed on the slider
|
|
100
|
+
*
|
|
101
|
+
* @defaultValue `true`
|
|
80
102
|
*/
|
|
81
103
|
showValueLabels: boolean;
|
|
82
104
|
/**
|
|
83
105
|
* If `true` the min and max labels are displayed on the slider
|
|
106
|
+
*
|
|
107
|
+
* @defaultValue `true`
|
|
84
108
|
*/
|
|
85
109
|
showMinMaxLabels: boolean;
|
|
86
110
|
/**
|
|
87
111
|
* It `true` slider display is inversed
|
|
112
|
+
*
|
|
113
|
+
* @defaultValue `false`
|
|
88
114
|
*/
|
|
89
115
|
rtl: boolean;
|
|
90
116
|
/**
|
|
91
117
|
* CSS classes to be applied on the widget main container
|
|
118
|
+
*
|
|
119
|
+
* @defaultValue `''`
|
|
92
120
|
*/
|
|
93
121
|
className: string;
|
|
94
122
|
/**
|
|
@@ -97,70 +125,118 @@ export interface SliderState {
|
|
|
97
125
|
structure: SlotContent<SliderContext>;
|
|
98
126
|
/**
|
|
99
127
|
* Slot to change the default labels of the slider
|
|
128
|
+
*
|
|
129
|
+
* @defaultValue
|
|
130
|
+
* ```ts
|
|
131
|
+
* ({value}: SliderSlotLabelContext) => '' + value
|
|
132
|
+
* ```
|
|
100
133
|
*/
|
|
101
134
|
label: SlotContent<SliderSlotLabelContext>;
|
|
102
135
|
/**
|
|
103
|
-
*
|
|
136
|
+
* Slot to change the handlers
|
|
104
137
|
*/
|
|
105
138
|
handle: SlotContent<SliderSlotHandleContext>;
|
|
106
139
|
}
|
|
107
140
|
export interface SliderProps {
|
|
108
141
|
/**
|
|
109
142
|
* Return the value for the 'aria-label' attribute for the handle
|
|
143
|
+
* @param value - value of the handle
|
|
144
|
+
* @param sortedIndex - index of the handle in the sorted list
|
|
145
|
+
* @param index - index of the handle in the original list
|
|
146
|
+
*
|
|
147
|
+
* @defaultValue
|
|
148
|
+
* ```ts
|
|
149
|
+
* (value: number) => '' + value
|
|
150
|
+
* ```
|
|
110
151
|
*/
|
|
111
152
|
ariaLabelHandle: (value: number, sortedIndex: number, index: number) => string;
|
|
112
153
|
/**
|
|
113
154
|
* Return the value for the 'aria-valuetext' attribute for the handle
|
|
155
|
+
* @param value - value of the handle
|
|
156
|
+
* @param sortedIndex - index of the handle in the sorted list
|
|
157
|
+
* @param index - index of the handle in the original list
|
|
158
|
+
*
|
|
159
|
+
* @defaultValue
|
|
160
|
+
* ```ts
|
|
161
|
+
* (value: number) => '' + value
|
|
162
|
+
* ```
|
|
114
163
|
*/
|
|
115
164
|
ariaValueText: (value: number, sortedIndex: number, index: number) => string;
|
|
116
165
|
/**
|
|
117
166
|
* An event emitted when slider values are changed
|
|
118
167
|
*
|
|
119
168
|
* Event payload equals to the updated slider values
|
|
169
|
+
*
|
|
170
|
+
* @defaultValue
|
|
171
|
+
* ```ts
|
|
172
|
+
* () => {}
|
|
173
|
+
* ```
|
|
120
174
|
*/
|
|
121
175
|
onValuesChange: (values: number[]) => void;
|
|
122
176
|
/**
|
|
123
177
|
* Minimum value that can be assigned to the slider
|
|
178
|
+
*
|
|
179
|
+
* @defaultValue `0`
|
|
124
180
|
*/
|
|
125
181
|
min: number;
|
|
126
182
|
/**
|
|
127
183
|
* Maximum value that can be assigned to the slider
|
|
184
|
+
*
|
|
185
|
+
* @defaultValue `100`
|
|
128
186
|
*/
|
|
129
187
|
max: number;
|
|
130
188
|
/**
|
|
131
189
|
* Unit value between slider steps
|
|
190
|
+
*
|
|
191
|
+
* @defaultValue `1`
|
|
132
192
|
*/
|
|
133
193
|
stepSize: number;
|
|
134
194
|
/**
|
|
135
195
|
* If `true` slider value cannot be changed but the slider is still focusable
|
|
196
|
+
*
|
|
197
|
+
* @defaultValue `false`
|
|
136
198
|
*/
|
|
137
199
|
readonly: boolean;
|
|
138
200
|
/**
|
|
139
201
|
* If `true` slider value cannot be changed and the slider cannot be focused
|
|
202
|
+
*
|
|
203
|
+
* @defaultValue `false`
|
|
140
204
|
*/
|
|
141
205
|
disabled: boolean;
|
|
142
206
|
/**
|
|
143
207
|
* If `true` is vertically positioned otherwise it is horizontal
|
|
208
|
+
*
|
|
209
|
+
* @defaultValue `false`
|
|
144
210
|
*/
|
|
145
211
|
vertical: boolean;
|
|
146
212
|
/**
|
|
147
213
|
* Current slider values
|
|
214
|
+
*
|
|
215
|
+
* @defaultValue `[0]`
|
|
148
216
|
*/
|
|
149
217
|
values: number[];
|
|
150
218
|
/**
|
|
151
219
|
* If `true` the value labels are displayed on the slider
|
|
220
|
+
*
|
|
221
|
+
* @defaultValue `true`
|
|
152
222
|
*/
|
|
153
223
|
showValueLabels: boolean;
|
|
154
224
|
/**
|
|
155
225
|
* If `true` the min and max labels are displayed on the slider
|
|
226
|
+
*
|
|
227
|
+
* @defaultValue `true`
|
|
156
228
|
*/
|
|
157
229
|
showMinMaxLabels: boolean;
|
|
158
230
|
/**
|
|
159
231
|
* It `true` slider display is inversed
|
|
232
|
+
*
|
|
233
|
+
* @defaultValue `false`
|
|
160
234
|
*/
|
|
161
235
|
rtl: boolean;
|
|
162
236
|
/**
|
|
163
237
|
* CSS classes to be applied on the widget main container
|
|
238
|
+
*
|
|
239
|
+
* @defaultValue `''`
|
|
164
240
|
*/
|
|
165
241
|
className: string;
|
|
166
242
|
/**
|
|
@@ -169,14 +245,26 @@ export interface SliderProps {
|
|
|
169
245
|
structure: SlotContent<SliderContext>;
|
|
170
246
|
/**
|
|
171
247
|
* Slot to change the default labels of the slider
|
|
248
|
+
*
|
|
249
|
+
* @defaultValue
|
|
250
|
+
* ```ts
|
|
251
|
+
* ({value}: SliderSlotLabelContext) => '' + value
|
|
252
|
+
* ```
|
|
172
253
|
*/
|
|
173
254
|
label: SlotContent<SliderSlotLabelContext>;
|
|
174
255
|
/**
|
|
175
|
-
*
|
|
256
|
+
* Slot to change the handlers
|
|
176
257
|
*/
|
|
177
258
|
handle: SlotContent<SliderSlotHandleContext>;
|
|
178
259
|
}
|
|
179
260
|
export type SliderWidget = Widget<SliderProps, SliderState, SliderApi, SliderActions, SliderDirectives>;
|
|
261
|
+
/**
|
|
262
|
+
* Create a Slider with given config props
|
|
263
|
+
* @param config - an optional slider config
|
|
264
|
+
* @returns a SliderWidget
|
|
265
|
+
*/
|
|
266
|
+
declare const export_createSlider: WidgetFactory<SliderWidget>;
|
|
267
|
+
export { export_createSlider as createSlider };
|
|
180
268
|
export interface ProgressDisplayOptions {
|
|
181
269
|
/**
|
|
182
270
|
* Right offset of the progress in %
|
|
@@ -276,18 +364,25 @@ export interface SliderDirectives {
|
|
|
276
364
|
export interface SliderActions {
|
|
277
365
|
/**
|
|
278
366
|
* Method to handle click on the slider
|
|
367
|
+
* @param event - mouse event
|
|
279
368
|
*/
|
|
280
369
|
click(event: MouseEvent): void;
|
|
281
370
|
/**
|
|
282
371
|
* Method to process the keyboard event
|
|
372
|
+
* @param event - keyboard event object
|
|
373
|
+
* @param handleNumber - id of the modified handle
|
|
283
374
|
*/
|
|
284
375
|
keydown(event: KeyboardEvent, handleNumber: number): void;
|
|
285
376
|
/**
|
|
286
377
|
* Method describing the behavior of the slider handle on mouse down event
|
|
378
|
+
* @param event - mouse event
|
|
379
|
+
* @param handleId - numeric id of the handle
|
|
287
380
|
*/
|
|
288
381
|
mouseDown(event: MouseEvent, handleId: number): void;
|
|
289
382
|
/**
|
|
290
383
|
* Method describing the behavior of the slider handle on touch start event
|
|
384
|
+
* @param event - touch event
|
|
385
|
+
* @param handleId - number id of the handle
|
|
291
386
|
*/
|
|
292
387
|
touchStart(event: TouchEvent, handleId: number): void;
|
|
293
388
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './toast.component';
|
|
2
|
-
export * from './toast';
|
|
2
|
+
export * from './toast.gen';
|