sccoreui 3.7.7 → 3.7.9
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.
|
@@ -40,8 +40,7 @@ const MultiSelectField = (props) => {
|
|
|
40
40
|
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column gap-1" }, { children: [optional && (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "font-medium text-base mb-1 w-full flex justify-content-between", htmlFor: name }, { children: [label, (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-base font-medium font-italic text-gray-600" }, { children: "Optional" }))] })), !optional && (0, jsx_runtime_1.jsx)("label", Object.assign({ className: "font-medium text-base mb-1", htmlFor: name }, { children: label })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, Object.assign({ placeholder: placeholder }, field, { options: options, itemTemplate: customFieldsTemplate, valueTemplate: customSelectedTemplate, optionDisabled: optionDisabled, optionLabel: optionLabel, className: `fullWidth ${className} ${errors[name] ? 'p-invalid' : ''} ${length === 'full' ? '' : 'w-18rem'}`, id: name }))) })), errors[name] && touched[name] ? ((0, jsx_runtime_1.jsx)("small", Object.assign({ className: 'errorField' }, { children: errors[name] }))) : (0, jsx_runtime_1.jsx)("small", { children: "\u00A0" })] })));
|
|
41
41
|
};
|
|
42
42
|
const PhoneNumberField = (props) => {
|
|
43
|
-
const
|
|
44
|
-
const { errors, touched, name, length, label, placeholder, optional, position, setFieldValue } = props;
|
|
43
|
+
const { errors, touched, name, length, values, label, placeholder, optional, position, setFieldValue } = props;
|
|
45
44
|
const customCountry = (props) => {
|
|
46
45
|
const customCountryTemplate = (options) => {
|
|
47
46
|
let callCode = (0, max_1.getCountryCallingCode)(options.value);
|
|
@@ -53,12 +52,11 @@ const PhoneNumberField = (props) => {
|
|
|
53
52
|
}
|
|
54
53
|
return ((0, jsx_runtime_1.jsx)("div", { children: placeholder }));
|
|
55
54
|
};
|
|
56
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ id: 'customCountryDropDown' }, { children: (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { filter: true, filterBy: 'label', options: props.options, panelClassName: `${position === 'left' ? '' : 'phoneNumberClass'}`, panelStyle: { maxWidth: '18rem' },
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} }) })));
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ id: 'customCountryDropDown' }, { children: (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ name: "countryCode" }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({ filter: true, filterBy: 'label', options: props.options }, field, { panelClassName: `${position === 'left' ? '' : 'phoneNumberClass'}`, panelStyle: { maxWidth: '18rem' } }, props, { itemTemplate: customCountryTemplate, valueTemplate: customSelectedVal, optionLabel: 'value', onChange: (e) => {
|
|
56
|
+
setFieldValue('countryCode', e.value);
|
|
57
|
+
} }))) })) })));
|
|
60
58
|
};
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column gap-1" }, { children: [optional && (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "font-medium text-base mb-1 w-full flex justify-content-between", htmlFor: name }, { children: [label, (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-base font-medium font-italic text-gray-600" }, { children: "Optional" }))] })), !optional && (0, jsx_runtime_1.jsx)("label", Object.assign({ className: "font-medium text-base mb-1", htmlFor: name }, { children: label })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(max_1.default, Object.assign({ international: true, countryCallingCodeEditable: false, withCountryCallingCode: false, countrySelectComponent: customCountry, usenationalformatfordefaultcountryvalue: "true", defaultCountry:
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column gap-1" }, { children: [optional && (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "font-medium text-base mb-1 w-full flex justify-content-between", htmlFor: name }, { children: [label, (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-base font-medium font-italic text-gray-600" }, { children: "Optional" }))] })), !optional && (0, jsx_runtime_1.jsx)("label", Object.assign({ className: "font-medium text-base mb-1", htmlFor: name }, { children: label })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(max_1.default, Object.assign({ international: true, countryCallingCodeEditable: false, withCountryCallingCode: false, countrySelectComponent: customCountry, usenationalformatfordefaultcountryvalue: "true", defaultCountry: values[name], limitMaxLength: true, className: `fullWidth flex align-items-center ${errors[name] ? 'p-invalid' : ''} ${length === 'full' ? 'w-18rem' : 'w-18rem'}` }, field, { onChange: (e) => setFieldValue(name, e) }))) })), errors[name] && touched[name] ? ((0, jsx_runtime_1.jsx)("small", Object.assign({ className: 'errorField' }, { children: errors[name] }))) : (0, jsx_runtime_1.jsx)("small", { children: "\u00A0" })] })));
|
|
62
60
|
};
|
|
63
61
|
// const InputGroupField = (props: any) => {
|
|
64
62
|
// const { errors, touched, name, length, label, placeholder, optional, position, setFieldValue } = props;
|