react-asc 20.1.0 → 20.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/apple-touch-icon.png +0 -0
  2. package/assets/index.1f5e1902.js +10 -0
  3. package/assets/index.a1009f35.css +1 -0
  4. package/assets/vendor.d012860f.js +57 -0
  5. package/changelog.md +919 -0
  6. package/favicon-16x16.png +0 -0
  7. package/favicon-32x32.png +0 -0
  8. package/favicon.ico +0 -0
  9. package/favicon.svg +23 -0
  10. package/index.html +27 -0
  11. package/manifest.webmanifest +1 -0
  12. package/package.json +1 -1
  13. package/pwa-192x192.png +0 -0
  14. package/pwa-512x512.png +0 -0
  15. package/react-asc.scss +63 -2
  16. package/registerSW.js +1 -0
  17. package/robots.txt +3 -0
  18. package/showcase/alert.md +3 -0
  19. package/showcase/appbar.md +8 -0
  20. package/showcase/autocomplete.md +53 -0
  21. package/showcase/backdrop.md +11 -0
  22. package/showcase/badge.md +8 -0
  23. package/showcase/breadcrumb.md +5 -0
  24. package/showcase/button.md +11 -0
  25. package/showcase/buttongroup.md +5 -0
  26. package/showcase/card.md +9 -0
  27. package/showcase/checkbox.md +7 -0
  28. package/showcase/chip.md +7 -0
  29. package/showcase/dateselect.md +8 -0
  30. package/showcase/drawer.md +13 -0
  31. package/showcase/expansionpanel.md +40 -0
  32. package/showcase/fileinput.md +6 -0
  33. package/showcase/floatingactionbutton.md +8 -0
  34. package/showcase/form.md +7 -0
  35. package/showcase/grid.md +5 -0
  36. package/showcase/hookuseconstructor.md +3 -0
  37. package/showcase/hookusedebounce.md +5 -0
  38. package/showcase/hookusehover.md +8 -0
  39. package/showcase/hookusewindowsize.md +5 -0
  40. package/showcase/icon.md +3 -0
  41. package/showcase/iconbutton.md +5 -0
  42. package/showcase/link.md +1 -0
  43. package/showcase/list.md +7 -0
  44. package/showcase/loadingindicator.md +18 -0
  45. package/showcase/menu.md +18 -0
  46. package/showcase/modal.md +17 -0
  47. package/showcase/numberselect.md +20 -0
  48. package/showcase/select.md +27 -0
  49. package/showcase/snackbar.md +22 -0
  50. package/showcase/speeddial.md +43 -0
  51. package/showcase/stepper.md +1 -0
  52. package/showcase/table.md +34 -0
  53. package/showcase/tabs.md +35 -0
  54. package/showcase/timeselect.md +1 -0
  55. package/showcase/tooltip.md +6 -0
  56. package/showcase/treeview.md +12 -0
  57. package/showcase/typography.md +6 -0
  58. package/sw.js +1 -0
  59. package/workbox-6cd28afd.js +1 -0
  60. package/components/Alert/Alert.d.ts +0 -11
  61. package/components/Alert/index.d.ts +0 -1
  62. package/components/AppBar/AppBar.d.ts +0 -9
  63. package/components/AppBar/AppBarTitle.d.ts +0 -5
  64. package/components/AppBar/index.d.ts +0 -2
  65. package/components/AutoComplete/AutoComplete.d.ts +0 -19
  66. package/components/AutoComplete/index.d.ts +0 -1
  67. package/components/Backdrop/Backdrop.d.ts +0 -7
  68. package/components/Backdrop/index.d.ts +0 -1
  69. package/components/Badge/Badge.d.ts +0 -7
  70. package/components/Badge/index.d.ts +0 -1
  71. package/components/Breadcrumb/Breadcrumb.d.ts +0 -5
  72. package/components/Breadcrumb/BreadcrumbItem.d.ts +0 -6
  73. package/components/Breadcrumb/index.d.ts +0 -2
  74. package/components/Button/Button.d.ts +0 -12
  75. package/components/Button/index.d.ts +0 -1
  76. package/components/ButtonGroup/ButtonGroup.d.ts +0 -2
  77. package/components/ButtonGroup/index.d.ts +0 -1
  78. package/components/Card/Card.d.ts +0 -6
  79. package/components/Card/CardBody.d.ts +0 -2
  80. package/components/Card/CardFooter.d.ts +0 -2
  81. package/components/Card/CardImage.d.ts +0 -2
  82. package/components/Card/CardSubtitle.d.ts +0 -2
  83. package/components/Card/CardText.d.ts +0 -2
  84. package/components/Card/CardTitle.d.ts +0 -6
  85. package/components/Card/index.d.ts +0 -7
  86. package/components/Checkbox/Checkbox.d.ts +0 -7
  87. package/components/Checkbox/index.d.ts +0 -1
  88. package/components/Chip/Chip.d.ts +0 -11
  89. package/components/Chip/index.d.ts +0 -1
  90. package/components/ConditionalWrapper/ConditionalWrapper.d.ts +0 -8
  91. package/components/ConditionalWrapper/index.d.ts +0 -1
  92. package/components/DateSelect/DateSelect.d.ts +0 -17
  93. package/components/DateSelect/DaySelect.d.ts +0 -12
  94. package/components/DateSelect/MonthSelect.d.ts +0 -10
  95. package/components/DateSelect/YearSelect.d.ts +0 -12
  96. package/components/DateSelect/index.d.ts +0 -4
  97. package/components/Drawer/Drawer.d.ts +0 -9
  98. package/components/Drawer/index.d.ts +0 -1
  99. package/components/ExpansionPanel/ExpansionPanel.d.ts +0 -8
  100. package/components/ExpansionPanel/ExpansionPanelContent.d.ts +0 -5
  101. package/components/ExpansionPanel/ExpansionPanelHeader.d.ts +0 -7
  102. package/components/ExpansionPanel/index.d.ts +0 -3
  103. package/components/FileInput/FileInput.d.ts +0 -5
  104. package/components/FileInput/index.d.ts +0 -1
  105. package/components/FloatingActionButton/FloatingActionButton.d.ts +0 -12
  106. package/components/FloatingActionButton/index.d.ts +0 -1
  107. package/components/Form/Form.d.ts +0 -38
  108. package/components/Form/FormError.d.ts +0 -8
  109. package/components/Form/FormGroup.d.ts +0 -7
  110. package/components/Form/FormHint/FormHint.d.ts +0 -2
  111. package/components/Form/FormHint/index.d.ts +0 -1
  112. package/components/Form/FormInput/FormInput.d.ts +0 -29
  113. package/components/Form/FormInput/index.d.ts +0 -1
  114. package/components/Form/FormLabel/FormLabel.d.ts +0 -2
  115. package/components/Form/FormLabel/index.d.ts +0 -1
  116. package/components/Form/form.interfaces.d.ts +0 -42
  117. package/components/Form/form.models.d.ts +0 -12
  118. package/components/Form/form.types.d.ts +0 -2
  119. package/components/Form/index.d.ts +0 -10
  120. package/components/Form/validators/EmailValidtor.d.ts +0 -1
  121. package/components/Form/validators/IsEmptyValidator.d.ts +0 -1
  122. package/components/Form/validators/IsEqualValidator.d.ts +0 -1
  123. package/components/Form/validators/index.d.ts +0 -3
  124. package/components/Grid/Column/Column.d.ts +0 -10
  125. package/components/Grid/Column/index.d.ts +0 -1
  126. package/components/Grid/Row/Row.d.ts +0 -5
  127. package/components/Grid/Row/index.d.ts +0 -1
  128. package/components/Grid/index.d.ts +0 -2
  129. package/components/Icon/Icon.d.ts +0 -6
  130. package/components/Icon/index.d.ts +0 -1
  131. package/components/IconButton/IconButton.d.ts +0 -11
  132. package/components/IconButton/index.d.ts +0 -1
  133. package/components/Link/Link.d.ts +0 -2
  134. package/components/Link/Link.test.d.ts +0 -1
  135. package/components/Link/index.d.ts +0 -1
  136. package/components/List/List.d.ts +0 -5
  137. package/components/List/ListItem.d.ts +0 -9
  138. package/components/List/ListItemAction.d.ts +0 -2
  139. package/components/List/ListItemAvatar.d.ts +0 -6
  140. package/components/List/ListItemIcon.d.ts +0 -6
  141. package/components/List/ListItemText.d.ts +0 -7
  142. package/components/List/index.d.ts +0 -6
  143. package/components/List/list.models.d.ts +0 -8
  144. package/components/LoadingIndicator/LoadingIndicator.d.ts +0 -2
  145. package/components/LoadingIndicator/LoadingIndicatorContainer.d.ts +0 -5
  146. package/components/LoadingIndicator/index.d.ts +0 -3
  147. package/components/LoadingIndicator/loading-indicator.service.d.ts +0 -11
  148. package/components/Menu/Menu.d.ts +0 -11
  149. package/components/Menu/MenuBackdrop.d.ts +0 -6
  150. package/components/Menu/MenuBody.d.ts +0 -12
  151. package/components/Menu/MenuContext.d.ts +0 -6
  152. package/components/Menu/MenuDivider.d.ts +0 -2
  153. package/components/Menu/MenuItem.d.ts +0 -8
  154. package/components/Menu/MenuToggle.d.ts +0 -6
  155. package/components/Menu/index.d.ts +0 -6
  156. package/components/Menu/menu.types.d.ts +0 -1
  157. package/components/Modal/GlobalModal.d.ts +0 -19
  158. package/components/Modal/Modal.d.ts +0 -14
  159. package/components/Modal/ModalBody.d.ts +0 -6
  160. package/components/Modal/ModalFooter.d.ts +0 -2
  161. package/components/Modal/ModalHeader.d.ts +0 -7
  162. package/components/Modal/index.d.ts +0 -8
  163. package/components/Modal/modal.enum.d.ts +0 -10
  164. package/components/Modal/modal.interfaces.d.ts +0 -12
  165. package/components/Modal/modal.service.d.ts +0 -21
  166. package/components/NumberSelect/NumberSelect.d.ts +0 -12
  167. package/components/NumberSelect/index.d.ts +0 -1
  168. package/components/Select/Select.d.ts +0 -15
  169. package/components/Select/index.d.ts +0 -1
  170. package/components/Sidebar/Sidebar.d.ts +0 -9
  171. package/components/Sidebar/index.d.ts +0 -2
  172. package/components/Sidebar/sidebar.interfaces.d.ts +0 -9
  173. package/components/Sidebar/sidebar.models.d.ts +0 -11
  174. package/components/Snackbar/Snackbar.d.ts +0 -8
  175. package/components/Snackbar/index.d.ts +0 -2
  176. package/components/Snackbar/snackbar.service.d.ts +0 -19
  177. package/components/SpeedDial/SpeedDial.d.ts +0 -7
  178. package/components/SpeedDial/SpeedDialAction.d.ts +0 -9
  179. package/components/SpeedDial/SpeedDialActions.d.ts +0 -2
  180. package/components/SpeedDial/SpeedDialIcon.d.ts +0 -5
  181. package/components/SpeedDial/index.d.ts +0 -3
  182. package/components/Stepper/Step/Step.d.ts +0 -19
  183. package/components/Stepper/Step/index.d.ts +0 -1
  184. package/components/Stepper/StepConnector/StepConnector.d.ts +0 -6
  185. package/components/Stepper/StepPanel/StepPanel.d.ts +0 -5
  186. package/components/Stepper/Stepper.d.ts +0 -16
  187. package/components/Stepper/StepperActions/StepperActions.d.ts +0 -12
  188. package/components/Stepper/StepperActions/index.d.ts +0 -1
  189. package/components/Stepper/index.d.ts +0 -3
  190. package/components/Table/Table.d.ts +0 -10
  191. package/components/Table/index.d.ts +0 -1
  192. package/components/Tabs/Tab.d.ts +0 -14
  193. package/components/Tabs/TabIndicator.d.ts +0 -10
  194. package/components/Tabs/TabPanel.d.ts +0 -6
  195. package/components/Tabs/Tabs.d.ts +0 -17
  196. package/components/Tabs/index.d.ts +0 -3
  197. package/components/Textarea/Textarea.d.ts +0 -5
  198. package/components/Textarea/index.d.ts +0 -1
  199. package/components/TimeSelect/HourSelect.d.ts +0 -10
  200. package/components/TimeSelect/MilliSecondSelect.d.ts +0 -11
  201. package/components/TimeSelect/MinuteSelect.d.ts +0 -10
  202. package/components/TimeSelect/SecondSelect.d.ts +0 -10
  203. package/components/TimeSelect/TimeSelect.d.ts +0 -20
  204. package/components/TimeSelect/index.d.ts +0 -5
  205. package/components/Tooltip/Tooltip.d.ts +0 -6
  206. package/components/Tooltip/index.d.ts +0 -1
  207. package/components/TreeView/TreeItem.d.ts +0 -14
  208. package/components/TreeView/TreeView.d.ts +0 -2
  209. package/components/TreeView/index.d.ts +0 -2
  210. package/components/Typography/Typography.d.ts +0 -10
  211. package/components/Typography/index.d.ts +0 -1
  212. package/components/component.enums.d.ts +0 -25
  213. package/components/component.interfaces.d.ts +0 -18
  214. package/components/index.d.ts +0 -41
  215. package/hooks/index.d.ts +0 -4
  216. package/hooks/useConstructor.d.ts +0 -1
  217. package/hooks/useDebounce.d.ts +0 -2
  218. package/hooks/useHover.d.ts +0 -2
  219. package/hooks/useWindowSize.d.ts +0 -4
  220. package/icons/CaretDownSolidIcon.d.ts +0 -2
  221. package/icons/CheckSolidIcon.d.ts +0 -2
  222. package/icons/CheckSquareRegularIcon.d.ts +0 -2
  223. package/icons/ChevronDownSolidIcon.d.ts +0 -2
  224. package/icons/ChevronLeftSolidIcon.d.ts +0 -2
  225. package/icons/ChevronRightSolidIcon.d.ts +0 -2
  226. package/icons/ChevronUpSolidIcon.d.ts +0 -2
  227. package/icons/CircleSolidIcon.d.ts +0 -2
  228. package/icons/HomeSolidIcon.d.ts +0 -2
  229. package/icons/PlusSolidIcon.d.ts +0 -2
  230. package/icons/SpinnerSolidIcon.d.ts +0 -2
  231. package/icons/SquareRegularIcon.d.ts +0 -2
  232. package/icons/TimesCircleSolidIcon.d.ts +0 -2
  233. package/icons/TimesSolidIcon.d.ts +0 -2
  234. package/icons/index.d.ts +0 -14
  235. package/index.d.ts +0 -3
  236. package/index.es.js +0 -2629
  237. package/index.js +0 -2745
package/index.es.js DELETED
@@ -1,2629 +0,0 @@
1
- import React, { useState, useEffect, useRef, Fragment, Component, createRef, cloneElement } from 'react';
2
- import { createPortal, render, unmountComponentAtNode } from 'react-dom';
3
- import { createPopper } from '@popperjs/core';
4
-
5
- /*! *****************************************************************************
6
- Copyright (c) Microsoft Corporation.
7
-
8
- Permission to use, copy, modify, and/or distribute this software for any
9
- purpose with or without fee is hereby granted.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
- PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */
19
-
20
- function __rest(s, e) {
21
- var t = {};
22
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
23
- t[p] = s[p];
24
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
25
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
26
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
27
- t[p[i]] = s[p[i]];
28
- }
29
- return t;
30
- }
31
-
32
- var COLOR;
33
- (function (COLOR) {
34
- COLOR["primary"] = "primary";
35
- COLOR["accent"] = "accent";
36
- COLOR["secondary"] = "secondary";
37
- // danger = 'danger',
38
- COLOR["light"] = "light";
39
- COLOR["dark"] = "dark";
40
- })(COLOR || (COLOR = {}));
41
- var VARIANT;
42
- (function (VARIANT) {
43
- VARIANT["contained"] = "contained";
44
- VARIANT["outline"] = "outline";
45
- VARIANT["text"] = "text";
46
- })(VARIANT || (VARIANT = {}));
47
- var SIZE;
48
- (function (SIZE) {
49
- SIZE["sm"] = "sm";
50
- SIZE["md"] = "md";
51
- SIZE["lg"] = "lg";
52
- })(SIZE || (SIZE = {}));
53
- var POSITION;
54
- (function (POSITION) {
55
- POSITION["right"] = "right";
56
- POSITION["left"] = "left";
57
- })(POSITION || (POSITION = {}));
58
- const STATUS = {
59
- HOVERED: 'hovered',
60
- NORMAL: 'normal',
61
- };
62
-
63
- function styleInject(css, ref) {
64
- if ( ref === void 0 ) ref = {};
65
- var insertAt = ref.insertAt;
66
-
67
- if (!css || typeof document === 'undefined') { return; }
68
-
69
- var head = document.head || document.getElementsByTagName('head')[0];
70
- var style = document.createElement('style');
71
- style.type = 'text/css';
72
-
73
- if (insertAt === 'top') {
74
- if (head.firstChild) {
75
- head.insertBefore(style, head.firstChild);
76
- } else {
77
- head.appendChild(style);
78
- }
79
- } else {
80
- head.appendChild(style);
81
- }
82
-
83
- if (style.styleSheet) {
84
- style.styleSheet.cssText = css;
85
- } else {
86
- style.appendChild(document.createTextNode(css));
87
- }
88
- }
89
-
90
- var css_248z$10 = ".Alert-module_alert__b4tbk {\n border-radius: var(--borderRadius);\n padding: 6px 16px; }\n .Alert-module_alert__b4tbk.Alert-module_shadow__5bz-7 {\n box-shadow: var(--shadow); }\n\n.Alert-module_contained__EM0x6.Alert-module_primary__q4pNj {\n color: var(--primary-contrast-text);\n background-color: var(--primary); }\n\n.Alert-module_contained__EM0x6.Alert-module_accent__a2WIl {\n color: var(--accent-contrast-text);\n background-color: var(--accent); }\n\n.Alert-module_contained__EM0x6.Alert-module_secondary__syXKX {\n color: var(--secondary-contrast-text);\n background-color: var(--secondary); }\n\n.Alert-module_contained__EM0x6.Alert-module_light__VKCXF {\n color: var(--light-contrast-text);\n background-color: var(--light); }\n\n.Alert-module_contained__EM0x6.Alert-module_dark__3c-Hm {\n color: var(--dark-contrast-text);\n background-color: var(--dark); }\n\n.Alert-module_outline__T2262.Alert-module_primary__q4pNj {\n color: var(--primary) !important;\n border: 1px solid var(--primary) !important; }\n\n.Alert-module_outline__T2262.Alert-module_secondary__syXKX {\n color: var(--secondary) !important;\n border: 1px solid var(--secondary) !important; }\n\n.Alert-module_outline__T2262.Alert-module_accent__a2WIl {\n color: var(--accent) !important;\n border: 1px solid var(--accent) !important; }\n\n.Alert-module_outline__T2262.Alert-module_light__VKCXF {\n color: var(--light-contrast-text) !important;\n border: 1px solid var(--light) !important; }\n\n.Alert-module_outline__T2262.Alert-module_dark__3c-Hm {\n color: var(--dark) !important;\n border: 1px solid var(--dark) !important; }\n";
91
- var styles$10 = {"alert":"Alert-module_alert__b4tbk","shadow":"Alert-module_shadow__5bz-7","contained":"Alert-module_contained__EM0x6","primary":"Alert-module_primary__q4pNj","accent":"Alert-module_accent__a2WIl","secondary":"Alert-module_secondary__syXKX","light":"Alert-module_light__VKCXF","dark":"Alert-module_dark__3c-Hm","outline":"Alert-module_outline__T2262"};
92
- styleInject(css_248z$10);
93
-
94
- const Alert = (props) => {
95
- const { children, className, color = COLOR.primary, variant = VARIANT.contained, shadow = true } = props, rest = __rest(props, ["children", "className", "color", "variant", "shadow"]);
96
- const getCssClasses = () => {
97
- const cssClasses = [];
98
- cssClasses.push(styles$10.alert);
99
- if (variant === VARIANT.contained) {
100
- cssClasses.push(styles$10.contained);
101
- cssClasses.push(styles$10[color]);
102
- }
103
- if (variant === VARIANT.outline) {
104
- cssClasses.push(styles$10.outline);
105
- cssClasses.push(styles$10[color]);
106
- }
107
- shadow && cssClasses.push(styles$10['shadow']);
108
- className && cssClasses.push(className);
109
- return cssClasses.filter(r => r).join(' ');
110
- };
111
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
112
- };
113
-
114
- var css_248z$$ = ".AppBar-module_appbar__Neyh3 {\n padding: 0.5rem 1rem;\n display: flex;\n z-index: 1000;\n min-height: 64px;\n flex-shrink: 0; }\n .AppBar-module_appbar__Neyh3.AppBar-module_primary__xMqXD {\n color: var(--primary-contrast-text);\n background-color: var(--primary); }\n .AppBar-module_appbar__Neyh3.AppBar-module_secondary__8MkLA {\n color: var(--secondary-contrast-text);\n background-color: var(--secondary); }\n .AppBar-module_appbar__Neyh3.AppBar-module_accent__vHbkp {\n color: var(--accent-contrast-text);\n background-color: var(--accent); }\n .AppBar-module_appbar__Neyh3.AppBar-module_light__HGy3y {\n color: var(--light-contrast-text);\n background-color: var(--light); }\n .AppBar-module_appbar__Neyh3.AppBar-module_dark__ILq96 {\n color: var(--dark-contrast-text);\n background-color: var(--dark); }\n .AppBar-module_appbar__Neyh3.AppBar-module_shadow__gQN8s {\n box-shadow: var(--shadow); }\n";
115
- var styles$$ = {"appbar":"AppBar-module_appbar__Neyh3","primary":"AppBar-module_primary__xMqXD","secondary":"AppBar-module_secondary__8MkLA","accent":"AppBar-module_accent__vHbkp","light":"AppBar-module_light__HGy3y","dark":"AppBar-module_dark__ILq96","shadow":"AppBar-module_shadow__gQN8s"};
116
- styleInject(css_248z$$);
117
-
118
- const AppBar = (props) => {
119
- const { children, className, color = COLOR.primary, shadow = true } = props, rest = __rest(props, ["children", "className", "color", "shadow"]);
120
- const getCssClasses = () => {
121
- const cssClasses = [];
122
- cssClasses.push(styles$$[color]);
123
- cssClasses.push(styles$$.appbar);
124
- shadow && cssClasses.push(styles$$['shadow']);
125
- className && cssClasses.push(className);
126
- return cssClasses.filter(r => r).join(' ');
127
- };
128
- return (React.createElement("nav", Object.assign({ className: getCssClasses() }, rest), children));
129
- };
130
-
131
- var css_248z$_ = ".AppBarTitle-module_appbarTitle__RsFg5 {\n align-items: center;\n padding-top: 0.3125rem;\n padding-bottom: 0.3125rem;\n font-size: 1.25rem;\n line-height: 1.8;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden !important;\n display: inline-block; }\n .AppBarTitle-module_appbarTitle__RsFg5:hover {\n cursor: pointer; }\n";
132
- var styles$_ = {"appbarTitle":"AppBarTitle-module_appbarTitle__RsFg5"};
133
- styleInject(css_248z$_);
134
-
135
- const AppBarTitle = (props) => {
136
- const { children, className, onClick } = props;
137
- const getCssClass = () => {
138
- const cssClasses = [];
139
- cssClasses.push(styles$_.appbarTitle);
140
- className && cssClasses.push(className);
141
- return cssClasses.filter(r => r).join(' ');
142
- };
143
- return (React.createElement("div", { className: getCssClass(), onClick: onClick }, children));
144
- };
145
-
146
- var css_248z$Z = ".Icon-module_icon__lFKCA {\n align-items: center;\n justify-content: center;\n display: flex;\n width: 20px;\n height: 20px; }\n .Icon-module_icon__lFKCA svg {\n width: inherit;\n height: inherit; }\n .Icon-module_icon__lFKCA.Icon-module_primary__3fID- {\n color: var(--primary); }\n .Icon-module_icon__lFKCA.Icon-module_accent__aZXGb {\n color: var(--accent); }\n .Icon-module_icon__lFKCA.Icon-module_secondary__HKKop {\n color: var(--secondary); }\n .Icon-module_icon__lFKCA.Icon-module_light__-ApMm {\n color: var(--light); }\n .Icon-module_icon__lFKCA.Icon-module_dark__DpCIK {\n color: var(--dark); }\n";
147
- var styles$Z = {"icon":"Icon-module_icon__lFKCA","primary":"Icon-module_primary__3fID-","accent":"Icon-module_accent__aZXGb","secondary":"Icon-module_secondary__HKKop","light":"Icon-module_light__-ApMm","dark":"Icon-module_dark__DpCIK"};
148
- styleInject(css_248z$Z);
149
-
150
- const Icon = (props) => {
151
- const { children, iconColor, className } = props, rest = __rest(props, ["children", "iconColor", "className"]);
152
- const getCssClasses = () => {
153
- const cssClasses = [];
154
- cssClasses.push(styles$Z.icon);
155
- iconColor && cssClasses.push(styles$Z[iconColor]);
156
- className && cssClasses.push(className);
157
- return cssClasses.filter(css => css).join(' ');
158
- };
159
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
160
- };
161
-
162
- var css_248z$Y = ".IconButton-module_iconButton__rpCPQ {\n border-radius: 100%;\n padding: 0px;\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n align-items: center;\n min-width: auto;\n box-shadow: none;\n font-weight: 400;\n text-align: center;\n vertical-align: middle;\n -webkit-user-select: none;\n user-select: none;\n background-color: transparent;\n font-size: 1rem;\n line-height: 1.5;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n border: none; }\n .IconButton-module_iconButton__rpCPQ:hover {\n cursor: pointer; }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_shadow__Uw0RK {\n box-shadow: var(--shadow); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_md__XnuSk {\n width: 48px;\n height: 48px; }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_lg__arEvo {\n width: 56px;\n height: 56px; }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag {\n padding: 0;\n background: transparent;\n color: inherit; }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_active__VIqU9 {\n background-color: rgba(0, 0, 0, 0.04); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_primary__vbo-G {\n color: var(--primary); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_primary__vbo-G:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_primary__vbo-G.IconButton-module_active__VIqU9 {\n color: var(--primary-dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_secondary__AiNAY {\n color: var(--secondary); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_secondary__AiNAY:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_secondary__AiNAY.IconButton-module_active__VIqU9 {\n color: var(--secondary-dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_accent__QRzM2 {\n color: var(--accent); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_accent__QRzM2:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_accent__QRzM2.IconButton-module_active__VIqU9 {\n color: var(--accent-dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_light__YNEiO {\n color: var(--light); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_light__YNEiO:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_light__YNEiO.IconButton-module_active__VIqU9 {\n color: var(--light-dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_dark__gnbUH {\n color: var(--dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_dark__gnbUH:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_dark__gnbUH.IconButton-module_active__VIqU9 {\n color: var(--dark-dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_text__Ualag.IconButton-module_disabled__QB0ZV {\n color: rgba(0, 0, 0, 0.26);\n background-color: transparent;\n cursor: default;\n pointer-events: none; }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_active__VIqU9 {\n background-color: rgba(0, 0, 0, 0.04); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_primary__vbo-G {\n background-color: var(--primary);\n color: var(--white); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_primary__vbo-G:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_primary__vbo-G.IconButton-module_active__VIqU9 {\n background-color: var(--primary-dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_secondary__AiNAY {\n background-color: var(--secondary);\n color: var(--white); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_secondary__AiNAY:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_secondary__AiNAY.IconButton-module_active__VIqU9 {\n background-color: var(--secondary-dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_accent__QRzM2 {\n background-color: var(--accent);\n color: var(--white); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_accent__QRzM2:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_accent__QRzM2.IconButton-module_active__VIqU9 {\n background-color: var(--accent-dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_light__YNEiO {\n background-color: var(--light);\n color: var(--dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_light__YNEiO:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_light__YNEiO.IconButton-module_active__VIqU9 {\n background-color: var(--light-dark); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_dark__gnbUH {\n background-color: var(--dark);\n color: var(--white); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_dark__gnbUH:hover, .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_dark__gnbUH.IconButton-module_active__VIqU9 {\n background-color: var(--dark-light); }\n .IconButton-module_iconButton__rpCPQ.IconButton-module_contained__k7vGA.IconButton-module_disabled__QB0ZV {\n color: rgba(0, 0, 0, 0.26);\n background-color: transparent;\n cursor: default;\n pointer-events: none; }\n .IconButton-module_iconButton__rpCPQ:focus {\n color: #212529;\n border-color: #86b7fe;\n outline: 0;\n box-shadow: inset 0 1px 2px #00000013, 0 0 0 0.25rem #0d6efd40; }\n";
163
- var styles$Y = {"iconButton":"IconButton-module_iconButton__rpCPQ","shadow":"IconButton-module_shadow__Uw0RK","md":"IconButton-module_md__XnuSk","lg":"IconButton-module_lg__arEvo","text":"IconButton-module_text__Ualag","active":"IconButton-module_active__VIqU9","primary":"IconButton-module_primary__vbo-G","secondary":"IconButton-module_secondary__AiNAY","accent":"IconButton-module_accent__QRzM2","light":"IconButton-module_light__YNEiO","dark":"IconButton-module_dark__gnbUH","disabled":"IconButton-module_disabled__QB0ZV","contained":"IconButton-module_contained__k7vGA"};
164
- styleInject(css_248z$Y);
165
-
166
- const IconButton = (props) => {
167
- const { children, icon, variant = VARIANT.text, color = COLOR.dark, size = SIZE.md, isActive, disabled, className, shadow } = props, rest = __rest(props, ["children", "icon", "variant", "color", "size", "isActive", "disabled", "className", "shadow"]);
168
- const getCssClasses = () => {
169
- const cssClasses = [];
170
- cssClasses.push(styles$Y[color]);
171
- cssClasses.push(styles$Y[variant]);
172
- cssClasses.push(styles$Y[size]);
173
- cssClasses.push(styles$Y.iconButton);
174
- isActive && cssClasses.push(styles$Y.active);
175
- disabled && cssClasses.push(styles$Y.disabled);
176
- shadow && cssClasses.push(styles$Y.shadow);
177
- className && cssClasses.push(className);
178
- return cssClasses.filter(css => css).join(' ');
179
- };
180
- return (React.createElement("button", Object.assign({ type: "button", className: getCssClasses(), disabled: disabled }, rest),
181
- icon && React.createElement(Icon, null, icon),
182
- children));
183
- };
184
-
185
- const CaretDownSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "caret-down", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512" },
186
- React.createElement("path", { fill: "currentColor", d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" })));
187
-
188
- const CheckSquareRegularIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "check-square", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512" },
189
- React.createElement("path", { fill: "currentColor", d: "M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zm0 400H48V80h352v352zm-35.864-241.724L191.547 361.48c-4.705 4.667-12.303 4.637-16.97-.068l-90.781-91.516c-4.667-4.705-4.637-12.303.069-16.971l22.719-22.536c4.705-4.667 12.303-4.637 16.97.069l59.792 60.277 141.352-140.216c4.705-4.667 12.303-4.637 16.97.068l22.536 22.718c4.667 4.706 4.637 12.304-.068 16.971z" })));
190
-
191
- const ChevronDownSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "chevron-down", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512" },
192
- React.createElement("path", { fill: "currentColor", d: "M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z" })));
193
-
194
- const ChevronRightSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "chevron-right", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512" },
195
- React.createElement("path", { fill: "currentColor", d: "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z" })));
196
-
197
- const ChevronUpSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "chevron-up", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512" },
198
- React.createElement("path", { fill: "currentColor", d: "M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z" })));
199
-
200
- const HomeSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "home", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 576 512" },
201
- React.createElement("path", { fill: "currentColor", d: "M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z" })));
202
-
203
- const SquareRegularIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "square", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512" },
204
- React.createElement("path", { fill: "currentColor", d: "M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-6 400H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h340c3.3 0 6 2.7 6 6v340c0 3.3-2.7 6-6 6z" })));
205
-
206
- const TimesCircleSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" },
207
- React.createElement("path", { fill: "currentColor", d: "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z" })));
208
-
209
- const TimesSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 352 512" },
210
- React.createElement("path", { fill: "currentColor", d: "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" })));
211
-
212
- const SpinnerSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "spinner", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" },
213
- React.createElement("path", { fill: "currentColor", d: "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z" })));
214
-
215
- const PlusSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512" },
216
- React.createElement("path", { fill: "currentColor", d: "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z" })));
217
-
218
- const CheckSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" },
219
- React.createElement("path", { fill: "currentColor", d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })));
220
-
221
- const CircleSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" },
222
- React.createElement("path", { fill: "currentColor", d: "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" })));
223
-
224
- const ChevronLeftSolidIcon = () => (React.createElement("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512" },
225
- React.createElement("path", { fill: "currentColor", d: "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z" })));
226
-
227
- function useWindowSize() {
228
- const [windowSize, setWindowSize] = useState({
229
- width: 0,
230
- height: 0,
231
- });
232
- useEffect(() => {
233
- function handleResize() {
234
- setWindowSize({
235
- width: window.innerWidth,
236
- height: window.innerHeight,
237
- });
238
- }
239
- window.addEventListener("resize", handleResize);
240
- handleResize();
241
- return () => window.removeEventListener("resize", handleResize);
242
- }, []);
243
- return windowSize;
244
- }
245
-
246
- function useHover() {
247
- const [value, setValue] = useState(false);
248
- const ref = useRef(null);
249
- const handleMouseOver = () => setValue(true);
250
- const handleMouseOut = () => setValue(false);
251
- useEffect(() => {
252
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
253
- const node = ref.current;
254
- if (node) {
255
- node.addEventListener("mouseover", handleMouseOver);
256
- node.addEventListener("mouseout", handleMouseOut);
257
- return () => {
258
- node.removeEventListener("mouseover", handleMouseOver);
259
- node.removeEventListener("mouseout", handleMouseOut);
260
- };
261
- }
262
- return;
263
- }, [ref.current] // Recall only if ref changes
264
- );
265
- return [ref, value];
266
- }
267
-
268
- const useConstructor = (callBack) => {
269
- const [hasBeenCalled, setHasBeenCalled] = useState(false);
270
- if (hasBeenCalled)
271
- return;
272
- callBack();
273
- setHasBeenCalled(true);
274
- };
275
-
276
- function useDebounce(callback, timeout, deps) {
277
- const timeoutId = useRef();
278
- useEffect(() => {
279
- clearTimeout(timeoutId.current);
280
- timeoutId.current = setTimeout(callback, timeout);
281
- return () => clearTimeout(timeoutId.current);
282
- }, deps);
283
- }
284
-
285
- var css_248z$X = ".Backdrop-module_backdrop__IRMoL {\n height: 100%;\n width: 100%;\n position: absolute;\n opacity: 0.5;\n z-index: 1040;\n top: 0;\n left: 0;\n background-color: #000; }\n";
286
- var styles$X = {"backdrop":"Backdrop-module_backdrop__IRMoL"};
287
- styleInject(css_248z$X);
288
-
289
- const Backdrop = (props) => {
290
- const { target = document.body, isTransparent = false, onClick, style } = props, rest = __rest(props, ["target", "isTransparent", "onClick", "style"]);
291
- const handleClick = (e) => {
292
- e.stopPropagation();
293
- onClick && onClick(e);
294
- };
295
- const getCssClasses = () => {
296
- const cssClasses = [];
297
- cssClasses.push(styles$X.backdrop);
298
- isTransparent && cssClasses.push(`bg-transparent`);
299
- return cssClasses.filter(css => css).join(' ');
300
- };
301
- const getStyles = () => {
302
- const styles = Object.assign({ height: '100%', width: '100%', position: 'absolute' }, style);
303
- return styles;
304
- };
305
- return (createPortal(React.createElement("div", Object.assign({ className: getCssClasses(), onClick: handleClick, style: getStyles() }, rest)), target));
306
- };
307
-
308
- var css_248z$W = ".List-module_list__gpZ41 {\n width: 100%;\n display: flex;\n flex-direction: column;\n padding-left: 0;\n margin-bottom: 0;\n margin-top: 0;\n background-color: var(--white); }\n";
309
- var styles$W = {"list":"List-module_list__gpZ41"};
310
- styleInject(css_248z$W);
311
-
312
- const List = (props) => {
313
- const { children, className, isFlush } = props, rest = __rest(props, ["children", "className", "isFlush"]);
314
- const getCssClasses = () => {
315
- const cssClasses = [];
316
- isFlush && cssClasses.push(styles$W.flush);
317
- cssClasses.push(styles$W.list);
318
- className && cssClasses.push(className);
319
- return cssClasses.filter(css => css).join(' ');
320
- };
321
- return (React.createElement("ul", Object.assign({ className: getCssClasses() }, rest), children));
322
- };
323
-
324
- var css_248z$V = ".ListItem-module_listItem__Pk1AP {\n display: flex;\n align-items: center;\n position: relative;\n padding: 0.75rem 1.25rem;\n min-width: 100%;\n color: var(--bodyColor);\n text-align: inherit;\n transition: background 0.5s ease; }\n .ListItem-module_listItem__Pk1AP:hover, .ListItem-module_listItem__Pk1AP.ListItem-module_active__zm2q8 {\n cursor: pointer;\n z-index: 1;\n text-decoration: none;\n background-color: rgba(0, 0, 0, 0.04);\n color: var(--primary); }\n .ListItem-module_listItem__Pk1AP + .ListItem-module_listItem__Pk1AP {\n border-top-width: 0; }\n .ListItem-module_listItem__Pk1AP.ListItem-module_primary__F6Qja {\n color: var(--primary-contrast-text);\n background-color: var(--primary); }\n .ListItem-module_listItem__Pk1AP.ListItem-module_accent__pg3Ha {\n color: var(--accent-contrast-text);\n background-color: var(--accent); }\n .ListItem-module_listItem__Pk1AP.ListItem-module_secondary__d0drD {\n color: var(--secondary-contrast-text);\n background-color: var(--secondary); }\n .ListItem-module_listItem__Pk1AP.ListItem-module_light__37kby {\n color: var(--light-contrast-text);\n background-color: var(--light); }\n .ListItem-module_listItem__Pk1AP.ListItem-module_dark__ZxQTF {\n color: var(--dark-contrast-text);\n background-color: var(--dark); }\n .ListItem-module_listItem__Pk1AP.ListItem-module_disabled__DQLKl {\n color: rgba(0, 0, 0, 0.26); }\n .ListItem-module_listItem__Pk1AP.ListItem-module_disabled__DQLKl:hover {\n cursor: not-allowed;\n background-color: inherit; }\n";
325
- var styles$V = {"listItem":"ListItem-module_listItem__Pk1AP","active":"ListItem-module_active__zm2q8","primary":"ListItem-module_primary__F6Qja","accent":"ListItem-module_accent__pg3Ha","secondary":"ListItem-module_secondary__d0drD","light":"ListItem-module_light__37kby","dark":"ListItem-module_dark__ZxQTF","disabled":"ListItem-module_disabled__DQLKl"};
326
- styleInject(css_248z$V);
327
-
328
- const ListItem = (props) => {
329
- const { children, color, active, className, disabled, onClick } = props, rest = __rest(props, ["children", "color", "active", "className", "disabled", "onClick"]);
330
- const getCssClasses = () => {
331
- const cssClasses = [];
332
- cssClasses.push(styles$V.listItem);
333
- color && cssClasses.push(styles$V[color]);
334
- active && cssClasses.push(styles$V['active']);
335
- disabled && cssClasses.push(styles$V['disabled']);
336
- className && cssClasses.push(className);
337
- return cssClasses.filter(css => css).join(' ');
338
- };
339
- const handleClick = (e) => {
340
- !disabled && onClick && onClick(e);
341
- };
342
- return (React.createElement("li", Object.assign({ onClick: handleClick, className: getCssClasses() }, rest), children));
343
- };
344
-
345
- var css_248z$U = ".ListItemAvatar-module_avatar__sVWfR {\n margin-right: 16px; }\n .ListItemAvatar-module_avatar__sVWfR svg, .ListItemAvatar-module_avatar__sVWfR img {\n width: 24px;\n height: 24px; }\n .ListItemAvatar-module_avatar__sVWfR img {\n border-radius: 50%; }\n";
346
- var styles$U = {"avatar":"ListItemAvatar-module_avatar__sVWfR"};
347
- styleInject(css_248z$U);
348
-
349
- const ListItemAvatar = (_a) => {
350
- var { avatar } = _a, rest = __rest(_a, ["avatar"]);
351
- return (React.createElement("div", Object.assign({ className: styles$U.avatar }, rest), avatar));
352
- };
353
-
354
- var css_248z$T = ".ListItemIcon-module_icon__cCvEv {\n margin-right: 32px; }\n .ListItemIcon-module_icon__cCvEv svg {\n width: 24px;\n height: 24px; }\n";
355
- var styles$T = {"icon":"ListItemIcon-module_icon__cCvEv"};
356
- styleInject(css_248z$T);
357
-
358
- const ListItemIcon = (_a) => {
359
- var { icon } = _a, rest = __rest(_a, ["icon"]);
360
- return (React.createElement("div", Object.assign({ className: styles$T.icon }, rest), icon));
361
- };
362
-
363
- var css_248z$S = ".ListItemAction-module_listItemAction__gAQRj {\n display: flex;\n justify-content: center;\n min-width: 40px; }\n .ListItemAction-module_listItemAction__gAQRj svg {\n width: 20px;\n height: 20px; }\n";
364
- var styles$S = {"listItemAction":"ListItemAction-module_listItemAction__gAQRj"};
365
- styleInject(css_248z$S);
366
-
367
- const ListItemAction = (_a) => {
368
- var { children, onClick } = _a, rest = __rest(_a, ["children", "onClick"]);
369
- return (React.createElement("div", Object.assign({ className: styles$S.listItemAction, onClick: e => onClick && onClick(e) }, rest), children));
370
- };
371
-
372
- var css_248z$R = ".ListItemTextIcon-module_listItemText__xCBLW {\n flex: 1; }\n";
373
- var styles$R = {"listItemText":"ListItemTextIcon-module_listItemText__xCBLW"};
374
- styleInject(css_248z$R);
375
-
376
- const ListItemText = (_a) => {
377
- var { primary, secondary } = _a, rest = __rest(_a, ["primary", "secondary"]);
378
- const getCssClasses = () => {
379
- const cssClasses = [];
380
- cssClasses.push(styles$R.listItemText);
381
- return cssClasses.filter(css => css).join(' ');
382
- };
383
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest),
384
- React.createElement(ListItemTextPrimary, null, primary),
385
- secondary &&
386
- React.createElement(ListItemTextSecondary, null, secondary)));
387
- };
388
- const ListItemTextPrimary = ({ children }) => (React.createElement("div", { className: "list-item-text-primary" }, children));
389
- const ListItemTextSecondary = ({ children }) => (React.createElement("div", { className: "list-item-text-secondary text-muted", style: { fontSize: '0.875rem' } }, children));
390
-
391
- var css_248z$Q = ".AutoComplete-module_selectContainer__1kA85 {\n position: relative; }\n\n.AutoComplete-module_select__NNYOi {\n width: 100%;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n appearance: none;\n border-radius: 0.25rem;\n box-shadow: inset 0 1px 2px #00000013;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n min-height: calc(1.5em + 0.75rem + 2px);\n height: auto;\n display: flex; }\n .AutoComplete-module_select__NNYOi:hover {\n cursor: pointer; }\n .AutoComplete-module_select__NNYOi:focus {\n color: #212529;\n background-color: #fff;\n border-color: #86b7fe;\n outline: 0;\n box-shadow: inset 0 1px 2px #00000013, 0 0 0 0.25rem #0d6efd40; }\n\n.AutoComplete-module_selectMenu__Gu81L {\n background-color: var(--light);\n position: absolute;\n box-shadow: var(--shadow);\n border-radius: var(--borderRadius);\n width: 100%;\n top: 38px;\n z-index: 1050;\n max-height: 280px;\n overflow: auto; }\n";
392
- var styles$Q = {"selectContainer":"AutoComplete-module_selectContainer__1kA85","select":"AutoComplete-module_select__NNYOi","selectMenu":"AutoComplete-module_selectMenu__Gu81L"};
393
- styleInject(css_248z$Q);
394
-
395
- // preset value
396
- // enter -> delay? -> show results
397
- // single
398
- // multiple
399
- // custom template render items
400
- const AutoComplete = (props) => {
401
- const { id, name, className, options = [], openOnFocus = true, disabled, readOnly, debounce = 0, placeholder, showNoEntry = true, showClearButton, onChange, onSelect, value } = props;
402
- const [model, setModel] = useState('');
403
- const [searchText, setSearchText] = useState('');
404
- const [isShow, setIsShow] = useState(false);
405
- const [optionsTemp, setOptionsTemp] = useState([]);
406
- const selectConainter = useRef(null);
407
- useEffect(() => {
408
- if (value !== model) {
409
- const option = options.find(o => o.value === value);
410
- setModel(option ? option.label : '');
411
- }
412
- }, [value]);
413
- useEffect(() => {
414
- if (options && options.length > 0) {
415
- const optionsOrigin = JSON.parse(JSON.stringify(options));
416
- const regex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'), 'gi');
417
- const optionsFiltered = optionsOrigin.filter(o => { var _a; return (_a = o.label) === null || _a === void 0 ? void 0 : _a.match(regex); });
418
- if (optionsFiltered.length === 0 && showNoEntry) {
419
- setOptionsTemp([{ value: '', label: '- no entry found -' }]);
420
- }
421
- else {
422
- setOptionsTemp(optionsFiltered);
423
- }
424
- }
425
- }, [options]);
426
- useDebounce(() => { onChange && onChange(searchText); }, debounce, [searchText]);
427
- useEffect(() => {
428
- if (isShow === true) {
429
- document.body.classList.add('modal-open');
430
- const main = document.querySelector('.main');
431
- main === null || main === void 0 ? void 0 : main.classList.add('modal-open');
432
- }
433
- else {
434
- document.body.classList.remove('modal-open');
435
- const main = document.querySelector('.main');
436
- main === null || main === void 0 ? void 0 : main.classList.remove('modal-open');
437
- }
438
- }, [isShow]);
439
- useEffect(() => {
440
- return () => {
441
- document.body.classList.remove('modal-open');
442
- const main = document.querySelector('.main');
443
- main === null || main === void 0 ? void 0 : main.classList.remove('modal-open');
444
- };
445
- }, []);
446
- const getCssClass = () => {
447
- const cssClasses = [];
448
- className && cssClasses.push(className);
449
- cssClasses.push(styles$Q.select);
450
- return cssClasses.filter(r => r).join(' ');
451
- };
452
- const show = () => setIsShow(true);
453
- const hide = () => setIsShow(false);
454
- const handleOnClick = (option) => {
455
- if (model !== option.value) {
456
- onSelect && onSelect(option);
457
- }
458
- setModel(option.label);
459
- hide();
460
- };
461
- const handleOnChange = (e) => {
462
- setModel(e.target.value);
463
- setSearchText(e.target.value);
464
- show();
465
- };
466
- const handleOnFocus = () => {
467
- openOnFocus && show();
468
- };
469
- const handleClickReset = () => {
470
- setModel('');
471
- setSearchText('');
472
- };
473
- return (React.createElement("div", { ref: selectConainter, className: styles$Q.selectContainer },
474
- React.createElement("div", { className: "d-flex" },
475
- React.createElement("input", { type: "text", className: getCssClass(), id: id, name: name, tabIndex: 0, readOnly: readOnly, disabled: disabled, onChange: handleOnChange, onFocus: handleOnFocus, placeholder: placeholder, value: model }),
476
- showClearButton && (model === null || model === void 0 ? void 0 : model.length) > 0 &&
477
- React.createElement(IconButton, { icon: React.createElement(TimesSolidIcon, null), onClick: handleClickReset })),
478
- isShow &&
479
- React.createElement(React.Fragment, null,
480
- React.createElement("div", { className: styles$Q.selectMenu },
481
- React.createElement(List, null, optionsTemp && optionsTemp.map((option, index) => React.createElement(ListItem, { id: `list-item-${index}`, key: option.value, onClick: () => handleOnClick(option), disabled: !option.value },
482
- React.createElement(ListItemText, { primary: option.label ? option.label : option.value }))))),
483
- React.createElement(Backdrop, { isTransparent: true, onClick: () => hide() }))));
484
- };
485
-
486
- var css_248z$P = ".Badge-module_badgeContainer__3nZBs {\n display: inline-flex;\n position: relative;\n flex-shrink: 0;\n vertical-align: middle; }\n\n.Badge-module_badge__9ImR0 {\n top: 0;\n right: 0;\n transform: scale(1) translate(50%, -50%);\n transform-origin: 100% 0%;\n height: 20px;\n display: flex;\n padding: 0 6px;\n z-index: 1;\n position: absolute;\n flex-wrap: wrap;\n font-size: 0.75rem;\n min-width: 20px;\n align-items: center;\n font-weight: 500;\n line-height: 1;\n align-content: center;\n flex-direction: row;\n justify-content: center;\n border-radius: 10px;\n transition: transform 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; }\n .Badge-module_badge__9ImR0.Badge-module_primary__41U-t {\n color: var(--primary-contrast-text);\n background-color: var(--primary); }\n .Badge-module_badge__9ImR0.Badge-module_accent__OQy2- {\n color: var(--accent-contrast-text);\n background-color: var(--accent); }\n .Badge-module_badge__9ImR0.Badge-module_secondary__a9Jfh {\n color: var(--secondary-contrast-text);\n background-color: var(--secondary); }\n .Badge-module_badge__9ImR0.Badge-module_light__4QvQ5 {\n color: var(--light-contrast-text);\n background-color: var(--light); }\n .Badge-module_badge__9ImR0.Badge-module_dark__g1yUJ {\n color: var(--dark-contrast-text);\n background-color: var(--dark); }\n";
487
- var styles$P = {"badgeContainer":"Badge-module_badgeContainer__3nZBs","badge":"Badge-module_badge__9ImR0","primary":"Badge-module_primary__41U-t","accent":"Badge-module_accent__OQy2-","secondary":"Badge-module_secondary__a9Jfh","light":"Badge-module_light__4QvQ5","dark":"Badge-module_dark__g1yUJ"};
488
- styleInject(css_248z$P);
489
-
490
- const Badge = (props) => {
491
- const { children, content, className, color = COLOR.primary } = props, rest = __rest(props, ["children", "content", "className", "color"]);
492
- const getCssClassesBadgeContainer = () => {
493
- const cssClasses = [];
494
- cssClasses.push(styles$P.badgeContainer);
495
- className && cssClasses.push(className);
496
- return cssClasses.filter(css => css).join(' ');
497
- };
498
- const getCssClassesBadge = () => {
499
- const cssClasses = [];
500
- cssClasses.push(styles$P.badge);
501
- cssClasses.push(styles$P[color]);
502
- return cssClasses.filter(css => css).join(' ');
503
- };
504
- return (React.createElement("div", Object.assign({ className: getCssClassesBadgeContainer() }, rest),
505
- children,
506
- React.createElement("span", { className: getCssClassesBadge() }, content)));
507
- };
508
-
509
- var css_248z$O = ".Button-module_button__qeIer {\n text-transform: uppercase !important;\n flex-shrink: 0;\n background-color: transparent;\n display: inline-block;\n font-weight: 400;\n line-height: 1.5;\n text-align: center;\n text-decoration: none;\n vertical-align: middle;\n user-select: none;\n border: 1px solid transparent;\n padding: 0.375rem 0.75rem;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n min-width: 64px;\n font-size: 0.875rem;\n border-radius: var(--borderRadius); }\n .Button-module_button__qeIer.Button-module_shadow__6N2nE {\n box-shadow: var(--shadow); }\n .Button-module_button__qeIer:hover {\n cursor: pointer; }\n .Button-module_button__qeIer:focus {\n color: #212529;\n border-color: #86b7fe;\n outline: 0;\n box-shadow: inset 0 1px 2px #00000013, 0 0 0 0.25rem #0d6efd40; }\n\n.Button-module_btnContained__16y5l.Button-module_primary__EUyOu {\n color: var(--primary-contrast-text);\n background-color: var(--primary); }\n .Button-module_btnContained__16y5l.Button-module_primary__EUyOu:hover {\n background-color: var(--primary-dark); }\n\n.Button-module_btnContained__16y5l.Button-module_accent__opVgQ {\n color: var(--accent-contrast-text);\n background-color: var(--accent); }\n .Button-module_btnContained__16y5l.Button-module_accent__opVgQ:hover {\n background-color: var(--accent-dark); }\n\n.Button-module_btnContained__16y5l.Button-module_secondary__zKoGk {\n color: var(--secondary-contrast-text);\n background-color: var(--secondary); }\n .Button-module_btnContained__16y5l.Button-module_secondary__zKoGk:hover {\n background-color: var(--secondary-dark); }\n\n.Button-module_btnContained__16y5l.Button-module_light__LXeZy {\n color: var(--light-contrast-text);\n background-color: var(--light); }\n .Button-module_btnContained__16y5l.Button-module_light__LXeZy:hover {\n background-color: var(--light-dark); }\n\n.Button-module_btnContained__16y5l.Button-module_dark__5oFOT {\n color: var(--dark-contrast-text);\n background-color: var(--dark); }\n .Button-module_btnContained__16y5l.Button-module_dark__5oFOT:hover {\n background-color: var(--dark-dark); }\n\n.Button-module_btnContained__16y5l:disabled:hover {\n cursor: not-allowed; }\n\n.Button-module_btnText__N5Gys {\n box-shadow: none;\n text-decoration: none; }\n .Button-module_btnText__N5Gys.Button-module_primary__EUyOu {\n color: var(--primary) !important; }\n .Button-module_btnText__N5Gys.Button-module_primary__EUyOu:hover {\n text-decoration: none;\n background: var(--primary-highlight) !important; }\n .Button-module_btnText__N5Gys.Button-module_secondary__zKoGk {\n color: var(--secondary) !important; }\n .Button-module_btnText__N5Gys.Button-module_secondary__zKoGk:hover {\n text-decoration: none;\n background: var(--secondary-highlight) !important; }\n .Button-module_btnText__N5Gys.Button-module_accent__opVgQ {\n color: var(--accent) !important; }\n .Button-module_btnText__N5Gys.Button-module_accent__opVgQ:hover {\n text-decoration: none;\n background: var(--accent-highlight) !important; }\n .Button-module_btnText__N5Gys.Button-module_light__LXeZy {\n color: var(--light-contrast-text) !important; }\n .Button-module_btnText__N5Gys.Button-module_light__LXeZy:hover {\n text-decoration: none;\n background: var(--light-highlight) !important; }\n .Button-module_btnText__N5Gys.Button-module_dark__5oFOT {\n color: var(--dark) !important; }\n .Button-module_btnText__N5Gys.Button-module_dark__5oFOT:hover {\n text-decoration: none;\n background: var(--dark-highlight) !important; }\n\n.Button-module_btnOutline__CCFPI {\n box-shadow: none;\n text-decoration: none; }\n .Button-module_btnOutline__CCFPI.Button-module_primary__EUyOu {\n color: var(--primary) !important;\n border-color: var(--primary) !important; }\n .Button-module_btnOutline__CCFPI.Button-module_primary__EUyOu:hover {\n background: var(--primary-highlight) !important; }\n .Button-module_btnOutline__CCFPI.Button-module_secondary__zKoGk {\n color: var(--secondary) !important;\n border-color: var(--secondary) !important; }\n .Button-module_btnOutline__CCFPI.Button-module_secondary__zKoGk:hover {\n background: var(--secondary-highlight) !important; }\n .Button-module_btnOutline__CCFPI.Button-module_accent__opVgQ {\n color: var(--accent) !important;\n border-color: var(--accent) !important; }\n .Button-module_btnOutline__CCFPI.Button-module_accent__opVgQ:hover {\n background: var(--accent-highlight) !important; }\n .Button-module_btnOutline__CCFPI.Button-module_light__LXeZy {\n color: var(--light-contrast-text) !important;\n border-color: var(--light) !important; }\n .Button-module_btnOutline__CCFPI.Button-module_light__LXeZy:hover {\n background: var(--light-highlight) !important; }\n .Button-module_btnOutline__CCFPI.Button-module_dark__5oFOT {\n color: var(--dark) !important;\n border-color: var(--dark) !important; }\n .Button-module_btnOutline__CCFPI.Button-module_dark__5oFOT:hover {\n background: var(--dark-highlight) !important; }\n\n.Button-module_startIcon__Eylwr {\n display: inherit;\n margin-left: -4px;\n margin-right: 8px; }\n .Button-module_startIcon__Eylwr svg {\n width: 18px;\n height: 18px; }\n\n.Button-module_endIcon__pCffL {\n display: inherit;\n margin-left: 8px; }\n .Button-module_endIcon__pCffL svg {\n width: 18px;\n height: 18px; }\n";
510
- var styles$O = {"button":"Button-module_button__qeIer","shadow":"Button-module_shadow__6N2nE","btnContained":"Button-module_btnContained__16y5l","primary":"Button-module_primary__EUyOu","accent":"Button-module_accent__opVgQ","secondary":"Button-module_secondary__zKoGk","light":"Button-module_light__LXeZy","dark":"Button-module_dark__5oFOT","btnText":"Button-module_btnText__N5Gys","btnOutline":"Button-module_btnOutline__CCFPI","startIcon":"Button-module_startIcon__Eylwr","endIcon":"Button-module_endIcon__pCffL"};
511
- styleInject(css_248z$O);
512
-
513
- const Button = (props) => {
514
- const { children, variant = VARIANT.contained, color = COLOR.primary, isRounded, isActive, className, startIcon, endIcon, shadow = true } = props, rest = __rest(props, ["children", "variant", "color", "isRounded", "isActive", "className", "startIcon", "endIcon", "shadow"]);
515
- const getCssClasses = () => {
516
- const cssClasses = [];
517
- cssClasses.push(styles$O.button);
518
- if (variant !== 'outline' && variant !== 'text') {
519
- cssClasses.push(styles$O.btnContained);
520
- cssClasses.push(styles$O[color]);
521
- }
522
- if (variant === 'outline') {
523
- cssClasses.push(styles$O.btnOutline);
524
- cssClasses.push(styles$O[color]);
525
- }
526
- if (variant === 'text') {
527
- cssClasses.push(styles$O.btnText);
528
- cssClasses.push(styles$O[color]);
529
- }
530
- if (isRounded && variant !== 'text') {
531
- cssClasses.push(`rounded-pill`);
532
- }
533
- if (isActive) {
534
- cssClasses.push('active');
535
- }
536
- shadow && cssClasses.push(styles$O.shadow);
537
- className && cssClasses.push(className);
538
- return cssClasses.filter(css => css).join(' ');
539
- };
540
- return (React.createElement("button", Object.assign({ type: "button", className: getCssClasses() }, rest),
541
- React.createElement("span", { className: "d-flex justify-content-center" },
542
- startIcon &&
543
- React.createElement(Icon, { className: styles$O.startIcon }, startIcon),
544
- children,
545
- endIcon &&
546
- React.createElement(Icon, { className: styles$O.endIcon }, endIcon))));
547
- };
548
-
549
- var css_248z$N = ".ButtonGroup-module_buttonGroup__w6iB- button:not(:last-child) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0; }\n\n.ButtonGroup-module_buttonGroup__w6iB- button:not(:first-child) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0; }\n";
550
- var styles$N = {"buttonGroup":"ButtonGroup-module_buttonGroup__w6iB-"};
551
- styleInject(css_248z$N);
552
-
553
- const ButtonGroup = (props) => {
554
- const { children, className } = props, rest = __rest(props, ["children", "className"]);
555
- const getCssClasses = () => {
556
- const cssClasses = [];
557
- cssClasses.push(styles$N.buttonGroup);
558
- className && cssClasses.push(className);
559
- return cssClasses.filter(css => css).join(' ');
560
- };
561
- return (React.createElement("div", Object.assign({ className: getCssClasses(), role: "group" }, rest), children));
562
- };
563
-
564
- var css_248z$M = ".Breadcrumb-module_breadcrumb__-pvAn {\n display: flex;\n flex-wrap: wrap;\n padding: 0;\n margin-bottom: 0;\n list-style: none;\n margin-bottom: 1rem; }\n";
565
- var styles$M = {"breadcrumb":"Breadcrumb-module_breadcrumb__-pvAn"};
566
- styleInject(css_248z$M);
567
-
568
- const Breadcrumb = (props) => {
569
- const { children, className } = props, rest = __rest(props, ["children", "className"]);
570
- const getCssClasses = () => {
571
- const cssClasses = [];
572
- cssClasses.push(styles$M.breadcrumb);
573
- className && cssClasses.push(className);
574
- return cssClasses.filter(css => css).join(' ');
575
- };
576
- return (React.createElement("nav", Object.assign({}, rest),
577
- React.createElement("ol", { className: getCssClasses() }, children)));
578
- };
579
-
580
- const ConditionalWrapper = ({ condition, wrapper, children }) => condition ? wrapper(children) : children;
581
-
582
- var css_248z$L = ".BreadcrumbItem-module_breadcrumbItem__zsUq- {\n display: flex;\n align-items: center; }\n .BreadcrumbItem-module_breadcrumbItem__zsUq- + .BreadcrumbItem-module_breadcrumbItem__zsUq- {\n padding-left: 0.5rem; }\n .BreadcrumbItem-module_breadcrumbItem__zsUq- + .BreadcrumbItem-module_breadcrumbItem__zsUq-::before {\n float: left;\n padding-right: 0.5rem;\n color: #6c757d;\n content: \"/\"; }\n .BreadcrumbItem-module_breadcrumbItem__zsUq- a:not([href]):not([class]) {\n color: var(--primary); }\n .BreadcrumbItem-module_breadcrumbItem__zsUq-:hover {\n cursor: pointer; }\n .BreadcrumbItem-module_breadcrumbItem__zsUq-.BreadcrumbItem-module_active__Kn1dA:hover {\n cursor: unset; }\n";
583
- var styles$L = {"breadcrumbItem":"BreadcrumbItem-module_breadcrumbItem__zsUq-","active":"BreadcrumbItem-module_active__Kn1dA"};
584
- styleInject(css_248z$L);
585
-
586
- const BreadcrumbItem = (props) => {
587
- const { children, className, isActive, onClick } = props;
588
- const getCssClasses = () => {
589
- const cssClasses = [];
590
- cssClasses.push(styles$L.breadcrumbItem);
591
- className && cssClasses.push(className);
592
- isActive && cssClasses.push('active');
593
- return cssClasses.filter(css => css).join(' ');
594
- };
595
- const handleClick = (event) => {
596
- onClick && onClick(event);
597
- };
598
- return (React.createElement("li", { className: getCssClasses(), onClick: handleClick },
599
- React.createElement(ConditionalWrapper, { condition: !isActive, wrapper: label => React.createElement("a", null, label) }, children)));
600
- };
601
-
602
- var css_248z$K = ".Card-module_card__TQdQq {\n background: var(--white);\n border-radius: var(--borderRadius); }\n .Card-module_card__TQdQq.Card-module_shadow__NxDVz {\n box-shadow: var(--shadow); }\n";
603
- var styles$K = {"card":"Card-module_card__TQdQq","shadow":"Card-module_shadow__NxDVz"};
604
- styleInject(css_248z$K);
605
-
606
- const Card = (props) => {
607
- const { children, className, shadow = true } = props, rest = __rest(props, ["children", "className", "shadow"]);
608
- const getCssClasses = () => {
609
- const cssClasses = [];
610
- cssClasses.push(styles$K.card);
611
- shadow && cssClasses.push(styles$K.shadow);
612
- className && cssClasses.push(className);
613
- return cssClasses.filter(css => css).join(' ');
614
- };
615
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
616
- };
617
-
618
- var css_248z$J = ".CardBody-module_cardBody__X52VY {\n flex: 1 1 auto;\n min-height: 1px;\n padding: 1.25rem; }\n";
619
- var styles$J = {"cardBody":"CardBody-module_cardBody__X52VY"};
620
- styleInject(css_248z$J);
621
-
622
- const CardBody = (props) => {
623
- const { children, className } = props, rest = __rest(props, ["children", "className"]);
624
- const getCssClasses = () => {
625
- const cssClasses = [];
626
- cssClasses.push(styles$J.cardBody);
627
- className && cssClasses.push(className);
628
- return cssClasses.filter(css => css).join(' ');
629
- };
630
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
631
- };
632
-
633
- var css_248z$I = ".CardFooter-module_cardFooter__BpOTG {\n padding: 0.75rem 1.25rem;\n background-color: rgba(0, 0, 0, 0.03);\n border-top: 1px solid rgba(0, 0, 0, 0.125); }\n .CardFooter-module_cardFooter__BpOTG:last-child {\n border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px); }\n";
634
- var styles$I = {"cardFooter":"CardFooter-module_cardFooter__BpOTG"};
635
- styleInject(css_248z$I);
636
-
637
- const CardFooter = (props) => {
638
- const { children, className } = props, rest = __rest(props, ["children", "className"]);
639
- const getCssClasses = () => {
640
- const cssClasses = [];
641
- cssClasses.push(styles$I.cardFooter);
642
- className && cssClasses.push(className);
643
- return cssClasses.filter(css => css).join(' ');
644
- };
645
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
646
- };
647
-
648
- var css_248z$H = ".CardSubtitle-module_cardSubtitle__YdoRM {\n color: #6c757d !important; }\n";
649
- var styles$H = {"cardSubtitle":"CardSubtitle-module_cardSubtitle__YdoRM"};
650
- styleInject(css_248z$H);
651
-
652
- const CardSubtitle = (props) => {
653
- const { children, className } = props, rest = __rest(props, ["children", "className"]);
654
- const getCssClasses = () => {
655
- const cssClasses = [];
656
- cssClasses.push(styles$H.cardSubtitle);
657
- className && cssClasses.push(className);
658
- return cssClasses.filter(css => css).join(' ');
659
- };
660
- return (React.createElement("p", Object.assign({ className: getCssClasses() }, rest), children));
661
- };
662
-
663
- var css_248z$G = ".CardText-module_cardText__UtYd9:last-child {\n margin-bottom: 0; }\n";
664
- var styles$G = {"cardText":"CardText-module_cardText__UtYd9"};
665
- styleInject(css_248z$G);
666
-
667
- const CardText = (props) => {
668
- const { children, className } = props, rest = __rest(props, ["children", "className"]);
669
- const getCssClasses = () => {
670
- const cssClasses = [];
671
- cssClasses.push(styles$G.cardText);
672
- className && cssClasses.push(className);
673
- return cssClasses.filter(css => css).join(' ');
674
- };
675
- return (React.createElement("p", Object.assign({ className: getCssClasses() }, rest), children));
676
- };
677
-
678
- var css_248z$F = ".CardTitle-module_cardTitle__aiPSE {\n margin-bottom: 0;\n font-size: 1.5rem;\n font-weight: 400;\n line-height: 1.334;\n letter-spacing: 0em; }\n";
679
- var styles$F = {"cardTitle":"CardTitle-module_cardTitle__aiPSE"};
680
- styleInject(css_248z$F);
681
-
682
- const CardTitle = (props) => {
683
- const { children, className, as: As = 'div' } = props, rest = __rest(props, ["children", "className", "as"]);
684
- const getCssClasses = () => {
685
- const cssClasses = [];
686
- cssClasses.push(styles$F.cardTitle);
687
- className && cssClasses.push(className);
688
- return cssClasses.filter(css => css).join(' ');
689
- };
690
- return (React.createElement(As, Object.assign({ className: getCssClasses() }, rest), children));
691
- };
692
-
693
- var css_248z$E = ".CardImage-module_cardImage__Z6JWW {\n flex-shrink: 0;\n width: 100%;\n border-top-left-radius: calc(0.25rem - 1px);\n border-top-right-radius: calc(0.25rem - 1px); }\n";
694
- var styles$E = {"cardImage":"CardImage-module_cardImage__Z6JWW"};
695
- styleInject(css_248z$E);
696
-
697
- const CardImage = (props) => {
698
- const { src, alt, className } = props, rest = __rest(props, ["src", "alt", "className"]);
699
- const getCssClasses = () => {
700
- const cssClasses = [];
701
- cssClasses.push(styles$E.cardImage);
702
- className && cssClasses.push(className);
703
- return cssClasses.filter(css => css).join(' ');
704
- };
705
- return (React.createElement("img", Object.assign({ className: getCssClasses(), src: src, alt: alt }, rest)));
706
- };
707
-
708
- var css_248z$D = ".Checkbox-module_checkboxContainer__x2GCi {\n display: flex;\n align-items: center;\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; }\n\n.Checkbox-module_checkboxLabel__nPY4k:hover {\n cursor: pointer; }\n\n.Checkbox-module_checkboxLabel__nPY4k.Checkbox-module_disabled__wnFIG {\n color: rgba(0, 0, 0, 0.26);\n cursor: not-allowed; }\n .Checkbox-module_checkboxLabel__nPY4k.Checkbox-module_disabled__wnFIG:hover {\n cursor: not-allowed; }\n";
709
- var styles$D = {"checkboxContainer":"Checkbox-module_checkboxContainer__x2GCi","checkboxLabel":"Checkbox-module_checkboxLabel__nPY4k","disabled":"Checkbox-module_disabled__wnFIG"};
710
- styleInject(css_248z$D);
711
-
712
- const Checkbox = (props) => {
713
- const { id, checked, className, label, name, value = "off", disabled, readOnly } = props, rest = __rest(props, ["id", "checked", "className", "label", "name", "value", "disabled", "readOnly"]);
714
- // TODO
715
- // add own value
716
- // set from outer
717
- // update on change
718
- // emit to outer
719
- // can be: true/false, custom
720
- const [isChecked, setIsChecked] = useState(false);
721
- const checkboxElement = useRef(null);
722
- useEffect(() => {
723
- if (checked === true || checked === false) {
724
- setIsChecked(checked);
725
- }
726
- }, [checked]);
727
- const icons = {
728
- default: React.createElement(SquareRegularIcon, null),
729
- selected: React.createElement(CheckSquareRegularIcon, null)
730
- };
731
- const getCssClasses = () => {
732
- const cssClasses = [];
733
- cssClasses.push('checkbox');
734
- className && cssClasses.push(className);
735
- return cssClasses.filter(css => css).join(' ');
736
- };
737
- const getCssClassesLabel = () => {
738
- const cssClasses = [];
739
- cssClasses.push(styles$D.checkboxLabel);
740
- disabled && cssClasses.push(styles$D['disabled']);
741
- return cssClasses.filter(css => css).join(' ');
742
- };
743
- const getIcon = () => {
744
- return isChecked ? icons.selected : icons.default;
745
- };
746
- const handleClick = () => {
747
- var _a;
748
- if (!disabled && !readOnly) {
749
- setIsChecked(!isChecked);
750
- (_a = checkboxElement === null || checkboxElement === void 0 ? void 0 : checkboxElement.current) === null || _a === void 0 ? void 0 : _a.click();
751
- }
752
- };
753
- return (React.createElement("div", { className: styles$D.checkboxContainer },
754
- React.createElement(IconButton, { className: getCssClasses(), onClick: handleClick, icon: getIcon(), disabled: disabled || readOnly }),
755
- React.createElement("label", { onClick: handleClick, className: getCssClassesLabel() }, label),
756
- React.createElement("input", Object.assign({ type: "checkbox", ref: checkboxElement, id: id, name: name, checked: isChecked, disabled: disabled, readOnly: readOnly, hidden: true, value: value }, rest))));
757
- };
758
-
759
- var css_248z$C = ".Chip-module_chip__dZ5qz {\n display: inline-flex;\n align-items: center;\n padding: 0.5rem;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n font-size: 75%;\n font-weight: 700;\n border-radius: 10rem;\n line-height: 1; }\n .Chip-module_chip__dZ5qz svg {\n width: 18px;\n height: 18px; }\n .Chip-module_chip__dZ5qz .Chip-module_deleteIcon__--rUx {\n margin-left: 5px; }\n .Chip-module_chip__dZ5qz .Chip-module_deleteIcon__--rUx:hover {\n cursor: pointer; }\n .Chip-module_chip__dZ5qz.Chip-module_primary__YVDi9 {\n background: var(--primary);\n color: var(--primary-contrast-text); }\n .Chip-module_chip__dZ5qz.Chip-module_secondary__-e4xP {\n background: var(--secondary);\n color: var(--secondary-contrast-text); }\n .Chip-module_chip__dZ5qz.Chip-module_accent__ZCTwu {\n background: var(--accent);\n color: var(--accent-contrast-text); }\n .Chip-module_chip__dZ5qz.Chip-module_light__vKs7O {\n color: var(--light-contrast-text);\n background-color: var(--light); }\n .Chip-module_chip__dZ5qz.Chip-module_dark__G-FLQ {\n color: var(--dark-contrast-text);\n background-color: var(--dark); }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover {\n cursor: pointer; }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover.Chip-module_primary__YVDi9 {\n background: var(--primary-dark); }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover.Chip-module_secondary__-e4xP {\n background: var(--secondary-dark); }\n .Chip-module_chip__dZ5qz.Chip-module_clickable__qAqVH:hover.Chip-module_accent__ZCTwu {\n background: var(--accent-dark); }\n .Chip-module_chip__dZ5qz.Chip-module_shadow__v11NF {\n box-shadow: var(--shadow); }\n";
760
- var styles$C = {"chip":"Chip-module_chip__dZ5qz","deleteIcon":"Chip-module_deleteIcon__--rUx","primary":"Chip-module_primary__YVDi9","secondary":"Chip-module_secondary__-e4xP","accent":"Chip-module_accent__ZCTwu","light":"Chip-module_light__vKs7O","dark":"Chip-module_dark__G-FLQ","clickable":"Chip-module_clickable__qAqVH","shadow":"Chip-module_shadow__v11NF"};
761
- styleInject(css_248z$C);
762
-
763
- const Chip = (props) => {
764
- const { children, color = 'secondary', className, shadow, onClick, isDeletable, onDelete, deleteIcon = React.createElement(TimesCircleSolidIcon, null), style } = props, rest = __rest(props, ["children", "color", "className", "shadow", "onClick", "isDeletable", "onDelete", "deleteIcon", "style"]);
765
- const getCssClass = () => {
766
- const cssClasses = [];
767
- cssClasses.push(styles$C.chip);
768
- cssClasses.push(styles$C[color]);
769
- shadow && cssClasses.push(styles$C['shadow']);
770
- onClick && cssClasses.push(styles$C['clickable']);
771
- className && cssClasses.push(className);
772
- return cssClasses.filter(r => r).join(' ');
773
- };
774
- const handleClickOnDelete = (e) => {
775
- e.stopPropagation();
776
- onDelete && onDelete(e);
777
- };
778
- return (React.createElement("div", Object.assign({ className: getCssClass() }, rest, { style: style }),
779
- React.createElement("div", null, children),
780
- isDeletable && (React.createElement("div", { className: styles$C.deleteIcon, onClick: e => handleClickOnDelete(e) }, deleteIcon))));
781
- };
782
-
783
- var css_248z$B = ".FormLabel-module_formLabel__TXcHc {\n display: inline-block;\n margin-bottom: 0.5rem; }\n";
784
- var styles$B = {"formLabel":"FormLabel-module_formLabel__TXcHc"};
785
- styleInject(css_248z$B);
786
-
787
- const FormLabel = (_a) => {
788
- var { children, className, htmlFor } = _a, rest = __rest(_a, ["children", "className", "htmlFor"]);
789
- const getCssClasses = () => {
790
- const cssClasses = [];
791
- cssClasses.push(styles$B.formLabel);
792
- className && cssClasses.push(className);
793
- return cssClasses.filter(css => css).join(' ');
794
- };
795
- return (React.createElement("label", Object.assign({ htmlFor: htmlFor, className: getCssClasses() }, rest), children));
796
- };
797
-
798
- const FormGroup = (props) => {
799
- const { children, className = 'mb-1' } = props;
800
- return (React.createElement("div", { className: className }, children));
801
- };
802
-
803
- const FileInput = (props) => {
804
- const { id, className, children, name, multiple = false, accept, disabled, onChange, readOnly, value, deletable = false } = props, rest = __rest(props, ["id", "className", "children", "name", "multiple", "accept", "disabled", "onChange", "readOnly", "value", "deletable"]);
805
- const inputFileElement = useRef(null);
806
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
807
- const [model, setModel] = useState(value);
808
- const [fileList, setFileList] = useState();
809
- const getCssClasses = () => {
810
- const cssClasses = [];
811
- className && cssClasses.push(className);
812
- return cssClasses.filter(r => r).join(' ');
813
- };
814
- const handleOnChange = (event) => {
815
- const values = event.target.files;
816
- setFileList(values);
817
- onChange && onChange(event);
818
- };
819
- const handleOnDelete = () => {
820
- alert('coming soon');
821
- };
822
- return (React.createElement("div", { className: "d-flex align-items-start" },
823
- React.createElement(Button, { className: "flex-wrap", disabled: disabled, onClick: () => { var _a; return (_a = inputFileElement.current) === null || _a === void 0 ? void 0 : _a.click(); } }, children),
824
- React.createElement("div", { className: "d-flex align-items-center flex-wrap ml-1" }, fileList && Array.from(fileList).map((file) => React.createElement(Chip, { key: file.name, isDeletable: deletable, onDelete: () => handleOnDelete() }, file.name))),
825
- React.createElement("input", Object.assign({ type: "file", ref: inputFileElement, className: getCssClasses(), id: id, name: name, multiple: multiple, accept: accept, disabled: disabled, readOnly: readOnly, hidden: true, onChange: handleOnChange, value: model }, rest))));
826
- };
827
-
828
- var css_248z$A = ".Select-module_selectContainer__DHFDZ {\n position: relative; }\n\n.Select-module_select__Fbn38 {\n width: 100%;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n appearance: none;\n border-radius: 0.25rem;\n box-shadow: inset 0 1px 2px #00000013;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n align-items: center;\n min-height: calc(1.5em + 0.75rem + 2px);\n height: auto;\n display: flex; }\n .Select-module_select__Fbn38:hover {\n cursor: pointer; }\n .Select-module_select__Fbn38:focus {\n color: #212529;\n background-color: #fff;\n border-color: #86b7fe;\n outline: 0;\n box-shadow: inset 0 1px 2px #00000013, 0 0 0 0.25rem #0d6efd40; }\n\n.Select-module_selectMenu__8y4kQ {\n background-color: var(--light);\n position: absolute;\n box-shadow: var(--shadow);\n border-radius: var(--borderRadius);\n width: 100%;\n top: 2px;\n z-index: 1112;\n max-height: 280px;\n overflow: auto; }\n";
829
- var styles$A = {"selectContainer":"Select-module_selectContainer__DHFDZ","select":"Select-module_select__Fbn38","selectMenu":"Select-module_selectMenu__8y4kQ"};
830
- styleInject(css_248z$A);
831
-
832
- const Select = (props) => {
833
- var _a, _b, _c;
834
- const { id, className, options = [], value, multiple, multipleMaxCountItems = 5, onChange, onKeyDown } = props;
835
- const [model, setModel] = useState('');
836
- const [hoverIndex, setHoverIndex] = useState(null);
837
- const [isShow, setIsShow] = useState(false);
838
- const [selectedOptions, setSelectedOptions] = useState([]);
839
- const selectConainter = useRef(null);
840
- const getCssClass = () => {
841
- const cssClasses = [];
842
- className && cssClasses.push(className);
843
- cssClasses.push(styles$A.select);
844
- return cssClasses.filter(r => r).join(' ');
845
- };
846
- useEffect(() => {
847
- const newValue = value ? value : '';
848
- writeValue(newValue);
849
- if (newValue) {
850
- const option = options.find(o => o.value === newValue);
851
- if (option) {
852
- setHoverIndex(options.indexOf(option));
853
- }
854
- }
855
- }, [value, options]);
856
- useEffect(() => {
857
- if (hoverIndex) {
858
- scrollIntoView(hoverIndex);
859
- }
860
- }, [hoverIndex, isShow]);
861
- const scrollIntoView = (index) => {
862
- var _a;
863
- const htmlListItem = (_a = selectConainter.current) === null || _a === void 0 ? void 0 : _a.querySelector(`#list-item-${index}`);
864
- if (htmlListItem) {
865
- htmlListItem === null || htmlListItem === void 0 ? void 0 : htmlListItem.scrollIntoView({ block: "end", behavior: "smooth" });
866
- }
867
- };
868
- const writeValue = (val) => setModel(val);
869
- useEffect(() => {
870
- if (!multiple) {
871
- const newOption = options.find(o => o.value === model);
872
- if (newOption) {
873
- setSelectedOptions([newOption]);
874
- }
875
- }
876
- else {
877
- const filteredOptions = options.filter(o => model.indexOf(o.value) >= 0);
878
- setSelectedOptions([...filteredOptions]);
879
- }
880
- }, [model, multiple]);
881
- const handleOnClick = (option) => {
882
- let newValue = multiple ? [] : '';
883
- if (!multiple) {
884
- if (model !== option.value) {
885
- newValue = option.value;
886
- onChange && onChange(newValue);
887
- }
888
- hide();
889
- }
890
- else {
891
- const selectedOption = selectedOptions.find(o => o.value === option.value);
892
- if (selectedOption) {
893
- newValue = selectedOptions.filter(o => o.value !== option.value).map(o => o.value);
894
- }
895
- else {
896
- newValue = newValue.concat(selectedOptions.map(o => o.value));
897
- newValue.push(option.value);
898
- }
899
- onChange && onChange(newValue);
900
- }
901
- writeValue(newValue);
902
- };
903
- const show = () => setIsShow(true);
904
- const hide = () => setIsShow(false);
905
- const isActive = (option) => {
906
- return selectedOptions.indexOf(option) >= 0 || hoverIndex === options.indexOf(option);
907
- };
908
- const renderSingleViewModel = () => {
909
- let result = null;
910
- if (selectedOptions.length > 0) {
911
- result = React.createElement("span", null, selectedOptions[0].label);
912
- }
913
- return result;
914
- };
915
- const renderMultipleViewModel = () => {
916
- let result = null;
917
- if (selectedOptions.length <= multipleMaxCountItems && selectedOptions.length > 0) {
918
- result = selectedOptions
919
- .map(option => React.createElement(Chip, { key: option.value, className: "mr-2", color: COLOR.primary, isDeletable: true, onDelete: (e) => handleOnDelete(e, option) }, option.label));
920
- }
921
- else {
922
- result = React.createElement("span", null,
923
- selectedOptions.length,
924
- " Items selected");
925
- }
926
- return result;
927
- };
928
- const handleOnDelete = (event, option) => {
929
- event.stopPropagation();
930
- handleOnClick(option);
931
- };
932
- // TODO - extract with wrapper?
933
- const handleOnKeyDown = (e) => {
934
- if (isShow) {
935
- onKeyDown && onKeyDown(e);
936
- switch (e.code) {
937
- case 'Escape':
938
- hide();
939
- break;
940
- case 'ArrowDown':
941
- if (hoverIndex) {
942
- setHoverIndex(hoverIndex + 1);
943
- }
944
- break;
945
- case 'ArrowUp':
946
- // TODO
947
- if (hoverIndex) {
948
- setHoverIndex(hoverIndex - 1);
949
- }
950
- break;
951
- case 'Enter':
952
- if (hoverIndex) {
953
- const option = options[hoverIndex];
954
- if (option)
955
- handleOnClick(option);
956
- }
957
- break;
958
- }
959
- }
960
- };
961
- return (React.createElement("div", { ref: selectConainter, className: styles$A.selectContainer },
962
- React.createElement("div", { id: id, className: getCssClass(), onClick: () => show(), tabIndex: 0, onKeyDown: e => handleOnKeyDown(e) },
963
- !multiple && renderSingleViewModel(),
964
- multiple && renderMultipleViewModel(),
965
- React.createElement(Icon, { className: "ml-auto" },
966
- React.createElement(ChevronDownSolidIcon, null))),
967
- isShow &&
968
- createPortal(React.createElement(React.Fragment, null,
969
- React.createElement("div", { className: styles$A.selectMenu, style: { left: (_a = selectConainter.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().x, top: (_b = selectConainter.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().y, width: (_c = selectConainter.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().width } },
970
- React.createElement(List, null, options && options.map((option, index) => React.createElement(ListItem, { id: `list-item-${index}`, key: option.value, onClick: () => handleOnClick(option), active: isActive(option) },
971
- multiple &&
972
- React.createElement(Checkbox, { checked: isActive(option), onChange: () => handleOnClick(option) }),
973
- React.createElement(ListItemText, { primary: option.label ? option.label : option.value }))))),
974
- React.createElement(Backdrop, { style: { zIndex: 1111 }, isTransparent: true, onClick: () => hide() })), document.body)));
975
- };
976
-
977
- var css_248z$z = ".Textarea-module_textarea__L5zqa {\n min-height: calc(10em + 0.75rem + 2px);\n display: block;\n width: 100%;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n background-clip: padding-box;\n border: 2px solid var(--input-border-color);\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border-radius: var(--borderRadius);\n resize: vertical;\n color: #212529;\n background-color: #fff;\n background-clip: padding-box;\n appearance: none;\n border-radius: 0.25rem;\n box-shadow: inset 0 1px 2px #00000013;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n border: 1px solid #ced4da; }\n .Textarea-module_textarea__L5zqa:focus {\n outline: none !important;\n border-color: var(--primary); }\n .Textarea-module_textarea__L5zqa.Textarea-module_isInvalid__JI01W {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.25rem #dc354540; }\n";
978
- var styles$z = {"textarea":"Textarea-module_textarea__L5zqa","isInvalid":"Textarea-module_isInvalid__JI01W"};
979
- styleInject(css_248z$z);
980
-
981
- const Textarea = (props) => {
982
- const { className, error } = props, rest = __rest(props, ["className", "error"]);
983
- const getCssClass = () => {
984
- const cssClasses = [];
985
- cssClasses.push(styles$z.textarea);
986
- className && cssClasses.push(className);
987
- error && cssClasses.push(styles$z['isInvalid']);
988
- return cssClasses.filter(r => r).join(' ');
989
- };
990
- return (React.createElement("textarea", Object.assign({ className: getCssClass() }, rest)));
991
- };
992
-
993
- var css_248z$y = ".FormInput-module_formInput__VXZip {\n display: block;\n width: 100%;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n -webkit-appearance: none;\n appearance: none;\n border-radius: 0.25rem;\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; }\n .FormInput-module_formInput__VXZip:focus {\n color: #212529;\n background-color: #fff;\n border-color: #86b7fe;\n outline: 0;\n box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); }\n .FormInput-module_formInput__VXZip.FormInput-module_isInvalid__vQDuz {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.25rem #dc354540; }\n";
994
- var styles$y = {"formInput":"FormInput-module_formInput__VXZip","isInvalid":"FormInput-module_isInvalid__vQDuz"};
995
- styleInject(css_248z$y);
996
-
997
- const FormInput = (props) => {
998
- const { value, name, type, placeholder, className, isValid = true, options = [], textareaOptions, selectOptions, autoCompleteOptions, autoFocus, label, disabled = false, readonly = false, onInput, onChange, onBlur, onKeyDown } = props;
999
- const getCssClasses = () => {
1000
- const cssClasses = [];
1001
- cssClasses.push(styles$y.formInput);
1002
- className && cssClasses.push(className);
1003
- !isValid && cssClasses.push(styles$y['isInvalid']);
1004
- return cssClasses.filter(css => css).join(' ');
1005
- };
1006
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1007
- const handleOnInput = (value, type, name) => {
1008
- onInput && onInput({ value, type, name });
1009
- };
1010
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1011
- const handleOnChange = (value, type, name) => {
1012
- onChange && onChange({ value, type, name });
1013
- };
1014
- return (React.createElement(Fragment, null,
1015
- (type === 'text' ||
1016
- type === 'date' ||
1017
- type === 'datetime-local' ||
1018
- type === 'email' ||
1019
- type === 'number' ||
1020
- type === 'password' ||
1021
- type === 'color' ||
1022
- type === 'time')
1023
- &&
1024
- React.createElement("input", { id: name, name: name, type: type, className: getCssClasses(), value: value, autoFocus: autoFocus, onInput: e => handleOnInput(e.target.value, type, name), onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).value, type, name), onBlur: onBlur, placeholder: placeholder, readOnly: readonly, disabled: disabled, onKeyDown: onKeyDown }),
1025
- type === 'file' &&
1026
- React.createElement(FileInput, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, autoFocus: autoFocus, readOnly: readonly, disabled: disabled, onChange: e => handleOnChange(e.target.value, type, name) }, "choose a file"),
1027
- type === 'textarea' &&
1028
- React.createElement(Textarea, { id: name, name: name, className: className, error: !isValid, value: value, autoFocus: autoFocus, onInput: e => handleOnInput(e.target.value, type, name), onChange: e => handleOnChange(e.target.value, type, name), placeholder: placeholder, rows: textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.rows, style: (textareaOptions === null || textareaOptions === void 0 ? void 0 : textareaOptions.resize) !== false ? undefined : { resize: 'none' } }),
1029
- type === 'select' &&
1030
- React.createElement(Select, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, multiple: selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions.multiple, onChange: e => handleOnChange(e, type, name),
1031
- // onKeyDown={e => onKeyDown(e)}
1032
- options: options }),
1033
- type === 'autocomplete' &&
1034
- React.createElement(AutoComplete, { id: name, name: name, className: className + (!isValid ? ' is-invalid' : ''), value: value, openOnFocus: autoCompleteOptions === null || autoCompleteOptions === void 0 ? void 0 : autoCompleteOptions.openOnFocus, onChange: e => handleOnChange(e, type, name), options: options }),
1035
- type === 'checkbox' &&
1036
- React.createElement(Checkbox, { id: name, name: name, label: label, className: (!isValid ? ' is-invalid' : ''), onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).checked, type, name), checked: value }),
1037
- type === 'radio' &&
1038
- React.createElement(React.Fragment, null, options.map((option) => React.createElement("div", { className: "form-check", key: option.id },
1039
- React.createElement("input", { id: option.id ? option.id : option.value, name: name, type: "radio", className: "form-check-input", onChange: e => handleOnChange((e === null || e === void 0 ? void 0 : e.target).value, type, name), value: option.value, checked: value === option.value, onKeyDown: onKeyDown }),
1040
- React.createElement("label", { className: "form-check-label", htmlFor: option.id }, option.label))))));
1041
- };
1042
-
1043
- const FormHint = (props) => {
1044
- const { children, className = 'form-text text-muted' } = props;
1045
- const getCssClasses = () => {
1046
- const cssClasses = [];
1047
- className && cssClasses.push(className);
1048
- return cssClasses.filter(css => css).join(' ');
1049
- };
1050
- return (React.createElement("small", { className: getCssClasses() }, children));
1051
- };
1052
-
1053
- var css_248z$x = ".FormError-module_isInvalid__tO1Sw {\n width: 100%;\n margin-top: 0.25rem;\n font-size: 0.875em;\n color: #dc3545; }\n";
1054
- var styles$x = {"isInvalid":"FormError-module_isInvalid__tO1Sw"};
1055
- styleInject(css_248z$x);
1056
-
1057
- const FormError = (props) => {
1058
- const { className = styles$x.isInvalid, errors = [] } = props;
1059
- return (React.createElement(Fragment, null, errors &&
1060
- React.createElement("div", { className: className }, errors.map(e => React.createElement("div", { key: e.validator }, e.message)))));
1061
- };
1062
-
1063
- const IsEmptyValidator = (value) => value.trim() === '' || value === null || value === undefined;
1064
-
1065
- const EmailValidator = (value) => {
1066
- const isInvalidEmailFormat = value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i) === null;
1067
- const isInvalid = !IsEmptyValidator(value) && isInvalidEmailFormat;
1068
- return isInvalid;
1069
- };
1070
-
1071
- const IsEqualValidator = (valueA, valueB) => valueA === valueB;
1072
-
1073
- // values, isSubmitting, handleChange, handleBlur, handleSubmit
1074
- class Form extends Component {
1075
- constructor(props) {
1076
- super(props);
1077
- this.myForm = createRef();
1078
- this.state = { controls: undefined, isValid: false, isChanged: false, isSubmitted: false, submitOnEnter: props.submitOnEnter !== undefined ? props.submitOnEnter : true };
1079
- }
1080
- static getDerivedStateFromProps(nextProps, state) {
1081
- if (!state.controls && nextProps.controls) {
1082
- return ({ controls: nextProps.controls });
1083
- }
1084
- return null;
1085
- }
1086
- handleChange() {
1087
- // get value by myForm instead of getControl?
1088
- if (this.state.isChanged || this.state.isSubmitted) {
1089
- const keys = Object.keys(this.state.controls);
1090
- const values = keys.reduce((obj, f) => {
1091
- const control = this.getControl(f);
1092
- // TODO - refactor
1093
- const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate((control.value))) ? new Date((control.value)).toISOString() : control.value;
1094
- return (Object.assign(Object.assign({}, obj), { [f]: newValue }));
1095
- }, {});
1096
- if (this.state.isValid && this.state.isSubmitted) {
1097
- this.props.onSubmit && this.props.onSubmit(values);
1098
- }
1099
- this.props.onChange && this.props.onChange(values);
1100
- this.setState({ isChanged: false, isSubmitted: false });
1101
- }
1102
- }
1103
- // extract to service?
1104
- validateField(fieldValue, fieldValidators) {
1105
- const errors = [];
1106
- if (fieldValidators) {
1107
- for (const validator of fieldValidators) {
1108
- const validatorSplitted = validator.split(':');
1109
- const validatorName = validatorSplitted[0];
1110
- const validatorParam = validatorSplitted.length > 1 ? validatorSplitted[1] : null;
1111
- switch (validatorName) {
1112
- case 'required':
1113
- if (IsEmptyValidator(fieldValue)) {
1114
- errors.push({ validator: validatorName, message: 'This field is required' });
1115
- }
1116
- break;
1117
- case 'email':
1118
- if (EmailValidator(fieldValue)) {
1119
- errors.push({ validator: validatorName, message: 'Email format is wrong' });
1120
- }
1121
- break;
1122
- case 'match':
1123
- if (validatorParam) {
1124
- const matchControl = this.getControl(validatorParam);
1125
- if (matchControl) {
1126
- if (!IsEqualValidator(fieldValue, matchControl.value)) {
1127
- errors.push({ validator: validatorName, message: 'Values do not match' });
1128
- }
1129
- }
1130
- else {
1131
- console.error(`Form: Field ${validatorParam} not found`);
1132
- }
1133
- }
1134
- break;
1135
- }
1136
- }
1137
- }
1138
- return errors;
1139
- }
1140
- handleInputChange(name, value) {
1141
- const field = this.getControl(name);
1142
- field.value = value;
1143
- // redundant mit handleOnBlur
1144
- field.isDirty = true;
1145
- field.errors = this.validateField(field.value, field.validators);
1146
- field.isValid = field.errors.length === 0;
1147
- const newControls = Object.assign({}, this.state.controls);
1148
- newControls[name] = field;
1149
- this.setState({ controls: newControls, isChanged: true }, () => this.handleChange());
1150
- }
1151
- handleOnBlur(e) {
1152
- if (this.props.validateOnBlur) {
1153
- const { name } = e.target;
1154
- const field = this.getControl(name);
1155
- field.isDirty = true;
1156
- field.errors = this.validateField(field.value, field.validators);
1157
- field.isValid = field.errors.length === 0;
1158
- const controls = this.state.controls;
1159
- if (controls) {
1160
- controls[name] = field;
1161
- this.setState({ controls: controls, isChanged: true }, () => this.handleChange());
1162
- }
1163
- }
1164
- }
1165
- isRequired(fieldName) {
1166
- let result = false;
1167
- result = this.getControl(fieldName).validators.indexOf('required') >= 0;
1168
- return result;
1169
- }
1170
- isInvalid(fieldName) {
1171
- let result = false;
1172
- const field = this.getControl(fieldName);
1173
- result = field.isDirty && !field.isValid;
1174
- return result;
1175
- }
1176
- getControl(name) {
1177
- return this.state.controls[name];
1178
- }
1179
- renderLabel(fieldKey, label, labelClassName = 'form-label') {
1180
- const cssClasses = [labelClassName, this.isRequired(fieldKey) ? 'required' : undefined];
1181
- return React.createElement(FormLabel, { htmlFor: fieldKey, className: cssClasses.join(' ') }, label);
1182
- }
1183
- // trigger via ref
1184
- handleFormSubmit() {
1185
- for (const fieldKey of Object.keys(this.state.controls)) {
1186
- const field = this.getControl(fieldKey);
1187
- // redundant mit handleBlur
1188
- field.isDirty = true;
1189
- field.errors = this.validateField(field.value, field.validators);
1190
- field.isValid = field.errors.length === 0;
1191
- }
1192
- this.setState({
1193
- controls: Object.assign({}, this.state.controls),
1194
- isSubmitted: true,
1195
- isValid: Object.keys(this.state.controls).map(f => this.getControl(f).isValid).every(valid => valid === true)
1196
- }, () => this.handleChange());
1197
- }
1198
- // trigger via ref
1199
- handleFormReset() {
1200
- for (const fieldKey of Object.keys(this.state.controls)) {
1201
- const field = this.getControl(fieldKey);
1202
- field.value = '';
1203
- field.isDirty = false;
1204
- field.errors = [];
1205
- field.isValid = field.errors.length === 0;
1206
- }
1207
- this.setState({
1208
- controls: Object.assign({}, this.state.controls),
1209
- isSubmitted: false,
1210
- isChanged: false,
1211
- isValid: false
1212
- });
1213
- }
1214
- handleOnKeyDown(e) {
1215
- if (e.key === 'Enter') {
1216
- e.preventDefault();
1217
- this.state.submitOnEnter && this.handleFormSubmit();
1218
- }
1219
- }
1220
- destroy() {
1221
- this.setState({ controls: {}, isValid: false, isChanged: false, isSubmitted: false });
1222
- }
1223
- getFormGroupCssClass(fieldKey) {
1224
- const result = this.getControl(fieldKey).config.formGroupClassName;
1225
- return result;
1226
- }
1227
- render() {
1228
- return (React.createElement("form", { ref: this.myForm }, this.state && this.state.controls && Object.keys(this.state.controls).map((fieldKey) => {
1229
- return (React.createElement(FormGroup, { key: fieldKey, className: this.getFormGroupCssClass(fieldKey) },
1230
- this.getControl(fieldKey).config.labelPosition !== 'behind' && this.getControl(fieldKey).type !== 'checkbox' &&
1231
- this.renderLabel(fieldKey, this.getControl(fieldKey).config.label, this.getControl(fieldKey).config.labelClassName),
1232
- React.createElement(FormInput, { autoFocus: this.getControl(fieldKey).config.autoFocus, className: this.getControl(fieldKey).config.formControlClassName, isValid: !this.isInvalid(fieldKey), label: this.getControl(fieldKey).config.label, name: fieldKey, options: this.getControl(fieldKey).config.options, placeholder: this.getControl(fieldKey).config.placeholder, textareaOptions: this.getControl(fieldKey).config.textareaOptions, selectOptions: this.getControl(fieldKey).config.selectOptions, autoCompleteOptions: this.getControl(fieldKey).config.autoCompleteOptions, type: this.getControl(fieldKey).type, value: this.getControl(fieldKey).value, disabled: this.getControl(fieldKey).config.disabled, readonly: this.getControl(fieldKey).config.readonly, onChange: ({ name, value }) => this.handleInputChange(name, value), onBlur: (e) => this.handleOnBlur(e), onKeyDown: (e) => this.handleOnKeyDown(e) }),
1233
- this.getControl(fieldKey).config.labelPosition === 'behind' && this.getControl(fieldKey).type !== 'checkbox' &&
1234
- this.renderLabel(fieldKey, this.getControl(fieldKey).config.label, this.getControl(fieldKey).config.labelClassName),
1235
- this.getControl(fieldKey).config.hint &&
1236
- React.createElement(FormHint, null, this.getControl(fieldKey).config.hint),
1237
- this.getControl(fieldKey).errors &&
1238
- React.createElement(FormError, { errors: this.getControl(fieldKey).errors })));
1239
- })));
1240
- }
1241
- }
1242
- function isValidDate(dateObject) {
1243
- return new Date(dateObject).toString() !== 'Invalid Date';
1244
- }
1245
-
1246
- class FormControl {
1247
- constructor(
1248
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1249
- value, validators = [], type, config) {
1250
- this.value = value;
1251
- this.validators = validators;
1252
- this.type = type;
1253
- this.config = config;
1254
- this.errors = [];
1255
- this.isValid = false;
1256
- this.isDirty = false;
1257
- }
1258
- }
1259
-
1260
- const DaySelect = (props) => {
1261
- const { className, day = new Date().getDate(), month = new Date().getMonth(), year = new Date().getFullYear(), disabled, id, name, onChange } = props;
1262
- useEffect(() => {
1263
- init();
1264
- }, [month, year]);
1265
- const init = () => {
1266
- const daysInMonth = new Date(year, month + 1, 0).getDate();
1267
- const newDays = [];
1268
- for (let i = 1; i <= daysInMonth; i++) {
1269
- newDays.push({ value: i.toString(), label: i.toString() });
1270
- }
1271
- setDayOptions(newDays);
1272
- };
1273
- const [value, setValue] = useState(day);
1274
- const [dayOptions, setDayOptions] = useState();
1275
- const getCssClasses = () => {
1276
- const cssClasses = [];
1277
- className && cssClasses.push(className);
1278
- return cssClasses.filter(css => css).join(' ');
1279
- };
1280
- const handleOnChange = (e) => {
1281
- setValue(e);
1282
- onChange && onChange(e);
1283
- };
1284
- return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: dayOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: value.toString() }));
1285
- };
1286
-
1287
- const MonthSelect = (props) => {
1288
- const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
1289
- const { className, value = new Date().getMonth(), id, name, disabled, onChange } = props;
1290
- const [newValue, setNewValue] = useState(value);
1291
- const [monthOptions, setMonthOptions] = useState();
1292
- useEffect(() => {
1293
- setMonthOptions(months.map((m, index) => ({ value: index.toString(), label: m })));
1294
- }, []);
1295
- const getCssClasses = () => {
1296
- const cssClasses = [];
1297
- className && cssClasses.push(className);
1298
- return cssClasses.filter(css => css).join(' ');
1299
- };
1300
- const handleOnChange = (e) => {
1301
- setNewValue(e);
1302
- onChange && onChange(e);
1303
- };
1304
- return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: monthOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
1305
- };
1306
-
1307
- const YearSelect = (props) => {
1308
- const { className, from = 1970, to = new Date().getFullYear().toString(), value = new Date().getFullYear().toString(), id, name, disabled, onChange } = props;
1309
- const [newValue, setNewValue] = useState(value.toString());
1310
- const [years, setYears] = useState();
1311
- useEffect(() => {
1312
- const newYears = [];
1313
- for (let i = from; i <= to; i++) {
1314
- newYears.push({ value: i.toString(), label: i.toString() });
1315
- }
1316
- setYears(newYears.reverse());
1317
- }, [from, to]);
1318
- const getCssClasses = () => {
1319
- const cssClasses = [];
1320
- className && cssClasses.push(className);
1321
- return cssClasses.filter(css => css).join(' ');
1322
- };
1323
- const handleOnChange = (e) => {
1324
- setNewValue(e);
1325
- onChange && onChange(parseInt(e));
1326
- };
1327
- return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: years, onChange: handleOnChange, disabled: disabled, value: newValue }));
1328
- };
1329
-
1330
- var DATEMODE;
1331
- (function (DATEMODE) {
1332
- DATEMODE[DATEMODE["YEAR"] = 0] = "YEAR";
1333
- DATEMODE[DATEMODE["MONTH"] = 1] = "MONTH";
1334
- DATEMODE[DATEMODE["DAY"] = 2] = "DAY";
1335
- })(DATEMODE || (DATEMODE = {}));
1336
- const DateSelect = (props) => {
1337
- const { className, value = new Date(), disabled, yearConfig, onChange } = props;
1338
- const getCssClasses = () => {
1339
- const cssClasses = [];
1340
- cssClasses.push('row');
1341
- className && cssClasses.push(className);
1342
- return cssClasses.filter(css => css).join(' ');
1343
- };
1344
- const [currDate, setCurrDate] = useState(value);
1345
- const handleOnChange = (e, mode) => {
1346
- const currYear = mode === DATEMODE.YEAR ? e : currDate.getFullYear();
1347
- const currMonth = mode === DATEMODE.MONTH ? e : currDate.getMonth();
1348
- const currday = mode === DATEMODE.DAY ? e : currDate.getDate();
1349
- const newDate = new Date(currYear, currMonth, currday);
1350
- setCurrDate(newDate);
1351
- onChange && onChange(newDate);
1352
- };
1353
- return (React.createElement("div", { className: getCssClasses() },
1354
- React.createElement(FormGroup, { className: "col" },
1355
- React.createElement(FormLabel, null, "Year"),
1356
- React.createElement(YearSelect, { value: currDate.getFullYear(), disabled: disabled, from: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.from, to: yearConfig === null || yearConfig === void 0 ? void 0 : yearConfig.to, onChange: e => handleOnChange(e, DATEMODE.YEAR) })),
1357
- React.createElement(FormGroup, { className: "col" },
1358
- React.createElement(FormLabel, null, "Month"),
1359
- React.createElement(MonthSelect, { value: currDate.getMonth(), disabled: disabled, onChange: e => handleOnChange(e, DATEMODE.MONTH) })),
1360
- React.createElement(FormGroup, { className: "col" },
1361
- React.createElement(FormLabel, null, "Day"),
1362
- React.createElement(DaySelect, { day: currDate.getDate(), month: currDate.getMonth(), year: currDate.getFullYear(), disabled: disabled, onChange: e => handleOnChange(e, DATEMODE.DAY) }))));
1363
- };
1364
- /*
1365
- * result = { year, month, day, dayOfWeek, weekNumber }
1366
- */
1367
- // const getWeekNumber = () => {
1368
- // var d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate()));
1369
- // var dayNum = d.getUTCDay() || 7;
1370
- // d.setUTCDate(d.getUTCDate() + 4 - dayNum);
1371
- // var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
1372
- // return Math.ceil((((d - yearStart) / 86400000) + 1) / 7)
1373
- // };
1374
-
1375
- var css_248z$w = ".Drawer-module_drawer__kdQCk {\n height: 100%;\n z-index: 1101;\n bottom: 0;\n position: fixed;\n background: white;\n min-width: 280px;\n overflow-y: auto; }\n .Drawer-module_drawer__kdQCk.Drawer-module_permanent__c-y8y {\n position: inherit;\n z-index: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_left__loQVO {\n order: 0; }\n .Drawer-module_drawer__kdQCk.Drawer-module_right__sJ3mZ {\n order: 2; }\n .Drawer-module_drawer__kdQCk.Drawer-module_shadow__Myo3n {\n box-shadow: var(--shadow); }\n\n.Drawer-module_drawerOpen__07ptP {\n overflow: hidden; }\n";
1376
- var styles$w = {"drawer":"Drawer-module_drawer__kdQCk","permanent":"Drawer-module_permanent__c-y8y","left":"Drawer-module_left__loQVO","right":"Drawer-module_right__sJ3mZ","shadow":"Drawer-module_shadow__Myo3n","drawerOpen":"Drawer-module_drawerOpen__07ptP"};
1377
- styleInject(css_248z$w);
1378
-
1379
- const Drawer = (props) => {
1380
- const { children, className, position = 'left', permanent = false, target = document.body, shadow = true, onClickBackdrop } = props, rest = __rest(props, ["children", "className", "position", "permanent", "target", "shadow", "onClickBackdrop"]);
1381
- useEffect(() => {
1382
- document.body.classList.add(styles$w.drawerOpen);
1383
- return () => {
1384
- document.body.classList.remove(styles$w.drawerOpen);
1385
- };
1386
- }, []);
1387
- const handleClickBackdrop = () => {
1388
- onClickBackdrop && onClickBackdrop();
1389
- };
1390
- return createPortal(React.createElement(React.Fragment, null,
1391
- React.createElement(DrawerContent, Object.assign({ className: className, position: position, permanent: permanent, shadow: shadow }, rest), children),
1392
- !permanent && React.createElement(Backdrop, { onClick: handleClickBackdrop })), target);
1393
- };
1394
- const DrawerContent = (props) => {
1395
- const { children, className, position = 'left', permanent = false, shadow } = props, rest = __rest(props, ["children", "className", "position", "permanent", "shadow"]);
1396
- const getCssClasses = () => {
1397
- const cssClasses = [];
1398
- cssClasses.push(styles$w.drawer);
1399
- shadow && cssClasses.push(styles$w.shadow);
1400
- !!permanent && cssClasses.push(styles$w['permanent']);
1401
- position === 'left' ? cssClasses.push(styles$w['left']) : cssClasses.push(styles$w['right']);
1402
- className && cssClasses.push(className);
1403
- return cssClasses.filter(css => css).join(' ');
1404
- };
1405
- const positionStyles = {
1406
- left: { left: '0px' },
1407
- right: { right: '0px' },
1408
- };
1409
- const getStyles = () => {
1410
- return !permanent ? positionStyles[position] : undefined;
1411
- };
1412
- return (React.createElement("div", Object.assign({ className: getCssClasses(), style: getStyles() }, rest), children));
1413
- };
1414
-
1415
- var css_248z$v = ".MenuBody-module_menuBody__u4FIQ {\n z-index: 1111;\n margin: 0;\n position: absolute;\n top: 100%;\n left: 0;\n min-width: 10rem;\n padding: 8px 0px;\n font-size: 1rem;\n color: #212529;\n text-align: left;\n list-style: none;\n background-color: #fff;\n background-clip: padding-box;\n border-radius: var(--borderRadius); }\n .MenuBody-module_menuBody__u4FIQ.MenuBody-module_shadow__OBp-f {\n box-shadow: var(--shadow); }\n";
1416
- var styles$v = {"menuBody":"MenuBody-module_menuBody__u4FIQ","shadow":"MenuBody-module_shadow__OBp-f"};
1417
- styleInject(css_248z$v);
1418
-
1419
- const MenuBody = (props) => {
1420
- const { parentRef, children, className, shadow = true, menuPosition = 'left', onClickBackdrop } = props;
1421
- const menuBodyRef = useRef(null);
1422
- useEffect(() => {
1423
- if (menuBodyRef && parentRef.current && menuBodyRef.current) {
1424
- createPopper(parentRef.current, menuBodyRef.current, {
1425
- placement: `${menuPosition}-start`,
1426
- modifiers: [
1427
- {
1428
- name: 'offset',
1429
- options: {
1430
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1431
- offset: ({ placement, popper }) => {
1432
- if (placement === 'left-start') {
1433
- return [0, -popper.width]; // y, x
1434
- }
1435
- if (placement === 'right-start') {
1436
- return [0, -popper.width];
1437
- }
1438
- return [];
1439
- },
1440
- },
1441
- },
1442
- ]
1443
- });
1444
- }
1445
- }, [menuBodyRef]);
1446
- const getCssClasses = () => {
1447
- const cssClasses = [];
1448
- cssClasses.push(styles$v.menuBody);
1449
- shadow && cssClasses.push(styles$v.shadow);
1450
- className && cssClasses.push(className);
1451
- return cssClasses.filter(css => css).join(' ');
1452
- };
1453
- const handleClickBackdrop = () => {
1454
- onClickBackdrop && onClickBackdrop();
1455
- };
1456
- return (createPortal(React.createElement(React.Fragment, null,
1457
- React.createElement("div", { ref: menuBodyRef, className: getCssClasses() }, children),
1458
- React.createElement(Backdrop, { isTransparent: true, onClick: handleClickBackdrop })), document.body));
1459
- };
1460
-
1461
- var css_248z$u = ".Menu-module_menu__p8QL- {\n display: flex; }\n";
1462
- var styles$u = {"menu":"Menu-module_menu__p8QL-"};
1463
- styleInject(css_248z$u);
1464
-
1465
- const Menu = (props) => {
1466
- const { toggle, children, className, open, menuPosition, onClickBackdrop } = props, rest = __rest(props, ["toggle", "children", "className", "open", "menuPosition", "onClickBackdrop"]);
1467
- const menuContainer = useRef(null);
1468
- const toggleContainerRef = useRef(null);
1469
- const getCssClasses = () => {
1470
- const cssClasses = [];
1471
- cssClasses.push(styles$u.menu);
1472
- className && cssClasses.push(className);
1473
- return cssClasses.filter(css => css).join(' ');
1474
- };
1475
- const handleClickBackdrop = () => {
1476
- onClickBackdrop && onClickBackdrop();
1477
- };
1478
- return (React.createElement("div", Object.assign({ ref: menuContainer, className: getCssClasses() }, rest),
1479
- React.createElement("div", { ref: toggleContainerRef }, toggle),
1480
- open &&
1481
- React.createElement(MenuBody, { parentRef: toggleContainerRef, menuPosition: menuPosition, onClickBackdrop: handleClickBackdrop }, children)));
1482
- };
1483
-
1484
- var css_248z$t = ".MenuItem-module_menuItem__MeBxN {\n display: flex;\n width: 100%;\n padding: 0.25rem 1.5rem;\n clear: both;\n font-weight: 400;\n color: #212529;\n text-align: inherit;\n text-decoration: none;\n white-space: nowrap;\n background-color: transparent;\n border: 0; }\n .MenuItem-module_menuItem__MeBxN.MenuItem-module_menuItemHeader__2l732 {\n margin-bottom: 0;\n font-size: 0.875rem; }\n .MenuItem-module_menuItem__MeBxN:hover {\n cursor: pointer;\n color: #1e2125;\n background-color: rgba(0, 0, 0, 0.04); }\n";
1485
- var styles$t = {"menuItem":"MenuItem-module_menuItem__MeBxN","menuItemHeader":"MenuItem-module_menuItemHeader__2l732"};
1486
- styleInject(css_248z$t);
1487
-
1488
- const MenuItem = (props) => {
1489
- const { children, onClick, type = 'item' } = props;
1490
- const getCssClasses = () => {
1491
- const cssClasses = [];
1492
- cssClasses.push(styles$t.menuItem);
1493
- if (type === 'header') {
1494
- cssClasses.push(styles$t.menuItemHeader);
1495
- }
1496
- return cssClasses.filter(css => css).join(' ');
1497
- };
1498
- const handleClick = (e) => {
1499
- e.stopPropagation();
1500
- onClick && onClick(e);
1501
- };
1502
- return (React.createElement(ConditionalWrapper, { condition: true, wrapper: children => ((type === 'item' ? (React.createElement("a", { className: getCssClasses(), onClick: handleClick }, children)) :
1503
- React.createElement("div", { className: getCssClasses(), onClick: handleClick }, children))) }, children));
1504
- };
1505
-
1506
- const MenuToggle = ({ children }) => {
1507
- return (React.createElement(Fragment, null, children));
1508
- };
1509
-
1510
- var css_248z$s = ".MenuDivider-module_menuItemDivider__oRP-j {\n height: 0;\n margin: 0.5rem 0;\n overflow: hidden;\n border-top: 1px solid #e9ecef; }\n";
1511
- var styles$s = {"menuItemDivider":"MenuDivider-module_menuItemDivider__oRP-j"};
1512
- styleInject(css_248z$s);
1513
-
1514
- const MenuDivider = () => React.createElement("div", { className: styles$s.menuItemDivider });
1515
-
1516
- var css_248z$r = ".ExpansionPanelContent-module_expansionPanelContent__aXNfH {\n padding: 8px 16px 16px; }\n";
1517
- var styles$r = {"expansionPanelContent":"ExpansionPanelContent-module_expansionPanelContent__aXNfH"};
1518
- styleInject(css_248z$r);
1519
-
1520
- const ExpansionPanelContent = ({ children }) => {
1521
- return (React.createElement("div", { className: styles$r.expansionPanelContent }, children));
1522
- };
1523
-
1524
- var css_248z$q = ".ExpansionPanelHeader-module_expansionPanelHeader__Wy6Pq {\n display: flex;\n align-items: center;\n padding: 12px 16px;\n min-height: 48px; }\n .ExpansionPanelHeader-module_expansionPanelHeader__Wy6Pq:hover {\n cursor: pointer;\n background-color: var(--highlight); }\n";
1525
- var styles$q = {"expansionPanelHeader":"ExpansionPanelHeader-module_expansionPanelHeader__Wy6Pq"};
1526
- styleInject(css_248z$q);
1527
-
1528
- const ExpansionPanelHeader = (props) => {
1529
- const { children, isExpanded, onClick } = props;
1530
- const handleClick = (e) => {
1531
- e.stopPropagation();
1532
- onClick && onClick(e);
1533
- };
1534
- return (React.createElement("div", { className: styles$q.expansionPanelHeader, onClick: handleClick },
1535
- children,
1536
- React.createElement("span", { className: "ml-auto text-muted" },
1537
- React.createElement(Icon, null, isExpanded ? React.createElement(ChevronUpSolidIcon, null) : React.createElement(ChevronDownSolidIcon, null)))));
1538
- };
1539
-
1540
- var css_248z$p = ".ExpansionPanel-module_expansionPanel__m1yQq {\n background-color: var(--white);\n box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; }\n .ExpansionPanel-module_expansionPanel__m1yQq:first-child {\n border-top-left-radius: 4px;\n border-top-right-radius: 4px; }\n .ExpansionPanel-module_expansionPanel__m1yQq:last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px; }\n .ExpansionPanel-module_expansionPanel__m1yQq.ExpansionPanel-module_isExpanded__TS1ph {\n margin: 16px 0; }\n .ExpansionPanel-module_expansionPanel__m1yQq.ExpansionPanel-module_isExpanded__TS1ph:first-child {\n margin-top: 0; }\n .ExpansionPanel-module_expansionPanel__m1yQq.ExpansionPanel-module_isExpanded__TS1ph:last-child {\n margin-bottom: 0; }\n";
1541
- var styles$p = {"expansionPanel":"ExpansionPanel-module_expansionPanel__m1yQq","isExpanded":"ExpansionPanel-module_isExpanded__TS1ph"};
1542
- styleInject(css_248z$p);
1543
-
1544
- const ExpansionPanel = (props) => {
1545
- const { header, children, isExpanded = false, onChange } = props;
1546
- const [_isExpanded, setIsExpanded] = useState(false);
1547
- useEffect(() => {
1548
- setIsExpanded(isExpanded);
1549
- }, [isExpanded]);
1550
- const getCssClasses = () => {
1551
- const cssClasses = [];
1552
- cssClasses.push(styles$p.expansionPanel);
1553
- if (_isExpanded) {
1554
- cssClasses.push(styles$p.isExpanded);
1555
- }
1556
- return cssClasses.filter(css => css).join(' ');
1557
- };
1558
- const handleClickHeader = (event) => {
1559
- setIsExpanded(!_isExpanded);
1560
- onChange && onChange(event, !_isExpanded);
1561
- };
1562
- return (React.createElement("div", { className: getCssClasses() },
1563
- React.createElement(ExpansionPanelHeader, { isExpanded: _isExpanded, onClick: handleClickHeader }, header),
1564
- _isExpanded &&
1565
- React.createElement(ExpansionPanelContent, null, children)));
1566
- };
1567
-
1568
- var css_248z$o = ".FloatingActionButton-module_fab__Rw3kd {\n box-shadow: var(--shadow); }\n .FloatingActionButton-module_fab__Rw3kd.FloatingActionButton-module_fixed__XQOkG {\n position: fixed;\n bottom: 16px;\n right: 16px;\n z-index: 1000; }\n";
1569
- var styles$o = {"fab":"FloatingActionButton-module_fab__Rw3kd","fixed":"FloatingActionButton-module_fixed__XQOkG"};
1570
- styleInject(css_248z$o);
1571
-
1572
- const FloatingActionButton = (props) => {
1573
- const { className, icon, color = COLOR.primary, fixed, size = SIZE.lg, isActive, disabled, onClick } = props;
1574
- const getCssClasses = () => {
1575
- const cssClasses = [];
1576
- cssClasses.push(styles$o.fab);
1577
- fixed && cssClasses.push(styles$o['fixed']);
1578
- className && cssClasses.push(className);
1579
- return cssClasses.filter(css => css).join(' ');
1580
- };
1581
- const handleClick = (e) => {
1582
- e.stopPropagation();
1583
- onClick && onClick(e);
1584
- };
1585
- return (React.createElement(IconButton, { className: getCssClasses(), color: color, size: size, isActive: isActive, disabled: disabled, icon: icon, variant: VARIANT.contained, onClick: handleClick }));
1586
- };
1587
-
1588
- var css_248z$n = ".Column-module_column__fcTgl {\n flex: 1 0 0%; }\n";
1589
- var styles$n = {"column":"Column-module_column__fcTgl"};
1590
- styleInject(css_248z$n);
1591
-
1592
- const Column = (props) => {
1593
- const { children, className } = props,
1594
- // xs,
1595
- // sm,
1596
- // md,
1597
- // lg,
1598
- // xl,
1599
- rest = __rest(props, ["children", "className"]);
1600
- const getCssClasses = () => {
1601
- const cssClasses = [];
1602
- // !xs && !sm && !md && !lg && !xl && cssClasses.push('col');
1603
- // if (xs) cssClasses.push(`col-${xs.toString()}`);
1604
- // if (sm) cssClasses.push(`col-sm-${sm.toString()}`);
1605
- // if (md) cssClasses.push(`col-md-${md.toString()}`);
1606
- // if (lg) cssClasses.push(`col-lg-${lg.toString()}`);
1607
- // if (xl) cssClasses.push(`col-xl-${xl.toString()}`);
1608
- cssClasses.push(styles$n.column);
1609
- className && cssClasses.push(className);
1610
- return cssClasses.filter(css => css).join(' ');
1611
- };
1612
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
1613
- };
1614
-
1615
- var css_248z$m = ".Row-module_row__bTIWp {\n display: flex;\n gap: 15px;\n flex-wrap: wrap; }\n .Row-module_row__bTIWp > * {\n flex-shrink: 0;\n width: 100%;\n min-width: 0;\n max-width: 100%; }\n";
1616
- var styles$m = {"row":"Row-module_row__bTIWp"};
1617
- styleInject(css_248z$m);
1618
-
1619
- const Row = (_a) => {
1620
- var { children, direction = 'row', className } = _a, rest = __rest(_a, ["children", "direction", "className"]);
1621
- const getCssClasses = () => {
1622
- const cssClasses = [];
1623
- cssClasses.push(styles$m.row);
1624
- className && cssClasses.push(className);
1625
- direction && cssClasses.push(`flex-${direction}`);
1626
- return cssClasses.filter(css => css).join(' ');
1627
- };
1628
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
1629
- };
1630
-
1631
- var css_248z$l = ".Link-module_link__YlJQl {\n color: var(--primary);\n text-decoration: underline; }\n .Link-module_link__YlJQl:hover {\n color: var(--primary-dark); }\n";
1632
- var styles$l = {"link":"Link-module_link__YlJQl"};
1633
- styleInject(css_248z$l);
1634
-
1635
- const Link = (props) => {
1636
- const { href = '#', className, target, children } = props, rest = __rest(props, ["href", "className", "target", "children"]);
1637
- const [status, setStatus] = useState(STATUS.NORMAL);
1638
- const getCssClasses = () => {
1639
- const cssClasses = [];
1640
- cssClasses.push(styles$l.link);
1641
- className && cssClasses.push(className);
1642
- status !== STATUS.NORMAL && cssClasses.push(status);
1643
- return cssClasses.filter(css => css).join(' ');
1644
- };
1645
- const onMouseEnter = () => {
1646
- setStatus(STATUS.HOVERED);
1647
- };
1648
- const onMouseLeave = () => {
1649
- setStatus(STATUS.NORMAL);
1650
- };
1651
- return (React.createElement("a", Object.assign({ className: getCssClasses(), href: href, target: target, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, rest), children));
1652
- };
1653
-
1654
- var css_248z$k = ".LoadingIndicator-module_loadingIndicatorContainer__GS9OG {\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%; }\n\n.LoadingIndicator-module_loadingIndicator__EC9sx {\n animation-name: LoadingIndicator-module_spinAnimation__LeY4Z;\n animation-duration: 5000ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n width: 24px;\n height: 24px; }\n\n@keyframes LoadingIndicator-module_spinAnimation__LeY4Z {\n from {\n transform: rotate(0deg); }\n to {\n transform: rotate(360deg); } }\n";
1655
- var styles$k = {"loadingIndicatorContainer":"LoadingIndicator-module_loadingIndicatorContainer__GS9OG","loadingIndicator":"LoadingIndicator-module_loadingIndicator__EC9sx","spinAnimation":"LoadingIndicator-module_spinAnimation__LeY4Z"};
1656
- styleInject(css_248z$k);
1657
-
1658
- const LoadingIndicator = (_a) => {
1659
- var rest = __rest(_a, []);
1660
- const getCssClasses = () => {
1661
- const cssClasses = [];
1662
- cssClasses.push(styles$k.loadingIndicator);
1663
- return cssClasses.filter(css => css).join(' ');
1664
- };
1665
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest),
1666
- React.createElement(SpinnerSolidIcon, null)));
1667
- };
1668
-
1669
- const LoadingIndicatorContainer = ({ children }) => {
1670
- const getCssClasses = () => {
1671
- const cssClasses = [];
1672
- cssClasses.push(styles$k.loadingIndicatorContainer);
1673
- return cssClasses.filter(css => css).join(' ');
1674
- };
1675
- return (React.createElement("div", { className: getCssClasses() }, children));
1676
- };
1677
-
1678
- class LoadingIndicatorService {
1679
- show() {
1680
- if (this.container) {
1681
- this.hide();
1682
- }
1683
- this.container = document.createElement('div');
1684
- this.container.classList.add('snackbar-container');
1685
- document.body.appendChild(this.container);
1686
- render(React.createElement(LoadingIndicatorContainer, null,
1687
- React.createElement(LoadingIndicator, null)), this.container);
1688
- }
1689
- hide() {
1690
- if (this.container) {
1691
- unmountComponentAtNode(this.container);
1692
- document.body.removeChild(this.container);
1693
- this.container = undefined;
1694
- this.handler && clearTimeout(this.handler);
1695
- }
1696
- }
1697
- }
1698
- const loadingIndicatorService = new LoadingIndicatorService();
1699
-
1700
- var css_248z$j = ".ModalHeader-module_modalHeader__tw-u- {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: space-between;\n padding: 1rem 1rem;\n border-top-left-radius: calc(0.3rem - 1px);\n border-top-right-radius: calc(0.3rem - 1px);\n border-bottom: none;\n align-items: center; }\n\n.ModalHeader-module_modalTitle__2xShH {\n margin-bottom: 0;\n line-height: 1.5; }\n";
1701
- var styles$j = {"modalHeader":"ModalHeader-module_modalHeader__tw-u-","modalTitle":"ModalHeader-module_modalTitle__2xShH"};
1702
- styleInject(css_248z$j);
1703
-
1704
- const ModalHeader = (props) => {
1705
- const { children, isDismissable = false, onClose } = props, rest = __rest(props, ["children", "isDismissable", "onClose"]);
1706
- const handleClick = () => {
1707
- onClose && onClose();
1708
- };
1709
- return (React.createElement("div", Object.assign({ className: styles$j.modalHeader }, rest),
1710
- React.createElement("h5", { className: styles$j.modalTitle }, children),
1711
- isDismissable &&
1712
- React.createElement(IconButton, { icon: React.createElement(TimesSolidIcon, null), variant: VARIANT.text, onClick: handleClick })));
1713
- };
1714
-
1715
- var css_248z$i = ".ModalBody-module_modalBody__D-gk2 {\n position: relative;\n flex: 1 1 auto;\n padding: 1rem; }\n";
1716
- var styles$i = {"modalBody":"ModalBody-module_modalBody__D-gk2"};
1717
- styleInject(css_248z$i);
1718
-
1719
- const ModalBody = ({ children }) => (React.createElement("div", { className: styles$i.modalBody }, children));
1720
-
1721
- var css_248z$h = ".ModalFooter-module_modalFooter__SNm-f {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n align-items: center;\n justify-content: flex-end;\n padding: 0.75rem;\n border-bottom-right-radius: calc(0.3rem - 1px);\n border-bottom-left-radius: calc(0.3rem - 1px); }\n .ModalFooter-module_modalFooter__SNm-f > * {\n margin: 0.25rem; }\n";
1722
- var styles$h = {"modalFooter":"ModalFooter-module_modalFooter__SNm-f"};
1723
- styleInject(css_248z$h);
1724
-
1725
- const ModalFooter = ({ children }) => (React.createElement("div", { className: styles$h.modalFooter }, children));
1726
-
1727
- var css_248z$g = ".Modal-module_modal__HMxWV {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n outline: 0;\n z-index: 1111 !important;\n border-radius: var(--borderRadius); }\n .Modal-module_modal__HMxWV .Modal-module_sm__CsR6U {\n max-width: 300px; }\n .Modal-module_modal__HMxWV .Modal-module_md__lNggx {\n max-width: 500px; }\n .Modal-module_modal__HMxWV .Modal-module_lg__6dtT2 {\n max-width: 1140px; }\n @media (min-width: 576px) {\n .Modal-module_modal__HMxWV .Modal-module_modal-dialog__U2wGf {\n max-width: 600px; } }\n\n.Modal-module_modalDialog__fNqyK {\n position: relative;\n width: auto;\n pointer-events: none; }\n @media (min-width: 576px) {\n .Modal-module_modalDialog__fNqyK {\n max-width: 500px;\n margin: 1.75rem auto; } }\n\n.Modal-module_modalDialogCentered__sa2wv {\n min-height: calc(100% - 3.5rem);\n display: flex;\n align-items: center; }\n\n.Modal-module_modalContent__9wAwB {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n pointer-events: auto;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 0.3rem;\n box-shadow: 0 0.125rem 0.25rem black;\n outline: 0; }\n\n.Modal-module_fullscreen__iepGa {\n width: 100% !important;\n height: 100% !important;\n max-height: 100% !important;\n margin: 0;\n padding: 0; }\n .Modal-module_fullscreen__iepGa .Modal-module_modalContent__9wAwB {\n height: auto;\n min-height: 100%;\n max-height: 100%;\n border-radius: 0;\n overflow: auto; }\n @media (min-width: 320px) {\n .Modal-module_fullscreen__iepGa {\n max-width: 100% !important; } }\n";
1728
- var styles$g = {"modal":"Modal-module_modal__HMxWV","sm":"Modal-module_sm__CsR6U","md":"Modal-module_md__lNggx","lg":"Modal-module_lg__6dtT2","modal-dialog":"Modal-module_modal-dialog__U2wGf","modalDialog":"Modal-module_modalDialog__fNqyK","modalDialogCentered":"Modal-module_modalDialogCentered__sa2wv","modalContent":"Modal-module_modalContent__9wAwB","fullscreen":"Modal-module_fullscreen__iepGa"};
1729
- styleInject(css_248z$g);
1730
-
1731
- const Modal = (props) => {
1732
- const { className, size, fullScreen, children, header, footer, onHeaderCloseClick, onBackdropClick, isDismissable = false } = props;
1733
- const getCssClass = () => {
1734
- const cssClasses = [];
1735
- cssClasses.push(styles$g.modalDialog);
1736
- cssClasses.push(styles$g.modalDialogCentered);
1737
- fullScreen && cssClasses.push(styles$g.fullscreen);
1738
- size && cssClasses.push(styles$g[size]);
1739
- className && cssClasses.push(className);
1740
- return cssClasses.filter(r => r).join(' ');
1741
- };
1742
- useEffect(() => {
1743
- document.body.classList.add('modal-open');
1744
- return () => {
1745
- document.body.classList.remove('modal-open');
1746
- };
1747
- }, []);
1748
- const handleClickBackdrop = () => {
1749
- onBackdropClick && onBackdropClick();
1750
- };
1751
- return (React.createElement(React.Fragment, null,
1752
- React.createElement("div", { className: styles$g.modal },
1753
- React.createElement("div", { className: getCssClass() },
1754
- React.createElement("div", { className: styles$g.modalContent },
1755
- header &&
1756
- React.createElement(ModalHeader, { isDismissable: isDismissable, onClose: () => onHeaderCloseClick && onHeaderCloseClick() }, header),
1757
- React.createElement(ModalBody, null, children),
1758
- footer &&
1759
- React.createElement(ModalFooter, null, footer)))),
1760
- React.createElement(Backdrop, { onClick: handleClickBackdrop })));
1761
- };
1762
-
1763
- // export enum MODALRESULT { OK = 'OK', CANCEL = 'CANCEL', DELETE = 'DELETE' }
1764
- var MODALTYPE;
1765
- (function (MODALTYPE) {
1766
- MODALTYPE["BASIC"] = "BASIC";
1767
- MODALTYPE["FORM"] = "FORM";
1768
- })(MODALTYPE || (MODALTYPE = {}));
1769
- var MODALBUTTONTYPE;
1770
- (function (MODALBUTTONTYPE) {
1771
- MODALBUTTONTYPE["OK"] = "OK";
1772
- MODALBUTTONTYPE["CANCEL"] = "CANCEL";
1773
- MODALBUTTONTYPE["RESET"] = "RESET";
1774
- MODALBUTTONTYPE["DEFAULT"] = "DEFAULT";
1775
- })(MODALBUTTONTYPE || (MODALBUTTONTYPE = {}));
1776
-
1777
- const GlobalModal = ({ title, description, formControls, onOk, onCancel, isDismissable = false, buttons = [
1778
- { label: 'Cancel', type: MODALBUTTONTYPE.CANCEL, color: COLOR.secondary, variant: VARIANT.text, shadow: false },
1779
- { label: 'Ok', type: MODALBUTTONTYPE.OK, variant: VARIANT.contained, focus: true },
1780
- ], size = SIZE.md, fullScreen = false }) => {
1781
- // workaround for getDerivedStateFromProps
1782
- const [myControls, setMyControls] = useState(null);
1783
- useEffect(() => {
1784
- setMyControls(Object.assign({}, formControls));
1785
- }, []);
1786
- // end
1787
- const modalType = formControls ? MODALTYPE.FORM : MODALTYPE.BASIC;
1788
- const myForm = useRef(null);
1789
- const handleOk = () => {
1790
- var _a;
1791
- if (modalType === MODALTYPE.FORM) {
1792
- (_a = myForm === null || myForm === void 0 ? void 0 : myForm.current) === null || _a === void 0 ? void 0 : _a.handleFormSubmit();
1793
- }
1794
- else {
1795
- onOk && onOk();
1796
- }
1797
- };
1798
- const handleCancel = () => {
1799
- onCancel && onCancel();
1800
- };
1801
- const onSubmit = (values) => {
1802
- onOk && onOk(values);
1803
- };
1804
- const handleClickButton = (button) => {
1805
- switch (button.type) {
1806
- case MODALBUTTONTYPE.OK:
1807
- handleOk();
1808
- break;
1809
- case MODALBUTTONTYPE.CANCEL:
1810
- handleCancel();
1811
- break;
1812
- default:
1813
- handleCancel();
1814
- break;
1815
- }
1816
- button.handler && button.handler();
1817
- };
1818
- return (React.createElement(Modal, { size: size, fullScreen: fullScreen, header: title, onHeaderCloseClick: onCancel, isDismissable: isDismissable, footer: React.createElement(Fragment, null, buttons.map((button, index) => (React.createElement(Button, { key: index, variant: button.variant, color: button.color, autoFocus: button.autoFocus, shadow: button.shadow, onClick: () => handleClickButton(button) }, button.label)))) },
1819
- description && React.createElement("div", null, description),
1820
- modalType === MODALTYPE.FORM &&
1821
- React.createElement(Fragment, null,
1822
- React.createElement(Form, { ref: myForm, controls: myControls, validateOnBlur: true, onSubmit: onSubmit }))));
1823
- };
1824
-
1825
- class ModalService {
1826
- show(title, description, options) {
1827
- return new Promise((resolve, reject) => {
1828
- if (!this.container) {
1829
- this.container = document.createElement('div');
1830
- document.body.appendChild(this.container);
1831
- const handleOk = (values) => {
1832
- resolve(values);
1833
- this.hide();
1834
- };
1835
- const handleCancel = () => {
1836
- reject();
1837
- this.hide();
1838
- };
1839
- render(React.createElement(GlobalModal, { fullScreen: options && options.fullScreen, size: options && options.size, title: title, description: description, formControls: options && options.formControls, onCancel: handleCancel, onOk: handleOk, isDismissable: options && options.isDismissable, buttons: options && options.buttons }), this.container);
1840
- }
1841
- });
1842
- }
1843
- hide() {
1844
- if (this.container) {
1845
- unmountComponentAtNode(this.container);
1846
- document.body.removeChild(this.container);
1847
- this.container = undefined;
1848
- }
1849
- }
1850
- }
1851
- const modalService = new ModalService();
1852
-
1853
- const NumberSelect = (props) => {
1854
- const { className, value = 0, from = 0, to = 100, id, name, disabled = false, onChange } = props;
1855
- const [newValue, setNewValue] = useState(0);
1856
- const [numberOptions, setNumberOptions] = useState();
1857
- useEffect(() => {
1858
- setNewValue(value);
1859
- }, [value]);
1860
- useEffect(() => {
1861
- const options = [];
1862
- for (let i = from; i <= to; i++) {
1863
- options.push({ value: i.toString(), label: i.toString() });
1864
- }
1865
- setNumberOptions(options);
1866
- }, [from, to]);
1867
- const getCssClasses = () => {
1868
- const cssClasses = [];
1869
- className && cssClasses.push(className);
1870
- return cssClasses.filter(css => css).join(' ');
1871
- };
1872
- const handleOnChange = (e) => {
1873
- setNewValue(e);
1874
- onChange && onChange(e);
1875
- };
1876
- return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: numberOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
1877
- };
1878
-
1879
- class SidebarItemModel {
1880
- constructor(id, label, path, icon, isActive, items, isCollapsible = false, isCollapsed = false) {
1881
- this.id = id;
1882
- this.label = label;
1883
- this.path = path;
1884
- this.icon = icon;
1885
- this.isActive = isActive;
1886
- this.items = items;
1887
- this.isCollapsible = isCollapsible;
1888
- this.isCollapsed = isCollapsed;
1889
- }
1890
- }
1891
-
1892
- const Sidebar = (props) => {
1893
- const { className, items, currentUrl, onItemClicked } = props, rest = __rest(props, ["className", "items", "currentUrl", "onItemClicked"]);
1894
- const [menuItems, setMenuItems] = useState([]);
1895
- useEffect(() => {
1896
- if (items && items.length > 0) {
1897
- initMenuItems();
1898
- }
1899
- }, []);
1900
- const getCssClasses = () => {
1901
- const cssClasses = [];
1902
- className && cssClasses.push(className);
1903
- return cssClasses.filter(css => css).join(' ');
1904
- };
1905
- const initMenuItems = () => {
1906
- const newItems = items.map(item => new SidebarItemModel(item.id, item.label, item.path, item.icon, isMenuItemActive(item.path), item.items && item.items.map(subItem => new SidebarItemModel(subItem.id, subItem.label, subItem.path, subItem.icon, isMenuItemActive(`${item.path}/${subItem.path}`))), item.isCollapsible, item.isCollapsed));
1907
- setMenuItems(newItems);
1908
- };
1909
- const isMenuItemActive = (path) => {
1910
- const lastSegment = currentUrl.substring(currentUrl.lastIndexOf('/') + 1, currentUrl.length);
1911
- let result = false;
1912
- if (currentUrl === '/' && path === '') {
1913
- result = true;
1914
- }
1915
- else if (path !== '') {
1916
- result = lastSegment ? lastSegment.toLowerCase() === path.toLowerCase() : false;
1917
- }
1918
- return result;
1919
- };
1920
- const navigate = (e, path) => {
1921
- e.stopPropagation();
1922
- e.preventDefault();
1923
- onItemClicked(path);
1924
- };
1925
- const handleClickItem = (item, e) => {
1926
- if (item.items && item.items.length > 0 && item.isCollapsible) {
1927
- const newMenuItems = menuItems.map((menuItem) => {
1928
- if (item.id === menuItem.id) {
1929
- menuItem.isCollapsed = !item.isCollapsed;
1930
- }
1931
- return menuItem;
1932
- });
1933
- setMenuItems(newMenuItems);
1934
- }
1935
- else {
1936
- navigate(e, `/${item.path}`);
1937
- }
1938
- };
1939
- const handleClickSubItem = (itemPath, subItemPath, e) => {
1940
- navigate(e, `/${itemPath}/${subItemPath}`);
1941
- };
1942
- return (React.createElement("nav", Object.assign({ className: getCssClasses() }, rest),
1943
- React.createElement(List, null, menuItems.map(item => (React.createElement(React.Fragment, { key: item.id },
1944
- React.createElement(ListItem, { active: isMenuItemActive(item.path), onClick: (e) => handleClickItem(item, e) },
1945
- React.createElement(ListItemText, { primary: React.createElement(React.Fragment, null,
1946
- item.label,
1947
- item.items && item.items.length > 0 && (React.createElement("small", { className: "ml-2" },
1948
- "(",
1949
- item.items.length,
1950
- ")"))) }),
1951
- item.items && item.items.length > 0 &&
1952
- React.createElement(ListItemAction, null, item.isCollapsed ? React.createElement(ChevronDownSolidIcon, null) : React.createElement(ChevronUpSolidIcon, null))),
1953
- !item.isCollapsed && item.items && item.items.length > 0 && (React.createElement(List, { className: "list-level-1", key: `${item.id}-sub` }, item.items.map(subItem => (React.createElement(ListItem, { className: "list-item-level-1", active: isMenuItemActive(subItem.path), key: subItem.id, onClick: (e) => handleClickSubItem(item.path, subItem.path, e) }, subItem.label)))))))))));
1954
- };
1955
-
1956
- var css_248z$f = ".Snackbar-module_snackbar__O5T2b {\n display: flex;\n align-items: center;\n min-width: 288px;\n padding: 6px 16px;\n transform-origin: center;\n min-height: 52px;\n animation: Snackbar-module_bounceIn__E47iD 0.4s ease;\n z-index: 1001;\n position: fixed;\n left: 50%;\n transform: translateX(-50%);\n bottom: 2%;\n border-radius: var(--borderRadius); }\n .Snackbar-module_snackbar__O5T2b.Snackbar-module_primary__ZBOTN {\n color: var(--primary-contrast-text);\n background-color: var(--primary); }\n .Snackbar-module_snackbar__O5T2b.Snackbar-module_accent__0MnFy {\n color: var(--accent-contrast-text);\n background-color: var(--accent); }\n .Snackbar-module_snackbar__O5T2b.Snackbar-module_secondary__s8-ez {\n color: var(--secondary-contrast-text);\n background-color: var(--secondary); }\n .Snackbar-module_snackbar__O5T2b.Snackbar-module_light__Vrd7o {\n color: var(--light-contrast-text);\n background-color: var(--light); }\n .Snackbar-module_snackbar__O5T2b.Snackbar-module_dark__U-5io {\n color: var(--dark-contrast-text);\n background-color: var(--dark); }\n\n.Snackbar-module_text__G5r5D {\n width: 100%;\n padding: 8px 0; }\n\n.Snackbar-module_action__vus2Y {\n margin-left: auto; }\n .Snackbar-module_action__vus2Y:hover {\n cursor: pointer; }\n\n@keyframes Snackbar-module_bounceIn__E47iD {\n 0% {\n opacity: 0; }\n 50% {\n opacity: 0.9; }\n 80% {\n opacity: 1; }\n 100% {\n opacity: 1; } }\n";
1957
- var styles$f = {"snackbar":"Snackbar-module_snackbar__O5T2b","bounceIn":"Snackbar-module_bounceIn__E47iD","primary":"Snackbar-module_primary__ZBOTN","accent":"Snackbar-module_accent__0MnFy","secondary":"Snackbar-module_secondary__s8-ez","light":"Snackbar-module_light__Vrd7o","dark":"Snackbar-module_dark__U-5io","text":"Snackbar-module_text__G5r5D","action":"Snackbar-module_action__vus2Y"};
1958
- styleInject(css_248z$f);
1959
-
1960
- const Snackbar = (props) => {
1961
- const { children, color = COLOR.dark, actionText = 'ok', onOk } = props, rest = __rest(props, ["children", "color", "actionText", "onOk"]);
1962
- const getCssClasses = () => {
1963
- const cssClasses = [];
1964
- cssClasses.push(styles$f.snackbar);
1965
- cssClasses.push(`shadow-lg`);
1966
- cssClasses.push(styles$f[color]);
1967
- return cssClasses.filter(css => css).join(' ');
1968
- };
1969
- const handleClickAction = (e) => {
1970
- onOk && onOk(e);
1971
- };
1972
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest),
1973
- React.createElement("div", { className: styles$f.text }, children),
1974
- React.createElement("div", { className: styles$f.action + " text-accent", onClick: handleClickAction },
1975
- React.createElement("span", null, actionText))));
1976
- };
1977
-
1978
- class SnackbarService {
1979
- show(message, options) {
1980
- const defaultOptions = { timeout: 3000, actionText: 'ok', color: COLOR.dark, target: document.body };
1981
- const mergedOptions = Object.assign(defaultOptions, options);
1982
- return new Promise((resolve) => {
1983
- if (this.container) {
1984
- this.hide();
1985
- }
1986
- this.container = document.createElement('div');
1987
- this.container.classList.add('snackbar-container');
1988
- mergedOptions.target.appendChild(this.container);
1989
- if (mergedOptions.timeout && mergedOptions.timeout > 0) {
1990
- this.handler = setTimeout(() => {
1991
- this.hide();
1992
- }, mergedOptions.timeout);
1993
- }
1994
- const handleOk = () => {
1995
- resolve();
1996
- this.hide();
1997
- };
1998
- render(React.createElement(Snackbar, { color: mergedOptions.color, actionText: mergedOptions.actionText, onOk: handleOk }, message), this.container);
1999
- });
2000
- }
2001
- hide() {
2002
- if (this.container) {
2003
- unmountComponentAtNode(this.container);
2004
- document.body.removeChild(this.container);
2005
- this.container = undefined;
2006
- this.handler && clearTimeout(this.handler);
2007
- }
2008
- }
2009
- }
2010
- const snackbarService = new SnackbarService();
2011
-
2012
- var css_248z$e = ".SpeedDialActions-module_speedDialActions__cY2i3 {\n margin-bottom: -32px;\n flex-direction: column-reverse;\n padding-bottom: 48px;\n display: flex;\n pointer-events: auto; }\n";
2013
- var styles$e = {"speedDialActions":"SpeedDialActions-module_speedDialActions__cY2i3"};
2014
- styleInject(css_248z$e);
2015
-
2016
- const SpeedDialActions = (props) => {
2017
- const { children } = props;
2018
- const getCssClasses = () => {
2019
- const cssClasses = [];
2020
- cssClasses.push(styles$e.speedDialActions);
2021
- return cssClasses.filter(css => css).join(' ');
2022
- };
2023
- return (React.createElement("div", { className: getCssClasses() }, children));
2024
- };
2025
-
2026
- var css_248z$d = ".SpeedDial-module_speedDial__W3VN2 {\n position: absolute;\n flex-direction: column-reverse;\n display: flex;\n z-index: 1050;\n align-items: center;\n right: 16px;\n bottom: 16px;\n transition: transform 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; }\n";
2027
- var styles$d = {"speedDial":"SpeedDial-module_speedDial__W3VN2"};
2028
- styleInject(css_248z$d);
2029
-
2030
- const SpeedDial = (props) => {
2031
- const { children, className, open, onOpen, onClose } = props, rest = __rest(props, ["children", "className", "open", "onOpen", "onClose"]);
2032
- const getCssClasses = () => {
2033
- const cssClasses = [];
2034
- cssClasses.push(styles$d.speedDial);
2035
- className && cssClasses.push(className);
2036
- return cssClasses.filter(css => css).join(' ');
2037
- };
2038
- const handleClick = (e) => {
2039
- if (open)
2040
- onClose && onClose(e);
2041
- else
2042
- onOpen && onOpen(e);
2043
- };
2044
- return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest),
2045
- React.createElement("div", { style: { 'transform': open ? 'rotate(45deg)' : undefined } },
2046
- React.createElement(FloatingActionButton, { icon: React.createElement(PlusSolidIcon, null), onClick: handleClick })),
2047
- open &&
2048
- React.createElement(SpeedDialActions, null, children)));
2049
- };
2050
-
2051
- var css_248z$c = ".SpeedDialAction-module_speedDialAction__kJLpz + .SpeedDialAction-module_speedDialAction__kJLpz {\n margin-bottom: 10px; }\n";
2052
- var styles$c = {"speedDialAction":"SpeedDialAction-module_speedDialAction__kJLpz"};
2053
- styleInject(css_248z$c);
2054
-
2055
- const SpeedDialAction = (props) => {
2056
- const { icon, color = COLOR.light, onClick, className } = props;
2057
- const getCssClasses = () => {
2058
- const cssClasses = [];
2059
- cssClasses.push(styles$c.speedDialAction);
2060
- className && cssClasses.push(className);
2061
- return cssClasses.filter(css => css).join(' ');
2062
- };
2063
- return (React.createElement(IconButton, { className: getCssClasses(), icon: icon, color: color, variant: VARIANT.contained, shadow: true, onClick: onClick }));
2064
- };
2065
-
2066
- const SpeedDialIcon = (props) => {
2067
- const { children, className } = props, rest = __rest(props, ["children", "className"]);
2068
- const getCssClasses = () => {
2069
- const cssClasses = [];
2070
- className && cssClasses.push(className);
2071
- return cssClasses.filter(css => css).join(' ');
2072
- };
2073
- return (React.createElement(Icon, Object.assign({ className: getCssClasses() }, rest), children));
2074
- };
2075
-
2076
- var css_248z$b = ".StepperActions-module_stepperActions__hBUkh {\n display: flex; }\n";
2077
- var styles$b = {"stepperActions":"StepperActions-module_stepperActions__hBUkh"};
2078
- styleInject(css_248z$b);
2079
-
2080
- const StepperActions = (props) => {
2081
- const { className, isCompleted, isFirstStep, isStepOptional, onBack, onSkip, onNext, onReset } = props;
2082
- const getCssClasses = () => {
2083
- const cssClasses = [];
2084
- cssClasses.push(styles$b.stepperActions);
2085
- className && cssClasses.push(className);
2086
- return cssClasses.filter(css => css).join(' ');
2087
- };
2088
- return (React.createElement("div", { className: getCssClasses() },
2089
- React.createElement(Button, { className: "mr-2", variant: VARIANT.outline, disabled: isFirstStep, startIcon: !isFirstStep ? React.createElement(ChevronLeftSolidIcon, null) : undefined, onClick: () => onBack && onBack() }, "Back"),
2090
- React.createElement("div", { className: "ml-auto" },
2091
- isCompleted && (React.createElement(Button, { className: "mr-2", color: COLOR.secondary, variant: VARIANT.text, onClick: () => onReset && onReset() }, "Reset")),
2092
- isStepOptional && (React.createElement(Button, { className: "mr-2", variant: VARIANT.contained, color: COLOR.primary, onClick: () => onSkip && onSkip() }, "Skip")),
2093
- React.createElement(Button, { variant: VARIANT.contained, color: COLOR.primary, startIcon: isCompleted ? React.createElement(CheckSolidIcon, null) : undefined, endIcon: !isCompleted ? React.createElement(ChevronRightSolidIcon, null) : undefined, onClick: () => onNext && onNext() }, isCompleted ? 'Done' : 'Next'))));
2094
- };
2095
-
2096
- const StepPanel = (props) => {
2097
- const { children } = props;
2098
- return (React.createElement("div", { className: "steppanel" }, children));
2099
- };
2100
-
2101
- var css_248z$a = ".StepConnector-module_stepConnector__A7A-7 {\n flex: 1 1 auto;\n flex-shrink: 0;\n min-width: 20px; }\n\n.StepConnector-module_stepConnectorLine__8rQxv {\n display: block;\n border-color: var(--secondary);\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; }\n .StepConnector-module_stepConnectorLine__8rQxv.StepConnector-module_isActive__TUIKV {\n border-color: var(--primary); }\n\n.StepConnector-module_stepConnectorLineHorizontal__i09K0 {\n border-top-style: solid;\n border-top-width: 1px; }\n";
2102
- var styles$a = {"stepConnector":"StepConnector-module_stepConnector__A7A-7","stepConnectorLine":"StepConnector-module_stepConnectorLine__8rQxv","isActive":"StepConnector-module_isActive__TUIKV","stepConnectorLineHorizontal":"StepConnector-module_stepConnectorLineHorizontal__i09K0"};
2103
- styleInject(css_248z$a);
2104
-
2105
- const StepConnector = (props) => {
2106
- const { isActive, isHorizontal = true } = props;
2107
- const getCssClassesConnector = () => {
2108
- const cssClasses = [];
2109
- cssClasses.push(styles$a.stepConnector);
2110
- return cssClasses.filter(css => css).join(' ');
2111
- };
2112
- const getCssClassesLine = () => {
2113
- const cssClasses = [];
2114
- cssClasses.push(styles$a.stepConnectorLine);
2115
- isActive && cssClasses.push(styles$a['isActive']);
2116
- isHorizontal && cssClasses.push(styles$a.stepConnectorLineHorizontal);
2117
- return cssClasses.filter(css => css).join(' ');
2118
- };
2119
- return (React.createElement("div", { className: getCssClassesConnector() },
2120
- React.createElement("div", { className: getCssClassesLine() })));
2121
- };
2122
-
2123
- var css_248z$9 = ".Stepper-module_stepper__V6odG {\n display: flex;\n align-items: center;\n flex-direction: row;\n margin-bottom: 10px; }\n .Stepper-module_stepper__V6odG.Stepper-module_isHorizontal__Q-3Wu {\n overflow-x: auto; }\n";
2124
- var styles$9 = {"stepper":"Stepper-module_stepper__V6odG","isHorizontal":"Stepper-module_isHorizontal__Q-3Wu"};
2125
- styleInject(css_248z$9);
2126
-
2127
- const Stepper = (props) => {
2128
- const { children, isLinear = true, showLabel = true, showProgressCheckIcon = false, value, isHorizontal = true, onChange, onFinish } = props;
2129
- const [steps, setSteps] = useState();
2130
- const [activeIndex, setActiveIndex] = React.useState(0);
2131
- const [skipped, setSkipped] = React.useState(new Set());
2132
- useEffect(() => {
2133
- if (children) {
2134
- setSteps(React.Children.toArray(children));
2135
- }
2136
- }, [children]);
2137
- useEffect(() => {
2138
- if (value !== undefined) {
2139
- setActiveIndex(value);
2140
- }
2141
- }, [value]);
2142
- const isStepSkipped = (step) => {
2143
- return skipped.has(step);
2144
- };
2145
- const handleClickStep = (event, newValue, index) => {
2146
- setActiveIndex(() => {
2147
- onChange && onChange(index);
2148
- return index;
2149
- });
2150
- };
2151
- const renderSteps = (child, index) => {
2152
- return React.isValidElement(child) &&
2153
- cloneElement(child, {
2154
- index: index,
2155
- isActive: activeIndex >= index,
2156
- isDone: activeIndex > index,
2157
- isDisabled: isLinear && (activeIndex + 1 < index),
2158
- showLabel: showLabel,
2159
- showProgressCheckIcon: showProgressCheckIcon,
2160
- onClick: (e) => handleClickStep(e.event, e.value, index)
2161
- });
2162
- };
2163
- const isStepOptional = (index) => {
2164
- return steps && steps[index].props.isOptional;
2165
- };
2166
- const handleBack = () => {
2167
- setActiveIndex((prevActiveStep) => {
2168
- const newIndex = prevActiveStep - 1;
2169
- onChange && onChange(newIndex);
2170
- return newIndex;
2171
- });
2172
- };
2173
- // TODO
2174
- const handleSkip = () => {
2175
- if (!isStepOptional(activeIndex)) {
2176
- throw new Error("You can't skip a step that isn't optional.");
2177
- }
2178
- setActiveIndex((prevActiveStep) => prevActiveStep + 1);
2179
- setSkipped((prevSkipped) => {
2180
- const newSkipped = new Set(prevSkipped.values());
2181
- newSkipped.add(activeIndex);
2182
- return newSkipped;
2183
- });
2184
- };
2185
- // TODO
2186
- const handleNext = () => {
2187
- if (!isLastStep()) {
2188
- let newSkipped = skipped;
2189
- if (isStepSkipped(activeIndex)) {
2190
- newSkipped = new Set(newSkipped.values());
2191
- newSkipped.delete(activeIndex);
2192
- }
2193
- setActiveIndex((prevActiveStep) => {
2194
- const newIndex = prevActiveStep + 1;
2195
- onChange && onChange(newIndex);
2196
- return newIndex;
2197
- });
2198
- setSkipped(newSkipped);
2199
- }
2200
- else {
2201
- onFinish && onFinish();
2202
- }
2203
- };
2204
- const handleReset = () => {
2205
- setActiveIndex(0);
2206
- onChange && onChange(0);
2207
- };
2208
- const isLastStep = () => {
2209
- return steps && activeIndex === steps.length - 1;
2210
- };
2211
- const getCssClasses = () => {
2212
- const cssClasses = [];
2213
- cssClasses.push(styles$9.stepper);
2214
- isHorizontal && cssClasses.push(styles$9['isHorizontal']);
2215
- return cssClasses.filter(css => css).join(' ');
2216
- };
2217
- return (React.createElement(React.Fragment, null, steps &&
2218
- React.createElement(React.Fragment, null,
2219
- React.createElement("div", { className: getCssClasses() }, steps.map((child, index) => (React.createElement(React.Fragment, { key: child.props.value },
2220
- renderSteps(child, index),
2221
- index !== steps.length - 1 && React.createElement(StepConnector, { isActive: activeIndex > index }))))),
2222
- steps && steps.map((step, index) => React.createElement(Fragment, { key: step.props.value }, index === activeIndex &&
2223
- React.createElement(StepPanel, null, step.props.children))),
2224
- React.createElement(StepperActions, { className: "mt-3", isFirstStep: activeIndex === 0, isStepOptional: isStepOptional(activeIndex), isCompleted: isLastStep(), onBack: handleBack, onSkip: handleSkip, onNext: handleNext, onReset: handleReset }))));
2225
- };
2226
-
2227
- var css_248z$8 = ".Typography-module_typography__sw-td {\n text-overflow: ellipsis;\n font-family: var(--fontFamily); }\n\nh1 {\n font-size: 2.5rem; }\n\nh2 {\n font-size: 2rem; }\n\nh3 {\n font-size: 1.75rem; }\n\nh4 {\n font-size: 1.5rem; }\n\nh5 {\n font-size: 1.25rem; }\n\nh6 {\n font-size: 1rem; }\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-weight: 500 !important;\n margin-top: 0;\n margin-bottom: 0.5rem;\n line-height: 1.2; }\n";
2228
- var styles$8 = {"typography":"Typography-module_typography__sw-td"};
2229
- styleInject(css_248z$8);
2230
-
2231
- const Wrapper = (props) => {
2232
- const { as = 'span', children, className } = props, rest = __rest(props, ["as", "children", "className"]);
2233
- const getCssClasses = () => {
2234
- const cssClasses = [];
2235
- cssClasses.push(styles$8.typography);
2236
- cssClasses.push(styles$8.as);
2237
- className && cssClasses.push(className);
2238
- return cssClasses.filter(css => css).join(' ');
2239
- };
2240
- return React.createElement(as, Object.assign(Object.assign({}, rest), { className: getCssClasses() }), children);
2241
- };
2242
- const Typography = (_a) => {
2243
- var { children, as = 'span' } = _a, rest = __rest(_a, ["children", "as"]);
2244
- return (React.createElement(Wrapper, Object.assign({ as: as }, rest), children));
2245
- };
2246
-
2247
- var css_248z$7 = ".Step-module_stepWrapper__IQwq1 {\n display: flex;\n align-items: center;\n padding-left: 8px;\n padding-right: 8px;\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; }\n .Step-module_stepWrapper__IQwq1.Step-module_hasLabel__LZNvd:not(.Step-module_disabled__JnxUP):hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.04);\n border-radius: var(--borderRadius); }\n\n.Step-module_step__k42go {\n width: 40px;\n height: 40px;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; }\n .Step-module_step__k42go:not(.Step-module_hasLabel__LZNvd):not(.Step-module_disabled__JnxUP):hover {\n border-radius: 100%;\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.04); }\n .Step-module_step__k42go.Step-module_hasLabel__LZNvd svg {\n width: 18px !important;\n height: 18px !important; }\n\n.Step-module_stepIconCircle__hnxIV svg {\n width: 24px;\n height: 24px; }\n\n.Step-module_stepValue__B0-xv {\n position: absolute;\n color: var(--secondary-contrast-text); }\n .Step-module_stepValue__B0-xv .Step-module_isActive__3GGcl {\n color: var(--primary-contrast-text); }\n";
2248
- var styles$7 = {"stepWrapper":"Step-module_stepWrapper__IQwq1","hasLabel":"Step-module_hasLabel__LZNvd","disabled":"Step-module_disabled__JnxUP","step":"Step-module_step__k42go","stepIconCircle":"Step-module_stepIconCircle__hnxIV","stepValue":"Step-module_stepValue__B0-xv","isActive":"Step-module_isActive__3GGcl"};
2249
- styleInject(css_248z$7);
2250
-
2251
- const Step = (props) => {
2252
- const { className, label, showLabel, index, value, isActive, isDone, isDisabled, showProgressCheckIcon, onClick } = props;
2253
- const [hoverRef, isHovered] = useHover();
2254
- const handleClick = (event) => {
2255
- if (!isDisabled) {
2256
- onClick && onClick({ event, value });
2257
- }
2258
- };
2259
- const getCssClasses = () => {
2260
- const cssClasses = [];
2261
- cssClasses.push(styles$7.stepWrapper);
2262
- label && showLabel && cssClasses.push(styles$7['hasLabel']);
2263
- isDisabled && cssClasses.push(styles$7['disabled']);
2264
- className && cssClasses.push(className);
2265
- return cssClasses.filter(css => css).join(' ');
2266
- };
2267
- const getCssClassesStep = () => {
2268
- const cssClasses = [];
2269
- cssClasses.push(styles$7.step);
2270
- label && showLabel && cssClasses.push(styles$7['hasLabel']);
2271
- isDisabled && cssClasses.push(styles$7['disabled']);
2272
- return cssClasses.filter(css => css).join(' ');
2273
- };
2274
- const getCssClassesStepValue = () => {
2275
- const cssClasses = [];
2276
- cssClasses.push(styles$7.stepValue);
2277
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2278
- isActive && cssClasses.push(styles$7.stepValue['isActive']);
2279
- return cssClasses.filter(css => css).join(' ');
2280
- };
2281
- return (React.createElement("div", { ref: hoverRef, className: getCssClasses(), onClick: handleClick },
2282
- React.createElement("div", { className: getCssClassesStep() },
2283
- React.createElement(Icon, { className: styles$7.stepIconCircle, iconColor: (isHovered || isActive) && !isDisabled ? COLOR.primary : COLOR.secondary },
2284
- React.createElement(CircleSolidIcon, null)),
2285
- React.createElement("div", { className: getCssClassesStepValue() }, showProgressCheckIcon && isActive && isDone ?
2286
- React.createElement(Icon, null,
2287
- React.createElement(CheckSolidIcon, null))
2288
- :
2289
- React.createElement(Typography, null, index + 1))),
2290
- label && showLabel &&
2291
- React.createElement(Typography, { className: "flex-shrink-0" }, label)));
2292
- };
2293
-
2294
- var css_248z$6 = ".Table-module_table__DHKNv {\n --bs-table-bg: transparent;\n --bs-table-accent-bg: transparent;\n --bs-table-striped-color: #212529;\n --bs-table-striped-bg: rgba(0, 0, 0, 0.05);\n --bs-table-active-color: #212529;\n --bs-table-active-bg: rgba(0, 0, 0, 0.1);\n --bs-table-hover-color: #212529;\n --bs-table-hover-bg: rgba(0, 0, 0, 0.075);\n width: 100%;\n margin-bottom: 1rem;\n color: #212529;\n vertical-align: top;\n border-color: #dee2e6; }\n .Table-module_table__DHKNv thead {\n vertical-align: bottom; }\n .Table-module_table__DHKNv > :not(caption) > * > * {\n padding: 0.5rem 0.5rem;\n background-color: var(--bs-table-bg);\n border-bottom-width: 1px;\n box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg); }\n .Table-module_table__DHKNv > :not(:first-child) {\n border-top: 2px solid currentColor; }\n\n.Table-module_bordered__1Kp1p > :not(caption) > * > * {\n border-width: 0 1px; }\n\n.Table-module_bordered__1Kp1p > :not(caption) > * {\n border-width: 1px 0; }\n\n.Table-module_striped__jmxgE > tbody > tr:nth-of-type(odd) > * {\n --bs-table-accent-bg: var(--bs-table-striped-bg);\n color: var(--bs-table-striped-color); }\n\n.Table-module_hover__P6r3y > tbody > tr:hover > * {\n --bs-table-accent-bg: var(--bs-table-hover-bg);\n color: var(--bs-table-hover-color); }\n\n.Table-module_tableResponsive__ykttB {\n overflow-x: auto; }\n";
2295
- var styles$6 = {"table":"Table-module_table__DHKNv","bordered":"Table-module_bordered__1Kp1p","striped":"Table-module_striped__jmxgE","hover":"Table-module_hover__P6r3y","tableResponsive":"Table-module_tableResponsive__ykttB"};
2296
- styleInject(css_248z$6);
2297
-
2298
- const Table = (props) => {
2299
- const { children, className, bordered, striped, hover, responsive = false } = props;
2300
- const getCssClasses = () => {
2301
- const cssClasses = [];
2302
- cssClasses.push(styles$6.table);
2303
- bordered && cssClasses.push(styles$6['bordered']);
2304
- striped && cssClasses.push(styles$6['striped']);
2305
- hover && cssClasses.push(styles$6['hover']);
2306
- className && cssClasses.push(className);
2307
- return cssClasses.filter(css => css).join(' ');
2308
- };
2309
- return (React.createElement(ConditionalWrapper, { condition: responsive, wrapper: children => React.createElement("div", { className: styles$6.tableResponsive }, children) },
2310
- React.createElement("table", { className: getCssClasses() }, children)));
2311
- };
2312
-
2313
- var css_248z$5 = ".TabIndicator-module_tabIndicator__jSJhH {\n bottom: 0;\n height: 2px;\n position: absolute;\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; }\n .TabIndicator-module_tabIndicator__jSJhH.TabIndicator-module_primary__Q5jEo {\n background-color: var(--primary); }\n .TabIndicator-module_tabIndicator__jSJhH.TabIndicator-module_accent__qbgIG {\n background-color: var(--accent); }\n";
2314
- var styles$5 = {"tabIndicator":"TabIndicator-module_tabIndicator__jSJhH","primary":"TabIndicator-module_primary__Q5jEo","accent":"TabIndicator-module_accent__qbgIG"};
2315
- styleInject(css_248z$5);
2316
-
2317
- const TabIndicator = (props) => {
2318
- const { color = COLOR.accent, width, amount, index } = props;
2319
- const getCssClasses = () => {
2320
- const cssClasses = [];
2321
- cssClasses.push(styles$5.tabIndicator);
2322
- cssClasses.push(styles$5[color]);
2323
- return cssClasses.filter(css => css).join(' ');
2324
- };
2325
- return (React.createElement("span", { className: getCssClasses(), style: {
2326
- width: width,
2327
- left: `calc(calc(100% / ${amount}) * ${index})`
2328
- } }));
2329
- };
2330
-
2331
- var css_248z$4 = ".Tabs-module_tabs__YyRTZ {\n display: flex;\n position: relative; }\n";
2332
- var styles$4 = {"tabs":"Tabs-module_tabs__YyRTZ"};
2333
- styleInject(css_248z$4);
2334
-
2335
- const Tabs = (props) => {
2336
- const { children, className, fixed, indicatorColor, onChange, value } = props;
2337
- const [selectedValue, setSelectedValue] = useState(value);
2338
- const [selectedIndex, setSelectedIndex] = useState();
2339
- useEffect(() => {
2340
- React.Children.toArray(children).forEach((child, index) => {
2341
- if (child.props.value === value) {
2342
- setSelectedIndex(index);
2343
- }
2344
- });
2345
- }, [children, value]);
2346
- const getCssClasses = () => {
2347
- const cssClasses = [];
2348
- cssClasses.push(styles$4.tabs);
2349
- className && cssClasses.push(className);
2350
- return cssClasses.filter(css => css).join(' ');
2351
- };
2352
- const handleClickTab = (event, newValue, index) => {
2353
- setSelectedValue(newValue);
2354
- setSelectedIndex(index);
2355
- onChange && onChange({ event, newValue });
2356
- };
2357
- const renderTabs = (child, index) => {
2358
- return React.isValidElement(child) && cloneElement(child, {
2359
- key: child.props.value,
2360
- isActive: child.props.value === selectedValue,
2361
- fixed: fixed,
2362
- onClick: (e) => handleClickTab(e.event, e.value, index),
2363
- });
2364
- };
2365
- return (React.createElement(React.Fragment, null,
2366
- React.createElement("div", { className: getCssClasses() },
2367
- children && React.Children.toArray(children).map((child, index) => renderTabs(child, index)),
2368
- children &&
2369
- React.createElement(TabIndicator, { color: indicatorColor, width: (100 / React.Children.toArray(children).length) + '%', index: selectedIndex, amount: React.Children.toArray(children).length }))));
2370
- };
2371
-
2372
- var css_248z$3 = ".Tab-module_tab__Q8w1f {\n padding: 6px 12px;\n overflow: hidden;\n position: relative;\n font-size: 0.875rem;\n min-width: 72px;\n box-sizing: border-box;\n min-height: 48px;\n text-align: center;\n font-weight: 500;\n line-height: 1.75;\n white-space: normal;\n letter-spacing: 0.02857em;\n text-transform: uppercase;\n border-radius: 0;\n flex-grow: 1;\n flex-basis: 0;\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; }\n";
2373
- var styles$3 = {"tab":"Tab-module_tab__Q8w1f"};
2374
- styleInject(css_248z$3);
2375
-
2376
- const Tab = (props) => {
2377
- const { label, className, isActive, disabled, value, onClick } = props;
2378
- const getCssClasses = () => {
2379
- const cssClasses = [];
2380
- cssClasses.push(styles$3.tab);
2381
- if (isActive) {
2382
- cssClasses.push(`show active`);
2383
- }
2384
- className && cssClasses.push(className);
2385
- return cssClasses.filter(css => css).join(' ');
2386
- };
2387
- return (React.createElement(Button, { className: getCssClasses(), onClick: (event) => onClick && onClick({ event, value }), isActive: isActive, disabled: disabled }, label));
2388
- };
2389
-
2390
- const TabPanel = (props) => {
2391
- const { children, value, index } = props, rest = __rest(props, ["children", "value", "index"]);
2392
- return (React.createElement("div", Object.assign({ role: "tabpanel", hidden: value !== index, id: `tabpanel-${index}`, "aria-labelledby": `wrapped-tab-${index}` }, rest), value === index && children));
2393
- };
2394
-
2395
- var css_248z$2 = ".Tooltip-module_tooltipContainer__9ZWx3 {\n display: inline; }\n\n.Tooltip-module_tooltip__x5HOu {\n background-color: #333;\n color: white;\n padding: 5px 10px;\n border-radius: 4px;\n font-size: 13px;\n position: absolute;\n left: -1000000px;\n z-index: 1100; }\n .Tooltip-module_tooltip__x5HOu #Tooltip-module_arrow__B6lfe,\n .Tooltip-module_tooltip__x5HOu #Tooltip-module_arrow__B6lfe::before {\n position: absolute;\n width: 8px;\n height: 8px;\n z-index: -1; }\n .Tooltip-module_tooltip__x5HOu #Tooltip-module_arrow__B6lfe::before {\n content: \"\";\n transform: rotate(45deg);\n background: #333; }\n .Tooltip-module_tooltip__x5HOu[data-popper-placement^=\"top\"] > #Tooltip-module_arrow__B6lfe {\n bottom: -4px; }\n .Tooltip-module_tooltip__x5HOu[data-popper-placement^=\"bottom\"] > #Tooltip-module_arrow__B6lfe {\n top: -4px; }\n .Tooltip-module_tooltip__x5HOu[data-popper-placement^=\"left\"] > #Tooltip-module_arrow__B6lfe {\n right: -4px; }\n .Tooltip-module_tooltip__x5HOu[data-popper-placement^=\"right\"] > #Tooltip-module_arrow__B6lfe {\n left: -4px; }\n";
2396
- var styles$2 = {"tooltipContainer":"Tooltip-module_tooltipContainer__9ZWx3","tooltip":"Tooltip-module_tooltip__x5HOu","arrow":"Tooltip-module_arrow__B6lfe"};
2397
- styleInject(css_248z$2);
2398
-
2399
- const Tooltip = (props) => {
2400
- const { children, text, placement = 'bottom' } = props;
2401
- const [show, setShow] = useState(false);
2402
- const refChild = useRef();
2403
- const refTooltip = useRef();
2404
- useEffect(() => {
2405
- if (show === true && refChild && refChild.current && refTooltip && refTooltip.current) {
2406
- // TODO - extract to own component?
2407
- createPopper(refChild.current, refTooltip.current, {
2408
- placement: placement,
2409
- modifiers: [
2410
- {
2411
- name: 'offset',
2412
- options: { offset: [0, 8] }
2413
- },
2414
- ]
2415
- });
2416
- }
2417
- }, [show]);
2418
- const handleMouseOver = () => {
2419
- setShow(true);
2420
- };
2421
- const handleMouseLeave = () => {
2422
- setShow(false);
2423
- };
2424
- return (React.createElement(React.Fragment, null,
2425
- React.createElement("div", { className: styles$2.tooltipContainer, ref: refChild, id: "tooltip-container" }, cloneElement(children, {
2426
- onMouseOver: handleMouseOver,
2427
- onMouseLeave: handleMouseLeave,
2428
- })),
2429
- show &&
2430
- React.createElement("div", { className: styles$2.tooltip, ref: refTooltip, id: "tooltip" },
2431
- text,
2432
- React.createElement("div", { id: "arrow", "data-popper-arrow": true }))));
2433
- };
2434
-
2435
- const HourSelect = (props) => {
2436
- const { className, value = 0, id, name, disabled, onChange } = props;
2437
- const [newValue, setNewValue] = useState(value);
2438
- const [hourOptions, setHourOptions] = useState();
2439
- useEffect(() => {
2440
- const newHourOptions = [];
2441
- for (let i = 0; i < 24; i++) {
2442
- newHourOptions.push({ value: i.toString(), label: i.toString() });
2443
- }
2444
- setHourOptions(newHourOptions);
2445
- }, []);
2446
- const getCssClasses = () => {
2447
- const cssClasses = [];
2448
- className && cssClasses.push(className);
2449
- return cssClasses.filter(css => css).join(' ');
2450
- };
2451
- const handleOnChange = (e) => {
2452
- setNewValue(e);
2453
- onChange && onChange(e);
2454
- };
2455
- return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: hourOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
2456
- };
2457
-
2458
- const MilliSecondSelect = (props) => {
2459
- const { className, value = 0, steps = 100, id, name, disabled, onChange } = props;
2460
- const [newValue, setNewValue] = useState(value);
2461
- const [milliSecondOptions, setMilliSecondOptions] = useState();
2462
- useEffect(() => {
2463
- const newMilliSecondOptions = [];
2464
- for (let i = 0; i < 1000; i += steps) {
2465
- newMilliSecondOptions.push({ value: i.toString(), label: i.toString() });
2466
- }
2467
- setMilliSecondOptions(newMilliSecondOptions);
2468
- }, []);
2469
- const getCssClasses = () => {
2470
- const cssClasses = [];
2471
- className && cssClasses.push(className);
2472
- return cssClasses.filter(css => css).join(' ');
2473
- };
2474
- const handleOnChange = (e) => {
2475
- setNewValue(e);
2476
- onChange && onChange(e);
2477
- };
2478
- return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: milliSecondOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
2479
- };
2480
-
2481
- const MinuteSelect = (props) => {
2482
- const { className, value = 0, id, name, disabled, onChange } = props;
2483
- const [newValue, setNewValue] = useState(value);
2484
- const [minuteOptions, setMinuteOptions] = useState();
2485
- useEffect(() => {
2486
- const newMinuteOptions = [];
2487
- for (let i = 0; i < 60; i++) {
2488
- newMinuteOptions.push({ value: i.toString(), label: i.toString() });
2489
- }
2490
- setMinuteOptions(newMinuteOptions);
2491
- }, []);
2492
- const getCssClasses = () => {
2493
- const cssClasses = [];
2494
- className && cssClasses.push(className);
2495
- return cssClasses.filter(css => css).join(' ');
2496
- };
2497
- const handleOnChange = (e) => {
2498
- setNewValue(e);
2499
- onChange && onChange(e);
2500
- };
2501
- return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: minuteOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
2502
- };
2503
-
2504
- const SecondSelect = (props) => {
2505
- const { className, value = 0, id, name, disabled, onChange } = props;
2506
- const [newValue, setNewValue] = useState(value);
2507
- const [secondOptions, setSecondOptions] = useState();
2508
- useEffect(() => {
2509
- const newSecondOptions = [];
2510
- for (let i = 0; i < 60; i++) {
2511
- newSecondOptions.push({ value: i.toString(), label: i.toString() });
2512
- }
2513
- setSecondOptions(newSecondOptions);
2514
- }, []);
2515
- const getCssClasses = () => {
2516
- const cssClasses = [];
2517
- className && cssClasses.push(className);
2518
- return cssClasses.filter(css => css).join(' ');
2519
- };
2520
- const handleOnChange = (e) => {
2521
- setNewValue(e);
2522
- onChange && onChange(e);
2523
- };
2524
- return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: secondOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
2525
- };
2526
-
2527
- var TIMEMODE;
2528
- (function (TIMEMODE) {
2529
- TIMEMODE[TIMEMODE["HOUR"] = 0] = "HOUR";
2530
- TIMEMODE[TIMEMODE["MINUTE"] = 1] = "MINUTE";
2531
- TIMEMODE[TIMEMODE["SECONDS"] = 2] = "SECONDS";
2532
- TIMEMODE[TIMEMODE["MILLISECONDS"] = 3] = "MILLISECONDS";
2533
- })(TIMEMODE || (TIMEMODE = {}));
2534
- const TimeSelect = (props) => {
2535
- const { className, value = new Date(), disabled, showHours = true, showMinutes = true, showSeconds = false, showMilliSeconds = false, onChange } = props;
2536
- const [currDate, setCurrDate] = useState(value);
2537
- const getCssClasses = () => {
2538
- const cssClasses = [];
2539
- cssClasses.push('row');
2540
- className && cssClasses.push(className);
2541
- return cssClasses.filter(css => css).join(' ');
2542
- };
2543
- const handleOnChange = (e, mode) => {
2544
- const currYear = currDate.getFullYear();
2545
- const currMonth = currDate.getMonth();
2546
- const currday = currDate.getDate();
2547
- const currHour = mode === TIMEMODE.HOUR ? e : currDate.getHours();
2548
- const currMinute = mode === TIMEMODE.MINUTE ? e : currDate.getMinutes();
2549
- const currSeconds = mode === TIMEMODE.SECONDS ? e : currDate.getSeconds();
2550
- const currMilliSeconds = mode === TIMEMODE.MILLISECONDS ? e : currDate.getMilliseconds();
2551
- const newDate = new Date(currYear, currMonth, currday, currHour, currMinute, currSeconds, currMilliSeconds);
2552
- setCurrDate(newDate);
2553
- onChange && onChange(newDate);
2554
- };
2555
- return (React.createElement("div", { className: getCssClasses() },
2556
- showHours &&
2557
- React.createElement(FormGroup, { className: "col" },
2558
- React.createElement(FormLabel, null, "Hours"),
2559
- React.createElement(HourSelect, { value: currDate.getHours(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.HOUR) })),
2560
- showMinutes &&
2561
- React.createElement(FormGroup, { className: "col" },
2562
- React.createElement(FormLabel, null, "Minutes"),
2563
- React.createElement(MinuteSelect, { value: currDate.getMinutes(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.MINUTE) })),
2564
- showSeconds &&
2565
- React.createElement(FormGroup, { className: "col" },
2566
- React.createElement(FormLabel, null, "Seconds"),
2567
- React.createElement(SecondSelect, { value: currDate.getSeconds(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.SECONDS) })),
2568
- showMilliSeconds &&
2569
- React.createElement(FormGroup, { className: "col" },
2570
- React.createElement(FormLabel, null, "Milliseconds"),
2571
- React.createElement(MilliSecondSelect, { value: currDate.getMilliseconds(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.MILLISECONDS) }))));
2572
- };
2573
-
2574
- var css_248z$1 = ".TreeView-module_treeView__VVj-4 {\n list-style-type: none;\n margin-bottom: 0;\n padding-left: 0px !important; }\n .TreeView-module_treeView__VVj-4 ul {\n padding-left: 48px !important; }\n";
2575
- var styles$1 = {"treeView":"TreeView-module_treeView__VVj-4"};
2576
- styleInject(css_248z$1);
2577
-
2578
- const TreeView = (props) => {
2579
- const { children, className } = props, rest = __rest(props, ["children", "className"]);
2580
- const getCssClasses = () => {
2581
- const cssClasses = [];
2582
- cssClasses.push(styles$1.treeView);
2583
- className && cssClasses.push(className);
2584
- return cssClasses.filter(css => css).join(' ');
2585
- };
2586
- return (React.createElement("ul", Object.assign({ className: getCssClasses() }, rest), children));
2587
- };
2588
-
2589
- var css_248z = ".TreeItem-module_treeItem__Mxsjr {\n display: flex;\n flex-direction: column;\n min-height: 48px;\n justify-content: center; }\n";
2590
- var styles = {"treeItem":"TreeItem-module_treeItem__Mxsjr"};
2591
- styleInject(css_248z);
2592
-
2593
- const TreeItem = (props) => {
2594
- const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onItemSelect } = props;
2595
- const [_isExpanded, setIsExpanded] = useState(false);
2596
- const [_isSelected, setIsSelected] = useState(false);
2597
- const getCssClasses = () => {
2598
- const cssClasses = [];
2599
- cssClasses.push(styles.treeItem);
2600
- className && cssClasses.push(className);
2601
- return cssClasses.filter(css => css).join(' ');
2602
- };
2603
- useEffect(() => {
2604
- if (isExpanded !== undefined)
2605
- setIsExpanded(isExpanded);
2606
- }, [isExpanded]);
2607
- useEffect(() => {
2608
- if (isSelected !== undefined)
2609
- setIsSelected(isSelected);
2610
- }, [isSelected]);
2611
- const handleOnToggleExpand = (nodeId) => {
2612
- setIsExpanded(!_isExpanded);
2613
- onToggleExpand && onToggleExpand(nodeId);
2614
- };
2615
- const handleOnSelect = (nodeId) => {
2616
- setIsSelected(!_isSelected);
2617
- onItemSelect && onItemSelect({ id: nodeId, isSelected: !_isSelected });
2618
- };
2619
- return (React.createElement("li", { className: getCssClasses(), style: { paddingLeft: `${(48 * (children ? 0 : 1))}px` } },
2620
- React.createElement("div", { className: "d-flex align-items-center" },
2621
- children &&
2622
- React.createElement(IconButton, { onClick: () => handleOnToggleExpand(nodeId), icon: !_isExpanded ? React.createElement(ChevronRightSolidIcon, null) : React.createElement(ChevronDownSolidIcon, null) }),
2623
- isSelectable &&
2624
- React.createElement(Checkbox, { checked: _isSelected, onChange: () => handleOnSelect(nodeId) }),
2625
- label),
2626
- children && _isExpanded ? React.createElement("ul", null, children) : null));
2627
- };
2628
-
2629
- export { Alert, AppBar, AppBarTitle, AutoComplete, Backdrop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, COLOR, Card, CardBody, CardFooter, CardImage, CardSubtitle, CardText, CardTitle, CaretDownSolidIcon, CheckSolidIcon, CheckSquareRegularIcon, Checkbox, ChevronDownSolidIcon, ChevronLeftSolidIcon, ChevronRightSolidIcon, ChevronUpSolidIcon, Chip, CircleSolidIcon, Column, ConditionalWrapper, DATEMODE, DateSelect, DaySelect, Drawer, EmailValidator, ExpansionPanel, ExpansionPanelContent, ExpansionPanelHeader, FileInput, FloatingActionButton, Form, FormControl, FormError, FormGroup, FormHint, FormInput, FormLabel, GlobalModal, HomeSolidIcon, HourSelect, Icon, IconButton, IsEmptyValidator, IsEqualValidator, Link, List, ListItem, ListItemAction, ListItemAvatar, ListItemIcon, ListItemText, LoadingIndicator, LoadingIndicatorContainer, MODALBUTTONTYPE, MODALTYPE, Menu, MenuBody, MenuDivider, MenuItem, MenuToggle, MilliSecondSelect, MinuteSelect, Modal, ModalBody, ModalFooter, ModalHeader, MonthSelect, NumberSelect, POSITION, PlusSolidIcon, Row, SIZE, STATUS, SecondSelect, Select, Sidebar, Snackbar, SpeedDial, SpeedDialAction, SpeedDialIcon, SpinnerSolidIcon, SquareRegularIcon, Step, Stepper, StepperActions, TIMEMODE, Tab, TabPanel, Table, Tabs, Textarea, TimeSelect, TimesCircleSolidIcon, TimesSolidIcon, Tooltip, TreeItem, TreeView, Typography, VARIANT, YearSelect, loadingIndicatorService, modalService, snackbarService, useConstructor, useDebounce, useHover, useWindowSize };