@guiexpert/solid-table 1.1.109 → 1.1.113
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/GuiexpertTableProps.d.ts +11 -1
- package/index.cjs +1 -1
- package/index.js +36 -32
- package/package.json +2 -2
package/GuiexpertTableProps.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FocusModelIf, GeBatchEditEvent, GeDetailEvent, GeEditEvent, GeUndoEvent, GeModelChangeEvent, GeMouseEvent, GeRowDragEvent, GeScrollEvent, GeStateChangeEvent, SelectionModelIf, TableApi, TableModelIf, TableOptions } from '@guiexpert/table';
|
|
1
|
+
import { FocusModelIf, GeBatchEditEvent, GeDetailEvent, GeEditEvent, GeUndoEvent, GeColumnResizeEvent, GeColumnMoveEvent, GeModelChangeEvent, GeMouseEvent, GeRowDragEvent, GeScrollEvent, GeStateChangeEvent, SelectionModelIf, TableApi, TableModelIf, TableOptions } from '@guiexpert/table';
|
|
2
2
|
|
|
3
3
|
export type GeMouseEventFn = (evt: GeMouseEvent) => void;
|
|
4
4
|
export type GeCheckboxEventFn = (evt: any[]) => void;
|
|
@@ -13,6 +13,8 @@ export type GeBatchEditEventFn = (evt: GeBatchEditEvent) => void;
|
|
|
13
13
|
export type GeDetailEventFn = (evt: GeDetailEvent) => void;
|
|
14
14
|
export type GeEditEventFn = (evt: GeEditEvent) => void;
|
|
15
15
|
export type GeUndoEventFn = (evt: GeUndoEvent) => void;
|
|
16
|
+
export type GeColumnResizeEventFn = (evt: GeColumnResizeEvent) => void;
|
|
17
|
+
export type GeColumnMoveEventFn = (evt: GeColumnMoveEvent) => void;
|
|
16
18
|
export interface GuiexpertTableProps {
|
|
17
19
|
tableModel: TableModelIf;
|
|
18
20
|
tableOptions?: TableOptions;
|
|
@@ -44,6 +46,14 @@ export interface GuiexpertTableProps {
|
|
|
44
46
|
editingChanged?: GeEditEventFn;
|
|
45
47
|
/** The undo history changed (since 1.1.99). */
|
|
46
48
|
undoStackChanged?: GeUndoEventFn;
|
|
49
|
+
/** The user started to resize a column (since 1.1.110). */
|
|
50
|
+
columnResizeStart?: GeColumnResizeEventFn;
|
|
51
|
+
/** A column resize by the user ended – `evt.type` "end" or "cancel"; save the layout here (since 1.1.110). */
|
|
52
|
+
columnResizeEnd?: GeColumnResizeEventFn;
|
|
53
|
+
/** The user started to move a column (since 1.1.110). */
|
|
54
|
+
columnMoveStart?: GeColumnMoveEventFn;
|
|
55
|
+
/** A column move by the user ended – `evt.columnOrder` (since 1.1.110). */
|
|
56
|
+
columnMoveEnd?: GeColumnMoveEventFn;
|
|
47
57
|
tableReady?: GeTableReadyEventFn;
|
|
48
58
|
licenseKey?: string;
|
|
49
59
|
/**
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("solid-js/web"),d=require("solid-js"),c=require("@guiexpert/table");class m{constructor(t){this.code=t}render(t,n,o,i,a,s,C){const e=g.mergeProps({rowIndex:n,columnIndex:o,areaIdent:i,areaModel:a,cellValue:s});return g.render(()=>this.code(e),t)}}class b{constructor(t){this.code=t}render(t,n,o){const i={row:n,rowIndex:o.rowIndex,tableApi:o.tableApi,context:o};return g.render(()=>this.code(i),t)}}var f=g.template("<div>");const v=p=>{let t;const n=d.mergeProps({tableModel:null,tableOptions:new c.TableOptions},p),o=(e,r,l)=>{l&&l(r),t&&t.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:e!=="scroll"}))},i={onSelectionChanged:e=>o("selectionChanged",e,n.selectionChanged),onFocusChanged:e=>o("focusChanged",e,n.focusChanged),onScroll:e=>o("scroll",e,n.scroll),onCheckboxChanged:e=>o("checkboxChanged",e,n.checkboxChanged),onContextmenu:e=>o("contextmenu",e,n.contextmenu),onModelChanged:e=>o("modelChanged",e,n.modelChanged),onMouseClicked:e=>o("mouseClicked",e,n.mouseClicked),onMouseDragging:e=>o("mouseDragging",e,n.mouseDragging),onMouseDraggingEnd:e=>o("mouseDraggingEnd",e,n.mouseDraggingEnd),onMouseMoved:e=>o("mouseMoved",e,n.mouseMoved),onStateChanged:e=>o("stateChanged",e,n.stateChanged),onRowDragStart:e=>o("rowDragStart",e,n.rowDragStart),onRowDragMove:e=>o("rowDragMove",e,n.rowDragMove),onRowDragEnd:e=>o("rowDragEnd",e,n.rowDragEnd),onBatchEditChanged:e=>o("batchEditChanged",e,n.batchEditChanged),onDetailExpandedChanged:e=>o("detailExpandedChanged",e,n.detailExpandedChanged),onEditingChanged:e=>o("editingChanged",e,n.editingChanged),onUndoStackChanged:e=>o("undoStackChanged",e,n.undoStackChanged),onColumnResizeStart:e=>o("columnResizeStart",e,n.columnResizeStart),onColumnResizeEnd:e=>o("columnResizeEnd",e,n.columnResizeEnd),onColumnMoveStart:e=>o("columnMoveStart",e,n.columnMoveStart),onColumnMoveEnd:e=>o("columnMoveEnd",e,n.columnMoveEnd)};let a,s=!1;const C=e=>{e?(a==null||a.showLoadingOverlay(),s=!0):s&&(a==null||a.hideOverlay(),s=!1)};return d.createEffect(()=>{const e=n.tableModel,r=n.tableOptions,l=t;if(!l||!e)return;const h=d.untrack(()=>{const u=new c.TableScope(l,e,new c.SimpleDomService,r??new c.TableOptions,i);return u.firstInit(),a=u,s=!1,C(!!n.loading),o("tableReady",u.getApi(),n.tableReady),u});d.onCleanup(()=>{a===h&&(a=void 0),h.destroy()})}),d.createEffect(()=>{const e=!!n.loading;d.untrack(()=>C(e))}),d.createEffect(()=>{const e=n.licenseKey;e&&c.LicenseManager.getInstance().setLicenseKey(e)}),(()=>{var e=f(),r=t;return typeof r=="function"?g.use(r,e):t=e,e})()};exports.ComponentRendererWrapper=m;exports.DetailComponentRendererWrapper=b;exports.GuiexpertTable=v;
|
package/index.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { mergeProps as
|
|
2
|
-
import { mergeProps as
|
|
3
|
-
import { TableOptions as
|
|
4
|
-
class
|
|
1
|
+
import { mergeProps as v, render as p, use as f, template as E } from "solid-js/web";
|
|
2
|
+
import { mergeProps as b, createEffect as u, untrack as h, onCleanup as M } from "solid-js";
|
|
3
|
+
import { TableOptions as C, LicenseManager as w, TableScope as D, SimpleDomService as S } from "@guiexpert/table";
|
|
4
|
+
class z {
|
|
5
5
|
constructor(t) {
|
|
6
6
|
this.code = t;
|
|
7
7
|
}
|
|
8
8
|
render(t, n, o, s, a, r, c) {
|
|
9
|
-
const e =
|
|
9
|
+
const e = v({
|
|
10
10
|
rowIndex: n,
|
|
11
11
|
columnIndex: o,
|
|
12
12
|
areaIdent: s,
|
|
13
13
|
areaModel: a,
|
|
14
14
|
cellValue: r
|
|
15
15
|
});
|
|
16
|
-
return
|
|
16
|
+
return p(
|
|
17
17
|
() => this.code(e),
|
|
18
18
|
t
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
class
|
|
22
|
+
class O {
|
|
23
23
|
constructor(t) {
|
|
24
24
|
this.code = t;
|
|
25
25
|
}
|
|
26
26
|
render(t, n, o) {
|
|
27
27
|
const s = { row: n, rowIndex: o.rowIndex, tableApi: o.tableApi, context: o };
|
|
28
|
-
return
|
|
28
|
+
return p(() => this.code(s), t);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
var
|
|
32
|
-
const
|
|
31
|
+
var R = /* @__PURE__ */ E("<div>");
|
|
32
|
+
const I = (g) => {
|
|
33
33
|
let t;
|
|
34
|
-
const n =
|
|
34
|
+
const n = b({
|
|
35
35
|
tableModel: null,
|
|
36
|
-
tableOptions: new
|
|
37
|
-
},
|
|
38
|
-
|
|
36
|
+
tableOptions: new C()
|
|
37
|
+
}, g), o = (e, d, i) => {
|
|
38
|
+
i && i(d), t && t.dispatchEvent(new CustomEvent(e, {
|
|
39
39
|
detail: d,
|
|
40
40
|
bubbles: e !== "scroll"
|
|
41
41
|
}));
|
|
@@ -57,36 +57,40 @@ const L = (l) => {
|
|
|
57
57
|
onBatchEditChanged: (e) => o("batchEditChanged", e, n.batchEditChanged),
|
|
58
58
|
onDetailExpandedChanged: (e) => o("detailExpandedChanged", e, n.detailExpandedChanged),
|
|
59
59
|
onEditingChanged: (e) => o("editingChanged", e, n.editingChanged),
|
|
60
|
-
onUndoStackChanged: (e) => o("undoStackChanged", e, n.undoStackChanged)
|
|
60
|
+
onUndoStackChanged: (e) => o("undoStackChanged", e, n.undoStackChanged),
|
|
61
|
+
onColumnResizeStart: (e) => o("columnResizeStart", e, n.columnResizeStart),
|
|
62
|
+
onColumnResizeEnd: (e) => o("columnResizeEnd", e, n.columnResizeEnd),
|
|
63
|
+
onColumnMoveStart: (e) => o("columnMoveStart", e, n.columnMoveStart),
|
|
64
|
+
onColumnMoveEnd: (e) => o("columnMoveEnd", e, n.columnMoveEnd)
|
|
61
65
|
};
|
|
62
66
|
let a, r = !1;
|
|
63
67
|
const c = (e) => {
|
|
64
68
|
e ? (a == null || a.showLoadingOverlay(), r = !0) : r && (a == null || a.hideOverlay(), r = !1);
|
|
65
69
|
};
|
|
66
|
-
return
|
|
67
|
-
const e = n.tableModel, d = n.tableOptions,
|
|
68
|
-
if (!
|
|
70
|
+
return u(() => {
|
|
71
|
+
const e = n.tableModel, d = n.tableOptions, i = t;
|
|
72
|
+
if (!i || !e)
|
|
69
73
|
return;
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
return
|
|
74
|
+
const m = h(() => {
|
|
75
|
+
const l = new D(i, e, new S(), d ?? new C(), s);
|
|
76
|
+
return l.firstInit(), a = l, r = !1, c(!!n.loading), o("tableReady", l.getApi(), n.tableReady), l;
|
|
73
77
|
});
|
|
74
|
-
|
|
75
|
-
a ===
|
|
78
|
+
M(() => {
|
|
79
|
+
a === m && (a = void 0), m.destroy();
|
|
76
80
|
});
|
|
77
|
-
}),
|
|
81
|
+
}), u(() => {
|
|
78
82
|
const e = !!n.loading;
|
|
79
|
-
|
|
80
|
-
}),
|
|
83
|
+
h(() => c(e));
|
|
84
|
+
}), u(() => {
|
|
81
85
|
const e = n.licenseKey;
|
|
82
|
-
e &&
|
|
86
|
+
e && w.getInstance().setLicenseKey(e);
|
|
83
87
|
}), (() => {
|
|
84
|
-
var e =
|
|
85
|
-
return typeof d == "function" ?
|
|
88
|
+
var e = R(), d = t;
|
|
89
|
+
return typeof d == "function" ? f(d, e) : t = e, e;
|
|
86
90
|
})();
|
|
87
91
|
};
|
|
88
92
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
z as ComponentRendererWrapper,
|
|
94
|
+
O as DetailComponentRendererWrapper,
|
|
95
|
+
I as GuiexpertTable
|
|
92
96
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guiexpert/solid-table",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.113",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dr. Marc Kronberg <info@gui.expert> (https://gui.expert)",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"tslib": "^2.3.0",
|
|
34
|
-
"@guiexpert/table": "^1.1.
|
|
34
|
+
"@guiexpert/table": "^1.1.113"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"solid-js": "^1.0.0"
|