@guiexpert/solid-table 1.1.113 → 1.1.114

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.
@@ -1,4 +1,4 @@
1
- import { FocusModelIf, GeBatchEditEvent, GeDetailEvent, GeEditEvent, GeUndoEvent, GeColumnResizeEvent, GeColumnMoveEvent, GeModelChangeEvent, GeMouseEvent, GeRowDragEvent, GeScrollEvent, GeStateChangeEvent, SelectionModelIf, TableApi, TableModelIf, TableOptions } from '@guiexpert/table';
1
+ import { FocusModelIf, GeBatchEditEvent, GeDetailEvent, GeEditEvent, GeUndoEvent, GeColumnResizeEvent, GeColumnMoveEvent, GeFilterEvent, 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;
@@ -15,6 +15,7 @@ export type GeEditEventFn = (evt: GeEditEvent) => void;
15
15
  export type GeUndoEventFn = (evt: GeUndoEvent) => void;
16
16
  export type GeColumnResizeEventFn = (evt: GeColumnResizeEvent) => void;
17
17
  export type GeColumnMoveEventFn = (evt: GeColumnMoveEvent) => void;
18
+ export type GeFilterEventFn = (evt: GeFilterEvent) => void;
18
19
  export interface GuiexpertTableProps {
19
20
  tableModel: TableModelIf;
20
21
  tableOptions?: TableOptions;
@@ -54,6 +55,8 @@ export interface GuiexpertTableProps {
54
55
  columnMoveStart?: GeColumnMoveEventFn;
55
56
  /** A column move by the user ended – `evt.columnOrder` (since 1.1.110). */
56
57
  columnMoveEnd?: GeColumnMoveEventFn;
58
+ /** Column filters changed (since 1.1.114). */
59
+ filterChanged?: GeFilterEventFn;
57
60
  tableReady?: GeTableReadyEventFn;
58
61
  licenseKey?: string;
59
62
  /**
package/index.cjs CHANGED
@@ -1 +1 @@
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;
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,h){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=C=>{let t;const n=d.mergeProps({tableModel:null,tableOptions:new c.TableOptions},C),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),onFilterChanged:e=>o("filterChanged",e,n.filterChanged)};let a,s=!1;const h=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 p=d.untrack(()=>{const u=new c.TableScope(l,e,new c.SimpleDomService,r??new c.TableOptions,i);return u.firstInit(),a=u,s=!1,h(!!n.loading),o("tableReady",u.getApi(),n.tableReady),u});d.onCleanup(()=>{a===p&&(a=void 0),p.destroy()})}),d.createEffect(()=>{const e=!!n.loading;d.untrack(()=>h(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,12 +1,12 @@
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";
1
+ import { mergeProps as f, render as p, use as v, template as E } from "solid-js/web";
2
+ import { mergeProps as b, createEffect as u, untrack as m, onCleanup as M } from "solid-js";
3
3
  import { TableOptions as C, LicenseManager as w, TableScope as D, SimpleDomService as S } from "@guiexpert/table";
4
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 = v({
9
+ const e = f({
10
10
  rowIndex: n,
11
11
  columnIndex: o,
12
12
  areaIdent: s,
@@ -61,7 +61,8 @@ const I = (g) => {
61
61
  onColumnResizeStart: (e) => o("columnResizeStart", e, n.columnResizeStart),
62
62
  onColumnResizeEnd: (e) => o("columnResizeEnd", e, n.columnResizeEnd),
63
63
  onColumnMoveStart: (e) => o("columnMoveStart", e, n.columnMoveStart),
64
- onColumnMoveEnd: (e) => o("columnMoveEnd", e, n.columnMoveEnd)
64
+ onColumnMoveEnd: (e) => o("columnMoveEnd", e, n.columnMoveEnd),
65
+ onFilterChanged: (e) => o("filterChanged", e, n.filterChanged)
65
66
  };
66
67
  let a, r = !1;
67
68
  const c = (e) => {
@@ -71,22 +72,22 @@ const I = (g) => {
71
72
  const e = n.tableModel, d = n.tableOptions, i = t;
72
73
  if (!i || !e)
73
74
  return;
74
- const m = h(() => {
75
+ const h = m(() => {
75
76
  const l = new D(i, e, new S(), d ?? new C(), s);
76
77
  return l.firstInit(), a = l, r = !1, c(!!n.loading), o("tableReady", l.getApi(), n.tableReady), l;
77
78
  });
78
79
  M(() => {
79
- a === m && (a = void 0), m.destroy();
80
+ a === h && (a = void 0), h.destroy();
80
81
  });
81
82
  }), u(() => {
82
83
  const e = !!n.loading;
83
- h(() => c(e));
84
+ m(() => c(e));
84
85
  }), u(() => {
85
86
  const e = n.licenseKey;
86
87
  e && w.getInstance().setLicenseKey(e);
87
88
  }), (() => {
88
89
  var e = R(), d = t;
89
- return typeof d == "function" ? f(d, e) : t = e, e;
90
+ return typeof d == "function" ? v(d, e) : t = e, e;
90
91
  })();
91
92
  };
92
93
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/solid-table",
3
- "version": "1.1.113",
3
+ "version": "1.1.114",
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.113"
34
+ "@guiexpert/table": "^1.1.114"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "solid-js": "^1.0.0"