tsgrid-ui 2.3.0 → 2.4.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 +63 -0
- package/dist/tsgrid-ui.css +2 -2
- package/dist/tsgrid-ui.d.ts +25 -44
- package/dist/tsgrid-ui.es6.js +1494 -1469
- package/dist/tsgrid-ui.es6.js.map +1 -0
- package/dist/tsgrid-ui.es6.min.js +600 -0
- package/dist/tsgrid-ui.js +1494 -1470
- package/dist/tsgrid-ui.min.css +2 -2
- package/dist/tsgrid-ui.min.js +625 -0
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,69 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to **TsGrid UI** will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## v2.4.1 — 2026-05-13
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **d.ts correctness** — `dist/tsgrid-ui.d.ts` referenced `TsFormatter` and `TsTimeResult` in public method signatures (`formatters: Record<string, TsFormatter>`, `isTime(...): boolean | TsTimeResult`) but did NOT declare them — they were stripped by tsup `stripInternal` in v2.4.0. Consumers compiling with strict TypeScript saw unresolved type references. Removed the `@internal` JSDoc tag from `TsFormatterExtra`, `TsFormatter`, and `TsTimeResult` in `src/tsutils.ts`; the three types remain non-exported but are now emitted in the rolled `.d.ts` because they're transitively referenced from public surface. SEMVER PATCH — runtime bundles byte-identical to v2.4.0; only the `.d.ts` grows by ~458 B (+0.49%).
|
|
10
|
+
|
|
11
|
+
### BC
|
|
12
|
+
|
|
13
|
+
`.d.ts` is now internally consistent; no other change. Public API surface, runtime, and bundles: UNCHANGED. SEMVER PATCH. BC verdict: NONE.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## v2.4.0 — 2026-05-13
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **Minified bundles** — new `dist/tsgrid-ui.min.js` (CJS, IIFE-wrapped) and `dist/tsgrid-ui.es6.min.js` (ESM). ~46% smaller than non-min counterparts (~508 KB vs ~947 KB). Non-min bundles remain the default for debugging; minified are opt-in by direct path.
|
|
22
|
+
- **ESM sourcemap** — `dist/tsgrid-ui.es6.js.map` shipped alongside the ESM bundle for consumer debugging. CJS sourcemap intentionally omitted (incompatible with the legacy IIFE wrapper rewrite).
|
|
23
|
+
- **ESLint enforcement of INV-8** — new `no-restricted-syntax` rule scoped to `src/tsutils-*.ts` blocks `arguments.length` (codifies the delegator-trap discovered in v2.1 / fixed in v2.3 into the lint gate).
|
|
24
|
+
|
|
25
|
+
### Refactor
|
|
26
|
+
|
|
27
|
+
Decomposed the **DOM cluster** (8 methods, ~397 LOC) out of `TsUtils` into a new leaf module `src/tsutils-dom.ts` — **no breaking changes**, public API preserved. Class methods remain; bodies are now one-line delegators routing to pure functions in the sibling module.
|
|
28
|
+
|
|
29
|
+
- `src/tsutils-dom.ts` — `transition`, `lock`, `unlock`, `getSize`, `getStrDimentions`, `getStrWidth`, `getStrHeight`, `bindEvents` extracted as stateless functions (~234 LOC). Zero `this.X` references in function bodies (INV-9); no import from `tsbase.ts` (INV-4 leaf rule).
|
|
30
|
+
- `TsLockOptions` interface moved to `tsutils-dom.ts` and re-exported via `tsutils.ts` barrel (TsCloneOptions / TsMessageOptions pattern). Public API unchanged.
|
|
31
|
+
- `lock()` internal `this.unlock(...)` call → direct module-level `unlock()` call (R-DOM-1 mitigation).
|
|
32
|
+
- `getStrDimentions()` internal `this.encodeTags(...)` → import `_encodeTags` from `tsutils-string.js` (R-DOM-2 mitigation).
|
|
33
|
+
- `src/tsutils.ts` shrinks from ~1,602 → ~1,470 LOC. **NET REPO DELTA: −18 LOC** (397 removed inline, 234 + 25 added in dom + delegators).
|
|
34
|
+
|
|
35
|
+
`TsUtils` singleton shape and all ~49+ call sites: **UNCHANGED**. SEMVER MINOR. BC verdict: NONE.
|
|
36
|
+
|
|
37
|
+
### Improved (type)
|
|
38
|
+
|
|
39
|
+
- `TsUtils.getStrDimentions(str, styles): { width: number; height: number }`, `TsUtils.getStrWidth(str, styles): number`, `TsUtils.getStrHeight(str, styles): number` — return types narrowed from accidental `any` to explicit `number`. **Type improvement, runtime-equivalent**; no behavior change. Consumers using strict tsconfig settings will see the tighter types (all previously valid call sites remain valid — `any → number` is a strict refinement).
|
|
40
|
+
|
|
41
|
+
### Internal
|
|
42
|
+
|
|
43
|
+
- `@internal` JSDoc + tsup `stripInternal: true` for private surface (`_msgDeps`/`_confirmDeps`/`_promptDeps`, plus `TsFormatterExtra`/`TsFormatter`/`TsTimeResult`). `dist/tsgrid-ui.d.ts` reduced ~1.07% (93,567 → 92,564 B). Larger reductions deferred to v2.5+ (root cause: `TsFormatter`/`TsTimeResult` referenced inline in public method signatures, so tsc re-emits them).
|
|
44
|
+
- `scripts/wrap-legacy.mjs` regex generalized to match esbuild's minified `module.exports=ui(_i);` form (anchors removed) — handles both `tsgrid-ui.js` and `tsgrid-ui.min.js` (R-WRAP-1 mitigation).
|
|
45
|
+
|
|
46
|
+
### Tests
|
|
47
|
+
|
|
48
|
+
- Added 27 unit tests (197 → 224) covering DOM cluster (lock/unlock/getSize/getStrDimentions/getStrWidth/getStrHeight/bindEvents). `transition` covered by Playwright smoke only (jsdom cannot observe CSS animations).
|
|
49
|
+
|
|
50
|
+
### Bundle
|
|
51
|
+
|
|
52
|
+
Non-min delta vs v2.3.0 baseline:
|
|
53
|
+
- `dist/tsgrid-ui.js`: 946,684 → 946,553 B (−0.014%)
|
|
54
|
+
- `dist/tsgrid-ui.es6.js`: 944,836 → 944,746 B (−0.010%)
|
|
55
|
+
|
|
56
|
+
New minified artifacts:
|
|
57
|
+
- `dist/tsgrid-ui.min.js`: ~509 KB (−46.3% vs non-min)
|
|
58
|
+
- `dist/tsgrid-ui.es6.min.js`: ~508 KB (−46.3%)
|
|
59
|
+
|
|
60
|
+
All within ±2% gate. PASSED.
|
|
61
|
+
|
|
62
|
+
### BC
|
|
63
|
+
|
|
64
|
+
Net-additive (new artifacts + type narrowing). Public method signatures: byte-identical for transition/lock/unlock/getSize/bindEvents. `getStrWidth/Height/getStrDimentions` types narrowed `any → number` (strict superset; no runtime change). SEMVER MINOR. BC verdict: NONE.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
5
68
|
## v2.3.0 — 2026-05-13
|
|
6
69
|
|
|
7
70
|
### Refactor
|
package/dist/tsgrid-ui.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* tsgrid-ui 1.0.x (nightly) (5/13/2026,
|
|
1
|
+
/* tsgrid-ui 1.0.x (nightly) (5/13/2026, 8:20:06 PM) (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,
|
|
12
|
+
src: url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAApcAAsAAAAAD0wAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAQQAAAFZdKW6ZY21hcAAAAYgAAACiAAACNBnCLmJnbHlmAAACLAAABd8AAAfo+edccWhlYWQAAAgMAAAAMQAAADYzdgz7aGhlYQAACEAAAAAYAAAAJA3eCBJobXR4AAAIWAAAABAAAABAeA8AAGxvY2EAAAhoAAAAIgAAACIO+gzSbWF4cAAACIwAAAAfAAAAIAEgAGBuYW1lAAAIrAAAATAAAAI6ubjYZ3Bvc3QAAAncAAAAgAAAAKn1lm/4eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGRvZJzAwMrA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fbYKFvYN0qCS6hi/DfKuX/dOxYrf97fy29Dl4LsB25Y5PM4Tr/DX9tfoLtqEVQB156nX47Rev/aZufoNcnOcXtr631u6fc/ro6XPChtACLiruSSY8p8UziQ8ifQVEESwB4nGNgZGBgAGLPdze+xPPbfGXgZr0DFGF4pvXwOoL+f4qDkW0VkMvBwAQSBQCSow2tAAAAeJxjYGRgYL3DAAQcjFASTCMBAQAdSAEGeJxjYGBg4GAkHwMAEREAiAAAAAAAJgA8AKQAwAECAWgBaAGiAhgCcgKgAtoDGgOAA/QAAHicY2BkYGAQYAhhYGMAASYg5gJCBob/YD4DABK4AYEAeJx1j81Kw0AUhU/6J7YgouBOmJUI0qStuy5ctjsXXXSftjNpSpoJk2mh4FP4BD6Fj+DKp/ApXHoa7yJIncDw3e+eO5kBcIkPBDiuAL1qP64Gzlj9cpN0Jdwi3wq3yffCHfKjcBcPeBLu4RopTwha5zQ3eBFu4AKvwk36N+EW+V24Tf4U7pC/hLuY41u4h7vg2ZeJS1d9Y3M/08kui13N1HCuXZnaXA3DQc1Oda5d7PVKLQ6q3Ccj740yzm7VhF2dZVYVzm700odr74txFBnx4dJu4VEigeMrV+jDwCKnm0HT7pAhZu905rSdc9Kxk1a1whAhBv9kp8zmVT5mpdlTWODAvcSe+VH1F8PaMGOxJU1kVvNuGVmhqHobmiV9iHU1VWCMiJ/5kw+Z4kk/pntoVnicbcdRDoIwEEXRPmgLigosxEXVMgqxdJpOSWT3avz1/NxcVamfXv03oEINDQOLBi0OOKLDCWdc0GPAqOobv4yfyT+t58BZmk+2NYrxmUX0lDkZWlPZO9rp+t1EWS/xziY5KWQTRb8EncImNlNgN1khl/3cCpWyxIco9QamJyTZ") format("woff");
|
|
13
13
|
font-weight: normal;
|
|
14
14
|
font-style: normal;
|
|
15
15
|
}
|
package/dist/tsgrid-ui.d.ts
CHANGED
|
@@ -182,8 +182,6 @@ interface TsEventPayload<TDetail = unknown> {
|
|
|
182
182
|
isCancelled: boolean;
|
|
183
183
|
/** Reference to the widget that triggered this event. CIRCULAR — do not serialize. */
|
|
184
184
|
owner: unknown;
|
|
185
|
-
/** @internal — Promise resolved when listeners settle; do not depend on shape. */
|
|
186
|
-
complete?: Promise<unknown>;
|
|
187
185
|
}
|
|
188
186
|
interface TsEventData {
|
|
189
187
|
type?: string | null;
|
|
@@ -374,6 +372,27 @@ interface TsMessageOptions {
|
|
|
374
372
|
[key: string]: unknown;
|
|
375
373
|
}
|
|
376
374
|
|
|
375
|
+
/**
|
|
376
|
+
* TsUtils DOM sub-module — Phase 5b of v2.4 SDD.
|
|
377
|
+
* DAG position: leaf module (no tsbase/tsutils imports).
|
|
378
|
+
*
|
|
379
|
+
* Imports: ./tsutils-string.js (_encodeTags), ./tsutils-type-guards.js (_isInt),
|
|
380
|
+
* ./tsutils-data.js (_extend), ./query.js (query, Query), DOM globals only.
|
|
381
|
+
* 4-space indent convention.
|
|
382
|
+
*
|
|
383
|
+
* INV-4: MUST NOT import from tsbase.ts or tsutils.ts.
|
|
384
|
+
* INV-8: No arguments.length usage.
|
|
385
|
+
* INV-9: No this.X in exported function bodies.
|
|
386
|
+
*/
|
|
387
|
+
/** Options for TsUtils.lock() — moved from tsutils.ts (Phase 5a of v2.4 SDD) */
|
|
388
|
+
interface TsLockOptions {
|
|
389
|
+
msg?: string | number;
|
|
390
|
+
spinner?: boolean;
|
|
391
|
+
opacity?: number;
|
|
392
|
+
bgColor?: string;
|
|
393
|
+
onClick?: () => void;
|
|
394
|
+
}
|
|
395
|
+
|
|
377
396
|
/**
|
|
378
397
|
* Part of TsUi 2.0 library
|
|
379
398
|
* - Dependencies: mQuery, TsUtils, TsBase, TsLocale
|
|
@@ -442,14 +461,6 @@ interface TsFormatterExtra {
|
|
|
442
461
|
}
|
|
443
462
|
/** Signature of a grid-cell formatter function */
|
|
444
463
|
type TsFormatter = (record: TsFormatterExtra, extra?: TsFormatterExtra) => string;
|
|
445
|
-
/** Options for TsUtils.lock() */
|
|
446
|
-
interface TsLockOptions {
|
|
447
|
-
msg?: string | number;
|
|
448
|
-
spinner?: boolean;
|
|
449
|
-
opacity?: number;
|
|
450
|
-
bgColor?: string;
|
|
451
|
-
onClick?: () => void;
|
|
452
|
-
}
|
|
453
464
|
/** Return value from TsUtils.isTime() when retTime === true */
|
|
454
465
|
interface TsTimeResult {
|
|
455
466
|
hours: number;
|
|
@@ -512,25 +523,6 @@ declare class Utils {
|
|
|
512
523
|
transition(div_old: HTMLElement, div_new: HTMLElement, type: string, callBack?: () => void): Promise<void>;
|
|
513
524
|
lock(box: unknown, options?: TsLockOptions | string, ...rest: unknown[]): void;
|
|
514
525
|
unlock(box: unknown, speed?: number): void;
|
|
515
|
-
/**
|
|
516
|
-
* Constructs the MessageDeps object for the _message() delegator.
|
|
517
|
-
* Called once per message() invocation — captures `this` at call time.
|
|
518
|
-
* Per design §C.5 / §C.2.
|
|
519
|
-
*/
|
|
520
|
-
private _msgDeps;
|
|
521
|
-
/**
|
|
522
|
-
* Constructs the ConfirmDeps object for the _confirm() delegator.
|
|
523
|
-
* Per design §C.3.
|
|
524
|
-
* normButtons closure: uses inline lambda that binds this.lang and this.settings
|
|
525
|
-
* at call time — preserving the call-time timing semantics (design §C.3 caveat).
|
|
526
|
-
*/
|
|
527
|
-
private _confirmDeps;
|
|
528
|
-
/**
|
|
529
|
-
* Constructs the PromptDeps object for the _prompt() delegator.
|
|
530
|
-
* Per design §C.3.
|
|
531
|
-
* lang is bound at call time so deps.lang('Ok') uses current locale.
|
|
532
|
-
*/
|
|
533
|
-
private _promptDeps;
|
|
534
526
|
/**
|
|
535
527
|
* Opens a context message, similar in parameters as TsPopup.open()
|
|
536
528
|
*
|
|
@@ -617,11 +609,11 @@ declare class Utils {
|
|
|
617
609
|
notify(text: string | Record<string, unknown>, options?: Record<string, unknown>): Promise<void>;
|
|
618
610
|
getSize(el: unknown, type: string): number;
|
|
619
611
|
getStrDimentions(str: string, styles?: string, raw?: boolean): {
|
|
620
|
-
width:
|
|
621
|
-
height:
|
|
612
|
+
width: number;
|
|
613
|
+
height: number;
|
|
622
614
|
};
|
|
623
|
-
getStrWidth(str: string, styles?: string, raw?: boolean):
|
|
624
|
-
getStrHeight(str: string, styles?: string, raw?: boolean):
|
|
615
|
+
getStrWidth(str: string, styles?: string, raw?: boolean): number;
|
|
616
|
+
getStrHeight(str: string, styles?: string, raw?: boolean): number;
|
|
625
617
|
execTemplate(str: any, replace_obj: any): any;
|
|
626
618
|
marker(el: any, items: any, options?: any): unknown;
|
|
627
619
|
lang(phrase: string, params?: Record<string, string | number> | boolean): string;
|
|
@@ -1509,17 +1501,6 @@ declare class TsLayout extends TsBase {
|
|
|
1509
1501
|
*
|
|
1510
1502
|
* @module types
|
|
1511
1503
|
*/
|
|
1512
|
-
/**
|
|
1513
|
-
* Creates a branded (nominal) type from a base type K and brand tag T.
|
|
1514
|
-
*
|
|
1515
|
-
* @example
|
|
1516
|
-
* type UserId = Brand<number, 'UserId'>
|
|
1517
|
-
*
|
|
1518
|
-
* @internal
|
|
1519
|
-
*/
|
|
1520
|
-
type Brand<K, T> = K & {
|
|
1521
|
-
readonly __brand: T;
|
|
1522
|
-
};
|
|
1523
1504
|
/**
|
|
1524
1505
|
* A record identifier value — the `recid` field used across TsGrid records.
|
|
1525
1506
|
* Can be either a string or a number at runtime; branded to prevent mixing
|