antdv-next 1.5.6 → 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.
- package/dist/_util/ContextIsolator.js +12 -3
- package/dist/_util/PurePanel.js +17 -14
- package/dist/_util/fallbackProp.d.ts +13 -0
- package/dist/_util/fallbackProp.js +15 -0
- package/dist/_util/hooks/useAllowClear.d.ts +35 -0
- package/dist/_util/hooks/useAllowClear.js +34 -0
- package/dist/_util/hooks/useClosable.js +1 -1
- package/dist/_util/hooks/useMergeSemantic.js +3 -2
- package/dist/_util/omitUndefined.d.ts +13 -0
- package/dist/_util/omitUndefined.js +20 -0
- package/dist/_util/tools.d.ts +3 -1
- package/dist/_util/tools.js +6 -1
- package/dist/_util/wave/index.js +4 -2
- package/dist/_util/wave/style.d.ts +5 -1
- package/dist/_util/wave/useWave.d.ts +2 -1
- package/dist/_util/wave/useWave.js +4 -3
- package/dist/affix/style/index.d.ts +5 -1
- package/dist/alert/Alert.d.ts +6 -2
- package/dist/alert/Alert.js +135 -129
- package/dist/alert/style/index.d.ts +7 -4
- package/dist/alert/style/index.js +12 -9
- package/dist/anchor/style/index.d.ts +5 -1
- package/dist/antd-with-locales.esm.js +21947 -18522
- package/dist/antd-with-locales.js +82 -82
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +19553 -16771
- package/dist/antd.js +82 -82
- package/dist/app/style/index.d.ts +5 -1
- package/dist/auto-complete/index.js +1 -0
- package/dist/avatar/Avatar.js +2 -4
- package/dist/avatar/AvatarContext.d.ts +2 -2
- package/dist/avatar/style/index.d.ts +5 -1
- package/dist/badge/index.js +1 -1
- package/dist/badge/style/index.d.ts +5 -1
- package/dist/badge/style/index.js +2 -9
- package/dist/badge/style/ribbon.d.ts +5 -1
- package/dist/border-beam/BorderBeam.d.ts +8 -1
- package/dist/border-beam/BorderBeam.js +28 -14
- package/dist/border-beam/index.d.ts +2 -2
- package/dist/border-beam/style/index.d.ts +5 -1
- package/dist/breadcrumb/BreadcrumbItem.js +2 -2
- package/dist/breadcrumb/style/index.d.ts +5 -1
- package/dist/button/style/index.d.ts +5 -1
- package/dist/calendar/style/index.d.ts +4 -1
- package/dist/card/Card.js +1 -1
- package/dist/card/style/index.d.ts +5 -1
- package/dist/card/style/index.js +2 -2
- package/dist/carousel/index.js +1 -1
- package/dist/carousel/style/index.d.ts +5 -1
- package/dist/carousel/style/index.js +1 -1
- package/dist/cascader/Panel.js +3 -3
- package/dist/cascader/index.js +14 -6
- package/dist/cascader/style/index.d.ts +5 -1
- package/dist/cascader/style/panel.d.ts +5 -1
- package/dist/checkbox/Checkbox.js +6 -4
- package/dist/checkbox/Group.d.ts +19 -1
- package/dist/checkbox/Group.js +34 -5
- package/dist/checkbox/GroupContext.d.ts +3 -0
- package/dist/checkbox/index.d.ts +2 -2
- package/dist/checkbox/style/index.d.ts +4 -1
- package/dist/collapse/style/index.d.ts +4 -1
- package/dist/color-picker/ColorPicker.js +8 -12
- package/dist/color-picker/style/index.d.ts +5 -1
- package/dist/color-picker/style/input.js +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/config-provider/context.d.ts +16 -21
- package/dist/config-provider/context.js +32 -38
- package/dist/config-provider/define.d.ts +3 -1
- package/dist/config-provider/hooks/useCSSVarCls.d.ts +3 -0
- package/dist/config-provider/hooks/useCSSVarCls.js +4 -3
- package/dist/config-provider/index.d.ts +2 -2
- package/dist/config-provider/index.js +24 -1
- package/dist/date-picker/generatePicker/generateRangePicker.js +29 -4
- package/dist/date-picker/generatePicker/generateSinglePicker.js +32 -6
- package/dist/date-picker/generatePicker/interface.d.ts +4 -0
- package/dist/date-picker/generatePicker/useComponents.d.ts +3 -3
- package/dist/date-picker/style/index.d.ts +5 -1
- package/dist/date-picker/style/panel.js +1 -1
- package/dist/date-picker/style/util.js +1 -1
- package/dist/date-picker/util.d.ts +10 -12
- package/dist/date-picker/util.js +14 -7
- package/dist/descriptions/Cell.js +80 -75
- package/dist/descriptions/Row.js +14 -11
- package/dist/descriptions/hooks/useItems.d.ts +10 -10
- package/dist/descriptions/style/index.d.ts +5 -1
- package/dist/descriptions/style/index.js +11 -13
- package/dist/divider/style/index.d.ts +5 -1
- package/dist/divider/style/index.js +1 -1
- package/dist/drawer/DrawerPanel.js +7 -7
- package/dist/drawer/index.d.ts +0 -2
- package/dist/drawer/index.js +0 -1
- package/dist/drawer/style/index.d.ts +5 -1
- package/dist/dropdown/dropdown.d.ts +2 -0
- package/dist/dropdown/dropdown.js +11 -3
- package/dist/dropdown/style/index.d.ts +5 -1
- package/dist/dropdown/style/index.js +1 -1
- package/dist/empty/style/index.d.ts +5 -1
- package/dist/flex/index.js +1 -1
- package/dist/flex/style/index.d.ts +5 -1
- package/dist/float-button/FloatButtonGroup.js +1 -1
- package/dist/float-button/style/index.d.ts +5 -1
- package/dist/form/ErrorList.js +1 -1
- package/dist/form/Form.js +1 -1
- package/dist/form/FormItem/ItemHolder.js +1 -1
- package/dist/form/FormItem/index.js +38 -18
- package/dist/form/FormItemInput.js +1 -1
- package/dist/form/FormItemLabel.js +1 -1
- package/dist/form/context.d.ts +1 -1
- package/dist/form/hooks/useVariant.d.ts +1 -1
- package/dist/form/hooks/useVariant.js +1 -1
- package/dist/form/style/index.d.ts +5 -1
- package/dist/grid/style/index.d.ts +5 -2
- package/dist/image/hooks/useMergedPreviewConfig.d.ts +1 -0
- package/dist/image/hooks/useMergedPreviewConfig.js +2 -1
- package/dist/image/hooks/usePreviewConfig.d.ts +9 -9
- package/dist/image/style/index.d.ts +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/input/Group.js +1 -1
- package/dist/input/Input.d.ts +2 -1
- package/dist/input/Input.js +8 -5
- package/dist/input/OTP/OTPInput.d.ts +2 -1
- package/dist/input/OTP/OTPInput.js +12 -3
- package/dist/input/OTP/index.d.ts +3 -1
- package/dist/input/OTP/index.js +15 -6
- package/dist/input/Password.js +7 -5
- package/dist/input/Search.js +4 -2
- package/dist/input/TextArea.d.ts +3 -1
- package/dist/input/TextArea.js +13 -8
- package/dist/input/style/index.d.ts +5 -2
- package/dist/input/style/index.js +1 -1
- package/dist/input/style/otp.d.ts +5 -1
- package/dist/input/style/search.d.ts +5 -1
- package/dist/input/style/textarea.d.ts +5 -1
- package/dist/input-number/index.d.ts +3 -6
- package/dist/input-number/index.js +8 -3
- package/dist/input-number/style/index.d.ts +5 -1
- package/dist/input-number/style/index.js +1 -5
- package/dist/layout/style/index.d.ts +5 -1
- package/dist/layout/style/sider.d.ts +5 -1
- package/dist/listy/index.d.ts +1 -1
- package/dist/listy/index.js +9 -7
- package/dist/listy/interface.d.ts +6 -1
- package/dist/listy/style/index.d.ts +5 -1
- package/dist/listy/style/index.js +4 -2
- package/dist/locale/ar_EG.js +9 -0
- package/dist/locale/az_AZ.js +9 -0
- package/dist/locale/bg_BG.js +9 -0
- package/dist/locale/bn_BD.js +9 -0
- package/dist/locale/by_BY.js +9 -0
- package/dist/locale/ca_ES.js +9 -0
- package/dist/locale/cs_CZ.js +9 -0
- package/dist/locale/da_DK.js +9 -0
- package/dist/locale/de_DE.js +9 -0
- package/dist/locale/el_GR.js +9 -0
- package/dist/locale/en_GB.js +11 -1
- package/dist/locale/en_US.js +11 -1
- package/dist/locale/es_ES.js +9 -0
- package/dist/locale/et_EE.js +9 -0
- package/dist/locale/eu_ES.js +9 -0
- package/dist/locale/fa_IR.js +9 -0
- package/dist/locale/fi_FI.js +10 -1
- package/dist/locale/fr_BE.js +9 -0
- package/dist/locale/fr_CA.js +9 -0
- package/dist/locale/fr_FR.js +9 -0
- package/dist/locale/ga_IE.js +9 -0
- package/dist/locale/gl_ES.js +9 -0
- package/dist/locale/he_IL.js +9 -0
- package/dist/locale/hi_IN.js +9 -0
- package/dist/locale/hr_HR.js +9 -0
- package/dist/locale/hu_HU.js +9 -0
- package/dist/locale/hy_AM.js +9 -0
- package/dist/locale/id_ID.js +9 -0
- package/dist/locale/index.d.ts +3 -0
- package/dist/locale/is_IS.js +9 -0
- package/dist/locale/it_IT.js +9 -0
- package/dist/locale/ja_JP.js +9 -0
- package/dist/locale/ka_GE.js +9 -0
- package/dist/locale/kk_KZ.js +9 -0
- package/dist/locale/km_KH.js +9 -0
- package/dist/locale/kmr_IQ.js +9 -0
- package/dist/locale/kn_IN.js +9 -0
- package/dist/locale/ko_KR.js +9 -0
- package/dist/locale/ku_IQ.js +9 -0
- package/dist/locale/lt_LT.js +9 -0
- package/dist/locale/lv_LV.js +9 -0
- package/dist/locale/mk_MK.js +9 -0
- package/dist/locale/ml_IN.js +9 -0
- package/dist/locale/mn_MN.js +9 -0
- package/dist/locale/mr_IN.js +9 -0
- package/dist/locale/ms_MY.js +9 -0
- package/dist/locale/my_MM.js +9 -0
- package/dist/locale/nb_NO.js +9 -0
- package/dist/locale/ne_NP.js +9 -0
- package/dist/locale/nl_BE.js +9 -0
- package/dist/locale/nl_NL.js +9 -0
- package/dist/locale/pl_PL.js +9 -0
- package/dist/locale/pt_BR.js +9 -0
- package/dist/locale/pt_PT.js +9 -0
- package/dist/locale/ro_RO.js +19 -10
- package/dist/locale/ru_RU.js +9 -0
- package/dist/locale/si_LK.js +9 -0
- package/dist/locale/sk_SK.js +9 -0
- package/dist/locale/sl_SI.js +9 -0
- package/dist/locale/sq_AL.js +9 -0
- package/dist/locale/sr_RS.js +9 -0
- package/dist/locale/sv_SE.js +9 -0
- package/dist/locale/ta_IN.js +10 -1
- package/dist/locale/th_TH.js +9 -0
- package/dist/locale/tk_TK.js +9 -0
- package/dist/locale/tr_TR.js +9 -0
- package/dist/locale/uk_UA.js +9 -0
- package/dist/locale/ur_PK.js +9 -0
- package/dist/locale/useLocale.d.ts +7 -2
- package/dist/locale/useLocale.js +12 -1
- package/dist/locale/uz_UZ.js +9 -0
- package/dist/locale/vi_VN.js +9 -0
- package/dist/locale/zh_CN.js +13 -3
- package/dist/locale/zh_HK.js +11 -1
- package/dist/locale/zh_TW.js +11 -1
- package/dist/masonry/Masonry.js +1 -1
- package/dist/masonry/style/index.d.ts +4 -1
- package/dist/mentions/index.d.ts +2 -3
- package/dist/mentions/index.js +10 -5
- package/dist/mentions/style/index.d.ts +5 -1
- package/dist/mentions/style/index.js +1 -1
- package/dist/menu/MenuContext.d.ts +2 -0
- package/dist/menu/MenuItem.js +25 -7
- package/dist/menu/index.js +5 -0
- package/dist/menu/menu.d.ts +3 -0
- package/dist/menu/menu.js +7 -0
- package/dist/message/style/index.d.ts +5 -1
- package/dist/modal/ConfirmDialog.js +14 -7
- package/dist/modal/style/index.d.ts +3 -1
- package/dist/notification/PurePanel.js +7 -12
- package/dist/notification/interface.d.ts +8 -0
- package/dist/notification/style/index.d.ts +4 -1
- package/dist/notification/style/index.js +1 -1
- package/dist/notification/style/placement.js +10 -7
- package/dist/notification/useNotification.js +5 -15
- package/dist/package.js +1 -1
- package/dist/pagination/Pagination.js +2 -2
- package/dist/pagination/style/index.d.ts +5 -1
- package/dist/pagination/useShowSizeChanger.d.ts +3 -0
- package/dist/pagination/useShowSizeChanger.js +1 -1
- package/dist/popconfirm/index.js +5 -5
- package/dist/popconfirm/style/index.d.ts +5 -1
- package/dist/popconfirm/style/index.js +1 -1
- package/dist/popover/index.js +5 -4
- package/dist/popover/style/index.d.ts +5 -1
- package/dist/popover/style/index.js +2 -2
- package/dist/progress/Circle.js +0 -8
- package/dist/progress/Line.js +1 -9
- package/dist/progress/Steps.js +0 -8
- package/dist/progress/progress.js +2 -14
- package/dist/progress/style/index.d.ts +5 -1
- package/dist/qrcode/index.js +4 -25
- package/dist/qrcode/interface.d.ts +1 -1
- package/dist/qrcode/style/index.d.ts +5 -1
- package/dist/radio/group.js +40 -7
- package/dist/radio/index.d.ts +2 -2
- package/dist/radio/interface.d.ts +19 -1
- package/dist/radio/radio.js +5 -3
- package/dist/radio/style/index.d.ts +5 -1
- package/dist/rate/style/index.d.ts +5 -1
- package/dist/result/index.js +3 -3
- package/dist/result/noFound.js +120 -140
- package/dist/result/serverError.js +132 -147
- package/dist/result/style/index.d.ts +5 -1
- package/dist/result/unauthorized.js +115 -129
- package/dist/segmented/index.js +1 -1
- package/dist/segmented/style/index.d.ts +5 -1
- package/dist/select/index.js +12 -5
- package/dist/select/style/dropdown.js +1 -1
- package/dist/select/style/index.d.ts +5 -1
- package/dist/select/style/index.js +2 -2
- package/dist/select/style/select-input-multiple.js +1 -1
- package/dist/select/usePopupRender.js +4 -1
- package/dist/skeleton/style/index.d.ts +5 -1
- package/dist/slider/index.d.ts +0 -3
- package/dist/slider/index.js +2 -2
- package/dist/slider/style/index.d.ts +5 -1
- package/dist/space/Compact.d.ts +1 -1
- package/dist/space/style/addon.d.ts +5 -1
- package/dist/space/style/compact.d.ts +5 -1
- package/dist/space/style/index.d.ts +5 -1
- package/dist/spin/style/index.d.ts +5 -1
- package/dist/splitter/SplitBar.js +9 -3
- package/dist/splitter/interface.d.ts +5 -1
- package/dist/splitter/style/index.d.ts +5 -1
- package/dist/statistic/style/index.d.ts +5 -1
- package/dist/steps/style/index.d.ts +5 -1
- package/dist/steps/style/index.js +1 -1
- package/dist/steps/style/inline.js +1 -1
- package/dist/style/motion/collapse.js +4 -10
- package/dist/switch/style/index.d.ts +5 -1
- package/dist/table/ExpandIcon.d.ts +9 -4
- package/dist/table/ExpandIcon.js +42 -20
- package/dist/table/InternalTable.js +72 -62
- package/dist/table/hooks/useLazyKVMap.js +1 -1
- package/dist/table/hooks/useSelection.js +73 -15
- package/dist/table/interface.d.ts +8 -0
- package/dist/table/style/index.d.ts +5 -1
- package/dist/table/style/index.js +1 -1
- package/dist/table/style/selection.js +1 -1
- package/dist/table/style/sorter.js +2 -2
- package/dist/table/util.d.ts +1 -1
- package/dist/tabs/index.js +9 -2
- package/dist/tabs/style/index.d.ts +5 -1
- package/dist/tabs/style/index.js +1 -1
- package/dist/tag/CheckableTagGroup.d.ts +2 -2
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/tag/style/index.d.ts +5 -1
- package/dist/theme/context.js +2 -1
- package/dist/theme/useToken.d.ts +6 -2
- package/dist/theme/useToken.js +46 -14
- package/dist/theme/util/genStyleUtils.d.ts +13 -3
- package/dist/theme/util/genStyleUtils.js +42 -28
- package/dist/time-picker/index.js +34 -0
- package/dist/timeline/Timeline.js +1 -1
- package/dist/timeline/style/index.d.ts +5 -1
- package/dist/timeline/useItems.d.ts +2 -2
- package/dist/timeline/useItems.js +1 -1
- package/dist/tooltip/index.js +1 -1
- package/dist/tooltip/style/index.d.ts +2 -2
- package/dist/tooltip/style/index.js +1 -1
- package/dist/tour/panelRender.js +3 -2
- package/dist/tour/style/index.d.ts +5 -1
- package/dist/transfer/Section.js +2 -1
- package/dist/transfer/Transfer.js +3 -1
- package/dist/transfer/style/index.d.ts +5 -1
- package/dist/tree/DirectoryTree.js +1 -1
- package/dist/tree/style/index.d.ts +4 -1
- package/dist/tree/style/index.js +1 -1
- package/dist/tree-select/index.js +15 -9
- package/dist/tree-select/style/index.d.ts +2 -2
- package/dist/typography/Base/index.js +23 -2
- package/dist/typography/Link.js +5 -0
- package/dist/typography/Paragraph.js +5 -0
- package/dist/typography/Text.js +5 -0
- package/dist/typography/Title.js +5 -0
- package/dist/typography/hooks/useMergedConfig.js +1 -1
- package/dist/typography/interface.d.ts +8 -1
- package/dist/typography/style/index.d.ts +5 -1
- package/dist/typography/style/index.js +2 -1
- package/dist/typography/style/mixins.d.ts +2 -1
- package/dist/typography/style/mixins.js +26 -3
- package/dist/upload/Upload.d.ts +1 -0
- package/dist/upload/Upload.js +10 -3
- package/dist/upload/UploadList/ListItem.js +8 -3
- package/dist/upload/interface.d.ts +1 -0
- package/dist/upload/style/index.d.ts +5 -1
- package/dist/version/token-meta.json +1 -1
- package/dist/version/token.json +1 -1
- package/dist/watermark/index.js +1 -1
- package/global.d.ts +5 -0
- package/package.json +17 -17
- package/web-tags.json +5053 -3004
- package/web-types.json +13207 -7299
- package/dist/_util/getAllowClear.d.ts +0 -6
- package/dist/_util/getAllowClear.js +0 -11
|
@@ -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
|
-
[
|
|
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`]: { [
|
|
32
|
-
[`&${componentCls}-small`]: { [
|
|
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
|
-
[
|
|
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:
|
|
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
|
-
[
|
|
109
|
+
[`> ${componentCls}-item-label`]: {
|
|
112
110
|
display: "inline-flex",
|
|
113
111
|
alignItems: "baseline"
|
|
114
112
|
},
|
|
115
|
-
[
|
|
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": { [
|
|
123
|
-
"&-small": { [
|
|
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) => ({
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
import { CSSProperties } from "vue";
|
|
4
8
|
//#region src/divider/style/index.d.ts
|
|
@@ -21,6 +25,6 @@ interface ComponentToken {
|
|
|
21
25
|
verticalMarginInline: CSSProperties['marginInline'];
|
|
22
26
|
}
|
|
23
27
|
declare const prepareComponentToken: GetDefaultToken<'Divider'>;
|
|
24
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
28
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
25
29
|
//#endregion
|
|
26
30
|
export { ComponentToken, _default as default, prepareComponentToken };
|
|
@@ -95,7 +95,7 @@ const genSharedDividerStyle = (token) => {
|
|
|
95
95
|
},
|
|
96
96
|
[`&-plain${componentCls}-with-text`]: {
|
|
97
97
|
color: token.colorText,
|
|
98
|
-
fontWeight:
|
|
98
|
+
fontWeight: 400,
|
|
99
99
|
fontSize: token.fontSize
|
|
100
100
|
},
|
|
101
101
|
[`&-horizontal${componentCls}-with-text-start${componentCls}-no-default-orientation-margin-start`]: {
|
|
@@ -67,21 +67,21 @@ const DrawerPanel = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
67
67
|
...headerStyle
|
|
68
68
|
},
|
|
69
69
|
"class": clsx(`${prefixCls}-header`, mergedClassNames.value.header, { [`${prefixCls}-header-close-only`]: mergedClosable && !hasTitle && !hasExtra })
|
|
70
|
-
}, [
|
|
71
|
-
closablePlacement.value === "start" && mergedCloseButton,
|
|
72
|
-
hasTitle && createVNode("div", {
|
|
70
|
+
}, [
|
|
71
|
+
createVNode("div", { "class": `${prefixCls}-header-title` }, [closablePlacement.value === "start" && mergedCloseButton, hasTitle && createVNode("div", {
|
|
73
72
|
"class": clsx(`${prefixCls}-title`, mergedClassNames.value.title),
|
|
74
73
|
"style": mergedStyles.value.title,
|
|
75
74
|
"id": ariaId
|
|
76
|
-
}, [title]),
|
|
75
|
+
}, [title])]),
|
|
77
76
|
hasExtra && createVNode("div", {
|
|
78
77
|
"class": clsx(`${prefixCls}-extra`, mergedClassNames.value.extra),
|
|
79
78
|
"style": mergedStyles.value.extra
|
|
80
|
-
}, [extra])
|
|
81
|
-
|
|
79
|
+
}, [extra]),
|
|
80
|
+
closablePlacement.value === "end" && mergedCloseButton
|
|
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]
|
package/dist/drawer/index.d.ts
CHANGED
|
@@ -31,7 +31,6 @@ interface DrawerProps extends Omit<DrawerProps$1, 'maskStyle' | 'destroyOnHidden
|
|
|
31
31
|
}
|
|
32
32
|
interface DrawerEmits {
|
|
33
33
|
'update:open': (open: boolean) => void;
|
|
34
|
-
'afterOpenChange': (open: boolean) => void;
|
|
35
34
|
'close': (e: MouseEvent | KeyboardEvent) => void;
|
|
36
35
|
'keydown': (e: KeyboardEvent) => void;
|
|
37
36
|
'keyup': (e: KeyboardEvent) => void;
|
|
@@ -42,7 +41,6 @@ interface DrawerEmits {
|
|
|
42
41
|
}
|
|
43
42
|
interface DrawerEmitsProps {
|
|
44
43
|
'onUpdate:open'?: DrawerEmits['update:open'];
|
|
45
|
-
onAfterOpenChange?: DrawerEmits['afterOpenChange'];
|
|
46
44
|
onClose?: DrawerEmits['close'];
|
|
47
45
|
onKeydown?: DrawerEmits['keydown'];
|
|
48
46
|
onKeyup?: DrawerEmits['keyup'];
|
package/dist/drawer/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { FullToken, GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
//#region src/drawer/style/index.d.ts
|
|
4
8
|
interface ComponentToken {
|
|
@@ -25,6 +29,6 @@ interface ComponentToken {
|
|
|
25
29
|
}
|
|
26
30
|
interface DrawerToken extends FullToken<'Drawer'> {}
|
|
27
31
|
declare const prepareComponentToken: GetDefaultToken<'Drawer'>;
|
|
28
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
32
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
29
33
|
//#endregion
|
|
30
34
|
export { ComponentToken, DrawerToken, _default as default, prepareComponentToken };
|
|
@@ -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;
|
|
@@ -86,7 +86,8 @@ const Dropdown = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs })
|
|
|
86
86
|
});
|
|
87
87
|
return () => {
|
|
88
88
|
const children = filterEmpty(slots?.default?.());
|
|
89
|
-
const
|
|
89
|
+
const firstChild = children[0];
|
|
90
|
+
const child = children.length === 1 && isVNode(firstChild) && typeof firstChild.type !== "symbol" ? firstChild : createVNode("span", null, [children]);
|
|
90
91
|
const { menu, popupRender, mouseEnterDelay, mouseLeaveDelay, arrow, getPopupContainer, rootClass, destroyOnHidden } = props;
|
|
91
92
|
const mergedPopupRender = slots?.popupRender ?? popupRender;
|
|
92
93
|
const popupTrigger = createVNode(child, {
|
|
@@ -94,8 +95,13 @@ const Dropdown = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs })
|
|
|
94
95
|
disabled: child?.props?.disabled ?? props?.disabled
|
|
95
96
|
});
|
|
96
97
|
const renderOverlay = () => {
|
|
97
|
-
const menuClassNames = omit(mergedClassNames.value, ["root"]);
|
|
98
|
-
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;
|
|
99
105
|
let overlayNode;
|
|
100
106
|
if (menu?.items) overlayNode = createVNode(Menu, mergeProps(omit(menu, [
|
|
101
107
|
"classes",
|
|
@@ -108,11 +114,13 @@ const Dropdown = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs })
|
|
|
108
114
|
"rootClass": clsx(menu?.rootClass),
|
|
109
115
|
"classes": {
|
|
110
116
|
...menu?.classes,
|
|
117
|
+
root: menuRootClassName,
|
|
111
118
|
...menuClassNames,
|
|
112
119
|
subMenu: { ...menuClassNames }
|
|
113
120
|
},
|
|
114
121
|
"styles": {
|
|
115
122
|
...menu?.styles,
|
|
123
|
+
root: menuRootStyle,
|
|
116
124
|
...menuStyles,
|
|
117
125
|
subMenu: { ...menuStyles }
|
|
118
126
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
1
3
|
import { ArrowToken } from "../../style/roundedArrow.js";
|
|
2
4
|
import { ArrowOffsetToken } from "../../style/placementArrow.js";
|
|
5
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
3
6
|
import { FullToken, GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
7
|
+
import "../../theme/interface/index.js";
|
|
4
8
|
import "../../theme/internal.js";
|
|
5
9
|
import { CSSProperties } from "vue";
|
|
6
10
|
//#region src/dropdown/style/index.d.ts
|
|
@@ -38,6 +42,6 @@ interface DropdownToken extends FullToken<'Dropdown'> {
|
|
|
38
42
|
menuCls: string;
|
|
39
43
|
}
|
|
40
44
|
declare const prepareComponentToken: GetDefaultToken<'Dropdown'>;
|
|
41
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
45
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
42
46
|
//#endregion
|
|
43
47
|
export { ComponentToken, DropdownToken, _default as default, prepareComponentToken };
|
|
@@ -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:
|
|
160
|
+
fontWeight: 400,
|
|
161
161
|
fontSize,
|
|
162
162
|
lineHeight: token.lineHeight,
|
|
163
163
|
cursor: "pointer",
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
4
|
+
import "../../theme/interface/index.js";
|
|
1
5
|
//#region src/empty/style/index.d.ts
|
|
2
6
|
/** Component only token. Which will handle additional calculation of alias token */
|
|
3
7
|
interface ComponentToken {}
|
|
4
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
8
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
5
9
|
//#endregion
|
|
6
10
|
export { ComponentToken, _default as default };
|
package/dist/flex/index.js
CHANGED
|
@@ -23,7 +23,7 @@ const Flex = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
23
23
|
[`${prefixCls.value}-gap-${gap}`]: isPresetSize(gap),
|
|
24
24
|
[`${prefixCls.value}-vertical`]: mergedVertical
|
|
25
25
|
});
|
|
26
|
-
const mergedStyle = {};
|
|
26
|
+
const mergedStyle = { ...ctxFlex?.style };
|
|
27
27
|
if (flex) mergedStyle.flex = flex;
|
|
28
28
|
if (gap && !isPresetSize(gap)) mergedStyle.gap = /\d/.test(`${gap}`) ? `${gap}px` : gap;
|
|
29
29
|
return createVNode(component, {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { FullToken, GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
//#region src/flex/style/index.d.ts
|
|
4
8
|
/** Component only token. Which will handle additional calculation of alias token */
|
|
@@ -27,6 +31,6 @@ interface FlexToken extends FullToken<'Flex'> {
|
|
|
27
31
|
flexGapLG: number;
|
|
28
32
|
}
|
|
29
33
|
declare const prepareComponentToken: GetDefaultToken<'Flex'>;
|
|
30
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
34
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
31
35
|
//#endregion
|
|
32
36
|
export { ComponentToken, FlexToken, _default as default, prepareComponentToken };
|
|
@@ -62,9 +62,9 @@ const FloatButtonGroup = /* @__PURE__ */ defineComponent((props, { slots, attrs,
|
|
|
62
62
|
const mergedDisabled = computed(() => props.disabled ?? disabledContext.value);
|
|
63
63
|
const triggerOpen = (nextOpen) => {
|
|
64
64
|
if (mergedDisabled.value) return;
|
|
65
|
+
if (open.value === nextOpen) return;
|
|
65
66
|
emit("update:open", nextOpen);
|
|
66
67
|
if (props.open !== void 0) return;
|
|
67
|
-
if (open.value === nextOpen) return;
|
|
68
68
|
open.value = nextOpen;
|
|
69
69
|
emit("openChange", nextOpen);
|
|
70
70
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { FullToken, GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
//#region src/float-button/style/index.d.ts
|
|
4
8
|
/** Component only token. Which will handle additional calculation of alias token */
|
|
@@ -30,6 +34,6 @@ type FloatButtonToken = FullToken<'FloatButton'> & {
|
|
|
30
34
|
floatButtonInsetInlineEnd: number;
|
|
31
35
|
};
|
|
32
36
|
declare const prepareComponentToken: GetDefaultToken<'FloatButton'>;
|
|
33
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
37
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
34
38
|
//#endregion
|
|
35
39
|
export { ComponentToken, FloatButtonToken, _default as default, prepareComponentToken };
|
package/dist/form/ErrorList.js
CHANGED
|
@@ -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";
|
|
@@ -63,6 +63,8 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
63
63
|
const errors = shallowRef([]);
|
|
64
64
|
const warnings = shallowRef([]);
|
|
65
65
|
const validateDisabled = shallowRef(false);
|
|
66
|
+
let validateId = 0;
|
|
67
|
+
let cancelDebounce;
|
|
66
68
|
const subFieldErrors = shallowRef({});
|
|
67
69
|
const initialValue = shallowRef(initialValueFormat(formContext.value?.getFieldValue?.(namePath.value)));
|
|
68
70
|
const getMergedRules = () => {
|
|
@@ -118,6 +120,7 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
118
120
|
});
|
|
119
121
|
if (!filteredRules.length) {
|
|
120
122
|
if (validateOnly) return Promise.resolve();
|
|
123
|
+
validateId++;
|
|
121
124
|
errors.value = [];
|
|
122
125
|
warnings.value = [];
|
|
123
126
|
updateMeta({
|
|
@@ -134,10 +137,20 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
134
137
|
validating: true,
|
|
135
138
|
validated: true
|
|
136
139
|
});
|
|
137
|
-
const
|
|
140
|
+
const currentValidateId = validateOnly ? validateId : ++validateId;
|
|
141
|
+
const runRules = () => validateRules(namePath.value, fieldValue.value, filteredRules, {
|
|
138
142
|
validateMessages: formContext.value?.validateMessages,
|
|
139
143
|
...options
|
|
140
144
|
}, props.validateFirst ?? false, messageVariables.value);
|
|
145
|
+
const validateDebounce = triggerName && !validateOnly ? props.validateDebounce : void 0;
|
|
146
|
+
const promise = validateDebounce ? new Promise((resolve) => {
|
|
147
|
+
cancelDebounce?.();
|
|
148
|
+
const timer = setTimeout(resolve, validateDebounce);
|
|
149
|
+
cancelDebounce = () => {
|
|
150
|
+
clearTimeout(timer);
|
|
151
|
+
resolve();
|
|
152
|
+
};
|
|
153
|
+
}).then(() => currentValidateId === validateId ? runRules() : []) : runRules();
|
|
141
154
|
if (validateOnly) return promise.catch((e) => e).then((results = []) => {
|
|
142
155
|
if (results.some(({ rule: { warningOnly }, errors: ruleErrors }) => !warningOnly && ruleErrors.length)) return Promise.reject(results);
|
|
143
156
|
return results;
|
|
@@ -149,17 +162,19 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
149
162
|
if (warningOnly) mergedWarnings.push(...ruleErrors);
|
|
150
163
|
else mergedErrors.push(...ruleErrors);
|
|
151
164
|
});
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
if (currentValidateId === validateId) {
|
|
166
|
+
errors.value = mergedErrors;
|
|
167
|
+
warnings.value = mergedWarnings;
|
|
168
|
+
updateMeta({
|
|
169
|
+
errors: mergedErrors,
|
|
170
|
+
warnings: mergedWarnings,
|
|
171
|
+
validating: false,
|
|
172
|
+
validated: true,
|
|
173
|
+
touched: meta.value.touched
|
|
174
|
+
});
|
|
175
|
+
formContext.value?.onValidate?.(namePath.value, mergedErrors.length === 0, mergedErrors.length ? mergedErrors : null);
|
|
176
|
+
formContext.value?.triggerFieldsChange?.([namePath.value]);
|
|
177
|
+
}
|
|
163
178
|
if (mergedErrors.length) return Promise.reject(results);
|
|
164
179
|
return results;
|
|
165
180
|
});
|
|
@@ -170,6 +185,7 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
170
185
|
validateRulesInner({ triggerName }).catch((e) => e);
|
|
171
186
|
};
|
|
172
187
|
const clearValidate = () => {
|
|
188
|
+
validateId++;
|
|
173
189
|
errors.value = [];
|
|
174
190
|
warnings.value = [];
|
|
175
191
|
updateMeta({
|
|
@@ -179,7 +195,7 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
179
195
|
});
|
|
180
196
|
};
|
|
181
197
|
const resetField = () => {
|
|
182
|
-
|
|
198
|
+
validateId++;
|
|
183
199
|
errors.value = [];
|
|
184
200
|
warnings.value = [];
|
|
185
201
|
updateMeta({
|
|
@@ -190,7 +206,9 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
190
206
|
validated: false
|
|
191
207
|
});
|
|
192
208
|
if (hasName.value && formContext.value?.model) {
|
|
193
|
-
const
|
|
209
|
+
const nextValue = initialValueFormat(initialValue.value);
|
|
210
|
+
if (!Object.is(fieldValue.value, nextValue)) validateDisabled.value = true;
|
|
211
|
+
const newStore = setValue(formContext.value.model, namePath.value, nextValue);
|
|
194
212
|
Object.assign(formContext.value.model, newStore);
|
|
195
213
|
}
|
|
196
214
|
};
|
|
@@ -284,6 +302,8 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
284
302
|
} else formContext.value?.removeField?.(eventKey.value);
|
|
285
303
|
}, { immediate: true });
|
|
286
304
|
onBeforeUnmount(() => {
|
|
305
|
+
validateId++;
|
|
306
|
+
cancelDebounce?.();
|
|
287
307
|
if (props.noStyle && notifyParentMetaChange) notifyParentMetaChange({
|
|
288
308
|
...meta.value,
|
|
289
309
|
destroy: true
|
|
@@ -310,8 +330,8 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
310
330
|
const childProps = child.props || {};
|
|
311
331
|
const _onBlur = childProps.onBlur;
|
|
312
332
|
const _onFocus = childProps.onFocus;
|
|
313
|
-
if (_onBlur) delete
|
|
314
|
-
if (_onFocus) delete
|
|
333
|
+
if (_onBlur) delete childProps.onBlur;
|
|
334
|
+
if (_onFocus) delete childProps.onFocus;
|
|
315
335
|
const newChildProps = {
|
|
316
336
|
id: childProps.id || currentFieldId,
|
|
317
337
|
onBlur: (...args) => {
|
|
@@ -335,7 +355,7 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
335
355
|
const { errors: itemErrors, warnings: itemWarnings } = mergedErrorList.value;
|
|
336
356
|
if (currentFieldId && (helpNode || itemErrors.length > 0 || itemWarnings.length > 0 || hasExtra)) {
|
|
337
357
|
const describedbyArr = [];
|
|
338
|
-
if (helpNode || itemErrors.length > 0) describedbyArr.push(`${currentFieldId}_help`);
|
|
358
|
+
if (helpNode || itemErrors.length > 0 || itemWarnings.length > 0) describedbyArr.push(`${currentFieldId}_help`);
|
|
339
359
|
if (hasExtra) describedbyArr.push(`${currentFieldId}_extra`);
|
|
340
360
|
newChildProps["aria-describedby"] = describedbyArr.join(" ");
|
|
341
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";
|
package/dist/form/context.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ declare function useFormItemPrefixContext(): Ref<{
|
|
|
71
71
|
prefixCls: string;
|
|
72
72
|
}>;
|
|
73
73
|
declare function useVariantContextProvider(variant: Ref<Variant | undefined>): void;
|
|
74
|
-
declare function useVariantContext(): Ref<"
|
|
74
|
+
declare function useVariantContext(): Ref<"outlined" | "filled" | "borderless" | "underlined" | undefined, "outlined" | "filled" | "borderless" | "underlined" | undefined>;
|
|
75
75
|
interface FormItemStatusContextProps {
|
|
76
76
|
isFormItemInput?: boolean;
|
|
77
77
|
status?: ValidateStatus;
|
|
@@ -3,7 +3,7 @@ import { Variant } from "../../config-provider/context.js";
|
|
|
3
3
|
import { Ref } from "vue";
|
|
4
4
|
//#region src/form/hooks/useVariant.d.ts
|
|
5
5
|
type VariantComponents = keyof Pick<ConfigProviderProps, 'input' | 'inputPassword' | 'inputSearch' | 'otp' | 'inputNumber' | 'textArea' | 'mentions' | 'select' | 'cascader' | 'treeSelect' | 'datePicker' | 'timePicker' | 'rangePicker' | 'card'>;
|
|
6
|
-
declare function useVariant(component: VariantComponents, variant?: Ref<Variant | undefined>, legacyBordered?: Ref<boolean | undefined> | boolean, fallbackComponent?: VariantComponents): readonly [import("vue").ComputedRef<"
|
|
6
|
+
declare function useVariant(component: VariantComponents, variant?: Ref<Variant | undefined>, legacyBordered?: Ref<boolean | undefined> | boolean, fallbackComponent?: VariantComponents): readonly [import("vue").ComputedRef<"outlined" | "filled" | "borderless" | "underlined">, import("vue").ComputedRef<boolean>, import("vue").ComputedRef<boolean>];
|
|
7
7
|
declare const useVariants: typeof useVariant;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { useVariant as default, useVariants };
|
|
@@ -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) {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
2
|
+
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
1
4
|
import { FullToken, GenStyleFn, GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
import { CSSProperties } from "vue";
|
|
4
8
|
//#region src/form/style/index.d.ts
|
|
@@ -74,6 +78,6 @@ interface FormToken extends FullToken<'Form'> {
|
|
|
74
78
|
}
|
|
75
79
|
declare const prepareComponentToken: GetDefaultToken<'Form'>;
|
|
76
80
|
declare function prepareToken(token: Parameters<GenStyleFn<'Form'>>[0], rootPrefixCls: string): FormToken;
|
|
77
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
81
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
78
82
|
//#endregion
|
|
79
83
|
export { ComponentToken, FormToken, _default as default, prepareComponentToken, prepareToken };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { SeedToken } from "../../theme/interface/seeds.js";
|
|
1
2
|
import { AliasToken } from "../../theme/interface/alias.js";
|
|
3
|
+
import { ComponentTokenMap } from "../../theme/interface/components.js";
|
|
2
4
|
import { GetDefaultToken } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
3
6
|
import "../../theme/internal.js";
|
|
4
7
|
//#region src/grid/style/index.d.ts
|
|
5
8
|
interface ComponentToken {}
|
|
6
9
|
declare const prepareRowComponentToken: GetDefaultToken<'Grid'>;
|
|
7
10
|
declare const prepareColComponentToken: GetDefaultToken<'Grid'>;
|
|
8
|
-
declare const useRowStyle: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
11
|
+
declare const useRowStyle: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
9
12
|
declare function getMediaSize(token: AliasToken): {
|
|
10
13
|
readonly xs: number;
|
|
11
14
|
readonly sm: number;
|
|
@@ -15,6 +18,6 @@ declare function getMediaSize(token: AliasToken): {
|
|
|
15
18
|
readonly xxl: number;
|
|
16
19
|
readonly xxxl: number;
|
|
17
20
|
};
|
|
18
|
-
declare const useColStyle: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
21
|
+
declare const useColStyle: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
|
|
19
22
|
//#endregion
|
|
20
23
|
export { ComponentToken, getMediaSize, prepareColComponentToken, prepareRowComponentToken, useColStyle, useRowStyle };
|