sales-frontend-components 0.0.156 → 0.0.157

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/dist/index.cjs.js CHANGED
@@ -1088,7 +1088,7 @@ const useCustomerSearch = (onSelect) => {
1088
1088
 
1089
1089
  const cx$j = classNames.bind(styles$2);
1090
1090
  const { InputBox: InputBox$3, Input: Input$3 } = salesFrontendDesignSystem.FormCore;
1091
- const CustomerSearch = ({ onSelectCustomer, placeholder, rootProps, ...props }) => {
1091
+ const CustomerSearch = ({ onSelectCustomer, onSearchClear, placeholder, rootProps, ...props }) => {
1092
1092
  const {
1093
1093
  triggerRef,
1094
1094
  isOpen,
@@ -1102,8 +1102,12 @@ const CustomerSearch = ({ onSelectCustomer, placeholder, rootProps, ...props })
1102
1102
  onClear,
1103
1103
  handleSelectItem
1104
1104
  } = useCustomerSearch(onSelectCustomer);
1105
+ const handleClear = () => {
1106
+ onClear();
1107
+ onSearchClear?.();
1108
+ };
1105
1109
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$j("container"), children: [
1106
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$j("search-bar"), children: /* @__PURE__ */ jsxRuntime.jsx(InputBox$3, { ...rootProps, endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconMainUiSearch, { onClick: search }), onClear, clearable: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1110
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$j("search-bar"), children: /* @__PURE__ */ jsxRuntime.jsx(InputBox$3, { ...rootProps, endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconMainUiSearch, { onClick: search }), onClear: handleClear, clearable: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1107
1111
  Input$3,
1108
1112
  {
1109
1113
  ...props,
@@ -1144,7 +1148,7 @@ const CustomerSearch = ({ onSelectCustomer, placeholder, rootProps, ...props })
1144
1148
 
1145
1149
  const cx$i = classNames.bind(styles$2);
1146
1150
  const { InputBox: InputBox$2, Input: Input$2 } = salesFrontendDesignSystem.FormCore;
1147
- function CustomerSearchModal({ isOpen, closeModal, onSelect }) {
1151
+ function CustomerSearchModal({ isOpen, closeModal, onSelect, onSearchClear }) {
1148
1152
  const {
1149
1153
  triggerRef,
1150
1154
  searchInput,
@@ -1159,12 +1163,16 @@ function CustomerSearchModal({ isOpen, closeModal, onSelect }) {
1159
1163
  onClear,
1160
1164
  handleSelectItem
1161
1165
  } = useCustomerSearch(onSelect);
1166
+ const handleClear = () => {
1167
+ onClear();
1168
+ onSearchClear?.();
1169
+ };
1162
1170
  return /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "full-screen", children: [
1163
1171
  /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
1164
1172
  /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
1165
1173
  /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uACE0\uAC1D \uAC80\uC0C9", showCloseButton: true }),
1166
1174
  /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Body, { children: [
1167
- /* @__PURE__ */ jsxRuntime.jsx(InputBox$2, { endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconMainUiSearch, { onClick: search }), onClear, clearable: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1175
+ /* @__PURE__ */ jsxRuntime.jsx(InputBox$2, { endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconMainUiSearch, { onClick: search }), onClear: handleClear, clearable: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1168
1176
  Input$2,
1169
1177
  {
1170
1178
  onChange: onSearchInputChange,