@cashub/ui 0.48.14 → 0.48.16
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 +25 -37
- 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 +21 -13
- package/chart/DoughnutChart.js +20 -34
- package/chart/LineChart.js +21 -13
- package/chart/SingleBarChart.js +5 -22
- 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 +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 +62 -69
- 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 +87 -128
- 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
package/section/SectionHeader.js
CHANGED
|
@@ -6,65 +6,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _header = _interopRequireDefault(require("../styles/config/header.style"));
|
|
9
|
+
var _templateObject, _templateObject2;
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
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); }
|
|
11
12
|
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; }
|
|
12
|
-
|
|
13
|
-
background: transparent
|
|
14
|
-
padding: 0;
|
|
15
|
-
margin-bottom: calc(var(--spacing-s) * -1);
|
|
16
|
-
|
|
17
|
-
> * {
|
|
18
|
-
padding-bottom: var(--spacing-s);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
${_ref => {
|
|
13
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
14
|
+
const SectionHeader = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: transparent;\n padding: 0;\n margin-bottom: calc(var(--spacing-s) * -1);\n\n > * {\n padding-bottom: var(--spacing-s);\n }\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), _ref => {
|
|
22
15
|
let {
|
|
23
16
|
inline
|
|
24
17
|
} = _ref;
|
|
25
|
-
return inline && (0, _styledComponents.css)
|
|
26
|
-
|
|
27
|
-
justify-content: space-between;
|
|
28
|
-
align-items: center;
|
|
29
|
-
`;
|
|
30
|
-
}}
|
|
31
|
-
|
|
32
|
-
${_ref2 => {
|
|
18
|
+
return inline && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n "])));
|
|
19
|
+
}, _ref2 => {
|
|
33
20
|
let {
|
|
34
21
|
flexStart
|
|
35
22
|
} = _ref2;
|
|
36
23
|
return flexStart && 'justify-content: flex-start;';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
${_ref3 => {
|
|
24
|
+
}, _ref3 => {
|
|
40
25
|
let {
|
|
41
26
|
border
|
|
42
27
|
} = _ref3;
|
|
43
28
|
return border && 'border-bottom: var(--border-width) solid var(--border-color);';
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
${_ref4 => {
|
|
29
|
+
}, _ref4 => {
|
|
47
30
|
let {
|
|
48
31
|
backgroundFill
|
|
49
32
|
} = _ref4;
|
|
50
33
|
return backgroundFill && 'background: var(--color-background1);';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
${_ref5 => {
|
|
34
|
+
}, _ref5 => {
|
|
54
35
|
let {
|
|
55
36
|
backgroundReverse
|
|
56
37
|
} = _ref5;
|
|
57
38
|
return backgroundReverse && 'background: var(--color-background2);';
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
${_ref6 => {
|
|
39
|
+
}, _ref6 => {
|
|
61
40
|
let {
|
|
62
41
|
sticky
|
|
63
42
|
} = _ref6;
|
|
64
|
-
return sticky &&
|
|
65
|
-
|
|
66
|
-
top: ${_header.default.height};
|
|
67
|
-
`;
|
|
68
|
-
}}
|
|
69
|
-
`;
|
|
43
|
+
return sticky && "position: sticky;\n z-index:20;\n top: ".concat(_header.default.height, ";\n ");
|
|
44
|
+
});
|
|
70
45
|
var _default = exports.default = SectionHeader;
|
|
@@ -5,14 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
8
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: space-between;
|
|
12
|
-
align-items: center;
|
|
13
|
-
|
|
14
|
-
> *:not(:first-child) {
|
|
15
|
-
margin-left: var(--spacing-s);
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
10
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
11
|
+
const SectionToolbar = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n > *:not(:first-child) {\n margin-left: var(--spacing-s);\n }\n"])));
|
|
18
12
|
var _default = exports.default = SectionToolbar;
|
|
@@ -5,13 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
8
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
|
|
13
|
-
> *:not(:first-child) {
|
|
14
|
-
margin-left: var(--spacing-s);
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
10
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
11
|
+
const SectionToolbarItem = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n > *:not(:first-child) {\n margin-left: var(--spacing-s);\n }\n"])));
|
|
17
12
|
var _default = exports.default = SectionToolbarItem;
|
package/select/InputSelect.js
CHANGED
|
@@ -13,16 +13,24 @@ var _ListBox = _interopRequireDefault(require("./subComponent/ListBox"));
|
|
|
13
13
|
var _Option = _interopRequireDefault(require("./subComponent/Option"));
|
|
14
14
|
var _Options = _interopRequireDefault(require("./subComponent/Options"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
const _excluded = ["options", "value", "disabled", "onChange", "onSelect"];
|
|
16
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
22
|
+
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); }
|
|
23
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
24
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
17
25
|
const InputSelect = _ref => {
|
|
18
26
|
let {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
options = [],
|
|
28
|
+
value,
|
|
29
|
+
disabled,
|
|
30
|
+
onChange,
|
|
31
|
+
onSelect
|
|
32
|
+
} = _ref,
|
|
33
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
34
|
const [displayListBox, setDisplayListBox] = (0, _react.useState)(false);
|
|
27
35
|
const [filteredOptions, setFilteredOptions] = (0, _react.useState)([]);
|
|
28
36
|
const [optionList, setOptionList] = (0, _react.useState)([]);
|
|
@@ -221,10 +229,9 @@ const InputSelect = _ref => {
|
|
|
221
229
|
} else {
|
|
222
230
|
selected = false;
|
|
223
231
|
}
|
|
224
|
-
return {
|
|
225
|
-
...option,
|
|
232
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
226
233
|
selected
|
|
227
|
-
};
|
|
234
|
+
});
|
|
228
235
|
}));
|
|
229
236
|
}, [filteredOptions, parsedSelected]);
|
|
230
237
|
(0, _react.useEffect)(() => {
|
|
@@ -236,16 +243,16 @@ const InputSelect = _ref => {
|
|
|
236
243
|
onOutsideClick: () => {
|
|
237
244
|
setDisplayListBox(false);
|
|
238
245
|
},
|
|
239
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default, {
|
|
240
|
-
autoComplete: "off"
|
|
241
|
-
|
|
246
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default, _objectSpread(_objectSpread(_objectSpread({
|
|
247
|
+
autoComplete: "off"
|
|
248
|
+
}, props), {}, {
|
|
242
249
|
onChange: event => {
|
|
243
250
|
onChange(event);
|
|
244
251
|
if (!displayListBox) setDisplayListBox(true);
|
|
245
252
|
},
|
|
246
253
|
value: value,
|
|
247
|
-
ref: setListBoxElement
|
|
248
|
-
|
|
254
|
+
ref: setListBoxElement
|
|
255
|
+
}, attributes.popper), {}, {
|
|
249
256
|
placement: state && state.placement,
|
|
250
257
|
onClick: handleDisplay,
|
|
251
258
|
onKeyUp: handleKeyUp,
|
|
@@ -253,7 +260,7 @@ const InputSelect = _ref => {
|
|
|
253
260
|
setDisplayListBox(true);
|
|
254
261
|
},
|
|
255
262
|
onKeyDown: handleKeyDown
|
|
256
|
-
}), optionItem.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListBox.default, {
|
|
263
|
+
})), optionItem.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListBox.default, {
|
|
257
264
|
style: styles.popper,
|
|
258
265
|
$display: displayListBox,
|
|
259
266
|
ref: setDropdownElement,
|
package/select/Select.js
CHANGED
|
@@ -28,7 +28,14 @@ var _Footer = _interopRequireDefault(require("./subComponent/Footer"));
|
|
|
28
28
|
var _figure = require("../figure");
|
|
29
29
|
var _image = require("../image");
|
|
30
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
31
32
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
33
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
34
|
+
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; }
|
|
35
|
+
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; }
|
|
36
|
+
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; }
|
|
37
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
38
|
+
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); }
|
|
32
39
|
const Select = _ref => {
|
|
33
40
|
let {
|
|
34
41
|
options,
|
|
@@ -77,10 +84,9 @@ const Select = _ref => {
|
|
|
77
84
|
const newOptions = (0, _react.useMemo)(() => {
|
|
78
85
|
if (!options) return;
|
|
79
86
|
const newOptions = options.map(item => {
|
|
80
|
-
return {
|
|
81
|
-
isDisable: false
|
|
82
|
-
|
|
83
|
-
};
|
|
87
|
+
return _objectSpread({
|
|
88
|
+
isDisable: false
|
|
89
|
+
}, item);
|
|
84
90
|
});
|
|
85
91
|
if (options.length > 0 && multiple && enableSelectAll) {
|
|
86
92
|
newOptions.unshift({
|
|
@@ -122,6 +128,31 @@ const Select = _ref => {
|
|
|
122
128
|
}
|
|
123
129
|
return false;
|
|
124
130
|
}, [displayMode, multiple]);
|
|
131
|
+
const getOptionText = (0, _react.useCallback)(option => {
|
|
132
|
+
return [option.text, option.suffix].filter(text => text || text === 0).join(' ');
|
|
133
|
+
}, []);
|
|
134
|
+
const renderOptionContent = (0, _react.useCallback)(option => {
|
|
135
|
+
var _option$highlightText;
|
|
136
|
+
const text = getOptionText(option);
|
|
137
|
+
const highlightText = (_option$highlightText = option.highlightText) === null || _option$highlightText === void 0 ? void 0 : _option$highlightText.toString();
|
|
138
|
+
if (highlightText && text.includes(highlightText)) {
|
|
139
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionLabel, {
|
|
140
|
+
children: text.split(highlightText).map((textPart, index, textParts) => {
|
|
141
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
142
|
+
children: [textPart, index < textParts.length - 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionHighlight, {
|
|
143
|
+
$color: option.highlightColor,
|
|
144
|
+
children: highlightText
|
|
145
|
+
})]
|
|
146
|
+
}, "".concat(highlightText, "-").concat(index));
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(OptionLabel, {
|
|
151
|
+
children: [option.text, option.suffix && /*#__PURE__*/(0, _jsxRuntime.jsxs)(OptionBadge, {
|
|
152
|
+
children: ["\xA0", option.suffix]
|
|
153
|
+
})]
|
|
154
|
+
});
|
|
155
|
+
}, [getOptionText]);
|
|
125
156
|
|
|
126
157
|
// set focused option
|
|
127
158
|
const handleFocusItem = (0, _react.useCallback)(element => {
|
|
@@ -188,13 +219,13 @@ const Select = _ref => {
|
|
|
188
219
|
return id === value;
|
|
189
220
|
});
|
|
190
221
|
});
|
|
191
|
-
const actualOpt = targetOption
|
|
222
|
+
const actualOpt = targetOption !== null && targetOption !== void 0 && targetOption.child ? targetOption.child.find(_ref4 => {
|
|
192
223
|
let {
|
|
193
224
|
id
|
|
194
225
|
} = _ref4;
|
|
195
226
|
return id === value;
|
|
196
227
|
}) : targetOption;
|
|
197
|
-
if (actualOpt
|
|
228
|
+
if (actualOpt !== null && actualOpt !== void 0 && actualOpt.isDisable) return;
|
|
198
229
|
|
|
199
230
|
// 選取選項
|
|
200
231
|
// 點選 all 全選
|
|
@@ -266,7 +297,7 @@ const Select = _ref => {
|
|
|
266
297
|
}] = selectedOptions;
|
|
267
298
|
} else {
|
|
268
299
|
text = selectedOptions.map(value => {
|
|
269
|
-
return value
|
|
300
|
+
return getOptionText(value);
|
|
270
301
|
}).join(', ');
|
|
271
302
|
}
|
|
272
303
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectedMultipleText.default, {
|
|
@@ -275,14 +306,14 @@ const Select = _ref => {
|
|
|
275
306
|
}
|
|
276
307
|
if (selectedOptions[0].id === allOptionId) {
|
|
277
308
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectedMultipleTags.default, {
|
|
278
|
-
content: selectedOptions[0]
|
|
309
|
+
content: renderOptionContent(selectedOptions[0]),
|
|
279
310
|
onClick: event => handleOnDeselect(event, selectedOptions[0].id),
|
|
280
311
|
disabled: disabled
|
|
281
312
|
}, selectedOptions[0].id);
|
|
282
313
|
}
|
|
283
314
|
return selectedOptions.map(value => {
|
|
284
315
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectedMultipleTags.default, {
|
|
285
|
-
content: value
|
|
316
|
+
content: renderOptionContent(value),
|
|
286
317
|
onClick: event => handleOnDeselect(event, value.id),
|
|
287
318
|
disabled: disabled
|
|
288
319
|
}, value.id);
|
|
@@ -291,11 +322,11 @@ const Select = _ref => {
|
|
|
291
322
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_SelectedSingle.default, {
|
|
292
323
|
children: [selectedOptions[0].icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
293
324
|
src: selectedOptions[0].icon
|
|
294
|
-
}), selectedOptions[0]
|
|
325
|
+
}), renderOptionContent(selectedOptions[0])]
|
|
295
326
|
});
|
|
296
327
|
}
|
|
297
328
|
return placeholder;
|
|
298
|
-
}, [placeholder, handleOnDeselect, multiple, displayMode, selectedOptions, disabled, allOptionId]);
|
|
329
|
+
}, [placeholder, handleOnDeselect, multiple, displayMode, selectedOptions, disabled, allOptionId, getOptionText, renderOptionContent]);
|
|
299
330
|
const optionItem = (0, _react.useMemo)(() => {
|
|
300
331
|
if (optionList.length <= 0) return null;
|
|
301
332
|
return optionList.map(option => {
|
|
@@ -307,7 +338,7 @@ const Select = _ref => {
|
|
|
307
338
|
id: option.text,
|
|
308
339
|
children: option.text
|
|
309
340
|
}), option.child.map(option => {
|
|
310
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
341
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Option.default, {
|
|
311
342
|
role: "option",
|
|
312
343
|
tabIndex: option.isDisable ? '-1' : '0',
|
|
313
344
|
id: option.id,
|
|
@@ -317,9 +348,7 @@ const Select = _ref => {
|
|
|
317
348
|
"aria-selected": option.selected,
|
|
318
349
|
"aria-disabled": option.isDisable,
|
|
319
350
|
disabled: option.isDisable,
|
|
320
|
-
children:
|
|
321
|
-
children: ["\xA0", option.suffix]
|
|
322
|
-
})]
|
|
351
|
+
children: renderOptionContent(option)
|
|
323
352
|
}, option.id);
|
|
324
353
|
})]
|
|
325
354
|
}, option.text);
|
|
@@ -339,12 +368,10 @@ const Select = _ref => {
|
|
|
339
368
|
disabled: option.isDisable
|
|
340
369
|
}), option.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
341
370
|
src: option.icon
|
|
342
|
-
}), option
|
|
343
|
-
children: ["\xA0", option.suffix]
|
|
344
|
-
})]
|
|
371
|
+
}), renderOptionContent(option)]
|
|
345
372
|
}, option.id);
|
|
346
373
|
});
|
|
347
|
-
}, [optionList, focusedOption, handleOnSelect, showCheckbox]);
|
|
374
|
+
}, [optionList, focusedOption, handleOnSelect, showCheckbox, renderOptionContent]);
|
|
348
375
|
|
|
349
376
|
// show or hide listbox
|
|
350
377
|
// and set listbox width according to combobox current width
|
|
@@ -510,8 +537,7 @@ const Select = _ref => {
|
|
|
510
537
|
if (!filteredOptions) return;
|
|
511
538
|
setOptionList(filteredOptions.map(option => {
|
|
512
539
|
if (option.child && option.child.length > 0) {
|
|
513
|
-
return {
|
|
514
|
-
...option,
|
|
540
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
515
541
|
child: option.child.map(option => {
|
|
516
542
|
let selected = false;
|
|
517
543
|
if (multiple && selectedAllOptions.includes(option.id.toString())) {
|
|
@@ -519,12 +545,11 @@ const Select = _ref => {
|
|
|
519
545
|
} else if (selectedAllOptions === option.id.toString()) {
|
|
520
546
|
selected = true;
|
|
521
547
|
}
|
|
522
|
-
return {
|
|
523
|
-
...option,
|
|
548
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
524
549
|
selected
|
|
525
|
-
};
|
|
550
|
+
});
|
|
526
551
|
})
|
|
527
|
-
};
|
|
552
|
+
});
|
|
528
553
|
}
|
|
529
554
|
let selected = false;
|
|
530
555
|
if (multiple && selectedAllOptions.includes(option.id.toString())) {
|
|
@@ -532,10 +557,9 @@ const Select = _ref => {
|
|
|
532
557
|
} else if (selectedAllOptions === option.id.toString()) {
|
|
533
558
|
selected = true;
|
|
534
559
|
}
|
|
535
|
-
return {
|
|
536
|
-
...option,
|
|
560
|
+
return _objectSpread(_objectSpread({}, option), {}, {
|
|
537
561
|
selected
|
|
538
|
-
};
|
|
562
|
+
});
|
|
539
563
|
}));
|
|
540
564
|
}, [filteredOptions, multiple, selectedAllOptions]);
|
|
541
565
|
|
|
@@ -544,19 +568,18 @@ const Select = _ref => {
|
|
|
544
568
|
const tmpFilteredOptions = [];
|
|
545
569
|
newOptions.forEach(option => {
|
|
546
570
|
if (option.child && option.child.length > 0) {
|
|
547
|
-
const tmpFilteredChildOptions = option.child.filter(option => option.
|
|
571
|
+
const tmpFilteredChildOptions = option.child.filter(option => getOptionText(option).toLowerCase().indexOf(search.toLowerCase().trim()) !== -1);
|
|
548
572
|
if (tmpFilteredChildOptions.length > 0) {
|
|
549
|
-
tmpFilteredOptions.push({
|
|
550
|
-
...option,
|
|
573
|
+
tmpFilteredOptions.push(_objectSpread(_objectSpread({}, option), {}, {
|
|
551
574
|
child: tmpFilteredChildOptions
|
|
552
|
-
});
|
|
575
|
+
}));
|
|
553
576
|
}
|
|
554
|
-
} else if (option.
|
|
577
|
+
} else if (getOptionText(option).toLowerCase().indexOf(search.toLowerCase().trim()) !== -1) {
|
|
555
578
|
tmpFilteredOptions.push(option);
|
|
556
579
|
}
|
|
557
580
|
});
|
|
558
581
|
setFilteredOptions(tmpFilteredOptions);
|
|
559
|
-
}, [search, newOptions]);
|
|
582
|
+
}, [search, newOptions, getOptionText]);
|
|
560
583
|
(0, _react.useEffect)(() => {
|
|
561
584
|
if (display) {
|
|
562
585
|
setupFocus();
|
|
@@ -603,7 +626,7 @@ const Select = _ref => {
|
|
|
603
626
|
"aria-haspopup": "listbox",
|
|
604
627
|
"aria-expanded": display
|
|
605
628
|
})]
|
|
606
|
-
}), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, {
|
|
629
|
+
}), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, _objectSpread(_objectSpread({
|
|
607
630
|
role: "listbox",
|
|
608
631
|
tabIndex: "0",
|
|
609
632
|
id: id,
|
|
@@ -612,8 +635,8 @@ const Select = _ref => {
|
|
|
612
635
|
onKeyDown: handleKeyDown,
|
|
613
636
|
width: listBoxWidth,
|
|
614
637
|
$display: display,
|
|
615
|
-
style: styles.popper
|
|
616
|
-
|
|
638
|
+
style: styles.popper
|
|
639
|
+
}, attributes.popper), {}, {
|
|
617
640
|
placement: state && state.placement,
|
|
618
641
|
children: [allowSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchBox.default, {
|
|
619
642
|
ref: searchBoxElement,
|
|
@@ -629,7 +652,7 @@ const Select = _ref => {
|
|
|
629
652
|
}), footer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Footer.default, {
|
|
630
653
|
children: footer
|
|
631
654
|
})]
|
|
632
|
-
}), document.body)]
|
|
655
|
+
})), document.body)]
|
|
633
656
|
})
|
|
634
657
|
});
|
|
635
658
|
};
|
|
@@ -649,129 +672,65 @@ const Icon = _ref5 => {
|
|
|
649
672
|
}), "\xA0"]
|
|
650
673
|
});
|
|
651
674
|
};
|
|
652
|
-
const Combobox = _styledComponents.default.div
|
|
653
|
-
display: flex;
|
|
654
|
-
flex-wrap: wrap;
|
|
655
|
-
align-items: center;
|
|
656
|
-
min-height: 36px;
|
|
657
|
-
cursor: pointer;
|
|
658
|
-
position: relative;
|
|
659
|
-
background: transparent;
|
|
660
|
-
color: var(--font-on-background);
|
|
661
|
-
font-size: var(--font-body1);
|
|
662
|
-
border: var(--border-width) solid var(--border-color);
|
|
663
|
-
border-radius: var(--border-radius-l);
|
|
664
|
-
padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);
|
|
665
|
-
|
|
666
|
-
&:focus {
|
|
667
|
-
${_ref6 => {
|
|
675
|
+
const Combobox = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: 36px;\n cursor: pointer;\n position: relative;\n background: transparent;\n color: var(--font-on-background);\n font-size: var(--font-body1);\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius-l);\n padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);\n\n &:focus {\n ", ";\n }\n\n ", "\n\n ", "\n\n ", "\n ", "\n \n ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), _ref6 => {
|
|
668
676
|
let {
|
|
669
677
|
disabled
|
|
670
678
|
} = _ref6;
|
|
671
|
-
return !disabled &&
|
|
672
|
-
|
|
673
|
-
outline: none;
|
|
674
|
-
`;
|
|
675
|
-
}};
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
${_ref7 => {
|
|
679
|
+
return !disabled && "\n border-color: var(--color-primary);\n outline: none;\n ";
|
|
680
|
+
}, _ref7 => {
|
|
679
681
|
let {
|
|
680
682
|
flexGrow
|
|
681
683
|
} = _ref7;
|
|
682
684
|
return !flexGrow && 'min-width: 160px;';
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
${_ref8 => {
|
|
685
|
+
}, _ref8 => {
|
|
686
686
|
let {
|
|
687
687
|
$display
|
|
688
688
|
} = _ref8;
|
|
689
|
-
return $display &&
|
|
690
|
-
|
|
691
|
-
outline: none;
|
|
692
|
-
`;
|
|
693
|
-
}}
|
|
694
|
-
|
|
695
|
-
${_ref9 => {
|
|
689
|
+
return $display && "\n border-color: var(--color-primary);\n outline: none;\n ";
|
|
690
|
+
}, _ref9 => {
|
|
696
691
|
let {
|
|
697
692
|
disabled
|
|
698
693
|
} = _ref9;
|
|
699
694
|
return disabled && 'cursor: not-allowed;opacity: 0.5;';
|
|
700
|
-
}
|
|
701
|
-
${_ref10 => {
|
|
695
|
+
}, _ref10 => {
|
|
702
696
|
let {
|
|
703
697
|
placeholder
|
|
704
698
|
} = _ref10;
|
|
705
699
|
return placeholder && 'color: var(--font-on-mute);';
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
${_ref11 => {
|
|
700
|
+
}, _ref11 => {
|
|
709
701
|
let {
|
|
710
702
|
fullWidth
|
|
711
703
|
} = _ref11;
|
|
712
704
|
return fullWidth ? 'width: 100%' : 'max-width: 320px';
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
${_ref12 => {
|
|
705
|
+
}, _ref12 => {
|
|
716
706
|
let {
|
|
717
707
|
large
|
|
718
708
|
} = _ref12;
|
|
719
|
-
return large &&
|
|
720
|
-
|
|
721
|
-
padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);
|
|
722
|
-
`;
|
|
723
|
-
}}
|
|
724
|
-
|
|
725
|
-
${_ref13 => {
|
|
709
|
+
return large && "\n height: 40px;\n padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);\n ";
|
|
710
|
+
}, _ref13 => {
|
|
726
711
|
let {
|
|
727
712
|
$fill
|
|
728
713
|
} = _ref13;
|
|
729
|
-
return $fill &&
|
|
730
|
-
|
|
731
|
-
border-color: transparent;
|
|
732
|
-
`;
|
|
733
|
-
}}
|
|
734
|
-
|
|
735
|
-
${_ref14 => {
|
|
714
|
+
return $fill && "\n background: var(--color-background2);\n border-color: transparent;\n ";
|
|
715
|
+
}, _ref14 => {
|
|
736
716
|
let {
|
|
737
717
|
fillReverse
|
|
738
718
|
} = _ref14;
|
|
739
|
-
return fillReverse &&
|
|
740
|
-
|
|
741
|
-
border-color: transparent;
|
|
742
|
-
`;
|
|
743
|
-
}}
|
|
744
|
-
`;
|
|
719
|
+
return fillReverse && "\n background: var(--color-background1);\n border-color: transparent;\n ";
|
|
720
|
+
});
|
|
745
721
|
Combobox.displayName = 'Combobox';
|
|
746
|
-
const CloseButton = (0, _styledComponents.default)(_md.MdClose)
|
|
747
|
-
position: absolute;
|
|
748
|
-
top: 50%;
|
|
749
|
-
transform: translateY(-50%);
|
|
750
|
-
color: var(--color-primary);
|
|
751
|
-
font-size: var(--font-body1);
|
|
752
|
-
right: var(--spacing-l);
|
|
753
|
-
|
|
754
|
-
${_media.default.tablet`
|
|
755
|
-
right: calc(var(--spacing) + var(--spacing-s));
|
|
756
|
-
`};
|
|
757
|
-
`;
|
|
722
|
+
const CloseButton = (0, _styledComponents.default)(_md.MdClose)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n color: var(--color-primary);\n font-size: var(--font-body1);\n right: var(--spacing-l);\n\n ", ";\n"])), _media.default.tablet(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n right: calc(var(--spacing) + var(--spacing-s));\n "]))));
|
|
758
723
|
CloseButton.displayName = 'CloseButton';
|
|
759
|
-
const ExpandArrow = (0, _styledComponents.default)(_ti.TiArrowSortedDown)
|
|
760
|
-
position: absolute;
|
|
761
|
-
top: 50%;
|
|
762
|
-
transform: translateY(-50%);
|
|
763
|
-
color: var(--color-primary);
|
|
764
|
-
font-size: var(--font-body1);
|
|
765
|
-
right: var(--spacing-s);
|
|
766
|
-
`;
|
|
724
|
+
const ExpandArrow = (0, _styledComponents.default)(_ti.TiArrowSortedDown)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n color: var(--color-primary);\n font-size: var(--font-body1);\n right: var(--spacing-s);\n"])));
|
|
767
725
|
ExpandArrow.displayName = 'ExpandArrow';
|
|
768
|
-
const Message = _styledComponents.default.p
|
|
769
|
-
margin: 0;
|
|
770
|
-
padding: 12px var(--spacing-s);
|
|
771
|
-
`;
|
|
726
|
+
const Message = _styledComponents.default.p(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 0;\n padding: 12px var(--spacing-s);\n"])));
|
|
772
727
|
Message.displayName = 'Message';
|
|
773
|
-
const OptionBadge = _styledComponents.default.span
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
728
|
+
const OptionBadge = _styledComponents.default.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: var(--color-danger);\n font-style: italic;\n"])));
|
|
729
|
+
const OptionLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n min-width: 0;\n"])));
|
|
730
|
+
const OptionHighlight = _styledComponents.default.span(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: ", ";\n"])), _ref15 => {
|
|
731
|
+
let {
|
|
732
|
+
$color
|
|
733
|
+
} = _ref15;
|
|
734
|
+
return $color || 'var(--color-danger)';
|
|
735
|
+
});
|
|
777
736
|
var _default = exports.default = Select;
|
|
@@ -7,8 +7,10 @@ exports.default = void 0;
|
|
|
7
7
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
8
|
var _md = require("react-icons/md");
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
var _templateObject, _templateObject2;
|
|
10
11
|
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); }
|
|
11
12
|
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; }
|
|
13
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
12
14
|
const Checkbox = _ref => {
|
|
13
15
|
let {
|
|
14
16
|
selected
|
|
@@ -18,31 +20,10 @@ const Checkbox = _ref => {
|
|
|
18
20
|
children: selected && /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdDone, {})
|
|
19
21
|
});
|
|
20
22
|
};
|
|
21
|
-
const Container = _styledComponents.default.div
|
|
22
|
-
position: relative;
|
|
23
|
-
width: 24px;
|
|
24
|
-
height: 24px;
|
|
25
|
-
border: var(--border-width) solid var(--border-color);
|
|
26
|
-
margin-right: var(--spacing-xs);
|
|
27
|
-
border-radius: 4px;
|
|
28
|
-
|
|
29
|
-
${_ref2 => {
|
|
23
|
+
const Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n width: 24px;\n height: 24px;\n border: var(--border-width) solid var(--border-color);\n margin-right: var(--spacing-xs);\n border-radius: 4px;\n\n ", "\n\n > svg {\n position: absolute;\n color: var(--font-on-primary);\n font-size: var(--font-h3);\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n"])), _ref2 => {
|
|
30
24
|
let {
|
|
31
25
|
selected
|
|
32
26
|
} = _ref2;
|
|
33
|
-
return selected && (0, _styledComponents.css)
|
|
34
|
-
|
|
35
|
-
border-color: var(--color-primary);
|
|
36
|
-
`;
|
|
37
|
-
}}
|
|
38
|
-
|
|
39
|
-
> svg {
|
|
40
|
-
position: absolute;
|
|
41
|
-
color: var(--font-on-primary);
|
|
42
|
-
font-size: var(--font-h3);
|
|
43
|
-
top: 50%;
|
|
44
|
-
left: 50%;
|
|
45
|
-
transform: translate(-50%, -50%);
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
27
|
+
return selected && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: var(--color-primary);\n border-color: var(--color-primary);\n "])));
|
|
28
|
+
});
|
|
48
29
|
var _default = exports.default = Checkbox;
|
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
8
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
|
|
10
|
-
padding: var(--spacing-s);
|
|
11
|
-
border-top: 1px solid var(--border-color);
|
|
12
|
-
`;
|
|
10
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
11
|
+
const Footer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: var(--spacing-s);\n border-top: 1px solid var(--border-color);\n"])));
|
|
13
12
|
var _default = exports.default = Footer;
|