@cashub/ui 0.5.0 → 0.6.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 (85) hide show
  1. package/Tab/TabList.js +1 -1
  2. package/Tab/TabPanel.js +3 -3
  3. package/animate/Collapse.js +1 -1
  4. package/animate/NumberCounter.js +1 -1
  5. package/backdrop/index.js +31 -0
  6. package/badge/BadgeFill.js +3 -3
  7. package/billing/BarChart.js +3 -3
  8. package/billing/Grid.js +10 -10
  9. package/breadcrumb/Breadcrumb.js +11 -6
  10. package/button/IconButton.js +1 -1
  11. package/chart/BarChart.js +4 -4
  12. package/chart/DoughnutChart.js +1 -1
  13. package/chart/LineChart.js +6 -6
  14. package/chart/SingleBarChart.js +2 -2
  15. package/cropper/Cropper.js +1 -1
  16. package/datetimePicker/Accordion.js +13 -13
  17. package/datetimePicker/CustomTimeInput.js +9 -9
  18. package/datetimePicker/DatePicker.js +24 -12
  19. package/datetimePicker/DatePickerV2.js +95 -71
  20. package/datetimePicker/DatetimePicker.js +6 -6
  21. package/datetimePicker/DatetimePickerV2.js +94 -54
  22. package/datetimePicker/TimePicker.js +15 -15
  23. package/datetimePicker/accordion/Month.js +20 -18
  24. package/datetimePicker/accordion/Year.js +7 -7
  25. package/datetimePicker/hooks/useChangeNumber.js +1 -1
  26. package/datetimePicker/hooks/useDecrease.js +1 -1
  27. package/datetimePicker/hooks/useIncrease.js +1 -1
  28. package/datetimePicker/utils/GMTDate.js +23 -0
  29. package/divider/Divider.js +4 -1
  30. package/dropdown/DropdownContent.js +1 -1
  31. package/dropdown/DropdownItem.js +2 -2
  32. package/dropzone/FileDropzone.js +24 -24
  33. package/dropzone/ImageDropzone.js +33 -33
  34. package/form/Label.js +1 -1
  35. package/form/Searchbox.js +4 -4
  36. package/geolocation/MapInteractor.js +4 -4
  37. package/heading/Heading1.js +2 -2
  38. package/heading/Heading2.js +3 -3
  39. package/heading/Heading3.js +10 -7
  40. package/icon/IconFigure.js +2 -2
  41. package/iconbox/ApplicationIconBox.js +8 -8
  42. package/iconbox/IconBoxFigure.js +6 -6
  43. package/iconbox/IconBoxImage.js +2 -2
  44. package/iconbox/IconBoxV2.js +4 -4
  45. package/image/UploadImage.js +2 -2
  46. package/jsoneditor/JsonEditor.js +1 -1
  47. package/layout/Backdrop.js +1 -1
  48. package/layout/MenuIcon.js +1 -1
  49. package/link/LinkSpan.js +4 -4
  50. package/map/LeafletMap.js +4 -4
  51. package/modal/StateModal.js +2 -2
  52. package/modal/TitleModal.js +4 -4
  53. package/package.json +1 -1
  54. package/paginate/Paginate.js +1 -1
  55. package/popover/Popover.js +3 -3
  56. package/ribbon/Ribbon.js +1 -1
  57. package/section/Section.js +27 -24
  58. package/section/SectionBody.js +1 -1
  59. package/section/SectionHeader.js +3 -3
  60. package/select/SearchBox.js +2 -2
  61. package/select/Select.js +59 -54
  62. package/services/api/index.js +2 -2
  63. package/table/Logo.js +1 -1
  64. package/table/PermissionTable.js +5 -5
  65. package/table/Table.js +31 -31
  66. package/table/TableHeadCell.js +3 -3
  67. package/table/hooks/useLimitChange.js +3 -3
  68. package/table/hooks/usePageChange.js +3 -3
  69. package/table/hooks/useSortChange.js +1 -1
  70. package/text/Paragraph.js +8 -5
  71. package/timeline/Timeline.js +4 -4
  72. package/toast/CustomToastContainer.js +1 -1
  73. package/tooltip/Tooltip.js +7 -7
  74. package/utils/array/generateRange.js +2 -2
  75. package/utils/chart/customTooltip.js +18 -18
  76. package/utils/chart/padEmptyChartBar.js +8 -8
  77. package/utils/dataURLtoFile.js +23 -6
  78. package/utils/format/datetimeFormat.js +7 -8
  79. package/utils/format/formatDate.js +7 -7
  80. package/utils/format/formatSize.js +1 -1
  81. package/utils/getBase64.js +2 -5
  82. package/utils/hooks/useCustomPopper.js +3 -4
  83. package/utils/image/resize.js +7 -7
  84. package/utils/react/setRef.js +1 -1
  85. package/wizard/Wizard.js +5 -12
@@ -6,14 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
 
8
8
  var getBase64 = function getBase64(file, callback) {
9
- // 建立FileReader物件
10
- var reader = new FileReader(); //讀取'成功'時執行
9
+ var reader = new FileReader();
11
10
 
12
11
  reader.onload = function () {
13
- //result返回文件的內容
14
12
  callback(reader.result);
15
- }; //讀取文件內容,結果用data:url形式表示
16
-
13
+ };
17
14
 
18
15
  reader.readAsDataURL(file);
19
16
  };
@@ -17,11 +17,10 @@ var useCustomPopper = function useCustomPopper(targetElement, popperElement) {
17
17
  boundary = _ref$boundary === void 0 ? 'clippingParents' : _ref$boundary;
18
18
 
19
19
  return (0, _reactPopper.usePopper)(targetElement, popperElement, {
20
- placement: 'bottom',
21
20
  strategy: strategy,
21
+ placement: 'bottom',
22
22
  modifiers: [{
23
23
  name: 'flip',
24
- //當reference元素將超出邊界時,定位popper元素
25
24
  enabled: true,
26
25
  options: {
27
26
  padding: 8
@@ -29,8 +28,8 @@ var useCustomPopper = function useCustomPopper(targetElement, popperElement) {
29
28
  }, {
30
29
  name: 'preventOverflow',
31
30
  options: {
32
- padding: 8,
33
- boundary: boundary
31
+ boundary: boundary,
32
+ padding: 8
34
33
  }
35
34
  }, {
36
35
  name: 'offset',
@@ -6,16 +6,16 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
 
8
8
  var resizeImage = function resizeImage(url, mime, size, mode, callback) {
9
- var canvas = document.createElement("canvas");
10
- var ctx = canvas.getContext("2d");
9
+ var canvas = document.createElement('canvas');
10
+ var ctx = canvas.getContext('2d');
11
11
  var img = new Image();
12
- img.crossOrigin = "Anonymous";
12
+ img.crossOrigin = 'Anonymous';
13
13
 
14
14
  img.onload = function () {
15
- var height = img.height;
16
- var width = img.width;
15
+ var height = img.height,
16
+ width = img.width;
17
17
 
18
- if (mode === "contain") {
18
+ if (mode === 'contain') {
19
19
  if (height > width) {
20
20
  width = width * (size / height);
21
21
  height = size;
@@ -25,7 +25,7 @@ var resizeImage = function resizeImage(url, mime, size, mode, callback) {
25
25
  }
26
26
  }
27
27
 
28
- if (mode === "cover") {
28
+ if (mode === 'cover') {
29
29
  if (height > width) {
30
30
  height = height * (size / width);
31
31
  width = size;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
 
8
8
  var setRef = function setRef(ref, value) {
9
- if (typeof ref === "function") {
9
+ if (typeof ref === 'function') {
10
10
  ref(value);
11
11
  } else if (ref) {
12
12
  ref.current = value;
package/wizard/Wizard.js CHANGED
@@ -102,20 +102,15 @@ var Wizard = function Wizard(props) {
102
102
  };
103
103
  }(), [currentStep, beforeNext, beforePrevious]);
104
104
  var nextStep = (0, _react.useCallback)(function () {
105
- console.log("next");
106
105
  var next = currentStep + 1;
107
106
 
108
107
  if (next > navNames.length) {
109
108
  next = navNames.length;
110
109
  }
111
110
 
112
- console.log("1");
113
-
114
111
  if (!beforeNext) {
115
- console.log("2");
116
112
  setCurrentStep(next);
117
113
  } else {
118
- console.log("3");
119
114
  beforeNext({
120
115
  current: currentStep
121
116
  }).then(function () {
@@ -144,7 +139,6 @@ var Wizard = function Wizard(props) {
144
139
  return currentStep === navNames.length;
145
140
  }, [currentStep, navNames.length]);
146
141
  var api = (0, _react.useMemo)(function () {
147
- console.log("api");
148
142
  return {
149
143
  goToStep: goToStep,
150
144
  nextStep: nextStep,
@@ -157,9 +151,8 @@ var Wizard = function Wizard(props) {
157
151
  return !!child;
158
152
  });
159
153
  return _react.Children.map(validChildren, function (child, index) {
160
- console.log("isReactComponent(child)", (0, _isReactComponent.default)(child));
161
154
  if (!child) return null;
162
- var className = index + 1 === currentStep && "active";
155
+ var className = index + 1 === currentStep && 'active';
163
156
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Step, {
164
157
  className: className,
165
158
  children: (0, _isReactComponent.default)(child) ? /*#__PURE__*/(0, _react.cloneElement)(child, api) : child
@@ -173,13 +166,13 @@ var Wizard = function Wizard(props) {
173
166
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Nav, {
174
167
  children: navNames.map(function (name, index, arr) {
175
168
  var step = index + 1;
176
- var arrow = step === currentStep && step !== arr.length ? "arrow" : undefined;
177
- var className = "";
169
+ var arrow = step === currentStep && step !== arr.length ? 'arrow' : undefined;
170
+ var className = '';
178
171
 
179
172
  if (step === currentStep) {
180
- className += "current";
173
+ className += 'current';
181
174
  } else if (step < currentStep) {
182
- className += "done";
175
+ className += 'done';
183
176
  }
184
177
 
185
178
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(NavItem, {