@agnos-ui/angular-bootstrap 0.4.4 → 0.5.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 (56) hide show
  1. package/README.md +2 -2
  2. package/agnos-ui-angular.module.d.ts +2 -1
  3. package/components/accordion/accordion.component.d.ts +40 -18
  4. package/components/accordion/accordion.gen.d.ts +37 -9
  5. package/components/alert/alert.component.d.ts +29 -17
  6. package/components/alert/alert.gen.d.ts +21 -2
  7. package/components/collapse/collapse.component.d.ts +79 -0
  8. package/components/collapse/collapse.gen.d.ts +146 -0
  9. package/components/collapse/index.d.ts +2 -0
  10. package/components/modal/modal.component.d.ts +13 -19
  11. package/components/modal/modal.gen.d.ts +35 -18
  12. package/components/modal/modal.service.d.ts +5 -1
  13. package/components/pagination/pagination.component.d.ts +20 -15
  14. package/components/pagination/pagination.gen.d.ts +49 -29
  15. package/components/progressbar/progressbar.component.d.ts +32 -16
  16. package/components/progressbar/progressbar.gen.d.ts +21 -4
  17. package/components/rating/rating.component.d.ts +11 -4
  18. package/components/rating/rating.gen.d.ts +25 -17
  19. package/components/select/select.component.d.ts +24 -4
  20. package/components/select/select.gen.d.ts +41 -25
  21. package/components/slider/slider.component.d.ts +32 -23
  22. package/components/slider/slider.gen.d.ts +54 -33
  23. package/components/toast/toast.component.d.ts +29 -17
  24. package/components/toast/toast.gen.d.ts +22 -2
  25. package/config.d.ts +16 -5
  26. package/config.gen.d.ts +5 -0
  27. package/esm2022/agnos-ui-angular.module.mjs +12 -5
  28. package/esm2022/components/accordion/accordion.component.mjs +165 -134
  29. package/esm2022/components/accordion/accordion.gen.mjs +1 -1
  30. package/esm2022/components/alert/alert.component.mjs +90 -65
  31. package/esm2022/components/alert/alert.gen.mjs +1 -1
  32. package/esm2022/components/collapse/collapse.component.mjs +89 -0
  33. package/esm2022/components/collapse/collapse.gen.mjs +15 -0
  34. package/esm2022/components/collapse/index.mjs +3 -0
  35. package/esm2022/components/modal/modal.component.mjs +111 -99
  36. package/esm2022/components/modal/modal.gen.mjs +1 -1
  37. package/esm2022/components/modal/modal.service.mjs +7 -5
  38. package/esm2022/components/pagination/pagination.component.mjs +138 -123
  39. package/esm2022/components/pagination/pagination.gen.mjs +1 -1
  40. package/esm2022/components/progressbar/progressbar.component.mjs +94 -55
  41. package/esm2022/components/progressbar/progressbar.gen.mjs +1 -1
  42. package/esm2022/components/rating/rating.component.mjs +41 -35
  43. package/esm2022/components/rating/rating.gen.mjs +1 -1
  44. package/esm2022/components/select/select.component.mjs +103 -118
  45. package/esm2022/components/select/select.gen.mjs +1 -1
  46. package/esm2022/components/slider/slider.component.mjs +126 -111
  47. package/esm2022/components/slider/slider.gen.mjs +1 -1
  48. package/esm2022/components/toast/toast.component.mjs +106 -81
  49. package/esm2022/components/toast/toast.gen.mjs +1 -1
  50. package/esm2022/config.gen.mjs +1 -1
  51. package/esm2022/config.mjs +17 -1
  52. package/esm2022/index.mjs +2 -1
  53. package/fesm2022/agnos-ui-angular-bootstrap.mjs +1085 -806
  54. package/fesm2022/agnos-ui-angular-bootstrap.mjs.map +1 -1
  55. package/index.d.ts +8 -7
  56. package/package.json +9 -8
@@ -1,18 +1,25 @@
1
1
  import type { SlotContent } from '@agnos-ui/angular-headless';
2
2
  import { BaseWidgetDirective } from '@agnos-ui/angular-headless';
3
- import type { AfterContentChecked } from '@angular/core';
4
3
  import { EventEmitter, TemplateRef } from '@angular/core';
5
4
  import type { ControlValueAccessor } from '@angular/forms';
6
5
  import type { RatingWidget, StarContext } from './rating.gen';
7
6
  import * as i0 from "@angular/core";
7
+ /**
8
+ * Directive to represent a rating star.
9
+ *
10
+ * This directive uses a template reference to render the {@link StarContext}.
11
+ */
8
12
  export declare class RatingStarDirective {
9
13
  templateRef: TemplateRef<any>;
10
14
  static ngTemplateContextGuard(_dir: RatingStarDirective, context: unknown): context is StarContext;
11
15
  static ɵfac: i0.ɵɵFactoryDeclaration<RatingStarDirective, never>;
12
16
  static ɵdir: i0.ɵɵDirectiveDeclaration<RatingStarDirective, "ng-template[auRatingStar]", never, {}, {}, never, never, true, never>;
13
17
  }
14
- export declare class RatingComponent extends BaseWidgetDirective<RatingWidget> implements ControlValueAccessor, AfterContentChecked {
15
- readonly _widget: import("@agnos-ui/angular-headless").AngularWidget<RatingWidget>;
18
+ /**
19
+ * The `RatingComponent` is an Angular component that allows users to provide a rating.
20
+ * It extends `BaseWidgetDirective` and implements `ControlValueAccessor` to integrate with Angular forms.
21
+ */
22
+ export declare class RatingComponent extends BaseWidgetDirective<RatingWidget> implements ControlValueAccessor {
16
23
  onChange: (_: any) => void;
17
24
  onTouched: () => void;
18
25
  /**
@@ -130,7 +137,7 @@ export declare class RatingComponent extends BaseWidgetDirective<RatingWidget> i
130
137
  registerOnChange(fn: (value: any) => any): void;
131
138
  registerOnTouched(fn: () => any): void;
132
139
  setDisabledState(disabled: boolean): void;
133
- ngAfterContentChecked(): void;
140
+ constructor();
134
141
  trackByIndex(index: number): number;
135
142
  static ɵfac: i0.ɵɵFactoryDeclaration<RatingComponent, never>;
136
143
  static ɵcmp: i0.ɵɵComponentDeclaration<RatingComponent, "[auRating]", never, { "ariaValueTextFn": { "alias": "auAriaValueTextFn"; "required": false; }; "disabled": { "alias": "auDisabled"; "required": false; }; "maxRating": { "alias": "auMaxRating"; "required": false; }; "rating": { "alias": "auRating"; "required": false; }; "readonly": { "alias": "auReadonly"; "required": false; }; "resettable": { "alias": "auResettable"; "required": false; }; "star": { "alias": "auStar"; "required": false; }; "tabindex": { "alias": "auTabindex"; "required": false; }; "className": { "alias": "auClassName"; "required": false; }; "ariaLabel": { "alias": "auAriaLabel"; "required": false; }; "ariaLabelledBy": { "alias": "auAriaLabelledBy"; "required": false; }; }, { "hover": "auHover"; "leave": "auLeave"; "ratingChange": "auRatingChange"; }, ["slotStarFromContent"], never, true, never>;
@@ -5,6 +5,9 @@ import type { SlotContent, Widget, WidgetFactory, Directive } from '@agnos-ui/an
5
5
  */
6
6
  declare const export_getRatingDefaultConfig: () => RatingProps;
7
7
  export { export_getRatingDefaultConfig as getRatingDefaultConfig };
8
+ /**
9
+ * Represents the state of a rating component.
10
+ */
8
11
  export interface RatingState {
9
12
  /**
10
13
  * the aria value of the rating
@@ -89,6 +92,9 @@ export interface RatingState {
89
92
  */
90
93
  star: SlotContent<StarContext>;
91
94
  }
95
+ /**
96
+ * Represents the properties for the Rating component.
97
+ */
92
98
  export interface RatingProps {
93
99
  /**
94
100
  * Return the value for the 'aria-valuetext' attribute.
@@ -201,7 +207,10 @@ export interface RatingProps {
201
207
  */
202
208
  star: SlotContent<StarContext>;
203
209
  }
204
- export type RatingWidget = Widget<RatingProps, RatingState, object, RatingActions, RatingDirectives>;
210
+ /**
211
+ * Represents a Rating Widget component.
212
+ */
213
+ export type RatingWidget = Widget<RatingProps, RatingState, RatingApi, RatingDirectives>;
205
214
  /**
206
215
  * Create a RatingWidget with given config props
207
216
  * @param config - an optional rating config
@@ -209,6 +218,9 @@ export type RatingWidget = Widget<RatingProps, RatingState, object, RatingAction
209
218
  */
210
219
  declare const export_createRating: WidgetFactory<RatingWidget>;
211
220
  export { export_createRating as createRating };
221
+ /**
222
+ * Represents the context for a star in a rating component.
223
+ */
212
224
  export interface StarContext {
213
225
  /**
214
226
  * indicates how much the current star is filled, from 0 to 100
@@ -219,6 +231,9 @@ export interface StarContext {
219
231
  */
220
232
  index: number;
221
233
  }
234
+ /**
235
+ * Interface representing directives for a rating component.
236
+ */
222
237
  export interface RatingDirectives {
223
238
  /**
224
239
  * A directive to be applied to the main container
@@ -232,31 +247,24 @@ export interface RatingDirectives {
232
247
  index: number;
233
248
  }>;
234
249
  }
235
- export interface RatingActions {
250
+ /**
251
+ * Interface representing the API that can be performed on a rating component.
252
+ */
253
+ export interface RatingApi {
236
254
  /**
237
- * Method to be used when a star is clicked.
255
+ * Sets the rating value.
238
256
  *
239
- * To be used in the onclick event of a star
240
257
  * @param index - Star index, starting from 1
241
258
  */
242
- click(index: number): void;
259
+ setRating(index: number): void;
243
260
  /**
244
- * Method to be used when the mouse enter in a star.
261
+ * Sets the hovered rating value.
245
262
  *
246
- * To be used in the onmouseenter of a star
247
263
  * @param index - Star index, starting from 1
248
264
  */
249
- hover(index: number): void;
265
+ setHoveredRating(index: number): void;
250
266
  /**
251
- * Method to be used when the mouse leave the widget.
252
- *
253
- * To be used in the onmouseleave of the rating container
267
+ * Leave the rating, resetting the visible rating to the rating value and triggering the onLeave callback
254
268
  */
255
269
  leave(): void;
256
- /**
257
- * Method to be used to handle the keyboard.
258
- *
259
- * To be used in the onkeydown of the rating container
260
- */
261
- handleKey(event: KeyboardEvent): void;
262
270
  }
@@ -1,23 +1,44 @@
1
1
  import type { SlotContent } from '@agnos-ui/angular-headless';
2
2
  import { BaseWidgetDirective } from '@agnos-ui/angular-headless';
3
- import type { AfterContentChecked } from '@angular/core';
4
3
  import { EventEmitter, TemplateRef } from '@angular/core';
5
4
  import type { Placement } from '@floating-ui/dom';
6
5
  import type { ItemContext, SelectItemContext, SelectWidget } from './select.gen';
7
6
  import * as i0 from "@angular/core";
7
+ /**
8
+ * Directive to provide a custom template for the badge label in a select component.
9
+ *
10
+ * @template Item - The type of the item in the select component.
11
+ *
12
+ * This directive uses a template reference to render the {@link SelectItemContext<Item>}.
13
+ */
8
14
  export declare class SelectBadgeLabelDirective<Item> {
9
15
  templateRef: TemplateRef<any>;
10
16
  static ngTemplateContextGuard<Item>(_dir: SelectBadgeLabelDirective<Item>, context: unknown): context is SelectItemContext<Item>;
11
17
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectBadgeLabelDirective<any>, never>;
12
18
  static ɵdir: i0.ɵɵDirectiveDeclaration<SelectBadgeLabelDirective<any>, "ng-template[auSelectBadgeLabel]", never, {}, {}, never, never, true, never>;
13
19
  }
20
+ /**
21
+ * Directive to provide a custom label template for select items.
22
+ *
23
+ * This directive allows you to define a custom template for the labels of items
24
+ * in a select component. The template can be specified using an Angular `TemplateRef`.
25
+ *
26
+ * @template Item - The type of the items in the select component.
27
+ *
28
+ * This directive uses a template reference to render the {@link SelectItemContext<Item>}.
29
+ */
14
30
  export declare class SelectItemLabelDirective<Item> {
15
31
  templateRef: TemplateRef<any>;
16
32
  static ngTemplateContextGuard<Item>(_dir: SelectItemLabelDirective<Item>, context: unknown): context is SelectItemContext<Item>;
17
33
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectItemLabelDirective<any>, never>;
18
34
  static ɵdir: i0.ɵɵDirectiveDeclaration<SelectItemLabelDirective<any>, "ng-template[auSelectItemLabel]", never, {}, {}, never, never, true, never>;
19
35
  }
20
- export declare class SelectComponent<Item> extends BaseWidgetDirective<SelectWidget<Item>> implements AfterContentChecked {
36
+ /**
37
+ * A component that represents a customizable select dropdown widget.
38
+ *
39
+ * @template Item - The type of items in the select dropdown.
40
+ */
41
+ export declare class SelectComponent<Item> extends BaseWidgetDirective<SelectWidget<Item>> {
21
42
  /**
22
43
  * aria-label used for the input inside the select
23
44
  *
@@ -170,9 +191,8 @@ export declare class SelectComponent<Item> extends BaseWidgetDirective<SelectWid
170
191
  * ```
171
192
  */
172
193
  navSelector: ((node: HTMLElement) => NodeListOf<HTMLSpanElement | HTMLInputElement>) | undefined;
173
- readonly _widget: import("@agnos-ui/angular-headless").AngularWidget<SelectWidget<Item>>;
194
+ constructor();
174
195
  itemCtxTrackBy(_: number, itemContext: ItemContext<Item>): string;
175
- ngAfterContentChecked(): void;
176
196
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent<any>, never>;
177
197
  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>;
178
198
  static ngAcceptInputType_open: unknown;
@@ -7,15 +7,28 @@ import type { Placement } from '@floating-ui/dom';
7
7
  declare const export_getSelectDefaultConfig: () => SelectProps<any>;
8
8
  export { export_getSelectDefaultConfig as getSelectDefaultConfig };
9
9
  /**
10
- * A type for the slot context of the pagination widget
10
+ * Interface for the slot context of the pagination widget
11
+ * @template Item - The type of the items in the Select component.
11
12
  */
12
- export type SelectContext<Item> = WidgetSlotContext<SelectWidget<Item>>;
13
- export type SelectItemContext<Item> = SelectContext<Item> & {
13
+ export interface SelectContext<Item> extends WidgetSlotContext<SelectWidget<Item>> {
14
+ }
15
+ /**
16
+ * Represents the context for a select item, extending the base `SelectContext` with additional
17
+ * contextual data specific to an item.
18
+ *
19
+ * @template Item - The type of the item within the select context.
20
+ */
21
+ export interface SelectItemContext<Item> extends SelectContext<Item> {
14
22
  /**
15
23
  * Contextual data related to an item
16
24
  */
17
25
  itemContext: ItemContext<Item>;
18
- };
26
+ }
27
+ /**
28
+ * Represents the state of a Select component.
29
+ *
30
+ * @template Item - The type of the items in the select component.
31
+ */
19
32
  export interface SelectState<Item> {
20
33
  /**
21
34
  * List of item contexts, to be displayed in the menu
@@ -119,6 +132,11 @@ export interface SelectState<Item> {
119
132
  */
120
133
  itemLabel: SlotContent<SelectItemContext<Item>>;
121
134
  }
135
+ /**
136
+ * Represents the properties for the Select component.
137
+ *
138
+ * @template Item - The type of the items in the select component.
139
+ */
122
140
  export interface SelectProps<Item> {
123
141
  /**
124
142
  * List of available items for the dropdown
@@ -271,7 +289,12 @@ export interface SelectProps<Item> {
271
289
  */
272
290
  itemLabel: SlotContent<SelectItemContext<Item>>;
273
291
  }
274
- export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, SelectApi<Item>, SelectActions<Item>, SelectDirectives<Item>>;
292
+ /**
293
+ * Represents a Select widget component.
294
+ *
295
+ * @template Item - The type of the items that the select widget will handle.
296
+ */
297
+ export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, SelectApi<Item>, SelectDirectives<Item>>;
275
298
  /**
276
299
  * Creates a new select widget instance.
277
300
  * @param config - config of the modal, either as a store or as an object containing values or stores.
@@ -279,6 +302,9 @@ export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, Se
279
302
  */
280
303
  declare const export_createSelect: <Item>(config?: PropsConfig<SelectProps<Item>>) => SelectWidget<Item>;
281
304
  export { export_createSelect as createSelect };
305
+ /**
306
+ * Item representation built from the items provided in parameters
307
+ */
282
308
  export interface ItemContext<T> {
283
309
  /**
284
310
  * Original item given in the parameters
@@ -293,6 +319,9 @@ export interface ItemContext<T> {
293
319
  */
294
320
  selected: boolean;
295
321
  }
322
+ /**
323
+ * Interface representing the API for a Select component.
324
+ */
296
325
  export interface SelectApi<Item> {
297
326
  /**
298
327
  * Clear all the selected items
@@ -355,6 +384,9 @@ export interface SelectApi<Item> {
355
384
  */
356
385
  toggle(isOpen?: boolean): void;
357
386
  }
387
+ /**
388
+ * Interface representing the directives used in the Select component.
389
+ */
358
390
  export interface SelectDirectives<Item> {
359
391
  /**
360
392
  * Directive to be used in the input group and the menu containers
@@ -384,28 +416,12 @@ export interface SelectDirectives<Item> {
384
416
  * A directive that applies all the necessary attributes to the dropdown item
385
417
  */
386
418
  itemAttributesDirective: Directive<ItemContext<Item>>;
387
- }
388
- export interface SelectActions<Item> {
389
419
  /**
390
- * Method to be plugged to on the 'input' event. The input text will be used as the filter text.
420
+ * A directive to be applied to the input
391
421
  */
392
- onInput: (e: {
393
- target: any;
394
- }) => void;
422
+ inputDirective: Directive;
395
423
  /**
396
- * Method to be attached to the node element to close a badge on click.
397
- */
398
- onRemoveBadgeClick: (event: MouseEvent, item: Item) => void;
399
- /**
400
- * Method to be plugged to on an keydown event of the main input, in order to control the keyboard interactions with the highlighted item.
401
- * It manages arrow keys to move the highlighted item, or enter to toggle the item.
402
- */
403
- onInputKeydown: (event: KeyboardEvent) => void;
404
- /**
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
424
+ * A directive to be applied to a button that closes a badge
409
425
  */
410
- onBadgeKeydown: (event: KeyboardEvent, item: Item) => void;
426
+ badgeCloseButtonDirective: Directive<ItemContext<Item>>;
411
427
  }
@@ -1,46 +1,55 @@
1
1
  import type { SlotContent } from '@agnos-ui/angular-headless';
2
- import { BaseWidgetDirective, ComponentTemplate } from '@agnos-ui/angular-headless';
3
- import { type WritableSignal } from '@amadeus-it-group/tansu';
4
- import type { AfterContentChecked } from '@angular/core';
2
+ import { BaseWidgetDirective } from '@agnos-ui/angular-headless';
5
3
  import { EventEmitter, TemplateRef } from '@angular/core';
6
- import type { SliderContext, SliderProps, SliderSlotHandleContext, SliderSlotLabelContext, SliderWidget } from './slider.gen';
4
+ import type { SliderContext, SliderSlotHandleContext, SliderSlotLabelContext, SliderWidget } from './slider.gen';
7
5
  import * as i0 from "@angular/core";
6
+ /**
7
+ * Directive to provide a template reference for slider labels.
8
+ *
9
+ * This directive uses a template reference to render the {@link SliderSlotLabelContext}.
10
+ */
8
11
  export declare class SliderLabelDirective {
9
12
  templateRef: TemplateRef<any>;
10
13
  static ngTemplateContextGuard(_dir: SliderLabelDirective, context: unknown): context is SliderSlotLabelContext;
11
14
  static ɵfac: i0.ɵɵFactoryDeclaration<SliderLabelDirective, never>;
12
15
  static ɵdir: i0.ɵɵDirectiveDeclaration<SliderLabelDirective, "ng-template[auSliderLabel]", never, {}, {}, never, never, true, never>;
13
16
  }
17
+ /**
18
+ * Directive representing a handle for a slider component.
19
+ *
20
+ * This directive uses a template reference to render the {@link SliderSlotLabelContext}.
21
+ */
14
22
  export declare class SliderHandleDirective {
15
23
  templateRef: TemplateRef<any>;
16
24
  static ngTemplateContextGuard(_dir: SliderHandleDirective, context: unknown): context is SliderSlotHandleContext;
17
25
  static ɵfac: i0.ɵɵFactoryDeclaration<SliderHandleDirective, never>;
18
26
  static ɵdir: i0.ɵɵDirectiveDeclaration<SliderHandleDirective, "ng-template[auSliderHandle]", never, {}, {}, never, never, true, never>;
19
27
  }
20
- export declare class SliderDefaultHandleSlotComponent {
21
- private readonly _zone;
22
- readonly handle: TemplateRef<SliderSlotHandleContext>;
23
- onKeyDown(event: KeyboardEvent, handleId: number, widgetOnKeyDownFn: (event: KeyboardEvent, handleId: number) => void): void;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<SliderDefaultHandleSlotComponent, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<SliderDefaultHandleSlotComponent, "ng-component", never, {}, {}, never, never, true, never>;
26
- }
27
- export declare const sliderDefaultSlotHandle: ComponentTemplate<unknown, "handle", SliderDefaultHandleSlotComponent>;
28
+ /**
29
+ * A constant representing the default slot handle for the slider component.
30
+ */
31
+ export declare const sliderDefaultSlotHandle: SlotContent<SliderSlotHandleContext>;
32
+ /**
33
+ * Directive that provides structure for the slider component.
34
+ *
35
+ * This directive uses a `TemplateRef` to handle the context of the slider slot.
36
+ */
28
37
  export declare class SliderStructureDirective {
29
38
  templateRef: TemplateRef<any>;
30
39
  static ngTemplateContextGuard(_dir: SliderStructureDirective, context: unknown): context is SliderSlotHandleContext;
31
40
  static ɵfac: i0.ɵɵFactoryDeclaration<SliderStructureDirective, never>;
32
41
  static ɵdir: i0.ɵɵDirectiveDeclaration<SliderStructureDirective, "ng-template[auSliderStructure]", never, {}, {}, never, never, true, never>;
33
42
  }
34
- export declare class SliderDefaultStructureSlotComponent {
35
- structure: TemplateRef<SliderContext>;
36
- static ɵfac: i0.ɵɵFactoryDeclaration<SliderDefaultStructureSlotComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<SliderDefaultStructureSlotComponent, "ng-component", never, {}, {}, never, never, true, never>;
38
- }
39
- export declare const sliderDefaultSlotStructure: ComponentTemplate<unknown, "structure", SliderDefaultStructureSlotComponent>;
40
- export type PartialSliderProps = Partial<SliderProps>;
41
- export declare class SliderComponent extends BaseWidgetDirective<SliderWidget> implements AfterContentChecked {
42
- readonly defaultSlots: WritableSignal<PartialSliderProps>;
43
- readonly _widget: import("@agnos-ui/angular-headless").AngularWidget<SliderWidget>;
43
+ /**
44
+ * Represents the default slot structure for the slider component.
45
+ */
46
+ export declare const sliderDefaultSlotStructure: SlotContent<SliderContext>;
47
+ /**
48
+ * SliderComponent is an Angular component that extends the BaseWidgetDirective
49
+ * to provide a customizable slider widget. This component allows for various
50
+ * configurations and customizations through its inputs and outputs.
51
+ */
52
+ export declare class SliderComponent extends BaseWidgetDirective<SliderWidget> {
44
53
  /**
45
54
  * CSS classes to be applied on the widget main container
46
55
  *
@@ -162,6 +171,7 @@ export declare class SliderComponent extends BaseWidgetDirective<SliderWidget> i
162
171
  */
163
172
  handle: SlotContent<SliderSlotHandleContext>;
164
173
  slotHandleFromContent: SliderHandleDirective | undefined;
174
+ constructor();
165
175
  /**
166
176
  * Control value accessor methods
167
177
  */
@@ -172,7 +182,6 @@ export declare class SliderComponent extends BaseWidgetDirective<SliderWidget> i
172
182
  writeValue(value: any): void;
173
183
  setDisabledState(isDisabled: boolean): void;
174
184
  handleBlur(): void;
175
- ngAfterContentChecked(): void;
176
185
  static ɵfac: i0.ɵɵFactoryDeclaration<SliderComponent, never>;
177
186
  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>;
178
187
  static ngAcceptInputType_min: unknown;
@@ -5,13 +5,35 @@ import type { WidgetSlotContext, SlotContent, Widget, WidgetFactory, Directive }
5
5
  */
6
6
  declare const export_getSliderDefaultConfig: () => SliderProps;
7
7
  export { export_getSliderDefaultConfig as getSliderDefaultConfig };
8
- export type SliderContext = WidgetSlotContext<SliderWidget>;
9
- export type SliderSlotLabelContext = SliderContext & {
8
+ /**
9
+ * Represents the context for a Slider component.
10
+ * This type is an alias for `WidgetSlotContext<SliderWidget>`.
11
+ */
12
+ export interface SliderContext extends WidgetSlotContext<SliderWidget> {
13
+ }
14
+ /**
15
+ * Represents the context for a slider slot label, extending the base `SliderContext`
16
+ * with an additional `value` property.
17
+ */
18
+ export interface SliderSlotLabelContext extends SliderContext {
19
+ /**
20
+ * the value of the handle the label is attached to
21
+ */
10
22
  value: number;
11
- };
12
- export type SliderSlotHandleContext = SliderContext & {
23
+ }
24
+ /**
25
+ * Represents the context for a slider slot handle.
26
+ * This type extends the `SliderContext` and includes an additional `item` property of type `SliderHandle`.
27
+ */
28
+ export interface SliderSlotHandleContext extends SliderContext {
29
+ /**
30
+ * the handle context
31
+ */
13
32
  item: SliderHandle;
14
- };
33
+ }
34
+ /**
35
+ * Represents the state of a slider component.
36
+ */
15
37
  export interface SliderState {
16
38
  /**
17
39
  * Sorted slider values
@@ -137,6 +159,9 @@ export interface SliderState {
137
159
  */
138
160
  handle: SlotContent<SliderSlotHandleContext>;
139
161
  }
162
+ /**
163
+ * Represents the properties for the Slider component.
164
+ */
140
165
  export interface SliderProps {
141
166
  /**
142
167
  * Return the value for the 'aria-label' attribute for the handle
@@ -257,7 +282,10 @@ export interface SliderProps {
257
282
  */
258
283
  handle: SlotContent<SliderSlotHandleContext>;
259
284
  }
260
- export type SliderWidget = Widget<SliderProps, SliderState, SliderApi, SliderActions, SliderDirectives>;
285
+ /**
286
+ * Represents a slider widget component.
287
+ */
288
+ export type SliderWidget = Widget<SliderProps, SliderState, object, SliderDirectives>;
261
289
  /**
262
290
  * Create a Slider with given config props
263
291
  * @param config - an optional slider config
@@ -265,6 +293,9 @@ export type SliderWidget = Widget<SliderProps, SliderState, SliderApi, SliderAct
265
293
  */
266
294
  declare const export_createSlider: WidgetFactory<SliderWidget>;
267
295
  export { export_createSlider as createSlider };
296
+ /**
297
+ * Options for displaying progress in a slider component.
298
+ */
268
299
  export interface ProgressDisplayOptions {
269
300
  /**
270
301
  * Right offset of the progress in %
@@ -291,6 +322,9 @@ export interface ProgressDisplayOptions {
291
322
  */
292
323
  height: number;
293
324
  }
325
+ /**
326
+ * Options for displaying a handle in a slider component.
327
+ */
294
328
  export interface HandleDisplayOptions {
295
329
  /**
296
330
  * Left offset of the handle in %
@@ -301,6 +335,9 @@ export interface HandleDisplayOptions {
301
335
  */
302
336
  top: number | null;
303
337
  }
338
+ /**
339
+ * Represents a handle in a slider component.
340
+ */
304
341
  export interface SliderHandle {
305
342
  /**
306
343
  * Value of the handle
@@ -319,8 +356,9 @@ export interface SliderHandle {
319
356
  */
320
357
  ariaValueText: string;
321
358
  }
322
- export interface SliderApi {
323
- }
359
+ /**
360
+ * Interface representing various directives used in the slider component.
361
+ */
324
362
  export interface SliderDirectives {
325
363
  /**
326
364
  * Directive to get the slider component elementRef
@@ -336,6 +374,14 @@ export interface SliderDirectives {
336
374
  * Directive to apply to the slider clickable area, to directly move the handle to a given specific position
337
375
  */
338
376
  clickableAreaDirective: Directive;
377
+ /**
378
+ * Directive to apply handle events handlers
379
+ */
380
+ handleEventsDirective: Directive<{
381
+ item: {
382
+ id: number;
383
+ };
384
+ }>;
339
385
  /**
340
386
  * Directive to apply to the slider handle if any
341
387
  */
@@ -361,28 +407,3 @@ export interface SliderDirectives {
361
407
  index: number;
362
408
  }>;
363
409
  }
364
- export interface SliderActions {
365
- /**
366
- * Method to handle click on the slider
367
- * @param event - mouse event
368
- */
369
- click(event: MouseEvent): void;
370
- /**
371
- * Method to process the keyboard event
372
- * @param event - keyboard event object
373
- * @param handleNumber - id of the modified handle
374
- */
375
- keydown(event: KeyboardEvent, handleNumber: number): void;
376
- /**
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
380
- */
381
- mouseDown(event: MouseEvent, handleId: number): void;
382
- /**
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
386
- */
387
- touchStart(event: TouchEvent, handleId: number): void;
388
- }
@@ -1,35 +1,48 @@
1
1
  import type { SlotContent, TransitionFn } from '@agnos-ui/angular-headless';
2
- import { BaseWidgetDirective, ComponentTemplate } from '@agnos-ui/angular-headless';
3
- import type { WritableSignal } from '@amadeus-it-group/tansu';
4
- import type { AfterContentChecked } from '@angular/core';
2
+ import { BaseWidgetDirective } from '@agnos-ui/angular-headless';
5
3
  import { EventEmitter, TemplateRef } from '@angular/core';
6
- import type { ToastContext, ToastProps, ToastWidget } from './toast.gen';
4
+ import type { ToastContext, ToastWidget } from './toast.gen';
7
5
  import * as i0 from "@angular/core";
6
+ /**
7
+ * Directive to represent the body of a toast notification.
8
+ * This directive uses a template reference to render the {@link ToastContext}.
9
+ */
8
10
  export declare class ToastBodyDirective {
9
11
  templateRef: TemplateRef<any>;
10
- static ngTemplateContextGuard(dir: ToastBodyDirective, context: unknown): context is ToastContext;
12
+ static ngTemplateContextGuard(_dir: ToastBodyDirective, context: unknown): context is ToastContext;
11
13
  static ɵfac: i0.ɵɵFactoryDeclaration<ToastBodyDirective, never>;
12
14
  static ɵdir: i0.ɵɵDirectiveDeclaration<ToastBodyDirective, "ng-template[auToastBody]", never, {}, {}, never, never, true, never>;
13
15
  }
16
+ /**
17
+ * Directive to define the structure of a toast component.
18
+ * This directive uses a template reference to render the {@link ToastContext}.
19
+ */
14
20
  export declare class ToastStructureDirective {
15
21
  templateRef: TemplateRef<any>;
16
- static ngTemplateContextGuard(dir: ToastStructureDirective, context: unknown): context is ToastContext;
22
+ static ngTemplateContextGuard(_dir: ToastStructureDirective, context: unknown): context is ToastContext;
17
23
  static ɵfac: i0.ɵɵFactoryDeclaration<ToastStructureDirective, never>;
18
24
  static ɵdir: i0.ɵɵDirectiveDeclaration<ToastStructureDirective, "ng-template[auToastStructure]", never, {}, {}, never, never, true, never>;
19
25
  }
26
+ /**
27
+ * Directive representing the header of a toast component.
28
+ * This directive uses a template reference to render the {@link ToastContext}.
29
+ */
20
30
  export declare class ToastHeaderDirective {
21
31
  templateRef: TemplateRef<any>;
22
- static ngTemplateContextGuard(dir: ToastHeaderDirective, context: unknown): context is ToastContext;
32
+ static ngTemplateContextGuard(_dir: ToastHeaderDirective, context: unknown): context is ToastContext;
23
33
  static ɵfac: i0.ɵɵFactoryDeclaration<ToastHeaderDirective, never>;
24
34
  static ɵdir: i0.ɵɵDirectiveDeclaration<ToastHeaderDirective, "ng-template[auToastHeader]", never, {}, {}, never, never, true, never>;
25
35
  }
26
- export declare class ToastDefaultSlotsComponent {
27
- structure: TemplateRef<ToastContext>;
28
- static ɵfac: i0.ɵɵFactoryDeclaration<ToastDefaultSlotsComponent, never>;
29
- static ɵcmp: i0.ɵɵComponentDeclaration<ToastDefaultSlotsComponent, "ng-component", never, {}, {}, never, never, true, never>;
30
- }
31
- export declare const toastDefaultSlotStructure: ComponentTemplate<unknown, "structure", ToastDefaultSlotsComponent>;
32
- export declare class ToastComponent extends BaseWidgetDirective<ToastWidget> implements AfterContentChecked {
36
+ /**
37
+ * Represents the default slot structure for the toast component.
38
+ */
39
+ export declare const toastDefaultSlotStructure: SlotContent<ToastContext>;
40
+ /**
41
+ * The `ToastComponent` is a UI component that displays a toast notification.
42
+ * It extends the `BaseWidgetDirective` and provides various configurable properties
43
+ * and events to control the behavior and appearance of the toast.
44
+ */
45
+ export declare class ToastComponent extends BaseWidgetDirective<ToastWidget> {
33
46
  /**
34
47
  * If `true`, alert can be dismissed by the user.
35
48
  * The close button (×) will be displayed and you can be notified of the event with the (close) output.
@@ -129,15 +142,14 @@ export declare class ToastComponent extends BaseWidgetDirective<ToastWidget> imp
129
142
  * ```
130
143
  */
131
144
  shown: EventEmitter<void>;
132
- readonly defaultSlots: WritableSignal<Partial<ToastProps>>;
133
145
  /**
134
146
  * CSS classes to be applied on the widget main container
135
147
  *
136
148
  * @defaultValue `''`
137
149
  */
138
150
  className: string | undefined;
139
- readonly _widget: import("@agnos-ui/angular-headless").AngularWidget<ToastWidget>;
140
- ngAfterContentChecked(): void;
151
+ slotChildren?: TemplateRef<void>;
152
+ constructor();
141
153
  static ɵfac: i0.ɵɵFactoryDeclaration<ToastComponent, never>;
142
154
  static ɵcmp: i0.ɵɵComponentDeclaration<ToastComponent, "[auToast]", never, { "dismissible": { "alias": "auDismissible"; "required": false; }; "transition": { "alias": "auTransition"; "required": false; }; "visible": { "alias": "auVisible"; "required": false; }; "animatedOnInit": { "alias": "auAnimatedOnInit"; "required": false; }; "animated": { "alias": "auAnimated"; "required": false; }; "autoHide": { "alias": "auAutoHide"; "required": false; }; "delay": { "alias": "auDelay"; "required": false; }; "ariaCloseButtonLabel": { "alias": "auAriaCloseButtonLabel"; "required": false; }; "children": { "alias": "auChildren"; "required": false; }; "structure": { "alias": "auStructure"; "required": false; }; "header": { "alias": "auHeader"; "required": false; }; "className": { "alias": "auClassName"; "required": false; }; }, { "visibleChange": "auVisibleChange"; "hidden": "auHidden"; "shown": "auShown"; }, ["slotDefaultFromContent", "slotStructureFromContent", "slotHeaderFromContent"], ["*"], true, never>;
143
155
  static ngAcceptInputType_dismissible: unknown;