sccoreui 6.5.25 → 6.5.27

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.
Files changed (88) hide show
  1. package/dist/components/ag-grid/advancedFeature/new-filter/conditions/Conditions.js +167 -17
  2. package/dist/components/ag-grid/advancedFeature/new-filter/table-filter.js +30 -11
  3. package/dist/components/ag-grid/parent-for-grid.js +56 -23
  4. package/package.json +1 -1
  5. package/dist/App.scss +0 -3413
  6. package/dist/assets/App.css +0 -96
  7. package/dist/assets/App.css.map +0 -1
  8. package/dist/assets/App.scss +0 -155
  9. package/dist/assets/error/error-500.png +0 -0
  10. package/dist/assets/flex.css +0 -21652
  11. package/dist/assets/fonts/Lato-Black.ttf +0 -0
  12. package/dist/assets/fonts/Lato-Bold.ttf +0 -0
  13. package/dist/assets/fonts/Lato-Light.ttf +0 -0
  14. package/dist/assets/fonts/Lato-Regular.ttf +0 -0
  15. package/dist/assets/fonts/Lato-Thin.ttf +0 -0
  16. package/dist/assets/fonts/Roboto-Bold.ttf +0 -0
  17. package/dist/assets/fonts/Roboto-Italic.ttf +0 -0
  18. package/dist/assets/fonts/Roboto-Medium.ttf +0 -0
  19. package/dist/assets/fonts/Roboto-Regular.ttf +0 -0
  20. package/dist/assets/fonts/primeicons.eot +0 -0
  21. package/dist/assets/fonts/primeicons.svg +0 -292
  22. package/dist/assets/fonts/primeicons.ttf +0 -0
  23. package/dist/assets/fonts/primeicons.woff +0 -0
  24. package/dist/assets/fonts/primeicons.woff2 +0 -0
  25. package/dist/assets/images/Error/error-500.png +0 -0
  26. package/dist/assets/images/Payment-method-apple-card.png +0 -0
  27. package/dist/assets/images/Payment-method-card-white.png +0 -0
  28. package/dist/assets/images/Payment-method-master-card.png +0 -0
  29. package/dist/assets/images/avatar.png +0 -0
  30. package/dist/assets/images/avatar1.png +0 -0
  31. package/dist/assets/images/avatar2.png +0 -0
  32. package/dist/assets/images/avatar3.png +0 -0
  33. package/dist/assets/images/avatar4.png +0 -0
  34. package/dist/assets/images/avatar5.png +0 -0
  35. package/dist/assets/images/avatar6.png +0 -0
  36. package/dist/assets/images/avatar7.png +0 -0
  37. package/dist/assets/images/avatar8.png +0 -0
  38. package/dist/assets/images/avatar9.png +0 -0
  39. package/dist/assets/images/company.png +0 -0
  40. package/dist/assets/images/company1.png +0 -0
  41. package/dist/assets/images/company2.png +0 -0
  42. package/dist/assets/images/company3.png +0 -0
  43. package/dist/assets/images/company4.png +0 -0
  44. package/dist/assets/images/company5.png +0 -0
  45. package/dist/assets/images/company6.png +0 -0
  46. package/dist/assets/images/demoImage.png +0 -0
  47. package/dist/assets/images/drag-and-drop-icon.png +0 -0
  48. package/dist/assets/images/drag.svg +0 -8
  49. package/dist/assets/images/empty-state-icon.svg +0 -53
  50. package/dist/assets/images/label-image.png +0 -0
  51. package/dist/assets/images/profile-square-image.png +0 -0
  52. package/dist/assets/png/checkbox_fill_icon.png +0 -0
  53. package/dist/assets/png/checkbox_minus_icon.png +0 -0
  54. package/dist/assets/png/checkbox_outline_icon.png +0 -0
  55. package/dist/assets/png/checkmark_icon.png +0 -0
  56. package/dist/assets/png/salseforce-img.png +0 -0
  57. package/dist/assets/sccoreicons.css +0 -1105
  58. package/dist/assets/sccoreui.css +0 -8947
  59. package/dist/assets/svg/add.svg +0 -3
  60. package/dist/assets/svg/back-button.svg +0 -3
  61. package/dist/assets/svg/check-white.svg +0 -3
  62. package/dist/assets/svg/check.svg +0 -3
  63. package/dist/assets/svg/check2.svg +0 -3
  64. package/dist/assets/svg/close.svg +0 -3
  65. package/dist/assets/svg/delete.svg +0 -3
  66. package/dist/assets/svg/done_all.svg +0 -3
  67. package/dist/assets/svg/dot_list.svg +0 -3
  68. package/dist/assets/svg/down_arrow.svg +0 -3
  69. package/dist/assets/svg/drag.svg +0 -8
  70. package/dist/assets/svg/edit.svg +0 -3
  71. package/dist/assets/svg/gallery.svg +0 -3
  72. package/dist/assets/svg/heading1.svg +0 -3
  73. package/dist/assets/svg/heading2.svg +0 -3
  74. package/dist/assets/svg/hyphen.svg +0 -3
  75. package/dist/assets/svg/info.svg +0 -3
  76. package/dist/assets/svg/input-info.svg +0 -0
  77. package/dist/assets/svg/italic.svg +0 -3
  78. package/dist/assets/svg/link.svg +0 -3
  79. package/dist/assets/svg/message-info.svg +0 -3
  80. package/dist/assets/svg/number_list.svg +0 -3
  81. package/dist/assets/svg/payment_method.svg +0 -7
  82. package/dist/assets/svg/quotes.svg +0 -3
  83. package/dist/assets/svg/remove.svg +0 -3
  84. package/dist/assets/svg/sort-down-arrow.svg +0 -3
  85. package/dist/assets/svg/sort-up-arrow.svg +0 -8
  86. package/dist/assets/svg/user.svg +0 -3
  87. package/dist/assets/theme.css +0 -6457
  88. package/dist/assets/variables.scss +0 -108
@@ -18,7 +18,7 @@ const Conditions = (props) => {
18
18
  // Filter available conditions based on column data type using fieldOperators
19
19
  const filteredConditions = constants_2.default.conditionsList.filter((cond) => cond.fieldOperators.includes(columnName === null || columnName === void 0 ? void 0 : columnName.dataType));
20
20
  // Extract numeric value from condition (handles both object and number formats)
21
- const conditionValue = typeof condition === 'object' ? condition === null || condition === void 0 ? void 0 : condition.value : condition;
21
+ const conditionValue = typeof condition === "object" ? condition === null || condition === void 0 ? void 0 : condition.value : condition;
22
22
  const onAddCondition = (index) => {
23
23
  addEmptyCondition(index);
24
24
  };
@@ -102,7 +102,9 @@ const Conditions = (props) => {
102
102
  }
103
103
  // Preview resulting value and block if > 100
104
104
  if (key !== ".") {
105
- const previewValue = currentValue.substring(0, cursorPos) + key + currentValue.substring(selEnd);
105
+ const previewValue = currentValue.substring(0, cursorPos) +
106
+ key +
107
+ currentValue.substring(selEnd);
106
108
  if (parseFloat(previewValue) > 100) {
107
109
  e.preventDefault();
108
110
  return;
@@ -120,24 +122,168 @@ const Conditions = (props) => {
120
122
  };
121
123
  const renderRangeNumber = (selectedColumn, showError) => {
122
124
  const isPercent = (selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.dataType) === Types_1.FilterDataType.PERCENT;
123
- const handleChange1 = (data) => {
124
- if (isPercent && data != null && data > 100)
125
+ const isInteger = (selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.dataType) === Types_1.FilterDataType.INTEGER;
126
+ const maxFractionDigits = isInteger ? 0 : 2;
127
+ // ✅ Validate input (allows typing states)
128
+ const validateInput = (val) => {
129
+ if (val === "")
130
+ return val;
131
+ const regex = isInteger
132
+ ? /^\d*$/
133
+ : new RegExp(`^\\d*(\\.\\d{0,${maxFractionDigits}})?$`);
134
+ if (!regex.test(val))
135
+ return null;
136
+ // only validate numeric constraints if complete
137
+ if (!val.endsWith(".") && val !== ".") {
138
+ const num = Number(val);
139
+ if (!Number.isNaN(num)) {
140
+ if (num < 0)
141
+ return null;
142
+ if (isPercent && num > 100)
143
+ return null;
144
+ }
145
+ }
146
+ return val;
147
+ };
148
+ // ✅ Safe conversion
149
+ const toSafeNumber = (val) => {
150
+ if (val === "" || val === "." || val.endsWith(".")) {
151
+ return val;
152
+ }
153
+ const num = Number(val);
154
+ if (!Number.isNaN(num) && Math.abs(num) <= Number.MAX_SAFE_INTEGER) {
155
+ return num;
156
+ }
157
+ return val;
158
+ };
159
+ // ✅ Normalize for comparison
160
+ const normalize = (val) => {
161
+ if (val === null || val === "")
162
+ return null;
163
+ return typeof val === "number" ? val.toString() : val;
164
+ };
165
+ // ✅ Large number safe compare (integers)
166
+ const compareValues = (a, b) => {
167
+ const x = a.replace(/^0+/, "") || "0";
168
+ const y = b.replace(/^0+/, "") || "0";
169
+ if (x.length > y.length)
170
+ return 1;
171
+ if (x.length < y.length)
172
+ return -1;
173
+ if (x > y)
174
+ return 1;
175
+ if (x < y)
176
+ return -1;
177
+ return 0;
178
+ };
179
+ // ✅ Between validation
180
+ const isValidRange = (() => {
181
+ if (!Array.isArray(value))
182
+ return true;
183
+ const [minVal, maxVal] = value;
184
+ if (!minVal || !maxVal)
185
+ return true;
186
+ if (!isInteger) {
187
+ return Number(minVal) <= Number(maxVal);
188
+ }
189
+ return compareValues(normalize(minVal), normalize(maxVal)) <= 0;
190
+ })();
191
+ const rangeInvalid = isValidRange ? "" : "p-invalid";
192
+ // ✅ Change handler
193
+ const handleChange = (index, val) => {
194
+ if (val.length > 20)
195
+ return;
196
+ const validated = validateInput(val);
197
+ if (validated === null)
198
+ return;
199
+ const converted = toSafeNumber(validated);
200
+ const newValue = Array.isArray(value) ? [...value] : [null, null];
201
+ newValue[index] = converted;
202
+ handleDynamicFieldState(newValue);
203
+ };
204
+ // ✅ Blur handler (normalize like ControlledInput)
205
+ const handleBlur = (index) => {
206
+ if (!Array.isArray(value))
207
+ return;
208
+ let val = value[index];
209
+ if (!val || typeof val !== "string")
210
+ return;
211
+ if (val === "." || val === "") {
212
+ const newValue = [...value];
213
+ newValue[index] = null;
214
+ handleDynamicFieldState(newValue);
215
+ return;
216
+ }
217
+ // ✅ if too large → DO NOT convert
218
+ if (val.length > 15) {
219
+ // keep as string (prevents precision loss)
220
+ return;
221
+ }
222
+ const num = Number(val);
223
+ if (!Number.isNaN(num)) {
224
+ let formatted = num;
225
+ if (!isInteger) {
226
+ formatted = Number(num.toFixed(maxFractionDigits));
227
+ }
228
+ else {
229
+ formatted = Math.floor(num);
230
+ }
231
+ const newValue = [...value];
232
+ newValue[index] = formatted;
233
+ handleDynamicFieldState(newValue);
234
+ }
235
+ };
236
+ // ✅ Display value
237
+ const getDisplayValue = (val) => {
238
+ if (val === null || val === undefined)
239
+ return "";
240
+ return val.toString();
241
+ };
242
+ // ✅ Keydown validation
243
+ const handleKeyDown = (e) => {
244
+ const allowed = ["Backspace", "Delete", "ArrowLeft", "ArrowRight", "Tab"];
245
+ const isDot = e.key === ".";
246
+ if (e.ctrlKey || e.metaKey) {
125
247
  return;
126
- Array.isArray(value) && value.splice(0, 1, data);
127
- handleDynamicFieldState(Array.isArray(value) ? value : [data]);
248
+ }
249
+ if (isDot && e.currentTarget.value.includes(".")) {
250
+ e.preventDefault();
251
+ return;
252
+ }
253
+ if (!/[0-9.]/.test(e.key) && !allowed.includes(e.key)) {
254
+ e.preventDefault();
255
+ }
128
256
  };
129
- const handleChange2 = (data) => {
130
- if (isPercent && data != null && data > 100)
257
+ // Paste handling (safe)
258
+ const handlePaste = (e) => {
259
+ let pasted = e.clipboardData.getData("text");
260
+ if (!pasted)
261
+ return;
262
+ // ✅ Trim spaces & normalize
263
+ pasted = pasted.trim();
264
+ // ✅ Remove commas (common copy case like 1,000)
265
+ pasted = pasted.replace(/,/g, "");
266
+ // ✅ Allow valid patterns
267
+ const regex = isInteger ? /^\d+$/ : /^\d*(\.\d*)?$/;
268
+ if (!regex.test(pasted)) {
269
+ e.preventDefault();
131
270
  return;
132
- Array.isArray(value) && value.splice(1, 1, data);
133
- handleDynamicFieldState(value);
271
+ }
272
+ // ✅ Validate numeric constraints (only if complete)
273
+ if (!pasted.endsWith(".")) {
274
+ const num = Number(pasted);
275
+ if (!Number.isNaN(num)) {
276
+ if (num < 0 || (isPercent && num > 100)) {
277
+ e.preventDefault();
278
+ return;
279
+ }
280
+ }
281
+ }
282
+ // ✅ Allow paste
134
283
  };
135
- const rangeInvalid = Array.isArray(value) && (value === null || value === void 0 ? void 0 : value.every((y) => Boolean(y)))
136
- ? value[0] > value[1]
137
- ? "p-invalid"
138
- : ""
139
- : "";
140
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `border-noround-left p-0 col-4 mx-0 focus:shadow-none lh-44 h-44 flex ${showError ? "p-invalid" : ""}` }, { children: [(0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, { disabled: !condition, min: 0, useGrouping: false, max: isPercent ? 100 : Infinity, maxFractionDigits: (selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.dataType) === Types_1.FilterDataType.INTEGER ? 0 : 2, inputClassName: "mx-0 w-full lh-44 h-44", className: `w-7ren border-noround-left lh-44 h-44 border-noround-right dropdown-focus-none ${rangeInvalid} ${showError ? "p-invalid" : ""}`, value: Array.isArray(value) ? value[0] : null, placeholder: "Min", onChange: (event) => handleChange1(event.value), onKeyDown: isPercent ? handlePercentKeyDown : undefined }), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, { disabled: !condition || !(Array.isArray(value) && value[0]), min: 0, useGrouping: false, max: isPercent ? 100 : Infinity, maxFractionDigits: (selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.dataType) === Types_1.FilterDataType.INTEGER ? 0 : 2, inputClassName: "mx-0 w-full lh-44 h-44", className: `w-7ren border-noround-left lh-44 h-44 dropdown-focus-none ${rangeInvalid} ${showError ? "p-invalid" : ""}`, value: Array.isArray(value) ? value[1] : null, placeholder: "Max", onChange: (event) => handleChange2(event.value), onKeyDown: isPercent ? handlePercentKeyDown : undefined })] })));
284
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `border-noround-left w-13rem p-0 col-4 mx-0 flex ${showError ? "p-invalid" : ""}` }, { children: [(0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition, value: getDisplayValue(Array.isArray(value) ? value[0] : ""), placeholder: "Min", onChange: (e) => handleChange(0, e.target.value), onKeyDown: handleKeyDown, onBlur: () => handleBlur(0),
285
+ // onPaste={handlePaste}
286
+ className: `w-6 border-noround-left lh-44 h-44 border-noround-right ${rangeInvalid} ${showError ? "p-invalid" : ""}` }), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition || !(Array.isArray(value) && value[0]), value: getDisplayValue(Array.isArray(value) ? value[1] : ""), placeholder: "Max", onChange: (e) => handleChange(1, e.target.value), onKeyDown: handleKeyDown, onBlur: () => handleBlur(1), onPaste: handlePaste, className: `w-6 border-left-none border-noround-left lh-44 h-44 ${rangeInvalid} ${showError ? "p-invalid" : ""}` })] })));
141
287
  };
142
288
  const renderListStringChips = (showError) => ((0, jsx_runtime_1.jsx)(chips_1.Chips, { value: value, type: "", disabled: !condition, className: `table_filters_1 border-noround-left col-4 focus:shadow-none lh-44 h-44 chip_comp flex align-items-center ${showError ? "p-invalid" : ""}`, onChange: (e) => handleDynamicFieldState(e.target.value), placeholder: "Enter tags", separator: "," }));
143
289
  const renderListNumberChips = (selectedColumn, showError) => {
@@ -281,7 +427,11 @@ const Conditions = (props) => {
281
427
  : convertDateToISO(val);
282
428
  handleDynamicFieldState(valueString);
283
429
  };
284
- const selectionMode = spec.kind === "Range" ? "range" : spec.kind === "List" ? "multiple" : "single";
430
+ const selectionMode = spec.kind === "Range"
431
+ ? "range"
432
+ : spec.kind === "List"
433
+ ? "multiple"
434
+ : "single";
285
435
  const isArrayMode = spec.kind === "Range" || spec.kind === "List";
286
436
  return ((0, jsx_runtime_1.jsx)(calendar_1.Calendar, { readOnlyInput: true, showTime: false, disabled: !condition, selectionMode: selectionMode, placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_Calender)
287
437
  ? filterModelText.elementThreePlaceHolder_Calender
@@ -68,10 +68,29 @@ const TableFilter = () => {
68
68
  */
69
69
  const validateNumberValue = (value, condition) => {
70
70
  if (isBetweenCondition(condition)) {
71
- return (Array.isArray(value) &&
72
- value.length > 1 &&
73
- value.every((item) => item !== undefined && item !== null && item !== "") &&
74
- Number(value[1]) > Number(value[0]));
71
+ const normalize = (val) => {
72
+ if (val === null || val === "")
73
+ return null;
74
+ return typeof val === "number" ? val.toString() : val;
75
+ };
76
+ const compareValues = (a, b) => {
77
+ if (a === null || a === undefined)
78
+ return -1;
79
+ if (b === null || b === undefined)
80
+ return 1;
81
+ const x = a.toString().replace(/^0+/, "") || "0";
82
+ const y = b.toString().replace(/^0+/, "") || "0";
83
+ if (x.length > y.length)
84
+ return 1;
85
+ if (x.length < y.length)
86
+ return -1;
87
+ if (x > y)
88
+ return 1;
89
+ if (x < y)
90
+ return -1;
91
+ return 0;
92
+ };
93
+ return (compareValues(normalize((value === null || value === void 0 ? void 0 : value[0]) || null), normalize((value === null || value === void 0 ? void 0 : value[1]) || null)) <= 0);
75
94
  }
76
95
  if (isAnyOrNoneOf(condition)) {
77
96
  return (Array.isArray(value) &&
@@ -206,7 +225,7 @@ const TableFilter = () => {
206
225
  /**
207
226
  * Apply filter conditions to the grid
208
227
  */
209
- const applyAdvancedFilter = (array) => {
228
+ const applyAdvancedFilter = (array, rest) => {
210
229
  const allQueries = array.map((query) => {
211
230
  const column = { code: query.columnName };
212
231
  const operation = query.condition;
@@ -221,7 +240,7 @@ const TableFilter = () => {
221
240
  const currentFeature = Object.assign({}, featureDetails);
222
241
  currentFeature.filterQueries = allQueries;
223
242
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: allQueries }));
224
- callGrid(currentFeature);
243
+ !rest && callGrid(currentFeature);
225
244
  return [];
226
245
  };
227
246
  /**
@@ -285,8 +304,8 @@ const TableFilter = () => {
285
304
  /**
286
305
  * Reset all filters to default state
287
306
  */
288
- const onResetFilter = (formSetter) => {
289
- applyAdvancedFilter([]);
307
+ const onResetFilter = (formSetter, key) => {
308
+ applyAdvancedFilter([], key);
290
309
  const newDefault = Object.assign(Object.assign({}, defaultCondition), { id: Math.random().toString() });
291
310
  setConditionsArray([newDefault]);
292
311
  setViewName("");
@@ -382,12 +401,12 @@ const TableFilter = () => {
382
401
  // Count of active filters for display
383
402
  const activeFilterCount = (globalFilters === null || globalFilters === void 0 ? void 0 : globalFilters.filter((each) => each.isActive).length) || 0;
384
403
  const hasActiveFilters = activeFilterCount >= 1;
385
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `cursor-pointer filter-btn-grid font-semibold hover:bg-primary-25 sc_icon_hover flex align-items-center gap-2 border-round-6 ${isDisabled && "disabled"} ${isVisible || hasActiveFilters ? "bg-primary-50" : "bg-white"}`, title: "Apply Filters" }, { children: [(0, jsx_runtime_1.jsx)("div", { id: "advancedFilterParent", className: "hidden" }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ onClick: (e) => !isDisabled && onClickFilter(e), className: "flex zoom_animate", id: "advance-filter-id" }, { children: [(0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "filter-lines", size: 18, color: isVisible || hasActiveFilters ? "#243DC6" : "#667085" }), hasActiveFilters && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ id: "selected-filters", className: "flex gap-2 align-items-center text-primary-400 pl-2 white-space-nowrap" }, { children: [`${activeFilterCount} ${(filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.onSelectedFilter)
404
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ onClick: (e) => !isDisabled && onClickFilter(e), className: `cursor-pointer filter-btn-grid font-semibold hover:bg-primary-25 sc_icon_hover flex align-items-center gap-2 border-round-6 ${isDisabled && "disabled"} ${isVisible || hasActiveFilters ? "bg-primary-50" : "bg-white"}`, title: "Apply Filters" }, { children: [(0, jsx_runtime_1.jsx)("div", { id: "advancedFilterParent", className: "hidden" }), (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "flex zoom_animate", id: "advance-filter-id" }, { children: [(0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "filter-lines", size: 18, color: isVisible || hasActiveFilters ? "#243DC6" : "#667085" }), hasActiveFilters && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ id: "selected-filters", className: "flex gap-2 align-items-center text-primary-400 pl-2 white-space-nowrap" }, { children: [`${activeFilterCount} ${(filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.onSelectedFilter)
386
405
  ? filterModelText.onSelectedFilter
387
406
  : "Selected"}`, (0, jsx_runtime_1.jsx)("span", Object.assign({ onClick: (e) => {
388
407
  e.preventDefault();
389
408
  e.stopPropagation();
390
- onResetFilter();
409
+ onResetFilter(() => { }, false);
391
410
  } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 18, color: "#243DC6" }) }))] })))] }))] })), (0, jsx_runtime_1.jsx)(form_1.default, Object.assign({ values: formInitialValues, enableReinitialize: true, formRef: formRef, validateOnChange: true, validateOnBlur: false, validateOnMount: true, validations: validationSchema, className: "h-full", onSubmit: () => onApplyFilter() }, { children: ({ handleSubmit, setFieldValue, isValid, values, errors, touched, }) => {
392
411
  const conditionsToRender = (values === null || values === void 0 ? void 0 : values.conditions) && values.conditions.length > 0
393
412
  ? values.conditions
@@ -400,7 +419,7 @@ const TableFilter = () => {
400
419
  return ((0, jsx_runtime_1.jsx)("div", { children: renderCondition(eachCondition, index, setFieldValue, (_a = errors === null || errors === void 0 ? void 0 : errors.conditions) === null || _a === void 0 ? void 0 : _a[index], (_b = touched === null || touched === void 0 ? void 0 : touched.conditions) === null || _b === void 0 ? void 0 : _b[index]) }, eachCondition.id || index));
401
420
  }) })) })), (0, jsx_runtime_1.jsx)(divider_1.Divider, { className: "w-full p-0 m-0" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4 flex justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(button_1.Button, { outlined: true, className: "focus:shadow-none font-semibold border-none hover:bg-primary-25 text-primary-400", label: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.resetFilterAction)
402
421
  ? filterModelText.resetFilterAction
403
- : "Reset Filter", onClick: () => onResetFilter(setFieldValue) }) }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [!displayInput && enableViewCreate && ((0, jsx_runtime_1.jsx)(button_1.Button, { className: "text-base px-2 font-semibold text-primary-400 flex gap-2 p-1 px-4 flex justify-content-center focus:shadow-none mr-3", label: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.createViewAction)
422
+ : "Reset Filter", onClick: () => onResetFilter(setFieldValue, true) }) }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [!displayInput && enableViewCreate && ((0, jsx_runtime_1.jsx)(button_1.Button, { className: "text-base px-2 font-semibold text-primary-400 flex gap-2 p-1 px-4 flex justify-content-center focus:shadow-none mr-3", label: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.createViewAction)
404
423
  ? filterModelText.createViewAction
405
424
  : "Create view", onClick: () => setDisplayInput(true), disabled: !isFormReady, text: true, iconPos: "left", icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "plus", color: "text-primary-400 mr-2" }) })), displayInput && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-left p-input-icon-right w-full" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-suffix" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: createViewFromFilters, disabled: !viewName.length, className: "p-0 h-auto mr-2", text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "check", color: "text-gray-500" }) }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => {
406
425
  setViewName("");
@@ -28,13 +28,16 @@ const INITIAL_CHECKBOX_DATA = {
28
28
  };
29
29
  function ParentForGrid(props) {
30
30
  var _a, _b, _c, _d, _e, _f, _g, _h;
31
- const { gridProps = {}, gridViewTemplate, selectColumns = () => { }, enableCheckboxForGroupHeader = false, serverSideSelectRow, blockSize, renderSelectField, renderMultiSelectField } = props;
31
+ const { gridProps = {}, gridViewTemplate, selectColumns = () => { }, enableCheckboxForGroupHeader = false, serverSideSelectRow, blockSize, renderSelectField, renderMultiSelectField, } = props;
32
32
  const effectiveBlockSize = blockSize || constants_1.BLOCK_SIZE;
33
33
  const [gridData, setGridData] = (0, react_1.useState)({
34
34
  rowData: (props === null || props === void 0 ? void 0 : props.rowData) || [],
35
35
  columnData: (0, helper_1.sortColumns)(props === null || props === void 0 ? void 0 : props.columnData),
36
36
  });
37
- const [gridViewData, setGridViewData] = (0, react_1.useState)({ rowData: [], searchText: "" });
37
+ const [gridViewData, setGridViewData] = (0, react_1.useState)({
38
+ rowData: [],
39
+ searchText: "",
40
+ });
38
41
  const [gridView, setGridView] = (0, react_1.useState)(false);
39
42
  const [isDataLoading, setIsDataLoading] = (0, react_1.useState)(false);
40
43
  // const [style] = useState<Style>(props.style);
@@ -135,7 +138,8 @@ function ParentForGrid(props) {
135
138
  else {
136
139
  setSelectedGroup([]);
137
140
  }
138
- selectColumns && selectColumns(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
141
+ selectColumns &&
142
+ selectColumns(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
139
143
  serverSideRowLeveSelection(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
140
144
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
141
145
  };
@@ -168,7 +172,7 @@ function ParentForGrid(props) {
168
172
  setIsDataLoading(true);
169
173
  try {
170
174
  const response = yield (props === null || props === void 0 ? void 0 : props.getRowData(startRow, endRow, currentFeatures, params));
171
- setGridData(prev => (Object.assign(Object.assign({}, prev), { rowData: [] })));
175
+ setGridData((prev) => (Object.assign(Object.assign({}, prev), { rowData: [] })));
172
176
  // To identify when to stop the callBack
173
177
  const actualEndRow = (response === null || response === void 0 ? void 0 : response.totalRecords) < constants_1.MAX_RECORDS_TO_LOAD
174
178
  ? response === null || response === void 0 ? void 0 : response.totalRecords
@@ -205,10 +209,16 @@ function ParentForGrid(props) {
205
209
  }
206
210
  (_k = (_j = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current) === null || _j === void 0 ? void 0 : _j.api) === null || _k === void 0 ? void 0 : _k.showLoadingOverlay();
207
211
  params && ((_l = params === null || params === void 0 ? void 0 : params.api) === null || _l === void 0 ? void 0 : _l.setGridOption("rowData", []));
208
- const result = gridViewData.rowData.length > 0 ? { rowData: gridViewData.rowData, totalRecords: gridViewData.rowData.length } : yield getData(0, 0, currentFeatures);
212
+ const result = gridViewData.rowData.length > 0
213
+ ? {
214
+ rowData: gridViewData.rowData,
215
+ totalRecords: gridViewData.rowData.length,
216
+ }
217
+ : yield getData(0, 0, currentFeatures);
209
218
  if (((_m = result.rowData) === null || _m === void 0 ? void 0 : _m.length) > 0) {
210
- gridViewData.rowData.length > 0 && setGridViewData({ rowData: [], searchText: "" });
211
- setGridData(prev => (Object.assign(Object.assign({}, prev), { rowData: result.rowData })));
219
+ gridViewData.rowData.length > 0 &&
220
+ setGridViewData({ rowData: [], searchText: "" });
221
+ setGridData((prev) => (Object.assign(Object.assign({}, prev), { rowData: result.rowData })));
212
222
  gridRef.current && gridRef.current.api.hideOverlay();
213
223
  params && ((_o = params === null || params === void 0 ? void 0 : params.api) === null || _o === void 0 ? void 0 : _o.applyTransaction({ add: result.rowData }));
214
224
  }
@@ -228,10 +238,14 @@ function ParentForGrid(props) {
228
238
  const response = yield getData(startRow, endRow, currentFeatures, params);
229
239
  // simulating real server call with a 500ms delay
230
240
  if (((_q = response.rowData) === null || _q === void 0 ? void 0 : _q.length) > 0) {
231
- setGridData(prev => (Object.assign(Object.assign({}, prev), { rowData: response.rowData })));
241
+ setGridData((prev) => (Object.assign(Object.assign({}, prev), { rowData: response.rowData })));
232
242
  gridRef.current.api.hideOverlay();
233
243
  // supply rows for requested block to grid
234
- params && params.success({ rowData: response.rowData, rowCount: response.actualEndRow });
244
+ params &&
245
+ params.success({
246
+ rowData: response.rowData,
247
+ rowCount: response.actualEndRow,
248
+ });
235
249
  return;
236
250
  }
237
251
  else {
@@ -320,8 +334,7 @@ function ParentForGrid(props) {
320
334
  GridHeaderComponent, // Header component
321
335
  headerCheckBoxRenderer, //
322
336
  enableCheckboxForGroupHeader, ((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayGroupCount) || false, parseInt(props === null || props === void 0 ? void 0 : props.rowGroupColumnWidth), // for grouped column width
323
- cellRendererConditionally, GroupHeaderRenderer // Custom component for group header
324
- );
337
+ cellRendererConditionally, GroupHeaderRenderer);
325
338
  }
326
339
  else {
327
340
  return (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, // If tree enable
@@ -330,8 +343,7 @@ function ParentForGrid(props) {
330
343
  GridHeaderComponent, // Header component
331
344
  headerCheckBoxRenderer, //
332
345
  enableCheckboxForGroupHeader, ((_c = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _c === void 0 ? void 0 : _c.displayGroupCount) || false, parseInt(props === null || props === void 0 ? void 0 : props.rowGroupColumnWidth), // for grouped column width
333
- GroupHeaderRenderer // Custom component for group header
334
- );
346
+ GroupHeaderRenderer);
335
347
  }
336
348
  };
337
349
  (0, react_1.useEffect)(() => {
@@ -344,7 +356,7 @@ function ParentForGrid(props) {
344
356
  }
345
357
  if (props === null || props === void 0 ? void 0 : props.rowData) {
346
358
  setTotalRecords(props === null || props === void 0 ? void 0 : props.rowData.length);
347
- setGridData(prev => (Object.assign(Object.assign({}, prev), { rowData: props.rowData })));
359
+ setGridData((prev) => (Object.assign(Object.assign({}, prev), { rowData: props.rowData })));
348
360
  }
349
361
  if (props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) {
350
362
  (_b = (_a = props === null || props === void 0 ? void 0 : props.getGridRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.api.setGridOption("advancedFilterParent", document.getElementById("advancedFilterParent"));
@@ -357,10 +369,16 @@ function ParentForGrid(props) {
357
369
  }, [props === null || props === void 0 ? void 0 : props.getGridRef]);
358
370
  const gridStyle = (0, react_1.useMemo)(() => {
359
371
  var _a, _b, _c;
360
- return (Object.assign({ width: (_a = props === null || props === void 0 ? void 0 : props.style) === null || _a === void 0 ? void 0 : _a.width }, (totalRecords > constants_1.AUTO_HEIGHT_ROWS || !((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.isGridAutoHeight)
372
+ return (Object.assign({ width: (_a = props === null || props === void 0 ? void 0 : props.style) === null || _a === void 0 ? void 0 : _a.width }, (totalRecords > constants_1.AUTO_HEIGHT_ROWS ||
373
+ !((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.isGridAutoHeight)
361
374
  ? { height: (_c = props === null || props === void 0 ? void 0 : props.style) === null || _c === void 0 ? void 0 : _c.height }
362
375
  : null)));
363
- }, [(_a = props === null || props === void 0 ? void 0 : props.style) === null || _a === void 0 ? void 0 : _a.width, (_b = props === null || props === void 0 ? void 0 : props.style) === null || _b === void 0 ? void 0 : _b.height, totalRecords, (_c = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _c === void 0 ? void 0 : _c.isGridAutoHeight]);
376
+ }, [
377
+ (_a = props === null || props === void 0 ? void 0 : props.style) === null || _a === void 0 ? void 0 : _a.width,
378
+ (_b = props === null || props === void 0 ? void 0 : props.style) === null || _b === void 0 ? void 0 : _b.height,
379
+ totalRecords,
380
+ (_c = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _c === void 0 ? void 0 : _c.isGridAutoHeight,
381
+ ]);
364
382
  // Dont show hide overlay component when any row pinned
365
383
  // useEffect(() => {
366
384
  // if (!props?.pinnedTopRowData) return;
@@ -399,7 +417,10 @@ function ParentForGrid(props) {
399
417
  }
400
418
  }), autoGroupColumnDef: (props === null || props === void 0 ? void 0 : props.autoGroupColumnDef)
401
419
  ? props === null || props === void 0 ? void 0 : props.autoGroupColumnDef
402
- : manageColumnGrouping(), treeData: (props === null || props === void 0 ? void 0 : props.enableTree) ? props === null || props === void 0 ? void 0 : props.enableTree : false, getDataPath: (props === null || props === void 0 ? void 0 : props.enableTree) ? getDataPath : null, defaultColDef: defaultColDef, suppressMenuHide: false, suppressRowClickSelection: false, headerHeight: props === null || props === void 0 ? void 0 : props.columnHeaderHeight, rowHeight: constants_1.ROW_HEIGHT, rowModelType: props.rowModelType, pinnedTopRowData: props === null || props === void 0 ? void 0 : props.pinnedTopRowData }, (props.rowModelType === (constants_1.ROWMODELTYPE === null || constants_1.ROWMODELTYPE === void 0 ? void 0 : constants_1.ROWMODELTYPE.SERVER_SIDE) && { cacheBlockSize: effectiveBlockSize })), { maxBlocksInCache: effectiveBlockSize, blockLoadDebounceMillis: constants_1.DEBOUNCE_INTERVAL, noRowsOverlayComponent: props === null || props === void 0 ? void 0 : props.noRowsOverlayComponent, loadingOverlayComponent: loading_component_1.default, suppressCellFocus: true, suppressPropertyNamesCheck: true, suppressServerSideFullWidthLoadingRow: true, enableRangeSelection: (_e = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _e === void 0 ? void 0 : _e.enableFillHandle, enableFillHandle: (_f = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _f === void 0 ? void 0 : _f.enableFillHandle, onFillEnd: wrapperToFillOpertation, fillOperation: myOpertaion, serverSideInitialRowCount: (props === null || props === void 0 ? void 0 : props.serverSideInitialRowCount) || 10, getRowId: getRowId, enableAdvancedFilter: (props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) || false, fillHandleDirection: "y" }), ((props === null || props === void 0 ? void 0 : props.rowData) && { rowData: props === null || props === void 0 ? void 0 : props.rowData })), (totalRecords <= constants_1.AUTO_HEIGHT_ROWS && ((_g = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _g === void 0 ? void 0 : _g.isGridAutoHeight)
420
+ : manageColumnGrouping(), treeData: (props === null || props === void 0 ? void 0 : props.enableTree) ? props === null || props === void 0 ? void 0 : props.enableTree : false, getDataPath: (props === null || props === void 0 ? void 0 : props.enableTree) ? getDataPath : null, defaultColDef: defaultColDef, suppressMenuHide: false, suppressRowClickSelection: false, headerHeight: props === null || props === void 0 ? void 0 : props.columnHeaderHeight, rowHeight: constants_1.ROW_HEIGHT, rowModelType: props.rowModelType, pinnedTopRowData: props === null || props === void 0 ? void 0 : props.pinnedTopRowData }, (props.rowModelType === (constants_1.ROWMODELTYPE === null || constants_1.ROWMODELTYPE === void 0 ? void 0 : constants_1.ROWMODELTYPE.SERVER_SIDE) && {
421
+ cacheBlockSize: effectiveBlockSize,
422
+ })), { maxBlocksInCache: effectiveBlockSize, blockLoadDebounceMillis: constants_1.DEBOUNCE_INTERVAL, noRowsOverlayComponent: props === null || props === void 0 ? void 0 : props.noRowsOverlayComponent, loadingOverlayComponent: loading_component_1.default, suppressCellFocus: true, suppressPropertyNamesCheck: true, suppressServerSideFullWidthLoadingRow: true, enableRangeSelection: (_e = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _e === void 0 ? void 0 : _e.enableFillHandle, enableFillHandle: (_f = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _f === void 0 ? void 0 : _f.enableFillHandle, onFillEnd: wrapperToFillOpertation, fillOperation: myOpertaion, serverSideInitialRowCount: (props === null || props === void 0 ? void 0 : props.serverSideInitialRowCount) || 10, getRowId: getRowId, enableAdvancedFilter: (props === null || props === void 0 ? void 0 : props.enableAdvancedFilter) || false, fillHandleDirection: "y" }), ((props === null || props === void 0 ? void 0 : props.rowData) && { rowData: props === null || props === void 0 ? void 0 : props.rowData })), (totalRecords <= constants_1.AUTO_HEIGHT_ROWS &&
423
+ ((_g = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _g === void 0 ? void 0 : _g.isGridAutoHeight)
403
424
  ? { domLayout: "autoHeight" }
404
425
  : { domLayout: "normal" })), ((props === null || props === void 0 ? void 0 : props.dataTypeDefinitions) && {
405
426
  dataTypeDefinitions: props === null || props === void 0 ? void 0 : props.dataTypeDefinitions,
@@ -538,8 +559,14 @@ function ParentForGrid(props) {
538
559
  }, [
539
560
  props.rowModelType,
540
561
  props === null || props === void 0 ? void 0 : props.quickSearch,
541
- featureDetails, gridData, callGrid,
542
- totalRecords, initialFeature, defaultFilters, defaultSearchText, defaultSort,
562
+ featureDetails,
563
+ gridData,
564
+ callGrid,
565
+ totalRecords,
566
+ initialFeature,
567
+ defaultFilters,
568
+ defaultSearchText,
569
+ defaultSort,
543
570
  props === null || props === void 0 ? void 0 : props.createView,
544
571
  props === null || props === void 0 ? void 0 : props.conditionsToDisplay,
545
572
  props === null || props === void 0 ? void 0 : props.dynamicText,
@@ -548,15 +575,21 @@ function ParentForGrid(props) {
548
575
  props === null || props === void 0 ? void 0 : props.clearFilters,
549
576
  props === null || props === void 0 ? void 0 : props.onFiltersCleared,
550
577
  props === null || props === void 0 ? void 0 : props.updateColumnsForGrid,
551
- props.enableManageColumnsCallback, selectedGroup, initialCheckBoxData,
552
- intialColumns, gridViewFun, gridViewData, gridView,
578
+ props.enableManageColumnsCallback,
579
+ selectedGroup,
580
+ initialCheckBoxData,
581
+ intialColumns,
582
+ gridViewFun,
583
+ gridViewData,
584
+ gridView,
553
585
  props === null || props === void 0 ? void 0 : props.enableAdvancedFilter,
554
586
  props === null || props === void 0 ? void 0 : props.rowData,
555
587
  props.serverSideSelectRow,
556
588
  props === null || props === void 0 ? void 0 : props.defaultViewName,
557
589
  isDataLoading,
558
- renderSelectField, renderMultiSelectField,
590
+ renderSelectField,
591
+ renderMultiSelectField,
559
592
  ]);
560
- 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 })] }) })) }) }));
593
+ 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 }))] }) })) }) }));
561
594
  }
562
595
  exports.default = ParentForGrid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.5.25",
3
+ "version": "6.5.27",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",