react-asc 20.2.0 → 21.0.3

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 (238) hide show
  1. package/components/Alert/Alert.d.ts +11 -0
  2. package/components/Alert/index.d.ts +1 -0
  3. package/components/AppBar/AppBar.d.ts +9 -0
  4. package/components/AppBar/AppBarTitle.d.ts +5 -0
  5. package/components/AppBar/index.d.ts +2 -0
  6. package/components/AutoComplete/AutoComplete.d.ts +19 -0
  7. package/components/AutoComplete/index.d.ts +1 -0
  8. package/components/Backdrop/Backdrop.d.ts +7 -0
  9. package/components/Backdrop/index.d.ts +1 -0
  10. package/components/Badge/Badge.d.ts +7 -0
  11. package/components/Badge/index.d.ts +1 -0
  12. package/components/Breadcrumb/Breadcrumb.d.ts +5 -0
  13. package/components/Breadcrumb/BreadcrumbItem.d.ts +6 -0
  14. package/components/Breadcrumb/index.d.ts +2 -0
  15. package/components/Button/Button.d.ts +13 -0
  16. package/components/Button/index.d.ts +1 -0
  17. package/components/ButtonGroup/ButtonGroup.d.ts +2 -0
  18. package/components/ButtonGroup/index.d.ts +1 -0
  19. package/components/Card/Card.d.ts +6 -0
  20. package/components/Card/CardBody.d.ts +2 -0
  21. package/components/Card/CardFooter.d.ts +2 -0
  22. package/components/Card/CardImage.d.ts +2 -0
  23. package/components/Card/CardSubtitle.d.ts +2 -0
  24. package/components/Card/CardText.d.ts +2 -0
  25. package/components/Card/CardTitle.d.ts +6 -0
  26. package/components/Card/index.d.ts +7 -0
  27. package/components/Checkbox/Checkbox.d.ts +7 -0
  28. package/components/Checkbox/index.d.ts +1 -0
  29. package/components/Chip/Chip.d.ts +11 -0
  30. package/components/Chip/index.d.ts +1 -0
  31. package/components/ConditionalWrapper/ConditionalWrapper.d.ts +8 -0
  32. package/components/ConditionalWrapper/index.d.ts +1 -0
  33. package/components/DateSelect/DateSelect.d.ts +17 -0
  34. package/components/DateSelect/DaySelect.d.ts +12 -0
  35. package/components/DateSelect/MonthSelect.d.ts +10 -0
  36. package/components/DateSelect/YearSelect.d.ts +12 -0
  37. package/components/DateSelect/index.d.ts +4 -0
  38. package/components/Drawer/Drawer.d.ts +9 -0
  39. package/components/Drawer/index.d.ts +1 -0
  40. package/components/ExpansionPanel/ExpansionPanel.d.ts +8 -0
  41. package/components/ExpansionPanel/ExpansionPanelContent.d.ts +5 -0
  42. package/components/ExpansionPanel/ExpansionPanelHeader.d.ts +7 -0
  43. package/components/ExpansionPanel/index.d.ts +3 -0
  44. package/components/FileInput/FileInput.d.ts +5 -0
  45. package/components/FileInput/index.d.ts +1 -0
  46. package/components/FloatingActionButton/FloatingActionButton.d.ts +12 -0
  47. package/components/FloatingActionButton/index.d.ts +1 -0
  48. package/components/Form/Form.d.ts +38 -0
  49. package/components/Form/FormError.d.ts +8 -0
  50. package/components/Form/FormGroup.d.ts +7 -0
  51. package/components/Form/FormHint/FormHint.d.ts +2 -0
  52. package/components/Form/FormHint/index.d.ts +1 -0
  53. package/components/Form/FormInput/FormInput.d.ts +29 -0
  54. package/components/Form/FormInput/index.d.ts +1 -0
  55. package/components/Form/FormLabel/FormLabel.d.ts +2 -0
  56. package/components/Form/FormLabel/index.d.ts +1 -0
  57. package/components/Form/form.interfaces.d.ts +42 -0
  58. package/components/Form/form.models.d.ts +12 -0
  59. package/components/Form/form.types.d.ts +2 -0
  60. package/components/Form/index.d.ts +10 -0
  61. package/components/Form/validators/EmailValidtor.d.ts +1 -0
  62. package/components/Form/validators/IsEmptyValidator.d.ts +1 -0
  63. package/components/Form/validators/IsEqualValidator.d.ts +1 -0
  64. package/components/Form/validators/index.d.ts +3 -0
  65. package/components/Grid/Column/Column.d.ts +10 -0
  66. package/components/Grid/Column/index.d.ts +1 -0
  67. package/components/Grid/Row/Row.d.ts +5 -0
  68. package/components/Grid/Row/index.d.ts +1 -0
  69. package/components/Grid/index.d.ts +2 -0
  70. package/components/Icon/Icon.d.ts +6 -0
  71. package/components/Icon/index.d.ts +1 -0
  72. package/components/IconButton/IconButton.d.ts +11 -0
  73. package/components/IconButton/index.d.ts +1 -0
  74. package/components/Link/Link.d.ts +2 -0
  75. package/components/Link/Link.test.d.ts +1 -0
  76. package/components/Link/index.d.ts +1 -0
  77. package/components/List/List.d.ts +5 -0
  78. package/components/List/ListItem.d.ts +9 -0
  79. package/components/List/ListItemAction.d.ts +2 -0
  80. package/components/List/ListItemAvatar.d.ts +6 -0
  81. package/components/List/ListItemIcon.d.ts +6 -0
  82. package/components/List/ListItemText.d.ts +7 -0
  83. package/components/List/index.d.ts +6 -0
  84. package/components/List/list.models.d.ts +8 -0
  85. package/components/LoadingIndicator/LoadingIndicator.d.ts +2 -0
  86. package/components/LoadingIndicator/LoadingIndicatorContainer.d.ts +5 -0
  87. package/components/LoadingIndicator/index.d.ts +3 -0
  88. package/components/LoadingIndicator/loading-indicator.service.d.ts +11 -0
  89. package/components/Menu/Menu.d.ts +11 -0
  90. package/components/Menu/MenuBackdrop.d.ts +6 -0
  91. package/components/Menu/MenuBody.d.ts +12 -0
  92. package/components/Menu/MenuContext.d.ts +6 -0
  93. package/components/Menu/MenuDivider.d.ts +2 -0
  94. package/components/Menu/MenuItem.d.ts +8 -0
  95. package/components/Menu/MenuToggle.d.ts +6 -0
  96. package/components/Menu/index.d.ts +6 -0
  97. package/components/Menu/menu.types.d.ts +1 -0
  98. package/components/Modal/GlobalModal.d.ts +19 -0
  99. package/components/Modal/Modal.d.ts +14 -0
  100. package/components/Modal/ModalBody.d.ts +6 -0
  101. package/components/Modal/ModalFooter.d.ts +2 -0
  102. package/components/Modal/ModalHeader.d.ts +7 -0
  103. package/components/Modal/index.d.ts +8 -0
  104. package/components/Modal/modal.enum.d.ts +10 -0
  105. package/components/Modal/modal.interfaces.d.ts +12 -0
  106. package/components/Modal/modal.service.d.ts +21 -0
  107. package/components/NumberSelect/NumberSelect.d.ts +12 -0
  108. package/components/NumberSelect/index.d.ts +1 -0
  109. package/components/Select/Select.d.ts +16 -0
  110. package/components/Select/index.d.ts +1 -0
  111. package/components/Sidebar/Sidebar.d.ts +9 -0
  112. package/components/Sidebar/index.d.ts +2 -0
  113. package/components/Sidebar/sidebar.interfaces.d.ts +9 -0
  114. package/components/Sidebar/sidebar.models.d.ts +11 -0
  115. package/components/Snackbar/Snackbar.d.ts +8 -0
  116. package/components/Snackbar/index.d.ts +2 -0
  117. package/components/Snackbar/snackbar.service.d.ts +19 -0
  118. package/components/SpeedDial/SpeedDial.d.ts +7 -0
  119. package/components/SpeedDial/SpeedDialAction.d.ts +9 -0
  120. package/components/SpeedDial/SpeedDialActions.d.ts +2 -0
  121. package/components/SpeedDial/SpeedDialIcon.d.ts +5 -0
  122. package/components/SpeedDial/index.d.ts +3 -0
  123. package/components/Stepper/Step/Step.d.ts +19 -0
  124. package/components/Stepper/Step/index.d.ts +1 -0
  125. package/components/Stepper/StepConnector/StepConnector.d.ts +6 -0
  126. package/components/Stepper/StepPanel/StepPanel.d.ts +5 -0
  127. package/components/Stepper/Stepper.d.ts +16 -0
  128. package/components/Stepper/StepperActions/StepperActions.d.ts +12 -0
  129. package/components/Stepper/StepperActions/index.d.ts +1 -0
  130. package/components/Stepper/index.d.ts +3 -0
  131. package/components/Table/Table.d.ts +10 -0
  132. package/components/Table/index.d.ts +1 -0
  133. package/components/Tabs/Tab.d.ts +14 -0
  134. package/components/Tabs/TabIndicator.d.ts +10 -0
  135. package/components/Tabs/TabPanel.d.ts +6 -0
  136. package/components/Tabs/Tabs.d.ts +17 -0
  137. package/components/Tabs/index.d.ts +3 -0
  138. package/components/Textarea/Textarea.d.ts +5 -0
  139. package/components/Textarea/index.d.ts +1 -0
  140. package/components/TimeSelect/HourSelect.d.ts +10 -0
  141. package/components/TimeSelect/MilliSecondSelect.d.ts +11 -0
  142. package/components/TimeSelect/MinuteSelect.d.ts +10 -0
  143. package/components/TimeSelect/SecondSelect.d.ts +10 -0
  144. package/components/TimeSelect/TimeSelect.d.ts +20 -0
  145. package/components/TimeSelect/index.d.ts +5 -0
  146. package/components/Tooltip/Tooltip.d.ts +6 -0
  147. package/components/Tooltip/index.d.ts +1 -0
  148. package/components/TreeView/TreeItem.d.ts +14 -0
  149. package/components/TreeView/TreeView.d.ts +2 -0
  150. package/components/TreeView/index.d.ts +2 -0
  151. package/components/Typography/Typography.d.ts +10 -0
  152. package/components/Typography/index.d.ts +1 -0
  153. package/components/component.enums.d.ts +25 -0
  154. package/components/component.interfaces.d.ts +18 -0
  155. package/components/index.d.ts +41 -0
  156. package/hooks/index.d.ts +4 -0
  157. package/hooks/useConstructor.d.ts +1 -0
  158. package/hooks/useDebounce.d.ts +2 -0
  159. package/hooks/useHover.d.ts +2 -0
  160. package/hooks/useWindowSize.d.ts +4 -0
  161. package/icons/CaretDownSolidIcon.d.ts +2 -0
  162. package/icons/CheckSolidIcon.d.ts +2 -0
  163. package/icons/CheckSquareRegularIcon.d.ts +2 -0
  164. package/icons/ChevronDownSolidIcon.d.ts +2 -0
  165. package/icons/ChevronLeftSolidIcon.d.ts +2 -0
  166. package/icons/ChevronRightSolidIcon.d.ts +2 -0
  167. package/icons/ChevronUpSolidIcon.d.ts +2 -0
  168. package/icons/CircleSolidIcon.d.ts +2 -0
  169. package/icons/HomeSolidIcon.d.ts +2 -0
  170. package/icons/PlusSolidIcon.d.ts +2 -0
  171. package/icons/SpinnerSolidIcon.d.ts +2 -0
  172. package/icons/SquareRegularIcon.d.ts +2 -0
  173. package/icons/TimesCircleSolidIcon.d.ts +2 -0
  174. package/icons/TimesSolidIcon.d.ts +2 -0
  175. package/icons/index.d.ts +14 -0
  176. package/index.d.ts +3 -0
  177. package/index.es.js +2636 -0
  178. package/index.js +2752 -0
  179. package/package.json +1 -3
  180. package/react-asc.scss +160 -116
  181. package/readme.md +56 -60
  182. package/apple-touch-icon.png +0 -0
  183. package/assets/index.1f5e1902.js +0 -10
  184. package/assets/index.a1009f35.css +0 -1
  185. package/assets/vendor.d012860f.js +0 -57
  186. package/changelog.md +0 -919
  187. package/favicon-16x16.png +0 -0
  188. package/favicon-32x32.png +0 -0
  189. package/favicon.ico +0 -0
  190. package/favicon.svg +0 -23
  191. package/index.html +0 -27
  192. package/manifest.webmanifest +0 -1
  193. package/pwa-192x192.png +0 -0
  194. package/pwa-512x512.png +0 -0
  195. package/registerSW.js +0 -1
  196. package/robots.txt +0 -3
  197. package/showcase/alert.md +0 -3
  198. package/showcase/appbar.md +0 -8
  199. package/showcase/autocomplete.md +0 -53
  200. package/showcase/backdrop.md +0 -11
  201. package/showcase/badge.md +0 -8
  202. package/showcase/breadcrumb.md +0 -5
  203. package/showcase/button.md +0 -11
  204. package/showcase/buttongroup.md +0 -5
  205. package/showcase/card.md +0 -9
  206. package/showcase/checkbox.md +0 -7
  207. package/showcase/chip.md +0 -7
  208. package/showcase/dateselect.md +0 -8
  209. package/showcase/drawer.md +0 -13
  210. package/showcase/expansionpanel.md +0 -40
  211. package/showcase/fileinput.md +0 -6
  212. package/showcase/floatingactionbutton.md +0 -8
  213. package/showcase/form.md +0 -7
  214. package/showcase/grid.md +0 -5
  215. package/showcase/hookuseconstructor.md +0 -3
  216. package/showcase/hookusedebounce.md +0 -5
  217. package/showcase/hookusehover.md +0 -8
  218. package/showcase/hookusewindowsize.md +0 -5
  219. package/showcase/icon.md +0 -3
  220. package/showcase/iconbutton.md +0 -5
  221. package/showcase/link.md +0 -1
  222. package/showcase/list.md +0 -7
  223. package/showcase/loadingindicator.md +0 -18
  224. package/showcase/menu.md +0 -18
  225. package/showcase/modal.md +0 -17
  226. package/showcase/numberselect.md +0 -20
  227. package/showcase/select.md +0 -27
  228. package/showcase/snackbar.md +0 -22
  229. package/showcase/speeddial.md +0 -43
  230. package/showcase/stepper.md +0 -1
  231. package/showcase/table.md +0 -34
  232. package/showcase/tabs.md +0 -35
  233. package/showcase/timeselect.md +0 -1
  234. package/showcase/tooltip.md +0 -6
  235. package/showcase/treeview.md +0 -12
  236. package/showcase/typography.md +0 -6
  237. package/sw.js +0 -1
  238. package/workbox-6cd28afd.js +0 -1
package/index.es.js ADDED
@@ -0,0 +1,2636 @@
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:not(.IconButton-module_iconButton__rpCPQ.IconButton-module_disabled__QB0ZV) {\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 .Backdrop-module_backdrop__IRMoL.Backdrop-module_isTransparent__F5nA5 {\n opacity: 0; }\n";
286
+ var styles$X = {"backdrop":"Backdrop-module_backdrop__IRMoL","isTransparent":"Backdrop-module_isTransparent__F5nA5"};
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(styles$X['isTransparent']);
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:not(.AutoComplete-module_select__NNYOi.AutoComplete-module_disabled__CbGP4) {\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 .AutoComplete-module_select__NNYOi:disabled, .AutoComplete-module_select__NNYOi:read-only {\n background-color: #e9ecef; }\n .AutoComplete-module_select__NNYOi:disabled:hover {\n cursor: not-allowed; }\n .AutoComplete-module_select__NNYOi:read-only:hover {\n cursor: inherit; }\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","disabled":"AutoComplete-module_disabled__CbGP4","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,\r 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.Button-module_block__JIazf {\n width: 100%; }\n .Button-module_button__qeIer:hover {\n cursor: pointer; }\n .Button-module_button__qeIer:focus:not(.Button-module_button__qeIer.Button-module_disabled__jiOqa) {\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","block":"Button-module_block__JIazf","disabled":"Button-module_disabled__jiOqa","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, block } = props, rest = __rest(props, ["children", "variant", "color", "isRounded", "isActive", "className", "startIcon", "endIcon", "shadow", "block"]);
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
+ block && cssClasses.push(styles$O.block);
538
+ className && cssClasses.push(className);
539
+ return cssClasses.filter(css => css).join(' ');
540
+ };
541
+ return (React.createElement("button", Object.assign({ type: "button", className: getCssClasses() }, rest),
542
+ React.createElement("span", { className: "d-flex justify-content-center" },
543
+ startIcon &&
544
+ React.createElement(Icon, { className: styles$O.startIcon }, startIcon),
545
+ children,
546
+ endIcon &&
547
+ React.createElement(Icon, { className: styles$O.endIcon }, endIcon))));
548
+ };
549
+
550
+ 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";
551
+ var styles$N = {"buttonGroup":"ButtonGroup-module_buttonGroup__w6iB-"};
552
+ styleInject(css_248z$N);
553
+
554
+ const ButtonGroup = (props) => {
555
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
556
+ const getCssClasses = () => {
557
+ const cssClasses = [];
558
+ cssClasses.push(styles$N.buttonGroup);
559
+ className && cssClasses.push(className);
560
+ return cssClasses.filter(css => css).join(' ');
561
+ };
562
+ return (React.createElement("div", Object.assign({ className: getCssClasses(), role: "group" }, rest), children));
563
+ };
564
+
565
+ 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";
566
+ var styles$M = {"breadcrumb":"Breadcrumb-module_breadcrumb__-pvAn"};
567
+ styleInject(css_248z$M);
568
+
569
+ const Breadcrumb = (props) => {
570
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
571
+ const getCssClasses = () => {
572
+ const cssClasses = [];
573
+ cssClasses.push(styles$M.breadcrumb);
574
+ className && cssClasses.push(className);
575
+ return cssClasses.filter(css => css).join(' ');
576
+ };
577
+ return (React.createElement("nav", Object.assign({}, rest),
578
+ React.createElement("ol", { className: getCssClasses() }, children)));
579
+ };
580
+
581
+ const ConditionalWrapper = ({ condition, wrapper, children }) => condition ? wrapper(children) : children;
582
+
583
+ 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";
584
+ var styles$L = {"breadcrumbItem":"BreadcrumbItem-module_breadcrumbItem__zsUq-","active":"BreadcrumbItem-module_active__Kn1dA"};
585
+ styleInject(css_248z$L);
586
+
587
+ const BreadcrumbItem = (props) => {
588
+ const { children, className, isActive, onClick } = props;
589
+ const getCssClasses = () => {
590
+ const cssClasses = [];
591
+ cssClasses.push(styles$L.breadcrumbItem);
592
+ className && cssClasses.push(className);
593
+ isActive && cssClasses.push('active');
594
+ return cssClasses.filter(css => css).join(' ');
595
+ };
596
+ const handleClick = (event) => {
597
+ onClick && onClick(event);
598
+ };
599
+ return (React.createElement("li", { className: getCssClasses(), onClick: handleClick },
600
+ React.createElement(ConditionalWrapper, { condition: !isActive, wrapper: label => React.createElement("a", null, label) }, children)));
601
+ };
602
+
603
+ 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";
604
+ var styles$K = {"card":"Card-module_card__TQdQq","shadow":"Card-module_shadow__NxDVz"};
605
+ styleInject(css_248z$K);
606
+
607
+ const Card = (props) => {
608
+ const { children, className, shadow = true } = props, rest = __rest(props, ["children", "className", "shadow"]);
609
+ const getCssClasses = () => {
610
+ const cssClasses = [];
611
+ cssClasses.push(styles$K.card);
612
+ shadow && cssClasses.push(styles$K.shadow);
613
+ className && cssClasses.push(className);
614
+ return cssClasses.filter(css => css).join(' ');
615
+ };
616
+ return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
617
+ };
618
+
619
+ var css_248z$J = ".CardBody-module_cardBody__X52VY {\n flex: 1 1 auto;\n min-height: 1px;\n padding: 1.25rem; }\n";
620
+ var styles$J = {"cardBody":"CardBody-module_cardBody__X52VY"};
621
+ styleInject(css_248z$J);
622
+
623
+ const CardBody = (props) => {
624
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
625
+ const getCssClasses = () => {
626
+ const cssClasses = [];
627
+ cssClasses.push(styles$J.cardBody);
628
+ className && cssClasses.push(className);
629
+ return cssClasses.filter(css => css).join(' ');
630
+ };
631
+ return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
632
+ };
633
+
634
+ 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";
635
+ var styles$I = {"cardFooter":"CardFooter-module_cardFooter__BpOTG"};
636
+ styleInject(css_248z$I);
637
+
638
+ const CardFooter = (props) => {
639
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
640
+ const getCssClasses = () => {
641
+ const cssClasses = [];
642
+ cssClasses.push(styles$I.cardFooter);
643
+ className && cssClasses.push(className);
644
+ return cssClasses.filter(css => css).join(' ');
645
+ };
646
+ return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
647
+ };
648
+
649
+ var css_248z$H = ".CardSubtitle-module_cardSubtitle__YdoRM {\n color: #6c757d !important; }\n";
650
+ var styles$H = {"cardSubtitle":"CardSubtitle-module_cardSubtitle__YdoRM"};
651
+ styleInject(css_248z$H);
652
+
653
+ const CardSubtitle = (props) => {
654
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
655
+ const getCssClasses = () => {
656
+ const cssClasses = [];
657
+ cssClasses.push(styles$H.cardSubtitle);
658
+ className && cssClasses.push(className);
659
+ return cssClasses.filter(css => css).join(' ');
660
+ };
661
+ return (React.createElement("p", Object.assign({ className: getCssClasses() }, rest), children));
662
+ };
663
+
664
+ var css_248z$G = ".CardText-module_cardText__UtYd9:last-child {\n margin-bottom: 0; }\n";
665
+ var styles$G = {"cardText":"CardText-module_cardText__UtYd9"};
666
+ styleInject(css_248z$G);
667
+
668
+ const CardText = (props) => {
669
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
670
+ const getCssClasses = () => {
671
+ const cssClasses = [];
672
+ cssClasses.push(styles$G.cardText);
673
+ className && cssClasses.push(className);
674
+ return cssClasses.filter(css => css).join(' ');
675
+ };
676
+ return (React.createElement("p", Object.assign({ className: getCssClasses() }, rest), children));
677
+ };
678
+
679
+ 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";
680
+ var styles$F = {"cardTitle":"CardTitle-module_cardTitle__aiPSE"};
681
+ styleInject(css_248z$F);
682
+
683
+ const CardTitle = (props) => {
684
+ const { children, className, as: As = 'div' } = props, rest = __rest(props, ["children", "className", "as"]);
685
+ const getCssClasses = () => {
686
+ const cssClasses = [];
687
+ cssClasses.push(styles$F.cardTitle);
688
+ className && cssClasses.push(className);
689
+ return cssClasses.filter(css => css).join(' ');
690
+ };
691
+ return (React.createElement(As, Object.assign({ className: getCssClasses() }, rest), children));
692
+ };
693
+
694
+ 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";
695
+ var styles$E = {"cardImage":"CardImage-module_cardImage__Z6JWW"};
696
+ styleInject(css_248z$E);
697
+
698
+ const CardImage = (props) => {
699
+ const { src, alt, className } = props, rest = __rest(props, ["src", "alt", "className"]);
700
+ const getCssClasses = () => {
701
+ const cssClasses = [];
702
+ cssClasses.push(styles$E.cardImage);
703
+ className && cssClasses.push(className);
704
+ return cssClasses.filter(css => css).join(' ');
705
+ };
706
+ return (React.createElement("img", Object.assign({ className: getCssClasses(), src: src, alt: alt }, rest)));
707
+ };
708
+
709
+ 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";
710
+ var styles$D = {"checkboxContainer":"Checkbox-module_checkboxContainer__x2GCi","checkboxLabel":"Checkbox-module_checkboxLabel__nPY4k","disabled":"Checkbox-module_disabled__wnFIG"};
711
+ styleInject(css_248z$D);
712
+
713
+ const Checkbox = (props) => {
714
+ const { id, checked, className, label, name, value = "off", disabled, readOnly } = props, rest = __rest(props, ["id", "checked", "className", "label", "name", "value", "disabled", "readOnly"]);
715
+ // TODO
716
+ // add own value
717
+ // set from outer
718
+ // update on change
719
+ // emit to outer
720
+ // can be: true/false, custom
721
+ const [isChecked, setIsChecked] = useState(false);
722
+ const checkboxElement = useRef(null);
723
+ useEffect(() => {
724
+ if (checked === true || checked === false) {
725
+ setIsChecked(checked);
726
+ }
727
+ }, [checked]);
728
+ const icons = {
729
+ default: React.createElement(SquareRegularIcon, null),
730
+ selected: React.createElement(CheckSquareRegularIcon, null)
731
+ };
732
+ const getCssClasses = () => {
733
+ const cssClasses = [];
734
+ cssClasses.push('checkbox');
735
+ className && cssClasses.push(className);
736
+ return cssClasses.filter(css => css).join(' ');
737
+ };
738
+ const getCssClassesLabel = () => {
739
+ const cssClasses = [];
740
+ cssClasses.push(styles$D.checkboxLabel);
741
+ disabled && cssClasses.push(styles$D['disabled']);
742
+ return cssClasses.filter(css => css).join(' ');
743
+ };
744
+ const getIcon = () => {
745
+ return isChecked ? icons.selected : icons.default;
746
+ };
747
+ const handleClick = () => {
748
+ var _a;
749
+ if (!disabled && !readOnly) {
750
+ setIsChecked(!isChecked);
751
+ (_a = checkboxElement === null || checkboxElement === void 0 ? void 0 : checkboxElement.current) === null || _a === void 0 ? void 0 : _a.click();
752
+ }
753
+ };
754
+ return (React.createElement("div", { className: styles$D.checkboxContainer },
755
+ React.createElement(IconButton, { className: getCssClasses(), onClick: handleClick, icon: getIcon(), disabled: disabled || readOnly }),
756
+ React.createElement("label", { onClick: handleClick, className: getCssClassesLabel() }, label),
757
+ React.createElement("input", Object.assign({ type: "checkbox", ref: checkboxElement, id: id, name: name, checked: isChecked, disabled: disabled, readOnly: readOnly, hidden: true, value: value }, rest))));
758
+ };
759
+
760
+ 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";
761
+ 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"};
762
+ styleInject(css_248z$C);
763
+
764
+ const Chip = (props) => {
765
+ 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"]);
766
+ const getCssClass = () => {
767
+ const cssClasses = [];
768
+ cssClasses.push(styles$C.chip);
769
+ cssClasses.push(styles$C[color]);
770
+ shadow && cssClasses.push(styles$C['shadow']);
771
+ onClick && cssClasses.push(styles$C['clickable']);
772
+ className && cssClasses.push(className);
773
+ return cssClasses.filter(r => r).join(' ');
774
+ };
775
+ const handleClickOnDelete = (e) => {
776
+ e.stopPropagation();
777
+ onDelete && onDelete(e);
778
+ };
779
+ return (React.createElement("div", Object.assign({ className: getCssClass() }, rest, { style: style }),
780
+ React.createElement("div", null, children),
781
+ isDeletable && (React.createElement("div", { className: styles$C.deleteIcon, onClick: e => handleClickOnDelete(e) }, deleteIcon))));
782
+ };
783
+
784
+ var css_248z$B = ".Column-module_column__fcTgl {\n flex: 1 0 0%; }\n";
785
+ var styles$B = {"column":"Column-module_column__fcTgl"};
786
+ styleInject(css_248z$B);
787
+
788
+ const Column = (props) => {
789
+ const { children, className } = props,
790
+ // xs,
791
+ // sm,
792
+ // md,
793
+ // lg,
794
+ // xl,
795
+ rest = __rest(props, ["children", "className"]);
796
+ const getCssClasses = () => {
797
+ const cssClasses = [];
798
+ // !xs && !sm && !md && !lg && !xl && cssClasses.push('col');
799
+ // if (xs) cssClasses.push(`col-${xs.toString()}`);
800
+ // if (sm) cssClasses.push(`col-sm-${sm.toString()}`);
801
+ // if (md) cssClasses.push(`col-md-${md.toString()}`);
802
+ // if (lg) cssClasses.push(`col-lg-${lg.toString()}`);
803
+ // if (xl) cssClasses.push(`col-xl-${xl.toString()}`);
804
+ cssClasses.push(styles$B.column);
805
+ className && cssClasses.push(className);
806
+ return cssClasses.filter(css => css).join(' ');
807
+ };
808
+ return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
809
+ };
810
+
811
+ var css_248z$A = ".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";
812
+ var styles$A = {"row":"Row-module_row__bTIWp"};
813
+ styleInject(css_248z$A);
814
+
815
+ const Row = (_a) => {
816
+ var { children, direction = 'row', className } = _a, rest = __rest(_a, ["children", "direction", "className"]);
817
+ const getCssClasses = () => {
818
+ const cssClasses = [];
819
+ cssClasses.push(styles$A.row);
820
+ className && cssClasses.push(className);
821
+ direction && cssClasses.push(`flex-${direction}`);
822
+ return cssClasses.filter(css => css).join(' ');
823
+ };
824
+ return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest), children));
825
+ };
826
+
827
+ var css_248z$z = ".FormLabel-module_formLabel__TXcHc {\n display: inline-block;\n margin-bottom: 0.5rem; }\n";
828
+ var styles$z = {"formLabel":"FormLabel-module_formLabel__TXcHc"};
829
+ styleInject(css_248z$z);
830
+
831
+ const FormLabel = (_a) => {
832
+ var { children, className, htmlFor } = _a, rest = __rest(_a, ["children", "className", "htmlFor"]);
833
+ const getCssClasses = () => {
834
+ const cssClasses = [];
835
+ cssClasses.push(styles$z.formLabel);
836
+ className && cssClasses.push(className);
837
+ return cssClasses.filter(css => css).join(' ');
838
+ };
839
+ return (React.createElement("label", Object.assign({ htmlFor: htmlFor, className: getCssClasses() }, rest), children));
840
+ };
841
+
842
+ const FormGroup = (props) => {
843
+ const { children, className = 'mb-1' } = props;
844
+ return (React.createElement("div", { className: className }, children));
845
+ };
846
+
847
+ const FileInput = (props) => {
848
+ 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"]);
849
+ const inputFileElement = useRef(null);
850
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
851
+ const [model, setModel] = useState(value);
852
+ const [fileList, setFileList] = useState();
853
+ const getCssClasses = () => {
854
+ const cssClasses = [];
855
+ className && cssClasses.push(className);
856
+ return cssClasses.filter(r => r).join(' ');
857
+ };
858
+ const handleOnChange = (event) => {
859
+ const values = event.target.files;
860
+ setFileList(values);
861
+ onChange && onChange(event);
862
+ };
863
+ const handleOnDelete = () => {
864
+ alert('coming soon');
865
+ };
866
+ return (React.createElement("div", { className: "d-flex align-items-start" },
867
+ React.createElement(Button, { className: "flex-wrap", disabled: disabled, onClick: () => { var _a; return (_a = inputFileElement.current) === null || _a === void 0 ? void 0 : _a.click(); } }, children),
868
+ 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))),
869
+ 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))));
870
+ };
871
+
872
+ var css_248z$y = ".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:not(.Select-module_select__Fbn38.Select-module_disabled__2XXut) {\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 .Select-module_select__Fbn38.Select-module_disabled__2XXut, .Select-module_select__Fbn38.Select-module_readOnly__VoTER {\n background-color: #e9ecef; }\n .Select-module_select__Fbn38.Select-module_disabled__2XXut:hover {\n cursor: not-allowed; }\n .Select-module_select__Fbn38.Select-module_readOnly__VoTER:hover {\n cursor: inherit; }\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";
873
+ var styles$y = {"selectContainer":"Select-module_selectContainer__DHFDZ","select":"Select-module_select__Fbn38","disabled":"Select-module_disabled__2XXut","readOnly":"Select-module_readOnly__VoTER","selectMenu":"Select-module_selectMenu__8y4kQ"};
874
+ styleInject(css_248z$y);
875
+
876
+ const Select = (props) => {
877
+ var _a, _b, _c;
878
+ const { id, className, options = [], value, multiple, multipleMaxCountItems = 5, disabled, readOnly, onChange, onKeyDown } = props;
879
+ const [model, setModel] = useState('');
880
+ const [hoverIndex, setHoverIndex] = useState(null);
881
+ const [isShow, setIsShow] = useState(false);
882
+ const [selectedOptions, setSelectedOptions] = useState([]);
883
+ const selectConainter = useRef(null);
884
+ const getCssClass = () => {
885
+ const cssClasses = [];
886
+ className && cssClasses.push(className);
887
+ disabled && cssClasses.push(styles$y['disabled']);
888
+ readOnly && cssClasses.push(styles$y['readOnly']);
889
+ cssClasses.push(styles$y.select);
890
+ return cssClasses.filter(r => r).join(' ');
891
+ };
892
+ useEffect(() => {
893
+ const newValue = value ? value : '';
894
+ writeValue(newValue);
895
+ if (newValue) {
896
+ const option = options.find(o => o.value === newValue);
897
+ if (option) {
898
+ setHoverIndex(options.indexOf(option));
899
+ }
900
+ }
901
+ }, [value, options]);
902
+ useEffect(() => {
903
+ if (hoverIndex) {
904
+ scrollIntoView(hoverIndex);
905
+ }
906
+ }, [hoverIndex, isShow]);
907
+ const scrollIntoView = (index) => {
908
+ var _a;
909
+ const htmlListItem = (_a = selectConainter.current) === null || _a === void 0 ? void 0 : _a.querySelector(`#list-item-${index}`);
910
+ if (htmlListItem) {
911
+ htmlListItem === null || htmlListItem === void 0 ? void 0 : htmlListItem.scrollIntoView({ block: "end", behavior: "smooth" });
912
+ }
913
+ };
914
+ const writeValue = (val) => setModel(val);
915
+ useEffect(() => {
916
+ if (!multiple) {
917
+ const newOption = options.find(o => o.value === model);
918
+ if (newOption) {
919
+ setSelectedOptions([newOption]);
920
+ }
921
+ }
922
+ else {
923
+ const filteredOptions = options.filter(o => model.indexOf(o.value) >= 0);
924
+ setSelectedOptions([...filteredOptions]);
925
+ }
926
+ }, [model, multiple]);
927
+ const handleOnClick = (option) => {
928
+ let newValue = multiple ? [] : '';
929
+ if (!multiple) {
930
+ if (model !== option.value) {
931
+ newValue = option.value;
932
+ onChange && onChange(newValue);
933
+ }
934
+ hide();
935
+ }
936
+ else {
937
+ const selectedOption = selectedOptions.find(o => o.value === option.value);
938
+ if (selectedOption) {
939
+ newValue = selectedOptions.filter(o => o.value !== option.value).map(o => o.value);
940
+ }
941
+ else {
942
+ newValue = newValue.concat(selectedOptions.map(o => o.value));
943
+ newValue.push(option.value);
944
+ }
945
+ onChange && onChange(newValue);
946
+ }
947
+ writeValue(newValue);
948
+ };
949
+ const show = () => {
950
+ if (!disabled && !readOnly) {
951
+ setIsShow(true);
952
+ }
953
+ };
954
+ const hide = () => setIsShow(false);
955
+ const isActive = (option) => {
956
+ return selectedOptions.indexOf(option) >= 0 || hoverIndex === options.indexOf(option);
957
+ };
958
+ const renderSingleViewModel = () => {
959
+ let result = null;
960
+ if (selectedOptions.length > 0) {
961
+ result = React.createElement("span", null, selectedOptions[0].label);
962
+ }
963
+ return result;
964
+ };
965
+ const renderMultipleViewModel = () => {
966
+ let result = null;
967
+ if (selectedOptions.length <= multipleMaxCountItems && selectedOptions.length > 0) {
968
+ result = selectedOptions
969
+ .map(option => React.createElement(Chip, { key: option.value, className: "mr-2", color: COLOR.primary, isDeletable: true, onDelete: (e) => handleOnDelete(e, option) }, option.label));
970
+ }
971
+ else {
972
+ result = React.createElement("span", null,
973
+ selectedOptions.length,
974
+ " Items selected");
975
+ }
976
+ return result;
977
+ };
978
+ const handleOnDelete = (event, option) => {
979
+ event.stopPropagation();
980
+ handleOnClick(option);
981
+ };
982
+ // TODO - extract with wrapper?
983
+ const handleOnKeyDown = (e) => {
984
+ if (isShow) {
985
+ onKeyDown && onKeyDown(e);
986
+ switch (e.code) {
987
+ case 'Escape':
988
+ hide();
989
+ break;
990
+ case 'ArrowDown':
991
+ if (hoverIndex) {
992
+ setHoverIndex(hoverIndex + 1);
993
+ }
994
+ break;
995
+ case 'ArrowUp':
996
+ // TODO
997
+ if (hoverIndex) {
998
+ setHoverIndex(hoverIndex - 1);
999
+ }
1000
+ break;
1001
+ case 'Enter':
1002
+ if (hoverIndex) {
1003
+ const option = options[hoverIndex];
1004
+ if (option)
1005
+ handleOnClick(option);
1006
+ }
1007
+ break;
1008
+ }
1009
+ }
1010
+ };
1011
+ return (React.createElement("div", { ref: selectConainter, className: styles$y.selectContainer },
1012
+ React.createElement("div", { id: id, className: getCssClass(), onClick: () => show(), tabIndex: 0, onKeyDown: e => handleOnKeyDown(e) },
1013
+ !multiple && renderSingleViewModel(),
1014
+ multiple && renderMultipleViewModel(),
1015
+ React.createElement(Icon, { className: "ml-auto" },
1016
+ React.createElement(ChevronDownSolidIcon, null))),
1017
+ isShow &&
1018
+ createPortal(React.createElement(React.Fragment, null,
1019
+ React.createElement("div", { className: styles$y.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 } },
1020
+ 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) },
1021
+ multiple &&
1022
+ React.createElement(Checkbox, { checked: isActive(option), onChange: () => handleOnClick(option) }),
1023
+ React.createElement(ListItemText, { primary: option.label ? option.label : option.value }))))),
1024
+ React.createElement(Backdrop, { style: { zIndex: 1111 }, isTransparent: true, onClick: () => hide() })), document.body)));
1025
+ };
1026
+
1027
+ var css_248z$x = ".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:not(.Textarea-module_textarea__L5zqa.Textarea-module_disabled__OqqOF) {\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";
1028
+ var styles$x = {"textarea":"Textarea-module_textarea__L5zqa","disabled":"Textarea-module_disabled__OqqOF","isInvalid":"Textarea-module_isInvalid__JI01W"};
1029
+ styleInject(css_248z$x);
1030
+
1031
+ const Textarea = (props) => {
1032
+ const { className, error } = props, rest = __rest(props, ["className", "error"]);
1033
+ const getCssClass = () => {
1034
+ const cssClasses = [];
1035
+ cssClasses.push(styles$x.textarea);
1036
+ className && cssClasses.push(className);
1037
+ error && cssClasses.push(styles$x['isInvalid']);
1038
+ return cssClasses.filter(r => r).join(' ');
1039
+ };
1040
+ return (React.createElement("textarea", Object.assign({ className: getCssClass() }, rest)));
1041
+ };
1042
+
1043
+ var css_248z$w = ".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:not(.FormInput-module_formInput__VXZip.FormInput-module_disabled__EjdD9) {\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";
1044
+ var styles$w = {"formInput":"FormInput-module_formInput__VXZip","disabled":"FormInput-module_disabled__EjdD9","isInvalid":"FormInput-module_isInvalid__vQDuz"};
1045
+ styleInject(css_248z$w);
1046
+
1047
+ const FormInput = (props) => {
1048
+ const { value, name, type, placeholder, className, isValid = true, options = [], textareaOptions, selectOptions, autoCompleteOptions, autoFocus, label, disabled = false, readonly = false, onInput, onChange, onBlur, onKeyDown } = props;
1049
+ const getCssClasses = () => {
1050
+ const cssClasses = [];
1051
+ cssClasses.push(styles$w.formInput);
1052
+ className && cssClasses.push(className);
1053
+ !isValid && cssClasses.push(styles$w['isInvalid']);
1054
+ return cssClasses.filter(css => css).join(' ');
1055
+ };
1056
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1057
+ const handleOnInput = (value, type, name) => {
1058
+ onInput && onInput({ value, type, name });
1059
+ };
1060
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1061
+ const handleOnChange = (value, type, name) => {
1062
+ onChange && onChange({ value, type, name });
1063
+ };
1064
+ return (React.createElement(Fragment, null,
1065
+ (type === 'text' ||
1066
+ type === 'date' ||
1067
+ type === 'datetime-local' ||
1068
+ type === 'email' ||
1069
+ type === 'number' ||
1070
+ type === 'password' ||
1071
+ type === 'color' ||
1072
+ type === 'time')
1073
+ &&
1074
+ 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 }),
1075
+ type === 'file' &&
1076
+ 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"),
1077
+ type === 'textarea' &&
1078
+ 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' } }),
1079
+ type === 'select' &&
1080
+ 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),
1081
+ // onKeyDown={e => onKeyDown(e)}
1082
+ options: options }),
1083
+ type === 'autocomplete' &&
1084
+ 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 }),
1085
+ type === 'checkbox' &&
1086
+ 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 }),
1087
+ type === 'radio' &&
1088
+ React.createElement(React.Fragment, null, options.map((option) => React.createElement("div", { className: "form-check", key: option.id },
1089
+ 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 }),
1090
+ React.createElement("label", { className: "form-check-label", htmlFor: option.id }, option.label))))));
1091
+ };
1092
+
1093
+ const FormHint = (props) => {
1094
+ const { children, className = 'form-text text-muted' } = props;
1095
+ const getCssClasses = () => {
1096
+ const cssClasses = [];
1097
+ className && cssClasses.push(className);
1098
+ return cssClasses.filter(css => css).join(' ');
1099
+ };
1100
+ return (React.createElement("small", { className: getCssClasses() }, children));
1101
+ };
1102
+
1103
+ var css_248z$v = ".FormError-module_isInvalid__tO1Sw {\n width: 100%;\n margin-top: 0.25rem;\n font-size: 0.875em;\n color: #dc3545; }\n";
1104
+ var styles$v = {"isInvalid":"FormError-module_isInvalid__tO1Sw"};
1105
+ styleInject(css_248z$v);
1106
+
1107
+ const FormError = (props) => {
1108
+ const { className = styles$v.isInvalid, errors = [] } = props;
1109
+ return (React.createElement(Fragment, null, errors &&
1110
+ React.createElement("div", { className: className }, errors.map(e => React.createElement("div", { key: e.validator }, e.message)))));
1111
+ };
1112
+
1113
+ const IsEmptyValidator = (value) => value.trim() === '' || value === null || value === undefined;
1114
+
1115
+ const EmailValidator = (value) => {
1116
+ const isInvalidEmailFormat = value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i) === null;
1117
+ const isInvalid = !IsEmptyValidator(value) && isInvalidEmailFormat;
1118
+ return isInvalid;
1119
+ };
1120
+
1121
+ const IsEqualValidator = (valueA, valueB) => valueA === valueB;
1122
+
1123
+ // values, isSubmitting, handleChange, handleBlur, handleSubmit
1124
+ class Form extends Component {
1125
+ constructor(props) {
1126
+ super(props);
1127
+ this.myForm = createRef();
1128
+ this.state = { controls: undefined, isValid: false, isChanged: false, isSubmitted: false, submitOnEnter: props.submitOnEnter !== undefined ? props.submitOnEnter : true };
1129
+ }
1130
+ static getDerivedStateFromProps(nextProps, state) {
1131
+ if (!state.controls && nextProps.controls) {
1132
+ return ({ controls: nextProps.controls });
1133
+ }
1134
+ return null;
1135
+ }
1136
+ handleChange() {
1137
+ // get value by myForm instead of getControl?
1138
+ if (this.state.isChanged || this.state.isSubmitted) {
1139
+ const keys = Object.keys(this.state.controls);
1140
+ const values = keys.reduce((obj, f) => {
1141
+ const control = this.getControl(f);
1142
+ // TODO - refactor
1143
+ const newValue = ((control.type === 'date' || control.type === 'datetime-local') && control.value && isValidDate((control.value))) ? new Date((control.value)).toISOString() : control.value;
1144
+ return (Object.assign(Object.assign({}, obj), { [f]: newValue }));
1145
+ }, {});
1146
+ if (this.state.isValid && this.state.isSubmitted) {
1147
+ this.props.onSubmit && this.props.onSubmit(values);
1148
+ }
1149
+ this.props.onChange && this.props.onChange(values);
1150
+ this.setState({ isChanged: false, isSubmitted: false });
1151
+ }
1152
+ }
1153
+ // extract to service?
1154
+ validateField(fieldValue, fieldValidators) {
1155
+ const errors = [];
1156
+ if (fieldValidators) {
1157
+ for (const validator of fieldValidators) {
1158
+ const validatorSplitted = validator.split(':');
1159
+ const validatorName = validatorSplitted[0];
1160
+ const validatorParam = validatorSplitted.length > 1 ? validatorSplitted[1] : null;
1161
+ switch (validatorName) {
1162
+ case 'required':
1163
+ if (IsEmptyValidator(fieldValue)) {
1164
+ errors.push({ validator: validatorName, message: 'This field is required' });
1165
+ }
1166
+ break;
1167
+ case 'email':
1168
+ if (EmailValidator(fieldValue)) {
1169
+ errors.push({ validator: validatorName, message: 'Email format is wrong' });
1170
+ }
1171
+ break;
1172
+ case 'match':
1173
+ if (validatorParam) {
1174
+ const matchControl = this.getControl(validatorParam);
1175
+ if (matchControl) {
1176
+ if (!IsEqualValidator(fieldValue, matchControl.value)) {
1177
+ errors.push({ validator: validatorName, message: 'Values do not match' });
1178
+ }
1179
+ }
1180
+ else {
1181
+ console.error(`Form: Field ${validatorParam} not found`);
1182
+ }
1183
+ }
1184
+ break;
1185
+ }
1186
+ }
1187
+ }
1188
+ return errors;
1189
+ }
1190
+ handleInputChange(name, value) {
1191
+ const field = this.getControl(name);
1192
+ field.value = value;
1193
+ // redundant mit handleOnBlur
1194
+ field.isDirty = true;
1195
+ field.errors = this.validateField(field.value, field.validators);
1196
+ field.isValid = field.errors.length === 0;
1197
+ const newControls = Object.assign({}, this.state.controls);
1198
+ newControls[name] = field;
1199
+ this.setState({ controls: newControls, isChanged: true }, () => this.handleChange());
1200
+ }
1201
+ handleOnBlur(e) {
1202
+ if (this.props.validateOnBlur) {
1203
+ const { name } = e.target;
1204
+ const field = this.getControl(name);
1205
+ field.isDirty = true;
1206
+ field.errors = this.validateField(field.value, field.validators);
1207
+ field.isValid = field.errors.length === 0;
1208
+ const controls = this.state.controls;
1209
+ if (controls) {
1210
+ controls[name] = field;
1211
+ this.setState({ controls: controls, isChanged: true }, () => this.handleChange());
1212
+ }
1213
+ }
1214
+ }
1215
+ isRequired(fieldName) {
1216
+ let result = false;
1217
+ result = this.getControl(fieldName).validators.indexOf('required') >= 0;
1218
+ return result;
1219
+ }
1220
+ isInvalid(fieldName) {
1221
+ let result = false;
1222
+ const field = this.getControl(fieldName);
1223
+ result = field.isDirty && !field.isValid;
1224
+ return result;
1225
+ }
1226
+ getControl(name) {
1227
+ return this.state.controls[name];
1228
+ }
1229
+ renderLabel(fieldKey, label, labelClassName = 'form-label') {
1230
+ const cssClasses = [labelClassName, this.isRequired(fieldKey) ? 'required' : undefined];
1231
+ return React.createElement(FormLabel, { htmlFor: fieldKey, className: cssClasses.join(' ') }, label);
1232
+ }
1233
+ // trigger via ref
1234
+ handleFormSubmit() {
1235
+ for (const fieldKey of Object.keys(this.state.controls)) {
1236
+ const field = this.getControl(fieldKey);
1237
+ // redundant mit handleBlur
1238
+ field.isDirty = true;
1239
+ field.errors = this.validateField(field.value, field.validators);
1240
+ field.isValid = field.errors.length === 0;
1241
+ }
1242
+ this.setState({
1243
+ controls: Object.assign({}, this.state.controls),
1244
+ isSubmitted: true,
1245
+ isValid: Object.keys(this.state.controls).map(f => this.getControl(f).isValid).every(valid => valid === true)
1246
+ }, () => this.handleChange());
1247
+ }
1248
+ // trigger via ref
1249
+ handleFormReset() {
1250
+ for (const fieldKey of Object.keys(this.state.controls)) {
1251
+ const field = this.getControl(fieldKey);
1252
+ field.value = '';
1253
+ field.isDirty = false;
1254
+ field.errors = [];
1255
+ field.isValid = field.errors.length === 0;
1256
+ }
1257
+ this.setState({
1258
+ controls: Object.assign({}, this.state.controls),
1259
+ isSubmitted: false,
1260
+ isChanged: false,
1261
+ isValid: false
1262
+ });
1263
+ }
1264
+ handleOnKeyDown(e) {
1265
+ if (e.key === 'Enter') {
1266
+ e.preventDefault();
1267
+ this.state.submitOnEnter && this.handleFormSubmit();
1268
+ }
1269
+ }
1270
+ destroy() {
1271
+ this.setState({ controls: {}, isValid: false, isChanged: false, isSubmitted: false });
1272
+ }
1273
+ getFormGroupCssClass(fieldKey) {
1274
+ const result = this.getControl(fieldKey).config.formGroupClassName;
1275
+ return result;
1276
+ }
1277
+ render() {
1278
+ return (React.createElement("form", { ref: this.myForm }, this.state && this.state.controls && Object.keys(this.state.controls).map((fieldKey) => {
1279
+ return (React.createElement(FormGroup, { key: fieldKey, className: this.getFormGroupCssClass(fieldKey) },
1280
+ this.getControl(fieldKey).config.labelPosition !== 'behind' && this.getControl(fieldKey).type !== 'checkbox' &&
1281
+ this.renderLabel(fieldKey, this.getControl(fieldKey).config.label, this.getControl(fieldKey).config.labelClassName),
1282
+ 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) }),
1283
+ this.getControl(fieldKey).config.labelPosition === 'behind' && this.getControl(fieldKey).type !== 'checkbox' &&
1284
+ this.renderLabel(fieldKey, this.getControl(fieldKey).config.label, this.getControl(fieldKey).config.labelClassName),
1285
+ this.getControl(fieldKey).config.hint &&
1286
+ React.createElement(FormHint, null, this.getControl(fieldKey).config.hint),
1287
+ this.getControl(fieldKey).errors &&
1288
+ React.createElement(FormError, { errors: this.getControl(fieldKey).errors })));
1289
+ })));
1290
+ }
1291
+ }
1292
+ function isValidDate(dateObject) {
1293
+ return new Date(dateObject).toString() !== 'Invalid Date';
1294
+ }
1295
+
1296
+ class FormControl {
1297
+ constructor(
1298
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1299
+ value, validators = [], type, config) {
1300
+ this.value = value;
1301
+ this.validators = validators;
1302
+ this.type = type;
1303
+ this.config = config;
1304
+ this.errors = [];
1305
+ this.isValid = false;
1306
+ this.isDirty = false;
1307
+ }
1308
+ }
1309
+
1310
+ const DaySelect = (props) => {
1311
+ const { className, day = new Date().getDate(), month = new Date().getMonth(), year = new Date().getFullYear(), disabled, id, name, onChange } = props;
1312
+ useEffect(() => {
1313
+ init();
1314
+ }, [month, year]);
1315
+ const init = () => {
1316
+ const daysInMonth = new Date(year, month + 1, 0).getDate();
1317
+ const newDays = [];
1318
+ for (let i = 1; i <= daysInMonth; i++) {
1319
+ newDays.push({ value: i.toString(), label: i.toString() });
1320
+ }
1321
+ setDayOptions(newDays);
1322
+ };
1323
+ const [value, setValue] = useState(day);
1324
+ const [dayOptions, setDayOptions] = useState();
1325
+ const getCssClasses = () => {
1326
+ const cssClasses = [];
1327
+ className && cssClasses.push(className);
1328
+ return cssClasses.filter(css => css).join(' ');
1329
+ };
1330
+ const handleOnChange = (e) => {
1331
+ setValue(e);
1332
+ onChange && onChange(e);
1333
+ };
1334
+ return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: dayOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: value.toString() }));
1335
+ };
1336
+
1337
+ const MonthSelect = (props) => {
1338
+ const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
1339
+ const { className, value = new Date().getMonth(), id, name, disabled, onChange } = props;
1340
+ const [newValue, setNewValue] = useState(value);
1341
+ const [monthOptions, setMonthOptions] = useState();
1342
+ useEffect(() => {
1343
+ setMonthOptions(months.map((m, index) => ({ value: index.toString(), label: m })));
1344
+ }, []);
1345
+ const getCssClasses = () => {
1346
+ const cssClasses = [];
1347
+ className && cssClasses.push(className);
1348
+ return cssClasses.filter(css => css).join(' ');
1349
+ };
1350
+ const handleOnChange = (e) => {
1351
+ setNewValue(e);
1352
+ onChange && onChange(e);
1353
+ };
1354
+ return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: monthOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
1355
+ };
1356
+
1357
+ const YearSelect = (props) => {
1358
+ const { className, from = 1970, to = new Date().getFullYear().toString(), value = new Date().getFullYear().toString(), id, name, disabled, onChange } = props;
1359
+ const [newValue, setNewValue] = useState(value.toString());
1360
+ const [years, setYears] = useState();
1361
+ useEffect(() => {
1362
+ const newYears = [];
1363
+ for (let i = from; i <= to; i++) {
1364
+ newYears.push({ value: i.toString(), label: i.toString() });
1365
+ }
1366
+ setYears(newYears.reverse());
1367
+ }, [from, to]);
1368
+ const getCssClasses = () => {
1369
+ const cssClasses = [];
1370
+ className && cssClasses.push(className);
1371
+ return cssClasses.filter(css => css).join(' ');
1372
+ };
1373
+ const handleOnChange = (e) => {
1374
+ setNewValue(e);
1375
+ onChange && onChange(parseInt(e));
1376
+ };
1377
+ return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: years, onChange: handleOnChange, disabled: disabled, value: newValue }));
1378
+ };
1379
+
1380
+ var DATEMODE;
1381
+ (function (DATEMODE) {
1382
+ DATEMODE[DATEMODE["YEAR"] = 0] = "YEAR";
1383
+ DATEMODE[DATEMODE["MONTH"] = 1] = "MONTH";
1384
+ DATEMODE[DATEMODE["DAY"] = 2] = "DAY";
1385
+ })(DATEMODE || (DATEMODE = {}));
1386
+ const DateSelect = (props) => {
1387
+ const { className, value = new Date(), disabled, yearConfig, onChange } = props;
1388
+ const getCssClasses = () => {
1389
+ const cssClasses = [];
1390
+ cssClasses.push('row');
1391
+ className && cssClasses.push(className);
1392
+ return cssClasses.filter(css => css).join(' ');
1393
+ };
1394
+ const [currDate, setCurrDate] = useState(value);
1395
+ const handleOnChange = (e, mode) => {
1396
+ const currYear = mode === DATEMODE.YEAR ? e : currDate.getFullYear();
1397
+ const currMonth = mode === DATEMODE.MONTH ? e : currDate.getMonth();
1398
+ const currday = mode === DATEMODE.DAY ? e : currDate.getDate();
1399
+ const newDate = new Date(currYear, currMonth, currday);
1400
+ setCurrDate(newDate);
1401
+ onChange && onChange(newDate);
1402
+ };
1403
+ return (React.createElement(Row, { className: getCssClasses() },
1404
+ React.createElement(Column, null,
1405
+ React.createElement(FormLabel, null, "Year"),
1406
+ 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) })),
1407
+ React.createElement(Column, null,
1408
+ React.createElement(FormLabel, null, "Month"),
1409
+ React.createElement(MonthSelect, { value: currDate.getMonth(), disabled: disabled, onChange: e => handleOnChange(e, DATEMODE.MONTH) })),
1410
+ React.createElement(Column, null,
1411
+ React.createElement(FormLabel, null, "Day"),
1412
+ React.createElement(DaySelect, { day: currDate.getDate(), month: currDate.getMonth(), year: currDate.getFullYear(), disabled: disabled, onChange: e => handleOnChange(e, DATEMODE.DAY) }))));
1413
+ };
1414
+ /*
1415
+ * result = { year, month, day, dayOfWeek, weekNumber }
1416
+ */
1417
+ // const getWeekNumber = () => {
1418
+ // var d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate()));
1419
+ // var dayNum = d.getUTCDay() || 7;
1420
+ // d.setUTCDate(d.getUTCDate() + 4 - dayNum);
1421
+ // var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
1422
+ // return Math.ceil((((d - yearStart) / 86400000) + 1) / 7)
1423
+ // };
1424
+
1425
+ var css_248z$u = ".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";
1426
+ var styles$u = {"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"};
1427
+ styleInject(css_248z$u);
1428
+
1429
+ const Drawer = (props) => {
1430
+ const { children, className, position = 'left', permanent = false, target = document.body, shadow = true, onClickBackdrop } = props, rest = __rest(props, ["children", "className", "position", "permanent", "target", "shadow", "onClickBackdrop"]);
1431
+ useEffect(() => {
1432
+ document.body.classList.add(styles$u.drawerOpen);
1433
+ return () => {
1434
+ document.body.classList.remove(styles$u.drawerOpen);
1435
+ };
1436
+ }, []);
1437
+ const handleClickBackdrop = () => {
1438
+ onClickBackdrop && onClickBackdrop();
1439
+ };
1440
+ return createPortal(React.createElement(React.Fragment, null,
1441
+ React.createElement(DrawerContent, Object.assign({ className: className, position: position, permanent: permanent, shadow: shadow }, rest), children),
1442
+ !permanent && React.createElement(Backdrop, { onClick: handleClickBackdrop })), target);
1443
+ };
1444
+ const DrawerContent = (props) => {
1445
+ const { children, className, position = 'left', permanent = false, shadow } = props, rest = __rest(props, ["children", "className", "position", "permanent", "shadow"]);
1446
+ const getCssClasses = () => {
1447
+ const cssClasses = [];
1448
+ cssClasses.push(styles$u.drawer);
1449
+ shadow && cssClasses.push(styles$u.shadow);
1450
+ !!permanent && cssClasses.push(styles$u['permanent']);
1451
+ position === 'left' ? cssClasses.push(styles$u['left']) : cssClasses.push(styles$u['right']);
1452
+ className && cssClasses.push(className);
1453
+ return cssClasses.filter(css => css).join(' ');
1454
+ };
1455
+ const positionStyles = {
1456
+ left: { left: '0px' },
1457
+ right: { right: '0px' },
1458
+ };
1459
+ const getStyles = () => {
1460
+ return !permanent ? positionStyles[position] : undefined;
1461
+ };
1462
+ return (React.createElement("div", Object.assign({ className: getCssClasses(), style: getStyles() }, rest), children));
1463
+ };
1464
+
1465
+ var css_248z$t = ".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";
1466
+ var styles$t = {"menuBody":"MenuBody-module_menuBody__u4FIQ","shadow":"MenuBody-module_shadow__OBp-f"};
1467
+ styleInject(css_248z$t);
1468
+
1469
+ const MenuBody = (props) => {
1470
+ const { parentRef, children, className, shadow = true, menuPosition = 'left', onClickBackdrop } = props;
1471
+ const menuBodyRef = useRef(null);
1472
+ useEffect(() => {
1473
+ if (menuBodyRef && parentRef.current && menuBodyRef.current) {
1474
+ createPopper(parentRef.current, menuBodyRef.current, {
1475
+ placement: `${menuPosition}-start`,
1476
+ modifiers: [
1477
+ {
1478
+ name: 'offset',
1479
+ options: {
1480
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1481
+ offset: ({ placement, popper }) => {
1482
+ if (placement === 'left-start') {
1483
+ return [0, -popper.width]; // y, x
1484
+ }
1485
+ if (placement === 'right-start') {
1486
+ return [0, -popper.width];
1487
+ }
1488
+ return [];
1489
+ },
1490
+ },
1491
+ },
1492
+ ]
1493
+ });
1494
+ }
1495
+ }, [menuBodyRef]);
1496
+ const getCssClasses = () => {
1497
+ const cssClasses = [];
1498
+ cssClasses.push(styles$t.menuBody);
1499
+ shadow && cssClasses.push(styles$t.shadow);
1500
+ className && cssClasses.push(className);
1501
+ return cssClasses.filter(css => css).join(' ');
1502
+ };
1503
+ const handleClickBackdrop = () => {
1504
+ onClickBackdrop && onClickBackdrop();
1505
+ };
1506
+ return (createPortal(React.createElement(React.Fragment, null,
1507
+ React.createElement("div", { ref: menuBodyRef, className: getCssClasses() }, children),
1508
+ React.createElement(Backdrop, { isTransparent: true, onClick: handleClickBackdrop })), document.body));
1509
+ };
1510
+
1511
+ var css_248z$s = ".Menu-module_menu__p8QL- {\n display: flex; }\n";
1512
+ var styles$s = {"menu":"Menu-module_menu__p8QL-"};
1513
+ styleInject(css_248z$s);
1514
+
1515
+ const Menu = (props) => {
1516
+ const { toggle, children, className, open, menuPosition, onClickBackdrop } = props, rest = __rest(props, ["toggle", "children", "className", "open", "menuPosition", "onClickBackdrop"]);
1517
+ const menuContainer = useRef(null);
1518
+ const toggleContainerRef = useRef(null);
1519
+ const getCssClasses = () => {
1520
+ const cssClasses = [];
1521
+ cssClasses.push(styles$s.menu);
1522
+ className && cssClasses.push(className);
1523
+ return cssClasses.filter(css => css).join(' ');
1524
+ };
1525
+ const handleClickBackdrop = () => {
1526
+ onClickBackdrop && onClickBackdrop();
1527
+ };
1528
+ return (React.createElement("div", Object.assign({ ref: menuContainer, className: getCssClasses() }, rest),
1529
+ React.createElement("div", { ref: toggleContainerRef }, toggle),
1530
+ open &&
1531
+ React.createElement(MenuBody, { parentRef: toggleContainerRef, menuPosition: menuPosition, onClickBackdrop: handleClickBackdrop }, children)));
1532
+ };
1533
+
1534
+ var css_248z$r = ".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";
1535
+ var styles$r = {"menuItem":"MenuItem-module_menuItem__MeBxN","menuItemHeader":"MenuItem-module_menuItemHeader__2l732"};
1536
+ styleInject(css_248z$r);
1537
+
1538
+ const MenuItem = (props) => {
1539
+ const { children, onClick, type = 'item' } = props;
1540
+ const getCssClasses = () => {
1541
+ const cssClasses = [];
1542
+ cssClasses.push(styles$r.menuItem);
1543
+ if (type === 'header') {
1544
+ cssClasses.push(styles$r.menuItemHeader);
1545
+ }
1546
+ return cssClasses.filter(css => css).join(' ');
1547
+ };
1548
+ const handleClick = (e) => {
1549
+ e.stopPropagation();
1550
+ onClick && onClick(e);
1551
+ };
1552
+ return (React.createElement(ConditionalWrapper, { condition: true, wrapper: children => ((type === 'item' ? (React.createElement("a", { className: getCssClasses(), onClick: handleClick }, children)) :
1553
+ React.createElement("div", { className: getCssClasses(), onClick: handleClick }, children))) }, children));
1554
+ };
1555
+
1556
+ const MenuToggle = ({ children }) => {
1557
+ return (React.createElement(Fragment, null, children));
1558
+ };
1559
+
1560
+ var css_248z$q = ".MenuDivider-module_menuItemDivider__oRP-j {\n height: 0;\n margin: 0.5rem 0;\n overflow: hidden;\n border-top: 1px solid #e9ecef; }\n";
1561
+ var styles$q = {"menuItemDivider":"MenuDivider-module_menuItemDivider__oRP-j"};
1562
+ styleInject(css_248z$q);
1563
+
1564
+ const MenuDivider = () => React.createElement("div", { className: styles$q.menuItemDivider });
1565
+
1566
+ var css_248z$p = ".ExpansionPanelContent-module_expansionPanelContent__aXNfH {\n padding: 8px 16px 16px; }\n";
1567
+ var styles$p = {"expansionPanelContent":"ExpansionPanelContent-module_expansionPanelContent__aXNfH"};
1568
+ styleInject(css_248z$p);
1569
+
1570
+ const ExpansionPanelContent = ({ children }) => {
1571
+ return (React.createElement("div", { className: styles$p.expansionPanelContent }, children));
1572
+ };
1573
+
1574
+ var css_248z$o = ".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";
1575
+ var styles$o = {"expansionPanelHeader":"ExpansionPanelHeader-module_expansionPanelHeader__Wy6Pq"};
1576
+ styleInject(css_248z$o);
1577
+
1578
+ const ExpansionPanelHeader = (props) => {
1579
+ const { children, isExpanded, onClick } = props;
1580
+ const handleClick = (e) => {
1581
+ e.stopPropagation();
1582
+ onClick && onClick(e);
1583
+ };
1584
+ return (React.createElement("div", { className: styles$o.expansionPanelHeader, onClick: handleClick },
1585
+ children,
1586
+ React.createElement("span", { className: "ml-auto text-muted" },
1587
+ React.createElement(Icon, null, isExpanded ? React.createElement(ChevronUpSolidIcon, null) : React.createElement(ChevronDownSolidIcon, null)))));
1588
+ };
1589
+
1590
+ var css_248z$n = ".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";
1591
+ var styles$n = {"expansionPanel":"ExpansionPanel-module_expansionPanel__m1yQq","isExpanded":"ExpansionPanel-module_isExpanded__TS1ph"};
1592
+ styleInject(css_248z$n);
1593
+
1594
+ const ExpansionPanel = (props) => {
1595
+ const { header, children, isExpanded = false, onChange } = props;
1596
+ const [_isExpanded, setIsExpanded] = useState(false);
1597
+ useEffect(() => {
1598
+ setIsExpanded(isExpanded);
1599
+ }, [isExpanded]);
1600
+ const getCssClasses = () => {
1601
+ const cssClasses = [];
1602
+ cssClasses.push(styles$n.expansionPanel);
1603
+ if (_isExpanded) {
1604
+ cssClasses.push(styles$n.isExpanded);
1605
+ }
1606
+ return cssClasses.filter(css => css).join(' ');
1607
+ };
1608
+ const handleClickHeader = (event) => {
1609
+ setIsExpanded(!_isExpanded);
1610
+ onChange && onChange(event, !_isExpanded);
1611
+ };
1612
+ return (React.createElement("div", { className: getCssClasses() },
1613
+ React.createElement(ExpansionPanelHeader, { isExpanded: _isExpanded, onClick: handleClickHeader }, header),
1614
+ _isExpanded &&
1615
+ React.createElement(ExpansionPanelContent, null, children)));
1616
+ };
1617
+
1618
+ var css_248z$m = ".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";
1619
+ var styles$m = {"fab":"FloatingActionButton-module_fab__Rw3kd","fixed":"FloatingActionButton-module_fixed__XQOkG"};
1620
+ styleInject(css_248z$m);
1621
+
1622
+ const FloatingActionButton = (props) => {
1623
+ const { className, icon, color = COLOR.primary, fixed, size = SIZE.lg, isActive, disabled, onClick } = props;
1624
+ const getCssClasses = () => {
1625
+ const cssClasses = [];
1626
+ cssClasses.push(styles$m.fab);
1627
+ fixed && cssClasses.push(styles$m['fixed']);
1628
+ className && cssClasses.push(className);
1629
+ return cssClasses.filter(css => css).join(' ');
1630
+ };
1631
+ const handleClick = (e) => {
1632
+ e.stopPropagation();
1633
+ onClick && onClick(e);
1634
+ };
1635
+ return (React.createElement(IconButton, { className: getCssClasses(), color: color, size: size, isActive: isActive, disabled: disabled, icon: icon, variant: VARIANT.contained, onClick: handleClick }));
1636
+ };
1637
+
1638
+ 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";
1639
+ var styles$l = {"link":"Link-module_link__YlJQl"};
1640
+ styleInject(css_248z$l);
1641
+
1642
+ const Link = (props) => {
1643
+ const { href = '#', className, target, children } = props, rest = __rest(props, ["href", "className", "target", "children"]);
1644
+ const [status, setStatus] = useState(STATUS.NORMAL);
1645
+ const getCssClasses = () => {
1646
+ const cssClasses = [];
1647
+ cssClasses.push(styles$l.link);
1648
+ className && cssClasses.push(className);
1649
+ status !== STATUS.NORMAL && cssClasses.push(status);
1650
+ return cssClasses.filter(css => css).join(' ');
1651
+ };
1652
+ const onMouseEnter = () => {
1653
+ setStatus(STATUS.HOVERED);
1654
+ };
1655
+ const onMouseLeave = () => {
1656
+ setStatus(STATUS.NORMAL);
1657
+ };
1658
+ return (React.createElement("a", Object.assign({ className: getCssClasses(), href: href, target: target, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, rest), children));
1659
+ };
1660
+
1661
+ 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";
1662
+ var styles$k = {"loadingIndicatorContainer":"LoadingIndicator-module_loadingIndicatorContainer__GS9OG","loadingIndicator":"LoadingIndicator-module_loadingIndicator__EC9sx","spinAnimation":"LoadingIndicator-module_spinAnimation__LeY4Z"};
1663
+ styleInject(css_248z$k);
1664
+
1665
+ const LoadingIndicator = (_a) => {
1666
+ var rest = __rest(_a, []);
1667
+ const getCssClasses = () => {
1668
+ const cssClasses = [];
1669
+ cssClasses.push(styles$k.loadingIndicator);
1670
+ return cssClasses.filter(css => css).join(' ');
1671
+ };
1672
+ return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest),
1673
+ React.createElement(SpinnerSolidIcon, null)));
1674
+ };
1675
+
1676
+ const LoadingIndicatorContainer = ({ children }) => {
1677
+ const getCssClasses = () => {
1678
+ const cssClasses = [];
1679
+ cssClasses.push(styles$k.loadingIndicatorContainer);
1680
+ return cssClasses.filter(css => css).join(' ');
1681
+ };
1682
+ return (React.createElement("div", { className: getCssClasses() }, children));
1683
+ };
1684
+
1685
+ class LoadingIndicatorService {
1686
+ show() {
1687
+ if (this.container) {
1688
+ this.hide();
1689
+ }
1690
+ this.container = document.createElement('div');
1691
+ this.container.classList.add('snackbar-container');
1692
+ document.body.appendChild(this.container);
1693
+ render(React.createElement(LoadingIndicatorContainer, null,
1694
+ React.createElement(LoadingIndicator, null)), this.container);
1695
+ }
1696
+ hide() {
1697
+ if (this.container) {
1698
+ unmountComponentAtNode(this.container);
1699
+ document.body.removeChild(this.container);
1700
+ this.container = undefined;
1701
+ this.handler && clearTimeout(this.handler);
1702
+ }
1703
+ }
1704
+ }
1705
+ const loadingIndicatorService = new LoadingIndicatorService();
1706
+
1707
+ 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";
1708
+ var styles$j = {"modalHeader":"ModalHeader-module_modalHeader__tw-u-","modalTitle":"ModalHeader-module_modalTitle__2xShH"};
1709
+ styleInject(css_248z$j);
1710
+
1711
+ const ModalHeader = (props) => {
1712
+ const { children, isDismissable = false, onClose } = props, rest = __rest(props, ["children", "isDismissable", "onClose"]);
1713
+ const handleClick = () => {
1714
+ onClose && onClose();
1715
+ };
1716
+ return (React.createElement("div", Object.assign({ className: styles$j.modalHeader }, rest),
1717
+ React.createElement("h5", { className: styles$j.modalTitle }, children),
1718
+ isDismissable &&
1719
+ React.createElement(IconButton, { icon: React.createElement(TimesSolidIcon, null), variant: VARIANT.text, onClick: handleClick })));
1720
+ };
1721
+
1722
+ var css_248z$i = ".ModalBody-module_modalBody__D-gk2 {\n position: relative;\n flex: 1 1 auto;\n padding: 1rem; }\n";
1723
+ var styles$i = {"modalBody":"ModalBody-module_modalBody__D-gk2"};
1724
+ styleInject(css_248z$i);
1725
+
1726
+ const ModalBody = ({ children }) => (React.createElement("div", { className: styles$i.modalBody }, children));
1727
+
1728
+ 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";
1729
+ var styles$h = {"modalFooter":"ModalFooter-module_modalFooter__SNm-f"};
1730
+ styleInject(css_248z$h);
1731
+
1732
+ const ModalFooter = ({ children }) => (React.createElement("div", { className: styles$h.modalFooter }, children));
1733
+
1734
+ 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";
1735
+ 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"};
1736
+ styleInject(css_248z$g);
1737
+
1738
+ const Modal = (props) => {
1739
+ const { className, size, fullScreen, children, header, footer, onHeaderCloseClick, onBackdropClick, isDismissable = false } = props;
1740
+ const getCssClass = () => {
1741
+ const cssClasses = [];
1742
+ cssClasses.push(styles$g.modalDialog);
1743
+ cssClasses.push(styles$g.modalDialogCentered);
1744
+ fullScreen && cssClasses.push(styles$g.fullscreen);
1745
+ size && cssClasses.push(styles$g[size]);
1746
+ className && cssClasses.push(className);
1747
+ return cssClasses.filter(r => r).join(' ');
1748
+ };
1749
+ useEffect(() => {
1750
+ document.body.classList.add('modal-open');
1751
+ return () => {
1752
+ document.body.classList.remove('modal-open');
1753
+ };
1754
+ }, []);
1755
+ const handleClickBackdrop = () => {
1756
+ onBackdropClick && onBackdropClick();
1757
+ };
1758
+ return (React.createElement(React.Fragment, null,
1759
+ React.createElement("div", { className: styles$g.modal },
1760
+ React.createElement("div", { className: getCssClass() },
1761
+ React.createElement("div", { className: styles$g.modalContent },
1762
+ header &&
1763
+ React.createElement(ModalHeader, { isDismissable: isDismissable, onClose: () => onHeaderCloseClick && onHeaderCloseClick() }, header),
1764
+ React.createElement(ModalBody, null, children),
1765
+ footer &&
1766
+ React.createElement(ModalFooter, null, footer)))),
1767
+ React.createElement(Backdrop, { onClick: handleClickBackdrop })));
1768
+ };
1769
+
1770
+ // export enum MODALRESULT { OK = 'OK', CANCEL = 'CANCEL', DELETE = 'DELETE' }
1771
+ var MODALTYPE;
1772
+ (function (MODALTYPE) {
1773
+ MODALTYPE["BASIC"] = "BASIC";
1774
+ MODALTYPE["FORM"] = "FORM";
1775
+ })(MODALTYPE || (MODALTYPE = {}));
1776
+ var MODALBUTTONTYPE;
1777
+ (function (MODALBUTTONTYPE) {
1778
+ MODALBUTTONTYPE["OK"] = "OK";
1779
+ MODALBUTTONTYPE["CANCEL"] = "CANCEL";
1780
+ MODALBUTTONTYPE["RESET"] = "RESET";
1781
+ MODALBUTTONTYPE["DEFAULT"] = "DEFAULT";
1782
+ })(MODALBUTTONTYPE || (MODALBUTTONTYPE = {}));
1783
+
1784
+ const GlobalModal = ({ title, description, formControls, onOk, onCancel, isDismissable = false, buttons = [
1785
+ { label: 'Cancel', type: MODALBUTTONTYPE.CANCEL, color: COLOR.secondary, variant: VARIANT.text, shadow: false },
1786
+ { label: 'Ok', type: MODALBUTTONTYPE.OK, variant: VARIANT.contained, focus: true },
1787
+ ], size = SIZE.md, fullScreen = false }) => {
1788
+ // workaround for getDerivedStateFromProps
1789
+ const [myControls, setMyControls] = useState(null);
1790
+ useEffect(() => {
1791
+ setMyControls(Object.assign({}, formControls));
1792
+ }, []);
1793
+ // end
1794
+ const modalType = formControls ? MODALTYPE.FORM : MODALTYPE.BASIC;
1795
+ const myForm = useRef(null);
1796
+ const handleOk = () => {
1797
+ var _a;
1798
+ if (modalType === MODALTYPE.FORM) {
1799
+ (_a = myForm === null || myForm === void 0 ? void 0 : myForm.current) === null || _a === void 0 ? void 0 : _a.handleFormSubmit();
1800
+ }
1801
+ else {
1802
+ onOk && onOk();
1803
+ }
1804
+ };
1805
+ const handleCancel = () => {
1806
+ onCancel && onCancel();
1807
+ };
1808
+ const onSubmit = (values) => {
1809
+ onOk && onOk(values);
1810
+ };
1811
+ const handleClickButton = (button) => {
1812
+ switch (button.type) {
1813
+ case MODALBUTTONTYPE.OK:
1814
+ handleOk();
1815
+ break;
1816
+ case MODALBUTTONTYPE.CANCEL:
1817
+ handleCancel();
1818
+ break;
1819
+ default:
1820
+ handleCancel();
1821
+ break;
1822
+ }
1823
+ button.handler && button.handler();
1824
+ };
1825
+ 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)))) },
1826
+ description && React.createElement("div", null, description),
1827
+ modalType === MODALTYPE.FORM &&
1828
+ React.createElement(Fragment, null,
1829
+ React.createElement(Form, { ref: myForm, controls: myControls, validateOnBlur: true, onSubmit: onSubmit }))));
1830
+ };
1831
+
1832
+ class ModalService {
1833
+ show(title, description, options) {
1834
+ return new Promise((resolve, reject) => {
1835
+ if (!this.container) {
1836
+ this.container = document.createElement('div');
1837
+ document.body.appendChild(this.container);
1838
+ const handleOk = (values) => {
1839
+ resolve(values);
1840
+ this.hide();
1841
+ };
1842
+ const handleCancel = () => {
1843
+ reject();
1844
+ this.hide();
1845
+ };
1846
+ 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);
1847
+ }
1848
+ });
1849
+ }
1850
+ hide() {
1851
+ if (this.container) {
1852
+ unmountComponentAtNode(this.container);
1853
+ document.body.removeChild(this.container);
1854
+ this.container = undefined;
1855
+ }
1856
+ }
1857
+ }
1858
+ const modalService = new ModalService();
1859
+
1860
+ const NumberSelect = (props) => {
1861
+ const { className, value = 0, from = 0, to = 100, id, name, disabled = false, onChange } = props;
1862
+ const [newValue, setNewValue] = useState(0);
1863
+ const [numberOptions, setNumberOptions] = useState();
1864
+ useEffect(() => {
1865
+ setNewValue(value);
1866
+ }, [value]);
1867
+ useEffect(() => {
1868
+ const options = [];
1869
+ for (let i = from; i <= to; i++) {
1870
+ options.push({ value: i.toString(), label: i.toString() });
1871
+ }
1872
+ setNumberOptions(options);
1873
+ }, [from, to]);
1874
+ const getCssClasses = () => {
1875
+ const cssClasses = [];
1876
+ className && cssClasses.push(className);
1877
+ return cssClasses.filter(css => css).join(' ');
1878
+ };
1879
+ const handleOnChange = (e) => {
1880
+ setNewValue(e);
1881
+ onChange && onChange(e);
1882
+ };
1883
+ return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: numberOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
1884
+ };
1885
+
1886
+ class SidebarItemModel {
1887
+ constructor(id, label, path, icon, isActive, items, isCollapsible = false, isCollapsed = false) {
1888
+ this.id = id;
1889
+ this.label = label;
1890
+ this.path = path;
1891
+ this.icon = icon;
1892
+ this.isActive = isActive;
1893
+ this.items = items;
1894
+ this.isCollapsible = isCollapsible;
1895
+ this.isCollapsed = isCollapsed;
1896
+ }
1897
+ }
1898
+
1899
+ const Sidebar = (props) => {
1900
+ const { className, items, currentUrl, onItemClicked } = props, rest = __rest(props, ["className", "items", "currentUrl", "onItemClicked"]);
1901
+ const [menuItems, setMenuItems] = useState([]);
1902
+ useEffect(() => {
1903
+ if (items && items.length > 0) {
1904
+ initMenuItems();
1905
+ }
1906
+ }, []);
1907
+ const getCssClasses = () => {
1908
+ const cssClasses = [];
1909
+ className && cssClasses.push(className);
1910
+ return cssClasses.filter(css => css).join(' ');
1911
+ };
1912
+ const initMenuItems = () => {
1913
+ 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));
1914
+ setMenuItems(newItems);
1915
+ };
1916
+ const isMenuItemActive = (path) => {
1917
+ const lastSegment = currentUrl.substring(currentUrl.lastIndexOf('/') + 1, currentUrl.length);
1918
+ let result = false;
1919
+ if (currentUrl === '/' && path === '') {
1920
+ result = true;
1921
+ }
1922
+ else if (path !== '') {
1923
+ result = lastSegment ? lastSegment.toLowerCase() === path.toLowerCase() : false;
1924
+ }
1925
+ return result;
1926
+ };
1927
+ const navigate = (e, path) => {
1928
+ e.stopPropagation();
1929
+ e.preventDefault();
1930
+ onItemClicked(path);
1931
+ };
1932
+ const handleClickItem = (item, e) => {
1933
+ if (item.items && item.items.length > 0 && item.isCollapsible) {
1934
+ const newMenuItems = menuItems.map((menuItem) => {
1935
+ if (item.id === menuItem.id) {
1936
+ menuItem.isCollapsed = !item.isCollapsed;
1937
+ }
1938
+ return menuItem;
1939
+ });
1940
+ setMenuItems(newMenuItems);
1941
+ }
1942
+ else {
1943
+ navigate(e, `/${item.path}`);
1944
+ }
1945
+ };
1946
+ const handleClickSubItem = (itemPath, subItemPath, e) => {
1947
+ navigate(e, `/${itemPath}/${subItemPath}`);
1948
+ };
1949
+ return (React.createElement("nav", Object.assign({ className: getCssClasses() }, rest),
1950
+ React.createElement(List, null, menuItems.map(item => (React.createElement(React.Fragment, { key: item.id },
1951
+ React.createElement(ListItem, { active: isMenuItemActive(item.path), onClick: (e) => handleClickItem(item, e) },
1952
+ React.createElement(ListItemText, { primary: React.createElement(React.Fragment, null,
1953
+ item.label,
1954
+ item.items && item.items.length > 0 && (React.createElement("small", { className: "ml-2" },
1955
+ "(",
1956
+ item.items.length,
1957
+ ")"))) }),
1958
+ item.items && item.items.length > 0 &&
1959
+ React.createElement(ListItemAction, null, item.isCollapsed ? React.createElement(ChevronDownSolidIcon, null) : React.createElement(ChevronUpSolidIcon, null))),
1960
+ !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)))))))))));
1961
+ };
1962
+
1963
+ 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";
1964
+ 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"};
1965
+ styleInject(css_248z$f);
1966
+
1967
+ const Snackbar = (props) => {
1968
+ const { children, color = COLOR.dark, actionText = 'ok', onOk } = props, rest = __rest(props, ["children", "color", "actionText", "onOk"]);
1969
+ const getCssClasses = () => {
1970
+ const cssClasses = [];
1971
+ cssClasses.push(styles$f.snackbar);
1972
+ cssClasses.push(`shadow-lg`);
1973
+ cssClasses.push(styles$f[color]);
1974
+ return cssClasses.filter(css => css).join(' ');
1975
+ };
1976
+ const handleClickAction = (e) => {
1977
+ onOk && onOk(e);
1978
+ };
1979
+ return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest),
1980
+ React.createElement("div", { className: styles$f.text }, children),
1981
+ React.createElement("div", { className: styles$f.action + " text-accent", onClick: handleClickAction },
1982
+ React.createElement("span", null, actionText))));
1983
+ };
1984
+
1985
+ class SnackbarService {
1986
+ show(message, options) {
1987
+ const defaultOptions = { timeout: 3000, actionText: 'ok', color: COLOR.dark, target: document.body };
1988
+ const mergedOptions = Object.assign(defaultOptions, options);
1989
+ return new Promise((resolve) => {
1990
+ if (this.container) {
1991
+ this.hide();
1992
+ }
1993
+ this.container = document.createElement('div');
1994
+ this.container.classList.add('snackbar-container');
1995
+ mergedOptions.target.appendChild(this.container);
1996
+ if (mergedOptions.timeout && mergedOptions.timeout > 0) {
1997
+ this.handler = setTimeout(() => {
1998
+ this.hide();
1999
+ }, mergedOptions.timeout);
2000
+ }
2001
+ const handleOk = () => {
2002
+ resolve();
2003
+ this.hide();
2004
+ };
2005
+ render(React.createElement(Snackbar, { color: mergedOptions.color, actionText: mergedOptions.actionText, onOk: handleOk }, message), this.container);
2006
+ });
2007
+ }
2008
+ hide() {
2009
+ if (this.container) {
2010
+ unmountComponentAtNode(this.container);
2011
+ document.body.removeChild(this.container);
2012
+ this.container = undefined;
2013
+ this.handler && clearTimeout(this.handler);
2014
+ }
2015
+ }
2016
+ }
2017
+ const snackbarService = new SnackbarService();
2018
+
2019
+ 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";
2020
+ var styles$e = {"speedDialActions":"SpeedDialActions-module_speedDialActions__cY2i3"};
2021
+ styleInject(css_248z$e);
2022
+
2023
+ const SpeedDialActions = (props) => {
2024
+ const { children } = props;
2025
+ const getCssClasses = () => {
2026
+ const cssClasses = [];
2027
+ cssClasses.push(styles$e.speedDialActions);
2028
+ return cssClasses.filter(css => css).join(' ');
2029
+ };
2030
+ return (React.createElement("div", { className: getCssClasses() }, children));
2031
+ };
2032
+
2033
+ 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";
2034
+ var styles$d = {"speedDial":"SpeedDial-module_speedDial__W3VN2"};
2035
+ styleInject(css_248z$d);
2036
+
2037
+ const SpeedDial = (props) => {
2038
+ const { children, className, open, onOpen, onClose } = props, rest = __rest(props, ["children", "className", "open", "onOpen", "onClose"]);
2039
+ const getCssClasses = () => {
2040
+ const cssClasses = [];
2041
+ cssClasses.push(styles$d.speedDial);
2042
+ className && cssClasses.push(className);
2043
+ return cssClasses.filter(css => css).join(' ');
2044
+ };
2045
+ const handleClick = (e) => {
2046
+ if (open)
2047
+ onClose && onClose(e);
2048
+ else
2049
+ onOpen && onOpen(e);
2050
+ };
2051
+ return (React.createElement("div", Object.assign({ className: getCssClasses() }, rest),
2052
+ React.createElement("div", { style: { 'transform': open ? 'rotate(45deg)' : undefined } },
2053
+ React.createElement(FloatingActionButton, { icon: React.createElement(PlusSolidIcon, null), onClick: handleClick })),
2054
+ open &&
2055
+ React.createElement(SpeedDialActions, null, children)));
2056
+ };
2057
+
2058
+ var css_248z$c = ".SpeedDialAction-module_speedDialAction__kJLpz + .SpeedDialAction-module_speedDialAction__kJLpz {\n margin-bottom: 10px; }\n";
2059
+ var styles$c = {"speedDialAction":"SpeedDialAction-module_speedDialAction__kJLpz"};
2060
+ styleInject(css_248z$c);
2061
+
2062
+ const SpeedDialAction = (props) => {
2063
+ const { icon, color = COLOR.light, onClick, className } = props;
2064
+ const getCssClasses = () => {
2065
+ const cssClasses = [];
2066
+ cssClasses.push(styles$c.speedDialAction);
2067
+ className && cssClasses.push(className);
2068
+ return cssClasses.filter(css => css).join(' ');
2069
+ };
2070
+ return (React.createElement(IconButton, { className: getCssClasses(), icon: icon, color: color, variant: VARIANT.contained, shadow: true, onClick: onClick }));
2071
+ };
2072
+
2073
+ const SpeedDialIcon = (props) => {
2074
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
2075
+ const getCssClasses = () => {
2076
+ const cssClasses = [];
2077
+ className && cssClasses.push(className);
2078
+ return cssClasses.filter(css => css).join(' ');
2079
+ };
2080
+ return (React.createElement(Icon, Object.assign({ className: getCssClasses() }, rest), children));
2081
+ };
2082
+
2083
+ var css_248z$b = ".StepperActions-module_stepperActions__hBUkh {\n display: flex; }\n";
2084
+ var styles$b = {"stepperActions":"StepperActions-module_stepperActions__hBUkh"};
2085
+ styleInject(css_248z$b);
2086
+
2087
+ const StepperActions = (props) => {
2088
+ const { className, isCompleted, isFirstStep, isStepOptional, onBack, onSkip, onNext, onReset } = props;
2089
+ const getCssClasses = () => {
2090
+ const cssClasses = [];
2091
+ cssClasses.push(styles$b.stepperActions);
2092
+ className && cssClasses.push(className);
2093
+ return cssClasses.filter(css => css).join(' ');
2094
+ };
2095
+ return (React.createElement("div", { className: getCssClasses() },
2096
+ React.createElement(Button, { className: "mr-2", variant: VARIANT.outline, disabled: isFirstStep, startIcon: !isFirstStep ? React.createElement(ChevronLeftSolidIcon, null) : undefined, onClick: () => onBack && onBack() }, "Back"),
2097
+ React.createElement("div", { className: "ml-auto" },
2098
+ isCompleted && (React.createElement(Button, { className: "mr-2", color: COLOR.secondary, variant: VARIANT.text, onClick: () => onReset && onReset() }, "Reset")),
2099
+ isStepOptional && (React.createElement(Button, { className: "mr-2", variant: VARIANT.contained, color: COLOR.primary, onClick: () => onSkip && onSkip() }, "Skip")),
2100
+ 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'))));
2101
+ };
2102
+
2103
+ const StepPanel = (props) => {
2104
+ const { children } = props;
2105
+ return (React.createElement("div", { className: "steppanel" }, children));
2106
+ };
2107
+
2108
+ 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";
2109
+ var styles$a = {"stepConnector":"StepConnector-module_stepConnector__A7A-7","stepConnectorLine":"StepConnector-module_stepConnectorLine__8rQxv","isActive":"StepConnector-module_isActive__TUIKV","stepConnectorLineHorizontal":"StepConnector-module_stepConnectorLineHorizontal__i09K0"};
2110
+ styleInject(css_248z$a);
2111
+
2112
+ const StepConnector = (props) => {
2113
+ const { isActive, isHorizontal = true } = props;
2114
+ const getCssClassesConnector = () => {
2115
+ const cssClasses = [];
2116
+ cssClasses.push(styles$a.stepConnector);
2117
+ return cssClasses.filter(css => css).join(' ');
2118
+ };
2119
+ const getCssClassesLine = () => {
2120
+ const cssClasses = [];
2121
+ cssClasses.push(styles$a.stepConnectorLine);
2122
+ isActive && cssClasses.push(styles$a['isActive']);
2123
+ isHorizontal && cssClasses.push(styles$a.stepConnectorLineHorizontal);
2124
+ return cssClasses.filter(css => css).join(' ');
2125
+ };
2126
+ return (React.createElement("div", { className: getCssClassesConnector() },
2127
+ React.createElement("div", { className: getCssClassesLine() })));
2128
+ };
2129
+
2130
+ 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";
2131
+ var styles$9 = {"stepper":"Stepper-module_stepper__V6odG","isHorizontal":"Stepper-module_isHorizontal__Q-3Wu"};
2132
+ styleInject(css_248z$9);
2133
+
2134
+ const Stepper = (props) => {
2135
+ const { children, isLinear = true, showLabel = true, showProgressCheckIcon = false, value, isHorizontal = true, onChange, onFinish } = props;
2136
+ const [steps, setSteps] = useState();
2137
+ const [activeIndex, setActiveIndex] = React.useState(0);
2138
+ const [skipped, setSkipped] = React.useState(new Set());
2139
+ useEffect(() => {
2140
+ if (children) {
2141
+ setSteps(React.Children.toArray(children));
2142
+ }
2143
+ }, [children]);
2144
+ useEffect(() => {
2145
+ if (value !== undefined) {
2146
+ setActiveIndex(value);
2147
+ }
2148
+ }, [value]);
2149
+ const isStepSkipped = (step) => {
2150
+ return skipped.has(step);
2151
+ };
2152
+ const handleClickStep = (event, newValue, index) => {
2153
+ setActiveIndex(() => {
2154
+ onChange && onChange(index);
2155
+ return index;
2156
+ });
2157
+ };
2158
+ const renderSteps = (child, index) => {
2159
+ return React.isValidElement(child) &&
2160
+ cloneElement(child, {
2161
+ index: index,
2162
+ isActive: activeIndex >= index,
2163
+ isDone: activeIndex > index,
2164
+ isDisabled: isLinear && (activeIndex + 1 < index),
2165
+ showLabel: showLabel,
2166
+ showProgressCheckIcon: showProgressCheckIcon,
2167
+ onClick: (e) => handleClickStep(e.event, e.value, index)
2168
+ });
2169
+ };
2170
+ const isStepOptional = (index) => {
2171
+ return steps && steps[index].props.isOptional;
2172
+ };
2173
+ const handleBack = () => {
2174
+ setActiveIndex((prevActiveStep) => {
2175
+ const newIndex = prevActiveStep - 1;
2176
+ onChange && onChange(newIndex);
2177
+ return newIndex;
2178
+ });
2179
+ };
2180
+ // TODO
2181
+ const handleSkip = () => {
2182
+ if (!isStepOptional(activeIndex)) {
2183
+ throw new Error("You can't skip a step that isn't optional.");
2184
+ }
2185
+ setActiveIndex((prevActiveStep) => prevActiveStep + 1);
2186
+ setSkipped((prevSkipped) => {
2187
+ const newSkipped = new Set(prevSkipped.values());
2188
+ newSkipped.add(activeIndex);
2189
+ return newSkipped;
2190
+ });
2191
+ };
2192
+ // TODO
2193
+ const handleNext = () => {
2194
+ if (!isLastStep()) {
2195
+ let newSkipped = skipped;
2196
+ if (isStepSkipped(activeIndex)) {
2197
+ newSkipped = new Set(newSkipped.values());
2198
+ newSkipped.delete(activeIndex);
2199
+ }
2200
+ setActiveIndex((prevActiveStep) => {
2201
+ const newIndex = prevActiveStep + 1;
2202
+ onChange && onChange(newIndex);
2203
+ return newIndex;
2204
+ });
2205
+ setSkipped(newSkipped);
2206
+ }
2207
+ else {
2208
+ onFinish && onFinish();
2209
+ }
2210
+ };
2211
+ const handleReset = () => {
2212
+ setActiveIndex(0);
2213
+ onChange && onChange(0);
2214
+ };
2215
+ const isLastStep = () => {
2216
+ return steps && activeIndex === steps.length - 1;
2217
+ };
2218
+ const getCssClasses = () => {
2219
+ const cssClasses = [];
2220
+ cssClasses.push(styles$9.stepper);
2221
+ isHorizontal && cssClasses.push(styles$9['isHorizontal']);
2222
+ return cssClasses.filter(css => css).join(' ');
2223
+ };
2224
+ return (React.createElement(React.Fragment, null, steps &&
2225
+ React.createElement(React.Fragment, null,
2226
+ React.createElement("div", { className: getCssClasses() }, steps.map((child, index) => (React.createElement(React.Fragment, { key: child.props.value },
2227
+ renderSteps(child, index),
2228
+ index !== steps.length - 1 && React.createElement(StepConnector, { isActive: activeIndex > index }))))),
2229
+ steps && steps.map((step, index) => React.createElement(Fragment, { key: step.props.value }, index === activeIndex &&
2230
+ React.createElement(StepPanel, null, step.props.children))),
2231
+ React.createElement(StepperActions, { className: "mt-3", isFirstStep: activeIndex === 0, isStepOptional: isStepOptional(activeIndex), isCompleted: isLastStep(), onBack: handleBack, onSkip: handleSkip, onNext: handleNext, onReset: handleReset }))));
2232
+ };
2233
+
2234
+ var css_248z$8 = ".Typography-module_typography__sw-td {\n text-overflow: ellipsis;\n font-family: var(--fontFamily); }\n\nh1 {\n font-size: calc(1.375rem + 1.5vw); }\n\nh2 {\n font-size: calc(1.325rem + 0.9vw); }\n\nh3 {\n font-size: calc(1.3rem + 0.6vw); }\n\nh4 {\n font-size: calc(1.275rem + 0.3vw); }\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";
2235
+ var styles$8 = {"typography":"Typography-module_typography__sw-td"};
2236
+ styleInject(css_248z$8);
2237
+
2238
+ const Wrapper = (props) => {
2239
+ const { as = 'span', children, className } = props, rest = __rest(props, ["as", "children", "className"]);
2240
+ const getCssClasses = () => {
2241
+ const cssClasses = [];
2242
+ cssClasses.push(styles$8.typography);
2243
+ cssClasses.push(styles$8.as);
2244
+ className && cssClasses.push(className);
2245
+ return cssClasses.filter(css => css).join(' ');
2246
+ };
2247
+ return React.createElement(as, Object.assign(Object.assign({}, rest), { className: getCssClasses() }), children);
2248
+ };
2249
+ const Typography = (_a) => {
2250
+ var { children, as = 'span' } = _a, rest = __rest(_a, ["children", "as"]);
2251
+ return (React.createElement(Wrapper, Object.assign({ as: as }, rest), children));
2252
+ };
2253
+
2254
+ 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";
2255
+ 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"};
2256
+ styleInject(css_248z$7);
2257
+
2258
+ const Step = (props) => {
2259
+ const { className, label, showLabel, index, value, isActive, isDone, isDisabled, showProgressCheckIcon, onClick } = props;
2260
+ const [hoverRef, isHovered] = useHover();
2261
+ const handleClick = (event) => {
2262
+ if (!isDisabled) {
2263
+ onClick && onClick({ event, value });
2264
+ }
2265
+ };
2266
+ const getCssClasses = () => {
2267
+ const cssClasses = [];
2268
+ cssClasses.push(styles$7.stepWrapper);
2269
+ label && showLabel && cssClasses.push(styles$7['hasLabel']);
2270
+ isDisabled && cssClasses.push(styles$7['disabled']);
2271
+ className && cssClasses.push(className);
2272
+ return cssClasses.filter(css => css).join(' ');
2273
+ };
2274
+ const getCssClassesStep = () => {
2275
+ const cssClasses = [];
2276
+ cssClasses.push(styles$7.step);
2277
+ label && showLabel && cssClasses.push(styles$7['hasLabel']);
2278
+ isDisabled && cssClasses.push(styles$7['disabled']);
2279
+ return cssClasses.filter(css => css).join(' ');
2280
+ };
2281
+ const getCssClassesStepValue = () => {
2282
+ const cssClasses = [];
2283
+ cssClasses.push(styles$7.stepValue);
2284
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2285
+ isActive && cssClasses.push(styles$7.stepValue['isActive']);
2286
+ return cssClasses.filter(css => css).join(' ');
2287
+ };
2288
+ return (React.createElement("div", { ref: hoverRef, className: getCssClasses(), onClick: handleClick },
2289
+ React.createElement("div", { className: getCssClassesStep() },
2290
+ React.createElement(Icon, { className: styles$7.stepIconCircle, iconColor: (isHovered || isActive) && !isDisabled ? COLOR.primary : COLOR.secondary },
2291
+ React.createElement(CircleSolidIcon, null)),
2292
+ React.createElement("div", { className: getCssClassesStepValue() }, showProgressCheckIcon && isActive && isDone ?
2293
+ React.createElement(Icon, null,
2294
+ React.createElement(CheckSolidIcon, null))
2295
+ :
2296
+ React.createElement(Typography, null, index + 1))),
2297
+ label && showLabel &&
2298
+ React.createElement(Typography, { className: "flex-shrink-0" }, label)));
2299
+ };
2300
+
2301
+ 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";
2302
+ 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"};
2303
+ styleInject(css_248z$6);
2304
+
2305
+ const Table = (props) => {
2306
+ const { children, className, bordered, striped, hover, responsive = false } = props;
2307
+ const getCssClasses = () => {
2308
+ const cssClasses = [];
2309
+ cssClasses.push(styles$6.table);
2310
+ bordered && cssClasses.push(styles$6['bordered']);
2311
+ striped && cssClasses.push(styles$6['striped']);
2312
+ hover && cssClasses.push(styles$6['hover']);
2313
+ className && cssClasses.push(className);
2314
+ return cssClasses.filter(css => css).join(' ');
2315
+ };
2316
+ return (React.createElement(ConditionalWrapper, { condition: responsive, wrapper: children => React.createElement("div", { className: styles$6.tableResponsive }, children) },
2317
+ React.createElement("table", { className: getCssClasses() }, children)));
2318
+ };
2319
+
2320
+ 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";
2321
+ var styles$5 = {"tabIndicator":"TabIndicator-module_tabIndicator__jSJhH","primary":"TabIndicator-module_primary__Q5jEo","accent":"TabIndicator-module_accent__qbgIG"};
2322
+ styleInject(css_248z$5);
2323
+
2324
+ const TabIndicator = (props) => {
2325
+ const { color = COLOR.accent, width, amount, index } = props;
2326
+ const getCssClasses = () => {
2327
+ const cssClasses = [];
2328
+ cssClasses.push(styles$5.tabIndicator);
2329
+ cssClasses.push(styles$5[color]);
2330
+ return cssClasses.filter(css => css).join(' ');
2331
+ };
2332
+ return (React.createElement("span", { className: getCssClasses(), style: {
2333
+ width: width,
2334
+ left: `calc(calc(100% / ${amount}) * ${index})`
2335
+ } }));
2336
+ };
2337
+
2338
+ var css_248z$4 = ".Tabs-module_tabs__YyRTZ {\n display: flex;\n position: relative; }\n";
2339
+ var styles$4 = {"tabs":"Tabs-module_tabs__YyRTZ"};
2340
+ styleInject(css_248z$4);
2341
+
2342
+ const Tabs = (props) => {
2343
+ const { children, className, fixed, indicatorColor, onChange, value } = props;
2344
+ const [selectedValue, setSelectedValue] = useState(value);
2345
+ const [selectedIndex, setSelectedIndex] = useState();
2346
+ useEffect(() => {
2347
+ React.Children.toArray(children).forEach((child, index) => {
2348
+ if (child.props.value === value) {
2349
+ setSelectedIndex(index);
2350
+ }
2351
+ });
2352
+ }, [children, value]);
2353
+ const getCssClasses = () => {
2354
+ const cssClasses = [];
2355
+ cssClasses.push(styles$4.tabs);
2356
+ className && cssClasses.push(className);
2357
+ return cssClasses.filter(css => css).join(' ');
2358
+ };
2359
+ const handleClickTab = (event, newValue, index) => {
2360
+ setSelectedValue(newValue);
2361
+ setSelectedIndex(index);
2362
+ onChange && onChange({ event, newValue });
2363
+ };
2364
+ const renderTabs = (child, index) => {
2365
+ return React.isValidElement(child) && cloneElement(child, {
2366
+ key: child.props.value,
2367
+ isActive: child.props.value === selectedValue,
2368
+ fixed: fixed,
2369
+ onClick: (e) => handleClickTab(e.event, e.value, index),
2370
+ });
2371
+ };
2372
+ return (React.createElement(React.Fragment, null,
2373
+ React.createElement("div", { className: getCssClasses() },
2374
+ children && React.Children.toArray(children).map((child, index) => renderTabs(child, index)),
2375
+ children &&
2376
+ React.createElement(TabIndicator, { color: indicatorColor, width: (100 / React.Children.toArray(children).length) + '%', index: selectedIndex, amount: React.Children.toArray(children).length }))));
2377
+ };
2378
+
2379
+ 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";
2380
+ var styles$3 = {"tab":"Tab-module_tab__Q8w1f"};
2381
+ styleInject(css_248z$3);
2382
+
2383
+ const Tab = (props) => {
2384
+ const { label, className, isActive, disabled, value, onClick } = props;
2385
+ const getCssClasses = () => {
2386
+ const cssClasses = [];
2387
+ cssClasses.push(styles$3.tab);
2388
+ if (isActive) {
2389
+ cssClasses.push(`show active`);
2390
+ }
2391
+ className && cssClasses.push(className);
2392
+ return cssClasses.filter(css => css).join(' ');
2393
+ };
2394
+ return (React.createElement(Button, { className: getCssClasses(), onClick: (event) => onClick && onClick({ event, value }), isActive: isActive, disabled: disabled }, label));
2395
+ };
2396
+
2397
+ const TabPanel = (props) => {
2398
+ const { children, value, index } = props, rest = __rest(props, ["children", "value", "index"]);
2399
+ return (React.createElement("div", Object.assign({ role: "tabpanel", hidden: value !== index, id: `tabpanel-${index}`, "aria-labelledby": `wrapped-tab-${index}` }, rest), value === index && children));
2400
+ };
2401
+
2402
+ 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";
2403
+ var styles$2 = {"tooltipContainer":"Tooltip-module_tooltipContainer__9ZWx3","tooltip":"Tooltip-module_tooltip__x5HOu","arrow":"Tooltip-module_arrow__B6lfe"};
2404
+ styleInject(css_248z$2);
2405
+
2406
+ const Tooltip = (props) => {
2407
+ const { children, text, placement = 'bottom' } = props;
2408
+ const [show, setShow] = useState(false);
2409
+ const refChild = useRef();
2410
+ const refTooltip = useRef();
2411
+ useEffect(() => {
2412
+ if (show === true && refChild && refChild.current && refTooltip && refTooltip.current) {
2413
+ // TODO - extract to own component?
2414
+ createPopper(refChild.current, refTooltip.current, {
2415
+ placement: placement,
2416
+ modifiers: [
2417
+ {
2418
+ name: 'offset',
2419
+ options: { offset: [0, 8] }
2420
+ },
2421
+ ]
2422
+ });
2423
+ }
2424
+ }, [show]);
2425
+ const handleMouseOver = () => {
2426
+ setShow(true);
2427
+ };
2428
+ const handleMouseLeave = () => {
2429
+ setShow(false);
2430
+ };
2431
+ return (React.createElement(React.Fragment, null,
2432
+ React.createElement("div", { className: styles$2.tooltipContainer, ref: refChild, id: "tooltip-container" }, cloneElement(children, {
2433
+ onMouseOver: handleMouseOver,
2434
+ onMouseLeave: handleMouseLeave,
2435
+ })),
2436
+ show &&
2437
+ React.createElement("div", { className: styles$2.tooltip, ref: refTooltip, id: "tooltip" },
2438
+ text,
2439
+ React.createElement("div", { id: "arrow", "data-popper-arrow": true }))));
2440
+ };
2441
+
2442
+ const HourSelect = (props) => {
2443
+ const { className, value = 0, id, name, disabled, onChange } = props;
2444
+ const [newValue, setNewValue] = useState(value);
2445
+ const [hourOptions, setHourOptions] = useState();
2446
+ useEffect(() => {
2447
+ const newHourOptions = [];
2448
+ for (let i = 0; i < 24; i++) {
2449
+ newHourOptions.push({ value: i.toString(), label: i.toString() });
2450
+ }
2451
+ setHourOptions(newHourOptions);
2452
+ }, []);
2453
+ const getCssClasses = () => {
2454
+ const cssClasses = [];
2455
+ className && cssClasses.push(className);
2456
+ return cssClasses.filter(css => css).join(' ');
2457
+ };
2458
+ const handleOnChange = (e) => {
2459
+ setNewValue(e);
2460
+ onChange && onChange(e);
2461
+ };
2462
+ return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: hourOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
2463
+ };
2464
+
2465
+ const MilliSecondSelect = (props) => {
2466
+ const { className, value = 0, steps = 100, id, name, disabled, onChange } = props;
2467
+ const [newValue, setNewValue] = useState(value);
2468
+ const [milliSecondOptions, setMilliSecondOptions] = useState();
2469
+ useEffect(() => {
2470
+ const newMilliSecondOptions = [];
2471
+ for (let i = 0; i < 1000; i += steps) {
2472
+ newMilliSecondOptions.push({ value: i.toString(), label: i.toString() });
2473
+ }
2474
+ setMilliSecondOptions(newMilliSecondOptions);
2475
+ }, []);
2476
+ const getCssClasses = () => {
2477
+ const cssClasses = [];
2478
+ className && cssClasses.push(className);
2479
+ return cssClasses.filter(css => css).join(' ');
2480
+ };
2481
+ const handleOnChange = (e) => {
2482
+ setNewValue(e);
2483
+ onChange && onChange(e);
2484
+ };
2485
+ return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: milliSecondOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
2486
+ };
2487
+
2488
+ const MinuteSelect = (props) => {
2489
+ const { className, value = 0, id, name, disabled, onChange } = props;
2490
+ const [newValue, setNewValue] = useState(value);
2491
+ const [minuteOptions, setMinuteOptions] = useState();
2492
+ useEffect(() => {
2493
+ const newMinuteOptions = [];
2494
+ for (let i = 0; i < 60; i++) {
2495
+ newMinuteOptions.push({ value: i.toString(), label: i.toString() });
2496
+ }
2497
+ setMinuteOptions(newMinuteOptions);
2498
+ }, []);
2499
+ const getCssClasses = () => {
2500
+ const cssClasses = [];
2501
+ className && cssClasses.push(className);
2502
+ return cssClasses.filter(css => css).join(' ');
2503
+ };
2504
+ const handleOnChange = (e) => {
2505
+ setNewValue(e);
2506
+ onChange && onChange(e);
2507
+ };
2508
+ return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: minuteOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
2509
+ };
2510
+
2511
+ const SecondSelect = (props) => {
2512
+ const { className, value = 0, id, name, disabled, onChange } = props;
2513
+ const [newValue, setNewValue] = useState(value);
2514
+ const [secondOptions, setSecondOptions] = useState();
2515
+ useEffect(() => {
2516
+ const newSecondOptions = [];
2517
+ for (let i = 0; i < 60; i++) {
2518
+ newSecondOptions.push({ value: i.toString(), label: i.toString() });
2519
+ }
2520
+ setSecondOptions(newSecondOptions);
2521
+ }, []);
2522
+ const getCssClasses = () => {
2523
+ const cssClasses = [];
2524
+ className && cssClasses.push(className);
2525
+ return cssClasses.filter(css => css).join(' ');
2526
+ };
2527
+ const handleOnChange = (e) => {
2528
+ setNewValue(e);
2529
+ onChange && onChange(e);
2530
+ };
2531
+ return (React.createElement(Select, { id: id, name: name, className: getCssClasses(), options: secondOptions, onChange: (e) => handleOnChange(parseInt(e)), disabled: disabled, value: newValue.toString() }));
2532
+ };
2533
+
2534
+ var TIMEMODE;
2535
+ (function (TIMEMODE) {
2536
+ TIMEMODE[TIMEMODE["HOUR"] = 0] = "HOUR";
2537
+ TIMEMODE[TIMEMODE["MINUTE"] = 1] = "MINUTE";
2538
+ TIMEMODE[TIMEMODE["SECONDS"] = 2] = "SECONDS";
2539
+ TIMEMODE[TIMEMODE["MILLISECONDS"] = 3] = "MILLISECONDS";
2540
+ })(TIMEMODE || (TIMEMODE = {}));
2541
+ const TimeSelect = (props) => {
2542
+ const { className, value = new Date(), disabled, showHours = true, showMinutes = true, showSeconds = false, showMilliSeconds = false, onChange } = props;
2543
+ const [currDate, setCurrDate] = useState(value);
2544
+ const getCssClasses = () => {
2545
+ const cssClasses = [];
2546
+ cssClasses.push('row');
2547
+ className && cssClasses.push(className);
2548
+ return cssClasses.filter(css => css).join(' ');
2549
+ };
2550
+ const handleOnChange = (e, mode) => {
2551
+ const currYear = currDate.getFullYear();
2552
+ const currMonth = currDate.getMonth();
2553
+ const currday = currDate.getDate();
2554
+ const currHour = mode === TIMEMODE.HOUR ? e : currDate.getHours();
2555
+ const currMinute = mode === TIMEMODE.MINUTE ? e : currDate.getMinutes();
2556
+ const currSeconds = mode === TIMEMODE.SECONDS ? e : currDate.getSeconds();
2557
+ const currMilliSeconds = mode === TIMEMODE.MILLISECONDS ? e : currDate.getMilliseconds();
2558
+ const newDate = new Date(currYear, currMonth, currday, currHour, currMinute, currSeconds, currMilliSeconds);
2559
+ setCurrDate(newDate);
2560
+ onChange && onChange(newDate);
2561
+ };
2562
+ return (React.createElement(Row, { className: getCssClasses() },
2563
+ showHours &&
2564
+ React.createElement(Column, null,
2565
+ React.createElement(FormLabel, null, "Hours"),
2566
+ React.createElement(HourSelect, { value: currDate.getHours(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.HOUR) })),
2567
+ showMinutes &&
2568
+ React.createElement(Column, null,
2569
+ React.createElement(FormLabel, null, "Minutes"),
2570
+ React.createElement(MinuteSelect, { value: currDate.getMinutes(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.MINUTE) })),
2571
+ showSeconds &&
2572
+ React.createElement(Column, null,
2573
+ React.createElement(FormLabel, null, "Seconds"),
2574
+ React.createElement(SecondSelect, { value: currDate.getSeconds(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.SECONDS) })),
2575
+ showMilliSeconds &&
2576
+ React.createElement(Column, null,
2577
+ React.createElement(FormLabel, null, "Milliseconds"),
2578
+ React.createElement(MilliSecondSelect, { value: currDate.getMilliseconds(), disabled: disabled, onChange: e => handleOnChange(e, TIMEMODE.MILLISECONDS) }))));
2579
+ };
2580
+
2581
+ 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";
2582
+ var styles$1 = {"treeView":"TreeView-module_treeView__VVj-4"};
2583
+ styleInject(css_248z$1);
2584
+
2585
+ const TreeView = (props) => {
2586
+ const { children, className } = props, rest = __rest(props, ["children", "className"]);
2587
+ const getCssClasses = () => {
2588
+ const cssClasses = [];
2589
+ cssClasses.push(styles$1.treeView);
2590
+ className && cssClasses.push(className);
2591
+ return cssClasses.filter(css => css).join(' ');
2592
+ };
2593
+ return (React.createElement("ul", Object.assign({ className: getCssClasses() }, rest), children));
2594
+ };
2595
+
2596
+ var css_248z = ".TreeItem-module_treeItem__Mxsjr {\n display: flex;\n flex-direction: column;\n min-height: 48px;\n justify-content: center; }\n";
2597
+ var styles = {"treeItem":"TreeItem-module_treeItem__Mxsjr"};
2598
+ styleInject(css_248z);
2599
+
2600
+ const TreeItem = (props) => {
2601
+ const { nodeId, label, children, className, isExpanded, isSelected, isSelectable, onToggleExpand, onItemSelect } = props;
2602
+ const [_isExpanded, setIsExpanded] = useState(false);
2603
+ const [_isSelected, setIsSelected] = useState(false);
2604
+ const getCssClasses = () => {
2605
+ const cssClasses = [];
2606
+ cssClasses.push(styles.treeItem);
2607
+ className && cssClasses.push(className);
2608
+ return cssClasses.filter(css => css).join(' ');
2609
+ };
2610
+ useEffect(() => {
2611
+ if (isExpanded !== undefined)
2612
+ setIsExpanded(isExpanded);
2613
+ }, [isExpanded]);
2614
+ useEffect(() => {
2615
+ if (isSelected !== undefined)
2616
+ setIsSelected(isSelected);
2617
+ }, [isSelected]);
2618
+ const handleOnToggleExpand = (nodeId) => {
2619
+ setIsExpanded(!_isExpanded);
2620
+ onToggleExpand && onToggleExpand(nodeId);
2621
+ };
2622
+ const handleOnSelect = (nodeId) => {
2623
+ setIsSelected(!_isSelected);
2624
+ onItemSelect && onItemSelect({ id: nodeId, isSelected: !_isSelected });
2625
+ };
2626
+ return (React.createElement("li", { className: getCssClasses(), style: { paddingLeft: `${(48 * (children ? 0 : 1))}px` } },
2627
+ React.createElement("div", { className: "d-flex align-items-center" },
2628
+ children &&
2629
+ React.createElement(IconButton, { onClick: () => handleOnToggleExpand(nodeId), icon: !_isExpanded ? React.createElement(ChevronRightSolidIcon, null) : React.createElement(ChevronDownSolidIcon, null) }),
2630
+ isSelectable &&
2631
+ React.createElement(Checkbox, { checked: _isSelected, onChange: () => handleOnSelect(nodeId) }),
2632
+ label),
2633
+ children && _isExpanded ? React.createElement("ul", null, children) : null));
2634
+ };
2635
+
2636
+ 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 };