@cashub/ui 0.8.1 → 0.9.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 (71) hide show
  1. package/Tab/Tab.js +1 -1
  2. package/Tab/TabPanel.js +1 -1
  3. package/Tab/TabTab.js +1 -1
  4. package/Tab/{TabContext.js → subComponent/TabContext.js} +0 -0
  5. package/chart/index.js +20 -0
  6. package/chart/utils/index.js +23 -0
  7. package/cropper/{CropperHandler.js → CropperModalHandler.js} +3 -3
  8. package/cropper/index.js +3 -3
  9. package/{partial/modal → cropper/subComponent}/CropImageModal.js +2 -2
  10. package/datetimePicker/DatePicker.js +6 -6
  11. package/datetimePicker/DatePickerV2.js +7 -7
  12. package/datetimePicker/DatetimePicker.js +1 -1
  13. package/datetimePicker/DatetimePickerV2.js +9 -9
  14. package/datetimePicker/accordion/Month.js +1 -1
  15. package/datetimePicker/accordion/Year.js +1 -1
  16. package/datetimePicker/hooks/useChangeNumber.js +2 -2
  17. package/datetimePicker/{Accordion.js → subComponent/Accordion.js} +9 -9
  18. package/datetimePicker/{CustomTimeInput.js → subComponent/CustomTimeInput.js} +0 -0
  19. package/datetimePicker/{DateTimePickerContext.js → subComponent/DateTimePickerContext.js} +0 -0
  20. package/datetimePicker/utils/GMTDate.js +3 -3
  21. package/dropdown/Dropdown.js +3 -3
  22. package/dropdown/DropdownContent.js +1 -1
  23. package/dropdown/DropdownItem.js +1 -1
  24. package/dropdown/DropdownToggle.js +1 -1
  25. package/dropdown/{DropdownContext.js → subComponent/DropdownContext.js} +0 -0
  26. package/dropzone/FileDropzone.js +4 -4
  27. package/dropzone/ImageDropzone.js +3 -3
  28. package/dropzone/{Message.js → subComponent/Message.js} +0 -0
  29. package/geolocation/ReverseGeolocation.js +1 -1
  30. package/geolocation/{MapSearchBoxControl.js → subComponent/MapSearchBoxControl.js} +1 -1
  31. package/iconbox/ApplicationIconBox.js +2 -2
  32. package/iconbox/IconBox.js +2 -2
  33. package/iconbox/IconBoxV2.js +2 -2
  34. package/iconbox/{IconBoxFigure.js → subComponent/IconBoxFigure.js} +0 -0
  35. package/iconbox/{IconBoxImage.js → subComponent/IconBoxImage.js} +0 -0
  36. package/image/UploadImage.js +5 -7
  37. package/modal/StateModal.js +2 -2
  38. package/modal/TitleModal.js +4 -6
  39. package/package.json +4 -1
  40. package/paginate/Paginate.js +3 -3
  41. package/popover/Popover.js +4 -4
  42. package/select/InputSelect.js +5 -5
  43. package/select/Select.js +11 -11
  44. package/select/{ListBox.js → subComponent/ListBox.js} +0 -0
  45. package/select/{Option.js → subComponent/Option.js} +0 -0
  46. package/select/{OptionGroup.js → subComponent/OptionGroup.js} +0 -0
  47. package/select/{Options.js → subComponent/Options.js} +1 -1
  48. package/select/{SearchBox.js → subComponent/SearchBox.js} +1 -1
  49. package/select/{SelectedMultiple.js → subComponent/SelectedMultiple.js} +0 -0
  50. package/select/{SelectedSingle.js → subComponent/SelectedSingle.js} +0 -0
  51. package/table/ImageBox.js +1 -1
  52. package/table/Table.js +5 -5
  53. package/table/{Logo.js → subComponent/Logo.js} +1 -1
  54. package/table/{TableFooter.js → subComponent/TableFooter.js} +0 -0
  55. package/table/{TableFooterInfo.js → subComponent/TableFooterInfo.js} +0 -0
  56. package/table/{TableFooterPager.js → subComponent/TableFooterPager.js} +0 -0
  57. package/table/{TableHeadCell.js → subComponent/TableHeadCell.js} +0 -0
  58. package/table/{TableSort.js → subComponent/TableSort.js} +0 -0
  59. package/tooltip/Tooltip.js +3 -5
  60. package/wizard/Wizard.js +2 -2
  61. package/utils/appendToBody.js +0 -21
  62. package/utils/dataURLtoFile.js +0 -42
  63. package/utils/format/formatDate.js +0 -46
  64. package/utils/format/formatSize.js +0 -36
  65. package/utils/getBase64.js +0 -19
  66. package/utils/hooks/useCustomPopper.js +0 -49
  67. package/utils/hooks/useForkRef.js +0 -28
  68. package/utils/hooks/usePagination.js +0 -86
  69. package/utils/react/isReactComponent.js +0 -16
  70. package/utils/react/setRef.js +0 -17
  71. package/utils/regex/check.js +0 -13
@@ -1,86 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.usePagination = exports.DOTS = void 0;
7
-
8
- var _react = require("react");
9
-
10
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
11
-
12
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
-
14
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
-
16
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
17
-
18
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
19
-
20
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
21
-
22
- var DOTS = '...';
23
- exports.DOTS = DOTS;
24
-
25
- var range = function range(start, end) {
26
- var length = end - start + 1;
27
- return Array.from({
28
- length: length
29
- }, function (_, idx) {
30
- return idx + start;
31
- });
32
- };
33
-
34
- var usePagination = function usePagination(_ref) {
35
- var totalCount = _ref.totalCount,
36
- pageSize = _ref.pageSize,
37
- _ref$siblingCount = _ref.siblingCount,
38
- siblingCount = _ref$siblingCount === void 0 ? 1 : _ref$siblingCount,
39
- currentPage = _ref.currentPage;
40
- var paginationRange = (0, _react.useMemo)(function () {
41
- var totalPageCount = Math.ceil(totalCount / pageSize); // Pages count is determined as siblingCount + firstPage + lastPage + currentPage + 2 * DOTS
42
-
43
- var totalPageNumbers = siblingCount + 5;
44
- /*
45
- If the number of pages is less than the page numbers we want to show in our
46
- paginationComponent, we return the range [1..totalPageCount]
47
- */
48
-
49
- if (totalPageNumbers >= totalPageCount) {
50
- return range(1, totalPageCount);
51
- }
52
-
53
- var leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
54
- var rightSiblingIndex = Math.min(currentPage + siblingCount, totalPageCount);
55
- /*
56
- We do not want to show dots if there is only one position left
57
- after/before the left/right page count as that would lead to a change if our Pagination
58
- component size which we do not want
59
- */
60
-
61
- var shouldShowLeftDots = leftSiblingIndex > 3;
62
- var shouldShowRightDots = rightSiblingIndex < totalPageCount - 1;
63
- var firstPageIndex = 1;
64
- var lastPageIndex = totalPageCount;
65
-
66
- if (!shouldShowLeftDots && shouldShowRightDots) {
67
- var leftItemCount = 3 + 2 * siblingCount;
68
- var leftRange = range(1, leftItemCount);
69
- return [].concat(_toConsumableArray(leftRange), [DOTS, totalPageCount]);
70
- }
71
-
72
- if (shouldShowLeftDots && !shouldShowRightDots) {
73
- var rightItemCount = 3 + 2 * siblingCount;
74
- var rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount);
75
- return [firstPageIndex, DOTS].concat(_toConsumableArray(rightRange));
76
- }
77
-
78
- if (shouldShowLeftDots && shouldShowRightDots) {
79
- var middleRange = range(leftSiblingIndex, rightSiblingIndex);
80
- return [firstPageIndex, DOTS].concat(_toConsumableArray(middleRange), [DOTS, lastPageIndex]);
81
- }
82
- }, [totalCount, pageSize, siblingCount, currentPage]);
83
- return paginationRange;
84
- };
85
-
86
- exports.usePagination = usePagination;
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
-
10
- var isReactComponent = function isReactComponent(_ref) {
11
- var type = _ref.type;
12
- return typeof type === 'function' || _typeof(type) === 'object';
13
- };
14
-
15
- var _default = isReactComponent;
16
- exports.default = _default;
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var setRef = function setRef(ref, value) {
9
- if (typeof ref === 'function') {
10
- ref(value);
11
- } else if (ref) {
12
- ref.current = value;
13
- }
14
- };
15
-
16
- var _default = setRef;
17
- exports.default = _default;
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.testInteger = void 0;
7
-
8
- var testInteger = function testInteger(value) {
9
- var intRegex = /^[0-9]\d*$/;
10
- return intRegex.test(value);
11
- };
12
-
13
- exports.testInteger = testInteger;