sccoreui 6.5.40 → 6.5.42

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.
@@ -30,13 +30,11 @@ function Sort() {
30
30
  const sortDetails = {
31
31
  isSortable: false,
32
32
  columnToSort: eachColumn,
33
- orderToSort: sortBy,
33
+ orderToSort: {},
34
34
  };
35
- if ((Object === null || Object === void 0 ? void 0 : Object.keys(sortBy).length) > 0) {
36
- sortDetails.isSortable = true;
37
- }
38
35
  setSortInfo(sortDetails);
39
36
  setSortValue(eachColumn);
37
+ setSortBy({});
40
38
  setShowBorder(true);
41
39
  }
42
40
  };
@@ -44,7 +44,7 @@ const conditionsList = [
44
44
  label: "contains_any_of",
45
45
  name: "Contains Any Of",
46
46
  value: CONDITIONSOPERATORS.CONTAINS_ANY_OF,
47
- fieldOperators: [Types_1.FilterDataType.STRING, Types_1.FilterDataType.MULTISELECT],
47
+ fieldOperators: [Types_1.FilterDataType.STRING],
48
48
  },
49
49
  {
50
50
  id: CONDITIONSOPERATORS.DOESNT_CONTAIN_ALL_OF,
@@ -58,7 +58,7 @@ const conditionsList = [
58
58
  label: "doesnt_contain_any_of",
59
59
  name: "Doesn't Contain Any Of",
60
60
  value: CONDITIONSOPERATORS.DOESNT_CONTAIN_ANY_OF,
61
- fieldOperators: [Types_1.FilterDataType.STRING, Types_1.FilterDataType.MULTISELECT],
61
+ fieldOperators: [Types_1.FilterDataType.STRING],
62
62
  },
63
63
  {
64
64
  id: CONDITIONSOPERATORS.STARTS_WITH_ANY_OF,
@@ -200,6 +200,7 @@ const conditionsList = [
200
200
  Types_1.FilterDataType.DECIMAL,
201
201
  Types_1.FilterDataType.CURRENCY,
202
202
  Types_1.FilterDataType.PERCENT,
203
+ Types_1.FilterDataType.BIGINTEGER,
203
204
  Types_1.FilterDataType.BOOLEAN,
204
205
  Types_1.FilterDataType.SELECT
205
206
  ],
@@ -217,6 +218,7 @@ const conditionsList = [
217
218
  Types_1.FilterDataType.DECIMAL,
218
219
  Types_1.FilterDataType.CURRENCY,
219
220
  Types_1.FilterDataType.PERCENT,
221
+ Types_1.FilterDataType.BIGINTEGER,
220
222
  Types_1.FilterDataType.BOOLEAN,
221
223
  Types_1.FilterDataType.SELECT
222
224
  ],
@@ -234,6 +236,7 @@ const conditionsList = [
234
236
  Types_1.FilterDataType.DECIMAL,
235
237
  Types_1.FilterDataType.CURRENCY,
236
238
  Types_1.FilterDataType.PERCENT,
239
+ Types_1.FilterDataType.BIGINTEGER,
237
240
  Types_1.FilterDataType.DATE,
238
241
  Types_1.FilterDataType.DATEANDTIME,
239
242
  Types_1.FilterDataType.MULTISELECT
@@ -252,6 +255,7 @@ const conditionsList = [
252
255
  Types_1.FilterDataType.DECIMAL,
253
256
  Types_1.FilterDataType.CURRENCY,
254
257
  Types_1.FilterDataType.PERCENT,
258
+ Types_1.FilterDataType.BIGINTEGER,
255
259
  Types_1.FilterDataType.DATE,
256
260
  Types_1.FilterDataType.DATEANDTIME,
257
261
  Types_1.FilterDataType.MULTISELECT
@@ -264,6 +268,13 @@ const conditionsList = [
264
268
  value: CONDITIONSOPERATORS.IS_EQUAL_TO_ALL_OF,
265
269
  fieldOperators: [Types_1.FilterDataType.MULTISELECT],
266
270
  },
271
+ {
272
+ id: CONDITIONSOPERATORS.IS_NOT_EQUAL_TO_ALL_OF,
273
+ label: "is_not_equal_to_all_of",
274
+ name: "Is Not Equal To All Of",
275
+ value: CONDITIONSOPERATORS.IS_NOT_EQUAL_TO_ALL_OF,
276
+ fieldOperators: [Types_1.FilterDataType.MULTISELECT],
277
+ },
267
278
  // Presence
268
279
  {
269
280
  id: CONDITIONSOPERATORS.IS_KNOWN,
@@ -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
- const popupParent = (0, react_1.useMemo)(() => {
397
- return document.getElementById("wrapper");
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: "wrapper", 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 }))] }) })) }) }));
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.5.40",
3
+ "version": "6.5.42",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",