@testid/antd-testid-runtime 1.0.16 → 1.0.17

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.d.mts CHANGED
@@ -10,7 +10,7 @@
10
10
  /**
11
11
  * 支持的浮层类型
12
12
  */
13
- type PopupType = 'modal' | 'drawer' | 'select' | 'datePicker' | 'popconfirm' | 'popover' | 'dropdown' | 'tooltip' | 'message';
13
+ type PopupType = 'modal' | 'drawer' | 'select' | 'datePicker' | 'popconfirm' | 'popover' | 'dropdown' | 'tooltip' | 'message' | 'submenu';
14
14
  /**
15
15
  * UI 库适配器接口
16
16
  *
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  /**
11
11
  * 支持的浮层类型
12
12
  */
13
- type PopupType = 'modal' | 'drawer' | 'select' | 'datePicker' | 'popconfirm' | 'popover' | 'dropdown' | 'tooltip' | 'message';
13
+ type PopupType = 'modal' | 'drawer' | 'select' | 'datePicker' | 'popconfirm' | 'popover' | 'dropdown' | 'tooltip' | 'message' | 'submenu';
14
14
  /**
15
15
  * UI 库适配器接口
16
16
  *
package/dist/index.js CHANGED
@@ -73,7 +73,8 @@ var popupClassSuffixMap = {
73
73
  popover: [["-popover"]],
74
74
  dropdown: [["-dropdown"]],
75
75
  tooltip: [["-tooltip"]],
76
- message: [["-message"]]
76
+ message: [["-message"]],
77
+ submenu: [["-menu-submenu-popup"]]
77
78
  };
78
79
  var antdAdapter = {
79
80
  name: "ant-design-vue",
@@ -119,7 +120,8 @@ var defaultConfig = {
119
120
  popover: "popover_",
120
121
  dropdown: "dropdown_",
121
122
  tooltip: "tooltip_",
122
- message: "message_"
123
+ message: "message_",
124
+ submenu: "submenu_"
123
125
  },
124
126
  ignoreTags: ["script", "style", "svg", "br", "iframe"],
125
127
  ignoreClass: ["no-test-mark", "hidden"],
@@ -187,7 +189,8 @@ var popupClassSuffixMap2 = {
187
189
  popover: [["-popover"]],
188
190
  dropdown: [["-dropdown-menu"]],
189
191
  tooltip: [["-tooltip__popper"]],
190
- message: [["-message"]]
192
+ message: [["-message"]],
193
+ submenu: []
191
194
  };
192
195
  var elementAdapter = {
193
196
  name: "element-ui",
@@ -260,7 +263,8 @@ var popupCounters = {
260
263
  popover: 0,
261
264
  dropdown: 0,
262
265
  tooltip: 0,
263
- message: 0
266
+ message: 0,
267
+ submenu: 0
264
268
  };
265
269
  function getNextPopupId(type) {
266
270
  const key = type in popupCounters ? type : "modal";
@@ -688,7 +692,7 @@ var TestIdObserver = class {
688
692
  if (node.hasAttribute("tabindex")) return true;
689
693
  const classStr = node.className;
690
694
  if (typeof classStr === "string") {
691
- if (/\bant-(?:menu-item|dropdown-menu-item|select-item|tabs-tab|picker-cell|breadcrumb-link)\b/.test(classStr)) {
695
+ if (/\bant-(?:menu-item|menu-submenu|dropdown-menu-item|select-item|tabs-tab|picker-cell|breadcrumb-link)\b/.test(classStr)) {
692
696
  return true;
693
697
  }
694
698
  if (/\bel-(?:menu-item|dropdown-menu__item|select-dropdown__item|tabs__item)\b/.test(classStr)) {
@@ -726,7 +730,8 @@ var GROUP_LABELS = {
726
730
  popover: "[Popover \u6D6E\u5C42]",
727
731
  dropdown: "[Dropdown \u6D6E\u5C42]",
728
732
  tooltip: "[Tooltip \u6D6E\u5C42]",
729
- message: "[Message \u6D6E\u5C42]"
733
+ message: "[Message \u6D6E\u5C42]",
734
+ submenu: "[SubMenu \u6D6E\u5C42]"
730
735
  };
731
736
  var GROUP_SUGGESTIONS = {
732
737
  custom: "\u4E1A\u52A1\u4EE3\u7801\u4E2D\u5B58\u5728\u624B\u5199\u56FA\u5B9A\u91CD\u590D data-testid\uFF0C\u8BF7\u68C0\u67E5\u76F8\u5173\u6A21\u677F\u4EE3\u7801",
@@ -740,7 +745,8 @@ var GROUP_SUGGESTIONS = {
740
745
  popover: "Popover \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548",
741
746
  dropdown: "Dropdown \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548",
742
747
  tooltip: "Tooltip \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548",
743
- message: "Message \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548"
748
+ message: "Message \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548",
749
+ submenu: "SubMenu \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548"
744
750
  };
745
751
  var TestIdChecker = class {
746
752
  /**
@@ -839,7 +845,8 @@ var TestIdChecker = class {
839
845
  "popover",
840
846
  "dropdown",
841
847
  "tooltip",
842
- "message"
848
+ "message",
849
+ "submenu"
843
850
  ];
844
851
  for (const type of popupTypes) {
845
852
  if (prefix === `${type}_`) return type;
package/dist/index.mjs CHANGED
@@ -33,7 +33,8 @@ var popupClassSuffixMap = {
33
33
  popover: [["-popover"]],
34
34
  dropdown: [["-dropdown"]],
35
35
  tooltip: [["-tooltip"]],
36
- message: [["-message"]]
36
+ message: [["-message"]],
37
+ submenu: [["-menu-submenu-popup"]]
37
38
  };
38
39
  var antdAdapter = {
39
40
  name: "ant-design-vue",
@@ -79,7 +80,8 @@ var defaultConfig = {
79
80
  popover: "popover_",
80
81
  dropdown: "dropdown_",
81
82
  tooltip: "tooltip_",
82
- message: "message_"
83
+ message: "message_",
84
+ submenu: "submenu_"
83
85
  },
84
86
  ignoreTags: ["script", "style", "svg", "br", "iframe"],
85
87
  ignoreClass: ["no-test-mark", "hidden"],
@@ -147,7 +149,8 @@ var popupClassSuffixMap2 = {
147
149
  popover: [["-popover"]],
148
150
  dropdown: [["-dropdown-menu"]],
149
151
  tooltip: [["-tooltip__popper"]],
150
- message: [["-message"]]
152
+ message: [["-message"]],
153
+ submenu: []
151
154
  };
152
155
  var elementAdapter = {
153
156
  name: "element-ui",
@@ -220,7 +223,8 @@ var popupCounters = {
220
223
  popover: 0,
221
224
  dropdown: 0,
222
225
  tooltip: 0,
223
- message: 0
226
+ message: 0,
227
+ submenu: 0
224
228
  };
225
229
  function getNextPopupId(type) {
226
230
  const key = type in popupCounters ? type : "modal";
@@ -648,7 +652,7 @@ var TestIdObserver = class {
648
652
  if (node.hasAttribute("tabindex")) return true;
649
653
  const classStr = node.className;
650
654
  if (typeof classStr === "string") {
651
- if (/\bant-(?:menu-item|dropdown-menu-item|select-item|tabs-tab|picker-cell|breadcrumb-link)\b/.test(classStr)) {
655
+ if (/\bant-(?:menu-item|menu-submenu|dropdown-menu-item|select-item|tabs-tab|picker-cell|breadcrumb-link)\b/.test(classStr)) {
652
656
  return true;
653
657
  }
654
658
  if (/\bel-(?:menu-item|dropdown-menu__item|select-dropdown__item|tabs__item)\b/.test(classStr)) {
@@ -686,7 +690,8 @@ var GROUP_LABELS = {
686
690
  popover: "[Popover \u6D6E\u5C42]",
687
691
  dropdown: "[Dropdown \u6D6E\u5C42]",
688
692
  tooltip: "[Tooltip \u6D6E\u5C42]",
689
- message: "[Message \u6D6E\u5C42]"
693
+ message: "[Message \u6D6E\u5C42]",
694
+ submenu: "[SubMenu \u6D6E\u5C42]"
690
695
  };
691
696
  var GROUP_SUGGESTIONS = {
692
697
  custom: "\u4E1A\u52A1\u4EE3\u7801\u4E2D\u5B58\u5728\u624B\u5199\u56FA\u5B9A\u91CD\u590D data-testid\uFF0C\u8BF7\u68C0\u67E5\u76F8\u5173\u6A21\u677F\u4EE3\u7801",
@@ -700,7 +705,8 @@ var GROUP_SUGGESTIONS = {
700
705
  popover: "Popover \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548",
701
706
  dropdown: "Dropdown \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548",
702
707
  tooltip: "Tooltip \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548",
703
- message: "Message \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548"
708
+ message: "Message \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548",
709
+ submenu: "SubMenu \u72EC\u7ACB\u8BA1\u6570\u5668\u81EA\u589E\u903B\u8F91\u5931\u6548"
704
710
  };
705
711
  var TestIdChecker = class {
706
712
  /**
@@ -799,7 +805,8 @@ var TestIdChecker = class {
799
805
  "popover",
800
806
  "dropdown",
801
807
  "tooltip",
802
- "message"
808
+ "message",
809
+ "submenu"
803
810
  ];
804
811
  for (const type of popupTypes) {
805
812
  if (prefix === `${type}_`) return type;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testid/antd-testid-runtime",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "运行时兜底打标模块 — MutationObserver + 锚点计数器 + 浮层计数器 + ID 重复检测",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",