sccoreui 5.9.63 → 5.9.65
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.js +3 -2
- package/dist/components/list-box-dropdown/list-box-dropdown.js +12 -7
- package/dist/pages/aggrid/AgGrid.js +257 -0
- package/dist/pages/aggrid/BulkAction.js +7 -0
- package/dist/pages/aggrid/id-cell.js +9 -0
- package/dist/pages/avatar/avatar.js +338 -0
- package/dist/pages/badges/badge.js +73 -0
- package/dist/pages/breadcrumb/breadcrumb.js +14 -0
- package/dist/pages/button/button.js +10 -0
- package/dist/pages/button-group/button-group.js +10 -0
- package/dist/pages/chart/chart.js +257 -0
- package/dist/pages/checkbox/checkbox.js +26 -0
- package/dist/pages/checkbox-group/checkbox-group-component.js +21 -0
- package/dist/pages/color-picker/color-picker.js +13 -0
- package/dist/pages/content-dividers/content-dividers.js +11 -0
- package/dist/pages/custom-color-picker/custom-color-picker.js +12 -0
- package/dist/pages/custom-multiselect/CustomMultiSelect.js +33 -0
- package/dist/pages/date-picker/date-picker.js +20 -0
- package/dist/pages/dropdown/dropdown-component.js +39 -0
- package/dist/pages/file-upload/file-upload.js +34 -0
- package/dist/pages/flex.js +15 -0
- package/dist/pages/formulaTemplate/formulaTemplate.js +154 -0
- package/dist/pages/frolaTextEditor/froala-text-editor.js +12 -0
- package/dist/pages/home.js +48 -0
- package/dist/pages/input/input-text.js +112 -0
- package/dist/pages/list-box-dropdown/listboxdropdown.js +55 -0
- package/dist/pages/loader-indicator/loader-indicator.js +10 -0
- package/dist/pages/mega-mennu/mega-menu.js +84 -0
- package/dist/pages/multi-select-dropdown/multi-select-dropdown.js +51 -0
- package/dist/pages/not-found/not-found.js +10 -0
- package/dist/pages/paginator/pagination.js +122 -0
- package/dist/pages/progress-bar/progress-bar.js +27 -0
- package/dist/pages/progress-steps/progress-steps.js +24 -0
- package/dist/pages/radio-button/radio-button-component.js +11 -0
- package/dist/pages/shadows/shadows.js +7 -0
- package/dist/pages/slideout-menus/slideout-menus.js +104 -0
- package/dist/pages/sliders/slider.js +39 -0
- package/dist/pages/tabels/table-data.js +2193 -0
- package/dist/pages/tabels/table.js +98 -0
- package/dist/pages/tabs/tabs.js +9 -0
- package/dist/pages/tags/tags.js +70 -0
- package/dist/pages/toast/toast.js +47 -0
- package/dist/pages/toggle/toggle.js +10 -0
- package/dist/pages/tooltip/tooltip.js +13 -0
- package/dist/pages/treeDropdownSelect/treedropdowselect.js +34 -0
- package/dist/pages/types/type.js +2 -0
- package/dist/types/pages/aggrid/AgGrid.d.ts +2 -0
- package/dist/types/pages/aggrid/BulkAction.d.ts +2 -0
- package/dist/types/pages/aggrid/id-cell.d.ts +2 -0
- package/dist/types/pages/avatar/avatar.d.ts +2 -0
- package/dist/types/pages/badges/badge.d.ts +3 -0
- package/dist/types/pages/breadcrumb/breadcrumb.d.ts +2 -0
- package/dist/types/pages/button/button.d.ts +2 -0
- package/dist/types/pages/button-group/button-group.d.ts +2 -0
- package/dist/types/pages/chart/chart.d.ts +2 -0
- package/dist/types/pages/checkbox/checkbox.d.ts +2 -0
- package/dist/types/pages/checkbox-group/checkbox-group-component.d.ts +3 -0
- package/dist/types/pages/color-picker/color-picker.d.ts +2 -0
- package/dist/types/pages/content-dividers/content-dividers.d.ts +2 -0
- package/dist/types/pages/custom-color-picker/custom-color-picker.d.ts +2 -0
- package/dist/types/pages/custom-multiselect/CustomMultiSelect.d.ts +2 -0
- package/dist/types/pages/date-picker/date-picker.d.ts +2 -0
- package/dist/types/pages/dropdown/dropdown-component.d.ts +2 -0
- package/dist/types/pages/file-upload/file-upload.d.ts +3 -0
- package/dist/types/pages/flex.d.ts +2 -0
- package/dist/types/pages/formulaTemplate/formulaTemplate.d.ts +2 -0
- package/dist/types/pages/frolaTextEditor/froala-text-editor.d.ts +2 -0
- package/dist/types/pages/home.d.ts +2 -0
- package/dist/types/pages/input/input-text.d.ts +3 -0
- package/dist/types/pages/list-box-dropdown/listboxdropdown.d.ts +2 -0
- package/dist/types/pages/loader-indicator/loader-indicator.d.ts +3 -0
- package/dist/types/pages/mega-mennu/mega-menu.d.ts +2 -0
- package/dist/types/pages/multi-select-dropdown/multi-select-dropdown.d.ts +2 -0
- package/dist/types/pages/not-found/not-found.d.ts +2 -0
- package/dist/types/pages/paginator/pagination.d.ts +2 -0
- package/dist/types/pages/progress-bar/progress-bar.d.ts +3 -0
- package/dist/types/pages/progress-steps/progress-steps.d.ts +2 -0
- package/dist/types/pages/radio-button/radio-button-component.d.ts +2 -0
- package/dist/types/pages/shadows/shadows.d.ts +2 -0
- package/dist/types/pages/slideout-menus/slideout-menus.d.ts +2 -0
- package/dist/types/pages/sliders/slider.d.ts +1 -0
- package/dist/types/pages/tabels/table-data.d.ts +3 -0
- package/dist/types/pages/tabels/table.d.ts +2 -0
- package/dist/types/pages/tabs/tabs.d.ts +3 -0
- package/dist/types/pages/tags/tags.d.ts +3 -0
- package/dist/types/pages/toast/toast.d.ts +2 -0
- package/dist/types/pages/toggle/toggle.d.ts +2 -0
- package/dist/types/pages/tooltip/tooltip.d.ts +2 -0
- package/dist/types/pages/treeDropdownSelect/treedropdowselect.d.ts +2 -0
- package/dist/types/pages/types/type.d.ts +64 -0
- package/package.json +1 -1
package/dist/App.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
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");
|
|
4
5
|
// import Home from './pages/home';
|
|
5
6
|
require("./App.scss");
|
|
6
|
-
|
|
7
|
+
const home_1 = tslib_1.__importDefault(require("./pages/home"));
|
|
7
8
|
const App = () => {
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)("div", {}));
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(home_1.default, {}) }) }));
|
|
9
10
|
};
|
|
10
11
|
exports.default = App;
|
|
@@ -15,6 +15,9 @@ const ListBoxDropdown = ({ selectAll, onSelectAll, onChange, footeTemplate, head
|
|
|
15
15
|
const optionsMenuRef = (0, react_1.useRef)();
|
|
16
16
|
const [checked, setChecked] = (0, react_1.useState)(false);
|
|
17
17
|
const onSelectOption = (e) => {
|
|
18
|
+
setChecked(e.value.length === listItems.length);
|
|
19
|
+
console.log(e.value.length);
|
|
20
|
+
console.log(listItems.length);
|
|
18
21
|
setSelectedItems(e.value);
|
|
19
22
|
onChange(e);
|
|
20
23
|
};
|
|
@@ -59,25 +62,27 @@ const ListBoxDropdown = ({ selectAll, onSelectAll, onChange, footeTemplate, head
|
|
|
59
62
|
// e.preventDefault()
|
|
60
63
|
// }
|
|
61
64
|
const onSelectAllItem = (e) => {
|
|
62
|
-
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
setChecked(!checked);
|
|
63
67
|
if (onSelectAll)
|
|
64
|
-
onSelectAll(
|
|
65
|
-
e.preventDefault();
|
|
68
|
+
onSelectAll(!checked);
|
|
66
69
|
};
|
|
67
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: className }, { children: [(0, jsx_runtime_1.jsx)(menu_1.Menu, { onShow: (e) => onShow && onShow(e), onHide: (e) => onHide && onHide(e), onFocus: (e) => onFocus && onFocus(e), popup: true, className: menuClassName ? menuClassName : "",
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: className }, { children: [(0, jsx_runtime_1.jsx)(menu_1.Menu, { onShow: (e) => onShow && onShow(e), onHide: (e) => onHide && onHide(e), onFocus: (e) => onFocus && onFocus(e), popup: true, ref: optionsMenuRef, id: "popup_menu_bottom", className: menuClassName ? menuClassName : "",
|
|
71
|
+
// ref={optionsMenuRef}
|
|
72
|
+
model: [
|
|
68
73
|
{
|
|
69
74
|
template: () => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: listBoxParentClassName
|
|
70
75
|
? listBoxParentClassName +
|
|
71
76
|
" list_box_dropdown border-round-lg border-1 overflow-hidden border-gray-200"
|
|
72
|
-
: "list_box_dropdown" }, { children: [headerTemplate && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: headerTemplate() }),
|
|
77
|
+
: "list_box_dropdown" }, { children: [headerTemplate && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: headerTemplate() }), (0, jsx_runtime_1.jsxs)(button_1.Button, Object.assign({ type: "button", onClick: (e) => onSelectAllItem(e),
|
|
73
78
|
// onClick={() => {
|
|
74
79
|
// if (onSelectAll) onSelectAll();
|
|
75
80
|
// }}
|
|
76
|
-
className: "text-primary-400 bg-white pt-0 px-2 flex gap-2 align-items-center w-full font-semibold absolute z-4 text-left focus:shadow-none", style: { top: "10em" }, link: true }, { children: [(0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { checked: checked
|
|
81
|
+
className: "text-primary-400 bg-white pt-0 px-2 flex gap-2 align-items-center w-full font-semibold absolute z-4 text-left focus:shadow-none", style: { top: "10em" }, link: true }, { children: [(0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { checked: checked }), " ", (0, jsx_runtime_1.jsx)("span", { children: checked ? "Select All" : "Unselect All" })] })), (0, jsx_runtime_1.jsx)(listbox_1.ListBox, { itemTemplate: (option) => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: optionTemplate ? (optionTemplate(option)) : ((0, jsx_runtime_1.jsx)("span", { children: option[`${optionLabel}`] })) })), listClassName: `${listClassName ? listClassName : " h-18rem overflow-auto "} ${selectAll && " mt-8 pt-2"}`, filter: filter ? true : false, multiple: multiple ? true : false, value: selectedItems, onChange: (e) => onSelectOption(e), options: listItems, optionLabel: optionLabel, className: `${listBoxclassName
|
|
77
82
|
? listBoxclassName
|
|
78
83
|
: "w-16rem border-none "} `, filterPlaceholder: filterPlaceholder ? filterPlaceholder : "" }), footeTemplate && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: footeTemplate() })] }))),
|
|
79
84
|
},
|
|
80
|
-
] }), !showChips ? ((0, jsx_runtime_1.jsx)(button_1.Button, { type: "button", className: `list_box_button focus:shadow-none p-0 h-max h-auto p-0 mx-2 ${buttonClassName}`, link: link ? true : false, icon: labelIcon ? labelIcon : "", size: labelIconSize ? labelIconSize : "", iconPos: labelIconPos ? labelIconPos : "", label: label, onClick: (event) => optionsMenuRef.current.toggle(event) })) : ((0, jsx_runtime_1.jsxs)("ul", Object.assign({ className: `pl-0 grid row-gap-2 list_box_chips ${chipsParentClassName}` }, { children: [(0, jsx_runtime_1.jsx)("li", Object.assign({ className: `cursor-pointer min-w-max mx-2 max-w-max ${buttonClassName}` }, { children: (0, jsx_runtime_1.jsx)(button_1.Button, { type: "button", className: `list_box_button focus:shadow-none p-0 h-max h-auto mx-2`, link: link ? true : false, icon: labelIcon ? labelIcon : "", size: labelIconSize ? labelIconSize : "", iconPos: labelIconPos ? labelIconPos : "", label: label, onClick: (event) => optionsMenuRef.current.toggle(event) }) })), selectedItems &&
|
|
85
|
+
] }), !showChips ? ((0, jsx_runtime_1.jsx)(button_1.Button, { type: "button", className: `list_box_button focus:shadow-none p-0 h-max h-auto p-0 mx-2 ${buttonClassName}`, link: link ? true : false, icon: labelIcon ? labelIcon : "", size: labelIconSize ? labelIconSize : "", iconPos: labelIconPos ? labelIconPos : "", label: label, onClick: (event) => optionsMenuRef.current.toggle(event) })) : ((0, jsx_runtime_1.jsxs)("ul", Object.assign({ className: `pl-0 grid row-gap-2 list_box_chips ${chipsParentClassName}` }, { children: [(0, jsx_runtime_1.jsx)("li", Object.assign({ className: `cursor-pointer min-w-max mx-2 max-w-max ${buttonClassName}` }, { children: (0, jsx_runtime_1.jsx)(button_1.Button, { type: "button", className: `list_box_button focus:shadow-none p-0 h-max h-auto mx-2`, 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 }) })), selectedItems &&
|
|
81
86
|
(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map((item, index) => {
|
|
82
87
|
var _a, _b;
|
|
83
88
|
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: `${chipClassName
|
|
@@ -0,0 +1,257 @@
|
|
|
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 parent_for_grid_1 = tslib_1.__importDefault(require("../../components/ag-grid/parent-for-grid"));
|
|
7
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
8
|
+
const Types_1 = require("../../components/ag-grid/Types");
|
|
9
|
+
// import IdCell from "./id-cell";
|
|
10
|
+
const constants_1 = require("../../components/ag-grid/constants");
|
|
11
|
+
// import { Dropdown } from "primereact/dropdown";
|
|
12
|
+
const custom_dropdown_1 = tslib_1.__importDefault(require("../../components/ag-grid/custom-dropdown"));
|
|
13
|
+
const BulkAction_1 = tslib_1.__importDefault(require("./BulkAction"));
|
|
14
|
+
// import { ATTRIBUTEDATATYPES } from "../../components/ag-grid/constants";
|
|
15
|
+
const AgGridPage = () => {
|
|
16
|
+
const [rowData, setRowData] = (0, react_1.useState)([]);
|
|
17
|
+
const [shouldRefetch, setShouldRefetch] = (0, react_1.useState)(false);
|
|
18
|
+
const [defaultFilters, setDefaultFilters] = (0, react_1.useState)([]);
|
|
19
|
+
const deleteComponent = () => {
|
|
20
|
+
return (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("button", Object.assign({ className: "bg-white", onClick: () => setShouldRefetch(true) }, { children: "Delete" })) });
|
|
21
|
+
};
|
|
22
|
+
const noRowsOverlayComponent = () => {
|
|
23
|
+
return (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("p", { children: "No Rows, message from products" }) });
|
|
24
|
+
};
|
|
25
|
+
const [columnDefs] = (0, react_1.useState)([
|
|
26
|
+
{
|
|
27
|
+
pinned: "left",
|
|
28
|
+
lockPosition: "left",
|
|
29
|
+
cellClass: "lock-pinned",
|
|
30
|
+
suppressMovable: true,
|
|
31
|
+
enableHeaderCheckbox: true,
|
|
32
|
+
enableChildCheckbox: true,
|
|
33
|
+
id: "101",
|
|
34
|
+
headerName: "ID",
|
|
35
|
+
field: "id",
|
|
36
|
+
isSortable: false,
|
|
37
|
+
code: 1,
|
|
38
|
+
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
39
|
+
editable: true,
|
|
40
|
+
isFilterable: false,
|
|
41
|
+
cellStyle: { borderRight: "1px solid #ccc" },
|
|
42
|
+
cellRendererSelector: (params) => {
|
|
43
|
+
if (params.node.rowPinned) {
|
|
44
|
+
return {
|
|
45
|
+
component: custom_dropdown_1.default,
|
|
46
|
+
params: {
|
|
47
|
+
style: { color: "#5577CC" },
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
lockPinned: true,
|
|
58
|
+
id: "102",
|
|
59
|
+
headerName: "Title",
|
|
60
|
+
cellRendererSelector: (params) => {
|
|
61
|
+
if (params.node.rowPinned) {
|
|
62
|
+
return {
|
|
63
|
+
component: custom_dropdown_1.default,
|
|
64
|
+
params: {
|
|
65
|
+
style: { color: "#5577CC" },
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
field: "name",
|
|
74
|
+
isSortable: true,
|
|
75
|
+
code: 1,
|
|
76
|
+
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
77
|
+
editable: false,
|
|
78
|
+
isFilterable: false,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
lockPinned: true,
|
|
82
|
+
id: "103",
|
|
83
|
+
headerName: "Body",
|
|
84
|
+
field: "body",
|
|
85
|
+
isSortable: true,
|
|
86
|
+
code: 1,
|
|
87
|
+
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
88
|
+
editable: false,
|
|
89
|
+
isFilterable: true,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
lockPinned: true,
|
|
93
|
+
id: "103",
|
|
94
|
+
headerName: "Status",
|
|
95
|
+
field: "status",
|
|
96
|
+
isSortable: true,
|
|
97
|
+
columnType: "single",
|
|
98
|
+
options: [
|
|
99
|
+
{ id: constants_1.STATUSLIST.DRAFT, label: "Draft", value: constants_1.STATUSLIST.DRAFT },
|
|
100
|
+
{ id: constants_1.STATUSLIST.ACTIVE, label: "Active", value: constants_1.STATUSLIST.ACTIVE },
|
|
101
|
+
{
|
|
102
|
+
id: constants_1.STATUSLIST.INACTIVE,
|
|
103
|
+
label: "Inactive",
|
|
104
|
+
value: constants_1.STATUSLIST.INACTIVE,
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
code: 1,
|
|
108
|
+
dataType: Types_1.ATTRIBUTEDATATYPES.BOOLEAN,
|
|
109
|
+
editable: false,
|
|
110
|
+
isFilterable: true,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
pinned: "right",
|
|
114
|
+
lockPosition: "rigth",
|
|
115
|
+
cellClass: "lock-pinned",
|
|
116
|
+
cellRendererSelector: (params) => {
|
|
117
|
+
if (params.node.rowPinned) {
|
|
118
|
+
return () => null;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
return { component: deleteComponent };
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
]);
|
|
126
|
+
// const [selectedCity, setSelectedCity] = useState(null);
|
|
127
|
+
const pinnedTopRowData = (0, react_1.useMemo)(() => {
|
|
128
|
+
return [
|
|
129
|
+
{ id: "1",
|
|
130
|
+
name: "nitesh",
|
|
131
|
+
body: "working out"
|
|
132
|
+
}
|
|
133
|
+
];
|
|
134
|
+
}, []);
|
|
135
|
+
// Remove items from - button
|
|
136
|
+
const removeItem = (checkboxSelectionDetails) => {
|
|
137
|
+
const unSelectedData = checkboxSelectionDetails === null || checkboxSelectionDetails === void 0 ? void 0 : checkboxSelectionDetails.excludedRecords;
|
|
138
|
+
const selectedData = checkboxSelectionDetails === null || checkboxSelectionDetails === void 0 ? void 0 : checkboxSelectionDetails.includedRecords;
|
|
139
|
+
const isIternminite = checkboxSelectionDetails === null || checkboxSelectionDetails === void 0 ? void 0 : checkboxSelectionDetails.isIndeterminate;
|
|
140
|
+
console.log(checkboxSelectionDetails, 'coming in remove item products');
|
|
141
|
+
let updatedRowData = [];
|
|
142
|
+
if (isIternminite) {
|
|
143
|
+
updatedRowData = unSelectedData;
|
|
144
|
+
}
|
|
145
|
+
else if ((selectedData === null || selectedData === void 0 ? void 0 : selectedData.length) && !(isIternminite)) {
|
|
146
|
+
const childIds = new Set(selectedData === null || selectedData === void 0 ? void 0 : selectedData.map(child => child.id));
|
|
147
|
+
updatedRowData = rowData.filter(parent => !childIds.has(parent.id));
|
|
148
|
+
}
|
|
149
|
+
console.log(updatedRowData, 'result data from remove items in products');
|
|
150
|
+
return updatedRowData;
|
|
151
|
+
};
|
|
152
|
+
const getCheckedRows = (checkedRows) => {
|
|
153
|
+
console.log(checkedRows, 'checked rows in products');
|
|
154
|
+
};
|
|
155
|
+
const getRowData = (startRow, endRow, featureDetails) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
156
|
+
console.log(featureDetails, 'feature details in page for filter queries');
|
|
157
|
+
const features = featureDetails;
|
|
158
|
+
// const conditionToRemoveItem = features.checkBoxSelection.allBoxChecked || features.checkBoxSelection.isIndeterminate || features.checkBoxSelection.includedRecords.length || features.checkBoxSelection.excludedRecords.length
|
|
159
|
+
if (featureDetails.isRemoveClicked) {
|
|
160
|
+
const result = removeItem(features.checkBoxSelection);
|
|
161
|
+
const output = {
|
|
162
|
+
totalRecords: result.length,
|
|
163
|
+
rowData: result
|
|
164
|
+
};
|
|
165
|
+
return yield output;
|
|
166
|
+
}
|
|
167
|
+
let totalRecords = 500;
|
|
168
|
+
const serverSideUrl = `https://jsonplaceholder.typicode.com/comments?_start=${startRow}&_end=${endRow}`;
|
|
169
|
+
const clientSideUrl = "https://jsonplaceholder.typicode.com/comments?_limit=20";
|
|
170
|
+
console.log(serverSideUrl, clientSideUrl);
|
|
171
|
+
const result = yield axios_1.default.get(serverSideUrl);
|
|
172
|
+
result.data[2].isSelected = true;
|
|
173
|
+
const outputData = result === null || result === void 0 ? void 0 : result.data.map((item) => {
|
|
174
|
+
item.status = "Active";
|
|
175
|
+
return item;
|
|
176
|
+
});
|
|
177
|
+
let output = {
|
|
178
|
+
totalRecords: totalRecords,
|
|
179
|
+
rowData: outputData
|
|
180
|
+
};
|
|
181
|
+
if (featureDetails.searchedText === "data") {
|
|
182
|
+
output = {
|
|
183
|
+
totalRecords: 0,
|
|
184
|
+
rowData: []
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
setRowData(result.data);
|
|
188
|
+
setShouldRefetch(false);
|
|
189
|
+
return output;
|
|
190
|
+
});
|
|
191
|
+
const style = {
|
|
192
|
+
height: "100vh",
|
|
193
|
+
width: "100%"
|
|
194
|
+
};
|
|
195
|
+
const conditionsToDisplay = {
|
|
196
|
+
displayFilter: true,
|
|
197
|
+
displaySort: true,
|
|
198
|
+
displaySearch: true,
|
|
199
|
+
displayRefresh: true,
|
|
200
|
+
displayRemoveItems: true,
|
|
201
|
+
displayBulkAction: true,
|
|
202
|
+
enableViewCreate: true
|
|
203
|
+
};
|
|
204
|
+
console.log(pinnedTopRowData, defaultFilters);
|
|
205
|
+
const createView = (viewDetails) => {
|
|
206
|
+
console.log(viewDetails, 'parsed value for create view');
|
|
207
|
+
};
|
|
208
|
+
const selectFilter = () => {
|
|
209
|
+
const defaultFilters = [
|
|
210
|
+
{
|
|
211
|
+
columnName: {
|
|
212
|
+
name: "Body",
|
|
213
|
+
code: "body",
|
|
214
|
+
dataType: "string",
|
|
215
|
+
},
|
|
216
|
+
condition: 5,
|
|
217
|
+
value: "data",
|
|
218
|
+
id: "0.028544677566825438",
|
|
219
|
+
isActive: true,
|
|
220
|
+
logicalOperator: 1, // number
|
|
221
|
+
},
|
|
222
|
+
];
|
|
223
|
+
setShouldRefetch(true);
|
|
224
|
+
setDefaultFilters(defaultFilters);
|
|
225
|
+
};
|
|
226
|
+
const dynamicText = {
|
|
227
|
+
filterModelText: {
|
|
228
|
+
header: "Filter",
|
|
229
|
+
subHeader: "Streamline Your Search With Filters",
|
|
230
|
+
resetFilterAction: "Reset Filter",
|
|
231
|
+
createViewInputPlaceHolder: "Enter",
|
|
232
|
+
createViewAction: "Create View",
|
|
233
|
+
applyAction: "Apply",
|
|
234
|
+
elementOnePlaceHolder: "Select",
|
|
235
|
+
elementTwoPlaceHolder: "Select",
|
|
236
|
+
elementThreePlaceHolder_Input: "Enter Text",
|
|
237
|
+
elementThreePlaceHolder_Input_Number: "Enter Number",
|
|
238
|
+
elementThreePlaceHolder_DropDown: "Select",
|
|
239
|
+
elementThreePlaceHolder_MultiSelect: "Select",
|
|
240
|
+
elementThreePlaceHolder_Calender: "Select Date",
|
|
241
|
+
onSelectedFilter: "Selected"
|
|
242
|
+
},
|
|
243
|
+
sortModelText: {
|
|
244
|
+
header: "Column Sorting",
|
|
245
|
+
clearAction: "Clear",
|
|
246
|
+
applyAction: "Apply",
|
|
247
|
+
onSelectedSort: "Selected"
|
|
248
|
+
},
|
|
249
|
+
recordDetailModelText: {
|
|
250
|
+
totalRecordHeader: "Total Records"
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("button", Object.assign({ onClick: selectFilter }, { children: "Select Filter" })), (0, jsx_runtime_1.jsx)(parent_for_grid_1.default, { columnData: columnDefs, style: style, getRowData: getRowData, conditionsToDisplay: conditionsToDisplay, rowModelType: constants_1.ROWMODELTYPE.INFINITE,
|
|
254
|
+
// pinnedTopRowData={pinnedTopRowData}
|
|
255
|
+
bulkActionComponent: BulkAction_1.default, getCheckedRows: getCheckedRows, shouldRefetch: shouldRefetch, noRowsOverlayComponent: noRowsOverlayComponent, defaultFilters: defaultFilters, createView: createView, dynamicText: dynamicText, sortOptions: constants_1.COLUMN_SORT_OPTIONS, filterConditions: [{ id: 1, label: "AND" }, { id: 2, label: "OR" }] })] }));
|
|
256
|
+
};
|
|
257
|
+
exports.default = AgGridPage;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
function IdCell(data) {
|
|
5
|
+
var _a;
|
|
6
|
+
console.log(data.row, 'data from grid');
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (_a = data.row) === null || _a === void 0 ? void 0 : _a.id }));
|
|
8
|
+
}
|
|
9
|
+
exports.default = IdCell;
|