sales-frontend-components 0.0.156 → 0.0.158
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 +22 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +29 -4
- package/dist/index.esm.js +22 -6
- package/dist/index.esm.js.map +1 -1
- package/package.json +15 -15
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,
|
|
@@ -2812,6 +2820,7 @@ function useJobSearchModal() {
|
|
|
2812
2820
|
isLoading
|
|
2813
2821
|
} = useJobSearch();
|
|
2814
2822
|
const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
|
|
2823
|
+
const [isConfirmed, setIsConfirmed] = React.useState(false);
|
|
2815
2824
|
const onTabChange = (value) => {
|
|
2816
2825
|
reset();
|
|
2817
2826
|
setActiveTab(value);
|
|
@@ -2823,6 +2832,7 @@ function useJobSearchModal() {
|
|
|
2823
2832
|
openModal();
|
|
2824
2833
|
};
|
|
2825
2834
|
const closeModalWithCheck = () => {
|
|
2835
|
+
setIsConfirmed(true);
|
|
2826
2836
|
if (!selectedJob) {
|
|
2827
2837
|
salesFrontendDesignSystem.ModalUtils.alert("\uC9C1\uC885\uC744 \uC120\uD0DD\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uC9C1\uC885 \uC120\uD0DD \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.", "\uC9C1\uC885\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.", {
|
|
2828
2838
|
modalId: "job-search-alert-no-selected"
|
|
@@ -2890,6 +2900,7 @@ function useJobSearchModal() {
|
|
|
2890
2900
|
}
|
|
2891
2901
|
),
|
|
2892
2902
|
isJobSearchOpen: isOpen,
|
|
2903
|
+
isConfirmed,
|
|
2893
2904
|
openJobSearchModal: openInitModal,
|
|
2894
2905
|
closeJobSearchModal: closeModal,
|
|
2895
2906
|
selectedJob,
|
|
@@ -3037,6 +3048,7 @@ function useJobVehicleSearchModal() {
|
|
|
3037
3048
|
selectedJobDetail
|
|
3038
3049
|
} = useJobVehicleSearch();
|
|
3039
3050
|
const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
|
|
3051
|
+
const [isConfirmed, setIsConfirmed] = React.useState(false);
|
|
3040
3052
|
const validate = () => {
|
|
3041
3053
|
if (!selectedJob && !selectedVehicle) {
|
|
3042
3054
|
return salesFrontendDesignSystem.ModalUtils.alert(
|
|
@@ -3070,6 +3082,7 @@ function useJobVehicleSearchModal() {
|
|
|
3070
3082
|
riskGrade,
|
|
3071
3083
|
hospitalizationGrade,
|
|
3072
3084
|
isOpenJobVehicleModal: isOpen,
|
|
3085
|
+
isConfirmed,
|
|
3073
3086
|
openJobVehicleModal: openInitModal,
|
|
3074
3087
|
closeJobVehicleModal: closeModal,
|
|
3075
3088
|
JobVehicleSearchModalComponent: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
|
|
@@ -3117,7 +3130,10 @@ function useJobVehicleSearchModal() {
|
|
|
3117
3130
|
] }),
|
|
3118
3131
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$5("right-panel"), children: rightPanelView === "jobSearch" ? JobSearch : VehicleSearch })
|
|
3119
3132
|
] }) }),
|
|
3120
|
-
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { style: { marginTop: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick:
|
|
3133
|
+
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { style: { marginTop: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: () => {
|
|
3134
|
+
validate();
|
|
3135
|
+
setIsConfirmed(true);
|
|
3136
|
+
}, children: "\uD655\uC778" }) })
|
|
3121
3137
|
] })
|
|
3122
3138
|
] })
|
|
3123
3139
|
};
|
|
@@ -4457,6 +4473,7 @@ exports.useAddressComponent = useAddressComponent;
|
|
|
4457
4473
|
exports.useBankStockSearch = useBankStockSearch;
|
|
4458
4474
|
exports.useCamera = useCamera;
|
|
4459
4475
|
exports.useCanvasPaint = useCanvasPaint;
|
|
4476
|
+
exports.useCustomerSearch = useCustomerSearch;
|
|
4460
4477
|
exports.useDownloader = useDownloader;
|
|
4461
4478
|
exports.useJobSearchModal = useJobSearchModal;
|
|
4462
4479
|
exports.useJobVehicleSearchModal = useJobVehicleSearchModal;
|