sccoreui 3.7.3 → 3.7.4
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.
|
@@ -11,33 +11,33 @@ const inputtextarea_1 = require("primereact/inputtextarea");
|
|
|
11
11
|
const max_1 = tslib_1.__importStar(require("react-phone-number-input/max"));
|
|
12
12
|
const inputnumber_1 = require("primereact/inputnumber");
|
|
13
13
|
const InputTextField = (props) => {
|
|
14
|
-
const { errors, touched, name, length, label, placeholder, optional, maxLength } = props;
|
|
15
|
-
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)(inputtext_1.InputText, Object.assign({ maxLength: maxLength, placeholder: placeholder }, field, { className:
|
|
14
|
+
const { errors, touched, name, length, label, placeholder, optional, maxLength, className } = props;
|
|
15
|
+
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)(inputtext_1.InputText, Object.assign({ maxLength: maxLength, placeholder: placeholder }, field, { className: `${className} fullWidth ${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" })] })));
|
|
16
16
|
};
|
|
17
17
|
const InputNumberField = (props) => {
|
|
18
|
-
const { errors, touched, name, length, label, placeholder, optional, setFieldValue, min, max, maxLength } = props;
|
|
19
|
-
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({ name: name, type: "number" }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ min: min, max: max, maxLength: maxLength, placeholder: placeholder }, field, { onChange: (e) => setFieldValue(name, e.value), className: `fullWidth ${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" })] })));
|
|
18
|
+
const { errors, touched, name, length, label, placeholder, optional, setFieldValue, min, max, maxLength, className } = props;
|
|
19
|
+
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({ name: name, type: "number" }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ min: min, max: max, maxLength: maxLength, placeholder: placeholder }, field, { onChange: (e) => setFieldValue(name, e.value), 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" })] })));
|
|
20
20
|
};
|
|
21
21
|
const InputCurrencyField = (props) => {
|
|
22
|
-
const { errors, touched, name, length, label, placeholder, optional, setFieldValue, min, max, maxLength } = props;
|
|
23
|
-
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({ name: name, type: "number" }, { children: ({ field }) => ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "p-input-icon-left" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix text-lg text-gray-600 font-normal" }, { children: "$" })), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ min: min, max: max, maxLength: maxLength }, field, { onChange: (e) => setFieldValue(name, e.value), maxFractionDigits: 2, placeholder: placeholder, className: `fullWidth customNumberField ${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" })] })));
|
|
22
|
+
const { errors, touched, name, length, label, placeholder, optional, setFieldValue, min, max, maxLength, className } = props;
|
|
23
|
+
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({ name: name, type: "number" }, { children: ({ field }) => ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "p-input-icon-left" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix text-lg text-gray-600 font-normal" }, { children: "$" })), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ min: min, max: max, maxLength: maxLength }, field, { onChange: (e) => setFieldValue(name, e.value), maxFractionDigits: 2, placeholder: placeholder, className: `fullWidth ${className} customNumberField ${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" })] })));
|
|
24
24
|
};
|
|
25
25
|
const InputTextAreaField = (props) => {
|
|
26
26
|
const [charCount, setCharCount] = (0, react_1.useState)(0);
|
|
27
|
-
const { errors, touched, name, length, label, placeholder, optional, values } = props;
|
|
27
|
+
const { errors, touched, name, length, label, placeholder, optional, values, className } = props;
|
|
28
28
|
(0, react_1.useEffect)(() => {
|
|
29
29
|
setCharCount(values[name].length);
|
|
30
30
|
}, [values[name]]);
|
|
31
31
|
(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-base font-medium font-italic text-gray-600" }, { children: "Optional" }));
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column gap-1 relative" }, { 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({ name: name, type: "textarea" }, { children: ({ field }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(inputtextarea_1.InputTextarea, Object.assign({ placeholder: placeholder, style: { height: '154px', resize: 'none', overflowY: 'scroll' } }, field, { maxLength: 100, className: `pt-2 fullWidth ${errors[name] ? 'p-invalid' : ''} ${length === 'full' ? '' : 'w-18rem'}`, id: name })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "absolute text-base font-normal text-gray-600", style: { bottom: '30px', right: '12px' } }, { children: [charCount, "/100"] }))] })) })), 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" })] })));
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column gap-1 relative" }, { 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({ name: name, type: "textarea" }, { children: ({ field }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(inputtextarea_1.InputTextarea, Object.assign({ placeholder: placeholder, style: { height: '154px', resize: 'none', overflowY: 'scroll' } }, field, { maxLength: 100, className: `pt-2 fullWidth ${className} ${errors[name] ? 'p-invalid' : ''} ${length === 'full' ? '' : 'w-18rem'}`, id: name })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "absolute text-base font-normal text-gray-600", style: { bottom: '30px', right: '12px' } }, { children: [charCount, "/100"] }))] })) })), 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" })] })));
|
|
33
33
|
};
|
|
34
34
|
const DropDownField = (props) => {
|
|
35
|
-
const { errors, touched, name, length, label, placeholder, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled } = props;
|
|
36
|
-
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)(dropdown_1.Dropdown, Object.assign({ placeholder: placeholder }, field, { options: options, itemTemplate: customFieldsTemplate, valueTemplate: customSelectedTemplate, optionDisabled: optionDisabled, optionLabel: optionLabel, className: `fullWidth ${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" })] })));
|
|
35
|
+
const { errors, touched, name, length, label, placeholder, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled, className } = props;
|
|
36
|
+
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)(dropdown_1.Dropdown, 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" })] })));
|
|
37
37
|
};
|
|
38
38
|
const MultiSelectField = (props) => {
|
|
39
|
-
const { errors, touched, name, length, label, placeholder, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled } = props;
|
|
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 ${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" })] })));
|
|
39
|
+
const { errors, touched, name, length, label, placeholder, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled, className } = props;
|
|
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
43
|
const [defaultCountry, setDefaultCountry] = (0, react_1.useState)('US');
|
|
@@ -58,7 +58,7 @@ const PhoneNumberField = (props) => {
|
|
|
58
58
|
setDefaultCountry(e.value);
|
|
59
59
|
} }) })));
|
|
60
60
|
};
|
|
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,
|
|
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: defaultCountry, 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
62
|
};
|
|
63
63
|
// const InputGroupField = (props: any) => {
|
|
64
64
|
// const { errors, touched, name, length, label, placeholder, optional, position, setFieldValue } = props;
|