sccoreui 5.9.63 → 5.9.64

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.
Files changed (91) hide show
  1. package/dist/components/list-box-dropdown/list-box-dropdown.js +25 -8
  2. package/dist/pages/aggrid/AgGrid.js +257 -0
  3. package/dist/pages/aggrid/BulkAction.js +7 -0
  4. package/dist/pages/aggrid/id-cell.js +9 -0
  5. package/dist/pages/avatar/avatar.js +338 -0
  6. package/dist/pages/badges/badge.js +73 -0
  7. package/dist/pages/breadcrumb/breadcrumb.js +14 -0
  8. package/dist/pages/button/button.js +10 -0
  9. package/dist/pages/button-group/button-group.js +10 -0
  10. package/dist/pages/chart/chart.js +257 -0
  11. package/dist/pages/checkbox/checkbox.js +26 -0
  12. package/dist/pages/checkbox-group/checkbox-group-component.js +21 -0
  13. package/dist/pages/color-picker/color-picker.js +13 -0
  14. package/dist/pages/content-dividers/content-dividers.js +11 -0
  15. package/dist/pages/custom-color-picker/custom-color-picker.js +12 -0
  16. package/dist/pages/custom-multiselect/CustomMultiSelect.js +33 -0
  17. package/dist/pages/date-picker/date-picker.js +20 -0
  18. package/dist/pages/dropdown/dropdown-component.js +39 -0
  19. package/dist/pages/file-upload/file-upload.js +34 -0
  20. package/dist/pages/flex.js +15 -0
  21. package/dist/pages/formulaTemplate/formulaTemplate.js +154 -0
  22. package/dist/pages/frolaTextEditor/froala-text-editor.js +12 -0
  23. package/dist/pages/home.js +48 -0
  24. package/dist/pages/input/input-text.js +112 -0
  25. package/dist/pages/list-box-dropdown/listboxdropdown.js +55 -0
  26. package/dist/pages/loader-indicator/loader-indicator.js +10 -0
  27. package/dist/pages/mega-mennu/mega-menu.js +84 -0
  28. package/dist/pages/multi-select-dropdown/multi-select-dropdown.js +51 -0
  29. package/dist/pages/not-found/not-found.js +10 -0
  30. package/dist/pages/paginator/pagination.js +122 -0
  31. package/dist/pages/progress-bar/progress-bar.js +27 -0
  32. package/dist/pages/progress-steps/progress-steps.js +24 -0
  33. package/dist/pages/radio-button/radio-button-component.js +11 -0
  34. package/dist/pages/shadows/shadows.js +7 -0
  35. package/dist/pages/slideout-menus/slideout-menus.js +104 -0
  36. package/dist/pages/sliders/slider.js +39 -0
  37. package/dist/pages/tabels/table-data.js +2193 -0
  38. package/dist/pages/tabels/table.js +98 -0
  39. package/dist/pages/tabs/tabs.js +9 -0
  40. package/dist/pages/tags/tags.js +70 -0
  41. package/dist/pages/toast/toast.js +47 -0
  42. package/dist/pages/toggle/toggle.js +10 -0
  43. package/dist/pages/tooltip/tooltip.js +13 -0
  44. package/dist/pages/treeDropdownSelect/treedropdowselect.js +34 -0
  45. package/dist/pages/types/type.js +2 -0
  46. package/dist/types/components/list-box-dropdown/list-box-dropdown.d.ts +1 -1
  47. package/dist/types/pages/aggrid/AgGrid.d.ts +2 -0
  48. package/dist/types/pages/aggrid/BulkAction.d.ts +2 -0
  49. package/dist/types/pages/aggrid/id-cell.d.ts +2 -0
  50. package/dist/types/pages/avatar/avatar.d.ts +2 -0
  51. package/dist/types/pages/badges/badge.d.ts +3 -0
  52. package/dist/types/pages/breadcrumb/breadcrumb.d.ts +2 -0
  53. package/dist/types/pages/button/button.d.ts +2 -0
  54. package/dist/types/pages/button-group/button-group.d.ts +2 -0
  55. package/dist/types/pages/chart/chart.d.ts +2 -0
  56. package/dist/types/pages/checkbox/checkbox.d.ts +2 -0
  57. package/dist/types/pages/checkbox-group/checkbox-group-component.d.ts +3 -0
  58. package/dist/types/pages/color-picker/color-picker.d.ts +2 -0
  59. package/dist/types/pages/content-dividers/content-dividers.d.ts +2 -0
  60. package/dist/types/pages/custom-color-picker/custom-color-picker.d.ts +2 -0
  61. package/dist/types/pages/custom-multiselect/CustomMultiSelect.d.ts +2 -0
  62. package/dist/types/pages/date-picker/date-picker.d.ts +2 -0
  63. package/dist/types/pages/dropdown/dropdown-component.d.ts +2 -0
  64. package/dist/types/pages/file-upload/file-upload.d.ts +3 -0
  65. package/dist/types/pages/flex.d.ts +2 -0
  66. package/dist/types/pages/formulaTemplate/formulaTemplate.d.ts +2 -0
  67. package/dist/types/pages/frolaTextEditor/froala-text-editor.d.ts +2 -0
  68. package/dist/types/pages/home.d.ts +2 -0
  69. package/dist/types/pages/input/input-text.d.ts +3 -0
  70. package/dist/types/pages/list-box-dropdown/listboxdropdown.d.ts +2 -0
  71. package/dist/types/pages/loader-indicator/loader-indicator.d.ts +3 -0
  72. package/dist/types/pages/mega-mennu/mega-menu.d.ts +2 -0
  73. package/dist/types/pages/multi-select-dropdown/multi-select-dropdown.d.ts +2 -0
  74. package/dist/types/pages/not-found/not-found.d.ts +2 -0
  75. package/dist/types/pages/paginator/pagination.d.ts +2 -0
  76. package/dist/types/pages/progress-bar/progress-bar.d.ts +3 -0
  77. package/dist/types/pages/progress-steps/progress-steps.d.ts +2 -0
  78. package/dist/types/pages/radio-button/radio-button-component.d.ts +2 -0
  79. package/dist/types/pages/shadows/shadows.d.ts +2 -0
  80. package/dist/types/pages/slideout-menus/slideout-menus.d.ts +2 -0
  81. package/dist/types/pages/sliders/slider.d.ts +1 -0
  82. package/dist/types/pages/tabels/table-data.d.ts +3 -0
  83. package/dist/types/pages/tabels/table.d.ts +2 -0
  84. package/dist/types/pages/tabs/tabs.d.ts +3 -0
  85. package/dist/types/pages/tags/tags.d.ts +3 -0
  86. package/dist/types/pages/toast/toast.d.ts +2 -0
  87. package/dist/types/pages/toggle/toggle.d.ts +2 -0
  88. package/dist/types/pages/tooltip/tooltip.d.ts +2 -0
  89. package/dist/types/pages/treeDropdownSelect/treedropdowselect.d.ts +2 -0
  90. package/dist/types/pages/types/type.d.ts +64 -0
  91. package/package.json +1 -1
@@ -9,12 +9,17 @@ const button_1 = require("primereact/button");
9
9
  const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
10
10
  // import { InputText } from "primereact/inputtext";
11
11
  const checkbox_1 = require("primereact/checkbox");
12
- const ListBoxDropdown = ({ selectAll, onSelectAll, onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className, scrollElementId, buttonClassName, showChips, chipTemplate, chipClassName, chipsParentClassName, showRemoveIcon, removeIconSize, removeIconClassName, onRemoveItem, isDraggable, onDranghandle, onShow, onHide, onFocus, }) => {
12
+ const ListBoxDropdown = ({ selectAll, onSelectAll, onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className, scrollElementId, buttonClassName, showChips, chipTemplate, chipClassName, chipsParentClassName, showRemoveIcon, removeIconSize, removeIconClassName, onRemoveItem, isDraggable, onDranghandle,
13
+ // onShow,
14
+ // onHide,
15
+ // onFocus,
16
+ }) => {
13
17
  const [selectedItems, setSelectedItems] = (0, react_1.useState)([]);
14
18
  // const [inpValue, setInpValue] = useState<any>();
15
19
  const optionsMenuRef = (0, react_1.useRef)();
16
20
  const [checked, setChecked] = (0, react_1.useState)(false);
17
21
  const onSelectOption = (e) => {
22
+ setChecked(e.value.length === listItems.length);
18
23
  setSelectedItems(e.value);
19
24
  onChange(e);
20
25
  };
@@ -59,25 +64,37 @@ const ListBoxDropdown = ({ selectAll, onSelectAll, onChange, footeTemplate, head
59
64
  // e.preventDefault()
60
65
  // }
61
66
  const onSelectAllItem = (e) => {
62
- setChecked(e.checked);
67
+ e.stopPropagation();
68
+ setChecked(!checked);
63
69
  if (onSelectAll)
64
- onSelectAll(e.checked);
65
- e.preventDefault();
70
+ onSelectAll(!checked);
66
71
  };
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 : "", ref: optionsMenuRef, model: [
72
+ 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
73
+ // onShow={(e: any) => onShow && onShow(e)}
74
+ // onHide={(e: any) => onHide && onHide(e)}
75
+ // onFocus={(e: any) => onFocus && onFocus(e)}
76
+ // popup
77
+ , {
78
+ // onShow={(e: any) => onShow && onShow(e)}
79
+ // onHide={(e: any) => onHide && onHide(e)}
80
+ // onFocus={(e: any) => onFocus && onFocus(e)}
81
+ // popup
82
+ popup: true, ref: optionsMenuRef, id: "popup_menu_bottom", className: menuClassName ? menuClassName : "",
83
+ // ref={optionsMenuRef}
84
+ model: [
68
85
  {
69
86
  template: () => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: listBoxParentClassName
70
87
  ? listBoxParentClassName +
71
88
  " 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() }), selectAll && ((0, jsx_runtime_1.jsxs)(button_1.Button, Object.assign({ type: "button",
89
+ : "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
90
  // onClick={() => {
74
91
  // if (onSelectAll) onSelectAll();
75
92
  // }}
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, onChange: e => onSelectAllItem(e) }), " ", (0, jsx_runtime_1.jsx)("span", { children: "Select 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
93
+ 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
94
  ? listBoxclassName
78
95
  : "w-16rem border-none "} `, filterPlaceholder: filterPlaceholder ? filterPlaceholder : "" }), footeTemplate && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: footeTemplate() })] }))),
79
96
  },
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 &&
97
+ ] }), !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
98
  (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map((item, index) => {
82
99
  var _a, _b;
83
100
  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,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ function BulkAction() {
5
+ return ((0, jsx_runtime_1.jsx)("div", { children: "Bulk Action " }));
6
+ }
7
+ exports.default = BulkAction;
@@ -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;