@design-factory/angular 21.0.4 → 21.1.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/drawer/README.md +54 -0
- package/fesm2022/design-factory-angular-drawer.mjs +202 -67
- package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
- package/fesm2022/design-factory-angular-internals.mjs +439 -17
- package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
- package/fesm2022/design-factory-angular-sidenav.mjs +223 -210
- package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
- package/fesm2022/design-factory-angular-theme.mjs +198 -0
- package/fesm2022/design-factory-angular-theme.mjs.map +1 -0
- package/fesm2022/design-factory-angular-topnav.mjs +1538 -0
- package/fesm2022/design-factory-angular-topnav.mjs.map +1 -0
- package/node_modules/@agnos-ui/core/README.md +5 -0
- package/node_modules/@agnos-ui/core/accordion-BC_9xn23.cjs +314 -0
- package/node_modules/@agnos-ui/core/accordion-Ca_0T8Bc.js +315 -0
- package/node_modules/@agnos-ui/core/alert-AhaliJ17.cjs +9 -0
- package/node_modules/@agnos-ui/core/alert-Cb9FhbFQ.js +10 -0
- package/node_modules/@agnos-ui/core/collapse-COriZO7o.cjs +94 -0
- package/node_modules/@agnos-ui/core/collapse-CP79atna.js +95 -0
- package/node_modules/@agnos-ui/core/common-B5jS-Ih_.cjs +73 -0
- package/node_modules/@agnos-ui/core/common-DFyZvkII.js +74 -0
- package/node_modules/@agnos-ui/core/components/accordion/accordion.d.ts +333 -0
- package/node_modules/@agnos-ui/core/components/accordion/index.cjs +7 -0
- package/node_modules/@agnos-ui/core/components/accordion/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/accordion/index.js +7 -0
- package/node_modules/@agnos-ui/core/components/alert/alert.d.ts +37 -0
- package/node_modules/@agnos-ui/core/components/alert/common.d.ts +138 -0
- package/node_modules/@agnos-ui/core/components/alert/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/alert/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/alert/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/carousel/carousel.d.ts +247 -0
- package/node_modules/@agnos-ui/core/components/carousel/index.cjs +292 -0
- package/node_modules/@agnos-ui/core/components/carousel/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/carousel/index.js +292 -0
- package/node_modules/@agnos-ui/core/components/collapse/collapse.d.ts +135 -0
- package/node_modules/@agnos-ui/core/components/collapse/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/collapse/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/collapse/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/commonProps.d.ts +11 -0
- package/node_modules/@agnos-ui/core/components/drawer/drawer.d.ts +279 -0
- package/node_modules/@agnos-ui/core/components/drawer/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/drawer/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/drawer/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/modal/index.cjs +8 -0
- package/node_modules/@agnos-ui/core/components/modal/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/modal/index.js +8 -0
- package/node_modules/@agnos-ui/core/components/modal/modal.d.ts +245 -0
- package/node_modules/@agnos-ui/core/components/pagination/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/pagination/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/pagination/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/pagination/pagination.d.ts +313 -0
- package/node_modules/@agnos-ui/core/components/progressbar/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/progressbar/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/progressbar/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/progressbar/progressbar.d.ts +91 -0
- package/node_modules/@agnos-ui/core/components/rating/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/rating/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/rating/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/rating/rating.d.ts +191 -0
- package/node_modules/@agnos-ui/core/components/slider/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/slider/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/slider/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/slider/slider-utils.d.ts +25 -0
- package/node_modules/@agnos-ui/core/components/slider/slider.d.ts +383 -0
- package/node_modules/@agnos-ui/core/components/toast/index.cjs +7 -0
- package/node_modules/@agnos-ui/core/components/toast/index.d.ts +2 -0
- package/node_modules/@agnos-ui/core/components/toast/index.js +7 -0
- package/node_modules/@agnos-ui/core/components/toast/toast.d.ts +66 -0
- package/node_modules/@agnos-ui/core/components/toast/toaster.d.ts +128 -0
- package/node_modules/@agnos-ui/core/components/tree/index.cjs +5 -0
- package/node_modules/@agnos-ui/core/components/tree/index.d.ts +1 -0
- package/node_modules/@agnos-ui/core/components/tree/index.js +5 -0
- package/node_modules/@agnos-ui/core/components/tree/tree.d.ts +143 -0
- package/node_modules/@agnos-ui/core/config.cjs +36 -0
- package/node_modules/@agnos-ui/core/config.d.ts +117 -0
- package/node_modules/@agnos-ui/core/config.js +36 -0
- package/node_modules/@agnos-ui/core/directive-Bsreu2z1.js +523 -0
- package/node_modules/@agnos-ui/core/directive-DCaXmRe_.cjs +522 -0
- package/node_modules/@agnos-ui/core/drawer-BbFAHV07.cjs +328 -0
- package/node_modules/@agnos-ui/core/drawer-C6Qa0xEu.js +329 -0
- package/node_modules/@agnos-ui/core/index.cjs +134 -0
- package/node_modules/@agnos-ui/core/index.d.ts +29 -0
- package/node_modules/@agnos-ui/core/index.js +134 -0
- package/node_modules/@agnos-ui/core/isFocusable-Ckwus82R.js +32 -0
- package/node_modules/@agnos-ui/core/isFocusable-DfzDLeAN.cjs +31 -0
- package/node_modules/@agnos-ui/core/modal-BsNuHhT7.cjs +252 -0
- package/node_modules/@agnos-ui/core/modal-CgzY8ezz.js +253 -0
- package/node_modules/@agnos-ui/core/package.json +57 -0
- package/node_modules/@agnos-ui/core/pagination-ZxGaNWZz.js +255 -0
- package/node_modules/@agnos-ui/core/pagination-xbcOHnhd.cjs +254 -0
- package/node_modules/@agnos-ui/core/progressbar-CRbMKp4b.cjs +86 -0
- package/node_modules/@agnos-ui/core/progressbar-CSEIFnlD.js +87 -0
- package/node_modules/@agnos-ui/core/promise-CxCD3NYv.cjs +118 -0
- package/node_modules/@agnos-ui/core/promise-D-RZVPuv.js +119 -0
- package/node_modules/@agnos-ui/core/rating-BIdiiPUo.js +184 -0
- package/node_modules/@agnos-ui/core/rating-qx1xaBmz.cjs +183 -0
- package/node_modules/@agnos-ui/core/scrollbars-CT87iv_6.cjs +30 -0
- package/node_modules/@agnos-ui/core/scrollbars-CcxSrnCx.js +31 -0
- package/node_modules/@agnos-ui/core/services/extendWidget.cjs +41 -0
- package/node_modules/@agnos-ui/core/services/extendWidget.d.ts +31 -0
- package/node_modules/@agnos-ui/core/services/extendWidget.js +41 -0
- package/node_modules/@agnos-ui/core/services/floatingUI.cjs +111 -0
- package/node_modules/@agnos-ui/core/services/floatingUI.d.ts +76 -0
- package/node_modules/@agnos-ui/core/services/floatingUI.js +111 -0
- package/node_modules/@agnos-ui/core/services/focusElement.cjs +46 -0
- package/node_modules/@agnos-ui/core/services/focusElement.d.ts +9 -0
- package/node_modules/@agnos-ui/core/services/focusElement.js +46 -0
- package/node_modules/@agnos-ui/core/services/focustrack.cjs +47 -0
- package/node_modules/@agnos-ui/core/services/focustrack.d.ts +40 -0
- package/node_modules/@agnos-ui/core/services/focustrack.js +47 -0
- package/node_modules/@agnos-ui/core/services/hash.cjs +15 -0
- package/node_modules/@agnos-ui/core/services/hash.d.ts +3 -0
- package/node_modules/@agnos-ui/core/services/hash.js +15 -0
- package/node_modules/@agnos-ui/core/services/intersection.cjs +53 -0
- package/node_modules/@agnos-ui/core/services/intersection.d.ts +30 -0
- package/node_modules/@agnos-ui/core/services/intersection.js +53 -0
- package/node_modules/@agnos-ui/core/services/matchMedia.cjs +14 -0
- package/node_modules/@agnos-ui/core/services/matchMedia.d.ts +8 -0
- package/node_modules/@agnos-ui/core/services/matchMedia.js +14 -0
- package/node_modules/@agnos-ui/core/services/navManager.cjs +166 -0
- package/node_modules/@agnos-ui/core/services/navManager.d.ts +144 -0
- package/node_modules/@agnos-ui/core/services/navManager.js +166 -0
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.cjs +60 -0
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.d.ts +42 -0
- package/node_modules/@agnos-ui/core/services/pointerdownPosition.js +60 -0
- package/node_modules/@agnos-ui/core/services/portal.cjs +42 -0
- package/node_modules/@agnos-ui/core/services/portal.d.ts +16 -0
- package/node_modules/@agnos-ui/core/services/portal.js +42 -0
- package/node_modules/@agnos-ui/core/services/resizeObserver.cjs +54 -0
- package/node_modules/@agnos-ui/core/services/resizeObserver.d.ts +18 -0
- package/node_modules/@agnos-ui/core/services/resizeObserver.js +54 -0
- package/node_modules/@agnos-ui/core/services/siblingsInert.cjs +44 -0
- package/node_modules/@agnos-ui/core/services/siblingsInert.d.ts +16 -0
- package/node_modules/@agnos-ui/core/services/siblingsInert.js +44 -0
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.cjs +186 -0
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.d.ts +166 -0
- package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.js +186 -0
- package/node_modules/@agnos-ui/core/services/transitions/collapse.cjs +40 -0
- package/node_modules/@agnos-ui/core/services/transitions/collapse.d.ts +49 -0
- package/node_modules/@agnos-ui/core/services/transitions/collapse.js +40 -0
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.cjs +32 -0
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.d.ts +25 -0
- package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.js +32 -0
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.cjs +37 -0
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.d.ts +47 -0
- package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.js +37 -0
- package/node_modules/@agnos-ui/core/slider-B93hE0ag.cjs +807 -0
- package/node_modules/@agnos-ui/core/slider-Cjiq9FgI.js +808 -0
- package/node_modules/@agnos-ui/core/textDirection-cNgt24LJ.js +4 -0
- package/node_modules/@agnos-ui/core/textDirection-zqcZ5-eK.cjs +3 -0
- package/node_modules/@agnos-ui/core/toaster-BQWqxYv-.cjs +190 -0
- package/node_modules/@agnos-ui/core/toaster-BzEkshT2.js +191 -0
- package/node_modules/@agnos-ui/core/tree-DY04XPPg.cjs +228 -0
- package/node_modules/@agnos-ui/core/tree-HwcvZ0_p.js +229 -0
- package/node_modules/@agnos-ui/core/types.cjs +6 -0
- package/node_modules/@agnos-ui/core/types.d.ts +246 -0
- package/node_modules/@agnos-ui/core/types.js +6 -0
- package/node_modules/@agnos-ui/core/utils/directive.cjs +28 -0
- package/node_modules/@agnos-ui/core/utils/directive.d.ts +352 -0
- package/node_modules/@agnos-ui/core/utils/directive.js +28 -0
- package/node_modules/@agnos-ui/core/utils/func.cjs +7 -0
- package/node_modules/@agnos-ui/core/utils/func.d.ts +11 -0
- package/node_modules/@agnos-ui/core/utils/func.js +7 -0
- package/node_modules/@agnos-ui/core/utils/id.cjs +5 -0
- package/node_modules/@agnos-ui/core/utils/id.d.ts +6 -0
- package/node_modules/@agnos-ui/core/utils/id.js +5 -0
- package/node_modules/@agnos-ui/core/utils/internal/assign.d.ts +10 -0
- package/node_modules/@agnos-ui/core/utils/internal/checks.d.ts +57 -0
- package/node_modules/@agnos-ui/core/utils/internal/dom.d.ts +75 -0
- package/node_modules/@agnos-ui/core/utils/internal/isFocusable.d.ts +9 -0
- package/node_modules/@agnos-ui/core/utils/internal/math.d.ts +5 -0
- package/node_modules/@agnos-ui/core/utils/internal/promise.d.ts +98 -0
- package/node_modules/@agnos-ui/core/utils/internal/scrollbars.d.ts +8 -0
- package/node_modules/@agnos-ui/core/utils/internal/sort.d.ts +16 -0
- package/node_modules/@agnos-ui/core/utils/internal/ssrHTMLElement.d.ts +17 -0
- package/node_modules/@agnos-ui/core/utils/internal/textDirection.d.ts +7 -0
- package/node_modules/@agnos-ui/core/utils/internal/traversal.d.ts +54 -0
- package/node_modules/@agnos-ui/core/utils/stores.cjs +172 -0
- package/node_modules/@agnos-ui/core/utils/stores.d.ts +224 -0
- package/node_modules/@agnos-ui/core/utils/stores.js +172 -0
- package/node_modules/@agnos-ui/core/utils/widget.cjs +8 -0
- package/node_modules/@agnos-ui/core/utils/widget.d.ts +11 -0
- package/node_modules/@agnos-ui/core/utils/widget.js +8 -0
- package/node_modules/@agnos-ui/core/utils/writables.cjs +16 -0
- package/node_modules/@agnos-ui/core/utils/writables.d.ts +95 -0
- package/node_modules/@agnos-ui/core/utils/writables.js +16 -0
- package/node_modules/@agnos-ui/core/writables-DYGjj5T3.js +103 -0
- package/node_modules/@agnos-ui/core/writables-Dt68gADJ.cjs +102 -0
- package/package.json +25 -6
- package/schematics/collection.json +1 -1
- package/types/design-factory-angular-drawer.d.ts +71 -13
- package/types/design-factory-angular-internals.d.ts +220 -31
- package/types/design-factory-angular-sidenav.d.ts +15 -7
- package/types/design-factory-angular-theme.d.ts +122 -0
- package/types/design-factory-angular-topnav.d.ts +435 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import type { Widget, Directive, WidgetFactory } from '../../types';
|
|
2
|
+
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing the common properties and state for a pagination component.
|
|
5
|
+
*/
|
|
6
|
+
interface PaginationCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
7
|
+
/**
|
|
8
|
+
* The current page.
|
|
9
|
+
*
|
|
10
|
+
* Page numbers start with `1`.
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue `1`
|
|
13
|
+
*/
|
|
14
|
+
page: number;
|
|
15
|
+
/**
|
|
16
|
+
* The label for the nav element.
|
|
17
|
+
*
|
|
18
|
+
* for I18n, we suggest to use the global configuration
|
|
19
|
+
* override any configuration parameters provided for this
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue `'Page navigation'`
|
|
22
|
+
*/
|
|
23
|
+
ariaLabel: string;
|
|
24
|
+
/**
|
|
25
|
+
* The label for the "active" page.
|
|
26
|
+
* for I18n, we suggest to use the global configuration
|
|
27
|
+
* override any configuration parameters provided for this
|
|
28
|
+
*
|
|
29
|
+
* @defaultValue
|
|
30
|
+
* ```ts
|
|
31
|
+
* '(current)'
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
activeLabel: string;
|
|
35
|
+
/**
|
|
36
|
+
* The label for the "First" page button.
|
|
37
|
+
* for I18n, we suggest to use the global configuration
|
|
38
|
+
* override any configuration parameters provided for this
|
|
39
|
+
*
|
|
40
|
+
* @defaultValue
|
|
41
|
+
* ```ts
|
|
42
|
+
* 'Action link for first page'
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
ariaFirstLabel: string;
|
|
46
|
+
/**
|
|
47
|
+
* The label for the "Previous" page button.
|
|
48
|
+
* for I18n, we suggest to use the global configuration
|
|
49
|
+
* override any configuration parameters provided for this
|
|
50
|
+
*
|
|
51
|
+
* @defaultValue
|
|
52
|
+
* ```ts
|
|
53
|
+
* 'Action link for previous page'
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
ariaPreviousLabel: string;
|
|
57
|
+
/**
|
|
58
|
+
* The label for the "Next" page button.
|
|
59
|
+
* for I18n, we suggest to use the global configuration
|
|
60
|
+
* override any configuration parameters provided for this
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue
|
|
63
|
+
* ```ts
|
|
64
|
+
* 'Action link for next page'
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
ariaNextLabel: string;
|
|
68
|
+
/**
|
|
69
|
+
* The label for the "Last" page button.
|
|
70
|
+
* for I18n, we suggest to use the global configuration
|
|
71
|
+
* override any configuration parameters provided for this
|
|
72
|
+
*
|
|
73
|
+
* @defaultValue
|
|
74
|
+
* ```ts
|
|
75
|
+
* 'Action link for last page'
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
ariaLastLabel: string;
|
|
79
|
+
/**
|
|
80
|
+
* The label for the "Ellipsis" page.
|
|
81
|
+
* for I18n, we suggest to use the global configuration
|
|
82
|
+
* override any configuration parameters provided for this
|
|
83
|
+
*
|
|
84
|
+
* @defaultValue `'Ellipsis page element'`
|
|
85
|
+
*/
|
|
86
|
+
ariaEllipsisLabel: string;
|
|
87
|
+
/**
|
|
88
|
+
* If `true`, pagination links will be disabled.
|
|
89
|
+
*
|
|
90
|
+
* @defaultValue `false`
|
|
91
|
+
*/
|
|
92
|
+
disabled: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* If `true`, the "Next" and "Previous" page links are shown.
|
|
95
|
+
*
|
|
96
|
+
* @defaultValue `true`
|
|
97
|
+
*/
|
|
98
|
+
directionLinks: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* If `true`, the "First" and "Last" page links are shown.
|
|
101
|
+
*
|
|
102
|
+
* @defaultValue `false`
|
|
103
|
+
*/
|
|
104
|
+
boundaryLinks: boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Interface representing the properties for the Pagination component.
|
|
108
|
+
*/
|
|
109
|
+
export interface PaginationProps extends PaginationCommonPropsAndState {
|
|
110
|
+
/**
|
|
111
|
+
* The number of items in your paginated collection.
|
|
112
|
+
*
|
|
113
|
+
* Note, that this is not the number of pages. Page numbers are calculated dynamically based on
|
|
114
|
+
* `collectionSize` and `pageSize`.
|
|
115
|
+
*
|
|
116
|
+
* Ex. if you have 100 items in your collection and displaying 20 items per page, you'll end up with 5 pages.
|
|
117
|
+
*
|
|
118
|
+
* Whatever the collectionSize the page number is of minimum 1.
|
|
119
|
+
*
|
|
120
|
+
* @defaultValue `0`
|
|
121
|
+
*/
|
|
122
|
+
collectionSize: number;
|
|
123
|
+
/**
|
|
124
|
+
* The number of items per page.
|
|
125
|
+
* @remarks min value is 1
|
|
126
|
+
*
|
|
127
|
+
* @defaultValue `10`
|
|
128
|
+
*/
|
|
129
|
+
pageSize: number;
|
|
130
|
+
/**
|
|
131
|
+
* An event fired when the page is changed.
|
|
132
|
+
*
|
|
133
|
+
* Event payload is the number of the newly selected page.
|
|
134
|
+
*
|
|
135
|
+
* Page numbers start with `1`.
|
|
136
|
+
* @defaultValue
|
|
137
|
+
* ```ts
|
|
138
|
+
* () => {}
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
onPageChange: (page: number) => void;
|
|
142
|
+
/**
|
|
143
|
+
* pagesFactory returns a function computing the array of pages to be displayed
|
|
144
|
+
* as number (-1 are treated as ellipsis).
|
|
145
|
+
* @param page - The current page number
|
|
146
|
+
* @param pageCount - The total number of pages
|
|
147
|
+
*
|
|
148
|
+
* @defaultValue
|
|
149
|
+
* ```ts
|
|
150
|
+
* (_page: number, pageCount: number) => {
|
|
151
|
+
* const pages: number[] = [];
|
|
152
|
+
* for (let i = 1; i <= pageCount; i++) {
|
|
153
|
+
* pages.push(i);
|
|
154
|
+
* }
|
|
155
|
+
* return pages;
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
pagesFactory: (page: number, pageCount: number) => number[];
|
|
160
|
+
/**
|
|
161
|
+
* Provide the label for each "Page" page button.
|
|
162
|
+
* This is used for accessibility purposes.
|
|
163
|
+
* for I18n, we suggest to use the global configuration
|
|
164
|
+
* override any configuration parameters provided for this
|
|
165
|
+
* @param processPage - The current page number
|
|
166
|
+
* @param pageCount - The total number of pages
|
|
167
|
+
*
|
|
168
|
+
* @defaultValue
|
|
169
|
+
* ```ts
|
|
170
|
+
* (processPage: number, pageCount: number) => `Page ${processPage} of ${pageCount}`
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
ariaPageLabel: (processPage: number, pageCount: number) => string;
|
|
174
|
+
/**
|
|
175
|
+
* Provide the label for the aria-live element
|
|
176
|
+
* This is used for accessibility purposes.
|
|
177
|
+
* for I18n, we suggest to use the global configuration
|
|
178
|
+
* override any configuration parameters provided for this
|
|
179
|
+
* @param currentPage - The current page number
|
|
180
|
+
* @param pageCount - The total number of pages
|
|
181
|
+
*
|
|
182
|
+
* @defaultValue
|
|
183
|
+
* ```ts
|
|
184
|
+
* (currentPage: number) => `Current page is ${currentPage}`
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
ariaLiveLabel: (currentPage: number, pageCount: number) => string;
|
|
188
|
+
/**
|
|
189
|
+
* Factory function providing the href for a "Page" page anchor,
|
|
190
|
+
* based on the current page number
|
|
191
|
+
* @param pageNumber - The index to use in the link
|
|
192
|
+
*
|
|
193
|
+
* @defaultValue
|
|
194
|
+
* ```ts
|
|
195
|
+
* (_page: number) => PAGE_LINK_DEFAULT
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
pageLink: (pageNumber: number) => string;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Interface representing the hrefs for pagination navigation links.
|
|
202
|
+
*/
|
|
203
|
+
export interface DirectionsHrefs {
|
|
204
|
+
/**
|
|
205
|
+
* The href for the 'Previous' navigation link
|
|
206
|
+
*/
|
|
207
|
+
previous: string;
|
|
208
|
+
/**
|
|
209
|
+
* The href for the 'Next' direction link
|
|
210
|
+
*/
|
|
211
|
+
next: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Represents the state of the pagination component.
|
|
215
|
+
*/
|
|
216
|
+
export interface PaginationState extends PaginationCommonPropsAndState {
|
|
217
|
+
/**
|
|
218
|
+
* The number of pages.
|
|
219
|
+
*/
|
|
220
|
+
pageCount: number;
|
|
221
|
+
/**
|
|
222
|
+
* The current pages, the number in the Array is the number of the page.
|
|
223
|
+
*/
|
|
224
|
+
pages: number[];
|
|
225
|
+
/**
|
|
226
|
+
* true if the previous link need to be disabled
|
|
227
|
+
*/
|
|
228
|
+
previousDisabled: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* true if the next link need to be disabled
|
|
231
|
+
*/
|
|
232
|
+
nextDisabled: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* The label for each "Page" page link.
|
|
235
|
+
*/
|
|
236
|
+
pagesLabel: string[];
|
|
237
|
+
/** The hrefs for each "Page" page link */
|
|
238
|
+
pagesHrefs: string[];
|
|
239
|
+
/** The hrefs for the direction links */
|
|
240
|
+
directionsHrefs: DirectionsHrefs;
|
|
241
|
+
/** The aria-live text */
|
|
242
|
+
ariaLiveLabelText: string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Interface representing pagination API for navigating through pages.
|
|
246
|
+
*/
|
|
247
|
+
export interface PaginationApi {
|
|
248
|
+
/**
|
|
249
|
+
* To "go" to a specific page
|
|
250
|
+
* @param page - The page number to select
|
|
251
|
+
*/
|
|
252
|
+
select(page: number): void;
|
|
253
|
+
/**
|
|
254
|
+
* To "go" to the first page
|
|
255
|
+
*/
|
|
256
|
+
first(): void;
|
|
257
|
+
/**
|
|
258
|
+
* To "go" to the previous page
|
|
259
|
+
*/
|
|
260
|
+
previous(): void;
|
|
261
|
+
/**
|
|
262
|
+
* To "go" to the next page
|
|
263
|
+
*/
|
|
264
|
+
next(): void;
|
|
265
|
+
/**
|
|
266
|
+
* To "go" to the last page
|
|
267
|
+
*/
|
|
268
|
+
last(): void;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Interface representing the directives for pagination components.
|
|
272
|
+
*/
|
|
273
|
+
export interface PaginationDirectives {
|
|
274
|
+
/**
|
|
275
|
+
* A directive to be applied to each page link
|
|
276
|
+
* This will handle the click, tabindex and aria attributes
|
|
277
|
+
*/
|
|
278
|
+
pageLink: Directive<{
|
|
279
|
+
page: number;
|
|
280
|
+
}>;
|
|
281
|
+
/**
|
|
282
|
+
* A directive to be applied on the previous link
|
|
283
|
+
*/
|
|
284
|
+
pagePrev: Directive;
|
|
285
|
+
/**
|
|
286
|
+
* A directive to be applied on the first link
|
|
287
|
+
*/
|
|
288
|
+
pageFirst: Directive;
|
|
289
|
+
/**
|
|
290
|
+
* A directive to be applied on the next link
|
|
291
|
+
*/
|
|
292
|
+
pageNext: Directive;
|
|
293
|
+
/**
|
|
294
|
+
* A directive to be applied on the Last link
|
|
295
|
+
*/
|
|
296
|
+
pageLast: Directive;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Represents a pagination widget with specific properties, state, API, actions, and directives.
|
|
300
|
+
*/
|
|
301
|
+
export type PaginationWidget = Widget<PaginationProps, PaginationState, PaginationApi, PaginationDirectives>;
|
|
302
|
+
/**
|
|
303
|
+
* Returns a shallow copy of the default pagination config
|
|
304
|
+
* @returns a copy of the default config
|
|
305
|
+
*/
|
|
306
|
+
export declare function getPaginationDefaultConfig(): PaginationProps;
|
|
307
|
+
/**
|
|
308
|
+
* Create a PaginationWidget with given config props
|
|
309
|
+
* @param config - an optional pagination config
|
|
310
|
+
* @returns a PaginationWidget
|
|
311
|
+
*/
|
|
312
|
+
export declare const createPagination: WidgetFactory<PaginationWidget>;
|
|
313
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const progressbar = require("../../progressbar-CRbMKp4b.cjs");
|
|
4
|
+
exports.createProgressbar = progressbar.createProgressbar;
|
|
5
|
+
exports.getProgressbarDefaultConfig = progressbar.getProgressbarDefaultConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './progressbar';
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Directive, Widget, WidgetFactory } from '../../types';
|
|
2
|
+
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
3
|
+
interface ProgressbarCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
4
|
+
/**
|
|
5
|
+
* The minimum value.
|
|
6
|
+
*
|
|
7
|
+
* @defaultValue `0`
|
|
8
|
+
*/
|
|
9
|
+
min: number;
|
|
10
|
+
/**
|
|
11
|
+
* The maximum value.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue `100`
|
|
14
|
+
*/
|
|
15
|
+
max: number;
|
|
16
|
+
/**
|
|
17
|
+
* The current value.
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue `0`
|
|
20
|
+
*/
|
|
21
|
+
value: number;
|
|
22
|
+
/**
|
|
23
|
+
* The aria label.
|
|
24
|
+
*
|
|
25
|
+
* @defaultValue `'Progressbar'`
|
|
26
|
+
*/
|
|
27
|
+
ariaLabel: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Interface representing directives for a progress bar component.
|
|
31
|
+
*/
|
|
32
|
+
export interface ProgressbarDirectives {
|
|
33
|
+
/**
|
|
34
|
+
* A directive to be applied to the main container that handles aria attributes.
|
|
35
|
+
*/
|
|
36
|
+
ariaDirective: Directive;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Represents the state of a progress bar component.
|
|
40
|
+
*/
|
|
41
|
+
export interface ProgressbarState extends ProgressbarCommonPropsAndState {
|
|
42
|
+
/**
|
|
43
|
+
* Percentage of completion.
|
|
44
|
+
*/
|
|
45
|
+
percentage: number;
|
|
46
|
+
/**
|
|
47
|
+
* `true` if the value is above its minimum value.
|
|
48
|
+
*/
|
|
49
|
+
started: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* `true` if the value has reached its maximum value.
|
|
52
|
+
*/
|
|
53
|
+
finished: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The aria value text.
|
|
56
|
+
*/
|
|
57
|
+
ariaValueText: string | undefined;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Interface representing the properties for the Progressbar component.
|
|
61
|
+
*/
|
|
62
|
+
export interface ProgressbarProps extends ProgressbarCommonPropsAndState {
|
|
63
|
+
/**
|
|
64
|
+
* Return the value for the 'aria-valuetext' attribute.
|
|
65
|
+
* @param value - current value
|
|
66
|
+
* @param minimum - minimum value
|
|
67
|
+
* @param maximum - maximum value
|
|
68
|
+
*
|
|
69
|
+
* @defaultValue
|
|
70
|
+
* ```ts
|
|
71
|
+
* () => undefined
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
ariaValueTextFn: (value: number, minimum: number, maximum: number) => string | undefined;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Represents a Progressbar widget with specific properties, state, API, and directives.
|
|
78
|
+
*/
|
|
79
|
+
export type ProgressbarWidget = Widget<ProgressbarProps, ProgressbarState, object, ProgressbarDirectives>;
|
|
80
|
+
/**
|
|
81
|
+
* Retrieve a shallow copy of the default Progressbar config
|
|
82
|
+
* @returns the default Progressbar config
|
|
83
|
+
*/
|
|
84
|
+
export declare function getProgressbarDefaultConfig(): ProgressbarProps;
|
|
85
|
+
/**
|
|
86
|
+
* Create an ProgressbarWidget with given config props
|
|
87
|
+
* @param config - an optional progress bar config
|
|
88
|
+
* @returns an ProgressbarWidget
|
|
89
|
+
*/
|
|
90
|
+
export declare const createProgressbar: WidgetFactory<ProgressbarWidget>;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './rating';
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import type { Directive, Widget, WidgetFactory } from '../../types';
|
|
2
|
+
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the context for a star in a rating component.
|
|
5
|
+
*/
|
|
6
|
+
export interface StarContext {
|
|
7
|
+
/**
|
|
8
|
+
* indicates how much the current star is filled, from 0 to 100
|
|
9
|
+
*/
|
|
10
|
+
fill: number;
|
|
11
|
+
/**
|
|
12
|
+
* the position of the star in the rating
|
|
13
|
+
*/
|
|
14
|
+
index: number;
|
|
15
|
+
}
|
|
16
|
+
interface RatingCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
17
|
+
/**
|
|
18
|
+
* The current rating. Could be a decimal value like `3.75`.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue `0`
|
|
21
|
+
*/
|
|
22
|
+
rating: number;
|
|
23
|
+
/**
|
|
24
|
+
* The maximum rating that can be given.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue `10`
|
|
27
|
+
*/
|
|
28
|
+
maxRating: number;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, the rating is disabled.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue `false`
|
|
33
|
+
*/
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* If `true`, the rating can't be changed.
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue `false`
|
|
39
|
+
*/
|
|
40
|
+
readonly: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Define if the rating can be reset.
|
|
43
|
+
*
|
|
44
|
+
* If set to true, the user can 'unset' the rating value by cliking on the current rating value.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue `true`
|
|
47
|
+
*/
|
|
48
|
+
resettable: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Allows setting a custom rating tabindex.
|
|
51
|
+
* If the component is disabled, `tabindex` will still be set to `-1`.
|
|
52
|
+
*
|
|
53
|
+
* @defaultValue `0`
|
|
54
|
+
*/
|
|
55
|
+
tabindex: number;
|
|
56
|
+
/**
|
|
57
|
+
* The aria label
|
|
58
|
+
*
|
|
59
|
+
* @defaultValue `'Rating'`
|
|
60
|
+
*/
|
|
61
|
+
ariaLabel: string;
|
|
62
|
+
/**
|
|
63
|
+
* The aria labelled by
|
|
64
|
+
*
|
|
65
|
+
* @defaultValue `''`
|
|
66
|
+
*/
|
|
67
|
+
ariaLabelledBy: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Interface representing the properties for the Rating widget.
|
|
71
|
+
*/
|
|
72
|
+
export interface RatingProps extends RatingCommonPropsAndState {
|
|
73
|
+
/**
|
|
74
|
+
* Return the value for the 'aria-valuetext' attribute.
|
|
75
|
+
* @param rating - Current rating value.
|
|
76
|
+
* @param maxRating - maxRating value.
|
|
77
|
+
*
|
|
78
|
+
* @defaultValue
|
|
79
|
+
* ```ts
|
|
80
|
+
* (rating: number, maxRating: number) => `${rating} out of ${maxRating}`
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
ariaValueTextFn: (rating: number, maxRating: number) => string;
|
|
84
|
+
/**
|
|
85
|
+
* An event emitted when the rating is changed.
|
|
86
|
+
*
|
|
87
|
+
* Event payload is equal to the newly selected rating.
|
|
88
|
+
*
|
|
89
|
+
* @defaultValue
|
|
90
|
+
* ```ts
|
|
91
|
+
* () => {}
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
onRatingChange: (rating: number) => void;
|
|
95
|
+
/**
|
|
96
|
+
* An event emitted when the user is hovering over a given rating.
|
|
97
|
+
*
|
|
98
|
+
* Event payload is equal to the rating being hovered over.
|
|
99
|
+
*
|
|
100
|
+
* @defaultValue
|
|
101
|
+
* ```ts
|
|
102
|
+
* () => {}
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
onHover: (rating: number) => void;
|
|
106
|
+
/**
|
|
107
|
+
* An event emitted when the user stops hovering over a given rating.
|
|
108
|
+
*
|
|
109
|
+
* Event payload is equal to the rating of the last item being hovered over.
|
|
110
|
+
*
|
|
111
|
+
* @defaultValue
|
|
112
|
+
* ```ts
|
|
113
|
+
* () => {}
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
onLeave: (rating: number) => void;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Interface representing directives for a rating component.
|
|
120
|
+
*/
|
|
121
|
+
export interface RatingDirectives {
|
|
122
|
+
/**
|
|
123
|
+
* A directive to be applied to the main container
|
|
124
|
+
* This will handle the keydown, mouseleave, tabindex and aria attributes
|
|
125
|
+
*/
|
|
126
|
+
containerDirective: Directive;
|
|
127
|
+
/**
|
|
128
|
+
* A directive to be applied on each star element
|
|
129
|
+
*/
|
|
130
|
+
starDirective: Directive<{
|
|
131
|
+
index: number;
|
|
132
|
+
}>;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Represents the state of a rating component.
|
|
136
|
+
*/
|
|
137
|
+
export interface RatingState extends RatingCommonPropsAndState {
|
|
138
|
+
/**
|
|
139
|
+
* the aria value of the rating
|
|
140
|
+
*/
|
|
141
|
+
ariaValueText: string;
|
|
142
|
+
/**
|
|
143
|
+
* the visible value of the rating (it changes when hovering over the rating even though the real value did not change)
|
|
144
|
+
*/
|
|
145
|
+
visibleRating: number;
|
|
146
|
+
/**
|
|
147
|
+
* is the rating interactive i.e. listening to hover, click and keyboard events
|
|
148
|
+
*/
|
|
149
|
+
interactive: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* the list of stars
|
|
152
|
+
*/
|
|
153
|
+
stars: StarContext[];
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Interface representing the API that can be performed on a rating component.
|
|
157
|
+
*/
|
|
158
|
+
export interface RatingApi {
|
|
159
|
+
/**
|
|
160
|
+
* Sets the rating value.
|
|
161
|
+
*
|
|
162
|
+
* @param index - Star index, starting from 1
|
|
163
|
+
*/
|
|
164
|
+
setRating(index: number): void;
|
|
165
|
+
/**
|
|
166
|
+
* Sets the hovered rating value.
|
|
167
|
+
*
|
|
168
|
+
* @param index - Star index, starting from 1
|
|
169
|
+
*/
|
|
170
|
+
setHoveredRating(index: number): void;
|
|
171
|
+
/**
|
|
172
|
+
* Leave the rating, resetting the visible rating to the rating value and triggering the onLeave callback
|
|
173
|
+
*/
|
|
174
|
+
leave(): void;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Represents a Rating widget.
|
|
178
|
+
*/
|
|
179
|
+
export type RatingWidget = Widget<RatingProps, RatingState, RatingApi, RatingDirectives>;
|
|
180
|
+
/**
|
|
181
|
+
* Returns a shallow copy of the default rating config.
|
|
182
|
+
* @returns a copy of the default config
|
|
183
|
+
*/
|
|
184
|
+
export declare function getRatingDefaultConfig(): RatingProps;
|
|
185
|
+
/**
|
|
186
|
+
* Create a RatingWidget with given config props
|
|
187
|
+
* @param config - an optional alert config
|
|
188
|
+
* @returns a RatingWidget
|
|
189
|
+
*/
|
|
190
|
+
export declare const createRating: WidgetFactory<RatingWidget>;
|
|
191
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './slider';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manages minimum and maximum range constraints for values in an array by adjusting adjacent values.
|
|
3
|
+
*
|
|
4
|
+
* This function ensures that the value at the specified index maintains proper minimum and maximum
|
|
5
|
+
* distance constraints with its neighboring values. It pushes adjacent handles when necessary to
|
|
6
|
+
* maintain the required range constraints.
|
|
7
|
+
*
|
|
8
|
+
* @param values - Array of numeric values to be managed (typically slider handle positions)
|
|
9
|
+
* @param index - Index of the value in the array that serves as the reference point
|
|
10
|
+
* @param minRange - Minimum allowed distance between adjacent values
|
|
11
|
+
* @param maxRange - Maximum allowed distance between adjacent values
|
|
12
|
+
* @param min - Minimum boundary of the slider
|
|
13
|
+
* @param max - Maximum boundary of the slider
|
|
14
|
+
* @param pushRange - Whether to enable pushing of adjacent values to maintain range constraints
|
|
15
|
+
*
|
|
16
|
+
* @returns The modified values array with range constraints applied
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const values = [10, 20, 30, 40];
|
|
21
|
+
* const result = manageMinMaxRange(values, 1, 5, 15, 0, 50, true);
|
|
22
|
+
* // Result ensures value at index 1 maintains 5-15 unit distance from neighbors
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const manageMinMaxRange: (values: number[], index: number, minRange: number, maxRange: number, min: number, max: number, pushRange: boolean) => number[];
|