antdv-next 1.6.0 → 1.7.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.
Files changed (240) hide show
  1. package/dist/_util/ContextIsolator.js +12 -3
  2. package/dist/_util/hooks/useAllowClear.d.ts +22 -6
  3. package/dist/_util/hooks/useAllowClear.js +24 -6
  4. package/dist/_util/hooks/useClosable.js +1 -1
  5. package/dist/_util/statusUtils.d.ts +1 -1
  6. package/dist/_util/tools.d.ts +3 -1
  7. package/dist/_util/tools.js +6 -1
  8. package/dist/_util/vueNode.d.ts +6 -2
  9. package/dist/alert/Alert.js +4 -1
  10. package/dist/alert/style/index.d.ts +3 -3
  11. package/dist/alert/style/index.js +3 -3
  12. package/dist/antd-with-locales.esm.js +16773 -15780
  13. package/dist/antd-with-locales.js +78 -78
  14. package/dist/antd.css +1 -1
  15. package/dist/antd.esm.js +14353 -14003
  16. package/dist/antd.js +80 -80
  17. package/dist/auto-complete/index.js +1 -0
  18. package/dist/avatar/Avatar.js +2 -4
  19. package/dist/avatar/AvatarContext.d.ts +2 -2
  20. package/dist/border-beam/BorderBeam.d.ts +8 -1
  21. package/dist/border-beam/BorderBeam.js +28 -14
  22. package/dist/border-beam/index.d.ts +2 -2
  23. package/dist/breadcrumb/BreadcrumbItem.js +1 -1
  24. package/dist/card/style/index.js +2 -2
  25. package/dist/cascader/Panel.js +3 -3
  26. package/dist/cascader/index.js +12 -5
  27. package/dist/checkbox/Checkbox.js +6 -4
  28. package/dist/checkbox/Group.d.ts +19 -1
  29. package/dist/checkbox/Group.js +34 -5
  30. package/dist/checkbox/GroupContext.d.ts +3 -0
  31. package/dist/checkbox/index.d.ts +2 -2
  32. package/dist/color-picker/ColorPicker.js +1 -1
  33. package/dist/color-picker/style/input.js +1 -1
  34. package/dist/components.d.ts +1 -1
  35. package/dist/date-picker/generatePicker/generateRangePicker.js +20 -2
  36. package/dist/date-picker/generatePicker/generateSinglePicker.js +20 -2
  37. package/dist/date-picker/generatePicker/interface.d.ts +4 -0
  38. package/dist/date-picker/style/panel.js +1 -1
  39. package/dist/date-picker/style/util.js +1 -1
  40. package/dist/date-picker/util.d.ts +2 -0
  41. package/dist/descriptions/hooks/useItems.d.ts +6 -6
  42. package/dist/descriptions/style/index.js +11 -13
  43. package/dist/divider/style/index.js +1 -1
  44. package/dist/drawer/DrawerPanel.js +1 -1
  45. package/dist/dropdown/dropdown.d.ts +2 -0
  46. package/dist/dropdown/dropdown.js +9 -2
  47. package/dist/dropdown/style/index.js +1 -1
  48. package/dist/form/ErrorList.js +1 -1
  49. package/dist/form/Form.js +1 -1
  50. package/dist/form/FormItem/ItemHolder.js +1 -1
  51. package/dist/form/FormItem/index.js +2 -2
  52. package/dist/form/FormItemInput.js +1 -1
  53. package/dist/form/FormItemLabel.js +1 -1
  54. package/dist/form/hooks/useVariant.js +1 -1
  55. package/dist/image/hooks/useMergedPreviewConfig.d.ts +1 -0
  56. package/dist/image/hooks/useMergedPreviewConfig.js +2 -1
  57. package/dist/index.d.ts +1 -1
  58. package/dist/input/Group.js +1 -1
  59. package/dist/input/Input.d.ts +2 -1
  60. package/dist/input/Input.js +8 -5
  61. package/dist/input/OTP/OTPInput.d.ts +2 -1
  62. package/dist/input/OTP/OTPInput.js +12 -3
  63. package/dist/input/OTP/index.d.ts +3 -1
  64. package/dist/input/OTP/index.js +15 -6
  65. package/dist/input/Password.js +7 -5
  66. package/dist/input/Search.js +4 -2
  67. package/dist/input/TextArea.d.ts +3 -1
  68. package/dist/input/TextArea.js +13 -8
  69. package/dist/input/style/index.js +1 -1
  70. package/dist/input-number/index.d.ts +3 -6
  71. package/dist/input-number/index.js +8 -3
  72. package/dist/input-number/style/index.js +1 -5
  73. package/dist/listy/index.d.ts +1 -1
  74. package/dist/listy/index.js +9 -7
  75. package/dist/listy/interface.d.ts +6 -1
  76. package/dist/listy/style/index.js +4 -2
  77. package/dist/locale/ar_EG.js +9 -0
  78. package/dist/locale/az_AZ.js +9 -0
  79. package/dist/locale/bg_BG.js +9 -0
  80. package/dist/locale/bn_BD.js +9 -0
  81. package/dist/locale/by_BY.js +9 -0
  82. package/dist/locale/ca_ES.js +9 -0
  83. package/dist/locale/cs_CZ.js +9 -0
  84. package/dist/locale/da_DK.js +9 -0
  85. package/dist/locale/de_DE.js +9 -0
  86. package/dist/locale/el_GR.js +9 -0
  87. package/dist/locale/en_GB.js +11 -1
  88. package/dist/locale/en_US.js +11 -1
  89. package/dist/locale/es_ES.js +9 -0
  90. package/dist/locale/et_EE.js +9 -0
  91. package/dist/locale/eu_ES.js +9 -0
  92. package/dist/locale/fa_IR.js +9 -0
  93. package/dist/locale/fi_FI.js +10 -1
  94. package/dist/locale/fr_BE.js +9 -0
  95. package/dist/locale/fr_CA.js +9 -0
  96. package/dist/locale/fr_FR.js +9 -0
  97. package/dist/locale/ga_IE.js +9 -0
  98. package/dist/locale/gl_ES.js +9 -0
  99. package/dist/locale/he_IL.js +9 -0
  100. package/dist/locale/hi_IN.js +9 -0
  101. package/dist/locale/hr_HR.js +9 -0
  102. package/dist/locale/hu_HU.js +9 -0
  103. package/dist/locale/hy_AM.js +9 -0
  104. package/dist/locale/id_ID.js +9 -0
  105. package/dist/locale/index.d.ts +3 -0
  106. package/dist/locale/is_IS.js +9 -0
  107. package/dist/locale/it_IT.js +9 -0
  108. package/dist/locale/ja_JP.js +9 -0
  109. package/dist/locale/ka_GE.js +9 -0
  110. package/dist/locale/kk_KZ.js +9 -0
  111. package/dist/locale/km_KH.js +9 -0
  112. package/dist/locale/kmr_IQ.js +9 -0
  113. package/dist/locale/kn_IN.js +9 -0
  114. package/dist/locale/ko_KR.js +9 -0
  115. package/dist/locale/ku_IQ.js +9 -0
  116. package/dist/locale/lt_LT.js +9 -0
  117. package/dist/locale/lv_LV.js +9 -0
  118. package/dist/locale/mk_MK.js +9 -0
  119. package/dist/locale/ml_IN.js +9 -0
  120. package/dist/locale/mn_MN.js +9 -0
  121. package/dist/locale/mr_IN.js +9 -0
  122. package/dist/locale/ms_MY.js +9 -0
  123. package/dist/locale/my_MM.js +9 -0
  124. package/dist/locale/nb_NO.js +9 -0
  125. package/dist/locale/ne_NP.js +9 -0
  126. package/dist/locale/nl_BE.js +9 -0
  127. package/dist/locale/nl_NL.js +9 -0
  128. package/dist/locale/pl_PL.js +9 -0
  129. package/dist/locale/pt_BR.js +9 -0
  130. package/dist/locale/pt_PT.js +9 -0
  131. package/dist/locale/ro_RO.js +19 -10
  132. package/dist/locale/ru_RU.js +9 -0
  133. package/dist/locale/si_LK.js +9 -0
  134. package/dist/locale/sk_SK.js +9 -0
  135. package/dist/locale/sl_SI.js +9 -0
  136. package/dist/locale/sq_AL.js +9 -0
  137. package/dist/locale/sr_RS.js +9 -0
  138. package/dist/locale/sv_SE.js +9 -0
  139. package/dist/locale/ta_IN.js +10 -1
  140. package/dist/locale/th_TH.js +9 -0
  141. package/dist/locale/tk_TK.js +9 -0
  142. package/dist/locale/tr_TR.js +9 -0
  143. package/dist/locale/uk_UA.js +9 -0
  144. package/dist/locale/ur_PK.js +9 -0
  145. package/dist/locale/useLocale.d.ts +6 -1
  146. package/dist/locale/useLocale.js +12 -1
  147. package/dist/locale/uz_UZ.js +9 -0
  148. package/dist/locale/vi_VN.js +9 -0
  149. package/dist/locale/zh_CN.js +13 -3
  150. package/dist/locale/zh_HK.js +11 -1
  151. package/dist/locale/zh_TW.js +11 -1
  152. package/dist/masonry/Masonry.js +1 -1
  153. package/dist/mentions/index.d.ts +2 -3
  154. package/dist/mentions/index.js +9 -4
  155. package/dist/mentions/style/index.js +1 -1
  156. package/dist/menu/MenuContext.d.ts +2 -0
  157. package/dist/menu/MenuItem.js +23 -6
  158. package/dist/menu/index.js +5 -0
  159. package/dist/menu/menu.d.ts +3 -0
  160. package/dist/menu/menu.js +7 -0
  161. package/dist/modal/ConfirmDialog.js +14 -7
  162. package/dist/notification/PurePanel.js +7 -12
  163. package/dist/notification/interface.d.ts +8 -0
  164. package/dist/notification/style/index.js +1 -1
  165. package/dist/notification/style/placement.js +10 -7
  166. package/dist/notification/useNotification.js +5 -15
  167. package/dist/package.js +1 -1
  168. package/dist/pagination/Pagination.js +2 -2
  169. package/dist/pagination/useShowSizeChanger.d.ts +3 -0
  170. package/dist/pagination/useShowSizeChanger.js +1 -1
  171. package/dist/popconfirm/index.js +5 -5
  172. package/dist/popconfirm/style/index.js +1 -1
  173. package/dist/popover/index.js +1 -1
  174. package/dist/popover/style/index.js +2 -2
  175. package/dist/progress/Circle.js +0 -8
  176. package/dist/progress/Line.js +1 -9
  177. package/dist/progress/Steps.js +0 -8
  178. package/dist/progress/progress.js +2 -14
  179. package/dist/qrcode/index.js +4 -4
  180. package/dist/radio/group.js +40 -7
  181. package/dist/radio/index.d.ts +2 -2
  182. package/dist/radio/interface.d.ts +19 -1
  183. package/dist/radio/radio.js +5 -3
  184. package/dist/result/index.js +3 -3
  185. package/dist/result/noFound.js +120 -140
  186. package/dist/result/serverError.js +132 -147
  187. package/dist/result/unauthorized.js +115 -129
  188. package/dist/segmented/index.js +1 -1
  189. package/dist/select/index.js +10 -3
  190. package/dist/select/style/dropdown.js +1 -1
  191. package/dist/select/style/index.js +2 -2
  192. package/dist/select/style/select-input-multiple.js +1 -1
  193. package/dist/select/usePopupRender.js +4 -1
  194. package/dist/slider/index.d.ts +0 -3
  195. package/dist/slider/index.js +2 -2
  196. package/dist/splitter/SplitBar.js +9 -3
  197. package/dist/splitter/interface.d.ts +5 -1
  198. package/dist/steps/style/index.js +1 -1
  199. package/dist/steps/style/inline.js +1 -1
  200. package/dist/style/motion/collapse.js +4 -10
  201. package/dist/table/ExpandIcon.d.ts +9 -4
  202. package/dist/table/ExpandIcon.js +42 -20
  203. package/dist/table/InternalTable.js +21 -15
  204. package/dist/table/hooks/useLazyKVMap.js +1 -1
  205. package/dist/table/hooks/useSelection.js +54 -9
  206. package/dist/table/interface.d.ts +8 -0
  207. package/dist/table/style/index.js +1 -1
  208. package/dist/table/style/sorter.js +2 -2
  209. package/dist/tabs/index.js +9 -2
  210. package/dist/tabs/style/index.js +1 -1
  211. package/dist/time-picker/index.js +34 -0
  212. package/dist/timeline/Timeline.js +1 -1
  213. package/dist/tooltip/style/index.js +1 -1
  214. package/dist/tour/panelRender.js +3 -2
  215. package/dist/transfer/Section.js +2 -1
  216. package/dist/transfer/Transfer.js +1 -1
  217. package/dist/tree/style/index.js +1 -1
  218. package/dist/tree-select/index.js +14 -8
  219. package/dist/typography/Base/index.js +23 -2
  220. package/dist/typography/Link.js +5 -0
  221. package/dist/typography/Paragraph.js +5 -0
  222. package/dist/typography/Text.js +5 -0
  223. package/dist/typography/Title.js +5 -0
  224. package/dist/typography/hooks/useMergedConfig.js +1 -1
  225. package/dist/typography/interface.d.ts +8 -1
  226. package/dist/typography/style/index.js +2 -1
  227. package/dist/typography/style/mixins.d.ts +2 -1
  228. package/dist/typography/style/mixins.js +26 -3
  229. package/dist/upload/Upload.d.ts +1 -0
  230. package/dist/upload/Upload.js +10 -3
  231. package/dist/upload/UploadList/ListItem.js +8 -3
  232. package/dist/upload/interface.d.ts +1 -0
  233. package/dist/version/token-meta.json +1 -1
  234. package/dist/version/token.json +1 -1
  235. package/dist/watermark/index.js +1 -1
  236. package/package.json +9 -9
  237. package/web-tags.json +74 -14
  238. package/web-types.json +186 -22
  239. package/dist/_util/getAllowClear.d.ts +0 -6
  240. package/dist/_util/getAllowClear.js +0 -11
@@ -11,6 +11,8 @@ declare function useIcons(props: Pick<PickerProps$1, 'allowClear' | 'clearIcon'
11
11
  clearIcon?: VueNode;
12
12
  }): readonly [false, string | number | boolean | import("vue/jsx-runtime").JSX.Element | RenderNodeFn<any[]> | null] | readonly [{
13
13
  readonly disabled?: boolean;
14
+ readonly tabIndex?: number;
15
+ readonly label?: string;
14
16
  readonly clearIcon: any;
15
17
  }, string | number | boolean | import("vue/jsx-runtime").JSX.Element | RenderNodeFn<any[]> | null];
16
18
  //#endregion
@@ -8,21 +8,21 @@ declare function useItems(screens: Ref<ScreenMap>, items: Ref<DescriptionsItemTy
8
8
  filled: boolean;
9
9
  _$index: number;
10
10
  key?: import("@v-c/util/dist/type").Key;
11
- label?: VueNode;
12
- style?: import("vue").CSSProperties | undefined;
13
11
  class?: string | undefined;
14
- styles?: CellSemanticStyles | undefined;
12
+ style?: import("vue").CSSProperties | undefined;
13
+ label?: VueNode;
15
14
  classes?: CellSemanticClassNames | undefined;
15
+ styles?: CellSemanticStyles | undefined;
16
16
  rootClass?: string | undefined;
17
17
  content?: VueNode;
18
18
  } | {
19
19
  span: number | undefined;
20
20
  key?: import("@v-c/util/dist/type").Key;
21
- label?: VueNode;
22
- style?: import("vue").CSSProperties | undefined;
23
21
  class?: string | undefined;
24
- styles?: CellSemanticStyles | undefined;
22
+ style?: import("vue").CSSProperties | undefined;
23
+ label?: VueNode;
25
24
  classes?: CellSemanticClassNames | undefined;
25
+ styles?: CellSemanticStyles | undefined;
26
26
  rootClass?: string | undefined;
27
27
  content?: VueNode;
28
28
  _$index: number;
@@ -5,11 +5,12 @@ import { unit } from "@antdv-next/cssinjs";
5
5
  //#region src/descriptions/style/index.ts
6
6
  const genBorderedStyle = (token) => {
7
7
  const { componentCls, labelBg } = token;
8
+ const rowSelector = `> ${componentCls}-view > table > tbody > ${componentCls}-row`;
8
9
  return { [`&${componentCls}-bordered`]: {
9
10
  [`> ${componentCls}-view`]: {
10
11
  border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
11
12
  "> table": { tableLayout: "auto" },
12
- [`${componentCls}-row`]: {
13
+ [`> table > tbody > ${componentCls}-row`]: {
13
14
  borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
14
15
  "&:first-child": { "> th:first-child, > td:first-child": { borderStartStartRadius: token.borderRadiusLG } },
15
16
  "&:last-child": {
@@ -28,12 +29,13 @@ const genBorderedStyle = (token) => {
28
29
  }
29
30
  }
30
31
  },
31
- [`&${componentCls}-medium`]: { [`${componentCls}-row`]: { [`> ${componentCls}-item-label, > ${componentCls}-item-content`]: { padding: `${unit(token.paddingSM)} ${unit(token.paddingLG)}` } } },
32
- [`&${componentCls}-small`]: { [`${componentCls}-row`]: { [`> ${componentCls}-item-label, > ${componentCls}-item-content`]: { padding: `${unit(token.paddingXS)} ${unit(token.padding)}` } } }
32
+ [`&${componentCls}-medium`]: { [rowSelector]: { [`> ${componentCls}-item-label, > ${componentCls}-item-content`]: { padding: `${unit(token.paddingSM)} ${unit(token.paddingLG)}` } } },
33
+ [`&${componentCls}-small`]: { [rowSelector]: { [`> ${componentCls}-item-label, > ${componentCls}-item-content`]: { padding: `${unit(token.paddingXS)} ${unit(token.padding)}` } } }
33
34
  } };
34
35
  };
35
36
  const genDescriptionStyles = (token) => {
36
37
  const { componentCls, extraColor, itemPaddingBottom, itemPaddingEnd, colonMarginRight, colonMarginLeft, titleMarginBottom } = token;
38
+ const rowSelector = `> ${componentCls}-view > table > tbody > ${componentCls}-row`;
37
39
  return { [componentCls]: {
38
40
  ...resetComponent(token),
39
41
  ...genBorderedStyle(token),
@@ -65,7 +67,7 @@ const genDescriptionStyles = (token) => {
65
67
  borderCollapse: "collapse"
66
68
  }
67
69
  },
68
- [`${componentCls}-row`]: {
70
+ [rowSelector]: {
69
71
  "> th, > td": {
70
72
  paddingBottom: itemPaddingBottom,
71
73
  paddingInlineEnd: itemPaddingEnd
@@ -78,7 +80,7 @@ const genDescriptionStyles = (token) => {
78
80
  },
79
81
  [`${componentCls}-item-label`]: {
80
82
  color: token.labelColor,
81
- fontWeight: "normal",
83
+ fontWeight: 400,
82
84
  fontSize: token.fontSize,
83
85
  lineHeight: token.lineHeight,
84
86
  textAlign: "start",
@@ -90,10 +92,6 @@ const genDescriptionStyles = (token) => {
90
92
  },
91
93
  [`&${componentCls}-item-no-colon::after`]: { content: "\"\"" }
92
94
  },
93
- [`${componentCls}-item-no-label`]: { "&::after": {
94
- margin: 0,
95
- content: "\"\""
96
- } },
97
95
  [`${componentCls}-item-content`]: {
98
96
  display: "table-cell",
99
97
  flex: 1,
@@ -108,19 +106,19 @@ const genDescriptionStyles = (token) => {
108
106
  verticalAlign: "top",
109
107
  "&-container": {
110
108
  display: "flex",
111
- [`${componentCls}-item-label`]: {
109
+ [`> ${componentCls}-item-label`]: {
112
110
  display: "inline-flex",
113
111
  alignItems: "baseline"
114
112
  },
115
- [`${componentCls}-item-content`]: {
113
+ [`> ${componentCls}-item-content`]: {
116
114
  display: "inline-flex",
117
115
  alignItems: "baseline",
118
116
  minWidth: "1em"
119
117
  }
120
118
  }
121
119
  },
122
- "&-medium": { [`${componentCls}-row`]: { "> th, > td": { paddingBottom: token.paddingSM } } },
123
- "&-small": { [`${componentCls}-row`]: { "> th, > td": { paddingBottom: token.paddingXS } } }
120
+ "&-medium": { [rowSelector]: { "> th, > td": { paddingBottom: token.paddingSM } } },
121
+ "&-small": { [rowSelector]: { "> th, > td": { paddingBottom: token.paddingXS } } }
124
122
  } };
125
123
  };
126
124
  const prepareComponentToken = (token) => ({
@@ -95,7 +95,7 @@ const genSharedDividerStyle = (token) => {
95
95
  },
96
96
  [`&-plain${componentCls}-with-text`]: {
97
97
  color: token.colorText,
98
- fontWeight: "normal",
98
+ fontWeight: 400,
99
99
  fontSize: token.fontSize
100
100
  },
101
101
  [`&-horizontal${componentCls}-with-text-start${componentCls}-no-default-orientation-margin-start`]: {
@@ -81,7 +81,7 @@ const DrawerPanel = /* @__PURE__ */ defineComponent((props, { slots }) => {
81
81
  ]);
82
82
  };
83
83
  const renderFooter = () => {
84
- if (!footer) return null;
84
+ if (!isRenderable(footer)) return null;
85
85
  return createVNode("div", {
86
86
  "class": clsx(`${prefixCls}-footer`, mergedClassNames.value.footer),
87
87
  "style": [mergedStyles.value.footer, footerStyle]
@@ -16,6 +16,7 @@ interface DropdownArrowOptions {
16
16
  type DropdownSemanticName = keyof DropdownSemanticClassNames & keyof DropdownSemanticStyles;
17
17
  interface DropdownSemanticClassNames {
18
18
  root?: string;
19
+ menu?: string;
19
20
  item?: string;
20
21
  itemTitle?: string;
21
22
  itemIcon?: string;
@@ -23,6 +24,7 @@ interface DropdownSemanticClassNames {
23
24
  }
24
25
  interface DropdownSemanticStyles {
25
26
  root?: CSSProperties;
27
+ menu?: CSSProperties;
26
28
  item?: CSSProperties;
27
29
  itemTitle?: CSSProperties;
28
30
  itemIcon?: CSSProperties;
@@ -95,8 +95,13 @@ const Dropdown = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs })
95
95
  disabled: child?.props?.disabled ?? props?.disabled
96
96
  });
97
97
  const renderOverlay = () => {
98
- const menuClassNames = omit(mergedClassNames.value, ["root"]);
99
- const menuStyles = omit(mergedStyles.value, ["root"]);
98
+ const menuClassNames = omit(mergedClassNames.value, ["root", "menu"]);
99
+ const menuStyles = omit(mergedStyles.value, ["root", "menu"]);
100
+ const menuRootClassName = clsx(menu?.classes?.root, mergedClassNames.value.menu) || void 0;
101
+ const menuRootStyle = mergedStyles.value.menu ? {
102
+ ...menu?.styles?.root,
103
+ ...mergedStyles.value.menu
104
+ } : menu?.styles?.root;
100
105
  let overlayNode;
101
106
  if (menu?.items) overlayNode = createVNode(Menu, mergeProps(omit(menu, [
102
107
  "classes",
@@ -109,11 +114,13 @@ const Dropdown = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs })
109
114
  "rootClass": clsx(menu?.rootClass),
110
115
  "classes": {
111
116
  ...menu?.classes,
117
+ root: menuRootClassName,
112
118
  ...menuClassNames,
113
119
  subMenu: { ...menuClassNames }
114
120
  },
115
121
  "styles": {
116
122
  ...menu?.styles,
123
+ root: menuRootStyle,
117
124
  ...menuStyles,
118
125
  subMenu: { ...menuStyles }
119
126
  }
@@ -157,7 +157,7 @@ const genBaseStyle = (token) => {
157
157
  margin: 0,
158
158
  padding: `${unit(paddingBlock)} ${unit(controlPaddingHorizontal)}`,
159
159
  color: token.colorText,
160
- fontWeight: "normal",
160
+ fontWeight: 400,
161
161
  fontSize,
162
162
  lineHeight: token.lineHeight,
163
163
  cursor: "pointer",
@@ -1,9 +1,9 @@
1
+ import { useFormItemPrefixContext } from "./context.js";
1
2
  import { getAttrStyleAndClass } from "../_util/hooks/useMergeSemantic.js";
2
3
  import { getSlotPropsFnRun } from "../_util/tools.js";
3
4
  import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
4
5
  import initCollapseMotion from "../_util/motion.js";
5
6
  import isNonNullable from "../_util/isNonNullable.js";
6
- import { useFormItemPrefixContext } from "./context.js";
7
7
  import style_default from "./style/index.js";
8
8
  import { Transition, TransitionGroup, computed, createVNode, defineComponent, isVNode, mergeProps } from "vue";
9
9
  import { clsx } from "@v-c/util";
package/dist/form/Form.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import warning from "../_util/warning.js";
2
+ import { NoFormStyle, useFormContextProvider, useVariantContextProvider } from "./context.js";
2
3
  import { useComponentBaseConfig } from "../config-provider/context.js";
3
4
  import { useSizeProvider } from "../config-provider/SizeContext.js";
4
5
  import { useSize } from "../config-provider/hooks/useSize.js";
@@ -7,7 +8,6 @@ import { toPropsRefs } from "../_util/tools.js";
7
8
  import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
8
9
  import { useDisabledContext, useDisabledContextProvider } from "../config-provider/DisabledContext.js";
9
10
  import useLocale from "../locale/useLocale.js";
10
- import { NoFormStyle, useFormContextProvider, useVariantContextProvider } from "./context.js";
11
11
  import { getFieldId, toArray, toNamePathStr } from "./util.js";
12
12
  import { FormHookRegistryKey, FormInstanceContextKey } from "./hooks/useForm.js";
13
13
  import style_default from "./style/index.js";
@@ -1,6 +1,6 @@
1
+ import { NoStyleItemContextProvider, useFormContext } from "../context.js";
1
2
  import { getAttrStyleAndClass } from "../../_util/hooks/useMergeSemantic.js";
2
3
  import isNonNullable from "../../_util/isNonNullable.js";
3
- import { NoStyleItemContextProvider, useFormContext } from "../context.js";
4
4
  import { getStatus } from "../util.js";
5
5
  import Row from "../../grid/row.js";
6
6
  import FormItemInput from "../FormItemInput.js";
@@ -1,8 +1,8 @@
1
+ import { useFormContext, useFormItemProvider, useNoStyleItemContext } from "../context.js";
1
2
  import { useComponentBaseConfig } from "../../config-provider/context.js";
2
3
  import { getSlotPropsFnRun } from "../../_util/tools.js";
3
4
  import useCSSVarCls from "../../config-provider/hooks/useCSSVarCls.js";
4
5
  import { isRenderable } from "../../_util/is.js";
5
- import { useFormContext, useFormItemProvider, useNoStyleItemContext } from "../context.js";
6
6
  import { getFieldId, initialValueFormat, toArray, toNamePathStr } from "../util.js";
7
7
  import { useFormInstance } from "../hooks/useForm.js";
8
8
  import style_default from "../style/index.js";
@@ -355,7 +355,7 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
355
355
  const { errors: itemErrors, warnings: itemWarnings } = mergedErrorList.value;
356
356
  if (currentFieldId && (helpNode || itemErrors.length > 0 || itemWarnings.length > 0 || hasExtra)) {
357
357
  const describedbyArr = [];
358
- if (helpNode || itemErrors.length > 0) describedbyArr.push(`${currentFieldId}_help`);
358
+ if (helpNode || itemErrors.length > 0 || itemWarnings.length > 0) describedbyArr.push(`${currentFieldId}_help`);
359
359
  if (hasExtra) describedbyArr.push(`${currentFieldId}_extra`);
360
360
  newChildProps["aria-describedby"] = describedbyArr.join(" ");
361
361
  }
@@ -1,6 +1,6 @@
1
+ import { FormItemPrefixContextProvider, useFormContext, useFormContextProvider } from "./context.js";
1
2
  import { getSlotPropsFnRun } from "../_util/tools.js";
2
3
  import { isRenderable } from "../_util/is.js";
3
- import { FormItemPrefixContextProvider, useFormContext, useFormContextProvider } from "./context.js";
4
4
  import { responsiveArrayReversed } from "../_util/responsiveObserver.js";
5
5
  import Col from "../grid/col.js";
6
6
  import ErrorList from "./ErrorList.js";
@@ -1,9 +1,9 @@
1
+ import { useFormContext } from "./context.js";
1
2
  import { getSlotPropsFnRun } from "../_util/tools.js";
2
3
  import InternalTooltip from "../tooltip/index.js";
3
4
  import { isRenderable } from "../_util/is.js";
4
5
  import localeValues from "../locale/en_US.js";
5
6
  import useLocale from "../locale/useLocale.js";
6
- import { useFormContext } from "./context.js";
7
7
  import Col from "../grid/col.js";
8
8
  import convertToTooltipProps from "../_util/convertToTooltipProps.js";
9
9
  import { Fragment, createVNode, defineComponent, mergeProps } from "vue";
@@ -1,5 +1,5 @@
1
- import { Variants, useConfig } from "../../config-provider/context.js";
2
1
  import { useVariantContext } from "../context.js";
2
+ import { Variants, useConfig } from "../../config-provider/context.js";
3
3
  import { computed } from "vue";
4
4
  //#region src/form/hooks/useVariant.ts
5
5
  function useVariant(component, variant, legacyBordered, fallbackComponent) {
@@ -11,6 +11,7 @@ declare function useMergedPreviewConfig<T extends PreviewConfig | GroupPreviewCo
11
11
  closeIcon: import("@v-c/util").VueNode;
12
12
  rootClassName: string;
13
13
  mask: boolean;
14
+ maskClosable: boolean;
14
15
  blurClassName: string | undefined;
15
16
  cover?: any;
16
17
  }>;
@@ -6,7 +6,7 @@ import { getTransitionName } from "@v-c/util/dist/utils/transition";
6
6
  //#region src/image/hooks/useMergedPreviewConfig.ts
7
7
  function useMergedPreviewConfig(previewConfig, contextPreviewConfig, prefixCls, mergedRootClassName, getContextPopupContainer, icons, defaultCover) {
8
8
  const [zIndex] = useZIndex("ImagePreview", computed(() => previewConfig.value?.zIndex));
9
- const [mergedPreviewMask, blurClassName] = useMergedMask(computed(() => previewConfig.value?.mask), computed(() => contextPreviewConfig.value?.mask), computed(() => `${prefixCls.value}-preview`));
9
+ const [mergedPreviewMask, blurClassName, mergedMaskClosable] = useMergedMask(computed(() => previewConfig.value?.mask), computed(() => contextPreviewConfig.value?.mask), computed(() => `${prefixCls.value}-preview`));
10
10
  return computed(() => {
11
11
  if (!previewConfig.value) return previewConfig.value;
12
12
  const { cover, getContainer, closeIcon, rootClassName: previewRootClassName } = previewConfig.value;
@@ -21,6 +21,7 @@ function useMergedPreviewConfig(previewConfig, contextPreviewConfig, prefixCls,
21
21
  closeIcon: closeIcon ?? contextCloseIcon,
22
22
  rootClassName: clsx(mergedRootClassName.value, previewRootClassName),
23
23
  mask: mergedPreviewMask.value,
24
+ maskClosable: mergedMaskClosable.value,
24
25
  blurClassName: blurClassName.value?.mask
25
26
  };
26
27
  });
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ import Pagination from "./pagination/Pagination.js";
19
19
  import { PaginationProps } from "./pagination/index.js";
20
20
  import Popover, { PopoverEmits, PopoverProps, PopoverRef, PopoverSlots } from "./popover/index.js";
21
21
  import Popconfirm, { PopconfirmEmits, PopconfirmProps, PopconfirmSlots } from "./popconfirm/index.js";
22
+ import { SplitterEmits, SplitterSlots } from "./splitter/interface.js";
22
23
  import _default$11, { SpinProps, SpinRef, SpinSlots } from "./spin/index.js";
23
24
  import InternalCheckbox, { CheckboxEmits, CheckboxProps, CheckboxSlots } from "./checkbox/Checkbox.js";
24
25
  import CheckboxGroup, { CheckboxGroupEmits, CheckboxGroupProps, CheckboxGroupSlots, CheckboxOptionType } from "./checkbox/Group.js";
@@ -104,7 +105,6 @@ import SkeletonWithSubComponents, { SkeletonProps, SkeletonRef } from "./skeleto
104
105
  import Slider, { SliderEmits, SliderProps, SliderRef } from "./slider/index.js";
105
106
  import { SpaceCompactProps, SpaceCompactRef } from "./space/Compact.js";
106
107
  import Space, { SpaceAddon, SpaceCompact, SpaceProps, SpaceSize, SpaceSlots } from "./space/index.js";
107
- import { SplitterEmits, SplitterSlots } from "./splitter/interface.js";
108
108
  import Splitter, { SplitterRef } from "./splitter/Splitter.js";
109
109
  import { SplitterPanel, SplitterProps } from "./splitter/index.js";
110
110
  import { StatisticRef } from "./statistic/Statistic.js";
@@ -1,8 +1,8 @@
1
1
  import { devUseWarning, isDev } from "../_util/warning.js";
2
+ import { useFormItemInputContext, useFormItemInputContextProvider } from "../form/context.js";
2
3
  import { useComponentBaseConfig } from "../config-provider/context.js";
3
4
  import { getAttrStyleAndClass } from "../_util/hooks/useMergeSemantic.js";
4
5
  import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
5
- import { useFormItemInputContext, useFormItemInputContextProvider } from "../form/context.js";
6
6
  import style_default, { useSharedStyle } from "./style/index.js";
7
7
  import { SpaceCompact } from "../space/index.js";
8
8
  import { computed, createVNode, defineComponent, mergeProps } from "vue";
@@ -3,6 +3,7 @@ import { SemanticClassNamesType, SemanticStylesType } from "../_util/hooks/useMe
3
3
  import "../_util/hooks/index.js";
4
4
  import { SizeType } from "../config-provider/SizeContext.js";
5
5
  import { InputStatus } from "../_util/statusUtils.js";
6
+ import { AllowClear } from "../_util/hooks/useAllowClear.js";
6
7
  import { ComponentBaseProps, Variant } from "../config-provider/context.js";
7
8
  import { CSSProperties, SlotsType } from "vue";
8
9
  import { InputProps as InputProps$1, InputRef as InputRef$1 } from "@v-c/input";
@@ -44,7 +45,7 @@ interface BaseVcInputProps {
44
45
  components?: InputProps$1['components'];
45
46
  prefix?: VueNode;
46
47
  suffix?: VueNode;
47
- allowClear?: InputProps$1['allowClear'];
48
+ allowClear?: AllowClear;
48
49
  changeOnComposing?: InputProps$1['changeOnComposing'];
49
50
  autoFocus?: boolean;
50
51
  inputMode?: string;
@@ -1,4 +1,5 @@
1
1
  import { devUseWarning, isDev } from "../_util/warning.js";
2
+ import { useFormItemInputContext } from "../form/context.js";
2
3
  import { useComponentBaseConfig } from "../config-provider/context.js";
3
4
  import { useSize } from "../config-provider/hooks/useSize.js";
4
5
  import { useCompactItemContext } from "../space/Compact.js";
@@ -8,10 +9,9 @@ import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
8
9
  import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
9
10
  import { useDisabledContext } from "../config-provider/DisabledContext.js";
10
11
  import { getMergedStatus, getStatusClassNames } from "../_util/statusUtils.js";
11
- import { useFormItemInputContext } from "../form/context.js";
12
12
  import useVariant from "../form/hooks/useVariant.js";
13
13
  import style_default, { useSharedStyle } from "./style/index.js";
14
- import getAllowClear from "../_util/getAllowClear.js";
14
+ import useAllowClear, { useAllowClearLabel } from "../_util/hooks/useAllowClear.js";
15
15
  import useRemovePasswordTimeout from "./hooks/useRemovePasswordTimeout.js";
16
16
  import { Fragment, computed, createVNode, defineComponent, isVNode, mergeProps, shallowRef } from "vue";
17
17
  import { clsx } from "@v-c/util";
@@ -83,9 +83,12 @@ const InternalInput = /* @__PURE__ */ defineComponent((props, { slots, expose, e
83
83
  const mergedStatus = computed(() => getMergedStatus(contextStatus.value, customStatus.value));
84
84
  const [mergedVariant, enableVariantCls] = useVariant("input", customVariant, bordered);
85
85
  const removePasswordTimeout = useRemovePasswordTimeout(inputRef, true);
86
- const mergedAllowClear = computed(() => {
87
- return getAllowClear(props.allowClear ?? contextAllowClear.value);
88
- });
86
+ const getClearLabel = useAllowClearLabel();
87
+ const mergedAllowClear = computed(() => useAllowClear({
88
+ allowClear: props.allowClear,
89
+ contextAllowClear: contextAllowClear.value,
90
+ defaultLabel: getClearLabel()
91
+ }));
89
92
  const mergedAutoComplete = computed(() => props.autoComplete ?? props.autocomplete ?? contextAutoComplete.value ?? contextAutocomplete.value);
90
93
  const mergedChangeOnComposing = computed(() => props.changeOnComposing ?? contextChangeOnComposing.value);
91
94
  expose({
@@ -1,5 +1,5 @@
1
1
  import { EmptyEmit } from "../../_util/type.js";
2
- import { InputProps } from "../Input.js";
2
+ import { InputEmits, InputProps } from "../Input.js";
3
3
  import { SlotsType } from "vue";
4
4
  //#region src/input/OTP/OTPInput.d.ts
5
5
  interface OTPInputProps extends Omit<InputProps, 'onChange'> {
@@ -8,6 +8,7 @@ interface OTPInputProps extends Omit<InputProps, 'onChange'> {
8
8
  value?: string;
9
9
  onChange: (index: number, value: string) => void;
10
10
  onActiveChange: (nextIndex: number) => void;
11
+ onFocus?: InputEmits['focus'];
11
12
  mask?: boolean | string;
12
13
  }
13
14
  declare const OTPInput: import("vue").DefineSetupFnComponent<OTPInputProps, EmptyEmit, SlotsType<{
@@ -1,6 +1,6 @@
1
1
  import { getAttrStyleAndClass } from "../../_util/hooks/useMergeSemantic.js";
2
2
  import InternalInput from "../Input.js";
3
- import { createVNode, defineComponent, mergeProps, shallowRef } from "vue";
3
+ import { computed, createVNode, defineComponent, mergeProps, shallowRef } from "vue";
4
4
  import { clsx } from "@v-c/util";
5
5
  import raf from "@v-c/util/dist/raf";
6
6
  import { omit } from "es-toolkit";
@@ -11,7 +11,7 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
11
11
  expose({
12
12
  focus: (...args) => inputRef.value?.focus?.(...args),
13
13
  blur: () => inputRef.value?.blur?.(),
14
- input: inputRef
14
+ input: computed(() => inputRef.value?.input ?? null)
15
15
  });
16
16
  const syncSelection = () => {
17
17
  raf(() => {
@@ -22,6 +22,10 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
22
22
  const handleChange = (e) => {
23
23
  props.onChange(props.index, e?.target?.value ?? "");
24
24
  };
25
+ const handleInternalFocus = (e) => {
26
+ props.onFocus?.(e);
27
+ syncSelection();
28
+ };
25
29
  const handleKeyDown = (event) => {
26
30
  const { key, ctrlKey, metaKey } = event;
27
31
  if (key === "ArrowLeft") props.onActiveChange(props.index - 1);
@@ -36,6 +40,7 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
36
40
  "index",
37
41
  "onChange",
38
42
  "onActiveChange",
43
+ "onFocus",
39
44
  "mask"
40
45
  ]);
41
46
  return () => createVNode("span", {
@@ -53,7 +58,7 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
53
58
  "onChange": handleChange,
54
59
  "htmlSize": 1,
55
60
  "onKeydown": handleKeyDown,
56
- "onFocus": () => syncSelection(),
61
+ "onFocus": handleInternalFocus,
57
62
  "onMousedown": () => syncSelection(),
58
63
  "onMouseup": () => syncSelection(),
59
64
  "aria-label": `OTP Input ${props.index + 1}`
@@ -80,6 +85,10 @@ const OTPInput = /* @__PURE__ */ defineComponent((props, { attrs, expose, slots
80
85
  type: Function,
81
86
  required: true
82
87
  },
88
+ onFocus: {
89
+ type: Function,
90
+ required: false
91
+ },
83
92
  mask: {
84
93
  type: [Boolean, String],
85
94
  required: false,
@@ -18,7 +18,7 @@ interface OTPSemanticStyles {
18
18
  }
19
19
  type OTPClassNamesType = SemanticClassNamesType<OTPProps, OTPSemanticClassNames>;
20
20
  type OTPStylesType = SemanticStylesType<OTPProps, OTPSemanticStyles>;
21
- interface OTPProps extends ComponentBaseProps, Omit<HTMLAttributes, 'onChange' | 'onInput'>, OTPEmitsProps {
21
+ interface OTPProps extends ComponentBaseProps, Omit<HTMLAttributes, 'onChange' | 'onInput' | 'onFocus'>, OTPEmitsProps {
22
22
  length?: number;
23
23
  variant?: Variant;
24
24
  size?: SizeType;
@@ -39,9 +39,11 @@ interface OTPEmits {
39
39
  'change': (value: string) => void;
40
40
  'input': (cells: string[]) => void;
41
41
  'update:value': (value: string) => void;
42
+ 'focus': (ev: FocusEvent) => void;
42
43
  }
43
44
  interface OTPEmitsProps {
44
45
  onChange?: OTPEmits['change'];
46
+ onFocus?: OTPEmits['focus'];
45
47
  onInput?: OTPEmits['input'];
46
48
  'onUpdate:value'?: OTPEmits['update:value'];
47
49
  }
@@ -1,10 +1,11 @@
1
1
  import { devUseWarning, isDev } from "../../_util/warning.js";
2
+ import { useFormItemInputContext, useFormItemInputContextProvider } from "../../form/context.js";
2
3
  import { useComponentBaseConfig } from "../../config-provider/context.js";
3
4
  import { useSize } from "../../config-provider/hooks/useSize.js";
4
5
  import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../../_util/hooks/useMergeSemantic.js";
5
6
  import { toPropsRefs } from "../../_util/tools.js";
7
+ import { isRenderable } from "../../_util/is.js";
6
8
  import { getMergedStatus } from "../../_util/statusUtils.js";
7
- import { useFormItemInputContext, useFormItemInputContextProvider } from "../../form/context.js";
8
9
  import useVariant from "../../form/hooks/useVariant.js";
9
10
  import otp_default from "../style/otp.js";
10
11
  import OTPInput from "./OTPInput.js";
@@ -55,7 +56,6 @@ const OTP = /* @__PURE__ */ defineComponent((props, { attrs, emit, slots }) => {
55
56
  for (let i = 0; i < index; i += 1) if (!nextCells[i]) nextCells[i] = "";
56
57
  if (txt.length <= 1) nextCells[index] = txt;
57
58
  else nextCells = nextCells.slice(0, index).concat(strToArr(txt));
58
- nextCells = nextCells.slice(0, mergedLength.value);
59
59
  for (let i = nextCells.length - 1; i >= 0; i -= 1) {
60
60
  if (nextCells[i]) break;
61
61
  nextCells.pop();
@@ -64,21 +64,28 @@ const OTP = /* @__PURE__ */ defineComponent((props, { attrs, emit, slots }) => {
64
64
  return strToArr(formattedValue).map((cell, i) => {
65
65
  if (cell === " " && !nextCells[i]) return nextCells[i];
66
66
  return cell;
67
- });
67
+ }).slice(0, mergedLength.value);
68
68
  };
69
69
  const handleInputChange = (index, txt) => {
70
70
  const nextCells = patchValue(index, txt);
71
+ triggerValueCellsChange(nextCells);
71
72
  const nextIndex = Math.min(index + txt.length, mergedLength.value - 1);
72
73
  if (nextIndex !== index && nextCells[index] !== void 0) inputRefs.value[nextIndex]?.focus?.();
73
- triggerValueCellsChange(nextCells);
74
74
  };
75
75
  const handleActiveChange = (nextIndex) => {
76
76
  inputRefs.value[nextIndex]?.focus?.();
77
77
  };
78
+ const handleInputFocus = (event, index) => {
79
+ for (let i = 0; i < index; i += 1) if (!valueCells.value[i]) {
80
+ inputRefs.value[i]?.focus();
81
+ break;
82
+ }
83
+ emit("focus", event);
84
+ };
78
85
  const renderSeparator = (index) => {
79
86
  const separator = slots.separator || props.separator;
80
87
  const separatorNode = typeof separator === "function" ? separator({ index }) : separator;
81
- if (!separatorNode) return null;
88
+ if (!isRenderable(separatorNode)) return null;
82
89
  return createVNode("span", {
83
90
  "key": `otp-sep-${index}`,
84
91
  "class": clsx(`${prefixCls.value}-separator`, mergedClassNames.value.separator),
@@ -105,6 +112,7 @@ const OTP = /* @__PURE__ */ defineComponent((props, { attrs, emit, slots }) => {
105
112
  "value": valueCells.value[index] || "",
106
113
  "onChange": handleInputChange,
107
114
  "onActiveChange": handleActiveChange,
115
+ "onFocus": (event) => handleInputFocus(event, index),
108
116
  "autoFocus": index === 0 ? props.autoFocus : void 0,
109
117
  "mask": props.mask,
110
118
  "type": props.type,
@@ -202,7 +210,8 @@ const OTP = /* @__PURE__ */ defineComponent((props, { attrs, emit, slots }) => {
202
210
  emits: [
203
211
  "change",
204
212
  "input",
205
- "update:value"
213
+ "update:value",
214
+ "focus"
206
215
  ],
207
216
  name: "AInputOtp",
208
217
  inheritAttrs: false
@@ -21,10 +21,10 @@ const InternalPassword = /* @__PURE__ */ defineComponent((props, { slots, attrs,
21
21
  const inputRef = shallowRef();
22
22
  const removePasswordTimeout = useRemovePasswordTimeout(inputRef);
23
23
  const visibilityToggle = computed(() => props.visibilityToggle ?? true);
24
- const visibilityControlled = computed(() => typeof visibilityToggle.value === "object" && visibilityToggle.value.visible !== void 0);
25
- const visible = shallowRef(visibilityControlled.value ? Boolean(visibilityToggle.value.visible) : false);
26
- watch(visibilityToggle, (next) => {
27
- if (visibilityControlled.value) visible.value = Boolean(next.visible);
24
+ const visibilityControlled = computed(() => props.iconVisible !== void 0 || typeof visibilityToggle.value === "object" && visibilityToggle.value.visible !== void 0);
25
+ const visible = shallowRef(props.iconVisible ?? (visibilityControlled.value ? Boolean(visibilityToggle.value.visible) : false));
26
+ watch([visibilityToggle, () => props.iconVisible], ([toggle, iconVisible]) => {
27
+ if (visibilityControlled.value) visible.value = iconVisible ?? Boolean(toggle.visible);
28
28
  });
29
29
  const triggerVisibleChange = () => {
30
30
  if (mergedDisabled.value || visibilityToggle.value === false) return;
@@ -32,6 +32,7 @@ const InternalPassword = /* @__PURE__ */ defineComponent((props, { slots, attrs,
32
32
  const next = !visible.value;
33
33
  if (!visibilityControlled.value) visible.value = next;
34
34
  if (typeof visibilityToggle.value === "object") visibilityToggle.value.onVisibleChange?.(next);
35
+ emit("update:iconVisible", next);
35
36
  };
36
37
  const action = computed(() => props.action ?? "click");
37
38
  const iconRender = (visible) => {
@@ -84,7 +85,8 @@ const InternalPassword = /* @__PURE__ */ defineComponent((props, { slots, attrs,
84
85
  "suffix",
85
86
  "inputPrefixCls",
86
87
  "rootClass",
87
- "prefixCls"
88
+ "prefixCls",
89
+ "iconVisible"
88
90
  ]);
89
91
  const suffixSlot = getSlotPropsFnRun(slots, props, "suffix");
90
92
  const visibilityIcon = getIcon();
@@ -2,6 +2,7 @@ import { useComponentBaseConfig } from "../config-provider/context.js";
2
2
  import { useSize } from "../config-provider/hooks/useSize.js";
3
3
  import { useCompactItemContext } from "../space/Compact.js";
4
4
  import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
5
+ import fallbackProp from "../_util/fallbackProp.js";
5
6
  import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
6
7
  import { useDisabledContext } from "../config-provider/DisabledContext.js";
7
8
  import button_default from "../button/index.js";
@@ -31,7 +32,7 @@ const omitInputKeys = [
31
32
  const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit, expose }) => {
32
33
  const composedRef = shallowRef(false);
33
34
  const inputRef = shallowRef();
34
- const { prefixCls, direction, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, getPrefixCls } = useComponentBaseConfig("inputSearch", props, void 0, "input-search");
35
+ const { prefixCls, direction, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, searchIcon: contextSearchIcon, getPrefixCls } = useComponentBaseConfig("inputSearch", props, ["searchIcon"], "input-search");
35
36
  const inputPrefixCls = computed(() => getPrefixCls("input", props.inputPrefixCls));
36
37
  const { classes, styles, size: customizeSize, disabled: customDisabled, variant: customizeVariant, bordered } = toPropsRefs(props, "classes", "styles", "size", "disabled", "variant", "bordered");
37
38
  const contextDisabled = useDisabledContext();
@@ -102,7 +103,7 @@ const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
102
103
  const enterButtonValue = props.enterButton ?? false;
103
104
  const isBooleanEnterButton = typeof enterButtonValue === "boolean";
104
105
  const searchIconFromSlot = getSlotPropsFnRun(slots, props, "searchIcon", false);
105
- const searchIcon = isBooleanEnterButton ? searchIconFromSlot ?? props.searchIcon ?? createVNode(SearchOutlined, null, null) : null;
106
+ const searchIcon = isBooleanEnterButton ? fallbackProp(searchIconFromSlot, contextSearchIcon.value, createVNode(SearchOutlined, null, null)) : null;
106
107
  const buttonChildren = isBooleanEnterButton ? void 0 : enterButtonValue;
107
108
  let buttonNode;
108
109
  const enterButtonNode = buttonChildren;
@@ -140,6 +141,7 @@ const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
140
141
  "class": mergedClassName,
141
142
  "style": mergedRootStyle
142
143
  }, { hidden: props.hidden }, rootAttrs, { "size": mergedSize.value }), { default: () => [createVNode(InternalInput, mergeProps(inputAttrs, restInputProps, {
144
+ "type": "search",
143
145
  "ref": inputRef,
144
146
  "prefixCls": inputPrefixCls.value,
145
147
  "size": mergedSize.value,