@agnos-ui/core 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/accordion-BaWN0_n-.js +330 -0
- package/accordion-BuIgxZ0S.cjs +329 -0
- package/alert-C4jCg9Pl.cjs +8 -0
- package/alert-Dlf-BV98.js +9 -0
- package/common-DRdsw5m8.js +76 -0
- package/common-nJRMXbwj.cjs +75 -0
- package/components/accordion/accordion.d.ts +57 -64
- package/components/accordion/index.cjs +7 -0
- package/components/accordion/index.js +7 -1
- package/components/alert/alert.d.ts +3 -12
- package/components/alert/common.d.ts +4 -13
- package/components/alert/index.cjs +10 -0
- package/components/alert/index.js +10 -2
- package/components/modal/index.cjs +7 -0
- package/components/modal/index.js +7 -1
- package/components/modal/modal.d.ts +7 -49
- package/components/pagination/index.cjs +5 -0
- package/components/pagination/index.d.ts +0 -1
- package/components/pagination/index.js +5 -2
- package/components/pagination/pagination.d.ts +107 -128
- package/components/progressbar/index.cjs +5 -0
- package/components/progressbar/index.js +5 -1
- package/components/progressbar/progressbar.d.ts +6 -22
- package/components/rating/index.cjs +5 -0
- package/components/rating/index.js +5 -1
- package/components/rating/rating.d.ts +16 -11
- package/components/select/index.cjs +6 -0
- package/components/select/index.js +6 -1
- package/components/select/select.d.ts +45 -57
- package/components/slider/index.cjs +5 -0
- package/components/slider/index.js +5 -1
- package/components/slider/slider.d.ts +63 -5
- package/components/toast/index.cjs +5 -0
- package/components/toast/index.d.ts +1 -0
- package/components/toast/index.js +5 -0
- package/components/toast/toast.d.ts +47 -0
- package/config.cjs +38 -0
- package/config.d.ts +6 -1
- package/config.js +35 -50
- package/directive-BTSEYLF3.cjs +404 -0
- package/directive-DCYlDznf.js +405 -0
- package/func-DR0n-ShK.js +7 -0
- package/func-Qd3cD9a3.cjs +6 -0
- package/index.cjs +119 -0
- package/index.d.ts +3 -1
- package/index.js +119 -31
- package/modal-BI2qUu1M.js +251 -0
- package/modal-rzMpATf5.cjs +250 -0
- package/package.json +30 -22
- package/pagination--GkwduJn.js +263 -0
- package/pagination-EWSWQT1I.cjs +262 -0
- package/progressbar-DH7DHYMp.cjs +83 -0
- package/progressbar-DuRX7_my.js +84 -0
- package/promise-BMJ8qhA8.cjs +118 -0
- package/promise-CY2U8bTP.js +119 -0
- package/rating-BR5wD7y2.js +173 -0
- package/rating-CmuYUSxy.cjs +172 -0
- package/select-BCs6HQWn.js +358 -0
- package/select-CCIKn8WR.cjs +357 -0
- package/services/extendWidget.cjs +32 -0
- package/services/extendWidget.d.ts +10 -5
- package/services/extendWidget.js +31 -34
- package/services/floatingUI.cjs +131 -0
- package/services/floatingUI.d.ts +30 -14
- package/services/floatingUI.js +128 -102
- package/services/focustrack.cjs +47 -0
- package/services/focustrack.js +45 -44
- package/services/hash.cjs +15 -0
- package/services/hash.d.ts +2 -0
- package/services/hash.js +15 -0
- package/services/intersection.cjs +53 -0
- package/services/intersection.js +48 -50
- package/services/matchMedia.cjs +13 -0
- package/services/matchMedia.d.ts +7 -0
- package/services/matchMedia.js +13 -0
- package/services/navManager.cjs +196 -0
- package/services/navManager.d.ts +24 -17
- package/services/navManager.js +186 -162
- package/services/portal.cjs +43 -0
- package/services/portal.js +41 -42
- package/services/resizeObserver.cjs +32 -0
- package/services/resizeObserver.d.ts +14 -0
- package/services/resizeObserver.js +32 -0
- package/services/siblingsInert.cjs +40 -0
- package/services/siblingsInert.js +31 -31
- package/services/transitions/baseTransitions.cjs +171 -0
- package/services/transitions/baseTransitions.d.ts +16 -16
- package/services/transitions/baseTransitions.js +159 -170
- package/services/transitions/collapse.cjs +44 -0
- package/services/transitions/collapse.js +41 -49
- package/services/transitions/cssTransitions.cjs +32 -0
- package/services/transitions/cssTransitions.d.ts +2 -1
- package/services/transitions/cssTransitions.js +29 -39
- package/services/transitions/simpleClassTransition.cjs +31 -0
- package/services/transitions/simpleClassTransition.js +30 -41
- package/slider-CA_fszn7.js +536 -0
- package/slider-DsLvT87U.cjs +535 -0
- package/toast-8tWp6x89.js +63 -0
- package/toast-Aw8o0Iwe.cjs +62 -0
- package/types.cjs +12 -0
- package/types.d.ts +21 -1
- package/types.js +11 -13
- package/utils/directive.cjs +26 -0
- package/utils/directive.d.ts +155 -4
- package/utils/directive.js +25 -189
- package/utils/internal/dom.d.ts +57 -3
- package/utils/internal/promise.d.ts +2 -2
- package/utils/internal/ssrHTMLElement.d.ts +7 -0
- package/utils/internal/textDirection.d.ts +1 -1
- package/utils/stores.cjs +163 -0
- package/utils/stores.d.ts +23 -20
- package/utils/stores.js +151 -269
- package/utils/writables.cjs +13 -0
- package/utils/writables.js +12 -71
- package/writables-D46sFgGK.cjs +85 -0
- package/writables-DoU_XYTX.js +86 -0
- package/components/accordion/accordion.js +0 -267
- package/components/alert/alert.js +0 -22
- package/components/alert/common.js +0 -69
- package/components/commonProps.js +0 -1
- package/components/modal/modal.js +0 -186
- package/components/pagination/bootstrap.d.ts +0 -8
- package/components/pagination/bootstrap.js +0 -110
- package/components/pagination/pagination.js +0 -149
- package/components/progressbar/progressbar.js +0 -78
- package/components/rating/rating.js +0 -138
- package/components/select/select.js +0 -266
- package/components/slider/slider.js +0 -415
- package/services/transitions/bootstrap/collapse.d.ts +0 -2
- package/services/transitions/bootstrap/collapse.js +0 -15
- package/services/transitions/bootstrap/fade.d.ts +0 -1
- package/services/transitions/bootstrap/fade.js +0 -7
- package/services/transitions/bootstrap.d.ts +0 -2
- package/services/transitions/bootstrap.js +0 -2
- package/utils/internal/checks.js +0 -60
- package/utils/internal/dom.js +0 -61
- package/utils/internal/func.js +0 -11
- package/utils/internal/isFocusable.js +0 -35
- package/utils/internal/math.js +0 -13
- package/utils/internal/promise.js +0 -169
- package/utils/internal/scrollbars.js +0 -33
- package/utils/internal/sort.js +0 -28
- package/utils/internal/textDirection.js +0 -7
- package/utils/internal/traversal.js +0 -105
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import type { PropsConfig, Widget,
|
|
1
|
+
import type { PropsConfig, Widget, Directive } from '../../types';
|
|
2
2
|
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
3
|
-
/**
|
|
4
|
-
* A type for the slot context of the pagination widget
|
|
5
|
-
*/
|
|
6
|
-
export type PaginationContext = WidgetSlotContext<PaginationWidget>;
|
|
7
|
-
/**
|
|
8
|
-
* A type for the slot context of the pagination widget when the slot is the number label
|
|
9
|
-
*/
|
|
10
|
-
export interface PaginationNumberContext extends PaginationContext {
|
|
11
|
-
/**
|
|
12
|
-
* Displayed page
|
|
13
|
-
*/
|
|
14
|
-
displayedPage: number;
|
|
15
|
-
}
|
|
16
3
|
export interface PaginationCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
17
4
|
/**
|
|
18
5
|
* The current page.
|
|
@@ -71,6 +58,13 @@ export interface PaginationCommonPropsAndState extends WidgetsCommonPropsAndStat
|
|
|
71
58
|
* @defaultValue 'Action link for last page'
|
|
72
59
|
*/
|
|
73
60
|
ariaLastLabel: string;
|
|
61
|
+
/**
|
|
62
|
+
* The label for the "Ellipsis" page.
|
|
63
|
+
* for I18n, we suggest to use the global configuration
|
|
64
|
+
* override any configuration parameters provided for this
|
|
65
|
+
* @defaultValue 'Ellipsis page element'
|
|
66
|
+
*/
|
|
67
|
+
ariaEllipsisLabel: string;
|
|
74
68
|
/**
|
|
75
69
|
* If `true`, pagination links will be disabled.
|
|
76
70
|
* @defaultValue false
|
|
@@ -86,58 +80,6 @@ export interface PaginationCommonPropsAndState extends WidgetsCommonPropsAndStat
|
|
|
86
80
|
* @defaultValue false
|
|
87
81
|
*/
|
|
88
82
|
boundaryLinks: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* The template to use for the ellipsis slot
|
|
91
|
-
* for I18n, we suggest to use the global configuration
|
|
92
|
-
* override any configuration parameters provided for this
|
|
93
|
-
* @defaultValue '…'
|
|
94
|
-
*/
|
|
95
|
-
slotEllipsis: SlotContent<PaginationContext>;
|
|
96
|
-
/**
|
|
97
|
-
* The template to use for the first slot
|
|
98
|
-
* for I18n, we suggest to use the global configuration
|
|
99
|
-
* override any configuration parameters provided for this
|
|
100
|
-
* @defaultValue '«'
|
|
101
|
-
*/
|
|
102
|
-
slotFirst: SlotContent<PaginationContext>;
|
|
103
|
-
/**
|
|
104
|
-
* The template to use for the previous slot
|
|
105
|
-
* for I18n, we suggest to use the global configuration
|
|
106
|
-
* override any configuration parameters provided for this
|
|
107
|
-
* @defaultValue '‹'
|
|
108
|
-
*/
|
|
109
|
-
slotPrevious: SlotContent<PaginationContext>;
|
|
110
|
-
/**
|
|
111
|
-
* The template to use for the next slot
|
|
112
|
-
* for I18n, we suggest to use the global configuration
|
|
113
|
-
* override any configuration parameters provided for this
|
|
114
|
-
* @defaultValue '›'
|
|
115
|
-
*/
|
|
116
|
-
slotNext: SlotContent<PaginationContext>;
|
|
117
|
-
/**
|
|
118
|
-
* The template to use for the last slot
|
|
119
|
-
* for I18n, we suggest to use the global configuration
|
|
120
|
-
* override any configuration parameters provided for this
|
|
121
|
-
* @defaultValue '»'
|
|
122
|
-
*/
|
|
123
|
-
slotLast: SlotContent<PaginationContext>;
|
|
124
|
-
/**
|
|
125
|
-
* The template to use for the pages slot
|
|
126
|
-
* To use to customize the pages view
|
|
127
|
-
* override any configuration parameters provided for this
|
|
128
|
-
*/
|
|
129
|
-
slotPages: SlotContent<PaginationContext>;
|
|
130
|
-
/**
|
|
131
|
-
* The template to use for the number slot
|
|
132
|
-
* override any configuration parameters provided for this
|
|
133
|
-
* for I18n, we suggest to use the global configuration
|
|
134
|
-
* @defaultValue
|
|
135
|
-
* ```ts
|
|
136
|
-
* ({displayedPage}) => `${displayedPage}`
|
|
137
|
-
* ```
|
|
138
|
-
* @param displayedPage - The current page number
|
|
139
|
-
*/
|
|
140
|
-
slotNumberLabel: SlotContent<PaginationNumberContext>;
|
|
141
83
|
}
|
|
142
84
|
export interface PaginationProps extends PaginationCommonPropsAndState {
|
|
143
85
|
/**
|
|
@@ -201,6 +143,39 @@ export interface PaginationProps extends PaginationCommonPropsAndState {
|
|
|
201
143
|
* ```
|
|
202
144
|
*/
|
|
203
145
|
ariaPageLabel: (processPage: number, pageCount: number) => string;
|
|
146
|
+
/**
|
|
147
|
+
* Provide the label for the aria-live element
|
|
148
|
+
* This is used for accessibility purposes.
|
|
149
|
+
* for I18n, we suggest to use the global configuration
|
|
150
|
+
* override any configuration parameters provided for this
|
|
151
|
+
* @param currentPage - The current page number
|
|
152
|
+
* @param pageCount - The total number of pages
|
|
153
|
+
* @defaultValue
|
|
154
|
+
* ```ts
|
|
155
|
+
* ({currentPage, pageCount}) => `Current page is ${currentPage}`
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
ariaLiveLabel: (currentPage: number, pageCount: number) => string;
|
|
159
|
+
/**
|
|
160
|
+
* Factory function providing the href for a "Page" page anchor,
|
|
161
|
+
* based on the current page number
|
|
162
|
+
* @param pageNumber - The index to use in the link
|
|
163
|
+
* @defaultValue
|
|
164
|
+
* ```ts
|
|
165
|
+
* (_pageNumber) => '#'
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
pageLink: (pageNumber: number) => string;
|
|
169
|
+
}
|
|
170
|
+
export interface DirectionsHrefs {
|
|
171
|
+
/**
|
|
172
|
+
* The href for the 'Previous' navigation link
|
|
173
|
+
*/
|
|
174
|
+
previous: string;
|
|
175
|
+
/**
|
|
176
|
+
* The href for the 'Next' direction link
|
|
177
|
+
*/
|
|
178
|
+
next: string;
|
|
204
179
|
}
|
|
205
180
|
export interface PaginationState extends PaginationCommonPropsAndState {
|
|
206
181
|
/**
|
|
@@ -223,38 +198,64 @@ export interface PaginationState extends PaginationCommonPropsAndState {
|
|
|
223
198
|
* The label for each "Page" page link.
|
|
224
199
|
*/
|
|
225
200
|
pagesLabel: string[];
|
|
201
|
+
/** The hrefs for each "Page" page link */
|
|
202
|
+
pagesHrefs: string[];
|
|
203
|
+
/** The hrefs for the direction links */
|
|
204
|
+
directionsHrefs: DirectionsHrefs;
|
|
205
|
+
/** The aria-live text */
|
|
206
|
+
ariaLiveLabelText: string;
|
|
226
207
|
}
|
|
227
208
|
export interface PaginationActions {
|
|
228
209
|
/**
|
|
229
210
|
* To "go" to a specific page
|
|
230
211
|
* @param page - The page number to select
|
|
231
212
|
*/
|
|
232
|
-
select(page: number): void;
|
|
213
|
+
select(page: number, event?: MouseEvent): void;
|
|
233
214
|
/**
|
|
234
215
|
* To "go" to the first page
|
|
235
216
|
*/
|
|
236
|
-
first(): void;
|
|
217
|
+
first(event?: MouseEvent): void;
|
|
237
218
|
/**
|
|
238
219
|
* To "go" to the previous page
|
|
239
220
|
*/
|
|
240
|
-
previous(): void;
|
|
221
|
+
previous(event?: MouseEvent): void;
|
|
241
222
|
/**
|
|
242
223
|
* To "go" to the next page
|
|
243
224
|
*/
|
|
244
|
-
next(): void;
|
|
225
|
+
next(event?: MouseEvent): void;
|
|
245
226
|
/**
|
|
246
227
|
* To "go" to the last page
|
|
247
228
|
*/
|
|
248
|
-
last(): void;
|
|
229
|
+
last(event?: MouseEvent): void;
|
|
249
230
|
}
|
|
250
|
-
export interface
|
|
231
|
+
export interface PaginationDirectives {
|
|
232
|
+
/**
|
|
233
|
+
* A directive to be applied to each page link
|
|
234
|
+
* This will handle the click, tabindex and aria attributes
|
|
235
|
+
*/
|
|
236
|
+
pageLink: Directive<{
|
|
237
|
+
page: number;
|
|
238
|
+
}>;
|
|
239
|
+
/**
|
|
240
|
+
* A directive to be applied on the previous link
|
|
241
|
+
*/
|
|
242
|
+
pagePrev: Directive;
|
|
243
|
+
/**
|
|
244
|
+
* A directive to be applied on the first link
|
|
245
|
+
*/
|
|
246
|
+
pageFirst: Directive;
|
|
251
247
|
/**
|
|
252
|
-
*
|
|
253
|
-
* @param page - The page number to check
|
|
248
|
+
* A directive to be applied on the next link
|
|
254
249
|
*/
|
|
255
|
-
|
|
250
|
+
pageNext: Directive;
|
|
251
|
+
/**
|
|
252
|
+
* A directive to be applied on the Last link
|
|
253
|
+
*/
|
|
254
|
+
pageLast: Directive;
|
|
255
|
+
}
|
|
256
|
+
export interface PaginationApi {
|
|
256
257
|
}
|
|
257
|
-
export type PaginationWidget = Widget<PaginationProps, PaginationState, PaginationApi, PaginationActions>;
|
|
258
|
+
export type PaginationWidget = Widget<PaginationProps, PaginationState, PaginationApi, PaginationActions, PaginationDirectives>;
|
|
258
259
|
/**
|
|
259
260
|
* Returns a shallow copy of the default pagination config
|
|
260
261
|
* @returns a copy of the default config
|
|
@@ -321,6 +322,29 @@ export declare function getPaginationDefaultConfig(): {
|
|
|
321
322
|
* ```
|
|
322
323
|
*/
|
|
323
324
|
ariaPageLabel: (processPage: number, pageCount: number) => string;
|
|
325
|
+
/**
|
|
326
|
+
* Provide the label for the aria-live element
|
|
327
|
+
* This is used for accessibility purposes.
|
|
328
|
+
* for I18n, we suggest to use the global configuration
|
|
329
|
+
* override any configuration parameters provided for this
|
|
330
|
+
* @param currentPage - The current page number
|
|
331
|
+
* @param pageCount - The total number of pages
|
|
332
|
+
* @defaultValue
|
|
333
|
+
* ```ts
|
|
334
|
+
* ({currentPage, pageCount}) => `Current page is ${currentPage}`
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
ariaLiveLabel: (currentPage: number, pageCount: number) => string;
|
|
338
|
+
/**
|
|
339
|
+
* Factory function providing the href for a "Page" page anchor,
|
|
340
|
+
* based on the current page number
|
|
341
|
+
* @param pageNumber - The index to use in the link
|
|
342
|
+
* @defaultValue
|
|
343
|
+
* ```ts
|
|
344
|
+
* (_pageNumber) => '#'
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
pageLink: (pageNumber: number) => string;
|
|
324
348
|
/**
|
|
325
349
|
* The current page.
|
|
326
350
|
*
|
|
@@ -378,6 +402,13 @@ export declare function getPaginationDefaultConfig(): {
|
|
|
378
402
|
* @defaultValue 'Action link for last page'
|
|
379
403
|
*/
|
|
380
404
|
ariaLastLabel: string;
|
|
405
|
+
/**
|
|
406
|
+
* The label for the "Ellipsis" page.
|
|
407
|
+
* for I18n, we suggest to use the global configuration
|
|
408
|
+
* override any configuration parameters provided for this
|
|
409
|
+
* @defaultValue 'Ellipsis page element'
|
|
410
|
+
*/
|
|
411
|
+
ariaEllipsisLabel: string;
|
|
381
412
|
/**
|
|
382
413
|
* If `true`, pagination links will be disabled.
|
|
383
414
|
* @defaultValue false
|
|
@@ -393,58 +424,6 @@ export declare function getPaginationDefaultConfig(): {
|
|
|
393
424
|
* @defaultValue false
|
|
394
425
|
*/
|
|
395
426
|
boundaryLinks: boolean;
|
|
396
|
-
/**
|
|
397
|
-
* The template to use for the ellipsis slot
|
|
398
|
-
* for I18n, we suggest to use the global configuration
|
|
399
|
-
* override any configuration parameters provided for this
|
|
400
|
-
* @defaultValue '…'
|
|
401
|
-
*/
|
|
402
|
-
slotEllipsis: SlotContent<PaginationContext>;
|
|
403
|
-
/**
|
|
404
|
-
* The template to use for the first slot
|
|
405
|
-
* for I18n, we suggest to use the global configuration
|
|
406
|
-
* override any configuration parameters provided for this
|
|
407
|
-
* @defaultValue '«'
|
|
408
|
-
*/
|
|
409
|
-
slotFirst: SlotContent<PaginationContext>;
|
|
410
|
-
/**
|
|
411
|
-
* The template to use for the previous slot
|
|
412
|
-
* for I18n, we suggest to use the global configuration
|
|
413
|
-
* override any configuration parameters provided for this
|
|
414
|
-
* @defaultValue '‹'
|
|
415
|
-
*/
|
|
416
|
-
slotPrevious: SlotContent<PaginationContext>;
|
|
417
|
-
/**
|
|
418
|
-
* The template to use for the next slot
|
|
419
|
-
* for I18n, we suggest to use the global configuration
|
|
420
|
-
* override any configuration parameters provided for this
|
|
421
|
-
* @defaultValue '›'
|
|
422
|
-
*/
|
|
423
|
-
slotNext: SlotContent<PaginationContext>;
|
|
424
|
-
/**
|
|
425
|
-
* The template to use for the last slot
|
|
426
|
-
* for I18n, we suggest to use the global configuration
|
|
427
|
-
* override any configuration parameters provided for this
|
|
428
|
-
* @defaultValue '»'
|
|
429
|
-
*/
|
|
430
|
-
slotLast: SlotContent<PaginationContext>;
|
|
431
|
-
/**
|
|
432
|
-
* The template to use for the pages slot
|
|
433
|
-
* To use to customize the pages view
|
|
434
|
-
* override any configuration parameters provided for this
|
|
435
|
-
*/
|
|
436
|
-
slotPages: SlotContent<PaginationContext>;
|
|
437
|
-
/**
|
|
438
|
-
* The template to use for the number slot
|
|
439
|
-
* override any configuration parameters provided for this
|
|
440
|
-
* for I18n, we suggest to use the global configuration
|
|
441
|
-
* @defaultValue
|
|
442
|
-
* ```ts
|
|
443
|
-
* ({displayedPage}) => `${displayedPage}`
|
|
444
|
-
* ```
|
|
445
|
-
* @param displayedPage - The current page number
|
|
446
|
-
*/
|
|
447
|
-
slotNumberLabel: SlotContent<PaginationNumberContext>;
|
|
448
427
|
className: string;
|
|
449
428
|
};
|
|
450
429
|
/**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const progressbar = require("../../progressbar-DH7DHYMp.cjs");
|
|
4
|
+
exports.createProgressbar = progressbar.createProgressbar;
|
|
5
|
+
exports.getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Directive, PropsConfig, Widget } from '../../types';
|
|
2
2
|
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
3
|
-
export type ProgressbarContext = WidgetSlotContext<ProgressbarWidget>;
|
|
4
3
|
export interface ProgressbarCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
5
4
|
/**
|
|
6
5
|
* The minimum value.
|
|
@@ -21,27 +20,12 @@ export interface ProgressbarCommonPropsAndState extends WidgetsCommonPropsAndSta
|
|
|
21
20
|
* The aria label.
|
|
22
21
|
*/
|
|
23
22
|
ariaLabel: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ProgressbarDirectives {
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
slotContent: SlotContent<ProgressbarContext>;
|
|
28
|
-
/**
|
|
29
|
-
* Label of the progress.
|
|
30
|
-
*/
|
|
31
|
-
slotDefault: SlotContent<ProgressbarContext>;
|
|
32
|
-
/**
|
|
33
|
-
* Height of the progressbar, can be any valid css height value.
|
|
34
|
-
*/
|
|
35
|
-
height: string;
|
|
36
|
-
/**
|
|
37
|
-
* If `true`, shows a striped progressbar.
|
|
38
|
-
*/
|
|
39
|
-
striped: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* If `true`, animates a striped progressbar.
|
|
42
|
-
* Takes effect only for browsers supporting CSS3 animations, and if `striped` is `true`.
|
|
26
|
+
* A directive to be applied to the main container that handles aria attributes.
|
|
43
27
|
*/
|
|
44
|
-
|
|
28
|
+
ariaDirective: Directive;
|
|
45
29
|
}
|
|
46
30
|
export interface ProgressbarState extends ProgressbarCommonPropsAndState {
|
|
47
31
|
/**
|
|
@@ -72,7 +56,7 @@ export interface ProgressbarProps extends ProgressbarCommonPropsAndState {
|
|
|
72
56
|
}
|
|
73
57
|
export interface ProgressbarApi {
|
|
74
58
|
}
|
|
75
|
-
export type ProgressbarWidget = Widget<ProgressbarProps, ProgressbarState, ProgressbarApi, object,
|
|
59
|
+
export type ProgressbarWidget = Widget<ProgressbarProps, ProgressbarState, ProgressbarApi, object, ProgressbarDirectives>;
|
|
76
60
|
/**
|
|
77
61
|
* Retrieve a shallow copy of the default Progressbar config
|
|
78
62
|
* @returns the default Progressbar config
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Directive, PropsConfig, Widget } from '../../types';
|
|
2
2
|
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
3
3
|
export interface StarContext {
|
|
4
4
|
/**
|
|
@@ -38,10 +38,6 @@ export interface RatingCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
|
38
38
|
* If the component is disabled, `tabindex` will still be set to `-1`.
|
|
39
39
|
*/
|
|
40
40
|
tabindex: number;
|
|
41
|
-
/**
|
|
42
|
-
* The template to override the way each star is displayed.
|
|
43
|
-
*/
|
|
44
|
-
slotStar: SlotContent<StarContext>;
|
|
45
41
|
/**
|
|
46
42
|
* The aria label
|
|
47
43
|
*/
|
|
@@ -77,6 +73,19 @@ export interface RatingProps extends RatingCommonPropsAndState {
|
|
|
77
73
|
*/
|
|
78
74
|
onLeave: (rating: number) => void;
|
|
79
75
|
}
|
|
76
|
+
export interface RatingDirectives {
|
|
77
|
+
/**
|
|
78
|
+
* A directive to be applied to the main container
|
|
79
|
+
* This will handle the keydown, mouseleave, tabindex and aria attributes
|
|
80
|
+
*/
|
|
81
|
+
containerDirective: Directive;
|
|
82
|
+
/**
|
|
83
|
+
* A directive to be applied on each star element
|
|
84
|
+
*/
|
|
85
|
+
starDirective: Directive<{
|
|
86
|
+
index: number;
|
|
87
|
+
}>;
|
|
88
|
+
}
|
|
80
89
|
export interface RatingState extends RatingCommonPropsAndState {
|
|
81
90
|
/**
|
|
82
91
|
* the aria value of the rating
|
|
@@ -89,7 +98,7 @@ export interface RatingState extends RatingCommonPropsAndState {
|
|
|
89
98
|
/**
|
|
90
99
|
* is the rating interactive i.e. listening to hover, click and keyboard events
|
|
91
100
|
*/
|
|
92
|
-
|
|
101
|
+
interactive: boolean;
|
|
93
102
|
/**
|
|
94
103
|
* the list of stars
|
|
95
104
|
*/
|
|
@@ -123,7 +132,7 @@ export interface RatingActions {
|
|
|
123
132
|
*/
|
|
124
133
|
handleKey(event: KeyboardEvent): void;
|
|
125
134
|
}
|
|
126
|
-
export type RatingWidget = Widget<RatingProps, RatingState, object, RatingActions>;
|
|
135
|
+
export type RatingWidget = Widget<RatingProps, RatingState, object, RatingActions, RatingDirectives>;
|
|
127
136
|
/**
|
|
128
137
|
* Returns a shallow copy of the default rating config.
|
|
129
138
|
* @returns a copy of the default config
|
|
@@ -180,10 +189,6 @@ export declare function getRatingDefaultConfig(): {
|
|
|
180
189
|
* If the component is disabled, `tabindex` will still be set to `-1`.
|
|
181
190
|
*/
|
|
182
191
|
tabindex: number;
|
|
183
|
-
/**
|
|
184
|
-
* The template to override the way each star is displayed.
|
|
185
|
-
*/
|
|
186
|
-
slotStar: SlotContent<StarContext>;
|
|
187
192
|
/**
|
|
188
193
|
* The aria label
|
|
189
194
|
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const select = require("../../select-CCIKn8WR.cjs");
|
|
4
|
+
exports.createSelect = select.createSelect;
|
|
5
|
+
exports.defaultConfig = select.defaultConfig;
|
|
6
|
+
exports.getSelectDefaultConfig = select.getSelectDefaultConfig;
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import type { Placement } from '@floating-ui/dom';
|
|
2
2
|
import type { FloatingUI } from '../../services/floatingUI';
|
|
3
3
|
import type { HasFocus } from '../../services/focustrack';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Directive, PropsConfig, Widget } from '../../types';
|
|
5
5
|
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
6
|
-
/**
|
|
7
|
-
* A type for the slot context of the pagination widget
|
|
8
|
-
*/
|
|
9
|
-
export type SelectContext<Item> = WidgetSlotContext<SelectWidget<Item>>;
|
|
10
|
-
export interface SelectItemContext<Item> extends SelectContext<Item> {
|
|
11
|
-
/**
|
|
12
|
-
* Contextual data related to an item
|
|
13
|
-
*/
|
|
14
|
-
itemContext: ItemContext<Item>;
|
|
15
|
-
}
|
|
16
6
|
export interface SelectCommonPropsAndState<Item> extends WidgetsCommonPropsAndState {
|
|
17
7
|
/**
|
|
18
8
|
* id used for the input inside the select
|
|
@@ -54,16 +44,6 @@ export interface SelectCommonPropsAndState<Item> extends WidgetsCommonPropsAndSt
|
|
|
54
44
|
* true if a loading process is being done
|
|
55
45
|
*/
|
|
56
46
|
loading: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* The template to override the way each badge on the left of the input is displayed.
|
|
59
|
-
* This define the content of the badge inside the badge container.
|
|
60
|
-
*/
|
|
61
|
-
slotBadgeLabel: SlotContent<SelectItemContext<Item>>;
|
|
62
|
-
/**
|
|
63
|
-
* The template to override the way each item is displayed in the list.
|
|
64
|
-
* This define the content of the badge inside the badge container.
|
|
65
|
-
*/
|
|
66
|
-
slotItem: SlotContent<SelectItemContext<Item>>;
|
|
67
47
|
}
|
|
68
48
|
export interface SelectProps<T> extends SelectCommonPropsAndState<T> {
|
|
69
49
|
/**
|
|
@@ -80,6 +60,12 @@ export interface SelectProps<T> extends SelectCommonPropsAndState<T> {
|
|
|
80
60
|
* By default, the item is returned
|
|
81
61
|
*/
|
|
82
62
|
itemIdFn(item: T): string;
|
|
63
|
+
/**
|
|
64
|
+
* Retrieves navigable elements within an HTML element containing badges and the input.
|
|
65
|
+
*
|
|
66
|
+
* @param node - HTMLElement that contains the badges and the input
|
|
67
|
+
*/
|
|
68
|
+
navSelector(node: HTMLElement): NodeListOf<HTMLSpanElement | HTMLInputElement>;
|
|
83
69
|
/**
|
|
84
70
|
* Callback called dropdown open state change
|
|
85
71
|
* @param isOpen - updated open state
|
|
@@ -163,27 +149,6 @@ export interface SelectApi<Item> {
|
|
|
163
149
|
* Highlight the last item among the visible list
|
|
164
150
|
*/
|
|
165
151
|
highlightLast(): void;
|
|
166
|
-
/**
|
|
167
|
-
* Focus the provided item among the selected list.
|
|
168
|
-
* The focus feature is designed to know what item must be focused in the UI, i.e. among the badge elements.
|
|
169
|
-
*/
|
|
170
|
-
focus(item: Item): void;
|
|
171
|
-
/**
|
|
172
|
-
* Focus the first element
|
|
173
|
-
*/
|
|
174
|
-
focusFirst(): void;
|
|
175
|
-
/**
|
|
176
|
-
* Focus the previous element. If no element was focused before the call, nothing happens.
|
|
177
|
-
*/
|
|
178
|
-
focusPrevious(): void;
|
|
179
|
-
/**
|
|
180
|
-
* Focus the next element. If no element was focused before the call, nothing happens.
|
|
181
|
-
*/
|
|
182
|
-
focusNext(): void;
|
|
183
|
-
/**
|
|
184
|
-
* Focus the last element. If no element was focused before the call, nothing happens.
|
|
185
|
-
*/
|
|
186
|
-
focusLast(): void;
|
|
187
152
|
/**
|
|
188
153
|
* Select the provided item.
|
|
189
154
|
* The selected list is used to
|
|
@@ -215,7 +180,7 @@ export interface SelectApi<Item> {
|
|
|
215
180
|
*/
|
|
216
181
|
toggle(isOpen?: boolean): void;
|
|
217
182
|
}
|
|
218
|
-
export interface SelectDirectives {
|
|
183
|
+
export interface SelectDirectives<Item> {
|
|
219
184
|
/**
|
|
220
185
|
* Directive to be used in the input group and the menu containers
|
|
221
186
|
*/
|
|
@@ -228,8 +193,24 @@ export interface SelectDirectives {
|
|
|
228
193
|
* A directive to be applied to the input group element serves as the base for menu positioning
|
|
229
194
|
*/
|
|
230
195
|
referenceDirective: FloatingUI['directives']['referenceDirective'];
|
|
196
|
+
/**
|
|
197
|
+
* A directive to be applied to the element that contains the badges and the input
|
|
198
|
+
*/
|
|
199
|
+
inputContainerDirective: Directive;
|
|
200
|
+
/**
|
|
201
|
+
* A directive that applies all the necessary attributes to the container badges
|
|
202
|
+
*/
|
|
203
|
+
badgeAttributesDirective: Directive<ItemContext<Item>>;
|
|
204
|
+
/**
|
|
205
|
+
* A directive that applies all the necessary attributes to the dropdown menu
|
|
206
|
+
*/
|
|
207
|
+
menuAttributesDirective: Directive;
|
|
208
|
+
/**
|
|
209
|
+
* A directive that applies all the necessary attributes to the dropdown item
|
|
210
|
+
*/
|
|
211
|
+
itemAttributesDirective: Directive<ItemContext<Item>>;
|
|
231
212
|
}
|
|
232
|
-
export interface SelectActions {
|
|
213
|
+
export interface SelectActions<Item> {
|
|
233
214
|
/**
|
|
234
215
|
* Method to be plugged to on the 'input' event. The input text will be used as the filter text.
|
|
235
216
|
*/
|
|
@@ -237,12 +218,23 @@ export interface SelectActions {
|
|
|
237
218
|
target: any;
|
|
238
219
|
}) => void;
|
|
239
220
|
/**
|
|
240
|
-
* Method to be
|
|
221
|
+
* Method to be attached to the node element to close a badge on click.
|
|
222
|
+
*/
|
|
223
|
+
onRemoveBadgeClick: (event: MouseEvent, item: Item) => void;
|
|
224
|
+
/**
|
|
225
|
+
* Method to be plugged to on an keydown event of the main input, in order to control the keyboard interactions with the highlighted item.
|
|
241
226
|
* It manages arrow keys to move the highlighted item, or enter to toggle the item.
|
|
242
227
|
*/
|
|
243
|
-
onInputKeydown: (
|
|
228
|
+
onInputKeydown: (event: KeyboardEvent) => void;
|
|
229
|
+
/**
|
|
230
|
+
* Method to be plugged to on an keydown event of a badge container, in order to manage main actions on badges.
|
|
231
|
+
*
|
|
232
|
+
* @param event - keyboard event
|
|
233
|
+
* @param item - corresponding item
|
|
234
|
+
*/
|
|
235
|
+
onBadgeKeydown: (event: KeyboardEvent, item: Item) => void;
|
|
244
236
|
}
|
|
245
|
-
export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, SelectApi<Item>, SelectActions
|
|
237
|
+
export type SelectWidget<Item> = Widget<SelectProps<Item>, SelectState<Item>, SelectApi<Item>, SelectActions<Item>, SelectDirectives<Item>>;
|
|
246
238
|
export declare const defaultConfig: SelectProps<any>;
|
|
247
239
|
/**
|
|
248
240
|
* Returns a shallow copy of the default select config.
|
|
@@ -263,6 +255,12 @@ export declare function getSelectDefaultConfig(): {
|
|
|
263
255
|
* By default, the item is returned
|
|
264
256
|
*/
|
|
265
257
|
itemIdFn(item: any): string;
|
|
258
|
+
/**
|
|
259
|
+
* Retrieves navigable elements within an HTML element containing badges and the input.
|
|
260
|
+
*
|
|
261
|
+
* @param node - HTMLElement that contains the badges and the input
|
|
262
|
+
*/
|
|
263
|
+
navSelector(node: HTMLElement): NodeListOf<HTMLInputElement | HTMLSpanElement>;
|
|
266
264
|
/**
|
|
267
265
|
* Callback called dropdown open state change
|
|
268
266
|
* @param isOpen - updated open state
|
|
@@ -317,16 +315,6 @@ export declare function getSelectDefaultConfig(): {
|
|
|
317
315
|
* true if a loading process is being done
|
|
318
316
|
*/
|
|
319
317
|
loading: boolean;
|
|
320
|
-
/**
|
|
321
|
-
* The template to override the way each badge on the left of the input is displayed.
|
|
322
|
-
* This define the content of the badge inside the badge container.
|
|
323
|
-
*/
|
|
324
|
-
slotBadgeLabel: SlotContent<SelectItemContext<any>>;
|
|
325
|
-
/**
|
|
326
|
-
* The template to override the way each item is displayed in the list.
|
|
327
|
-
* This define the content of the badge inside the badge container.
|
|
328
|
-
*/
|
|
329
|
-
slotItem: SlotContent<SelectItemContext<any>>;
|
|
330
318
|
className: string;
|
|
331
319
|
};
|
|
332
320
|
/**
|