@smartbit4all/ng-client 7.3.29 → 7.3.31

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/MIGRATION-7.0.md CHANGED
@@ -462,7 +462,12 @@ The library line now builds against Angular 19. Host-relevant changes:
462
462
  `(click)="(someCallback)"` — previously silently dead — are now flagged at
463
463
  build time. Warning only, the build stays green.
464
464
  - TypeScript requirement stays satisfied by 5.5 (Angular 19 supports
465
- TS 5.5–5.8).
465
+ TS 5.5–5.8). `ng update @angular/core@19` can install **TS 5.9** all the same, and the
466
+ build then stops with "requires TypeScript >=5.5.0 and <5.9.0"; pin `typescript ~5.8.3`
467
+ (p009-angular, 2026-10-27).
468
+ - TS 5.8 reports two dead constructs as errors: **TS2869** on a `` `${x}` ?? '' `` (a template
469
+ literal is never nullish) and **TS2353** on a property the widget type does not have, e.g.
470
+ `direction` on a `SELECT` widget. Both never did anything; delete them (p034).
466
471
 
467
472
  ### Angular 20 hop (Phase 2, 19 → 20)
468
473
 
@@ -497,7 +502,17 @@ The library line now builds against Angular 20. Host-relevant changes:
497
502
  - **`moduleResolution: "node"` → `"bundler"`** in `tsconfig.json` (and any
498
503
  `tsconfig.lib.json` that sets it explicitly). Automatic migration; it changes
499
504
  how sub-path exports resolve, so a host with hand-written `paths` entries
500
- should re-verify its build.
505
+ should re-verify its build. A deep import such as
506
+ `import { UiAction } from '@smartbit4all/ng-client/projects'` stops resolving
507
+ (TS2307); import from `@smartbit4all/ng-client` instead. A 4.5-era deep import of a
508
+ generated model (`@smartbit4all/document-explorer/lib/api/...`,
509
+ `@smartbit4all/ng-client/lib/smart-generic-pages/api/...`) breaks the same way and has no
510
+ root export: take the host's own generated model, or derive the type from the field it
511
+ copies (`AdminTemplate['file']`) (p034).
512
+ - **A host without `skipLibCheck` that still imports `primeng/dynamicdialog` stays red from
513
+ this hop**: PrimeNG 17's typings name `InjectFlags`, which Angular 20 removed (TS2305 inside
514
+ `node_modules/primeng`). The 6.x `SmartdialogService` subclasses need that import until the
515
+ codemod removes it, so this hop joins 21 and 22 as red until the 7.0 library is in (p034).
501
516
  - **Workspace generation defaults**: the CLI adds a `schematics` block to
502
517
  `angular.json` pinning the pre-20 file-naming style (`type: "component"`,
503
518
  `typeSeparator: "."`). Cosmetic — it only affects newly generated files.
@@ -696,6 +711,13 @@ functioning in TypeScript 7.0"). Two ways out:
696
711
  - `strictTemplates` is on by default in v22; the lib workspace was already
697
712
  strict, so nothing changed. If your host was not strict, the `ng update`
698
713
  migration adds `"strictTemplates": false` to keep it that way.
714
+ - A `@HostListener('document:keydown.enter', ['$event'])` handler typed `KeyboardEvent` fails
715
+ with TS2345 (`Event` is not assignable); type the parameter as `Event` when the handler only
716
+ reads `target` (p034).
717
+ - **An Angular CLI 1x `src/test.ts` breaks `ng test`**: `require.context` is a webpack API the
718
+ 22 karma builder no longer provides (`__webpack_require__(...).context is not a function`,
719
+ 0 specs run). Delete the `require.context` block; the builder collects the specs from
720
+ `tsconfig.spec.json` itself (p034).
699
721
 
700
722
  ### The third-party packages the library does *not* own (Phase 2)
701
723
 
@@ -961,7 +983,13 @@ app-formmate or `@smartbit4all/document-explorer`:
961
983
  the table internally. **All `SmartTable*` model types stay** (`SmartTableType`,
962
984
  `SmartTableInterfaceTypeEnum`, `SmartTableHeader`, …). p043 imports
963
985
  `SmarttableComponent` in `ad-groups.component.ts` but never uses it — delete
964
- that one import line.
986
+ that one import line. An import is not the only way in: p009-angular created it
987
+ through `ComponentFactoryService` (`recommendations-page`), so grep for the class
988
+ name, not only for the import, and rebuild such a page on `<smart-grid>`. p034 used it
989
+ three times for a client-side check box table (a `<smarttable>` in a template and two
990
+ `ComponentFactoryService` sites) whose rows come from the host, not from a backend grid;
991
+ there a small host component rendering the still public `SmartTable` model with
992
+ `mat-table` keeps the pages, because `<smart-grid>` needs a backend grid model.
965
993
  - `GoogleMap`, `LeafletMap`, `AbstractMap` — select an engine with
966
994
  `withSmartMap({ engine })`.
967
995
  - `SmartFilterParamComponent`, `SmartFilterParamsComponent`,
@@ -987,6 +1015,10 @@ No host provided them, so no action is needed.
987
1015
  and the ui-action menus no longer carry `[subActions]`. All four were dead
988
1016
  bindings that the NgModules' `CUSTOM_ELEMENTS_SCHEMA` had been hiding — they
989
1017
  wrote a DOM property nobody read. Rendering is unchanged.
1018
+ - The same schema on a **host** module hides library selectors that 7.0 no longer
1019
+ exports: the template compiles and the element renders nothing.
1020
+ `<smart-filter-group-params>` (p009-angular, two admin pages) is one; grep the
1021
+ templates for `smart-` selectors that the build does not resolve.
990
1022
  - The dead `ExpandableGridComponent` is deleted (it was declared in
991
1023
  `SmartGridModule` but its selector was used nowhere).
992
1024
 
@@ -1312,6 +1344,30 @@ compiles: `actions` is your field, and the freeze only covers the entries. It ke
1312
1344
  array reference, so the toolbar does not re-render. Reassign the array — or, if you hold it
1313
1345
  in a `signal`, `update()` it.
1314
1346
 
1347
+ **A component's own toolbar entries come from its `actionModels` signal.** The 6.x pattern
1348
+ `this.uiActionModels.forEach((a) => (a.cssClass = 'eji-button'))` in `initActions` becomes an
1349
+ override of that signal, which bound, pulled and layout-embedded toolbars all read:
1350
+
1351
+ ```ts
1352
+ // the helper runs while this.actionModels is still the base class's signal
1353
+ function withCssClass(component: SmartComponent<any>, cssClass: string) {
1354
+ const source = component.actionModels;
1355
+ return computed(() => source().map((a) => ({ ...a, cssClass })));
1356
+ }
1357
+
1358
+ override readonly actionModels = withCssClass(this, 'eji-button');
1359
+ ```
1360
+
1361
+ Reading `this.actionModels` directly in its own initializer is `TS2729`; passing `this` to a
1362
+ function is what captures the base signal (p009-angular, `src/app/utils/action-css-class.ts`).
1363
+ A host field of its own named `actionModels` now collides with the base signal
1364
+ (`TS2416` + `TS4114`): rename it.
1365
+
1366
+ When the mapping reads the component's data (mark the entry of `data.currentPage`), read
1367
+ `component.modelSignal()` inside the `computed` as well: `data` is a plain field, so without it
1368
+ the class does not follow a data change that leaves the action list alone (p034,
1369
+ `src/app/utils/action-models.ts`).
1370
+
1315
1371
  The descriptor a toolbar resolves is no longer written back into the entry either. Nothing
1316
1372
  outside the toolbar read it; if you did, resolve it yourself through
1317
1373
  `UiActionDescriptorService.getActionDescriptor(uiAction)` — which is
@@ -1321,8 +1377,18 @@ outside the toolbar read it; if you did, resolve it yourself through
1321
1377
 
1322
1378
  `SmartTranslateService`, `viewContext.translateService` and the `translateServiceChanged`
1323
1379
  subject are removed, together with `originalLabel` / `originalPlaceholder` on the widget
1324
- interfaces. No measured host assigned any of them — the three references in p014/p043 were
1325
- unused imports — and the backend localizes server-side.
1380
+ interfaces, and the `translateService` field of `SmartForm`, `SmartGrid` and `SmartFilter`. The
1381
+ backend localizes server-side, and in p014/p043 the three references were unused imports.
1382
+
1383
+ **A host that sends translation keys still needs translating.** p009-angular keeps ngx-translate
1384
+ keys in its client-built forms, its client action descriptors and its titles; deleting the
1385
+ calls would put raw keys on screen. It now translates in the host: the widget labels,
1386
+ placeholders, validator messages and item labels when a form is built, and the descriptor map
1387
+ on every `onLangChange`, with `bootstrap.start()` waiting for the language to load. **Grid
1388
+ column headers and filter labels have no host-side replacement**: they show what the backend
1389
+ sends, so localize them on the backend. A page that read `this.translate` without assigning it
1390
+ got `undefined` already on 6.x (the base class never set it), so check what a title showed
1391
+ before calling a now-translated one a regression.
1326
1392
 
1327
1393
  What the frontend authors itself is now configuration:
1328
1394