sccoreui 6.4.90 → 6.4.92

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.
@@ -202,7 +202,7 @@ function HideColumn() {
202
202
  position: "sticky",
203
203
  top: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.selected_attributes) && "0px",
204
204
  } }, { children: [(sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.selected_attributes) || "Selected Attributes", " ", (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-gray-500 text-lg font-normal ml-1" }, { children: [`(`, nodes === null || nodes === void 0 ? void 0 : nodes.filter((node) => node.selected).length, "/", nodes === null || nodes === void 0 ? void 0 : nodes.filter((node) => node.unSelected || node.selected).length, `)`] }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "w-full" }, { children: (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "list-none p-0 mt-0" }, { children: (nodes === null || nodes === void 0 ? void 0 : nodes.length) > 0 ? (nodes === null || nodes === void 0 ? void 0 : nodes.map((listItem, idx) => (listItem === null || listItem === void 0 ? void 0 : listItem.visibleInPanel) &&
205
- (listItem === null || listItem === void 0 ? void 0 : listItem.selected) && ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3 text-gray-600 text-base", draggable: true, onDragStart: handleDragStart(idx), onDrop: handleDrop(idx), onDragOver: handleDragOver }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex gap-3" }, { children: [(0, jsx_runtime_1.jsx)("img", { src: drag_and_drop_icon_png_1.default, alt: "Drag and drop", className: "cursor-move" }), (0, jsx_runtime_1.jsx)("span", { children: listItem.headerName })] })), (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: listItem === null || listItem === void 0 ? void 0 : listItem.checked, onChange: (e) => handleSwitchChange(listItem, e.value) })] }), idx)))) : ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column -mx-3" }, { children: (0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "mt-0 mb-2 flex align-items-center justify-content-center py-8 bg-gray-50 p-8 border-round-md mt-2 text-gray-900 font-normal" }, { children: "No results found on the search criteria" })) })) })) })) })), (0, jsx_runtime_1.jsxs)("h3", Object.assign({ className: " mb-0 mt-0 py-2 border-bottom-1 border-gray-200 bg-white z-5", style: {
205
+ (listItem === null || listItem === void 0 ? void 0 : listItem.selected) && ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3 text-gray-600 text-base", draggable: true, onDragStart: handleDragStart(idx), onDrop: handleDrop(idx), onDragOver: handleDragOver }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex gap-3" }, { children: [(0, jsx_runtime_1.jsx)("img", { src: drag_and_drop_icon_png_1.default, alt: "Drag and drop", className: "cursor-move" }), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "max-w-24rem text_ellipsis" }, { children: listItem.headerName }))] })), (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: listItem === null || listItem === void 0 ? void 0 : listItem.checked, onChange: (e) => handleSwitchChange(listItem, e.value) })] }), idx)))) : ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column -mx-3" }, { children: (0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "mt-0 mb-2 flex align-items-center justify-content-center py-8 bg-gray-50 p-8 border-round-md mt-2 text-gray-900 font-normal" }, { children: "No results found on the search criteria" })) })) })) })) })), (0, jsx_runtime_1.jsxs)("h3", Object.assign({ className: " mb-0 mt-0 py-2 border-bottom-1 border-gray-200 bg-white z-5", style: {
206
206
  position: "sticky",
207
207
  top: (sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.selected_attributes) && "35px",
208
208
  } }, { children: [(sidePanelText === null || sidePanelText === void 0 ? void 0 : sidePanelText.unselected_attributes) || "Unselected Attributes", (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "text-gray-500 text-lg font-normal ml-2" }, { children: [`(`, nodes === null || nodes === void 0 ? void 0 : nodes.filter((node) => node.unSelected).length, "/", nodes === null || nodes === void 0 ? void 0 : nodes.filter((node) => node.unSelected || node.selected).length, `)`] }))] })), (nodes === null || nodes === void 0 ? void 0 : nodes.length) > 0 ? ((0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "list-none p-0 mt-2 ml-3" }, { children: nodes === null || nodes === void 0 ? void 0 : nodes.map((listItem) => (listItem === null || listItem === void 0 ? void 0 : listItem.visibleInPanel) &&
@@ -13,7 +13,16 @@ const svg_component_1 = tslib_1.__importDefault(require("../../../../../directiv
13
13
  const chips_1 = require("primereact/chips");
14
14
  const constants_1 = tslib_1.__importDefault(require("../../../constants"));
15
15
  const Conditions = (props) => {
16
- const { columnName, condition, value, columnsArray, conditionsArray, index, id, updateconditionsArray, removeConditionFromArray, addEmptyCondition, conditionsLength, conditionType, conditionTypes, handleConditionType, filterModelText, } = props;
16
+ const { columnName, condition, value, columnsArray, conditionsArray, index, id, updateconditionsArray, removeConditionFromArray, addEmptyCondition, conditionsLength, conditionType, conditionTypes, handleConditionType, filterModelText, validationErrors, validationTouched, } = props;
17
+ const valueError = Boolean(validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.value) && Boolean(validationTouched === null || validationTouched === void 0 ? void 0 : validationTouched.value);
18
+ // Filter available conditions based on column data type
19
+ const filteredConditions = conditionsArray.filter((each) => {
20
+ var _a;
21
+ return (_a = constants_1.default.accessBasedOnDataType
22
+ .find((access) => access.datatype === (columnName === null || columnName === void 0 ? void 0 : columnName.dataType))) === null || _a === void 0 ? void 0 : _a.conditions.includes(each.value);
23
+ });
24
+ // Extract numeric value from condition (handles both object and number formats)
25
+ const conditionValue = typeof condition === 'object' ? condition === null || condition === void 0 ? void 0 : condition.value : condition;
17
26
  const onAddCondition = (index) => {
18
27
  addEmptyCondition(index);
19
28
  };
@@ -47,7 +56,7 @@ const Conditions = (props) => {
47
56
  id: id,
48
57
  }, id);
49
58
  };
50
- const renderDynamicField = (selectedColumn) => {
59
+ const renderDynamicField = (selectedColumn, showError) => {
51
60
  var _a, _b, _c, _d, _e, _f;
52
61
  if (condition === Types_1.FilteredConditionTypes.IS_KNOWN ||
53
62
  condition === Types_1.FilteredConditionTypes.IS_UNKNOWN) {
@@ -59,12 +68,12 @@ const Conditions = (props) => {
59
68
  case Types_1.FilterDataType.STRING: {
60
69
  if (condition === Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO ||
61
70
  condition === Types_1.FilteredConditionTypes.IS_EQUAL_TO) {
62
- return ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition, className: "border-noround-left col-4 focus:shadow-none lh-44 h-44 flex align-items-center pl-3", value: value, placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_Input)
71
+ return ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition, className: `border-noround-left col-4 focus:shadow-none lh-44 h-44 flex align-items-center pl-3 ${showError ? "p-invalid" : ""}`, value: value, placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_Input)
63
72
  ? filterModelText.elementThreePlaceHolder_Input
64
73
  : "Enter", onChange: (event) => handleDynamicFieldState(event.target.value) }));
65
74
  }
66
75
  else {
67
- return ((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", onChange: (e) => handleDynamicFieldState(e.target.value), placeholder: "Enter tags", separator: "," }));
76
+ return ((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: "," }));
68
77
  }
69
78
  }
70
79
  case Types_1.FilterDataType.DECIMAL:
@@ -81,7 +90,7 @@ const Conditions = (props) => {
81
90
  };
82
91
  if (condition === Types_1.FilteredConditionTypes.IS_BETWEEN ||
83
92
  condition === Types_1.FilteredConditionTypes.IS_NOT_BETWEEN) {
84
- 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" }, { children: [(0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, { disabled: !condition, min: 0, useGrouping: false, max: ((_a = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.columnName) === null || _a === void 0 ? void 0 : _a.dataType) ===
93
+ 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: ((_a = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.columnName) === null || _a === void 0 ? void 0 : _a.dataType) ===
85
94
  Types_1.FilterDataType.PERCENT
86
95
  ? 99.999
87
96
  : Infinity, maxFractionDigits: ((_b = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.columnName) === null || _b === void 0 ? void 0 : _b.dataType) ===
@@ -91,7 +100,7 @@ const Conditions = (props) => {
91
100
  ? value[0] > value[1]
92
101
  ? "p-invalid"
93
102
  : ""
94
- : ""}`, value: Array.isArray(value) ? value[0] : null, placeholder: "Min", onChange: (event) => handleChange1(event.value) }), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, { disabled: !condition || !(Array.isArray(value) && value[0]), min: 0, useGrouping: false, max: ((_c = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.columnName) === null || _c === void 0 ? void 0 : _c.dataType) ===
103
+ : ""} ${showError ? "p-invalid" : ""}`, value: Array.isArray(value) ? value[0] : null, placeholder: "Min", onChange: (event) => handleChange1(event.value) }), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, { disabled: !condition || !(Array.isArray(value) && value[0]), min: 0, useGrouping: false, max: ((_c = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.columnName) === null || _c === void 0 ? void 0 : _c.dataType) ===
95
104
  Types_1.FilterDataType.PERCENT
96
105
  ? 99.999
97
106
  : Infinity, maxFractionDigits: ((_d = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.columnName) === null || _d === void 0 ? void 0 : _d.dataType) ===
@@ -101,20 +110,20 @@ const Conditions = (props) => {
101
110
  ? value[0] > value[1]
102
111
  ? "p-invalid"
103
112
  : ""
104
- : ""}`, value: Array.isArray(value) ? value[1] : null, placeholder: "Max", onChange: (event) => {
113
+ : ""} ${showError ? "p-invalid" : ""}`, value: Array.isArray(value) ? value[1] : null, placeholder: "Max", onChange: (event) => {
105
114
  handleChange2(event.value);
106
115
  } })] })));
107
116
  }
108
117
  else if (condition === Types_1.FilteredConditionTypes.IS_ANY_OF ||
109
118
  condition === Types_1.FilteredConditionTypes.IS_NONE_OF) {
110
- return ((0, jsx_runtime_1.jsx)(chips_1.Chips, { value: value, type: "", keyfilter: "money", disabled: !condition, className: "table_filters_1 border-noround-left col-4 focus:shadow-none lh-44 h-44 chip_comp flex align-items-center", onChange: (e) => handleDynamicFieldState(e.target.value), placeholder: "Enter", separator: "," }));
119
+ return ((0, jsx_runtime_1.jsx)(chips_1.Chips, { value: value, type: "", keyfilter: "money", 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", separator: "," }));
111
120
  }
112
121
  else {
113
122
  return ((0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, { value: value, useGrouping: false, min: 0, maxFractionDigits: ((_e = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.columnName) === null || _e === void 0 ? void 0 : _e.dataType) === Types_1.FilterDataType.INTEGER
114
123
  ? 0
115
124
  : 2, max: ((_f = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.columnName) === null || _f === void 0 ? void 0 : _f.dataType) === Types_1.FilterDataType.PERCENT
116
125
  ? 99.999
117
- : Infinity, disabled: !condition, placeholder: "Enter", inputClassName: "mx-0 w-full lh-44 h-44", className: "border-noround-left p-0 col-4 mx-0 focus:shadow-none lh-44 h-44", onChange: (event) => handleDynamicFieldState(event.value) }));
126
+ : Infinity, disabled: !condition, placeholder: "Enter", inputClassName: "mx-0 w-full lh-44 h-44", className: `border-noround-left p-0 col-4 mx-0 focus:shadow-none lh-44 h-44 ${showError ? "p-invalid" : ""}`, onChange: (event) => handleDynamicFieldState(event.value) }));
118
127
  }
119
128
  }
120
129
  case Types_1.FilterDataType.SELECT: {
@@ -188,19 +197,15 @@ const Conditions = (props) => {
188
197
  : [], dropdownType: "default", optionLabel: "label" }));
189
198
  }
190
199
  default:
191
- return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "border-noround-left col-4 focus:shadow-none lh-44 h-44 flex align-items-center dropdown-focus-none pl-3", options: [], value: value, optionLabel: "name", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_DropDown)
200
+ return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: `border-noround-left col-4 focus:shadow-none lh-44 h-44 flex align-items-center dropdown-focus-none pl-3 ${showError ? "p-invalid" : ""}`, options: [], value: value, optionLabel: "name", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_DropDown)
192
201
  ? filterModelText.elementThreePlaceHolder_DropDown
193
202
  : "Select", disabled: true }));
194
203
  }
195
204
  };
196
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "grid my-1 align-items-center pt-2" }, { children: [index !== 0 ? ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "operator-type filter_dropdown_and col-2 w-7rem mx-4 border-1 border-gray-300 h-44 -mt-2", options: conditionTypes, optionLabel: "label", placeholder: "Select", value: conditionType, disabled: index !== 1, onChange: (event) => handleConditionType(event.target.value) })) : ((0, jsx_runtime_1.jsx)("div", { className: "col-2 w-7rem mx-4" })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "col-9 grid filter-dropdowns overflow-y-hidden" }, { children: [(0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: `condition-dropdown dropdown-focus-none border-noround-right col-4 pl-3`, options: columnsArray, optionLabel: "name", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementOnePlaceHolder)
205
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "grid my-1 align-items-center pt-2" }, { children: [index !== 0 ? ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "operator-type filter_dropdown_and col-2 w-7rem mx-4 border-1 border-gray-300 h-44 -mt-2", options: conditionTypes, optionLabel: "label", placeholder: "Select", value: conditionType, disabled: index !== 1, onChange: (event) => handleConditionType(event.target.value) })) : ((0, jsx_runtime_1.jsx)("div", { className: "col-2 w-7rem mx-4" })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "col-9 grid filter-dropdowns overflow-y-hidden" }, { children: [(0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: `condition-dropdown dropdown-focus-none border-noround-right col-4 pl-3`, options: columnsArray, optionLabel: "name", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementOnePlaceHolder)
197
206
  ? filterModelText.elementOnePlaceHolder
198
- : "Select", value: columnsArray.find((item) => item.code === columnName.code), onChange: (event) => onUpdateColumnName(event.value), panelClassName: "w-14rem" }), (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "condition-type hide-focus border-noround remove-focus border-x-none filter-dropdown-grid col-4", value: condition, options: conditionsArray.filter((each) => {
199
- var _a;
200
- return (_a = constants_1.default.accessBasedOnDataType
201
- .find((access) => access.datatype === (columnName === null || columnName === void 0 ? void 0 : columnName.dataType))) === null || _a === void 0 ? void 0 : _a.conditions.includes(each.value);
202
- }), disabled: columnName === "", optionLabel: "name", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementTwoPlaceHolder)
207
+ : "Select", value: columnsArray.find((item) => item.code === columnName.code), onChange: (event) => onUpdateColumnName(event.value), panelClassName: "w-14rem" }), (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "condition-type hide-focus border-noround remove-focus border-x-none filter-dropdown-grid col-4", value: conditionValue, options: filteredConditions, disabled: columnName === "", optionLabel: "name", optionValue: "value", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementTwoPlaceHolder)
203
208
  ? filterModelText.elementTwoPlaceHolder
204
- : "Select", onChange: (event) => onUpdateCondition(event.value), panelClassName: "w-14rem status_select_field" }), renderDynamicField(columnName)] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex gap-1 col-1 -mt-2 md:px-2 lg:px-0" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "cursor-pointer conditional_btn", onClick: () => onAddCondition(index) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "plus-circle", size: 20, color: "text-gray-500" }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `cursor-pointer conditional_btn delete-action ${conditionsLength === 1 ? "p-disabled" : ""}`, onClick: () => onRemoveCondition(id) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "minus-circle", size: 20, color: "text-gray-500" }) }))] }))] })));
209
+ : "Select", onChange: (event) => onUpdateCondition(event.value), panelClassName: "w-14rem status_select_field" }), renderDynamicField(columnName, valueError)] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex gap-1 col-1 -mt-2 md:px-2 lg:px-0" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "cursor-pointer conditional_btn", onClick: () => onAddCondition(index) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "plus-circle", size: 20, color: "text-gray-500" }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `cursor-pointer conditional_btn delete-action ${conditionsLength === 1 ? "p-disabled" : ""}`, onClick: () => onRemoveCondition(id) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "minus-circle", size: 20, color: "text-gray-500" }) }))] }))] })));
205
210
  };
206
211
  exports.default = Conditions;