@agnos-ui/core 0.4.0-next.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,20 @@
1
1
  import type { PropsConfig, Widget, Directive } from '../../types';
2
2
  import type { WidgetsCommonPropsAndState } from '../commonProps';
3
- export interface PaginationCommonPropsAndState extends WidgetsCommonPropsAndState {
3
+ interface PaginationCommonPropsAndState extends WidgetsCommonPropsAndState {
4
4
  /**
5
5
  * The current page.
6
6
  *
7
7
  * Page numbers start with `1`.
8
- * @defaultValue 1
8
+ *
9
+ * @defaultValue `1`
9
10
  */
10
11
  page: number;
11
12
  /**
12
13
  * The pagination display size.
13
14
  *
14
15
  * Bootstrap currently supports small and large sizes.
15
- * @defaultValue null
16
+ *
17
+ * @defaultValue `null`
16
18
  */
17
19
  size: 'sm' | 'lg' | null;
18
20
  /**
@@ -20,64 +22,89 @@ export interface PaginationCommonPropsAndState extends WidgetsCommonPropsAndStat
20
22
  *
21
23
  * for I18n, we suggest to use the global configuration
22
24
  * override any configuration parameters provided for this
23
- * @defaultValue 'Page navigation'
25
+ *
26
+ * @defaultValue `'Page navigation'`
24
27
  */
25
28
  ariaLabel: string;
26
29
  /**
27
30
  * The label for the "active" page.
28
31
  * for I18n, we suggest to use the global configuration
29
32
  * override any configuration parameters provided for this
30
- * @defaultValue '(current)'
33
+ *
34
+ * @defaultValue
35
+ * ```ts
36
+ * '(current)'
37
+ * ```
31
38
  */
32
39
  activeLabel: string;
33
40
  /**
34
41
  * The label for the "First" page button.
35
42
  * for I18n, we suggest to use the global configuration
36
43
  * override any configuration parameters provided for this
37
- * @defaultValue 'Action link for first page'
44
+ *
45
+ * @defaultValue
46
+ * ```ts
47
+ * 'Action link for first page'
48
+ * ```
38
49
  */
39
50
  ariaFirstLabel: string;
40
51
  /**
41
52
  * The label for the "Previous" page button.
42
53
  * for I18n, we suggest to use the global configuration
43
54
  * override any configuration parameters provided for this
44
- * @defaultValue 'Action link for previous page'
55
+ *
56
+ * @defaultValue
57
+ * ```ts
58
+ * 'Action link for previous page'
59
+ * ```
45
60
  */
46
61
  ariaPreviousLabel: string;
47
62
  /**
48
63
  * The label for the "Next" page button.
49
64
  * for I18n, we suggest to use the global configuration
50
65
  * override any configuration parameters provided for this
51
- * @defaultValue 'Action link for next page'
66
+ *
67
+ * @defaultValue
68
+ * ```ts
69
+ * 'Action link for next page'
70
+ * ```
52
71
  */
53
72
  ariaNextLabel: string;
54
73
  /**
55
74
  * The label for the "Last" page button.
56
75
  * for I18n, we suggest to use the global configuration
57
76
  * override any configuration parameters provided for this
58
- * @defaultValue 'Action link for last page'
77
+ *
78
+ * @defaultValue
79
+ * ```ts
80
+ * 'Action link for last page'
81
+ * ```
59
82
  */
60
83
  ariaLastLabel: string;
61
84
  /**
62
85
  * The label for the "Ellipsis" page.
63
86
  * for I18n, we suggest to use the global configuration
64
87
  * override any configuration parameters provided for this
65
- * @defaultValue 'Ellipsis page element'
88
+ *
89
+ * @defaultValue `'Ellipsis page element'`
66
90
  */
67
91
  ariaEllipsisLabel: string;
68
92
  /**
69
93
  * If `true`, pagination links will be disabled.
70
- * @defaultValue false
94
+ *
95
+ * @defaultValue `false`
71
96
  */
72
97
  disabled: boolean;
73
98
  /**
74
99
  * If `true`, the "Next" and "Previous" page links are shown.
75
- * @defaultValue true
100
+ *
101
+ * @defaultValue `true`
76
102
  */
77
103
  directionLinks: boolean;
78
104
  /**
79
105
  * If `true`, the "First" and "Last" page links are shown.
80
- * @defaultValue false
106
+ *
107
+ * @defaultValue `false`
81
108
  */
82
109
  boundaryLinks: boolean;
83
110
  }
@@ -91,13 +118,15 @@ export interface PaginationProps extends PaginationCommonPropsAndState {
91
118
  * Ex. if you have 100 items in your collection and displaying 20 items per page, you'll end up with 5 pages.
92
119
  *
93
120
  * Whatever the collectionSize the page number is of minimum 1.
94
- * @defaultValue 0
121
+ *
122
+ * @defaultValue `0`
95
123
  */
96
124
  collectionSize: number;
97
125
  /**
98
126
  * The number of items per page.
99
- * @defaultValue 10
100
127
  * @remarks min value is 1
128
+ *
129
+ * @defaultValue `10`
101
130
  */
102
131
  pageSize: number;
103
132
  /**
@@ -118,15 +147,16 @@ export interface PaginationProps extends PaginationCommonPropsAndState {
118
147
  * Use Page slot to customize the pages view and not this
119
148
  * @param page - The current page number
120
149
  * @param pageCount - The total number of pages
150
+ *
121
151
  * @defaultValue
122
152
  * ```ts
123
- * ({page, pageCount}) => {
124
- * const pages: number[] = [];
125
- * for (let i = 1; i <= pageCount; i++) {
126
- * pages.push(i);
153
+ * (_page: number, pageCount: number) => {
154
+ * const pages: number[] = [];
155
+ * for (let i = 1; i <= pageCount; i++) {
156
+ * pages.push(i);
157
+ * }
158
+ * return pages;
127
159
  * }
128
- * return pages;
129
- * }
130
160
  * ```
131
161
  */
132
162
  pagesFactory: (page: number, pageCount: number) => number[];
@@ -137,9 +167,10 @@ export interface PaginationProps extends PaginationCommonPropsAndState {
137
167
  * override any configuration parameters provided for this
138
168
  * @param processPage - The current page number
139
169
  * @param pageCount - The total number of pages
170
+ *
140
171
  * @defaultValue
141
172
  * ```ts
142
- * ({processPage, pageCount}) => `Page ${processPage} of ${pageCount}`
173
+ * (processPage: number, pageCount: number) => `Page ${processPage} of ${pageCount}`
143
174
  * ```
144
175
  */
145
176
  ariaPageLabel: (processPage: number, pageCount: number) => string;
@@ -150,9 +181,10 @@ export interface PaginationProps extends PaginationCommonPropsAndState {
150
181
  * override any configuration parameters provided for this
151
182
  * @param currentPage - The current page number
152
183
  * @param pageCount - The total number of pages
184
+ *
153
185
  * @defaultValue
154
186
  * ```ts
155
- * ({currentPage, pageCount}) => `Current page is ${currentPage}`
187
+ * (currentPage: number, pageCount: number) => `Current page is ${currentPage}`
156
188
  * ```
157
189
  */
158
190
  ariaLiveLabel: (currentPage: number, pageCount: number) => string;
@@ -160,9 +192,10 @@ export interface PaginationProps extends PaginationCommonPropsAndState {
160
192
  * Factory function providing the href for a "Page" page anchor,
161
193
  * based on the current page number
162
194
  * @param pageNumber - The index to use in the link
195
+ *
163
196
  * @defaultValue
164
197
  * ```ts
165
- * (_pageNumber) => '#'
198
+ * (_page: number) => PAGE_LINK_DEFAULT
166
199
  * ```
167
200
  */
168
201
  pageLink: (pageNumber: number) => string;
@@ -270,13 +303,15 @@ export declare function getPaginationDefaultConfig(): {
270
303
  * Ex. if you have 100 items in your collection and displaying 20 items per page, you'll end up with 5 pages.
271
304
  *
272
305
  * Whatever the collectionSize the page number is of minimum 1.
273
- * @defaultValue 0
306
+ *
307
+ * @defaultValue `0`
274
308
  */
275
309
  collectionSize: number;
276
310
  /**
277
311
  * The number of items per page.
278
- * @defaultValue 10
279
312
  * @remarks min value is 1
313
+ *
314
+ * @defaultValue `10`
280
315
  */
281
316
  pageSize: number;
282
317
  /**
@@ -297,15 +332,16 @@ export declare function getPaginationDefaultConfig(): {
297
332
  * Use Page slot to customize the pages view and not this
298
333
  * @param page - The current page number
299
334
  * @param pageCount - The total number of pages
335
+ *
300
336
  * @defaultValue
301
337
  * ```ts
302
- * ({page, pageCount}) => {
303
- * const pages: number[] = [];
304
- * for (let i = 1; i <= pageCount; i++) {
305
- * pages.push(i);
338
+ * (_page: number, pageCount: number) => {
339
+ * const pages: number[] = [];
340
+ * for (let i = 1; i <= pageCount; i++) {
341
+ * pages.push(i);
342
+ * }
343
+ * return pages;
306
344
  * }
307
- * return pages;
308
- * }
309
345
  * ```
310
346
  */
311
347
  pagesFactory: (page: number, pageCount: number) => number[];
@@ -316,9 +352,10 @@ export declare function getPaginationDefaultConfig(): {
316
352
  * override any configuration parameters provided for this
317
353
  * @param processPage - The current page number
318
354
  * @param pageCount - The total number of pages
355
+ *
319
356
  * @defaultValue
320
357
  * ```ts
321
- * ({processPage, pageCount}) => `Page ${processPage} of ${pageCount}`
358
+ * (processPage: number, pageCount: number) => `Page ${processPage} of ${pageCount}`
322
359
  * ```
323
360
  */
324
361
  ariaPageLabel: (processPage: number, pageCount: number) => string;
@@ -329,9 +366,10 @@ export declare function getPaginationDefaultConfig(): {
329
366
  * override any configuration parameters provided for this
330
367
  * @param currentPage - The current page number
331
368
  * @param pageCount - The total number of pages
369
+ *
332
370
  * @defaultValue
333
371
  * ```ts
334
- * ({currentPage, pageCount}) => `Current page is ${currentPage}`
372
+ * (currentPage: number, pageCount: number) => `Current page is ${currentPage}`
335
373
  * ```
336
374
  */
337
375
  ariaLiveLabel: (currentPage: number, pageCount: number) => string;
@@ -339,9 +377,10 @@ export declare function getPaginationDefaultConfig(): {
339
377
  * Factory function providing the href for a "Page" page anchor,
340
378
  * based on the current page number
341
379
  * @param pageNumber - The index to use in the link
380
+ *
342
381
  * @defaultValue
343
382
  * ```ts
344
- * (_pageNumber) => '#'
383
+ * (_page: number) => PAGE_LINK_DEFAULT
345
384
  * ```
346
385
  */
347
386
  pageLink: (pageNumber: number) => string;
@@ -349,14 +388,16 @@ export declare function getPaginationDefaultConfig(): {
349
388
  * The current page.
350
389
  *
351
390
  * Page numbers start with `1`.
352
- * @defaultValue 1
391
+ *
392
+ * @defaultValue `1`
353
393
  */
354
394
  page: number;
355
395
  /**
356
396
  * The pagination display size.
357
397
  *
358
398
  * Bootstrap currently supports small and large sizes.
359
- * @defaultValue null
399
+ *
400
+ * @defaultValue `null`
360
401
  */
361
402
  size: "sm" | "lg" | null;
362
403
  /**
@@ -364,64 +405,89 @@ export declare function getPaginationDefaultConfig(): {
364
405
  *
365
406
  * for I18n, we suggest to use the global configuration
366
407
  * override any configuration parameters provided for this
367
- * @defaultValue 'Page navigation'
408
+ *
409
+ * @defaultValue `'Page navigation'`
368
410
  */
369
411
  ariaLabel: string;
370
412
  /**
371
413
  * The label for the "active" page.
372
414
  * for I18n, we suggest to use the global configuration
373
415
  * override any configuration parameters provided for this
374
- * @defaultValue '(current)'
416
+ *
417
+ * @defaultValue
418
+ * ```ts
419
+ * '(current)'
420
+ * ```
375
421
  */
376
422
  activeLabel: string;
377
423
  /**
378
424
  * The label for the "First" page button.
379
425
  * for I18n, we suggest to use the global configuration
380
426
  * override any configuration parameters provided for this
381
- * @defaultValue 'Action link for first page'
427
+ *
428
+ * @defaultValue
429
+ * ```ts
430
+ * 'Action link for first page'
431
+ * ```
382
432
  */
383
433
  ariaFirstLabel: string;
384
434
  /**
385
435
  * The label for the "Previous" page button.
386
436
  * for I18n, we suggest to use the global configuration
387
437
  * override any configuration parameters provided for this
388
- * @defaultValue 'Action link for previous page'
438
+ *
439
+ * @defaultValue
440
+ * ```ts
441
+ * 'Action link for previous page'
442
+ * ```
389
443
  */
390
444
  ariaPreviousLabel: string;
391
445
  /**
392
446
  * The label for the "Next" page button.
393
447
  * for I18n, we suggest to use the global configuration
394
448
  * override any configuration parameters provided for this
395
- * @defaultValue 'Action link for next page'
449
+ *
450
+ * @defaultValue
451
+ * ```ts
452
+ * 'Action link for next page'
453
+ * ```
396
454
  */
397
455
  ariaNextLabel: string;
398
456
  /**
399
457
  * The label for the "Last" page button.
400
458
  * for I18n, we suggest to use the global configuration
401
459
  * override any configuration parameters provided for this
402
- * @defaultValue 'Action link for last page'
460
+ *
461
+ * @defaultValue
462
+ * ```ts
463
+ * 'Action link for last page'
464
+ * ```
403
465
  */
404
466
  ariaLastLabel: string;
405
467
  /**
406
468
  * The label for the "Ellipsis" page.
407
469
  * for I18n, we suggest to use the global configuration
408
470
  * override any configuration parameters provided for this
409
- * @defaultValue 'Ellipsis page element'
471
+ *
472
+ * @defaultValue `'Ellipsis page element'`
410
473
  */
411
474
  ariaEllipsisLabel: string;
412
475
  /**
413
476
  * If `true`, pagination links will be disabled.
414
- * @defaultValue false
477
+ *
478
+ * @defaultValue `false`
415
479
  */
416
480
  disabled: boolean;
417
481
  /**
418
482
  * If `true`, the "Next" and "Previous" page links are shown.
419
- * @defaultValue true
483
+ *
484
+ * @defaultValue `true`
420
485
  */
421
486
  directionLinks: boolean;
422
487
  /**
423
488
  * If `true`, the "First" and "Last" page links are shown.
424
- * @defaultValue false
489
+ *
490
+ * @defaultValue `false`
425
491
  */
426
492
  boundaryLinks: boolean;
427
493
  className: string;
@@ -432,3 +498,4 @@ export declare function getPaginationDefaultConfig(): {
432
498
  * @returns a PaginationWidget
433
499
  */
434
500
  export declare function createPagination(config?: PropsConfig<PaginationProps>): PaginationWidget;
501
+ export {};
@@ -1,23 +1,28 @@
1
1
  import type { Directive, PropsConfig, Widget } from '../../types';
2
2
  import type { WidgetsCommonPropsAndState } from '../commonProps';
3
- export interface ProgressbarCommonPropsAndState extends WidgetsCommonPropsAndState {
3
+ interface ProgressbarCommonPropsAndState extends WidgetsCommonPropsAndState {
4
4
  /**
5
5
  * The minimum value.
6
- * @defaultValue 0
6
+ *
7
+ * @defaultValue `0`
7
8
  */
8
9
  min: number;
9
10
  /**
10
11
  * The maximum value.
11
- * @defaultValue 100
12
+ *
13
+ * @defaultValue `100`
12
14
  */
13
15
  max: number;
14
16
  /**
15
17
  * The current value.
16
- * @defaultValue 0
18
+ *
19
+ * @defaultValue `0`
17
20
  */
18
21
  value: number;
19
22
  /**
20
23
  * The aria label.
24
+ *
25
+ * @defaultValue `'Progressbar'`
21
26
  */
22
27
  ariaLabel: string;
23
28
  }
@@ -51,6 +56,11 @@ export interface ProgressbarProps extends ProgressbarCommonPropsAndState {
51
56
  * @param value - current value
52
57
  * @param minimum - minimum value
53
58
  * @param maximum - maximum value
59
+ *
60
+ * @defaultValue
61
+ * ```ts
62
+ * () => undefined
63
+ * ```
54
64
  */
55
65
  ariaValueTextFn: (value: number, minimum: number, maximum: number) => string | undefined;
56
66
  }
@@ -68,3 +78,4 @@ export declare function getProgressbarDefaultConfig(): ProgressbarProps;
68
78
  * @returns an ProgressbarWidget
69
79
  */
70
80
  export declare function createProgressbar(config?: PropsConfig<ProgressbarProps>): ProgressbarWidget;
81
+ export {};
@@ -10,40 +10,56 @@ export interface StarContext {
10
10
  */
11
11
  index: number;
12
12
  }
13
- export interface RatingCommonPropsAndState extends WidgetsCommonPropsAndState {
13
+ interface RatingCommonPropsAndState extends WidgetsCommonPropsAndState {
14
14
  /**
15
15
  * The current rating. Could be a decimal value like `3.75`.
16
+ *
17
+ * @defaultValue `0`
16
18
  */
17
19
  rating: number;
18
20
  /**
19
21
  * The maximum rating that can be given.
22
+ *
23
+ * @defaultValue `10`
20
24
  */
21
25
  maxRating: number;
22
26
  /**
23
27
  * If `true`, the rating is disabled.
28
+ *
29
+ * @defaultValue `false`
24
30
  */
25
31
  disabled: boolean;
26
32
  /**
27
33
  * If `true`, the rating can't be changed.
34
+ *
35
+ * @defaultValue `false`
28
36
  */
29
37
  readonly: boolean;
30
38
  /**
31
39
  * Define if the rating can be reset.
32
40
  *
33
41
  * If set to true, the user can 'unset' the rating value by cliking on the current rating value.
42
+ *
43
+ * @defaultValue `true`
34
44
  */
35
45
  resettable: boolean;
36
46
  /**
37
47
  * Allows setting a custom rating tabindex.
38
48
  * If the component is disabled, `tabindex` will still be set to `-1`.
49
+ *
50
+ * @defaultValue `0`
39
51
  */
40
52
  tabindex: number;
41
53
  /**
42
54
  * The aria label
55
+ *
56
+ * @defaultValue `'Rating'`
43
57
  */
44
58
  ariaLabel: string;
45
59
  /**
46
60
  * The aria labelled by
61
+ *
62
+ * @defaultValue `''`
47
63
  */
48
64
  ariaLabelledBy: string;
49
65
  }
@@ -52,24 +68,44 @@ export interface RatingProps extends RatingCommonPropsAndState {
52
68
  * Return the value for the 'aria-valuetext' attribute.
53
69
  * @param rating - Current rating value.
54
70
  * @param maxRating - maxRating value.
71
+ *
72
+ * @defaultValue
73
+ * ```ts
74
+ * (rating: number, maxRating: number) => `${rating} out of ${maxRating}`
75
+ * ```
55
76
  */
56
77
  ariaValueTextFn: (rating: number, maxRating: number) => string;
57
78
  /**
58
79
  * An event emitted when the rating is changed.
59
80
  *
60
81
  * Event payload is equal to the newly selected rating.
82
+ *
83
+ * @defaultValue
84
+ * ```ts
85
+ * () => {}
86
+ * ```
61
87
  */
62
88
  onRatingChange: (rating: number) => void;
63
89
  /**
64
90
  * An event emitted when the user is hovering over a given rating.
65
91
  *
66
92
  * Event payload is equal to the rating being hovered over.
93
+ *
94
+ * @defaultValue
95
+ * ```ts
96
+ * () => {}
97
+ * ```
67
98
  */
68
99
  onHover: (rating: number) => void;
69
100
  /**
70
101
  * An event emitted when the user stops hovering over a given rating.
71
102
  *
72
103
  * Event payload is equal to the rating of the last item being hovered over.
104
+ *
105
+ * @defaultValue
106
+ * ```ts
107
+ * () => {}
108
+ * ```
73
109
  */
74
110
  onLeave: (rating: number) => void;
75
111
  }
@@ -142,59 +178,95 @@ export declare function getRatingDefaultConfig(): {
142
178
  * Return the value for the 'aria-valuetext' attribute.
143
179
  * @param rating - Current rating value.
144
180
  * @param maxRating - maxRating value.
181
+ *
182
+ * @defaultValue
183
+ * ```ts
184
+ * (rating: number, maxRating: number) => `${rating} out of ${maxRating}`
185
+ * ```
145
186
  */
146
187
  ariaValueTextFn: (rating: number, maxRating: number) => string;
147
188
  /**
148
189
  * An event emitted when the rating is changed.
149
190
  *
150
191
  * Event payload is equal to the newly selected rating.
192
+ *
193
+ * @defaultValue
194
+ * ```ts
195
+ * () => {}
196
+ * ```
151
197
  */
152
198
  onRatingChange: (rating: number) => void;
153
199
  /**
154
200
  * An event emitted when the user is hovering over a given rating.
155
201
  *
156
202
  * Event payload is equal to the rating being hovered over.
203
+ *
204
+ * @defaultValue
205
+ * ```ts
206
+ * () => {}
207
+ * ```
157
208
  */
158
209
  onHover: (rating: number) => void;
159
210
  /**
160
211
  * An event emitted when the user stops hovering over a given rating.
161
212
  *
162
213
  * Event payload is equal to the rating of the last item being hovered over.
214
+ *
215
+ * @defaultValue
216
+ * ```ts
217
+ * () => {}
218
+ * ```
163
219
  */
164
220
  onLeave: (rating: number) => void;
165
221
  /**
166
222
  * The current rating. Could be a decimal value like `3.75`.
223
+ *
224
+ * @defaultValue `0`
167
225
  */
168
226
  rating: number;
169
227
  /**
170
228
  * The maximum rating that can be given.
229
+ *
230
+ * @defaultValue `10`
171
231
  */
172
232
  maxRating: number;
173
233
  /**
174
234
  * If `true`, the rating is disabled.
235
+ *
236
+ * @defaultValue `false`
175
237
  */
176
238
  disabled: boolean;
177
239
  /**
178
240
  * If `true`, the rating can't be changed.
241
+ *
242
+ * @defaultValue `false`
179
243
  */
180
244
  readonly: boolean;
181
245
  /**
182
246
  * Define if the rating can be reset.
183
247
  *
184
248
  * If set to true, the user can 'unset' the rating value by cliking on the current rating value.
249
+ *
250
+ * @defaultValue `true`
185
251
  */
186
252
  resettable: boolean;
187
253
  /**
188
254
  * Allows setting a custom rating tabindex.
189
255
  * If the component is disabled, `tabindex` will still be set to `-1`.
256
+ *
257
+ * @defaultValue `0`
190
258
  */
191
259
  tabindex: number;
192
260
  /**
193
261
  * The aria label
262
+ *
263
+ * @defaultValue `'Rating'`
194
264
  */
195
265
  ariaLabel: string;
196
266
  /**
197
267
  * The aria labelled by
268
+ *
269
+ * @defaultValue `''`
198
270
  */
199
271
  ariaLabelledBy: string;
200
272
  className: string;
@@ -205,3 +277,4 @@ export declare function getRatingDefaultConfig(): {
205
277
  * @returns a RatingWidget
206
278
  */
207
279
  export declare function createRating(config?: PropsConfig<RatingProps>): RatingWidget;
280
+ export {};
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const select = require("../../select-CBlGWfZY.cjs");
3
+ const select = require("../../select-BBiF-m3N.cjs");
4
4
  exports.createSelect = select.createSelect;
5
- exports.defaultConfig = select.defaultConfig;
6
5
  exports.getSelectDefaultConfig = select.getSelectDefaultConfig;
@@ -1,6 +1,5 @@
1
- import { c, d, g } from "../../select-BS0mh7Qk.js";
1
+ import { c, g } from "../../select-jUrt_lSn.js";
2
2
  export {
3
3
  c as createSelect,
4
- d as defaultConfig,
5
4
  g as getSelectDefaultConfig
6
5
  };