react-graph-grid 0.1.4 → 0.1.6

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 (88) hide show
  1. package/README.md +4 -0
  2. package/{src/css → dist}/default.css +2 -1
  3. package/dist/index.esm.js +21 -0
  4. package/dist/index.js +56 -0
  5. package/dist/index10.esm.js +3844 -0
  6. package/dist/index10.js +3848 -0
  7. package/dist/index11.esm.js +4121 -0
  8. package/dist/index11.js +4125 -0
  9. package/dist/index12.esm.js +5238 -0
  10. package/dist/index12.js +5242 -0
  11. package/dist/index13.esm.js +5466 -0
  12. package/dist/index13.js +5470 -0
  13. package/dist/index14.esm.js +22 -0
  14. package/dist/index14.js +26 -0
  15. package/dist/index15.esm.js +402 -0
  16. package/dist/index15.js +403 -0
  17. package/dist/index16.esm.js +507 -0
  18. package/dist/index16.js +507 -0
  19. package/dist/index17.esm.js +256 -0
  20. package/dist/index17.js +257 -0
  21. package/dist/index18.esm.js +261 -0
  22. package/dist/index18.js +263 -0
  23. package/dist/index19.esm.js +623 -0
  24. package/dist/index19.js +624 -0
  25. package/dist/index2.esm.js +6 -0
  26. package/dist/index2.js +2 -0
  27. package/dist/index20.esm.js +219 -0
  28. package/dist/index20.js +220 -0
  29. package/dist/index21.esm.js +298 -0
  30. package/dist/index21.js +299 -0
  31. package/dist/index22.esm.js +662 -0
  32. package/dist/index22.js +663 -0
  33. package/dist/index23.esm.js +340 -0
  34. package/dist/index23.js +341 -0
  35. package/dist/index24.esm.js +269 -0
  36. package/dist/index24.js +270 -0
  37. package/dist/index25.esm.js +600 -0
  38. package/dist/index25.js +601 -0
  39. package/dist/index26.esm.js +245 -0
  40. package/dist/index26.js +246 -0
  41. package/dist/index27.esm.js +136 -0
  42. package/dist/index27.js +137 -0
  43. package/dist/index28.esm.js +70 -0
  44. package/dist/index28.js +70 -0
  45. package/dist/index29.esm.js +748 -0
  46. package/dist/index29.js +748 -0
  47. package/dist/index30.esm.js +363 -0
  48. package/dist/index30.js +363 -0
  49. package/dist/index4.esm.js +27 -0
  50. package/dist/index4.js +27 -0
  51. package/dist/index5.esm.js +35 -0
  52. package/dist/index5.js +39 -0
  53. package/dist/index6.esm.js +200 -0
  54. package/dist/index6.js +204 -0
  55. package/dist/index7.esm.js +9 -0
  56. package/dist/index7.js +13 -0
  57. package/dist/index8.esm.js +65 -0
  58. package/dist/index8.js +68 -0
  59. package/dist/index9.esm.js +102 -0
  60. package/dist/index9.js +103 -0
  61. package/package.json +6 -3
  62. package/eslint.config.js +0 -29
  63. package/index.html +0 -13
  64. package/index.js +0 -19
  65. package/npm.aps +0 -0
  66. package/src/Base.jsx +0 -81
  67. package/src/Card.jsx +0 -333
  68. package/src/Dropdown.jsx +0 -339
  69. package/src/FieldEdit.jsx +0 -376
  70. package/src/Graph.jsx +0 -482
  71. package/src/Grid.jsx +0 -887
  72. package/src/GridCD.jsx +0 -180
  73. package/src/GridDB.jsx +0 -897
  74. package/src/GridFE.jsx +0 -753
  75. package/src/GridFL.jsx +0 -468
  76. package/src/GridGR.jsx +0 -311
  77. package/src/GridPK.jsx +0 -414
  78. package/src/Modal.jsx +0 -511
  79. package/src/Overlay.jsx +0 -140
  80. package/src/Tests/DebugApp.jsx +0 -334
  81. package/src/Tests/TestData.jsx +0 -251
  82. package/src/Themes/DefaultGridTheme.jsx +0 -36
  83. package/src/Themes/Images.jsx +0 -438
  84. package/src/Themes/Translate.jsx +0 -76
  85. package/src/css/default_.css +0 -945
  86. package/src/main.jsx +0 -10
  87. package/vite.config.js +0 -14
  88. /package/{public → dist}/IM.svg +0 -0
@@ -0,0 +1,363 @@
1
+ import { require_jsx_runtime } from "./index7.esm.js";
2
+ import { Overlay } from "./index9.esm.js";
3
+ import { Modal } from "./index15.esm.js";
4
+ import { Dropdown } from "./index17.esm.js";
5
+ import { Grid } from "./index19.esm.js";
6
+ import { GridGR } from "./index20.esm.js";
7
+ import { GridDB } from "./index22.esm.js";
8
+ import { GridFL } from "./index23.esm.js";
9
+ import { FieldEdit } from "./index24.esm.js";
10
+ import { GridFE } from "./index25.esm.js";
11
+ import { GridCD } from "./index27.esm.js";
12
+ import { TestData } from "./index29.esm.js";
13
+ import { useState } from "react";
14
+ var import_jsx_runtime = require_jsx_runtime();
15
+ function DebugApp() {
16
+ const [state, setState] = useState({ menuItem: -2 });
17
+ window._logEnabled = true;
18
+ const GetFamily = function(e) {
19
+ return new Promise(function(resolve, reject) {
20
+ const rows = new TestData().getFamily(e);
21
+ if (rows != null) resolve(rows);
22
+ else reject(Error("Error getting rows"));
23
+ });
24
+ };
25
+ const GetButtons = function() {
26
+ return [{
27
+ id: 1,
28
+ name: "info",
29
+ title: "Persone Info",
30
+ label: "Persone Info",
31
+ click: function(e) {
32
+ const selRow = e.grid.selectedRowIndex >= 0 && e.grid.rows.length > 0 ? e.grid.rows[e.grid.selectedRowIndex] : null;
33
+ if (!selRow) return;
34
+ alert(`Persone Name = ${selRow.Name}, Persone Birth Day = ${selRow.Date}`);
35
+ },
36
+ getDisabled: function(e) {
37
+ return !e.grid.rows || e.grid.rows.length <= 0;
38
+ }
39
+ }, {
40
+ id: 2,
41
+ name: "clear",
42
+ title: "Clear console",
43
+ label: "Clear console",
44
+ click: function() {
45
+ console.clear();
46
+ }
47
+ }];
48
+ };
49
+ const GetCities = function(e) {
50
+ return new Promise(function(resolve, reject) {
51
+ const rows = new TestData().getCity(e);
52
+ if (rows != null) resolve(rows);
53
+ else reject(Error("Error getting rows"));
54
+ });
55
+ };
56
+ const GetCityColumns = function() {
57
+ return new TestData().GetCityColumns();
58
+ };
59
+ const GetFamilyColumns = function() {
60
+ return new TestData().GetFamilyColumns();
61
+ };
62
+ const ResetColumnsOrder = function() {
63
+ const grid = window.gridComponent;
64
+ if (!grid) return;
65
+ grid.resetColumnsOrderToDefault();
66
+ };
67
+ const ResetColumnsWidths = function() {
68
+ const grid = window.gridComponent;
69
+ if (!grid) return;
70
+ grid.resetColumnsWidthsToDefault();
71
+ };
72
+ const GetPopupItems = function() {
73
+ return new Promise(function(resolve) {
74
+ resolve([
75
+ {
76
+ id: 1,
77
+ text: "test 1 item"
78
+ },
79
+ {
80
+ id: 2,
81
+ text: "test 2 item"
82
+ },
83
+ {
84
+ id: 3,
85
+ text: "test 3 item"
86
+ },
87
+ {
88
+ id: 4,
89
+ text: "test 4 item"
90
+ },
91
+ {
92
+ id: 5,
93
+ text: "test 5 item"
94
+ }
95
+ ]);
96
+ });
97
+ };
98
+ const drawGridInModal = function() {
99
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
100
+ className: "div-on-menu",
101
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
102
+ onClick: () => {
103
+ console.clear();
104
+ },
105
+ className: "modal-window-footer-button",
106
+ children: "Clear console"
107
+ })
108
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Grid, {
109
+ getRows: GetFamily,
110
+ init: (grid) => {
111
+ window.gridComponent = grid;
112
+ }
113
+ })] });
114
+ };
115
+ const drawDropdownInModal = function(wnd) {
116
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
117
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
118
+ className: "div-on-menu",
119
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
120
+ onClick: () => {
121
+ console.clear();
122
+ },
123
+ className: "modal-window-footer-button",
124
+ children: "Clear console"
125
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
126
+ onClick: (e) => {
127
+ wnd.ddComponent.popup(e);
128
+ },
129
+ className: "modal-window-footer-button",
130
+ children: "Show Dropdown"
131
+ })]
132
+ }),
133
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: wnd.ddComponent && wnd.ddComponent.clickedItem ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Item Clicked : " + wnd.ddComponent.clickedItem }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {}) }),
134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Dropdown, {
135
+ init: (dd) => {
136
+ wnd.ddComponent = dd;
137
+ },
138
+ getItems: GetPopupItems,
139
+ onItemClick: (e) => {
140
+ e.self.clickedItem = e.itemId;
141
+ wnd.refreshState();
142
+ }
143
+ })
144
+ ] });
145
+ };
146
+ const drawClearConsole = function() {
147
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
148
+ onClick: () => {
149
+ console.clear();
150
+ },
151
+ className: "modal-window-footer-button",
152
+ children: "Clear console"
153
+ });
154
+ };
155
+ const drawTest = function() {
156
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
157
+ };
158
+ const getTestApp = () => {
159
+ console.log("state == " + state.menuItem);
160
+ switch (state.menuItem) {
161
+ case 0: return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
162
+ case 1: return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
163
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
164
+ className: "div-on-menu",
165
+ children: "1. Drag column to reorder 2. Doubleclick on divider to autowidth"
166
+ }),
167
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
168
+ className: "div-on-menu",
169
+ children: [
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
171
+ onClick: () => ResetColumnsOrder(),
172
+ className: "modal-window-footer-button",
173
+ children: "Reset columns order"
174
+ }),
175
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
176
+ onClick: () => ResetColumnsWidths(),
177
+ className: "modal-window-footer-button",
178
+ children: "Reset columns widths"
179
+ }),
180
+ drawClearConsole()
181
+ ]
182
+ }),
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Grid, {
184
+ getRows: GetFamily,
185
+ init: (grid) => {
186
+ window.gridComponent = grid;
187
+ }
188
+ })
189
+ ] });
190
+ case 2: return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
191
+ className: "div-on-menu",
192
+ children: drawClearConsole()
193
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Overlay, {
194
+ init: (ovl) => {
195
+ window.overlayComponent = ovl;
196
+ },
197
+ closeWhenEscape: true,
198
+ closeWhenClick: true
199
+ })] });
200
+ case 3: return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Modal, {
201
+ uid: "m01",
202
+ isModal: true,
203
+ renderContent: () => {
204
+ return drawGridInModal();
205
+ },
206
+ closeWhenEscape: true,
207
+ pos: {
208
+ x: 100,
209
+ y: 100,
210
+ w: 600,
211
+ h: 450
212
+ },
213
+ title: "Modal Grid"
214
+ }) });
215
+ case 4: return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Modal, {
216
+ uid: "m02",
217
+ isModal: true,
218
+ title: "Dropdown",
219
+ renderContent: (wnd) => {
220
+ return drawDropdownInModal(wnd);
221
+ },
222
+ closeWhenEscape: true,
223
+ dimensionsByContent: true,
224
+ pos: {
225
+ x: 100,
226
+ y: 100,
227
+ w: 300,
228
+ h: 250
229
+ }
230
+ }) });
231
+ case 5: return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
232
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
233
+ className: "div-on-menu",
234
+ children: "Change the active record in the parent grid to see the child rows."
235
+ }),
236
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
237
+ className: "div-on-menu",
238
+ children: drawClearConsole()
239
+ }),
240
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
241
+ className: "div-with-grid",
242
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GridGR, {
243
+ uid: "people",
244
+ getRows: GetFamily
245
+ })
246
+ }),
247
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
248
+ className: "div-with-grid",
249
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GridGR, {
250
+ uid: "cities",
251
+ parentGrids: "people",
252
+ getRows: GetCities,
253
+ getColumns: GetCityColumns
254
+ })
255
+ })
256
+ ] });
257
+ case 6: return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
258
+ className: "div-on-menu",
259
+ children: "Grid with pager, pocket and sortable columns. Hold shift to sort by multiple columns."
260
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
261
+ className: "div-with-grid",
262
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GridDB, {
263
+ getRows: GetFamily,
264
+ buttons: GetButtons(),
265
+ getColumns: GetFamilyColumns,
266
+ multi: true
267
+ })
268
+ })] });
269
+ case 7: return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
270
+ className: "div-on-menu",
271
+ children: "Grid with column filters."
272
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
273
+ className: "div-with-grid",
274
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GridFL, {
275
+ getRows: GetFamily,
276
+ buttons: GetButtons(),
277
+ getColumns: GetFamilyColumns
278
+ })
279
+ })] });
280
+ case 8: return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Modal, {
281
+ uid: "m01",
282
+ isModal: true,
283
+ closeWhenEscape: true,
284
+ renderContent: () => {
285
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
286
+ className: "div-with-grid",
287
+ children: [
288
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Persona" }),
289
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldEdit, { column: {
290
+ id: 1,
291
+ name: "Persona",
292
+ getRows: GetFamily,
293
+ refKeyField: "Id",
294
+ refNameField: "Name",
295
+ type: "lookup"
296
+ } }),
297
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
298
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Age" }),
299
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldEdit, { column: {
300
+ id: 2,
301
+ name: "Age"
302
+ } })
303
+ ]
304
+ });
305
+ },
306
+ pos: {
307
+ x: 100,
308
+ y: 100,
309
+ w: 400,
310
+ h: 200
311
+ },
312
+ title: "Field Edit"
313
+ }) });
314
+ case 9: return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
315
+ className: "div-on-menu",
316
+ children: "Editable grid."
317
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
318
+ className: "div-with-grid",
319
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GridFE, {
320
+ getRows: GetFamily,
321
+ getColumns: GetFamilyColumns,
322
+ allowEdit: true
323
+ })
324
+ })] });
325
+ case 10: return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
326
+ className: "div-on-menu",
327
+ children: "Editable grid with card-based record view."
328
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
329
+ className: "div-with-grid",
330
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GridCD, {
331
+ getRows: GetFamily,
332
+ getColumns: GetFamilyColumns,
333
+ allowEdit: true
334
+ })
335
+ })] });
336
+ case 11: return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: drawTest() });
337
+ default: return null;
338
+ }
339
+ };
340
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", {
341
+ onChange: (e) => {
342
+ setState({ menuItem: e.target.selectedIndex });
343
+ },
344
+ children: [
345
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "0. None" }),
346
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "1. React Grid" }),
347
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "2. Overlay" }),
348
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "3. Modal" }),
349
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "4. Dropdown" }),
350
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "5. Two Grids" }),
351
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "6. GridDB" }),
352
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "7. GridFL" }),
353
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "8. Field Edit" }),
354
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "9. GridFE" }),
355
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "10. GridCD" }),
356
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { children: "11. TEST" })
357
+ ]
358
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
359
+ className: "div-on-menu",
360
+ children: getTestApp()
361
+ })] });
362
+ }
363
+ export { DebugApp };