sccoreui 6.5.41 → 6.5.43
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.
|
@@ -86,6 +86,11 @@ function ParentForGrid(props) {
|
|
|
86
86
|
const isInitialLoadRef = (0, react_1.useRef)(true);
|
|
87
87
|
const isRefetchingRef = (0, react_1.useRef)(false);
|
|
88
88
|
const gridRef = (0, react_1.useRef)(null);
|
|
89
|
+
// Unique per instance — multiple grids can be mounted on the same screen at once
|
|
90
|
+
// (e.g. an "include" and "exclude" grid side by side), so a hardcoded id here would
|
|
91
|
+
// collide and popupParent (below) would resolve to the wrong instance's wrapper.
|
|
92
|
+
const wrapperId = (0, react_1.useId)();
|
|
93
|
+
const wrapperRef = (0, react_1.useRef)(null);
|
|
89
94
|
const groupingColumns = (0, react_1.useMemo)(() => {
|
|
90
95
|
var _a, _b;
|
|
91
96
|
return (_b = (_a = gridData === null || gridData === void 0 ? void 0 : gridData.columnData) === null || _a === void 0 ? void 0 : _a.filter((colDef) => colDef === null || colDef === void 0 ? void 0 : colDef.rowGroup)) === null || _b === void 0 ? void 0 : _b.length;
|
|
@@ -393,8 +398,12 @@ function ParentForGrid(props) {
|
|
|
393
398
|
// api?.showNoRowsOverlay(); // Show the noRowsOverlayComponent only if no rows or pinned rows are present
|
|
394
399
|
// }
|
|
395
400
|
// }, [gridData.rowData, props?.pinnedTopRowData]);
|
|
396
|
-
|
|
397
|
-
|
|
401
|
+
// Resolved from this instance's own ref (not a global id lookup) once it's mounted —
|
|
402
|
+
// the ref isn't attached yet during the render that builds gridOptions the first
|
|
403
|
+
// time, so this is set via an effect rather than computed synchronously.
|
|
404
|
+
const [popupParent, setPopupParent] = (0, react_1.useState)(null);
|
|
405
|
+
(0, react_1.useEffect)(() => {
|
|
406
|
+
setPopupParent(wrapperRef.current);
|
|
398
407
|
}, []);
|
|
399
408
|
const onGridPreDestroyed = () => {
|
|
400
409
|
const allData = [];
|
|
@@ -607,6 +616,6 @@ function ParentForGrid(props) {
|
|
|
607
616
|
renderSelectField,
|
|
608
617
|
renderMultiSelectField,
|
|
609
618
|
]);
|
|
610
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ id:
|
|
619
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ id: wrapperId, ref: wrapperRef, style: { height: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.height, width: gridStyle === null || gridStyle === void 0 ? void 0 : gridStyle.width }, className: `ag-grid-container ag-grid-parent-div ${(props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) ? "hide-advance-filter" : ""}` }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(context_provider_1.default, Object.assign({ value: contextValue }, { children: ((_h = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _h === void 0 ? void 0 : _h.displayFeaturesHeader) && ((0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props })) })), gridView ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: gridViewTemplate(gridViewData) })) : ((0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: gridStyle, gridOptions: gridOptions, onGridReady: (props === null || props === void 0 ? void 0 : props.rowData) ? undefined : onGridReady, gridRef: gridRef }))] }) })) }) }));
|
|
611
620
|
}
|
|
612
621
|
exports.default = ParentForGrid;
|
|
@@ -65,7 +65,7 @@ const InputTextAreaField = (props) => {
|
|
|
65
65
|
const DropDownField = (props) => {
|
|
66
66
|
const { errors, touched, name, length, label, onFocus,
|
|
67
67
|
// onChange,
|
|
68
|
-
placeholder, panelClassName, showClear, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled, className, validate, disabled, filter, panelStyle, isLoading, isRequired = false, value, filterPlaceholder, emptyMessage, emptyFilterMessage, unselect = false, } = props;
|
|
68
|
+
placeholder, panelClassName, showClear, options, optional, customSelectedTemplate, customFieldsTemplate, optionLabel, optionDisabled, className, validate, disabled, filter, panelStyle, isLoading, isRequired = false, value, filterPlaceholder, emptyMessage, emptyFilterMessage, unselect = false, resetFilterOnHide, } = props;
|
|
69
69
|
const errorData = (0, formik_1.getIn)(errors, name);
|
|
70
70
|
const touchedData = (0, formik_1.getIn)(touched, name);
|
|
71
71
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column" }, { children: !isLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [optional && ((0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "font-medium text-base mb-1 w-full flex justify-content-between text_ellipsis", 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 && (
|
|
@@ -74,19 +74,19 @@ const DropDownField = (props) => {
|
|
|
74
74
|
// </label>
|
|
75
75
|
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errorData, touched: touchedData, isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({ onFocus: () => {
|
|
76
76
|
onFocus && onFocus();
|
|
77
|
-
}, panelClassName: panelClassName, showClear: showClear, panelStyle: panelStyle || "", filter: filter || false, disabled: disabled, placeholder: placeholder }, field, { onChange: (e) => {
|
|
77
|
+
}, panelClassName: panelClassName, showClear: showClear, panelStyle: panelStyle || "", filter: filter || false, resetFilterOnHide: resetFilterOnHide !== undefined ? resetFilterOnHide : Boolean(filter), disabled: disabled, placeholder: placeholder }, field, { onChange: (e) => {
|
|
78
78
|
!unselect && field.onChange(e);
|
|
79
79
|
},
|
|
80
80
|
// onChange={(e: any) => onChange && onChange(e)}
|
|
81
81
|
options: options, itemTemplate: customFieldsTemplate, valueTemplate: customSelectedTemplate, optionDisabled: optionDisabled, optionLabel: optionLabel, className: ` ${errorData && touchedData ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name, filterPlaceholder: filterPlaceholder ? filterPlaceholder : "Search", emptyMessage: emptyMessage ? emptyMessage : "No Data Found", emptyFilterMessage: emptyFilterMessage ? emptyFilterMessage : "No Results Found" }))) })), errorData && touchedData ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errorData }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-column gap-1" }, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "w-5rem" }), (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) }))] })) })));
|
|
82
82
|
};
|
|
83
83
|
const MultiSelectField = (props) => {
|
|
84
|
-
const { errors, touched, name, length, label, placeholder, options, optional, customFieldsTemplate, optionLabel, optionDisabled, className, validate, disabled, isLoading, filter, isRequired = false, value, } = props;
|
|
84
|
+
const { errors, touched, name, length, label, placeholder, options, optional, customFieldsTemplate, optionLabel, optionDisabled, className, validate, disabled, isLoading, filter, isRequired = false, value, filterPlaceholder, resetFilterOnHide, } = props;
|
|
85
85
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column" }, { children: !isLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { 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 && (
|
|
86
86
|
// <label className="font-medium text-base mb-1" htmlFor={name}>
|
|
87
87
|
// {label}
|
|
88
88
|
// </label>
|
|
89
|
-
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, Object.assign({ filter: filter ? filter : false, disabled: disabled, placeholder: placeholder }, field, { options: options, itemTemplate: customFieldsTemplate, optionDisabled: optionDisabled, optionLabel: optionLabel, className: ` ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name }))) })), (errors === null || errors === void 0 ? void 0 : errors[name]) && (touched === null || touched === void 0 ? void 0 : touched[name]) ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors === null || errors === void 0 ? void 0 : errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) }))] })) })));
|
|
89
|
+
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, htmlFor: name, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ type: "text", name: name, validate: validate }, { children: ({ field }) => ((0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, Object.assign({ filter: filter ? filter : false, filterPlaceholder: filterPlaceholder ? filterPlaceholder : "Search", resetFilterOnHide: resetFilterOnHide !== undefined ? resetFilterOnHide : Boolean(filter), disabled: disabled, placeholder: placeholder }, field, { options: options, itemTemplate: customFieldsTemplate, optionDisabled: optionDisabled, optionLabel: optionLabel, className: ` ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name }))) })), (errors === null || errors === void 0 ? void 0 : errors[name]) && (touched === null || touched === void 0 ? void 0 : touched[name]) ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors === null || errors === void 0 ? void 0 : errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) }))] })) })));
|
|
90
90
|
};
|
|
91
91
|
const PhoneNumberField = (props) => {
|
|
92
92
|
const { errors, touched, name, length, values, label, placeholder, optional, position, setFieldValue, isLoading, isRequired = false, value, } = props;
|
|
@@ -171,6 +171,7 @@ export interface DropDownFieldProps {
|
|
|
171
171
|
value?: any;
|
|
172
172
|
emptyFilterMessage?: any;
|
|
173
173
|
filterPlaceholder?: string;
|
|
174
|
+
resetFilterOnHide?: boolean;
|
|
174
175
|
}
|
|
175
176
|
export interface MultiSelectProps {
|
|
176
177
|
errors: any;
|
|
@@ -193,6 +194,8 @@ export interface MultiSelectProps {
|
|
|
193
194
|
value?: any;
|
|
194
195
|
emptyMessage?: any;
|
|
195
196
|
emptyFilterMessage?: any;
|
|
197
|
+
filterPlaceholder?: string;
|
|
198
|
+
resetFilterOnHide?: boolean;
|
|
196
199
|
}
|
|
197
200
|
export interface TreeDropdownSelectTypes {
|
|
198
201
|
displayLabelName: string;
|