sccoreui 6.5.29 → 6.5.30

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.
@@ -225,7 +225,7 @@ const TableFilter = () => {
225
225
  /**
226
226
  * Apply filter conditions to the grid
227
227
  */
228
- const applyAdvancedFilter = (array, rest) => {
228
+ const applyAdvancedFilter = (array) => {
229
229
  const allQueries = array.map((query) => {
230
230
  const column = { code: query.columnName };
231
231
  const operation = query.condition;
@@ -240,7 +240,7 @@ const TableFilter = () => {
240
240
  const currentFeature = Object.assign({}, featureDetails);
241
241
  currentFeature.filterQueries = allQueries;
242
242
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: allQueries }));
243
- !rest && callGrid(currentFeature);
243
+ callGrid(currentFeature);
244
244
  return [];
245
245
  };
246
246
  /**
@@ -305,7 +305,7 @@ const TableFilter = () => {
305
305
  * Reset all filters to default state
306
306
  */
307
307
  const onResetFilter = (formSetter) => {
308
- applyAdvancedFilter([], true);
308
+ applyAdvancedFilter([]);
309
309
  const newDefault = Object.assign(Object.assign({}, defaultCondition), { id: Math.random().toString() });
310
310
  setConditionsArray([newDefault]);
311
311
  setViewName("");
@@ -408,6 +408,7 @@ const TableFilter = () => {
408
408
  e.stopPropagation();
409
409
  onResetFilter();
410
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, }) => {
411
+ var _a;
411
412
  const conditionsToRender = (values === null || values === void 0 ? void 0 : values.conditions) && values.conditions.length > 0
412
413
  ? values.conditions
413
414
  : conditionsArray;
@@ -417,7 +418,8 @@ const TableFilter = () => {
417
418
  : "Streamline Your Search With Filters" }))] })), (0, jsx_runtime_1.jsx)(divider_1.Divider, { className: "w-full p-0 m-0" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-2" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "max-h-14rem overflow-y-auto overflow-x-hidden flex flex-column gap-1" }, { children: conditionsToRender.map((eachCondition, index) => {
418
419
  var _a, _b;
419
420
  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));
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)
421
+ }) })) })), (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, disabled: (conditionsToRender === null || conditionsToRender === void 0 ? void 0 : conditionsToRender.length) === 1 &&
422
+ typeof ((_a = conditionsToRender === null || conditionsToRender === void 0 ? void 0 : conditionsToRender[0]) === null || _a === void 0 ? void 0 : _a.columnName) === "string", 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)
421
423
  ? filterModelText.resetFilterAction
422
424
  : "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)
423
425
  ? filterModelText.createViewAction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.5.29",
3
+ "version": "6.5.30",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",