sales-frontend-components 0.0.90 → 0.0.92
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 +16 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.esm.js +17 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { FieldValues, UseControllerProps } from 'react-hook-form';
|
|
3
|
-
import { CheckboxButtonProps, CheckboxProps, DatePickerSingleHtmlProps, DatePickerRangeHtmlProps, FormField, SegmentGroupHtmlProps, SelectProps, OptionProps } from 'sales-frontend-design-system';
|
|
3
|
+
import { CheckboxButtonProps, CheckboxProps, DatePickerSingleHtmlProps, DatePickerRangeHtmlProps, FormField, SegmentGroupHtmlProps, SelectProps, OptionProps, SegmentItems } from 'sales-frontend-design-system';
|
|
4
4
|
import * as sales_frontend_api_method from 'sales-frontend-api/method';
|
|
5
5
|
import { OccupationResponseDto, AddressStandardizationResponseDto, AddressResponseDto, CodeDto, OrganizationProfileResponse, EmployeeProfileResponseDto, PersonalCustomerProfileResponseDto, CustomerSearchProps, RemoteIdentityVerificationSystemTokenRequestDto, ApiConfig } from 'sales-frontend-api/method';
|
|
6
6
|
import * as React$1 from 'react';
|
|
@@ -35,10 +35,7 @@ declare const FormSelect: {
|
|
|
35
35
|
Group: <TFormValues extends FieldValues>({ options, optionsProps, ...props }: Omit<IFormSelectGroupProps<TFormValues>, "children">) => react_jsx_runtime.JSX.Element;
|
|
36
36
|
};
|
|
37
37
|
interface IFormSelectGroupProps<TFormValues extends FieldValues> extends FormSelectProps<TFormValues> {
|
|
38
|
-
options:
|
|
39
|
-
label: string;
|
|
40
|
-
value: string;
|
|
41
|
-
}[];
|
|
38
|
+
options: SegmentItems[];
|
|
42
39
|
optionsProps?: Omit<OptionProps, 'children' | 'value'>;
|
|
43
40
|
}
|
|
44
41
|
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useController } from 'react-hook-form';
|
|
3
|
-
import { CheckboxButton, Checkbox, DatePicker, DateRangePicker, Table, Accordion, Radio, FormField, Select, Tab, useModalState, Modal, Button, SegmentGroup, ModalUtils, FormCore, RadioGroup, useDropDown, List, ListItem, Loading } from 'sales-frontend-design-system';
|
|
3
|
+
import { CheckboxButton, Checkbox, isDate, DatePicker, DateRangePicker, Table, Accordion, Radio, FormField, Select, Tab, useModalState, Modal, Button, SegmentGroup, ModalUtils, FormCore, RadioGroup, useDropDown, List, ListItem, Loading } from 'sales-frontend-design-system';
|
|
4
4
|
import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
|
|
5
5
|
import { useSearchOccupationDetailQuery, useSearchOccupationQuery, useSearchAddressQuery, useSearchPostalCodeQuery, useSearchAddressStandardizationQuery, useSearchCommonCodeQuery, useSearchOrganizationQuery, useSearchEmployeeProfileQuery, useSearchVehicleQuery, useSearchRiskGradeQuery, getDspCustomerListMethod, useSearchCustomerListQuery, getRemoteIdentityVerificationSystemToken } from 'sales-frontend-api/method';
|
|
6
6
|
import { IconMainUiSearch, IconIllustCamera, IconGraphicsBankSaneop, IconGraphicsBankKiup, IconGraphicsBankKukmin, IconGraphicsBankSuhyeop, IconGraphicsBankJangGiSinYong, IconGraphicsBankNhNonghyeop, IconGraphicsBankJiyeokNonghyeop, IconGraphicsBankWoori, IconGraphicsBankScJeil, IconGraphicsBankSinhan, IconGraphicsBankHankookCity, IconGraphicsBankDaegu, IconGraphicsBankBusan, IconGraphicsBankGwangju, IconGraphicsBankJeju, IconGraphicsBankJeonbuk, IconGraphicsBankGyeongnam, IconGraphicsBankSaemaulGeumgo, IconGraphicsBankSinhyeop, IconGraphicsBankJeochuk, IconGraphicsBankHsbc, IconGraphicsBankABNAMRO, IconGraphicsBankSanlim, IconGraphicsBankPost, IconGraphicsBankKebHana, IconGraphicsBankKBank, IconGraphicsBankKakaoBank, IconGraphicsBankTossBank, IconGraphicsStockYuantaJeungkwon, IconGraphicsStockKbJeungkwon, IconGraphicsStockMiraeAssetJeungkwon, IconGraphicsStockSamsungJeungkwon, IconGraphicsStockHankookTujajeungkwon, IconGraphicsStockNhWooriTujajeungkwon, IconGraphicsStockGyoboJeungkwon, IconGraphicsStockHiTujajeungkwon, IconGraphicsStockHyundaiChaJeungkwon, IconGraphicsStockKiwoomJeungkwon, IconGraphicsStockSkJeungkwon, IconGraphicsStockDaesinJeungkwon, IconGraphicsStockHanwhaTujajeungkwon, IconGraphicsStockHanaGeumyungTujajeungkwon, IconGraphicsStockSinhanTujajeungkwon, IconGraphicsStockDbGeumyungTujajeungkwon, IconGraphicsStockYujinTujajeungkwon, IconGraphicsStockMeritzJeungkwon, IconGraphicsStockKakaoPayJeungkwon, IconGraphicsStockNhTujajeungkwon, IconGraphicsStockBugukJeungkwon, IconGraphicsStockSinyeongJeungkwon, IconGraphicsStockHochulEopsum, IconGraphicsFeedbackEmpty, IconIllustGrade, IconIllustJob, IconSubUiArrowRight, IconIllustVehicle } from 'sales-frontend-assets';
|
|
@@ -64,7 +64,7 @@ const FormDatePicker = ({
|
|
|
64
64
|
const { field, fieldState } = useController({ name, control, disabled, defaultValue });
|
|
65
65
|
const [selected, setSelected] = React.useState();
|
|
66
66
|
React.useEffect(() => {
|
|
67
|
-
if (field.value !== selected) {
|
|
67
|
+
if (isDate(field.value) && field.value !== selected) {
|
|
68
68
|
setSelected(field.value);
|
|
69
69
|
}
|
|
70
70
|
}, [field.value]);
|
|
@@ -99,16 +99,12 @@ const FormDateRangePicker = ({
|
|
|
99
99
|
});
|
|
100
100
|
const [selected, setSelected] = React.useState();
|
|
101
101
|
React.useEffect(() => {
|
|
102
|
-
if (field.value && !selected) {
|
|
102
|
+
if (isDate(field.value) && !selected) {
|
|
103
103
|
setSelected(field.value);
|
|
104
104
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
console.warn(field.value, selected);
|
|
109
|
-
}
|
|
110
|
-
} catch (e) {
|
|
111
|
-
console.log(e);
|
|
105
|
+
if (isDate(field.value) && selected && (field.value.startDate.getTime() !== selected.startDate?.getTime() || field.value.endDate.getTime() !== selected.endDate?.getTime())) {
|
|
106
|
+
setSelected(field.value);
|
|
107
|
+
console.warn(field.value, selected);
|
|
112
108
|
}
|
|
113
109
|
}, [field.value]);
|
|
114
110
|
return /* @__PURE__ */ jsx(
|
|
@@ -864,7 +860,9 @@ const FormSelectGroup = ({
|
|
|
864
860
|
optionsProps,
|
|
865
861
|
...props
|
|
866
862
|
}) => {
|
|
867
|
-
return /* @__PURE__ */ jsx(FormSelect, { ...props, children: options.map(
|
|
863
|
+
return /* @__PURE__ */ jsx(FormSelect, { ...props, children: options.map(
|
|
864
|
+
(option) => option.label && /* @__PURE__ */ jsx(FormSelectOption, { value: option.value, ...optionsProps, children: option.label }, option.value)
|
|
865
|
+
) });
|
|
868
866
|
};
|
|
869
867
|
FormSelect.Option = FormSelectOption;
|
|
870
868
|
FormSelect.Group = FormSelectGroup;
|
|
@@ -1680,7 +1678,6 @@ function AddressComponent({ isOpen, onClose, setValue }) {
|
|
|
1680
1678
|
size: "medium",
|
|
1681
1679
|
appearance: "filled",
|
|
1682
1680
|
width: "full",
|
|
1683
|
-
disabled: nextButtonDisabled,
|
|
1684
1681
|
children: [
|
|
1685
1682
|
addressSearchStep === "search-result" && "\uB2E4\uC74C(1/2)",
|
|
1686
1683
|
addressSearchStep === "detail-input" && "\uD655\uC778(2/2)"
|
|
@@ -1720,6 +1717,14 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1720
1717
|
});
|
|
1721
1718
|
const [nextButtonDisabled, setNextButtonDisabled] = useState(false);
|
|
1722
1719
|
const onNext = () => {
|
|
1720
|
+
if (step === "search-result" && nextButtonDisabled) {
|
|
1721
|
+
ModalUtils.alert(
|
|
1722
|
+
"\uC8FC\uC18C\uB97C \uC120\uD0DD\uD558\uC9C0 \uC54A\uC73C\uBA74 \uB2E4\uC74C \uB2E8\uACC4\uB85C \uC774\uB3D9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\n\uC8FC\uC18C\uB97C \uC120\uD0DD\uD55C \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.",
|
|
1723
|
+
"\uC120\uD0DD \uC8FC\uC18C \uC5C6\uC74C",
|
|
1724
|
+
{ modalId: "search-modal-address-no-selected" }
|
|
1725
|
+
);
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1723
1728
|
if (step === "search-result") {
|
|
1724
1729
|
setStep("detail-input");
|
|
1725
1730
|
setNextButtonDisabled(true);
|