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