@agnos-ui/angular-bootstrap 0.8.1 → 0.9.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.
- package/fesm2022/agnos-ui-angular-bootstrap.mjs +156 -94
- package/fesm2022/agnos-ui-angular-bootstrap.mjs.map +1 -1
- package/index.d.ts +6450 -40
- package/package.json +5 -5
- package/agnos-ui-angular.module.d.ts +0 -20
- package/components/accordion/accordion.component.d.ts +0 -257
- package/components/accordion/accordion.gen.d.ts +0 -442
- package/components/accordion/index.d.ts +0 -2
- package/components/alert/alert.component.d.ts +0 -140
- package/components/alert/alert.gen.d.ts +0 -191
- package/components/alert/index.d.ts +0 -2
- package/components/carousel/carousel.component.d.ts +0 -207
- package/components/carousel/carousel.gen.d.ts +0 -358
- package/components/carousel/index.d.ts +0 -2
- package/components/collapse/collapse.component.d.ts +0 -83
- package/components/collapse/collapse.gen.d.ts +0 -150
- package/components/collapse/index.d.ts +0 -2
- package/components/modal/index.d.ts +0 -3
- package/components/modal/modal.component.d.ts +0 -220
- package/components/modal/modal.gen.d.ts +0 -355
- package/components/modal/modal.service.d.ts +0 -21
- package/components/pagination/index.d.ts +0 -2
- package/components/pagination/pagination.component.d.ts +0 -379
- package/components/pagination/pagination.gen.d.ts +0 -584
- package/components/progressbar/index.d.ts +0 -2
- package/components/progressbar/progressbar.component.d.ts +0 -118
- package/components/progressbar/progressbar.gen.d.ts +0 -196
- package/components/rating/index.d.ts +0 -2
- package/components/rating/rating.component.d.ts +0 -144
- package/components/rating/rating.gen.d.ts +0 -270
- package/components/select/index.d.ts +0 -2
- package/components/select/select.component.d.ts +0 -198
- package/components/select/select.gen.d.ts +0 -433
- package/components/slider/index.d.ts +0 -2
- package/components/slider/slider.component.d.ts +0 -234
- package/components/slider/slider.gen.d.ts +0 -511
- package/components/toast/index.d.ts +0 -4
- package/components/toast/toast.component.d.ts +0 -155
- package/components/toast/toast.gen.d.ts +0 -308
- package/components/toast/toaster.component.d.ts +0 -17
- package/components/toast/toaster.service.d.ts +0 -7
- package/components/tree/index.d.ts +0 -2
- package/components/tree/tree.component.d.ts +0 -145
- package/components/tree/tree.gen.d.ts +0 -216
- package/config.d.ts +0 -27
- package/config.gen.d.ts +0 -62
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import type { WidgetSlotContext, SlotContent, Widget, WidgetFactory, Directive } from '@agnos-ui/angular-headless';
|
|
2
|
-
import type { BSContextualClass } from '@agnos-ui/core-bootstrap/types';
|
|
3
|
-
/**
|
|
4
|
-
* Retrieve a shallow copy of the default Progressbar config
|
|
5
|
-
* @returns the default Progressbar config
|
|
6
|
-
*/
|
|
7
|
-
declare const export_getProgressbarDefaultConfig: () => ProgressbarProps;
|
|
8
|
-
export { export_getProgressbarDefaultConfig as getProgressbarDefaultConfig };
|
|
9
|
-
/**
|
|
10
|
-
* Represents the context for a Progressbar widget.
|
|
11
|
-
* This interface is used to define the context object that is passed to the Progressbar widget.
|
|
12
|
-
*/
|
|
13
|
-
export interface ProgressbarContext extends WidgetSlotContext<ProgressbarWidget> {
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Represents the state of a Progressbar component.
|
|
17
|
-
*/
|
|
18
|
-
export interface ProgressbarState {
|
|
19
|
-
/**
|
|
20
|
-
* Percentage of completion.
|
|
21
|
-
*/
|
|
22
|
-
percentage: number;
|
|
23
|
-
/**
|
|
24
|
-
* `true` if the value is above its minimum value.
|
|
25
|
-
*/
|
|
26
|
-
started: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* `true` if the value has reached its maximum value.
|
|
29
|
-
*/
|
|
30
|
-
finished: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The aria value text.
|
|
33
|
-
*/
|
|
34
|
-
ariaValueText: string | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* The minimum value.
|
|
37
|
-
*
|
|
38
|
-
* @defaultValue `0`
|
|
39
|
-
*/
|
|
40
|
-
min: number;
|
|
41
|
-
/**
|
|
42
|
-
* The maximum value.
|
|
43
|
-
*
|
|
44
|
-
* @defaultValue `100`
|
|
45
|
-
*/
|
|
46
|
-
max: number;
|
|
47
|
-
/**
|
|
48
|
-
* The current value.
|
|
49
|
-
*
|
|
50
|
-
* @defaultValue `0`
|
|
51
|
-
*/
|
|
52
|
-
value: number;
|
|
53
|
-
/**
|
|
54
|
-
* The aria label.
|
|
55
|
-
*
|
|
56
|
-
* @defaultValue `'Progressbar'`
|
|
57
|
-
*/
|
|
58
|
-
ariaLabel: string;
|
|
59
|
-
/**
|
|
60
|
-
* CSS classes to be applied on the widget main container
|
|
61
|
-
*
|
|
62
|
-
* @defaultValue `''`
|
|
63
|
-
*/
|
|
64
|
-
className: string;
|
|
65
|
-
/**
|
|
66
|
-
* Global template for the Progressbar.
|
|
67
|
-
*/
|
|
68
|
-
structure: SlotContent<ProgressbarContext>;
|
|
69
|
-
/**
|
|
70
|
-
* Label of the progress.
|
|
71
|
-
*/
|
|
72
|
-
children: SlotContent<ProgressbarContext>;
|
|
73
|
-
/**
|
|
74
|
-
* Height of the progressbar, can be any valid css height value.
|
|
75
|
-
*
|
|
76
|
-
* @defaultValue `''`
|
|
77
|
-
*/
|
|
78
|
-
height: string;
|
|
79
|
-
/**
|
|
80
|
-
* If `true`, shows a striped progressbar.
|
|
81
|
-
*
|
|
82
|
-
* @defaultValue `false`
|
|
83
|
-
*/
|
|
84
|
-
striped: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* If `true`, animates a striped progressbar.
|
|
87
|
-
* Takes effect only for browsers supporting CSS3 animations, and if `striped` is `true`.
|
|
88
|
-
*
|
|
89
|
-
* @defaultValue `false`
|
|
90
|
-
*/
|
|
91
|
-
animated: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Type of the progressbar, following bootstrap types.
|
|
94
|
-
*/
|
|
95
|
-
type: BSContextualClass | undefined;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Interface representing the properties for the Progressbar component.
|
|
99
|
-
*/
|
|
100
|
-
export interface ProgressbarProps {
|
|
101
|
-
/**
|
|
102
|
-
* Return the value for the 'aria-valuetext' attribute.
|
|
103
|
-
* @param value - current value
|
|
104
|
-
* @param minimum - minimum value
|
|
105
|
-
* @param maximum - maximum value
|
|
106
|
-
*
|
|
107
|
-
* @defaultValue
|
|
108
|
-
* ```ts
|
|
109
|
-
* () => undefined
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
ariaValueTextFn: (value: number, minimum: number, maximum: number) => string | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* The minimum value.
|
|
115
|
-
*
|
|
116
|
-
* @defaultValue `0`
|
|
117
|
-
*/
|
|
118
|
-
min: number;
|
|
119
|
-
/**
|
|
120
|
-
* The maximum value.
|
|
121
|
-
*
|
|
122
|
-
* @defaultValue `100`
|
|
123
|
-
*/
|
|
124
|
-
max: number;
|
|
125
|
-
/**
|
|
126
|
-
* The current value.
|
|
127
|
-
*
|
|
128
|
-
* @defaultValue `0`
|
|
129
|
-
*/
|
|
130
|
-
value: number;
|
|
131
|
-
/**
|
|
132
|
-
* The aria label.
|
|
133
|
-
*
|
|
134
|
-
* @defaultValue `'Progressbar'`
|
|
135
|
-
*/
|
|
136
|
-
ariaLabel: string;
|
|
137
|
-
/**
|
|
138
|
-
* CSS classes to be applied on the widget main container
|
|
139
|
-
*
|
|
140
|
-
* @defaultValue `''`
|
|
141
|
-
*/
|
|
142
|
-
className: string;
|
|
143
|
-
/**
|
|
144
|
-
* Global template for the Progressbar.
|
|
145
|
-
*/
|
|
146
|
-
structure: SlotContent<ProgressbarContext>;
|
|
147
|
-
/**
|
|
148
|
-
* Label of the progress.
|
|
149
|
-
*/
|
|
150
|
-
children: SlotContent<ProgressbarContext>;
|
|
151
|
-
/**
|
|
152
|
-
* Height of the progressbar, can be any valid css height value.
|
|
153
|
-
*
|
|
154
|
-
* @defaultValue `''`
|
|
155
|
-
*/
|
|
156
|
-
height: string;
|
|
157
|
-
/**
|
|
158
|
-
* If `true`, shows a striped progressbar.
|
|
159
|
-
*
|
|
160
|
-
* @defaultValue `false`
|
|
161
|
-
*/
|
|
162
|
-
striped: boolean;
|
|
163
|
-
/**
|
|
164
|
-
* If `true`, animates a striped progressbar.
|
|
165
|
-
* Takes effect only for browsers supporting CSS3 animations, and if `striped` is `true`.
|
|
166
|
-
*
|
|
167
|
-
* @defaultValue `false`
|
|
168
|
-
*/
|
|
169
|
-
animated: boolean;
|
|
170
|
-
/**
|
|
171
|
-
* Type of the progressbar, following bootstrap types.
|
|
172
|
-
*/
|
|
173
|
-
type: BSContextualClass | undefined;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Represents a Progressbar widget.
|
|
177
|
-
*
|
|
178
|
-
* This type defines the structure of a Progressbar widget, including its properties, state, and directives.
|
|
179
|
-
*/
|
|
180
|
-
export type ProgressbarWidget = Widget<ProgressbarProps, ProgressbarState, object, ProgressbarDirectives>;
|
|
181
|
-
/**
|
|
182
|
-
* Create a Progressbar with given config props
|
|
183
|
-
* @param config - an optional progressbar config
|
|
184
|
-
* @returns a ProgressbarWidget
|
|
185
|
-
*/
|
|
186
|
-
declare const export_createProgressbar: WidgetFactory<ProgressbarWidget>;
|
|
187
|
-
export { export_createProgressbar as createProgressbar };
|
|
188
|
-
/**
|
|
189
|
-
* Interface representing directives for a progress bar component.
|
|
190
|
-
*/
|
|
191
|
-
export interface ProgressbarDirectives {
|
|
192
|
-
/**
|
|
193
|
-
* A directive to be applied to the main container that handles aria attributes.
|
|
194
|
-
*/
|
|
195
|
-
ariaDirective: Directive;
|
|
196
|
-
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import type { SlotContent } from '@agnos-ui/angular-headless';
|
|
2
|
-
import { BaseWidgetDirective } from '@agnos-ui/angular-headless';
|
|
3
|
-
import { TemplateRef } from '@angular/core';
|
|
4
|
-
import type { ControlValueAccessor } from '@angular/forms';
|
|
5
|
-
import type { RatingWidget, StarContext } from './rating.gen';
|
|
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
|
-
*/
|
|
12
|
-
export declare class RatingStarDirective {
|
|
13
|
-
templateRef: TemplateRef<any>;
|
|
14
|
-
static ngTemplateContextGuard(_dir: RatingStarDirective, context: unknown): context is StarContext;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RatingStarDirective, never>;
|
|
16
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RatingStarDirective, "ng-template[auRatingStar]", never, {}, {}, never, never, true, never>;
|
|
17
|
-
}
|
|
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 {
|
|
23
|
-
onChange: (_: any) => void;
|
|
24
|
-
onTouched: () => void;
|
|
25
|
-
/**
|
|
26
|
-
* Return the value for the 'aria-valuetext' attribute.
|
|
27
|
-
* @param rating - Current rating value.
|
|
28
|
-
* @param maxRating - maxRating value.
|
|
29
|
-
*
|
|
30
|
-
* @defaultValue
|
|
31
|
-
* ```ts
|
|
32
|
-
* (rating: number, maxRating: number) => `${rating} out of ${maxRating}`
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
readonly ariaValueTextFn: import("@angular/core").InputSignal<((rating: number, maxRating: number) => string) | undefined>;
|
|
36
|
-
/**
|
|
37
|
-
* If `true`, the rating is disabled.
|
|
38
|
-
*
|
|
39
|
-
* @defaultValue `false`
|
|
40
|
-
*/
|
|
41
|
-
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
42
|
-
/**
|
|
43
|
-
* The maximum rating that can be given.
|
|
44
|
-
*
|
|
45
|
-
* @defaultValue `10`
|
|
46
|
-
*/
|
|
47
|
-
readonly maxRating: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
48
|
-
/**
|
|
49
|
-
* The current rating. Could be a decimal value like `3.75`.
|
|
50
|
-
*
|
|
51
|
-
* @defaultValue `0`
|
|
52
|
-
*/
|
|
53
|
-
readonly rating: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
54
|
-
/**
|
|
55
|
-
* If `true`, the rating can't be changed.
|
|
56
|
-
*
|
|
57
|
-
* @defaultValue `false`
|
|
58
|
-
*/
|
|
59
|
-
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
60
|
-
/**
|
|
61
|
-
* Define if the rating can be reset.
|
|
62
|
-
*
|
|
63
|
-
* If set to true, the user can 'unset' the rating value by cliking on the current rating value.
|
|
64
|
-
*
|
|
65
|
-
* @defaultValue `true`
|
|
66
|
-
*/
|
|
67
|
-
readonly resettable: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
68
|
-
/**
|
|
69
|
-
* The template to override the way each star is displayed.
|
|
70
|
-
*
|
|
71
|
-
* @defaultValue
|
|
72
|
-
* ```ts
|
|
73
|
-
* ({fill}: StarContext) => String.fromCharCode(fill === 100 ? 9733 : 9734)
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
readonly star: import("@angular/core").InputSignal<SlotContent<StarContext>>;
|
|
77
|
-
readonly slotStarFromContent: import("@angular/core").Signal<RatingStarDirective | undefined>;
|
|
78
|
-
/**
|
|
79
|
-
* Allows setting a custom rating tabindex.
|
|
80
|
-
* If the component is disabled, `tabindex` will still be set to `-1`.
|
|
81
|
-
*
|
|
82
|
-
* @defaultValue `0`
|
|
83
|
-
*/
|
|
84
|
-
readonly tabindex: import("@angular/core").InputSignalWithTransform<number | undefined, unknown>;
|
|
85
|
-
/**
|
|
86
|
-
* CSS classes to be applied on the widget main container
|
|
87
|
-
*
|
|
88
|
-
* @defaultValue `''`
|
|
89
|
-
*/
|
|
90
|
-
readonly className: import("@angular/core").InputSignal<string | undefined>;
|
|
91
|
-
/**
|
|
92
|
-
* The aria label
|
|
93
|
-
*
|
|
94
|
-
* @defaultValue `'Rating'`
|
|
95
|
-
*/
|
|
96
|
-
readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
97
|
-
/**
|
|
98
|
-
* The aria labelled by
|
|
99
|
-
*
|
|
100
|
-
* @defaultValue `''`
|
|
101
|
-
*/
|
|
102
|
-
readonly ariaLabelledBy: import("@angular/core").InputSignal<string | undefined>;
|
|
103
|
-
/**
|
|
104
|
-
* An event emitted when the user is hovering over a given rating.
|
|
105
|
-
*
|
|
106
|
-
* Event payload is equal to the rating being hovered over.
|
|
107
|
-
*
|
|
108
|
-
* @defaultValue
|
|
109
|
-
* ```ts
|
|
110
|
-
* () => {}
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
readonly hover: import("@angular/core").OutputEmitterRef<number>;
|
|
114
|
-
/**
|
|
115
|
-
* An event emitted when the user stops hovering over a given rating.
|
|
116
|
-
*
|
|
117
|
-
* Event payload is equal to the rating of the last item being hovered over.
|
|
118
|
-
*
|
|
119
|
-
* @defaultValue
|
|
120
|
-
* ```ts
|
|
121
|
-
* () => {}
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
readonly leave: import("@angular/core").OutputEmitterRef<number>;
|
|
125
|
-
/**
|
|
126
|
-
* An event emitted when the rating is changed.
|
|
127
|
-
*
|
|
128
|
-
* Event payload is equal to the newly selected rating.
|
|
129
|
-
*
|
|
130
|
-
* @defaultValue
|
|
131
|
-
* ```ts
|
|
132
|
-
* () => {}
|
|
133
|
-
* ```
|
|
134
|
-
*/
|
|
135
|
-
readonly ratingChange: import("@angular/core").OutputEmitterRef<number>;
|
|
136
|
-
writeValue(value: any): void;
|
|
137
|
-
registerOnChange(fn: (value: any) => any): void;
|
|
138
|
-
registerOnTouched(fn: () => any): void;
|
|
139
|
-
setDisabledState(disabled: boolean): void;
|
|
140
|
-
constructor();
|
|
141
|
-
trackByIndex(index: number): number;
|
|
142
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RatingComponent, never>;
|
|
143
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RatingComponent, "[auRating]", never, { "ariaValueTextFn": { "alias": "auAriaValueTextFn"; "required": false; "isSignal": true; }; "disabled": { "alias": "auDisabled"; "required": false; "isSignal": true; }; "maxRating": { "alias": "auMaxRating"; "required": false; "isSignal": true; }; "rating": { "alias": "auRating"; "required": false; "isSignal": true; }; "readonly": { "alias": "auReadonly"; "required": false; "isSignal": true; }; "resettable": { "alias": "auResettable"; "required": false; "isSignal": true; }; "star": { "alias": "auStar"; "required": false; "isSignal": true; }; "tabindex": { "alias": "auTabindex"; "required": false; "isSignal": true; }; "className": { "alias": "auClassName"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "auAriaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "auAriaLabelledBy"; "required": false; "isSignal": true; }; }, { "hover": "auHover"; "leave": "auLeave"; "ratingChange": "auRatingChange"; }, ["slotStarFromContent"], never, true, never>;
|
|
144
|
-
}
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import type { SlotContent, Widget, WidgetFactory, Directive } from '@agnos-ui/angular-headless';
|
|
2
|
-
/**
|
|
3
|
-
* Retrieve a shallow copy of the default Rating config
|
|
4
|
-
* @returns the default Rating config
|
|
5
|
-
*/
|
|
6
|
-
declare const export_getRatingDefaultConfig: () => RatingProps;
|
|
7
|
-
export { export_getRatingDefaultConfig as getRatingDefaultConfig };
|
|
8
|
-
/**
|
|
9
|
-
* Represents the state of a rating component.
|
|
10
|
-
*/
|
|
11
|
-
export interface RatingState {
|
|
12
|
-
/**
|
|
13
|
-
* the aria value of the rating
|
|
14
|
-
*/
|
|
15
|
-
ariaValueText: string;
|
|
16
|
-
/**
|
|
17
|
-
* the visible value of the rating (it changes when hovering over the rating even though the real value did not change)
|
|
18
|
-
*/
|
|
19
|
-
visibleRating: number;
|
|
20
|
-
/**
|
|
21
|
-
* is the rating interactive i.e. listening to hover, click and keyboard events
|
|
22
|
-
*/
|
|
23
|
-
interactive: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* the list of stars
|
|
26
|
-
*/
|
|
27
|
-
stars: StarContext[];
|
|
28
|
-
/**
|
|
29
|
-
* The current rating. Could be a decimal value like `3.75`.
|
|
30
|
-
*
|
|
31
|
-
* @defaultValue `0`
|
|
32
|
-
*/
|
|
33
|
-
rating: number;
|
|
34
|
-
/**
|
|
35
|
-
* The maximum rating that can be given.
|
|
36
|
-
*
|
|
37
|
-
* @defaultValue `10`
|
|
38
|
-
*/
|
|
39
|
-
maxRating: number;
|
|
40
|
-
/**
|
|
41
|
-
* If `true`, the rating is disabled.
|
|
42
|
-
*
|
|
43
|
-
* @defaultValue `false`
|
|
44
|
-
*/
|
|
45
|
-
disabled: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* If `true`, the rating can't be changed.
|
|
48
|
-
*
|
|
49
|
-
* @defaultValue `false`
|
|
50
|
-
*/
|
|
51
|
-
readonly: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Define if the rating can be reset.
|
|
54
|
-
*
|
|
55
|
-
* If set to true, the user can 'unset' the rating value by cliking on the current rating value.
|
|
56
|
-
*
|
|
57
|
-
* @defaultValue `true`
|
|
58
|
-
*/
|
|
59
|
-
resettable: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Allows setting a custom rating tabindex.
|
|
62
|
-
* If the component is disabled, `tabindex` will still be set to `-1`.
|
|
63
|
-
*
|
|
64
|
-
* @defaultValue `0`
|
|
65
|
-
*/
|
|
66
|
-
tabindex: number;
|
|
67
|
-
/**
|
|
68
|
-
* The aria label
|
|
69
|
-
*
|
|
70
|
-
* @defaultValue `'Rating'`
|
|
71
|
-
*/
|
|
72
|
-
ariaLabel: string;
|
|
73
|
-
/**
|
|
74
|
-
* The aria labelled by
|
|
75
|
-
*
|
|
76
|
-
* @defaultValue `''`
|
|
77
|
-
*/
|
|
78
|
-
ariaLabelledBy: string;
|
|
79
|
-
/**
|
|
80
|
-
* CSS classes to be applied on the widget main container
|
|
81
|
-
*
|
|
82
|
-
* @defaultValue `''`
|
|
83
|
-
*/
|
|
84
|
-
className: string;
|
|
85
|
-
/**
|
|
86
|
-
* The template to override the way each star is displayed.
|
|
87
|
-
*
|
|
88
|
-
* @defaultValue
|
|
89
|
-
* ```ts
|
|
90
|
-
* ({fill}: StarContext) => String.fromCharCode(fill === 100 ? 9733 : 9734)
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
star: SlotContent<StarContext>;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Represents the properties for the Rating component.
|
|
97
|
-
*/
|
|
98
|
-
export interface RatingProps {
|
|
99
|
-
/**
|
|
100
|
-
* Return the value for the 'aria-valuetext' attribute.
|
|
101
|
-
* @param rating - Current rating value.
|
|
102
|
-
* @param maxRating - maxRating value.
|
|
103
|
-
*
|
|
104
|
-
* @defaultValue
|
|
105
|
-
* ```ts
|
|
106
|
-
* (rating: number, maxRating: number) => `${rating} out of ${maxRating}`
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
ariaValueTextFn: (rating: number, maxRating: number) => string;
|
|
110
|
-
/**
|
|
111
|
-
* An event emitted when the rating is changed.
|
|
112
|
-
*
|
|
113
|
-
* Event payload is equal to the newly selected rating.
|
|
114
|
-
*
|
|
115
|
-
* @defaultValue
|
|
116
|
-
* ```ts
|
|
117
|
-
* () => {}
|
|
118
|
-
* ```
|
|
119
|
-
*/
|
|
120
|
-
onRatingChange: (rating: number) => void;
|
|
121
|
-
/**
|
|
122
|
-
* An event emitted when the user is hovering over a given rating.
|
|
123
|
-
*
|
|
124
|
-
* Event payload is equal to the rating being hovered over.
|
|
125
|
-
*
|
|
126
|
-
* @defaultValue
|
|
127
|
-
* ```ts
|
|
128
|
-
* () => {}
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
onHover: (rating: number) => void;
|
|
132
|
-
/**
|
|
133
|
-
* An event emitted when the user stops hovering over a given rating.
|
|
134
|
-
*
|
|
135
|
-
* Event payload is equal to the rating of the last item being hovered over.
|
|
136
|
-
*
|
|
137
|
-
* @defaultValue
|
|
138
|
-
* ```ts
|
|
139
|
-
* () => {}
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
onLeave: (rating: number) => void;
|
|
143
|
-
/**
|
|
144
|
-
* The current rating. Could be a decimal value like `3.75`.
|
|
145
|
-
*
|
|
146
|
-
* @defaultValue `0`
|
|
147
|
-
*/
|
|
148
|
-
rating: number;
|
|
149
|
-
/**
|
|
150
|
-
* The maximum rating that can be given.
|
|
151
|
-
*
|
|
152
|
-
* @defaultValue `10`
|
|
153
|
-
*/
|
|
154
|
-
maxRating: number;
|
|
155
|
-
/**
|
|
156
|
-
* If `true`, the rating is disabled.
|
|
157
|
-
*
|
|
158
|
-
* @defaultValue `false`
|
|
159
|
-
*/
|
|
160
|
-
disabled: boolean;
|
|
161
|
-
/**
|
|
162
|
-
* If `true`, the rating can't be changed.
|
|
163
|
-
*
|
|
164
|
-
* @defaultValue `false`
|
|
165
|
-
*/
|
|
166
|
-
readonly: boolean;
|
|
167
|
-
/**
|
|
168
|
-
* Define if the rating can be reset.
|
|
169
|
-
*
|
|
170
|
-
* If set to true, the user can 'unset' the rating value by cliking on the current rating value.
|
|
171
|
-
*
|
|
172
|
-
* @defaultValue `true`
|
|
173
|
-
*/
|
|
174
|
-
resettable: boolean;
|
|
175
|
-
/**
|
|
176
|
-
* Allows setting a custom rating tabindex.
|
|
177
|
-
* If the component is disabled, `tabindex` will still be set to `-1`.
|
|
178
|
-
*
|
|
179
|
-
* @defaultValue `0`
|
|
180
|
-
*/
|
|
181
|
-
tabindex: number;
|
|
182
|
-
/**
|
|
183
|
-
* The aria label
|
|
184
|
-
*
|
|
185
|
-
* @defaultValue `'Rating'`
|
|
186
|
-
*/
|
|
187
|
-
ariaLabel: string;
|
|
188
|
-
/**
|
|
189
|
-
* The aria labelled by
|
|
190
|
-
*
|
|
191
|
-
* @defaultValue `''`
|
|
192
|
-
*/
|
|
193
|
-
ariaLabelledBy: string;
|
|
194
|
-
/**
|
|
195
|
-
* CSS classes to be applied on the widget main container
|
|
196
|
-
*
|
|
197
|
-
* @defaultValue `''`
|
|
198
|
-
*/
|
|
199
|
-
className: string;
|
|
200
|
-
/**
|
|
201
|
-
* The template to override the way each star is displayed.
|
|
202
|
-
*
|
|
203
|
-
* @defaultValue
|
|
204
|
-
* ```ts
|
|
205
|
-
* ({fill}: StarContext) => String.fromCharCode(fill === 100 ? 9733 : 9734)
|
|
206
|
-
* ```
|
|
207
|
-
*/
|
|
208
|
-
star: SlotContent<StarContext>;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Represents a Rating Widget component.
|
|
212
|
-
*/
|
|
213
|
-
export type RatingWidget = Widget<RatingProps, RatingState, RatingApi, RatingDirectives>;
|
|
214
|
-
/**
|
|
215
|
-
* Create a RatingWidget with given config props
|
|
216
|
-
* @param config - an optional rating config
|
|
217
|
-
* @returns a RatingWidget
|
|
218
|
-
*/
|
|
219
|
-
declare const export_createRating: WidgetFactory<RatingWidget>;
|
|
220
|
-
export { export_createRating as createRating };
|
|
221
|
-
/**
|
|
222
|
-
* Represents the context for a star in a rating component.
|
|
223
|
-
*/
|
|
224
|
-
export interface StarContext {
|
|
225
|
-
/**
|
|
226
|
-
* indicates how much the current star is filled, from 0 to 100
|
|
227
|
-
*/
|
|
228
|
-
fill: number;
|
|
229
|
-
/**
|
|
230
|
-
* the position of the star in the rating
|
|
231
|
-
*/
|
|
232
|
-
index: number;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Interface representing directives for a rating component.
|
|
236
|
-
*/
|
|
237
|
-
export interface RatingDirectives {
|
|
238
|
-
/**
|
|
239
|
-
* A directive to be applied to the main container
|
|
240
|
-
* This will handle the keydown, mouseleave, tabindex and aria attributes
|
|
241
|
-
*/
|
|
242
|
-
containerDirective: Directive;
|
|
243
|
-
/**
|
|
244
|
-
* A directive to be applied on each star element
|
|
245
|
-
*/
|
|
246
|
-
starDirective: Directive<{
|
|
247
|
-
index: number;
|
|
248
|
-
}>;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Interface representing the API that can be performed on a rating component.
|
|
252
|
-
*/
|
|
253
|
-
export interface RatingApi {
|
|
254
|
-
/**
|
|
255
|
-
* Sets the rating value.
|
|
256
|
-
*
|
|
257
|
-
* @param index - Star index, starting from 1
|
|
258
|
-
*/
|
|
259
|
-
setRating(index: number): void;
|
|
260
|
-
/**
|
|
261
|
-
* Sets the hovered rating value.
|
|
262
|
-
*
|
|
263
|
-
* @param index - Star index, starting from 1
|
|
264
|
-
*/
|
|
265
|
-
setHoveredRating(index: number): void;
|
|
266
|
-
/**
|
|
267
|
-
* Leave the rating, resetting the visible rating to the rating value and triggering the onLeave callback
|
|
268
|
-
*/
|
|
269
|
-
leave(): void;
|
|
270
|
-
}
|