@guiexpert/solid-table 1.1.94 → 1.1.96
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 +9 -1
- package/index.cjs +1 -1
- package/index.js +42 -38
- package/package.json +2 -2
package/GuiexpertTableProps.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FocusModelIf, GeModelChangeEvent, GeMouseEvent, GeScrollEvent, GeStateChangeEvent, SelectionModelIf, TableApi, TableModelIf, TableOptions } from '@guiexpert/table';
|
|
1
|
+
import { FocusModelIf, GeBatchEditEvent, 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;
|
|
@@ -8,6 +8,8 @@ export type GeSelectionChangeEventFn = (evt: SelectionModelIf) => void;
|
|
|
8
8
|
export type GeFocusChangeEventFn = (evt: FocusModelIf) => void;
|
|
9
9
|
export type GeScrollEventFn = (evt: GeScrollEvent) => void;
|
|
10
10
|
export type GeStateChangeEventFn = (evt: GeStateChangeEvent) => void;
|
|
11
|
+
export type GeRowDragEventFn = (evt: GeRowDragEvent) => void;
|
|
12
|
+
export type GeBatchEditEventFn = (evt: GeBatchEditEvent) => void;
|
|
11
13
|
export interface GuiexpertTableProps {
|
|
12
14
|
tableModel: TableModelIf;
|
|
13
15
|
tableOptions?: TableOptions;
|
|
@@ -27,6 +29,12 @@ export interface GuiexpertTableProps {
|
|
|
27
29
|
* @since 1.1.92
|
|
28
30
|
*/
|
|
29
31
|
stateChanged?: GeStateChangeEventFn;
|
|
32
|
+
/** Row drag (since 1.1.95, handles via `ColumnDef.rowDrag`): started / target changed / ended ("end" or "cancel"). */
|
|
33
|
+
rowDragStart?: GeRowDragEventFn;
|
|
34
|
+
rowDragMove?: GeRowDragEventFn;
|
|
35
|
+
rowDragEnd?: GeRowDragEventFn;
|
|
36
|
+
/** Batch edit: values marked, set back, written or discarded (since 1.1.96). */
|
|
37
|
+
batchEditChanged?: GeBatchEditEventFn;
|
|
30
38
|
tableReady?: GeTableReadyEventFn;
|
|
31
39
|
licenseKey?: string;
|
|
32
40
|
/**
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("solid-js/web"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("solid-js/web"),s=require("solid-js"),i=require("@guiexpert/table");class b{constructor(a){this.code=a}render(a,o,n,u,t,d,h){const e=g.mergeProps({rowIndex:o,columnIndex:n,areaIdent:u,areaModel:t,cellValue:d});return g.render(()=>this.code(e),a)}}var m=g.template("<div>");const f=p=>{let a;const o=s.mergeProps({tableModel:null,tableOptions:new i.TableOptions},p),n=(e,r,l)=>{l&&l(r),a&&a.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:e!=="scroll"}))},u={onSelectionChanged:e=>n("selectionChanged",e,o.selectionChanged),onFocusChanged:e=>n("focusChanged",e,o.focusChanged),onScroll:e=>n("scroll",e,o.scroll),onCheckboxChanged:e=>n("checkboxChanged",e,o.checkboxChanged),onContextmenu:e=>n("contextmenu",e,o.contextmenu),onModelChanged:e=>n("modelChanged",e,o.modelChanged),onMouseClicked:e=>n("mouseClicked",e,o.mouseClicked),onMouseDragging:e=>n("mouseDragging",e,o.mouseDragging),onMouseDraggingEnd:e=>n("mouseDraggingEnd",e,o.mouseDraggingEnd),onMouseMoved:e=>n("mouseMoved",e,o.mouseMoved),onStateChanged:e=>n("stateChanged",e,o.stateChanged),onRowDragStart:e=>n("rowDragStart",e,o.rowDragStart),onRowDragMove:e=>n("rowDragMove",e,o.rowDragMove),onRowDragEnd:e=>n("rowDragEnd",e,o.rowDragEnd),onBatchEditChanged:e=>n("batchEditChanged",e,o.batchEditChanged)};let t,d=!1;const h=e=>{e?(t==null||t.showLoadingOverlay(),d=!0):d&&(t==null||t.hideOverlay(),d=!1)};return s.createEffect(()=>{const e=o.tableModel,r=o.tableOptions,l=a;if(!l||!e)return;const C=s.untrack(()=>{const c=new i.TableScope(l,e,new i.SimpleDomService,r??new i.TableOptions,u);return c.firstInit(),t=c,d=!1,h(!!o.loading),n("tableReady",c.getApi(),o.tableReady),c});s.onCleanup(()=>{t===C&&(t=void 0),C.destroy()})}),s.createEffect(()=>{const e=!!o.loading;s.untrack(()=>h(e))}),s.createEffect(()=>{const e=o.licenseKey;e&&i.LicenseManager.getInstance().setLicenseKey(e)}),(()=>{var e=m(),r=a;return typeof r=="function"?g.use(r,e):a=e,e})()};exports.ComponentRendererWrapper=b;exports.GuiexpertTable=f;
|
package/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { mergeProps as C, render as f, use as b, template as v } from "solid-js/web";
|
|
2
|
-
import { mergeProps as
|
|
3
|
-
import { TableOptions as
|
|
4
|
-
class
|
|
5
|
-
constructor(
|
|
6
|
-
this.code =
|
|
2
|
+
import { mergeProps as w, createEffect as c, untrack as u, onCleanup as D } from "solid-js";
|
|
3
|
+
import { TableOptions as p, LicenseManager as M, TableScope as E, SimpleDomService as y } from "@guiexpert/table";
|
|
4
|
+
class R {
|
|
5
|
+
constructor(a) {
|
|
6
|
+
this.code = a;
|
|
7
7
|
}
|
|
8
|
-
render(
|
|
8
|
+
render(a, o, n, i, t, s, l) {
|
|
9
9
|
const e = C({
|
|
10
10
|
rowIndex: o,
|
|
11
11
|
columnIndex: n,
|
|
12
|
-
areaIdent:
|
|
12
|
+
areaIdent: i,
|
|
13
13
|
areaModel: t,
|
|
14
|
-
cellValue:
|
|
14
|
+
cellValue: s
|
|
15
15
|
});
|
|
16
16
|
return f(
|
|
17
17
|
() => this.code(e),
|
|
18
|
-
|
|
18
|
+
a
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
var
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
const o =
|
|
22
|
+
var x = /* @__PURE__ */ v("<div>");
|
|
23
|
+
const L = (h) => {
|
|
24
|
+
let a;
|
|
25
|
+
const o = w({
|
|
26
26
|
tableModel: null,
|
|
27
|
-
tableOptions: new
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
detail:
|
|
27
|
+
tableOptions: new p()
|
|
28
|
+
}, h), n = (e, r, d) => {
|
|
29
|
+
d && d(r), a && a.dispatchEvent(new CustomEvent(e, {
|
|
30
|
+
detail: r,
|
|
31
31
|
bubbles: e !== "scroll"
|
|
32
32
|
}));
|
|
33
|
-
},
|
|
33
|
+
}, i = {
|
|
34
34
|
onSelectionChanged: (e) => n("selectionChanged", e, o.selectionChanged),
|
|
35
35
|
onFocusChanged: (e) => n("focusChanged", e, o.focusChanged),
|
|
36
36
|
onScroll: (e) => n("scroll", e, o.scroll),
|
|
@@ -41,35 +41,39 @@ const P = (m) => {
|
|
|
41
41
|
onMouseDragging: (e) => n("mouseDragging", e, o.mouseDragging),
|
|
42
42
|
onMouseDraggingEnd: (e) => n("mouseDraggingEnd", e, o.mouseDraggingEnd),
|
|
43
43
|
onMouseMoved: (e) => n("mouseMoved", e, o.mouseMoved),
|
|
44
|
-
onStateChanged: (e) => n("stateChanged", e, o.stateChanged)
|
|
44
|
+
onStateChanged: (e) => n("stateChanged", e, o.stateChanged),
|
|
45
|
+
onRowDragStart: (e) => n("rowDragStart", e, o.rowDragStart),
|
|
46
|
+
onRowDragMove: (e) => n("rowDragMove", e, o.rowDragMove),
|
|
47
|
+
onRowDragEnd: (e) => n("rowDragEnd", e, o.rowDragEnd),
|
|
48
|
+
onBatchEditChanged: (e) => n("batchEditChanged", e, o.batchEditChanged)
|
|
45
49
|
};
|
|
46
|
-
let t,
|
|
47
|
-
const
|
|
48
|
-
e ? (t == null || t.showLoadingOverlay(),
|
|
50
|
+
let t, s = !1;
|
|
51
|
+
const l = (e) => {
|
|
52
|
+
e ? (t == null || t.showLoadingOverlay(), s = !0) : s && (t == null || t.hideOverlay(), s = !1);
|
|
49
53
|
};
|
|
50
|
-
return
|
|
51
|
-
const e = o.tableModel,
|
|
52
|
-
if (!
|
|
54
|
+
return c(() => {
|
|
55
|
+
const e = o.tableModel, r = o.tableOptions, d = a;
|
|
56
|
+
if (!d || !e)
|
|
53
57
|
return;
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
return
|
|
58
|
+
const m = u(() => {
|
|
59
|
+
const g = new E(d, e, new y(), r ?? new p(), i);
|
|
60
|
+
return g.firstInit(), t = g, s = !1, l(!!o.loading), n("tableReady", g.getApi(), o.tableReady), g;
|
|
57
61
|
});
|
|
58
|
-
|
|
59
|
-
t ===
|
|
62
|
+
D(() => {
|
|
63
|
+
t === m && (t = void 0), m.destroy();
|
|
60
64
|
});
|
|
61
|
-
}),
|
|
65
|
+
}), c(() => {
|
|
62
66
|
const e = !!o.loading;
|
|
63
|
-
|
|
64
|
-
}),
|
|
67
|
+
u(() => l(e));
|
|
68
|
+
}), c(() => {
|
|
65
69
|
const e = o.licenseKey;
|
|
66
|
-
e &&
|
|
70
|
+
e && M.getInstance().setLicenseKey(e);
|
|
67
71
|
}), (() => {
|
|
68
|
-
var e =
|
|
69
|
-
return typeof
|
|
72
|
+
var e = x(), r = a;
|
|
73
|
+
return typeof r == "function" ? b(r, e) : a = e, e;
|
|
70
74
|
})();
|
|
71
75
|
};
|
|
72
76
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
R as ComponentRendererWrapper,
|
|
78
|
+
L as GuiexpertTable
|
|
75
79
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guiexpert/solid-table",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.96",
|
|
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.96"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"solid-js": "^1.0.0"
|