@cashub/ui 0.48.12 → 0.48.14
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 +38 -26
- package/Tab/TabPanel.js +13 -20
- package/Tab/TabTab.js +41 -25
- package/Tab/index.js +3 -6
- package/Tab/subComponent/TabListV2.js +11 -18
- package/Tab/subComponent/TabPanelV2.js +16 -20
- package/Tab/subComponent/TabTabV2.js +33 -21
- package/VerticalTab/TabList.js +13 -18
- package/VerticalTab/TabPanel.js +16 -20
- package/VerticalTab/TabTab.js +40 -21
- package/VerticalTab/VerticalTab.js +8 -4
- package/alert/Alert.js +12 -5
- package/animate/Collapse.js +5 -7
- package/animate/Loader.js +18 -7
- package/animate/PulseRing.js +18 -5
- package/animate/Spinner.js +8 -3
- package/backdrop/BaseBackdrop.js +9 -3
- package/backdrop/LoadingBackdrop.js +7 -3
- package/backdrop/ModalBackdrop.js +5 -3
- package/badge/Badge.js +15 -3
- package/badge/BadgeDot.js +8 -3
- package/badge/BadgeFill.js +24 -6
- package/badge/BadgeWithText.js +13 -3
- package/billing/BarChart.js +1 -1
- package/breadcrumb/Breadcrumb.js +42 -3
- package/button/Button.js +88 -20
- package/button/ButtonGroup.js +33 -9
- package/button/IconButton.js +37 -10
- package/button/ScrollToTopButton.js +12 -4
- package/callout/Callout.js +37 -8
- package/chart/BarChart.js +13 -21
- package/chart/DoughnutChart.js +34 -20
- package/chart/LineChart.js +13 -21
- package/chart/SingleBarChart.js +22 -5
- package/chart/utils/centerTextPlugin.js +2 -2
- package/chart/utils/customTooltip.js +8 -8
- package/chart/utils/htmlLegendPlugin.js +1 -1
- package/chart/utils/yAxisTopTitlePlugin.js +1 -1
- package/container/FlexContainer.js +15 -7
- package/cropper/Cropper.js +1 -2
- package/datetimePicker/DatePicker.js +80 -26
- package/datetimePicker/DatePickerV2.js +95 -36
- package/datetimePicker/DatetimePicker.js +174 -11
- package/datetimePicker/DatetimePickerV2.js +87 -33
- package/datetimePicker/DatetimePickerV3.js +177 -14
- package/datetimePicker/TimeInput.js +35 -10
- package/datetimePicker/TimePicker.js +77 -22
- package/datetimePicker/TimePickerStyle.js +53 -3
- package/datetimePicker/TimePickerV2.js +58 -28
- package/datetimePicker/accordion/Month.js +93 -16
- package/datetimePicker/accordion/Year.js +96 -18
- package/datetimePicker/hooks/useChangeNumber.js +3 -6
- package/datetimePicker/hooks/useDecrease.js +3 -6
- package/datetimePicker/hooks/useIncrease.js +3 -6
- package/datetimePicker/subComponent/Accordion.js +101 -20
- package/descriptionList/DescriptionDetail.js +15 -4
- package/descriptionList/DescriptionList.js +12 -4
- package/descriptionList/DescriptionTerm.js +5 -3
- package/divider/Divider.js +15 -6
- package/dropdown/DropdownButtonOption.js +22 -6
- package/dropdown/DropdownContent.js +29 -15
- package/dropdown/DropdownDivOption.js +17 -3
- package/dropdown/DropdownLinkOption.js +14 -3
- package/dropdown/DropdownToggle.js +7 -15
- package/dropzone/FileDropzone.js +121 -22
- package/dropzone/ImageDropzone.js +83 -14
- package/dropzone/subComponent/Message.js +11 -4
- package/figure/IconFigure.js +16 -7
- package/figure/ImageFigure.js +19 -6
- package/file/HiddenFileInput.js +3 -3
- package/form/Checkbox.js +74 -13
- package/form/Fieldset.js +9 -3
- package/form/FormItem.js +10 -5
- package/form/Input.js +40 -7
- package/form/Label.js +34 -10
- package/form/MutedText.js +8 -4
- package/form/PasswordInput.js +20 -13
- package/form/RadioButton.js +55 -8
- package/form/SearchSelect.js +64 -12
- package/form/Searchbox.js +45 -19
- package/form/Slider.js +28 -10
- package/form/SwitchButton.js +48 -14
- package/form/Textarea.js +30 -3
- package/form/TreeView.js +13 -6
- package/grid/Column.js +23 -10
- package/grid/Grid.js +14 -6
- package/heading/Heading1.js +8 -4
- package/heading/Heading2.js +11 -5
- package/heading/Heading3.js +20 -8
- package/iconbox/ApplicationIconBox.js +48 -12
- package/iconbox/IconBox.js +31 -7
- package/iconbox/IconBoxV2.js +33 -8
- package/iconbox/subComponent/IconBoxFigure.js +17 -9
- package/iconbox/subComponent/IconBoxImage.js +21 -8
- package/image/ImageFluid.js +7 -3
- package/image/UploadImage.js +66 -18
- package/jsoneditor/JsonEditor.js +121 -15
- package/keyframe/Pulse.js +13 -3
- package/keyframe/Spin.js +5 -3
- package/layout/Aside.js +30 -5
- package/layout/Backdrop.js +8 -4
- package/layout/Container.js +21 -5
- package/layout/Footer.js +26 -7
- package/link/LinkSpan.js +37 -19
- package/map/GoogleMap.js +3 -7
- package/map/GoogleReverseGeolocation.js +6 -3
- package/map/LeafletMap.js +2 -2
- package/map/subComponent/GoogleMapContainer.js +16 -4
- package/map/subComponent/GoogleMapPopup.js +7 -10
- package/map/subComponent/GoogleMapWrapper.js +8 -15
- package/map/subComponent/LeafletDrawControl.js +9 -7
- package/map/subComponent/LeafletMapContainer.js +159 -4
- package/modal/StateModal.js +56 -33
- package/modal/TitleModal.js +70 -29
- package/package.json +1 -1
- package/page/Disclaimer.js +119 -3
- package/paginate/Paginate.js +54 -12
- package/popover/Popover.js +30 -25
- package/qrcode/QRCode.js +20 -6
- package/qrcode/QRCodeContainter.js +12 -4
- package/ribbon/Ribbon.js +29 -4
- package/section/Section.js +68 -20
- package/section/SectionBody.js +29 -8
- package/section/SectionHeader.js +36 -11
- package/section/SectionToolbar.js +9 -3
- package/section/SectionToolbarItem.js +8 -3
- package/select/InputSelect.js +16 -23
- package/select/Select.js +112 -43
- package/select/subComponent/Checkbox.js +24 -5
- package/select/subComponent/Footer.js +4 -3
- package/select/subComponent/ListBox.js +12 -5
- package/select/subComponent/Option.js +27 -7
- package/select/subComponent/OptionGroup.js +13 -3
- package/select/subComponent/Options.js +18 -5
- package/select/subComponent/SearchBox.js +34 -12
- package/select/subComponent/SelectedMultipleTags.js +21 -3
- package/select/subComponent/SelectedMultipleText.js +20 -4
- package/select/subComponent/SelectedSingle.js +7 -3
- package/styles/GlobalStyle.js +156 -45
- package/styles/mixin/backgroundColor.js +16 -8
- package/styles/mixin/borderColor.js +13 -7
- package/styles/mixin/color.js +13 -7
- package/styles/mixin/colorOnBackground.js +13 -7
- package/styles/mixin/inputPlaceholder.js +20 -3
- package/styles/mixin/media.js +5 -3
- package/styles/mixin/rounded.js +10 -6
- package/styles/mixin/scrollbar.js +13 -3
- package/styles/theme/dark.theme.js +15 -14
- package/styles/theme/light.theme.js +15 -14
- package/styles/theme/white.theme.js +15 -14
- package/table/GridTable.js +71 -33
- package/table/ImageBox.js +15 -5
- package/table/InfiniteGridTable.js +92 -46
- package/table/PermissionTable.js +32 -10
- package/table/SimpleGridTable.js +52 -17
- package/table/Table.js +198 -48
- package/table/__mock__/columns.js +1 -1
- package/table/subComponent/BaseTableHeadCell.js +37 -8
- package/table/subComponent/GridTableFooter.js +10 -4
- package/table/subComponent/GridTableHeadCell.js +6 -4
- package/table/subComponent/Resizer.js +19 -4
- package/table/subComponent/TableFooter.js +15 -6
- package/table/subComponent/TableFooterInfo.js +4 -3
- package/table/subComponent/TableFooterPager.js +19 -6
- package/table/subComponent/TableHeadCell.js +9 -3
- package/table/subComponent/TableSort.js +17 -7
- package/tagify/TagifyStyle.js +49 -3
- package/tagify/Tags.js +37 -21
- package/tagify/templates/getCreateButtonTemplate.js +5 -2
- package/text/Paragraph.js +50 -12
- package/timeline/Timeline.js +94 -17
- package/toast/CustomToastContainer.js +35 -3
- package/toast/MessageContainer.js +22 -4
- package/tooltip/Tooltip.js +47 -19
- package/treeView/TreeViewV2.js +1 -1
- package/treeView/TreeflexStyle.js +38 -3
- package/wizard/Wizard.js +115 -6
|
@@ -8,24 +8,49 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _rcTimePicker = _interopRequireDefault(require("rc-time-picker"));
|
|
9
9
|
require("rc-time-picker/assets/index.css");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
var _templateObject;
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
|
-
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; }
|
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
-
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
12
|
const TimeInput = props => {
|
|
20
13
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
21
14
|
disabled: props.disabled,
|
|
22
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_rcTimePicker.default,
|
|
15
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_rcTimePicker.default, {
|
|
16
|
+
...props
|
|
17
|
+
})
|
|
23
18
|
});
|
|
24
19
|
};
|
|
25
|
-
const Wrapper = _styledComponents.default.div
|
|
20
|
+
const Wrapper = _styledComponents.default.div`
|
|
21
|
+
.rc-time-picker {
|
|
22
|
+
width: 100%;
|
|
23
|
+
|
|
24
|
+
.rc-time-picker-input {
|
|
25
|
+
height: 36px;
|
|
26
|
+
border-radius: var(--border-radius);
|
|
27
|
+
border: var(--border-width) solid var(--border-color);
|
|
28
|
+
padding: 10px var(--spacing-s);
|
|
29
|
+
color: var(--font-on-background);
|
|
30
|
+
background: transparent;
|
|
31
|
+
font-size: var(--font-body1);
|
|
32
|
+
|
|
33
|
+
${_ref => {
|
|
26
34
|
let {
|
|
27
35
|
disabled
|
|
28
36
|
} = _ref;
|
|
29
37
|
return disabled && 'opacity: 0.5;';
|
|
30
|
-
}
|
|
38
|
+
}}
|
|
39
|
+
|
|
40
|
+
&:focus {
|
|
41
|
+
border: var(--border-width) solid var(--color-primary);
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.rc-time-picker-clear {
|
|
47
|
+
top: 6px;
|
|
48
|
+
right: 8px;
|
|
49
|
+
|
|
50
|
+
i:after {
|
|
51
|
+
font-size: var(--font-body1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
31
56
|
var _default = exports.default = TimeInput;
|
|
@@ -13,14 +13,7 @@ var _utils = require("@cashub/utils");
|
|
|
13
13
|
var _hooks = require("./hooks");
|
|
14
14
|
var _pad = _interopRequireDefault(require("./utils/pad"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
19
|
-
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; }
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
23
|
-
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); }
|
|
24
17
|
const LENGTH = 2;
|
|
25
18
|
const PAD_STRING = '0';
|
|
26
19
|
const TimePicker = _ref => {
|
|
@@ -46,7 +39,7 @@ const TimePicker = _ref => {
|
|
|
46
39
|
});
|
|
47
40
|
(0, _react.useEffect)(() => {
|
|
48
41
|
if (typeof onChange === 'function' && time.hour && time.minute && time.second) {
|
|
49
|
-
onChange(
|
|
42
|
+
onChange(`${time.hour}:${time.minute}:${time.second}`);
|
|
50
43
|
}
|
|
51
44
|
}, [onChange, time.hour, time.minute, time.second]);
|
|
52
45
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
@@ -99,7 +92,9 @@ const Hour = _ref2 => {
|
|
|
99
92
|
onKeyUp: handleKeyUp,
|
|
100
93
|
onBlur: event => {
|
|
101
94
|
setTime(previous => {
|
|
102
|
-
const newState =
|
|
95
|
+
const newState = {
|
|
96
|
+
...previous
|
|
97
|
+
};
|
|
103
98
|
newState[NAME] = (0, _pad.default)(event.target.value, LENGTH, PAD_STRING);
|
|
104
99
|
return newState;
|
|
105
100
|
});
|
|
@@ -123,7 +118,7 @@ const Minute = _ref3 => {
|
|
|
123
118
|
const NAME = 'minute';
|
|
124
119
|
const MIN = 0;
|
|
125
120
|
const MAX = 59;
|
|
126
|
-
const [minuteId] = (0, _react.useState)((0, _lodash.default)(
|
|
121
|
+
const [minuteId] = (0, _react.useState)((0, _lodash.default)(`${NAME}-`));
|
|
127
122
|
const increase = (0, _hooks.useIncrease)(MIN, MAX, setTime, {
|
|
128
123
|
name: NAME,
|
|
129
124
|
length: LENGTH,
|
|
@@ -151,7 +146,9 @@ const Minute = _ref3 => {
|
|
|
151
146
|
onKeyUp: handleKeyUp,
|
|
152
147
|
onBlur: event => {
|
|
153
148
|
setTime(previous => {
|
|
154
|
-
const newState =
|
|
149
|
+
const newState = {
|
|
150
|
+
...previous
|
|
151
|
+
};
|
|
155
152
|
newState[NAME] = (0, _pad.default)(event.target.value, LENGTH, PAD_STRING);
|
|
156
153
|
return newState;
|
|
157
154
|
});
|
|
@@ -176,7 +173,7 @@ const Second = _ref4 => {
|
|
|
176
173
|
const NAME = 'second';
|
|
177
174
|
const MIN = 0;
|
|
178
175
|
const MAX = 59;
|
|
179
|
-
const [secondId] = (0, _react.useState)((0, _lodash.default)(
|
|
176
|
+
const [secondId] = (0, _react.useState)((0, _lodash.default)(`${NAME}-`));
|
|
180
177
|
const increase = (0, _hooks.useIncrease)(MIN, MAX, setTime, {
|
|
181
178
|
name: NAME,
|
|
182
179
|
length: LENGTH,
|
|
@@ -204,7 +201,9 @@ const Second = _ref4 => {
|
|
|
204
201
|
onKeyUp: handleKeyUp,
|
|
205
202
|
onBlur: event => {
|
|
206
203
|
setTime(previous => {
|
|
207
|
-
const newState =
|
|
204
|
+
const newState = {
|
|
205
|
+
...previous
|
|
206
|
+
};
|
|
208
207
|
newState[NAME] = (0, _pad.default)(event.target.value, LENGTH, PAD_STRING);
|
|
209
208
|
return newState;
|
|
210
209
|
});
|
|
@@ -233,14 +232,18 @@ const useKeyUp = (increase, decrease, min, max, setState, name) => {
|
|
|
233
232
|
break;
|
|
234
233
|
case _utils.KEY_CODE.HOME:
|
|
235
234
|
setState(previous => {
|
|
236
|
-
const newState =
|
|
235
|
+
const newState = {
|
|
236
|
+
...previous
|
|
237
|
+
};
|
|
237
238
|
newState[name] = (0, _pad.default)(min, LENGTH, PAD_STRING);
|
|
238
239
|
return newState;
|
|
239
240
|
});
|
|
240
241
|
break;
|
|
241
242
|
case _utils.KEY_CODE.END:
|
|
242
243
|
setState(previous => {
|
|
243
|
-
const newState =
|
|
244
|
+
const newState = {
|
|
245
|
+
...previous
|
|
246
|
+
};
|
|
244
247
|
newState[name] = (0, _pad.default)(max, LENGTH, PAD_STRING);
|
|
245
248
|
return newState;
|
|
246
249
|
});
|
|
@@ -250,13 +253,65 @@ const useKeyUp = (increase, decrease, min, max, setState, name) => {
|
|
|
250
253
|
}
|
|
251
254
|
}, [increase, decrease, min, max, setState, name]);
|
|
252
255
|
};
|
|
253
|
-
const Container = _styledComponents.default.div
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
256
|
+
const Container = _styledComponents.default.div`
|
|
257
|
+
display: flex;
|
|
258
|
+
align-items: center;
|
|
259
|
+
justify-content: center;
|
|
260
|
+
`;
|
|
261
|
+
const Label = _styledComponents.default.label`
|
|
262
|
+
display: inline-block;
|
|
263
|
+
color: var(--font-on-background);
|
|
264
|
+
font-size: var(--font-body1);
|
|
265
|
+
margin-right: 12px;
|
|
266
|
+
`;
|
|
267
|
+
const Section = _styledComponents.default.div`
|
|
268
|
+
display: inline-flex;
|
|
269
|
+
height: 36px;
|
|
270
|
+
width: 56px;
|
|
271
|
+
padding: calc(var(--spacing-xs) / 2) var(--spacing-xs);
|
|
272
|
+
border: var(--border-width) solid var(--border-color);
|
|
273
|
+
border-radius: var(--border-radius-s);
|
|
274
|
+
background: transparent;
|
|
275
|
+
color: var(--font-on-background);
|
|
276
|
+
`;
|
|
277
|
+
const Input = _styledComponents.default.input`
|
|
278
|
+
width: calc(100% - 4px - 12px);
|
|
279
|
+
border: none;
|
|
280
|
+
background: transparent;
|
|
281
|
+
color: inherit;
|
|
282
|
+
|
|
283
|
+
&:focus {
|
|
284
|
+
outline: none;
|
|
285
|
+
}
|
|
286
|
+
`;
|
|
257
287
|
const StepperButton = _styledComponents.default.div.attrs(() => ({
|
|
258
288
|
role: 'button'
|
|
259
|
-
}))
|
|
260
|
-
|
|
261
|
-
|
|
289
|
+
}))`
|
|
290
|
+
width: 12px;
|
|
291
|
+
height: 12px;
|
|
292
|
+
|
|
293
|
+
> svg {
|
|
294
|
+
width: 100%;
|
|
295
|
+
height: 100%;
|
|
296
|
+
vertical-align: top;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
&:first-child {
|
|
300
|
+
margin-bottom: 2px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&:hover {
|
|
304
|
+
color: var(--color-primary);
|
|
305
|
+
}
|
|
306
|
+
`;
|
|
307
|
+
const Stepper = _styledComponents.default.div`
|
|
308
|
+
margin-left: calc(var(--spacing-xs) / 2);
|
|
309
|
+
`;
|
|
310
|
+
const Delimiter = _styledComponents.default.span`
|
|
311
|
+
display: inline-block;
|
|
312
|
+
color: var(--font-on-background);
|
|
313
|
+
font-size: var(--font-body1);
|
|
314
|
+
width: 12px;
|
|
315
|
+
text-align: center;
|
|
316
|
+
`;
|
|
262
317
|
var _default = exports.default = TimePicker;
|
|
@@ -6,9 +6,59 @@ 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;
|
|
10
9
|
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) } })); }
|
|
12
10
|
// integrate rc-time-picker component
|
|
13
|
-
const TimePickerStyle = (0, _styledComponents.createGlobalStyle)
|
|
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
|
+
`;
|
|
14
64
|
var _default = exports.default = TimePickerStyle;
|
|
@@ -13,16 +13,9 @@ 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;
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
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); }
|
|
19
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; }
|
|
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); }
|
|
26
19
|
const LENGTH = 2;
|
|
27
20
|
const PAD_STRING = '0';
|
|
28
21
|
const HOUR_OPTIONS = (0, _utils.generateRange)(0, 23).map(value => {
|
|
@@ -75,22 +68,20 @@ const TimePickerV2 = _ref => {
|
|
|
75
68
|
update();
|
|
76
69
|
};
|
|
77
70
|
const handleChange = (type, value) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
const next = {
|
|
72
|
+
...time,
|
|
73
|
+
[type]: value
|
|
74
|
+
};
|
|
75
|
+
setTime(next);
|
|
76
|
+
if (typeof onSelect === 'function' && next.hour && next.minute && next.second) {
|
|
77
|
+
onSelect(`${next.hour}:${next.minute}:${next.second}`);
|
|
78
|
+
}
|
|
83
79
|
};
|
|
84
80
|
|
|
85
81
|
// sync time picker state when selected value changes
|
|
86
82
|
(0, _react.useEffect)(() => {
|
|
87
83
|
setTime(getTimeFromSelected(selected, allowEmpty));
|
|
88
84
|
}, [allowEmpty, selected]);
|
|
89
|
-
(0, _react.useEffect)(() => {
|
|
90
|
-
if (typeof onSelect === 'function' && time.hour && time.minute && time.second) {
|
|
91
|
-
onSelect("".concat(time.hour, ":").concat(time.minute, ":").concat(time.second));
|
|
92
|
-
}
|
|
93
|
-
}, [onSelect, time.hour, time.minute, time.second]);
|
|
94
85
|
(0, _react.useEffect)(() => {
|
|
95
86
|
if (display) {
|
|
96
87
|
const {
|
|
@@ -114,12 +105,12 @@ const TimePickerV2 = _ref => {
|
|
|
114
105
|
type: "text",
|
|
115
106
|
readOnly: true,
|
|
116
107
|
onClick: handleToggle,
|
|
117
|
-
value: time.hour && time.minute && time.second ?
|
|
118
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Panel,
|
|
108
|
+
value: time.hour && time.minute && time.second ? `${time.hour}:${time.minute}:${time.second}` : ''
|
|
109
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Panel, {
|
|
119
110
|
ref: setPopperElement,
|
|
120
111
|
$display: display,
|
|
121
|
-
style: styles.popper
|
|
122
|
-
|
|
112
|
+
style: styles.popper,
|
|
113
|
+
...attributes.popper,
|
|
123
114
|
placement: state && state.placement,
|
|
124
115
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Picker, {
|
|
125
116
|
children: HOUR_OPTIONS.map(option => {
|
|
@@ -158,21 +149,60 @@ const TimePickerV2 = _ref => {
|
|
|
158
149
|
}, option);
|
|
159
150
|
})
|
|
160
151
|
})]
|
|
161
|
-
})
|
|
152
|
+
})]
|
|
162
153
|
})
|
|
163
154
|
});
|
|
164
155
|
};
|
|
165
|
-
const Panel = _styledComponents.default.div
|
|
156
|
+
const Panel = _styledComponents.default.div`
|
|
157
|
+
display: flex;
|
|
158
|
+
visibility: ${_ref2 => {
|
|
166
159
|
let {
|
|
167
160
|
$display
|
|
168
161
|
} = _ref2;
|
|
169
162
|
return $display ? 'visible' : 'hidden';
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
}};
|
|
164
|
+
width: 100%;
|
|
165
|
+
max-width: 360px;
|
|
166
|
+
background: var(--color-background1);
|
|
167
|
+
color: var(--font-on-background);
|
|
168
|
+
border: var(--border-width) solid var(--border-color);
|
|
169
|
+
border-radius: var(--border-radius);
|
|
170
|
+
box-shadow: var(--box-shadow);
|
|
171
|
+
z-index: 85;
|
|
172
|
+
`;
|
|
173
|
+
const Picker = _styledComponents.default.ul`
|
|
174
|
+
flex: 1;
|
|
175
|
+
text-align: center;
|
|
176
|
+
max-height: 144px;
|
|
177
|
+
overflow-y: auto;
|
|
178
|
+
|
|
179
|
+
${_scrollbar.default}
|
|
180
|
+
|
|
181
|
+
&:first-child {
|
|
182
|
+
border-top-left-radius: var(--border-radius);
|
|
183
|
+
border-bottom-left-radius: var(--border-radius);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&:not(:last-child) {
|
|
187
|
+
border-right: var(--border-width) solid var(--border-color);
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
const Option = _styledComponents.default.li`
|
|
191
|
+
padding: var(--spacing-xs) 0;
|
|
192
|
+
background: var(--color-background1);
|
|
193
|
+
transition: background 0.3s;
|
|
194
|
+
|
|
195
|
+
&:hover {
|
|
196
|
+
background: var(--color-hover);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
${_ref3 => {
|
|
173
200
|
let {
|
|
174
201
|
selected
|
|
175
202
|
} = _ref3;
|
|
176
|
-
return selected && (0, _styledComponents.css)
|
|
177
|
-
|
|
203
|
+
return selected && (0, _styledComponents.css)`
|
|
204
|
+
background: var(--color-hover);
|
|
205
|
+
`;
|
|
206
|
+
}}
|
|
207
|
+
`;
|
|
178
208
|
var _default = exports.default = TimePickerV2;
|
|
@@ -12,11 +12,9 @@ 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;
|
|
16
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
16
|
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
17
|
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) } })); }
|
|
20
18
|
const Month = _ref => {
|
|
21
19
|
let {
|
|
22
20
|
expand,
|
|
@@ -134,44 +132,123 @@ const Month = _ref => {
|
|
|
134
132
|
})]
|
|
135
133
|
});
|
|
136
134
|
};
|
|
137
|
-
const Header = _styledComponents.default.div
|
|
138
|
-
|
|
135
|
+
const Header = _styledComponents.default.div`
|
|
136
|
+
display: flex;
|
|
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 => {
|
|
139
171
|
let {
|
|
140
172
|
disabled
|
|
141
173
|
} = _ref2;
|
|
142
|
-
return disabled && (0, _styledComponents.css)
|
|
143
|
-
|
|
174
|
+
return disabled && (0, _styledComponents.css)`
|
|
175
|
+
opacity: 0.5;
|
|
176
|
+
|
|
177
|
+
&:hover {
|
|
178
|
+
color: var(--font-on-background);
|
|
179
|
+
}
|
|
180
|
+
`;
|
|
181
|
+
}}
|
|
182
|
+
|
|
183
|
+
${_ref3 => {
|
|
144
184
|
let {
|
|
145
185
|
right,
|
|
146
186
|
$rotate
|
|
147
187
|
} = _ref3;
|
|
148
|
-
return right &&
|
|
149
|
-
|
|
150
|
-
|
|
188
|
+
return right && `
|
|
189
|
+
position: absolute;
|
|
190
|
+
right: 0;
|
|
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 => {
|
|
151
202
|
let {
|
|
152
203
|
expand
|
|
153
204
|
} = _ref4;
|
|
154
205
|
return expand ? 'flex' : 'none';
|
|
155
|
-
}
|
|
206
|
+
}};
|
|
207
|
+
|
|
208
|
+
${_ref5 => {
|
|
156
209
|
let {
|
|
157
210
|
fixedYear
|
|
158
211
|
} = _ref5;
|
|
159
|
-
return (0, _styledComponents.css)
|
|
160
|
-
}
|
|
161
|
-
|
|
212
|
+
return (0, _styledComponents.css)`
|
|
213
|
+
min-height: ${fixedYear ? '192' : '144'}px;
|
|
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 => {
|
|
162
233
|
let {
|
|
163
234
|
disabled
|
|
164
235
|
} = _ref6;
|
|
165
236
|
return !disabled && 'background: var(--color-primary)';
|
|
166
|
-
}
|
|
237
|
+
}}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
${_ref7 => {
|
|
167
241
|
let {
|
|
168
242
|
disabled
|
|
169
243
|
} = _ref7;
|
|
170
244
|
return disabled && 'color: var(--font-on-mute)';
|
|
171
|
-
}
|
|
245
|
+
}}
|
|
246
|
+
|
|
247
|
+
${_ref8 => {
|
|
172
248
|
let {
|
|
173
249
|
selected
|
|
174
250
|
} = _ref8;
|
|
175
251
|
return selected && 'background: var(--color-hover)';
|
|
176
|
-
}
|
|
252
|
+
}}
|
|
253
|
+
`;
|
|
177
254
|
var _default = exports.default = Month;
|