@cashub/ui 0.48.28 → 0.48.30

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 (179) hide show
  1. package/Tab/TabList.js +38 -26
  2. package/Tab/TabPanel.js +13 -20
  3. package/Tab/TabTab.js +37 -25
  4. package/Tab/index.js +3 -6
  5. package/Tab/subComponent/TabListV2.js +11 -18
  6. package/Tab/subComponent/TabPanelV2.js +16 -20
  7. package/Tab/subComponent/TabTabV2.js +33 -21
  8. package/VerticalTab/TabList.js +13 -18
  9. package/VerticalTab/TabPanel.js +16 -20
  10. package/VerticalTab/TabTab.js +40 -21
  11. package/VerticalTab/VerticalTab.js +8 -4
  12. package/alert/Alert.js +12 -5
  13. package/animate/Collapse.js +5 -7
  14. package/animate/Loader.js +18 -7
  15. package/animate/PulseRing.js +18 -5
  16. package/animate/Spinner.js +8 -3
  17. package/backdrop/BaseBackdrop.js +9 -3
  18. package/backdrop/LoadingBackdrop.js +7 -3
  19. package/backdrop/ModalBackdrop.js +5 -3
  20. package/badge/Badge.js +15 -3
  21. package/badge/BadgeDot.js +8 -3
  22. package/badge/BadgeFill.js +24 -6
  23. package/badge/BadgeFillTriangle.js +77 -40
  24. package/badge/BadgeWithText.js +13 -3
  25. package/billing/BarChart.js +1 -1
  26. package/breadcrumb/Breadcrumb.js +42 -3
  27. package/button/Button.js +102 -22
  28. package/button/ButtonGroup.js +33 -9
  29. package/button/IconButton.js +37 -10
  30. package/button/ScrollToTopButton.js +12 -4
  31. package/callout/Callout.js +37 -8
  32. package/chart/BarChart.js +13 -21
  33. package/chart/DoughnutChart.js +34 -20
  34. package/chart/LineChart.js +13 -21
  35. package/chart/SingleBarChart.js +22 -5
  36. package/chart/utils/centerTextPlugin.js +2 -2
  37. package/chart/utils/customTooltip.js +8 -8
  38. package/chart/utils/htmlLegendPlugin.js +1 -1
  39. package/chart/utils/yAxisTopTitlePlugin.js +1 -1
  40. package/container/FlexContainer.js +15 -7
  41. package/cropper/Cropper.js +1 -2
  42. package/datetimePicker/DatePicker.js +80 -26
  43. package/datetimePicker/DatePickerV2.js +95 -36
  44. package/datetimePicker/DatetimePicker.js +174 -11
  45. package/datetimePicker/DatetimePickerV2.js +87 -33
  46. package/datetimePicker/DatetimePickerV3.js +174 -11
  47. package/datetimePicker/TimeInput.js +35 -10
  48. package/datetimePicker/TimePicker.js +77 -22
  49. package/datetimePicker/TimePickerStyle.js +53 -3
  50. package/datetimePicker/TimePickerV2.js +54 -21
  51. package/datetimePicker/accordion/Month.js +93 -16
  52. package/datetimePicker/accordion/Year.js +96 -18
  53. package/datetimePicker/hooks/useChangeNumber.js +3 -6
  54. package/datetimePicker/hooks/useDecrease.js +3 -6
  55. package/datetimePicker/hooks/useIncrease.js +3 -6
  56. package/datetimePicker/subComponent/Accordion.js +101 -20
  57. package/descriptionList/DescriptionDetail.js +15 -4
  58. package/descriptionList/DescriptionList.js +12 -4
  59. package/descriptionList/DescriptionTerm.js +5 -3
  60. package/divider/Divider.js +15 -6
  61. package/dropdown/DropdownButtonOption.js +22 -6
  62. package/dropdown/DropdownContent.js +29 -15
  63. package/dropdown/DropdownDivOption.js +17 -3
  64. package/dropdown/DropdownLinkOption.js +14 -3
  65. package/dropdown/DropdownToggle.js +7 -15
  66. package/dropzone/FileDropzone.js +121 -22
  67. package/dropzone/ImageDropzone.js +83 -14
  68. package/dropzone/subComponent/Message.js +11 -4
  69. package/figure/IconFigure.js +16 -7
  70. package/figure/ImageFigure.js +19 -6
  71. package/file/HiddenFileInput.js +3 -3
  72. package/form/Checkbox.js +81 -16
  73. package/form/Fieldset.js +9 -3
  74. package/form/FormItem.js +10 -5
  75. package/form/Input.js +40 -7
  76. package/form/Label.js +34 -10
  77. package/form/MutedText.js +8 -4
  78. package/form/PasswordInput.js +20 -13
  79. package/form/RadioButton.js +55 -8
  80. package/form/SearchSelect.js +64 -12
  81. package/form/Searchbox.js +45 -19
  82. package/form/Slider.js +28 -10
  83. package/form/SwitchButton.js +48 -14
  84. package/form/Textarea.js +30 -3
  85. package/form/TreeView.js +13 -6
  86. package/grid/Column.js +23 -10
  87. package/grid/Grid.js +14 -6
  88. package/heading/Heading1.js +8 -4
  89. package/heading/Heading2.js +11 -5
  90. package/heading/Heading3.js +20 -8
  91. package/iconbox/ApplicationIconBox.js +48 -12
  92. package/iconbox/IconBox.js +31 -7
  93. package/iconbox/IconBoxV2.js +45 -10
  94. package/iconbox/subComponent/IconBoxFigure.js +17 -9
  95. package/iconbox/subComponent/IconBoxImage.js +21 -8
  96. package/image/ImageFluid.js +7 -3
  97. package/image/UploadImage.js +66 -18
  98. package/jsoneditor/JsonEditor.js +121 -15
  99. package/keyframe/Pulse.js +13 -3
  100. package/keyframe/Spin.js +5 -3
  101. package/layout/Aside.js +30 -5
  102. package/layout/Backdrop.js +8 -4
  103. package/layout/Container.js +21 -5
  104. package/layout/Footer.js +26 -7
  105. package/link/LinkSpan.js +37 -19
  106. package/map/GoogleMap.js +3 -7
  107. package/map/GoogleReverseGeolocation.js +6 -3
  108. package/map/LeafletMap.js +2 -2
  109. package/map/subComponent/GoogleMapContainer.js +16 -4
  110. package/map/subComponent/GoogleMapPopup.js +7 -10
  111. package/map/subComponent/GoogleMapWrapper.js +8 -15
  112. package/map/subComponent/LeafletDrawControl.js +9 -7
  113. package/map/subComponent/LeafletMapContainer.js +159 -4
  114. package/modal/StateModal.js +62 -38
  115. package/modal/TitleModal.js +70 -29
  116. package/package.json +1 -1
  117. package/page/Disclaimer.js +119 -3
  118. package/paginate/Paginate.js +54 -12
  119. package/popover/Popover.js +30 -25
  120. package/qrcode/QRCode.js +20 -6
  121. package/qrcode/QRCodeContainter.js +12 -4
  122. package/ribbon/Ribbon.js +29 -4
  123. package/section/Section.js +68 -20
  124. package/section/SectionBody.js +29 -8
  125. package/section/SectionHeader.js +36 -11
  126. package/section/SectionToolbar.js +9 -3
  127. package/section/SectionToolbarItem.js +8 -3
  128. package/select/InputSelect.js +16 -23
  129. package/select/Select.js +123 -50
  130. package/select/subComponent/Checkbox.js +24 -5
  131. package/select/subComponent/Footer.js +4 -3
  132. package/select/subComponent/ListBox.js +12 -5
  133. package/select/subComponent/Option.js +27 -7
  134. package/select/subComponent/OptionGroup.js +13 -3
  135. package/select/subComponent/Options.js +18 -5
  136. package/select/subComponent/SearchBox.js +34 -12
  137. package/select/subComponent/SelectedMultipleCount.js +31 -6
  138. package/select/subComponent/SelectedMultipleTags.js +24 -4
  139. package/select/subComponent/SelectedMultipleText.js +20 -4
  140. package/select/subComponent/SelectedSingle.js +7 -3
  141. package/styles/GlobalStyle.js +156 -45
  142. package/styles/mixin/backgroundColor.js +16 -8
  143. package/styles/mixin/borderColor.js +16 -8
  144. package/styles/mixin/color.js +16 -8
  145. package/styles/mixin/colorOnBackground.js +13 -7
  146. package/styles/mixin/inputPlaceholder.js +20 -3
  147. package/styles/mixin/media.js +5 -3
  148. package/styles/mixin/rounded.js +10 -6
  149. package/styles/mixin/scrollbar.js +13 -3
  150. package/styles/theme/dark.theme.js +15 -14
  151. package/styles/theme/light.theme.js +15 -14
  152. package/styles/theme/white.theme.js +15 -14
  153. package/table/GridTable.js +71 -33
  154. package/table/ImageBox.js +15 -5
  155. package/table/InfiniteGridTable.js +92 -46
  156. package/table/PermissionTable.js +32 -10
  157. package/table/SimpleGridTable.js +52 -17
  158. package/table/Table.js +198 -48
  159. package/table/__mock__/columns.js +1 -1
  160. package/table/subComponent/BaseTableHeadCell.js +37 -8
  161. package/table/subComponent/GridTableFooter.js +10 -4
  162. package/table/subComponent/GridTableHeadCell.js +6 -4
  163. package/table/subComponent/Resizer.js +19 -4
  164. package/table/subComponent/TableFooter.js +15 -6
  165. package/table/subComponent/TableFooterInfo.js +4 -3
  166. package/table/subComponent/TableFooterPager.js +19 -6
  167. package/table/subComponent/TableHeadCell.js +9 -3
  168. package/table/subComponent/TableSort.js +17 -7
  169. package/tagify/TagifyStyle.js +49 -3
  170. package/tagify/Tags.js +37 -21
  171. package/tagify/templates/getCreateButtonTemplate.js +5 -2
  172. package/text/Paragraph.js +50 -12
  173. package/timeline/Timeline.js +94 -17
  174. package/toast/CustomToastContainer.js +35 -3
  175. package/toast/MessageContainer.js +22 -4
  176. package/tooltip/Tooltip.js +53 -24
  177. package/treeView/TreeViewV2.js +1 -1
  178. package/treeView/TreeflexStyle.js +38 -3
  179. package/wizard/Wizard.js +115 -6
@@ -6,40 +6,65 @@ 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;
10
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
10
  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); }
12
11
  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) } })); }
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 => {
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 => {
15
22
  let {
16
23
  inline
17
24
  } = _ref;
18
- return inline && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n "])));
19
- }, _ref2 => {
25
+ return inline && (0, _styledComponents.css)`
26
+ display: flex;
27
+ justify-content: space-between;
28
+ align-items: center;
29
+ `;
30
+ }}
31
+
32
+ ${_ref2 => {
20
33
  let {
21
34
  flexStart
22
35
  } = _ref2;
23
36
  return flexStart && 'justify-content: flex-start;';
24
- }, _ref3 => {
37
+ }}
38
+
39
+ ${_ref3 => {
25
40
  let {
26
41
  border
27
42
  } = _ref3;
28
43
  return border && 'border-bottom: var(--border-width) solid var(--border-color);';
29
- }, _ref4 => {
44
+ }}
45
+
46
+ ${_ref4 => {
30
47
  let {
31
48
  backgroundFill
32
49
  } = _ref4;
33
50
  return backgroundFill && 'background: var(--color-background1);';
34
- }, _ref5 => {
51
+ }}
52
+
53
+ ${_ref5 => {
35
54
  let {
36
55
  backgroundReverse
37
56
  } = _ref5;
38
57
  return backgroundReverse && 'background: var(--color-background2);';
39
- }, _ref6 => {
58
+ }}
59
+
60
+ ${_ref6 => {
40
61
  let {
41
62
  sticky
42
63
  } = _ref6;
43
- return sticky && "position: sticky;\n z-index:20;\n top: ".concat(_header.default.height, ";\n ");
44
- });
64
+ return sticky && `position: sticky;
65
+ z-index:20;
66
+ top: ${_header.default.height};
67
+ `;
68
+ }}
69
+ `;
45
70
  var _default = exports.default = SectionHeader;
@@ -5,8 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _templateObject;
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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"])));
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
+ `;
12
18
  var _default = exports.default = SectionToolbar;
@@ -5,8 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _templateObject;
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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"])));
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
+ `;
12
17
  var _default = exports.default = SectionToolbarItem;
@@ -13,24 +13,16 @@ 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"];
17
16
  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; }
25
17
  const InputSelect = _ref => {
26
18
  let {
27
- options = [],
28
- value,
29
- disabled,
30
- onChange,
31
- onSelect
32
- } = _ref,
33
- props = _objectWithoutProperties(_ref, _excluded);
19
+ options = [],
20
+ value,
21
+ disabled,
22
+ onChange,
23
+ onSelect,
24
+ ...props
25
+ } = _ref;
34
26
  const [displayListBox, setDisplayListBox] = (0, _react.useState)(false);
35
27
  const [filteredOptions, setFilteredOptions] = (0, _react.useState)([]);
36
28
  const [optionList, setOptionList] = (0, _react.useState)([]);
@@ -229,9 +221,10 @@ const InputSelect = _ref => {
229
221
  } else {
230
222
  selected = false;
231
223
  }
232
- return _objectSpread(_objectSpread({}, option), {}, {
224
+ return {
225
+ ...option,
233
226
  selected
234
- });
227
+ };
235
228
  }));
236
229
  }, [filteredOptions, parsedSelected]);
237
230
  (0, _react.useEffect)(() => {
@@ -243,16 +236,16 @@ const InputSelect = _ref => {
243
236
  onOutsideClick: () => {
244
237
  setDisplayListBox(false);
245
238
  },
246
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default, _objectSpread(_objectSpread(_objectSpread({
247
- autoComplete: "off"
248
- }, props), {}, {
239
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default, {
240
+ autoComplete: "off",
241
+ ...props,
249
242
  onChange: event => {
250
243
  onChange(event);
251
244
  if (!displayListBox) setDisplayListBox(true);
252
245
  },
253
246
  value: value,
254
- ref: setListBoxElement
255
- }, attributes.popper), {}, {
247
+ ref: setListBoxElement,
248
+ ...attributes.popper,
256
249
  placement: state && state.placement,
257
250
  onClick: handleDisplay,
258
251
  onKeyUp: handleKeyUp,
@@ -260,7 +253,7 @@ const InputSelect = _ref => {
260
253
  setDisplayListBox(true);
261
254
  },
262
255
  onKeyDown: handleKeyDown
263
- })), optionItem.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListBox.default, {
256
+ }), optionItem.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListBox.default, {
264
257
  style: styles.popper,
265
258
  $display: displayListBox,
266
259
  ref: setDropdownElement,
package/select/Select.js CHANGED
@@ -29,14 +29,7 @@ var _Footer = _interopRequireDefault(require("./subComponent/Footer"));
29
29
  var _figure = require("../figure");
30
30
  var _image = require("../image");
31
31
  var _jsxRuntime = require("react/jsx-runtime");
32
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
33
32
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
34
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
35
- 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; }
36
- 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; }
37
- 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; }
38
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
39
- 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); }
40
33
  const Select = _ref => {
41
34
  let {
42
35
  options,
@@ -85,9 +78,10 @@ const Select = _ref => {
85
78
  const newOptions = (0, _react.useMemo)(() => {
86
79
  if (!options) return;
87
80
  const newOptions = options.map(item => {
88
- return _objectSpread({
89
- isDisable: false
90
- }, item);
81
+ return {
82
+ isDisable: false,
83
+ ...item
84
+ };
91
85
  });
92
86
  if (options.length > 0 && multiple && enableSelectAll) {
93
87
  newOptions.unshift({
@@ -133,9 +127,8 @@ const Select = _ref => {
133
127
  return [option.text, option.suffix].filter(text => text || text === 0).join(' ');
134
128
  }, []);
135
129
  const renderOptionContent = (0, _react.useCallback)(option => {
136
- var _option$highlightText;
137
130
  const text = getOptionText(option);
138
- const highlightText = (_option$highlightText = option.highlightText) === null || _option$highlightText === void 0 ? void 0 : _option$highlightText.toString();
131
+ const highlightText = option.highlightText?.toString();
139
132
  if (highlightText && text.includes(highlightText)) {
140
133
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionLabel, {
141
134
  children: text.split(highlightText).map((textPart, index, textParts) => {
@@ -144,7 +137,7 @@ const Select = _ref => {
144
137
  $color: option.highlightColor,
145
138
  children: highlightText
146
139
  })]
147
- }, "".concat(highlightText, "-").concat(index));
140
+ }, `${highlightText}-${index}`);
148
141
  })
149
142
  });
150
143
  }
@@ -220,13 +213,13 @@ const Select = _ref => {
220
213
  return id === value;
221
214
  });
222
215
  });
223
- const actualOpt = targetOption !== null && targetOption !== void 0 && targetOption.child ? targetOption.child.find(_ref4 => {
216
+ const actualOpt = targetOption?.child ? targetOption.child.find(_ref4 => {
224
217
  let {
225
218
  id
226
219
  } = _ref4;
227
220
  return id === value;
228
221
  }) : targetOption;
229
- if (actualOpt !== null && actualOpt !== void 0 && actualOpt.isDisable) return;
222
+ if (actualOpt?.isDisable) return;
230
223
 
231
224
  // 選取選項
232
225
  // 點選 all 全選
@@ -308,6 +301,7 @@ const Select = _ref => {
308
301
  if (displayMode === 'count') {
309
302
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectedMultipleCount.default, {
310
303
  placeholder: placeholder,
304
+ firstSelectedText: selectedOptions.length > 0 ? getOptionText(selectedOptions[0]) : '',
311
305
  count: selectedOptions.length
312
306
  });
313
307
  }
@@ -322,7 +316,7 @@ const Select = _ref => {
322
316
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectedMultipleTags.default, {
323
317
  content: renderOptionContent(value),
324
318
  onClick: event => handleOnDeselect(event, value.id),
325
- disabled: disabled || value.isDisable
319
+ disabled: disabled
326
320
  }, value.id);
327
321
  });
328
322
  }
@@ -547,7 +541,8 @@ const Select = _ref => {
547
541
  if (!filteredOptions) return;
548
542
  setOptionList(filteredOptions.map(option => {
549
543
  if (option.child && option.child.length > 0) {
550
- return _objectSpread(_objectSpread({}, option), {}, {
544
+ return {
545
+ ...option,
551
546
  child: option.child.map(option => {
552
547
  let selected = false;
553
548
  if (multiple && selectedAllOptions.includes(option.id.toString())) {
@@ -555,11 +550,12 @@ const Select = _ref => {
555
550
  } else if (selectedAllOptions === option.id.toString()) {
556
551
  selected = true;
557
552
  }
558
- return _objectSpread(_objectSpread({}, option), {}, {
553
+ return {
554
+ ...option,
559
555
  selected
560
- });
556
+ };
561
557
  })
562
- });
558
+ };
563
559
  }
564
560
  let selected = false;
565
561
  if (multiple && selectedAllOptions.includes(option.id.toString())) {
@@ -567,9 +563,10 @@ const Select = _ref => {
567
563
  } else if (selectedAllOptions === option.id.toString()) {
568
564
  selected = true;
569
565
  }
570
- return _objectSpread(_objectSpread({}, option), {}, {
566
+ return {
567
+ ...option,
571
568
  selected
572
- });
569
+ };
573
570
  }));
574
571
  }, [filteredOptions, multiple, selectedAllOptions]);
575
572
 
@@ -580,9 +577,10 @@ const Select = _ref => {
580
577
  if (option.child && option.child.length > 0) {
581
578
  const tmpFilteredChildOptions = option.child.filter(option => getOptionText(option).toLowerCase().indexOf(search.toLowerCase().trim()) !== -1);
582
579
  if (tmpFilteredChildOptions.length > 0) {
583
- tmpFilteredOptions.push(_objectSpread(_objectSpread({}, option), {}, {
580
+ tmpFilteredOptions.push({
581
+ ...option,
584
582
  child: tmpFilteredChildOptions
585
- }));
583
+ });
586
584
  }
587
585
  } else if (getOptionText(option).toLowerCase().indexOf(search.toLowerCase().trim()) !== -1) {
588
586
  tmpFilteredOptions.push(option);
@@ -636,7 +634,7 @@ const Select = _ref => {
636
634
  "aria-haspopup": "listbox",
637
635
  "aria-expanded": display
638
636
  })]
639
- }), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, _objectSpread(_objectSpread({
637
+ }), /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, {
640
638
  role: "listbox",
641
639
  tabIndex: "0",
642
640
  id: id,
@@ -645,8 +643,8 @@ const Select = _ref => {
645
643
  onKeyDown: handleKeyDown,
646
644
  width: listBoxWidth,
647
645
  $display: display,
648
- style: styles.popper
649
- }, attributes.popper), {}, {
646
+ style: styles.popper,
647
+ ...attributes.popper,
650
648
  placement: state && state.placement,
651
649
  children: [allowSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchBox.default, {
652
650
  ref: searchBoxElement,
@@ -662,7 +660,7 @@ const Select = _ref => {
662
660
  }), footer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Footer.default, {
663
661
  children: footer
664
662
  })]
665
- })), document.body)]
663
+ }), document.body)]
666
664
  })
667
665
  });
668
666
  };
@@ -682,65 +680,140 @@ const Icon = _ref5 => {
682
680
  }), "\xA0"]
683
681
  });
684
682
  };
685
- 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 => {
683
+ const Combobox = _styledComponents.default.div`
684
+ display: flex;
685
+ flex-wrap: wrap;
686
+ align-items: center;
687
+ min-height: 36px;
688
+ cursor: pointer;
689
+ position: relative;
690
+ background: transparent;
691
+ color: var(--font-on-background);
692
+ font-size: var(--font-body1);
693
+ border: var(--border-width) solid var(--border-color);
694
+ border-radius: var(--border-radius-l);
695
+ padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);
696
+
697
+ &:focus {
698
+ ${_ref6 => {
686
699
  let {
687
700
  disabled
688
701
  } = _ref6;
689
- return !disabled && "\n border-color: var(--color-primary);\n outline: none;\n ";
690
- }, _ref7 => {
702
+ return !disabled && `
703
+ border-color: var(--color-primary);
704
+ outline: none;
705
+ `;
706
+ }};
707
+ }
708
+
709
+ ${_ref7 => {
691
710
  let {
692
711
  flexGrow
693
712
  } = _ref7;
694
713
  return !flexGrow && 'min-width: 160px;';
695
- }, _ref8 => {
714
+ }}
715
+
716
+ ${_ref8 => {
696
717
  let {
697
718
  $display
698
719
  } = _ref8;
699
- return $display && "\n border-color: var(--color-primary);\n outline: none;\n ";
700
- }, _ref9 => {
720
+ return $display && `
721
+ border-color: var(--color-primary);
722
+ outline: none;
723
+ `;
724
+ }}
725
+
726
+ ${_ref9 => {
701
727
  let {
702
728
  disabled
703
729
  } = _ref9;
704
730
  return disabled && 'cursor: not-allowed;opacity: 0.5;';
705
- }, _ref10 => {
731
+ }}
732
+ ${_ref10 => {
706
733
  let {
707
734
  placeholder
708
735
  } = _ref10;
709
736
  return placeholder && 'color: var(--font-on-mute);';
710
- }, _ref11 => {
737
+ }}
738
+
739
+ ${_ref11 => {
711
740
  let {
712
741
  fullWidth
713
742
  } = _ref11;
714
743
  return fullWidth ? 'width: 100%' : 'max-width: 320px';
715
- }, _ref12 => {
744
+ }};
745
+
746
+ ${_ref12 => {
716
747
  let {
717
748
  large
718
749
  } = _ref12;
719
- return large && "\n height: 40px;\n padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);\n ";
720
- }, _ref13 => {
750
+ return large && `
751
+ height: 40px;
752
+ padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);
753
+ `;
754
+ }}
755
+
756
+ ${_ref13 => {
721
757
  let {
722
758
  $fill
723
759
  } = _ref13;
724
- return $fill && "\n background: var(--color-background2);\n border-color: transparent;\n ";
725
- }, _ref14 => {
760
+ return $fill && `
761
+ background: var(--color-background2);
762
+ border-color: transparent;
763
+ `;
764
+ }}
765
+
766
+ ${_ref14 => {
726
767
  let {
727
768
  fillReverse
728
769
  } = _ref14;
729
- return fillReverse && "\n background: var(--color-background1);\n border-color: transparent;\n ";
730
- });
770
+ return fillReverse && `
771
+ background: var(--color-background1);
772
+ border-color: transparent;
773
+ `;
774
+ }}
775
+ `;
731
776
  Combobox.displayName = 'Combobox';
732
- 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 "]))));
777
+ const CloseButton = (0, _styledComponents.default)(_md.MdClose)`
778
+ position: absolute;
779
+ top: 50%;
780
+ transform: translateY(-50%);
781
+ color: var(--color-primary);
782
+ font-size: var(--font-body1);
783
+ right: var(--spacing-l);
784
+
785
+ ${_media.default.tablet`
786
+ right: calc(var(--spacing) + var(--spacing-s));
787
+ `};
788
+ `;
733
789
  CloseButton.displayName = 'CloseButton';
734
- 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"])));
790
+ const ExpandArrow = (0, _styledComponents.default)(_ti.TiArrowSortedDown)`
791
+ position: absolute;
792
+ top: 50%;
793
+ transform: translateY(-50%);
794
+ color: var(--color-primary);
795
+ font-size: var(--font-body1);
796
+ right: var(--spacing-s);
797
+ `;
735
798
  ExpandArrow.displayName = 'ExpandArrow';
736
- const Message = _styledComponents.default.p(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin: 0;\n padding: 12px var(--spacing-s);\n"])));
799
+ const Message = _styledComponents.default.p`
800
+ margin: 0;
801
+ padding: 12px var(--spacing-s);
802
+ `;
737
803
  Message.displayName = 'Message';
738
- const OptionBadge = _styledComponents.default.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: var(--color-danger);\n font-style: italic;\n"])));
739
- const OptionLabel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n min-width: 0;\n"])));
740
- const OptionHighlight = _styledComponents.default.span(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n color: ", ";\n"])), _ref15 => {
804
+ const OptionBadge = _styledComponents.default.span`
805
+ color: var(--color-danger);
806
+ font-style: italic;
807
+ `;
808
+ const OptionLabel = _styledComponents.default.div`
809
+ min-width: 0;
810
+ `;
811
+ const OptionHighlight = _styledComponents.default.span`
812
+ color: ${_ref15 => {
741
813
  let {
742
814
  $color
743
815
  } = _ref15;
744
816
  return $color || 'var(--color-danger)';
745
- });
817
+ }};
818
+ `;
746
819
  var _default = exports.default = Select;
@@ -7,10 +7,8 @@ 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;
11
10
  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); }
12
11
  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) } })); }
14
12
  const Checkbox = _ref => {
15
13
  let {
16
14
  selected
@@ -20,10 +18,31 @@ const Checkbox = _ref => {
20
18
  children: selected && /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdDone, {})
21
19
  });
22
20
  };
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 => {
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 => {
24
30
  let {
25
31
  selected
26
32
  } = _ref2;
27
- return selected && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: var(--color-primary);\n border-color: var(--color-primary);\n "])));
28
- });
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
+ `;
29
48
  var _default = exports.default = Checkbox;
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _templateObject;
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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"])));
9
+ const Footer = _styledComponents.default.div`
10
+ padding: var(--spacing-s);
11
+ border-top: 1px solid var(--border-color);
12
+ `;
12
13
  var _default = exports.default = Footer;
@@ -5,19 +5,26 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _templateObject;
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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 => {
9
+ const ListBox = _styledComponents.default.div`
10
+ visibility: ${_ref => {
12
11
  let {
13
12
  $display
14
13
  } = _ref;
15
14
  return $display ? 'visible' : 'hidden';
16
- }, _ref2 => {
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 => {
17
22
  let {
18
23
  width
19
24
  } = _ref2;
20
25
  return width;
21
- });
26
+ }}px;
27
+ z-index: 85;
28
+ `;
22
29
  ListBox.displayName = 'ListBox';
23
30
  var _default = exports.default = ListBox;
@@ -5,21 +5,41 @@ 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;
9
8
  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); }
10
9
  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; }
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 => {
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 => {
13
24
  let {
14
25
  selected,
15
26
  focus
16
27
  } = _ref;
17
- return (selected || focus) && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: var(--color-hover);\n "])));
18
- }, _ref2 => {
28
+ return (selected || focus) && (0, _styledComponents.css)`
29
+ background: var(--color-hover);
30
+ `;
31
+ }}
32
+
33
+ ${_ref2 => {
19
34
  let {
20
35
  disabled
21
36
  } = _ref2;
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
- });
37
+ return disabled && (0, _styledComponents.css)`
38
+ cursor: not-allowed;
39
+ pointer-events: none;
40
+ color: var(--font-on-mute);
41
+ `;
42
+ }}
43
+ `;
24
44
  Option.displayName = 'Option';
25
45
  var _default = exports.default = Option;