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.d.ts CHANGED
@@ -290,14 +290,17 @@ declare const BANK_STOCK_ICON_LIST: {
290
290
  icon: react_jsx_runtime.JSX.Element;
291
291
  }[];
292
292
 
293
- declare const CustomerSearch: ({ onSelectCustomer, placeholder, rootProps, ...props }: CustomerSearchProps) => react_jsx_runtime.JSX.Element;
293
+ declare const CustomerSearch: ({ onSelectCustomer, onSearchClear, placeholder, rootProps, ...props }: CustomerSearchProps & {
294
+ onSearchClear?: () => void;
295
+ }) => react_jsx_runtime.JSX.Element;
294
296
 
295
297
  interface Props$3 {
296
298
  isOpen: boolean;
297
299
  closeModal: () => void;
298
300
  onSelect?: (customer: CustomerDto) => void;
301
+ onSearchClear?: () => void;
299
302
  }
300
- declare function CustomerSearchModal({ isOpen, closeModal, onSelect }: Props$3): react_jsx_runtime.JSX.Element;
303
+ declare function CustomerSearchModal({ isOpen, closeModal, onSelect, onSearchClear }: Props$3): react_jsx_runtime.JSX.Element;
301
304
 
302
305
  interface Props$2 {
303
306
  setValue: (nationality: NationalityResponseDto) => void;
package/dist/index.esm.js CHANGED
@@ -1086,7 +1086,7 @@ const useCustomerSearch = (onSelect) => {
1086
1086
 
1087
1087
  const cx$j = classNames.bind(styles$2);
1088
1088
  const { InputBox: InputBox$3, Input: Input$3 } = FormCore;
1089
- const CustomerSearch = ({ onSelectCustomer, placeholder, rootProps, ...props }) => {
1089
+ const CustomerSearch = ({ onSelectCustomer, onSearchClear, placeholder, rootProps, ...props }) => {
1090
1090
  const {
1091
1091
  triggerRef,
1092
1092
  isOpen,
@@ -1100,8 +1100,12 @@ const CustomerSearch = ({ onSelectCustomer, placeholder, rootProps, ...props })
1100
1100
  onClear,
1101
1101
  handleSelectItem
1102
1102
  } = useCustomerSearch(onSelectCustomer);
1103
+ const handleClear = () => {
1104
+ onClear();
1105
+ onSearchClear?.();
1106
+ };
1103
1107
  return /* @__PURE__ */ jsxs("div", { className: cx$j("container"), children: [
1104
- /* @__PURE__ */ jsx("div", { className: cx$j("search-bar"), children: /* @__PURE__ */ jsx(InputBox$3, { ...rootProps, endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }), onClear, clearable: true, children: /* @__PURE__ */ jsx(
1108
+ /* @__PURE__ */ jsx("div", { className: cx$j("search-bar"), children: /* @__PURE__ */ jsx(InputBox$3, { ...rootProps, endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }), onClear: handleClear, clearable: true, children: /* @__PURE__ */ jsx(
1105
1109
  Input$3,
1106
1110
  {
1107
1111
  ...props,
@@ -1142,7 +1146,7 @@ const CustomerSearch = ({ onSelectCustomer, placeholder, rootProps, ...props })
1142
1146
 
1143
1147
  const cx$i = classNames.bind(styles$2);
1144
1148
  const { InputBox: InputBox$2, Input: Input$2 } = FormCore;
1145
- function CustomerSearchModal({ isOpen, closeModal, onSelect }) {
1149
+ function CustomerSearchModal({ isOpen, closeModal, onSelect, onSearchClear }) {
1146
1150
  const {
1147
1151
  triggerRef,
1148
1152
  searchInput,
@@ -1157,12 +1161,16 @@ function CustomerSearchModal({ isOpen, closeModal, onSelect }) {
1157
1161
  onClear,
1158
1162
  handleSelectItem
1159
1163
  } = useCustomerSearch(onSelect);
1164
+ const handleClear = () => {
1165
+ onClear();
1166
+ onSearchClear?.();
1167
+ };
1160
1168
  return /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose: closeModal, modalSize: "full-screen", children: [
1161
1169
  /* @__PURE__ */ jsx(Modal.Overlay, {}),
1162
1170
  /* @__PURE__ */ jsxs(Modal.Content, { children: [
1163
1171
  /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uACE0\uAC1D \uAC80\uC0C9", showCloseButton: true }),
1164
1172
  /* @__PURE__ */ jsxs(Modal.Body, { children: [
1165
- /* @__PURE__ */ jsx(InputBox$2, { endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }), onClear, clearable: true, children: /* @__PURE__ */ jsx(
1173
+ /* @__PURE__ */ jsx(InputBox$2, { endElement: /* @__PURE__ */ jsx(IconMainUiSearch, { onClick: search }), onClear: handleClear, clearable: true, children: /* @__PURE__ */ jsx(
1166
1174
  Input$2,
1167
1175
  {
1168
1176
  onChange: onSearchInputChange,