@cashub/ui 0.48.2 → 0.48.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.
- package/Tab/TabList.js +26 -38
- package/Tab/TabPanel.js +20 -13
- package/Tab/TabTab.js +24 -36
- package/Tab/index.js +6 -3
- package/Tab/subComponent/TabListV2.js +18 -11
- package/Tab/subComponent/TabPanelV2.js +20 -16
- package/Tab/subComponent/TabTabV2.js +21 -33
- package/VerticalTab/TabList.js +18 -13
- package/VerticalTab/TabPanel.js +20 -16
- package/VerticalTab/TabTab.js +21 -40
- package/VerticalTab/VerticalTab.js +4 -8
- package/alert/Alert.js +5 -12
- package/animate/Collapse.js +7 -5
- package/animate/Loader.js +7 -18
- package/animate/PulseRing.js +5 -18
- package/animate/Spinner.js +3 -8
- package/backdrop/BaseBackdrop.js +3 -9
- package/backdrop/LoadingBackdrop.js +3 -7
- package/backdrop/ModalBackdrop.js +3 -5
- package/badge/Badge.js +3 -15
- package/badge/BadgeDot.js +3 -8
- package/badge/BadgeFill.js +6 -24
- package/badge/BadgeWithText.js +3 -13
- package/billing/BarChart.js +1 -1
- package/breadcrumb/Breadcrumb.js +3 -42
- package/button/Button.js +20 -88
- package/button/ButtonGroup.js +9 -33
- package/button/IconButton.js +10 -37
- package/button/ScrollToTopButton.js +4 -12
- package/callout/Callout.js +8 -37
- package/chart/BarChart.js +17 -10
- package/chart/DoughnutChart.js +20 -34
- package/chart/LineChart.js +18 -11
- package/chart/SingleBarChart.js +5 -22
- package/chart/utils/centerTextPlugin.js +2 -2
- package/chart/utils/customTooltip.js +14 -8
- package/chart/utils/htmlLegendPlugin.js +1 -1
- package/chart/utils/yAxisTopTitlePlugin.js +1 -1
- package/container/FlexContainer.js +7 -15
- package/cropper/Cropper.js +2 -1
- package/datetimePicker/DatePicker.js +26 -80
- package/datetimePicker/DatePickerV2.js +36 -95
- package/datetimePicker/DatetimePicker.js +11 -174
- package/datetimePicker/DatetimePickerV2.js +33 -87
- package/datetimePicker/DatetimePickerV3.js +11 -174
- package/datetimePicker/TimeInput.js +10 -35
- package/datetimePicker/TimePicker.js +22 -77
- package/datetimePicker/TimePickerStyle.js +3 -53
- package/datetimePicker/TimePickerV2.js +21 -54
- package/datetimePicker/accordion/Month.js +16 -93
- package/datetimePicker/accordion/Year.js +18 -96
- package/datetimePicker/hooks/useChangeNumber.js +6 -3
- package/datetimePicker/hooks/useDecrease.js +6 -3
- package/datetimePicker/hooks/useIncrease.js +6 -3
- package/datetimePicker/subComponent/Accordion.js +20 -101
- package/descriptionList/DescriptionDetail.js +4 -15
- package/descriptionList/DescriptionList.js +4 -12
- package/descriptionList/DescriptionTerm.js +3 -5
- package/divider/Divider.js +6 -15
- package/dropdown/DropdownButtonOption.js +6 -22
- package/dropdown/DropdownContent.js +15 -29
- package/dropdown/DropdownDivOption.js +3 -17
- package/dropdown/DropdownLinkOption.js +3 -14
- package/dropdown/DropdownToggle.js +15 -7
- package/dropzone/FileDropzone.js +22 -121
- package/dropzone/ImageDropzone.js +14 -83
- package/dropzone/subComponent/Message.js +4 -11
- package/figure/IconFigure.js +7 -16
- package/figure/ImageFigure.js +6 -19
- package/file/HiddenFileInput.js +3 -3
- package/form/Checkbox.js +13 -74
- package/form/Fieldset.js +3 -9
- package/form/FormItem.js +5 -10
- package/form/Input.js +7 -40
- package/form/Label.js +10 -34
- package/form/MutedText.js +4 -8
- package/form/PasswordInput.js +13 -20
- package/form/RadioButton.js +8 -55
- package/form/SearchSelect.js +12 -64
- package/form/Searchbox.js +19 -45
- package/form/Slider.js +10 -28
- package/form/SwitchButton.js +14 -48
- package/form/Textarea.js +3 -30
- package/form/TreeView.js +6 -13
- package/grid/Column.js +10 -23
- package/grid/Grid.js +6 -14
- package/heading/Heading1.js +4 -8
- package/heading/Heading2.js +5 -11
- package/heading/Heading3.js +8 -20
- package/iconbox/ApplicationIconBox.js +12 -48
- package/iconbox/IconBox.js +7 -31
- package/iconbox/IconBoxV2.js +8 -33
- package/iconbox/subComponent/IconBoxFigure.js +9 -17
- package/iconbox/subComponent/IconBoxImage.js +8 -21
- package/image/ImageFluid.js +3 -7
- package/image/UploadImage.js +18 -66
- package/jsoneditor/JsonEditor.js +15 -121
- package/keyframe/Pulse.js +3 -13
- package/keyframe/Spin.js +3 -5
- package/layout/Aside.js +5 -30
- package/layout/Backdrop.js +4 -8
- package/layout/Container.js +5 -21
- package/layout/Footer.js +7 -26
- package/link/LinkSpan.js +19 -37
- package/map/GoogleMap.js +7 -3
- package/map/GoogleReverseGeolocation.js +3 -6
- package/map/LeafletMap.js +2 -2
- package/map/subComponent/GoogleMapContainer.js +4 -16
- package/map/subComponent/GoogleMapPopup.js +10 -7
- package/map/subComponent/GoogleMapWrapper.js +15 -8
- package/map/subComponent/LeafletDrawControl.js +7 -9
- package/map/subComponent/LeafletMapContainer.js +4 -159
- package/modal/StateModal.js +28 -49
- package/modal/TitleModal.js +29 -70
- package/package.json +1 -1
- package/page/Disclaimer.js +3 -119
- package/paginate/Paginate.js +12 -54
- package/popover/Popover.js +25 -30
- package/qrcode/QRCode.js +6 -20
- package/qrcode/QRCodeContainter.js +4 -12
- package/ribbon/Ribbon.js +4 -29
- package/section/Section.js +20 -68
- package/section/SectionBody.js +8 -29
- package/section/SectionHeader.js +11 -36
- package/section/SectionToolbar.js +3 -9
- package/section/SectionToolbarItem.js +3 -8
- package/select/InputSelect.js +23 -16
- package/select/Select.js +43 -112
- package/select/subComponent/Checkbox.js +5 -24
- package/select/subComponent/Footer.js +3 -4
- package/select/subComponent/ListBox.js +5 -12
- package/select/subComponent/Option.js +7 -27
- package/select/subComponent/OptionGroup.js +3 -13
- package/select/subComponent/Options.js +5 -18
- package/select/subComponent/SearchBox.js +12 -34
- package/select/subComponent/SelectedMultipleTags.js +3 -21
- package/select/subComponent/SelectedMultipleText.js +4 -20
- package/select/subComponent/SelectedSingle.js +3 -7
- package/styles/GlobalStyle.js +45 -156
- package/styles/mixin/backgroundColor.js +8 -16
- package/styles/mixin/borderColor.js +7 -13
- package/styles/mixin/color.js +7 -13
- package/styles/mixin/colorOnBackground.js +7 -13
- package/styles/mixin/inputPlaceholder.js +3 -20
- package/styles/mixin/media.js +3 -5
- package/styles/mixin/rounded.js +6 -10
- package/styles/mixin/scrollbar.js +3 -13
- package/styles/theme/dark.theme.js +14 -15
- package/styles/theme/light.theme.js +14 -15
- package/styles/theme/white.theme.js +14 -15
- package/table/GridTable.js +33 -71
- package/table/ImageBox.js +5 -15
- package/table/InfiniteGridTable.js +46 -92
- package/table/PermissionTable.js +10 -32
- package/table/SimpleGridTable.js +17 -52
- package/table/Table.js +48 -198
- package/table/__mock__/columns.js +1 -1
- package/table/subComponent/BaseTableHeadCell.js +8 -37
- package/table/subComponent/GridTableFooter.js +4 -10
- package/table/subComponent/GridTableHeadCell.js +4 -6
- package/table/subComponent/Resizer.js +4 -19
- package/table/subComponent/TableFooter.js +6 -15
- package/table/subComponent/TableFooterInfo.js +3 -4
- package/table/subComponent/TableFooterPager.js +6 -19
- package/table/subComponent/TableHeadCell.js +3 -9
- package/table/subComponent/TableSort.js +7 -17
- package/tagify/TagifyStyle.js +3 -49
- package/tagify/Tags.js +21 -37
- package/tagify/templates/getCreateButtonTemplate.js +2 -5
- package/text/Paragraph.js +12 -50
- package/timeline/Timeline.js +17 -94
- package/toast/CustomToastContainer.js +3 -35
- package/toast/MessageContainer.js +4 -22
- package/tooltip/Tooltip.js +19 -47
- package/treeView/TreeViewV2.js +1 -1
- package/treeView/TreeflexStyle.js +3 -38
- package/wizard/Wizard.js +6 -115
|
@@ -6,59 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = require("styled-components");
|
|
8
8
|
var _scrollbar = _interopRequireDefault(require("../styles/mixin/scrollbar"));
|
|
9
|
+
var _templateObject;
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
10
12
|
// integrate rc-time-picker component
|
|
11
|
-
const TimePickerStyle = (0, _styledComponents.createGlobalStyle)
|
|
12
|
-
.rc-time-picker-panel-narrow {
|
|
13
|
-
max-width: none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.rc-time-picker-panel {
|
|
17
|
-
.rc-time-picker-panel-inner {
|
|
18
|
-
background: transparent;
|
|
19
|
-
border: none;
|
|
20
|
-
box-shadow: none;
|
|
21
|
-
|
|
22
|
-
.rc-time-picker-panel-input-wrap {
|
|
23
|
-
display: none;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.rc-time-picker-panel-combobox {
|
|
27
|
-
height: 144px;
|
|
28
|
-
border: var(--border-width) solid var(--border-color);
|
|
29
|
-
color: var(--font-on-background);
|
|
30
|
-
box-shadow: var(--box-shadow);
|
|
31
|
-
border-radius: var(--border-radius);
|
|
32
|
-
background: var(--color-background2);
|
|
33
|
-
|
|
34
|
-
.rc-time-picker-panel-select {
|
|
35
|
-
font-size: var(--font-body1);
|
|
36
|
-
|
|
37
|
-
${_scrollbar.default}
|
|
38
|
-
|
|
39
|
-
li {
|
|
40
|
-
&:hover {
|
|
41
|
-
background: var(--color-hover);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&.rc-time-picker-panel-select-option-selected {
|
|
45
|
-
background: var(--color-hover);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&:first-child {
|
|
50
|
-
border-top-left-radius: var(--border-radius);
|
|
51
|
-
border-bottom-left-radius: var(--border-radius);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&.rc-time-picker-panel-placement-bottomLeft {
|
|
58
|
-
.rc-time-picker-panel-inner {
|
|
59
|
-
padding-top: calc(36px + var(--spacing-xs));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
13
|
+
const TimePickerStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .rc-time-picker-panel-narrow {\n max-width: none;\n }\n\n .rc-time-picker-panel {\n .rc-time-picker-panel-inner {\n background: transparent;\n border: none;\n box-shadow: none;\n\n .rc-time-picker-panel-input-wrap {\n display: none;\n }\n\n .rc-time-picker-panel-combobox {\n height: 144px;\n border: var(--border-width) solid var(--border-color);\n color: var(--font-on-background);\n box-shadow: var(--box-shadow);\n border-radius: var(--border-radius);\n background: var(--color-background2);\n\n .rc-time-picker-panel-select {\n font-size: var(--font-body1);\n \n ", "\n\n li {\n &:hover {\n background: var(--color-hover);\n }\n \n &.rc-time-picker-panel-select-option-selected {\n background: var(--color-hover);\n }\n }\n\n &:first-child {\n border-top-left-radius: var(--border-radius);\n border-bottom-left-radius: var(--border-radius);\n }\n }\n }\n }\n\n &.rc-time-picker-panel-placement-bottomLeft {\n .rc-time-picker-panel-inner {\n padding-top: calc(36px + var(--spacing-xs));\n }\n }\n }\n"])), _scrollbar.default);
|
|
64
14
|
var _default = exports.default = TimePickerStyle;
|
|
@@ -13,9 +13,16 @@ var _pad = _interopRequireDefault(require("./utils/pad"));
|
|
|
13
13
|
var _form = require("../form");
|
|
14
14
|
var _scrollbar = _interopRequireDefault(require("../styles/mixin/scrollbar"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
16
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
18
|
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); }
|
|
18
19
|
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; }
|
|
20
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
25
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
26
|
const LENGTH = 2;
|
|
20
27
|
const PAD_STRING = '0';
|
|
21
28
|
const HOUR_OPTIONS = (0, _utils.generateRange)(0, 23).map(value => {
|
|
@@ -59,15 +66,14 @@ const TimePickerV2 = _ref => {
|
|
|
59
66
|
};
|
|
60
67
|
const handleChange = (type, value) => {
|
|
61
68
|
setTime(previous => {
|
|
62
|
-
return {
|
|
63
|
-
...previous,
|
|
69
|
+
return _objectSpread(_objectSpread({}, previous), {}, {
|
|
64
70
|
[type]: value
|
|
65
|
-
};
|
|
71
|
+
});
|
|
66
72
|
});
|
|
67
73
|
};
|
|
68
74
|
(0, _react.useEffect)(() => {
|
|
69
75
|
if (typeof onSelect === 'function' && time.hour && time.minute && time.second) {
|
|
70
|
-
onSelect(
|
|
76
|
+
onSelect("".concat(time.hour, ":").concat(time.minute, ":").concat(time.second));
|
|
71
77
|
}
|
|
72
78
|
}, [onSelect, time.hour, time.minute, time.second]);
|
|
73
79
|
(0, _react.useEffect)(() => {
|
|
@@ -93,12 +99,12 @@ const TimePickerV2 = _ref => {
|
|
|
93
99
|
type: "text",
|
|
94
100
|
readOnly: true,
|
|
95
101
|
onClick: handleToggle,
|
|
96
|
-
value:
|
|
97
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Panel, {
|
|
102
|
+
value: "".concat(time.hour, ":").concat(time.minute, ":").concat(time.second)
|
|
103
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Panel, _objectSpread(_objectSpread({
|
|
98
104
|
ref: setPopperElement,
|
|
99
105
|
$display: display,
|
|
100
|
-
style: styles.popper
|
|
101
|
-
|
|
106
|
+
style: styles.popper
|
|
107
|
+
}, attributes.popper), {}, {
|
|
102
108
|
placement: state && state.placement,
|
|
103
109
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Picker, {
|
|
104
110
|
children: HOUR_OPTIONS.map(option => {
|
|
@@ -137,60 +143,21 @@ const TimePickerV2 = _ref => {
|
|
|
137
143
|
}, option);
|
|
138
144
|
})
|
|
139
145
|
})]
|
|
140
|
-
})]
|
|
146
|
+
}))]
|
|
141
147
|
})
|
|
142
148
|
});
|
|
143
149
|
};
|
|
144
|
-
const Panel = _styledComponents.default.div
|
|
145
|
-
display: flex;
|
|
146
|
-
visibility: ${_ref2 => {
|
|
150
|
+
const Panel = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n visibility: ", ";\n width: 100%;\n max-width: 360px;\n background: var(--color-background1);\n color: var(--font-on-background);\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius);\n box-shadow: var(--box-shadow);\n z-index: 85;\n"])), _ref2 => {
|
|
147
151
|
let {
|
|
148
152
|
$display
|
|
149
153
|
} = _ref2;
|
|
150
154
|
return $display ? 'visible' : 'hidden';
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
background: var(--color-background1);
|
|
155
|
-
color: var(--font-on-background);
|
|
156
|
-
border: var(--border-width) solid var(--border-color);
|
|
157
|
-
border-radius: var(--border-radius);
|
|
158
|
-
box-shadow: var(--box-shadow);
|
|
159
|
-
z-index: 85;
|
|
160
|
-
`;
|
|
161
|
-
const Picker = _styledComponents.default.ul`
|
|
162
|
-
flex: 1;
|
|
163
|
-
text-align: center;
|
|
164
|
-
max-height: 144px;
|
|
165
|
-
overflow-y: auto;
|
|
166
|
-
|
|
167
|
-
${_scrollbar.default}
|
|
168
|
-
|
|
169
|
-
&:first-child {
|
|
170
|
-
border-top-left-radius: var(--border-radius);
|
|
171
|
-
border-bottom-left-radius: var(--border-radius);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
&:not(:last-child) {
|
|
175
|
-
border-right: var(--border-width) solid var(--border-color);
|
|
176
|
-
}
|
|
177
|
-
`;
|
|
178
|
-
const Option = _styledComponents.default.li`
|
|
179
|
-
padding: var(--spacing-xs) 0;
|
|
180
|
-
background: var(--color-background1);
|
|
181
|
-
transition: background 0.3s;
|
|
182
|
-
|
|
183
|
-
&:hover {
|
|
184
|
-
background: var(--color-hover);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
${_ref3 => {
|
|
155
|
+
});
|
|
156
|
+
const Picker = _styledComponents.default.ul(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1;\n text-align: center;\n max-height: 144px;\n overflow-y: auto;\n\n ", "\n\n &:first-child {\n border-top-left-radius: var(--border-radius);\n border-bottom-left-radius: var(--border-radius);\n }\n\n &:not(:last-child) {\n border-right: var(--border-width) solid var(--border-color);\n }\n"])), _scrollbar.default);
|
|
157
|
+
const Option = _styledComponents.default.li(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: var(--spacing-xs) 0;\n background: var(--color-background1);\n transition: background 0.3s;\n\n &:hover {\n background: var(--color-hover);\n }\n\n ", "\n"])), _ref3 => {
|
|
188
158
|
let {
|
|
189
159
|
selected
|
|
190
160
|
} = _ref3;
|
|
191
|
-
return selected && (0, _styledComponents.css)
|
|
192
|
-
|
|
193
|
-
`;
|
|
194
|
-
}}
|
|
195
|
-
`;
|
|
161
|
+
return selected && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background: var(--color-hover);\n "])));
|
|
162
|
+
});
|
|
196
163
|
var _default = exports.default = TimePickerV2;
|
|
@@ -12,9 +12,11 @@ var _utils = require("@cashub/utils");
|
|
|
12
12
|
var _DateTimePickerContext = _interopRequireDefault(require("../subComponent/DateTimePickerContext"));
|
|
13
13
|
var _constant = require("../provider/constant");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
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); }
|
|
17
18
|
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; }
|
|
19
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
18
20
|
const Month = _ref => {
|
|
19
21
|
let {
|
|
20
22
|
expand,
|
|
@@ -132,123 +134,44 @@ const Month = _ref => {
|
|
|
132
134
|
})]
|
|
133
135
|
});
|
|
134
136
|
};
|
|
135
|
-
const Header = _styledComponents.default.div
|
|
136
|
-
|
|
137
|
-
justify-content: center;
|
|
138
|
-
align-content: center;
|
|
139
|
-
position: relative;
|
|
140
|
-
|
|
141
|
-
> div {
|
|
142
|
-
width: 72px;
|
|
143
|
-
line-height: 36px;
|
|
144
|
-
text-align: center;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
&::before {
|
|
148
|
-
content: '';
|
|
149
|
-
border-bottom: var(--border-width) solid var(--border-color);
|
|
150
|
-
position: absolute;
|
|
151
|
-
width: 300px;
|
|
152
|
-
bottom: 0;
|
|
153
|
-
z-index: 1;
|
|
154
|
-
right: -16px;
|
|
155
|
-
}
|
|
156
|
-
`;
|
|
157
|
-
const IconButton = _styledComponents.default.button`
|
|
158
|
-
width: 36px;
|
|
159
|
-
height: 36px;
|
|
160
|
-
background: var(--color-background1);
|
|
161
|
-
border: none;
|
|
162
|
-
color: var(--font-on-background);
|
|
163
|
-
padding: 0;
|
|
164
|
-
transition: 0.3s;
|
|
165
|
-
|
|
166
|
-
&:hover {
|
|
167
|
-
color: var(--color-primary);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
${_ref2 => {
|
|
137
|
+
const Header = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-content: center;\n position: relative;\n\n > div {\n width: 72px;\n line-height: 36px;\n text-align: center;\n }\n\n &::before {\n content: '';\n border-bottom: var(--border-width) solid var(--border-color);\n position: absolute;\n width: 300px;\n bottom: 0;\n z-index: 1;\n right: -16px;\n }\n"])));
|
|
138
|
+
const IconButton = _styledComponents.default.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n background: var(--color-background1);\n border: none;\n color: var(--font-on-background);\n padding: 0;\n transition: 0.3s;\n\n &:hover {\n color: var(--color-primary);\n }\n\n ", "\n\n ", "\n"])), _ref2 => {
|
|
171
139
|
let {
|
|
172
140
|
disabled
|
|
173
141
|
} = _ref2;
|
|
174
|
-
return disabled && (0, _styledComponents.css)
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
&:hover {
|
|
178
|
-
color: var(--font-on-background);
|
|
179
|
-
}
|
|
180
|
-
`;
|
|
181
|
-
}}
|
|
182
|
-
|
|
183
|
-
${_ref3 => {
|
|
142
|
+
return disabled && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n opacity: 0.5;\n\n &:hover {\n color: var(--font-on-background);\n }\n "])));
|
|
143
|
+
}, _ref3 => {
|
|
184
144
|
let {
|
|
185
145
|
right,
|
|
186
146
|
$rotate
|
|
187
147
|
} = _ref3;
|
|
188
|
-
return right &&
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
${$rotate && (0, _styledComponents.css)`
|
|
192
|
-
transform: rotate(180deg);
|
|
193
|
-
`}
|
|
194
|
-
`;
|
|
195
|
-
}}
|
|
196
|
-
`;
|
|
197
|
-
const Body = _styledComponents.default.div`
|
|
198
|
-
flex-wrap: wrap;
|
|
199
|
-
height: 0;
|
|
200
|
-
width: 100%;
|
|
201
|
-
display: ${_ref4 => {
|
|
148
|
+
return right && "\n position: absolute;\n right: 0;\n ".concat($rotate && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transform: rotate(180deg);\n "]))), "\n ");
|
|
149
|
+
});
|
|
150
|
+
const Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex-wrap: wrap;\n height: 0;\n width: 100%;\n display: ", ";\n\n ", "\n transition: .3s;\n\n transition: 0.3s;\n"])), _ref4 => {
|
|
202
151
|
let {
|
|
203
152
|
expand
|
|
204
153
|
} = _ref4;
|
|
205
154
|
return expand ? 'flex' : 'none';
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
${_ref5 => {
|
|
155
|
+
}, _ref5 => {
|
|
209
156
|
let {
|
|
210
157
|
fixedYear
|
|
211
158
|
} = _ref5;
|
|
212
|
-
return (0, _styledComponents.css)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}}
|
|
216
|
-
transition: .3s;
|
|
217
|
-
|
|
218
|
-
transition: 0.3s;
|
|
219
|
-
`;
|
|
220
|
-
const Item = _styledComponents.default.button`
|
|
221
|
-
width: calc(100% / 3);
|
|
222
|
-
height: 36px;
|
|
223
|
-
line-height: 36px;
|
|
224
|
-
text-align: center;
|
|
225
|
-
border-radius: var(--border-radius-s);
|
|
226
|
-
padding: 0;
|
|
227
|
-
border: none;
|
|
228
|
-
color: var(--font-on-background);
|
|
229
|
-
background: var(--color-background1);
|
|
230
|
-
|
|
231
|
-
&:hover {
|
|
232
|
-
${_ref6 => {
|
|
159
|
+
return (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), fixedYear ? '192' : '144');
|
|
160
|
+
});
|
|
161
|
+
const Item = _styledComponents.default.button(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: calc(100% / 3);\n height: 36px;\n line-height: 36px;\n text-align: center;\n border-radius: var(--border-radius-s);\n padding: 0;\n border: none;\n color: var(--font-on-background);\n background: var(--color-background1);\n\n &:hover {\n ", "\n }\n\n ", "\n\n ", "\n"])), _ref6 => {
|
|
233
162
|
let {
|
|
234
163
|
disabled
|
|
235
164
|
} = _ref6;
|
|
236
165
|
return !disabled && 'background: var(--color-primary)';
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
${_ref7 => {
|
|
166
|
+
}, _ref7 => {
|
|
241
167
|
let {
|
|
242
168
|
disabled
|
|
243
169
|
} = _ref7;
|
|
244
170
|
return disabled && 'color: var(--font-on-mute)';
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
${_ref8 => {
|
|
171
|
+
}, _ref8 => {
|
|
248
172
|
let {
|
|
249
173
|
selected
|
|
250
174
|
} = _ref8;
|
|
251
175
|
return selected && 'background: var(--color-hover)';
|
|
252
|
-
}
|
|
253
|
-
`;
|
|
176
|
+
});
|
|
254
177
|
var _default = exports.default = Month;
|
|
@@ -12,9 +12,11 @@ var _utils = require("@cashub/utils");
|
|
|
12
12
|
var _DateTimePickerContext = _interopRequireDefault(require("../subComponent/DateTimePickerContext"));
|
|
13
13
|
var _scrollbar = _interopRequireDefault(require("../../styles/mixin/scrollbar"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
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); }
|
|
17
18
|
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; }
|
|
19
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
18
20
|
const Year = _ref => {
|
|
19
21
|
let {
|
|
20
22
|
expand,
|
|
@@ -93,7 +95,7 @@ const Year = _ref => {
|
|
|
93
95
|
}
|
|
94
96
|
}, [fixedYear, selectedDate]);
|
|
95
97
|
const scroll = (0, _react.useCallback)(() => {
|
|
96
|
-
if (bodyRef
|
|
98
|
+
if (bodyRef !== null && bodyRef !== void 0 && bodyRef.current && selectedYearRef !== null && selectedYearRef !== void 0 && selectedYearRef.current) {
|
|
97
99
|
const body = bodyRef.current;
|
|
98
100
|
if (body.scrollTop + body.clientHeight >= body.scrollHeight - 90) {
|
|
99
101
|
body.removeEventListener('scroll', scroll);
|
|
@@ -129,7 +131,7 @@ const Year = _ref => {
|
|
|
129
131
|
bodyRef.current.addEventListener('scroll', scroll);
|
|
130
132
|
}, [scroll]);
|
|
131
133
|
(0, _react.useEffect)(() => {
|
|
132
|
-
if (expand && bodyRef
|
|
134
|
+
if (expand && bodyRef !== null && bodyRef !== void 0 && bodyRef.current && selectedYearRef !== null && selectedYearRef !== void 0 && selectedYearRef.current) {
|
|
133
135
|
bodyRef.current.scrollTo({
|
|
134
136
|
top: selectedYearRef.current.offsetTop - bodyRef.current.offsetTop
|
|
135
137
|
});
|
|
@@ -161,124 +163,44 @@ const Year = _ref => {
|
|
|
161
163
|
})]
|
|
162
164
|
});
|
|
163
165
|
};
|
|
164
|
-
const Header = _styledComponents.default.div
|
|
165
|
-
|
|
166
|
-
justify-content: center;
|
|
167
|
-
align-content: center;
|
|
168
|
-
position: relative;
|
|
169
|
-
|
|
170
|
-
> div {
|
|
171
|
-
width: 72px;
|
|
172
|
-
line-height: 36px;
|
|
173
|
-
text-align: center;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
&::before {
|
|
177
|
-
content: '';
|
|
178
|
-
border-bottom: var(--border-width) solid var(--border-color);
|
|
179
|
-
position: absolute;
|
|
180
|
-
width: 300px;
|
|
181
|
-
bottom: 0;
|
|
182
|
-
z-index: 1;
|
|
183
|
-
right: -16px;
|
|
184
|
-
}
|
|
185
|
-
`;
|
|
186
|
-
const IconButton = _styledComponents.default.button`
|
|
187
|
-
width: 36px;
|
|
188
|
-
height: 36px;
|
|
189
|
-
background: var(--color-background1);
|
|
190
|
-
border: none;
|
|
191
|
-
color: var(--font-on-background);
|
|
192
|
-
padding: 0;
|
|
193
|
-
transition: 0.3s;
|
|
194
|
-
|
|
195
|
-
&:hover {
|
|
196
|
-
color: var(--color-primary);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
${_ref2 => {
|
|
166
|
+
const Header = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-content: center;\n position: relative;\n\n > div {\n width: 72px;\n line-height: 36px;\n text-align: center;\n }\n\n &::before {\n content: '';\n border-bottom: var(--border-width) solid var(--border-color);\n position: absolute;\n width: 300px;\n bottom: 0;\n z-index: 1;\n right: -16px;\n }\n"])));
|
|
167
|
+
const IconButton = _styledComponents.default.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n background: var(--color-background1);\n border: none;\n color: var(--font-on-background);\n padding: 0;\n transition: 0.3s;\n\n &:hover {\n color: var(--color-primary);\n }\n\n ", "\n\n ", "\n"])), _ref2 => {
|
|
200
168
|
let {
|
|
201
169
|
disabled
|
|
202
170
|
} = _ref2;
|
|
203
|
-
return disabled && (0, _styledComponents.css)
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
&:hover {
|
|
207
|
-
color: var(--font-on-background);
|
|
208
|
-
}
|
|
209
|
-
`;
|
|
210
|
-
}}
|
|
211
|
-
|
|
212
|
-
${_ref3 => {
|
|
171
|
+
return disabled && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n opacity: 0.5;\n\n &:hover {\n color: var(--font-on-background);\n }\n "])));
|
|
172
|
+
}, _ref3 => {
|
|
213
173
|
let {
|
|
214
174
|
right,
|
|
215
175
|
$rotate
|
|
216
176
|
} = _ref3;
|
|
217
|
-
return right &&
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
${$rotate && (0, _styledComponents.css)`
|
|
221
|
-
transform: rotate(180deg);
|
|
222
|
-
`}
|
|
223
|
-
`;
|
|
224
|
-
}}
|
|
225
|
-
`;
|
|
226
|
-
const Body = _styledComponents.default.div`
|
|
227
|
-
flex-wrap: wrap;
|
|
228
|
-
height: 0;
|
|
229
|
-
width: 100%;
|
|
230
|
-
display: ${_ref4 => {
|
|
177
|
+
return right && "\n position: absolute;\n right: 0;\n ".concat($rotate && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transform: rotate(180deg);\n "]))), "\n ");
|
|
178
|
+
});
|
|
179
|
+
const Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex-wrap: wrap;\n height: 0;\n width: 100%;\n display: ", ";\n transition: 0.3s;\n overflow-y: scroll;\n gap: 12px 0;\n ", "\n\n ", "\n"])), _ref4 => {
|
|
231
180
|
let {
|
|
232
181
|
expand
|
|
233
182
|
} = _ref4;
|
|
234
183
|
return expand ? 'flex' : 'none';
|
|
235
|
-
}
|
|
236
|
-
transition: 0.3s;
|
|
237
|
-
overflow-y: scroll;
|
|
238
|
-
gap: 12px 0;
|
|
239
|
-
${_scrollbar.default}
|
|
240
|
-
|
|
241
|
-
${_ref5 => {
|
|
184
|
+
}, _scrollbar.default, _ref5 => {
|
|
242
185
|
let {
|
|
243
186
|
fixedYear
|
|
244
187
|
} = _ref5;
|
|
245
|
-
return (0, _styledComponents.css)
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}}
|
|
249
|
-
`;
|
|
250
|
-
const Item = _styledComponents.default.button`
|
|
251
|
-
width: calc(100% / 3);
|
|
252
|
-
height: 36px;
|
|
253
|
-
line-height: 36px;
|
|
254
|
-
text-align: center;
|
|
255
|
-
border-radius: var(--border-radius-s);
|
|
256
|
-
padding: 0;
|
|
257
|
-
border: none;
|
|
258
|
-
color: var(--font-on-background);
|
|
259
|
-
background: var(--color-background1);
|
|
260
|
-
|
|
261
|
-
&:hover {
|
|
262
|
-
${_ref6 => {
|
|
188
|
+
return (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n height: ", "px};\n "])), fixedYear ? '144' : '192');
|
|
189
|
+
});
|
|
190
|
+
const Item = _styledComponents.default.button(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: calc(100% / 3);\n height: 36px;\n line-height: 36px;\n text-align: center;\n border-radius: var(--border-radius-s);\n padding: 0;\n border: none;\n color: var(--font-on-background);\n background: var(--color-background1);\n\n &:hover {\n ", "\n }\n\n ", "\n\n ", "\n"])), _ref6 => {
|
|
263
191
|
let {
|
|
264
192
|
disabled
|
|
265
193
|
} = _ref6;
|
|
266
194
|
return !disabled && 'background: var(--color-primary);';
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
${_ref7 => {
|
|
195
|
+
}, _ref7 => {
|
|
271
196
|
let {
|
|
272
197
|
disabled
|
|
273
198
|
} = _ref7;
|
|
274
199
|
return disabled && 'color: var(--font-on-mute)';
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
${_ref8 => {
|
|
200
|
+
}, _ref8 => {
|
|
278
201
|
let {
|
|
279
202
|
selected
|
|
280
203
|
} = _ref8;
|
|
281
204
|
return selected && 'background: var(--color-hover)';
|
|
282
|
-
}
|
|
283
|
-
`;
|
|
205
|
+
});
|
|
284
206
|
var _default = exports.default = Year;
|
|
@@ -6,6 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _utils = require("@cashub/utils");
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
14
|
const useChangeNumber = (min, max, setState, name) => {
|
|
10
15
|
return (0, _react.useCallback)(number => {
|
|
11
16
|
let value = String(number);
|
|
@@ -29,9 +34,7 @@ const useChangeNumber = (min, max, setState, name) => {
|
|
|
29
34
|
}
|
|
30
35
|
setState(previous => {
|
|
31
36
|
if (name && typeof previous === 'object') {
|
|
32
|
-
const newState = {
|
|
33
|
-
...previous
|
|
34
|
-
};
|
|
37
|
+
const newState = _objectSpread({}, previous);
|
|
35
38
|
newState[name] = value;
|
|
36
39
|
return newState;
|
|
37
40
|
}
|
|
@@ -7,6 +7,11 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _pad = _interopRequireDefault(require("../utils/pad"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
15
|
const useDecrease = function (min, max, setState) {
|
|
11
16
|
let config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
12
17
|
const {
|
|
@@ -21,9 +26,7 @@ const useDecrease = function (min, max, setState) {
|
|
|
21
26
|
if (value < min) {
|
|
22
27
|
value = max;
|
|
23
28
|
}
|
|
24
|
-
const newState = {
|
|
25
|
-
...previous
|
|
26
|
-
};
|
|
29
|
+
const newState = _objectSpread({}, previous);
|
|
27
30
|
newState[name] = (0, _pad.default)(value, length, padString);
|
|
28
31
|
return newState;
|
|
29
32
|
}
|
|
@@ -7,6 +7,11 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _pad = _interopRequireDefault(require("../utils/pad"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
15
|
const useIncrease = function (min, max, setState) {
|
|
11
16
|
let config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
12
17
|
const {
|
|
@@ -21,9 +26,7 @@ const useIncrease = function (min, max, setState) {
|
|
|
21
26
|
if (value > max) {
|
|
22
27
|
value = min;
|
|
23
28
|
}
|
|
24
|
-
const newState = {
|
|
25
|
-
...previous
|
|
26
|
-
};
|
|
29
|
+
const newState = _objectSpread({}, previous);
|
|
27
30
|
newState[name] = (0, _pad.default)(value, length, padString);
|
|
28
31
|
return newState;
|
|
29
32
|
}
|