@cashub/ui-elv 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/chart/BarChart.js +8 -2
  2. package/chart/DoughnutChart.js +2 -1
  3. package/chart/LineChart.js +2 -1
  4. package/chart/utils/customTooltip.js +3 -7
  5. package/chart/utils/customTooltipLifecyclePlugin.js +21 -0
  6. package/chart/utils/tooltipElement.js +25 -0
  7. package/chart/utils/xAxisLabelTooltipPlugin.js +107 -0
  8. package/datetimePicker/index.js +2 -37
  9. package/esm/Tab/Tab.js +21 -0
  10. package/esm/Tab/TabList.js +160 -0
  11. package/esm/Tab/TabPanel.js +42 -0
  12. package/esm/Tab/TabTab.js +98 -0
  13. package/esm/Tab/index.js +23 -0
  14. package/esm/Tab/subComponent/TabContext.js +3 -0
  15. package/esm/Tab/subComponent/TabListV2.js +18 -0
  16. package/esm/Tab/subComponent/TabPanelV2.js +45 -0
  17. package/esm/Tab/subComponent/TabTabV2.js +56 -0
  18. package/esm/VerticalTab/TabList.js +20 -0
  19. package/esm/VerticalTab/TabPanel.js +45 -0
  20. package/esm/VerticalTab/TabTab.js +63 -0
  21. package/esm/VerticalTab/VerticalTab.js +34 -0
  22. package/esm/VerticalTab/index.js +9 -0
  23. package/esm/VerticalTab/subComponent/TabContext.js +3 -0
  24. package/esm/alert/Alert.js +22 -0
  25. package/esm/alert/index.js +1 -0
  26. package/esm/animate/Collapse.js +65 -0
  27. package/esm/animate/Loader.js +51 -0
  28. package/esm/animate/NumberCounter.js +45 -0
  29. package/esm/animate/PulseRing.js +26 -0
  30. package/esm/animate/Spinner.js +11 -0
  31. package/esm/animate/index.js +5 -0
  32. package/esm/assets/css/autocomplete.css +16 -0
  33. package/esm/assets/css/font.css +4 -0
  34. package/esm/assets/css/global.css +2 -0
  35. package/esm/assets/font/helvetica/Helvetica.ttf +0 -0
  36. package/esm/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
  37. package/esm/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
  38. package/esm/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
  39. package/esm/assets/icons/app-management.png +0 -0
  40. package/esm/assets/icons/burger-black.png +0 -0
  41. package/esm/assets/icons/burger-white.png +0 -0
  42. package/esm/assets/icons/burger.png +0 -0
  43. package/esm/assets/icons/file.svg +1 -0
  44. package/esm/assets/icons/map_icon1.png +0 -0
  45. package/esm/assets/icons/map_icon4.png +0 -0
  46. package/esm/assets/images/bg-aside.png +0 -0
  47. package/esm/assets/images/bg-chart-circle.png +0 -0
  48. package/esm/assets/images/bg-chart-triangle.png +0 -0
  49. package/esm/assets/images/cashub-logo-only.png +0 -0
  50. package/esm/assets/images/default-user.jpg +0 -0
  51. package/esm/assets/images/logo-cashub.png +0 -0
  52. package/esm/assets/images/map.png +0 -0
  53. package/esm/assets/images/qrcode.png +0 -0
  54. package/esm/backdrop/BaseBackdrop.js +11 -0
  55. package/esm/backdrop/LoadingBackdrop.js +10 -0
  56. package/esm/backdrop/ModalBackdrop.js +8 -0
  57. package/esm/backdrop/index.js +3 -0
  58. package/esm/badge/Badge.js +19 -0
  59. package/esm/badge/BadgeDot.js +11 -0
  60. package/esm/badge/BadgeFill.js +42 -0
  61. package/esm/badge/BadgeFillTriangle.js +138 -0
  62. package/esm/badge/BadgeWithText.js +24 -0
  63. package/esm/badge/index.js +5 -0
  64. package/esm/billing/BarChart.js +45 -0
  65. package/esm/billing/Grid.js +38 -0
  66. package/esm/billing/Header2.js +19 -0
  67. package/esm/billing/Header3.js +31 -0
  68. package/esm/billing/Paragraph.js +27 -0
  69. package/esm/billing/ParagraphGroup.js +16 -0
  70. package/esm/billing/ParagraphText.js +20 -0
  71. package/esm/billing/Section.js +44 -0
  72. package/esm/billing/SectionBody.js +11 -0
  73. package/esm/billing/SectionHeader.js +20 -0
  74. package/esm/billing/__stories__/BarChart.stories.js_bak +46 -0
  75. package/esm/billing/__stories__/Grid.stories.js_bak +57 -0
  76. package/esm/billing/__stories__/Header2.stories.js_bak +62 -0
  77. package/esm/billing/__stories__/Header3.stories.js_bak +69 -0
  78. package/esm/billing/__stories__/Paragraph.stories.js_bak +84 -0
  79. package/esm/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
  80. package/esm/billing/__stories__/ParagraphText.stories.js_bak +64 -0
  81. package/esm/billing/__stories__/Section.stories.js_bak +115 -0
  82. package/esm/billing/__stories__/SectionBody.stories.js_bak +62 -0
  83. package/esm/billing/__stories__/SectionHeader.stories.js-bak +68 -0
  84. package/esm/breadcrumb/Breadcrumb.js +71 -0
  85. package/esm/breadcrumb/index.js +1 -0
  86. package/esm/button/Button.js +145 -0
  87. package/esm/button/ButtonGroup.js +54 -0
  88. package/esm/button/IconButton.js +64 -0
  89. package/esm/button/ScrollToTopButton.js +47 -0
  90. package/esm/button/index.js +4 -0
  91. package/esm/callout/Callout.js +45 -0
  92. package/esm/callout/index.js +1 -0
  93. package/esm/chart/BarChart.js +147 -0
  94. package/esm/chart/DoughnutChart.js +110 -0
  95. package/esm/chart/LineChart.js +140 -0
  96. package/esm/chart/SingleBarChart.js +35 -0
  97. package/esm/chart/index.js +5 -0
  98. package/esm/chart/utils/centerTextPlugin.js +56 -0
  99. package/esm/chart/utils/customTooltip.js +84 -0
  100. package/esm/chart/utils/customTooltipLifecyclePlugin.js +16 -0
  101. package/esm/chart/utils/htmlLegendPlugin.js +83 -0
  102. package/esm/chart/utils/index.js +3 -0
  103. package/esm/chart/utils/padEmptyChartBar.js +47 -0
  104. package/esm/chart/utils/tooltipElement.js +17 -0
  105. package/esm/chart/utils/xAxisLabelTooltipPlugin.js +101 -0
  106. package/esm/chart/utils/yAxisTopTitlePlugin.js +43 -0
  107. package/esm/container/FlexContainer.js +33 -0
  108. package/esm/container/index.js +1 -0
  109. package/esm/cropper/Cropper.js +47 -0
  110. package/esm/cropper/CropperModalHandler.js +34 -0
  111. package/esm/cropper/index.js +2 -0
  112. package/esm/cropper/subComponent/CropImageModal.js +72 -0
  113. package/{datetimePicker/DatetimePicker.js → esm/datetimePicker/DatetimePickerV3.js} +63 -31
  114. package/esm/datetimePicker/TimeInput.js +49 -0
  115. package/esm/datetimePicker/TimePickerStyle.js +58 -0
  116. package/esm/datetimePicker/TimePickerV2.js +199 -0
  117. package/esm/datetimePicker/accordion/Month.js +245 -0
  118. package/esm/datetimePicker/accordion/Year.js +275 -0
  119. package/esm/datetimePicker/index.js +4 -0
  120. package/esm/datetimePicker/provider/constant.js +38 -0
  121. package/esm/datetimePicker/subComponent/DateTimePickerContext.js +3 -0
  122. package/esm/datetimePicker/utils/GMTDate.js +9 -0
  123. package/esm/datetimePicker/utils/pad.js +7 -0
  124. package/esm/datetimePicker/utils/toUTC0.js +7 -0
  125. package/esm/descriptionList/DescriptionDetail.js +21 -0
  126. package/esm/descriptionList/DescriptionList.js +18 -0
  127. package/esm/descriptionList/DescriptionTerm.js +7 -0
  128. package/esm/descriptionList/index.js +3 -0
  129. package/esm/divider/Divider.js +24 -0
  130. package/esm/divider/index.js +1 -0
  131. package/esm/dropdown/Dropdown.js +48 -0
  132. package/esm/dropdown/DropdownButtonOption.js +36 -0
  133. package/esm/dropdown/DropdownContent.js +83 -0
  134. package/esm/dropdown/DropdownDivOption.js +19 -0
  135. package/esm/dropdown/DropdownItem.js +19 -0
  136. package/esm/dropdown/DropdownLinkOption.js +17 -0
  137. package/esm/dropdown/DropdownToggle.js +31 -0
  138. package/esm/dropdown/index.js +11 -0
  139. package/esm/dropdown/subComponent/DropdownContext.js +3 -0
  140. package/esm/dropzone/FileDropzone.js +472 -0
  141. package/esm/dropzone/ImageDropzone.js +327 -0
  142. package/esm/dropzone/index.js +2 -0
  143. package/esm/dropzone/subComponent/Message.js +19 -0
  144. package/esm/figure/IconFigure.js +35 -0
  145. package/esm/figure/ImageFigure.js +31 -0
  146. package/esm/figure/index.js +2 -0
  147. package/esm/file/HiddenFileInput.js +8 -0
  148. package/esm/file/index.js +1 -0
  149. package/esm/form/Checkbox.js +157 -0
  150. package/esm/form/Fieldset.js +11 -0
  151. package/esm/form/FormItem.js +15 -0
  152. package/esm/form/Input.js +59 -0
  153. package/esm/form/Label.js +54 -0
  154. package/esm/form/MutedText.js +14 -0
  155. package/esm/form/PasswordInput.js +40 -0
  156. package/esm/form/RadioButton.js +94 -0
  157. package/esm/form/SearchSelect.js +174 -0
  158. package/esm/form/Searchbox.js +91 -0
  159. package/esm/form/Slider.js +39 -0
  160. package/esm/form/SwitchButton.js +97 -0
  161. package/esm/form/Textarea.js +34 -0
  162. package/esm/form/TreeView.js +66 -0
  163. package/esm/form/index.js +14 -0
  164. package/esm/grid/Column.js +39 -0
  165. package/esm/grid/Grid.js +28 -0
  166. package/esm/grid/index.js +2 -0
  167. package/esm/heading/Heading1.js +14 -0
  168. package/esm/heading/Heading2.js +21 -0
  169. package/esm/heading/Heading3.js +42 -0
  170. package/esm/heading/index.js +3 -0
  171. package/esm/helmet/Helmet.js +17 -0
  172. package/esm/helmet/index.js +2 -0
  173. package/esm/iconbox/ApplicationIconBox.js +74 -0
  174. package/esm/iconbox/IconBox.js +60 -0
  175. package/esm/iconbox/IconBoxV2.js +63 -0
  176. package/esm/iconbox/index.js +3 -0
  177. package/esm/iconbox/subComponent/IconBoxFigure.js +43 -0
  178. package/esm/iconbox/subComponent/IconBoxImage.js +35 -0
  179. package/esm/image/ImageFluid.js +10 -0
  180. package/esm/image/UploadImage.js +243 -0
  181. package/esm/image/index.js +2 -0
  182. package/esm/index.js +47 -0
  183. package/esm/keyframe/Pulse.js +15 -0
  184. package/esm/keyframe/Spin.js +7 -0
  185. package/esm/layout/Aside.js +39 -0
  186. package/esm/layout/AsideHeader.jsx +27 -0
  187. package/esm/layout/Backdrop.js +16 -0
  188. package/esm/layout/Container.js +30 -0
  189. package/esm/layout/Footer.js +36 -0
  190. package/esm/layout/Header.jsx +55 -0
  191. package/esm/layout/Layout.jsx +84 -0
  192. package/esm/layout/Logo.jsx +17 -0
  193. package/esm/layout/MenuIcon.jsx +27 -0
  194. package/esm/layout/Sidebar.jsx +271 -0
  195. package/esm/layout/index.js +1 -0
  196. package/esm/link/LinkSpan.js +62 -0
  197. package/esm/link/index.js +1 -0
  198. package/esm/map/GoogleMap.js +439 -0
  199. package/esm/map/GoogleReverseGeolocation.js +193 -0
  200. package/esm/map/LeafletMap.js +224 -0
  201. package/esm/map/LeafletReverseGeolocation.js +94 -0
  202. package/esm/map/index.js +4 -0
  203. package/esm/map/subComponent/BasicLeafletMap.js +27 -0
  204. package/esm/map/subComponent/GoogleMapContainer.js +22 -0
  205. package/esm/map/subComponent/GoogleMapPopup.js +103 -0
  206. package/esm/map/subComponent/GoogleMapWrapper.js +34 -0
  207. package/esm/map/subComponent/LeafletDrawControl.js +116 -0
  208. package/esm/map/subComponent/LeafletMapContainer.js +166 -0
  209. package/esm/map/subComponent/MapSearchBoxControl.js +47 -0
  210. package/esm/modal/StateModal.js +169 -0
  211. package/esm/modal/TitleModal.js +241 -0
  212. package/esm/modal/index.js +2 -0
  213. package/esm/page/Disclaimer.js +121 -0
  214. package/esm/page/index.js +1 -0
  215. package/esm/paginate/Paginate.js +129 -0
  216. package/esm/paginate/index.js +1 -0
  217. package/esm/popover/Popover.js +82 -0
  218. package/esm/popover/index.js +1 -0
  219. package/esm/qrcode/QRCode.js +51 -0
  220. package/esm/qrcode/QRCodeContainter.js +27 -0
  221. package/esm/qrcode/index.js +2 -0
  222. package/esm/ribbon/Ribbon.js +35 -0
  223. package/esm/ribbon/index.js +1 -0
  224. package/esm/section/Section.js +126 -0
  225. package/esm/section/SectionBody.js +43 -0
  226. package/esm/section/SectionHeader.js +61 -0
  227. package/esm/section/SectionToolbar.js +11 -0
  228. package/esm/section/SectionToolbarItem.js +10 -0
  229. package/esm/section/index.js +5 -0
  230. package/esm/select/InputSelect.js +263 -0
  231. package/esm/select/Select.js +811 -0
  232. package/esm/select/index.js +2 -0
  233. package/esm/select/subComponent/Checkbox.js +40 -0
  234. package/esm/select/subComponent/Footer.js +6 -0
  235. package/esm/select/subComponent/ListBox.js +23 -0
  236. package/esm/select/subComponent/Option.js +37 -0
  237. package/esm/select/subComponent/OptionGroup.js +16 -0
  238. package/esm/select/subComponent/Options.js +25 -0
  239. package/esm/select/subComponent/SearchBox.js +51 -0
  240. package/esm/select/subComponent/SelectedMultipleCount.js +32 -0
  241. package/esm/select/subComponent/SelectedMultipleTags.js +47 -0
  242. package/esm/select/subComponent/SelectedMultipleText.js +63 -0
  243. package/esm/select/subComponent/SelectedSingle.js +10 -0
  244. package/esm/styles/GlobalStyle.js +328 -0
  245. package/esm/styles/config/breakpoint.style.js +7 -0
  246. package/esm/styles/config/header.style.js +4 -0
  247. package/esm/styles/config/sidebar.style.js +11 -0
  248. package/esm/styles/index.js +2 -0
  249. package/esm/styles/mixin/backgroundColor.js +38 -0
  250. package/esm/styles/mixin/borderColor.js +31 -0
  251. package/esm/styles/mixin/color.js +31 -0
  252. package/esm/styles/mixin/colorOnBackground.js +31 -0
  253. package/esm/styles/mixin/inputPlaceholder.js +24 -0
  254. package/esm/styles/mixin/media.js +15 -0
  255. package/esm/styles/mixin/rounded.js +24 -0
  256. package/esm/styles/mixin/scrollbar.js +26 -0
  257. package/esm/styles/theme/dark.theme.js +91 -0
  258. package/esm/styles/theme/light.theme.js +91 -0
  259. package/esm/styles/theme/white.theme.js +91 -0
  260. package/esm/styles/themes.js +9 -0
  261. package/esm/table/GridTable.js +329 -0
  262. package/esm/table/ImageBox.js +38 -0
  263. package/esm/table/InfiniteGridTable.js +396 -0
  264. package/esm/table/PermissionTable.js +57 -0
  265. package/esm/table/SimpleGridTable.js +136 -0
  266. package/esm/table/Table.js +559 -0
  267. package/esm/table/__mock__/columns.js +64 -0
  268. package/esm/table/__mock__/data.js +530 -0
  269. package/esm/table/hooks/index.js +2 -0
  270. package/esm/table/hooks/useCalculateDataRange.js +22 -0
  271. package/esm/table/hooks/useGenerateSort.js +32 -0
  272. package/esm/table/index.js +6 -0
  273. package/esm/table/subComponent/BaseTableHeadCell.js +54 -0
  274. package/esm/table/subComponent/GridTableFooter.js +17 -0
  275. package/esm/table/subComponent/GridTableHeadCell.js +13 -0
  276. package/esm/table/subComponent/Resizer.js +70 -0
  277. package/esm/table/subComponent/TableFooter.js +24 -0
  278. package/esm/table/subComponent/TableFooterInfo.js +6 -0
  279. package/esm/table/subComponent/TableFooterPager.js +26 -0
  280. package/esm/table/subComponent/TableHeadCell.js +12 -0
  281. package/esm/table/subComponent/TableSort.js +31 -0
  282. package/esm/tagify/TagifyStyle.js +54 -0
  283. package/esm/tagify/Tags.js +49 -0
  284. package/esm/tagify/index.js +3 -0
  285. package/esm/tagify/templates/getCreateButtonTemplate.js +12 -0
  286. package/esm/text/Paragraph.js +79 -0
  287. package/esm/text/index.js +1 -0
  288. package/esm/timeline/Timeline.js +132 -0
  289. package/esm/timeline/index.js +1 -0
  290. package/esm/toast/CustomToastContainer.js +38 -0
  291. package/esm/toast/MessageContainer.js +44 -0
  292. package/esm/toast/index.js +3 -0
  293. package/esm/toast/show.js +29 -0
  294. package/esm/toast/style.css +1 -0
  295. package/esm/tooltip/Tooltip.js +133 -0
  296. package/esm/tooltip/index.js +1 -0
  297. package/esm/treeView/TreeViewV2.js +32 -0
  298. package/esm/treeView/TreeflexStyle.js +43 -0
  299. package/esm/treeView/index.js +2 -0
  300. package/esm/wizard/Wizard.js +244 -0
  301. package/esm/wizard/index.js +1 -0
  302. package/index.js +0 -12
  303. package/layout/Sidebar.jsx +1 -1
  304. package/package.json +5 -4
  305. package/datetimePicker/DatePicker.js +0 -363
  306. package/datetimePicker/DatePickerV2.js +0 -407
  307. package/datetimePicker/DatetimePickerV2.js +0 -395
  308. package/datetimePicker/TimePicker.js +0 -317
  309. package/datetimePicker/hooks/index.js +0 -27
  310. package/datetimePicker/hooks/useChangeNumber.js +0 -42
  311. package/datetimePicker/hooks/useDecrease.js +0 -38
  312. package/datetimePicker/hooks/useIncrease.js +0 -38
  313. package/datetimePicker/subComponent/Accordion.js +0 -373
  314. package/datetimePicker/subComponent/CustomTimeInput.js +0 -47
  315. package/jsoneditor/JsonEditor.js +0 -142
  316. package/jsoneditor/index.js +0 -13
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "useChangeNumber", {
7
- enumerable: true,
8
- get: function () {
9
- return _useChangeNumber.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "useDecrease", {
13
- enumerable: true,
14
- get: function () {
15
- return _useDecrease.default;
16
- }
17
- });
18
- Object.defineProperty(exports, "useIncrease", {
19
- enumerable: true,
20
- get: function () {
21
- return _useIncrease.default;
22
- }
23
- });
24
- var _useIncrease = _interopRequireDefault(require("./useIncrease"));
25
- var _useDecrease = _interopRequireDefault(require("./useDecrease"));
26
- var _useChangeNumber = _interopRequireDefault(require("./useChangeNumber"));
27
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _utils = require("@cashub/utils");
9
- const useChangeNumber = (min, max, setState, name) => {
10
- return (0, _react.useCallback)(number => {
11
- let value = String(number);
12
-
13
- // update value when value is a valid value
14
- if (value.length > 0) {
15
- // if value is not a integer, then remove last char
16
- if (!(0, _utils.isInteger)(value)) {
17
- value = value.substring(0, value.length - 1);
18
- }
19
-
20
- // use min value instead when exceed minimum
21
- if (value.length >= String(min).length && value < min) {
22
- value = min;
23
- }
24
-
25
- // use max value instead when exceed maximum
26
- if (value > max) {
27
- value = max;
28
- }
29
- }
30
- setState(previous => {
31
- if (name && typeof previous === 'object') {
32
- const newState = {
33
- ...previous
34
- };
35
- newState[name] = value;
36
- return newState;
37
- }
38
- return value;
39
- });
40
- }, [min, max, setState, name]);
41
- };
42
- var _default = exports.default = useChangeNumber;
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _pad = _interopRequireDefault(require("../utils/pad"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- const useDecrease = function (min, max, setState) {
11
- let config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
12
- const {
13
- name,
14
- length,
15
- padString
16
- } = config;
17
- return (0, _react.useCallback)(() => {
18
- setState(previous => {
19
- if (name && typeof previous === 'object') {
20
- let value = parseInt(previous[name], 10) - 1;
21
- if (value < min) {
22
- value = max;
23
- }
24
- const newState = {
25
- ...previous
26
- };
27
- newState[name] = (0, _pad.default)(value, length, padString);
28
- return newState;
29
- }
30
- let value = parseInt(previous, 10) - 1;
31
- if (value < min) {
32
- value = max;
33
- }
34
- return (0, _pad.default)(value, length, padString);
35
- });
36
- }, [min, max, setState, name, length, padString]);
37
- };
38
- var _default = exports.default = useDecrease;
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _pad = _interopRequireDefault(require("../utils/pad"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- const useIncrease = function (min, max, setState) {
11
- let config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
12
- const {
13
- name,
14
- length,
15
- padString
16
- } = config;
17
- return (0, _react.useCallback)(() => {
18
- setState(previous => {
19
- if (name && typeof previous === 'object') {
20
- let value = parseInt(previous[name], 10) + 1;
21
- if (value > max) {
22
- value = min;
23
- }
24
- const newState = {
25
- ...previous
26
- };
27
- newState[name] = (0, _pad.default)(value, length, padString);
28
- return newState;
29
- }
30
- let value = parseInt(previous, 10) + 1;
31
- if (value > max) {
32
- value = min;
33
- }
34
- return (0, _pad.default)(value, length, padString);
35
- });
36
- }, [min, max, setState, name, length, padString]);
37
- };
38
- var _default = exports.default = useIncrease;
@@ -1,373 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _md = require("react-icons/md");
9
- var _io = require("react-icons/io");
10
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
- var _utils = require("@cashub/utils");
12
- var _scrollbar = _interopRequireDefault(require("../../styles/mixin/scrollbar"));
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
- const monthArr = [{
18
- number: '01',
19
- name: 'Jan'
20
- }, {
21
- number: '02',
22
- name: 'Feb'
23
- }, {
24
- number: '03',
25
- name: 'Mar'
26
- }, {
27
- number: '04',
28
- name: 'Apr'
29
- }, {
30
- number: '05',
31
- name: 'May'
32
- }, {
33
- number: '06',
34
- name: 'Jun'
35
- }, {
36
- number: '07',
37
- name: 'Jul'
38
- }, {
39
- number: '08',
40
- name: 'Aug'
41
- }, {
42
- number: '09',
43
- name: 'Sep'
44
- }, {
45
- number: '10',
46
- name: 'Oct'
47
- }, {
48
- number: '11',
49
- name: 'Nov'
50
- }, {
51
- number: '12',
52
- name: 'Dec'
53
- }];
54
- const Accordion = _ref => {
55
- let {
56
- type,
57
- handleDisplayAccordionContent,
58
- handleChangeTitle,
59
- setCurrentDisplayType,
60
- currentDisplayType,
61
- selectedYear,
62
- setSelectedYear,
63
- selectedMonth,
64
- setSelectedMonth,
65
- fixedYear,
66
- minDate,
67
- maxDate,
68
- selectedDay
69
- } = _ref;
70
- const bodyRef = (0, _react.useRef)(null);
71
- const selectedYearRef = (0, _react.useRef)(null);
72
- const [display, setDisplay] = (0, _react.useState)(false);
73
- const [yearArr, setYearArr] = (0, _react.useState)([]);
74
- const minYear = minDate ? new Date(minDate).getFullYear() : 1;
75
- const minMonth = minDate ? new Date(minDate).getMonth() : null;
76
- const maxYear = maxDate ? new Date(maxDate).getFullYear() : null;
77
- const maxMonth = maxDate ? new Date(maxDate).getMonth() : null;
78
- const accordionTitle = () => {
79
- if (type === 'year') {
80
- return selectedYear ? selectedYear : new Date().getFullYear();
81
- } else if (type === 'month') {
82
- return monthArr[selectedMonth ? selectedMonth : new Date().getMonth()]?.name;
83
- }
84
- };
85
- const handleChangeMonth = (0, _react.useCallback)(month => {
86
- setSelectedMonth(month);
87
- setCurrentDisplayType(null);
88
- }, [setCurrentDisplayType, setSelectedMonth]);
89
- const handleChangeYear = (0, _react.useCallback)(year => {
90
- setSelectedYear(year);
91
- setCurrentDisplayType(null);
92
- }, [setCurrentDisplayType, setSelectedYear]);
93
- const handleYearItemDisable = (0, _react.useCallback)(year => {
94
- if (minDate !== undefined && maxDate !== undefined) {
95
- return !(minYear <= year && year <= maxYear);
96
- }
97
- if (minDate) {
98
- return minYear > year;
99
- } else if (maxDate) {
100
- return maxYear < year;
101
- }
102
- return false;
103
- }, [minYear, maxYear, maxDate, minDate]);
104
- const handleMonthItemDisable = (0, _react.useCallback)(month => {
105
- const date = (0, _utils.formatDate)(new Date(selectedYear, month, selectedDay));
106
- if (minDate !== undefined && maxDate !== undefined) {
107
- return !(minDate <= date && date <= maxDate);
108
- } else if (minDate) {
109
- return !(minDate <= date);
110
- } else if (maxDate) {
111
- return !(date <= maxDate);
112
- }
113
- return false;
114
- }, [maxDate, minDate, selectedYear, selectedDay]);
115
- const handleDisableArrow = (0, _react.useCallback)(arrowType => {
116
- if (type === 'year') {
117
- if (arrowType === 'previous') {
118
- return minYear > selectedYear - 1;
119
- } else if (arrowType === 'next') {
120
- if (maxYear) {
121
- return maxYear < selectedYear + 1;
122
- }
123
- return false;
124
- }
125
- } else if (type === 'month') {
126
- const date = arrowType === 'previous' ? (0, _utils.formatDate)(new Date(selectedYear, selectedMonth - 1 < 0 ? 11 : selectedMonth - 1, 1)) : (0, _utils.formatDate)(new Date(selectedYear, selectedMonth + 1 > 11 ? 0 : selectedMonth + 1, 1));
127
- if (fixedYear) {
128
- if (fixedYear && !minDate && !maxDate) {
129
- return false;
130
- }
131
- } else if (!minDate && !maxDate) {
132
- return false;
133
- } else {
134
- const minDate1st = (0, _utils.formatDate)(new Date(minYear, minMonth, 1));
135
- const maxDate1st = (0, _utils.formatDate)(new Date(maxYear, maxMonth, 1));
136
- if (minDate && !maxDate) {
137
- return !(minDate1st <= date);
138
- } else if (maxDate && !minDate) {
139
- return !(maxDate1st >= date);
140
- } else if (minDate && maxDate) {
141
- return !(minDate1st <= date && maxDate1st >= date);
142
- }
143
- }
144
- }
145
- }, [minDate, selectedYear, selectedMonth, minYear, type, fixedYear, maxDate, maxYear, maxMonth, minMonth]);
146
- const MonthContent = (0, _react.useMemo)(() => {
147
- return monthArr.map((month, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Item, {
148
- selected: selectedMonth === index,
149
- onClick: () => {
150
- handleChangeMonth(index);
151
- },
152
- disabled: handleMonthItemDisable(index),
153
- children: month.name
154
- }, month.number));
155
- }, [handleChangeMonth, selectedMonth, handleMonthItemDisable]);
156
- const YearContent = (0, _react.useMemo)(() => {
157
- return yearArr.map((year, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Item, {
158
- ref: selectedYear === year ? selectedYearRef : null,
159
- selected: selectedYear === year,
160
- onClick: () => {
161
- handleChangeYear(year);
162
- },
163
- disabled: handleYearItemDisable(year),
164
- children: year
165
- }, index));
166
- }, [selectedYear, yearArr, handleChangeYear, handleYearItemDisable]);
167
- (0, _react.useEffect)(() => {
168
- if (!fixedYear) {
169
- const start = selectedYear - 16 ? selectedYear - 16 : 1;
170
- const end = selectedYear + 16;
171
- const yearRange = (0, _utils.generateRange)(start, end);
172
- setYearArr(yearRange);
173
- }
174
- }, [fixedYear, selectedYear]);
175
- const scroll = (0, _react.useCallback)(() => {
176
- if (bodyRef?.current && selectedYearRef?.current) {
177
- const body = bodyRef.current;
178
- if (body.scrollTop < 200) {
179
- body.removeEventListener('scroll', scroll);
180
- setTimeout(() => {
181
- body.scrollTo({
182
- top: body.scrollTop + 200
183
- });
184
- }, 400);
185
- setTimeout(() => {
186
- setYearArr(previousParams => {
187
- body.addEventListener('scroll', scroll);
188
- const addYearRange = (0, _utils.generateRange)(previousParams[0] - 15, previousParams[0] - 1);
189
- return [...addYearRange, ...previousParams];
190
- });
191
- }, 400);
192
- } else if (body.scrollTop + body.clientHeight >= body.scrollHeight) {
193
- body.removeEventListener('scroll', scroll);
194
- setTimeout(() => {
195
- setYearArr(previousParams => {
196
- body.addEventListener('scroll', scroll);
197
- const addYearRange = (0, _utils.generateRange)(previousParams[previousParams.length - 1] + 1, previousParams[previousParams.length - 1] + 15);
198
- return [...previousParams, ...addYearRange];
199
- });
200
- }, 400);
201
- }
202
- }
203
- }, []);
204
- (0, _react.useEffect)(() => {
205
- bodyRef.current.addEventListener('scroll', scroll);
206
- }, [scroll]);
207
- (0, _react.useEffect)(() => {
208
- setDisplay(currentDisplayType === type);
209
- }, [currentDisplayType, type]);
210
- (0, _react.useEffect)(() => {
211
- if (display && bodyRef?.current && currentDisplayType === 'year' && selectedYearRef?.current) {
212
- bodyRef.current.scrollTo({
213
- top: selectedYearRef.current.offsetTop - bodyRef.current.offsetTop
214
- });
215
- }
216
- }, [currentDisplayType, display]);
217
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
218
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Header, {
219
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
220
- onClick: () => {
221
- handleChangeTitle('previous');
222
- },
223
- disabled: handleDisableArrow('previous'),
224
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdArrowBackIosNew, {})
225
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
226
- children: accordionTitle()
227
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
228
- onClick: () => {
229
- handleChangeTitle('next');
230
- },
231
- disabled: handleDisableArrow('next'),
232
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdArrowForwardIos, {})
233
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
234
- $display: display,
235
- right: true,
236
- onClick: handleDisplayAccordionContent,
237
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_io.IoMdArrowDropup, {})
238
- })]
239
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Body, {
240
- fixedYear: !fixedYear,
241
- ref: bodyRef,
242
- type: type,
243
- $display: display,
244
- children: [type === 'month' && MonthContent, type === 'year' && YearContent]
245
- })]
246
- });
247
- };
248
- const IconButton = _styledComponents.default.button`
249
- width: 36px;
250
- height: 36px;
251
- background: var(--color-background1);
252
- border: none;
253
- color: var(--font-on-background);
254
- padding: 0;
255
- transition: 0.3s;
256
-
257
- &:hover {
258
- color: var(--color-primary);
259
- }
260
-
261
- ${_ref2 => {
262
- let {
263
- disabled
264
- } = _ref2;
265
- return disabled && (0, _styledComponents.css)`
266
- opacity: 0.5;
267
-
268
- &:hover {
269
- color: var(--font-on-background);
270
- }
271
- `;
272
- }}
273
-
274
- ${_ref3 => {
275
- let {
276
- right,
277
- $display
278
- } = _ref3;
279
- return right && `
280
- position: absolute;
281
- right: 0;
282
- ${$display && (0, _styledComponents.css)`
283
- transform: rotate(180deg);
284
- `}
285
- `;
286
- }}
287
- `;
288
- const Header = _styledComponents.default.div`
289
- display: flex;
290
- justify-content: center;
291
- align-content: center;
292
- position: relative;
293
-
294
- > div {
295
- width: 72px;
296
- line-height: 36px;
297
- text-align: center;
298
- }
299
-
300
- &::before {
301
- content: '';
302
- border-bottom: var(--border-width) solid var(--border-color);
303
- position: absolute;
304
- width: 300px;
305
- bottom: 0;
306
- z-index: 1;
307
- right: -16px;
308
- }
309
- `;
310
- const Body = _styledComponents.default.div`
311
- flex-wrap: wrap;
312
- height: 0;
313
- width: 100%;
314
- display: ${_ref4 => {
315
- let {
316
- $display
317
- } = _ref4;
318
- return $display ? 'flex' : 'none';
319
- }};
320
- ${_ref5 => {
321
- let {
322
- type,
323
- fixedYear
324
- } = _ref5;
325
- return type && (0, _styledComponents.css)`
326
- min-height: ${type === 'year' ? '197' : fixedYear ? '144' : '192'}px};
327
- transition: .3s;
328
-
329
- ${type === 'year' && (0, _styledComponents.css)`
330
- overflow-y: scroll;
331
- gap: 12px 0;
332
- ${_scrollbar.default}
333
- `};
334
- `;
335
- }}
336
-
337
- transition: 0.3s;
338
- `;
339
- const Item = _styledComponents.default.button`
340
- width: 84px;
341
- height: 36px;
342
- line-height: 36px;
343
- text-align: center;
344
- border-radius: var(--border-radius-s);
345
- padding: 0;
346
- border: none;
347
- color: var(--font-on-background);
348
- background: var(--color-background1);
349
-
350
- &:hover {
351
- ${_ref6 => {
352
- let {
353
- disabled
354
- } = _ref6;
355
- return !disabled && 'background: var(--color-primary)';
356
- }}
357
- }
358
-
359
- ${_ref7 => {
360
- let {
361
- disabled
362
- } = _ref7;
363
- return disabled && 'color: var(--font-on-mute)';
364
- }}
365
-
366
- ${_ref8 => {
367
- let {
368
- selected
369
- } = _ref8;
370
- return selected && 'background: var(--color-hover)';
371
- }}
372
- `;
373
- var _default = exports.default = Accordion;
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _jsxRuntime = require("react/jsx-runtime");
9
- const CustomTimeInput = _ref => {
10
- let {
11
- date,
12
- onCustomChange
13
- } = _ref;
14
- const [time, setTime] = (0, _react.useState)('');
15
- const changeDate = () => {
16
- let hh = '';
17
- let mm = '';
18
- let ss = '';
19
- if (time.indexOf(':') !== -1) {
20
- [hh, mm, ss] = time.split(':');
21
- } else {
22
- hh = time.substring(0, 2);
23
- mm = time.substring(2, 4);
24
- ss = time.substring(4, 6);
25
- }
26
- const targetDate = date instanceof Date && !isNaN(date) ? date : new Date();
27
- targetDate.setHours(Number(hh) || 0, Number(mm) || 0, Number(ss) || 0);
28
- onCustomChange(targetDate);
29
- };
30
- (0, _react.useEffect)(() => {
31
- const defaultTime = date instanceof Date && !isNaN(date) ?
32
- // Getting time from Date beacuse `value` comes here without seconds
33
- date.toLocaleTimeString('it-IT') : '';
34
- setTime(defaultTime);
35
- }, [date]);
36
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
37
- value: time,
38
- onBlur: changeDate,
39
- onKeyUp: event => {
40
- if (event.key === 'Enter') {
41
- changeDate();
42
- }
43
- },
44
- onChange: event => setTime(event.target.value)
45
- });
46
- };
47
- var _default = exports.default = CustomTimeInput;
@@ -1,142 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _styledComponents = _interopRequireDefault(require("styled-components"));
9
- var _jsoneditorReact = require("jsoneditor-react");
10
- var _brace = _interopRequireDefault(require("brace"));
11
- require("jsoneditor-react/es/editor.min.css");
12
- require("brace/mode/json");
13
- require("brace/theme/github");
14
- var _jsxRuntime = require("react/jsx-runtime");
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- const JsonEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
17
- let {
18
- ...props
19
- } = _ref;
20
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
21
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsoneditorReact.JsonEditor, {
22
- ref: ref,
23
- ...props,
24
- ace: _brace.default
25
- })
26
- });
27
- });
28
- const Wrapper = _styledComponents.default.div`
29
- .jsoneditor {
30
- border: 0;
31
-
32
- div.jsoneditor-tree {
33
- background: transparent;
34
- }
35
- }
36
-
37
- div.jsoneditor td.jsoneditor-tree {
38
- vertical-align: middle;
39
- }
40
-
41
- .jsoneditor-popover,
42
- .jsoneditor-schema-error,
43
- div.jsoneditor th,
44
- div.jsoneditor td,
45
- div.jsoneditor textarea,
46
- div.jsoneditor select,
47
- div.jsoneditor-field,
48
- div.jsoneditor-value,
49
- pre.jsoneditor-preview {
50
- font-size: var(--font-body1);
51
- color: var(--font-on-background);
52
- }
53
-
54
- div.jsoneditor select {
55
- background: var(--color-background1);
56
- }
57
-
58
- div {
59
- &.jsoneditor-readonly {
60
- color: var(--font-on-background);
61
- }
62
-
63
- &.jsoneditor-value.jsoneditor-number {
64
- color: var(--color-danger);
65
- }
66
-
67
- &.jsoneditor-field.jsoneditor-empty::after,
68
- &.jsoneditor-value.jsoneditor-empty::after {
69
- font-size: var(--font-body1);
70
- color: var(--font-on-background);
71
- }
72
-
73
- &.jsoneditor-field[contenteditable='true']:focus,
74
- &.jsoneditor-field[contenteditable='true']:hover,
75
- &.jsoneditor-value[contenteditable='true']:focus,
76
- &.jsoneditor-value[contenteditable='true']:hover,
77
- &.jsoneditor-field.jsoneditor-highlight,
78
- &.jsoneditor-value.jsoneditor-highlight {
79
- background-color: transparent;
80
- border: var(--border-width) solid var(--border-color);
81
- }
82
-
83
- &.jsoneditor-empty {
84
- border-color: transparent;
85
- border-style: none;
86
- }
87
-
88
- &.jsoneditor-tree button.jsoneditor-button {
89
- filter: invert(100%) sepia(0%) saturate(2%) hue-rotate(78deg)
90
- brightness(104%) contrast(101%);
91
- }
92
-
93
- &.jsoneditor-tree button.jsoneditor-button:focus {
94
- background-color: transparent;
95
- }
96
- }
97
-
98
- // ace editor
99
- .ace_editor.ace-jsoneditor {
100
- border-radius: 8px;
101
- }
102
-
103
- .ace_gutter {
104
- background: rgb(59, 57, 87) !important;
105
- color: #ffffff !important;
106
- z-index: 0;
107
- }
108
-
109
- .ace-jsoneditor .ace_gutter-active-line {
110
- background: #00001d;
111
- }
112
-
113
- .ace_content {
114
- background: rgb(76, 72, 110);
115
- z-index: 0;
116
- }
117
-
118
- .ace-jsoneditor .ace_marker-layer .ace_active-line {
119
- background: #00001d;
120
- }
121
-
122
- .ace-jsoneditor .ace_text-layer {
123
- color: #fff;
124
- }
125
-
126
- .ace-jsoneditor .ace_variable {
127
- color: #fff;
128
- }
129
-
130
- .ace-jsoneditor .ace_string {
131
- color: #11d8cd;
132
- }
133
-
134
- .ace-jsoneditor .ace_cursor {
135
- border-left: 2px solid #fff;
136
- }
137
-
138
- .ace_hidden-cursors .ace_cursor {
139
- opacity: 0.5;
140
- }
141
- `;
142
- var _default = exports.default = JsonEditor;