ngx-tethys 17.0.0-next.4 → 17.0.0-next.5
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/CHANGELOG.md +9 -0
- package/esm2022/version.mjs +2 -2
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-update/core/complete.d.ts +0 -1
- package/schematics/ng-update/core/complete.js +1 -10
- package/schematics/ng-update/update-17/class-name-migration.d.ts +12 -0
- package/schematics/ng-update/update-17/class-name-migration.js +62 -0
- package/schematics/ng-update/update-17/index.js +4 -3
- package/schematics/ng-update/update-17/index.spec.js +57 -0
- package/schematics/ng-update/update-17/update-data.d.ts +2 -0
- package/schematics/ng-update/update-17/update-data.js +788 -0
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/schematics/ng-update/core/html-parsing.d.ts +0 -175
- package/schematics/ng-update/core/html-parsing.js +0 -237
- package/schematics/ng-update/core/module-specifiers.d.ts +0 -4
- package/schematics/ng-update/core/module-specifiers.js +0 -20
- package/schematics/ng-update/core/upgrade-data.d.ts +0 -14
- package/schematics/ng-update/core/upgrade-data.js +0 -12
- package/schematics/ng-update/data/after-insert-element.d.ts +0 -40
- package/schematics/ng-update/data/after-insert-element.js +0 -27
- package/schematics/ng-update/data/attribute-selectors.d.ts +0 -2
- package/schematics/ng-update/data/attribute-selectors.js +0 -53
- package/schematics/ng-update/data/before-insert-element.d.ts +0 -40
- package/schematics/ng-update/data/before-insert-element.js +0 -27
- package/schematics/ng-update/data/class-names.d.ts +0 -2
- package/schematics/ng-update/data/class-names.js +0 -837
- package/schematics/ng-update/data/constructor-checks.d.ts +0 -2
- package/schematics/ng-update/data/constructor-checks.js +0 -4
- package/schematics/ng-update/data/css-selectors.d.ts +0 -20
- package/schematics/ng-update/data/css-selectors.js +0 -49
- package/schematics/ng-update/data/element-selectors.d.ts +0 -2
- package/schematics/ng-update/data/element-selectors.js +0 -33
- package/schematics/ng-update/data/entry-points.d.ts +0 -18
- package/schematics/ng-update/data/entry-points.js +0 -21
- package/schematics/ng-update/data/index.d.ts +0 -17
- package/schematics/ng-update/data/index.js +0 -53
- package/schematics/ng-update/data/input-names-removal.d.ts +0 -33
- package/schematics/ng-update/data/input-names-removal.js +0 -43
- package/schematics/ng-update/data/input-names.d.ts +0 -2
- package/schematics/ng-update/data/input-names.js +0 -69
- package/schematics/ng-update/data/input-values.d.ts +0 -40
- package/schematics/ng-update/data/input-values.js +0 -132
- package/schematics/ng-update/data/method-call-checks.d.ts +0 -2
- package/schematics/ng-update/data/method-call-checks.js +0 -4
- package/schematics/ng-update/data/output-names-removal.d.ts +0 -33
- package/schematics/ng-update/data/output-names-removal.js +0 -19
- package/schematics/ng-update/data/output-names.d.ts +0 -2
- package/schematics/ng-update/data/output-names.js +0 -4
- package/schematics/ng-update/data/property-names.d.ts +0 -2
- package/schematics/ng-update/data/property-names.js +0 -4
- package/schematics/ng-update/data/symbol-removal.d.ts +0 -11
- package/schematics/ng-update/data/symbol-removal.js +0 -4
- package/schematics/ng-update/migrations/after-insert-element.d.ts +0 -17
- package/schematics/ng-update/migrations/after-insert-element.js +0 -53
- package/schematics/ng-update/migrations/before-insert-element.d.ts +0 -17
- package/schematics/ng-update/migrations/before-insert-element.js +0 -53
- package/schematics/ng-update/migrations/checks/action-menu-removal-rule.d.ts +0 -13
- package/schematics/ng-update/migrations/checks/action-menu-removal-rule.js +0 -80
- package/schematics/ng-update/migrations/checks/label-removal-rule.d.ts +0 -9
- package/schematics/ng-update/migrations/checks/label-removal-rule.js +0 -77
- package/schematics/ng-update/migrations/class-names.d.ts +0 -50
- package/schematics/ng-update/migrations/class-names.js +0 -105
- package/schematics/ng-update/migrations/entry-points.d.ts +0 -17
- package/schematics/ng-update/migrations/entry-points.js +0 -69
- package/schematics/ng-update/migrations/input-names-removal.d.ts +0 -16
- package/schematics/ng-update/migrations/input-names-removal.js +0 -43
- package/schematics/ng-update/migrations/input-values.d.ts +0 -16
- package/schematics/ng-update/migrations/input-values.js +0 -65
- package/schematics/ng-update/migrations/output-names-removal.d.ts +0 -16
- package/schematics/ng-update/migrations/output-names-removal.js +0 -43
package/schematics/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "17.0.0-next.
|
|
1
|
+
export declare const VERSION = "17.0.0-next.5";
|
package/schematics/version.js
CHANGED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { DefaultTreeAdapterMap } from 'parse5/dist/tree-adapters/default';
|
|
2
|
-
export type Element = DefaultTreeAdapterMap['element'];
|
|
3
|
-
export type ChildNode = DefaultTreeAdapterMap['childNode'];
|
|
4
|
-
/**
|
|
5
|
-
* Finds the specified Angular @Input in the given elements with tag name.
|
|
6
|
-
*
|
|
7
|
-
* 在具有标签名称的给定元素中查找指定的 Angular @Input。
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
export declare function findWholeInputsOnElementWithTag(html: string, inputName: string, tagNames: string[]): {
|
|
11
|
-
start: number;
|
|
12
|
-
end: number;
|
|
13
|
-
startTagEnd: number;
|
|
14
|
-
endTagStart: number;
|
|
15
|
-
value: string;
|
|
16
|
-
}[];
|
|
17
|
-
/**
|
|
18
|
-
* Finds the specified Angular @Input in elements that have one of the specified attributes.
|
|
19
|
-
*
|
|
20
|
-
* 在具有指定属性之一的元素中查找指定的 Angular @Input。
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
export declare function findWholeInputsOnElementWithAttr(html: string, inputName: string, attrs: string[]): {
|
|
24
|
-
start: number;
|
|
25
|
-
end: number;
|
|
26
|
-
startTagEnd: number;
|
|
27
|
-
endTagStart: number;
|
|
28
|
-
value: string;
|
|
29
|
-
}[];
|
|
30
|
-
export declare function findWholeInputsOnElementWithTagInputBrackets(html: string, inputName: string, tagNames: string[]): {
|
|
31
|
-
start: number;
|
|
32
|
-
end: number;
|
|
33
|
-
startTagEnd: number;
|
|
34
|
-
endTagStart: number;
|
|
35
|
-
value: string;
|
|
36
|
-
}[];
|
|
37
|
-
export declare function findWholeInputsOnElementWithAttrInputBrackets(html: string, inputName: string, attrs: string[]): {
|
|
38
|
-
start: number;
|
|
39
|
-
end: number;
|
|
40
|
-
startTagEnd: number;
|
|
41
|
-
endTagStart: number;
|
|
42
|
-
value: string;
|
|
43
|
-
}[];
|
|
44
|
-
/**
|
|
45
|
-
* Finds elements with explicit tag names that also contain the specified attribute. Returns the
|
|
46
|
-
* attribute start offset/end offset/start tag end offset/end tag start offset/attribute value based on the specified HTML.
|
|
47
|
-
*
|
|
48
|
-
* 查找具有显式标签名称的元素,该名称也包含指定的属性。根据指定的 HTML 返回属性起始偏移量/截止偏移量/元素起始标签的截止偏移量/元素截止标签的起始偏移量/属性值。
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
export declare function findWholeAttributeOnElementWithTag(html: string, name: string, tagNames: string[]): {
|
|
52
|
-
start: number;
|
|
53
|
-
end: number;
|
|
54
|
-
startTagEnd: number;
|
|
55
|
-
endTagStart: number;
|
|
56
|
-
value: string;
|
|
57
|
-
}[];
|
|
58
|
-
/**
|
|
59
|
-
* Finds elements that contain the given attribute and contain at least one of the other
|
|
60
|
-
* specified attributes. Returns the primary attribute's start offset/end offset/start tag end offset/end tag start offset/attribute based on the specified HTML.
|
|
61
|
-
*
|
|
62
|
-
* 查找包含给定属性且包含至少一个其他指定属性的元素。根据指定的 HTML 返回主要属性的起始偏移量/截止偏移量/元素起始标签的截止偏移量/元素截止标签的起始偏移量/属性值。
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
export declare function findWholeAttributeOnElementWithAttrs(html: string, name: string, attrs: string[]): {
|
|
66
|
-
start: number;
|
|
67
|
-
end: number;
|
|
68
|
-
startTagEnd: number;
|
|
69
|
-
endTagStart: number;
|
|
70
|
-
value: string;
|
|
71
|
-
}[];
|
|
72
|
-
/**
|
|
73
|
-
* Gets the end offset of the given attribute from a Parse5 element.
|
|
74
|
-
*
|
|
75
|
-
* 从 Parse5 元素获取给定属性的截止偏移量。
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
|
-
export declare function getEndOffsetOfAttribute(element: any, attributeName: string): number;
|
|
79
|
-
/**
|
|
80
|
-
* Finds the specified Angular @Output in the given elements with tag name.
|
|
81
|
-
*
|
|
82
|
-
* 在具有标签名称的给定元素中查找指定的 Angular @Output。
|
|
83
|
-
*
|
|
84
|
-
*/
|
|
85
|
-
export declare function findWholeOutputsOnElementWithTag(html: string, outputName: string, tagNames: string[]): {
|
|
86
|
-
start: number;
|
|
87
|
-
end: number;
|
|
88
|
-
startTagEnd: number;
|
|
89
|
-
endTagStart: number;
|
|
90
|
-
value: string;
|
|
91
|
-
}[];
|
|
92
|
-
/**
|
|
93
|
-
* Finds the specified Angular @Output in elements that have one of the specified attributes.
|
|
94
|
-
*
|
|
95
|
-
* 在具有指定属性之一的元素中查找指定的 Angular @Output。
|
|
96
|
-
*
|
|
97
|
-
*/
|
|
98
|
-
export declare function findWholeOutputsOnElementWithAttr(html: string, outputName: string, attrs: string[]): {
|
|
99
|
-
start: number;
|
|
100
|
-
end: number;
|
|
101
|
-
startTagEnd: number;
|
|
102
|
-
endTagStart: number;
|
|
103
|
-
value: string;
|
|
104
|
-
}[];
|
|
105
|
-
/**
|
|
106
|
-
* Finds the specified Angular @Input name and value in the given elements with tag name.
|
|
107
|
-
*
|
|
108
|
-
* 在具有标签名称的给定元素中查找指定的 Angular @Input 名称和值。
|
|
109
|
-
*
|
|
110
|
-
*/
|
|
111
|
-
export declare function findWholeInputsNameAndValueOnElementWithTag(html: string, inputName: string, inputValue: string, tagNames: string[]): {
|
|
112
|
-
start: number;
|
|
113
|
-
end: number;
|
|
114
|
-
}[];
|
|
115
|
-
/**
|
|
116
|
-
* Finds the specified Angular @Input name and value in elements that have one of the specified attributes.
|
|
117
|
-
*
|
|
118
|
-
* 在具有指定属性之一的元素中查找指定的 Angular @Input 名称和值。
|
|
119
|
-
*
|
|
120
|
-
*/
|
|
121
|
-
export declare function findWholeInputsNameAndValueOnElementWithAttr(html: string, inputName: string, inputValue: string, attrs: string[]): {
|
|
122
|
-
start: number;
|
|
123
|
-
end: number;
|
|
124
|
-
}[];
|
|
125
|
-
/**
|
|
126
|
-
* Finds elements with explicit tag names that also contain the specified attribute name and value. Returns the
|
|
127
|
-
* attribute start offset and end offset based on the specified HTML.
|
|
128
|
-
*
|
|
129
|
-
* 查找具有显式标签名称的元素,该名称也包含指定的属性,且属性值一致。根据指定的 HTML 返回属性起始偏移量和截止偏移量。
|
|
130
|
-
*
|
|
131
|
-
*/
|
|
132
|
-
export declare function findWholeAttributeNameAndValueOnElementWithTag(html: string, name: string, value: string, tagNames: string[]): {
|
|
133
|
-
start: number;
|
|
134
|
-
end: number;
|
|
135
|
-
}[];
|
|
136
|
-
/**
|
|
137
|
-
* Finds elements that contain the given attribute(name and value) and contain at least one of the other
|
|
138
|
-
* specified attributes. Returns the primary attribute's start offset and end offset based on the specified HTML.
|
|
139
|
-
*
|
|
140
|
-
* 查找包含给定属性(名称和值)且包含至少一个其他指定属性的元素。根据指定的 HTML 返回主要属性的起始偏移量和截止偏移量。
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
export declare function findWholeAttributeNameAndValueOnElementWithAttrs(html: string, name: string, value: string, attrs: string[]): {
|
|
144
|
-
start: number;
|
|
145
|
-
end: number;
|
|
146
|
-
}[];
|
|
147
|
-
/**
|
|
148
|
-
* Parses a HTML fragment and traverses all AST nodes in order find elements that
|
|
149
|
-
* include the specified attribute name and value.
|
|
150
|
-
*
|
|
151
|
-
* 解析 HTML 片段并遍历所有 AST 节点,以查找包含指定属性且属性值一致的元素。
|
|
152
|
-
*
|
|
153
|
-
*/
|
|
154
|
-
export declare function findElementsWithAttributeNameAndValue(html: string, attributeName: string, attributeValue: string): import("parse5/dist/tree-adapters/default").Element[];
|
|
155
|
-
/**
|
|
156
|
-
* Gets the end offset of the Parse5 element start tag.
|
|
157
|
-
*
|
|
158
|
-
* 获取 Parse5 元素起始标签的截止偏移量。
|
|
159
|
-
*
|
|
160
|
-
*/
|
|
161
|
-
export declare function getStartTagEndOffsetOfElement(element: any): number;
|
|
162
|
-
/**
|
|
163
|
-
* Gets the end offset of the Parse5 element end tag.
|
|
164
|
-
*
|
|
165
|
-
* 获取 Parse5 元素截止标签的起始偏移量。
|
|
166
|
-
*
|
|
167
|
-
*/
|
|
168
|
-
export declare function getEndTagStartOffsetOfElement(element: any): number;
|
|
169
|
-
/**
|
|
170
|
-
* Gets the value of the given attribute from a Parse5 element.
|
|
171
|
-
*
|
|
172
|
-
*从 Parse5 元素获取给定属性的值。
|
|
173
|
-
*
|
|
174
|
-
*/
|
|
175
|
-
export declare function getAttributeValueOfElement(element: any, attributeName: string): string;
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAttributeValueOfElement = exports.getEndTagStartOffsetOfElement = exports.getStartTagEndOffsetOfElement = exports.findElementsWithAttributeNameAndValue = exports.findWholeAttributeNameAndValueOnElementWithAttrs = exports.findWholeAttributeNameAndValueOnElementWithTag = exports.findWholeInputsNameAndValueOnElementWithAttr = exports.findWholeInputsNameAndValueOnElementWithTag = exports.findWholeOutputsOnElementWithAttr = exports.findWholeOutputsOnElementWithTag = exports.getEndOffsetOfAttribute = exports.findWholeAttributeOnElementWithAttrs = exports.findWholeAttributeOnElementWithTag = exports.findWholeInputsOnElementWithAttrInputBrackets = exports.findWholeInputsOnElementWithTagInputBrackets = exports.findWholeInputsOnElementWithAttr = exports.findWholeInputsOnElementWithTag = void 0;
|
|
4
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
|
-
const parse5_1 = require("parse5");
|
|
6
|
-
/**
|
|
7
|
-
* Finds the specified Angular @Input in the given elements with tag name.
|
|
8
|
-
*
|
|
9
|
-
* 在具有标签名称的给定元素中查找指定的 Angular @Input。
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
function findWholeInputsOnElementWithTag(html, inputName, tagNames) {
|
|
13
|
-
return [
|
|
14
|
-
// Inputs can be also used without brackets (e.g. `<thy-tag thyColor="primary">Primary</thy-tag>`)
|
|
15
|
-
...findWholeAttributeOnElementWithTag(html, inputName, tagNames),
|
|
16
|
-
...findWholeAttributeOnElementWithTag(html, `[${inputName}]`, tagNames)
|
|
17
|
-
];
|
|
18
|
-
}
|
|
19
|
-
exports.findWholeInputsOnElementWithTag = findWholeInputsOnElementWithTag;
|
|
20
|
-
/**
|
|
21
|
-
* Finds the specified Angular @Input in elements that have one of the specified attributes.
|
|
22
|
-
*
|
|
23
|
-
* 在具有指定属性之一的元素中查找指定的 Angular @Input。
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
function findWholeInputsOnElementWithAttr(html, inputName, attrs) {
|
|
27
|
-
return [
|
|
28
|
-
// Inputs can be also used without brackets (e.g. `<label thyTag>Primary</label>`)
|
|
29
|
-
...findWholeAttributeOnElementWithAttrs(html, inputName, attrs),
|
|
30
|
-
...findWholeAttributeOnElementWithAttrs(html, `[${inputName}]`, attrs)
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
exports.findWholeInputsOnElementWithAttr = findWholeInputsOnElementWithAttr;
|
|
34
|
-
function findWholeInputsOnElementWithTagInputBrackets(html, inputName, tagNames) {
|
|
35
|
-
return [...findWholeAttributeOnElementWithTag(html, inputName, tagNames)];
|
|
36
|
-
}
|
|
37
|
-
exports.findWholeInputsOnElementWithTagInputBrackets = findWholeInputsOnElementWithTagInputBrackets;
|
|
38
|
-
function findWholeInputsOnElementWithAttrInputBrackets(html, inputName, attrs) {
|
|
39
|
-
return [...findWholeAttributeOnElementWithAttrs(html, inputName, attrs)];
|
|
40
|
-
}
|
|
41
|
-
exports.findWholeInputsOnElementWithAttrInputBrackets = findWholeInputsOnElementWithAttrInputBrackets;
|
|
42
|
-
/**
|
|
43
|
-
* Finds elements with explicit tag names that also contain the specified attribute. Returns the
|
|
44
|
-
* attribute start offset/end offset/start tag end offset/end tag start offset/attribute value based on the specified HTML.
|
|
45
|
-
*
|
|
46
|
-
* 查找具有显式标签名称的元素,该名称也包含指定的属性。根据指定的 HTML 返回属性起始偏移量/截止偏移量/元素起始标签的截止偏移量/元素截止标签的起始偏移量/属性值。
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
function findWholeAttributeOnElementWithTag(html, name, tagNames) {
|
|
50
|
-
return (0, schematics_1.findElementsWithAttribute)(html, name)
|
|
51
|
-
.filter(element => tagNames.includes(element.tagName))
|
|
52
|
-
.map(element => {
|
|
53
|
-
return {
|
|
54
|
-
start: (0, schematics_1.getStartOffsetOfAttribute)(element, name),
|
|
55
|
-
end: getEndOffsetOfAttribute(element, name),
|
|
56
|
-
startTagEnd: getStartTagEndOffsetOfElement(element),
|
|
57
|
-
endTagStart: getEndTagStartOffsetOfElement(element),
|
|
58
|
-
value: getAttributeValueOfElement(element, name)
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
exports.findWholeAttributeOnElementWithTag = findWholeAttributeOnElementWithTag;
|
|
63
|
-
/**
|
|
64
|
-
* Finds elements that contain the given attribute and contain at least one of the other
|
|
65
|
-
* specified attributes. Returns the primary attribute's start offset/end offset/start tag end offset/end tag start offset/attribute based on the specified HTML.
|
|
66
|
-
*
|
|
67
|
-
* 查找包含给定属性且包含至少一个其他指定属性的元素。根据指定的 HTML 返回主要属性的起始偏移量/截止偏移量/元素起始标签的截止偏移量/元素截止标签的起始偏移量/属性值。
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
function findWholeAttributeOnElementWithAttrs(html, name, attrs) {
|
|
71
|
-
return (0, schematics_1.findElementsWithAttribute)(html, name)
|
|
72
|
-
.filter(element => attrs.some(attr => hasElementAttribute(element, attr)))
|
|
73
|
-
.map(element => {
|
|
74
|
-
return {
|
|
75
|
-
start: (0, schematics_1.getStartOffsetOfAttribute)(element, name),
|
|
76
|
-
end: getEndOffsetOfAttribute(element, name),
|
|
77
|
-
startTagEnd: getStartTagEndOffsetOfElement(element),
|
|
78
|
-
endTagStart: getEndTagStartOffsetOfElement(element),
|
|
79
|
-
value: getAttributeValueOfElement(element, name)
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
exports.findWholeAttributeOnElementWithAttrs = findWholeAttributeOnElementWithAttrs;
|
|
84
|
-
/**
|
|
85
|
-
* Shorthand function that checks if the specified element contains the given attribute.
|
|
86
|
-
*
|
|
87
|
-
* 检查指定元素是否包含给定属性的简写函数。
|
|
88
|
-
*
|
|
89
|
-
*/
|
|
90
|
-
function hasElementAttribute(element, attributeName) {
|
|
91
|
-
return element.attrs && element.attrs.some(attr => attr.name === attributeName.toLowerCase());
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Gets the end offset of the given attribute from a Parse5 element.
|
|
95
|
-
*
|
|
96
|
-
* 从 Parse5 元素获取给定属性的截止偏移量。
|
|
97
|
-
*
|
|
98
|
-
*/
|
|
99
|
-
function getEndOffsetOfAttribute(element, attributeName) {
|
|
100
|
-
return element.sourceCodeLocation.attrs[attributeName.toLowerCase()].endOffset;
|
|
101
|
-
}
|
|
102
|
-
exports.getEndOffsetOfAttribute = getEndOffsetOfAttribute;
|
|
103
|
-
/**
|
|
104
|
-
* Finds the specified Angular @Output in the given elements with tag name.
|
|
105
|
-
*
|
|
106
|
-
* 在具有标签名称的给定元素中查找指定的 Angular @Output。
|
|
107
|
-
*
|
|
108
|
-
*/
|
|
109
|
-
function findWholeOutputsOnElementWithTag(html, outputName, tagNames) {
|
|
110
|
-
return findWholeAttributeOnElementWithTag(html, `(${outputName})`, tagNames);
|
|
111
|
-
}
|
|
112
|
-
exports.findWholeOutputsOnElementWithTag = findWholeOutputsOnElementWithTag;
|
|
113
|
-
/**
|
|
114
|
-
* Finds the specified Angular @Output in elements that have one of the specified attributes.
|
|
115
|
-
*
|
|
116
|
-
* 在具有指定属性之一的元素中查找指定的 Angular @Output。
|
|
117
|
-
*
|
|
118
|
-
*/
|
|
119
|
-
function findWholeOutputsOnElementWithAttr(html, outputName, attrs) {
|
|
120
|
-
return findWholeAttributeOnElementWithAttrs(html, `(${outputName})`, attrs);
|
|
121
|
-
}
|
|
122
|
-
exports.findWholeOutputsOnElementWithAttr = findWholeOutputsOnElementWithAttr;
|
|
123
|
-
/**
|
|
124
|
-
* Finds the specified Angular @Input name and value in the given elements with tag name.
|
|
125
|
-
*
|
|
126
|
-
* 在具有标签名称的给定元素中查找指定的 Angular @Input 名称和值。
|
|
127
|
-
*
|
|
128
|
-
*/
|
|
129
|
-
function findWholeInputsNameAndValueOnElementWithTag(html, inputName, inputValue, tagNames) {
|
|
130
|
-
return [
|
|
131
|
-
// Inputs can be also used without brackets (e.g. `<thy-tag thyColor="primary">Primary</thy-tag>`)
|
|
132
|
-
...findWholeAttributeNameAndValueOnElementWithTag(html, inputName, inputValue, tagNames),
|
|
133
|
-
...findWholeAttributeNameAndValueOnElementWithTag(html, `[${inputName}]`, inputValue, tagNames)
|
|
134
|
-
];
|
|
135
|
-
}
|
|
136
|
-
exports.findWholeInputsNameAndValueOnElementWithTag = findWholeInputsNameAndValueOnElementWithTag;
|
|
137
|
-
/**
|
|
138
|
-
* Finds the specified Angular @Input name and value in elements that have one of the specified attributes.
|
|
139
|
-
*
|
|
140
|
-
* 在具有指定属性之一的元素中查找指定的 Angular @Input 名称和值。
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
function findWholeInputsNameAndValueOnElementWithAttr(html, inputName, inputValue, attrs) {
|
|
144
|
-
return [
|
|
145
|
-
// Inputs can be also used without brackets (e.g. `<label thyTag>Tag 2</label>`)
|
|
146
|
-
...findWholeAttributeNameAndValueOnElementWithAttrs(html, inputName, inputValue, attrs),
|
|
147
|
-
...findWholeAttributeNameAndValueOnElementWithAttrs(html, `[${inputName}]`, inputValue, attrs)
|
|
148
|
-
];
|
|
149
|
-
}
|
|
150
|
-
exports.findWholeInputsNameAndValueOnElementWithAttr = findWholeInputsNameAndValueOnElementWithAttr;
|
|
151
|
-
/**
|
|
152
|
-
* Finds elements with explicit tag names that also contain the specified attribute name and value. Returns the
|
|
153
|
-
* attribute start offset and end offset based on the specified HTML.
|
|
154
|
-
*
|
|
155
|
-
* 查找具有显式标签名称的元素,该名称也包含指定的属性,且属性值一致。根据指定的 HTML 返回属性起始偏移量和截止偏移量。
|
|
156
|
-
*
|
|
157
|
-
*/
|
|
158
|
-
function findWholeAttributeNameAndValueOnElementWithTag(html, name, value, tagNames) {
|
|
159
|
-
return findElementsWithAttributeNameAndValue(html, name, value)
|
|
160
|
-
.filter(element => tagNames.includes(element.tagName))
|
|
161
|
-
.map(element => {
|
|
162
|
-
return { start: (0, schematics_1.getStartOffsetOfAttribute)(element, name), end: getEndOffsetOfAttribute(element, name) };
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
exports.findWholeAttributeNameAndValueOnElementWithTag = findWholeAttributeNameAndValueOnElementWithTag;
|
|
166
|
-
/**
|
|
167
|
-
* Finds elements that contain the given attribute(name and value) and contain at least one of the other
|
|
168
|
-
* specified attributes. Returns the primary attribute's start offset and end offset based on the specified HTML.
|
|
169
|
-
*
|
|
170
|
-
* 查找包含给定属性(名称和值)且包含至少一个其他指定属性的元素。根据指定的 HTML 返回主要属性的起始偏移量和截止偏移量。
|
|
171
|
-
*
|
|
172
|
-
*/
|
|
173
|
-
function findWholeAttributeNameAndValueOnElementWithAttrs(html, name, value, attrs) {
|
|
174
|
-
return findElementsWithAttributeNameAndValue(html, name, value)
|
|
175
|
-
.filter(element => attrs.some(attr => hasElementAttribute(element, attr)))
|
|
176
|
-
.map(element => {
|
|
177
|
-
return { start: (0, schematics_1.getStartOffsetOfAttribute)(element, name), end: getEndOffsetOfAttribute(element, name) };
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
exports.findWholeAttributeNameAndValueOnElementWithAttrs = findWholeAttributeNameAndValueOnElementWithAttrs;
|
|
181
|
-
/**
|
|
182
|
-
* Parses a HTML fragment and traverses all AST nodes in order find elements that
|
|
183
|
-
* include the specified attribute name and value.
|
|
184
|
-
*
|
|
185
|
-
* 解析 HTML 片段并遍历所有 AST 节点,以查找包含指定属性且属性值一致的元素。
|
|
186
|
-
*
|
|
187
|
-
*/
|
|
188
|
-
function findElementsWithAttributeNameAndValue(html, attributeName, attributeValue) {
|
|
189
|
-
const document = (0, parse5_1.parseFragment)(html, { sourceCodeLocationInfo: true });
|
|
190
|
-
const elements = [];
|
|
191
|
-
const visitNodes = (nodes) => {
|
|
192
|
-
nodes.forEach(n => {
|
|
193
|
-
var _a;
|
|
194
|
-
const node = n;
|
|
195
|
-
if (node.childNodes) {
|
|
196
|
-
visitNodes(node.childNodes);
|
|
197
|
-
}
|
|
198
|
-
if ((_a = node.attrs) === null || _a === void 0 ? void 0 : _a.some(attr => attr.name === attributeName.toLowerCase() && attr.value === attributeValue.toLowerCase())) {
|
|
199
|
-
elements.push(node);
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
visitNodes(document.childNodes);
|
|
204
|
-
return elements;
|
|
205
|
-
}
|
|
206
|
-
exports.findElementsWithAttributeNameAndValue = findElementsWithAttributeNameAndValue;
|
|
207
|
-
/**
|
|
208
|
-
* Gets the end offset of the Parse5 element start tag.
|
|
209
|
-
*
|
|
210
|
-
* 获取 Parse5 元素起始标签的截止偏移量。
|
|
211
|
-
*
|
|
212
|
-
*/
|
|
213
|
-
function getStartTagEndOffsetOfElement(element) {
|
|
214
|
-
return element.sourceCodeLocation.startTag.endOffset;
|
|
215
|
-
}
|
|
216
|
-
exports.getStartTagEndOffsetOfElement = getStartTagEndOffsetOfElement;
|
|
217
|
-
/**
|
|
218
|
-
* Gets the end offset of the Parse5 element end tag.
|
|
219
|
-
*
|
|
220
|
-
* 获取 Parse5 元素截止标签的起始偏移量。
|
|
221
|
-
*
|
|
222
|
-
*/
|
|
223
|
-
function getEndTagStartOffsetOfElement(element) {
|
|
224
|
-
return element.sourceCodeLocation.endTag.startOffset;
|
|
225
|
-
}
|
|
226
|
-
exports.getEndTagStartOffsetOfElement = getEndTagStartOffsetOfElement;
|
|
227
|
-
/**
|
|
228
|
-
* Gets the value of the given attribute from a Parse5 element.
|
|
229
|
-
*
|
|
230
|
-
*从 Parse5 元素获取给定属性的值。
|
|
231
|
-
*
|
|
232
|
-
*/
|
|
233
|
-
function getAttributeValueOfElement(element, attributeName) {
|
|
234
|
-
var _a;
|
|
235
|
-
return element.attrs && ((_a = element.attrs.find(attr => attr.name === attributeName.toLowerCase())) === null || _a === void 0 ? void 0 : _a.value);
|
|
236
|
-
}
|
|
237
|
-
exports.getAttributeValueOfElement = getAttributeValueOfElement;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNgxTethysExportDeclaration = exports.isNgxTethysImportDeclaration = exports.ngxTethysModuleSpecifier = void 0;
|
|
4
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
|
-
exports.ngxTethysModuleSpecifier = 'ngx-tethys';
|
|
6
|
-
function isNgxTethysImportDeclaration(node) {
|
|
7
|
-
return isNgxTethysDeclaration((0, schematics_1.getImportDeclaration)(node));
|
|
8
|
-
}
|
|
9
|
-
exports.isNgxTethysImportDeclaration = isNgxTethysImportDeclaration;
|
|
10
|
-
function isNgxTethysExportDeclaration(node) {
|
|
11
|
-
return isNgxTethysDeclaration((0, schematics_1.getExportDeclaration)(node));
|
|
12
|
-
}
|
|
13
|
-
exports.isNgxTethysExportDeclaration = isNgxTethysExportDeclaration;
|
|
14
|
-
function isNgxTethysDeclaration(declaration) {
|
|
15
|
-
if (!declaration.moduleSpecifier) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
const moduleSpecifier = declaration.moduleSpecifier.getText();
|
|
19
|
-
return moduleSpecifier.indexOf(exports.ngxTethysModuleSpecifier) !== -1;
|
|
20
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Migration, UpgradeData, ValueOfChanges, VersionChanges } from '@angular/cdk/schematics';
|
|
2
|
-
import { AfterInsertElementUpgradeData, InputNameRemovalUpgradeData, InputValueUpgradeData } from '../data';
|
|
3
|
-
import { BeforeInsertElementUpgradeData } from '../data/before-insert-element';
|
|
4
|
-
import { EntryPointUpgradeData } from '../data/entry-points';
|
|
5
|
-
import { OutputNameRemovalUpgradeData } from '../data/output-names-removal';
|
|
6
|
-
export interface TethysUpgradeData extends UpgradeData {
|
|
7
|
-
inputNamesRemoval: VersionChanges<InputNameRemovalUpgradeData>;
|
|
8
|
-
outputNamesRemoval: VersionChanges<OutputNameRemovalUpgradeData>;
|
|
9
|
-
inputValues: VersionChanges<InputValueUpgradeData>;
|
|
10
|
-
beforeInsertElement: VersionChanges<BeforeInsertElementUpgradeData>;
|
|
11
|
-
afterInsertElement: VersionChanges<AfterInsertElementUpgradeData>;
|
|
12
|
-
entryPoints: VersionChanges<EntryPointUpgradeData>;
|
|
13
|
-
}
|
|
14
|
-
export declare function getTethysVersionUpgradeData<T extends keyof TethysUpgradeData, U = ValueOfChanges<TethysUpgradeData[T]>>(migration: Migration<TethysUpgradeData>, dataName: T): U[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTethysVersionUpgradeData = void 0;
|
|
4
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
|
-
function getTethysVersionUpgradeData(migration, dataName) {
|
|
6
|
-
if (migration.targetVersion === null) {
|
|
7
|
-
return [];
|
|
8
|
-
}
|
|
9
|
-
// Note that below we need to cast to `unknown` first TS doesn't infer the type of T correctly.
|
|
10
|
-
return (0, schematics_1.getChangesForTarget)(migration.targetVersion, migration.upgradeData[dataName]);
|
|
11
|
-
}
|
|
12
|
-
exports.getTethysVersionUpgradeData = getTethysVersionUpgradeData;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { VersionChanges } from '@angular/cdk/schematics';
|
|
2
|
-
export interface AfterInsertElementUpgradeData {
|
|
3
|
-
/**
|
|
4
|
-
* The @Input() name to insert. When this attribute is encountered, an element will be inserted before the last child node in the current element, and the attribute will be removed from the current element and placed on the inserted element.
|
|
5
|
-
*
|
|
6
|
-
* 要替换的 @Input() 名称,遇到这个属性,会在当前元素内,最后一个子节点后插入元素,并把该属性从当前元素移除,放入到插入的元素上。
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
replace: string;
|
|
10
|
-
/**
|
|
11
|
-
* The new element to insert.
|
|
12
|
-
*
|
|
13
|
-
* 要插入的元素。
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
insert: string;
|
|
17
|
-
/**
|
|
18
|
-
* Controls which elements and attributes in which this insert is made.
|
|
19
|
-
*
|
|
20
|
-
* 控制要替换的元素和属性。
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
limitedTo: {
|
|
24
|
-
/**
|
|
25
|
-
* Limit to elements with any of these element tags.
|
|
26
|
-
*
|
|
27
|
-
* 限制为任何具有这些元素标签的元素。
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
elements?: string[];
|
|
31
|
-
/**
|
|
32
|
-
* Limit to elements with any of these attributes.
|
|
33
|
-
*
|
|
34
|
-
* 限制为任何带有这些属性的元素。
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
attributes?: string[];
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export declare const afterInsertElement: VersionChanges<AfterInsertElementUpgradeData>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.afterInsertElement = void 0;
|
|
4
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
|
-
exports.afterInsertElement = {
|
|
6
|
-
[schematics_1.TargetVersion.V17]: [
|
|
7
|
-
{
|
|
8
|
-
pr: '',
|
|
9
|
-
changes: [
|
|
10
|
-
{
|
|
11
|
-
replace: 'thyAfterIcon',
|
|
12
|
-
insert: '<thy-icon thyIconName=thyAfterIcon class="ml-1"></thy-icon>',
|
|
13
|
-
limitedTo: {
|
|
14
|
-
attributes: ['thyLabel', '[thyLabel]']
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
replace: '[thyAfterIcon]',
|
|
19
|
-
insert: '<thy-icon [thyIconName]=[thyAfterIcon] class="ml-1"></thy-icon>',
|
|
20
|
-
limitedTo: {
|
|
21
|
-
attributes: ['thyLabel', '[thyLabel]']
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.attributeSelectors = void 0;
|
|
4
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
|
-
exports.attributeSelectors = {
|
|
6
|
-
[schematics_1.TargetVersion.V17]: [
|
|
7
|
-
{
|
|
8
|
-
pr: '',
|
|
9
|
-
changes: [
|
|
10
|
-
{
|
|
11
|
-
replace: '[thyLabel]',
|
|
12
|
-
replaceWith: '[thyTag]'
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
replace: 'thyLabel ',
|
|
16
|
-
replaceWith: 'thyTag '
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
replace: 'thyLabel\n',
|
|
20
|
-
replaceWith: 'thyTag\n'
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
replace: 'thyLabel>',
|
|
24
|
-
replaceWith: 'thyTag>'
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
replace: 'thyActionMenuDividerTitle',
|
|
28
|
-
replaceWith: ''
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
replace: '[thyActionMenuDividerTitle]',
|
|
32
|
-
replaceWith: ''
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
replace: 'thyActionMenuSubItem',
|
|
36
|
-
replaceWith: 'thyDropdownSubmenu '
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
replace: 'thyActionMenuSubItem=',
|
|
40
|
-
replaceWith: 'thyDropdownSubmenu thyDirection='
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
replace: '[thyActionMenuSubItem]=',
|
|
44
|
-
replaceWith: 'thyDropdownSubmenu [thyDirection]='
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
replace: 'thyActionMenuItem',
|
|
48
|
-
replaceWith: 'thyDropdownMenuItem'
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { VersionChanges } from '@angular/cdk/schematics';
|
|
2
|
-
export interface BeforeInsertElementUpgradeData {
|
|
3
|
-
/**
|
|
4
|
-
* The @Input() name to replace. When this attribute is encountered, an element will be inserted before the first child node in the current element, and the attribute will be removed from the current element and placed on the inserted element.
|
|
5
|
-
*
|
|
6
|
-
* 要替换的 @Input() 名称,遇到这个属性,会在当前元素内,第一个子节点前插入元素,并把该属性从当前元素移除,放入到插入的元素上。
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
replace: string;
|
|
10
|
-
/**
|
|
11
|
-
* The new element to insert.
|
|
12
|
-
*
|
|
13
|
-
* 要插入的元素。
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
insert: string;
|
|
17
|
-
/**
|
|
18
|
-
* Controls which elements and attributes in which this insert is made.
|
|
19
|
-
*
|
|
20
|
-
* 控制要插入的元素和属性。
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
limitedTo: {
|
|
24
|
-
/**
|
|
25
|
-
* Limit to elements with any of these element tags.
|
|
26
|
-
*
|
|
27
|
-
* 限制为任何具有这些元素标签的元素。
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
elements?: string[];
|
|
31
|
-
/**
|
|
32
|
-
* Limit to elements with any of these attributes.
|
|
33
|
-
*
|
|
34
|
-
* 限制为任何带有这些属性的元素。
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
attributes?: string[];
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export declare const beforeInsertElement: VersionChanges<BeforeInsertElementUpgradeData>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.beforeInsertElement = void 0;
|
|
4
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
|
-
exports.beforeInsertElement = {
|
|
6
|
-
[schematics_1.TargetVersion.V17]: [
|
|
7
|
-
{
|
|
8
|
-
pr: '',
|
|
9
|
-
changes: [
|
|
10
|
-
{
|
|
11
|
-
replace: 'thyBeforeIcon',
|
|
12
|
-
insert: '<thy-icon thyIconName=thyBeforeIcon></thy-icon>',
|
|
13
|
-
limitedTo: {
|
|
14
|
-
attributes: ['thyLabel', '[thyLabel]']
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
replace: '[thyBeforeIcon]',
|
|
19
|
-
insert: '<thy-icon [thyIconName]=[thyBeforeIcon]></thy-icon>',
|
|
20
|
-
limitedTo: {
|
|
21
|
-
attributes: ['thyLabel', '[thyLabel]']
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
};
|