@siemens/element-ng 48.2.0 → 48.3.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.
- package/accordion/index.d.ts +5 -1
- package/application-header/index.d.ts +15 -2
- package/chat-messages/index.d.ts +654 -0
- package/chat-messages/package.json +3 -0
- package/dashboard/index.d.ts +1 -0
- package/fesm2022/siemens-element-ng-accordion.mjs +5 -1
- package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-application-header.mjs +62 -1
- package/fesm2022/siemens-element-ng-application-header.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-card.mjs +4 -4
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-chat-messages.mjs +863 -0
- package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-dashboard.mjs +8 -4
- package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-file-uploader.mjs +277 -118
- package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +3 -4
- package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-icon.mjs +3 -1
- package/fesm2022/siemens-element-ng-icon.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ip-input.mjs +92 -89
- package/fesm2022/siemens-element-ng-ip-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs +253 -0
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-phone-number.mjs +5 -4
- package/fesm2022/siemens-element-ng-phone-number.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-popover.mjs +3 -4
- package/fesm2022/siemens-element-ng-popover.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-resize-observer.mjs +13 -0
- package/fesm2022/siemens-element-ng-resize-observer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +41 -2
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/file-uploader/index.d.ts +119 -15
- package/icon/index.d.ts +3 -1
- package/ip-input/index.d.ts +13 -0
- package/markdown-renderer/index.d.ts +36 -0
- package/markdown-renderer/package.json +3 -0
- package/package.json +11 -3
- package/resize-observer/index.d.ts +13 -0
- package/schematics/migrations/action-modal-migration/action-modal-migration.js +2 -2
- package/schematics/migrations/data/attribute-selectors.js +6 -0
- package/schematics/migrations/data/component-names.js +78 -0
- package/schematics/migrations/data/element-selectors.js +10 -0
- package/schematics/migrations/data/index.js +17 -0
- package/schematics/migrations/data/output-names.js +8 -0
- package/schematics/migrations/data/symbol-removals.js +58 -0
- package/schematics/migrations/element-migration/element-migration.js +101 -0
- package/schematics/migrations/element-migration/index.js +5 -0
- package/schematics/migrations/index.js +7 -2
- package/schematics/migrations/wizard-migration/index.js +88 -0
- package/schematics/scss-import-to-siemens-migration/index.js +3 -3
- package/schematics/ts-import-to-siemens-migration/index.js +2 -2
- package/schematics/utils/index.js +3 -3
- package/schematics/utils/project-utils.js +24 -35
- package/schematics/utils/template-utils.js +78 -2
- package/schematics/utils/ts-utils.js +5 -5
- package/template-i18n.json +9 -0
- package/translate/index.d.ts +9 -0
- package/tree-view/index.d.ts +40 -1
- package/schematics/migrations/to-legacy-migration/to-legacy-migration.js +0 -55
- package/schematics/migrations/to-legacy-migration/to-legacy-replacement.js +0 -35
package/file-uploader/index.d.ts
CHANGED
|
@@ -20,6 +20,112 @@ interface UploadFile {
|
|
|
20
20
|
progress: number;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
interface FileUploadError extends UploadFile {
|
|
24
|
+
status: 'invalid';
|
|
25
|
+
errorText: TranslatableString;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Directive for handling file uploads with validation for file type and size.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```html
|
|
32
|
+
* <input
|
|
33
|
+
* #fileInput
|
|
34
|
+
* type="file"
|
|
35
|
+
* class="d-none"
|
|
36
|
+
* siFileUpload
|
|
37
|
+
* [accept]="accept()"
|
|
38
|
+
* [maxFileSize]="maxFileSize()"
|
|
39
|
+
* [multiple]="true"
|
|
40
|
+
* (validFiles)="onFilesAdded($event)"
|
|
41
|
+
* (fileError)="onFileError($event)"
|
|
42
|
+
* />
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare class SiFileUploadDirective {
|
|
46
|
+
/**
|
|
47
|
+
* Text or translation key of message title if incorrect file type is dragged / dropped.
|
|
48
|
+
*
|
|
49
|
+
* @defaultValue
|
|
50
|
+
* ```
|
|
51
|
+
* t(() => $localize`:@@SI_FILE_UPLOADER.ERROR_FILE_TYPE:Incorrect file type selected`)
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
readonly errorTextFileType: _angular_core.InputSignal<TranslatableString>;
|
|
55
|
+
/**
|
|
56
|
+
* Message or translation key if file exceeds the maximum file size limit.
|
|
57
|
+
*
|
|
58
|
+
* @defaultValue
|
|
59
|
+
* ```
|
|
60
|
+
* t(() => $localize`:@@SI_FILE_UPLOADER.ERROR_FILE_SIZE_EXCEEDED:File exceeds allowed maximum size`)
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
readonly errorTextFileMaxSize: _angular_core.InputSignal<TranslatableString>;
|
|
64
|
+
/**
|
|
65
|
+
* Define which file types are suggested in file browser.
|
|
66
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#attr-accept
|
|
67
|
+
*/
|
|
68
|
+
readonly accept: _angular_core.InputSignal<string | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* Define maximal allowed file size in bytes.
|
|
71
|
+
*/
|
|
72
|
+
readonly maxFileSize: _angular_core.InputSignal<number | undefined>;
|
|
73
|
+
/**
|
|
74
|
+
* Defines whether the file input allows selecting multiple files.
|
|
75
|
+
* When {@link directoryUpload} is enabled, this will have no effect.
|
|
76
|
+
*
|
|
77
|
+
* @defaultValue false
|
|
78
|
+
*/
|
|
79
|
+
readonly multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* Enable directory upload.
|
|
82
|
+
*
|
|
83
|
+
* @defaultValue false
|
|
84
|
+
*/
|
|
85
|
+
readonly directoryUpload: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
86
|
+
/**
|
|
87
|
+
* Event emitted when valid files are added.
|
|
88
|
+
* Invalid files (due to size or type) will be ignored and instead the {@link fileError} event will be emitted.
|
|
89
|
+
*/
|
|
90
|
+
readonly validFiles: _angular_core.OutputEmitterRef<UploadFile[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Event emitted when valid files are added.
|
|
93
|
+
* Also includes invalid files, but with status 'invalid' and an errorText describing why they were ignored.
|
|
94
|
+
*/
|
|
95
|
+
readonly filesAdded: _angular_core.OutputEmitterRef<UploadFile[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Event emitted when file validation errors occur, including files that were ignored due to size or type.
|
|
98
|
+
*/
|
|
99
|
+
readonly fileError: _angular_core.OutputEmitterRef<FileUploadError>;
|
|
100
|
+
private readonly elementRef;
|
|
101
|
+
private locale;
|
|
102
|
+
private numberFormat;
|
|
103
|
+
protected onInputChange(event: Event): void;
|
|
104
|
+
/**
|
|
105
|
+
* Handle files from input or drag and drop
|
|
106
|
+
*/
|
|
107
|
+
handleFiles(files: FileList | null): void;
|
|
108
|
+
/**
|
|
109
|
+
* Handle directory entries for drag and drop
|
|
110
|
+
*/
|
|
111
|
+
handleItems(items: DataTransferItemList): void;
|
|
112
|
+
/**
|
|
113
|
+
* Reset the file input value
|
|
114
|
+
*/
|
|
115
|
+
reset(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Trigger the file input click
|
|
118
|
+
*/
|
|
119
|
+
triggerClick(): void;
|
|
120
|
+
private makeUploadFile;
|
|
121
|
+
private verifyFileSize;
|
|
122
|
+
private verifyFileType;
|
|
123
|
+
fileSizeToString(num: number): string;
|
|
124
|
+
static formatFileSize(num: number, formatter?: Intl.NumberFormat): string;
|
|
125
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiFileUploadDirective, never>;
|
|
126
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiFileUploadDirective, "input[type=\"file\"][siFileUpload]", never, { "errorTextFileType": { "alias": "errorTextFileType"; "required": false; "isSignal": true; }; "errorTextFileMaxSize": { "alias": "errorTextFileMaxSize"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "directoryUpload": { "alias": "directoryUpload"; "required": false; "isSignal": true; }; }, { "validFiles": "validFiles"; "filesAdded": "filesAdded"; "fileError": "fileError"; }, never, never, true, never>;
|
|
127
|
+
}
|
|
128
|
+
|
|
23
129
|
declare class SiFileDropzoneComponent {
|
|
24
130
|
/**
|
|
25
131
|
* Text or translation key of the input file selector (is combined with the `uploadTextRest`).
|
|
@@ -92,9 +198,14 @@ declare class SiFileDropzoneComponent {
|
|
|
92
198
|
*/
|
|
93
199
|
readonly multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
94
200
|
/**
|
|
95
|
-
* Event emitted when files are added.
|
|
201
|
+
* Event emitted when valid files are added.
|
|
202
|
+
* Invalid files are also included here, but with status 'invalid' and an errorText describing why they were ignored.
|
|
96
203
|
*/
|
|
97
204
|
readonly filesAdded: _angular_core.OutputEmitterRef<UploadFile[]>;
|
|
205
|
+
/**
|
|
206
|
+
* Event emitted when file validation errors occur, including files that were ignored due to size or type.
|
|
207
|
+
*/
|
|
208
|
+
readonly fileError: _angular_core.OutputEmitterRef<FileUploadError>;
|
|
98
209
|
/**
|
|
99
210
|
* Enable directory upload.
|
|
100
211
|
*
|
|
@@ -104,25 +215,18 @@ declare class SiFileDropzoneComponent {
|
|
|
104
215
|
protected readonly maxFileSizeString: _angular_core.Signal<string>;
|
|
105
216
|
protected readonly icons: Record<"elementUpload", string>;
|
|
106
217
|
protected dragOver: boolean;
|
|
107
|
-
private readonly
|
|
108
|
-
private locale;
|
|
109
|
-
private numberFormat;
|
|
218
|
+
private readonly fileUploadDirective;
|
|
110
219
|
protected dropHandler(event: DragEvent): void;
|
|
111
220
|
protected dragOverHandler(event: DragEvent): void;
|
|
112
221
|
protected inputEnterHandler(): void;
|
|
113
|
-
protected
|
|
114
|
-
protected
|
|
222
|
+
protected onFilesAdded(files: UploadFile[]): void;
|
|
223
|
+
protected onFileError(error: FileUploadError): void;
|
|
115
224
|
/**
|
|
116
225
|
* Reset all the files inside the native file input (and therefore the dropzone).
|
|
117
226
|
*/
|
|
118
227
|
reset(): void;
|
|
119
|
-
private makeUploadFile;
|
|
120
|
-
private verifyFileSize;
|
|
121
|
-
private verifyFileType;
|
|
122
|
-
private fileSizeToString;
|
|
123
|
-
private handleItems;
|
|
124
228
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiFileDropzoneComponent, never>;
|
|
125
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiFileDropzoneComponent, "si-file-dropzone", never, { "uploadTextFileSelect": { "alias": "uploadTextFileSelect"; "required": false; "isSignal": true; }; "uploadDropText": { "alias": "uploadDropText"; "required": false; "isSignal": true; }; "maxFileSizeText": { "alias": "maxFileSizeText"; "required": false; "isSignal": true; }; "acceptText": { "alias": "acceptText"; "required": false; "isSignal": true; }; "errorTextFileType": { "alias": "errorTextFileType"; "required": false; "isSignal": true; }; "errorTextFileMaxSize": { "alias": "errorTextFileMaxSize"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "directoryUpload": { "alias": "directoryUpload"; "required": false; "isSignal": true; }; }, { "filesAdded": "filesAdded"; }, never, never, true, never>;
|
|
229
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiFileDropzoneComponent, "si-file-dropzone", never, { "uploadTextFileSelect": { "alias": "uploadTextFileSelect"; "required": false; "isSignal": true; }; "uploadDropText": { "alias": "uploadDropText"; "required": false; "isSignal": true; }; "maxFileSizeText": { "alias": "maxFileSizeText"; "required": false; "isSignal": true; }; "acceptText": { "alias": "acceptText"; "required": false; "isSignal": true; }; "errorTextFileType": { "alias": "errorTextFileType"; "required": false; "isSignal": true; }; "errorTextFileMaxSize": { "alias": "errorTextFileMaxSize"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "directoryUpload": { "alias": "directoryUpload"; "required": false; "isSignal": true; }; }, { "filesAdded": "filesAdded"; "fileError": "fileError"; }, never, never, true, never>;
|
|
126
230
|
}
|
|
127
231
|
|
|
128
232
|
/**
|
|
@@ -418,9 +522,9 @@ declare class SiFileUploaderComponent implements OnChanges {
|
|
|
418
522
|
|
|
419
523
|
declare class SiFileUploaderModule {
|
|
420
524
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiFileUploaderModule, never>;
|
|
421
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiFileUploaderModule, never, [typeof SiFileDropzoneComponent, typeof SiFileUploaderComponent], [typeof SiFileDropzoneComponent, typeof SiFileUploaderComponent]>;
|
|
525
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiFileUploaderModule, never, [typeof SiFileDropzoneComponent, typeof SiFileUploaderComponent, typeof SiFileUploadDirective], [typeof SiFileDropzoneComponent, typeof SiFileUploaderComponent, typeof SiFileUploadDirective]>;
|
|
422
526
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiFileUploaderModule>;
|
|
423
527
|
}
|
|
424
528
|
|
|
425
|
-
export { SiFileDropzoneComponent, SiFileUploaderComponent, SiFileUploaderModule };
|
|
426
|
-
export type { FileUploadConfig, FileUploadResult, UploadFile };
|
|
529
|
+
export { SiFileDropzoneComponent, SiFileUploadDirective, SiFileUploaderComponent, SiFileUploaderModule };
|
|
530
|
+
export type { FileUploadConfig, FileUploadError, FileUploadResult, UploadFile };
|
package/icon/index.d.ts
CHANGED
|
@@ -246,6 +246,8 @@ declare const elementAlarmFilled = "data:image/svg+xml;utf8,<svg xmlns='http://w
|
|
|
246
246
|
declare const elementAlarmTick = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M427.72 116.64 279.19 277.47l-73.9-73.9a12 12 0 0 0-17 17l82.73 82.73a12 12 0 0 0 8.48 3.51h.24a12 12 0 0 0 8.58-3.86l157-170a12 12 0 0 0-17.63-16.28Z'/></svg>";
|
|
247
247
|
declare const elementUser = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 252a76 76 0 1 0-76-76 76.08 76.08 0 0 0 76 76Zm0-128a52 52 0 1 1-52 52 52.06 52.06 0 0 1 52-52ZM124 360.14a12 12 0 0 0 6.71-2.06c.61-.41 61.54-41.08 126.14-41.08 75.3 0 122.86 39.84 123.3 40.23a12 12 0 0 0 15.68-18.18c-2.19-1.88-54.39-46.05-139-46.05C185 293 120 336.35 117.28 338.19a12 12 0 0 0 6.72 21.95Z'/></svg>";
|
|
248
248
|
declare const elementHelp = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 64C150.13 64 64 150.13 64 256s86.13 192 192 192 192-86.13 192-192S361.87 64 256 64Zm0 360c-92.64 0-168-75.36-168-168S163.36 88 256 88s168 75.36 168 168-75.36 168-168 168Z'/><path d='M256 305a12 12 0 0 1-12-12v-29.22a12 12 0 0 1 6.51-10.67 11.63 11.63 0 0 1 1.67-.71c1.14-.4 38.54-14.05 38.54-36.4a36 36 0 0 0-70-12 12 12 0 1 1-22.64-8 60 60 0 0 1 116.6 20c0 31-31.39 48.92-46.72 55.84V293A12 12 0 0 1 256 305ZM256.11 360h-.22a16 16 0 0 1 0-32h.22a16 16 0 0 1 0 32Z'/></svg>";
|
|
249
|
+
declare const elementPinch = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M248.46 275.15c0-.19-.05-.37-.07-.55s-.06-.41-.1-.61a6 6 0 0 0-.15-.61c0-.18-.08-.36-.13-.53s-.14-.39-.2-.58-.13-.36-.2-.53-.16-.35-.24-.53-.17-.36-.26-.53-.19-.33-.29-.49-.2-.35-.32-.52-.25-.35-.38-.52-.2-.29-.32-.43c-.24-.29-.5-.58-.77-.85-.28-.27-.56-.52-.86-.77-.14-.12-.29-.22-.44-.33l-.5-.37-.53-.32-.48-.28c-.18-.1-.37-.18-.55-.27l-.51-.23c-.18-.08-.37-.14-.55-.21l-.56-.19-.56-.15-.58-.14-.66-.1-.5-.07a11.85 11.85 0 0 0-1.19-.06h-120a12 12 0 0 0 0 24h91L108 387.84a12 12 0 1 0 17 17l99.51-99.51v91a12 12 0 0 0 24 0v-120a10.88 10.88 0 0 0-.05-1.18ZM405.1 106.75a12 12 0 0 0-17 0l-99.51 99.51v-91a12 12 0 0 0-24 0v120a10.88 10.88 0 0 0 .06 1.14c0 .18.05.36.08.54s.05.41.09.62.1.4.15.6.08.36.14.54.13.38.2.58.12.35.19.52.17.36.25.53.16.36.26.54.19.33.29.49.2.35.31.52l.38.51.32.43c.25.3.5.58.77.86.27.27.56.53.85.77l.44.33a6 6 0 0 0 .51.37 5.74 5.74 0 0 0 .53.32l.47.29.55.26c.17.08.34.17.52.24l.54.2c.19.07.37.14.57.2l.54.14.6.14.63.1c.17 0 .35.06.53.07a11.66 11.66 0 0 0 1.18.06h120a12 12 0 0 0 0-24h-91l99.51-99.51a12 12 0 0 0 .05-16.91Z'/></svg>";
|
|
250
|
+
declare const elementZoom = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M423.94 98.82c0-.19-.05-.37-.08-.55s-.05-.41-.09-.61-.1-.41-.15-.61a4.58 4.58 0 0 0-.14-.53c-.06-.2-.13-.39-.2-.58s-.12-.36-.19-.53-.16-.35-.25-.53-.16-.36-.26-.54-.19-.32-.29-.48-.2-.35-.31-.52-.25-.35-.38-.52l-.32-.43c-.24-.29-.5-.58-.77-.85s-.56-.53-.85-.77l-.44-.33c-.17-.12-.33-.25-.51-.37l-.53-.32-.47-.28c-.18-.1-.37-.18-.56-.27l-.51-.24-.55-.2-.55-.19c-.19-.06-.38-.1-.57-.15l-.57-.14-.67-.1-.49-.07q-.6-.06-1.2-.06H308a12 12 0 0 0 0 24h75l-100.82 100.8a12 12 0 0 0 17 17L400 129v75a12 12 0 0 0 24 0V100a10.88 10.88 0 0 0-.06-1.18ZM212.85 282.18 112 383v-75a12 12 0 0 0-24 0v104a10.88 10.88 0 0 0 .06 1.14c0 .19 0 .37.08.55s0 .41.09.61.1.41.15.61a4.58 4.58 0 0 0 .14.53c.06.2.13.39.2.58s.12.36.19.53.17.35.25.53.16.36.26.54.19.32.29.48.2.35.31.52.25.35.38.52l.32.43c.24.29.5.58.77.85s.56.53.85.77l.44.33c.17.12.33.25.51.37l.52.32.48.28c.18.1.37.18.55.27l.52.24.54.19c.19.07.37.14.57.2a5.36 5.36 0 0 0 .54.14c.2.05.39.11.6.15s.42.06.63.09l.53.08a11.51 11.51 0 0 0 1.23.15h104a12 12 0 0 0 0-24h-75l100.82-100.85a12 12 0 1 0-17-17Z'/></svg>";
|
|
249
251
|
|
|
250
|
-
export { STATUS_ICON_CONFIG, SiIconComponent, SiIconLegacyComponent, SiIconModule, SiStatusIconComponent, addIcons, element2dEditor, elementAlarmFilled, elementAlarmTick, elementBreadcrumbRoot, elementCalendar, elementCancel, elementChecked, elementCheckedFilled, elementCircleFilled, elementDelete, elementDocument, elementDoubleLeft, elementDoubleRight, elementDown2, elementExport, elementFavorites, elementFavoritesFilled, elementHelp, elementHide, elementLeft2, elementLeft3, elementLeft4, elementLock, elementMenu, elementMinus, elementNotChecked, elementOctagonFilled, elementOk, elementOptionsVertical, elementOutOfService, elementPlus, elementRadioChecked, elementRecordFilled, elementRedo, elementRight2, elementRight3, elementRight4, elementSearch, elementShow, elementSortDown, elementSortUp, elementSoundMute, elementSoundOn, elementSquare45Filled, elementSquareFilled, elementStateExclamationMark, elementStateInfo, elementStatePause, elementStateProgress, elementStateQuestionMark, elementStateTick, elementThumbnails, elementTriangleFilled, elementUpload, elementUser, elementWarningFilled, provideIconConfig };
|
|
252
|
+
export { STATUS_ICON_CONFIG, SiIconComponent, SiIconLegacyComponent, SiIconModule, SiStatusIconComponent, addIcons, element2dEditor, elementAlarmFilled, elementAlarmTick, elementBreadcrumbRoot, elementCalendar, elementCancel, elementChecked, elementCheckedFilled, elementCircleFilled, elementDelete, elementDocument, elementDoubleLeft, elementDoubleRight, elementDown2, elementExport, elementFavorites, elementFavoritesFilled, elementHelp, elementHide, elementLeft2, elementLeft3, elementLeft4, elementLock, elementMenu, elementMinus, elementNotChecked, elementOctagonFilled, elementOk, elementOptionsVertical, elementOutOfService, elementPinch, elementPlus, elementRadioChecked, elementRecordFilled, elementRedo, elementRight2, elementRight3, elementRight4, elementSearch, elementShow, elementSortDown, elementSortUp, elementSoundMute, elementSoundOn, elementSquare45Filled, elementSquareFilled, elementStateExclamationMark, elementStateInfo, elementStatePause, elementStateProgress, elementStateQuestionMark, elementStateTick, elementThumbnails, elementTriangleFilled, elementUpload, elementUser, elementWarningFilled, elementZoom, provideIconConfig };
|
|
251
253
|
export type { IconConfig };
|
package/ip-input/index.d.ts
CHANGED
|
@@ -45,7 +45,15 @@ declare abstract class SiIpInputDirective {
|
|
|
45
45
|
setDisabledState(isDisabled: boolean): void;
|
|
46
46
|
writeValue(value?: string | null): void;
|
|
47
47
|
protected onInput(e: Event): void;
|
|
48
|
+
/** @internal */
|
|
48
49
|
protected blur(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Allow to adjust the input value when leaving the input field.
|
|
52
|
+
*/
|
|
53
|
+
protected leaveInput(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Enforce a format on user input.
|
|
56
|
+
*/
|
|
49
57
|
protected abstract maskInput(e: AddrInputEvent): void;
|
|
50
58
|
static ɵfac: i0.ɵɵFactoryDeclaration<SiIpInputDirective, never>;
|
|
51
59
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SiIpInputDirective, "input[siIpInput]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "cidr": { "alias": "cidr"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -72,6 +80,11 @@ declare abstract class SiIpInputDirective {
|
|
|
72
80
|
*/
|
|
73
81
|
declare class SiIp4InputDirective extends SiIpInputDirective implements ControlValueAccessor, Validator {
|
|
74
82
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
83
|
+
/**
|
|
84
|
+
* Trim leading zeros from each part of the IPv4 address
|
|
85
|
+
*/
|
|
86
|
+
protected leaveInput(): void;
|
|
87
|
+
/** @internal */
|
|
75
88
|
protected maskInput(e: AddrInputEvent): void;
|
|
76
89
|
static ɵfac: i0.ɵɵFactoryDeclaration<SiIp4InputDirective, never>;
|
|
77
90
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SiIp4InputDirective, "input[siIpV4]", ["siIpV4"], {}, {}, never, never, true, never>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Component to display markdown text, uses the {@link getMarkdownRenderer} function internally, relies on `markdown-content` theme class.
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
declare class SiMarkdownRendererComponent {
|
|
9
|
+
private sanitizer;
|
|
10
|
+
private hostElement;
|
|
11
|
+
private markdownRenderer;
|
|
12
|
+
/**
|
|
13
|
+
* The markdown text to transform and display
|
|
14
|
+
* @defaultValue ''
|
|
15
|
+
*/
|
|
16
|
+
readonly text: i0.InputSignal<string>;
|
|
17
|
+
constructor();
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SiMarkdownRendererComponent, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SiMarkdownRendererComponent, "si-markdown-renderer", never, { "text": { "alias": "text"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns a markdown renderer function which_
|
|
24
|
+
* - Transforms markdown text into formatted HTML.
|
|
25
|
+
* - Returns a DOM node containing the formatted content.
|
|
26
|
+
*
|
|
27
|
+
* **Warning:** The returned Node is inserted without additional sanitization.
|
|
28
|
+
* Input content is sanitized before processing.
|
|
29
|
+
*
|
|
30
|
+
* @experimental
|
|
31
|
+
* @param sanitizer - Angular DomSanitizer instance
|
|
32
|
+
* @returns A function taking the markdown text to transform and returning a DOM div element containing the formatted HTML
|
|
33
|
+
*/
|
|
34
|
+
declare const getMarkdownRenderer: (sanitizer: DomSanitizer) => ((text: string) => Node);
|
|
35
|
+
|
|
36
|
+
export { SiMarkdownRendererComponent, getMarkdownRenderer };
|
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.
|
|
4
|
+
"version": "48.3.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.
|
|
34
|
-
"@siemens/element-theme": "48.
|
|
33
|
+
"@siemens/element-translate-ng": "48.3.0",
|
|
34
|
+
"@siemens/element-theme": "48.3.0",
|
|
35
35
|
"@siemens/ngx-datatable": "22 - 24",
|
|
36
36
|
"flag-icons": "^7.3.2",
|
|
37
37
|
"google-libphonenumber": "^3.2.40",
|
|
@@ -111,6 +111,10 @@
|
|
|
111
111
|
"types": "./card/index.d.ts",
|
|
112
112
|
"default": "./fesm2022/siemens-element-ng-card.mjs"
|
|
113
113
|
},
|
|
114
|
+
"./chat-messages": {
|
|
115
|
+
"types": "./chat-messages/index.d.ts",
|
|
116
|
+
"default": "./fesm2022/siemens-element-ng-chat-messages.mjs"
|
|
117
|
+
},
|
|
114
118
|
"./circle-status": {
|
|
115
119
|
"types": "./circle-status/index.d.ts",
|
|
116
120
|
"default": "./fesm2022/siemens-element-ng-circle-status.mjs"
|
|
@@ -243,6 +247,10 @@
|
|
|
243
247
|
"types": "./main-detail-container/index.d.ts",
|
|
244
248
|
"default": "./fesm2022/siemens-element-ng-main-detail-container.mjs"
|
|
245
249
|
},
|
|
250
|
+
"./markdown-renderer": {
|
|
251
|
+
"types": "./markdown-renderer/index.d.ts",
|
|
252
|
+
"default": "./fesm2022/siemens-element-ng-markdown-renderer.mjs"
|
|
253
|
+
},
|
|
246
254
|
"./menu": {
|
|
247
255
|
"types": "./menu/index.d.ts",
|
|
248
256
|
"default": "./fesm2022/siemens-element-ng-menu.mjs"
|
|
@@ -36,6 +36,19 @@ declare class ResizeObserverService {
|
|
|
36
36
|
private processQueue;
|
|
37
37
|
/**
|
|
38
38
|
* check size on all observed elements. Only use in testing!
|
|
39
|
+
* @deprecated Will be removed in major version 50! For testing purposes use the resize observer mock:
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* beforeEach(() => mockResizeObserver());
|
|
43
|
+
* afterEach(() => restoreResizeObserver());
|
|
44
|
+
* it('should trigger resize', () => {
|
|
45
|
+
* // For all observed elements
|
|
46
|
+
* MockResizeObserver.triggerResize({});
|
|
47
|
+
* // For specific HTML element
|
|
48
|
+
* MockResizeObserver.triggerResize({ target: myElement });
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
|
|
39
52
|
*/
|
|
40
53
|
_checkAll(): void;
|
|
41
54
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ResizeObserverService, never>;
|
|
@@ -12,9 +12,9 @@ import { ACTION_DIALOG_TYPES_REPLACEMENTS, ACTION_MODAL_SYMBOLS, DIALOG_METHOD_C
|
|
|
12
12
|
* @returns A schematic rule for migrating action modal methods.
|
|
13
13
|
*/
|
|
14
14
|
export const actionModalMigrationRule = (options) => {
|
|
15
|
-
return (tree, context) => {
|
|
15
|
+
return async (tree, context) => {
|
|
16
16
|
context.logger.info('🔄 Migrating action modal methods to v48...');
|
|
17
|
-
const tsSourceFiles = discoverSourceFiles(tree, context, options.path);
|
|
17
|
+
const tsSourceFiles = await discoverSourceFiles(tree, context, options.path);
|
|
18
18
|
for (const filePath of tsSourceFiles) {
|
|
19
19
|
const content = tree.read(filePath);
|
|
20
20
|
if (!content) {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const COMPONENT_NAMES_MIGRATION = [
|
|
2
|
+
// Icon current to legacy
|
|
3
|
+
{
|
|
4
|
+
module: /@(siemens|simpl)\/element-ng(\/icon)?/,
|
|
5
|
+
symbolRenamings: [
|
|
6
|
+
{
|
|
7
|
+
replace: 'SiIconComponent',
|
|
8
|
+
replaceWith: 'SiIconLegacyComponent'
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
// Icon next to current
|
|
13
|
+
{
|
|
14
|
+
module: /@(siemens|simpl)\/element-ng(\/icon-next)?/,
|
|
15
|
+
symbolRenamings: [
|
|
16
|
+
{
|
|
17
|
+
replace: 'SiIconNextComponent',
|
|
18
|
+
replaceWith: 'SiIconComponent'
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
// Tabs current to legacy
|
|
23
|
+
{
|
|
24
|
+
module: /@(siemens|simpl)\/element-ng(\/tabs)?/,
|
|
25
|
+
symbolRenamings: [
|
|
26
|
+
{
|
|
27
|
+
replace: 'SiTabComponent',
|
|
28
|
+
replaceWith: 'SiTabLegacyComponent'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
replace: 'SiTabsetComponent',
|
|
32
|
+
replaceWith: 'SiTabsetLegacyComponent'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
replace: 'SiTabsModule',
|
|
36
|
+
replaceWith: 'SiTabsLegacyModule'
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
toModule: '@siemens/element-ng/tabs-legacy'
|
|
40
|
+
},
|
|
41
|
+
// Tabs next to current
|
|
42
|
+
{
|
|
43
|
+
module: /@(siemens|simpl)\/element-ng(\/tabs-next)?/,
|
|
44
|
+
symbolRenamings: [
|
|
45
|
+
{
|
|
46
|
+
replace: 'SiTabNextComponent',
|
|
47
|
+
replaceWith: 'SiTabComponent'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
replace: 'SiTabsetNextComponent',
|
|
51
|
+
replaceWith: 'SiTabsetComponent'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
replace: 'SiTabsNextModule',
|
|
55
|
+
replaceWith: 'SiTabsModule'
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
toModule: '@siemens/element-ng/tabs'
|
|
59
|
+
},
|
|
60
|
+
// Popover current to legacy
|
|
61
|
+
{
|
|
62
|
+
module: /@(siemens|simpl)\/element-ng(\/popover)?/,
|
|
63
|
+
symbolRenamings: [
|
|
64
|
+
{ replace: 'SiPopoverDirective', replaceWith: 'SiPopoverLegacyDirective' },
|
|
65
|
+
{ replace: 'SiPopoverModule', replaceWith: 'SiPopoverLegacyModule' }
|
|
66
|
+
],
|
|
67
|
+
toModule: '@siemens/element-ng/popover-legacy'
|
|
68
|
+
},
|
|
69
|
+
// Popover next to current
|
|
70
|
+
{
|
|
71
|
+
module: /@(siemens|simpl)\/element-ng(\/popover-next)?/,
|
|
72
|
+
symbolRenamings: [
|
|
73
|
+
{ replace: 'SiPopoverNextDirective', replaceWith: 'SiPopoverDirective' },
|
|
74
|
+
{ replace: 'SiPopoverNextModule', replaceWith: 'SiPopoverModule' }
|
|
75
|
+
],
|
|
76
|
+
toModule: '@siemens/element-ng/popover'
|
|
77
|
+
}
|
|
78
|
+
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const ELEMENT_SELECTORS_MIGRATION = [
|
|
2
|
+
// current to legacy
|
|
3
|
+
{ replace: 'si-icon', replaceWith: 'si-icon-legacy' },
|
|
4
|
+
{ replace: 'si-tabset', replaceWith: 'si-tabset-legacy' },
|
|
5
|
+
{ replace: 'si-tab', replaceWith: 'si-tab-legacy' },
|
|
6
|
+
// next to current
|
|
7
|
+
{ replace: 'si-icon-next', replaceWith: 'si-icon' },
|
|
8
|
+
{ replace: 'si-tabset-next', replaceWith: 'si-tabset' },
|
|
9
|
+
{ replace: 'si-tab-next', replaceWith: 'si-tab' }
|
|
10
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { ATTRIBUTE_SELECTORS_MIGRATION } from './attribute-selectors.js';
|
|
6
|
+
import { COMPONENT_NAMES_MIGRATION } from './component-names.js';
|
|
7
|
+
import { ELEMENT_SELECTORS_MIGRATION } from './element-selectors.js';
|
|
8
|
+
import { OUTPUT_NAMES_MIGRATION } from './output-names.js';
|
|
9
|
+
import { SYMBOL_REMOVALS_MIGRATION } from './symbol-removals.js';
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
11
|
+
export const getElementMigrationData = () => ({
|
|
12
|
+
attributeSelectorChanges: ATTRIBUTE_SELECTORS_MIGRATION,
|
|
13
|
+
componentNameChanges: COMPONENT_NAMES_MIGRATION,
|
|
14
|
+
elementSelectorChanges: ELEMENT_SELECTORS_MIGRATION,
|
|
15
|
+
symbolRemovalChanges: SYMBOL_REMOVALS_MIGRATION,
|
|
16
|
+
outputNameChanges: OUTPUT_NAMES_MIGRATION
|
|
17
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const OUTPUT_NAMES_MIGRATION = [
|
|
2
|
+
{
|
|
3
|
+
module: /@(siemens|simpl)\/element-ng(\/accordion)?/,
|
|
4
|
+
elementSelector: 'si-collapsible-panel',
|
|
5
|
+
componentOrModuleName: ['SiCollapsiblePanelComponent', 'SiAccordionModule'],
|
|
6
|
+
apiMappings: [{ replace: '(toggle)', replaceWith: '(panelToggle)' }]
|
|
7
|
+
}
|
|
8
|
+
];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export const SYMBOL_REMOVALS_MIGRATION = [
|
|
2
|
+
{
|
|
3
|
+
module: /@(siemens|simpl)\/element-ng(\/accordion)?/,
|
|
4
|
+
elementSelector: 'si-accordion',
|
|
5
|
+
componentOrModuleName: ['SiAccordionComponent', 'SiAccordionModule'],
|
|
6
|
+
names: ['colorVariant']
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
module: /@(siemens|simpl)\/element-ng(\/datepicker)?/,
|
|
10
|
+
elementSelector: 'input',
|
|
11
|
+
attributeSelector: 'siDateInput',
|
|
12
|
+
componentOrModuleName: ['SiDateInputDirective', 'SiDatepickerModule'],
|
|
13
|
+
names: ['dateInputDebounceTime']
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
module: /@(siemens|simpl)\/element-ng(\/datepicker)?/,
|
|
17
|
+
elementSelector: 'input',
|
|
18
|
+
attributeSelector: 'siDatepicker',
|
|
19
|
+
componentOrModuleName: ['SiDateInputDirective', 'SiDatepickerModule'],
|
|
20
|
+
names: ['triggeringInput']
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
module: /@(siemens|simpl)\/element-ng(\/datepicker)?/,
|
|
24
|
+
elementSelector: 'si-date-range',
|
|
25
|
+
componentOrModuleName: ['SiDateRangeComponent', 'SiDatepickerModule'],
|
|
26
|
+
names: ['debounceTime']
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
module: /@(siemens|simpl)\/element-ng(\/filtered-search)?/,
|
|
30
|
+
elementSelector: 'si-filtered-search',
|
|
31
|
+
componentOrModuleName: ['SiFilteredSearchComponent', 'SiFilteredSearchModule'],
|
|
32
|
+
names: ['showIcon', 'noMatchingCriteriaText']
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
module: /@(siemens|simpl)\/element-ng(\/form)?/,
|
|
36
|
+
elementSelector: 'si-form-item',
|
|
37
|
+
componentOrModuleName: ['SiFormItemComponent', 'SiFormModule'],
|
|
38
|
+
names: ['inputId', 'readonly']
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
module: /@(siemens|simpl)\/element-ng(\/navbar-vertical)?/,
|
|
42
|
+
elementSelector: 'si-navbar-vertical',
|
|
43
|
+
componentOrModuleName: ['SiNavbarVerticalComponent', 'SiNavbarVerticalModule'],
|
|
44
|
+
names: ['autoCollapseDelay']
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
module: /@(siemens|simpl)\/element-ng(\/split)?/,
|
|
48
|
+
elementSelector: 'si-split-part',
|
|
49
|
+
componentOrModuleName: ['SiSplitPartComponent', 'SiSplitModule'],
|
|
50
|
+
names: ['headerStatusColor', 'headerStatusIconClass']
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
module: /@(siemens|simpl)\/element-ng(\/navbar-vertical)?/,
|
|
54
|
+
elementSelector: 'si-tree-view',
|
|
55
|
+
componentOrModuleName: ['SiTreeViewComponent', 'SiTreeViewModule'],
|
|
56
|
+
names: ['disableFilledIcons', 'trackByFunction']
|
|
57
|
+
}
|
|
58
|
+
];
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import * as ts from 'typescript';
|
|
6
|
+
import { EmitHint } from 'typescript';
|
|
7
|
+
import { discoverSourceFiles, getImportSpecifiers, renameApi, renameAttribute, renameElementTag, renameIdentifier, removeSymbol } from '../../utils/index.js';
|
|
8
|
+
import { getElementMigrationData } from '../data/index.js';
|
|
9
|
+
export const elementMigrationRule = (options) => {
|
|
10
|
+
return async (tree, context) => {
|
|
11
|
+
const tsSourceFiles = await discoverSourceFiles(tree, context, options.path);
|
|
12
|
+
const migrationData = getElementMigrationData();
|
|
13
|
+
for (const filePath of tsSourceFiles) {
|
|
14
|
+
const content = tree.read(filePath);
|
|
15
|
+
if (!content) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const sourceFile = ts.createSourceFile(filePath, content.toString(), ts.ScriptTarget.Latest, true);
|
|
19
|
+
let recorder = undefined;
|
|
20
|
+
let printer = undefined;
|
|
21
|
+
// Remove the ifs when it grows a bit more and split into multiple functions
|
|
22
|
+
if (migrationData.componentNameChanges) {
|
|
23
|
+
const changeInstructions = renameIdentifier({
|
|
24
|
+
sourceFile,
|
|
25
|
+
renamingInstructions: migrationData.componentNameChanges
|
|
26
|
+
});
|
|
27
|
+
for (const changeInstruction of changeInstructions) {
|
|
28
|
+
recorder ??= tree.beginUpdate(filePath);
|
|
29
|
+
printer ??= ts.createPrinter();
|
|
30
|
+
recorder.remove(changeInstruction.start, changeInstruction.width);
|
|
31
|
+
recorder.insertLeft(changeInstruction.start, printer.printNode(EmitHint.Unspecified, changeInstruction.newNode, sourceFile));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (migrationData.attributeSelectorChanges) {
|
|
35
|
+
recorder ??= tree.beginUpdate(filePath);
|
|
36
|
+
for (const change of migrationData.attributeSelectorChanges) {
|
|
37
|
+
renameAttribute({
|
|
38
|
+
tree,
|
|
39
|
+
recorder,
|
|
40
|
+
sourceFile,
|
|
41
|
+
filePath,
|
|
42
|
+
fromName: change.replace,
|
|
43
|
+
toName: change.replaceWith
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (migrationData.elementSelectorChanges) {
|
|
48
|
+
recorder ??= tree.beginUpdate(filePath);
|
|
49
|
+
for (const change of migrationData.elementSelectorChanges) {
|
|
50
|
+
renameElementTag({
|
|
51
|
+
tree,
|
|
52
|
+
recorder,
|
|
53
|
+
sourceFile,
|
|
54
|
+
filePath,
|
|
55
|
+
fromName: change.replace,
|
|
56
|
+
toName: change.replaceWith
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (migrationData.outputNameChanges) {
|
|
61
|
+
recorder ??= tree.beginUpdate(filePath);
|
|
62
|
+
for (const change of migrationData.outputNameChanges) {
|
|
63
|
+
const importSpecifiers = getImportSpecifiers(sourceFile, change.module, change.componentOrModuleName);
|
|
64
|
+
if (!importSpecifiers?.length) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
renameApi({
|
|
68
|
+
tree,
|
|
69
|
+
recorder,
|
|
70
|
+
sourceFile,
|
|
71
|
+
filePath,
|
|
72
|
+
elementName: change.elementSelector,
|
|
73
|
+
apis: change.apiMappings
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (migrationData.symbolRemovalChanges) {
|
|
78
|
+
recorder ??= tree.beginUpdate(filePath);
|
|
79
|
+
for (const change of migrationData.symbolRemovalChanges) {
|
|
80
|
+
const importSpecifiers = getImportSpecifiers(sourceFile, change.module, change.componentOrModuleName);
|
|
81
|
+
if (!importSpecifiers?.length) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
removeSymbol({
|
|
85
|
+
tree,
|
|
86
|
+
recorder,
|
|
87
|
+
sourceFile,
|
|
88
|
+
filePath,
|
|
89
|
+
elementName: change.elementSelector,
|
|
90
|
+
attributeSelector: change.attributeSelector,
|
|
91
|
+
names: change.names
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (recorder) {
|
|
96
|
+
tree.commitUpdate(recorder);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return tree;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { chain } from '@angular-devkit/schematics';
|
|
6
6
|
import { actionModalMigrationRule } from './action-modal-migration/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { elementMigrationRule } from './element-migration/index.js';
|
|
8
|
+
import { wizardMigrationRule } from './wizard-migration/index.js';
|
|
8
9
|
export const v47to48Migration = (options) => {
|
|
9
10
|
return (tree, context) => {
|
|
10
11
|
context.logger.info('🚀 Starting migration from v47 to v48...');
|
|
11
|
-
return chain([
|
|
12
|
+
return chain([
|
|
13
|
+
actionModalMigrationRule(options),
|
|
14
|
+
elementMigrationRule(options),
|
|
15
|
+
wizardMigrationRule(options)
|
|
16
|
+
])(tree, context);
|
|
12
17
|
};
|
|
13
18
|
};
|