@object-ui/plugin-aggrid 4.0.4 → 4.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-aggrid",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "AG Grid data grid plugin for Object UI, powered by AG Grid Community",
@@ -25,12 +25,12 @@
25
25
  "./style.css": "./dist/index.css"
26
26
  },
27
27
  "dependencies": {
28
- "@object-ui/components": "4.0.4",
29
- "@object-ui/core": "4.0.4",
30
- "@object-ui/data-objectstack": "4.0.4",
31
- "@object-ui/fields": "4.0.4",
32
- "@object-ui/react": "4.0.4",
33
- "@object-ui/types": "4.0.4"
28
+ "@object-ui/components": "4.0.6",
29
+ "@object-ui/core": "4.0.6",
30
+ "@object-ui/data-objectstack": "4.0.6",
31
+ "@object-ui/fields": "4.0.6",
32
+ "@object-ui/react": "4.0.6",
33
+ "@object-ui/types": "4.0.6"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "ag-grid-community": "^32.0.0",
@@ -1,225 +0,0 @@
1
- import { useCallback as e, useMemo as t, useRef as n } from "react";
2
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
- import { AgGridReact as a } from "ag-grid-react";
4
- //#region src/AgGridImpl.tsx
5
- function o({ rowData: o = [], columnDefs: s = [], gridOptions: c = {}, pagination: l = !1, paginationPageSize: u = 10, domLayout: d = "normal", animateRows: f = !0, rowSelection: p, theme: m = "quartz", height: h = 500, className: g = "", editable: _ = !1, editType: v, singleClickEdit: y = !1, stopEditingWhenCellsLoseFocus: b = !0, exportConfig: x, statusBar: S, callbacks: C, columnConfig: w, enableRangeSelection: T = !1, enableCharts: E = !1, contextMenu: D, treeData: O, rowGrouping: k, excelExport: A }) {
6
- let j = n(null), M = t(() => {
7
- if (!S?.enabled) return;
8
- let e = S.aggregations || [
9
- "count",
10
- "sum",
11
- "avg"
12
- ], t = [];
13
- return e.includes("count") && t.push({
14
- statusPanel: "agAggregationComponent",
15
- statusPanelParams: { aggFuncs: ["count"] }
16
- }), e.includes("sum") && t.push({
17
- statusPanel: "agAggregationComponent",
18
- statusPanelParams: { aggFuncs: ["sum"] }
19
- }), e.includes("avg") && t.push({
20
- statusPanel: "agAggregationComponent",
21
- statusPanelParams: { aggFuncs: ["avg"] }
22
- }), e.includes("min") && t.push({
23
- statusPanel: "agAggregationComponent",
24
- statusPanelParams: { aggFuncs: ["min"] }
25
- }), e.includes("max") && t.push({
26
- statusPanel: "agAggregationComponent",
27
- statusPanelParams: { aggFuncs: ["max"] }
28
- }), t;
29
- }, [S]), N = e(() => {
30
- if (!j.current?.api) return;
31
- let e = {
32
- fileName: x?.fileName || "export.csv",
33
- skipColumnHeaders: x?.skipColumnHeaders || !1,
34
- allColumns: x?.allColumns || !1,
35
- onlySelected: x?.onlySelected || !1
36
- };
37
- if (j.current.api.exportDataAsCsv(e), C?.onExport) {
38
- let e = x?.onlySelected ? j.current.api.getSelectedRows() : o;
39
- C.onExport(e || [], "csv");
40
- }
41
- }, [
42
- x,
43
- C,
44
- o
45
- ]), P = e(() => {
46
- if (!j.current?.api) return;
47
- let e = {
48
- fileName: A?.fileName || x?.fileName || "export.csv",
49
- skipColumnHeaders: A?.includeHeaders === !1,
50
- allColumns: !0,
51
- onlySelected: A?.onlySelected || !1
52
- };
53
- if (j.current.api.exportDataAsCsv(e), C?.onExport) {
54
- let e = A?.onlySelected ? j.current.api.getSelectedRows() : o;
55
- C.onExport(e || [], "excel");
56
- }
57
- }, [
58
- A,
59
- x,
60
- C,
61
- o
62
- ]), F = e((e) => {
63
- if (!D?.enabled) return [];
64
- let t = [];
65
- return (D.items || [
66
- "copy",
67
- "copyWithHeaders",
68
- "separator",
69
- "export"
70
- ]).forEach((e) => {
71
- e === "export" ? t.push({
72
- name: "Export CSV",
73
- icon: "<span>📥</span>",
74
- action: () => N()
75
- }) : e === "export-excel" ? t.push({
76
- name: "Export Excel (CSV)",
77
- icon: "<span>📊</span>",
78
- action: () => P()
79
- }) : e === "autoSizeAll" ? t.push({
80
- name: "Auto-size All Columns",
81
- action: () => {
82
- j.current?.api && j.current.api.autoSizeAllColumns();
83
- }
84
- }) : e === "resetColumns" ? t.push({
85
- name: "Reset Columns",
86
- action: () => {
87
- j.current?.api && j.current.api.resetColumnState();
88
- }
89
- }) : t.push(e);
90
- }), D.customItems && (t.length > 0 && t.push("separator"), D.customItems.forEach((n) => {
91
- t.push({
92
- name: n.name,
93
- disabled: n.disabled,
94
- action: () => {
95
- C?.onContextMenuAction && C.onContextMenuAction(n.action, e.node?.data);
96
- }
97
- });
98
- })), t;
99
- }, [
100
- D,
101
- N,
102
- P,
103
- C
104
- ]), I = e((e) => {
105
- C?.onCellClicked?.(e);
106
- }, [C]), L = e((e) => {
107
- C?.onRowClicked?.(e);
108
- }, [C]), R = e((e) => {
109
- C?.onSelectionChanged?.(e);
110
- }, [C]), z = e((e) => {
111
- C?.onCellValueChanged?.(e);
112
- }, [C]), B = e((e) => {
113
- j.current = e;
114
- }, []), V = t(() => s ? s.map((e) => {
115
- let t = { ...e };
116
- return _ && e.editable !== !1 && (t.editable = !0), w && (w.resizable !== void 0 && e.resizable === void 0 && (t.resizable = w.resizable), w.sortable !== void 0 && e.sortable === void 0 && (t.sortable = w.sortable), w.filterable !== void 0 && e.filter === void 0 && (t.filter = w.filterable)), k?.enabled && k.groupByFields?.includes(e.field || "") && (t.rowGroup = !0, t.hide = !0), k?.aggregations && e.field && k.aggregations[e.field] && (t.aggFunc = k.aggregations[e.field]), t;
117
- }) : [], [
118
- s,
119
- _,
120
- w,
121
- k
122
- ]), H = t(() => ({
123
- ...c,
124
- pagination: l,
125
- paginationPageSize: u,
126
- domLayout: d,
127
- animateRows: f,
128
- rowSelection: p,
129
- editType: v,
130
- singleClickEdit: y,
131
- stopEditingWhenCellsLoseFocus: b,
132
- statusBar: M ? { statusPanels: M } : void 0,
133
- enableRangeSelection: T,
134
- enableCharts: E,
135
- getContextMenuItems: D?.enabled ? F : void 0,
136
- ...O?.enabled ? {
137
- treeData: !0,
138
- getDataPath: O.pathField ? (e) => e[O.pathField] : void 0,
139
- autoGroupColumnDef: {
140
- headerName: "Hierarchy",
141
- minWidth: 250,
142
- cellRendererParams: { suppressCount: !1 }
143
- },
144
- groupDefaultExpanded: O.expandAll ? -1 : O.expandDepth ?? 0
145
- } : {},
146
- ...k?.enabled ? {
147
- groupDefaultExpanded: +!!k.groupByFields?.length,
148
- autoGroupColumnDef: {
149
- minWidth: 200,
150
- cellRendererParams: { suppressCount: !k.showRowCount }
151
- }
152
- } : {},
153
- suppressCellFocus: !_,
154
- enableCellTextSelection: !0,
155
- ensureDomOrder: !0,
156
- rowBuffer: c.rowBuffer ?? 10,
157
- debounceVerticalScrollbar: c.debounceVerticalScrollbar ?? o.length > 1e3,
158
- onCellClicked: I,
159
- onRowClicked: L,
160
- onSelectionChanged: R,
161
- onCellValueChanged: z,
162
- onGridReady: B
163
- }), [
164
- c,
165
- l,
166
- u,
167
- d,
168
- f,
169
- p,
170
- v,
171
- y,
172
- b,
173
- M,
174
- T,
175
- E,
176
- D,
177
- F,
178
- O,
179
- k,
180
- _,
181
- o.length,
182
- I,
183
- L,
184
- R,
185
- z,
186
- B
187
- ]), U = t(() => ({
188
- height: typeof h == "number" ? `${h}px` : h,
189
- width: "100%"
190
- }), [h]), W = [
191
- `ag-theme-${m}`,
192
- "rounded-xl",
193
- "border",
194
- "border-border",
195
- "overflow-hidden",
196
- "shadow-lg",
197
- g
198
- ].filter(Boolean).join(" ");
199
- return /* @__PURE__ */ i("div", {
200
- className: "ag-grid-container",
201
- children: [(x?.enabled || A?.enabled) && /* @__PURE__ */ i("div", {
202
- className: "mb-2 flex gap-2",
203
- children: [x?.enabled && /* @__PURE__ */ r("button", {
204
- onClick: N,
205
- className: "px-3 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors",
206
- children: "Export CSV"
207
- }), A?.enabled && /* @__PURE__ */ r("button", {
208
- onClick: P,
209
- className: "px-3 py-1.5 text-sm font-medium text-white bg-green-600 hover:bg-green-700 rounded-md transition-colors",
210
- children: "Export Excel (CSV)"
211
- })]
212
- }), /* @__PURE__ */ r("div", {
213
- className: W,
214
- style: U,
215
- children: /* @__PURE__ */ r(a, {
216
- ref: j,
217
- rowData: o,
218
- columnDefs: V,
219
- gridOptions: H
220
- })
221
- })]
222
- });
223
- }
224
- //#endregion
225
- export { o as default };
@@ -1,460 +0,0 @@
1
- import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
- import { buildExpandFields as a } from "@object-ui/core";
3
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
4
- import { AgGridReact as c } from "ag-grid-react";
5
- import { createRoot as l } from "react-dom/client";
6
- import { AvatarField as u, BooleanField as d, CodeField as f, ColorField as p, CurrencyField as m, DateField as h, DateTimeField as g, EmailField as _, ImageField as v, LookupField as y, NumberField as b, PasswordField as x, PercentField as S, PhoneField as C, RatingField as w, SelectField as T, SliderField as E, TextAreaField as D, TextField as O, TimeField as k, UrlField as A } from "@object-ui/fields";
7
- //#region src/object-aggrid.types.ts
8
- var j = {
9
- text: "agTextColumnFilter",
10
- textarea: "agTextColumnFilter",
11
- number: "agNumberColumnFilter",
12
- currency: "agNumberColumnFilter",
13
- percent: "agNumberColumnFilter",
14
- boolean: "agSetColumnFilter",
15
- date: "agDateColumnFilter",
16
- datetime: "agDateColumnFilter",
17
- time: "agTextColumnFilter",
18
- email: "agTextColumnFilter",
19
- phone: "agTextColumnFilter",
20
- url: "agTextColumnFilter",
21
- select: "agSetColumnFilter"
22
- }, M = {
23
- text: O,
24
- textarea: D,
25
- number: b,
26
- currency: m,
27
- percent: S,
28
- boolean: d,
29
- select: T,
30
- date: h,
31
- datetime: g,
32
- time: k,
33
- email: _,
34
- phone: C,
35
- url: A,
36
- password: x,
37
- color: p,
38
- rating: w,
39
- image: v,
40
- avatar: u,
41
- lookup: y,
42
- slider: E,
43
- code: f
44
- };
45
- function N(e) {
46
- return M[e] || null;
47
- }
48
- var P = class {
49
- eGui;
50
- root = null;
51
- init(e) {
52
- let { value: t, field: n } = e, r = N(n.type);
53
- this.eGui = document.createElement("div"), this.eGui.className = "field-widget-cell", r ? (this.root = l(this.eGui), this.root.render(/* @__PURE__ */ o(r, {
54
- value: t,
55
- onChange: () => {},
56
- field: n,
57
- readonly: !0
58
- }))) : this.eGui.textContent = t == null ? "" : String(t);
59
- }
60
- getGui() {
61
- return this.eGui;
62
- }
63
- refresh(e) {
64
- let { value: t, field: n } = e, r = N(n.type);
65
- return r && this.root ? (this.root.render(/* @__PURE__ */ o(r, {
66
- value: t,
67
- onChange: () => {},
68
- field: n,
69
- readonly: !0
70
- })), !0) : this.eGui ? (this.eGui.textContent = t == null ? "" : String(t), !0) : !1;
71
- }
72
- destroy() {
73
- this.root && this.root.unmount();
74
- }
75
- }, F = class {
76
- eGui;
77
- root = null;
78
- currentValue;
79
- params;
80
- init(e) {
81
- this.params = e, this.currentValue = e.value;
82
- let { field: t } = e, n = N(t.type);
83
- if (this.eGui = document.createElement("div"), this.eGui.className = "field-widget-editor", n) this.root = l(this.eGui), this.root.render(/* @__PURE__ */ o(n, {
84
- value: this.currentValue,
85
- onChange: (e) => {
86
- this.currentValue = e;
87
- },
88
- field: t,
89
- readonly: !1
90
- }));
91
- else {
92
- let e = document.createElement("input");
93
- e.value = this.currentValue == null ? "" : String(this.currentValue), e.className = "ag-input-field-input ag-text-field-input", e.addEventListener("input", (e) => {
94
- this.currentValue = e.target.value;
95
- }), this.eGui.appendChild(e), setTimeout(() => e.focus(), 0);
96
- }
97
- }
98
- getGui() {
99
- return this.eGui;
100
- }
101
- getValue() {
102
- return this.currentValue;
103
- }
104
- destroy() {
105
- this.root && this.root.unmount();
106
- }
107
- isPopup() {
108
- return [
109
- "date",
110
- "datetime",
111
- "select",
112
- "lookup",
113
- "color"
114
- ].includes(this.params.field.type);
115
- }
116
- };
117
- function I(e) {
118
- return class extends P {
119
- init(t) {
120
- super.init({
121
- ...t,
122
- field: e
123
- });
124
- }
125
- refresh(t) {
126
- return super.refresh({
127
- ...t,
128
- field: e
129
- });
130
- }
131
- };
132
- }
133
- function L(e) {
134
- return class extends F {
135
- init(t) {
136
- super.init({
137
- ...t,
138
- field: e
139
- });
140
- }
141
- };
142
- }
143
- //#endregion
144
- //#region src/ObjectAgGridImpl.tsx
145
- function R({ objectName: l, dataSource: u, fields: d, fieldNames: f, filters: p, sort: m, pageSize: h = 10, pagination: g = !0, domLayout: _ = "normal", animateRows: v = !0, rowSelection: y, theme: b = "quartz", height: x = 500, className: S = "", editable: C = !1, editType: w, singleClickEdit: T = !1, stopEditingWhenCellsLoseFocus: E = !0, exportConfig: D, statusBar: O, callbacks: k, columnConfig: A, enableRangeSelection: j = !1, enableCharts: M = !1, contextMenu: N }) {
146
- let P = r(null), [F, I] = i(!0), [L, R] = i(null), [B, V] = i(null), [H, U] = i([]);
147
- t(() => {
148
- if (!u) {
149
- R(/* @__PURE__ */ Error("DataSource is required")), I(!1);
150
- return;
151
- }
152
- (async () => {
153
- try {
154
- I(!0), R(null), V(await u.getObjectSchema(l));
155
- } catch (e) {
156
- let t = e instanceof Error ? e : Error(String(e));
157
- R(t), k?.onDataError?.(t);
158
- } finally {
159
- I(!1);
160
- }
161
- })();
162
- }, [
163
- l,
164
- u,
165
- k
166
- ]), t(() => {
167
- !u || !B || (async () => {
168
- try {
169
- I(!0), R(null);
170
- let e = {
171
- $top: h,
172
- $skip: 0
173
- };
174
- p && (e.$filter = p), m && (e.$orderby = m);
175
- let t = a(B?.fields);
176
- t.length > 0 && (e.$expand = t);
177
- let n = await u.find(l, e);
178
- U(n.data || []), k?.onDataLoaded?.(n.data || []);
179
- } catch (e) {
180
- let t = e instanceof Error ? e : Error(String(e));
181
- R(t), k?.onDataError?.(t);
182
- } finally {
183
- I(!1);
184
- }
185
- })();
186
- }, [
187
- l,
188
- u,
189
- B,
190
- p,
191
- m,
192
- h,
193
- k
194
- ]);
195
- let W = n(() => {
196
- if (!B?.fields) return [];
197
- let e = d || Object.values(B.fields);
198
- return (f ? e.filter((e) => f.includes(e.name)) : e).map((e) => {
199
- let t = {
200
- field: e.name,
201
- headerName: e.label || e.name,
202
- sortable: e.sortable !== !1,
203
- filter: ee(e),
204
- editable: C && !e.readonly
205
- };
206
- return A && (A.resizable !== void 0 && (t.resizable = A.resizable), A.sortable !== void 0 && t.sortable === void 0 && (t.sortable = A.sortable)), z(t, e), t;
207
- });
208
- }, [
209
- B,
210
- d,
211
- f,
212
- C,
213
- A
214
- ]), G = n(() => {
215
- if (!O?.enabled) return;
216
- let e = O.aggregations || [
217
- "count",
218
- "sum",
219
- "avg"
220
- ], t = [];
221
- return e.includes("count") && t.push({
222
- statusPanel: "agAggregationComponent",
223
- statusPanelParams: { aggFuncs: ["count"] }
224
- }), e.includes("sum") && t.push({
225
- statusPanel: "agAggregationComponent",
226
- statusPanelParams: { aggFuncs: ["sum"] }
227
- }), e.includes("avg") && t.push({
228
- statusPanel: "agAggregationComponent",
229
- statusPanelParams: { aggFuncs: ["avg"] }
230
- }), e.includes("min") && t.push({
231
- statusPanel: "agAggregationComponent",
232
- statusPanelParams: { aggFuncs: ["min"] }
233
- }), e.includes("max") && t.push({
234
- statusPanel: "agAggregationComponent",
235
- statusPanelParams: { aggFuncs: ["max"] }
236
- }), t;
237
- }, [O]), K = e(() => {
238
- if (!P.current?.api) return;
239
- let e = {
240
- fileName: D?.fileName || `${l}-export.csv`,
241
- skipColumnHeaders: D?.skipColumnHeaders || !1,
242
- allColumns: D?.allColumns || !1,
243
- onlySelected: D?.onlySelected || !1
244
- };
245
- if (P.current.api.exportDataAsCsv(e), k?.onExport) {
246
- let e = D?.onlySelected ? P.current.api.getSelectedRows() : H;
247
- k.onExport(e || [], "csv");
248
- }
249
- }, [
250
- D,
251
- k,
252
- H,
253
- l
254
- ]), q = e((e) => {
255
- if (!N?.enabled) return [];
256
- let t = [];
257
- return (N.items || [
258
- "copy",
259
- "copyWithHeaders",
260
- "separator",
261
- "export"
262
- ]).forEach((e) => {
263
- e === "export" ? t.push({
264
- name: "Export CSV",
265
- icon: "<span>📥</span>",
266
- action: () => K()
267
- }) : e === "autoSizeAll" ? t.push({
268
- name: "Auto-size All Columns",
269
- action: () => {
270
- P.current?.api && P.current.api.autoSizeAllColumns();
271
- }
272
- }) : e === "resetColumns" ? t.push({
273
- name: "Reset Columns",
274
- action: () => {
275
- P.current?.api && P.current.api.resetColumnState();
276
- }
277
- }) : t.push(e);
278
- }), N.customItems && (t.length > 0 && t.push("separator"), N.customItems.forEach((n) => {
279
- t.push({
280
- name: n.name,
281
- disabled: n.disabled,
282
- action: () => {
283
- k?.onContextMenuAction && k.onContextMenuAction(n.action, e.node?.data);
284
- }
285
- });
286
- })), t;
287
- }, [
288
- N,
289
- K,
290
- k
291
- ]), J = e((e) => {
292
- k?.onCellClicked?.(e);
293
- }, [k]), Y = e((e) => {
294
- k?.onRowClicked?.(e);
295
- }, [k]), X = e((e) => {
296
- k?.onSelectionChanged?.(e);
297
- }, [k]), Z = e(async (e) => {
298
- if (k?.onCellValueChanged?.(e), u && e.data && e.data.id) try {
299
- await u.update(l, e.data.id, { [e.colDef.field]: e.newValue });
300
- } catch (t) {
301
- console.error("Failed to update record:", t), e.node.setDataValue(e.colDef.field, e.oldValue);
302
- }
303
- }, [
304
- k,
305
- u,
306
- l
307
- ]), Q = e((e) => {
308
- P.current = e;
309
- }, []), te = n(() => ({
310
- pagination: g,
311
- paginationPageSize: h,
312
- domLayout: _,
313
- animateRows: v,
314
- rowSelection: y,
315
- editType: w,
316
- singleClickEdit: T,
317
- stopEditingWhenCellsLoseFocus: E,
318
- statusBar: G ? { statusPanels: G } : void 0,
319
- enableRangeSelection: j,
320
- enableCharts: M,
321
- getContextMenuItems: N?.enabled ? q : void 0,
322
- suppressCellFocus: !C,
323
- enableCellTextSelection: !0,
324
- ensureDomOrder: !0,
325
- onCellClicked: J,
326
- onRowClicked: Y,
327
- onSelectionChanged: X,
328
- onCellValueChanged: Z,
329
- onGridReady: Q
330
- }), [
331
- g,
332
- h,
333
- _,
334
- v,
335
- y,
336
- w,
337
- T,
338
- E,
339
- G,
340
- j,
341
- M,
342
- N,
343
- q,
344
- C,
345
- J,
346
- Y,
347
- X,
348
- Z,
349
- Q
350
- ]), $ = n(() => ({
351
- height: typeof x == "number" ? `${x}px` : x,
352
- width: "100%"
353
- }), [x]), ne = [
354
- `ag-theme-${b}`,
355
- "rounded-xl",
356
- "border",
357
- "border-border",
358
- "overflow-hidden",
359
- "shadow-lg",
360
- S
361
- ].filter(Boolean).join(" ");
362
- return F ? /* @__PURE__ */ o("div", {
363
- className: "flex items-center justify-center",
364
- style: $,
365
- children: /* @__PURE__ */ s("div", {
366
- className: "text-muted-foreground",
367
- children: [
368
- "Loading ",
369
- l,
370
- "..."
371
- ]
372
- })
373
- }) : L ? /* @__PURE__ */ o("div", {
374
- className: "flex items-center justify-center",
375
- style: $,
376
- children: /* @__PURE__ */ s("div", {
377
- className: "text-destructive",
378
- children: ["Error loading data: ", L.message]
379
- })
380
- }) : /* @__PURE__ */ s("div", {
381
- className: "object-aggrid-container",
382
- children: [D?.enabled && /* @__PURE__ */ o("div", {
383
- className: "mb-2 flex gap-2",
384
- children: /* @__PURE__ */ o("button", {
385
- onClick: K,
386
- className: "px-3 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors",
387
- children: "Export CSV"
388
- })
389
- }), /* @__PURE__ */ o("div", {
390
- className: ne,
391
- style: $,
392
- children: /* @__PURE__ */ o(c, {
393
- ref: P,
394
- rowData: H,
395
- columnDefs: W,
396
- gridOptions: te
397
- })
398
- })]
399
- });
400
- }
401
- function ee(e) {
402
- return e.filterable === !1 ? !1 : j[e.type] || "agTextColumnFilter";
403
- }
404
- function z(e, t) {
405
- if ([
406
- "text",
407
- "textarea",
408
- "number",
409
- "currency",
410
- "percent",
411
- "boolean",
412
- "select",
413
- "date",
414
- "datetime",
415
- "time",
416
- "email",
417
- "phone",
418
- "url",
419
- "password",
420
- "color",
421
- "rating",
422
- "image",
423
- "avatar",
424
- "lookup",
425
- "slider",
426
- "code"
427
- ].includes(t.type)) e.cellRenderer = I(t), e.editable && (e.cellEditor = L(t), [
428
- "date",
429
- "datetime",
430
- "select",
431
- "lookup",
432
- "color"
433
- ].includes(t.type) && (e.cellEditorPopup = !0));
434
- else switch (t.type) {
435
- case "master_detail":
436
- e.valueFormatter = (e) => e.value ? typeof e.value == "object" ? e.value.name || e.value.label || e.value.id || "" : String(e.value) : "";
437
- break;
438
- case "object":
439
- e.cellRenderer = () => {
440
- let e = document.createElement("span");
441
- return e.className = "text-gray-500 italic", e.textContent = "[Object]", e;
442
- };
443
- break;
444
- case "vector":
445
- e.cellRenderer = () => {
446
- let e = document.createElement("span");
447
- return e.className = "text-gray-500 italic", e.textContent = "[Vector]", e;
448
- };
449
- break;
450
- case "grid":
451
- e.cellRenderer = () => {
452
- let e = document.createElement("span");
453
- return e.className = "text-gray-500 italic", e.textContent = "[Grid]", e;
454
- };
455
- break;
456
- default: e.valueFormatter = (e) => e.value == null ? "" : String(e.value);
457
- }
458
- }
459
- //#endregion
460
- export { R as default };