@cashub/ui 0.48.20 → 0.48.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/Tab/TabList.js +26 -38
  2. package/Tab/TabPanel.js +20 -13
  3. package/Tab/TabTab.js +25 -37
  4. package/Tab/index.js +6 -3
  5. package/Tab/subComponent/TabListV2.js +18 -11
  6. package/Tab/subComponent/TabPanelV2.js +20 -16
  7. package/Tab/subComponent/TabTabV2.js +21 -33
  8. package/VerticalTab/TabList.js +18 -13
  9. package/VerticalTab/TabPanel.js +20 -16
  10. package/VerticalTab/TabTab.js +21 -40
  11. package/VerticalTab/VerticalTab.js +4 -8
  12. package/alert/Alert.js +5 -12
  13. package/animate/Collapse.js +7 -5
  14. package/animate/Loader.js +7 -18
  15. package/animate/PulseRing.js +5 -18
  16. package/animate/Spinner.js +3 -8
  17. package/backdrop/BaseBackdrop.js +3 -9
  18. package/backdrop/LoadingBackdrop.js +3 -7
  19. package/backdrop/ModalBackdrop.js +3 -5
  20. package/badge/Badge.js +3 -15
  21. package/badge/BadgeDot.js +3 -8
  22. package/badge/BadgeFill.js +6 -24
  23. package/badge/BadgeWithText.js +3 -13
  24. package/billing/BarChart.js +1 -1
  25. package/breadcrumb/Breadcrumb.js +3 -42
  26. package/button/Button.js +22 -102
  27. package/button/ButtonGroup.js +9 -33
  28. package/button/IconButton.js +10 -37
  29. package/button/ScrollToTopButton.js +4 -12
  30. package/callout/Callout.js +8 -37
  31. package/chart/BarChart.js +21 -13
  32. package/chart/DoughnutChart.js +20 -34
  33. package/chart/LineChart.js +21 -13
  34. package/chart/SingleBarChart.js +5 -22
  35. package/chart/utils/centerTextPlugin.js +2 -2
  36. package/chart/utils/customTooltip.js +8 -8
  37. package/chart/utils/htmlLegendPlugin.js +1 -1
  38. package/chart/utils/yAxisTopTitlePlugin.js +1 -1
  39. package/container/FlexContainer.js +7 -15
  40. package/cropper/Cropper.js +2 -1
  41. package/datetimePicker/DatePicker.js +26 -80
  42. package/datetimePicker/DatePickerV2.js +36 -95
  43. package/datetimePicker/DatetimePicker.js +11 -174
  44. package/datetimePicker/DatetimePickerV2.js +33 -87
  45. package/datetimePicker/DatetimePickerV3.js +11 -174
  46. package/datetimePicker/TimeInput.js +10 -35
  47. package/datetimePicker/TimePicker.js +22 -77
  48. package/datetimePicker/TimePickerStyle.js +3 -53
  49. package/datetimePicker/TimePickerV2.js +21 -54
  50. package/datetimePicker/accordion/Month.js +16 -93
  51. package/datetimePicker/accordion/Year.js +18 -96
  52. package/datetimePicker/hooks/useChangeNumber.js +6 -3
  53. package/datetimePicker/hooks/useDecrease.js +6 -3
  54. package/datetimePicker/hooks/useIncrease.js +6 -3
  55. package/datetimePicker/subComponent/Accordion.js +20 -101
  56. package/descriptionList/DescriptionDetail.js +4 -15
  57. package/descriptionList/DescriptionList.js +4 -12
  58. package/descriptionList/DescriptionTerm.js +3 -5
  59. package/divider/Divider.js +6 -15
  60. package/dropdown/DropdownButtonOption.js +6 -22
  61. package/dropdown/DropdownContent.js +15 -29
  62. package/dropdown/DropdownDivOption.js +3 -17
  63. package/dropdown/DropdownLinkOption.js +3 -14
  64. package/dropdown/DropdownToggle.js +15 -7
  65. package/dropzone/FileDropzone.js +22 -121
  66. package/dropzone/ImageDropzone.js +14 -83
  67. package/dropzone/subComponent/Message.js +4 -11
  68. package/figure/IconFigure.js +7 -16
  69. package/figure/ImageFigure.js +6 -19
  70. package/file/HiddenFileInput.js +3 -3
  71. package/form/Checkbox.js +16 -81
  72. package/form/Fieldset.js +3 -9
  73. package/form/FormItem.js +5 -10
  74. package/form/Input.js +7 -40
  75. package/form/Label.js +10 -34
  76. package/form/MutedText.js +4 -8
  77. package/form/PasswordInput.js +13 -20
  78. package/form/RadioButton.js +8 -55
  79. package/form/SearchSelect.js +12 -64
  80. package/form/Searchbox.js +19 -45
  81. package/form/Slider.js +10 -28
  82. package/form/SwitchButton.js +14 -48
  83. package/form/Textarea.js +3 -30
  84. package/form/TreeView.js +6 -13
  85. package/grid/Column.js +10 -23
  86. package/grid/Grid.js +6 -14
  87. package/heading/Heading1.js +4 -8
  88. package/heading/Heading2.js +5 -11
  89. package/heading/Heading3.js +8 -20
  90. package/iconbox/ApplicationIconBox.js +12 -48
  91. package/iconbox/IconBox.js +7 -31
  92. package/iconbox/IconBoxV2.js +10 -45
  93. package/iconbox/subComponent/IconBoxFigure.js +9 -17
  94. package/iconbox/subComponent/IconBoxImage.js +8 -21
  95. package/image/ImageFluid.js +3 -7
  96. package/image/UploadImage.js +18 -66
  97. package/jsoneditor/JsonEditor.js +15 -121
  98. package/keyframe/Pulse.js +3 -13
  99. package/keyframe/Spin.js +3 -5
  100. package/layout/Aside.js +5 -30
  101. package/layout/Backdrop.js +4 -8
  102. package/layout/Container.js +5 -21
  103. package/layout/Footer.js +7 -26
  104. package/link/LinkSpan.js +19 -37
  105. package/map/GoogleMap.js +7 -3
  106. package/map/GoogleReverseGeolocation.js +3 -6
  107. package/map/LeafletMap.js +2 -2
  108. package/map/subComponent/GoogleMapContainer.js +4 -16
  109. package/map/subComponent/GoogleMapPopup.js +10 -7
  110. package/map/subComponent/GoogleMapWrapper.js +15 -8
  111. package/map/subComponent/LeafletDrawControl.js +7 -9
  112. package/map/subComponent/LeafletMapContainer.js +4 -159
  113. package/modal/StateModal.js +38 -62
  114. package/modal/TitleModal.js +29 -70
  115. package/package.json +1 -1
  116. package/page/Disclaimer.js +3 -119
  117. package/paginate/Paginate.js +12 -54
  118. package/popover/Popover.js +25 -30
  119. package/qrcode/QRCode.js +6 -20
  120. package/qrcode/QRCodeContainter.js +4 -12
  121. package/ribbon/Ribbon.js +4 -29
  122. package/section/Section.js +20 -68
  123. package/section/SectionBody.js +8 -29
  124. package/section/SectionHeader.js +11 -36
  125. package/section/SectionToolbar.js +3 -9
  126. package/section/SectionToolbarItem.js +3 -8
  127. package/select/InputSelect.js +23 -16
  128. package/select/Select.js +54 -123
  129. package/select/subComponent/Checkbox.js +5 -24
  130. package/select/subComponent/Footer.js +3 -4
  131. package/select/subComponent/ListBox.js +5 -12
  132. package/select/subComponent/Option.js +7 -27
  133. package/select/subComponent/OptionGroup.js +3 -13
  134. package/select/subComponent/Options.js +5 -18
  135. package/select/subComponent/SearchBox.js +12 -34
  136. package/select/subComponent/SelectedMultipleTags.js +3 -21
  137. package/select/subComponent/SelectedMultipleText.js +4 -20
  138. package/select/subComponent/SelectedSingle.js +3 -7
  139. package/styles/GlobalStyle.js +45 -156
  140. package/styles/mixin/backgroundColor.js +8 -16
  141. package/styles/mixin/borderColor.js +7 -13
  142. package/styles/mixin/color.js +7 -13
  143. package/styles/mixin/colorOnBackground.js +7 -13
  144. package/styles/mixin/inputPlaceholder.js +3 -20
  145. package/styles/mixin/media.js +3 -5
  146. package/styles/mixin/rounded.js +6 -10
  147. package/styles/mixin/scrollbar.js +3 -13
  148. package/styles/theme/dark.theme.js +14 -15
  149. package/styles/theme/light.theme.js +14 -15
  150. package/styles/theme/white.theme.js +14 -15
  151. package/table/GridTable.js +33 -71
  152. package/table/ImageBox.js +5 -15
  153. package/table/InfiniteGridTable.js +46 -92
  154. package/table/PermissionTable.js +10 -32
  155. package/table/SimpleGridTable.js +17 -52
  156. package/table/Table.js +48 -198
  157. package/table/__mock__/columns.js +1 -1
  158. package/table/subComponent/BaseTableHeadCell.js +8 -37
  159. package/table/subComponent/GridTableFooter.js +4 -10
  160. package/table/subComponent/GridTableHeadCell.js +4 -6
  161. package/table/subComponent/Resizer.js +4 -19
  162. package/table/subComponent/TableFooter.js +6 -15
  163. package/table/subComponent/TableFooterInfo.js +3 -4
  164. package/table/subComponent/TableFooterPager.js +6 -19
  165. package/table/subComponent/TableHeadCell.js +3 -9
  166. package/table/subComponent/TableSort.js +7 -17
  167. package/tagify/TagifyStyle.js +3 -49
  168. package/tagify/Tags.js +21 -37
  169. package/tagify/templates/getCreateButtonTemplate.js +2 -5
  170. package/text/Paragraph.js +12 -50
  171. package/timeline/Timeline.js +17 -94
  172. package/toast/CustomToastContainer.js +3 -35
  173. package/toast/MessageContainer.js +4 -22
  174. package/tooltip/Tooltip.js +26 -52
  175. package/treeView/TreeViewV2.js +1 -1
  176. package/treeView/TreeflexStyle.js +3 -38
  177. package/wizard/Wizard.js +6 -115
@@ -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
- const SectionHeader = _styledComponents.default.div`
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
- display: flex;
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 && `position: sticky;
65
- z-index:20;
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
- const SectionToolbar = _styledComponents.default.div`
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
- const SectionToolbarItem = _styledComponents.default.div`
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;
@@ -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
- options = [],
20
- value,
21
- disabled,
22
- onChange,
23
- onSelect,
24
- ...props
25
- } = _ref;
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
- ...props,
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
- ...attributes.popper,
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
- ...item
83
- };
87
+ return _objectSpread({
88
+ isDisable: false
89
+ }, item);
84
90
  });
85
91
  if (options.length > 0 && multiple && enableSelectAll) {
86
92
  newOptions.unshift({
@@ -126,8 +132,9 @@ const Select = _ref => {
126
132
  return [option.text, option.suffix].filter(text => text || text === 0).join(' ');
127
133
  }, []);
128
134
  const renderOptionContent = (0, _react.useCallback)(option => {
135
+ var _option$highlightText;
129
136
  const text = getOptionText(option);
130
- const highlightText = option.highlightText?.toString();
137
+ const highlightText = (_option$highlightText = option.highlightText) === null || _option$highlightText === void 0 ? void 0 : _option$highlightText.toString();
131
138
  if (highlightText && text.includes(highlightText)) {
132
139
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionLabel, {
133
140
  children: text.split(highlightText).map((textPart, index, textParts) => {
@@ -136,7 +143,7 @@ const Select = _ref => {
136
143
  $color: option.highlightColor,
137
144
  children: highlightText
138
145
  })]
139
- }, `${highlightText}-${index}`);
146
+ }, "".concat(highlightText, "-").concat(index));
140
147
  })
141
148
  });
142
149
  }
@@ -212,13 +219,13 @@ const Select = _ref => {
212
219
  return id === value;
213
220
  });
214
221
  });
215
- const actualOpt = targetOption?.child ? targetOption.child.find(_ref4 => {
222
+ const actualOpt = targetOption !== null && targetOption !== void 0 && targetOption.child ? targetOption.child.find(_ref4 => {
216
223
  let {
217
224
  id
218
225
  } = _ref4;
219
226
  return id === value;
220
227
  }) : targetOption;
221
- if (actualOpt?.isDisable) return;
228
+ if (actualOpt !== null && actualOpt !== void 0 && actualOpt.isDisable) return;
222
229
 
223
230
  // 選取選項
224
231
  // 點選 all 全選
@@ -331,7 +338,7 @@ const Select = _ref => {
331
338
  id: option.text,
332
339
  children: option.text
333
340
  }), option.child.map(option => {
334
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Option.default, {
341
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Option.default, {
335
342
  role: "option",
336
343
  tabIndex: option.isDisable ? '-1' : '0',
337
344
  id: option.id,
@@ -341,7 +348,10 @@ const Select = _ref => {
341
348
  "aria-selected": option.selected,
342
349
  "aria-disabled": option.isDisable,
343
350
  disabled: option.isDisable,
344
- children: renderOptionContent(option)
351
+ children: [showCheckbox && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
352
+ selected: option.selected,
353
+ disabled: option.isDisable
354
+ }), renderOptionContent(option)]
345
355
  }, option.id);
346
356
  })]
347
357
  }, option.text);
@@ -530,8 +540,7 @@ const Select = _ref => {
530
540
  if (!filteredOptions) return;
531
541
  setOptionList(filteredOptions.map(option => {
532
542
  if (option.child && option.child.length > 0) {
533
- return {
534
- ...option,
543
+ return _objectSpread(_objectSpread({}, option), {}, {
535
544
  child: option.child.map(option => {
536
545
  let selected = false;
537
546
  if (multiple && selectedAllOptions.includes(option.id.toString())) {
@@ -539,12 +548,11 @@ const Select = _ref => {
539
548
  } else if (selectedAllOptions === option.id.toString()) {
540
549
  selected = true;
541
550
  }
542
- return {
543
- ...option,
551
+ return _objectSpread(_objectSpread({}, option), {}, {
544
552
  selected
545
- };
553
+ });
546
554
  })
547
- };
555
+ });
548
556
  }
549
557
  let selected = false;
550
558
  if (multiple && selectedAllOptions.includes(option.id.toString())) {
@@ -552,10 +560,9 @@ const Select = _ref => {
552
560
  } else if (selectedAllOptions === option.id.toString()) {
553
561
  selected = true;
554
562
  }
555
- return {
556
- ...option,
563
+ return _objectSpread(_objectSpread({}, option), {}, {
557
564
  selected
558
- };
565
+ });
559
566
  }));
560
567
  }, [filteredOptions, multiple, selectedAllOptions]);
561
568
 
@@ -566,10 +573,9 @@ const Select = _ref => {
566
573
  if (option.child && option.child.length > 0) {
567
574
  const tmpFilteredChildOptions = option.child.filter(option => getOptionText(option).toLowerCase().indexOf(search.toLowerCase().trim()) !== -1);
568
575
  if (tmpFilteredChildOptions.length > 0) {
569
- tmpFilteredOptions.push({
570
- ...option,
576
+ tmpFilteredOptions.push(_objectSpread(_objectSpread({}, option), {}, {
571
577
  child: tmpFilteredChildOptions
572
- });
578
+ }));
573
579
  }
574
580
  } else if (getOptionText(option).toLowerCase().indexOf(search.toLowerCase().trim()) !== -1) {
575
581
  tmpFilteredOptions.push(option);
@@ -623,7 +629,7 @@ const Select = _ref => {
623
629
  "aria-haspopup": "listbox",
624
630
  "aria-expanded": display
625
631
  })]
626
- }), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, {
632
+ }), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, _objectSpread(_objectSpread({
627
633
  role: "listbox",
628
634
  tabIndex: "0",
629
635
  id: id,
@@ -632,8 +638,8 @@ const Select = _ref => {
632
638
  onKeyDown: handleKeyDown,
633
639
  width: listBoxWidth,
634
640
  $display: display,
635
- style: styles.popper,
636
- ...attributes.popper,
641
+ style: styles.popper
642
+ }, attributes.popper), {}, {
637
643
  placement: state && state.placement,
638
644
  children: [allowSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchBox.default, {
639
645
  ref: searchBoxElement,
@@ -649,7 +655,7 @@ const Select = _ref => {
649
655
  }), footer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Footer.default, {
650
656
  children: footer
651
657
  })]
652
- }), document.body)]
658
+ })), document.body)]
653
659
  })
654
660
  });
655
661
  };
@@ -669,140 +675,65 @@ const Icon = _ref5 => {
669
675
  }), "\xA0"]
670
676
  });
671
677
  };
672
- const Combobox = _styledComponents.default.div`
673
- display: flex;
674
- flex-wrap: wrap;
675
- align-items: center;
676
- min-height: 36px;
677
- cursor: pointer;
678
- position: relative;
679
- background: transparent;
680
- color: var(--font-on-background);
681
- font-size: var(--font-body1);
682
- border: var(--border-width) solid var(--border-color);
683
- border-radius: var(--border-radius-l);
684
- padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);
685
-
686
- &:focus {
687
- ${_ref6 => {
678
+ 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 => {
688
679
  let {
689
680
  disabled
690
681
  } = _ref6;
691
- return !disabled && `
692
- border-color: var(--color-primary);
693
- outline: none;
694
- `;
695
- }};
696
- }
697
-
698
- ${_ref7 => {
682
+ return !disabled && "\n border-color: var(--color-primary);\n outline: none;\n ";
683
+ }, _ref7 => {
699
684
  let {
700
685
  flexGrow
701
686
  } = _ref7;
702
687
  return !flexGrow && 'min-width: 160px;';
703
- }}
704
-
705
- ${_ref8 => {
688
+ }, _ref8 => {
706
689
  let {
707
690
  $display
708
691
  } = _ref8;
709
- return $display && `
710
- border-color: var(--color-primary);
711
- outline: none;
712
- `;
713
- }}
714
-
715
- ${_ref9 => {
692
+ return $display && "\n border-color: var(--color-primary);\n outline: none;\n ";
693
+ }, _ref9 => {
716
694
  let {
717
695
  disabled
718
696
  } = _ref9;
719
697
  return disabled && 'cursor: not-allowed;opacity: 0.5;';
720
- }}
721
- ${_ref10 => {
698
+ }, _ref10 => {
722
699
  let {
723
700
  placeholder
724
701
  } = _ref10;
725
702
  return placeholder && 'color: var(--font-on-mute);';
726
- }}
727
-
728
- ${_ref11 => {
703
+ }, _ref11 => {
729
704
  let {
730
705
  fullWidth
731
706
  } = _ref11;
732
707
  return fullWidth ? 'width: 100%' : 'max-width: 320px';
733
- }};
734
-
735
- ${_ref12 => {
708
+ }, _ref12 => {
736
709
  let {
737
710
  large
738
711
  } = _ref12;
739
- return large && `
740
- height: 40px;
741
- padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);
742
- `;
743
- }}
744
-
745
- ${_ref13 => {
712
+ return large && "\n height: 40px;\n padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);\n ";
713
+ }, _ref13 => {
746
714
  let {
747
715
  $fill
748
716
  } = _ref13;
749
- return $fill && `
750
- background: var(--color-background2);
751
- border-color: transparent;
752
- `;
753
- }}
754
-
755
- ${_ref14 => {
717
+ return $fill && "\n background: var(--color-background2);\n border-color: transparent;\n ";
718
+ }, _ref14 => {
756
719
  let {
757
720
  fillReverse
758
721
  } = _ref14;
759
- return fillReverse && `
760
- background: var(--color-background1);
761
- border-color: transparent;
762
- `;
763
- }}
764
- `;
722
+ return fillReverse && "\n background: var(--color-background1);\n border-color: transparent;\n ";
723
+ });
765
724
  Combobox.displayName = 'Combobox';
766
- const CloseButton = (0, _styledComponents.default)(_md.MdClose)`
767
- position: absolute;
768
- top: 50%;
769
- transform: translateY(-50%);
770
- color: var(--color-primary);
771
- font-size: var(--font-body1);
772
- right: var(--spacing-l);
773
-
774
- ${_media.default.tablet`
775
- right: calc(var(--spacing) + var(--spacing-s));
776
- `};
777
- `;
725
+ 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 "]))));
778
726
  CloseButton.displayName = 'CloseButton';
779
- const ExpandArrow = (0, _styledComponents.default)(_ti.TiArrowSortedDown)`
780
- position: absolute;
781
- top: 50%;
782
- transform: translateY(-50%);
783
- color: var(--color-primary);
784
- font-size: var(--font-body1);
785
- right: var(--spacing-s);
786
- `;
727
+ 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"])));
787
728
  ExpandArrow.displayName = 'ExpandArrow';
788
- const Message = _styledComponents.default.p`
789
- margin: 0;
790
- padding: 12px var(--spacing-s);
791
- `;
729
+ const Message = _styledComponents.default.p(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 0;\n padding: 12px var(--spacing-s);\n"])));
792
730
  Message.displayName = 'Message';
793
- const OptionBadge = _styledComponents.default.span`
794
- color: var(--color-danger);
795
- font-style: italic;
796
- `;
797
- const OptionLabel = _styledComponents.default.div`
798
- min-width: 0;
799
- `;
800
- const OptionHighlight = _styledComponents.default.span`
801
- color: ${_ref15 => {
731
+ const OptionBadge = _styledComponents.default.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: var(--color-danger);\n font-style: italic;\n"])));
732
+ const OptionLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n min-width: 0;\n"])));
733
+ const OptionHighlight = _styledComponents.default.span(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: ", ";\n"])), _ref15 => {
802
734
  let {
803
735
  $color
804
736
  } = _ref15;
805
737
  return $color || 'var(--color-danger)';
806
- }};
807
- `;
738
+ });
808
739
  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
- background: var(--color-primary);
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
- const Footer = _styledComponents.default.div`
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;
@@ -5,26 +5,19 @@ 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
- const ListBox = _styledComponents.default.div`
10
- visibility: ${_ref => {
10
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
11
+ const ListBox = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n visibility: ", ";\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 width: ", "px;\n z-index: 85;\n"])), _ref => {
11
12
  let {
12
13
  $display
13
14
  } = _ref;
14
15
  return $display ? 'visible' : 'hidden';
15
- }};
16
- background: var(--color-background1);
17
- color: var(--font-on-background);
18
- border: var(--border-width) solid var(--border-color);
19
- border-radius: var(--border-radius);
20
- box-shadow: var(--box-shadow);
21
- width: ${_ref2 => {
16
+ }, _ref2 => {
22
17
  let {
23
18
  width
24
19
  } = _ref2;
25
20
  return width;
26
- }}px;
27
- z-index: 85;
28
- `;
21
+ });
29
22
  ListBox.displayName = 'ListBox';
30
23
  var _default = exports.default = ListBox;
@@ -5,41 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ var _templateObject, _templateObject2, _templateObject3;
8
9
  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); }
9
10
  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; }
10
- const Option = _styledComponents.default.div`
11
- display: flex;
12
- align-items: center;
13
- max-width: 100%;
14
- word-break: break-all;
15
- padding: 12px var(--spacing-s);
16
- background: var(--color-background1);
17
- transition: background 0.3s;
18
-
19
- &:hover {
20
- background: var(--color-hover);
21
- }
22
-
23
- ${_ref => {
11
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
12
+ const Option = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n max-width: 100%;\n word-break: break-all;\n padding: 12px var(--spacing-s);\n background: var(--color-background1);\n transition: background 0.3s;\n\n &:hover {\n background: var(--color-hover);\n }\n\n ", "\n\n ", "\n"])), _ref => {
24
13
  let {
25
14
  selected,
26
15
  focus
27
16
  } = _ref;
28
- return (selected || focus) && (0, _styledComponents.css)`
29
- background: var(--color-hover);
30
- `;
31
- }}
32
-
33
- ${_ref2 => {
17
+ return (selected || focus) && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: var(--color-hover);\n "])));
18
+ }, _ref2 => {
34
19
  let {
35
20
  disabled
36
21
  } = _ref2;
37
- return disabled && (0, _styledComponents.css)`
38
- cursor: not-allowed;
39
- pointer-events: none;
40
- color: var(--font-on-mute);
41
- `;
42
- }}
43
- `;
22
+ return disabled && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n cursor: not-allowed;\n pointer-events: none;\n color: var(--font-on-mute);\n "])));
23
+ });
44
24
  Option.displayName = 'Option';
45
25
  var _default = exports.default = Option;