@ihk-gfi/lux-components-update 14.7.1 → 15.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.
- package/README.md +4 -2
- package/add-lux-components/files/app/app.component.html +34 -0
- package/{src/add-lux-components → add-lux-components}/files/app/app.component.spec.ts +4 -2
- package/{src/add-lux-components → add-lux-components}/files/app/app.component.ts +1 -1
- package/add-lux-components/files/src/main.ts +17 -0
- package/{src/add-lux-components → add-lux-components}/index.js +29 -30
- package/add-lux-components/schema.json +23 -0
- package/collection.json +35 -0
- package/package.json +27 -27
- package/{src/theme → theme}/change-theme-to-authentic/index.js +0 -1
- package/theme/change-theme-to-authentic/schema.json +23 -0
- package/{src/theme → theme}/change-to-lux-icons/index.js +0 -1
- package/theme/change-to-lux-icons/schema.json +23 -0
- package/{src/update-dependencies → update-dependencies}/index.d.ts +1 -0
- package/update-dependencies/index.js +92 -0
- package/update-dependencies/schema.json +23 -0
- package/{src/update-en-messages → update-en-messages}/index.js +0 -1
- package/update-en-messages/schema.json +23 -0
- package/updates/15.0.0/index.d.ts +8 -0
- package/updates/15.0.0/index.js +109 -0
- package/updates/15.0.0/schema.json +23 -0
- package/{src/utility → utility}/dependencies.js +0 -1
- package/{src/utility → utility}/files.js +0 -1
- package/{src/utility → utility}/html/hit.js +0 -1
- package/{src/utility → utility}/html/html-manipulator.js +0 -1
- package/{src/utility → utility}/html/manipulator-functions.js +0 -1
- package/{src/utility → utility}/json.d.ts +2 -0
- package/{src/utility → utility}/json.js +16 -8
- package/{src/utility → utility}/logging.js +0 -1
- package/{src/utility → utility}/test.js +0 -1
- package/{src/utility → utility}/typescript.js +0 -1
- package/{src/utility → utility}/util.js +0 -1
- package/{src/utility → utility}/validation.js +0 -1
- package/src/add-lux-components/files/app/app.component.html +0 -32
- package/src/add-lux-components/files/app/base/license-hint/license-hint.component.html +0 -7
- package/src/add-lux-components/files/app/base/license-hint/license-hint.component.ts +0 -18
- package/src/add-lux-components/files/app/error/error.component.html +0 -10
- package/src/add-lux-components/files/app/error/error.component.scss +0 -3
- package/src/add-lux-components/files/app/error/error.component.spec.ts +0 -49
- package/src/add-lux-components/files/app/error/error.component.ts +0 -17
- package/src/add-lux-components/files/app/home/home.component.html +0 -7
- package/src/add-lux-components/files/app/home/home.component.scss +0 -3
- package/src/add-lux-components/files/app/home/home.component.ts +0 -13
- package/src/add-lux-components/files/app/profil/profil.component.html +0 -1
- package/src/add-lux-components/files/app/profil/profil.component.scss +0 -0
- package/src/add-lux-components/files/app/profil/profil.component.spec.ts +0 -24
- package/src/add-lux-components/files/app/profil/profil.component.ts +0 -11
- package/src/add-lux-components/files/assets/svg/Example.svg +0 -6
- package/src/add-lux-components/files/assets/svg/android.svg +0 -2
- package/src/add-lux-components/files/assets/svg/box.svg +0 -690
- package/src/add-lux-components/files/assets/svg/demoAppLogo.svg +0 -1
- package/src/add-lux-components/files/assets/svg/red_power_button.svg +0 -67
- package/src/add-lux-components/files/assets/svg/svg2009.svg +0 -57457
- package/src/add-lux-components/files/src/polyfills.ts +0 -58
- package/src/add-lux-components/index.js.map +0 -1
- package/src/add-lux-components/index.ts +0 -293
- package/src/add-lux-components/index_spec.d.ts +0 -1
- package/src/add-lux-components/index_spec.js +0 -51
- package/src/add-lux-components/index_spec.js.map +0 -1
- package/src/add-lux-components/index_spec.ts +0 -55
- package/src/add-lux-components/schema.json +0 -23
- package/src/collection.json +0 -70
- package/src/theme/change-theme-to-authentic/index.js.map +0 -1
- package/src/theme/change-theme-to-authentic/index.ts +0 -131
- package/src/theme/change-theme-to-authentic/index_spec.d.ts +0 -1
- package/src/theme/change-theme-to-authentic/index_spec.js +0 -300
- package/src/theme/change-theme-to-authentic/index_spec.js.map +0 -1
- package/src/theme/change-theme-to-authentic/index_spec.ts +0 -321
- package/src/theme/change-theme-to-authentic/schema.json +0 -23
- package/src/theme/change-to-lux-icons/index.js.map +0 -1
- package/src/theme/change-to-lux-icons/index.ts +0 -392
- package/src/theme/change-to-lux-icons/index_spec.d.ts +0 -1
- package/src/theme/change-to-lux-icons/index_spec.js +0 -128
- package/src/theme/change-to-lux-icons/index_spec.js.map +0 -1
- package/src/theme/change-to-lux-icons/index_spec.ts +0 -130
- package/src/theme/change-to-lux-icons/schema.json +0 -23
- package/src/update-dependencies/index.js +0 -88
- package/src/update-dependencies/index.js.map +0 -1
- package/src/update-dependencies/index.ts +0 -86
- package/src/update-dependencies/schema.json +0 -23
- package/src/update-en-messages/index.js.map +0 -1
- package/src/update-en-messages/index.ts +0 -83
- package/src/update-en-messages/index_spec.d.ts +0 -1
- package/src/update-en-messages/index_spec.js +0 -174
- package/src/update-en-messages/index_spec.js.map +0 -1
- package/src/update-en-messages/index_spec.ts +0 -182
- package/src/update-en-messages/schema.json +0 -23
- package/src/updates/update140000/files/src/polyfills.ts +0 -70
- package/src/updates/update140000/index.d.ts +0 -14
- package/src/updates/update140000/index.js +0 -95
- package/src/updates/update140000/index.js.map +0 -1
- package/src/updates/update140000/index.ts +0 -110
- package/src/updates/update140000/index_spec.d.ts +0 -1
- package/src/updates/update140000/index_spec.js +0 -165
- package/src/updates/update140000/index_spec.js.map +0 -1
- package/src/updates/update140000/index_spec.ts +0 -171
- package/src/updates/update140000/schema.json +0 -23
- package/src/updates/update140100/index.d.ts +0 -5
- package/src/updates/update140100/index.js +0 -62
- package/src/updates/update140100/index.js.map +0 -1
- package/src/updates/update140100/index.ts +0 -60
- package/src/updates/update140100/index_spec.d.ts +0 -1
- package/src/updates/update140100/index_spec.js +0 -124
- package/src/updates/update140100/index_spec.js.map +0 -1
- package/src/updates/update140100/index_spec.ts +0 -137
- package/src/updates/update140100/schema.json +0 -23
- package/src/updates/update140200/index.d.ts +0 -8
- package/src/updates/update140200/index.js +0 -40
- package/src/updates/update140200/index.js.map +0 -1
- package/src/updates/update140200/index.ts +0 -38
- package/src/updates/update140200/index_spec.d.ts +0 -1
- package/src/updates/update140200/index_spec.js +0 -75
- package/src/updates/update140200/index_spec.js.map +0 -1
- package/src/updates/update140200/index_spec.ts +0 -81
- package/src/updates/update140200/schema.json +0 -23
- package/src/updates/update140300/index.d.ts +0 -10
- package/src/updates/update140300/index.js +0 -85
- package/src/updates/update140300/index.js.map +0 -1
- package/src/updates/update140300/index.ts +0 -86
- package/src/updates/update140300/index_spec.d.ts +0 -1
- package/src/updates/update140300/index_spec.js +0 -145
- package/src/updates/update140300/index_spec.js.map +0 -1
- package/src/updates/update140300/index_spec.ts +0 -177
- package/src/updates/update140300/schema.json +0 -23
- package/src/updates/update140400/index.d.ts +0 -2
- package/src/updates/update140400/index.js +0 -22
- package/src/updates/update140400/index.js.map +0 -1
- package/src/updates/update140400/index.ts +0 -18
- package/src/updates/update140400/index_spec.d.ts +0 -1
- package/src/updates/update140400/index_spec.js +0 -75
- package/src/updates/update140400/index_spec.js.map +0 -1
- package/src/updates/update140400/index_spec.ts +0 -81
- package/src/updates/update140400/schema.json +0 -23
- package/src/updates/update140500/index.d.ts +0 -2
- package/src/updates/update140500/index.js +0 -21
- package/src/updates/update140500/index.js.map +0 -1
- package/src/updates/update140500/index.ts +0 -17
- package/src/updates/update140500/index_spec.d.ts +0 -1
- package/src/updates/update140500/index_spec.js +0 -73
- package/src/updates/update140500/index_spec.js.map +0 -1
- package/src/updates/update140500/index_spec.ts +0 -78
- package/src/updates/update140500/schema.json +0 -23
- package/src/updates/update140600/index.d.ts +0 -2
- package/src/updates/update140600/index.js +0 -39
- package/src/updates/update140600/index.js.map +0 -1
- package/src/updates/update140600/index.ts +0 -35
- package/src/updates/update140600/index_spec.d.ts +0 -1
- package/src/updates/update140600/index_spec.js +0 -71
- package/src/updates/update140600/index_spec.js.map +0 -1
- package/src/updates/update140600/index_spec.ts +0 -75
- package/src/updates/update140600/schema.json +0 -23
- package/src/updates/update140700/index.d.ts +0 -2
- package/src/updates/update140700/index.js +0 -22
- package/src/updates/update140700/index.js.map +0 -1
- package/src/updates/update140700/index.ts +0 -18
- package/src/updates/update140700/index_spec.d.ts +0 -1
- package/src/updates/update140700/index_spec.js +0 -75
- package/src/updates/update140700/index_spec.js.map +0 -1
- package/src/updates/update140700/index_spec.ts +0 -79
- package/src/updates/update140700/schema.json +0 -23
- package/src/utility/dependencies.js.map +0 -1
- package/src/utility/dependencies.ts +0 -144
- package/src/utility/files.js.map +0 -1
- package/src/utility/files.ts +0 -368
- package/src/utility/html/hit.js.map +0 -1
- package/src/utility/html/hit.ts +0 -28
- package/src/utility/html/html-manipulator.js.map +0 -1
- package/src/utility/html/html-manipulator.ts +0 -156
- package/src/utility/html/html_spec.d.ts +0 -1
- package/src/utility/html/html_spec.js +0 -692
- package/src/utility/html/html_spec.js.map +0 -1
- package/src/utility/html/html_spec.ts +0 -751
- package/src/utility/html/manipulator-functions.js.map +0 -1
- package/src/utility/html/manipulator-functions.ts +0 -149
- package/src/utility/json.js.map +0 -1
- package/src/utility/json.ts +0 -288
- package/src/utility/json_spec.d.ts +0 -1
- package/src/utility/json_spec.js +0 -326
- package/src/utility/json_spec.js.map +0 -1
- package/src/utility/json_spec.ts +0 -446
- package/src/utility/logging.js.map +0 -1
- package/src/utility/logging.ts +0 -80
- package/src/utility/test.js.map +0 -1
- package/src/utility/test.ts +0 -24
- package/src/utility/typescript.js.map +0 -1
- package/src/utility/typescript.ts +0 -598
- package/src/utility/typescript_spec.d.ts +0 -1
- package/src/utility/typescript_spec.js +0 -1005
- package/src/utility/typescript_spec.js.map +0 -1
- package/src/utility/typescript_spec.ts +0 -1265
- package/src/utility/util.js.map +0 -1
- package/src/utility/util.ts +0 -145
- package/src/utility/validation.js.map +0 -1
- package/src/utility/validation.ts +0 -48
- package/tsconfig.json +0 -35
- /package/{src/add-lux-components → add-lux-components}/files/app/app-routing.module.ts +0 -0
- /package/{src/add-lux-components → add-lux-components}/files/app/app.module.ts +0 -0
- /package/{src/add-lux-components → add-lux-components}/files/environments/environment.prod.ts +0 -0
- /package/{src/add-lux-components → add-lux-components}/files/environments/environment.ts +0 -0
- /package/{src/add-lux-components → add-lux-components}/files/locale/messages.en.xlf +0 -0
- /package/{src/add-lux-components → add-lux-components}/files/locale/messages.xlf +0 -0
- /package/{src/add-lux-components → add-lux-components}/files/src/index.html +0 -0
- /package/{src/add-lux-components → add-lux-components}/index.d.ts +0 -0
- /package/{src/theme → theme}/change-theme-to-authentic/index.d.ts +0 -0
- /package/{src/theme → theme}/change-to-lux-icons/index.d.ts +0 -0
- /package/{src/update-en-messages → update-en-messages}/index.d.ts +0 -0
- /package/{src/utility → utility}/dependencies.d.ts +0 -0
- /package/{src/utility → utility}/files.d.ts +0 -0
- /package/{src/utility → utility}/html/hit.d.ts +0 -0
- /package/{src/utility → utility}/html/html-manipulator.d.ts +0 -0
- /package/{src/utility → utility}/html/manipulator-functions.d.ts +0 -0
- /package/{src/utility → utility}/logging.d.ts +0 -0
- /package/{src/utility → utility}/test.d.ts +0 -0
- /package/{src/utility → utility}/typescript.d.ts +0 -0
- /package/{src/utility → utility}/util.d.ts +0 -0
- /package/{src/utility → utility}/validation.d.ts +0 -0
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { JSDOM } from 'jsdom';
|
|
2
|
-
import { replaceFirst } from '../util';
|
|
3
|
-
import { Hit } from './hit';
|
|
4
|
-
import { ManipulatorFn } from './manipulator-functions';
|
|
5
|
-
|
|
6
|
-
export const ATTR_NOT_PROCESSED = 'data-lux-not-processed';
|
|
7
|
-
export const PLACEHOLDER = `@@@element@@@`;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Der {@link HtmlManipulator} ist für die Manipulation der HTML-Templates zuständig.
|
|
11
|
-
*
|
|
12
|
-
* Warum verwendet der {@link HtmlManipulator} eigene Funktionen, um den HTML-Inhalt anzupassen,
|
|
13
|
-
* anstatt die bereitgestellten Methoden von JSDOm (serialize()) bzw. Cheerio (xml() oder html() zu verwenden?
|
|
14
|
-
*
|
|
15
|
-
* Die serialize-Methode von JSDOM wandelt alle Attribute in Kleinschrift um, sodass die Angular-Attribute nicht mehr
|
|
16
|
-
* funktionieren. Cheerio kann konfiguriert werden, sodass die Camel-Case-Namen erhalten bleiben,
|
|
17
|
-
* aber dort werden z.B. die leeren Ent-Tags ersetzt. Zusätzlich bricht Cheerio manchmal in komplexeren Templates an Stellen um,
|
|
18
|
-
* sodass das Template im Anschluss nicht mehr kompiliert.
|
|
19
|
-
*
|
|
20
|
-
* @example JSDOM
|
|
21
|
-
* Input: <lux-input luxLabel="Lorem ipsum"></lux-input>
|
|
22
|
-
* Output: <lux-input luxlabel="Lorem ipsum"></lux-input>
|
|
23
|
-
*
|
|
24
|
-
* @example Cheerio
|
|
25
|
-
* Input: <lux-input></lux-input>
|
|
26
|
-
* Output: <lux-input/>
|
|
27
|
-
*/
|
|
28
|
-
export class HtmlManipulator {
|
|
29
|
-
private htmlContent: string;
|
|
30
|
-
private readonly selector: string;
|
|
31
|
-
private readonly manipulatorFNs: ManipulatorFn[];
|
|
32
|
-
|
|
33
|
-
private constructor(htmlContent: string, selector: string, manipulatorFns: ManipulatorFn[]) {
|
|
34
|
-
this.htmlContent = htmlContent;
|
|
35
|
-
this.selector = selector;
|
|
36
|
-
this.manipulatorFNs = manipulatorFns ?? [];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Diese Methode ermittelt alle betroffenen HTML-Elemente anhand des übergebenen Selektors und versieht diese mit dem temporären
|
|
41
|
-
* {@link ATTR_NOT_PROCESSED}-Attribut.
|
|
42
|
-
*
|
|
43
|
-
* @example Selektor - lux-card
|
|
44
|
-
* <div>
|
|
45
|
-
* <lux-card luxTitle="Test">
|
|
46
|
-
* <lux-card-content>
|
|
47
|
-
* <p>Lorem ipsum</p>
|
|
48
|
-
* </lux-card-content>
|
|
49
|
-
* </lux-card>
|
|
50
|
-
* </div>
|
|
51
|
-
*
|
|
52
|
-
* <div>
|
|
53
|
-
* <lux-card data-lux-not-processed luxTitle="Test">
|
|
54
|
-
* <lux-card-content>
|
|
55
|
-
* <p>Lorem ipsum</p>
|
|
56
|
-
* </lux-card-content>
|
|
57
|
-
* </lux-card>
|
|
58
|
-
* </div>
|
|
59
|
-
*
|
|
60
|
-
* @param htmlContent Der HTML-Inhalt.
|
|
61
|
-
* @param selector Der CSS-Selektor.
|
|
62
|
-
*/
|
|
63
|
-
static prepare(htmlContent: string, selector: string): string {
|
|
64
|
-
const dom = new JSDOM(htmlContent, { includeNodeLocations: true });
|
|
65
|
-
const elements = dom.window.document.querySelectorAll(selector);
|
|
66
|
-
|
|
67
|
-
let counter = 0;
|
|
68
|
-
elements.forEach((el) => {
|
|
69
|
-
const location = dom.nodeLocation(el);
|
|
70
|
-
const startIndex = location?.startOffset ?? -1;
|
|
71
|
-
const endIndex = location?.endOffset ?? -1;
|
|
72
|
-
|
|
73
|
-
htmlContent = this.addUnprocessedAttr(htmlContent, el.tagName, startIndex, endIndex, counter++);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
return htmlContent;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Diese Methode transformiert den übergebenen HTML-Inhalt mit den Manipulator-Funktionen.
|
|
81
|
-
*
|
|
82
|
-
* @param htmlContent Der HTML-Inhalt.
|
|
83
|
-
* @param selector Der CSS-Selektor.
|
|
84
|
-
* @param manipulatorFns Die Funktionen manipulieren den HTML-Inhalt.
|
|
85
|
-
*/
|
|
86
|
-
static transform(htmlContent: string, selector: string, ...manipulatorFns: ManipulatorFn[]): string {
|
|
87
|
-
return new HtmlManipulator(htmlContent, selector, manipulatorFns).do();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Diese Methode liefert die Anzahl der mit dem Selektor gefundenen Elemente zurück.
|
|
92
|
-
*
|
|
93
|
-
* @param htmlContent Der HTML-Inhalt.
|
|
94
|
-
* @param selector Der CSS-Selektor.
|
|
95
|
-
*/
|
|
96
|
-
static count(htmlContent: string, selector: string): number {
|
|
97
|
-
return new JSDOM(htmlContent, { includeNodeLocations: false }).window.document.querySelectorAll(selector).length;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
private do(): string {
|
|
101
|
-
this.htmlContent = HtmlManipulator.prepare(this.htmlContent, this.selector);
|
|
102
|
-
|
|
103
|
-
// Hier wird der erste Treffer gesetzt. Zusätzlich wird im Ergebnis-HTML anstelle des Elements ein Platzhalter eingesetzt.
|
|
104
|
-
// Dieser Platzhalter wird im Nachgang wieder durch das manipulierte HTML des Elements ersetzt.
|
|
105
|
-
let hit = this.next();
|
|
106
|
-
while (hit) {
|
|
107
|
-
// Hier wird der HTML-Inhalt des Elements über die Manipulator-Funktionen angepasst.
|
|
108
|
-
this.manipulatorFNs.forEach((fn) => fn(hit!));
|
|
109
|
-
|
|
110
|
-
// Jetzt muss das unprocessed-Attribut, das in der prepare-Methode gesetzt wurde, wieder entfernt werden.
|
|
111
|
-
const updatedHtml = replaceFirst(hit.elementContent, ' ' + ATTR_NOT_PROCESSED, '');
|
|
112
|
-
|
|
113
|
-
// Zum Schluss muss der veränderte HTML-Inhalt des Elements wieder an die Stelle des Platzhalters im Ergebnis-HTML eingesetzt werden.
|
|
114
|
-
// Der Platzhalter im Ergebnis wird durch die next-Methode gesetzt.
|
|
115
|
-
this.htmlContent = this.htmlContent.replace(hit.placeholder, updatedHtml);
|
|
116
|
-
|
|
117
|
-
// Hier wird der nächste Treffer gesetzt.
|
|
118
|
-
// Details siehe den next()-Aufruf weiter oben.
|
|
119
|
-
hit = this.next();
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return this.htmlContent;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
private next(): Hit | null {
|
|
126
|
-
const dom = new JSDOM(this.htmlContent, { includeNodeLocations: true });
|
|
127
|
-
const element = dom.window.document.querySelector(`*[${ATTR_NOT_PROCESSED}]`);
|
|
128
|
-
|
|
129
|
-
if (element) {
|
|
130
|
-
const location = dom.nodeLocation(element);
|
|
131
|
-
if (location && location.startOffset >= 0 && location.endOffset >= 0) {
|
|
132
|
-
const start = location.startOffset;
|
|
133
|
-
const end = location.endOffset;
|
|
134
|
-
|
|
135
|
-
// Der Hit auf denen die Manipulator-Funktionen arbeiten, bekommen nur den HTML-Inhalt des Elements und
|
|
136
|
-
// nicht den gesamten Inhalt.
|
|
137
|
-
const hitContent = this.htmlContent.slice(start, end);
|
|
138
|
-
|
|
139
|
-
// Für das HTML des Elements wird der Platzhalter eingesetzt.
|
|
140
|
-
this.htmlContent = this.htmlContent.slice(0, start) + PLACEHOLDER + this.htmlContent.slice(end, this.htmlContent.length);
|
|
141
|
-
|
|
142
|
-
return new Hit(PLACEHOLDER, this.selector, hitContent, element, location.startLine);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
private static addUnprocessedAttr(htmlContent: string, tagName: string, startIndex: number, endIndex: number, counter: number) {
|
|
150
|
-
if (startIndex >= 0 && endIndex >= 0) {
|
|
151
|
-
const position = startIndex + (tagName.length + 1) + counter * (ATTR_NOT_PROCESSED.length + 1); /* +1 für die Leerzeichen */
|
|
152
|
-
htmlContent = [htmlContent.slice(0, position), ' ' + ATTR_NOT_PROCESSED, htmlContent.slice(position)].join('');
|
|
153
|
-
}
|
|
154
|
-
return htmlContent;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|