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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NoFormStyle } from "../form/context.js";
|
|
1
2
|
import { NoCompactStyle } from "../space/Compact.js";
|
|
2
3
|
import { createVNode, defineComponent, isVNode } from "vue";
|
|
3
4
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
@@ -11,12 +12,20 @@ const ContextIsolator = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
11
12
|
const children = filterEmpty(slots?.default?.());
|
|
12
13
|
if (children.length === 0) return null;
|
|
13
14
|
let result = children;
|
|
14
|
-
if (form) {
|
|
15
|
-
if (space) {
|
|
15
|
+
if (form) {
|
|
16
16
|
const _result = function() {
|
|
17
17
|
return result;
|
|
18
18
|
}();
|
|
19
|
-
result = createVNode(
|
|
19
|
+
result = createVNode(NoFormStyle, {
|
|
20
|
+
"override": true,
|
|
21
|
+
"status": true
|
|
22
|
+
}, _isSlot(result) ? result : { default: () => [_result] });
|
|
23
|
+
}
|
|
24
|
+
if (space) {
|
|
25
|
+
const _result2 = function() {
|
|
26
|
+
return result;
|
|
27
|
+
}();
|
|
28
|
+
result = createVNode(NoCompactStyle, null, _isSlot(result) ? result : { default: () => [_result2] });
|
|
20
29
|
}
|
|
21
30
|
return result;
|
|
22
31
|
};
|
package/dist/_util/PurePanel.js
CHANGED
|
@@ -82,21 +82,24 @@ function genPurePanel(Component, alignPropName, postProps, defaultPrefixCls, get
|
|
|
82
82
|
"style": mergedStyle
|
|
83
83
|
}, [createVNode(Component, mergeProps(attrs, mergedProps), slots)]);
|
|
84
84
|
};
|
|
85
|
-
}, {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
}, {
|
|
86
|
+
props: {
|
|
87
|
+
prefixCls: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: false
|
|
90
|
+
},
|
|
91
|
+
style: {
|
|
92
|
+
type: Object,
|
|
93
|
+
required: false
|
|
94
|
+
},
|
|
95
|
+
open: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
required: false,
|
|
98
|
+
default: void 0
|
|
99
|
+
}
|
|
93
100
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
required: false,
|
|
97
|
-
default: void 0
|
|
98
|
-
}
|
|
99
|
-
} }));
|
|
101
|
+
inheritAttrs: false
|
|
102
|
+
}));
|
|
100
103
|
}
|
|
101
104
|
//#endregion
|
|
102
105
|
export { genPurePanel as default, withPureRenderTheme };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/_util/fallbackProp.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Search for the first non-undefined value in the arguments and return it.
|
|
4
|
+
*
|
|
5
|
+
* ```js
|
|
6
|
+
* const mergedIcon = fallbackProp(propIcon, contextIcon, defaultIcon);
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Note: it is different from `??` operator which skips null
|
|
10
|
+
*/
|
|
11
|
+
declare function fallbackProp<T>(...args: T[]): Exclude<T, undefined> | undefined;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { fallbackProp as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/_util/fallbackProp.ts
|
|
2
|
+
/**
|
|
3
|
+
* Search for the first non-undefined value in the arguments and return it.
|
|
4
|
+
*
|
|
5
|
+
* ```js
|
|
6
|
+
* const mergedIcon = fallbackProp(propIcon, contextIcon, defaultIcon);
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Note: it is different from `??` operator which skips null
|
|
10
|
+
*/
|
|
11
|
+
function fallbackProp(...args) {
|
|
12
|
+
return args.find((arg) => arg !== void 0);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { fallbackProp as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/_util/hooks/useAllowClear.d.ts
|
|
2
|
+
interface AllowClearConfig {
|
|
3
|
+
/** Custom clear icon */
|
|
4
|
+
clearIcon?: any;
|
|
5
|
+
/** Disable the clear button */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Tab order of the clear button. `-1` excludes it from Tab navigation */
|
|
8
|
+
tabIndex?: number;
|
|
9
|
+
/** Accessible name of the clear button */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
type AllowClear = boolean | AllowClearConfig;
|
|
13
|
+
/** The hook never returns plain `true`: a truthy allowClear is normalized to the object form. */
|
|
14
|
+
type MergedAllowClear = AllowClearConfig | false;
|
|
15
|
+
interface UseAllowClearOptions {
|
|
16
|
+
allowClear?: AllowClear;
|
|
17
|
+
clearIcon?: any;
|
|
18
|
+
contextAllowClear?: AllowClear;
|
|
19
|
+
contextClearIcon?: any;
|
|
20
|
+
defaultAllowClear?: boolean;
|
|
21
|
+
defaultLabel?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Getter for the localized clear button label (`locale.global.clear`).
|
|
25
|
+
* Reads the locale context lazily so callers can use it inside their own `computed` without extra reactive objects.
|
|
26
|
+
*/
|
|
27
|
+
declare function useAllowClearLabel(): () => string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Merge component- and ConfigProvider-level `allowClear` / `clearIcon`.
|
|
30
|
+
* Each field is resolved on its own (priority: props → context → default), so `allowClear: true`
|
|
31
|
+
* inherits the global config while `disabled: false` / `tabIndex: 0` / `label: ''` still override it.
|
|
32
|
+
*/
|
|
33
|
+
declare function useAllowClear({ allowClear, clearIcon, contextAllowClear, contextClearIcon, defaultAllowClear, defaultLabel }: UseAllowClearOptions): MergedAllowClear;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { AllowClear, AllowClearConfig, MergedAllowClear, UseAllowClearOptions, useAllowClear as default, useAllowClearLabel };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useLocaleContext } from "../../locale/index.js";
|
|
2
|
+
import fallbackProp from "../fallbackProp.js";
|
|
3
|
+
import { isPlainObject } from "../is.js";
|
|
4
|
+
import localeValues from "../../locale/en_US.js";
|
|
5
|
+
import { createVNode } from "vue";
|
|
6
|
+
import { CloseCircleFilled } from "@antdv-next/icons";
|
|
7
|
+
//#region src/_util/hooks/useAllowClear.tsx
|
|
8
|
+
/** The hook never returns plain `true`: a truthy allowClear is normalized to the object form. */
|
|
9
|
+
/**
|
|
10
|
+
* Getter for the localized clear button label (`locale.global.clear`).
|
|
11
|
+
* Reads the locale context lazily so callers can use it inside their own `computed` without extra reactive objects.
|
|
12
|
+
*/
|
|
13
|
+
function useAllowClearLabel() {
|
|
14
|
+
const { locale } = useLocaleContext();
|
|
15
|
+
return () => locale.value?.global?.clear ?? localeValues.global?.clear;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Merge component- and ConfigProvider-level `allowClear` / `clearIcon`.
|
|
19
|
+
* Each field is resolved on its own (priority: props → context → default), so `allowClear: true`
|
|
20
|
+
* inherits the global config while `disabled: false` / `tabIndex: 0` / `label: ''` still override it.
|
|
21
|
+
*/
|
|
22
|
+
function useAllowClear({ allowClear, clearIcon, contextAllowClear, contextClearIcon, defaultAllowClear, defaultLabel }) {
|
|
23
|
+
if (!(allowClear ?? contextAllowClear ?? defaultAllowClear)) return false;
|
|
24
|
+
const config = isPlainObject(allowClear) ? allowClear : void 0;
|
|
25
|
+
const contextConfig = isPlainObject(contextAllowClear) ? contextAllowClear : void 0;
|
|
26
|
+
return {
|
|
27
|
+
clearIcon: fallbackProp(config?.clearIcon, clearIcon, contextConfig?.clearIcon, contextClearIcon, createVNode(CloseCircleFilled, null, null)),
|
|
28
|
+
disabled: config?.disabled ?? contextConfig?.disabled,
|
|
29
|
+
tabIndex: config?.tabIndex ?? contextConfig?.tabIndex,
|
|
30
|
+
label: config?.label ?? contextConfig?.label ?? defaultLabel
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { useAllowClear as default, useAllowClearLabel };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getSlotPropsFnRun } from "../tools.js";
|
|
2
|
-
import isNonNullable from "../isNonNullable.js";
|
|
3
2
|
import localeValues from "../../locale/en_US.js";
|
|
4
3
|
import useLocale from "../../locale/useLocale.js";
|
|
5
4
|
import { getVNode } from "../vueNode.js";
|
|
6
5
|
import mergeProps$1 from "../extendsObject.js";
|
|
6
|
+
import isNonNullable from "../isNonNullable.js";
|
|
7
7
|
import { computed, createVNode, isVNode, mergeProps, ref, unref } from "vue";
|
|
8
8
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
9
9
|
import { CloseOutlined } from "@antdv-next/icons";
|
|
@@ -62,11 +62,12 @@ function resolveStyleOrClass(value, info) {
|
|
|
62
62
|
* @descZH 合并来自多个来源的 classNames 和 styles,当提供了 `schema` 时,必须提供嵌套的对象结构。
|
|
63
63
|
*/
|
|
64
64
|
function useMergeSemantic(classNamesList, stylesList, info, schema) {
|
|
65
|
+
const resolveLazy = (value) => typeof value === "function" ? value(info.value) : value;
|
|
65
66
|
const resolvedClassNamesList = computed(() => {
|
|
66
|
-
return classNamesList.value.map((classNames) => classNames ?
|
|
67
|
+
return classNamesList.value.map((classNames) => classNames ? resolveLazy(classNames) : void 0);
|
|
67
68
|
});
|
|
68
69
|
const resolvedStylesList = computed(() => {
|
|
69
|
-
return stylesList.value.map((styles) => styles ?
|
|
70
|
+
return stylesList.value.map((styles) => styles ? resolveLazy(styles) : void 0);
|
|
70
71
|
});
|
|
71
72
|
const mergedClassNames = computed(() => useSemanticClassNames(schema?.value, ...resolvedClassNamesList.value));
|
|
72
73
|
const mergedStyles = computed(() => useSemanticStyles(...resolvedStylesList.value));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/_util/omitUndefined.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Copy `obj` without the keys whose value is `undefined`.
|
|
4
|
+
*
|
|
5
|
+
* Vue materialises every declared prop on `props` (unset ones as `undefined`),
|
|
6
|
+
* so spreading `props` into a child forwards dozens of empty keys that the
|
|
7
|
+
* child then has to normalise in `initProps` / `setFullProps` on every mount.
|
|
8
|
+
* Boolean props in this code base default to `undefined` rather than `false`,
|
|
9
|
+
* so leaving an unset key out is equivalent to passing it as `undefined`.
|
|
10
|
+
*/
|
|
11
|
+
declare function omitUndefined<T extends Record<string, any>>(obj: T, omitKeys?: readonly string[]): Partial<T>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { omitUndefined };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/_util/omitUndefined.ts
|
|
2
|
+
/**
|
|
3
|
+
* Copy `obj` without the keys whose value is `undefined`.
|
|
4
|
+
*
|
|
5
|
+
* Vue materialises every declared prop on `props` (unset ones as `undefined`),
|
|
6
|
+
* so spreading `props` into a child forwards dozens of empty keys that the
|
|
7
|
+
* child then has to normalise in `initProps` / `setFullProps` on every mount.
|
|
8
|
+
* Boolean props in this code base default to `undefined` rather than `false`,
|
|
9
|
+
* so leaving an unset key out is equivalent to passing it as `undefined`.
|
|
10
|
+
*/
|
|
11
|
+
function omitUndefined(obj, omitKeys = []) {
|
|
12
|
+
const result = {};
|
|
13
|
+
for (const key in obj) {
|
|
14
|
+
const value = obj[key];
|
|
15
|
+
if (value !== void 0 && !omitKeys.includes(key)) result[key] = value;
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { omitUndefined };
|
package/dist/_util/tools.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { classNames } from "@v-c/util";
|
|
|
3
3
|
//#region src/_util/tools.d.ts
|
|
4
4
|
declare function getSlotPropFn(slots: any, props: any, key: string): any;
|
|
5
5
|
declare function getSlotPropsFnRun(slots: any, props: any, key: string, isNull?: boolean, params?: any): any;
|
|
6
|
+
/** Resolve a slot/prop render prop: slot first, empty slot (undefined / []) falls back to prop; explicit null is kept; function props are invoked, never leaked. */
|
|
7
|
+
declare function getSlotPropsFnRunWithFallback(slots: any, props: any, key: string, params?: any): any;
|
|
6
8
|
declare function toPropsRefs<T extends Record<string, any>, K extends keyof T>(obj: T, ...args: K[]): { [key in K]-?: Ref<T[key]>; };
|
|
7
9
|
/**
|
|
8
10
|
* 返回一个「稳定引用」的事件转发器,调用时实时读取组件当前 vnode 上的监听器。
|
|
@@ -19,4 +21,4 @@ declare function toPropsRefs<T extends Record<string, any>, K extends keyof T>(o
|
|
|
19
21
|
declare function useLiveListener<Args extends any[] = any[], R = any>(name: string): (...args: Args) => R | undefined;
|
|
20
22
|
declare const clsx: typeof classNames;
|
|
21
23
|
//#endregion
|
|
22
|
-
export { clsx, getSlotPropFn, getSlotPropsFnRun, toPropsRefs, useLiveListener };
|
|
24
|
+
export { clsx, getSlotPropFn, getSlotPropsFnRun, getSlotPropsFnRunWithFallback, toPropsRefs, useLiveListener };
|
package/dist/_util/tools.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fallbackProp from "./fallbackProp.js";
|
|
1
2
|
import { getCurrentInstance, toHandlerKey, toRef } from "vue";
|
|
2
3
|
import { classNames } from "@v-c/util";
|
|
3
4
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
@@ -22,6 +23,10 @@ function getSlotPropsFnRun(slots, props, key, isNull = true, params) {
|
|
|
22
23
|
}
|
|
23
24
|
return fn;
|
|
24
25
|
}
|
|
26
|
+
/** Resolve a slot/prop render prop: slot first, empty slot (undefined / []) falls back to prop; explicit null is kept; function props are invoked, never leaked. */
|
|
27
|
+
function getSlotPropsFnRunWithFallback(slots, props, key, params) {
|
|
28
|
+
return fallbackProp(getSlotPropsFnRun(slots, {}, key, false, params), getSlotPropsFnRun({}, props, key, false, params));
|
|
29
|
+
}
|
|
25
30
|
function toPropsRefs(obj, ...args) {
|
|
26
31
|
const _res = {};
|
|
27
32
|
args.forEach((key) => {
|
|
@@ -58,4 +63,4 @@ function useLiveListener(name) {
|
|
|
58
63
|
}
|
|
59
64
|
const clsx = classNames;
|
|
60
65
|
//#endregion
|
|
61
|
-
export { clsx, getSlotPropFn, getSlotPropsFnRun, toPropsRefs, useLiveListener };
|
|
66
|
+
export { clsx, getSlotPropFn, getSlotPropsFnRun, getSlotPropsFnRunWithFallback, toPropsRefs, useLiveListener };
|
package/dist/_util/wave/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useConfig } from "../../config-provider/context.js";
|
|
2
|
+
import { useStyleToken } from "../../theme/util/genStyleUtils.js";
|
|
2
3
|
import style_default from "./style.js";
|
|
3
4
|
import useWave from "./useWave.js";
|
|
4
5
|
import { cloneVNode, computed, defineComponent, isVNode, onBeforeUnmount, onMounted, shallowRef, watch } from "vue";
|
|
@@ -26,9 +27,10 @@ var wave_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
26
27
|
const configCtx = useConfig();
|
|
27
28
|
const containerRef = shallowRef(null);
|
|
28
29
|
const prefixCls = computed(() => configCtx.value.getPrefixCls("wave"));
|
|
29
|
-
const
|
|
30
|
+
const tokenResult = useStyleToken();
|
|
31
|
+
const hashId = style_default(prefixCls, void 0, tokenResult);
|
|
30
32
|
const colorSource = computed(() => props.colorSource);
|
|
31
|
-
const showWave = useWave(containerRef, computed(() => classNames(prefixCls.value, hashId.value)), computed(() => props.component), colorSource);
|
|
33
|
+
const showWave = useWave(containerRef, computed(() => classNames(prefixCls.value, hashId.value)), computed(() => props.component), colorSource, tokenResult);
|
|
32
34
|
const handleEvent = (event) => {
|
|
33
35
|
const node = containerRef.value;
|
|
34
36
|
if (!node) return;
|
|
@@ -1,8 +1,12 @@
|
|
|
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 } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
//#region src/_util/wave/style.d.ts
|
|
4
8
|
interface ComponentToken {}
|
|
5
9
|
interface WaveToken extends FullToken<'Wave'> {}
|
|
6
|
-
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => import("vue").Ref<string, string>;
|
|
10
|
+
declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>, tokenResult?: import("@antdv-next/cssinjs").UseTokenReturn<ComponentTokenMap, AliasToken, SeedToken> | undefined) => import("vue").Ref<string, string>;
|
|
7
11
|
//#endregion
|
|
8
12
|
export { ComponentToken, WaveToken, _default as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { StyleTokenResult } from "../../theme/util/genStyleUtils.js";
|
|
1
2
|
import { ShowWave, WaveComponent } from "./interface.js";
|
|
2
3
|
import { WaveProps } from "./index.js";
|
|
3
4
|
import { Ref } from "vue";
|
|
4
5
|
//#region src/_util/wave/useWave.d.ts
|
|
5
|
-
declare function useWave(nodeRef: Ref<HTMLElement | null | undefined>, className: string | Ref<string>, component?: WaveComponent | Ref<WaveComponent | undefined>, colorSource?: Ref<WaveProps['colorSource']
|
|
6
|
+
declare function useWave(nodeRef: Ref<HTMLElement | null | undefined>, className: string | Ref<string>, component?: WaveComponent | Ref<WaveComponent | undefined>, colorSource?: Ref<WaveProps['colorSource']>, tokenResult?: StyleTokenResult): ShowWave;
|
|
6
7
|
//#endregion
|
|
7
8
|
export { useWave as default };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { useConfig } from "../../config-provider/context.js";
|
|
2
|
-
import
|
|
2
|
+
import { useStyleToken } from "../../theme/util/genStyleUtils.js";
|
|
3
3
|
import { TARGET_CLS } from "./interface.js";
|
|
4
4
|
import showWaveEffect from "./WaveEffect.js";
|
|
5
5
|
import { onBeforeUnmount, ref, unref } from "vue";
|
|
6
6
|
import raf from "@v-c/util/dist/raf";
|
|
7
7
|
//#region src/_util/wave/useWave.ts
|
|
8
|
-
function useWave(nodeRef, className, component, colorSource) {
|
|
8
|
+
function useWave(nodeRef, className, component, colorSource, tokenResult = useStyleToken()) {
|
|
9
9
|
const configCtx = useConfig();
|
|
10
|
-
const
|
|
10
|
+
const token = tokenResult.realToken;
|
|
11
|
+
const hashId = tokenResult.hashId;
|
|
11
12
|
const showWave = (event) => {
|
|
12
13
|
const node = nodeRef.value;
|
|
13
14
|
if (!node) return;
|
|
@@ -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
|
//#region src/affix/style/index.d.ts
|
|
4
8
|
interface ComponentToken {
|
|
@@ -9,6 +13,6 @@ interface ComponentToken {
|
|
|
9
13
|
zIndexPopup: number;
|
|
10
14
|
}
|
|
11
15
|
declare const prepareComponentToken: GetDefaultToken<'Affix'>;
|
|
12
|
-
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>];
|
|
16
|
+
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>];
|
|
13
17
|
//#endregion
|
|
14
18
|
export { ComponentToken, _default as default, prepareComponentToken };
|
package/dist/alert/Alert.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ interface AlertSemanticType {
|
|
|
27
27
|
}
|
|
28
28
|
type AlertClassNamesType = SemanticType<AlertProps, AlertSemanticType['classes']>;
|
|
29
29
|
type AlertStylesType = SemanticType<AlertProps, AlertSemanticType['styles']>;
|
|
30
|
+
type AlertClosableType = boolean | (Exclude<ClosableType, boolean> & {
|
|
31
|
+
onClose?: (e?: MouseEvent) => void;
|
|
32
|
+
afterClose?: () => void;
|
|
33
|
+
});
|
|
30
34
|
type AlertVariant = 'filled' | 'outlined';
|
|
31
35
|
interface AlertProps extends ComponentBaseProps, AlertEmitsProps {
|
|
32
36
|
/** Type of Alert styles, options:`success`, `info`, `warning`, `error` */
|
|
@@ -38,7 +42,7 @@ interface AlertProps extends ComponentBaseProps, AlertEmitsProps {
|
|
|
38
42
|
*/
|
|
39
43
|
variant?: AlertVariant;
|
|
40
44
|
/** Whether Alert can be closed */
|
|
41
|
-
closable?:
|
|
45
|
+
closable?: AlertClosableType;
|
|
42
46
|
/** Content of Alert */
|
|
43
47
|
title?: VueNode;
|
|
44
48
|
/**
|
|
@@ -84,4 +88,4 @@ interface AlertEmitsProps {
|
|
|
84
88
|
}
|
|
85
89
|
declare const Alert: import("vue").DefineSetupFnComponent<AlertProps, AlertEmits, SlotsType<AlertSlots>, AlertProps, import("vue").PublicProps>;
|
|
86
90
|
//#endregion
|
|
87
|
-
export { AlertClassNamesType, AlertEmits, AlertEmitsProps, AlertProps, AlertSemanticType, AlertSlots, AlertStylesType, AlertVariant, Alert as default };
|
|
91
|
+
export { AlertClassNamesType, AlertClosableType, AlertEmits, AlertEmitsProps, AlertProps, AlertSemanticType, AlertSlots, AlertStylesType, AlertVariant, Alert as default };
|