@testid/antd-testid-runtime 1.0.5 → 1.0.7
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/dist/index.js +20 -11
- package/dist/index.mjs +20 -11
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -184,21 +184,30 @@ function buildPopupTestId(type, tag, counterId) {
|
|
|
184
184
|
|
|
185
185
|
// src/utils/testIdObserver.ts
|
|
186
186
|
var POPUP_CLASS_SUFFIX_MAP = {
|
|
187
|
-
modal: ["-modal"],
|
|
188
|
-
drawer: ["-drawer"],
|
|
189
|
-
select: ["-select-dropdown"],
|
|
190
|
-
datePicker: [
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
187
|
+
modal: [["-modal"]],
|
|
188
|
+
drawer: [["-drawer"]],
|
|
189
|
+
select: [["-select-dropdown"]],
|
|
190
|
+
datePicker: [
|
|
191
|
+
["-picker-dropdown"],
|
|
192
|
+
// Ant Design Vue 4.x (新)
|
|
193
|
+
["-calendar-picker-container"]
|
|
194
|
+
// Ant Design Vue 1.x (旧)
|
|
195
|
+
],
|
|
196
|
+
popconfirm: [["-popover", "-popconfirm"]],
|
|
197
|
+
dropdown: [["-dropdown"]],
|
|
198
|
+
tooltip: [["-tooltip"]]
|
|
194
199
|
};
|
|
195
200
|
function buildPopupClassMap(prefixes) {
|
|
196
201
|
const result = {};
|
|
197
202
|
const entries = Object.entries(POPUP_CLASS_SUFFIX_MAP);
|
|
198
|
-
for (const [type,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
for (const [type, suffixGroups] of entries) {
|
|
204
|
+
const selectorSets = [];
|
|
205
|
+
for (const suffixGroup of suffixGroups) {
|
|
206
|
+
for (const prefix of prefixes) {
|
|
207
|
+
selectorSets.push(suffixGroup.map((suffix) => `${prefix}${suffix}`));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
result[type] = selectorSets;
|
|
202
211
|
}
|
|
203
212
|
return result;
|
|
204
213
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -142,21 +142,30 @@ function buildPopupTestId(type, tag, counterId) {
|
|
|
142
142
|
|
|
143
143
|
// src/utils/testIdObserver.ts
|
|
144
144
|
var POPUP_CLASS_SUFFIX_MAP = {
|
|
145
|
-
modal: ["-modal"],
|
|
146
|
-
drawer: ["-drawer"],
|
|
147
|
-
select: ["-select-dropdown"],
|
|
148
|
-
datePicker: [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
145
|
+
modal: [["-modal"]],
|
|
146
|
+
drawer: [["-drawer"]],
|
|
147
|
+
select: [["-select-dropdown"]],
|
|
148
|
+
datePicker: [
|
|
149
|
+
["-picker-dropdown"],
|
|
150
|
+
// Ant Design Vue 4.x (新)
|
|
151
|
+
["-calendar-picker-container"]
|
|
152
|
+
// Ant Design Vue 1.x (旧)
|
|
153
|
+
],
|
|
154
|
+
popconfirm: [["-popover", "-popconfirm"]],
|
|
155
|
+
dropdown: [["-dropdown"]],
|
|
156
|
+
tooltip: [["-tooltip"]]
|
|
152
157
|
};
|
|
153
158
|
function buildPopupClassMap(prefixes) {
|
|
154
159
|
const result = {};
|
|
155
160
|
const entries = Object.entries(POPUP_CLASS_SUFFIX_MAP);
|
|
156
|
-
for (const [type,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
for (const [type, suffixGroups] of entries) {
|
|
162
|
+
const selectorSets = [];
|
|
163
|
+
for (const suffixGroup of suffixGroups) {
|
|
164
|
+
for (const prefix of prefixes) {
|
|
165
|
+
selectorSets.push(suffixGroup.map((suffix) => `${prefix}${suffix}`));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
result[type] = selectorSets;
|
|
160
169
|
}
|
|
161
170
|
return result;
|
|
162
171
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testid/antd-testid-runtime",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "运行时兜底打标模块 — MutationObserver + 锚点计数器 + 浮层计数器 + ID 重复检测",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/testid/testid-plugins.git",
|
|
21
|
+
"directory": "packages/antd-testid-runtime"
|
|
22
|
+
},
|
|
18
23
|
"scripts": {
|
|
19
24
|
"build": "tsup src/index.ts --dts --format esm,cjs --clean",
|
|
20
25
|
"dev": "tsup src/index.ts --dts --format esm,cjs --watch"
|