antdv-next 1.6.0 → 1.7.1
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/hooks/useAllowClear.d.ts +22 -6
- package/dist/_util/hooks/useAllowClear.js +24 -6
- package/dist/_util/hooks/useClosable.js +1 -1
- package/dist/_util/tools.d.ts +3 -1
- package/dist/_util/tools.js +6 -1
- package/dist/_util/vueNode.d.ts +17 -3
- package/dist/_util/vueNode.js +17 -1
- package/dist/affix/index.js +12 -9
- package/dist/alert/Alert.js +4 -1
- package/dist/alert/style/index.d.ts +3 -3
- package/dist/alert/style/index.js +3 -3
- package/dist/anchor/Anchor.js +11 -6
- package/dist/anchor/style/index.js +2 -3
- package/dist/antd-with-locales.esm.js +16276 -17343
- package/dist/antd-with-locales.js +81 -88
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +14015 -15728
- package/dist/antd.js +82 -89
- package/dist/auto-complete/index.js +1 -0
- package/dist/avatar/Avatar.js +3 -5
- package/dist/avatar/AvatarGroup.js +3 -5
- 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/breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/breadcrumb/index.d.ts +8 -1
- package/dist/calendar/generateCalendar.d.ts +10 -10
- package/dist/calendar/index.d.ts +1 -1
- package/dist/card/index.d.ts +8 -1
- package/dist/card/style/index.js +5 -9
- package/dist/cascader/Panel.js +3 -3
- package/dist/cascader/hooks/useIcons.js +3 -2
- package/dist/cascader/index.d.ts +2 -0
- package/dist/cascader/index.js +12 -5
- package/dist/checkbox/Checkbox.js +6 -4
- package/dist/checkbox/Group.d.ts +19 -1
- package/dist/checkbox/Group.js +38 -9
- package/dist/checkbox/GroupContext.d.ts +3 -0
- package/dist/checkbox/index.d.ts +2 -2
- package/dist/color-picker/ColorPicker.js +1 -1
- package/dist/color-picker/style/input.js +7 -12
- package/dist/components.d.ts +24 -24
- package/dist/components.js +1 -2
- package/dist/config-provider/context.d.ts +3 -2
- package/dist/date-picker/generatePicker/generateRangePicker.js +24 -6
- package/dist/date-picker/generatePicker/generateSinglePicker.js +24 -6
- package/dist/date-picker/generatePicker/interface.d.ts +21 -5
- package/dist/date-picker/generatePicker/useComponents.d.ts +1 -14
- 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 +8 -2
- package/dist/descriptions/hooks/useItems.d.ts +6 -6
- package/dist/descriptions/style/index.js +11 -13
- package/dist/divider/style/index.js +1 -1
- package/dist/drawer/DrawerPanel.js +1 -1
- package/dist/dropdown/dropdown.d.ts +2 -0
- package/dist/dropdown/dropdown.js +9 -2
- package/dist/dropdown/style/index.js +1 -7
- package/dist/empty/index.js +2 -1
- package/dist/float-button/BackTop.js +2 -1
- package/dist/form/ErrorList.js +1 -1
- package/dist/form/Form.js +9 -8
- package/dist/form/FormItem/ItemHolder.js +1 -1
- package/dist/form/FormItem/index.js +11 -9
- package/dist/form/FormItemInput.js +1 -1
- package/dist/form/FormItemLabel.js +2 -2
- package/dist/form/context.d.ts +2 -2
- package/dist/form/hooks/useVariant.d.ts +1 -1
- package/dist/form/hooks/useVariant.js +1 -1
- package/dist/grid/hooks/useBreakpoint.js +12 -6
- package/dist/image/PreviewGroup.d.ts +9 -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 +7 -7
- package/dist/image/index.d.ts +3 -3
- package/dist/index.d.ts +26 -24
- package/dist/index.js +1 -2
- 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.js +3 -16
- package/dist/input-number/index.d.ts +3 -6
- package/dist/input-number/index.js +8 -3
- package/dist/input-number/style/index.js +1 -5
- package/dist/listy/index.d.ts +1 -1
- package/dist/listy/index.js +9 -7
- package/dist/listy/interface.d.ts +29 -5
- package/dist/listy/style/index.js +5 -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 +6 -1
- 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/mentions/index.d.ts +2 -3
- package/dist/mentions/index.js +9 -4
- package/dist/mentions/style/index.js +1 -1
- package/dist/menu/MenuContext.d.ts +2 -0
- package/dist/menu/MenuItem.js +23 -6
- 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.js +2 -1
- package/dist/modal/ConfirmDialog.js +14 -7
- package/dist/modal/PurePanel.js +2 -2
- package/dist/modal/style/confirm.js +1 -1
- package/dist/notification/PurePanel.js +7 -12
- package/dist/notification/interface.d.ts +8 -0
- package/dist/notification/style/index.d.ts +3 -0
- package/dist/notification/style/index.js +4 -5
- 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.js +12 -4
- package/dist/pagination/useShowSizeChanger.d.ts +3 -0
- package/dist/pagination/useShowSizeChanger.js +1 -1
- package/dist/popconfirm/index.js +6 -5
- package/dist/popconfirm/style/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/popover/style/index.js +2 -2
- package/dist/progress/Circle.js +0 -8
- package/dist/progress/Line.js +3 -10
- package/dist/progress/Steps.js +0 -8
- package/dist/progress/progress.js +3 -15
- package/dist/qrcode/QrcodeStatus.js +2 -1
- package/dist/qrcode/index.js +4 -4
- 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/result/index.js +3 -3
- package/dist/result/noFound.js +120 -140
- package/dist/result/serverError.js +132 -147
- package/dist/result/unauthorized.js +115 -129
- package/dist/segmented/index.js +1 -1
- package/dist/select/index.js +10 -3
- package/dist/select/style/dropdown.js +1 -1
- package/dist/select/style/index.js +2 -2
- package/dist/select/style/select-input-multiple.js +1 -1
- package/dist/select/useIcons.d.ts +6 -2
- package/dist/select/usePopupRender.js +4 -1
- package/dist/slider/index.d.ts +6 -4
- package/dist/slider/index.js +7 -5
- package/dist/space/Compact.d.ts +1 -1
- package/dist/space/Item.d.ts +1 -0
- package/dist/space/Item.js +6 -2
- package/dist/space/index.js +1 -0
- package/dist/spin/Indicator/index.js +5 -1
- package/dist/splitter/SplitBar.js +9 -3
- package/dist/splitter/Splitter.js +8 -2
- package/dist/splitter/interface.d.ts +6 -1
- package/dist/statistic/Statistic.d.ts +3 -0
- package/dist/statistic/Statistic.js +2 -1
- package/dist/steps/index.js +9 -7
- 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/index.js +8 -2
- package/dist/table/ExpandIcon.d.ts +9 -4
- package/dist/table/ExpandIcon.js +42 -20
- package/dist/table/InternalTable.js +41 -20
- package/dist/table/hooks/useLazyKVMap.js +1 -1
- package/dist/table/hooks/useSelection.js +54 -9
- package/dist/table/index.d.ts +2 -2
- package/dist/table/interface.d.ts +8 -0
- package/dist/table/style/index.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.js +3 -7
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/time-picker/index.d.ts +10 -9
- package/dist/time-picker/index.js +54 -83
- package/dist/timeline/Timeline.js +1 -1
- package/dist/tooltip/style/index.js +1 -2
- package/dist/tour/panelRender.js +3 -2
- package/dist/transfer/Section.js +2 -1
- package/dist/transfer/Transfer.js +1 -1
- package/dist/tree/DirectoryTree.d.ts +19 -7
- package/dist/tree/Tree.d.ts +73 -58
- package/dist/tree/index.d.ts +8 -5
- package/dist/tree/index.js +4 -3
- package/dist/tree/style/index.js +1 -1
- package/dist/tree-select/index.js +14 -8
- 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.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/utils.js +8 -3
- package/dist/version/token-meta.json +1 -1
- package/dist/version/token.json +1 -1
- package/dist/watermark/index.js +1 -1
- package/package.json +24 -24
- package/web-tags.json +79 -15
- package/web-types.json +196 -24
- package/dist/_util/getAllowClear.d.ts +0 -6
- package/dist/_util/getAllowClear.js +0 -11
|
@@ -128,6 +128,7 @@ const InternalAutoComplete = /* @__PURE__ */ defineComponent((props, { slots, em
|
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
const selectProps = omit(props, omitKeys);
|
|
131
|
+
selectProps.allowClear = props.allowClear ?? false;
|
|
131
132
|
if (selectProps.placeholder === void 0 && customizeInputPlaceholder !== void 0) selectProps.placeholder = customizeInputPlaceholder;
|
|
132
133
|
return createVNode(Select, mergeProps(forwardedAttrs, selectProps, {
|
|
133
134
|
onSelect: (value, option) => {
|
package/dist/avatar/Avatar.js
CHANGED
|
@@ -5,7 +5,7 @@ import { getAttrStyleAndClass } from "../_util/hooks/useMergeSemantic.js";
|
|
|
5
5
|
import { getSlotPropsFnRun } from "../_util/tools.js";
|
|
6
6
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
7
7
|
import { isRenderable } from "../_util/is.js";
|
|
8
|
-
import { responsiveArray } from "../_util/responsiveObserver.js";
|
|
8
|
+
import { matchScreen, responsiveArray } from "../_util/responsiveObserver.js";
|
|
9
9
|
import useBreakpoint from "../grid/hooks/useBreakpoint.js";
|
|
10
10
|
import { useAvatarContext } from "./AvatarContext.js";
|
|
11
11
|
import style_default from "./style/index.js";
|
|
@@ -62,12 +62,11 @@ const Avatar = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit, exp
|
|
|
62
62
|
const { shape, rootClass, draggable, srcSet, crossOrigin, alt } = props;
|
|
63
63
|
const responsiveSizeStyleFn = () => {
|
|
64
64
|
if (typeof size.value !== "object") return {};
|
|
65
|
-
const
|
|
66
|
-
const currentSize = size.value[currentBreakpoint] || size.value;
|
|
65
|
+
const currentSize = matchScreen(screens.value ?? {}, size.value);
|
|
67
66
|
return currentSize ? {
|
|
68
67
|
width: `${currentSize}px`,
|
|
69
68
|
height: `${currentSize}px`,
|
|
70
|
-
fontSize:
|
|
69
|
+
fontSize: hasIcon || children.length ? `${currentSize / 2}px` : "18px"
|
|
71
70
|
} : {};
|
|
72
71
|
};
|
|
73
72
|
const responsiveSizeStyle = responsiveSizeStyleFn();
|
|
@@ -102,7 +101,6 @@ const Avatar = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit, exp
|
|
|
102
101
|
else if (mounted.value || scale.value !== 1) {
|
|
103
102
|
const transformString = `scale(${scale.value})`;
|
|
104
103
|
const childrenStyle = {
|
|
105
|
-
msTransform: transformString,
|
|
106
104
|
WebkitTransform: transformString,
|
|
107
105
|
transform: transformString
|
|
108
106
|
};
|
|
@@ -33,6 +33,7 @@ const AvatarGroup = /* @__PURE__ */ defineComponent((props, { slots, attrs, expo
|
|
|
33
33
|
});
|
|
34
34
|
const mergeCount = max?.count;
|
|
35
35
|
const numOfChildren = childrenWithProps.length;
|
|
36
|
+
let childrenToRender = childrenWithProps;
|
|
36
37
|
if (mergeCount && mergeCount < numOfChildren) {
|
|
37
38
|
const childrenShow = childrenWithProps.slice(0, mergeCount);
|
|
38
39
|
const childrenHidden = childrenWithProps.slice(mergeCount, numOfChildren);
|
|
@@ -50,15 +51,12 @@ const AvatarGroup = /* @__PURE__ */ defineComponent((props, { slots, attrs, expo
|
|
|
50
51
|
"key": "avatar-popover-key",
|
|
51
52
|
"destroyOnHidden": true
|
|
52
53
|
}, popoverProps), { default: () => [createVNode(Avatar, { "style": mergeStyle }, { default: () => [`+${numOfChildren - mergeCount}`] })] }));
|
|
53
|
-
|
|
54
|
-
"class": cls,
|
|
55
|
-
"style": style
|
|
56
|
-
}), [childrenShow]);
|
|
54
|
+
childrenToRender = childrenShow;
|
|
57
55
|
}
|
|
58
56
|
return createVNode("div", mergeProps({ "ref": nativeElementRef }, restAttrs, {
|
|
59
57
|
"class": cls,
|
|
60
58
|
"style": style
|
|
61
|
-
}), [
|
|
59
|
+
}), [childrenToRender]);
|
|
62
60
|
};
|
|
63
61
|
}, {
|
|
64
62
|
props: {
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { BorderBeamColor, BorderBeamGradient } from "./util.js";
|
|
2
2
|
import { SlotsType } from "vue";
|
|
3
3
|
//#region src/border-beam/BorderBeam.d.ts
|
|
4
|
+
interface BorderBeamItem {
|
|
5
|
+
color?: BorderBeamColor;
|
|
6
|
+
lineWidth?: number | string;
|
|
7
|
+
outset?: number | string;
|
|
8
|
+
size?: number | string;
|
|
9
|
+
}
|
|
4
10
|
interface BorderBeamProps {
|
|
5
11
|
prefixCls?: string;
|
|
6
12
|
rootClass?: string;
|
|
7
13
|
color?: BorderBeamColor;
|
|
8
14
|
count?: number;
|
|
9
15
|
duration?: number;
|
|
16
|
+
items?: BorderBeamItem[];
|
|
10
17
|
lineWidth?: number | string;
|
|
11
18
|
outset?: number | string;
|
|
12
19
|
size?: number | string;
|
|
@@ -18,4 +25,4 @@ declare const BorderBeam: import("vue").DefineSetupFnComponent<BorderBeamProps,
|
|
|
18
25
|
[x: `on${Capitalize<string>}`]: ((...args: unknown[]) => any) | undefined;
|
|
19
26
|
}, import("vue").PublicProps>;
|
|
20
27
|
//#endregion
|
|
21
|
-
export { type BorderBeamColor, type BorderBeamGradient, BorderBeamProps, BorderBeamSlots, BorderBeam as default };
|
|
28
|
+
export { type BorderBeamColor, type BorderBeamGradient, BorderBeamItem, BorderBeamProps, BorderBeamSlots, BorderBeam as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
1
2
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
3
|
import { genCssVar } from "../theme/util/genStyleUtils.js";
|
|
3
4
|
import { isNonNullable, isNumber } from "../_util/is.js";
|
|
@@ -26,8 +27,8 @@ const BorderBeam = /* @__PURE__ */ defineComponent((props, { attrs, slots }) =>
|
|
|
26
27
|
const borderWidth = useBorderSize(hostDom);
|
|
27
28
|
const beamGradient = computed(() => getBorderBeamGradient(props.color));
|
|
28
29
|
const mergedCount = computed(() => {
|
|
29
|
-
const { count
|
|
30
|
-
return isNumber(count) && Number.isFinite(count) && count >= 1 ? Math.floor(count) : 1;
|
|
30
|
+
const { count, items } = props;
|
|
31
|
+
return items?.length ?? (isNumber(count) && Number.isFinite(count) && count >= 1 ? Math.floor(count) : 1);
|
|
31
32
|
});
|
|
32
33
|
const mergedDuration = computed(() => {
|
|
33
34
|
const { duration } = props;
|
|
@@ -43,22 +44,31 @@ const BorderBeam = /* @__PURE__ */ defineComponent((props, { attrs, slots }) =>
|
|
|
43
44
|
};
|
|
44
45
|
return () => {
|
|
45
46
|
let _slot;
|
|
46
|
-
const { duration, lineWidth, size } = props;
|
|
47
|
+
const { duration, lineWidth, size, items } = props;
|
|
47
48
|
const children = filterEmpty(slots.default?.() ?? []);
|
|
48
49
|
const count = mergedCount.value;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
if (isDev) devUseWarning("BorderBeam")(!isNonNullable(items) || !isNonNullable(props.count), "usage", "`count` is ignored when `items` is provided.");
|
|
51
|
+
const getBeamStyle = (index) => {
|
|
52
|
+
const item = items?.[index] ?? {};
|
|
53
|
+
const beamPhase = index / count;
|
|
54
|
+
const itemBeamGradient = item.color ? getBorderBeamGradient(item.color) : beamGradient.value;
|
|
55
|
+
const itemLineWidth = item.lineWidth ?? lineWidth;
|
|
56
|
+
const itemSize = item.size ?? size;
|
|
57
|
+
const itemInsetOffset = isNonNullable(item.outset) ? getInset(item.outset) : insetOffset.value;
|
|
58
|
+
return {
|
|
59
|
+
...contextStyle?.value ?? {},
|
|
60
|
+
...attrs.style ?? {},
|
|
61
|
+
...itemBeamGradient && { [varName.value("beam-gradient")]: itemBeamGradient },
|
|
62
|
+
...isNumber(duration) && duration > 0 && { [varName.value("duration")]: `${duration}s` },
|
|
63
|
+
...isNonNullable(itemLineWidth) && { [varName.value("line-width")]: unit(itemLineWidth) },
|
|
64
|
+
...isNonNullable(itemSize) && { [varName.value("size")]: unit(itemSize) },
|
|
65
|
+
...beamPhase > 0 && { [varName.value("delay")]: `${-mergedDuration.value * beamPhase}s` },
|
|
66
|
+
[varName.value("inset-offset")]: itemInsetOffset
|
|
67
|
+
};
|
|
68
|
+
};
|
|
59
69
|
const beamCls = clsx(prefixCls.value, contextClassName?.value, props.rootClass, attrs.class, hashId.value, cssVarCls.value);
|
|
60
70
|
const beamNode = hostDom.value ? createVNode(Teleport, { "to": hostDom.value }, _isSlot(_slot = Array.from({ length: count }, (_, index) => createVNode("div", {
|
|
61
|
-
"key": index
|
|
71
|
+
"key": `${count}-${index / count}`,
|
|
62
72
|
"aria-hidden": "true",
|
|
63
73
|
"class": beamCls,
|
|
64
74
|
"style": getBeamStyle(index)
|
|
@@ -92,6 +102,10 @@ const BorderBeam = /* @__PURE__ */ defineComponent((props, { attrs, slots }) =>
|
|
|
92
102
|
type: Number,
|
|
93
103
|
required: false
|
|
94
104
|
},
|
|
105
|
+
items: {
|
|
106
|
+
type: Array,
|
|
107
|
+
required: false
|
|
108
|
+
},
|
|
95
109
|
lineWidth: {
|
|
96
110
|
type: [Number, String],
|
|
97
111
|
required: false
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BorderBeamColor, BorderBeamGradient } from "./util.js";
|
|
2
|
-
import BorderBeam, { BorderBeamProps } from "./BorderBeam.js";
|
|
3
|
-
export { type BorderBeamColor, type BorderBeamGradient, type BorderBeamProps, BorderBeam as default };
|
|
2
|
+
import BorderBeam, { BorderBeamItem, BorderBeamProps } from "./BorderBeam.js";
|
|
3
|
+
export { type BorderBeamColor, type BorderBeamGradient, type BorderBeamItem, type BorderBeamProps, BorderBeam as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useBaseConfig } from "../config-provider/context.js";
|
|
2
2
|
import { getSlotPropsFnRun } from "../_util/tools.js";
|
|
3
3
|
import { isRenderable } from "../_util/is.js";
|
|
4
|
-
import isNonNullable from "../_util/isNonNullable.js";
|
|
5
4
|
import { checkRenderNode } from "../_util/vueNode.js";
|
|
5
|
+
import isNonNullable from "../_util/isNonNullable.js";
|
|
6
6
|
import { useBreadcrumbContext } from "./BreadcrumbContext.js";
|
|
7
7
|
import Dropdown from "../dropdown/index.js";
|
|
8
8
|
import BreadcrumbSeparator from "./BreadcrumbSeparator.js";
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import _default, { BreadcrumbItemProps, SeparatorType } from "./BreadcrumbItem.js";
|
|
2
2
|
import _default$1 from "./BreadcrumbSeparator.js";
|
|
3
3
|
import Breadcrumb, { BreadcrumbEmits, BreadcrumbItemRenderContext, BreadcrumbProps, BreadcrumbRef, BreadcrumbSlots, ItemType } from "./Breadcrumb.js";
|
|
4
|
-
|
|
4
|
+
//#region src/breadcrumb/index.d.ts
|
|
5
|
+
type CompoundedBreadcrumb = typeof Breadcrumb & {
|
|
6
|
+
Item: typeof _default;
|
|
7
|
+
Separator: typeof _default$1;
|
|
8
|
+
};
|
|
9
|
+
declare const _default$2: CompoundedBreadcrumb;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { type BreadcrumbEmits, _default as BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbItemRenderContext, type ItemType as BreadcrumbItemType, type BreadcrumbProps, type BreadcrumbRef, _default$1 as BreadcrumbSeparator, type BreadcrumbSlots, type SeparatorType, _default$2 as default };
|
|
@@ -64,31 +64,31 @@ interface CalendarRef {
|
|
|
64
64
|
nativeElement: HTMLDivElement;
|
|
65
65
|
}
|
|
66
66
|
declare const calendarProps: string[];
|
|
67
|
-
interface CalendarSlots {
|
|
67
|
+
interface CalendarSlots<DateType = AnyObject> {
|
|
68
68
|
dateFullCellRender?: (ctx: {
|
|
69
|
-
date:
|
|
69
|
+
date: DateType;
|
|
70
70
|
}) => any;
|
|
71
71
|
dateCellRender?: (ctx: {
|
|
72
|
-
date:
|
|
72
|
+
date: DateType;
|
|
73
73
|
}) => any;
|
|
74
74
|
monthFullCellRender?: (ctx: {
|
|
75
|
-
date:
|
|
75
|
+
date: DateType;
|
|
76
76
|
}) => any;
|
|
77
77
|
monthCellRender?: (ctx: {
|
|
78
|
-
date:
|
|
78
|
+
date: DateType;
|
|
79
79
|
}) => any;
|
|
80
80
|
cellRender?: (ctx: {
|
|
81
|
-
date:
|
|
81
|
+
date: DateType;
|
|
82
82
|
info: any;
|
|
83
83
|
}) => any;
|
|
84
84
|
fullCellRender?: (ctx: {
|
|
85
|
-
date:
|
|
85
|
+
date: DateType;
|
|
86
86
|
info: any;
|
|
87
87
|
}) => any;
|
|
88
88
|
headerRender?: (config: {
|
|
89
|
-
value:
|
|
89
|
+
value: DateType;
|
|
90
90
|
type: CalendarMode;
|
|
91
|
-
onChange: (date:
|
|
91
|
+
onChange: (date: DateType) => void;
|
|
92
92
|
onTypeChange: (type: CalendarMode) => void;
|
|
93
93
|
}) => any;
|
|
94
94
|
[key: string]: any;
|
|
@@ -105,6 +105,6 @@ interface CalendarEmitsProps<DateType = AnyObject> {
|
|
|
105
105
|
onPanelChange?: CalendarEmits<DateType>['panelChange'];
|
|
106
106
|
onSelect?: CalendarEmits<DateType>['select'];
|
|
107
107
|
}
|
|
108
|
-
declare function generateCalendar<DateType extends AnyObject>(generateConfig: GenerateConfig<DateType>): import("vue").DefineSetupFnComponent<CalendarProps<DateType>, CalendarEmits<DateType>, SlotsType<CalendarSlots
|
|
108
|
+
declare function generateCalendar<DateType extends AnyObject>(generateConfig: GenerateConfig<DateType>): import("vue").DefineSetupFnComponent<CalendarProps<DateType>, CalendarEmits<DateType>, SlotsType<CalendarSlots<DateType>>, CalendarProps<DateType>, import("vue").PublicProps>;
|
|
109
109
|
//#endregion
|
|
110
110
|
export { CalendarClassNamesType, CalendarEmits, CalendarEmitsProps, CalendarMode, CalendarProps, CalendarRef, CalendarSemanticClassNames, CalendarSemanticName, CalendarSemanticStyles, CalendarSlots, CalendarStylesType, HeaderRender, SelectInfo, calendarProps, generateCalendar as default };
|
package/dist/calendar/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import generateCalendar, { CalendarEmits, CalendarMode, CalendarProps, CalendarRef, CalendarSlots } from "./generateCalendar.js";
|
|
2
2
|
import { Dayjs } from "dayjs";
|
|
3
3
|
//#region src/calendar/index.d.ts
|
|
4
|
-
declare const Calendar: import("vue").DefineSetupFnComponent<CalendarProps<Dayjs>, CalendarEmits<Dayjs>, import("vue").SlotsType<CalendarSlots
|
|
4
|
+
declare const Calendar: import("vue").DefineSetupFnComponent<CalendarProps<Dayjs>, CalendarEmits<Dayjs>, import("vue").SlotsType<CalendarSlots<Dayjs>>, CalendarProps<Dayjs>, import("vue").PublicProps>;
|
|
5
5
|
type CalendarType = typeof Calendar & {
|
|
6
6
|
generateCalendar: typeof generateCalendar;
|
|
7
7
|
};
|
package/dist/card/index.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import Card, { CardEmits, CardProps, CardSize, CardSlots, CardTabListType } from "./Card.js";
|
|
2
2
|
import CardMeta, { CardMetaProps, CardMetaRef } from "./CardMeta.js";
|
|
3
3
|
import CardGrid, { CardGridProps, CardGridRef } from "./CardGrid.js";
|
|
4
|
-
|
|
4
|
+
//#region src/card/index.d.ts
|
|
5
|
+
type CompoundedCard = typeof Card & {
|
|
6
|
+
Grid: typeof CardGrid;
|
|
7
|
+
Meta: typeof CardMeta;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: CompoundedCard;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { type CardEmits, CardGrid, type CardGridProps, type CardGridRef, CardMeta, type CardMetaProps, type CardMetaRef, type CardProps, type CardSize, type CardSlots, type CardTabListType, _default as default };
|
package/dist/card/style/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { mergeToken } from "../../theme/internal.js";
|
|
|
4
4
|
import { unit } from "@antdv-next/cssinjs";
|
|
5
5
|
//#region src/card/style/index.ts
|
|
6
6
|
const genCardHeadStyle = (token) => {
|
|
7
|
-
const { antCls,
|
|
7
|
+
const { antCls, headerHeight, headerPadding, tabsMarginBottom } = token;
|
|
8
8
|
return {
|
|
9
9
|
display: "flex",
|
|
10
10
|
justifyContent: "center",
|
|
@@ -28,10 +28,7 @@ const genCardHeadStyle = (token) => {
|
|
|
28
28
|
display: "inline-block",
|
|
29
29
|
flex: 1,
|
|
30
30
|
...textEllipsis,
|
|
31
|
-
[`
|
|
32
|
-
> ${componentCls}-typography,
|
|
33
|
-
> ${componentCls}-typography-edit-content
|
|
34
|
-
`]: {
|
|
31
|
+
[`> ${antCls}-typography`]: {
|
|
35
32
|
insetInlineStart: 0,
|
|
36
33
|
marginTop: 0,
|
|
37
34
|
marginBottom: 0
|
|
@@ -41,9 +38,8 @@ const genCardHeadStyle = (token) => {
|
|
|
41
38
|
clear: "both",
|
|
42
39
|
marginBottom: tabsMarginBottom,
|
|
43
40
|
color: token.colorText,
|
|
44
|
-
fontWeight:
|
|
45
|
-
fontSize: token.fontSize
|
|
46
|
-
"&-bar": { borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}` }
|
|
41
|
+
fontWeight: 400,
|
|
42
|
+
fontSize: token.fontSize
|
|
47
43
|
}
|
|
48
44
|
};
|
|
49
45
|
};
|
|
@@ -161,7 +157,7 @@ const genCardStyle = (token) => {
|
|
|
161
157
|
[`${componentCls}-extra`]: {
|
|
162
158
|
marginInlineStart: "auto",
|
|
163
159
|
color: extraColor,
|
|
164
|
-
fontWeight:
|
|
160
|
+
fontWeight: 400,
|
|
165
161
|
fontSize: token.fontSize
|
|
166
162
|
},
|
|
167
163
|
[`${componentCls}-body`]: {
|
package/dist/cascader/Panel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
2
|
import { getAttrStyleAndClass } from "../_util/hooks/useMergeSemantic.js";
|
|
3
|
-
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
3
|
+
import { getSlotPropsFnRun, getSlotPropsFnRunWithFallback, toPropsRefs } from "../_util/tools.js";
|
|
4
4
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
5
5
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
6
6
|
import { DefaultRenderEmpty } from "../config-provider/defaultRenderEmpty.js";
|
|
@@ -30,8 +30,8 @@ const CascaderPanel = /* @__PURE__ */ defineComponent((props, { attrs, emit, slo
|
|
|
30
30
|
return () => {
|
|
31
31
|
const { rootClass, multiple, optionRender, expandIcon, prefixCls: _prefixCls, direction: _direction, loadingIcon, ...rest } = props;
|
|
32
32
|
const { className, style, restAttrs } = getAttrStyleAndClass(attrs);
|
|
33
|
-
const customExpandIcon =
|
|
34
|
-
const customLoadingIcon =
|
|
33
|
+
const customExpandIcon = getSlotPropsFnRunWithFallback(slots, props, "expandIcon");
|
|
34
|
+
const customLoadingIcon = getSlotPropsFnRunWithFallback(slots, props, "loadingIcon");
|
|
35
35
|
const { expandIcon: mergedExpandIcon, loadingIcon: mergedLoadingIcon } = useIcons({
|
|
36
36
|
contextExpandIcon: contextExpandIcon.value,
|
|
37
37
|
contextLoadingIcon: contextLoadingIcon.value,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cloneIfVNode } from "../../_util/vueNode.js";
|
|
1
2
|
import { createVNode } from "vue";
|
|
2
3
|
import { LeftOutlined, LoadingOutlined, RightOutlined } from "@antdv-next/icons";
|
|
3
4
|
//#region src/cascader/hooks/useIcons.tsx
|
|
@@ -6,8 +7,8 @@ const defaultExpandIcon = createVNode(RightOutlined, null, null);
|
|
|
6
7
|
const defaultRtlExpandIcon = createVNode(LeftOutlined, null, null);
|
|
7
8
|
function useIcons({ contextExpandIcon, contextLoadingIcon, expandIcon, loadingIcon, isRtl }) {
|
|
8
9
|
return {
|
|
9
|
-
expandIcon: expandIcon ?? contextExpandIcon ?? (isRtl ? defaultRtlExpandIcon : defaultExpandIcon),
|
|
10
|
-
loadingIcon: loadingIcon ?? contextLoadingIcon ?? defaultLoadingIcon
|
|
10
|
+
expandIcon: cloneIfVNode(expandIcon ?? contextExpandIcon ?? (isRtl ? defaultRtlExpandIcon : defaultExpandIcon)),
|
|
11
|
+
loadingIcon: cloneIfVNode(loadingIcon ?? contextLoadingIcon ?? defaultLoadingIcon)
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
//#endregion
|
package/dist/cascader/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ interface CascaderSemanticClassNames {
|
|
|
23
23
|
item?: string;
|
|
24
24
|
itemContent?: string;
|
|
25
25
|
itemRemove?: string;
|
|
26
|
+
clear?: string;
|
|
26
27
|
}
|
|
27
28
|
interface CascaderSemanticStyles {
|
|
28
29
|
root?: CSSProperties;
|
|
@@ -34,6 +35,7 @@ interface CascaderSemanticStyles {
|
|
|
34
35
|
item?: CSSProperties;
|
|
35
36
|
itemContent?: CSSProperties;
|
|
36
37
|
itemRemove?: CSSProperties;
|
|
38
|
+
clear?: CSSProperties;
|
|
37
39
|
}
|
|
38
40
|
type CascaderClassNamesType = SemanticClassNamesType<CascaderProps, CascaderSemanticClassNames, {
|
|
39
41
|
popup?: SelectPopupSemanticClassNames;
|
package/dist/cascader/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
+
import { useFormItemInputContext } from "../form/context.js";
|
|
2
3
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
4
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
5
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
5
6
|
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
6
7
|
import { useZIndex } from "../_util/hooks/useZIndex.js";
|
|
7
|
-
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
8
|
+
import { getSlotPropsFnRun, getSlotPropsFnRunWithFallback, toPropsRefs } from "../_util/tools.js";
|
|
8
9
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
9
10
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
11
|
+
import { useLocaleGetter } from "../locale/useLocale.js";
|
|
10
12
|
import genPurePanel from "../_util/PurePanel.js";
|
|
11
13
|
import { getMergedStatus, getStatusClassNames } from "../_util/statusUtils.js";
|
|
12
14
|
import { DefaultRenderEmpty } from "../config-provider/defaultRenderEmpty.js";
|
|
13
|
-
import { useFormItemInputContext } from "../form/context.js";
|
|
14
15
|
import { useVariants } from "../form/hooks/useVariant.js";
|
|
15
16
|
import mergedBuiltinPlacements from "../select/mergedBuiltinPlacements.js";
|
|
16
17
|
import style_default from "../select/style/index.js";
|
|
@@ -74,6 +75,7 @@ const InternalCascader = /* @__PURE__ */ defineComponent((props, { attrs, emit,
|
|
|
74
75
|
"removeIcon",
|
|
75
76
|
"suffixIcon"
|
|
76
77
|
]);
|
|
78
|
+
const getGlobalLocale = useLocaleGetter("global");
|
|
77
79
|
const { prefixCls: customizePrefixCls, direction: propDirection, variant: customizeVariant, bordered, size: customizeSize, disabled: customDisabled, status: customStatus, classes, styles } = toPropsRefs(props, "prefixCls", "direction", "variant", "bordered", "size", "disabled", "status", "classes", "styles");
|
|
78
80
|
const { prefixCls, cascaderPrefixCls, direction: mergedDirection, renderEmpty } = useBase(customizePrefixCls, propDirection);
|
|
79
81
|
const isRtl = computed(() => mergedDirection.value === "rtl");
|
|
@@ -179,11 +181,16 @@ const InternalCascader = /* @__PURE__ */ defineComponent((props, { attrs, emit,
|
|
|
179
181
|
componentName: "Cascader"
|
|
180
182
|
});
|
|
181
183
|
const mergedClearIcon = rest.clearIcon ?? contextClearIcon.value ?? clearIcon;
|
|
182
|
-
const
|
|
184
|
+
const finalAllowClear = allowClear ?? true;
|
|
185
|
+
const mergedAllowClear = finalAllowClear ? {
|
|
186
|
+
clearIcon: mergedClearIcon,
|
|
187
|
+
label: getGlobalLocale().clear,
|
|
188
|
+
...typeof finalAllowClear === "object" ? finalAllowClear : {}
|
|
189
|
+
} : finalAllowClear;
|
|
183
190
|
const mergedPopupRender = usePopupRender((slots.popupRender ?? popupRender) || dropdownRender);
|
|
184
191
|
const mergedPopupMenuColumnStyle = popupMenuColumnStyle ?? dropdownMenuColumnStyle;
|
|
185
|
-
const customExpandIcon =
|
|
186
|
-
const customLoadingIcon =
|
|
192
|
+
const customExpandIcon = getSlotPropsFnRunWithFallback(slots, props, "expandIcon");
|
|
193
|
+
const customLoadingIcon = getSlotPropsFnRunWithFallback(slots, props, "loadingIcon");
|
|
187
194
|
const { expandIcon: mergedExpandIcon, loadingIcon: mergedLoadingIcon } = useIcons$1({
|
|
188
195
|
contextExpandIcon: contextExpandIcon.value,
|
|
189
196
|
contextLoadingIcon: contextLoadingIcon.value,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
+
import { useFormItemContext, useFormItemInputContext } from "../form/context.js";
|
|
2
3
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
4
|
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
4
5
|
import { toPropsRefs } from "../_util/tools.js";
|
|
5
6
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
6
7
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
7
|
-
import isNonNullable from "../_util/isNonNullable.js";
|
|
8
8
|
import { TARGET_CLS } from "../_util/wave/interface.js";
|
|
9
9
|
import wave_default from "../_util/wave/index.js";
|
|
10
10
|
import { checkRenderNode } from "../_util/vueNode.js";
|
|
11
|
-
import
|
|
11
|
+
import isNonNullable from "../_util/isNonNullable.js";
|
|
12
12
|
import useBubbleLock from "./useBubbleLock.js";
|
|
13
13
|
import style_default from "./style/index.js";
|
|
14
14
|
import { isValueEqual } from "../_util/isEqual.js";
|
|
15
15
|
import { useGroupContext } from "./GroupContext.js";
|
|
16
|
-
import { computed, createVNode, defineComponent, mergeDefaults, mergeProps, nextTick, shallowRef, watch } from "vue";
|
|
16
|
+
import { computed, createVNode, defineComponent, mergeDefaults, mergeProps, nextTick, shallowRef, toRef, watch } from "vue";
|
|
17
17
|
import { clsx } from "@v-c/util";
|
|
18
18
|
import { omit } from "es-toolkit";
|
|
19
19
|
import VcCheckbox from "@v-c/checkbox";
|
|
@@ -45,7 +45,9 @@ const InternalCheckbox = /* @__PURE__ */ defineComponent((props, { slots, emit,
|
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
47
|
const contextStyleRoot = useSemanticRootStyle(contextStyle);
|
|
48
|
-
const
|
|
48
|
+
const groupClassNames = toRef(() => props.skipGroup ? void 0 : checkboxGroup?.value?.classes);
|
|
49
|
+
const groupStyles = toRef(() => props.skipGroup ? void 0 : checkboxGroup?.value?.styles);
|
|
50
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic(useToArr(contextClassNames, groupClassNames, classes), useToArr(contextStyles, contextStyleRoot, groupStyles, styles), useToProps(mergedProps));
|
|
49
51
|
const checkboxRef = shallowRef();
|
|
50
52
|
if (isDev) devUseWarning("Checkbox")("checked" in props || !!checkboxGroup?.value || !("value" in props), "usage", "`value` is not a valid prop, do you mean `checked`?");
|
|
51
53
|
watch([() => props.value, () => props.skipGroup], ([value, skipGroup], _prev, onCleanup) => {
|
package/dist/checkbox/Group.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { VueNode } from "../_util/type.js";
|
|
2
|
+
import { SemanticClassNamesType, SemanticStylesType } from "../_util/hooks/useMergeSemantic.js";
|
|
3
|
+
import "../_util/hooks/index.js";
|
|
2
4
|
import { ComponentBaseProps } from "../config-provider/context.js";
|
|
3
5
|
import { CSSProperties, SlotsType } from "vue";
|
|
4
6
|
import { CheckboxChangeEvent } from "@v-c/checkbox";
|
|
@@ -18,6 +20,20 @@ interface AbstractCheckboxGroupProps extends ComponentBaseProps {
|
|
|
18
20
|
options?: (CheckboxOptionType | string | number)[];
|
|
19
21
|
disabled?: boolean;
|
|
20
22
|
}
|
|
23
|
+
interface CheckboxGroupSemanticClassNames {
|
|
24
|
+
root?: string;
|
|
25
|
+
item?: string;
|
|
26
|
+
itemIcon?: string;
|
|
27
|
+
itemLabel?: string;
|
|
28
|
+
}
|
|
29
|
+
interface CheckboxGroupSemanticStyles {
|
|
30
|
+
root?: CSSProperties;
|
|
31
|
+
item?: CSSProperties;
|
|
32
|
+
itemIcon?: CSSProperties;
|
|
33
|
+
itemLabel?: CSSProperties;
|
|
34
|
+
}
|
|
35
|
+
type CheckboxGroupClassNamesType = SemanticClassNamesType<CheckboxGroupProps, CheckboxGroupSemanticClassNames>;
|
|
36
|
+
type CheckboxGroupStylesType = SemanticStylesType<CheckboxGroupProps, CheckboxGroupSemanticStyles>;
|
|
21
37
|
interface CheckboxGroupProps extends AbstractCheckboxGroupProps, CheckboxGroupEmitsProps {
|
|
22
38
|
name?: string;
|
|
23
39
|
defaultValue?: any[];
|
|
@@ -27,6 +43,8 @@ interface CheckboxGroupProps extends AbstractCheckboxGroupProps, CheckboxGroupEm
|
|
|
27
43
|
index: number;
|
|
28
44
|
}) => any;
|
|
29
45
|
role?: string;
|
|
46
|
+
classes?: CheckboxGroupClassNamesType;
|
|
47
|
+
styles?: CheckboxGroupStylesType;
|
|
30
48
|
'onUpdate:value'?: (value: any[]) => void;
|
|
31
49
|
}
|
|
32
50
|
interface CheckboxGroupEmits {
|
|
@@ -44,4 +62,4 @@ interface CheckboxGroupSlots {
|
|
|
44
62
|
}
|
|
45
63
|
declare const CheckboxGroup: import("vue").DefineSetupFnComponent<CheckboxGroupProps, CheckboxGroupEmits, SlotsType<CheckboxGroupSlots>, CheckboxGroupProps, import("vue").PublicProps>;
|
|
46
64
|
//#endregion
|
|
47
|
-
export { AbstractCheckboxGroupProps, CheckboxGroupEmits, CheckboxGroupEmitsProps, CheckboxGroupProps, CheckboxGroupSlots, CheckboxOptionType, CheckboxGroup as default };
|
|
65
|
+
export { AbstractCheckboxGroupProps, CheckboxGroupClassNamesType, CheckboxGroupEmits, CheckboxGroupEmitsProps, CheckboxGroupProps, CheckboxGroupSemanticClassNames, CheckboxGroupSemanticStyles, CheckboxGroupSlots, CheckboxGroupStylesType, CheckboxOptionType, CheckboxGroup as default };
|
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
|
|
@@ -14,7 +15,7 @@ function _isSlot(s) {
|
|
|
14
15
|
const CheckboxGroup = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) => {
|
|
15
16
|
const { prefixCls, direction } = useBaseConfig("checkbox", props);
|
|
16
17
|
const value = shallowRef(props?.value ?? props?.defaultValue ?? []);
|
|
17
|
-
|
|
18
|
+
let registeredValues = [];
|
|
18
19
|
watch(() => props.value, () => {
|
|
19
20
|
value.value = props?.value ?? [];
|
|
20
21
|
});
|
|
@@ -28,17 +29,17 @@ const CheckboxGroup = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
28
29
|
}).filter((item) => item !== null && item !== void 0 && item.value !== null && item.value !== void 0);
|
|
29
30
|
});
|
|
30
31
|
const cancelValue = (val) => {
|
|
31
|
-
registeredValues
|
|
32
|
+
registeredValues = registeredValues.filter((v) => v !== val);
|
|
32
33
|
};
|
|
33
34
|
const registerValue = (val) => {
|
|
34
|
-
registeredValues
|
|
35
|
+
registeredValues = [...registeredValues, val];
|
|
35
36
|
};
|
|
36
37
|
const toggleOption = (option) => {
|
|
37
38
|
const optionIndex = value.value.indexOf(option.value);
|
|
38
39
|
const newValue = [...value.value];
|
|
39
40
|
if (optionIndex === -1) newValue.push(option.value);
|
|
40
41
|
else newValue.splice(optionIndex, 1);
|
|
41
|
-
const sortVals = newValue.filter((val) => registeredValues.
|
|
42
|
+
const sortVals = newValue.filter((val) => registeredValues.includes(val)).sort((a, b) => {
|
|
42
43
|
return memoizedOptions.value.findIndex((opt) => opt.value === a) - memoizedOptions.value.findIndex((opt) => opt.value === b);
|
|
43
44
|
});
|
|
44
45
|
emit("change", sortVals);
|
|
@@ -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 };
|