@ihk-gfi/lux-components-update 18.5.2 → 19.0.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 (90) hide show
  1. package/README.md +3 -3
  2. package/collection.json +22 -57
  3. package/package.json +15 -34
  4. package/src/update-dependencies/index.js +89 -0
  5. package/{update-en-messages → src/update-en-messages}/index.js +4 -4
  6. package/src/update-standalone-imports/index.js +677 -0
  7. package/src/update-standalone-imports/schema.json +20 -0
  8. package/src/updates/19.0.0/index.js +345 -0
  9. package/{utility → src/utility}/dependencies.js +5 -7
  10. package/{utility → src/utility}/files.js +9 -1
  11. package/{utility → src/utility}/html/hit.js +5 -0
  12. package/{utility → src/utility}/html/html-manipulator.js +6 -4
  13. package/{utility → src/utility}/json.js +21 -4
  14. package/{utility → src/utility}/replace-item.js +17 -2
  15. package/{utility → src/utility}/typescript.js +125 -46
  16. package/{utility → src/utility}/util.js +0 -22
  17. package/{utility → src/utility}/validation.js +1 -2
  18. package/add-lux-components/files/app/app-routing.module.ts +0 -21
  19. package/add-lux-components/files/app/app.component.html +0 -34
  20. package/add-lux-components/files/app/app.component.scss +0 -4
  21. package/add-lux-components/files/app/app.component.spec.ts +0 -21
  22. package/add-lux-components/files/app/app.component.ts +0 -24
  23. package/add-lux-components/files/app/app.module.ts +0 -63
  24. package/add-lux-components/files/app/base/license-hint/license-hint.component.html +0 -11
  25. package/add-lux-components/files/app/base/license-hint/license-hint.component.ts +0 -24
  26. package/add-lux-components/files/app/error/error.component.html +0 -10
  27. package/add-lux-components/files/app/error/error.component.scss +0 -3
  28. package/add-lux-components/files/app/error/error.component.spec.ts +0 -51
  29. package/add-lux-components/files/app/error/error.component.ts +0 -17
  30. package/add-lux-components/files/app/home/home.component.html +0 -10
  31. package/add-lux-components/files/app/home/home.component.scss +0 -3
  32. package/add-lux-components/files/app/home/home.component.ts +0 -13
  33. package/add-lux-components/files/app/profil/profil.component.html +0 -1
  34. package/add-lux-components/files/app/profil/profil.component.scss +0 -0
  35. package/add-lux-components/files/app/profil/profil.component.spec.ts +0 -24
  36. package/add-lux-components/files/app/profil/profil.component.ts +0 -11
  37. package/add-lux-components/files/assets/svg/Example.svg +0 -6
  38. package/add-lux-components/files/assets/svg/android.svg +0 -2
  39. package/add-lux-components/files/assets/svg/box.svg +0 -690
  40. package/add-lux-components/files/assets/svg/demoAppLogo.svg +0 -1
  41. package/add-lux-components/files/assets/svg/red_power_button.svg +0 -67
  42. package/add-lux-components/files/assets/svg/svg2009.svg +0 -57457
  43. package/add-lux-components/files/environments/environment.prod.ts +0 -4
  44. package/add-lux-components/files/environments/environment.ts +0 -17
  45. package/add-lux-components/files/locale/messages.en.xlf +0 -1373
  46. package/add-lux-components/files/locale/messages.xlf +0 -1220
  47. package/add-lux-components/files/root/move-de-files.js +0 -15
  48. package/add-lux-components/files/src/index.html +0 -29
  49. package/add-lux-components/files/src/main.ts +0 -12
  50. package/add-lux-components/index.d.ts +0 -10
  51. package/add-lux-components/index.js +0 -232
  52. package/add-lux-components/schema.json +0 -23
  53. package/update-dependencies/index.d.ts +0 -6
  54. package/update-dependencies/index.js +0 -89
  55. package/update-en-messages/index.d.ts +0 -2
  56. package/updates/18.0.0/index.d.ts +0 -13
  57. package/updates/18.0.0/index.js +0 -125
  58. package/updates/18.1.0/index.d.ts +0 -2
  59. package/updates/18.1.0/index.js +0 -19
  60. package/updates/18.1.0/schema.json +0 -23
  61. package/updates/18.2.0/index.d.ts +0 -5
  62. package/updates/18.2.0/index.js +0 -44
  63. package/updates/18.2.0/schema.json +0 -23
  64. package/updates/18.3.0/index.d.ts +0 -5
  65. package/updates/18.3.0/index.js +0 -59
  66. package/updates/18.3.0/schema.json +0 -23
  67. package/updates/18.4.0/index.d.ts +0 -7
  68. package/updates/18.4.0/index.js +0 -76
  69. package/updates/18.4.0/schema.json +0 -23
  70. package/updates/18.5.0/index.d.ts +0 -5
  71. package/updates/18.5.0/index.js +0 -53
  72. package/updates/18.5.0/schema.json +0 -23
  73. package/utility/dependencies.d.ts +0 -45
  74. package/utility/files.d.ts +0 -66
  75. package/utility/html/hit.d.ts +0 -21
  76. package/utility/html/html-manipulator.d.ts +0 -71
  77. package/utility/html/manipulator-functions.d.ts +0 -99
  78. package/utility/json.d.ts +0 -82
  79. package/utility/logging.d.ts +0 -32
  80. package/utility/replace-item.d.ts +0 -18
  81. package/utility/test.d.ts +0 -10
  82. package/utility/typescript.d.ts +0 -22
  83. package/utility/util.d.ts +0 -37
  84. package/utility/validation.d.ts +0 -10
  85. /package/{update-dependencies → src/update-dependencies}/schema.json +0 -0
  86. /package/{update-en-messages → src/update-en-messages}/schema.json +0 -0
  87. /package/{updates/18.0.0 → src/updates/19.0.0}/schema.json +0 -0
  88. /package/{utility → src/utility}/html/manipulator-functions.js +0 -0
  89. /package/{utility → src/utility}/logging.js +0 -0
  90. /package/{utility → src/utility}/test.js +0 -0
@@ -0,0 +1,345 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateNodeMinVersion = exports.updateMinVersion = exports.updateMajorVersion = void 0;
4
+ exports.update190000 = update190000;
5
+ exports.updateProject = updateProject;
6
+ exports.copyFiles = copyFiles;
7
+ exports.updatePackageJson = updatePackageJson;
8
+ exports.updateAngularJson = updateAngularJson;
9
+ exports.updateKarmaConfJs = updateKarmaConfJs;
10
+ exports.updateTsConfigAppJson = updateTsConfigAppJson;
11
+ exports.updateTsConfigSpecJson = updateTsConfigSpecJson;
12
+ exports.updateMainTs = updateMainTs;
13
+ exports.updateTestTs = updateTestTs;
14
+ const schematics_1 = require("@angular-devkit/schematics");
15
+ const chalk = require("chalk");
16
+ const index_1 = require("../../update-dependencies/index");
17
+ const files_1 = require("../../utility/files");
18
+ const json_1 = require("../../utility/json");
19
+ const logging_1 = require("../../utility/logging");
20
+ const replace_item_1 = require("../../utility/replace-item");
21
+ const util_1 = require("../../utility/util");
22
+ const validation_1 = require("../../utility/validation");
23
+ exports.updateMajorVersion = '19';
24
+ exports.updateMinVersion = '18.5.0';
25
+ exports.updateNodeMinVersion = '22.0.0';
26
+ function update190000(options) {
27
+ return (_tree, _context) => {
28
+ return (0, schematics_1.chain)([
29
+ check(options),
30
+ (0, util_1.applyRuleIf)(exports.updateMinVersion, updateProject(options)),
31
+ (0, util_1.finish)(false, ``, `${chalk.yellowBright('Nur für JAST-Apps')}`, `${chalk.yellowBright('----------------------------------------------------------------------')}`, `${chalk.yellowBright('1. Bitte die Node-Version 22 verwenden.')}`, `${chalk.yellowBright('2. Bitte die pipeline.yaml anpassen:')}`, `${chalk.yellowBright(' a. Den Parameter --no-optional entfernen.')}`, `${chalk.yellowBright(' b. Das Image von "node:18-alpine" auf "node:22-alpine" ändern.')}`, ``, `${chalk.greenBright('Fertig!')}`)
32
+ ]);
33
+ };
34
+ }
35
+ function updateProject(options) {
36
+ return (_tree, _context) => {
37
+ return (0, schematics_1.chain)([
38
+ (0, util_1.messageInfoRule)(`LUX-Components ${exports.updateMajorVersion} werden aktualisiert...`),
39
+ (0, index_1.updateDependencies)(),
40
+ copyFiles(options),
41
+ updatePackageJson(options),
42
+ updateAngularJson(options),
43
+ updateTsConfigAppJson(options),
44
+ updateTsConfigSpecJson(options),
45
+ updateKarmaConfJs(options),
46
+ updateMainTs(options),
47
+ updateTestTs(options),
48
+ (0, files_1.deleteFile)(options.path ?? '', '.eslintrc.json'),
49
+ updateMessages(options),
50
+ (0, util_1.messageSuccessRule)(`LUX-Components ${exports.updateMajorVersion} wurden aktualisiert.`)
51
+ ]);
52
+ };
53
+ }
54
+ function check(_options) {
55
+ return (tree, _context) => {
56
+ (0, logging_1.logInfoWithDescriptor)(`Vorbedingungen werden geprüft...`);
57
+ (0, validation_1.validateNodeVersion)(_context, exports.updateNodeMinVersion);
58
+ (0, validation_1.validateLuxComponentsVersion)(tree, `${exports.updateMinVersion} || ^${exports.updateMajorVersion}.0.0`);
59
+ (0, logging_1.logSuccess)(`Vorbedingungen wurden geprüft.`);
60
+ return tree;
61
+ };
62
+ }
63
+ function copyFiles(options) {
64
+ return (0, schematics_1.chain)([
65
+ (0, util_1.messageInfoRule)(`Dateien werden kopiert...`),
66
+ (0, files_1.moveFilesToDirectory)(options, 'files/root', '/'),
67
+ (0, util_1.messageSuccessRule)(`Dateien wurden kopiert.`)
68
+ ]);
69
+ }
70
+ function updatePackageJson(options) {
71
+ return (_tree, _context) => {
72
+ const filePath = (options.path ?? '') + '/package.json';
73
+ const startScriptJsonPath = ['scripts', 'start'];
74
+ const startScriptJsonValue = 'ng serve --no-hmr';
75
+ const buildAotScriptJsonPath = ['scripts', 'build-aot'];
76
+ const buildAotScriptJsonValue = 'node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --aot --output-hashing none && npm run move-de-files';
77
+ const buildZentralScriptJsonPath = ['scripts', 'buildzentral'];
78
+ const buildZentralScriptJsonValue = 'node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --configuration production --output-hashing none && npm run move-de-files';
79
+ const startEnScriptJsonPath = ['scripts', 'start-en'];
80
+ const startEnScriptJsonValue = 'ng serve --configuration en --no-hmr';
81
+ return (0, schematics_1.chain)([
82
+ (0, util_1.messageInfoRule)(`package.json wird angepasst...`),
83
+ (0, json_1.updateJsonValue)(filePath, startScriptJsonPath, startScriptJsonValue, true),
84
+ (0, json_1.updateJsonValue)(filePath, buildAotScriptJsonPath, buildAotScriptJsonValue, true),
85
+ (0, json_1.updateJsonValue)(filePath, buildZentralScriptJsonPath, buildZentralScriptJsonValue, true),
86
+ (0, json_1.updateJsonValue)(filePath, startEnScriptJsonPath, startEnScriptJsonValue, true),
87
+ (0, json_1.deleteJsonValue)(filePath, ['scripts', 'test_no_sm']),
88
+ (0, files_1.replaceRule)(options, `lint --fix wird angepasst...`, `lint --fix wurde angepasst.`, filePath, new replace_item_1.ReplaceItem('lint --fix', 'lint', true)),
89
+ (0, util_1.messageSuccessRule)(`package.json wurde angepasst.`)
90
+ ]);
91
+ };
92
+ }
93
+ function updateAngularJson(options) {
94
+ return (_tree, _context) => {
95
+ const filePath = (options.path ?? '') + '/angular.json';
96
+ const localizePath = ['projects', options.project, 'architect', 'build', 'options', 'localize'];
97
+ const localizeValue = true;
98
+ const polyfillsI18nPath = ['projects', options.project, 'architect', 'build', 'options', 'polyfills'];
99
+ const polyfillsI18nTestPath = ['projects', options.project, 'architect', 'test', 'options', 'polyfills'];
100
+ const polyfillsI18nValue = '@angular/localize/init';
101
+ const assetsPath = ['projects', options.project, 'architect', 'build', 'options', 'assets'];
102
+ const assetsTestPath = ['projects', options.project, 'architect', 'test', 'options', 'assets'];
103
+ const assetsFindBuildFn = (node) => (0, json_1.findObjectContainsInArray)(node, 'input', 'pdfjs-dist/build');
104
+ const assetsFindCmapsFn = (node) => (0, json_1.findObjectContainsInArray)(node, 'input', 'pdfjs-dist/cmaps');
105
+ const allowedPath = ['projects', options.project, 'architect', 'build', 'options', 'allowedCommonJsDependencies'];
106
+ const allowedPdfViewerFn = (node) => (0, json_1.findStringInArray)(node, 'ng2-pdf-viewer');
107
+ const allowedPdfDistFn = (node) => (0, json_1.findStringInArray)(node, 'pdfjs-dist');
108
+ const enPath = ['projects', options.project, 'architect', 'build', 'configurations', 'en', 'localize'];
109
+ const lintPatternPath = ['projects', options.project, 'architect', 'lint', 'options', 'lintFilePatterns'];
110
+ const lintPatternValue = ['src/app/**/*.ts', 'src/app/**/*.html'];
111
+ const lintConfigPath = ['projects', options.project, 'architect', 'lint', 'options', 'eslintConfig'];
112
+ const lintConfigValue = 'eslint.config.js';
113
+ const cliPath = ['cli', 'schematicCollections'];
114
+ const cliFn = (node) => (0, json_1.findStringInArray)(node, '@angular-eslint/schematics');
115
+ return (0, schematics_1.chain)([
116
+ (0, util_1.messageInfoRule)(`angular.json wird angepasst...`),
117
+ (0, files_1.replaceRule)(options, 'Attribut "browserTarget" wird umbenannt in "buildTarget"...', 'Attribut "luxOptionMultiline" wurde entfernt.', (options.path ?? '') + 'angular.json', new replace_item_1.ReplaceItem('browserTarget', 'buildTarget', true)),
118
+ (0, json_1.updateJsonValue)(filePath, localizePath, localizeValue),
119
+ (0, json_1.updateJsonArray)(filePath, polyfillsI18nPath, polyfillsI18nValue),
120
+ (0, json_1.updateJsonArray)(filePath, polyfillsI18nTestPath, polyfillsI18nValue),
121
+ (0, json_1.deleteJsonArray)(filePath, assetsPath, assetsFindBuildFn),
122
+ (0, json_1.deleteJsonArray)(filePath, assetsPath, assetsFindCmapsFn),
123
+ (0, json_1.deleteJsonArray)(filePath, assetsTestPath, assetsFindBuildFn),
124
+ (0, json_1.deleteJsonArray)(filePath, assetsTestPath, assetsFindCmapsFn),
125
+ (0, json_1.deleteJsonArray)(filePath, allowedPath, allowedPdfViewerFn),
126
+ (0, json_1.deleteJsonArray)(filePath, allowedPath, allowedPdfDistFn),
127
+ (0, json_1.deleteJsonValue)(filePath, enPath),
128
+ (0, json_1.updateJsonValue)(filePath, lintPatternPath, lintPatternValue),
129
+ (0, json_1.updateJsonValue)(filePath, lintConfigPath, lintConfigValue),
130
+ (0, json_1.deleteJsonArray)(filePath, cliPath, cliFn),
131
+ (0, files_1.replaceRule)(options, 'Icons-and-Fonts auf v1.10.0 wird aktualisiert...', 'Icons-and-Fonts auf v1.10.0 wurde aktualisiert.', (options.path ?? '') + 'src/styles.scss', new replace_item_1.ReplaceItem('icons-and-fonts/v1.8.0', 'icons-and-fonts/v1.10.0', true)),
132
+ (0, files_1.replaceRule)(options, 'Icons-and-Fonts auf v1.10.0 wird aktualisiert...', 'Icons-and-Fonts auf v1.10.0 wurde aktualisiert.', (options.path ?? '') + 'src/app/app.module.ts', new replace_item_1.ReplaceItem('icons-and-fonts/v1.8.0', 'icons-and-fonts/v1.10.0', true)),
133
+ (0, util_1.messageSuccessRule)(`angular.json wurde angepasst.`)
134
+ ]);
135
+ };
136
+ }
137
+ function updateKarmaConfJs(options) {
138
+ return (_tree, _context) => {
139
+ const filePath = (options.path ?? '') + '/karma.conf.js';
140
+ return (0, schematics_1.chain)([
141
+ (0, util_1.messageInfoRule)(`karma.conf.js wird angepasst...`),
142
+ (0, files_1.replaceRule)(options, 'Reporters wird angepasst...', 'Reporters wurde angepasst.', filePath, new replace_item_1.ReplaceItem("'progress', 'coverage'", "'progress', 'kjhtml'")),
143
+ (0, util_1.messageSuccessRule)(`karma.conf.js wurde angepasst.`)
144
+ ]);
145
+ };
146
+ }
147
+ function updateTsConfigAppJson(options) {
148
+ return (_tree, _context) => {
149
+ const filePath = (options.path ?? '') + '/src/tsconfig.app.json';
150
+ const i18nPath = ['compilerOptions', 'types'];
151
+ const i18nValue = '@angular/localize';
152
+ return (0, schematics_1.chain)([
153
+ (0, util_1.messageInfoRule)(`tsconfig.app.json wird angepasst...`),
154
+ (0, json_1.updateJsonArray)(filePath, i18nPath, i18nValue),
155
+ (0, util_1.messageSuccessRule)(`tsconfig.app.json wurde angepasst.`)
156
+ ]);
157
+ };
158
+ }
159
+ function updateTsConfigSpecJson(options) {
160
+ return (_tree, _context) => {
161
+ const filePath = (options.path ?? '') + '/src/tsconfig.spec.json';
162
+ const testPath = ['files'];
163
+ const testFn = (node) => (0, json_1.findStringInArray)(node, 'test.ts');
164
+ const i18nPath = ['compilerOptions', 'types'];
165
+ const i18nValue = '@angular/localize';
166
+ return (0, schematics_1.chain)([
167
+ (0, util_1.messageInfoRule)(`tsconfig.spec.json wird angepasst...`),
168
+ (0, json_1.deleteJsonArray)(filePath, testPath, testFn),
169
+ (0, json_1.updateJsonArray)(filePath, i18nPath, i18nValue),
170
+ (0, util_1.messageSuccessRule)(`tsconfig.spec.json wurde angepasst.`)
171
+ ]);
172
+ };
173
+ }
174
+ function updateMainTs(options) {
175
+ return (_tree, _context) => {
176
+ const filePath = (options.path ?? '') + '/src/main.ts';
177
+ return (0, schematics_1.chain)([
178
+ (0, util_1.messageInfoRule)(`main.ts wird angepasst...`),
179
+ (0, files_1.replaceRule)(options, 'I18N wird angepasst...', 'I18N wurde angepasst.', filePath, new replace_item_1.ReplaceItem("import '@angular/localize/init';", '/// <reference types="@angular/localize" />')),
180
+ (0, util_1.messageSuccessRule)(`main.ts wurde angepasst.`)
181
+ ]);
182
+ };
183
+ }
184
+ function updateTestTs(options) {
185
+ return (_tree, _context) => {
186
+ const filePath = (options.path ?? '') + '/src/main.ts';
187
+ return (0, schematics_1.chain)([
188
+ (0, util_1.messageInfoRule)(`test.ts wird angepasst...`),
189
+ (0, files_1.replaceRule)(options, 'I18N wird angepasst...', 'I18N wurde angepasst.', filePath, new replace_item_1.ReplaceItem("import '@angular/localize/init';", '/// <reference types="@angular/localize" />')),
190
+ (0, util_1.messageSuccessRule)(`test.ts wurde angepasst.`)
191
+ ]);
192
+ };
193
+ }
194
+ function updateMessages(options) {
195
+ return (_tree, _context) => {
196
+ const deFilePath = (options.path ?? '') + '/src/locale/messages.xlf';
197
+ const enFilePath = (options.path ?? '') + '/src/locale/messages.en.xlf';
198
+ const zoomId = 'luxc.file-preview.pdfviewer.zoom.arialabel';
199
+ const chipRemoveBeforeId = `luxc.chips.input.placeholder.lbl`;
200
+ const deChipRemove = `<trans-unit id="luxc.chips.remove" datatype="html">
201
+ <source>entfernen</source>
202
+ <context-group purpose="location">
203
+ <context context-type="sourcefile">projects/lux-components-lib/core/lib/lux-form/lux-chips-ac/lux-chips-ac.component.html</context>
204
+ <context context-type="linenumber">1</context>
205
+ </context-group>
206
+ <context-group purpose="location">
207
+ <context context-type="sourcefile">projects/lux-components-lib/core/lib/lux-form/lux-chips-ac/lux-chips-ac.component.html</context>
208
+ <context context-type="linenumber">1</context>
209
+ </context-group>
210
+ </trans-unit>`;
211
+ const enChipRemove = `<trans-unit id="luxc.chips.remove" datatype="html">
212
+ <source>entfernen</source>
213
+ <target>remove</target>
214
+ <context-group purpose="location">
215
+ <context context-type="sourcefile">projects/lux-components-lib/core/lib/lux-form/lux-chips-ac/lux-chips-ac.component.html</context>
216
+ <context context-type="linenumber">1</context>
217
+ </context-group>
218
+ <context-group purpose="location">
219
+ <context context-type="sourcefile">projects/lux-components-lib/core/lib/lux-form/lux-chips-ac/lux-chips-ac.component.html</context>
220
+ <context context-type="linenumber">1</context>
221
+ </context-group>
222
+ </trans-unit>`;
223
+ const stepperNotCompletedBeforeId = `luxc.lookup-autocomplete.error_message.not_available`;
224
+ const deStepperNotCompleted = `<trans-unit id="luxc.stepper-large.error_message.steps_not_completed" datatype="html">
225
+ <source>Die Angaben in Schritt <x id="PH" equiv-text="i + 1"/> sind unvollständig oder fehlerhaft. Bitte korrigieren Sie erst Ihre Angaben in diesem Schritt.</source>
226
+ <context-group purpose="location">
227
+ <context context-type="sourcefile">projects/lux-components-lib/core/lib/lux-layout/lux-stepper-large/lux-stepper-large.component.ts</context>
228
+ <context context-type="linenumber">244</context>
229
+ </context-group>
230
+ </trans-unit>`;
231
+ const enStepperNotCompleted = `<trans-unit id="luxc.stepper-large.error_message.steps_not_completed" datatype="html">
232
+ <source>Die Angaben in Schritt <x id="PH" equiv-text="i + 1"/> sind unvollständig oder fehlerhaft. Bitte korrigieren Sie erst Ihre Angaben in diesem Schritt.</source>
233
+ <target>The information in step <x id="PH" equiv-text="i + 1"/> is incomplete or incorrect. Please correct your information in this step first.</target>
234
+ <context-group purpose="location">
235
+ <context context-type="sourcefile">projects/lux-components-lib/core/lib/lux-layout/lux-stepper-large/lux-stepper-large.component.ts</context>
236
+ <context context-type="linenumber">244</context>
237
+ </context-group>
238
+ </trans-unit>`;
239
+ const listBeforeId = `luxc.master-detail.back-to-master-label`;
240
+ const deList = `<trans-unit id="luxc.list.arialabel" datatype="html">
241
+ <source>Liste</source>
242
+ <context-group purpose="location">
243
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-layout/lux-list/lux-list.component.ts</context>
244
+ <context context-type="linenumber">43</context>
245
+ </context-group>
246
+ <context-group purpose="location">
247
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-layout/lux-list/lux-list.component.ts</context>
248
+ <context context-type="linenumber">49</context>
249
+ </context-group>
250
+ </trans-unit>`;
251
+ const enList = `<trans-unit id="luxc.list.arialabel" datatype="html">
252
+ <source>Liste</source>
253
+ <target>List</target>
254
+ <context-group purpose="location">
255
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-layout/lux-list/lux-list.component.ts</context>
256
+ <context context-type="linenumber">43</context>
257
+ </context-group>
258
+ <context-group purpose="location">
259
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-layout/lux-list/lux-list.component.ts</context>
260
+ <context context-type="linenumber">49</context>
261
+ </context-group>
262
+ </trans-unit>`;
263
+ const fileRenameId = `luxc.file.replace.dialog.title.multiple`;
264
+ const deFileRename = `<trans-unit id="luxc.file.rename.dialog.title" datatype="html">
265
+ <source> Wollen Sie die Datei umbenennen? </source>
266
+ <context-group purpose="location">
267
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-rename-dialog/lux-file-rename-dialog.component.html</context>
268
+ <context context-type="linenumber">4,7</context>
269
+ </context-group>
270
+ </trans-unit>
271
+ <trans-unit id="luxc.file.rename.input.lbl" datatype="html">
272
+ <source>Neuer Dateiname</source>
273
+ <context-group purpose="location">
274
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-rename-dialog/lux-file-rename-dialog.component.html</context>
275
+ <context context-type="linenumber">9,10</context>
276
+ </context-group>
277
+ </trans-unit>
278
+ <trans-unit id="luxc.file.rename.dialog.cancel.lbl" datatype="html">
279
+ <source>Abbrechen</source>
280
+ <context-group purpose="location">
281
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-rename-dialog/lux-file-rename-dialog.component.html</context>
282
+ <context context-type="linenumber">21,22</context>
283
+ </context-group>
284
+ </trans-unit>
285
+ <trans-unit id="luxc.file.rename.dialog.rename.lbl" datatype="html">
286
+ <source>Umbenennen</source>
287
+ <context-group purpose="location">
288
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-rename-dialog/lux-file-rename-dialog.component.html</context>
289
+ <context context-type="linenumber">28,29</context>
290
+ </context-group>
291
+ </trans-unit>`;
292
+ const enFileRename = `<trans-unit id="luxc.file.rename.dialog.title" datatype="html">
293
+ <source> Wollen Sie die Datei umbenennen? </source>
294
+ <target>Do you want to rename the file?</target>
295
+ <context-group purpose="location">
296
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-rename-dialog/lux-file-rename-dialog.component.html</context>
297
+ <context context-type="linenumber">4,7</context>
298
+ </context-group>
299
+ </trans-unit>
300
+ <trans-unit id="luxc.file.rename.input.lbl" datatype="html">
301
+ <source>Neuer Dateiname</source>
302
+ <target>New file name</target>
303
+ <context-group purpose="location">
304
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-rename-dialog/lux-file-rename-dialog.component.html</context>
305
+ <context context-type="linenumber">9,10</context>
306
+ </context-group>
307
+ </trans-unit>
308
+ <trans-unit id="luxc.file.rename.dialog.cancel.lbl" datatype="html">
309
+ <source>Abbrechen</source>
310
+ <target>Cancel</target>
311
+ <context-group purpose="location">
312
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-rename-dialog/lux-file-rename-dialog.component.html</context>
313
+ <context context-type="linenumber">21,22</context>
314
+ </context-group>
315
+ </trans-unit>
316
+ <trans-unit id="luxc.file.rename.dialog.rename.lbl" datatype="html">
317
+ <source>Umbenennen</source>
318
+ <target>Rename</target>
319
+ <context-group purpose="location">
320
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-rename-dialog/lux-file-rename-dialog.component.html</context>
321
+ <context context-type="linenumber">28,29</context>
322
+ </context-group>
323
+ </trans-unit>`;
324
+ const fileFileDeleteProtectionId = `luxc.file.replace.dialog.cancel.lbl`;
325
+ const deFileDeleteProtection = `<trans-unit id="luxc.file.replace.dialog.deleteprotection" datatype="html">
326
+ <source>Es soll eine Datei ersetzt werden, die weder erstetzt noch gelöscht werden darf!</source>
327
+ <context-group purpose="location">
328
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-replace-dialog/lux-file-replace-dialog.component.html</context>
329
+ <context context-type="linenumber">24,28</context>
330
+ </context-group>
331
+ </trans-unit>`;
332
+ const enFileDeleteProtection = `<trans-unit id="luxc.file.replace.dialog.deleteprotection" datatype="html">
333
+ <source>Es soll eine Datei ersetzt werden, die weder erstetzt noch gelöscht werden darf!</source>
334
+ <target>A file is to be replaced that must not be replaced or deleted!</target>
335
+ <context-group purpose="location">
336
+ <context context-type="sourcefile">projects/lux-components-lib/src/lib/lux-form/lux-file/lux-file-subcomponents/lux-file-replace-dialog/lux-file-replace-dialog.component.html</context>
337
+ <context context-type="linenumber">24,28</context>
338
+ </context-group>
339
+ </trans-unit>`;
340
+ return (0, schematics_1.chain)([
341
+ (0, files_1.replaceRule)(options, `Messages (de) werden angepasst...`, `Messages (de) wurden angepasst.`, deFilePath, new replace_item_1.RemoveTransUnitItem(zoomId), new replace_item_1.AddTransUnitItem(chipRemoveBeforeId, deChipRemove), new replace_item_1.AddTransUnitItem(stepperNotCompletedBeforeId, deStepperNotCompleted), new replace_item_1.AddTransUnitItem(listBeforeId, deList), new replace_item_1.AddTransUnitItem(fileRenameId, deFileRename), new replace_item_1.AddTransUnitItem(fileFileDeleteProtectionId, deFileDeleteProtection)),
342
+ (0, files_1.replaceRule)(options, `Messages (en) werden angepasst...`, `Messages (en) wurden angepasst.`, enFilePath, new replace_item_1.RemoveTransUnitItem(zoomId), new replace_item_1.AddTransUnitItem(chipRemoveBeforeId, enChipRemove), new replace_item_1.AddTransUnitItem(stepperNotCompletedBeforeId, enStepperNotCompleted), new replace_item_1.AddTransUnitItem(listBeforeId, enList), new replace_item_1.AddTransUnitItem(fileRenameId, enFileRename), new replace_item_1.AddTransUnitItem(fileFileDeleteProtectionId, enFileDeleteProtection))
343
+ ]);
344
+ };
345
+ }
@@ -92,19 +92,17 @@ function updatePackageJsonDependency(tree, dependency) {
92
92
  let node = (0, jsonc_parser_1.findNodeAtLocation)(packageJsonAsNode, [dependency.type.toString(), dependency.name]);
93
93
  if (node) {
94
94
  if (node && node.value !== dependency.version) {
95
- (0, logging_1.logInfo)(`Dependency ` +
96
- chalk.yellowBright(`${dependency.name}`) +
97
- ` ${node.value} wird ersetzt durch ${dependency.version}.`);
95
+ (0, logging_1.logInfo)(`Dependency ` + chalk.yellowBright(`${dependency.name}`) + ` ${node.value} wird ersetzt durch ${dependency.version}.`);
98
96
  }
99
97
  }
100
98
  else {
101
- (0, logging_1.logInfo)(`Dependency ` +
102
- chalk.yellowBright(`${dependency.name}`) +
103
- ` ${dependency.version} wird im Abschnitt ${dependency.type} hinzugefügt.`);
99
+ (0, logging_1.logInfo)(`Dependency ` + chalk.yellowBright(`${dependency.name}`) + ` ${dependency.version} wird im Abschnitt ${dependency.type} hinzugefügt.`);
104
100
  }
105
101
  if (!node || node.value !== dependency.version) {
106
102
  const packageJonsAsString = (0, json_1.readJsonAsString)(tree, '/package.json');
107
- const edits = (0, jsonc_parser_1.modify)(packageJonsAsString, [dependency.type.toString(), dependency.name], dependency.version, { formattingOptions: json_1.jsonFormattingOptions });
103
+ const edits = (0, jsonc_parser_1.modify)(packageJonsAsString, [dependency.type.toString(), dependency.name], dependency.version, {
104
+ formattingOptions: json_1.jsonFormattingOptions
105
+ });
108
106
  if (edits) {
109
107
  tree.overwrite('/package.json', (0, jsonc_parser_1.applyEdits)(packageJonsAsString, edits));
110
108
  }
@@ -9,6 +9,7 @@ exports.searchInComponentAndModifyModule = searchInComponentAndModifyModule;
9
9
  exports.findModule = findModule;
10
10
  exports.deleteFile = deleteFile;
11
11
  exports.replaceRule = replaceRule;
12
+ exports.readFile = readFile;
12
13
  const core_1 = require("@angular-devkit/core");
13
14
  const schematics_1 = require("@angular-devkit/schematics");
14
15
  const logging_1 = require("./logging");
@@ -165,7 +166,10 @@ function moveFilesToDirectory(options, sourcePath, targetPath) {
165
166
  }
166
167
  targetPath = (options.path ? options.path : '') + targetPath;
167
168
  const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('.' + sourcePath), [
168
- (0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
169
+ (0, schematics_1.template)({
170
+ ...core_1.strings,
171
+ ...options
172
+ }),
169
173
  (0, schematics_1.forEach)((file) => {
170
174
  let newTargetPath = targetPath + file.path;
171
175
  newTargetPath = newTargetPath.replace('//', '/');
@@ -330,3 +334,7 @@ function replaceRule(options, startMsg, endMsg, filePattern, ...replaceItems) {
330
334
  (0, util_1.messageSuccessRule)(endMsg)
331
335
  ]);
332
336
  }
337
+ function readFile(tree, path) {
338
+ const fileContent = tree.read(path);
339
+ return fileContent ? fileContent.toString() : '';
340
+ }
@@ -5,6 +5,11 @@ exports.Hit = void 0;
5
5
  * Die {@link Hit}-Klasse repräsentiert einen Treffer, der Anhand des verwendeten Selektors gefunden wurde.
6
6
  */
7
7
  class Hit {
8
+ placeholder;
9
+ selector;
10
+ row;
11
+ elementContent;
12
+ element;
8
13
  /**
9
14
  * Der Konstruktor der {@link Hit}-Klasse.
10
15
  *
@@ -26,10 +26,13 @@ exports.PLACEHOLDER = `@@@element@@@`;
26
26
  * Output: <lux-input/>
27
27
  */
28
28
  class HtmlManipulator {
29
+ htmlContent;
30
+ selector;
31
+ manipulatorFNs;
29
32
  constructor(htmlContent, selector, manipulatorFns) {
30
33
  this.htmlContent = htmlContent;
31
34
  this.selector = selector;
32
- this.manipulatorFNs = manipulatorFns !== null && manipulatorFns !== void 0 ? manipulatorFns : [];
35
+ this.manipulatorFNs = manipulatorFns ?? [];
33
36
  }
34
37
  /**
35
38
  * Diese Methode ermittelt alle betroffenen HTML-Elemente anhand des übergebenen Selektors und versieht diese mit dem temporären
@@ -60,10 +63,9 @@ class HtmlManipulator {
60
63
  const elements = dom.window.document.querySelectorAll(selector);
61
64
  let counter = 0;
62
65
  elements.forEach((el) => {
63
- var _a, _b;
64
66
  const location = dom.nodeLocation(el);
65
- const startIndex = (_a = location === null || location === void 0 ? void 0 : location.startOffset) !== null && _a !== void 0 ? _a : -1;
66
- const endIndex = (_b = location === null || location === void 0 ? void 0 : location.endOffset) !== null && _b !== void 0 ? _b : -1;
67
+ const startIndex = location?.startOffset ?? -1;
68
+ const endIndex = location?.endOffset ?? -1;
67
69
  htmlContent = this.addUnprocessedAttr(htmlContent, el.tagName, startIndex, endIndex, counter++);
68
70
  });
69
71
  return htmlContent;
@@ -10,6 +10,7 @@ exports.updateJsonArray = updateJsonArray;
10
10
  exports.deleteJsonArray = deleteJsonArray;
11
11
  exports.findObjectIndexInArray = findObjectIndexInArray;
12
12
  exports.findObjectPropertyInArray = findObjectPropertyInArray;
13
+ exports.findObjectContainsInArray = findObjectContainsInArray;
13
14
  exports.findStringInArray = findStringInArray;
14
15
  exports.findStringIndexInArray = findStringIndexInArray;
15
16
  exports.removeJsonNode = removeJsonNode;
@@ -168,7 +169,6 @@ function deleteJsonArray(filePath, jsonPath, findFn) {
168
169
  * @param propertyValue Ein Propertywert (z.B. *.css).
169
170
  */
170
171
  function findObjectIndexInArray(arrayNode, propertyName, propertyValue) {
171
- var _a;
172
172
  let arrayIndex = -1;
173
173
  if (arrayNode.children) {
174
174
  for (let i = 0; i < arrayNode.children.length; i++) {
@@ -178,7 +178,7 @@ function findObjectIndexInArray(arrayNode, propertyName, propertyValue) {
178
178
  if (assetObjectChildren) {
179
179
  for (let j = 0; j < assetObjectChildren.length; j++) {
180
180
  if (assetObjectChildren[j].type === 'property') {
181
- const propertyChildren = (_a = assetObjectChildren[j].children) !== null && _a !== void 0 ? _a : [];
181
+ const propertyChildren = assetObjectChildren[j].children ?? [];
182
182
  if (propertyChildren.length > 1 &&
183
183
  propertyChildren[0].value === propertyName &&
184
184
  propertyChildren[1].value === propertyValue) {
@@ -198,14 +198,13 @@ function findObjectIndexInArray(arrayNode, propertyName, propertyValue) {
198
198
  return arrayIndex;
199
199
  }
200
200
  function findObjectPropertyInArray(node, propertyName, propertyValue) {
201
- var _a;
202
201
  let found = false;
203
202
  if (node.type === 'object' && node.children && node.children.length > 0) {
204
203
  const assetObjectChildren = node.children;
205
204
  if (assetObjectChildren) {
206
205
  for (let j = 0; j < assetObjectChildren.length; j++) {
207
206
  if (assetObjectChildren[j].type === 'property') {
208
- const propertyChildren = (_a = assetObjectChildren[j].children) !== null && _a !== void 0 ? _a : [];
207
+ const propertyChildren = assetObjectChildren[j].children ?? [];
209
208
  if (propertyChildren.length > 1 && propertyChildren[0].value === propertyName && propertyChildren[1].value === propertyValue) {
210
209
  found = true;
211
210
  break;
@@ -216,6 +215,24 @@ function findObjectPropertyInArray(node, propertyName, propertyValue) {
216
215
  }
217
216
  return found;
218
217
  }
218
+ function findObjectContainsInArray(node, propertyName, value) {
219
+ let found = false;
220
+ if (node.type === 'object' && node.children && node.children.length > 0) {
221
+ const assetObjectChildren = node.children;
222
+ if (assetObjectChildren) {
223
+ for (let j = 0; j < assetObjectChildren.length; j++) {
224
+ if (assetObjectChildren[j].type === 'property') {
225
+ const propertyChildren = assetObjectChildren[j].children ?? [];
226
+ if (propertyChildren.length > 1 && propertyChildren[0].value === propertyName && propertyChildren[1].value?.includes(value)) {
227
+ found = true;
228
+ break;
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }
234
+ return found;
235
+ }
219
236
  function findStringInArray(arrayNode, value) {
220
237
  let found = false;
221
238
  if (arrayNode.type === 'string' && arrayNode.value === value) {
@@ -1,11 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RemoveHtmlAttributeItem = exports.ReplaceHtmlAttributeItem = exports.RemoveHtmlTagAttributeItem = exports.ReplaceHtmlTagAttributeItem = exports.ReplaceItem = void 0;
3
+ exports.AddTransUnitItem = exports.RemoveTransUnitItem = exports.RemoveHtmlAttributeItem = exports.ReplaceHtmlAttributeItem = exports.RemoveHtmlTagAttributeItem = exports.ReplaceHtmlTagAttributeItem = exports.ReplaceItem = void 0;
4
4
  class ReplaceItem {
5
+ find;
6
+ replacement;
7
+ replaceAll;
5
8
  constructor(find, replace, replaceAll) {
6
9
  this.find = find;
7
10
  this.replacement = replace;
8
- this.replaceAll = replaceAll !== null && replaceAll !== void 0 ? replaceAll : true;
11
+ this.replaceAll = replaceAll ?? true;
9
12
  }
10
13
  }
11
14
  exports.ReplaceItem = ReplaceItem;
@@ -33,3 +36,15 @@ class RemoveHtmlAttributeItem extends ReplaceItem {
33
36
  }
34
37
  }
35
38
  exports.RemoveHtmlAttributeItem = RemoveHtmlAttributeItem;
39
+ class RemoveTransUnitItem extends ReplaceItem {
40
+ constructor(transUnitId) {
41
+ super(new RegExp(String.raw `<trans-unit id="${transUnitId}"[\s\S]*?<\/trans-unit>`, 'gm'), '', true);
42
+ }
43
+ }
44
+ exports.RemoveTransUnitItem = RemoveTransUnitItem;
45
+ class AddTransUnitItem extends ReplaceItem {
46
+ constructor(transUnitId, newTransUnit) {
47
+ super(new RegExp(String.raw `<trans-unit id="${transUnitId}" datatype="html">`, 'gm'), `${newTransUnit}\n <trans-unit id="${transUnitId}" datatype="html">`, true);
48
+ }
49
+ }
50
+ exports.AddTransUnitItem = AddTransUnitItem;