sccoreui 5.8.18 → 5.8.19
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.
- package/dist/components/ag-grid/MyProvider.js +11 -0
- package/dist/components/ag-grid/advancedFeature/advanced-feature.js +4 -2
- package/dist/components/ag-grid/advancedFeature/new-filter/TableFilter.js +137 -0
- package/dist/components/ag-grid/advancedFeature/new-filter/conditions/Conditions.js +156 -0
- package/dist/components/ag-grid/constants.js +253 -11
- package/dist/components/ag-grid/grid-checkbox.js +10 -1
- package/dist/types/components/ag-grid/advancedFeature/new-filter/TableFilter.d.ts +3 -0
- package/dist/types/components/ag-grid/advancedFeature/new-filter/conditions/Conditions.d.ts +2 -0
- package/dist/types/components/ag-grid/constants.d.ts +82 -2
- package/package.json +1 -1
|
@@ -18,6 +18,10 @@ function MyProvider({ children, value }) {
|
|
|
18
18
|
// Returns based on length of filterQueries present
|
|
19
19
|
return length === 0 ? [0] : Array.from({ length }, (_, index) => index);
|
|
20
20
|
});
|
|
21
|
+
const conditionTypes = [{ id: 1, label: "And" }, { id: 2, label: "OR" }];
|
|
22
|
+
const [conditionType, setConditionType] = (0, react_1.useState)(conditionTypes[0]);
|
|
23
|
+
const [globalFilters, setGlobalFilters] = (0, react_1.useState)([]);
|
|
24
|
+
const [showAsSave, setShowAsSave] = (0, react_1.useState)(false);
|
|
21
25
|
// Function call on click to refresh
|
|
22
26
|
const removeFeaturesAndRefresh = () => {
|
|
23
27
|
const emptyFeatures = initialFeature;
|
|
@@ -45,6 +49,13 @@ function MyProvider({ children, value }) {
|
|
|
45
49
|
callGrid,
|
|
46
50
|
removeFeaturesAndRefresh,
|
|
47
51
|
totalRecords,
|
|
52
|
+
conditionTypes,
|
|
53
|
+
conditionType,
|
|
54
|
+
setConditionType,
|
|
55
|
+
globalFilters,
|
|
56
|
+
setGlobalFilters,
|
|
57
|
+
showAsSave,
|
|
58
|
+
setShowAsSave
|
|
48
59
|
} }, { children: children })));
|
|
49
60
|
}
|
|
50
61
|
exports.default = MyProvider;
|
|
@@ -5,11 +5,12 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const global_search_1 = tslib_1.__importDefault(require("./global-search"));
|
|
6
6
|
const custom_sort_1 = tslib_1.__importDefault(require("./custom-sort"));
|
|
7
7
|
const record_detail_1 = tslib_1.__importDefault(require("./record-detail"));
|
|
8
|
-
|
|
8
|
+
// import Filter from "./filter/filter"
|
|
9
9
|
const refresh_grid_1 = tslib_1.__importDefault(require("./refresh-grid"));
|
|
10
10
|
const remove_items_1 = tslib_1.__importDefault(require("./remove-items"));
|
|
11
11
|
const react_1 = require("react");
|
|
12
12
|
const MyProvider_1 = require("../MyProvider");
|
|
13
|
+
const TableFilter_1 = tslib_1.__importDefault(require("./new-filter/TableFilter"));
|
|
13
14
|
// import HideColumn from "./hide-column"
|
|
14
15
|
// import Grouping from "./grouping"
|
|
15
16
|
// import { ConditionsToDisplay } from "../Types"
|
|
@@ -18,6 +19,7 @@ function AdvancedFeatures({ props }) {
|
|
|
18
19
|
const conditionsToDisplay = props === null || props === void 0 ? void 0 : props.conditionsToDisplay;
|
|
19
20
|
const { bulkActionComponent: BulkAction } = props;
|
|
20
21
|
// const {displayFilter,displaySearch,displayRefresh,displaySort} = conditionsToDisplay
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between py-3 px-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySearch) && (0, jsx_runtime_1.jsx)(global_search_1.default, { searchPlaceHolder: props === null || props === void 0 ? void 0 : props.placeholder }), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && (0, jsx_runtime_1.jsx)(
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between py-3 px-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySearch) && ((0, jsx_runtime_1.jsx)(global_search_1.default, { searchPlaceHolder: props === null || props === void 0 ? void 0 : props.placeholder })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && ((0, jsx_runtime_1.jsx)(TableFilter_1.default, {}))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRemoveItems) && (0, jsx_runtime_1.jsx)(remove_items_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkAction) &&
|
|
23
|
+
(props === null || props === void 0 ? void 0 : props.bulkActionComponent) && ((0, jsx_runtime_1.jsx)(BulkAction, { checkBoxSelection: featureDetails.checkBoxSelection })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRefresh) && (0, jsx_runtime_1.jsx)(refresh_grid_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySort) && (0, jsx_runtime_1.jsx)(custom_sort_1.default, {}), (0, jsx_runtime_1.jsx)(record_detail_1.default, {})] }))] })));
|
|
22
24
|
}
|
|
23
25
|
exports.default = AdvancedFeatures;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const overlaypanel_1 = require("primereact/overlaypanel");
|
|
7
|
+
const button_1 = require("primereact/button");
|
|
8
|
+
const divider_1 = require("primereact/divider");
|
|
9
|
+
const svg_component_1 = tslib_1.__importDefault(require("../../../../directives/svg-component"));
|
|
10
|
+
const constants_1 = tslib_1.__importDefault(require("../../constants"));
|
|
11
|
+
const Conditions_1 = tslib_1.__importDefault(require("./conditions/Conditions"));
|
|
12
|
+
require("./TableFilter.module.scss");
|
|
13
|
+
const MyProvider_1 = require("../../MyProvider");
|
|
14
|
+
const TableFilter = () => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const { featureDetails, columnData, conditionType, conditionTypes, globalFilters, setConditionType, setGlobalFilters, setFeatureDetails, } = (0, react_1.useContext)(MyProvider_1.FeatureContext);
|
|
17
|
+
const columnId = "field";
|
|
18
|
+
const columnName = "headerName";
|
|
19
|
+
const showFilter = (0, react_1.useRef)(null);
|
|
20
|
+
const [conditionsArray, setConditionsArray] = (0, react_1.useState)([]);
|
|
21
|
+
const [allFieldsFilled, setAllFieldsFilled] = (0, react_1.useState)(false);
|
|
22
|
+
const [enbleApply, setEnbleApply] = (0, react_1.useState)(true);
|
|
23
|
+
const [isOverlayOpened, setIsOverlayOpened] = (0, react_1.useState)(false);
|
|
24
|
+
const tableColumns = columnData === null || columnData === void 0 ? void 0 : columnData.map((eachColumn) => {
|
|
25
|
+
return {
|
|
26
|
+
name: eachColumn[columnName],
|
|
27
|
+
code: eachColumn[columnId],
|
|
28
|
+
dataType: eachColumn.dataType,
|
|
29
|
+
type: eachColumn.type,
|
|
30
|
+
key: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.key,
|
|
31
|
+
options: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.options,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
const defaultCondtion = {
|
|
35
|
+
columnName: "",
|
|
36
|
+
condition: "",
|
|
37
|
+
value: "",
|
|
38
|
+
id: Math.random().toString(),
|
|
39
|
+
isActive: false,
|
|
40
|
+
};
|
|
41
|
+
const applyAdvancedFilter = (array) => {
|
|
42
|
+
setGlobalFilters(array);
|
|
43
|
+
const allQueries = array.map((query) => {
|
|
44
|
+
console.log(query, 'query in apply filter');
|
|
45
|
+
const column = { field: query.columnName.code };
|
|
46
|
+
const operation = { code: query.condition.code };
|
|
47
|
+
let queryToAdd = {
|
|
48
|
+
selectedColumn: column,
|
|
49
|
+
selectedOperation: operation,
|
|
50
|
+
value: query.value,
|
|
51
|
+
logicalOperator: conditionType.id
|
|
52
|
+
};
|
|
53
|
+
return queryToAdd;
|
|
54
|
+
});
|
|
55
|
+
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: allQueries }));
|
|
56
|
+
console.log(allQueries, 'all queries added');
|
|
57
|
+
// callGrid(featureDetails)
|
|
58
|
+
// console.log("applyAdvancedFilter",array,conditionType)
|
|
59
|
+
return [];
|
|
60
|
+
};
|
|
61
|
+
const handleConditionType = (value) => {
|
|
62
|
+
setConditionType(value);
|
|
63
|
+
};
|
|
64
|
+
const onClickFilter = (event) => {
|
|
65
|
+
showFilter.current.toggle(event);
|
|
66
|
+
};
|
|
67
|
+
const updateconditionsArray = (conditionObj, condtionIndex) => {
|
|
68
|
+
const updatedCondtions = conditionsArray.map((eachCondition) => {
|
|
69
|
+
if (eachCondition.id === condtionIndex) {
|
|
70
|
+
return conditionObj;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return eachCondition;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
setConditionsArray(updatedCondtions);
|
|
77
|
+
};
|
|
78
|
+
const addEmptyCondition = (index) => {
|
|
79
|
+
const updatedconditionsArray = [...conditionsArray];
|
|
80
|
+
updatedconditionsArray.splice(index + 1, 0, defaultCondtion);
|
|
81
|
+
setConditionsArray(updatedconditionsArray);
|
|
82
|
+
};
|
|
83
|
+
const removeConditionFromArray = (conditionIndex) => {
|
|
84
|
+
const updatedconditionsArray = conditionsArray.filter((condition) => condition.id !== conditionIndex);
|
|
85
|
+
setConditionsArray(updatedconditionsArray);
|
|
86
|
+
};
|
|
87
|
+
const onApplyFilter = () => {
|
|
88
|
+
let arr = conditionsArray.map((condition) => {
|
|
89
|
+
return Object.assign(Object.assign({}, condition), { isActive: true });
|
|
90
|
+
});
|
|
91
|
+
console.log(arr, 'array from condition');
|
|
92
|
+
applyAdvancedFilter(arr);
|
|
93
|
+
setConditionsArray(arr);
|
|
94
|
+
showFilter.current.toggle(false);
|
|
95
|
+
};
|
|
96
|
+
const onresetFilter = () => {
|
|
97
|
+
applyAdvancedFilter([]);
|
|
98
|
+
setConditionsArray([defaultCondtion]);
|
|
99
|
+
showFilter.current.toggle(false);
|
|
100
|
+
};
|
|
101
|
+
const renderCondtion = (conditions, key) => {
|
|
102
|
+
const { columnName, condition, value, id } = conditions;
|
|
103
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex" }, { children: (0, jsx_runtime_1.jsx)(Conditions_1.default, { index: key, setEnbleApply: (value) => setEnbleApply(value), id: id, columnName: columnName, condition: condition, conditionType: conditionType, conditionTypes: conditionTypes, value: value, columnsArray: tableColumns, conditionsArray: constants_1.default.conditionsList, handleConditionType: handleConditionType, updateconditionsArray: updateconditionsArray, addEmptyCondition: addEmptyCondition, removeConditionFromArray: removeConditionFromArray, condtionslenght: conditionsArray.length }, key) })));
|
|
104
|
+
};
|
|
105
|
+
(0, react_1.useEffect)(() => {
|
|
106
|
+
if (conditionsArray.length === 0) {
|
|
107
|
+
setConditionsArray([defaultCondtion]);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
(0, react_1.useEffect)(() => {
|
|
111
|
+
if (globalFilters.length === 0) {
|
|
112
|
+
setConditionsArray([defaultCondtion]);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
setConditionsArray(globalFilters);
|
|
116
|
+
}
|
|
117
|
+
}, [isOverlayOpened]);
|
|
118
|
+
(0, react_1.useEffect)(() => {
|
|
119
|
+
const isAllFieldsFilled = conditionsArray.every((condition) => {
|
|
120
|
+
return condition.columnName && condition.condition && condition.value;
|
|
121
|
+
});
|
|
122
|
+
setAllFieldsFilled(isAllFieldsFilled && enbleApply);
|
|
123
|
+
}, [conditionsArray, enbleApply]);
|
|
124
|
+
console.log(featureDetails, globalFilters, 'feature details in new filter');
|
|
125
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `cursor-pointer p-1 sc_icon_hover flex align-items-center gap-2 border-round-lg ${isOverlayOpened ||
|
|
126
|
+
((_a = globalFilters === null || globalFilters === void 0 ? void 0 : globalFilters.filters) === null || _a === void 0 ? void 0 : _a.filter((each) => each.isActive).length) >=
|
|
127
|
+
1
|
|
128
|
+
? "bg-primary-50"
|
|
129
|
+
: ""}` }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ onClick: (e) => onClickFilter(e) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "filter-lines", size: 20, color: isOverlayOpened ||
|
|
130
|
+
((_b = globalFilters === null || globalFilters === void 0 ? void 0 : globalFilters.filters) === null || _b === void 0 ? void 0 : _b.filter((each) => each.isActive).length) >= 1
|
|
131
|
+
? "#243DC6"
|
|
132
|
+
: "#667085" }) })), (globalFilters === null || globalFilters === void 0 ? void 0 : globalFilters.filter((each) => each.isActive).length) >=
|
|
133
|
+
1 && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "flex gap-1 align-items-center text-primary-400" }, { children: [`${globalFilters === null || globalFilters === void 0 ? void 0 : globalFilters.filter((each) => each.isActive).length} Selected`, (0, jsx_runtime_1.jsx)("span", Object.assign({ onClick: onresetFilter }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 20, color: "#243DC6" }) }))] })))] })), (0, jsx_runtime_1.jsx)(overlaypanel_1.OverlayPanel, Object.assign({ ref: showFilter, onShow: () => setIsOverlayOpened(true), onHide: () => setIsOverlayOpened(false), className: ` tableFilterPanel` }, { children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-lg font-semibold line-height-3 text-gray-900" }, { children: "Filters" })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-sm text-gray-600" }, { children: "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-4" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "max-h-14rem\toverflow-auto" }, { children: conditionsArray.map((eachCondition, index) => {
|
|
134
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: renderCondtion(eachCondition, index) }, index));
|
|
135
|
+
}) })) })), (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, { className: "text-base font-semibold text-gray-600 bg-white border-white p-1 pt-2 focus:shadow-none", label: "Reset Filter", onClick: onresetFilter }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: "text-base font-semibold text-primary-400 p-1 focus:shadow-none mr-3", label: "Create View", onClick: () => '', text: true, iconPos: "left", icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "plus", color: "text-primary-400 mr-2" }) }), (0, jsx_runtime_1.jsx)(button_1.Button, { className: "text-base font-semibold text-gray-600 p-1 focus:shadow-none text-white w-4rem", label: "Apply", onClick: onApplyFilter, disabled: !allFieldsFilled })] })] }))] }) }))] }));
|
|
136
|
+
};
|
|
137
|
+
exports.default = TableFilter;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// import { Dropdown, Button, SvgComponent, InputText, InputNumber, Calendar, MultiSelectDropDown } from "sccoreui";
|
|
6
|
+
const dropdown_1 = require("primereact/dropdown");
|
|
7
|
+
const button_1 = require("primereact/button");
|
|
8
|
+
const svg_component_1 = tslib_1.__importDefault(require("../../../../../directives/svg-component"));
|
|
9
|
+
const inputtext_1 = require("primereact/inputtext");
|
|
10
|
+
const inputnumber_1 = require("primereact/inputnumber");
|
|
11
|
+
const calendar_1 = require("primereact/calendar");
|
|
12
|
+
const multi_select_dropdown_1 = tslib_1.__importDefault(require("../../../../multi-select-dropdown/multi-select-dropdown"));
|
|
13
|
+
const Condtions = (props) => {
|
|
14
|
+
const { columnName, condition, value, columnsArray, conditionsArray, index, id, setEnbleApply, updateconditionsArray, removeConditionFromArray, addEmptyCondition, condtionslenght, conditionType, conditionTypes, handleConditionType } = props;
|
|
15
|
+
// const [columnState, setColumnState] = useState(columnName);
|
|
16
|
+
// const [condtionState, setConditionState] = useState(condition);
|
|
17
|
+
// const [dynamicFieldState, setDynamicFieldState] = useState(value);
|
|
18
|
+
// useEffect(() => {
|
|
19
|
+
// setColumnState(columnName);
|
|
20
|
+
// setConditionState(condition);
|
|
21
|
+
// setDynamicFieldState(value);
|
|
22
|
+
// }, [columnName, condition, value]);
|
|
23
|
+
const onAddCondtion = (index) => {
|
|
24
|
+
addEmptyCondition(index);
|
|
25
|
+
};
|
|
26
|
+
const onRemoveCondtion = (index) => {
|
|
27
|
+
removeConditionFromArray(index);
|
|
28
|
+
};
|
|
29
|
+
const onUpdateColumnName = (envent) => {
|
|
30
|
+
// setColumnState(envent);
|
|
31
|
+
updateconditionsArray({
|
|
32
|
+
columnName: envent,
|
|
33
|
+
condition: '',
|
|
34
|
+
value: '',
|
|
35
|
+
id: id
|
|
36
|
+
}, id);
|
|
37
|
+
};
|
|
38
|
+
const onUpdateCondition = (event) => {
|
|
39
|
+
// setConditionState(event);
|
|
40
|
+
updateconditionsArray({
|
|
41
|
+
columnName: columnName,
|
|
42
|
+
condition: event,
|
|
43
|
+
value: '',
|
|
44
|
+
id: id
|
|
45
|
+
}, id);
|
|
46
|
+
};
|
|
47
|
+
const handleDynamicFieldState = (event) => {
|
|
48
|
+
// setDynamicFieldState(event);
|
|
49
|
+
updateconditionsArray({
|
|
50
|
+
columnName: columnName,
|
|
51
|
+
condition: condition,
|
|
52
|
+
value: event,
|
|
53
|
+
id: id
|
|
54
|
+
}, id);
|
|
55
|
+
};
|
|
56
|
+
const renderDynamicField = (selectedColumn) => {
|
|
57
|
+
var _a;
|
|
58
|
+
const dataType = (selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.type) ? selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.type : selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.dataType;
|
|
59
|
+
switch (dataType === null || dataType === void 0 ? void 0 : dataType.toLowerCase()) {
|
|
60
|
+
case "string": {
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition, className: "condtion-dropdown border-noround-left mb-2 focus:shadow-none", value: value, placeholder: "Enter", onChange: (event) => handleDynamicFieldState(event.target.value) }));
|
|
62
|
+
}
|
|
63
|
+
case "integer": {
|
|
64
|
+
const handleOnchangeEvent = (eventValue) => {
|
|
65
|
+
const regex = /^\s*\d+(-\d+)?\s*$/; // Updated regex pattern to allow numbers with one "-"
|
|
66
|
+
// Remove all non-digit and non-hyphen characters
|
|
67
|
+
let eventValue1 = eventValue.replace(/[^\d-]/g, "");
|
|
68
|
+
// Ensure only one occurrence of "-"
|
|
69
|
+
eventValue1 = eventValue1.replace(/-{2,}/g, "-");
|
|
70
|
+
let finalOn = '';
|
|
71
|
+
if (eventValue1.includes("-")) {
|
|
72
|
+
finalOn = eventValue1.replace("-", ",");
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
finalOn = eventValue1;
|
|
76
|
+
}
|
|
77
|
+
handleDynamicFieldState(finalOn);
|
|
78
|
+
if (regex.test(eventValue1) && eventValue1.includes("-")) {
|
|
79
|
+
let arr = eventValue1.split("-").map((count) => parseInt(count));
|
|
80
|
+
if (arr[1] > arr[0]) {
|
|
81
|
+
setEnbleApply(true);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
setEnbleApply(false);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
setEnbleApply(false); // Set enableApply to false when the input is invalid
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.code) === "9" || (condition === null || condition === void 0 ? void 0 : condition.code) === "20") {
|
|
92
|
+
return ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition, className: "condtion-dropdown border-noround-left mb-2 dropdown-focus-none", value: value.includes(",") ? value.replace(",", "-") : value, placeholder: "Enter", onChange: (event) => handleOnchangeEvent(event.target.value) })
|
|
93
|
+
// <div className="flex">
|
|
94
|
+
// <InputNumber
|
|
95
|
+
// disabled={!condition}
|
|
96
|
+
// className="condtion-dropdown w-7rem border-noround-left mb-2 dropdown-focus-none"
|
|
97
|
+
// value={value}
|
|
98
|
+
// placeholder="Enter"
|
|
99
|
+
// onChange={(event: any) => handleDynamicFieldState(event.target.value)}
|
|
100
|
+
// />
|
|
101
|
+
// <InputNumber
|
|
102
|
+
// disabled={!condition}
|
|
103
|
+
// className="condtion-dropdown w-7rem mb-2 dropdown-focus-none"
|
|
104
|
+
// value={value}
|
|
105
|
+
// placeholder="Enter"
|
|
106
|
+
// onChange={(event: any) => handleDynamicFieldState(event.target.value)}
|
|
107
|
+
// />
|
|
108
|
+
// </div>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
return ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition, className: "condtion-dropdown border-noround-left mb-2 dropdown-focus-none", value: value, type: "number", placeholder: "Enter", onChange: (event) => { var _a; return handleDynamicFieldState((_a = event.target.value) === null || _a === void 0 ? void 0 : _a.replace("-", '')); } }));
|
|
112
|
+
}
|
|
113
|
+
case "single": {
|
|
114
|
+
// let optionValue = selectedColumn?.options.find((each: any) => each[selectedColumn['key']] === value)
|
|
115
|
+
const handleOnchangeEvent = (value) => {
|
|
116
|
+
// if (selectedColumn['key'] === 'value') {
|
|
117
|
+
handleDynamicFieldState(`${value}`);
|
|
118
|
+
// }
|
|
119
|
+
};
|
|
120
|
+
return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "condtion-dropdown border-noround-left mb-2 dropdown-focus-none", value: parseInt(value), options: selectedColumn.options, optionLabel: "label", placeholder: "Select", disabled: !condition, onChange: (event) => handleOnchangeEvent(event.value) }));
|
|
121
|
+
}
|
|
122
|
+
case "date": {
|
|
123
|
+
const convertDateToISO = (date) => {
|
|
124
|
+
if (date) {
|
|
125
|
+
const dateObject = new Date(date);
|
|
126
|
+
if (isNaN(dateObject.getTime()))
|
|
127
|
+
return null; // Invalid date handling
|
|
128
|
+
return dateObject.toISOString();
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
131
|
+
};
|
|
132
|
+
const handleOnchangeEvent = (value) => {
|
|
133
|
+
let valueString = value.length === 2 ? value.map(convertDateToISO).join(",") : value;
|
|
134
|
+
handleDynamicFieldState(valueString);
|
|
135
|
+
};
|
|
136
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.code) === "9" || (condition === null || condition === void 0 ? void 0 : condition.code) === "20") {
|
|
137
|
+
return ((0, jsx_runtime_1.jsx)(calendar_1.Calendar, { readOnlyInput: true, showTime: true, disabled: !condition, selectionMode: "range", placeholder: "Select", className: "condtion-dropdown border-noround-left mb-2 filter-calendar", value: (value === null || value === void 0 ? void 0 : value.includes(",")) ? (_a = value === null || value === void 0 ? void 0 : value.split(",")) === null || _a === void 0 ? void 0 : _a.map((date) => date ? new Date(date) : null) : null, onChange: (event) => handleOnchangeEvent(event.value) }));
|
|
138
|
+
}
|
|
139
|
+
return ((0, jsx_runtime_1.jsx)(calendar_1.Calendar, { readOnlyInput: true, showTime: false, disabled: !condition, selectionMode: "single", placeholder: "Select", className: "condtion-dropdown border-noround-left mb-2 filter-calendar", value: value, onChange: (event) => handleDynamicFieldState(event.value) }));
|
|
140
|
+
}
|
|
141
|
+
case "multi": {
|
|
142
|
+
return ((0, jsx_runtime_1.jsx)(multi_select_dropdown_1.default, { className: "filter-multi-dropdown mb-2", value: value, hidePanelHeader: true, maxSelectedLabels: 1, onChange: (event) => handleDynamicFieldState(event.value), placeholder: "Select", options: selectedColumn.options, dropdownType: "default", optionLabel: "name" }));
|
|
143
|
+
}
|
|
144
|
+
case "decimal": {
|
|
145
|
+
return ((0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, { className: "border-noround-left mb-2 filter-input-decimal", value: value, placeholder: "Enter", onChange: (event) => handleDynamicFieldState(event.target.value), maxFractionDigits: 2 }));
|
|
146
|
+
}
|
|
147
|
+
case "percent": {
|
|
148
|
+
return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "condtion-dropdown border-noround-left mb-2 dropdown-focus-none", value: value, options: [], optionLabel: "name", placeholder: "Select", onChange: (event) => handleDynamicFieldState(event.value) }));
|
|
149
|
+
}
|
|
150
|
+
default:
|
|
151
|
+
return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "condtion-dropdown border-noround-left mb-2 dropdown-focus-none", options: [], value: value, optionLabel: "name", placeholder: "Select", disabled: true }));
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex filter-dropdowns align-items-center" }, { children: [index !== 0 ? (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "condtion-dropdown w-5rem mb-2 mr-2 dropdown-focus-none ", options: conditionTypes, optionLabel: "label", placeholder: "Select", value: conditionType, disabled: index !== 1, onChange: (event) => handleConditionType(event.target.value) }) : (0, jsx_runtime_1.jsx)("div", { className: "w-5rem mr-2" }), (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: `condtion-dropdown border-noround-right mb-2 dropdown-focus-none`, options: columnsArray, optionLabel: "name", placeholder: "Select", value: columnName, onChange: (event) => onUpdateColumnName(event.value) }), (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "condition-type border-noround mb-2 dropdown-focus-none", options: conditionsArray.filter((each) => each.datatypes.includes(columnName === null || columnName === void 0 ? void 0 : columnName.dataType)).map((option) => { return Object.assign(Object.assign({}, option), { name: option.name.toLowerCase().split(' ').map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ') }); }), value: condition, disabled: columnName === '', optionLabel: "name", placeholder: "Select", onChange: (event) => onUpdateCondition(event.value) }), renderDynamicField(columnName), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex gap-2 mx-2" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ className: "mb-2 bg-white w-2rem border-white p-0 flex justify-content-center focus:shadow-none", onClick: () => onAddCondtion(index), disabled: false }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "plus-circle", size: 20 }) })), (0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ disabled: condtionslenght === 1, className: "mb-2 bg-white text-center w-2rem border-white p-0 flex justify-content-center focus:shadow-none", onClick: () => onRemoveCondtion(id) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "minus-circle", size: 20 }) }))] }))] })));
|
|
155
|
+
};
|
|
156
|
+
exports.default = Condtions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DEFAULTS = exports.FILEEXTENSIONTYPE = exports.IMAGETYPES = exports.STATUSLIST = exports.SETUPPRICEOPTIONS = exports.PRICINGTYPE = exports.BUNDLETYPE = exports.BUNDLEQUANTITYTYPE = exports.DEFAULTGUID = exports.CATEGORYTYPE = exports.PRODUCTDISCOUNTTYPE = exports.conditionsList = exports.PRODUCTTYPE = exports.ROW_HEIGHT = exports.DEBOUNCE_INTERVAL = exports.MAX_BLOCKS = exports.BLOCK_SIZE = exports.ROWMODELTYPE = exports.COLUMN_SORT_OPTIONS = void 0;
|
|
4
4
|
const Types_1 = require("./Types");
|
|
5
5
|
exports.COLUMN_SORT_OPTIONS = [
|
|
6
6
|
{ id: 1, label: "Low - High", sortId: 1, dataType: Types_1.ATTRIBUTEDATATYPES.INTEGER },
|
|
@@ -10,9 +10,191 @@ exports.COLUMN_SORT_OPTIONS = [
|
|
|
10
10
|
{ id: 5, sortId: 1, label: "Min -Max", dataType: Types_1.ATTRIBUTEDATATYPES.DATE },
|
|
11
11
|
{ id: 6, sortId: 2, label: "Max - Min", dataType: Types_1.ATTRIBUTEDATATYPES.DATE },
|
|
12
12
|
];
|
|
13
|
+
// export const conditionsList: Operation[] = [
|
|
14
|
+
// { name: "contains all of", datatypes: ["boolean","select"], code: "1" },
|
|
15
|
+
// { name: "contains any of ", datatypes: ["string","select"], code: "2" },
|
|
16
|
+
// { name: "doesn’t contain all of ", datatypes: ["boolean"], code: "3" },
|
|
17
|
+
// { name: "doesn’t contain any of", datatypes: ["string"], code: "4" },
|
|
18
|
+
// { name: "ends with any of", datatypes: ["string"], code: "5" },
|
|
19
|
+
// { name: "is after", datatypes: ["date"], code: "6" },
|
|
20
|
+
// { name: "is any of", datatypes: ["boolean"], code: "7" },
|
|
21
|
+
// { name: "is before", datatypes: ["date"], code: "8" },
|
|
22
|
+
// { name: "is between", datatypes: ["integer", "date"], code: "9" },
|
|
23
|
+
// { name: "is (not) equal to", datatypes: ["integer", "date"], code: "10" },
|
|
24
|
+
// { name: "is (not) equal to all of", datatypes: ["boolean"], code: "11" },
|
|
25
|
+
// { name: "is (not) equal to any of", datatypes: ["string"], code: "12" },
|
|
26
|
+
// { name: "is greater than", datatypes: ["integer"], code: "13" },
|
|
27
|
+
// { name: "is greater than or equalto", datatypes: ["integer"], code: "14" },
|
|
28
|
+
// { name: "is known", datatypes: ["boolean", "integer", "string"], code: "15" },
|
|
29
|
+
// { name: "is less than", datatypes: ["integer", "date"], code: "16" },
|
|
30
|
+
// { name: "is less than or equal to", datatypes: ["integer"], code: "17" },
|
|
31
|
+
// { name: "is more than", datatypes: ["integer", "date"], code: "18" },
|
|
32
|
+
// { name: "is none of", datatypes: ["boolean"], code: "19" },
|
|
33
|
+
// { name: "is not between", datatypes: ["integer", "date"], code: "20" },
|
|
34
|
+
// { name: "is unknown", datatypes: ["boolean", "integer", "string"], code: "21" },
|
|
35
|
+
// { name: "starts with any of ", datatypes: ["string"], code: "22" },
|
|
36
|
+
// { name: "is equal to", datatypes: ["integer", "date"], code: "23" },
|
|
37
|
+
// { name: "is equal to all of", datatypes: ["boolean"], code: "24" },
|
|
38
|
+
// { name: "is equal to any of", datatypes: ["string"], code: "25" }
|
|
39
|
+
// ];
|
|
40
|
+
exports.ROWMODELTYPE = {
|
|
41
|
+
INFINITE: "infinite",
|
|
42
|
+
SERVER_SIDE: "serverSide",
|
|
43
|
+
CLIENT_SIDE: "clientSide",
|
|
44
|
+
};
|
|
45
|
+
exports.BLOCK_SIZE = 100;
|
|
46
|
+
exports.MAX_BLOCKS = 2;
|
|
47
|
+
exports.DEBOUNCE_INTERVAL = 200;
|
|
48
|
+
exports.ROW_HEIGHT = 60;
|
|
49
|
+
const DEFAULTGUID = "000000000000000000000000";
|
|
50
|
+
exports.DEFAULTGUID = DEFAULTGUID;
|
|
51
|
+
// import { SETUPPRICEOPTIONS } from "./attribute";
|
|
52
|
+
// max char limit (INPUT FIELDS)
|
|
53
|
+
let maxCodeLength = 250;
|
|
54
|
+
let maxNameLength = 250;
|
|
55
|
+
const minSortInputLength = 0;
|
|
56
|
+
const maxSortInputLength = 99;
|
|
57
|
+
var DEFAULTS;
|
|
58
|
+
(function (DEFAULTS) {
|
|
59
|
+
DEFAULTS[DEFAULTS["CURRENCY"] = 1] = "CURRENCY";
|
|
60
|
+
DEFAULTS[DEFAULTS["DATEFORMAT"] = 2] = "DATEFORMAT";
|
|
61
|
+
DEFAULTS[DEFAULTS["LANGUAGE"] = 3] = "LANGUAGE";
|
|
62
|
+
DEFAULTS[DEFAULTS["TIMEFORMAT"] = 7] = "TIMEFORMAT";
|
|
63
|
+
DEFAULTS[DEFAULTS["TIMEZONE"] = 8] = "TIMEZONE";
|
|
64
|
+
})(DEFAULTS || (DEFAULTS = {}));
|
|
65
|
+
exports.DEFAULTS = DEFAULTS;
|
|
66
|
+
var CATEGORYTYPE;
|
|
67
|
+
(function (CATEGORYTYPE) {
|
|
68
|
+
CATEGORYTYPE[CATEGORYTYPE["static"] = 1] = "static";
|
|
69
|
+
CATEGORYTYPE[CATEGORYTYPE["dynamic"] = 2] = "dynamic";
|
|
70
|
+
})(CATEGORYTYPE || (CATEGORYTYPE = {}));
|
|
71
|
+
exports.CATEGORYTYPE = CATEGORYTYPE;
|
|
72
|
+
var PRICINGTYPE;
|
|
73
|
+
(function (PRICINGTYPE) {
|
|
74
|
+
PRICINGTYPE[PRICINGTYPE["PRODUCTDISCOUNT"] = 1] = "PRODUCTDISCOUNT";
|
|
75
|
+
PRICINGTYPE[PRICINGTYPE["PERCENTAGEDISCOUNT"] = 2] = "PERCENTAGEDISCOUNT";
|
|
76
|
+
PRICINGTYPE[PRICINGTYPE["FIXEDDISCOUNT"] = 3] = "FIXEDDISCOUNT";
|
|
77
|
+
PRICINGTYPE[PRICINGTYPE["FIXEDPRICE"] = 4] = "FIXEDPRICE";
|
|
78
|
+
PRICINGTYPE[PRICINGTYPE["FIXEDPOINTS"] = 5] = "FIXEDPOINTS";
|
|
79
|
+
PRICINGTYPE[PRICINGTYPE["NODISCOUNT"] = 6] = "NODISCOUNT";
|
|
80
|
+
})(PRICINGTYPE || (PRICINGTYPE = {}));
|
|
81
|
+
exports.PRICINGTYPE = PRICINGTYPE;
|
|
82
|
+
var BUNDLEQUANTITYTYPE;
|
|
83
|
+
(function (BUNDLEQUANTITYTYPE) {
|
|
84
|
+
BUNDLEQUANTITYTYPE[BUNDLEQUANTITYTYPE["ANY"] = 1] = "ANY";
|
|
85
|
+
BUNDLEQUANTITYTYPE[BUNDLEQUANTITYTYPE["FIXED"] = 2] = "FIXED";
|
|
86
|
+
BUNDLEQUANTITYTYPE[BUNDLEQUANTITYTYPE["RANGE"] = 3] = "RANGE";
|
|
87
|
+
})(BUNDLEQUANTITYTYPE || (BUNDLEQUANTITYTYPE = {}));
|
|
88
|
+
exports.BUNDLEQUANTITYTYPE = BUNDLEQUANTITYTYPE;
|
|
89
|
+
var STATUSLIST;
|
|
90
|
+
(function (STATUSLIST) {
|
|
91
|
+
STATUSLIST[STATUSLIST["DRAFT"] = 1] = "DRAFT";
|
|
92
|
+
STATUSLIST[STATUSLIST["ACTIVE"] = 2] = "ACTIVE";
|
|
93
|
+
STATUSLIST[STATUSLIST["INACTIVE"] = 3] = "INACTIVE";
|
|
94
|
+
STATUSLIST[STATUSLIST["DELETED"] = 4] = "DELETED";
|
|
95
|
+
STATUSLIST[STATUSLIST["SCHEDULE"] = 5] = "SCHEDULE";
|
|
96
|
+
})(STATUSLIST || (STATUSLIST = {}));
|
|
97
|
+
exports.STATUSLIST = STATUSLIST;
|
|
98
|
+
var BUNDLETYPE;
|
|
99
|
+
(function (BUNDLETYPE) {
|
|
100
|
+
BUNDLETYPE[BUNDLETYPE["PRODUCT"] = 1] = "PRODUCT";
|
|
101
|
+
BUNDLETYPE[BUNDLETYPE["CATEGORY"] = 2] = "CATEGORY";
|
|
102
|
+
})(BUNDLETYPE || (BUNDLETYPE = {}));
|
|
103
|
+
exports.BUNDLETYPE = BUNDLETYPE;
|
|
104
|
+
var PRODUCTDISCOUNTTYPE;
|
|
105
|
+
(function (PRODUCTDISCOUNTTYPE) {
|
|
106
|
+
PRODUCTDISCOUNTTYPE[PRODUCTDISCOUNTTYPE["VALUE"] = 1] = "VALUE";
|
|
107
|
+
PRODUCTDISCOUNTTYPE[PRODUCTDISCOUNTTYPE["PERCENTAGE"] = 2] = "PERCENTAGE";
|
|
108
|
+
})(PRODUCTDISCOUNTTYPE || (PRODUCTDISCOUNTTYPE = {}));
|
|
109
|
+
exports.PRODUCTDISCOUNTTYPE = PRODUCTDISCOUNTTYPE;
|
|
110
|
+
var PRODUCTTYPE;
|
|
111
|
+
(function (PRODUCTTYPE) {
|
|
112
|
+
PRODUCTTYPE[PRODUCTTYPE["SIMPLE"] = 1] = "SIMPLE";
|
|
113
|
+
PRODUCTTYPE[PRODUCTTYPE["CONFIGURABLE"] = 2] = "CONFIGURABLE";
|
|
114
|
+
PRODUCTTYPE[PRODUCTTYPE["GIFTCARD"] = 3] = "GIFTCARD";
|
|
115
|
+
PRODUCTTYPE[PRODUCTTYPE["DIGITAL"] = 4] = "DIGITAL";
|
|
116
|
+
})(PRODUCTTYPE = exports.PRODUCTTYPE || (exports.PRODUCTTYPE = {}));
|
|
117
|
+
var IMAGETYPES;
|
|
118
|
+
(function (IMAGETYPES) {
|
|
119
|
+
IMAGETYPES[IMAGETYPES["JPG"] = 1] = "JPG";
|
|
120
|
+
IMAGETYPES[IMAGETYPES["JPEG"] = 2] = "JPEG";
|
|
121
|
+
IMAGETYPES[IMAGETYPES["PNG"] = 3] = "PNG";
|
|
122
|
+
IMAGETYPES[IMAGETYPES["GIF"] = 4] = "GIF";
|
|
123
|
+
IMAGETYPES[IMAGETYPES["TIFF"] = 5] = "TIFF";
|
|
124
|
+
IMAGETYPES[IMAGETYPES["BMP"] = 6] = "BMP";
|
|
125
|
+
IMAGETYPES[IMAGETYPES["WEBP"] = 7] = "WEBP";
|
|
126
|
+
IMAGETYPES[IMAGETYPES["AVIF"] = 8] = "AVIF";
|
|
127
|
+
})(IMAGETYPES || (IMAGETYPES = {}));
|
|
128
|
+
exports.IMAGETYPES = IMAGETYPES;
|
|
129
|
+
var FILEEXTENSIONTYPE;
|
|
130
|
+
(function (FILEEXTENSIONTYPE) {
|
|
131
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["DOC"] = 1] = "DOC";
|
|
132
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["DOCX"] = 2] = "DOCX";
|
|
133
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["PDF"] = 3] = "PDF";
|
|
134
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["XLS"] = 4] = "XLS";
|
|
135
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["XLSX"] = 5] = "XLSX";
|
|
136
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["PPT"] = 6] = "PPT";
|
|
137
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["PPTX"] = 7] = "PPTX";
|
|
138
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["TXT"] = 8] = "TXT";
|
|
139
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["RTF"] = 9] = "RTF";
|
|
140
|
+
FILEEXTENSIONTYPE[FILEEXTENSIONTYPE["CSV"] = 10] = "CSV";
|
|
141
|
+
})(FILEEXTENSIONTYPE || (FILEEXTENSIONTYPE = {}));
|
|
142
|
+
exports.FILEEXTENSIONTYPE = FILEEXTENSIONTYPE;
|
|
143
|
+
const statusList = [
|
|
144
|
+
{ id: STATUSLIST.DRAFT, label: "Draft", value: STATUSLIST.DRAFT },
|
|
145
|
+
{ id: STATUSLIST.ACTIVE, label: "Active", value: STATUSLIST.ACTIVE },
|
|
146
|
+
{ id: STATUSLIST.INACTIVE, label: "Inactive", value: STATUSLIST.INACTIVE },
|
|
147
|
+
];
|
|
148
|
+
const imageOptions = [
|
|
149
|
+
{ id: IMAGETYPES.JPG, label: 'JPG', value: IMAGETYPES.JPG },
|
|
150
|
+
{ id: IMAGETYPES.JPEG, label: 'JPEG', value: IMAGETYPES.JPEG },
|
|
151
|
+
{ id: IMAGETYPES.PNG, label: 'PNG', value: IMAGETYPES.PNG },
|
|
152
|
+
{ id: IMAGETYPES.WEBP, label: 'WEBP', value: IMAGETYPES.WEBP },
|
|
153
|
+
{ id: IMAGETYPES.AVIF, label: 'AVIF', value: IMAGETYPES.AVIF },
|
|
154
|
+
{ id: IMAGETYPES.BMP, label: 'BMP', value: IMAGETYPES.BMP },
|
|
155
|
+
{ id: IMAGETYPES.TIFF, label: 'TIFF', value: IMAGETYPES.TIFF },
|
|
156
|
+
{ id: IMAGETYPES.GIF, label: 'GIF', value: IMAGETYPES.GIF },
|
|
157
|
+
];
|
|
158
|
+
const fileOptions = [
|
|
159
|
+
{ id: FILEEXTENSIONTYPE.DOC, label: 'DOC', value: FILEEXTENSIONTYPE.DOC },
|
|
160
|
+
{ id: FILEEXTENSIONTYPE.DOCX, label: 'DOCX', value: FILEEXTENSIONTYPE.DOCX },
|
|
161
|
+
{ id: FILEEXTENSIONTYPE.PDF, label: 'PDF', value: FILEEXTENSIONTYPE.PDF },
|
|
162
|
+
{ id: FILEEXTENSIONTYPE.XLS, label: 'XLS', value: FILEEXTENSIONTYPE.XLS },
|
|
163
|
+
{ id: FILEEXTENSIONTYPE.XLSX, label: 'XLSX', value: FILEEXTENSIONTYPE.XLSX },
|
|
164
|
+
{ id: FILEEXTENSIONTYPE.PPT, label: 'PPT', value: FILEEXTENSIONTYPE.PPT },
|
|
165
|
+
{ id: FILEEXTENSIONTYPE.PPTX, label: 'PPTX', value: FILEEXTENSIONTYPE.PPTX },
|
|
166
|
+
{ id: FILEEXTENSIONTYPE.TXT, label: 'TXT', value: FILEEXTENSIONTYPE.TXT },
|
|
167
|
+
{ id: FILEEXTENSIONTYPE.RTF, label: 'RTF', value: FILEEXTENSIONTYPE.RTF },
|
|
168
|
+
{ id: FILEEXTENSIONTYPE.CSV, label: 'CSV', value: FILEEXTENSIONTYPE.CSV },
|
|
169
|
+
];
|
|
170
|
+
var SETUPPRICEOPTIONS;
|
|
171
|
+
(function (SETUPPRICEOPTIONS) {
|
|
172
|
+
SETUPPRICEOPTIONS[SETUPPRICEOPTIONS["EVERYTIME"] = 1] = "EVERYTIME";
|
|
173
|
+
SETUPPRICEOPTIONS[SETUPPRICEOPTIONS["ONLYFORNEW"] = 2] = "ONLYFORNEW";
|
|
174
|
+
})(SETUPPRICEOPTIONS || (SETUPPRICEOPTIONS = {}));
|
|
175
|
+
exports.SETUPPRICEOPTIONS = SETUPPRICEOPTIONS;
|
|
176
|
+
const setUpPriceOptions = [
|
|
177
|
+
{ id: SETUPPRICEOPTIONS.EVERYTIME, label: 'Everytime', value: SETUPPRICEOPTIONS.EVERYTIME },
|
|
178
|
+
{ id: SETUPPRICEOPTIONS.ONLYFORNEW, label: 'Only For New', value: SETUPPRICEOPTIONS.ONLYFORNEW }
|
|
179
|
+
];
|
|
180
|
+
const statusWithSchedueList = [
|
|
181
|
+
{ id: STATUSLIST.DRAFT, label: "Draft", value: STATUSLIST.DRAFT },
|
|
182
|
+
{ id: STATUSLIST.ACTIVE, label: "Active", value: STATUSLIST.ACTIVE },
|
|
183
|
+
{ id: STATUSLIST.INACTIVE, label: "Inactive", value: STATUSLIST.INACTIVE },
|
|
184
|
+
{ id: STATUSLIST.SCHEDULE, label: "Scheduled", value: STATUSLIST.SCHEDULE },
|
|
185
|
+
];
|
|
186
|
+
const currencyOptions = [
|
|
187
|
+
{ id: 1, label: 'USD', value: 1 },
|
|
188
|
+
{ id: 2, label: 'EUR', value: 2 },
|
|
189
|
+
{ id: 3, label: 'CAD', value: 3 }
|
|
190
|
+
];
|
|
191
|
+
const booleanOptions = [
|
|
192
|
+
{ id: 1, label: 'True', value: true },
|
|
193
|
+
{ id: 2, label: 'False', value: false },
|
|
194
|
+
];
|
|
13
195
|
exports.conditionsList = [
|
|
14
|
-
{ name: "contains all of", datatypes: ["boolean"
|
|
15
|
-
{ name: "contains any of ", datatypes: ["string"
|
|
196
|
+
{ name: "contains all of", datatypes: ["boolean"], code: "1" },
|
|
197
|
+
{ name: "contains any of ", datatypes: ["string"], code: "2" },
|
|
16
198
|
{ name: "doesn’t contain all of ", datatypes: ["boolean"], code: "3" },
|
|
17
199
|
{ name: "doesn’t contain any of", datatypes: ["string"], code: "4" },
|
|
18
200
|
{ name: "ends with any of", datatypes: ["string"], code: "5" },
|
|
@@ -37,12 +219,72 @@ exports.conditionsList = [
|
|
|
37
219
|
{ name: "is equal to all of", datatypes: ["boolean"], code: "24" },
|
|
38
220
|
{ name: "is equal to any of", datatypes: ["string"], code: "25" }
|
|
39
221
|
];
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
CLIENT_SIDE: "clientSide",
|
|
222
|
+
const toasterStates = {
|
|
223
|
+
success: "success-tick-mark",
|
|
224
|
+
error: "info-circle"
|
|
44
225
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
226
|
+
const defaultOptionValueColumn = { order: 1, labelName: "", value: "", upload: "", actions: "" };
|
|
227
|
+
const brandOrderType = [{ id: 0, label: "Price", dataType: 'integer' }, { id: 1, label: "Alphabetical", dataType: 'string' }];
|
|
228
|
+
const columnSortTypes = [{ id: 1, label: "Low - High", sortId: 1, dataType: "integer" }, { id: 2, label: "High - Low", sortId: 2, dataType: "integer" }, { id: 3, label: "A - Z", sortId: 1, dataType: "string" }, { id: 4, label: "Z - A", sortId: 2, dataType: "string" }, { id: 5, sortId: 1, label: "Min -Max", dataType: "date" }, { id: 6, sortId: 2, label: "Max - Min", dataType: "date" }];
|
|
229
|
+
const optionSetInitValues = {
|
|
230
|
+
name: '',
|
|
231
|
+
status: { id: 1, label: "Draft" },
|
|
232
|
+
code: '',
|
|
233
|
+
description: '',
|
|
234
|
+
optionIDList: [],
|
|
235
|
+
};
|
|
236
|
+
const columnSortOptions = {
|
|
237
|
+
numberOption: [
|
|
238
|
+
{
|
|
239
|
+
id: 1, name: 'High - Low', icon: 'arrow-down',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
id: 2, name: 'Low - High', icon: 'arrow-up'
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
stringOption: [
|
|
246
|
+
{
|
|
247
|
+
id: 3, name: 'A - Z', icon: 'arrow-down',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: 4, name: 'Z - A', icon: 'arrow-up'
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
};
|
|
254
|
+
const daysOptions = [
|
|
255
|
+
{ id: 1, label: "Days", value: 1 },
|
|
256
|
+
{ id: 2, label: "Months", value: 2 },
|
|
257
|
+
{ id: 3, label: "Years", value: 3 },
|
|
258
|
+
];
|
|
259
|
+
const currencies = [
|
|
260
|
+
{ id: 1, name: "USD", value: 1 },
|
|
261
|
+
{ id: 2, name: "EUR", value: 2 },
|
|
262
|
+
{ id: 3, name: "GBP", value: 3 },
|
|
263
|
+
{ id: 4, name: "JPY", value: 4 },
|
|
264
|
+
{ id: 5, name: "CAD", value: 5 },
|
|
265
|
+
{ id: 6, name: "AUD", value: 6 },
|
|
266
|
+
{ id: 7, name: "NZD", value: 7 },
|
|
267
|
+
];
|
|
268
|
+
const constants = {
|
|
269
|
+
daysOptions,
|
|
270
|
+
maxCodeLength,
|
|
271
|
+
maxNameLength,
|
|
272
|
+
statusWithSchedueList,
|
|
273
|
+
columnSortOptions,
|
|
274
|
+
optionSetInitValues,
|
|
275
|
+
columnSortTypes,
|
|
276
|
+
defaultOptionValueColumn,
|
|
277
|
+
conditionsList: exports.conditionsList,
|
|
278
|
+
statusList,
|
|
279
|
+
brandOrderType,
|
|
280
|
+
toasterStates,
|
|
281
|
+
imageOptions,
|
|
282
|
+
fileOptions,
|
|
283
|
+
currencyOptions,
|
|
284
|
+
setUpPriceOptions,
|
|
285
|
+
booleanOptions,
|
|
286
|
+
maxSortInputLength,
|
|
287
|
+
minSortInputLength,
|
|
288
|
+
currencies
|
|
289
|
+
};
|
|
290
|
+
exports.default = constants;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const checkbox_1 = require("primereact/checkbox");
|
|
6
|
+
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
4
7
|
const GridCheckBOx = ({ checked, onChange, isInterminate }) => {
|
|
5
8
|
console.log(isInterminate, 'is interminat status in checkbox');
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { icon: isInterminate && (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "minus-square" }), onChange: onChange, checked: checked })
|
|
10
|
+
// <input
|
|
11
|
+
// type="checkbox"
|
|
12
|
+
// checked={checked}
|
|
13
|
+
// onChange={onChange}
|
|
14
|
+
// />
|
|
15
|
+
);
|
|
7
16
|
};
|
|
8
17
|
exports.default = GridCheckBOx;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SortType } from "./Types";
|
|
2
2
|
export declare const COLUMN_SORT_OPTIONS: SortType[];
|
|
3
|
-
export declare const conditionsList: Operation[];
|
|
4
3
|
export declare const ROWMODELTYPE: {
|
|
5
4
|
INFINITE: string;
|
|
6
5
|
SERVER_SIDE: string;
|
|
@@ -10,3 +9,84 @@ export declare const BLOCK_SIZE = 100;
|
|
|
10
9
|
export declare const MAX_BLOCKS = 2;
|
|
11
10
|
export declare const DEBOUNCE_INTERVAL = 200;
|
|
12
11
|
export declare const ROW_HEIGHT = 60;
|
|
12
|
+
declare const DEFAULTGUID = "000000000000000000000000";
|
|
13
|
+
declare enum DEFAULTS {
|
|
14
|
+
CURRENCY = 1,
|
|
15
|
+
DATEFORMAT = 2,
|
|
16
|
+
LANGUAGE = 3,
|
|
17
|
+
TIMEFORMAT = 7,
|
|
18
|
+
TIMEZONE = 8
|
|
19
|
+
}
|
|
20
|
+
declare enum CATEGORYTYPE {
|
|
21
|
+
static = 1,
|
|
22
|
+
dynamic = 2
|
|
23
|
+
}
|
|
24
|
+
declare enum PRICINGTYPE {
|
|
25
|
+
PRODUCTDISCOUNT = 1,
|
|
26
|
+
PERCENTAGEDISCOUNT = 2,
|
|
27
|
+
FIXEDDISCOUNT = 3,
|
|
28
|
+
FIXEDPRICE = 4,
|
|
29
|
+
FIXEDPOINTS = 5,
|
|
30
|
+
NODISCOUNT = 6
|
|
31
|
+
}
|
|
32
|
+
declare enum BUNDLEQUANTITYTYPE {
|
|
33
|
+
ANY = 1,
|
|
34
|
+
FIXED = 2,
|
|
35
|
+
RANGE = 3
|
|
36
|
+
}
|
|
37
|
+
declare enum STATUSLIST {
|
|
38
|
+
DRAFT = 1,
|
|
39
|
+
ACTIVE = 2,
|
|
40
|
+
INACTIVE = 3,
|
|
41
|
+
DELETED = 4,
|
|
42
|
+
SCHEDULE = 5
|
|
43
|
+
}
|
|
44
|
+
declare enum BUNDLETYPE {
|
|
45
|
+
PRODUCT = 1,
|
|
46
|
+
CATEGORY = 2
|
|
47
|
+
}
|
|
48
|
+
declare enum PRODUCTDISCOUNTTYPE {
|
|
49
|
+
VALUE = 1,
|
|
50
|
+
PERCENTAGE = 2
|
|
51
|
+
}
|
|
52
|
+
export declare enum PRODUCTTYPE {
|
|
53
|
+
SIMPLE = 1,
|
|
54
|
+
CONFIGURABLE = 2,
|
|
55
|
+
GIFTCARD = 3,
|
|
56
|
+
DIGITAL = 4
|
|
57
|
+
}
|
|
58
|
+
export interface StatusType {
|
|
59
|
+
id: number;
|
|
60
|
+
label: string;
|
|
61
|
+
value: number;
|
|
62
|
+
}
|
|
63
|
+
declare enum IMAGETYPES {
|
|
64
|
+
JPG = 1,
|
|
65
|
+
JPEG = 2,
|
|
66
|
+
PNG = 3,
|
|
67
|
+
GIF = 4,
|
|
68
|
+
TIFF = 5,
|
|
69
|
+
BMP = 6,
|
|
70
|
+
WEBP = 7,
|
|
71
|
+
AVIF = 8
|
|
72
|
+
}
|
|
73
|
+
declare enum FILEEXTENSIONTYPE {
|
|
74
|
+
DOC = 1,
|
|
75
|
+
DOCX = 2,
|
|
76
|
+
PDF = 3,
|
|
77
|
+
XLS = 4,
|
|
78
|
+
XLSX = 5,
|
|
79
|
+
PPT = 6,
|
|
80
|
+
PPTX = 7,
|
|
81
|
+
TXT = 8,
|
|
82
|
+
RTF = 9,
|
|
83
|
+
CSV = 10
|
|
84
|
+
}
|
|
85
|
+
declare enum SETUPPRICEOPTIONS {
|
|
86
|
+
EVERYTIME = 1,
|
|
87
|
+
ONLYFORNEW = 2
|
|
88
|
+
}
|
|
89
|
+
export declare const conditionsList: any;
|
|
90
|
+
declare const constants: any;
|
|
91
|
+
export { PRODUCTDISCOUNTTYPE, CATEGORYTYPE, DEFAULTGUID, BUNDLEQUANTITYTYPE, BUNDLETYPE, PRICINGTYPE, SETUPPRICEOPTIONS, STATUSLIST, IMAGETYPES, FILEEXTENSIONTYPE, DEFAULTS };
|
|
92
|
+
export default constants;
|