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
package/dist/checkbox/Group.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useBaseConfig } from "../config-provider/context.js";
|
|
2
|
-
import { getAttrStyleAndClass } from "../_util/hooks/useMergeSemantic.js";
|
|
2
|
+
import { getAttrStyleAndClass, useMergeSemantic, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
3
3
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
4
|
+
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
4
5
|
import style_default from "./style/index.js";
|
|
5
6
|
import { useGroupContextProvider } from "./GroupContext.js";
|
|
6
7
|
import InternalCheckbox from "./Checkbox.js";
|
|
7
|
-
import { computed, createVNode, defineComponent, isVNode, mergeDefaults, mergeProps, shallowRef, watch } from "vue";
|
|
8
|
+
import { computed, createVNode, defineComponent, isVNode, mergeDefaults, mergeProps, shallowRef, toRef, watch } from "vue";
|
|
8
9
|
import { clsx } from "@v-c/util";
|
|
9
10
|
import { omit } from "es-toolkit";
|
|
10
11
|
//#region src/checkbox/Group.tsx
|
|
@@ -48,12 +49,30 @@ const CheckboxGroup = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
48
49
|
const groupPrefixCls = computed(() => `${prefixCls.value}-group`);
|
|
49
50
|
const rootCls = useCSSVarCls(prefixCls);
|
|
50
51
|
const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
|
|
52
|
+
const contextDisabled = useDisabledContext();
|
|
53
|
+
const mergedProps = computed(() => ({
|
|
54
|
+
...props,
|
|
55
|
+
options: props.options,
|
|
56
|
+
value: value.value,
|
|
57
|
+
disabled: props.disabled ?? contextDisabled.value
|
|
58
|
+
}));
|
|
59
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic(useToArr(toRef(() => props.classes)), useToArr(toRef(() => props.styles)), useToProps(mergedProps));
|
|
51
60
|
useGroupContextProvider(computed(() => {
|
|
52
61
|
return {
|
|
53
62
|
toggleOption,
|
|
54
63
|
value: value.value,
|
|
55
64
|
disabled: props.disabled,
|
|
56
65
|
name: props.name,
|
|
66
|
+
classes: {
|
|
67
|
+
root: mergedClassNames.value.item,
|
|
68
|
+
icon: mergedClassNames.value.itemIcon,
|
|
69
|
+
label: mergedClassNames.value.itemLabel
|
|
70
|
+
},
|
|
71
|
+
styles: {
|
|
72
|
+
root: mergedStyles.value.item,
|
|
73
|
+
icon: mergedStyles.value.itemIcon,
|
|
74
|
+
label: mergedStyles.value.itemLabel
|
|
75
|
+
},
|
|
57
76
|
registerValue,
|
|
58
77
|
cancelValue
|
|
59
78
|
};
|
|
@@ -64,7 +83,9 @@ const CheckboxGroup = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
64
83
|
"options",
|
|
65
84
|
"rootClass",
|
|
66
85
|
"defaultValue",
|
|
67
|
-
"prefixCls"
|
|
86
|
+
"prefixCls",
|
|
87
|
+
"classes",
|
|
88
|
+
"styles"
|
|
68
89
|
]);
|
|
69
90
|
const children = slots?.default?.();
|
|
70
91
|
const { restAttrs, className, style } = getAttrStyleAndClass(attrs);
|
|
@@ -89,9 +110,9 @@ const CheckboxGroup = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
89
110
|
}), _isSlot(_label) ? _label : { default: () => [_label] });
|
|
90
111
|
}) : children;
|
|
91
112
|
return createVNode("div", mergeProps({
|
|
92
|
-
"class": clsx(groupPrefixCls.value, { [`${groupPrefixCls.value}-rtl`]: direction.value === "rtl" }, className, rootClass, cssVarCls.value, rootCls.value, hashId.value),
|
|
113
|
+
"class": clsx(groupPrefixCls.value, { [`${groupPrefixCls.value}-rtl`]: direction.value === "rtl" }, className, rootClass, mergedClassNames.value.root, cssVarCls.value, rootCls.value, hashId.value),
|
|
93
114
|
"role": role,
|
|
94
|
-
"style": style
|
|
115
|
+
"style": [mergedStyles.value.root, style]
|
|
95
116
|
}, restAttrs), [childrenNode]);
|
|
96
117
|
};
|
|
97
118
|
}, {
|
|
@@ -116,6 +137,14 @@ const CheckboxGroup = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
116
137
|
type: String,
|
|
117
138
|
required: false
|
|
118
139
|
},
|
|
140
|
+
classes: {
|
|
141
|
+
type: [Object, Function],
|
|
142
|
+
required: false
|
|
143
|
+
},
|
|
144
|
+
styles: {
|
|
145
|
+
type: [Object, Function],
|
|
146
|
+
required: false
|
|
147
|
+
},
|
|
119
148
|
"onUpdate:value": {
|
|
120
149
|
type: Function,
|
|
121
150
|
required: false
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CheckboxSemanticClassNames, CheckboxSemanticStyles } from "./Checkbox.js";
|
|
1
2
|
import { CheckboxOptionType } from "./Group.js";
|
|
2
3
|
import { Ref } from "vue";
|
|
3
4
|
//#region src/checkbox/GroupContext.d.ts
|
|
@@ -6,6 +7,8 @@ interface CheckboxGroupContext {
|
|
|
6
7
|
toggleOption?: (option: CheckboxOptionType) => void;
|
|
7
8
|
value?: any;
|
|
8
9
|
disabled?: boolean;
|
|
10
|
+
classes?: CheckboxSemanticClassNames;
|
|
11
|
+
styles?: CheckboxSemanticStyles;
|
|
9
12
|
registerValue: (val: any) => void;
|
|
10
13
|
cancelValue: (val: any) => void;
|
|
11
14
|
}
|
package/dist/checkbox/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import InternalCheckbox, { CheckboxEmits, CheckboxProps, CheckboxSlots } from "./Checkbox.js";
|
|
2
|
-
import CheckboxGroup, { CheckboxGroupEmits, CheckboxGroupProps, CheckboxGroupSlots, CheckboxOptionType } from "./Group.js";
|
|
3
|
-
export { type CheckboxEmits, CheckboxGroup, type CheckboxGroupEmits, type CheckboxGroupProps, type CheckboxGroupSlots, type CheckboxOptionType, type CheckboxProps, type CheckboxSlots, InternalCheckbox as default };
|
|
2
|
+
import CheckboxGroup, { CheckboxGroupClassNamesType, CheckboxGroupEmits, CheckboxGroupProps, CheckboxGroupSemanticClassNames, CheckboxGroupSemanticStyles, CheckboxGroupSlots, CheckboxGroupStylesType, CheckboxOptionType } from "./Group.js";
|
|
3
|
+
export { type CheckboxEmits, CheckboxGroup, type CheckboxGroupClassNamesType, type CheckboxGroupEmits, type CheckboxGroupProps, type CheckboxGroupSemanticClassNames, type CheckboxGroupSemanticStyles, type CheckboxGroupSlots, type CheckboxGroupStylesType, type CheckboxOptionType, type CheckboxProps, type CheckboxSlots, InternalCheckbox as default };
|
|
@@ -1,3 +1,6 @@
|
|
|
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";
|
|
2
5
|
import { GenerateStyle } from "../../theme/interface/index.js";
|
|
3
6
|
import "../../theme/internal.js";
|
|
@@ -21,6 +24,6 @@ interface CheckboxToken extends FullToken<'Checkbox'> {
|
|
|
21
24
|
}
|
|
22
25
|
declare const genCheckboxStyle: GenerateStyle<CheckboxToken>;
|
|
23
26
|
declare function getStyle(prefixCls: string, token: FullToken<'Checkbox'>): import("@antdv-next/cssinjs").CSSInterpolation;
|
|
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>];
|
|
27
|
+
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
28
|
//#endregion
|
|
26
29
|
export { ComponentToken, _default as default, genCheckboxStyle, getStyle };
|
|
@@ -1,3 +1,6 @@
|
|
|
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";
|
|
2
5
|
import { GenerateStyle } from "../../theme/interface/index.js";
|
|
3
6
|
import "../../theme/internal.js";
|
|
@@ -66,6 +69,6 @@ type CollapseToken = FullToken<'Collapse'> & {
|
|
|
66
69
|
};
|
|
67
70
|
declare const genBaseStyle: GenerateStyle<CollapseToken, CSSObject>;
|
|
68
71
|
declare const prepareComponentToken: GetDefaultToken<'Collapse'>;
|
|
69
|
-
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>];
|
|
72
|
+
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>];
|
|
70
73
|
//#endregion
|
|
71
74
|
export { ComponentToken, _default as default, genBaseStyle, prepareComponentToken };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useFormItemInputContext } from "../form/context.js";
|
|
1
2
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
3
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
3
4
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
@@ -11,7 +12,6 @@ import { formatColorValue, genAlphaColor, generateColor, getColorAlpha } from ".
|
|
|
11
12
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
12
13
|
import genPurePanel from "../_util/PurePanel.js";
|
|
13
14
|
import { getStatusClassNames } from "../_util/statusUtils.js";
|
|
14
|
-
import { useFormItemInputContext } from "../form/context.js";
|
|
15
15
|
import Popover from "../popover/index.js";
|
|
16
16
|
import ColorPickerPanel_default from "./ColorPickerPanel.js";
|
|
17
17
|
import ColorTrigger_default from "./components/ColorTrigger.js";
|
|
@@ -118,11 +118,7 @@ const ColorPicker = /* @__PURE__ */ defineComponent((props, { slots, expose, emi
|
|
|
118
118
|
const rootCls = useCSSVarCls(prefixCls);
|
|
119
119
|
const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
|
|
120
120
|
const handleClear = () => {
|
|
121
|
-
const cleared = new AggregationColor("");
|
|
122
|
-
setColor(cleared);
|
|
123
121
|
emit("clear");
|
|
124
|
-
emit("change", cleared, cleared.toCssString());
|
|
125
|
-
emit("update:value", valueFormat.value ? formatColorValue(cleared, valueFormat.value) : cleared.toCssString());
|
|
126
122
|
};
|
|
127
123
|
expose({
|
|
128
124
|
focus: () => {},
|
|
@@ -130,7 +126,7 @@ const ColorPicker = /* @__PURE__ */ defineComponent((props, { slots, expose, emi
|
|
|
130
126
|
});
|
|
131
127
|
return () => {
|
|
132
128
|
const { rootClass, trigger, placement, getPopupContainer, autoAdjustOverflow, destroyOnHidden } = props;
|
|
133
|
-
const { className, style, restAttrs } = getAttrStyleAndClass(attrs);
|
|
129
|
+
const { className, style, restAttrs } = getAttrStyleAndClass(attrs, void 0, props);
|
|
134
130
|
const children = filterEmpty(slots?.default?.() ?? []);
|
|
135
131
|
const showText = slots?.showText ?? props?.showText;
|
|
136
132
|
const panelRender = slots?.panelRender ?? props?.panelRender;
|
|
@@ -151,8 +147,7 @@ const ColorPicker = /* @__PURE__ */ defineComponent((props, { slots, expose, emi
|
|
|
151
147
|
autoAdjustOverflow,
|
|
152
148
|
destroyOnHidden
|
|
153
149
|
};
|
|
154
|
-
const
|
|
155
|
-
const panelNode = createVNode(ContextIsolator, { "form": true }, { default: () => [createVNode(ColorPickerPanel_default, mergeProps(restAttrs, {
|
|
150
|
+
const panelNode = createVNode(ContextIsolator, { "form": true }, { default: () => [createVNode(ColorPickerPanel_default, mergeProps({
|
|
156
151
|
"prefixCls": prefixCls.value,
|
|
157
152
|
"presets": presets.value,
|
|
158
153
|
"panelRender": panelRender,
|
|
@@ -176,19 +171,20 @@ const ColorPicker = /* @__PURE__ */ defineComponent((props, { slots, expose, emi
|
|
|
176
171
|
"classes": mergedClassNames.value,
|
|
177
172
|
"styles": mergedStyles.value
|
|
178
173
|
}), null)] });
|
|
179
|
-
const triggerNode = children.length ? children : createVNode(ColorTrigger_default, {
|
|
174
|
+
const triggerNode = children.length ? children : createVNode(ColorTrigger_default, mergeProps({
|
|
180
175
|
"activeIndex": popupOpen.value ? activeIndex.value : -1,
|
|
181
176
|
"open": popupOpen.value,
|
|
182
177
|
"className": mergedCls,
|
|
183
178
|
"style": style,
|
|
184
179
|
"prefixCls": prefixCls.value,
|
|
185
180
|
"disabled": mergedDisabled.value,
|
|
186
|
-
"showText":
|
|
187
|
-
"format": formatValue.value
|
|
181
|
+
"showText": showText,
|
|
182
|
+
"format": formatValue.value
|
|
183
|
+
}, restAttrs, {
|
|
188
184
|
"color": mergedColor.value,
|
|
189
185
|
"classes": mergedClassNames.value,
|
|
190
186
|
"styles": mergedStyles.value
|
|
191
|
-
}, null);
|
|
187
|
+
}), null);
|
|
192
188
|
return createVNode(Popover, mergeProps({
|
|
193
189
|
"classes": { root: mergedPopupCls },
|
|
194
190
|
"styles": {
|
|
@@ -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 } from "../../theme/interface/cssinjs-utils.js";
|
|
5
|
+
import "../../theme/interface/index.js";
|
|
2
6
|
import "../../theme/internal.js";
|
|
3
7
|
//#region src/color-picker/style/index.d.ts
|
|
4
8
|
interface ComponentToken {}
|
|
@@ -59,6 +63,6 @@ declare function genActiveStyle(token: ColorPickerToken, borderColor: string, ou
|
|
|
59
63
|
boxShadow: string;
|
|
60
64
|
outline: number;
|
|
61
65
|
};
|
|
62
|
-
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>];
|
|
66
|
+
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>];
|
|
63
67
|
//#endregion
|
|
64
68
|
export { ColorPickerToken, ComponentToken, _default as default, genActiveStyle };
|
|
@@ -12,7 +12,7 @@ const genInputStyle = (token) => {
|
|
|
12
12
|
paddingInlineStart: paddingXXS,
|
|
13
13
|
paddingInlineEnd: 0
|
|
14
14
|
},
|
|
15
|
-
[`${antCls}-input-number-
|
|
15
|
+
[`${antCls}-input-number-actions`]: { width: colorPickerInputNumberHandleWidth }
|
|
16
16
|
},
|
|
17
17
|
[`${componentCls}-steppers${componentCls}-alpha-input`]: {
|
|
18
18
|
flex: `0 0 ${unit(colorPickerAlphaInputWidth)}`,
|
package/dist/components.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import Pagination from "./pagination/Pagination.js";
|
|
|
18
18
|
import { PaginationProps } from "./pagination/index.js";
|
|
19
19
|
import Popover, { PopoverEmits, PopoverProps, PopoverRef, PopoverSlots } from "./popover/index.js";
|
|
20
20
|
import Popconfirm, { PopconfirmEmits, PopconfirmProps, PopconfirmSlots } from "./popconfirm/index.js";
|
|
21
|
+
import { SplitterEmits, SplitterSlots } from "./splitter/interface.js";
|
|
21
22
|
import _default$11, { SpinProps, SpinRef, SpinSlots } from "./spin/index.js";
|
|
22
23
|
import InternalCheckbox, { CheckboxEmits, CheckboxProps, CheckboxSlots } from "./checkbox/Checkbox.js";
|
|
23
24
|
import CheckboxGroup, { CheckboxGroupEmits, CheckboxGroupProps, CheckboxGroupSlots, CheckboxOptionType } from "./checkbox/Group.js";
|
|
@@ -110,7 +111,6 @@ import "./skeleton/index.js";
|
|
|
110
111
|
import Slider, { SliderEmits, SliderProps, SliderRef } from "./slider/index.js";
|
|
111
112
|
import { SpaceCompactProps, SpaceCompactRef } from "./space/Compact.js";
|
|
112
113
|
import Space, { SpaceAddon, SpaceCompact, SpaceProps, SpaceSize, SpaceSlots } from "./space/index.js";
|
|
113
|
-
import { SplitterEmits, SplitterSlots } from "./splitter/interface.js";
|
|
114
114
|
import Splitter, { SplitterRef } from "./splitter/Splitter.js";
|
|
115
115
|
import { SplitterPanel, SplitterProps } from "./splitter/index.js";
|
|
116
116
|
import { StatisticRef } from "./statistic/Statistic.js";
|
|
@@ -90,7 +90,7 @@ import { TreeSelectProps } from "../tree-select/index.js";
|
|
|
90
90
|
import { BlockProps } from "../typography/interface.js";
|
|
91
91
|
import { ButtonProps } from "../button/Button.js";
|
|
92
92
|
import "../button/index.js";
|
|
93
|
-
import {
|
|
93
|
+
import { CSSProperties, Ref } from "vue";
|
|
94
94
|
import { DerivativeFunc } from "@antdv-next/cssinjs";
|
|
95
95
|
import { MoreProps } from "@v-c/tabs";
|
|
96
96
|
//#region src/config-provider/context.d.ts
|
|
@@ -232,10 +232,7 @@ type ButtonConfig = ComponentStyleConfig & Pick<ButtonProps, 'classes' | 'styles
|
|
|
232
232
|
loadingIcon?: VueNode;
|
|
233
233
|
};
|
|
234
234
|
type FlexConfig = ComponentStyleConfig & Pick<FlexProps, 'vertical'>;
|
|
235
|
-
type AlertConfig = ComponentStyleConfig & Pick<AlertProps, 'variant' | 'closeIcon' | 'classes' | 'styles'> & {
|
|
236
|
-
closable?: boolean | ({
|
|
237
|
-
closeIcon?: VueNode;
|
|
238
|
-
} & AriaAttributes);
|
|
235
|
+
type AlertConfig = ComponentStyleConfig & Pick<AlertProps, 'variant' | 'closeIcon' | 'closable' | 'classes' | 'styles'> & {
|
|
239
236
|
successIcon?: VueNode;
|
|
240
237
|
infoIcon?: VueNode;
|
|
241
238
|
warningIcon?: VueNode;
|
|
@@ -343,9 +340,7 @@ type UploadConfig = ComponentStyleConfig & Pick<UploadProps, 'classes' | 'styles
|
|
|
343
340
|
type DatePickerConfig = ComponentStyleConfig & Pick<DatePickerProps, 'classes' | 'styles' | 'variant' | 'suffixIcon' | 'allowClear'> & {
|
|
344
341
|
clearIcon?: any;
|
|
345
342
|
};
|
|
346
|
-
type RangePickerConfig = ComponentStyleConfig & Pick<RangePickerProps, '
|
|
347
|
-
clearIcon?: any;
|
|
348
|
-
};
|
|
343
|
+
type RangePickerConfig = ComponentStyleConfig & Pick<RangePickerProps, 'variant' | 'separator'>;
|
|
349
344
|
type TimePickerConfig = ComponentStyleConfig & Pick<TimePickerProps, 'classes' | 'styles' | 'variant' | 'suffixIcon' | 'allowClear'> & {
|
|
350
345
|
clearIcon?: any;
|
|
351
346
|
};
|
|
@@ -481,13 +476,13 @@ declare function useConfig(): Ref<ConfigConsumerProps, ConfigConsumerProps>;
|
|
|
481
476
|
*/
|
|
482
477
|
type ConfigRefs<R extends ConfigConsumerProps = ConfigConsumerProps> = { [K in keyof R]?: R[K] extends ((...args: any[]) => any) ? R[K] : R[K] extends object | undefined ? Ref<R[K]> : Ref<R[K]>; };
|
|
483
478
|
declare function useBaseConfig<K extends string>(suffixCls?: K, props?: ComponentBaseProps): {
|
|
484
|
-
result:
|
|
485
|
-
modal:
|
|
486
|
-
timeline:
|
|
487
|
-
notification:
|
|
479
|
+
result: Readonly<Ref<ResultConfig | undefined, ResultConfig | undefined>>;
|
|
480
|
+
modal: Readonly<Ref<ModalConfig | undefined, ModalConfig | undefined>>;
|
|
481
|
+
timeline: Readonly<Ref<TimelineConfig | undefined, TimelineConfig | undefined>>;
|
|
482
|
+
notification: Readonly<Ref<NotificationConfig | undefined, NotificationConfig | undefined>>;
|
|
488
483
|
getPrefixCls: (suffixCls?: string, prefixCls?: string) => string;
|
|
489
|
-
prefixCls:
|
|
490
|
-
direction:
|
|
484
|
+
prefixCls: Readonly<Ref<string, string>>;
|
|
485
|
+
direction: Readonly<Ref<DirectionType, DirectionType>>;
|
|
491
486
|
getPopupContainer: ((triggerNode?: HTMLElement) => HTMLElement) | undefined;
|
|
492
487
|
};
|
|
493
488
|
/**
|
|
@@ -503,16 +498,16 @@ declare function useComponentBaseConfig<T extends keyof ConfigComponentProps, K
|
|
|
503
498
|
classes?: any;
|
|
504
499
|
styles?: any;
|
|
505
500
|
} & ConfigComponentProps[T] extends (infer T_1) ? { [Key in keyof T_1]-?: Ref<T_1[Key], T_1[Key]>; } : never) & {
|
|
506
|
-
direction:
|
|
507
|
-
prefixCls:
|
|
508
|
-
rootPrefixCls:
|
|
501
|
+
direction: Readonly<Ref<DirectionType, DirectionType>>;
|
|
502
|
+
prefixCls: Readonly<Ref<string, string>>;
|
|
503
|
+
rootPrefixCls: Readonly<Ref<string, string>>;
|
|
509
504
|
getPopupContainer: ((triggerNode?: HTMLElement) => HTMLElement) | undefined;
|
|
510
505
|
getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
|
|
511
506
|
getTargetContainer: (() => HTMLElement) | undefined;
|
|
512
|
-
virtual:
|
|
513
|
-
renderEmpty:
|
|
514
|
-
popupMatchSelectWidth:
|
|
515
|
-
popupOverflow:
|
|
507
|
+
virtual: Readonly<Ref<boolean | undefined, boolean | undefined>>;
|
|
508
|
+
renderEmpty: Readonly<Ref<RenderEmptyHandler | undefined, RenderEmptyHandler | undefined>>;
|
|
509
|
+
popupMatchSelectWidth: Readonly<Ref<boolean | undefined, boolean | undefined>>;
|
|
510
|
+
popupOverflow: Readonly<Ref<PopupOverflow | undefined, PopupOverflow | undefined>>;
|
|
516
511
|
};
|
|
517
512
|
//#endregion
|
|
518
513
|
export { AlertConfig, AnchorStyleConfig, BadgeConfig, BreadcrumbConfig, ButtonConfig, CSPConfig, CalendarConfig, CardConfig, CardMetaConfig, CascaderConfig, CheckboxConfig, CollapseConfig, ColorPickerConfig, ComponentBaseProps, ComponentStyleConfig, ConfigComponentProps, ConfigConsumerProps, ConfigRefs, DatePickerConfig, DescriptionsConfig, DirectionType, DividerConfig, DrawerConfig, DropdownConfig, EmptyConfig, FlexConfig, FloatButtonConfig, FloatButtonGroupConfig, FormConfig, ImageConfig, InputConfig, InputNumberConfig, InputPasswordConfig, InputSearchConfig, ListyConfig, MappingAlgorithm, MasonryConfig, MentionsConfig, MenuConfig, ModalConfig, NotificationConfig, OTPConfig, PaginationConfig, PopconfirmConfig, PopoverConfig, PopupOverflow, ProgressConfig, QRcodeConfig, RadioConfig, RangePickerConfig, ResultConfig, RibbonConfig, SegmentedConfig, SelectConfig, SkeletonConfig, SliderConfig, SpaceConfig, SpinConfig, SplitterConfig, StatisticConfig, StepsConfig, SwitchStyleConfig, TableConfig, TabsConfig, TabsMoreConfig, TagConfig, TextAreaConfig, Theme, ThemeConfig, TimePickerConfig, TimelineConfig, TooltipConfig, TooltipUniqueConfig, TourConfig, TransferConfig, TreeConfig, TreeSelectConfig, TriggerType, TypographyConfig, UploadConfig, Variant, Variants, WaveConfig, defaultIconPrefixCls, defaultPrefixCls, useBaseConfig, useComponentBaseConfig, useComponentConfig, useConfig, useConfigProvider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, inject, provide, ref } from "vue";
|
|
1
|
+
import { computed, inject, provide, ref, toRef } from "vue";
|
|
2
2
|
//#region src/config-provider/context.ts
|
|
3
3
|
const defaultPrefixCls = "ant";
|
|
4
4
|
const defaultIconPrefixCls = "anticon";
|
|
@@ -17,26 +17,23 @@ function defaultGetPrefixCls(suffixCls, customizePrefixCls) {
|
|
|
17
17
|
if (customizePrefixCls) return customizePrefixCls;
|
|
18
18
|
return suffixCls ? `ant-${suffixCls}` : "ant";
|
|
19
19
|
}
|
|
20
|
+
const defaultConfigRef = ref({
|
|
21
|
+
getPrefixCls: defaultGetPrefixCls,
|
|
22
|
+
iconPrefixCls: defaultIconPrefixCls
|
|
23
|
+
});
|
|
20
24
|
function useConfig() {
|
|
21
|
-
return inject(ConfigConsumerKey,
|
|
22
|
-
getPrefixCls: defaultGetPrefixCls,
|
|
23
|
-
iconPrefixCls: defaultIconPrefixCls
|
|
24
|
-
}));
|
|
25
|
+
return inject(ConfigConsumerKey, defaultConfigRef);
|
|
25
26
|
}
|
|
26
27
|
function useBaseConfig(suffixCls, props) {
|
|
27
28
|
const config = useConfig();
|
|
28
29
|
return {
|
|
29
|
-
result:
|
|
30
|
-
modal:
|
|
31
|
-
timeline:
|
|
32
|
-
notification:
|
|
30
|
+
result: toRef(() => config.value?.result),
|
|
31
|
+
modal: toRef(() => config.value?.modal),
|
|
32
|
+
timeline: toRef(() => config.value?.timeline),
|
|
33
|
+
notification: toRef(() => config.value?.notification),
|
|
33
34
|
getPrefixCls: (suffixCls, prefixCls) => config.value?.getPrefixCls(suffixCls, prefixCls),
|
|
34
|
-
prefixCls:
|
|
35
|
-
|
|
36
|
-
}),
|
|
37
|
-
direction: computed(() => {
|
|
38
|
-
return config.value?.direction;
|
|
39
|
-
}),
|
|
35
|
+
prefixCls: toRef(() => config.value?.getPrefixCls(suffixCls, props?.prefixCls)),
|
|
36
|
+
direction: toRef(() => config.value?.direction),
|
|
40
37
|
getPopupContainer: config?.value.getPopupContainer
|
|
41
38
|
};
|
|
42
39
|
}
|
|
@@ -65,37 +62,34 @@ function useComponentConfig(propName) {
|
|
|
65
62
|
}
|
|
66
63
|
function useComponentBaseConfig(propName, props, keys, suffixCls) {
|
|
67
64
|
const context = useConfig();
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
});
|
|
71
|
-
const toRefs = (propValues) => {
|
|
65
|
+
const getPropValue = () => context.value[propName];
|
|
66
|
+
const toRefs = (getPropValues) => {
|
|
72
67
|
const result = {
|
|
73
|
-
classes:
|
|
74
|
-
styles:
|
|
75
|
-
class:
|
|
76
|
-
style:
|
|
68
|
+
classes: toRef(() => getPropValues()?.classes ?? EMPTY_OBJECT),
|
|
69
|
+
styles: toRef(() => getPropValues()?.styles ?? EMPTY_OBJECT),
|
|
70
|
+
class: toRef(() => getPropValues()?.class),
|
|
71
|
+
style: toRef(() => getPropValues()?.style)
|
|
72
|
+
};
|
|
73
|
+
const addKey = (key) => {
|
|
74
|
+
if (!result[key]) result[key] = toRef(() => getPropValues()?.[key]);
|
|
77
75
|
};
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (!result[key]) result[key] = computed(() => propValues.value?.[key]);
|
|
82
|
-
});
|
|
76
|
+
const current = getPropValues();
|
|
77
|
+
if (current) Object.keys(current).forEach(addKey);
|
|
78
|
+
keys?.forEach((key) => addKey(key));
|
|
83
79
|
return result;
|
|
84
80
|
};
|
|
85
81
|
return {
|
|
86
|
-
...toRefs(
|
|
87
|
-
direction:
|
|
88
|
-
prefixCls:
|
|
89
|
-
|
|
90
|
-
}),
|
|
91
|
-
rootPrefixCls: computed(() => context.value?.getPrefixCls()),
|
|
82
|
+
...toRefs(getPropValue),
|
|
83
|
+
direction: toRef(() => context.value.direction),
|
|
84
|
+
prefixCls: toRef(() => context.value?.getPrefixCls(suffixCls ?? propName, props?.prefixCls)),
|
|
85
|
+
rootPrefixCls: toRef(() => context.value?.getPrefixCls()),
|
|
92
86
|
getPopupContainer: context.value.getPopupContainer,
|
|
93
87
|
getPrefixCls: context.value.getPrefixCls,
|
|
94
88
|
getTargetContainer: context.value.getTargetContainer,
|
|
95
|
-
virtual:
|
|
96
|
-
renderEmpty:
|
|
97
|
-
popupMatchSelectWidth:
|
|
98
|
-
popupOverflow:
|
|
89
|
+
virtual: toRef(() => context.value.virtual),
|
|
90
|
+
renderEmpty: toRef(() => context.value.renderEmpty),
|
|
91
|
+
popupMatchSelectWidth: toRef(() => context.value.popupMatchSelectWidth),
|
|
92
|
+
popupOverflow: toRef(() => context.value.popupOverflow)
|
|
99
93
|
};
|
|
100
94
|
}
|
|
101
95
|
//#endregion
|
|
@@ -4,7 +4,7 @@ import { ColumnType } from "../table/interface.js";
|
|
|
4
4
|
import "../table/index.js";
|
|
5
5
|
import { Locale } from "../locale/index.js";
|
|
6
6
|
import { RenderEmptyHandler } from "./defaultRenderEmpty.js";
|
|
7
|
-
import { AlertConfig, AnchorStyleConfig, BadgeConfig, BreadcrumbConfig, ButtonConfig, CSPConfig, CalendarConfig, CardConfig, CascaderConfig, CheckboxConfig, CollapseConfig, ColorPickerConfig, ComponentStyleConfig, DatePickerConfig, DescriptionsConfig, DirectionType, DividerConfig, DrawerConfig, DropdownConfig, EmptyConfig, FlexConfig, FloatButtonConfig, FloatButtonGroupConfig, FormConfig, ImageConfig, InputConfig, InputNumberConfig, InputPasswordConfig, InputSearchConfig, ListyConfig, MasonryConfig, MentionsConfig, MenuConfig, ModalConfig, NotificationConfig, OTPConfig, PaginationConfig, PopconfirmConfig, PopoverConfig, PopupOverflow, ProgressConfig, RadioConfig, RangePickerConfig, ResultConfig, SegmentedConfig, SelectConfig, SkeletonConfig, SliderConfig, SpaceConfig, SpinConfig, SplitterConfig, StatisticConfig, StepsConfig, SwitchStyleConfig, TableConfig, TabsConfig, TagConfig, TextAreaConfig, ThemeConfig, TimePickerConfig, TimelineConfig, TooltipConfig, TourConfig, TransferConfig, TreeConfig, TreeSelectConfig, TypographyConfig, UploadConfig, Variant, WaveConfig } from "./context.js";
|
|
7
|
+
import { AlertConfig, AnchorStyleConfig, BadgeConfig, BreadcrumbConfig, ButtonConfig, CSPConfig, CalendarConfig, CardConfig, CardMetaConfig, CascaderConfig, CheckboxConfig, CollapseConfig, ColorPickerConfig, ComponentStyleConfig, DatePickerConfig, DescriptionsConfig, DirectionType, DividerConfig, DrawerConfig, DropdownConfig, EmptyConfig, FlexConfig, FloatButtonConfig, FloatButtonGroupConfig, FormConfig, ImageConfig, InputConfig, InputNumberConfig, InputPasswordConfig, InputSearchConfig, ListyConfig, MasonryConfig, MentionsConfig, MenuConfig, ModalConfig, NotificationConfig, OTPConfig, PaginationConfig, PopconfirmConfig, PopoverConfig, PopupOverflow, ProgressConfig, RadioConfig, RangePickerConfig, ResultConfig, RibbonConfig, SegmentedConfig, SelectConfig, SkeletonConfig, SliderConfig, SpaceConfig, SpinConfig, SplitterConfig, StatisticConfig, StepsConfig, SwitchStyleConfig, TableConfig, TabsConfig, TagConfig, TextAreaConfig, ThemeConfig, TimePickerConfig, TimelineConfig, TooltipConfig, TourConfig, TransferConfig, TreeConfig, TreeSelectConfig, TypographyConfig, UploadConfig, Variant, WaveConfig } from "./context.js";
|
|
8
8
|
//#region src/config-provider/define.d.ts
|
|
9
9
|
interface ConfigProviderProps {
|
|
10
10
|
getTargetContainer?: () => HTMLElement | Window;
|
|
@@ -89,6 +89,7 @@ interface ConfigProviderProps {
|
|
|
89
89
|
badge?: BadgeConfig;
|
|
90
90
|
radio?: RadioConfig;
|
|
91
91
|
rate?: ComponentStyleConfig;
|
|
92
|
+
ribbon?: RibbonConfig;
|
|
92
93
|
switch?: SwitchStyleConfig;
|
|
93
94
|
transfer?: TransferConfig;
|
|
94
95
|
avatar?: ComponentStyleConfig;
|
|
@@ -96,6 +97,7 @@ interface ConfigProviderProps {
|
|
|
96
97
|
tag?: TagConfig;
|
|
97
98
|
table?: TableConfig;
|
|
98
99
|
card?: CardConfig;
|
|
100
|
+
cardMeta?: CardMetaConfig;
|
|
99
101
|
tabs?: TabsConfig;
|
|
100
102
|
timeline?: TimelineConfig;
|
|
101
103
|
timePicker?: TimePickerConfig;
|
|
@@ -3,6 +3,9 @@ import { Ref } from "vue";
|
|
|
3
3
|
/**
|
|
4
4
|
* This hook is only for cssVar to add root className for components.
|
|
5
5
|
* If root ClassName is needed, this hook could be refactored with `-root`
|
|
6
|
+
*
|
|
7
|
+
* antd 6 always runs with CSS variables enabled (`useToken()` always yields a
|
|
8
|
+
* cssVar config), so the class is unconditional and no token lookup is needed.
|
|
6
9
|
* @param prefixCls
|
|
7
10
|
*/
|
|
8
11
|
declare function useCSSVarCls(prefixCls: Ref<string>): import("vue").ComputedRef<string>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import useToken from "../../theme/useToken.js";
|
|
2
1
|
import { computed } from "vue";
|
|
3
2
|
//#region src/config-provider/hooks/useCSSVarCls.ts
|
|
4
3
|
/**
|
|
5
4
|
* This hook is only for cssVar to add root className for components.
|
|
6
5
|
* If root ClassName is needed, this hook could be refactored with `-root`
|
|
6
|
+
*
|
|
7
|
+
* antd 6 always runs with CSS variables enabled (`useToken()` always yields a
|
|
8
|
+
* cssVar config), so the class is unconditional and no token lookup is needed.
|
|
7
9
|
* @param prefixCls
|
|
8
10
|
*/
|
|
9
11
|
function useCSSVarCls(prefixCls) {
|
|
10
|
-
|
|
11
|
-
return computed(() => cssVar?.value ? `${prefixCls.value}-css-var` : "");
|
|
12
|
+
return computed(() => `${prefixCls.value}-css-var`);
|
|
12
13
|
}
|
|
13
14
|
//#endregion
|
|
14
15
|
export { useCSSVarCls as default };
|
|
@@ -30,8 +30,8 @@ declare function globalConfig(): {
|
|
|
30
30
|
getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
|
|
31
31
|
getIconPrefixCls: typeof getGlobalIconPrefixCls;
|
|
32
32
|
getRootPrefixCls: () => string;
|
|
33
|
-
getTheme: () =>
|
|
34
|
-
theme: import("vue").ComputedRef<
|
|
33
|
+
getTheme: () => Theme | ThemeConfig;
|
|
34
|
+
theme: import("vue").ComputedRef<Theme | ThemeConfig>;
|
|
35
35
|
locale: Locale | undefined;
|
|
36
36
|
holderRender: holderRenderType | undefined;
|
|
37
37
|
readonly appContext: AppContext | undefined;
|
|
@@ -154,9 +154,16 @@ const ProviderChildren = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
154
154
|
theme: mergedTheme.value,
|
|
155
155
|
direction: props.direction,
|
|
156
156
|
virtual: props.virtual,
|
|
157
|
+
popupMatchSelectWidth: props.popupMatchSelectWidth,
|
|
158
|
+
popupOverflow: props.popupOverflow,
|
|
157
159
|
locale: locale.value || props.legacyLocale,
|
|
158
160
|
space: props.space,
|
|
159
|
-
variant: props.variant
|
|
161
|
+
variant: props.variant,
|
|
162
|
+
calendar: props.calendar,
|
|
163
|
+
carousel: props.carousel,
|
|
164
|
+
cardMeta: props.cardMeta,
|
|
165
|
+
ribbon: props.ribbon,
|
|
166
|
+
warning: props.warning
|
|
160
167
|
};
|
|
161
168
|
const config = { ...parentConfig };
|
|
162
169
|
Object.keys(baseConfig).forEach((key) => {
|
|
@@ -515,6 +522,10 @@ const ProviderChildren = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
515
522
|
type: Object,
|
|
516
523
|
required: false
|
|
517
524
|
},
|
|
525
|
+
ribbon: {
|
|
526
|
+
type: Object,
|
|
527
|
+
required: false
|
|
528
|
+
},
|
|
518
529
|
switch: {
|
|
519
530
|
type: Object,
|
|
520
531
|
required: false
|
|
@@ -543,6 +554,10 @@ const ProviderChildren = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
543
554
|
type: Object,
|
|
544
555
|
required: false
|
|
545
556
|
},
|
|
557
|
+
cardMeta: {
|
|
558
|
+
type: Object,
|
|
559
|
+
required: false
|
|
560
|
+
},
|
|
546
561
|
tabs: {
|
|
547
562
|
type: Object,
|
|
548
563
|
required: false
|
|
@@ -883,6 +898,10 @@ const ConfigProvider = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
883
898
|
type: Object,
|
|
884
899
|
required: false
|
|
885
900
|
},
|
|
901
|
+
ribbon: {
|
|
902
|
+
type: Object,
|
|
903
|
+
required: false
|
|
904
|
+
},
|
|
886
905
|
switch: {
|
|
887
906
|
type: Object,
|
|
888
907
|
required: false
|
|
@@ -911,6 +930,10 @@ const ConfigProvider = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
911
930
|
type: Object,
|
|
912
931
|
required: false
|
|
913
932
|
},
|
|
933
|
+
cardMeta: {
|
|
934
|
+
type: Object,
|
|
935
|
+
required: false
|
|
936
|
+
},
|
|
914
937
|
tabs: {
|
|
915
938
|
type: Object,
|
|
916
939
|
required: false
|