@siemens/element-ng 48.1.0 → 48.2.0-rc.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/card/index.d.ts +68 -29
- package/common/index.d.ts +11 -0
- package/dashboard/index.d.ts +1 -0
- package/datepicker/index.d.ts +30 -34
- package/fesm2022/siemens-element-ng-breadcrumb.mjs +2 -2
- package/fesm2022/siemens-element-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-card.mjs +103 -37
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-common.mjs +6 -0
- package/fesm2022/siemens-element-ng-common.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-connection-strength.mjs +2 -2
- package/fesm2022/siemens-element-ng-connection-strength.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-content-action-bar.mjs +2 -2
- package/fesm2022/siemens-element-ng-content-action-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-dashboard.mjs +10 -8
- package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datatable.mjs +5 -0
- package/fesm2022/siemens-element-ng-datatable.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datepicker.mjs +173 -151
- package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-file-uploader.mjs +2 -2
- package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filter-bar.mjs +5 -5
- package/fesm2022/siemens-element-ng-filter-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +15 -3
- package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-form.mjs +7 -1
- package/fesm2022/siemens-element-ng-form.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-formly.mjs +2 -2
- package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ip-input.mjs +38 -0
- package/fesm2022/siemens-element-ng-ip-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-language-switcher.mjs +1 -1
- package/fesm2022/siemens-element-ng-language-switcher.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-list-details.mjs +2 -2
- package/fesm2022/siemens-element-ng-list-details.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-pagination.mjs +2 -2
- package/fesm2022/siemens-element-ng-pagination.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-photo-upload.mjs +1 -1
- package/fesm2022/siemens-element-ng-photo-upload.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-search-bar.mjs +14 -4
- package/fesm2022/siemens-element-ng-search-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-side-panel.mjs +2 -2
- package/fesm2022/siemens-element-ng-side-panel.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-bar.mjs +2 -2
- package/fesm2022/siemens-element-ng-status-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs +2 -2
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs.mjs +5 -5
- package/fesm2022/siemens-element-ng-tabs.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tooltip.mjs +5 -6
- package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +4 -4
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-typeahead.mjs +329 -257
- package/fesm2022/siemens-element-ng-typeahead.mjs.map +1 -1
- package/filter-bar/index.d.ts +9 -3
- package/ip-input/index.d.ts +42 -4
- package/package.json +23 -19
- package/schematics/collection.json +28 -0
- package/schematics/ng-add/index.js +16 -0
- package/schematics/ng-add/schema.json +16 -0
- package/schematics/scss-import-to-siemens-migration/index.js +101 -0
- package/schematics/scss-import-to-siemens-migration/schema.json +16 -0
- package/schematics/scss-import-to-siemens-migration/style-mappings.js +46 -0
- package/schematics/simpl-siemens-migration/index.js +17 -0
- package/schematics/simpl-siemens-migration/schema.json +16 -0
- package/schematics/ts-import-to-siemens-migration/index.js +118 -0
- package/schematics/ts-import-to-siemens-migration/mappings/charts-ng-mappings.js +70 -0
- package/schematics/ts-import-to-siemens-migration/mappings/dashboards-ng-mappings.js +52 -0
- package/schematics/ts-import-to-siemens-migration/mappings/element-ng-mappings.js +651 -0
- package/schematics/ts-import-to-siemens-migration/mappings/element-translate-ng-mappings.js +21 -0
- package/schematics/ts-import-to-siemens-migration/mappings/index.js +9 -0
- package/schematics/ts-import-to-siemens-migration/mappings/maps-ng-mappings.js +46 -0
- package/schematics/ts-import-to-siemens-migration/model.js +4 -0
- package/schematics/ts-import-to-siemens-migration/schema.json +16 -0
- package/schematics/utils/index.js +8 -0
- package/schematics/utils/project-utils.js +75 -0
- package/schematics/utils/schematics-file-system.js +22 -0
- package/schematics/utils/testing.js +41 -0
- package/schematics/utils/ts-utils.js +99 -0
- package/search-bar/index.d.ts +11 -1
- package/template-i18n.json +7 -0
- package/tooltip/index.d.ts +1 -1
- package/translate/index.d.ts +7 -0
- package/typeahead/index.d.ts +85 -4
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export const ELEMENT_TRANSLATE_NG_MAPPINGS = {
|
|
6
|
+
'getBrowserCultureLanguage': '@siemens/element-translate-ng/translate',
|
|
7
|
+
'getBrowserLanguage': '@siemens/element-translate-ng/translate',
|
|
8
|
+
'injectSiTranslateService': '@siemens/element-translate-ng/translate',
|
|
9
|
+
'provideMockTranslateServiceBuilder': '@siemens/element-translate-ng/translate',
|
|
10
|
+
'provideNgLocalizeForElement': '@siemens/element-translate-ng/angular-localize',
|
|
11
|
+
'provideNgxTranslateForElement': '@siemens/element-translate-ng/ngx-translate',
|
|
12
|
+
'SI_TRANSLATABLE_VALUES': '@siemens/element-translate-ng/translate',
|
|
13
|
+
'SiNoTranslateService': '@siemens/element-translate-ng/translate',
|
|
14
|
+
'SiTranslateModule': '@siemens/element-translate-ng/translate',
|
|
15
|
+
'SiTranslateNgLocalizeModule': '@siemens/element-translate-ng/angular-localize',
|
|
16
|
+
'SiTranslateNgxTModule': '@siemens/element-translate-ng/ngx-translate',
|
|
17
|
+
'SiTranslatePipe': '@siemens/element-translate-ng/translate',
|
|
18
|
+
't': '@siemens/element-translate-ng/translate',
|
|
19
|
+
'TranslatableString': '@siemens/element-translate-ng/translate-types',
|
|
20
|
+
'TranslationResult': '@siemens/element-translate-ng/translate'
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export * from './charts-ng-mappings.js';
|
|
6
|
+
export * from './dashboards-ng-mappings.js';
|
|
7
|
+
export * from './element-ng-mappings.js';
|
|
8
|
+
export * from './element-translate-ng-mappings.js';
|
|
9
|
+
export * from './maps-ng-mappings.js';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export const MAPS_NG_MAPPINGS = {
|
|
6
|
+
'ANIMATION_DURATION': '@siemens/maps-ng',
|
|
7
|
+
'CLUSTER_CHARTS_FRAGMENTS': '@siemens/maps-ng',
|
|
8
|
+
'CLUSTER_RADIUS_SIZE': '@siemens/maps-ng',
|
|
9
|
+
'ColorPalette': '@siemens/maps-ng',
|
|
10
|
+
'ColorPalettes': '@siemens/maps-ng',
|
|
11
|
+
'DEFAULT_CLUSTER_CLICK_ZOOM': '@siemens/maps-ng',
|
|
12
|
+
'DEFAULT_CLUSTER_DISTANCE': '@siemens/maps-ng',
|
|
13
|
+
'DEFAULT_CLUSTER_TYPE': '@siemens/maps-ng',
|
|
14
|
+
'DEFAULT_DONUT_RATIO': '@siemens/maps-ng',
|
|
15
|
+
'DEFAULT_FEATURE_CLICK_ZOOM': '@siemens/maps-ng',
|
|
16
|
+
'DEFAULT_FEATURE_SELECT_ZOOM': '@siemens/maps-ng',
|
|
17
|
+
'DEFAULT_FIT_PADDING': '@siemens/maps-ng',
|
|
18
|
+
'DEFAULT_GLOBAL_ZOOM': '@siemens/maps-ng',
|
|
19
|
+
'DEFAULT_ICON_SCALE': '@siemens/maps-ng',
|
|
20
|
+
'DEFAULT_ICON': '@siemens/maps-ng',
|
|
21
|
+
'DEFAULT_OFFSET': '@siemens/maps-ng',
|
|
22
|
+
'DEFAULT_STROKE_WEIGHT': '@siemens/maps-ng',
|
|
23
|
+
'GEOJSON_LAYER': '@siemens/maps-ng',
|
|
24
|
+
'Grouping': '@siemens/maps-ng',
|
|
25
|
+
'IconMarkerOptions': '@siemens/maps-ng',
|
|
26
|
+
'LabelOptions': '@siemens/maps-ng',
|
|
27
|
+
'LAYER_NAME': '@siemens/maps-ng',
|
|
28
|
+
'MapPoint': '@siemens/maps-ng',
|
|
29
|
+
'MapPointMetaData': '@siemens/maps-ng',
|
|
30
|
+
'MapService': '@siemens/maps-ng',
|
|
31
|
+
'MarkerOptions': '@siemens/maps-ng',
|
|
32
|
+
'MarkerStatusType': '@siemens/maps-ng',
|
|
33
|
+
'MAX_CLUSTER_BUILDINGS': '@siemens/maps-ng',
|
|
34
|
+
'OverlayNativeProperties': '@siemens/maps-ng',
|
|
35
|
+
'POINTS_LAYER': '@siemens/maps-ng',
|
|
36
|
+
'provideSiMapsTranslatableOverrides': '@siemens/maps-ng/translate',
|
|
37
|
+
'RenderOptions': '@siemens/maps-ng',
|
|
38
|
+
'SIEMENS_FONT_LABELS': '@siemens/maps-ng',
|
|
39
|
+
'SIEMENS_FONT': '@siemens/maps-ng',
|
|
40
|
+
'SiMapComponent': '@siemens/maps-ng',
|
|
41
|
+
'SiMapModule': '@siemens/maps-ng',
|
|
42
|
+
'SiMapPopoverComponent': '@siemens/maps-ng',
|
|
43
|
+
'SiMapsNgModule': '@siemens/maps-ng',
|
|
44
|
+
'SiMapTooltipComponent': '@siemens/maps-ng',
|
|
45
|
+
'TOOLTIP_FEATURES_TO_DISPLAY': '@siemens/maps-ng'
|
|
46
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "TsImportToSiemensMigrationSchema",
|
|
4
|
+
"title": "TypeScript import to Siemens Migration Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"path": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Path to the directory where all simpl imports should be migrated.",
|
|
10
|
+
"x-prompt": "Which directory do you want to migrate?",
|
|
11
|
+
"format": "path",
|
|
12
|
+
"default": "/"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { normalize } from '@angular-devkit/core';
|
|
6
|
+
import { SchematicsException } from '@angular-devkit/schematics';
|
|
7
|
+
import { dirname, isAbsolute, resolve } from 'path';
|
|
8
|
+
import { parseTsconfigFile } from './ts-utils.js';
|
|
9
|
+
export const getGlobalStyles = (tree) => {
|
|
10
|
+
const globalStyles = new Set();
|
|
11
|
+
for (const target of getTargets(getWorkspace(tree))) {
|
|
12
|
+
if (target.options?.styles && Array.isArray(target.options.styles)) {
|
|
13
|
+
target.options.styles.forEach((style) => {
|
|
14
|
+
if (typeof style === 'string') {
|
|
15
|
+
globalStyles.add(normalize(style));
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return [...globalStyles];
|
|
21
|
+
};
|
|
22
|
+
export const getWorkspace = (tree) => {
|
|
23
|
+
const workspace = tree.read('/angular.json');
|
|
24
|
+
if (!workspace) {
|
|
25
|
+
throw new SchematicsException('Could not find angular.json');
|
|
26
|
+
}
|
|
27
|
+
return JSON.parse(workspace.toString());
|
|
28
|
+
};
|
|
29
|
+
export const getTsConfigPaths = (tree) => {
|
|
30
|
+
const buildPaths = new Set();
|
|
31
|
+
for (const target of getTargets(getWorkspace(tree))) {
|
|
32
|
+
if (target.options?.tsConfig && typeof target.options.tsConfig === 'string') {
|
|
33
|
+
const tsConfig = target.options.tsConfig;
|
|
34
|
+
if (tree.exists(tsConfig)) {
|
|
35
|
+
buildPaths.add(normalize(tsConfig));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return [...buildPaths];
|
|
40
|
+
};
|
|
41
|
+
export const discoverSourceFiles = (tree, context, projectPath, extension = '.ts') => {
|
|
42
|
+
const basePath = normalize(process.cwd());
|
|
43
|
+
// Wrap the tree to force full paths since parsing the typescript config requires full paths.
|
|
44
|
+
const tsConfigs = getTsConfigPaths(tree);
|
|
45
|
+
if (!tsConfigs.length) {
|
|
46
|
+
throw new SchematicsException('Could not find any tsconfig file. Cannot run the migration.');
|
|
47
|
+
}
|
|
48
|
+
context.logger.debug(`Found tsconfig files: ${tsConfigs.join(', ')}`);
|
|
49
|
+
let sourceFiles = [];
|
|
50
|
+
for (const configPath of tsConfigs) {
|
|
51
|
+
const tsConfigPath = resolve(basePath, configPath);
|
|
52
|
+
const config = parseTsconfigFile(tsConfigPath, dirname(tsConfigPath), tree);
|
|
53
|
+
sourceFiles.push(...config.fileNames.filter(f => f.endsWith(extension)));
|
|
54
|
+
}
|
|
55
|
+
// Filter all files which are in the path
|
|
56
|
+
if (projectPath) {
|
|
57
|
+
sourceFiles = isAbsolute(projectPath)
|
|
58
|
+
? sourceFiles.filter(f => f.startsWith(projectPath))
|
|
59
|
+
: sourceFiles.filter(f => f.startsWith(resolve(basePath, projectPath)));
|
|
60
|
+
}
|
|
61
|
+
return Array.from(new Set(sourceFiles)).map(p => p.substring(basePath.length + 1));
|
|
62
|
+
};
|
|
63
|
+
function* getTargets(workspace, targetNames = ['build', 'test']) {
|
|
64
|
+
for (const [, projectRaw] of Object.entries(workspace.projects)) {
|
|
65
|
+
const project = projectRaw;
|
|
66
|
+
if (!project.architect) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
for (const [name, target] of Object.entries(project.architect)) {
|
|
70
|
+
if (targetNames.includes(name) && target) {
|
|
71
|
+
yield target;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { normalize } from '@angular-devkit/core';
|
|
6
|
+
import { relative } from 'path';
|
|
7
|
+
export class SchematicsFileSystem {
|
|
8
|
+
tree;
|
|
9
|
+
basePath = normalize(process.cwd());
|
|
10
|
+
constructor(tree) {
|
|
11
|
+
this.tree = tree;
|
|
12
|
+
}
|
|
13
|
+
readText = (path) => {
|
|
14
|
+
return this.tree.readText(normalize(relative(this.basePath, path)));
|
|
15
|
+
};
|
|
16
|
+
exists = (path) => {
|
|
17
|
+
return this.tree.exists(normalize(relative(this.basePath, path)));
|
|
18
|
+
};
|
|
19
|
+
getDir = (path) => {
|
|
20
|
+
return this.tree.getDir(normalize(relative(this.basePath, path)));
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a sample workspace with two applications: 'app' (default) and 'second-app'
|
|
3
|
+
*/
|
|
4
|
+
export const createTestApp = async (runner, appOptions = {}, files) => {
|
|
5
|
+
let tree = await createWorkspace(runner);
|
|
6
|
+
if (files) {
|
|
7
|
+
addTestFiles(tree, files);
|
|
8
|
+
}
|
|
9
|
+
tree = await runner.runExternalSchematic('@schematics/angular', 'application', { name: 'app', ...appOptions }, tree);
|
|
10
|
+
return runner.runExternalSchematic('@schematics/angular', 'application', { name: 'second-app', ...appOptions }, tree);
|
|
11
|
+
};
|
|
12
|
+
const createWorkspace = (runner) => {
|
|
13
|
+
return runner.runExternalSchematic('@schematics/angular', 'workspace', {
|
|
14
|
+
name: 'workspace',
|
|
15
|
+
version: '1.0.0',
|
|
16
|
+
newProjectRoot: 'projects'
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
export const addTestFiles = (tree, files) => {
|
|
20
|
+
Object.entries(files).forEach(([path, content]) => {
|
|
21
|
+
if (tree.exists(path)) {
|
|
22
|
+
tree.overwrite(path, content);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
tree.create(path, content);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return tree;
|
|
29
|
+
};
|
|
30
|
+
export const readLines = (tree, path) => tree
|
|
31
|
+
.readContent(path)
|
|
32
|
+
.split('\n')
|
|
33
|
+
.filter(l => l.length > 0);
|
|
34
|
+
export const removeTestFiles = (tree, files) => {
|
|
35
|
+
files.forEach(path => {
|
|
36
|
+
if (tree.exists(path)) {
|
|
37
|
+
tree.delete(path);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return tree;
|
|
41
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { normalize } from '@angular-devkit/core';
|
|
6
|
+
import { SchematicsException } from '@angular-devkit/schematics';
|
|
7
|
+
import { isAbsolute } from 'path';
|
|
8
|
+
import ts from 'typescript';
|
|
9
|
+
import { SchematicsFileSystem } from './schematics-file-system.js';
|
|
10
|
+
/**
|
|
11
|
+
* Reads and parses a tsconfig file from the given path.
|
|
12
|
+
*/
|
|
13
|
+
export const parseTsconfigFile = (tsconfigPath, basePath, tree) => {
|
|
14
|
+
// Parse the tsconfig file content
|
|
15
|
+
const fs = new SchematicsFileSystem(tree);
|
|
16
|
+
const { config, error } = ts.readConfigFile(tsconfigPath, fs.readText);
|
|
17
|
+
if (error) {
|
|
18
|
+
throw new SchematicsException(`Error parsing ${tsconfigPath}: ${error.messageText}`);
|
|
19
|
+
}
|
|
20
|
+
// Create a ts.ParseConfigHost that uses the schematics Tree
|
|
21
|
+
const parseConfigHost = {
|
|
22
|
+
fileExists: fs.exists,
|
|
23
|
+
readFile: fs.readText,
|
|
24
|
+
readDirectory: (path, _extensions, _excludes, _includes, _depth) => visitDirectory(fs, path),
|
|
25
|
+
useCaseSensitiveFileNames: true
|
|
26
|
+
};
|
|
27
|
+
// Throw if incorrect arguments are passed to this function. Passing relative base paths
|
|
28
|
+
// results in root directories not being resolved and in later type checking runtime errors.
|
|
29
|
+
// More details can be found here: https://github.com/microsoft/TypeScript/issues/37731.
|
|
30
|
+
if (!isAbsolute(basePath)) {
|
|
31
|
+
throw Error('Unexpected relative base path has been specified.');
|
|
32
|
+
}
|
|
33
|
+
return ts.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Finds all nodes which match the given kind.
|
|
37
|
+
*/
|
|
38
|
+
export const findNodes = (node, kindOrGuard, max = Infinity, recursive = false) => {
|
|
39
|
+
if (!node || max == 0) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
const test = typeof kindOrGuard === 'function'
|
|
43
|
+
? kindOrGuard
|
|
44
|
+
: // eslint-disable-next-line @typescript-eslint/no-shadow
|
|
45
|
+
(node) => node.kind === kindOrGuard;
|
|
46
|
+
const arr = [];
|
|
47
|
+
if (test(node)) {
|
|
48
|
+
arr.push(node);
|
|
49
|
+
max--;
|
|
50
|
+
}
|
|
51
|
+
if (max > 0 && (recursive || !test(node))) {
|
|
52
|
+
for (const child of node.getChildren()) {
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-loop-func, @typescript-eslint/no-shadow
|
|
54
|
+
findNodes(child, test, max, recursive).forEach(node => {
|
|
55
|
+
if (max > 0) {
|
|
56
|
+
arr.push(node);
|
|
57
|
+
}
|
|
58
|
+
max--;
|
|
59
|
+
});
|
|
60
|
+
if (max <= 0) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return arr;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Gets the import nodes from a TypeScript file which start the given import path.
|
|
69
|
+
*/
|
|
70
|
+
export const getImportNodes = (filePath, content, specifier) => {
|
|
71
|
+
const sourceFile = ts.createSourceFile(filePath, content.toString(), ts.ScriptTarget.Latest, true);
|
|
72
|
+
// Find all import declarations in the source file
|
|
73
|
+
const allImports = findNodes(sourceFile, ts.SyntaxKind.ImportDeclaration);
|
|
74
|
+
return allImports.filter(node => node.moduleSpecifier &&
|
|
75
|
+
ts.isStringLiteral(node.moduleSpecifier) &&
|
|
76
|
+
node.moduleSpecifier.text.startsWith(specifier));
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Gets the imported symbols from an import declaration.
|
|
80
|
+
*/
|
|
81
|
+
export const getSymbols = (node) => {
|
|
82
|
+
// Extract all imported component names or module names from @simpl/ imports
|
|
83
|
+
return node.importClause?.namedBindings && ts.isNamedImports(node.importClause.namedBindings)
|
|
84
|
+
? node.importClause.namedBindings.elements
|
|
85
|
+
: [];
|
|
86
|
+
};
|
|
87
|
+
const visitDirectory = (fs, dirPath) => {
|
|
88
|
+
const entries = fs.getDir(dirPath);
|
|
89
|
+
const files = [];
|
|
90
|
+
entries.subfiles.forEach(filename => {
|
|
91
|
+
const fullPath = normalize(`${dirPath}/${filename}`);
|
|
92
|
+
files.push(fullPath);
|
|
93
|
+
});
|
|
94
|
+
entries.subdirs.forEach(subdirname => {
|
|
95
|
+
const newFiles = visitDirectory(fs, `${dirPath}/${subdirname}`);
|
|
96
|
+
files.push(...newFiles);
|
|
97
|
+
});
|
|
98
|
+
return files;
|
|
99
|
+
};
|
package/search-bar/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _siemens_element_translate_ng_translate_types from '@siemens/element-translate-ng/translate-types';
|
|
1
2
|
import * as _angular_core from '@angular/core';
|
|
2
3
|
import { OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
|
3
4
|
import { ControlValueAccessor } from '@angular/forms';
|
|
@@ -49,6 +50,15 @@ declare class SiSearchBarComponent implements OnInit, OnDestroy, ControlValueAcc
|
|
|
49
50
|
readonly colorVariant: _angular_core.InputSignal<BackgroundColorVariant>;
|
|
50
51
|
/** @defaultValue false */
|
|
51
52
|
readonly disabledInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
53
|
+
/**
|
|
54
|
+
* Aria label for the clear button.
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue
|
|
57
|
+
* ```
|
|
58
|
+
* t(() => $localize`:@@SI_SEARCH_BAR.CLEAR_BUTTON:clear`)
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
readonly clearButtonAriaLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate_types.TranslatableString>;
|
|
52
62
|
/**
|
|
53
63
|
* Output callback event will provide you with search term if search input changes.
|
|
54
64
|
*/
|
|
@@ -81,7 +91,7 @@ declare class SiSearchBarComponent implements OnInit, OnDestroy, ControlValueAcc
|
|
|
81
91
|
protected resetForm(): void;
|
|
82
92
|
protected writeSearchValue(value: string): void;
|
|
83
93
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiSearchBarComponent, never>;
|
|
84
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiSearchBarComponent, "si-search-bar", never, { "debounceTime": { "alias": "debounceTime"; "required": false; "isSignal": true; }; "prohibitedCharacters": { "alias": "prohibitedCharacters"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "tabbable": { "alias": "tabbable"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "colorVariant": { "alias": "colorVariant"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "searchChange": "searchChange"; }, never, never, true, never>;
|
|
94
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiSearchBarComponent, "si-search-bar", never, { "debounceTime": { "alias": "debounceTime"; "required": false; "isSignal": true; }; "prohibitedCharacters": { "alias": "prohibitedCharacters"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "tabbable": { "alias": "tabbable"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "colorVariant": { "alias": "colorVariant"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; "clearButtonAriaLabel": { "alias": "clearButtonAriaLabel"; "required": false; "isSignal": true; }; }, { "searchChange": "searchChange"; }, never, never, true, never>;
|
|
85
95
|
}
|
|
86
96
|
|
|
87
97
|
declare class SiSearchBarModule {
|
package/template-i18n.json
CHANGED
|
@@ -102,18 +102,24 @@
|
|
|
102
102
|
"SI_FILTER_BAR.RESET_FILTERS": "Reset filters",
|
|
103
103
|
"SI_FORM_CONTAINER.ERROR.DATE_FORMAT": "Invalid date format.",
|
|
104
104
|
"SI_FORM_CONTAINER.ERROR.EMAIL": "The email is not valid.",
|
|
105
|
+
"SI_FORM_CONTAINER.ERROR.HOURS": "The hours are not valid.",
|
|
105
106
|
"SI_FORM_CONTAINER.ERROR.IPV4": "Invalid IPv4 address.",
|
|
106
107
|
"SI_FORM_CONTAINER.ERROR.IPV6": "Invalid IPv6 address.",
|
|
107
108
|
"SI_FORM_CONTAINER.ERROR.MAX": "The value is too large.",
|
|
108
109
|
"SI_FORM_CONTAINER.ERROR.MAX_DATE": "The date is too far in the future.",
|
|
109
110
|
"SI_FORM_CONTAINER.ERROR.MAX_LENGTH": "A maximum number of characters is exceeded.",
|
|
111
|
+
"SI_FORM_CONTAINER.ERROR.MAX_TIME": "The time is too far in the future.",
|
|
112
|
+
"SI_FORM_CONTAINER.ERROR.MILLISECONDS": "The milliseconds are not valid.",
|
|
110
113
|
"SI_FORM_CONTAINER.ERROR.MIN": "The value is too small",
|
|
114
|
+
"SI_FORM_CONTAINER.ERROR.MINUTES": "The minutes are not valid.",
|
|
111
115
|
"SI_FORM_CONTAINER.ERROR.MIN_DATE": "The date is too far in the past.",
|
|
112
116
|
"SI_FORM_CONTAINER.ERROR.MIN_LENGTH": "The minimum number of characters is not met.",
|
|
117
|
+
"SI_FORM_CONTAINER.ERROR.MIN_TIME": "The time is too far in the past.",
|
|
113
118
|
"SI_FORM_CONTAINER.ERROR.NUMBER_FORMAT": "The value is not a valid number.",
|
|
114
119
|
"SI_FORM_CONTAINER.ERROR.PATTERN": "The value does not match the predefined pattern.",
|
|
115
120
|
"SI_FORM_CONTAINER.ERROR.REQUIRED": "A value is required.",
|
|
116
121
|
"SI_FORM_CONTAINER.ERROR.REQUIRED_TRUE": "The value should be true.",
|
|
122
|
+
"SI_FORM_CONTAINER.ERROR.SECONDS": "The seconds are not valid.",
|
|
117
123
|
"SI_ICON_STATUS.CAUTION": "Caution",
|
|
118
124
|
"SI_ICON_STATUS.CRITICAL": "Critical",
|
|
119
125
|
"SI_ICON_STATUS.DANGER": "Danger",
|
|
@@ -172,6 +178,7 @@
|
|
|
172
178
|
"SI_PHOTO_UPLOAD.UPLOAD_PHOTO": "Upload photo",
|
|
173
179
|
"SI_PILLS_INPUT.INPUT_ELEMENT_ARIA_LABEL": "Create item",
|
|
174
180
|
"SI_PROGRESSBAR.LABEL": "Progress",
|
|
181
|
+
"SI_SEARCH_BAR.CLEAR_BUTTON": "clear",
|
|
175
182
|
"SI_SELECT.NO-RESULTS-FOUND": "No results found",
|
|
176
183
|
"SI_SELECT.SEARCH-PLACEHOLDER": "Search...",
|
|
177
184
|
"SI_SIDE_PANEL.CLOSE": "Close",
|
package/tooltip/index.d.ts
CHANGED
|
@@ -36,7 +36,6 @@ declare class SiTooltipDirective implements OnDestroy {
|
|
|
36
36
|
private tooltipRef?;
|
|
37
37
|
private tooltipService;
|
|
38
38
|
private elementRef;
|
|
39
|
-
private destroyer;
|
|
40
39
|
ngOnDestroy(): void;
|
|
41
40
|
private showTooltip;
|
|
42
41
|
protected focusIn(): void;
|
|
@@ -70,6 +69,7 @@ declare class TooltipRef {
|
|
|
70
69
|
private describedBy;
|
|
71
70
|
private injector?;
|
|
72
71
|
constructor(overlayRef: OverlayRef, element: ElementRef, describedBy: string, injector?: Injector | undefined);
|
|
72
|
+
private subscription?;
|
|
73
73
|
show(content: TranslatableString | TemplateRef<any> | Type<any>, tooltipContext?: unknown): void;
|
|
74
74
|
hide(): void;
|
|
75
75
|
destroy(): void;
|
package/translate/index.d.ts
CHANGED
|
@@ -105,18 +105,24 @@ interface SiTranslatableKeys {
|
|
|
105
105
|
'SI_FILTER_BAR.RESET_FILTERS'?: string;
|
|
106
106
|
'SI_FORM_CONTAINER.ERROR.DATE_FORMAT'?: string;
|
|
107
107
|
'SI_FORM_CONTAINER.ERROR.EMAIL'?: string;
|
|
108
|
+
'SI_FORM_CONTAINER.ERROR.HOURS'?: string;
|
|
108
109
|
'SI_FORM_CONTAINER.ERROR.IPV4'?: string;
|
|
109
110
|
'SI_FORM_CONTAINER.ERROR.IPV6'?: string;
|
|
110
111
|
'SI_FORM_CONTAINER.ERROR.MAX'?: string;
|
|
111
112
|
'SI_FORM_CONTAINER.ERROR.MAX_DATE'?: string;
|
|
112
113
|
'SI_FORM_CONTAINER.ERROR.MAX_LENGTH'?: string;
|
|
114
|
+
'SI_FORM_CONTAINER.ERROR.MAX_TIME'?: string;
|
|
115
|
+
'SI_FORM_CONTAINER.ERROR.MILLISECONDS'?: string;
|
|
113
116
|
'SI_FORM_CONTAINER.ERROR.MIN'?: string;
|
|
117
|
+
'SI_FORM_CONTAINER.ERROR.MINUTES'?: string;
|
|
114
118
|
'SI_FORM_CONTAINER.ERROR.MIN_DATE'?: string;
|
|
115
119
|
'SI_FORM_CONTAINER.ERROR.MIN_LENGTH'?: string;
|
|
120
|
+
'SI_FORM_CONTAINER.ERROR.MIN_TIME'?: string;
|
|
116
121
|
'SI_FORM_CONTAINER.ERROR.NUMBER_FORMAT'?: string;
|
|
117
122
|
'SI_FORM_CONTAINER.ERROR.PATTERN'?: string;
|
|
118
123
|
'SI_FORM_CONTAINER.ERROR.REQUIRED'?: string;
|
|
119
124
|
'SI_FORM_CONTAINER.ERROR.REQUIRED_TRUE'?: string;
|
|
125
|
+
'SI_FORM_CONTAINER.ERROR.SECONDS'?: string;
|
|
120
126
|
'SI_ICON_STATUS.CAUTION'?: string;
|
|
121
127
|
'SI_ICON_STATUS.CRITICAL'?: string;
|
|
122
128
|
'SI_ICON_STATUS.DANGER'?: string;
|
|
@@ -175,6 +181,7 @@ interface SiTranslatableKeys {
|
|
|
175
181
|
'SI_PHOTO_UPLOAD.UPLOAD_PHOTO'?: string;
|
|
176
182
|
'SI_PILLS_INPUT.INPUT_ELEMENT_ARIA_LABEL'?: string;
|
|
177
183
|
'SI_PROGRESSBAR.LABEL'?: string;
|
|
184
|
+
'SI_SEARCH_BAR.CLEAR_BUTTON'?: string;
|
|
178
185
|
'SI_SELECT.NO-RESULTS-FOUND'?: string;
|
|
179
186
|
'SI_SELECT.SEARCH-PLACEHOLDER'?: string;
|
|
180
187
|
'SI_SIDE_PANEL.CLOSE'?: string;
|
package/typeahead/index.d.ts
CHANGED
|
@@ -5,6 +5,18 @@ import { ConnectionPositionPair } from '@angular/cdk/overlay';
|
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
import * as i1 from '@siemens/element-ng/autocomplete';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
10
|
+
* SPDX-License-Identifier: MIT
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface MatchSegment$1 {
|
|
14
|
+
text: string;
|
|
15
|
+
isMatching: boolean;
|
|
16
|
+
matches: number;
|
|
17
|
+
uniqueMatches: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
/**
|
|
9
21
|
* Copyright (c) Siemens 2016 - 2025
|
|
10
22
|
* SPDX-License-Identifier: MIT
|
|
@@ -213,7 +225,44 @@ declare class SiTypeaheadDirective implements OnChanges, OnDestroy {
|
|
|
213
225
|
/** Emits whenever the typeahead overlay is opened or closed. */
|
|
214
226
|
readonly typeaheadOpenChange: _angular_core.OutputEmitterRef<boolean>;
|
|
215
227
|
/** @internal */
|
|
216
|
-
readonly foundMatches: _angular_core.
|
|
228
|
+
readonly foundMatches: _angular_core.Signal<{
|
|
229
|
+
itemSelected: any;
|
|
230
|
+
iconClass: string | undefined;
|
|
231
|
+
option: TypeaheadOption;
|
|
232
|
+
text: string;
|
|
233
|
+
result: MatchSegment$1[];
|
|
234
|
+
stringMatch: boolean;
|
|
235
|
+
atBeginning: boolean;
|
|
236
|
+
matches: number;
|
|
237
|
+
uniqueMatches: number;
|
|
238
|
+
uniqueSeparateMatches: number;
|
|
239
|
+
matchesEntireQuery: boolean;
|
|
240
|
+
matchesAllParts: boolean;
|
|
241
|
+
matchesAllPartsSeparately: boolean;
|
|
242
|
+
}[] | TypeaheadMatch[] | {
|
|
243
|
+
option: {
|
|
244
|
+
text: string;
|
|
245
|
+
option: TypeaheadOption;
|
|
246
|
+
};
|
|
247
|
+
text: string;
|
|
248
|
+
result: {
|
|
249
|
+
text: string;
|
|
250
|
+
isMatching: boolean;
|
|
251
|
+
matches: number;
|
|
252
|
+
uniqueMatches: number;
|
|
253
|
+
}[];
|
|
254
|
+
itemSelected: any;
|
|
255
|
+
iconClass: string | undefined;
|
|
256
|
+
stringMatch: boolean;
|
|
257
|
+
atBeginning: boolean;
|
|
258
|
+
matches: number;
|
|
259
|
+
uniqueMatches: number;
|
|
260
|
+
uniqueSeparateMatches: number;
|
|
261
|
+
matchesEntireQuery: boolean;
|
|
262
|
+
matchesAllParts: boolean;
|
|
263
|
+
matchesAllPartsSeparately: boolean;
|
|
264
|
+
active: boolean;
|
|
265
|
+
}[]>;
|
|
217
266
|
/** @internal */
|
|
218
267
|
readonly query: _angular_core.WritableSignal<string>;
|
|
219
268
|
/**
|
|
@@ -226,12 +275,23 @@ declare class SiTypeaheadDirective implements OnChanges, OnDestroy {
|
|
|
226
275
|
private autoComplete;
|
|
227
276
|
private $typeahead;
|
|
228
277
|
private componentRef?;
|
|
229
|
-
private component?;
|
|
230
278
|
private inputTimer;
|
|
231
279
|
private sourceSubscription?;
|
|
232
|
-
private subscription?;
|
|
233
280
|
private matchSorter;
|
|
234
281
|
private overlayRef?;
|
|
282
|
+
/**
|
|
283
|
+
* Indicates that the typeahead can be potentially open.
|
|
284
|
+
* This signal is typically `true` when the input is focussed.
|
|
285
|
+
* It may be overridden and set to `false` when escape is pressed
|
|
286
|
+
* or when an option was selected.
|
|
287
|
+
*/
|
|
288
|
+
private readonly canBeOpen;
|
|
289
|
+
private readonly selectionCounter;
|
|
290
|
+
private readonly typeaheadOptions;
|
|
291
|
+
private readonly typeaheadSearch;
|
|
292
|
+
private readonly processedSearch;
|
|
293
|
+
private readonly unprocessedSearch;
|
|
294
|
+
constructor();
|
|
235
295
|
ngOnChanges(changes: SimpleChanges): void;
|
|
236
296
|
protected onBlur(): void;
|
|
237
297
|
protected onInput(event: Event): void;
|
|
@@ -239,8 +299,29 @@ declare class SiTypeaheadDirective implements OnChanges, OnDestroy {
|
|
|
239
299
|
protected onKeydownSpace(event: Event): void;
|
|
240
300
|
ngOnDestroy(): void;
|
|
241
301
|
private loadComponent;
|
|
302
|
+
/**
|
|
303
|
+
* Extracts the display value from a typeahead option.
|
|
304
|
+
*
|
|
305
|
+
* For string options, returns the string value directly.
|
|
306
|
+
* For object options, returns the value of the field specified by {@link typeaheadOptionField}
|
|
307
|
+
* (defaults to 'name'), or an empty string if the field doesn't exist.
|
|
308
|
+
*
|
|
309
|
+
* @param option - The typeahead option to extract the value from
|
|
310
|
+
* @returns The string representation of the option for display purposes
|
|
311
|
+
*/
|
|
242
312
|
private getOptionValue;
|
|
243
|
-
|
|
313
|
+
/**
|
|
314
|
+
* Extracts a specific field value from a typeahead option.
|
|
315
|
+
*
|
|
316
|
+
* This method is used to access additional properties of object-type options,
|
|
317
|
+
* such as 'selected' for multi-select functionality or 'iconClass' for displaying icons.
|
|
318
|
+
*
|
|
319
|
+
* @param option - The typeahead option to extract the field from
|
|
320
|
+
* @param field - The name of the field to extract
|
|
321
|
+
* @returns The field value as a string if the option is an object and the field exists,
|
|
322
|
+
* otherwise undefined
|
|
323
|
+
*/
|
|
324
|
+
private getOptionField;
|
|
244
325
|
/** @internal */
|
|
245
326
|
selectMatch(match: TypeaheadMatch): void;
|
|
246
327
|
private removeComponent;
|