sccoreui 6.3.99 → 6.4.0

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 (120) hide show
  1. package/dist/components/list-box-dropdown/list-box-dropdown.js +2 -2
  2. package/dist/components/list-box-dropdown/virtualization-component.js +7 -7
  3. package/dist/pages/RowGroupingServerside/DragandDropFeatures.js +49 -0
  4. package/dist/pages/RowGroupingServerside/RowGroupingServerSide.js +125 -0
  5. package/dist/pages/RowGroupingServerside/dummyData.js +226 -0
  6. package/dist/pages/VirtualScrollDropDown/VirtualScrollDropDown.js +9 -0
  7. package/dist/pages/aggrid/AgGrid.js +837 -0
  8. package/dist/pages/aggrid/BulkAction.js +9 -0
  9. package/dist/pages/aggrid/RowGroupTrail.js +125 -0
  10. package/dist/pages/aggrid/Template.js +11 -0
  11. package/dist/pages/aggrid/TestingWIthAdminConfig.js +243 -0
  12. package/dist/pages/aggrid/TestingWithAdminClientSide.js +447 -0
  13. package/dist/pages/aggrid/fakeServer.js +95 -0
  14. package/dist/pages/aggrid/id-cell.js +9 -0
  15. package/dist/pages/aggrid/interface.js +2 -0
  16. package/dist/pages/avatar/avatar.js +338 -0
  17. package/dist/pages/badges/badge.js +73 -0
  18. package/dist/pages/breadcrumb/breadcrumb.js +14 -0
  19. package/dist/pages/button/button.js +10 -0
  20. package/dist/pages/button-group/button-group.js +10 -0
  21. package/dist/pages/chart/chart.js +257 -0
  22. package/dist/pages/checkbox/checkbox.js +26 -0
  23. package/dist/pages/checkbox-group/checkbox-group-component.js +21 -0
  24. package/dist/pages/color-picker/color-picker.js +13 -0
  25. package/dist/pages/content-dividers/content-dividers.js +11 -0
  26. package/dist/pages/custom-color-picker/custom-color-picker.js +12 -0
  27. package/dist/pages/custom-multiselect/CustomMultiSelect.js +37 -0
  28. package/dist/pages/date-picker/date-picker.js +20 -0
  29. package/dist/pages/dropdown/dropdown-component.js +39 -0
  30. package/dist/pages/file-upload/file-upload.js +34 -0
  31. package/dist/pages/flex.js +15 -0
  32. package/dist/pages/formulaTemplate/formulaTemplate.js +105 -0
  33. package/dist/pages/frolaTextEditor/froala-text-editor.js +14 -0
  34. package/dist/pages/home.js +58 -0
  35. package/dist/pages/input/input-text.js +112 -0
  36. package/dist/pages/list-box-dropdown/listboxdropdown.js +91 -0
  37. package/dist/pages/loader-indicator/loader-indicator.js +10 -0
  38. package/dist/pages/mega-mennu/mega-menu.js +84 -0
  39. package/dist/pages/multi-select-dropdown/multi-select-dropdown.js +51 -0
  40. package/dist/pages/not-found/not-found.js +10 -0
  41. package/dist/pages/paginator/pagination.js +122 -0
  42. package/dist/pages/progress-bar/progress-bar.js +27 -0
  43. package/dist/pages/progress-steps/progress-steps.js +24 -0
  44. package/dist/pages/radio-button/radio-button-component.js +11 -0
  45. package/dist/pages/shadows/shadows.js +7 -0
  46. package/dist/pages/slideout-menus/slideout-menus.js +104 -0
  47. package/dist/pages/sliders/slider.js +39 -0
  48. package/dist/pages/tabels/table-data.js +2193 -0
  49. package/dist/pages/tabels/table.js +98 -0
  50. package/dist/pages/tabs/tabs.js +9 -0
  51. package/dist/pages/tags/tags.js +70 -0
  52. package/dist/pages/testingcomponents/NormalAgGrid.js +58 -0
  53. package/dist/pages/testingcomponents/TestComponent.js +69 -0
  54. package/dist/pages/testingcomponents/data.js +326 -0
  55. package/dist/pages/testingcomponents/fom-feild-testing/MainformComp.js +16 -0
  56. package/dist/pages/toast/toast.js +47 -0
  57. package/dist/pages/toggle/toggle.js +10 -0
  58. package/dist/pages/tooltip/tooltip.js +13 -0
  59. package/dist/pages/treeDropdownSelect/treedropdowselect.js +34 -0
  60. package/dist/pages/types/type.js +2 -0
  61. package/dist/types/components/types/type.d.ts +1 -0
  62. package/dist/types/pages/RowGroupingServerside/DragandDropFeatures.d.ts +4 -0
  63. package/dist/types/pages/RowGroupingServerside/RowGroupingServerSide.d.ts +4 -0
  64. package/dist/types/pages/RowGroupingServerside/dummyData.d.ts +9 -0
  65. package/dist/types/pages/VirtualScrollDropDown/VirtualScrollDropDown.d.ts +2 -0
  66. package/dist/types/pages/aggrid/AgGrid.d.ts +2 -0
  67. package/dist/types/pages/aggrid/BulkAction.d.ts +2 -0
  68. package/dist/types/pages/aggrid/RowGroupTrail.d.ts +4 -0
  69. package/dist/types/pages/aggrid/Template.d.ts +2 -0
  70. package/dist/types/pages/aggrid/TestingWIthAdminConfig.d.ts +2 -0
  71. package/dist/types/pages/aggrid/TestingWithAdminClientSide.d.ts +2 -0
  72. package/dist/types/pages/aggrid/fakeServer.d.ts +7 -0
  73. package/dist/types/pages/aggrid/id-cell.d.ts +2 -0
  74. package/dist/types/pages/aggrid/interface.d.ts +12 -0
  75. package/dist/types/pages/avatar/avatar.d.ts +2 -0
  76. package/dist/types/pages/badges/badge.d.ts +3 -0
  77. package/dist/types/pages/breadcrumb/breadcrumb.d.ts +2 -0
  78. package/dist/types/pages/button/button.d.ts +2 -0
  79. package/dist/types/pages/button-group/button-group.d.ts +2 -0
  80. package/dist/types/pages/chart/chart.d.ts +2 -0
  81. package/dist/types/pages/checkbox/checkbox.d.ts +2 -0
  82. package/dist/types/pages/checkbox-group/checkbox-group-component.d.ts +3 -0
  83. package/dist/types/pages/color-picker/color-picker.d.ts +2 -0
  84. package/dist/types/pages/content-dividers/content-dividers.d.ts +2 -0
  85. package/dist/types/pages/custom-color-picker/custom-color-picker.d.ts +2 -0
  86. package/dist/types/pages/custom-multiselect/CustomMultiSelect.d.ts +2 -0
  87. package/dist/types/pages/date-picker/date-picker.d.ts +2 -0
  88. package/dist/types/pages/dropdown/dropdown-component.d.ts +2 -0
  89. package/dist/types/pages/file-upload/file-upload.d.ts +3 -0
  90. package/dist/types/pages/flex.d.ts +2 -0
  91. package/dist/types/pages/formulaTemplate/formulaTemplate.d.ts +2 -0
  92. package/dist/types/pages/frolaTextEditor/froala-text-editor.d.ts +2 -0
  93. package/dist/types/pages/home.d.ts +2 -0
  94. package/dist/types/pages/input/input-text.d.ts +3 -0
  95. package/dist/types/pages/list-box-dropdown/listboxdropdown.d.ts +2 -0
  96. package/dist/types/pages/loader-indicator/loader-indicator.d.ts +3 -0
  97. package/dist/types/pages/mega-mennu/mega-menu.d.ts +2 -0
  98. package/dist/types/pages/multi-select-dropdown/multi-select-dropdown.d.ts +2 -0
  99. package/dist/types/pages/not-found/not-found.d.ts +2 -0
  100. package/dist/types/pages/paginator/pagination.d.ts +2 -0
  101. package/dist/types/pages/progress-bar/progress-bar.d.ts +3 -0
  102. package/dist/types/pages/progress-steps/progress-steps.d.ts +2 -0
  103. package/dist/types/pages/radio-button/radio-button-component.d.ts +2 -0
  104. package/dist/types/pages/shadows/shadows.d.ts +2 -0
  105. package/dist/types/pages/slideout-menus/slideout-menus.d.ts +2 -0
  106. package/dist/types/pages/sliders/slider.d.ts +1 -0
  107. package/dist/types/pages/tabels/table-data.d.ts +3 -0
  108. package/dist/types/pages/tabels/table.d.ts +2 -0
  109. package/dist/types/pages/tabs/tabs.d.ts +3 -0
  110. package/dist/types/pages/tags/tags.d.ts +3 -0
  111. package/dist/types/pages/testingcomponents/NormalAgGrid.d.ts +4 -0
  112. package/dist/types/pages/testingcomponents/TestComponent.d.ts +4 -0
  113. package/dist/types/pages/testingcomponents/data.d.ts +1 -0
  114. package/dist/types/pages/testingcomponents/fom-feild-testing/MainformComp.d.ts +2 -0
  115. package/dist/types/pages/toast/toast.d.ts +2 -0
  116. package/dist/types/pages/toggle/toggle.d.ts +2 -0
  117. package/dist/types/pages/tooltip/tooltip.d.ts +2 -0
  118. package/dist/types/pages/treeDropdownSelect/treedropdowselect.d.ts +2 -0
  119. package/dist/types/pages/types/type.d.ts +64 -0
  120. package/package.json +1 -1
@@ -0,0 +1,837 @@
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 constants_1 = require("../../components/ag-grid/constants");
6
+ const react_1 = require("react");
7
+ const BulkAction_1 = tslib_1.__importDefault(require("./BulkAction"));
8
+ const parent_for_grid_1 = tslib_1.__importDefault(require("../../components/ag-grid/parent-for-grid"));
9
+ const axios_1 = tslib_1.__importDefault(require("axios"));
10
+ const inputtext_1 = require("primereact/inputtext");
11
+ const type_1 = require("../../components/types/type");
12
+ const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-component"));
13
+ // import { Dropdown } from "primereact/dropdown";
14
+ // import CustomDropDown from "../../components/ag-grid/custom-dropdown";
15
+ // import { FakeServer } from "./fakeServer";
16
+ // import IdCell from "./id-cell";
17
+ // import { Dropdown } from "primereact/dropdown";
18
+ // import { FilterDataType } from "../../components/ag-grid/constants";
19
+ const treeData = [
20
+ {
21
+ orgHierarchy: ["Testing configuable products"],
22
+ id: "66d8352fb870ddafea4cbb77",
23
+ code: "Testingconfiguableproducts",
24
+ type: 2,
25
+ totalSkuCount: 6,
26
+ },
27
+ {
28
+ orgHierarchy: [
29
+ "Testing configuable products",
30
+ "Testingconfiguableproducts-Blue-cc1234-fbdfb",
31
+ ],
32
+ id: "66d86873bc124aba35f15190",
33
+ code: "Testingconfiguableproducts-Blue-cc1234-fbdfb",
34
+ },
35
+ {
36
+ orgHierarchy: [
37
+ "Testing configuable products",
38
+ "Testingconfiguableproducts-Blue-cc1234-red",
39
+ ],
40
+ id: "66d86873bc124aba35f1518e",
41
+ code: "Testingconfiguableproducts-Blue-cc1234-red",
42
+ },
43
+ ];
44
+ const AgGridPage = () => {
45
+ const [rowData, setRowData] = (0, react_1.useState)([]);
46
+ const [shouldRefetch, setShouldRefetch] = (0, react_1.useState)(false);
47
+ const [defaultFilters] = (0, react_1.useState)([]);
48
+ const [storeResult, setStoreResult] = (0, react_1.useState)();
49
+ // const deleteComponent = () => {
50
+ // return (
51
+ // <div>
52
+ // <button className="bg-white" onClick={() => setShouldRefetch(true)}>
53
+ // Delete
54
+ // </button>
55
+ // </div>
56
+ // );
57
+ // };
58
+ // const AdvancedFilter = () => {
59
+ // return <p>Advnaced Filter</p>;
60
+ // };
61
+ const initialConditions = {
62
+ displayFilter: type_1.VisibilityState.ENABLE,
63
+ displayAdvancedFilter: type_1.VisibilityState.ENABLE,
64
+ displaySort: type_1.VisibilityState.DISABLE,
65
+ displaySearch: type_1.VisibilityState.ENABLE,
66
+ displayRefresh: type_1.VisibilityState.DISABLE,
67
+ displayRemoveItems: type_1.VisibilityState.DISABLE,
68
+ displayBulkAction: type_1.VisibilityState.HIDE,
69
+ enableViewCreate: true,
70
+ displaySidePanel: type_1.VisibilityState.ENABLE,
71
+ enableFillHandle: true,
72
+ displayBulkEdit: type_1.VisibilityState.DISABLE,
73
+ displayDiscardEdit: false,
74
+ displaySaveEditButton: false,
75
+ displayRecords: type_1.VisibilityState.ENABLE,
76
+ displayEditHeading: type_1.VisibilityState.ENABLE,
77
+ displayFeaturesHeader: true,
78
+ displayCheckboxOnRight: false,
79
+ displayGroupCount: true,
80
+ displayCheckboxForGroupChild: false,
81
+ displayCheckboxForGroups: false,
82
+ displayRowGroupingElement: type_1.VisibilityState.ENABLE,
83
+ isGridAutoHeight: false,
84
+ };
85
+ const [conditionsToDisplay, setConditionsToDisplay] = (0, react_1.useState)(initialConditions);
86
+ // const updateRows = (row) => {
87
+ // setUpdateRowData({ rowData: row, shouldUpdate: true })
88
+ // }
89
+ // const statusDropDwon = (params) => {
90
+ // return <Dropdown
91
+ // onChange={(e) => { params.data.status = e.value, console.log(e.value, 'value updating on change'), updateRows(params.data) }}
92
+ // value={params.data?.status}
93
+ // options={[{ id: 1, label: "Draft", value: 1 },
94
+ // { id: 2, label: "Active", value: 2 },
95
+ // {
96
+ // id: 3,
97
+ // label: "Inactive",
98
+ // value: 3,
99
+ // }]}
100
+ // />
101
+ // }
102
+ const [shouldClearFilters, setShouldClearFilters] = (0, react_1.useState)(false);
103
+ // Callback for remove button click
104
+ // const removeCallBack = (featureDetails) => {
105
+ // console.log(featureDetails, "feature details in products on remove click");
106
+ // };
107
+ // const groupColumns = [
108
+ // {
109
+ // id: "1",
110
+ // seq: 1,
111
+ // field: "rank",
112
+ // headerName: "rank",
113
+ // rowGroup: true,
114
+ // },
115
+ // {
116
+ // id: "2",
117
+ // seq: 2,
118
+ // field: "name",
119
+ // headerName: "Name",
120
+ // },
121
+ // ];
122
+ // const [columnDefs] = useState(
123
+ // // [
124
+ // // {
125
+ // // seq: 1,
126
+ // // // pinned: "left",
127
+ // // // lockPosition: "left",
128
+ // // // cellClass: "lock-pinned",
129
+ // // // suppressMovable: true,
130
+ // // enableHeaderCheckbox: true,
131
+ // // hide: false,
132
+ // // enableChildCheckbox: true,
133
+ // // id: "101",
134
+ // // headerName: "ID",
135
+ // // field: "id",
136
+ // // isSortable: false,
137
+ // // code: 1,
138
+ // // dataType: FilterDataType.STRING,
139
+ // // editable: true,
140
+ // // isFilterable: false,
141
+ // // cellStyle: { borderRight: "1px solid #ccc" },
142
+ // // visibleInPanel: true,
143
+ // // cellRendererSelector: (params) => {
144
+ // // if (params.node.rowPinned) {
145
+ // // return {
146
+ // // component: CustomDropDown,
147
+ // // params: {
148
+ // // style: { color: "#5577CC" },
149
+ // // },
150
+ // // };
151
+ // // } else {
152
+ // // return undefined;
153
+ // // }
154
+ // // },
155
+ // // suppressFillHandle: true,
156
+ // // isEditable: false
157
+ // // },
158
+ // // {
159
+ // // id: "111",
160
+ // // seq: 3,
161
+ // // headerName: "Email",
162
+ // // dataType: FilterDataType.STRING,
163
+ // // editable: true,
164
+ // // visibleInPanel: true,
165
+ // // isFilterable: false,
166
+ // // field: "email",
167
+ // // suppressFillHandle: false,
168
+ // // isEditable: true,
169
+ // // filter: "agTextColumnFilter",
170
+ // // },
171
+ // // {
172
+ // // seq: 3,
173
+ // // filter: "agTextColumnFilter",
174
+ // // // lockPinned: true,
175
+ // // hide: false,
176
+ // // id: "102",
177
+ // // headerName: "Title",
178
+ // // cellRendererSelector: (params) => {
179
+ // // if (params.node.rowPinned) {
180
+ // // return {
181
+ // // component: CustomDropDown,
182
+ // // params: {
183
+ // // style: { color: "#5577CC" },
184
+ // // },
185
+ // // };
186
+ // // } else {
187
+ // // return undefined;
188
+ // // }
189
+ // // },
190
+ // // field: "name",
191
+ // // isSortable: true,
192
+ // // code: 1,
193
+ // // dataType: FilterDataType.STRING,
194
+ // // editable: true,
195
+ // // visibleInPanel: true,
196
+ // // isFilterable: false,
197
+ // // suppressFillHandle: false,
198
+ // // isEditable: true
199
+ // // },
200
+ // // {
201
+ // // seq: 2,
202
+ // // hide: true,
203
+ // // // lockPinned: true,
204
+ // // id: "103",
205
+ // // headerName: "Body",
206
+ // // field: "body",
207
+ // // isSortable: true,
208
+ // // code: 1,
209
+ // // dataType: FilterDataType.STRING,
210
+ // // editable: true,
211
+ // // visibleInPanel: true,
212
+ // // isFilterable: true,
213
+ // // suppressFillHandle: false,
214
+ // // isEditable: true,
215
+ // // filter: "agTextColumnFilter",
216
+ // // },
217
+ // // {
218
+ // // seq: 4,
219
+ // // hide: false,
220
+ // // id: "104",
221
+ // // headerName: "Status",
222
+ // // field: "status",
223
+ // // isSortable: true,
224
+ // // visibleInPanel: true,
225
+ // // columnType: "single",
226
+ // // filter: true,
227
+ // // rowGroup: false,
228
+ // // filterParams: {
229
+ // // values: [
230
+ // // 1,
231
+ // // 2,
232
+ // // 3
233
+ // // ]
234
+ // // },
235
+ // // options: [
236
+ // // { id: 1, label: "Draft", value: 1 },
237
+ // // { id: 2, label: "Active", value: 2 },
238
+ // // { id: 3, label: "Inactive", value: 3 },
239
+ // // ],
240
+ // // code: 1,
241
+ // // dataType: FilterDataType.SELECT,
242
+ // // editable: false,
243
+ // // isFilterable: true,
244
+ // // cellRenderer: statusDropDwon,
245
+ // // suppressFillHandle: false,
246
+ // // isEditable: true
247
+ // // },
248
+ // // {
249
+ // // seq: 6,
250
+ // // hide: false,
251
+ // // // lockPinned: true,
252
+ // // id: "555",
253
+ // // headerName: "Price",
254
+ // // field: "price",
255
+ // // isSortable: true,
256
+ // // code: 1,
257
+ // // dataType: FilterDataType.INTEGER,
258
+ // // editable: true,
259
+ // // visibleInPanel: true,
260
+ // // isFilterable: true,
261
+ // // suppressFillHandle: false,
262
+ // // isEditable: true,
263
+ // // filter: "agNumberColumnFilter",
264
+ // // },
265
+ // // {
266
+ // // seq: 6,
267
+ // // hide: false,
268
+ // // // lockPinned: true,
269
+ // // id: "666",
270
+ // // headerName: "Date",
271
+ // // field: "date",
272
+ // // isSortable: true,
273
+ // // code: 1,
274
+ // // dataType: FilterDataType.DATE,
275
+ // // editable: false,
276
+ // // visibleInPanel: true,
277
+ // // isFilterable: true,
278
+ // // suppressFillHandle: false,
279
+ // // isEditable: true,
280
+ // // filter: true,
281
+ // // },
282
+ // // {
283
+ // // seq: 5,
284
+ // // id: "105",
285
+ // // hide: false,
286
+ // // isEditable: false,
287
+ // // // pinned: "right",
288
+ // // // lockPosition: "rigth",
289
+ // // // cellClass: "lock-pinned",
290
+ // // visibleInPanel: false,
291
+ // // suppressFillHandle: true,
292
+ // // cellRendererSelector: (params) => {
293
+ // // if (params.node.rowPinned) {
294
+ // // return () => null;
295
+ // // } else {
296
+ // // return { component: deleteComponent };
297
+ // // }
298
+ // // },
299
+ // // },
300
+ // // ]
301
+ // []
302
+ // );
303
+ const [columnsToDisplay, setColumnsToDisplay] = (0, react_1.useState)([]);
304
+ const inputText = (row, field) => {
305
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ title: row[field], className: "overflow-hidden white-space-nowrap text-overflow-ellipsis max-w-16rem text-base line-heignt-3" }, { children: (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { value: row[field], onChange: (e) => setRowData3((prev) => [
306
+ ...prev.map((x) => {
307
+ if (x.id === row.id) {
308
+ return Object.assign(Object.assign({}, x), { name: e.target.value });
309
+ }
310
+ return x;
311
+ }),
312
+ ]) }) })));
313
+ };
314
+ const commonFieldsTemplate = (row, field) => {
315
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ title: row[field], className: "overflow-hidden white-space-nowrap text-overflow-ellipsis max-w-16rem text-base line-heignt-3" }, { children: row[field] ? row[field] : "--" })));
316
+ };
317
+ // const statusData = () => {
318
+ // return (
319
+ // <>
320
+ // <p>{"cell renderer"}</p>
321
+ // </>
322
+ // );
323
+ // };
324
+ const DeleteRow = (params) => {
325
+ console.log(params, "params in delete");
326
+ return (0, jsx_runtime_1.jsx)("p", Object.assign({ onClick: () => deleteRow(params) }, { children: "delete" }));
327
+ };
328
+ const AddRow = (params) => {
329
+ return (0, jsx_runtime_1.jsx)("p", Object.assign({ onClick: () => addRow(params) }, { children: "Add" }));
330
+ };
331
+ const deleteRow = (params) => {
332
+ const { node } = params;
333
+ const api = params === null || params === void 0 ? void 0 : params.api;
334
+ api.applyTransaction({ remove: [node.data] });
335
+ };
336
+ const addRow = (params) => {
337
+ const api = params.api;
338
+ const newRow = { id: "101", status: 3, name: "New Product" };
339
+ api.applyTransaction({ add: [newRow] });
340
+ };
341
+ const fillDynamicColumns = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
342
+ const result = yield axios_1.default.get("https://paymentconfig_queriesapi.easyfastnow.com/api/grid/get-meta-data?screenId=1&viewId=1");
343
+ const options = { data: { response: { data: [] } } };
344
+ let x = result.data.response.columns.map((col, index) => {
345
+ let obj = {
346
+ headerName: col.fieldDisplayName,
347
+ suppressMovable: true,
348
+ enableHeaderCheckbox: col.enableHeaderCheckbox,
349
+ enableChildCheckbox: col.enableChildCheckbox,
350
+ hide: col.fieldName === "status" ? false : col.hide,
351
+ isFilterable: col.isFilterable,
352
+ isSortable: col.isSortable,
353
+ field: col.fieldName,
354
+ filter: true,
355
+ visibleInPanel: true,
356
+ dataType: col.datatype,
357
+ id: index + index,
358
+ seq: index,
359
+ grouping: index === 0,
360
+ attributeType: col.isCustomAttribute ? 2 : 1,
361
+ cellRenderer: (data) => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: data.data ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: col.fieldName === "name" ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: inputText(data.data, col.fieldName) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: commonFieldsTemplate(data.data, col.fieldName) })) })) : ("") })),
362
+ // cellRenderer: statusData,
363
+ };
364
+ if (col.isCustomAttribute) {
365
+ obj = Object.assign(Object.assign({}, obj), { visibleInPanel: true, field: col.fieldID, isFilterable: true });
366
+ }
367
+ if (col.pinned) {
368
+ obj = Object.assign(Object.assign({}, obj), { pinned: "left", lockPosition: "left", cellClass: "lock-pinned", minWidth: 350 });
369
+ }
370
+ if (col.datatype === 14 || col.datatype === 12) {
371
+ obj["options"] = [
372
+ { id: 1, label: "Draft", value: "DRAFT" },
373
+ { id: 2, label: "Active", value: "Active" },
374
+ { id: 3, label: "Inactive", value: "Inactive" },
375
+ ];
376
+ }
377
+ return obj;
378
+ });
379
+ options.data.response.data
380
+ .filter((x) => !x.isMerged)
381
+ .map((option) => {
382
+ let obj = {
383
+ headerName: option.name,
384
+ suppressMovable: true,
385
+ enableHeaderCheckbox: false,
386
+ enableChildCheckbox: false,
387
+ hide: true,
388
+ isFilterable: true,
389
+ isSortable: false,
390
+ field: option.id,
391
+ dataType: 14,
392
+ visibleInPanel: false,
393
+ attributeType: 3,
394
+ options: option.optionValues
395
+ ? option.optionValues.map((option1) => (Object.assign(Object.assign({}, option1), { label: option1.name, value: option1.id, minWidth: 200 })))
396
+ : [],
397
+ };
398
+ x.push(obj);
399
+ return obj;
400
+ });
401
+ const deleteColumn = {
402
+ cellRenderer: DeleteRow,
403
+ };
404
+ const addColumn = {
405
+ cellRenderer: AddRow,
406
+ };
407
+ x.splice(3, x.length - 1);
408
+ x.push(deleteColumn);
409
+ x.push(addColumn);
410
+ setColumnsToDisplay(x);
411
+ });
412
+ const [rowData3, setRowData3] = (0, react_1.useState)([]);
413
+ const fetchData = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
414
+ var _a, _b;
415
+ const result = yield axios_1.default.post("https://paymentconfig_queriesapi.easyfastnow.com/api/grid/get-data", {
416
+ pageIndex: 1,
417
+ pageSize: 100,
418
+ screenId: 1,
419
+ });
420
+ console.log("resulttt in ag grid", result);
421
+ const treeData = (_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.map((row, idx) => {
422
+ // row.orgHierarchy = [row.id]
423
+ if (idx < 4) {
424
+ row.orgHierarchy = [row.id];
425
+ }
426
+ else {
427
+ row.orgHierarchy = [row.id];
428
+ }
429
+ return row;
430
+ });
431
+ setRowData3(treeData);
432
+ });
433
+ (0, react_1.useEffect)(() => {
434
+ fetchData();
435
+ fillDynamicColumns();
436
+ }, []);
437
+ const noRowsOverlayComponent = () => {
438
+ // const displayedRowCount = getGridRef?.current!.api?.getDisplayedRowCount();
439
+ // const text = getGridRef?.current!.api?.getQuickFilter();
440
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("p", { children: "No Rows, message from products" }) }));
441
+ };
442
+ console.log(rowData3, "rowdara");
443
+ const updateCell = (selectedRowsToUpdate) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
444
+ console.log(selectedRowsToUpdate, "selected rows to update");
445
+ setRowData(rowData);
446
+ setStoreResult(rowData);
447
+ const output = {
448
+ isSuccess: true,
449
+ };
450
+ return output;
451
+ });
452
+ // const [selectedCity, setSelectedCity] = useState(null);
453
+ const pinnedTopRowData = (0, react_1.useMemo)(() => {
454
+ return [{ id: "1", name: "nitesh", body: "working out" }];
455
+ }, []);
456
+ // Update columns based on hide panel
457
+ const updateColumns = (updatedColumns) => {
458
+ console.log(updatedColumns, "updated columns in products");
459
+ setColumnsToDisplay(updatedColumns.columns);
460
+ };
461
+ console.log(setColumnsToDisplay);
462
+ // Remove items from - button
463
+ // const removeItem = (checkboxSelectionDetails) => {
464
+ // const unSelectedData = checkboxSelectionDetails?.excludedRecords;
465
+ // const selectedData = checkboxSelectionDetails?.includedRecords;
466
+ // const isIternminite = checkboxSelectionDetails?.isIndeterminate;
467
+ // console.log(checkboxSelectionDetails, "coming in remove item products");
468
+ // let updatedRowData = [];
469
+ // if (isIternminite) {
470
+ // updatedRowData = unSelectedData;
471
+ // } else if (selectedData?.length && !isIternminite) {
472
+ // const childIds = new Set(selectedData?.map((child) => child.id));
473
+ // updatedRowData = rowData.filter((parent) => !childIds.has(parent.id));
474
+ // }
475
+ // console.log(updatedRowData, "result data from remove items in products");
476
+ // return updatedRowData;
477
+ // };
478
+ const getCheckedRows = (checkedRows) => {
479
+ console.log(checkedRows, "checked rows in products");
480
+ };
481
+ // const updateForFillOperation =(fillSelected)=>{
482
+ // console.log('store row data in update fill',storeResult,fillSelected)
483
+ // const updatedResult = JSON.parse(JSON.stringify(storeResult.rowData))?.map((item)=>{
484
+ // fillSelected.childRows?.filter((fillItem)=>{
485
+ // console.log(item.id ,fillItem.id)
486
+ // if(item.id===fillItem.id){
487
+ // console.log('coming in satisfied item')
488
+ // console.log(item[fillSelected.column.field],fillItem[fillSelected.column.field],'field in item and fill item')
489
+ // item[fillSelected.column.field] = fillSelected.parentRow[fillSelected.column.field]
490
+ // }
491
+ // })
492
+ // return item
493
+ // })
494
+ // const newOutput = {
495
+ // rowData : updatedResult,
496
+ // totalRecords:storeResult.totalRecords
497
+ // }
498
+ // console.log(updatedResult,'updated result on fill')
499
+ // return newOutput
500
+ // // const updatedRowData = storeResult.rowData.map
501
+ // }
502
+ // const SaveEdit = (params) => {
503
+ // console.log(params, "params in save edit");
504
+ // console.log(editedRecords, "edited records in page");
505
+ // const saveChanges = () => {
506
+ // setEmptyCheckboxStatus(true);
507
+ // console.log("changes saved", editedRecords);
508
+ // setColumnsToDisplay(columnDefs);
509
+ // setShouldRefetch(true);
510
+ // setEditMode(false);
511
+ // setConditionsToDisplay(initialConditions);
512
+ // };
513
+ // return (
514
+ // <button
515
+ // disabled={!editedRecords.length}
516
+ // onClick={saveChanges}
517
+ // className="bg-white"
518
+ // >
519
+ // Save Changes
520
+ // </button>
521
+ // );
522
+ // };
523
+ // Discard component for bulk edit
524
+ // const DiscardEdit = () => {
525
+ // const discard = () => {
526
+ // setColumnsToDisplay(columnDefs);
527
+ // setShouldRefetch(true);
528
+ // setEditMode(false);
529
+ // setConditionsToDisplay(initialConditions);
530
+ // };
531
+ // return (
532
+ // <div>
533
+ // <p onClick={discard}>Discard</p>
534
+ // </div>
535
+ // );
536
+ // };
537
+ // Edit headeing details
538
+ // const EditHeadingDetails = () => {
539
+ // return (
540
+ // <div>
541
+ // <p>Bulk Edit 4 products 4 variants</p>
542
+ // </div>
543
+ // );
544
+ // };
545
+ // Bulk edit component
546
+ const BulkEdit = () => {
547
+ const updateColumns = () => {
548
+ const tempColumns = [...columnsToDisplay].filter((column) => column.isEditable);
549
+ console.log(tempColumns, "temp columsn");
550
+ setColumnsToDisplay(tempColumns);
551
+ setShouldRefetch(true);
552
+ // setEditMode(true);
553
+ const tempConditions = conditionsToDisplay;
554
+ tempConditions.displayFilter = type_1.VisibilityState.ENABLE;
555
+ tempConditions.displaySort = type_1.VisibilityState.DISABLE;
556
+ tempConditions.displayBulkAction = type_1.VisibilityState.HIDE;
557
+ tempConditions.enableFillHandle = true;
558
+ tempConditions.displayDiscardEdit = true;
559
+ tempConditions.displayRefresh = type_1.VisibilityState.DISABLE;
560
+ tempConditions.displayRemoveItems = type_1.VisibilityState.DISABLE;
561
+ tempConditions.displayBulkEdit = type_1.VisibilityState.DISABLE;
562
+ tempConditions.displaySaveEditButton = true;
563
+ tempConditions.displayEditHeading = type_1.VisibilityState.ENABLE;
564
+ setConditionsToDisplay(tempConditions);
565
+ };
566
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ onClick: updateColumns, className: "disabled" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "edit-02", color: "text-gray-500" }) })));
567
+ };
568
+ // const getRowData = async (startRow, endRow, featureDetails, params?: any) => {
569
+ // const getRowData = async () => {
570
+ // console.log("called");
571
+ // // const dummyRecordForGroup = [
572
+ // // {name:"nitesh",rank:1,id:"01"},
573
+ // // {name:"pawan",rank:1,id:"02"},
574
+ // // {name:"harish",rank:2,id:"03"},
575
+ // // {name:"nitesh",rank:3,id:"04"},
576
+ // // {name:"nitesh",rank:2,id:"05"},
577
+ // // {name:"nitesh",rank:3,id:"06"},
578
+ // // {name:"nitesh",rank:3,id:"07"},
579
+ // // {name:"nitesh",rank:3,id:"08"},
580
+ // // ]
581
+ // // console.log(params, "params in page");
582
+ // // console.log(featureDetails, "feature details in page for filter queries");
583
+ // // if(featureDetails?.fillSelected?.childRows?.length){
584
+ // // return updateForFillOperation(featureDetails.fillSelected)
585
+ // // }
586
+ // // const features: Features = featureDetails;
587
+ // // const conditionToRemoveItem = features.checkBoxSelection.allBoxChecked || features.checkBoxSelection.isIndeterminate || features.checkBoxSelection.includedRecords.length || features.checkBoxSelection.excludedRecords.length
588
+ // // if (featureDetails.isRemoveClicked) {
589
+ // // const result = removeItem(features.checkBoxSelection);
590
+ // // const output = {
591
+ // // totalRecords: result.length,
592
+ // // rowData: result,
593
+ // // };
594
+ // // return await output;
595
+ // // }
596
+ // // let totalRecords = 500;
597
+ // // const serverSideUrl = `https://jsonplaceholder.typicode.com/comments?_start=${startRow}&_end=${endRow}`;
598
+ // // const clientSideUrl = "https://jsonplaceholder.typicode.com/comments?_limit=200";
599
+ // // console.log(serverSideUrl, clientSideUrl);
600
+ // // const { startRow, featureDetails } = payload
601
+ // // const stringWithoutZeros = String(startRow).replace(/00/g, '');
602
+ // // const numberWithoutZeros = parseInt(stringWithoutZeros) + 1
603
+ // // const requestObject: any = { pageIndex: numberWithoutZeros, pageSize: 100 }
604
+ // // debugger
605
+ // // // Add sort info if given any by gird component
606
+ // // if (featureDetails?.sort?.isSortable) {
607
+ // // const sortInfo = featureDetails?.sort
608
+ // // requestObject.sortOrder = {
609
+ // // direction: sortInfo?.orderToSort?.sortId,
610
+ // // propertyName: sortInfo?.columnToSort?.field
611
+ // // }
612
+ // // }
613
+ // // // Add search info if given any by gird component
614
+ // // if (featureDetails?.searchedText?.length) {
615
+ // // requestObject.searchString = featureDetails?.searchedText
616
+ // // }
617
+ // // // Add filter info if given any by gird component
618
+ // // const filterFromGrid = featureDetails?.filterQueries ?? [];
619
+ // // if (filterFromGrid.length > 0) {
620
+ // // const requestFilters: any[] = filterFromGrid.map((element: any) => ({
621
+ // // fieldName: element?.selectedColumn?.code,
622
+ // // fieldValue: element?.value.toString(),
623
+ // // conditionalOperator: element?.selectedOperation,
624
+ // // logicalOperator: element.logicalOperator
625
+ // // }));
626
+ // // requestObject.filters = requestFilters;
627
+ // // }
628
+ // const result: any = await axios.post(
629
+ // "https://productservice.easyfastnow.com/products/search",
630
+ // {}
631
+ // );
632
+ // console.log("resulttt in ag grid", result);
633
+ // const treeData = result?.data?.response?.data?.map((row, idx) => {
634
+ // // row.orgHierarchy = [row.id]
635
+ // if (idx < 4) {
636
+ // row.orgHierarchy = [row.id];
637
+ // } else {
638
+ // row.orgHierarchy = [row.id];
639
+ // }
640
+ // return row;
641
+ // });
642
+ // console.log(result, treeData, "row data api call");
643
+ // // debugger
644
+ // // Enable row group local server
645
+ // // const grouping = false;
646
+ // // const outputData = result?.data
647
+ // // .map((item, idx) => {
648
+ // // if (idx == 2 || idx == 3) {
649
+ // // item.type = 2
650
+ // // item.price = "--"
651
+ // // } else {
652
+ // // item.type = 1
653
+ // // item.status = 3
654
+ // // item.price = 500;
655
+ // // }
656
+ // // delete item.postId;
657
+ // // return item;
658
+ // // });
659
+ // // const dummyData = [
660
+ // // {status:3,name:"product 1", id:1},
661
+ // // {status:4,name:"product 2", id:2},
662
+ // // {status:5,name:"product 3", id:3},
663
+ // // {status:2,name:"product 4", id:4},
664
+ // // {status:1,name:"product 5", id:5},
665
+ // // {status:3,name:"product 6", id:6},
666
+ // // ]
667
+ // // const dummy = treeData.map((item, index) => {
668
+ // // return {
669
+ // // ...item,
670
+ // // status:index % 2 == 0 ? "--" : item.status
671
+ // // };
672
+ // // });
673
+ // const dummy = treeData.splice(0, 6);
674
+ // console.log(dummy);
675
+ // let output = {
676
+ // totalRecords: dummy,
677
+ // rowData: dummy,
678
+ // };
679
+ // // Performs when grouping is present
680
+ // // if (grouping) {
681
+ // // const result: any = await axios.get(serverSideUrl);
682
+ // // result?.data.map((item) => {
683
+ // // item.status = "Active";
684
+ // // return item;
685
+ // // });
686
+ // // let fakeServer = FakeServer(result.data, ["status"]);
687
+ // // const groupingResponse = fakeServer.getData(params);
688
+ // // console.log(groupingResponse, 'grouping response')
689
+ // // const lastRow =
690
+ // // params.groupKeys?.length == 0
691
+ // // ? groupingResponse?.lastRow
692
+ // // : totalRecords;
693
+ // // output.rowData = groupingResponse.rows;
694
+ // // output.totalRecords = lastRow;
695
+ // // }
696
+ // setStoreResult(output);
697
+ // setRowData(result.data);
698
+ // setShouldRefetch(false);
699
+ // setShouldClearFilters(false);
700
+ // return output;
701
+ // };
702
+ const style = {
703
+ height: "100vh",
704
+ width: "100%",
705
+ };
706
+ console.log(pinnedTopRowData, defaultFilters);
707
+ // const createView = (viewDetails) => {
708
+ // console.log(viewDetails, "parsed value for create view");
709
+ // };
710
+ console.log(storeResult, "sotred result");
711
+ const selectFilter = () => {
712
+ var _a;
713
+ (_a = getGridRef.current.api) === null || _a === void 0 ? void 0 : _a.showAdvancedFilterBuilder();
714
+ // const defaultFilters = [
715
+ // {
716
+ // columnName: {
717
+ // name: "Body",
718
+ // code: "body",
719
+ // dataType: "string",
720
+ // },
721
+ // condition: 5, // Convert to type number
722
+ // value: "data", // type can be anything
723
+ // id: "0.028544677566825438", // "string"
724
+ // isActive: true, // boolean
725
+ // logicalOperator: 1, // number
726
+ // },
727
+ // ];
728
+ // setShouldRefetch(true);
729
+ // setDefaultFilters(defaultFilters);
730
+ // setRowData3([...rowData3.slice(1)]);
731
+ };
732
+ // const dynamicText = {
733
+ // filterModelText: {
734
+ // header: "Filter",
735
+ // subHeader: "Streamline Your Search With Filters",
736
+ // resetFilterAction: "Reset Filter",
737
+ // createViewInputPlaceHolder: "Enter",
738
+ // createViewAction: "Create View",
739
+ // applyAction: "Apply",
740
+ // elementOnePlaceHolder: "Select",
741
+ // elementTwoPlaceHolder: "Select",
742
+ // elementThreePlaceHolder_Input: "Enter Text",
743
+ // elementThreePlaceHolder_Input_Number: "Enter Number",
744
+ // elementThreePlaceHolder_DropDown: "Select",
745
+ // elementThreePlaceHolder_MultiSelect: "Select",
746
+ // elementThreePlaceHolder_Calender: "Select Date",
747
+ // onSelectedFilter: "Selected",
748
+ // },
749
+ // sortModelText: {
750
+ // header: "Column Sorting",
751
+ // clearAction: "Clear",
752
+ // applyAction: "Apply",
753
+ // onSelectedSort: "Selected",
754
+ // },
755
+ // recordDetailModelText: {
756
+ // totalRecordHeader: "Total Records",
757
+ // },
758
+ // sidePanelText: {
759
+ // header: "Configure Columns",
760
+ // disacrd_button: "Discard",
761
+ // update_button: "Update",
762
+ // apply_to_all_views: "Apply to all views",
763
+ // apply_subHeading:
764
+ // "Apply the chosen column selection to all available views",
765
+ // search_placeHolder: "Search by column name",
766
+ // selected_attributes: "Selected Attributes",
767
+ // unselected_attributes: "Unselected Attributes",
768
+ // },
769
+ // bulkEditAction: {
770
+ // discard: "Discard",
771
+ // save: "Save Changes",
772
+ // },
773
+ // };
774
+ // const GroupHeaderComponent = (params) =>{
775
+ // console.log(params)
776
+ // return <><p>Group Header</p> </>
777
+ // }
778
+ // const getGroupedColumnsWithOrder = (params) => {
779
+ // // Get all row group columns in the order they are grouped
780
+ // const rowGroupColumns = params?.api?.getRowGroupColumns() || [];
781
+ // // Extract column details including ID and field
782
+ // const groupedColumnsInOrder = rowGroupColumns.map((col) => ({
783
+ // field: col.getColDef().headerName,
784
+ // }));
785
+ // console.log("Grouped Columns in Order:", rowGroupColumns);
786
+ // return groupedColumnsInOrder;
787
+ // };
788
+ // const GroupHeaderName = (props) => {
789
+ // const { params } = props;
790
+ // // const level = params.node.level;
791
+ // const groupId = params.node.key; // The unique key for the current group
792
+ // const parentGroupId = params?.node?.key; // The unique key for the parent group, if available
793
+ // // Get the grouped columns with their details
794
+ // const columnsSelectedForGroup = getGroupedColumnsWithOrder(params);
795
+ // // Custom names for groups and subgroups
796
+ // const customNames = {
797
+ // group1: `GROUP BY - ${columnsSelectedForGroup[0]?.field?.toUpperCase()} : ${groupId}`,
798
+ // group2: `${columnsSelectedForGroup[1]?.field?.toUpperCase()} BY ${parentGroupId}`,
799
+ // };
800
+ // // Determine the group name based on the level
801
+ // // const groupName = params?.node?.level === 0 ? customNames.group1 : customNames.group2;
802
+ // return (
803
+ // <>
804
+ // {params?.node?.level === 0 && customNames.group1}
805
+ // {params?.node?.level === 1 && customNames.group2}
806
+ // </>
807
+ // );
808
+ // };
809
+ // Store ref and update grid
810
+ // const getGridRef = (gridRef) => {
811
+ // console.log(gridRef, "grid ref in products");
812
+ // const newRow = { name: "nitesh", id: "101", status: "199" };
813
+ // console.log(newRow);
814
+ // if (gridRef?.current) {
815
+ // // gridRef.current?.api?.applyTransaction({ add: [newRow] })
816
+ // }
817
+ // };
818
+ const ChildComponentForGroup = () => {
819
+ return (0, jsx_runtime_1.jsx)("p", { children: "hhhh" });
820
+ };
821
+ const GroupHeaderComponent = () => {
822
+ return (0, jsx_runtime_1.jsx)("h3", { children: "MODULES" });
823
+ };
824
+ const RowGroupHeaderComponent = () => {
825
+ return (0, jsx_runtime_1.jsx)("span", { children: "ttt" });
826
+ };
827
+ const getGridRef = (0, react_1.useRef)(null);
828
+ const loadingOverlayComponentParams = (0, react_1.useMemo)(() => {
829
+ return { loadingMessage: "One moment please..." };
830
+ }, []);
831
+ 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)("button", Object.assign({ onClick: () => setShouldClearFilters(true) }, { children: "clear filter" })), columnsToDisplay.length > 0 && ((0, jsx_runtime_1.jsx)(parent_for_grid_1.default, { columnData: columnsToDisplay, style: style,
832
+ // getRowData={getRowData}
833
+ rowData: treeData, conditionsToDisplay: conditionsToDisplay, rowModelType: constants_1.ROWMODELTYPE.CLIENT_SIDE, pinnedTopRowData: pinnedTopRowData, bulkActionComponent: BulkAction_1.default, getCheckedRows: getCheckedRows, shouldRefetch: shouldRefetch, noRowsOverlayComponent: noRowsOverlayComponent, enableManageColumnsCallback: true, clearFilters: shouldClearFilters, updateColumnsForGrid: updateColumns, updateCell: updateCell, BulkEditComponent: BulkEdit, getGridRef: getGridRef, enableAdvancedFilter: false, ChildComponentForGroup: ChildComponentForGroup, displayRowGroupingElement: true, GroupHeaderComponent: GroupHeaderComponent, rowGroupColumnWidth: 200, displayCheckboxForGroups: true, displayCheckboxForGroupChild: false, displayCheckboxOnRight: false, rowGroupHeaderComponent: RowGroupHeaderComponent, enableCheckboxForGroupHeader: false, enableChildCheckbox: false, enableHeaderCheckbox: false, onRowClicked: (data) => {
834
+ console.log(data, "data");
835
+ }, loadingOverlayComponentParams: loadingOverlayComponentParams }))] }));
836
+ };
837
+ exports.default = AgGridPage;