sccoreui 6.4.54 → 6.4.56
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/App.scss +1 -1
- package/dist/assets/sccoreui.css +3 -1
- package/dist/components/ag-grid/helper.js +43 -23
- package/dist/components/ag-grid/parent-for-grid.js +14 -4
- package/dist/components/form/form-fields/form-fields.js +2 -2
- package/dist/components/list-box-dropdown/list-box-dropdown.js +2 -2
- package/dist/components/list-box-dropdown/virtualization-component.js +1 -1
- package/dist/components/multi-select-dropdown/multi-select-dropdown.js +7 -6
- package/dist/types/components/ag-grid/helper.d.ts +2 -2
- package/dist/types/components/types/type.d.ts +2 -0
- package/package.json +1 -1
package/dist/App.scss
CHANGED
package/dist/assets/sccoreui.css
CHANGED
|
@@ -1909,7 +1909,9 @@ a {
|
|
|
1909
1909
|
background: transparent;
|
|
1910
1910
|
transition: box-shadow 0.2s;
|
|
1911
1911
|
border-radius: 4px !important;
|
|
1912
|
-
|
|
1912
|
+
&:not(:last-child) {
|
|
1913
|
+
margin-bottom: 2px;
|
|
1914
|
+
}
|
|
1913
1915
|
}
|
|
1914
1916
|
.p-multiselect-panel .p-multiselect-items .p-multiselect-item.p-highlight {
|
|
1915
1917
|
background: var(--gray-50);
|
|
@@ -62,21 +62,30 @@ const sortColumns = (columns) => {
|
|
|
62
62
|
};
|
|
63
63
|
exports.sortColumns = sortColumns;
|
|
64
64
|
// Give checkbox checked status
|
|
65
|
-
const getCheckedStatus = (row, featureDetails, GRID_CHECKBOX_STATUS
|
|
65
|
+
const getCheckedStatus = (row, featureDetails, GRID_CHECKBOX_STATUS) => {
|
|
66
66
|
const { allBoxChecked, excludedRecords, includedRecords, headerCheckBoxStatus, } = featureDetails.checkBoxSelection;
|
|
67
67
|
if (allBoxChecked) {
|
|
68
68
|
return !excludedRecords.includes(row);
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
|
+
if (excludedRecords.some((y) => y.id === row.id)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
71
74
|
if (headerCheckBoxStatus === GRID_CHECKBOX_STATUS.NEUTRAL &&
|
|
72
75
|
(row === null || row === void 0 ? void 0 : row.isSelected)) {
|
|
73
|
-
if (!includedRecords.includes(row)) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
// if (!includedRecords.includes(row)) {
|
|
77
|
+
// // includedRecords.push(row);
|
|
78
|
+
// // setFeatureDetails((prev) => ({
|
|
79
|
+
// // ...prev,
|
|
80
|
+
// // checkBoxSelection: {
|
|
81
|
+
// // ...prev.checkBoxSelection,
|
|
82
|
+
// // includedRecords: [...includedRecords],
|
|
83
|
+
// // },
|
|
84
|
+
// // }));
|
|
85
|
+
// }
|
|
77
86
|
return true;
|
|
78
87
|
}
|
|
79
|
-
return includedRecords.
|
|
88
|
+
return includedRecords.some((y) => y.id === row.id);
|
|
80
89
|
}
|
|
81
90
|
};
|
|
82
91
|
exports.getCheckedStatus = getCheckedStatus;
|
|
@@ -227,7 +236,7 @@ exports.autoGroupColumnDef = autoGroupColumnDef;
|
|
|
227
236
|
// depending on whether all checkboxes are checked or not (`allBoxChecked` state)
|
|
228
237
|
const updateRecords = (rowData, featureDetails, gridData) => {
|
|
229
238
|
var _a, _b, _c;
|
|
230
|
-
const { excludedRecords, includedRecords, allBoxChecked } = featureDetails.checkBoxSelection;
|
|
239
|
+
const { excludedRecords, includedRecords, allBoxChecked, headerCheckBoxStatus } = featureDetails.checkBoxSelection;
|
|
231
240
|
let newExcludedRecords = [...excludedRecords];
|
|
232
241
|
let newIncludedRecords = [...includedRecords];
|
|
233
242
|
// When all checkboxes are checked
|
|
@@ -248,17 +257,24 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
248
257
|
// When not all checkboxes are checked
|
|
249
258
|
else {
|
|
250
259
|
// Update included records: add or remove the current rowData
|
|
251
|
-
|
|
252
|
-
|
|
260
|
+
if (includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.some((row) => row.id === rowData.id)) {
|
|
261
|
+
newIncludedRecords = includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.filter((item) => {
|
|
253
262
|
if ((item === null || item === void 0 ? void 0 : item.id) !== (rowData === null || rowData === void 0 ? void 0 : rowData.id)) {
|
|
254
|
-
return
|
|
263
|
+
return true;
|
|
255
264
|
}
|
|
256
265
|
else {
|
|
257
|
-
rowData
|
|
266
|
+
newExcludedRecords.push(rowData); // Set isSelected to false if removing the row
|
|
258
267
|
return false; // Exclude this item from the new array
|
|
259
268
|
}
|
|
260
|
-
})
|
|
261
|
-
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
else if (rowData.isSelected) {
|
|
272
|
+
newExcludedRecords = [...newExcludedRecords, Object.assign(Object.assign({}, rowData), { isSelected: false })];
|
|
273
|
+
rowData.isSelected = !rowData.isSelected;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
newIncludedRecords = [...includedRecords, rowData];
|
|
277
|
+
}
|
|
262
278
|
// Check if all records are included; reset if so
|
|
263
279
|
if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_b = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
264
280
|
return {
|
|
@@ -266,6 +282,7 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
266
282
|
includedRecords: [],
|
|
267
283
|
isIndeterminate: false,
|
|
268
284
|
allBoxChecked: true,
|
|
285
|
+
headerCheckBoxStatus: constants_1.GRID_CHECKBOX_STATUS.CHECKED,
|
|
269
286
|
};
|
|
270
287
|
}
|
|
271
288
|
// Check if all records are excluded; reset if so
|
|
@@ -274,7 +291,7 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
274
291
|
}
|
|
275
292
|
// Otherwise, update the included records
|
|
276
293
|
else {
|
|
277
|
-
return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { includedRecords: newIncludedRecords });
|
|
294
|
+
return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { headerCheckBoxStatus: headerCheckBoxStatus === constants_1.GRID_CHECKBOX_STATUS.UNCHECKED ? constants_1.GRID_CHECKBOX_STATUS.NEUTRAL : headerCheckBoxStatus, includedRecords: newIncludedRecords, excludedRecords: newExcludedRecords });
|
|
278
295
|
}
|
|
279
296
|
}
|
|
280
297
|
};
|
|
@@ -563,17 +580,20 @@ const getGroupIds = (gridRef) => {
|
|
|
563
580
|
return { firstGroupIds, secondGroupIds };
|
|
564
581
|
};
|
|
565
582
|
exports.getGroupIds = getGroupIds;
|
|
566
|
-
const handleCheckboxClick = (e, params, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns) => {
|
|
567
|
-
var
|
|
583
|
+
const handleCheckboxClick = (e, params, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns, serverSideRowLeveSelection) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
584
|
+
var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
568
585
|
const isChecked = e.checked;
|
|
569
586
|
const { data: rowData } = params;
|
|
570
587
|
// Update checkbox data and set the updated state
|
|
571
|
-
const updatedCheckBoxData = (0, exports.updateRecords)(rowData, featureDetails, gridData);
|
|
572
|
-
|
|
573
|
-
|
|
588
|
+
const updatedCheckBoxData = yield (0, exports.updateRecords)(rowData, featureDetails, gridData);
|
|
589
|
+
const checkBoxObject = Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: updatedCheckBoxData });
|
|
590
|
+
console.log(updatedCheckBoxData, "updatedCheckBoxData");
|
|
591
|
+
selectColumns && selectColumns(checkBoxObject);
|
|
592
|
+
yield setFeatureDetails(checkBoxObject);
|
|
593
|
+
yield serverSideRowLeveSelection(checkBoxObject);
|
|
574
594
|
// Gather parent and super parent group data for condition checks
|
|
575
|
-
const parentGroupData = (
|
|
576
|
-
const superParentData = (
|
|
595
|
+
const parentGroupData = (_k = (_j = (_h = params === null || params === void 0 ? void 0 : params.node) === null || _h === void 0 ? void 0 : _h.parent) === null || _j === void 0 ? void 0 : _j.childrenAfterGroup) === null || _k === void 0 ? void 0 : _k.map((childNode) => childNode === null || childNode === void 0 ? void 0 : childNode.data);
|
|
596
|
+
const superParentData = (_p = (_o = (_m = (_l = params === null || params === void 0 ? void 0 : params.node) === null || _l === void 0 ? void 0 : _l.parent) === null || _m === void 0 ? void 0 : _m.parent) === null || _o === void 0 ? void 0 : _o.allLeafChildren) === null || _p === void 0 ? void 0 : _p.map((children) => children === null || children === void 0 ? void 0 : children.data);
|
|
577
597
|
// Determine if all or any parent groups are included/excluded
|
|
578
598
|
const isEveryParentGroupInclude = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => {
|
|
579
599
|
var _a;
|
|
@@ -604,8 +624,8 @@ const handleCheckboxClick = (e, params, featureDetails, gridData, setFeatureDeta
|
|
|
604
624
|
// Determine the conditions to update group state
|
|
605
625
|
const conditions = (0, exports.determineConditions)(isChecked, updatedCheckBoxData.allBoxChecked, isEveryParentGroupInclude, isEverySuperParentGroupInclude, isSomeParentGroupExcluded, isSomeSuperParentGroupExcluded);
|
|
606
626
|
// Update group state based on determined conditions
|
|
607
|
-
(0, exports.updateGroupState)(groupingColumns, (
|
|
608
|
-
};
|
|
627
|
+
(0, exports.updateGroupState)(groupingColumns, (_r = (_q = params === null || params === void 0 ? void 0 : params.node) === null || _q === void 0 ? void 0 : _q.parent) === null || _r === void 0 ? void 0 : _r.id, (_u = (_t = (_s = params === null || params === void 0 ? void 0 : params.node) === null || _s === void 0 ? void 0 : _s.parent) === null || _t === void 0 ? void 0 : _t.parent) === null || _u === void 0 ? void 0 : _u.id, conditions, setSelectedGroup);
|
|
628
|
+
});
|
|
609
629
|
exports.handleCheckboxClick = handleCheckboxClick;
|
|
610
630
|
const deepClone = (obj) => {
|
|
611
631
|
var _a, _b, _c;
|
|
@@ -15,7 +15,7 @@ const group_checkbox_1 = tslib_1.__importDefault(require("./group-checkbox"));
|
|
|
15
15
|
const utilComponents_1 = require("./utilComponents");
|
|
16
16
|
function ParentForGrid(props) {
|
|
17
17
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
18
|
-
const { gridProps = {}, gridViewTemplate, selectColumns = () => { }, enableCheckboxForGroupHeader = false } = props;
|
|
18
|
+
const { gridProps = {}, gridViewTemplate, selectColumns = () => { }, enableCheckboxForGroupHeader = false, serverSideSelectRow } = props;
|
|
19
19
|
const [gridData, setGridData] = (0, react_1.useState)({
|
|
20
20
|
rowData: (props === null || props === void 0 ? void 0 : props.rowData) || [],
|
|
21
21
|
columnData: (0, helper_1.sortColumns)(props === null || props === void 0 ? void 0 : props.columnData),
|
|
@@ -78,6 +78,15 @@ function ParentForGrid(props) {
|
|
|
78
78
|
sortable: false,
|
|
79
79
|
};
|
|
80
80
|
}, []);
|
|
81
|
+
const emptyIncludedRecords = (objectData) => {
|
|
82
|
+
const obj = Object.assign(Object.assign({}, objectData), { checkBoxSelection: Object.assign(Object.assign({}, objectData.checkBoxSelection), { includedRecords: [], kl: "kl" }) });
|
|
83
|
+
setFeatureDetails(obj);
|
|
84
|
+
};
|
|
85
|
+
const serverSideRowLeveSelection = (object) => {
|
|
86
|
+
if (serverSideSelectRow) {
|
|
87
|
+
serverSideSelectRow(object, (objectData) => emptyIncludedRecords(objectData));
|
|
88
|
+
}
|
|
89
|
+
};
|
|
81
90
|
// Function to handle header checkbox click event
|
|
82
91
|
const handleHeaderCheckbox = () => {
|
|
83
92
|
// get the group and subgroupids
|
|
@@ -94,7 +103,8 @@ function ParentForGrid(props) {
|
|
|
94
103
|
else {
|
|
95
104
|
setSelectedGroup([]);
|
|
96
105
|
}
|
|
97
|
-
selectColumns(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
|
|
106
|
+
selectColumns && selectColumns(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
|
|
107
|
+
serverSideRowLeveSelection(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
|
|
98
108
|
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
|
|
99
109
|
};
|
|
100
110
|
// JSX for rendering checkbox in header
|
|
@@ -115,8 +125,8 @@ function ParentForGrid(props) {
|
|
|
115
125
|
var _a, _b;
|
|
116
126
|
const { data } = params;
|
|
117
127
|
// const { allBoxChecked, excludedRecords, includedRecords } = featureDetails.checkBoxSelection;
|
|
118
|
-
const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS
|
|
119
|
-
return ((0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: isChecked, disabled: ((_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a.tagged) || false, onChange: (e) => (0, helper_1.handleCheckboxClick)(e, params, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns), isIndeterminate: false, shouldRenderOnRight: (_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayCheckboxOnRight }));
|
|
128
|
+
const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS);
|
|
129
|
+
return ((0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: isChecked, disabled: ((_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a.tagged) || false, onChange: (e) => (0, helper_1.handleCheckboxClick)(e, params, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns, serverSideRowLeveSelection), isIndeterminate: false, shouldRenderOnRight: (_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayCheckboxOnRight }));
|
|
120
130
|
};
|
|
121
131
|
// Callback to products for getting data
|
|
122
132
|
const getData = (startRow, endRow, currentFeatures, params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -32,14 +32,14 @@ const InputNumberField = (props) => {
|
|
|
32
32
|
} })), (errors === null || errors === void 0 ? void 0 : errors[name]) && (touched === null || touched === void 0 ? void 0 : touched[name]) ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors === null || errors === void 0 ? void 0 : errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) }))] })) })));
|
|
33
33
|
};
|
|
34
34
|
const InputCurrencyField = (props) => {
|
|
35
|
-
const { errors, spanClassName, touched, name, length, label, placeholder, optional, setFieldValue, useGrouping = false, min, max, maxLength, className, validate, disabled, isLoading, inputNumberProps = {}, isRequired = false, value, } = props;
|
|
35
|
+
const { errors, spanClassName, touched, name, length, label, placeholder, optional, setFieldValue, useGrouping = false, min, max, maxLength, className, validate, disabled, isLoading, inputNumberProps = {}, isRequired = false, value, currenyIcon } = props;
|
|
36
36
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column" }, { children: !isLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [optional && ((0, jsx_runtime_1.jsxs)("label", Object.assign({ className: "font-medium text-base mb-1 w-full flex justify-content-between", htmlFor: name }, { children: [label, (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-base font-medium font-italic text-gray-600" }, { children: "Optional" }))] }))), !optional && (
|
|
37
37
|
// <label className="font-medium text-base mb-1" htmlFor={name}>
|
|
38
38
|
// {label}
|
|
39
39
|
// </label>
|
|
40
40
|
(0, jsx_runtime_1.jsx)(FieldLabel_1.default, { value: value, label: label, error: errors === null || errors === void 0 ? void 0 : errors[name], touched: touched === null || touched === void 0 ? void 0 : touched[name], isRequired: isRequired })), (0, jsx_runtime_1.jsx)(formik_1.Field, Object.assign({ name: name, errors: errors, touched: touched, validate: validate }, { children: ({ field }) => {
|
|
41
41
|
const { value, name } = field;
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: `${spanClassName} p-input-icon-left form_field` }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix text-lg text-gray-600 font-normal" }, { children: "$" })), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ name: name, value: value, "aria-autocomplete": "none", minFractionDigits: 2, disabled: disabled, min: min, max: max, maxLength: maxLength, onValueChange: (e) => setFieldValue(name, e.value !== null ? e.value : min), maxFractionDigits: 2, placeholder: placeholder, className: ` customNumberField ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name, useGrouping: useGrouping }, inputNumberProps))] })));
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: `${spanClassName} p-input-icon-left form_field` }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix text-lg text-gray-600 font-normal" }, { children: currenyIcon ? currenyIcon : "$" })), (0, jsx_runtime_1.jsx)(inputnumber_1.InputNumber, Object.assign({ name: name, value: value, "aria-autocomplete": "none", minFractionDigits: 2, disabled: disabled, min: min, max: max, maxLength: maxLength, onValueChange: (e) => setFieldValue(name, e.value !== null ? e.value : min), maxFractionDigits: 2, placeholder: placeholder, className: ` customNumberField ${errors[name] && touched[name] ? "p-invalid" : ""} ${length === "full" ? "full_form_field" : "form_field"} ${className}`, id: name, useGrouping: useGrouping }, inputNumberProps))] })));
|
|
43
43
|
} })), (errors === null || errors === void 0 ? void 0 : errors[name]) && (touched === null || touched === void 0 ? void 0 : touched[name]) ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: errors === null || errors === void 0 ? void 0 : errors[name] }) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) })))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "16px", className: "mb-1 w-5rem" }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: `${className ? className : "form_field"} ` }, { children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px" }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "errorField flex align-items-center text-sm" }, { children: (0, jsx_runtime_1.jsx)("span", { children: "\u00A0" }) }))] })) })));
|
|
44
44
|
};
|
|
45
45
|
const InputTextAreaField = (props) => {
|
|
@@ -12,7 +12,7 @@ const virtualization_component_1 = tslib_1.__importDefault(require("./virtualiza
|
|
|
12
12
|
// import { Checkbox } from "primereact/checkbox";
|
|
13
13
|
const ListBoxDropdown = (props) => {
|
|
14
14
|
const boxRef = (0, react_1.useRef)();
|
|
15
|
-
const { selectAll,
|
|
15
|
+
const { selectAll, disabled = false,
|
|
16
16
|
// onSelectAll,
|
|
17
17
|
onSelectionChange, onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className, scrollElementId, optionsMenuRef = boxRef,
|
|
18
18
|
// buttonClassName,
|
|
@@ -158,7 +158,7 @@ const ListBoxDropdown = (props) => {
|
|
|
158
158
|
? emptyFilterMessage
|
|
159
159
|
: "No Results Found", emptyMessage: emptyMessage ? emptyMessage : "No Data Found" })), footeTemplate && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: footeTemplate() })] }))),
|
|
160
160
|
},
|
|
161
|
-
] }), !showChips ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !dataLabel ? ((0, jsx_runtime_1.jsx)(button_1.Button, { type: "button", className: `list_box_btn ${type === "sectionHeader" ? "section_btn" : ""}`, link: link ? true : false, icon: labelIcon ? labelIcon : "", size: labelIconSize ? labelIconSize : "", iconPos: labelIconPos ? labelIconPos : "", label: label, onClick: (event) => optionsMenuRef.current.toggle(event), title: label })) : ((0, jsx_runtime_1.jsx)(button_1.Button, { type: "button", icon: labelIcon ? labelIcon : "", size: labelIconSize ? labelIconSize : "", iconPos: labelIconPos ? labelIconPos : "", label: label, onClick: (event) => optionsMenuRef.current.toggle(event), "aria-controls": "popup_menu_right", "aria-haspopup": true, ref: buttonRef, className: "data_label", title: dataLabel })) })) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-wrap gap-2" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: `list_box_btn ${type === "sectionHeader" ? "section_btn" : ""}`, link: link ? true : false, icon: labelIcon ? labelIcon : "", size: labelIconSize ? labelIconSize : "", iconPos: labelIconPos ? labelIconPos : "", label: label, onClick: (event) => optionsMenuRef.current.toggle(event), "aria-controls": "popup_menu_right", "aria-haspopup": true, ref: buttonRef, title: label }), (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: `list_box_chips ${chipsParentClassName}` }, { children: selectedItems &&
|
|
161
|
+
] }), !showChips ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !dataLabel ? ((0, jsx_runtime_1.jsx)(button_1.Button, { type: "button", className: `list_box_btn ${type === "sectionHeader" ? "section_btn" : ""}`, link: link ? true : false, icon: labelIcon ? labelIcon : "", size: labelIconSize ? labelIconSize : "", iconPos: labelIconPos ? labelIconPos : "", label: label, onClick: (event) => optionsMenuRef.current.toggle(event), title: label, disabled: disabled })) : ((0, jsx_runtime_1.jsx)(button_1.Button, { type: "button", icon: labelIcon ? labelIcon : "", size: labelIconSize ? labelIconSize : "", iconPos: labelIconPos ? labelIconPos : "", label: label, onClick: (event) => optionsMenuRef.current.toggle(event), "aria-controls": "popup_menu_right", "aria-haspopup": true, ref: buttonRef, className: "data_label", title: dataLabel, disabled: disabled })) })) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex flex-wrap gap-2" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: `list_box_btn ${type === "sectionHeader" ? "section_btn" : ""}`, link: link ? true : false, icon: labelIcon ? labelIcon : "", size: labelIconSize ? labelIconSize : "", iconPos: labelIconPos ? labelIconPos : "", label: label, onClick: (event) => optionsMenuRef.current.toggle(event), "aria-controls": "popup_menu_right", "aria-haspopup": true, ref: buttonRef, title: label, type: "button", disabled: disabled }), (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: `list_box_chips ${chipsParentClassName}` }, { children: selectedItems &&
|
|
162
162
|
(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map((item, index) => {
|
|
163
163
|
var _a, _b, _c, _d;
|
|
164
164
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isDraggable !== undefined ? ((0, jsx_runtime_1.jsx)("li", Object.assign({ draggable: isDraggable, onDragStart: (e) => handleDragStart(e, index), onDragOver: (e) => handleDragOver(e), onDrop: (e) => handleDrop(e, index), className: `select-none ${chipClassName ? chipClassName : "list_box_chip"} ${showRemoveIcon ? "relative text-gray-700" : ""}` }, { children: chipTemplate ? (chipTemplate(item)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-truncate max-w-10rem inline-block", title: typeof item === "object"
|
|
@@ -116,7 +116,7 @@ function RowVirtualizerDynamic(props) {
|
|
|
116
116
|
position: "relative",
|
|
117
117
|
}, className: `${data.length === 0
|
|
118
118
|
? "flex-column flex justify-content-around align-items-center h-full w-full"
|
|
119
|
-
: ""}` }, { children:
|
|
119
|
+
: ""}` }, { children: loading && (data === null || data === void 0 ? void 0 : data.length) === 0 ? ((0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "p-listbox-list w-full h-full" }, { children: renderSkeletons() }))) : (data === null || data === void 0 ? void 0 : data.length) === 0 ? (debouncedValue && debouncedValue !== "" ? ((0, jsx_runtime_1.jsx)("span", { children: emptyFilterMessage })) : ((0, jsx_runtime_1.jsx)("span", { children: emptyMessage }))) : ((0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "p-listbox-list", style: {
|
|
120
120
|
position: "absolute",
|
|
121
121
|
top: 0,
|
|
122
122
|
left: 0,
|
|
@@ -7,6 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
const multiselect_1 = require("primereact/multiselect");
|
|
8
8
|
const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
|
|
9
9
|
const MultiSelectDropDown = (props) => {
|
|
10
|
+
const { multiSelectExtraProps = {} } = props;
|
|
10
11
|
const [items, setItems] = (0, react_1.useState)([]);
|
|
11
12
|
const [isMoreThanOne, setIsMoreThenOne] = (0, react_1.useState)(false);
|
|
12
13
|
const LeftSection = () => {
|
|
@@ -43,24 +44,24 @@ const MultiSelectDropDown = (props) => {
|
|
|
43
44
|
};
|
|
44
45
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [props.dropdownType === "withIcon" && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `sc_custom_multiselect flex align-items-center relative ${props.className} ${isMoreThanOne
|
|
45
46
|
? `selected_multile ${`selected_num_` + (items === null || items === void 0 ? void 0 : items.length)}`
|
|
46
|
-
: ""}` }, { children: [(0, jsx_runtime_1.jsx)(LeftSection, {}), (0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, { panelClassName: `Multi_select_dropdown_panel panel_${props.dropdownType} ${props.panelClassName} ${props.hidePanelHeader !== undefined ? "hidePanelHeader" : ""}`, value: items, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, style: {
|
|
47
|
+
: ""}` }, { children: [(0, jsx_runtime_1.jsx)(LeftSection, {}), (0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, Object.assign({ panelClassName: `Multi_select_dropdown_panel panel_${props.dropdownType} ${props.panelClassName} ${props.hidePanelHeader !== undefined ? "hidePanelHeader" : ""}`, value: items, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, style: {
|
|
47
48
|
minWidth: props.dropdownWidth ? props.dropdownWidth + "px" : "",
|
|
48
49
|
maxWidth: props.dropdownWidth ? props.dropdownWidth + "px" : "",
|
|
49
50
|
}, className: `w-full ${props.maxWidth ? `${"optionBodyMaxWidth_" + props.maxWidth}` : ""}`, panelStyle: {
|
|
50
51
|
width: props.panelWidth ? props.panelWidth + "px" : "",
|
|
51
|
-
} }), (items === null || items === void 0 ? void 0 : items.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [isMoreThanOne && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "selected_moreThan_one absolute z-5" }, { children: [" ", "+", (items === null || items === void 0 ? void 0 : items.length) - props.maxSelectedLabels] }))), props.clear && clearIcon()] })))] }))), props.dropdownType === "default" && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `sc_custom_multiselect flex align-items-center relative ${props.className} ${props.icon !== undefined ? "left_icon" : "no_icon"} ${isMoreThanOne
|
|
52
|
+
} }, multiSelectExtraProps)), (items === null || items === void 0 ? void 0 : items.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [isMoreThanOne && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "selected_moreThan_one absolute z-5" }, { children: [" ", "+", (items === null || items === void 0 ? void 0 : items.length) - props.maxSelectedLabels] }))), props.clear && clearIcon()] })))] }))), props.dropdownType === "default" && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `sc_custom_multiselect flex align-items-center relative ${props.className} ${props.icon !== undefined ? "left_icon" : "no_icon"} ${isMoreThanOne
|
|
52
53
|
? `selected_multile ${`selected_num_` + (items === null || items === void 0 ? void 0 : items.length)}`
|
|
53
|
-
: ""}` }, { children: [props.icon !== undefined && (0, jsx_runtime_1.jsx)(LeftSection, {}), (0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, { panelClassName: `Multi_select_dropdown_panel panel_${props.dropdownType} ${props.panelClassName} ${props.hidePanelHeader !== undefined ? "hidePanelHeader" : ""}`, value: items, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, style: {
|
|
54
|
+
: ""}` }, { children: [props.icon !== undefined && (0, jsx_runtime_1.jsx)(LeftSection, {}), (0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, Object.assign({ panelClassName: `Multi_select_dropdown_panel panel_${props.dropdownType} ${props.panelClassName} ${props.hidePanelHeader !== undefined ? "hidePanelHeader" : ""}`, value: items, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, style: {
|
|
54
55
|
minWidth: props.dropdownWidth ? props.dropdownWidth + "px" : "",
|
|
55
56
|
maxWidth: props.dropdownWidth ? props.dropdownWidth + "px" : "",
|
|
56
57
|
}, className: `w-full`, panelStyle: {
|
|
57
58
|
width: props.panelWidth ? props.panelWidth + "px" : "",
|
|
58
|
-
} }), (items === null || items === void 0 ? void 0 : items.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [isMoreThanOne && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "selected_moreThan_one absolute z-5" }, { children: [" ", "+", (items === null || items === void 0 ? void 0 : items.length) - props.maxSelectedLabels] }))), props.clear && clearIcon()] })))] }))), (props === null || props === void 0 ? void 0 : props.dropdownType) === "status" && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `sc_custom_multiselect flex align-items-center relative status_dropdown ${(items === null || items === void 0 ? void 0 : items.length) > 2 ? "mutli_select_status" : ""} ${props.className} ${(items === null || items === void 0 ? void 0 : items.length) > 3 ? "moreThanThreeItems" : ""}` }, { children: [(0, jsx_runtime_1.jsx)(LeftSection, {}), (0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, { panelClassName: `Multi_select_dropdown_panel panel_${props.dropdownType} ${props.panelClassName} ${props.hidePanelHeader !== undefined ? "hidePanelHeader" : ""}`, value: items, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", itemTemplate: (option) => itemTemplate(option), filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, style: {
|
|
59
|
+
} }, multiSelectExtraProps)), (items === null || items === void 0 ? void 0 : items.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [isMoreThanOne && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "selected_moreThan_one absolute z-5" }, { children: [" ", "+", (items === null || items === void 0 ? void 0 : items.length) - props.maxSelectedLabels] }))), props.clear && clearIcon()] })))] }))), (props === null || props === void 0 ? void 0 : props.dropdownType) === "status" && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `sc_custom_multiselect flex align-items-center relative status_dropdown ${(items === null || items === void 0 ? void 0 : items.length) > 2 ? "mutli_select_status" : ""} ${props.className} ${(items === null || items === void 0 ? void 0 : items.length) > 3 ? "moreThanThreeItems" : ""}` }, { children: [(0, jsx_runtime_1.jsx)(LeftSection, {}), (0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, Object.assign({ panelClassName: `Multi_select_dropdown_panel panel_${props.dropdownType} ${props.panelClassName} ${props.hidePanelHeader !== undefined ? "hidePanelHeader" : ""}`, value: items, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", itemTemplate: (option) => itemTemplate(option), filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, style: {
|
|
59
60
|
minWidth: props.dropdownWidth ? props.dropdownWidth + "px" : "",
|
|
60
61
|
maxWidth: props.dropdownWidth ? props.dropdownWidth + "px" : "",
|
|
61
62
|
}, className: `w-full`, panelStyle: {
|
|
62
63
|
width: props.panelWidth ? props.panelWidth + "px" : "",
|
|
63
|
-
} }), (items === null || items === void 0 ? void 0 : items.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [isMoreThanOne && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "selected_moreThan_one absolute z-5" }, { children: [" ", "+", (items === null || items === void 0 ? void 0 : items.length) - props.maxSelectedLabels] }))), props.clear && clearIcon()] })))] }))), (props === null || props === void 0 ? void 0 : props.dropdownType) === "" && ((0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, { value: items, panelClassName: `Multi_select_dropdown_panel ${props.panelClassName} ${props.hidePanelHeader !== undefined ? "hidePanelHeader" : ""}`, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, style: {
|
|
64
|
+
} }, multiSelectExtraProps)), (items === null || items === void 0 ? void 0 : items.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [isMoreThanOne && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: "selected_moreThan_one absolute z-5" }, { children: [" ", "+", (items === null || items === void 0 ? void 0 : items.length) - props.maxSelectedLabels] }))), props.clear && clearIcon()] })))] }))), (props === null || props === void 0 ? void 0 : props.dropdownType) === "" && ((0, jsx_runtime_1.jsx)(multiselect_1.MultiSelect, Object.assign({ value: items, panelClassName: `Multi_select_dropdown_panel ${props.panelClassName} ${props.hidePanelHeader !== undefined ? "hidePanelHeader" : ""}`, onChange: (e) => onChange(e), options: props.options, optionLabel: "name", filter: true, placeholder: props.placeholder, display: "chip", maxSelectedLabels: props.maxSelectedLabels, style: {
|
|
64
65
|
minWidth: props.dropdownWidth ? props.dropdownWidth + "px" : "",
|
|
65
66
|
maxWidth: props.dropdownWidth ? props.dropdownWidth + "px" : "",
|
|
66
67
|
},
|
|
@@ -69,7 +70,7 @@ const MultiSelectDropDown = (props) => {
|
|
|
69
70
|
width: props.panelWidth ? props.panelWidth + "px" : "",
|
|
70
71
|
}, emptyFilterMessage: props.emptyFilterMessage
|
|
71
72
|
? props.emptyFilterMessage
|
|
72
|
-
: "No Results Found", filterPlaceholder: props.filterPlaceholder ? props.filterPlaceholder : "Search by name" }))] }));
|
|
73
|
+
: "No Results Found", filterPlaceholder: props.filterPlaceholder ? props.filterPlaceholder : "Search by name" }, multiSelectExtraProps)))] }));
|
|
73
74
|
};
|
|
74
75
|
exports.MultiSelectDropDown = MultiSelectDropDown;
|
|
75
76
|
exports.default = exports.MultiSelectDropDown;
|
|
@@ -5,7 +5,7 @@ export declare const isComponentDisable: (state?: string) => boolean;
|
|
|
5
5
|
export declare const applyDefaultFilters: (defaultFilters: any) => any;
|
|
6
6
|
export declare const parseIfNeeded: (value: any) => any;
|
|
7
7
|
export declare const sortColumns: (columns: any) => any;
|
|
8
|
-
export declare const getCheckedStatus: (row: any, featureDetails: any, GRID_CHECKBOX_STATUS: any
|
|
8
|
+
export declare const getCheckedStatus: (row: any, featureDetails: any, GRID_CHECKBOX_STATUS: any) => any;
|
|
9
9
|
export declare const updateCells: (updatedRowData: any, setUpdateRowData: any, api: any) => void;
|
|
10
10
|
export declare const fillOperation: (params: any, api: any, editedRecords: any, setEditedRecords: any) => Promise<void>;
|
|
11
11
|
export declare const autoGroupColumnDef: (isTreeEnable: boolean, headerName: string, groupField: string, GroupHeaderComponent: React.FC, headerCheckboxRenderer: React.FC, enableCheckboxForGroupHeader: boolean, displayGroupCount: boolean, rowGroupColumnWidth: number, ChildRendererForGroup?: React.FC, HeaderRendererForGroup?: React.FC) => {
|
|
@@ -51,5 +51,5 @@ export declare const getGroupIds: (gridRef: any) => {
|
|
|
51
51
|
firstGroupIds: string[];
|
|
52
52
|
secondGroupIds: string[];
|
|
53
53
|
};
|
|
54
|
-
export declare const handleCheckboxClick: (e: any, params: any, featureDetails: any, gridData: any, setFeatureDetails: any, groupingColumns: any, setSelectedGroup: any, selectColumns: any) => void
|
|
54
|
+
export declare const handleCheckboxClick: (e: any, params: any, featureDetails: any, gridData: any, setFeatureDetails: any, groupingColumns: any, setSelectedGroup: any, selectColumns: any, serverSideRowLeveSelection: any) => Promise<void>;
|
|
55
55
|
export declare const deepClone: (obj: any) => any;
|
|
@@ -125,6 +125,7 @@ export interface NumberFieldProps {
|
|
|
125
125
|
inputNumberProps?: any;
|
|
126
126
|
isRequired?: boolean;
|
|
127
127
|
value?: any;
|
|
128
|
+
currenyIcon?: string;
|
|
128
129
|
}
|
|
129
130
|
export interface TextAreaFieldProps {
|
|
130
131
|
errors: any;
|
|
@@ -270,6 +271,7 @@ export interface ListBoxDropdownTypes {
|
|
|
270
271
|
virtualScroll?: boolean;
|
|
271
272
|
onSelectionChange?: (data: any) => void;
|
|
272
273
|
fetchData?: (data: any) => void;
|
|
274
|
+
disabled?: boolean;
|
|
273
275
|
}
|
|
274
276
|
export interface DatePickerTypes {
|
|
275
277
|
value: any;
|