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
package/dist/space/Item.js
CHANGED
|
@@ -5,13 +5,13 @@ import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
|
5
5
|
const Item = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
6
6
|
const spaceContext = useSpaceContext();
|
|
7
7
|
return () => {
|
|
8
|
-
const { index, className, classes, styles } = props;
|
|
8
|
+
const { index, className, prefix, classes, styles } = props;
|
|
9
9
|
const { latestIndex } = spaceContext.value;
|
|
10
10
|
const children = filterEmpty(slots?.default?.());
|
|
11
11
|
const separator = filterEmpty(slots?.separator?.());
|
|
12
12
|
if (children.length === 0) return null;
|
|
13
13
|
return createVNode(Fragment, null, [createVNode("div", mergeProps({ "class": className }, attrs), [children]), index < latestIndex && !!separator.length && createVNode("span", {
|
|
14
|
-
"class": [`${
|
|
14
|
+
"class": [`${prefix}-item-separator`, classes.separator],
|
|
15
15
|
"style": styles.separator
|
|
16
16
|
}, [separator])]);
|
|
17
17
|
};
|
|
@@ -24,6 +24,10 @@ const Item = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
24
24
|
type: String,
|
|
25
25
|
required: true
|
|
26
26
|
},
|
|
27
|
+
prefix: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
27
31
|
classes: {
|
|
28
32
|
type: Object,
|
|
29
33
|
required: true
|
package/dist/space/index.js
CHANGED
|
@@ -54,6 +54,7 @@ const InternalSpace = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
54
54
|
if (child !== null && child !== void 0) latestIndex.value = i;
|
|
55
55
|
const key = child?.key || `${itemClassName}-${i}`;
|
|
56
56
|
return createVNode(Item, {
|
|
57
|
+
"prefix": prefixCls.value,
|
|
57
58
|
"className": itemClassName,
|
|
58
59
|
"classes": mergedClassNames.value,
|
|
59
60
|
"styles": mergedStyles.value,
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import { getAttrStyleAndClass } from "../../_util/hooks/useMergeSemantic.js";
|
|
1
2
|
import { getSlotPropsFnRun } from "../../_util/tools.js";
|
|
2
3
|
import { Looper } from "./Looper.js";
|
|
3
4
|
import { createVNode, defineComponent, isVNode, mergeDefaults, mergeProps } from "vue";
|
|
5
|
+
import { classNames } from "@v-c/util";
|
|
4
6
|
//#region src/spin/Indicator/index.tsx
|
|
5
7
|
const Indicator = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
6
8
|
return () => {
|
|
7
9
|
const { prefixCls, percent } = props;
|
|
8
10
|
const dotClassName = `${prefixCls}-dot`;
|
|
9
11
|
const indicator = getSlotPropsFnRun(slots, props, "indicator");
|
|
12
|
+
const { style, className } = getAttrStyleAndClass(attrs);
|
|
10
13
|
if (indicator && isVNode(indicator)) return createVNode(indicator, {
|
|
11
|
-
class: dotClassName,
|
|
14
|
+
class: classNames(dotClassName, className),
|
|
15
|
+
style,
|
|
12
16
|
percent
|
|
13
17
|
});
|
|
14
18
|
return createVNode(Looper, mergeProps(attrs, {
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { genCssVar } from "../theme/util/genStyleUtils.js";
|
|
2
2
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
3
|
-
import
|
|
3
|
+
import useLocale from "../locale/useLocale.js";
|
|
4
|
+
import { computed, createVNode, defineComponent, isVNode, mergeProps, shallowRef, watch } from "vue";
|
|
4
5
|
import { clsx } from "@v-c/util";
|
|
5
6
|
import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from "@antdv-next/icons";
|
|
6
7
|
//#region src/splitter/SplitBar.tsx
|
|
8
|
+
function getAriaLabel(icon, defaultLabel) {
|
|
9
|
+
const node = Array.isArray(icon) && icon.length === 1 ? icon[0] : icon;
|
|
10
|
+
return isVNode(node) && node.props?.["aria-label"] || defaultLabel;
|
|
11
|
+
}
|
|
7
12
|
function getValidNumber(num) {
|
|
8
13
|
return typeof num === "number" && !Number.isNaN(num) && Number.isFinite(num) ? Math.round(num) : 0;
|
|
9
14
|
}
|
|
10
15
|
const DOUBLE_CLICK_TIME_GAP = 300;
|
|
11
16
|
const SplitBar = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
17
|
+
const [locale] = useLocale("Splitter");
|
|
12
18
|
const { vertical, resizable, index, containerSize, ariaNow, ariaMin, ariaMax, prefixCls, rootPrefixCls, lazy } = toPropsRefs(props, "vertical", "resizable", "index", "containerSize", "ariaNow", "ariaMin", "ariaMax", "prefixCls", "rootPrefixCls", "lazy");
|
|
13
19
|
const splitBarPrefixCls = computed(() => `${prefixCls.value}-bar`);
|
|
14
20
|
const lastClickTimeRef = shallowRef(0);
|
|
@@ -163,7 +169,7 @@ const SplitBar = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
163
169
|
"class": clsx(`${splitBarPrefixCls.value}-collapse-bar`, `${splitBarPrefixCls.value}-collapse-bar-start`, { [`${splitBarPrefixCls.value}-collapse-bar-customize`]: startCustomize }, getVisibilityClass(showStartCollapsibleIcon)),
|
|
164
170
|
"role": "button",
|
|
165
171
|
"tabindex": 0,
|
|
166
|
-
"aria-label":
|
|
172
|
+
"aria-label": getAriaLabel(startIcon, locale.value.toggleStartPanel),
|
|
167
173
|
"onClick": () => onCollapse(index.value, "start"),
|
|
168
174
|
"onKeydown": (e) => onCollapseKeyDown(e, "start")
|
|
169
175
|
}, [createVNode("span", { "class": clsx(`${splitBarPrefixCls.value}-collapse-icon`, `${splitBarPrefixCls.value}-collapse-start`) }, [startIcon])]),
|
|
@@ -171,7 +177,7 @@ const SplitBar = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
171
177
|
"class": clsx(`${splitBarPrefixCls.value}-collapse-bar`, `${splitBarPrefixCls.value}-collapse-bar-end`, { [`${splitBarPrefixCls.value}-collapse-bar-customize`]: endCustomize }, getVisibilityClass(showEndCollapsibleIcon)),
|
|
172
178
|
"role": "button",
|
|
173
179
|
"tabindex": 0,
|
|
174
|
-
"aria-label":
|
|
180
|
+
"aria-label": getAriaLabel(endIcon, locale.value.toggleEndPanel),
|
|
175
181
|
"onClick": () => onCollapse(index.value, "end"),
|
|
176
182
|
"onKeydown": (e) => onCollapseKeyDown(e, "end")
|
|
177
183
|
}, [createVNode("span", { "class": clsx(`${splitBarPrefixCls.value}-collapse-icon`, `${splitBarPrefixCls.value}-collapse-end`) }, [endIcon])])
|
|
@@ -86,7 +86,7 @@ const Splitter = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose
|
|
|
86
86
|
const nativeElementRef = shallowRef();
|
|
87
87
|
expose({ nativeElement: nativeElementRef });
|
|
88
88
|
return () => {
|
|
89
|
-
const { rootClass, lazy, draggerIcon, collapsible, collapsibleIcon } = props;
|
|
89
|
+
const { rootClass, lazy, draggerIcon, collapsible, collapsibleIcon, destroyOnHidden } = props;
|
|
90
90
|
const mergedCollapsibleIcon = collapsible?.icon ?? collapsibleIcon;
|
|
91
91
|
items.value = convertChildrenToItems(slots?.default?.() ?? []);
|
|
92
92
|
const { className, style, restAttrs } = getAttrStyleAndClass(attrs);
|
|
@@ -110,7 +110,8 @@ const Splitter = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose
|
|
|
110
110
|
}, {
|
|
111
111
|
"prefixCls": prefixCls.value,
|
|
112
112
|
"size": panelSizes.value[idx],
|
|
113
|
-
"supportMotion": collapsible?.motion && movingIndex.value === void 0
|
|
113
|
+
"supportMotion": collapsible?.motion && movingIndex.value === void 0,
|
|
114
|
+
"destroyOnHidden": item.destroyOnHidden ?? destroyOnHidden
|
|
114
115
|
}), { default: () => [item._$slots?.default?.()] });
|
|
115
116
|
let splitBar = null;
|
|
116
117
|
const resizableInfo = resizableInfos.value[idx];
|
|
@@ -181,6 +182,11 @@ const Splitter = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose
|
|
|
181
182
|
required: false,
|
|
182
183
|
default: void 0
|
|
183
184
|
},
|
|
185
|
+
destroyOnHidden: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
required: false,
|
|
188
|
+
default: void 0
|
|
189
|
+
},
|
|
184
190
|
draggerIcon: {
|
|
185
191
|
type: [
|
|
186
192
|
Function,
|
|
@@ -34,6 +34,10 @@ type SplitterClassNamesType = SemanticClassNamesType<SplitterProps, SplitterSema
|
|
|
34
34
|
type SplitterStylesType = SemanticStylesType<SplitterProps, SplitterSemanticStyles, {
|
|
35
35
|
dragger?: CSSProperties | DraggerSemanticStyles;
|
|
36
36
|
}>;
|
|
37
|
+
interface SplitterLocale {
|
|
38
|
+
toggleStartPanel?: string;
|
|
39
|
+
toggleEndPanel?: string;
|
|
40
|
+
}
|
|
37
41
|
interface SplitterProps extends ComponentBaseProps {
|
|
38
42
|
classes?: SplitterClassNamesType;
|
|
39
43
|
styles?: SplitterStylesType;
|
|
@@ -44,6 +48,7 @@ interface SplitterProps extends ComponentBaseProps {
|
|
|
44
48
|
layout?: Orientation;
|
|
45
49
|
orientation?: Orientation;
|
|
46
50
|
vertical?: boolean;
|
|
51
|
+
destroyOnHidden?: boolean;
|
|
47
52
|
draggerIcon?: VueNode;
|
|
48
53
|
/**
|
|
49
54
|
* Collapse configuration. Set `motion: true` to enable collapse animation.
|
|
@@ -146,4 +151,4 @@ interface UseCollapsible {
|
|
|
146
151
|
setOldBasics: () => void;
|
|
147
152
|
}
|
|
148
153
|
//#endregion
|
|
149
|
-
export { DraggerSemantic, DraggerSemanticClassNames, DraggerSemanticStyles, InternalPanelProps, PanelProps, SplitterClassNamesType, SplitterEmits, SplitterProps, SplitterSemanticClassNames, SplitterSemanticDraggerClassNames, SplitterSemanticName, SplitterSemanticStyles, SplitterSlots, SplitterStylesType, UseCollapsible, UseCollapsibleProps, UseHandle, UseHandleProps, UseResize, UseResizeProps };
|
|
154
|
+
export { DraggerSemantic, DraggerSemanticClassNames, DraggerSemanticStyles, InternalPanelProps, PanelProps, SplitterClassNamesType, SplitterEmits, SplitterLocale, SplitterProps, SplitterSemanticClassNames, SplitterSemanticDraggerClassNames, SplitterSemanticName, SplitterSemanticStyles, SplitterSlots, SplitterStylesType, UseCollapsible, UseCollapsibleProps, UseHandle, UseHandleProps, UseResize, UseResizeProps };
|
|
@@ -50,6 +50,9 @@ interface StatisticSlots {
|
|
|
50
50
|
title: () => any;
|
|
51
51
|
prefix: () => any;
|
|
52
52
|
suffix: () => any;
|
|
53
|
+
formatter?: (ctx: {
|
|
54
|
+
value: valueType;
|
|
55
|
+
}) => any;
|
|
53
56
|
}
|
|
54
57
|
interface InternalStatisticProps extends StatisticProps, StatisticEmitsProps {}
|
|
55
58
|
interface StatisticEmitsProps {
|
|
@@ -29,6 +29,7 @@ const Statistic = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit,
|
|
|
29
29
|
const title = getSlotPropsFnRun(slots, props, "title");
|
|
30
30
|
const prefix = getSlotPropsFnRun(slots, props, "prefix");
|
|
31
31
|
const suffix = getSlotPropsFnRun(slots, props, "suffix");
|
|
32
|
+
const mergedFormatter = slots.formatter ? (v) => getSlotPropsFnRun(slots, {}, "formatter", true, { value: v }) : formatter;
|
|
32
33
|
const cls = classNames(prefixCls.value, { [`${prefixCls.value}-rtl`]: direction.value === "rtl" }, contextClassName.value, attrs.class, rootClass, mergedClassNames.value.root, hashId.value, cssVarCls.value);
|
|
33
34
|
const restProps = pickAttrs(attrs, {
|
|
34
35
|
data: true,
|
|
@@ -44,7 +45,7 @@ const Statistic = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit,
|
|
|
44
45
|
"decimalSeparator": decimalSeparator,
|
|
45
46
|
"groupSeparator": groupSeparator,
|
|
46
47
|
"prefixCls": prefixCls.value,
|
|
47
|
-
"formatter":
|
|
48
|
+
"formatter": mergedFormatter,
|
|
48
49
|
"precision": precision,
|
|
49
50
|
"value": value,
|
|
50
51
|
"className": valueClassNames,
|
package/dist/steps/index.js
CHANGED
|
@@ -13,9 +13,9 @@ import PanelArrow from "./PanelArrow.js";
|
|
|
13
13
|
import ProgressIcon from "./ProgressIcon.js";
|
|
14
14
|
import style_default from "./style/index.js";
|
|
15
15
|
import useDisplaySteps from "./useDisplaySteps.js";
|
|
16
|
-
import { Fragment, computed, createVNode, defineComponent, isVNode, mergeDefaults, mergeProps } from "vue";
|
|
16
|
+
import { Fragment, computed, createVNode, defineComponent, getCurrentInstance, isVNode, mergeDefaults, mergeProps } from "vue";
|
|
17
17
|
import { clsx } from "@v-c/util";
|
|
18
|
-
import { CheckOutlined } from "@antdv-next/icons";
|
|
18
|
+
import { CheckOutlined, CloseOutlined } from "@antdv-next/icons";
|
|
19
19
|
import VcSteps from "@v-c/steps";
|
|
20
20
|
//#region src/steps/index.tsx
|
|
21
21
|
function _isSlot(s) {
|
|
@@ -23,6 +23,7 @@ function _isSlot(s) {
|
|
|
23
23
|
}
|
|
24
24
|
const waveEffectClassNames = { itemIcon: TARGET_CLS };
|
|
25
25
|
const Steps = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) => {
|
|
26
|
+
const instance = getCurrentInstance();
|
|
26
27
|
const internalContent = useInternalContext();
|
|
27
28
|
const { direction: rtlDirection, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, prefixCls, rootPrefixCls } = useComponentBaseConfig("steps", props);
|
|
28
29
|
const { size, items, responsive, type, classes, styles } = toPropsRefs(props, "size", "items", "responsive", "type", "classes", "styles");
|
|
@@ -84,7 +85,7 @@ const Steps = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
84
85
|
warning(props.maxCount === void 0 || props.maxCount >= 3, "usage", "`maxCount` should be greater than or equal to 3.");
|
|
85
86
|
}
|
|
86
87
|
return () => {
|
|
87
|
-
const { variant, onChange, offset, ellipsis, rootClass, current: _current, initial: _initial, maxCount: _maxCount, ...restProps } = props;
|
|
88
|
+
const { variant, onChange, offset, ellipsis, rootClass, classes: _classes, size: _size, type: _type, direction: _direction, labelPlacement: _labelPlacement, progressDot: _progressDot, responsive: _responsive, percent: _percent, current: _current, initial: _initial, maxCount: _maxCount, ...restProps } = props;
|
|
88
89
|
const { className, restAttrs } = getAttrStyleAndClass(attrs);
|
|
89
90
|
const iconRender = slots?.iconRender || props?.iconRender;
|
|
90
91
|
const legacyProgressDotRenderFn = () => {
|
|
@@ -103,7 +104,7 @@ const Steps = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
103
104
|
iconContent = createVNode(CheckOutlined, { "class": `${itemIconCls.value}-finish` }, null);
|
|
104
105
|
break;
|
|
105
106
|
case "error":
|
|
106
|
-
iconContent = createVNode(
|
|
107
|
+
iconContent = createVNode(CloseOutlined, { "class": `${itemIconCls.value}-error` }, null);
|
|
107
108
|
break;
|
|
108
109
|
default: {
|
|
109
110
|
let numNode = createVNode("span", { "class": `${itemIconCls.value}-number` }, [mappedIndex + 1]);
|
|
@@ -139,6 +140,7 @@ const Steps = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
139
140
|
});
|
|
140
141
|
return iconNode;
|
|
141
142
|
};
|
|
143
|
+
const hasChangeListener = !!(props.onChange || instance?.vnode?.props?.["onUpdate:current"]);
|
|
142
144
|
const itemRender = (itemNode, itemInfo) => {
|
|
143
145
|
let content = itemNode;
|
|
144
146
|
const itemContent = getSlotPropsFnRun({}, itemInfo.item, "content");
|
|
@@ -148,7 +150,7 @@ const Steps = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
148
150
|
}, _isSlot(itemNode) ? itemNode : { default: () => [itemNode] });
|
|
149
151
|
return createVNode(wave_default, {
|
|
150
152
|
"component": "Steps",
|
|
151
|
-
"disabled": itemInfo.item.disabled || !
|
|
153
|
+
"disabled": itemInfo.item.disabled || !hasChangeListener,
|
|
152
154
|
"colorSource": variant === "filled" ? "color" : null
|
|
153
155
|
}, _isSlot(content) ? content : { default: () => [content] });
|
|
154
156
|
};
|
|
@@ -177,13 +179,13 @@ const Steps = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
177
179
|
"initial": 0,
|
|
178
180
|
"current": mappedDisplayCurrent.value,
|
|
179
181
|
"items": displayItems.value,
|
|
180
|
-
"onChange": (displayCurrent) => {
|
|
182
|
+
"onChange": hasChangeListener ? (displayCurrent) => {
|
|
181
183
|
const target = displaySteps.value[displayCurrent];
|
|
182
184
|
const originIndex = target && target.originIndex >= 0 ? target.originIndex : displayCurrent;
|
|
183
185
|
const next = mergedInitial.value + originIndex;
|
|
184
186
|
onChange?.(next);
|
|
185
187
|
emit("update:current", next);
|
|
186
|
-
},
|
|
188
|
+
} : void 0,
|
|
187
189
|
"iconRender": internalIconRender,
|
|
188
190
|
"itemRender": itemRender,
|
|
189
191
|
"itemWrapperRender": itemWrapperRender
|
|
@@ -53,7 +53,7 @@ const genBasicStyle = (token) => {
|
|
|
53
53
|
},
|
|
54
54
|
[`${itemCls}-subtitle`]: {
|
|
55
55
|
color: token.colorTextDescription,
|
|
56
|
-
fontWeight:
|
|
56
|
+
fontWeight: 400,
|
|
57
57
|
fontSize: varRef("subtitle-font-size"),
|
|
58
58
|
lineHeight: varRef("subtitle-line-height"),
|
|
59
59
|
marginInlineStart: token.marginXS,
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
//#region src/style/motion/collapse.ts
|
|
2
2
|
const genCollapseMotion = (token) => {
|
|
3
3
|
const { componentCls, antCls, motionDurationMid, motionEaseInOut } = token;
|
|
4
|
-
return { [componentCls]: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
[`${antCls}-motion-collapse`]: {
|
|
10
|
-
overflow: "hidden",
|
|
11
|
-
transition: `${["height", "opacity"].map((prop) => `${prop} ${motionDurationMid} ${motionEaseInOut}`).join(", ")} !important`
|
|
12
|
-
}
|
|
13
|
-
} };
|
|
4
|
+
return { [componentCls]: { [`${antCls}-motion-collapse`]: {
|
|
5
|
+
overflow: "hidden",
|
|
6
|
+
transition: `${["height", "opacity"].map((prop) => `${prop} ${motionDurationMid} ${motionEaseInOut}`).join(", ")} !important`
|
|
7
|
+
} } };
|
|
14
8
|
};
|
|
15
9
|
//#endregion
|
|
16
10
|
export { genCollapseMotion as default };
|
package/dist/switch/index.js
CHANGED
|
@@ -31,7 +31,7 @@ const keys = [
|
|
|
31
31
|
"checkedChildren",
|
|
32
32
|
"unCheckedChildren"
|
|
33
33
|
];
|
|
34
|
-
const Switch = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) => {
|
|
34
|
+
const Switch = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expose }) => {
|
|
35
35
|
const mergedCheckedValue = computed(() => props.checkedValue ?? true);
|
|
36
36
|
const mergedUnCheckedValue = computed(() => props.unCheckedValue ?? false);
|
|
37
37
|
const currentValue = shallowRef(props?.checked ?? props?.value ?? props?.defaultChecked ?? props?.defaultValue ?? mergedUnCheckedValue.value);
|
|
@@ -69,6 +69,12 @@ const Switch = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
|
|
|
69
69
|
emit("update:checked", newValue);
|
|
70
70
|
emit("update:value", newValue);
|
|
71
71
|
};
|
|
72
|
+
const switchRef = shallowRef();
|
|
73
|
+
expose({
|
|
74
|
+
nativeElement: switchRef,
|
|
75
|
+
focus: () => switchRef.value?.focus?.(),
|
|
76
|
+
blur: () => switchRef.value?.blur?.()
|
|
77
|
+
});
|
|
72
78
|
return () => {
|
|
73
79
|
const { loading, rootClass } = props;
|
|
74
80
|
const checkedChildren = getSlotPropsFnRun(slots, props, "checkedChildren");
|
|
@@ -91,7 +97,7 @@ const Switch = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =
|
|
|
91
97
|
return createVNode(wave_default, {
|
|
92
98
|
"component": "Switch",
|
|
93
99
|
"disabled": mergedDisabled.value
|
|
94
|
-
}, { default: () => [createVNode(VcSwitch, mergeProps(restAttrs, restProps, {
|
|
100
|
+
}, { default: () => [createVNode(VcSwitch, mergeProps({ "ref": switchRef }, restAttrs, restProps, {
|
|
95
101
|
"classNames": mergedClassNames.value,
|
|
96
102
|
"styles": mergedStyles.value,
|
|
97
103
|
"checked": isChecked.value,
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { AnyObject } from "../_util/type.js";
|
|
2
2
|
import { TableLocale } from "./interface.js";
|
|
3
|
+
import { ExpandIconComponent } from "@v-c/table";
|
|
3
4
|
//#region src/table/ExpandIcon.d.ts
|
|
4
|
-
|
|
5
|
+
type LegacyRenderExpandIcon<RecordType = AnyObject> = (props: {
|
|
5
6
|
prefixCls: string;
|
|
6
7
|
record: RecordType;
|
|
7
8
|
expanded: boolean;
|
|
8
9
|
expandable: boolean;
|
|
9
10
|
onExpand: (record: RecordType, e: MouseEvent) => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
11
|
+
}) => any;
|
|
12
|
+
/**
|
|
13
|
+
* Create a stable expand icon component for `components.ExpandIcon`.
|
|
14
|
+
* Getters are read at render time so the component itself never changes identity.
|
|
15
|
+
*/
|
|
16
|
+
declare function createExpandIcon<RecordType extends AnyObject = AnyObject>(getLocale: () => TableLocale, getExpandIcon: () => ExpandIconComponent<RecordType> | undefined, getLegacyRenderExpandIcons: () => (LegacyRenderExpandIcon<RecordType> | undefined)[]): ExpandIconComponent<RecordType>;
|
|
12
17
|
//#endregion
|
|
13
|
-
export {
|
|
18
|
+
export { createExpandIcon as default };
|
package/dist/table/ExpandIcon.js
CHANGED
|
@@ -1,25 +1,47 @@
|
|
|
1
|
-
import { createVNode } from "vue";
|
|
1
|
+
import { createVNode, h } from "vue";
|
|
2
2
|
import { clsx } from "@v-c/util";
|
|
3
3
|
//#region src/table/ExpandIcon.tsx
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
function renderInternalExpandIcon(props, locale) {
|
|
5
|
+
const { prefixCls, type, expanded, expandable, onClick } = props;
|
|
6
|
+
const iconPrefix = `${prefixCls}-row-expand-icon`;
|
|
7
|
+
if (type === "all" && !expandable) return createVNode("span", { "class": clsx(iconPrefix, `${iconPrefix}-spaced`) }, null);
|
|
8
|
+
const ariaLabel = type === "all" ? expanded ? locale.collapseAll : locale.expandAll : expanded ? locale.collapse : locale.expand;
|
|
9
|
+
return createVNode("button", {
|
|
10
|
+
"type": "button",
|
|
11
|
+
"onClick": onClick,
|
|
12
|
+
"class": clsx(iconPrefix, {
|
|
13
|
+
[`${iconPrefix}-spaced`]: !expandable,
|
|
14
|
+
[`${iconPrefix}-expanded`]: expandable && expanded,
|
|
15
|
+
[`${iconPrefix}-collapsed`]: expandable && !expanded
|
|
16
|
+
}),
|
|
17
|
+
"aria-label": ariaLabel,
|
|
18
|
+
"aria-expanded": expanded
|
|
19
|
+
}, null);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create a stable expand icon component for `components.ExpandIcon`.
|
|
23
|
+
* Getters are read at render time so the component itself never changes identity.
|
|
24
|
+
*/
|
|
25
|
+
function createExpandIcon(getLocale, getExpandIcon, getLegacyRenderExpandIcons) {
|
|
26
|
+
const MergedExpandIcon = (props) => {
|
|
27
|
+
const ExpandIcon = getExpandIcon();
|
|
28
|
+
if (ExpandIcon) return h(ExpandIcon, props);
|
|
29
|
+
const renderExpandIcon = getLegacyRenderExpandIcons().find(Boolean);
|
|
30
|
+
if (renderExpandIcon && props.type === "row") {
|
|
31
|
+
const { prefixCls, record, expanded, expandable, onClick } = props;
|
|
32
|
+
return renderExpandIcon({
|
|
33
|
+
prefixCls,
|
|
34
|
+
record,
|
|
35
|
+
expanded,
|
|
36
|
+
expandable,
|
|
37
|
+
onExpand: (_record, event) => onClick(event)
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return renderInternalExpandIcon(props, getLocale());
|
|
22
41
|
};
|
|
42
|
+
MergedExpandIcon.displayName = "TableExpandIcon";
|
|
43
|
+
MergedExpandIcon.inheritAttrs = false;
|
|
44
|
+
return MergedExpandIcon;
|
|
23
45
|
}
|
|
24
46
|
//#endregion
|
|
25
|
-
export {
|
|
47
|
+
export { createExpandIcon as default };
|
|
@@ -15,7 +15,7 @@ import useBreakpoint from "../grid/hooks/useBreakpoint.js";
|
|
|
15
15
|
import Spin from "../spin/index.js";
|
|
16
16
|
import pagination_default from "../pagination/index.js";
|
|
17
17
|
import useSelection from "./hooks/useSelection.js";
|
|
18
|
-
import
|
|
18
|
+
import createExpandIcon from "./ExpandIcon.js";
|
|
19
19
|
import useColumnTitleProps from "./hooks/useColumnTitleProps.js";
|
|
20
20
|
import useContainerWidth from "./hooks/useContainerWidth.js";
|
|
21
21
|
import useFilledColumns from "./hooks/useFilledColumns.js";
|
|
@@ -56,12 +56,13 @@ function resolvePanelRender(slots, props, key) {
|
|
|
56
56
|
if (slots[key] || props[key]) return (data) => getSlotPropsFnRun(slots, props, key, true, data);
|
|
57
57
|
}
|
|
58
58
|
const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs, expose }) => {
|
|
59
|
-
const { prefixCls, direction, getPrefixCls, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, renderEmpty, getPopupContainer: contextGetPopupContainer, virtual: contextVirtual, bodyCell: contextBodyCell, headerCell: contextHeaderCell, rowKey: contextRowKey, scroll: contextScroll, column: contextColumn } = useComponentBaseConfig("table", props, [
|
|
59
|
+
const { prefixCls, direction, getPrefixCls, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, renderEmpty, getPopupContainer: contextGetPopupContainer, virtual: contextVirtual, bodyCell: contextBodyCell, headerCell: contextHeaderCell, rowKey: contextRowKey, scroll: contextScroll, column: contextColumn, expandable: contextExpandable } = useComponentBaseConfig("table", props, [
|
|
60
60
|
"bodyCell",
|
|
61
61
|
"headerCell",
|
|
62
62
|
"rowKey",
|
|
63
63
|
"scroll",
|
|
64
|
-
"column"
|
|
64
|
+
"column",
|
|
65
|
+
"expandable"
|
|
65
66
|
]);
|
|
66
67
|
const configCtx = useConfig();
|
|
67
68
|
const mergedScroll = computed(() => props.scroll ?? contextScroll.value);
|
|
@@ -71,17 +72,6 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
71
72
|
ariaProps: ariaProps.value,
|
|
72
73
|
component: props.components?.header?.table
|
|
73
74
|
})));
|
|
74
|
-
const mergedComponents = computed(() => {
|
|
75
|
-
const components = props.components;
|
|
76
|
-
if (!hasAriaProps.value) return components;
|
|
77
|
-
return {
|
|
78
|
-
...components,
|
|
79
|
-
header: {
|
|
80
|
-
...components?.header,
|
|
81
|
-
table: HeaderTable
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
75
|
const { classes, styles } = toPropsRefs(props, "classes", "styles");
|
|
86
76
|
const mergedSize = useSize(computed(() => props.size));
|
|
87
77
|
const mergedProps = computed(() => {
|
|
@@ -296,12 +286,12 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
296
286
|
};
|
|
297
287
|
const columnTitleProps = useColumnTitleProps(sorterTitleProps, filters);
|
|
298
288
|
const transformTitleColumns = computed(() => useTitleColumns(columnTitleProps.value)[0]);
|
|
299
|
-
const renderExpandedRow =
|
|
289
|
+
const renderExpandedRow = (record, index, indent, expanded) => getSlotPropsFnRun(slots, props, "expandedRowRender", true, {
|
|
300
290
|
record,
|
|
301
291
|
index,
|
|
302
292
|
indent,
|
|
303
293
|
expanded
|
|
304
|
-
})
|
|
294
|
+
});
|
|
305
295
|
const renderFilterDropdown = slots.filterDropdown ? (ctx) => getSlotPropsFnRun(slots, props, "filterDropdown", false, ctx) : void 0;
|
|
306
296
|
const renderFilterIcon = slots.filterIcon ? (ctx) => getSlotPropsFnRun(slots, props, "filterIcon", false, ctx) : void 0;
|
|
307
297
|
const transformFilterColumns = computed(() => useFilter({
|
|
@@ -319,19 +309,50 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
319
309
|
const transformColumns = (innerColumns) => transformTitleColumns.value(transformSelectionColumns(transformFilterColumns.value(transformSorterColumns(innerColumns))));
|
|
320
310
|
const expandType = computed(() => {
|
|
321
311
|
if (rawData.value.some((item) => item?.[childrenColumnName.value])) return "nest";
|
|
322
|
-
if (
|
|
312
|
+
if (slots.expandedRowRender || mergedExpandable.value.expandedRowRender) return "row";
|
|
323
313
|
return null;
|
|
324
314
|
});
|
|
315
|
+
if (isDev) devUseWarning("Table").deprecated(!props.expandable?.expandIcon, "expandable.expandIcon", "components.ExpandIcon");
|
|
316
|
+
const MergedExpandIcon = createExpandIcon(() => mergedLocale.value, () => props.components?.ExpandIcon, () => [mergedExpandable.value.expandIcon, contextExpandable.value?.expandIcon]);
|
|
325
317
|
const mergedExpandableConfig = computed(() => {
|
|
326
318
|
const expandable = { ...mergedExpandable.value };
|
|
327
319
|
expandable.__PARENT_RENDER_ICON__ = expandable.expandIcon;
|
|
328
|
-
|
|
329
|
-
expandable.expandIcon = expandable.expandIcon || renderExpandIcon(mergedLocale.value);
|
|
320
|
+
expandable.expandIcon = void 0;
|
|
330
321
|
if (expandType.value === "nest" && expandable.expandIconColumnIndex === void 0) expandable.expandIconColumnIndex = mergedRowSelection.value ? 1 : 0;
|
|
331
322
|
else if (expandType.value === "nest" && expandable.expandIconColumnIndex > 0 && mergedRowSelection.value) expandable.expandIconColumnIndex -= 1;
|
|
332
323
|
if (typeof expandable.indentSize !== "number") expandable.indentSize = typeof props.indentSize === "number" ? props.indentSize : 15;
|
|
333
324
|
return expandable;
|
|
334
325
|
});
|
|
326
|
+
let lastExpandableBase;
|
|
327
|
+
let lastExpandableHasSlot = false;
|
|
328
|
+
let lastExpandableConfig;
|
|
329
|
+
const resolveExpandableConfig = () => {
|
|
330
|
+
const base = mergedExpandableConfig.value;
|
|
331
|
+
const hasSlot = !!slots.expandedRowRender;
|
|
332
|
+
if (base !== lastExpandableBase || hasSlot !== lastExpandableHasSlot) {
|
|
333
|
+
lastExpandableBase = base;
|
|
334
|
+
lastExpandableHasSlot = hasSlot;
|
|
335
|
+
lastExpandableConfig = hasSlot ? {
|
|
336
|
+
...base,
|
|
337
|
+
expandedRowRender: renderExpandedRow
|
|
338
|
+
} : base;
|
|
339
|
+
}
|
|
340
|
+
return lastExpandableConfig;
|
|
341
|
+
};
|
|
342
|
+
const mergedComponents = computed(() => {
|
|
343
|
+
let components = props.components;
|
|
344
|
+
if (hasAriaProps.value) components = {
|
|
345
|
+
...components,
|
|
346
|
+
header: {
|
|
347
|
+
...components?.header,
|
|
348
|
+
table: HeaderTable
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
return {
|
|
352
|
+
...components,
|
|
353
|
+
ExpandIcon: MergedExpandIcon
|
|
354
|
+
};
|
|
355
|
+
});
|
|
335
356
|
const measureRowRender = (measureRow) => createVNode(TableMeasureRowContextProvider, { "value": true }, { default: () => [createVNode(ConfigProvider, { "getPopupContainer": (node) => node }, _isSlot(measureRow) ? measureRow : { default: () => [measureRow] })] });
|
|
336
357
|
const onInternalUpdateExpandedRowKeys = (keys) => emit("update:expandedRowKeys", keys);
|
|
337
358
|
const onInternalResizeColumn = (width, column, columnKey) => emit("resizeColumn", width, column, columnKey);
|
|
@@ -413,7 +434,7 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
413
434
|
"emptyText": mergedEmptyNode,
|
|
414
435
|
"classNames": mergedClassNames.value,
|
|
415
436
|
"styles": mergedStyles.value,
|
|
416
|
-
"expandable":
|
|
437
|
+
"expandable": resolveExpandableConfig(),
|
|
417
438
|
"prefixCls": prefixCls.value,
|
|
418
439
|
"direction": direction.value,
|
|
419
440
|
"headerCell": slots.headerCell || contextHeaderCell.value || props.headerCell ? renderHeaderCell : void 0,
|
|
@@ -6,7 +6,7 @@ function useLazyKVMap(data, childrenColumnName, getRowKey) {
|
|
|
6
6
|
const mergedData = unref(data);
|
|
7
7
|
const mergedChildrenColumnName = unref(childrenColumnName);
|
|
8
8
|
const mergedGetRowKey = unref(getRowKey);
|
|
9
|
-
if (
|
|
9
|
+
if (mapCacheRef.value.data !== mergedData || mapCacheRef.value.childrenColumnName !== mergedChildrenColumnName || mapCacheRef.value.getRowKey !== mergedGetRowKey) {
|
|
10
10
|
const kvMap = /* @__PURE__ */ new Map();
|
|
11
11
|
function dig(records) {
|
|
12
12
|
records.forEach((record, index) => {
|