@agnos-ui/angular-bootstrap 0.3.1 → 0.4.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/agnos-ui-angular.module.d.ts +1 -1
  2. package/components/accordion/accordion.component.d.ts +63 -97
  3. package/components/accordion/accordion.d.ts +5 -10
  4. package/components/accordion/accordion.gen.d.ts +342 -0
  5. package/components/alert/alert.component.d.ts +11 -5
  6. package/components/alert/alert.d.ts +4 -6
  7. package/components/alert/alert.gen.d.ts +118 -0
  8. package/components/modal/modal.component.d.ts +24 -8
  9. package/components/modal/modal.d.ts +5 -8
  10. package/components/modal/modal.gen.d.ts +238 -0
  11. package/components/pagination/pagination.component.d.ts +42 -0
  12. package/components/pagination/pagination.d.ts +4 -7
  13. package/components/pagination/pagination.gen.d.ts +394 -0
  14. package/components/progressbar/progressbar.component.d.ts +8 -2
  15. package/components/progressbar/progressbar.d.ts +4 -6
  16. package/components/progressbar/progressbar.gen.d.ts +126 -0
  17. package/components/rating/rating.component.d.ts +6 -3
  18. package/components/rating/rating.d.ts +4 -5
  19. package/components/rating/rating.gen.d.ts +179 -0
  20. package/components/select/select.component.d.ts +16 -8
  21. package/components/select/select.d.ts +4 -7
  22. package/components/select/select.gen.d.ts +291 -0
  23. package/components/slider/slider.component.d.ts +13 -4
  24. package/components/slider/slider.d.ts +4 -8
  25. package/components/slider/slider.gen.d.ts +293 -0
  26. package/components/toast/toast.component.d.ts +15 -6
  27. package/components/toast/toast.d.ts +4 -6
  28. package/components/toast/toast.gen.d.ts +145 -0
  29. package/config.d.ts +3 -5
  30. package/config.gen.d.ts +47 -0
  31. package/esm2022/agnos-ui-angular.module.mjs +5 -5
  32. package/esm2022/components/accordion/accordion.component.mjs +121 -155
  33. package/esm2022/components/accordion/accordion.gen.mjs +2 -0
  34. package/esm2022/components/accordion/accordion.mjs +4 -3
  35. package/esm2022/components/alert/alert.component.mjs +20 -20
  36. package/esm2022/components/alert/alert.gen.mjs +2 -0
  37. package/esm2022/components/alert/alert.mjs +3 -3
  38. package/esm2022/components/modal/modal.component.mjs +18 -18
  39. package/esm2022/components/modal/modal.gen.mjs +2 -0
  40. package/esm2022/components/modal/modal.mjs +4 -3
  41. package/esm2022/components/pagination/pagination.component.mjs +25 -25
  42. package/esm2022/components/pagination/pagination.gen.mjs +2 -0
  43. package/esm2022/components/pagination/pagination.mjs +3 -3
  44. package/esm2022/components/progressbar/progressbar.component.mjs +12 -12
  45. package/esm2022/components/progressbar/progressbar.gen.mjs +2 -0
  46. package/esm2022/components/progressbar/progressbar.mjs +3 -3
  47. package/esm2022/components/rating/rating.component.mjs +11 -12
  48. package/esm2022/components/rating/rating.gen.mjs +2 -0
  49. package/esm2022/components/rating/rating.mjs +3 -3
  50. package/esm2022/components/select/select.component.mjs +24 -24
  51. package/esm2022/components/select/select.gen.mjs +2 -0
  52. package/esm2022/components/select/select.mjs +3 -3
  53. package/esm2022/components/slider/slider.component.mjs +42 -42
  54. package/esm2022/components/slider/slider.gen.mjs +2 -0
  55. package/esm2022/components/slider/slider.mjs +3 -3
  56. package/esm2022/components/toast/toast.component.mjs +31 -31
  57. package/esm2022/components/toast/toast.gen.mjs +2 -0
  58. package/esm2022/components/toast/toast.mjs +3 -3
  59. package/esm2022/config.gen.mjs +2 -0
  60. package/esm2022/config.mjs +1 -1
  61. package/esm2022/index.mjs +1 -1
  62. package/fesm2022/agnos-ui-angular-bootstrap.mjs +319 -362
  63. package/fesm2022/agnos-ui-angular-bootstrap.mjs.map +1 -1
  64. package/index.d.ts +9 -9
  65. package/package.json +7 -7
@@ -0,0 +1,179 @@
1
+ import type { SlotContent, Widget, Directive } from '@agnos-ui/angular-headless';
2
+ export interface RatingState {
3
+ /**
4
+ * the aria value of the rating
5
+ */
6
+ ariaValueText: string;
7
+ /**
8
+ * the visible value of the rating (it changes when hovering over the rating even though the real value did not change)
9
+ */
10
+ visibleRating: number;
11
+ /**
12
+ * is the rating interactive i.e. listening to hover, click and keyboard events
13
+ */
14
+ interactive: boolean;
15
+ /**
16
+ * the list of stars
17
+ */
18
+ stars: StarContext[];
19
+ /**
20
+ * The current rating. Could be a decimal value like `3.75`.
21
+ */
22
+ rating: number;
23
+ /**
24
+ * The maximum rating that can be given.
25
+ */
26
+ maxRating: number;
27
+ /**
28
+ * If `true`, the rating is disabled.
29
+ */
30
+ disabled: boolean;
31
+ /**
32
+ * If `true`, the rating can't be changed.
33
+ */
34
+ readonly: boolean;
35
+ /**
36
+ * Define if the rating can be reset.
37
+ *
38
+ * If set to true, the user can 'unset' the rating value by cliking on the current rating value.
39
+ */
40
+ resettable: boolean;
41
+ /**
42
+ * Allows setting a custom rating tabindex.
43
+ * If the component is disabled, `tabindex` will still be set to `-1`.
44
+ */
45
+ tabindex: number;
46
+ /**
47
+ * The aria label
48
+ */
49
+ ariaLabel: string;
50
+ /**
51
+ * The aria labelled by
52
+ */
53
+ ariaLabelledBy: string;
54
+ /**
55
+ * CSS classes to be applied on the widget main container
56
+ */
57
+ className: string;
58
+ /**
59
+ * The template to override the way each star is displayed.
60
+ */
61
+ star: SlotContent<StarContext>;
62
+ }
63
+ export interface RatingProps {
64
+ /**
65
+ * Return the value for the 'aria-valuetext' attribute.
66
+ */
67
+ ariaValueTextFn: (rating: number, maxRating: number) => string;
68
+ /**
69
+ * An event emitted when the rating is changed.
70
+ *
71
+ * Event payload is equal to the newly selected rating.
72
+ */
73
+ onRatingChange: (rating: number) => void;
74
+ /**
75
+ * An event emitted when the user is hovering over a given rating.
76
+ *
77
+ * Event payload is equal to the rating being hovered over.
78
+ */
79
+ onHover: (rating: number) => void;
80
+ /**
81
+ * An event emitted when the user stops hovering over a given rating.
82
+ *
83
+ * Event payload is equal to the rating of the last item being hovered over.
84
+ */
85
+ onLeave: (rating: number) => void;
86
+ /**
87
+ * The current rating. Could be a decimal value like `3.75`.
88
+ */
89
+ rating: number;
90
+ /**
91
+ * The maximum rating that can be given.
92
+ */
93
+ maxRating: number;
94
+ /**
95
+ * If `true`, the rating is disabled.
96
+ */
97
+ disabled: boolean;
98
+ /**
99
+ * If `true`, the rating can't be changed.
100
+ */
101
+ readonly: boolean;
102
+ /**
103
+ * Define if the rating can be reset.
104
+ *
105
+ * If set to true, the user can 'unset' the rating value by cliking on the current rating value.
106
+ */
107
+ resettable: boolean;
108
+ /**
109
+ * Allows setting a custom rating tabindex.
110
+ * If the component is disabled, `tabindex` will still be set to `-1`.
111
+ */
112
+ tabindex: number;
113
+ /**
114
+ * The aria label
115
+ */
116
+ ariaLabel: string;
117
+ /**
118
+ * The aria labelled by
119
+ */
120
+ ariaLabelledBy: string;
121
+ /**
122
+ * CSS classes to be applied on the widget main container
123
+ */
124
+ className: string;
125
+ /**
126
+ * The template to override the way each star is displayed.
127
+ */
128
+ star: SlotContent<StarContext>;
129
+ }
130
+ export type RatingWidget = Widget<RatingProps, RatingState, object, RatingActions, RatingDirectives>;
131
+ export interface StarContext {
132
+ /**
133
+ * indicates how much the current star is filled, from 0 to 100
134
+ */
135
+ fill: number;
136
+ /**
137
+ * the position of the star in the rating
138
+ */
139
+ index: number;
140
+ }
141
+ export interface RatingDirectives {
142
+ /**
143
+ * A directive to be applied to the main container
144
+ * This will handle the keydown, mouseleave, tabindex and aria attributes
145
+ */
146
+ containerDirective: Directive;
147
+ /**
148
+ * A directive to be applied on each star element
149
+ */
150
+ starDirective: Directive<{
151
+ index: number;
152
+ }>;
153
+ }
154
+ export interface RatingActions {
155
+ /**
156
+ * Method to be used when a star is clicked.
157
+ *
158
+ * To be used in the onclick event of a star
159
+ */
160
+ click(index: number): void;
161
+ /**
162
+ * Method to be used when the mouse enter in a star.
163
+ *
164
+ * To be used in the onmouseenter of a star
165
+ */
166
+ hover(index: number): void;
167
+ /**
168
+ * Method to be used when the mouse leave the widget.
169
+ *
170
+ * To be used in the onmouseleave of the rating container
171
+ */
172
+ leave(): void;
173
+ /**
174
+ * Method to be used to handle the keyboard.
175
+ *
176
+ * To be used in the onkeydown of the rating container
177
+ */
178
+ handleKey(event: KeyboardEvent): void;
179
+ }
@@ -11,11 +11,11 @@ export declare class SelectBadgeLabelDirective<Item> {
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectBadgeLabelDirective<any>, never>;
12
12
  static ɵdir: i0.ɵɵDirectiveDeclaration<SelectBadgeLabelDirective<any>, "ng-template[auSelectBadgeLabel]", never, {}, {}, never, never, true, never>;
13
13
  }
14
- export declare class SelectItemDirective<Item> {
14
+ export declare class SelectItemLabelDirective<Item> {
15
15
  templateRef: TemplateRef<any>;
16
- static ngTemplateContextGuard<Item>(_dir: SelectItemDirective<Item>, context: unknown): context is SelectItemContext<Item>;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<SelectItemDirective<any>, never>;
18
- static ɵdir: i0.ɵɵDirectiveDeclaration<SelectItemDirective<any>, "ng-template[auSelectItem]", never, {}, {}, never, never, true, never>;
16
+ static ngTemplateContextGuard<Item>(_dir: SelectItemLabelDirective<Item>, context: unknown): context is SelectItemContext<Item>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectItemLabelDirective<any>, never>;
18
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SelectItemLabelDirective<any>, "ng-template[auSelectItemLabel]", never, {}, {}, never, never, true, never>;
19
19
  }
20
20
  export declare class SelectComponent<Item> extends BaseWidgetDirective<SelectWidget<Item>> implements AfterContentChecked {
21
21
  /**
@@ -68,10 +68,18 @@ export declare class SelectComponent<Item> extends BaseWidgetDirective<SelectWid
68
68
  * Class to be added on the dropdown menu container
69
69
  */
70
70
  menuClassName: string | undefined;
71
- slotBadgeLabel: SlotContent<SelectItemContext<Item>>;
71
+ /**
72
+ * The template to override the way each badge on the left of the input is displayed.
73
+ * This define the content of the badge inside the badge container.
74
+ */
75
+ badgeLabel: SlotContent<SelectItemContext<Item>>;
72
76
  slotSelectBadgeLabelFromContent: SelectBadgeLabelDirective<Item> | undefined;
73
- slotItem: SlotContent<SelectItemContext<Item>>;
74
- slotSelectItemFromContent: SelectItemDirective<Item> | undefined;
77
+ /**
78
+ * The template to override the way each item is displayed in the list.
79
+ * This define the content of the badge inside the badge container.
80
+ */
81
+ itemLabel: SlotContent<SelectItemContext<Item>>;
82
+ slotSelectItemLabelFromContent: SelectItemLabelDirective<Item> | undefined;
75
83
  /**
76
84
  * Callback called when the text filter change
77
85
  */
@@ -100,7 +108,7 @@ export declare class SelectComponent<Item> extends BaseWidgetDirective<SelectWid
100
108
  itemCtxTrackBy(_: number, itemContext: ItemContext<Item>): string;
101
109
  ngAfterContentChecked(): void;
102
110
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent<any>, never>;
103
- static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent<any>, "[auSelect]", never, { "ariaLabel": { "alias": "auAriaLabel"; "required": false; }; "id": { "alias": "auId"; "required": false; }; "items": { "alias": "auItems"; "required": false; }; "allowedPlacements": { "alias": "auAllowedPlacements"; "required": false; }; "open": { "alias": "auOpen"; "required": false; }; "filterText": { "alias": "auFilterText"; "required": false; }; "className": { "alias": "auClassName"; "required": false; }; "disabled": { "alias": "auDisabled"; "required": false; }; "selected": { "alias": "auSelected"; "required": false; }; "loading": { "alias": "auLoading"; "required": false; }; "itemIdFn": { "alias": "auItemIdFn"; "required": false; }; "menuClassName": { "alias": "auMenuClassName"; "required": false; }; "slotBadgeLabel": { "alias": "auSlotBadgeLabel"; "required": false; }; "slotItem": { "alias": "auSlotItem"; "required": false; }; "menuItemClassName": { "alias": "auMenuItemClassName"; "required": false; }; "badgeClassName": { "alias": "auBadgeClassName"; "required": false; }; "navSelector": { "alias": "auNavSelector"; "required": false; }; }, { "filterTextChange": "auFilterTextChange"; "selectedChange": "auSelectedChange"; "openChange": "auOpenChange"; }, ["slotSelectBadgeLabelFromContent", "slotSelectItemFromContent"], never, true, never>;
111
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent<any>, "[auSelect]", never, { "ariaLabel": { "alias": "auAriaLabel"; "required": false; }; "id": { "alias": "auId"; "required": false; }; "items": { "alias": "auItems"; "required": false; }; "allowedPlacements": { "alias": "auAllowedPlacements"; "required": false; }; "open": { "alias": "auOpen"; "required": false; }; "filterText": { "alias": "auFilterText"; "required": false; }; "className": { "alias": "auClassName"; "required": false; }; "disabled": { "alias": "auDisabled"; "required": false; }; "selected": { "alias": "auSelected"; "required": false; }; "loading": { "alias": "auLoading"; "required": false; }; "itemIdFn": { "alias": "auItemIdFn"; "required": false; }; "menuClassName": { "alias": "auMenuClassName"; "required": false; }; "badgeLabel": { "alias": "auBadgeLabel"; "required": false; }; "itemLabel": { "alias": "auItemLabel"; "required": false; }; "menuItemClassName": { "alias": "auMenuItemClassName"; "required": false; }; "badgeClassName": { "alias": "auBadgeClassName"; "required": false; }; "navSelector": { "alias": "auNavSelector"; "required": false; }; }, { "filterTextChange": "auFilterTextChange"; "selectedChange": "auSelectedChange"; "openChange": "auOpenChange"; }, ["slotSelectBadgeLabelFromContent", "slotSelectItemLabelFromContent"], never, true, never>;
104
112
  static ngAcceptInputType_open: unknown;
105
113
  static ngAcceptInputType_disabled: unknown;
106
114
  static ngAcceptInputType_loading: unknown;
@@ -1,8 +1,5 @@
1
- import type { AdaptWidgetSlots, WidgetProps, WidgetState, AdaptSlotContentProps, PropsConfig } from '@agnos-ui/angular-headless';
2
- export * from '@agnos-ui/core-bootstrap/components/select';
3
- export type SelectWidget<Item> = AdaptWidgetSlots<import('@agnos-ui/core-bootstrap/components/select').SelectWidget<Item>>;
4
- export type SelectProps<Item> = WidgetProps<SelectWidget<Item>>;
5
- export type SelectState<Item> = WidgetState<SelectWidget<Item>>;
6
- export type SelectContext<Item> = AdaptSlotContentProps<import('@agnos-ui/core-bootstrap/components/select').SelectContext<Item>>;
7
- export type SelectItemContext<Item> = AdaptSlotContentProps<import('@agnos-ui/core-bootstrap/components/select').SelectItemContext<Item>>;
1
+ import type { PropsConfig } from '@agnos-ui/angular-headless';
2
+ import type { SelectProps, SelectWidget } from './select.gen';
3
+ export type * from './select.gen';
8
4
  export declare const createSelect: <Item>(propsConfig?: PropsConfig<SelectProps<Item>>) => SelectWidget<Item>;
5
+ export declare const getSelectDefaultConfig: () => SelectProps<any>;
@@ -0,0 +1,291 @@
1
+ import type { WidgetSlotContext, SlotContent, Widget, HasFocus, FloatingUI, Directive } from '@agnos-ui/angular-headless';
2
+ import type { Placement } from '@floating-ui/dom';
3
+ export type SelectContext<Item> = WidgetSlotContext<SelectWidget<Item>>;
4
+ export type SelectItemContext<Item> = SelectContext<Item> & {
5
+ /**
6
+ * Contextual data related to an item
7
+ */
8
+ itemContext: ItemContext<Item>;
9
+ };
10
+ export interface SelectState<Item> {
11
+ /**
12
+ * List of item contexts, to be displayed in the menu
13
+ */
14
+ visibleItems: ItemContext<Item>[];
15
+ /**
16
+ * List of selected items to be display
17
+ */
18
+ selectedContexts: ItemContext<Item>[];
19
+ /**
20
+ * Highlighted item context.
21
+ * It is designed to define the highlighted item in the dropdown menu
22
+ */
23
+ highlighted: ItemContext<Item> | undefined;
24
+ /**
25
+ * Current placement of the dropdown
26
+ */
27
+ placement: Placement | undefined;
28
+ /**
29
+ * id used for the input inside the select
30
+ */
31
+ id: string | undefined;
32
+ /**
33
+ * aria-label used for the input inside the select
34
+ */
35
+ ariaLabel: string | undefined;
36
+ /**
37
+ * List of selected item ids
38
+ */
39
+ selected: Item[];
40
+ /**
41
+ * Filtered text to be display in the filter input
42
+ */
43
+ filterText: string;
44
+ /**
45
+ * true if the select is disabled
46
+ */
47
+ disabled: boolean;
48
+ /**
49
+ * true if the select is open
50
+ */
51
+ open: boolean;
52
+ /**
53
+ * Class to be added on the dropdown menu container
54
+ */
55
+ menuClassName: string;
56
+ /**
57
+ * Class to be added on menu items
58
+ */
59
+ menuItemClassName: string;
60
+ /**
61
+ * Class to be added on selected items (displayed in the input zone)
62
+ */
63
+ badgeClassName: string;
64
+ /**
65
+ * true if a loading process is being done
66
+ */
67
+ loading: boolean;
68
+ /**
69
+ * CSS classes to be applied on the widget main container
70
+ */
71
+ className: string;
72
+ /**
73
+ * The template to override the way each badge on the left of the input is displayed.
74
+ * This define the content of the badge inside the badge container.
75
+ */
76
+ badgeLabel: SlotContent<SelectItemContext<Item>>;
77
+ /**
78
+ * The template to override the way each item is displayed in the list.
79
+ * This define the content of the badge inside the badge container.
80
+ */
81
+ itemLabel: SlotContent<SelectItemContext<Item>>;
82
+ }
83
+ export interface SelectProps<Item> {
84
+ /**
85
+ * List of available items for the dropdown
86
+ */
87
+ items: Item[];
88
+ /**
89
+ * List of allowed placements for the dropdown.
90
+ * 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).
91
+ */
92
+ allowedPlacements: Placement[];
93
+ /**
94
+ * Custom function to get the id of an item
95
+ * By default, the item is returned
96
+ */
97
+ itemIdFn(item: Item): string;
98
+ /**
99
+ * Retrieves navigable elements within an HTML element containing badges and the input.
100
+ */
101
+ navSelector(node: HTMLElement): NodeListOf<HTMLSpanElement | HTMLInputElement>;
102
+ /**
103
+ * Callback called dropdown open state change
104
+ */
105
+ onOpenChange(isOpen: boolean): void;
106
+ /**
107
+ * Callback called when the text filter change
108
+ */
109
+ onFilterTextChange(text: string): void;
110
+ /**
111
+ * Callback called when the selection change
112
+ */
113
+ onSelectedChange(selected: Item[]): void;
114
+ /**
115
+ * id used for the input inside the select
116
+ */
117
+ id: string | undefined;
118
+ /**
119
+ * aria-label used for the input inside the select
120
+ */
121
+ ariaLabel: string | undefined;
122
+ /**
123
+ * List of selected item ids
124
+ */
125
+ selected: Item[];
126
+ /**
127
+ * Filtered text to be display in the filter input
128
+ */
129
+ filterText: string;
130
+ /**
131
+ * true if the select is disabled
132
+ */
133
+ disabled: boolean;
134
+ /**
135
+ * true if the select is open
136
+ */
137
+ open: boolean;
138
+ /**
139
+ * Class to be added on the dropdown menu container
140
+ */
141
+ menuClassName: string;
142
+ /**
143
+ * Class to be added on menu items
144
+ */
145
+ menuItemClassName: string;
146
+ /**
147
+ * Class to be added on selected items (displayed in the input zone)
148
+ */
149
+ badgeClassName: string;
150
+ /**
151
+ * true if a loading process is being done
152
+ */
153
+ loading: boolean;
154
+ /**
155
+ * CSS classes to be applied on the widget main container
156
+ */
157
+ className: string;
158
+ /**
159
+ * The template to override the way each badge on the left of the input is displayed.
160
+ * This define the content of the badge inside the badge container.
161
+ */
162
+ badgeLabel: SlotContent<SelectItemContext<Item>>;
163
+ /**
164
+ * The template to override the way each item is displayed in the list.
165
+ * This define the content of the badge inside the badge container.
166
+ */
167
+ itemLabel: SlotContent<SelectItemContext<Item>>;
168
+ }
169
+ export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, SelectApi<Item>, SelectActions<Item>, SelectDirectives<Item>>;
170
+ export interface ItemContext<T> {
171
+ /**
172
+ * Original item given in the parameters
173
+ */
174
+ item: T;
175
+ /**
176
+ * Unique id to identify the item
177
+ */
178
+ id: string;
179
+ /**
180
+ * Specify if the item is checked
181
+ */
182
+ selected: boolean;
183
+ }
184
+ export interface SelectApi<Item> {
185
+ /**
186
+ * Clear all the selected items
187
+ */
188
+ clear(): void;
189
+ /**
190
+ * Clear the filter text
191
+ */
192
+ clearText(): void;
193
+ /**
194
+ * Highlight the given item, if there is a corresponding match among the visible list
195
+ */
196
+ highlight(item: Item): void;
197
+ /**
198
+ * Highlight the first item among the visible list
199
+ */
200
+ highlightFirst(): void;
201
+ /**
202
+ * Highlight the previous item among the visible list
203
+ * Loop to the last item if needed
204
+ */
205
+ highlightPrevious(): void;
206
+ /**
207
+ * Highlight the next item among the visible list.
208
+ * Loop to the first item if needed
209
+ */
210
+ highlightNext(): void;
211
+ /**
212
+ * Highlight the last item among the visible list
213
+ */
214
+ highlightLast(): void;
215
+ /**
216
+ * Select the provided item.
217
+ * The selected list is used to
218
+ */
219
+ select(item: Item): void;
220
+ /**
221
+ * Unselect the provided item.
222
+ */
223
+ unselect(item: Item): void;
224
+ /**
225
+ * Toggle the selection of an item
226
+ */
227
+ toggleItem(item: Item, selected?: boolean): void;
228
+ /**
229
+ * open the select
230
+ */
231
+ open(): void;
232
+ /**
233
+ * close the select
234
+ */
235
+ close(): void;
236
+ /**
237
+ * Toggle the dropdown menu
238
+ */
239
+ toggle(isOpen?: boolean): void;
240
+ }
241
+ export interface SelectDirectives<Item> {
242
+ /**
243
+ * Directive to be used in the input group and the menu containers
244
+ */
245
+ hasFocusDirective: HasFocus['directive'];
246
+ /**
247
+ * Directive that enables dynamic positioning of menu element
248
+ */
249
+ floatingDirective: FloatingUI['directives']['floatingDirective'];
250
+ /**
251
+ * A directive to be applied to the input group element serves as the base for menu positioning
252
+ */
253
+ referenceDirective: FloatingUI['directives']['referenceDirective'];
254
+ /**
255
+ * A directive to be applied to the element that contains the badges and the input
256
+ */
257
+ inputContainerDirective: Directive;
258
+ /**
259
+ * A directive that applies all the necessary attributes to the container badges
260
+ */
261
+ badgeAttributesDirective: Directive<ItemContext<Item>>;
262
+ /**
263
+ * A directive that applies all the necessary attributes to the dropdown menu
264
+ */
265
+ menuAttributesDirective: Directive;
266
+ /**
267
+ * A directive that applies all the necessary attributes to the dropdown item
268
+ */
269
+ itemAttributesDirective: Directive<ItemContext<Item>>;
270
+ }
271
+ export interface SelectActions<Item> {
272
+ /**
273
+ * Method to be plugged to on the 'input' event. The input text will be used as the filter text.
274
+ */
275
+ onInput: (e: {
276
+ target: any;
277
+ }) => void;
278
+ /**
279
+ * Method to be attached to the node element to close a badge on click.
280
+ */
281
+ onRemoveBadgeClick: (event: MouseEvent, item: Item) => void;
282
+ /**
283
+ * Method to be plugged to on an keydown event of the main input, in order to control the keyboard interactions with the highlighted item.
284
+ * It manages arrow keys to move the highlighted item, or enter to toggle the item.
285
+ */
286
+ onInputKeydown: (event: KeyboardEvent) => void;
287
+ /**
288
+ * Method to be plugged to on an keydown event of a badge container, in order to manage main actions on badges.
289
+ */
290
+ onBadgeKeydown: (event: KeyboardEvent, item: Item) => void;
291
+ }
@@ -99,11 +99,20 @@ export declare class SliderComponent extends BaseWidgetDirective<SliderWidget> i
99
99
  * Event payload equals to the updated slider values
100
100
  */
101
101
  valuesChange: EventEmitter<number[]>;
102
- slotLabel: SlotContent<SliderSlotLabelContext>;
102
+ /**
103
+ * Slot to change the default labels of the slider
104
+ */
105
+ label: SlotContent<SliderSlotLabelContext>;
103
106
  slotLabelFromContent: SliderLabelDirective | undefined;
104
- slotStructure: SlotContent<SliderContext>;
107
+ /**
108
+ * Slot to change the default display of the slider
109
+ */
110
+ structure: SlotContent<SliderContext>;
105
111
  slotStructureFromContent: SliderStructureDirective | undefined;
106
- slotHandle: SlotContent<SliderSlotHandleContext>;
112
+ /**
113
+ * Slot to change the handlers
114
+ */
115
+ handle: SlotContent<SliderSlotHandleContext>;
107
116
  slotHandleFromContent: SliderHandleDirective | undefined;
108
117
  /**
109
118
  * Control value accessor methods
@@ -117,7 +126,7 @@ export declare class SliderComponent extends BaseWidgetDirective<SliderWidget> i
117
126
  handleBlur(): void;
118
127
  ngAfterContentChecked(): void;
119
128
  static ɵfac: i0.ɵɵFactoryDeclaration<SliderComponent, never>;
120
- static ɵcmp: i0.ɵɵComponentDeclaration<SliderComponent, "[auSlider]", never, { "className": { "alias": "auClassName"; "required": false; }; "min": { "alias": "auMin"; "required": false; }; "max": { "alias": "auMax"; "required": false; }; "stepSize": { "alias": "auStepSize"; "required": false; }; "values": { "alias": "auValues"; "required": false; }; "rtl": { "alias": "auRtl"; "required": false; }; "showValueLabels": { "alias": "auShowValueLabels"; "required": false; }; "showMinMaxLabels": { "alias": "auShowMinMaxLabels"; "required": false; }; "ariaLabelHandle": { "alias": "auAriaLabelHandle"; "required": false; }; "ariaValueText": { "alias": "auAriaValueText"; "required": false; }; "readonly": { "alias": "auReadonly"; "required": false; }; "disabled": { "alias": "auDisabled"; "required": false; }; "vertical": { "alias": "auVertical"; "required": false; }; "slotLabel": { "alias": "auSlotLabel"; "required": false; }; "slotStructure": { "alias": "auSlotStructure"; "required": false; }; "slotHandle": { "alias": "auSlotHandle"; "required": false; }; }, { "valuesChange": "auValuesChange"; }, ["slotLabelFromContent", "slotStructureFromContent", "slotHandleFromContent"], never, true, never>;
129
+ static ɵcmp: i0.ɵɵComponentDeclaration<SliderComponent, "[auSlider]", never, { "className": { "alias": "auClassName"; "required": false; }; "min": { "alias": "auMin"; "required": false; }; "max": { "alias": "auMax"; "required": false; }; "stepSize": { "alias": "auStepSize"; "required": false; }; "values": { "alias": "auValues"; "required": false; }; "rtl": { "alias": "auRtl"; "required": false; }; "showValueLabels": { "alias": "auShowValueLabels"; "required": false; }; "showMinMaxLabels": { "alias": "auShowMinMaxLabels"; "required": false; }; "ariaLabelHandle": { "alias": "auAriaLabelHandle"; "required": false; }; "ariaValueText": { "alias": "auAriaValueText"; "required": false; }; "readonly": { "alias": "auReadonly"; "required": false; }; "disabled": { "alias": "auDisabled"; "required": false; }; "vertical": { "alias": "auVertical"; "required": false; }; "label": { "alias": "auLabel"; "required": false; }; "structure": { "alias": "auStructure"; "required": false; }; "handle": { "alias": "auHandle"; "required": false; }; }, { "valuesChange": "auValuesChange"; }, ["slotLabelFromContent", "slotStructureFromContent", "slotHandleFromContent"], never, true, never>;
121
130
  static ngAcceptInputType_min: unknown;
122
131
  static ngAcceptInputType_max: unknown;
123
132
  static ngAcceptInputType_stepSize: unknown;
@@ -1,9 +1,5 @@
1
- import type { AdaptWidgetSlots, WidgetProps, WidgetState, AdaptSlotContentProps, WidgetFactory } from '@agnos-ui/angular-headless';
2
- export * from '@agnos-ui/core-bootstrap/components/slider';
3
- export type SliderWidget = AdaptWidgetSlots<import('@agnos-ui/core-bootstrap/components/slider').SliderWidget>;
4
- export type SliderProps = WidgetProps<SliderWidget>;
5
- export type SliderState = WidgetState<SliderWidget>;
6
- export type SliderContext = AdaptSlotContentProps<import('@agnos-ui/core-bootstrap/components/slider').SliderContext>;
7
- export type SliderSlotLabelContext = AdaptSlotContentProps<import('@agnos-ui/core-bootstrap/components/slider').SliderSlotLabelContext>;
8
- export type SliderSlotHandleContext = AdaptSlotContentProps<import('@agnos-ui/core-bootstrap/components/slider').SliderSlotHandleContext>;
1
+ import type { WidgetFactory } from '@agnos-ui/angular-headless';
2
+ import type { SliderProps, SliderWidget } from './slider.gen';
3
+ export type * from './slider.gen';
9
4
  export declare const createSlider: WidgetFactory<SliderWidget>;
5
+ export declare const getSliderDefaultConfig: () => SliderProps;