@siemens/element-ng 48.3.0 → 48.4.0

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.
Files changed (39) hide show
  1. package/accordion/index.d.ts +0 -1
  2. package/chat-messages/index.d.ts +172 -156
  3. package/dashboard/index.d.ts +2 -3
  4. package/fesm2022/siemens-element-ng-accordion.mjs +2 -3
  5. package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -1
  6. package/fesm2022/siemens-element-ng-chat-messages.mjs +259 -163
  7. package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
  8. package/fesm2022/siemens-element-ng-dashboard.mjs +7 -11
  9. package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
  10. package/fesm2022/siemens-element-ng-datepicker.mjs +5 -3
  11. package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -1
  12. package/fesm2022/siemens-element-ng-filtered-search.mjs +4 -8
  13. package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
  14. package/fesm2022/siemens-element-ng-navbar-vertical.mjs +2 -9
  15. package/fesm2022/siemens-element-ng-navbar-vertical.mjs.map +1 -1
  16. package/fesm2022/siemens-element-ng-select.mjs +4 -0
  17. package/fesm2022/siemens-element-ng-select.mjs.map +1 -1
  18. package/fesm2022/siemens-element-ng-side-panel.mjs +3 -5
  19. package/fesm2022/siemens-element-ng-side-panel.mjs.map +1 -1
  20. package/fesm2022/siemens-element-ng-status-bar.mjs +3 -4
  21. package/fesm2022/siemens-element-ng-status-bar.mjs.map +1 -1
  22. package/fesm2022/siemens-element-ng-tour.mjs +58 -21
  23. package/fesm2022/siemens-element-ng-tour.mjs.map +1 -1
  24. package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
  25. package/fesm2022/siemens-element-ng-tree-view.mjs +4 -4
  26. package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
  27. package/filtered-search/index.d.ts +6 -7
  28. package/navbar-vertical/index.d.ts +2 -4
  29. package/package.json +7 -7
  30. package/schematics/migrations/action-modal-migration/action-modal-migration.js +45 -4
  31. package/schematics/migrations/data/output-names.js +0 -1
  32. package/schematics/migrations/data/symbol-removals.js +0 -9
  33. package/schematics/migrations/element-migration/element-migration.js +1 -9
  34. package/schematics/migrations/wizard-migration/index.js +1 -9
  35. package/select/index.d.ts +5 -0
  36. package/status-bar/index.d.ts +0 -1
  37. package/template-i18n.json +1 -0
  38. package/tour/index.d.ts +4 -2
  39. package/translate/index.d.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
3
3
  import { BackgroundColorVariant } from '@siemens/element-ng/common';
4
4
  import { TypeaheadOption } from '@siemens/element-ng/typeahead';
5
5
  import { TranslatableString } from '@siemens/element-translate-ng/translate';
@@ -150,7 +150,7 @@ interface InternalCriterionDefinition extends CriterionDefinition {
150
150
  translatedLabel: string;
151
151
  }
152
152
 
153
- declare class SiFilteredSearchComponent implements OnInit, OnChanges, OnDestroy {
153
+ declare class SiFilteredSearchComponent implements OnInit, OnChanges {
154
154
  private static readonly criterionRegex;
155
155
  /**
156
156
  * Output callback event that provides an object describing the
@@ -370,10 +370,10 @@ declare class SiFilteredSearchComponent implements OnInit, OnChanges, OnDestroy
370
370
  private typeaheadInputChange;
371
371
  /** Used to debounce the Search emissions */
372
372
  private searchEmitQueue;
373
- private destroySubscriptions;
374
- private cdRef;
375
- private translateService;
376
- private locale;
373
+ private readonly destroyRef;
374
+ private readonly cdRef;
375
+ private readonly translateService;
376
+ private readonly locale;
377
377
  /**
378
378
  * The cache is used to control when the interceptDisplayedCriteria event needs to be called.
379
379
  * Every time a criteria gain the focus we have to reset the cache to call the interceptor.
@@ -388,7 +388,6 @@ declare class SiFilteredSearchComponent implements OnInit, OnChanges, OnDestroy
388
388
  constructor();
389
389
  ngOnChanges(changes: SimpleChanges): void;
390
390
  ngOnInit(): void;
391
- ngOnDestroy(): void;
392
391
  private initCriteria;
393
392
  private initValue;
394
393
  /**
@@ -1,6 +1,6 @@
1
1
  import * as _siemens_element_translate_ng_translate_types from '@siemens/element-translate-ng/translate-types';
2
2
  import * as _angular_core from '@angular/core';
3
- import { OnChanges, OnInit, OnDestroy, SimpleChanges } from '@angular/core';
3
+ import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
4
4
  import { NavigationExtras, IsActiveMatchOptions, ActivatedRoute } from '@angular/router';
5
5
  import { MenuItem } from '@siemens/element-ng/common';
6
6
  import { TranslatableString } from '@siemens/element-translate-ng/translate';
@@ -91,7 +91,7 @@ declare class SiNavbarVerticalItemGuardDirective {
91
91
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiNavbarVerticalItemGuardDirective, never>;
92
92
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiNavbarVerticalItemGuardDirective, "[siNavbarVerticalItemGuard]", never, {}, {}, never, never, true, never>;
93
93
  }
94
- declare class SiNavbarVerticalComponent implements OnChanges, OnInit, OnDestroy {
94
+ declare class SiNavbarVerticalComponent implements OnChanges, OnInit {
95
95
  /**
96
96
  * Whether the navbar-vertical is collapsed.
97
97
  *
@@ -197,12 +197,10 @@ declare class SiNavbarVerticalComponent implements OnChanges, OnInit, OnDestroy
197
197
  private readonly itemsToComponents;
198
198
  protected readonly smallScreen: _angular_core.WritableSignal<boolean>;
199
199
  protected readonly uiStateExpandedItems: _angular_core.WritableSignal<Record<string, boolean>>;
200
- private destroyer;
201
200
  private preferCollapse;
202
201
  constructor();
203
202
  ngOnChanges(changes: SimpleChanges): void;
204
203
  ngOnInit(): void;
205
- ngOnDestroy(): void;
206
204
  protected toggleCollapse(): void;
207
205
  /** Expands the vertical navbar. */
208
206
  expand(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@siemens/element-ng",
3
3
  "description": "Element Angular component library, implementing the Siemens Design Language",
4
- "version": "48.3.0",
4
+ "version": "48.4.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -30,8 +30,8 @@
30
30
  "@angular/router": "20",
31
31
  "@ngx-formly/bootstrap": "^6.2.2",
32
32
  "@ngx-formly/core": "^6.2.2",
33
- "@siemens/element-translate-ng": "48.3.0",
34
- "@siemens/element-theme": "48.3.0",
33
+ "@siemens/element-translate-ng": "48.4.0",
34
+ "@siemens/element-theme": "48.4.0",
35
35
  "@siemens/ngx-datatable": "22 - 24",
36
36
  "flag-icons": "^7.3.2",
37
37
  "google-libphonenumber": "^3.2.40",
@@ -67,10 +67,6 @@
67
67
  "types": "./index.d.ts",
68
68
  "default": "./fesm2022/siemens-element-ng.mjs"
69
69
  },
70
- "./accordion": {
71
- "types": "./accordion/index.d.ts",
72
- "default": "./fesm2022/siemens-element-ng-accordion.mjs"
73
- },
74
70
  "./about": {
75
71
  "types": "./about/index.d.ts",
76
72
  "default": "./fesm2022/siemens-element-ng-about.mjs"
@@ -87,6 +83,10 @@
87
83
  "types": "./auto-collapsable-list/index.d.ts",
88
84
  "default": "./fesm2022/siemens-element-ng-auto-collapsable-list.mjs"
89
85
  },
86
+ "./accordion": {
87
+ "types": "./accordion/index.d.ts",
88
+ "default": "./fesm2022/siemens-element-ng-accordion.mjs"
89
+ },
90
90
  "./autocomplete": {
91
91
  "types": "./autocomplete/index.d.ts",
92
92
  "default": "./fesm2022/siemens-element-ng-autocomplete.mjs"
@@ -29,7 +29,11 @@ export const actionModalMigrationRule = (options) => {
29
29
  continue;
30
30
  }
31
31
  const pendingTransformations = [];
32
+ const usedIdentifier = new Set();
32
33
  const visitNodeAndCollectTransformations = (node) => {
34
+ if (ts.isImportDeclaration(node)) {
35
+ return;
36
+ }
33
37
  // Collect method call transformations
34
38
  if (ts.isCallExpression(node)) {
35
39
  const methodTransformation = createActionDialogMethodCallTransformation(node);
@@ -42,11 +46,17 @@ export const actionModalMigrationRule = (options) => {
42
46
  const typeTransformation = createActionDialogTypeTransformation(node);
43
47
  if (typeTransformation) {
44
48
  pendingTransformations.push(typeTransformation);
49
+ // We remove the usage here. In order to avoid counting it as used identifier, we skip further processing.
50
+ return;
45
51
  }
46
52
  }
53
+ if (ts.isIdentifier(node)) {
54
+ usedIdentifier.add(node.text);
55
+ }
47
56
  node.forEachChild(visitNodeAndCollectTransformations);
48
57
  };
49
58
  sourceFile.forEachChild(visitNodeAndCollectTransformations);
59
+ pendingTransformations.push(...removeUnusedImports(sourceFile, usedIdentifier));
50
60
  if (pendingTransformations.length > 0) {
51
61
  applyCodeTransformations(tree, filePath, pendingTransformations);
52
62
  }
@@ -69,8 +79,7 @@ const createActionDialogMethodCallTransformation = (node) => {
69
79
  const newCode = printer.printNode(ts.EmitHint.Expression, newNode, node.getSourceFile());
70
80
  return {
71
81
  node,
72
- newCode,
73
- type: 'method-call'
82
+ newCode
74
83
  };
75
84
  };
76
85
  const createActionDialogTypeTransformation = (node) => {
@@ -81,8 +90,7 @@ const createActionDialogTypeTransformation = (node) => {
81
90
  }
82
91
  return {
83
92
  node,
84
- newCode: `'${matchingReplacement.new}'`,
85
- type: 'type-reference'
93
+ newCode: `'${matchingReplacement.new}'`
86
94
  };
87
95
  };
88
96
  /**
@@ -119,3 +127,36 @@ const applyCodeTransformations = (tree, filePath, codeTransformations) => {
119
127
  });
120
128
  tree.commitUpdate(recorder);
121
129
  };
130
+ const removeUnusedImports = (sourceFile, usedIdentifier) => {
131
+ const printer = ts.createPrinter();
132
+ const importFinder = (node) => {
133
+ if (ts.isImportDeclaration(node) &&
134
+ ts.isStringLiteral(node.moduleSpecifier) &&
135
+ /@(siemens|simpl)\/element-ng(\/action-modal)?/.test(node.moduleSpecifier.text) &&
136
+ node.importClause?.namedBindings &&
137
+ ts.isNamedImports(node.importClause.namedBindings)) {
138
+ const usedBindings = node.importClause.namedBindings.elements.filter(element =>
139
+ // This script anyway is not capable of handling aliasing imports, so we can ignore them here.
140
+ usedIdentifier.has(element.name.text) || !ACTION_MODAL_SYMBOLS.includes(element.name.text));
141
+ if (usedBindings.length === node.importClause.namedBindings.elements.length) {
142
+ // All bindings are used, no changes needed
143
+ return undefined;
144
+ }
145
+ if (usedBindings.length === 0) {
146
+ // No bindings are used, remove the entire import statement
147
+ return {
148
+ node,
149
+ newCode: ''
150
+ };
151
+ }
152
+ // Recreate import statement with only used bindings
153
+ const newImport = ts.factory.createImportDeclaration(node.modifiers, ts.factory.createImportClause(node.importClause.isTypeOnly, node.importClause.name, ts.factory.createNamedImports(usedBindings)), node.moduleSpecifier, node.attributes);
154
+ return {
155
+ node,
156
+ newCode: printer.printNode(ts.EmitHint.Unspecified, newImport, sourceFile)
157
+ };
158
+ }
159
+ return undefined;
160
+ };
161
+ return sourceFile.statements.map(importFinder).filter(transform => transform !== undefined);
162
+ };
@@ -2,7 +2,6 @@ export const OUTPUT_NAMES_MIGRATION = [
2
2
  {
3
3
  module: /@(siemens|simpl)\/element-ng(\/accordion)?/,
4
4
  elementSelector: 'si-collapsible-panel',
5
- componentOrModuleName: ['SiCollapsiblePanelComponent', 'SiAccordionModule'],
6
5
  apiMappings: [{ replace: '(toggle)', replaceWith: '(panelToggle)' }]
7
6
  }
8
7
  ];
@@ -2,57 +2,48 @@ export const SYMBOL_REMOVALS_MIGRATION = [
2
2
  {
3
3
  module: /@(siemens|simpl)\/element-ng(\/accordion)?/,
4
4
  elementSelector: 'si-accordion',
5
- componentOrModuleName: ['SiAccordionComponent', 'SiAccordionModule'],
6
5
  names: ['colorVariant']
7
6
  },
8
7
  {
9
8
  module: /@(siemens|simpl)\/element-ng(\/datepicker)?/,
10
9
  elementSelector: 'input',
11
10
  attributeSelector: 'siDateInput',
12
- componentOrModuleName: ['SiDateInputDirective', 'SiDatepickerModule'],
13
11
  names: ['dateInputDebounceTime']
14
12
  },
15
13
  {
16
14
  module: /@(siemens|simpl)\/element-ng(\/datepicker)?/,
17
15
  elementSelector: 'input',
18
16
  attributeSelector: 'siDatepicker',
19
- componentOrModuleName: ['SiDateInputDirective', 'SiDatepickerModule'],
20
17
  names: ['triggeringInput']
21
18
  },
22
19
  {
23
20
  module: /@(siemens|simpl)\/element-ng(\/datepicker)?/,
24
21
  elementSelector: 'si-date-range',
25
- componentOrModuleName: ['SiDateRangeComponent', 'SiDatepickerModule'],
26
22
  names: ['debounceTime']
27
23
  },
28
24
  {
29
25
  module: /@(siemens|simpl)\/element-ng(\/filtered-search)?/,
30
26
  elementSelector: 'si-filtered-search',
31
- componentOrModuleName: ['SiFilteredSearchComponent', 'SiFilteredSearchModule'],
32
27
  names: ['showIcon', 'noMatchingCriteriaText']
33
28
  },
34
29
  {
35
30
  module: /@(siemens|simpl)\/element-ng(\/form)?/,
36
31
  elementSelector: 'si-form-item',
37
- componentOrModuleName: ['SiFormItemComponent', 'SiFormModule'],
38
32
  names: ['inputId', 'readonly']
39
33
  },
40
34
  {
41
35
  module: /@(siemens|simpl)\/element-ng(\/navbar-vertical)?/,
42
36
  elementSelector: 'si-navbar-vertical',
43
- componentOrModuleName: ['SiNavbarVerticalComponent', 'SiNavbarVerticalModule'],
44
37
  names: ['autoCollapseDelay']
45
38
  },
46
39
  {
47
40
  module: /@(siemens|simpl)\/element-ng(\/split)?/,
48
41
  elementSelector: 'si-split-part',
49
- componentOrModuleName: ['SiSplitPartComponent', 'SiSplitModule'],
50
42
  names: ['headerStatusColor', 'headerStatusIconClass']
51
43
  },
52
44
  {
53
45
  module: /@(siemens|simpl)\/element-ng(\/navbar-vertical)?/,
54
46
  elementSelector: 'si-tree-view',
55
- componentOrModuleName: ['SiTreeViewComponent', 'SiTreeViewModule'],
56
47
  names: ['disableFilledIcons', 'trackByFunction']
57
48
  }
58
49
  ];
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as ts from 'typescript';
6
6
  import { EmitHint } from 'typescript';
7
- import { discoverSourceFiles, getImportSpecifiers, renameApi, renameAttribute, renameElementTag, renameIdentifier, removeSymbol } from '../../utils/index.js';
7
+ import { discoverSourceFiles, renameApi, renameAttribute, renameElementTag, renameIdentifier, removeSymbol } from '../../utils/index.js';
8
8
  import { getElementMigrationData } from '../data/index.js';
9
9
  export const elementMigrationRule = (options) => {
10
10
  return async (tree, context) => {
@@ -60,10 +60,6 @@ export const elementMigrationRule = (options) => {
60
60
  if (migrationData.outputNameChanges) {
61
61
  recorder ??= tree.beginUpdate(filePath);
62
62
  for (const change of migrationData.outputNameChanges) {
63
- const importSpecifiers = getImportSpecifiers(sourceFile, change.module, change.componentOrModuleName);
64
- if (!importSpecifiers?.length) {
65
- continue;
66
- }
67
63
  renameApi({
68
64
  tree,
69
65
  recorder,
@@ -77,10 +73,6 @@ export const elementMigrationRule = (options) => {
77
73
  if (migrationData.symbolRemovalChanges) {
78
74
  recorder ??= tree.beginUpdate(filePath);
79
75
  for (const change of migrationData.symbolRemovalChanges) {
80
- const importSpecifiers = getImportSpecifiers(sourceFile, change.module, change.componentOrModuleName);
81
- if (!importSpecifiers?.length) {
82
- continue;
83
- }
84
76
  removeSymbol({
85
77
  tree,
86
78
  recorder,
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { join, dirname } from 'path';
6
6
  import * as ts from 'typescript';
7
- import { discoverSourceFiles, findElement, getImportSpecifiers, getInlineTemplates, getTemplateUrl } from '../../utils/index.js';
7
+ import { discoverSourceFiles, findElement, getInlineTemplates, getTemplateUrl } from '../../utils/index.js';
8
8
  export const wizardMigrationRule = (options) => {
9
9
  return async (tree, context) => {
10
10
  context.logger.info('🔄 Migrating wizard api...');
@@ -15,14 +15,6 @@ export const wizardMigrationRule = (options) => {
15
15
  continue;
16
16
  }
17
17
  const sourceFile = ts.createSourceFile(filePath, content.toString(), ts.ScriptTarget.Latest, true);
18
- const modulePathToMatch = /@(siemens|simpl)\/element-ng(\/wizard)?/;
19
- const wizardImports = getImportSpecifiers(sourceFile, modulePathToMatch, [
20
- 'SiWizardComponent',
21
- 'SiWizardModule'
22
- ]);
23
- if (!wizardImports?.length) {
24
- continue;
25
- }
26
18
  const recorder = tree.beginUpdate(filePath);
27
19
  renameApi({
28
20
  tree,
package/select/index.d.ts CHANGED
@@ -561,6 +561,11 @@ declare class SiSelectActionDirective {
561
561
  }
562
562
 
563
563
  declare class SiSelectActionsDirective {
564
+ /** @internal */
565
+ static ngTemplateContextGuard(directive: SiSelectActionsDirective, context: unknown): context is {
566
+ searchText?: string;
567
+ visibleOptionsCount?: number;
568
+ };
564
569
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiSelectActionsDirective, never>;
565
570
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiSelectActionsDirective, "[siSelectActions]", ["si-select-actions"], {}, {}, never, never, true, never>;
566
571
  }
@@ -137,7 +137,6 @@ declare class SiStatusBarComponent implements DoCheck, OnDestroy, OnChanges {
137
137
  private readonly translateService;
138
138
  private readonly resizeObserver;
139
139
  private readonly measureService;
140
- private readonly destroyRef;
141
140
  constructor();
142
141
  ngOnChanges(changes: SimpleChanges): void;
143
142
  ngDoCheck(): void;
@@ -49,6 +49,7 @@
49
49
  "SI_DATEPICKER.SECONDS": "Seconds",
50
50
  "SI_DATEPICKER.START_DATE_PLACEHOLDER": "Start date",
51
51
  "SI_DATEPICKER.START_TIME_LABEL": "from",
52
+ "SI_DATEPICKER.TODAY": "Today",
52
53
  "SI_DATE_RANGE_FILTER.ADVANCED": "Advanced",
53
54
  "SI_DATE_RANGE_FILTER.AFTER": "After",
54
55
  "SI_DATE_RANGE_FILTER.APPLY": "Apply",
package/tour/index.d.ts CHANGED
@@ -104,10 +104,12 @@ declare class SiTourService {
104
104
  private makeStep;
105
105
  private scrollIntoView;
106
106
  private handleBeforeNextPromise;
107
- private makeOverlay;
107
+ private centerOverlay;
108
+ private attachOverlay;
109
+ private createFlexiblePositionStrategy;
110
+ private createOrUpdateOverlays;
108
111
  private handleResizeSubscription;
109
112
  private isElementVisible;
110
- private handlePositionChangeSubscription;
111
113
  private getElement;
112
114
  private hide;
113
115
  static ɵfac: i0.ɵɵFactoryDeclaration<SiTourService, never>;
@@ -52,6 +52,7 @@ interface SiTranslatableKeys {
52
52
  'SI_DATEPICKER.SECONDS'?: string;
53
53
  'SI_DATEPICKER.START_DATE_PLACEHOLDER'?: string;
54
54
  'SI_DATEPICKER.START_TIME_LABEL'?: string;
55
+ 'SI_DATEPICKER.TODAY'?: string;
55
56
  'SI_DATE_RANGE_FILTER.ADVANCED'?: string;
56
57
  'SI_DATE_RANGE_FILTER.AFTER'?: string;
57
58
  'SI_DATE_RANGE_FILTER.APPLY'?: string;