@siemens/element-ng 51.0.1 → 51.1.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.
@@ -15,7 +15,8 @@ declare class SiAutoCollapsableListMeasurable {
15
15
  * .pipe(
16
16
  * map(size => size.width),
17
17
  * distinctUntilChanged(),
18
- * shareReplay(1)
18
+ * takeUntilDestroyed(),
19
+ * shareReplay({ bufferSize: 1, refCount: true })
19
20
  * )
20
21
  * ```
21
22
  */
@@ -45,6 +45,16 @@ declare class SiNavbarVerticalNextGroupTriggerDirective {
45
45
  * @internal
46
46
  */
47
47
  readonly flyout: _angular_core.WritableSignal<boolean>;
48
+ /** `true` when this group is currently rendered as a mobile flat group.
49
+ * @internal
50
+ */
51
+ readonly flatGroupActive: _angular_core.Signal<boolean>;
52
+ /**
53
+ * Whether the group is currently revealed to the user, taking the active
54
+ * rendering mode into account. Used for `aria-expanded`.
55
+ * @internal
56
+ */
57
+ readonly ariaExpanded: _angular_core.Signal<boolean>;
48
58
  /** `true` when this group contains the active route. Set by the group component.
49
59
  * @internal
50
60
  */
@@ -56,6 +66,7 @@ declare class SiNavbarVerticalNextGroupTriggerDirective {
56
66
  readonly flyoutMode: _angular_core.Signal<boolean>;
57
67
  private flyoutOutsideClickSubscription?;
58
68
  private readonly viewContainer;
69
+ private readonly elementRef;
59
70
  private readonly overlay;
60
71
  private readonly destroyRef;
61
72
  private readonly injector;
@@ -66,6 +77,8 @@ declare class SiNavbarVerticalNextGroupTriggerDirective {
66
77
  constructor();
67
78
  /** @internal */
68
79
  hideFlyout(): void;
80
+ /** @internal */
81
+ focus(): void;
69
82
  protected triggered(): void;
70
83
  private toggleFlyout;
71
84
  private attachInline;
@@ -127,6 +140,7 @@ declare class SiNavbarVerticalNextItemComponent implements OnInit {
127
140
  * Formats badge value to limit display to "+99" for numbers greater than 99
128
141
  */
129
142
  protected readonly formattedBadge: _angular_core.Signal<string>;
143
+ protected readonly toggleIcon: _angular_core.Signal<string>;
130
144
  /** Active via override or router link — excludes group state.
131
145
  * @internal
132
146
  */
@@ -235,6 +249,20 @@ declare class SiNavbarVerticalNextComponent implements OnChanges, OnInit {
235
249
  private injector;
236
250
  protected readonly ready: _angular_core.WritableSignal<boolean>;
237
251
  protected readonly smallScreen: _angular_core.WritableSignal<boolean>;
252
+ private readonly mobileScreen;
253
+ /**
254
+ * `true` when triggering a group should open the mobile flat group
255
+ * instead of inline/flyout. Requires `alwaysFlyout` and a viewport width at
256
+ * or below {@link BOOTSTRAP_BREAKPOINTS.smMinimum}, 576px. Collapsing the
257
+ * drawer on mobile must not reset the open flat group, so this stays `true`
258
+ * regardless of `collapsed`.
259
+ * @internal
260
+ */
261
+ readonly flatMode: _angular_core.Signal<boolean>;
262
+ /** Id of the group currently shown as a mobile flat group.
263
+ * @internal
264
+ */
265
+ readonly openFlatGroupId: _angular_core.WritableSignal<string | undefined>;
238
266
  /** Chip menu sub-component; present only while the parent template renders it.
239
267
  * @internal
240
268
  */
@@ -286,6 +314,10 @@ declare class SiNavbarVerticalNextComponent implements OnChanges, OnInit {
286
314
  collapse(): void;
287
315
  /** @internal */
288
316
  groupStateChanged(stateId: string | undefined, expanded: boolean): void;
317
+ /** Closes the open mobile flat group.
318
+ * @internal
319
+ */
320
+ closeFlatGroup(): void;
289
321
  protected saveUIState(): void;
290
322
  /** @internal */
291
323
  itemTriggered(): void;
@@ -356,14 +388,29 @@ declare class SiNavbarVerticalNextFooterItemsComponent {
356
388
 
357
389
  /** @experimental */
358
390
  declare class SiNavbarVerticalNextGroupComponent {
391
+ protected readonly icons: Record<"elementLeft2", string>;
359
392
  protected readonly navbar: _siemens_element_ng_navbar_vertical_next.SiNavbarVerticalNextComponent;
360
393
  protected readonly groupTrigger: SiNavbarVerticalNextGroupTriggerDirective;
394
+ protected readonly triggerItem: SiNavbarVerticalNextItemComponent;
395
+ protected readonly flatGroupTitleId: string;
396
+ /**
397
+ * Back button text for flat groups.
398
+ *
399
+ * @defaultValue
400
+ * ```
401
+ * t(() => $localize`:@@SI_NAVBAR_VERTICAL.BACK:Back`)
402
+ * ```
403
+ */
404
+ readonly ariaLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
361
405
  private readonly routerLinkActive;
406
+ private readonly focusTrap;
407
+ private wasFlatGroupActive;
362
408
  protected readonly visible: _angular_core.Signal<boolean>;
363
409
  constructor();
364
410
  protected close(): void;
411
+ private updateFlatGroupFocus;
365
412
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiNavbarVerticalNextGroupComponent, never>;
366
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiNavbarVerticalNextGroupComponent, "si-navbar-vertical-next-group", never, {}, {}, never, ["*"], true, never>;
413
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiNavbarVerticalNextGroupComponent, "si-navbar-vertical-next-group", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
367
414
  }
368
415
 
369
416
  /** @experimental */
@@ -216,6 +216,7 @@ interface SiTranslatableKeys {
216
216
  'SI_MARKDOWN_CALLOUT.TIP'?: string;
217
217
  'SI_NAVBAR.OPEN_LAUNCHPAD'?: string;
218
218
  'SI_NAVBAR.TOGGLE_NAVIGATION'?: string;
219
+ 'SI_NAVBAR_VERTICAL.BACK'?: string;
219
220
  'SI_NAVBAR_VERTICAL.COLLAPSE'?: string;
220
221
  'SI_NAVBAR_VERTICAL.EXPAND'?: string;
221
222
  'SI_NAVBAR_VERTICAL.SEARCH_PLACEHOLDER'?: string;
@@ -1,304 +0,0 @@
1
- const CSS_CUSTOM_PROPERTIES_MIGRATION = [
2
- {
3
- replace: '--si-feedback-icon-offset',
4
- replaceWith: '--si-feedback-icon-size'
5
- },
6
- {
7
- replace: '$si-font-size-title-1-bold',
8
- replaceWith: '$si-font-size-h4-bold'
9
- },
10
- {
11
- replace: '$si-font-weight-title-2',
12
- replaceWith: '$si-font-weight-h5'
13
- }
14
- ];
15
- const SYMBOL_RENAMING_MIGRATION = [
16
- {
17
- module: /@(siemens|simpl)\/element-ng(\/icon)?/,
18
- symbolRenamings: [
19
- {
20
- replace: 'SiIconComponent',
21
- replaceWith: 'SiIconLegacyComponent'
22
- }
23
- ]
24
- },
25
- {
26
- module: /@(siemens|simpl)\/element-ng(\/icon-next)?/,
27
- symbolRenamings: [
28
- {
29
- replace: 'SiIconNextComponent',
30
- replaceWith: 'SiIconComponent'
31
- }
32
- ]
33
- },
34
- {
35
- module: /@(siemens|simpl)\/element-ng(\/tabs)?/,
36
- symbolRenamings: [
37
- {
38
- replace: 'SiTabComponent',
39
- replaceWith: 'SiTabLegacyComponent'
40
- },
41
- {
42
- replace: 'SiTabsetComponent',
43
- replaceWith: 'SiTabsetLegacyComponent'
44
- },
45
- {
46
- replace: 'SiTabsModule',
47
- replaceWith: 'SiTabsLegacyModule'
48
- }
49
- ],
50
- toModule: '@siemens/element-ng/tabs-legacy'
51
- },
52
- {
53
- module: /@(siemens|simpl)\/element-ng(\/tabs-next)?/,
54
- symbolRenamings: [
55
- {
56
- replace: 'SiTabNextComponent',
57
- replaceWith: 'SiTabComponent'
58
- },
59
- {
60
- replace: 'SiTabsetNextComponent',
61
- replaceWith: 'SiTabsetComponent'
62
- },
63
- {
64
- replace: 'SiTabsNextModule',
65
- replaceWith: 'SiTabsModule'
66
- }
67
- ],
68
- toModule: '@siemens/element-ng/tabs'
69
- },
70
- {
71
- module: /@(siemens|simpl)\/element-ng(\/popover)?/,
72
- symbolRenamings: [
73
- { replace: 'SiPopoverDirective', replaceWith: 'SiPopoverLegacyDirective' },
74
- { replace: 'SiPopoverModule', replaceWith: 'SiPopoverLegacyModule' }
75
- ],
76
- toModule: '@siemens/element-ng/popover-legacy'
77
- },
78
- {
79
- module: /@(siemens|simpl)\/element-ng(\/popover-next)?/,
80
- symbolRenamings: [
81
- { replace: 'SiPopoverNextDirective', replaceWith: 'SiPopoverDirective' },
82
- { replace: 'SiPopoverNextModule', replaceWith: 'SiPopoverModule' }
83
- ],
84
- toModule: '@siemens/element-ng/popover'
85
- },
86
- {
87
- module: /@(siemens|simpl)\/dashboards-ng/,
88
- symbolRenamings: [{ replace: 'CONFIG_TOKEN', replaceWith: 'SI_DASHBOARD_CONFIGURATION' }]
89
- },
90
- {
91
- module: /@(siemens|simpl)\/element-ng(\/toast-notification)?/,
92
- symbolRenamings: [{ replace: 'ToastStateName', replaceWith: 'StatusType' }],
93
- toModule: '@siemens/element-ng/common'
94
- },
95
- {
96
- module: /@(siemens|simpl)\/element-ng(\/(info-page|unauthorized-page))?/,
97
- symbolRenamings: [
98
- { replace: 'SiUnauthorizedPageComponent', replaceWith: 'SiInfoPageComponent' }
99
- ],
100
- toModule: '@siemens/element-ng/info-page'
101
- }
102
- ];
103
- const ATTRIBUTE_SELECTORS_MIGRATION = [
104
- { replace: 'siPopover', replaceWith: 'siPopoverLegacy' },
105
- { replace: 'siPopoverNext', replaceWith: 'siPopover' }
106
- ];
107
- const ELEMENT_SELECTORS_MIGRATION = [
108
- // current to legacy
109
- { replace: 'si-icon', replaceWith: 'si-icon-legacy' },
110
- { replace: 'si-tabset', replaceWith: 'si-tabset-legacy' },
111
- { replace: 'si-tab', replaceWith: 'si-tab-legacy' },
112
- // next to current
113
- { replace: 'si-icon-next', replaceWith: 'si-icon' },
114
- { replace: 'si-tabset-next', replaceWith: 'si-tabset' },
115
- { replace: 'si-tab-next', replaceWith: 'si-tab' },
116
- // v49 to v51
117
- {
118
- replace: 'si-unauthorized-page',
119
- replaceWith: 'si-info-page',
120
- defaultAttributes: [
121
- { name: 'icon', value: 'element-warning-filled' },
122
- { name: 'iconColor', value: 'status-warning' }
123
- ]
124
- }
125
- ];
126
- const SYMBOL_REMOVALS_MIGRATION = [
127
- {
128
- module: /@(siemens|simpl)\/element-ng(\/accordion)?/,
129
- elementSelector: 'si-accordion',
130
- names: ['colorVariant']
131
- },
132
- {
133
- module: /@(siemens|simpl)\/element-ng(\/datepicker)?/,
134
- elementSelector: 'input',
135
- attributeSelector: 'siDateInput',
136
- names: ['dateInputDebounceTime']
137
- },
138
- {
139
- module: /@(siemens|simpl)\/element-ng(\/datepicker)?/,
140
- elementSelector: 'input',
141
- attributeSelector: 'siDatepicker',
142
- names: ['triggeringInput']
143
- },
144
- {
145
- module: /@(siemens|simpl)\/element-ng(\/datepicker)?/,
146
- elementSelector: 'si-date-range',
147
- names: ['debounceTime']
148
- },
149
- {
150
- module: /@(siemens|simpl)\/element-ng(\/filtered-search)?/,
151
- elementSelector: 'si-filtered-search',
152
- names: ['showIcon', 'noMatchingCriteriaText']
153
- },
154
- {
155
- module: /@(siemens|simpl)\/element-ng(\/form)?/,
156
- elementSelector: 'si-form-item',
157
- names: ['inputId', 'readonly']
158
- },
159
- {
160
- module: /@(siemens|simpl)\/element-ng(\/navbar-vertical)?/,
161
- elementSelector: 'si-navbar-vertical',
162
- names: ['autoCollapseDelay']
163
- },
164
- {
165
- module: /@(siemens|simpl)\/element-ng(\/split)?/,
166
- elementSelector: 'si-split-part',
167
- names: ['headerStatusColor', 'headerStatusIconClass']
168
- },
169
- {
170
- module: /@(siemens|simpl)\/element-ng(\/navbar-vertical)?/,
171
- elementSelector: 'si-tree-view',
172
- names: ['disableFilledIcons', 'trackByFunction']
173
- },
174
- {
175
- module: /@(siemens|simpl)\/charts-ng/,
176
- elementSelector: 'si-chart-gauge',
177
- names: ['numberOfDecimals']
178
- }
179
- ];
180
- const COMPONENT_PROPERTY_NAMES_MIGRATION = [
181
- // Output name changes
182
- {
183
- module: /@(siemens|simpl)\/element-ng(\/accordion)?/,
184
- elementSelector: 'si-collapsible-panel',
185
- propertyMappings: [{ replace: '(toggle)', replaceWith: '(panelToggle)' }]
186
- },
187
- // Input name changes
188
- // v49 to v51
189
- {
190
- module: /@(siemens|simpl)\/element-ng/,
191
- elementSelector: 'si-filtered-search',
192
- propertyMappings: [{ replace: 'readonly', replaceWith: 'disabled' }]
193
- },
194
- {
195
- module: /@(siemens|simpl)\/charts-ng/,
196
- elementSelector: 'si-chart-gauge',
197
- propertyMappings: [
198
- { replace: 'numberOfDecimals', replaceWith: ['minNumberOfDecimals', 'maxNumberOfDecimals'] }
199
- ]
200
- },
201
- {
202
- module: /@(siemens|simpl)\/element-ng(\/(info-page|unauthorized-page))?/,
203
- elementSelector: 'si-unauthorized-page',
204
- propertyMappings: [
205
- { replace: 'heading', replaceWith: 'titleText' },
206
- { replace: 'subHeading', replaceWith: 'copyText' },
207
- { replace: 'description', replaceWith: 'instructions' }
208
- ]
209
- }
210
- ];
211
- const COMPONENT_PROPERTY_TO_CHILD_MIGRATION = [
212
- {
213
- parentElementSelector: 'si-map',
214
- childElementSelector: 'si-map-tooltip',
215
- propertyName: 'moreText'
216
- }
217
- ];
218
- const CLASS_MEMBER_REPLACEMENTS_MIGRATION = [
219
- {
220
- module: /@(siemens|simpl)\/element-ng(\/resize-observer)?/,
221
- typeNames: ['SiResponsiveContainerDirective'],
222
- propertyReplacements: [
223
- { property: 'isXs', replacement: '${expression}.xs()' },
224
- { property: 'isSm', replacement: '${expression}.sm()' },
225
- { property: 'isMd', replacement: '${expression}.md()' },
226
- { property: 'isLg', replacement: '${expression}.lg()' },
227
- { property: 'isXl', replacement: '${expression}.xl()' },
228
- { property: 'isXxl', replacement: '${expression}.xxl()' }
229
- ]
230
- },
231
- {
232
- module: /@(siemens|simpl)\/element-ng(\/modal)?/,
233
- typeNames: ['ModalOptions'],
234
- propertyReplacements: [{ property: 'initialState', replacement: '${expression}.inputValues' }]
235
- }
236
- ];
237
- const ELEMENT_CLASS_CHANGES_MIGRATION = [
238
- {
239
- requiredClasses: ['btn-ghost'],
240
- removeClasses: ['btn-ghost'],
241
- addClasses: ['btn-tertiary-ghost']
242
- },
243
- {
244
- requiredClasses: ['btn-primary-ghost'],
245
- removeClasses: ['btn-primary-ghost'],
246
- addClasses: ['btn-ghost']
247
- },
248
- {
249
- elementSelector: 'si-select',
250
- requiredClasses: [],
251
- excludedClasses: ['form-control', 'btn'],
252
- removeClasses: [],
253
- addClasses: ['btn', 'btn-ghost']
254
- },
255
- // btn-circle with btn-sm should have btn-sm removed
256
- {
257
- requiredClasses: ['btn', 'btn-circle', 'btn-sm'],
258
- removeClasses: ['btn-sm'],
259
- addClasses: []
260
- },
261
- // btn-circle with btn-xs should migrate to btn-sm
262
- {
263
- requiredClasses: ['btn', 'btn-circle', 'btn-xs'],
264
- removeClasses: ['btn-xs'],
265
- addClasses: ['btn-sm']
266
- },
267
- // btn-circle without size modifier should get btn-lg
268
- {
269
- requiredClasses: ['btn', 'btn-circle'],
270
- excludedClasses: ['btn-lg', 'btn-sm', 'btn-xs'],
271
- removeClasses: [],
272
- addClasses: ['btn-lg']
273
- },
274
- // Non-circle buttons with btn-xs should migrate to btn-sm
275
- {
276
- requiredClasses: ['btn', 'btn-xs'],
277
- excludedClasses: ['btn-circle'],
278
- removeClasses: ['btn-xs'],
279
- addClasses: ['btn-sm']
280
- }
281
- ];
282
- const PROVIDER_FUNCTION_REMOVALS_MIGRATION = [
283
- {
284
- module: /@(siemens)\/element-ng(\/icon)?/,
285
- names: ['provideIconConfig']
286
- }
287
- ];
288
- /**
289
- * Stable migration data for testing.
290
- * This data is frozen and used for testing to ensure test stability.
291
- * Do not modify this data unless you intend to update the test expectations.
292
- */
293
- export const getElementMigrationTestData = () => ({
294
- attributeSelectorChanges: ATTRIBUTE_SELECTORS_MIGRATION,
295
- classMemberReplacementChanges: CLASS_MEMBER_REPLACEMENTS_MIGRATION,
296
- componentPropertyNameChanges: COMPONENT_PROPERTY_NAMES_MIGRATION,
297
- cssCustomPropertyChanges: CSS_CUSTOM_PROPERTIES_MIGRATION,
298
- componentPropertyToChildChanges: COMPONENT_PROPERTY_TO_CHILD_MIGRATION,
299
- elementClassChanges: ELEMENT_CLASS_CHANGES_MIGRATION,
300
- elementSelectorChanges: ELEMENT_SELECTORS_MIGRATION,
301
- providerFunctionRemovalChanges: PROVIDER_FUNCTION_REMOVALS_MIGRATION,
302
- symbolRemovalChanges: SYMBOL_REMOVALS_MIGRATION,
303
- symbolRenamingChanges: SYMBOL_RENAMING_MIGRATION
304
- });
@@ -1,54 +0,0 @@
1
- import { UnitTestTree } from '@angular-devkit/schematics/testing';
2
- const testAppCache = new Map();
3
- /**
4
- * Creates a sample workspace with two applications: 'app' (default) and 'second-app'
5
- */
6
- export const createTestApp = async (runner, appOptions = {}, files) => {
7
- const cacheKey = JSON.stringify(appOptions);
8
- let cachedTree = testAppCache.get(cacheKey);
9
- if (!cachedTree) {
10
- cachedTree = createBaseTestApp(runner, appOptions);
11
- testAppCache.set(cacheKey, cachedTree);
12
- }
13
- const tree = new UnitTestTree((await cachedTree).branch());
14
- if (files) {
15
- addTestFiles(tree, files);
16
- }
17
- return tree;
18
- };
19
- const createBaseTestApp = async (runner, appOptions) => {
20
- let tree = await createWorkspace(runner);
21
- tree = await runner.runExternalSchematic('@schematics/angular', 'application', { name: 'app', ...appOptions }, tree);
22
- tree = await runner.runExternalSchematic('@schematics/angular', 'application', { name: 'second-app', ...appOptions }, tree);
23
- return tree;
24
- };
25
- const createWorkspace = (runner) => {
26
- return runner.runExternalSchematic('@schematics/angular', 'workspace', {
27
- name: 'workspace',
28
- version: '1.0.0',
29
- newProjectRoot: 'projects'
30
- });
31
- };
32
- export const addTestFiles = (tree, files) => {
33
- Object.entries(files).forEach(([path, content]) => {
34
- if (tree.exists(path)) {
35
- tree.overwrite(path, content);
36
- }
37
- else {
38
- tree.create(path, content);
39
- }
40
- });
41
- return tree;
42
- };
43
- export const readLines = (tree, path) => tree
44
- .readContent(path)
45
- .split('\n')
46
- .filter(l => l.length > 0);
47
- export const removeTestFiles = (tree, files) => {
48
- files.forEach(path => {
49
- if (tree.exists(path)) {
50
- tree.delete(path);
51
- }
52
- });
53
- return tree;
54
- };