tsgrid-ui 1.0.0 → 1.0.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,55 @@
2
2
 
3
3
  All notable changes to **TsGrid UI** will be documented in this file.
4
4
 
5
+ ## [1.0.1] — Consumer DX fixes
6
+
7
+ Patch release driven by integrating tsgrid-ui v1.0.0 in a real Angular 21 standalone project. Three changes, no breaking, no API removals.
8
+
9
+ ### Added — `sideEffects` declaration
10
+
11
+ `package.json` now declares `"sideEffects": ["./dist/tsgrid-ui.css", "./dist/tsgrid-ui.min.css"]`. Modern bundlers (esbuild, Vite, webpack 5+, Rollup) can now tree-shake widgets the consumer does not import. Importing only `TsGrid` no longer drags `TsForm`, `TsLayout`, `TsSidebar`, `TsTabs`, `TsPopup`, `TsTooltip` into the final bundle.
12
+
13
+ ### Added — public type exports
14
+
15
+ The barrel `src/index.ts` previously re-exported only the **classes** (`TsGrid`, `TsForm`, etc.). Auxiliary interfaces and types lived in `dist/tsgrid-ui.d.ts` but were inaccessible — consumers had to type their inputs as `any` or import from internal paths. v1.0.1 re-exports the full public type surface:
16
+
17
+ - **TsGrid**: `TsGridRecord`, `TsGridColumn`, `TsGridSearch`, `TsGridSortData`, `TsGridSelection`, `TsGridCellSelection`, `TsGridRange`, `TsGridRangeEndpoint`, `TsGridGroupBy`
18
+ - **TsField**: `TsFieldOptions`, `TsFieldElement`, `TsFieldNumericOptions`, `TsFieldColorOptions`, `TsFieldDateOptions`, `TsFieldTimeOptions`, `TsFieldDateTimeOptions`, `TsFieldListOptions`, `TsFieldEnumOptions`, `TsFieldFileOptions`
19
+ - **TsLayout**: `TsLayoutPanel`, `TsPanelType`, `TsPanelContent`
20
+ - **TsSidebar**: `TsSidebarRefreshOptions`, `TsSidebarUpdateOptions`, `TsSidebarSetCountOptions`, `TsSidebarFindOptions`, `TsSidebarSortOptions`
21
+ - **TsLocale / TsUtils**: `TsLocaleSettings`, `TsMessageProm`, `TsMessageWhere`, `TsMessageOptions`, `TsMenuItem`, `TsColorRgb`, `TsLockOptions`, `TsCloneOptions`
22
+ - **Common**: `RecId`, `TsEventData`, `TsEventPayload`
23
+
24
+ Consumers can now write `import type { TsGridColumn, TsGridRecord } from 'tsgrid-ui'` and get full autocomplete + type checking.
25
+
26
+ ### Added — `TsEventPayload` interface and `toSafeEvent()` helper
27
+
28
+ The per-class event-handler signatures (`onSelect: (event: CustomEvent) => void`) are misleading: the runtime always passes a `TsEvent` instance from the TsBase event system, **not** a DOM `CustomEvent`. The real payload contains a circular reference (`event.owner` ↔ `widget.activeEvents[]`), so calling `JSON.stringify(event)` throws "Converting circular structure to JSON". This breaks reactive state in any framework: Angular signals + JsonPipe, React state + Redux DevTools, Vue ref + Pinia, etc.
29
+
30
+ This release adds:
31
+
32
+ - **`interface TsEventPayload<TDetail>`** — accurate shape of the object passed to handlers, with the `owner` field documented as circular and unsafe to serialize. The misleading `(event: CustomEvent) => void` per-class declarations remain for backwards compatibility and will be corrected in v2.0.
33
+ - **`function toSafeEvent(event)`** — extracts a JSON-serializable subset (`type`, `phase`, `detail`, `isStopped`, `isCancelled`) for use in reactive state.
34
+
35
+ ```ts
36
+ import { toSafeEvent } from 'tsgrid-ui'
37
+
38
+ grid.on('select', (event) => {
39
+ mySignal.set(toSafeEvent(event)) // safe to JSON.stringify
40
+ })
41
+ ```
42
+
43
+ ### Bundle-size impact (measured)
44
+
45
+ Bundle in a fresh Angular 21 standalone project consuming only `TsGrid`:
46
+
47
+ | | v1.0.0 | v1.0.1 |
48
+ | --- | --- | --- |
49
+ | `main.js` raw | 506.18 KB | _re-measure pending_ |
50
+ | `main.js` gzip | 121.90 KB | _re-measure pending_ |
51
+
52
+ Re-measurement after publish lives in the `tsgrid-angular-example` demo repo.
53
+
5
54
  ## [1.0.0] — Hard Fork from w2ui v2.1
6
55
 
7
56
  This is the initial public release of **TsGrid UI**, a hard fork of [w2ui](https://github.com/vitmalina/w2ui) by Vit Malina. See [README — Acknowledgments](README.md#acknowledgments) for the relationship to upstream and [MIGRATION-FROM-W2UI.md](MIGRATION-FROM-W2UI.md) for the complete renaming map if you're coming from w2ui.
package/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- MIT License
2
-
3
- Copyright (c) 2014 Vit Malina <vitmalina@gmail.com>
4
- Copyright (c) 2026 DaverSoGT <jodaniheso@gmail.com>
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in
14
- all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- THE SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2014 Vit Malina <vitmalina@gmail.com>
4
+ Copyright (c) 2026 DaverSoGT <jodaniheso@gmail.com>
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
@@ -1,4 +1,4 @@
1
- /* tsgrid-ui 1.0.x (nightly) (5/8/2026, 9:17:22 PM) (c) 2014 vitmalina@gmail.com, (c) 2026 DaverSoGT — MIT */
1
+ /* tsgrid-ui 1.0.x (nightly) (5/9/2026, 12:21:22 AM) (c) 2014 vitmalina@gmail.com, (c) 2026 DaverSoGT — MIT */
2
2
  /**
3
3
  * TODO:
4
4
  * - remove default styling, only keep tsg-* styles
@@ -9,7 +9,7 @@
9
9
  */
10
10
  @font-face {
11
11
  font-family: "tsgrid-font";
12
- src: url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAApYAAsAAAAAD0wAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAQQAAAFZdKW6ZY21hcAAAAYgAAACiAAACNBnCLmJnbHlmAAACLAAABd8AAAfo+edccWhlYWQAAAgMAAAAMAAAADYzaPjRaGhlYQAACDwAAAAYAAAAJA3eCBJobXR4AAAIVAAAABAAAABAeA8AAGxvY2EAAAhkAAAAIgAAACIO+gzSbWF4cAAACIgAAAAfAAAAIAEgAGBuYW1lAAAIqAAAATAAAAI6ubjYZ3Bvc3QAAAnYAAAAgAAAAKn1lm/4eJxjYGRgYOBiMGCwY2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mal2VNY4MC9xJ75UfUXw9owY7ElTWRW824ZWaGoehuaJX2IdTVVYIyIn/mTD5niST+me2hWeJxtx1EOgjAQRdE+aAuKCizERdUyCrF0mk5JZPdq/PX83FxVqZ9e/TegQg0NA4sGLQ44osMJZ1zQY8Co6hu/jJ/JP63nwFmaT7Y1ivGZRfSUORlaU9k72un63URZL/HOJjkpZBNFvwSdwiY2U2A3WSGX/dwKlbLEhyj1BqYnJNk=") format("woff");
13
13
  font-weight: normal;
14
14
  font-style: normal;
15
15
  }
@@ -8,6 +8,34 @@
8
8
  * - added unmount that cleans up the box
9
9
  *
10
10
  */
11
+ /**
12
+ * Payload object passed to handlers registered via `.on(eventName, handler)`.
13
+ *
14
+ * IMPORTANT — circular references:
15
+ * `event.owner` points back to the widget that triggered the event, and that
16
+ * widget keeps `activeEvents: TsEvent[]` referencing this same payload.
17
+ * Calling `JSON.stringify(event)` will throw "Converting circular structure
18
+ * to JSON". Use `toSafeEvent(event)` from `tsgrid-ui` to extract a
19
+ * serializable subset before storing in reactive state (Angular signals,
20
+ * React state, Pinia/Redux stores, etc.).
21
+ *
22
+ * Note: the per-class declarations like `onSelect: (event: CustomEvent) => void`
23
+ * in TsGrid/TsForm/etc. are historical noise — the runtime always passes a
24
+ * `TsEventPayload`, never a DOM `CustomEvent`. This will be corrected in v2.0.
25
+ */
26
+ interface TsEventPayload<TDetail = unknown> {
27
+ type: string | null;
28
+ phase: 'before' | 'after' | string;
29
+ detail: TDetail & TsEventData;
30
+ target: unknown;
31
+ object: unknown;
32
+ isStopped: boolean;
33
+ isCancelled: boolean;
34
+ /** Reference to the widget that triggered this event. CIRCULAR — do not serialize. */
35
+ owner: unknown;
36
+ /** @internal — Promise resolved when listeners settle; do not depend on shape. */
37
+ complete?: Promise<unknown>;
38
+ }
11
39
  interface TsEventData {
12
40
  type?: string | null;
13
41
  target?: unknown;
@@ -48,6 +76,24 @@ declare class TsEvent {
48
76
  preventDefault(): void;
49
77
  stopPropagation(): void;
50
78
  }
79
+ /**
80
+ * Extract a JSON-serializable subset of a TsEvent payload, dropping the
81
+ * circular `owner` and `complete` references. Use before storing in
82
+ * Angular signals, React state, Pinia/Redux stores, or any DevTools that
83
+ * snapshots state via JSON.
84
+ *
85
+ * @example
86
+ * grid.on('select', (event) => {
87
+ * this.lastSelection.set(toSafeEvent(event))
88
+ * })
89
+ */
90
+ declare function toSafeEvent<TDetail = unknown>(event: unknown): {
91
+ type: string | null;
92
+ phase: string;
93
+ detail: TDetail & TsEventData;
94
+ isStopped: boolean;
95
+ isCancelled: boolean;
96
+ };
51
97
  declare class TsBase {
52
98
  activeEvents: TsEvent[];
53
99
  listeners: TsEventListener[];
@@ -2429,4 +2475,4 @@ declare class TsField extends TsBase {
2429
2475
  moveCaret2end(): void;
2430
2476
  }
2431
2477
 
2432
- export { Tooltip, TsAlert, TsBase, TsColor, TsConfirm, TsDate, TsDialog, TsEvent, TsField, TsForm, TsGrid, TsLayout, TsLocale, TsMenu, TsPopup, TsPrompt, TsSidebar, TsTabs, TsToolbar, TsTooltip, TsUi, TsUtils, query };
2478
+ export { type RecId, Tooltip, TsAlert, TsBase, type TsCloneOptions, TsColor, type TsColorRgb, TsConfirm, TsDate, TsDialog, TsEvent, type TsEventData, type TsEventPayload, TsField, type TsFieldColorOptions, type TsFieldDateOptions, type TsFieldDateTimeOptions, type TsFieldElement, type TsFieldEnumOptions, type TsFieldFileOptions, type TsFieldListOptions, type TsFieldNumericOptions, type TsFieldOptions, type TsFieldTimeOptions, TsForm, TsGrid, type TsGridCellSelection, type TsGridColumn, type TsGridGroupBy, type TsGridRange, type TsGridRangeEndpoint, type TsGridRecord, type TsGridSearch, type TsGridSelection, type TsGridSortData, TsLayout, type TsLayoutPanel, TsLocale, type TsLocaleSettings, type TsLockOptions, TsMenu, type TsMenuItem, type TsMessageOptions, type TsMessageProm, type TsMessageWhere, type TsPanelContent, type TsPanelType, TsPopup, TsPrompt, TsSidebar, type TsSidebarFindOptions, type TsSidebarRefreshOptions, type TsSidebarSetCountOptions, type TsSidebarSortOptions, type TsSidebarUpdateOptions, TsTabs, TsToolbar, TsTooltip, TsUi, TsUtils, query, toSafeEvent };
@@ -65,6 +65,19 @@ var TsEvent = class {
65
65
  this.isStopped = true;
66
66
  }
67
67
  };
68
+ function toSafeEvent(event2) {
69
+ if (typeof event2 !== "object" || event2 === null) {
70
+ return { type: null, phase: "before", detail: {}, isStopped: false, isCancelled: false };
71
+ }
72
+ const ev = event2;
73
+ return {
74
+ type: typeof ev["type"] === "string" ? ev["type"] : null,
75
+ phase: typeof ev["phase"] === "string" ? ev["phase"] : "before",
76
+ detail: ev["detail"] ?? {},
77
+ isStopped: ev["isStopped"] === true,
78
+ isCancelled: ev["isCancelled"] === true
79
+ };
80
+ }
68
81
  var TsBase = class {
69
82
  activeEvents = [];
70
83
  listeners = [];
@@ -24232,5 +24245,6 @@ export {
24232
24245
  TsTooltip,
24233
24246
  TsUi,
24234
24247
  TsUtils,
24235
- query
24248
+ query,
24249
+ toSafeEvent
24236
24250
  };
package/dist/tsgrid-ui.js CHANGED
@@ -1,4 +1,4 @@
1
- /* tsgrid-ui 1.0.x (nightly) (5/8/2026, 9:17:29 PM) (c) 2014 vitmalina@gmail.com, (c) 2026 DaverSoGT — MIT */
1
+ /* tsgrid-ui 1.0.x (nightly) (5/9/2026, 12:21:32 AM) (c) 2014 vitmalina@gmail.com, (c) 2026 DaverSoGT — MIT */
2
2
  "use strict";
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;