react-asc 19.0.6 → 20.2.0

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