antdv-next 1.5.3 → 1.5.5
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/PurePanel.js +2 -1
- package/dist/_util/hooks/useMergeSemantic.js +3 -2
- package/dist/_util/hooks/useMergedMask.js +1 -1
- package/dist/_util/styleUtils.d.ts +19 -1
- package/dist/_util/styleUtils.js +24 -1
- package/dist/_util/vnode/index.js +5 -5
- package/dist/_util/vueNode.d.ts +6 -2
- package/dist/_util/warning.d.ts +0 -1
- package/dist/affix/index.js +7 -18
- package/dist/alert/Alert.js +18 -19
- package/dist/anchor/Anchor.d.ts +1 -1
- package/dist/anchor/Anchor.js +16 -7
- package/dist/anchor/AnchorLink.d.ts +4 -3
- package/dist/anchor/AnchorLink.js +3 -2
- package/dist/antd-with-locales.esm.js +20087 -18146
- package/dist/antd-with-locales.js +83 -83
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +17212 -15798
- package/dist/antd.js +95 -95
- package/dist/app/App.js +1 -1
- package/dist/app/index.js +0 -3
- package/dist/auto-complete/index.d.ts +3 -3
- package/dist/auto-complete/index.js +15 -4
- package/dist/avatar/Avatar.d.ts +4 -1
- package/dist/avatar/Avatar.js +21 -13
- package/dist/avatar/AvatarGroup.js +2 -2
- package/dist/avatar/index.d.ts +2 -2
- package/dist/badge/Ribbon.js +3 -4
- package/dist/badge/index.js +11 -9
- package/dist/breadcrumb/Breadcrumb.js +10 -6
- package/dist/breadcrumb/BreadcrumbItem.js +5 -4
- package/dist/breadcrumb/useItemRender.js +5 -8
- package/dist/button/Button.js +2 -0
- package/dist/card/Card.d.ts +5 -1
- package/dist/card/Card.js +11 -9
- package/dist/carousel/index.d.ts +1 -1
- package/dist/carousel/index.js +7 -8
- package/dist/cascader/Panel.d.ts +1 -0
- package/dist/cascader/Panel.js +2 -1
- package/dist/cascader/index.d.ts +11 -10
- package/dist/cascader/index.js +17 -6
- package/dist/checkbox/Checkbox.js +14 -28
- package/dist/collapse/Collapse.d.ts +0 -3
- package/dist/collapse/Collapse.js +2 -2
- package/dist/color-picker/ColorPicker.js +9 -9
- package/dist/color-picker/components/ColorClear.d.ts +1 -0
- package/dist/color-picker/components/ColorClear.js +14 -4
- package/dist/color-picker/components/ColorPresets.js +4 -4
- package/dist/color-picker/components/ColorSlider.js +8 -2
- package/dist/color-picker/components/ColorTrigger.js +3 -2
- package/dist/color-picker/interface.d.ts +0 -2
- package/dist/color-picker/style/index.js +5 -6
- package/dist/components.d.ts +2 -2
- package/dist/config-provider/SizeContext.d.ts +1 -1
- package/dist/config-provider/SizeContext.js +1 -1
- package/dist/config-provider/context.d.ts +2 -5
- package/dist/config-provider/hooks/useTheme.js +2 -1
- package/dist/config-provider/index.d.ts +2 -2
- package/dist/date-picker/generatePicker/generateRangePicker.d.ts +4 -3
- package/dist/date-picker/generatePicker/generateRangePicker.js +18 -3
- package/dist/date-picker/generatePicker/generateSinglePicker.d.ts +1 -0
- package/dist/date-picker/generatePicker/generateSinglePicker.js +17 -2
- package/dist/date-picker/generatePicker/index.d.ts +1 -1
- package/dist/date-picker/generatePicker/interface.d.ts +0 -2
- package/dist/date-picker/generatePicker/useComponents.d.ts +1 -1
- package/dist/date-picker/index.d.ts +3 -2
- package/dist/date-picker/locale/ar_EG.js +8 -0
- package/dist/date-picker/locale/bg_BG.js +8 -0
- package/dist/date-picker/locale/bn_BD.js +1 -0
- package/dist/date-picker/locale/ca_ES.js +8 -0
- package/dist/date-picker/locale/cs_CZ.js +8 -0
- package/dist/date-picker/locale/da_DK.js +8 -0
- package/dist/date-picker/locale/de_DE.js +11 -1
- package/dist/date-picker/locale/es_ES.js +8 -0
- package/dist/date-picker/locale/et_EE.js +8 -0
- package/dist/date-picker/locale/eu_ES.js +8 -0
- package/dist/date-picker/locale/fi_FI.js +8 -0
- package/dist/date-picker/locale/fr_BE.js +1 -0
- package/dist/date-picker/locale/fr_CA.js +1 -0
- package/dist/date-picker/locale/fr_FR.js +1 -0
- package/dist/date-picker/locale/ga_IE.js +1 -0
- package/dist/date-picker/locale/gl_ES.js +8 -0
- package/dist/date-picker/locale/he_IL.js +8 -0
- package/dist/date-picker/locale/hi_IN.js +1 -0
- package/dist/date-picker/locale/hr_HR.js +1 -0
- package/dist/date-picker/locale/hu_HU.js +8 -0
- package/dist/date-picker/locale/is_IS.js +8 -0
- package/dist/date-picker/locale/it_IT.js +8 -0
- package/dist/date-picker/locale/ka_GE.js +1 -0
- package/dist/date-picker/locale/kk_KZ.js +1 -0
- package/dist/date-picker/locale/km_KH.js +1 -0
- package/dist/date-picker/locale/kmr_IQ.js +8 -0
- package/dist/date-picker/locale/lv_LV.js +8 -0
- package/dist/date-picker/locale/mk_MK.js +8 -0
- package/dist/date-picker/locale/ml_IN.js +1 -0
- package/dist/date-picker/locale/mn_MN.js +8 -0
- package/dist/date-picker/locale/ms_MY.js +8 -0
- package/dist/date-picker/locale/nb_NO.js +1 -0
- package/dist/date-picker/locale/nl_BE.js +1 -0
- package/dist/date-picker/locale/nl_NL.js +1 -0
- package/dist/date-picker/locale/pl_PL.js +8 -0
- package/dist/date-picker/locale/pt_BR.js +8 -0
- package/dist/date-picker/locale/pt_PT.js +8 -0
- package/dist/date-picker/locale/ro_RO.js +8 -0
- package/dist/date-picker/locale/ru_RU.js +1 -0
- package/dist/date-picker/locale/sk_SK.js +8 -0
- package/dist/date-picker/locale/sl_SI.js +8 -0
- package/dist/date-picker/locale/sr_RS.js +1 -0
- package/dist/date-picker/locale/sv_SE.js +1 -0
- package/dist/date-picker/locale/ta_IN.js +1 -0
- package/dist/date-picker/locale/th_TH.js +1 -0
- package/dist/date-picker/locale/tr_TR.js +1 -0
- package/dist/date-picker/locale/uk_UA.js +1 -0
- package/dist/date-picker/locale/ur_PK.js +1 -0
- package/dist/date-picker/locale/uz_UZ.js +1 -0
- package/dist/date-picker/locale/zh_TW.js +1 -1
- package/dist/date-picker/util.d.ts +4 -4
- package/dist/descriptions/Row.js +7 -5
- package/dist/descriptions/hooks/useItems.d.ts +4 -4
- package/dist/descriptions/index.js +6 -3
- package/dist/divider/index.d.ts +0 -1
- package/dist/drawer/DrawerPanel.js +11 -5
- package/dist/drawer/index.d.ts +0 -3
- package/dist/drawer/index.js +17 -4
- package/dist/dropdown/dropdown.d.ts +3 -6
- package/dist/dropdown/dropdown.js +8 -4
- package/dist/dropdown/index.js +0 -3
- package/dist/empty/index.js +2 -1
- package/dist/float-button/BackTop.d.ts +4 -2
- package/dist/float-button/BackTop.js +12 -4
- package/dist/float-button/FloatButton.d.ts +2 -2
- package/dist/float-button/FloatButton.js +11 -4
- package/dist/float-button/FloatButtonGroup.d.ts +2 -2
- package/dist/float-button/FloatButtonGroup.js +10 -3
- package/dist/float-button/PurePanel.js +20 -8
- package/dist/float-button/style/group.js +31 -5
- package/dist/form/FormItem/index.js +4 -3
- package/dist/form/FormItemInput.js +4 -2
- 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/style/index.js +4 -1
- package/dist/grid/col.js +1 -1
- package/dist/grid/row.js +1 -1
- package/dist/image/PreviewGroup.js +7 -5
- package/dist/image/hooks/usePreviewConfig.d.ts +5 -5
- package/dist/image/hooks/usePreviewConfig.js +1 -1
- package/dist/image/index.js +3 -4
- package/dist/index.d.ts +2 -2
- package/dist/input/Input.d.ts +0 -1
- package/dist/input/Input.js +16 -4
- package/dist/input/OTP/OTPInput.js +16 -4
- package/dist/input/Password.js +14 -5
- package/dist/input/Search.js +17 -8
- package/dist/input/TextArea.d.ts +0 -1
- package/dist/input/TextArea.js +17 -2
- package/dist/input/style/index.d.ts +2 -1
- package/dist/input/style/index.js +12 -11
- package/dist/input/style/variants.js +1 -4
- package/dist/input-number/index.d.ts +11 -1
- package/dist/input-number/index.js +48 -6
- package/dist/input-number/style/index.js +13 -16
- package/dist/listy/index.js +17 -8
- package/dist/listy/interface.d.ts +2 -2
- package/dist/locale/ar_EG.js +4 -0
- package/dist/locale/az_AZ.js +4 -0
- package/dist/locale/bg_BG.js +4 -0
- package/dist/locale/bn_BD.js +4 -0
- package/dist/locale/by_BY.js +4 -0
- package/dist/locale/ca_ES.js +4 -0
- package/dist/locale/cs_CZ.js +4 -0
- package/dist/locale/da_DK.js +4 -0
- package/dist/locale/de_DE.js +4 -0
- package/dist/locale/el_GR.js +4 -0
- package/dist/locale/en_GB.js +4 -0
- package/dist/locale/es_ES.js +4 -0
- package/dist/locale/et_EE.js +4 -0
- package/dist/locale/eu_ES.js +4 -0
- package/dist/locale/fa_IR.js +4 -0
- package/dist/locale/fi_FI.js +4 -0
- package/dist/locale/fr_BE.js +4 -0
- package/dist/locale/fr_CA.js +4 -0
- package/dist/locale/fr_FR.js +4 -0
- package/dist/locale/ga_IE.js +4 -0
- package/dist/locale/gl_ES.js +4 -0
- package/dist/locale/he_IL.js +4 -0
- package/dist/locale/hi_IN.js +4 -0
- package/dist/locale/hr_HR.js +4 -0
- package/dist/locale/hu_HU.js +4 -0
- package/dist/locale/hy_AM.js +20 -2
- package/dist/locale/id_ID.js +4 -0
- package/dist/locale/is_IS.js +4 -0
- package/dist/locale/it_IT.js +4 -0
- package/dist/locale/ja_JP.js +4 -0
- package/dist/locale/ka_GE.js +4 -0
- package/dist/locale/kk_KZ.js +4 -0
- package/dist/locale/km_KH.js +4 -0
- package/dist/locale/kmr_IQ.js +4 -0
- package/dist/locale/kn_IN.js +4 -0
- package/dist/locale/ko_KR.js +4 -0
- package/dist/locale/ku_IQ.js +4 -0
- package/dist/locale/lt_LT.js +4 -0
- package/dist/locale/lv_LV.js +4 -0
- package/dist/locale/mk_MK.js +4 -0
- package/dist/locale/ml_IN.js +4 -0
- package/dist/locale/mn_MN.js +4 -0
- package/dist/locale/mr_IN.js +4 -0
- package/dist/locale/ms_MY.js +4 -0
- package/dist/locale/my_MM.js +4 -0
- package/dist/locale/nb_NO.js +4 -0
- package/dist/locale/ne_NP.js +4 -0
- package/dist/locale/nl_BE.js +4 -0
- package/dist/locale/nl_NL.js +4 -0
- package/dist/locale/pl_PL.js +4 -0
- package/dist/locale/pt_BR.js +4 -0
- package/dist/locale/pt_PT.js +4 -0
- package/dist/locale/ro_RO.js +4 -0
- package/dist/locale/ru_RU.js +4 -0
- package/dist/locale/si_LK.js +4 -0
- package/dist/locale/sk_SK.js +4 -0
- package/dist/locale/sl_SI.js +4 -0
- package/dist/locale/sq_AL.js +4 -0
- package/dist/locale/sr_RS.js +4 -0
- package/dist/locale/sv_SE.js +4 -0
- package/dist/locale/ta_IN.js +4 -0
- package/dist/locale/th_TH.js +4 -0
- package/dist/locale/tk_TK.js +4 -0
- package/dist/locale/tr_TR.js +4 -0
- package/dist/locale/uk_UA.js +4 -0
- package/dist/locale/ur_PK.js +4 -0
- package/dist/locale/uz_UZ.js +4 -0
- package/dist/locale/vi_VN.js +4 -0
- package/dist/locale/zh_HK.js +4 -0
- package/dist/locale/zh_TW.js +5 -1
- package/dist/masonry/Masonry.js +9 -1
- package/dist/mentions/index.d.ts +1 -1
- package/dist/mentions/index.js +7 -3
- package/dist/menu/MenuContext.js +4 -1
- package/dist/menu/MenuItem.js +2 -2
- package/dist/menu/OverrideContext.js +4 -1
- package/dist/menu/style/theme.js +1 -0
- package/dist/message/PurePanel.js +2 -1
- package/dist/message/index.js +14 -9
- package/dist/message/interface.d.ts +8 -0
- package/dist/message/useMessage.d.ts +1 -1
- package/dist/message/useMessage.js +26 -32
- package/dist/modal/ConfirmDialog.js +1 -1
- package/dist/modal/Modal.js +3 -2
- package/dist/modal/PurePanel.js +2 -2
- package/dist/modal/components/NormalCancelBtn.js +6 -1
- package/dist/modal/interface.d.ts +1 -6
- package/dist/modal/shared.js +2 -1
- package/dist/notification/PurePanel.d.ts +1 -1
- package/dist/notification/PurePanel.js +12 -10
- package/dist/notification/index.js +4 -1
- package/dist/notification/interface.d.ts +4 -0
- package/dist/notification/useNotification.js +20 -22
- package/dist/package.js +1 -1
- package/dist/pagination/Pagination.js +3 -4
- package/dist/popconfirm/PurePanel.js +1 -1
- package/dist/popconfirm/index.js +10 -7
- package/dist/popover/PurePanel.js +8 -2
- package/dist/popover/index.js +10 -7
- package/dist/qrcode/QrcodeStatus.js +4 -1
- package/dist/qrcode/index.js +2 -1
- package/dist/radio/group.js +2 -2
- package/dist/radio/radio.js +4 -3
- package/dist/rate/index.d.ts +1 -1
- package/dist/rate/index.js +1 -5
- package/dist/result/index.js +4 -3
- package/dist/segmented/index.js +9 -6
- package/dist/segmented/style/index.js +5 -1
- package/dist/select/index.d.ts +5 -5
- package/dist/select/index.js +10 -6
- package/dist/skeleton/Element.js +2 -2
- package/dist/skeleton/Image.js +3 -1
- package/dist/slider/SliderTooltip.js +4 -1
- package/dist/slider/index.d.ts +2 -0
- package/dist/slider/index.js +9 -3
- package/dist/spin/index.js +2 -2
- package/dist/splitter/Panel.js +12 -3
- package/dist/splitter/SplitBar.js +12 -1
- package/dist/splitter/Splitter.js +2 -1
- package/dist/splitter/hooks/sizeUtil.js +17 -1
- package/dist/splitter/interface.d.ts +3 -1
- package/dist/splitter/style/index.js +6 -1
- package/dist/statistic/Number.js +2 -1
- package/dist/statistic/Statistic.js +5 -4
- package/dist/steps/ProgressIcon.js +7 -10
- package/dist/steps/index.js +3 -4
- package/dist/switch/index.d.ts +0 -2
- package/dist/table/Column.d.ts +5 -1
- package/dist/table/Column.js +10 -1
- package/dist/table/ColumnGroup.js +5 -0
- package/dist/table/InternalTable.d.ts +4 -1
- package/dist/table/InternalTable.js +28 -18
- package/dist/table/Table.js +16 -5
- package/dist/table/hooks/useFilter/FilterDropdown.js +14 -14
- package/dist/table/hooks/useFilter/index.d.ts +3 -1
- package/dist/table/hooks/useFilter/index.js +2 -2
- package/dist/table/hooks/useSelection.js +7 -3
- package/dist/table/interface.d.ts +11 -4
- package/dist/table/style/index.js +30 -2
- package/dist/table/style/virtual.js +2 -1
- package/dist/table/util.d.ts +1 -1
- package/dist/table/utils.js +20 -2
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +15 -7
- package/dist/tag/CheckableTag.d.ts +0 -3
- package/dist/tag/CheckableTag.js +5 -3
- package/dist/tag/CheckableTagGroup.js +19 -3
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/tag/index.js +4 -3
- package/dist/theme/context.d.ts +0 -1
- package/dist/theme/util/alias.js +3 -0
- package/dist/theme/util/genStyleUtils.d.ts +4 -0
- package/dist/time-picker/index.d.ts +8 -3
- package/dist/time-picker/index.js +72 -8
- package/dist/timeline/TimelineItem.js +4 -1
- package/dist/timeline/useItems.js +2 -1
- package/dist/tooltip/PurePanel.js +4 -1
- package/dist/tooltip/index.d.ts +5 -2
- package/dist/tooltip/index.js +8 -5
- package/dist/tooltip/style/index.d.ts +0 -1
- package/dist/tour/index.js +2 -3
- package/dist/tour/interface.d.ts +7 -5
- package/dist/tour/panelRender.js +6 -6
- package/dist/transfer/ListBody.js +1 -1
- package/dist/transfer/Section.js +3 -2
- package/dist/transfer/Transfer.js +37 -13
- package/dist/transfer/hooks/useSelection.js +1 -1
- package/dist/transfer/interface.d.ts +1 -1
- package/dist/tree/DirectoryTree.js +3 -1
- package/dist/tree/Tree.js +6 -6
- package/dist/tree/utils/dictUtil.js +2 -2
- package/dist/tree-select/index.d.ts +6 -7
- package/dist/tree-select/index.js +20 -8
- package/dist/typography/Base/Ellipsis.js +2 -1
- package/dist/typography/Base/index.js +6 -3
- package/dist/typography/Editable.js +2 -1
- package/dist/upload/Dragger.js +2 -4
- package/dist/upload/Upload.d.ts +0 -1
- package/dist/upload/Upload.js +2 -2
- package/dist/upload/UploadList/ListItem.d.ts +1 -0
- package/dist/upload/UploadList/ListItem.js +15 -9
- package/dist/upload/UploadList/index.js +1 -0
- package/dist/upload/interface.d.ts +6 -7
- package/dist/version/token.json +1 -1
- package/dist/watermark/useClips.js +1 -0
- package/package.json +37 -37
- package/web-tags.json +1258 -1224
- package/web-types.json +4483 -4517
package/dist/spin/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
2
|
import { useComponentBaseConfig, useComponentConfig } from "../config-provider/context.js";
|
|
3
3
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
|
-
import { getAttrStyleAndClass
|
|
4
|
+
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
5
5
|
import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
6
6
|
import Indicator from "./Indicator/index.js";
|
|
7
7
|
import style_default from "./style/index.js";
|
|
@@ -60,7 +60,7 @@ const Spin = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose }) =
|
|
|
60
60
|
const description = getSlotPropsFnRun(slots, props, "description");
|
|
61
61
|
const tip = getSlotPropsFnRun(slots, props, "tip");
|
|
62
62
|
const mergedDescription = description ?? tip;
|
|
63
|
-
const { style, className, restAttrs } = getAttrStyleAndClass
|
|
63
|
+
const { style, className, restAttrs } = getAttrStyleAndClass(attrs);
|
|
64
64
|
if (isDev) {
|
|
65
65
|
warning.deprecated(size !== "default", "size=\"default\"", "size=\"medium\"");
|
|
66
66
|
warning.deprecated(!props.tip && !slots.tip, "tip", "description");
|
package/dist/splitter/Panel.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
+
import { normalizeStyle as normalizeStyle$1 } from "../_util/styleUtils.js";
|
|
1
2
|
import { createVNode, defineComponent, mergeProps } from "vue";
|
|
2
3
|
import { clsx } from "@v-c/util";
|
|
3
4
|
//#region src/splitter/Panel.tsx
|
|
4
5
|
const InternalPanel = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
5
6
|
return () => {
|
|
6
|
-
const { prefixCls, class: className, size, style = {}, destroyOnHidden } = props;
|
|
7
|
+
const { prefixCls, class: className, size, style = {}, destroyOnHidden, supportMotion } = props;
|
|
7
8
|
const isHidden = size === 0;
|
|
8
|
-
const panelClassName = clsx(`${prefixCls}-panel`, {
|
|
9
|
+
const panelClassName = clsx(`${prefixCls}-panel`, {
|
|
10
|
+
[`${prefixCls}-panel-hidden`]: isHidden,
|
|
11
|
+
[`${prefixCls}-panel-transition`]: supportMotion
|
|
12
|
+
}, className);
|
|
9
13
|
const hasSize = size !== void 0;
|
|
10
14
|
return createVNode("div", mergeProps(attrs, {
|
|
11
15
|
"class": panelClassName,
|
|
12
16
|
"style": {
|
|
13
|
-
...style,
|
|
17
|
+
...normalizeStyle$1(style) || {},
|
|
14
18
|
flexBasis: hasSize ? typeof size === "number" ? `${size}px` : size : "auto",
|
|
15
19
|
flexGrow: hasSize ? 0 : 1
|
|
16
20
|
}
|
|
@@ -26,6 +30,11 @@ const InternalPanel = /* @__PURE__ */ defineComponent((props, { slots, attrs })
|
|
|
26
30
|
type: String,
|
|
27
31
|
required: false
|
|
28
32
|
},
|
|
33
|
+
supportMotion: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
required: false,
|
|
36
|
+
default: void 0
|
|
37
|
+
},
|
|
29
38
|
style: {
|
|
30
39
|
type: Object,
|
|
31
40
|
required: false
|
|
@@ -215,7 +215,18 @@ const SplitBar = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
215
215
|
type: Boolean,
|
|
216
216
|
required: true
|
|
217
217
|
},
|
|
218
|
-
draggerIcon: {
|
|
218
|
+
draggerIcon: {
|
|
219
|
+
type: [
|
|
220
|
+
Function,
|
|
221
|
+
String,
|
|
222
|
+
Number,
|
|
223
|
+
null,
|
|
224
|
+
Object,
|
|
225
|
+
Boolean
|
|
226
|
+
],
|
|
227
|
+
required: false,
|
|
228
|
+
default: void 0
|
|
229
|
+
},
|
|
219
230
|
collapsibleIcon: {
|
|
220
231
|
type: Object,
|
|
221
232
|
required: false
|
|
@@ -109,7 +109,8 @@ const Splitter = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose
|
|
|
109
109
|
}
|
|
110
110
|
}, {
|
|
111
111
|
"prefixCls": prefixCls.value,
|
|
112
|
-
"size": panelSizes.value[idx]
|
|
112
|
+
"size": panelSizes.value[idx],
|
|
113
|
+
"supportMotion": collapsible?.motion && movingIndex.value === void 0
|
|
113
114
|
}), { default: () => [item._$slots?.default?.()] });
|
|
114
115
|
let splitBar = null;
|
|
115
116
|
const resizableInfo = resizableInfos.value[idx];
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
//#region src/splitter/hooks/sizeUtil.ts
|
|
2
|
+
function fitPtgSizes(sizes, minSizes, maxSizes) {
|
|
3
|
+
const mergedMinSizes = sizes.map((size, index) => size === 0 ? 0 : minSizes[index] ?? 0);
|
|
4
|
+
const mergedMaxSizes = sizes.map((size, index) => size === 0 ? 0 : maxSizes[index] ?? 1);
|
|
5
|
+
const invalidLimits = mergedMinSizes.some((min, index) => min > mergedMaxSizes[index]);
|
|
6
|
+
const totalMin = mergedMinSizes.reduce((sum, size) => sum + size, 0);
|
|
7
|
+
const totalMax = mergedMaxSizes.reduce((sum, size) => sum + size, 0);
|
|
8
|
+
if (invalidLimits || totalMin > 1 || totalMax < 1) return sizes;
|
|
9
|
+
const result = sizes.map((size, index) => Math.min(mergedMaxSizes[index], Math.max(mergedMinSizes[index], size)));
|
|
10
|
+
const total = result.reduce((sum, size) => sum + size, 0);
|
|
11
|
+
if (total === 1) return result;
|
|
12
|
+
const grow = total < 1;
|
|
13
|
+
const spaces = result.map((size, index) => grow ? mergedMaxSizes[index] - size : size - mergedMinSizes[index]);
|
|
14
|
+
const totalSpace = spaces.reduce((sum, space) => sum + space, 0);
|
|
15
|
+
const rest = 1 - total;
|
|
16
|
+
return result.map((size, index) => size + rest * (spaces[index] / totalSpace));
|
|
17
|
+
}
|
|
2
18
|
function autoPtgSizes(ptgSizes, minPtgSizes, maxPtgSizes) {
|
|
3
19
|
let currentTotalPtg = 0;
|
|
4
20
|
const undefinedIndexes = [];
|
|
@@ -14,7 +30,7 @@ function autoPtgSizes(ptgSizes, minPtgSizes, maxPtgSizes) {
|
|
|
14
30
|
return ptgSizes.map(() => avg);
|
|
15
31
|
}
|
|
16
32
|
const scale = 1 / currentTotalPtg;
|
|
17
|
-
return ptgSizes.map((size) => size * scale);
|
|
33
|
+
return fitPtgSizes(ptgSizes.map((size) => size * scale), minPtgSizes, maxPtgSizes);
|
|
18
34
|
}
|
|
19
35
|
if (restPtg < 0) {
|
|
20
36
|
const scale = 1 / currentTotalPtg;
|
|
@@ -46,9 +46,10 @@ interface SplitterProps extends ComponentBaseProps {
|
|
|
46
46
|
vertical?: boolean;
|
|
47
47
|
draggerIcon?: VueNode;
|
|
48
48
|
/**
|
|
49
|
-
* Collapse configuration.
|
|
49
|
+
* Collapse configuration. Set `motion: true` to enable collapse animation.
|
|
50
50
|
*/
|
|
51
51
|
collapsible?: {
|
|
52
|
+
motion?: boolean;
|
|
52
53
|
icon?: {
|
|
53
54
|
start?: VueNode;
|
|
54
55
|
end?: VueNode;
|
|
@@ -98,6 +99,7 @@ interface PanelProps {
|
|
|
98
99
|
interface InternalPanelProps extends PanelProps {
|
|
99
100
|
class?: string;
|
|
100
101
|
prefixCls?: string;
|
|
102
|
+
supportMotion?: boolean;
|
|
101
103
|
}
|
|
102
104
|
interface UseResizeProps {
|
|
103
105
|
basicsState: number[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { genFocusOutline, resetComponent } from "../../style/index.js";
|
|
2
2
|
import { genCssVar, genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
3
|
+
import { genNoMotionStyle } from "../../style/motion/util.js";
|
|
3
4
|
//#region src/splitter/style/index.ts
|
|
4
5
|
const centerStyle = {
|
|
5
6
|
position: "absolute",
|
|
@@ -212,7 +213,11 @@ const genSplitterStyle = (token) => {
|
|
|
212
213
|
padding: 0,
|
|
213
214
|
overflow: "hidden"
|
|
214
215
|
},
|
|
215
|
-
[`&:has(${componentCls}:only-child)`]: { overflow: "hidden" }
|
|
216
|
+
[`&:has(${componentCls}:only-child)`]: { overflow: "hidden" },
|
|
217
|
+
"&-transition": {
|
|
218
|
+
transition: `flex-basis ${token.motionDurationSlow} ${token.motionEaseInOut}`,
|
|
219
|
+
...genNoMotionStyle()
|
|
220
|
+
}
|
|
216
221
|
}
|
|
217
222
|
} };
|
|
218
223
|
};
|
package/dist/statistic/Number.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNumber } from "../_util/is.js";
|
|
1
2
|
import { createVNode, defineComponent } from "vue";
|
|
2
3
|
//#region src/statistic/Number.tsx
|
|
3
4
|
const StatisticNumber = /* @__PURE__ */ defineComponent((props) => {
|
|
@@ -14,7 +15,7 @@ const StatisticNumber = /* @__PURE__ */ defineComponent((props) => {
|
|
|
14
15
|
let int = cells[2] || "0";
|
|
15
16
|
let decimal = cells[4] || "";
|
|
16
17
|
int = int.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
|
|
17
|
-
if (
|
|
18
|
+
if (isNumber(precision)) decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0);
|
|
18
19
|
if (decimal) decimal = `${decimalSeparator}${decimal}`;
|
|
19
20
|
valueNode = [createVNode("span", {
|
|
20
21
|
"key": "int",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
2
|
import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
3
3
|
import { clsx as clsx$1, getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
4
|
+
import { isFunction, isRenderable } from "../_util/is.js";
|
|
4
5
|
import skeleton_default from "../skeleton/index.js";
|
|
5
6
|
import StatisticNumber from "./Number.js";
|
|
6
7
|
import style_default from "./style/index.js";
|
|
@@ -55,7 +56,7 @@ const Statistic = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit,
|
|
|
55
56
|
"style": [mergedStyles.value.root, attrs.style],
|
|
56
57
|
"onMouseenter": handleMouseEnter,
|
|
57
58
|
"onMouseleave": handleMouseLeave
|
|
58
|
-
}), [
|
|
59
|
+
}), [isRenderable(title) && createVNode("div", {
|
|
59
60
|
"class": headerClassNames,
|
|
60
61
|
"style": mergedStyles.value.header
|
|
61
62
|
}, [createVNode("div", {
|
|
@@ -70,12 +71,12 @@ const Statistic = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit,
|
|
|
70
71
|
"style": [valueStyle, mergedStyles.value.content],
|
|
71
72
|
"class": contentClassNames
|
|
72
73
|
}, [
|
|
73
|
-
|
|
74
|
+
isRenderable(prefix) && createVNode("span", {
|
|
74
75
|
"class": prefixClassNames,
|
|
75
76
|
"style": mergedStyles.value.prefix
|
|
76
77
|
}, [prefix]),
|
|
77
|
-
valueRender ? valueRender(valueNode) : valueNode,
|
|
78
|
-
|
|
78
|
+
isFunction(valueRender) ? valueRender(valueNode) : valueNode,
|
|
79
|
+
isRenderable(suffix) && createVNode("span", {
|
|
79
80
|
"class": suffixClassNames,
|
|
80
81
|
"style": mergedStyles.value.suffix
|
|
81
82
|
}, [suffix])
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { genCssVar } from "../theme/util/genStyleUtils.js";
|
|
2
|
-
import { Fragment,
|
|
2
|
+
import { Fragment, createVNode, defineComponent } from "vue";
|
|
3
3
|
import { clsx } from "@v-c/util";
|
|
4
4
|
//#region src/steps/ProgressIcon.tsx
|
|
5
5
|
const ProgressIcon = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
@@ -15,18 +15,15 @@ const ProgressIcon = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
15
15
|
"width": "100%",
|
|
16
16
|
"height": "100%",
|
|
17
17
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
18
|
+
"role": "progressbar",
|
|
18
19
|
"aria-valuemax": 100,
|
|
19
20
|
"aria-valuemin": 0,
|
|
20
21
|
"aria-valuenow": percent
|
|
21
|
-
}, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"stroke-dasharray": dashArray,
|
|
27
|
-
"transform": "rotate(-90 50 50)"
|
|
28
|
-
}, null)
|
|
29
|
-
]), slots?.default?.()]);
|
|
22
|
+
}, [createVNode("circle", { "class": clsx(circleCls, `${circleCls}-rail`) }, null), createVNode("circle", {
|
|
23
|
+
"class": clsx(circleCls, `${circleCls}-ptg`),
|
|
24
|
+
"stroke-dasharray": dashArray,
|
|
25
|
+
"transform": "rotate(-90 50 50)"
|
|
26
|
+
}, null)]), slots?.default?.()]);
|
|
30
27
|
};
|
|
31
28
|
}, {
|
|
32
29
|
props: {
|
package/dist/steps/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { devUseWarning, isDev } from "../_util/warning.js";
|
|
|
2
2
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
3
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
4
|
import { genCssVar } from "../theme/util/genStyleUtils.js";
|
|
5
|
-
import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
6
|
-
import { getSlotPropsFnRun, toPropsRefs
|
|
5
|
+
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
6
|
+
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
7
7
|
import InternalTooltip from "../tooltip/index.js";
|
|
8
8
|
import { TARGET_CLS } from "../_util/wave/interface.js";
|
|
9
9
|
import wave_default from "../_util/wave/index.js";
|
|
@@ -15,7 +15,6 @@ import style_default from "./style/index.js";
|
|
|
15
15
|
import useDisplaySteps from "./useDisplaySteps.js";
|
|
16
16
|
import { Fragment, computed, createVNode, defineComponent, isVNode, mergeDefaults, mergeProps } from "vue";
|
|
17
17
|
import { clsx } from "@v-c/util";
|
|
18
|
-
import { getAttrStyleAndClass } from "@v-c/util/dist/props-util";
|
|
19
18
|
import { CheckOutlined } from "@antdv-next/icons";
|
|
20
19
|
import VcSteps from "@v-c/steps";
|
|
21
20
|
//#region src/steps/index.tsx
|
|
@@ -26,7 +25,7 @@ const waveEffectClassNames = { itemIcon: TARGET_CLS };
|
|
|
26
25
|
const Steps = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) => {
|
|
27
26
|
const internalContent = useInternalContext();
|
|
28
27
|
const { direction: rtlDirection, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, prefixCls, rootPrefixCls } = useComponentBaseConfig("steps", props);
|
|
29
|
-
const { size, items, responsive, type, classes, styles } = toPropsRefs
|
|
28
|
+
const { size, items, responsive, type, classes, styles } = toPropsRefs(props, "size", "items", "responsive", "type", "classes", "styles");
|
|
30
29
|
const components = computed(() => {
|
|
31
30
|
return {
|
|
32
31
|
root: internalContent.value?.rootComponent,
|
package/dist/switch/index.d.ts
CHANGED
|
@@ -27,12 +27,10 @@ interface SwitchProps extends ComponentBaseProps, SwitchEmitsProps {
|
|
|
27
27
|
defaultChecked?: CheckedValueType;
|
|
28
28
|
/**
|
|
29
29
|
* Alias for `checked`.
|
|
30
|
-
* @since 5.12.0
|
|
31
30
|
*/
|
|
32
31
|
value?: CheckedValueType;
|
|
33
32
|
/**
|
|
34
33
|
* Alias for `defaultChecked`.
|
|
35
|
-
* @since 5.12.0
|
|
36
34
|
*/
|
|
37
35
|
defaultValue?: CheckedValueType;
|
|
38
36
|
/**
|
package/dist/table/Column.d.ts
CHANGED
|
@@ -9,7 +9,11 @@ interface ColumnSlots {
|
|
|
9
9
|
default?: () => any;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Syntactic sugar for `columns` prop.
|
|
12
|
+
* Syntactic sugar for the `columns` prop.
|
|
13
|
+
*
|
|
14
|
+
* Kebab-case template attributes (`data-index`, `min-width`, ...) are
|
|
15
|
+
* remapped to the camelCase field names the table understands in
|
|
16
|
+
* `convertColumnsToColumnProps` (see `./utils.ts`).
|
|
13
17
|
*/
|
|
14
18
|
declare const Column: import("vue").DefineSetupFnComponent<ColumnProps<AnyObject>, EmptyEmit, SlotsType<ColumnSlots>, ColumnProps<AnyObject>, import("vue").PublicProps>;
|
|
15
19
|
//#endregion
|
package/dist/table/Column.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { defineComponent } from "vue";
|
|
2
2
|
//#region src/table/Column.tsx
|
|
3
3
|
/**
|
|
4
|
-
* Syntactic sugar for `columns` prop.
|
|
4
|
+
* Syntactic sugar for the `columns` prop.
|
|
5
|
+
*
|
|
6
|
+
* Kebab-case template attributes (`data-index`, `min-width`, ...) are
|
|
7
|
+
* remapped to the camelCase field names the table understands in
|
|
8
|
+
* `convertColumnsToColumnProps` (see `./utils.ts`).
|
|
5
9
|
*/
|
|
6
10
|
const Column = /* @__PURE__ */ defineComponent(() => {
|
|
7
11
|
return () => null;
|
|
@@ -13,6 +17,11 @@ const Column = /* @__PURE__ */ defineComponent(() => {
|
|
|
13
17
|
required: false,
|
|
14
18
|
skipCheck: true
|
|
15
19
|
},
|
|
20
|
+
resizable: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
required: false,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
16
25
|
sorter: {
|
|
17
26
|
type: [
|
|
18
27
|
Boolean,
|
|
@@ -52,7 +52,7 @@ type TableStylesType<RecordType = AnyObject> = SemanticStylesType<TableProps<Rec
|
|
|
52
52
|
header?: ComponentsSemanticStyles;
|
|
53
53
|
pagination?: PaginationSemanticStyles;
|
|
54
54
|
}>;
|
|
55
|
-
interface TableProps<RecordType = AnyObject> extends ComponentBaseProps, Omit<TableProps$1<RecordType>, 'transformColumns' | 'internalHooks' | 'internalRefs' | 'data' | 'columns' | 'scroll' | 'emptyText' | 'className' | 'style' | 'classNames' | 'styles' | 'getPopupContainer' | 'onUpdate:expandedRowKeys' | 'onScroll'> {
|
|
55
|
+
interface TableProps<RecordType = AnyObject> extends ComponentBaseProps, Omit<TableProps$1<RecordType>, 'transformColumns' | 'internalHooks' | 'internalRefs' | 'data' | 'columns' | 'scroll' | 'emptyText' | 'className' | 'style' | 'classNames' | 'styles' | 'getPopupContainer' | 'onUpdate:expandedRowKeys' | 'onScroll' | 'onResizeColumn'> {
|
|
56
56
|
classes?: TableClassNamesType<RecordType>;
|
|
57
57
|
styles?: TableStylesType<RecordType>;
|
|
58
58
|
dropdownPrefixCls?: string;
|
|
@@ -80,12 +80,15 @@ interface TableEmits<RecordType = AnyObject> {
|
|
|
80
80
|
'change': (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<RecordType> | SorterResult<RecordType>[], extra: TableCurrentDataSource<RecordType>) => void;
|
|
81
81
|
'update:expandedRowKeys': (keys: readonly Key[]) => void;
|
|
82
82
|
'scroll': NonNullable<TableProps$1['onScroll']>;
|
|
83
|
+
/** Fired once per drag on a `resizable` column. `columnKey` is the key the width is tracked by (the column `key`, or its position when unset). */
|
|
84
|
+
'resizeColumn': (width: number, column: ColumnType$1<RecordType>, columnKey: Key) => void;
|
|
83
85
|
}
|
|
84
86
|
interface TableExpose extends Reference {}
|
|
85
87
|
interface TableEmitsProps<RecordType = AnyObject> {
|
|
86
88
|
onChange?: TableEmits<RecordType>['change'];
|
|
87
89
|
'onUpdate:expandedRowKeys'?: TableEmits<RecordType>['update:expandedRowKeys'];
|
|
88
90
|
onScroll?: TableEmits<RecordType>['scroll'];
|
|
91
|
+
onResizeColumn?: TableEmits<RecordType>['resizeColumn'];
|
|
89
92
|
}
|
|
90
93
|
interface TableSlots<RecordType = AnyObject> {
|
|
91
94
|
default?: () => any;
|
|
@@ -2,8 +2,8 @@ import { devUseWarning, isDev } from "../_util/warning.js";
|
|
|
2
2
|
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
3
3
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
4
|
import useToken from "../theme/useToken.js";
|
|
5
|
-
import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
6
|
-
import { getSlotPropsFnRun, toPropsRefs
|
|
5
|
+
import { getAttrStyleAndClass, mergeClassNames, mergeStyles, resolveStyleOrClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
6
|
+
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
7
7
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
8
8
|
import { TableMeasureRowContextProvider } from "./TableMeasureRowContext.js";
|
|
9
9
|
import ConfigProvider from "../config-provider/index.js";
|
|
@@ -30,7 +30,6 @@ import style_default from "./style/index.js";
|
|
|
30
30
|
import { convertColumnsToColumnProps } from "./utils.js";
|
|
31
31
|
import { computed, createVNode, defineComponent, h, inject, isVNode, mergeDefaults, mergeProps, provide, shallowRef, watch, watchEffect } from "vue";
|
|
32
32
|
import { clsx } from "@v-c/util";
|
|
33
|
-
import { getAttrStyleAndClass } from "@v-c/util/dist/props-util";
|
|
34
33
|
import { omit } from "es-toolkit";
|
|
35
34
|
import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
36
35
|
import VcTable, { INTERNAL_HOOKS, VirtualTable } from "@v-c/table";
|
|
@@ -82,7 +81,7 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
82
81
|
}
|
|
83
82
|
};
|
|
84
83
|
});
|
|
85
|
-
const { classes, styles } = toPropsRefs
|
|
84
|
+
const { classes, styles } = toPropsRefs(props, "classes", "styles");
|
|
86
85
|
const mergedSize = useSize(computed(() => props.size));
|
|
87
86
|
const mergedProps = computed(() => {
|
|
88
87
|
return {
|
|
@@ -191,9 +190,9 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
191
190
|
globalLocale
|
|
192
191
|
});
|
|
193
192
|
const sortedData = computed(() => getSortData(rawData.value, sortStates.value, childrenColumnName.value));
|
|
194
|
-
const filterStates = shallowRef(collectFilterStates(mergedColumns.value, true));
|
|
193
|
+
const filterStates = shallowRef(collectFilterStates(baseColumns.value ?? mergedColumns.value, true));
|
|
195
194
|
const filterStateWarning = isDev ? devUseWarning("Table") : void 0;
|
|
196
|
-
const mergedFilterStates = computed(() => getMergedFilterStates(mergedColumns.value, filterStates.value, filterStateWarning));
|
|
195
|
+
const mergedFilterStates = computed(() => getMergedFilterStates(mergedColumns.value, filterStates.value, filterStateWarning, baseColumns.value));
|
|
197
196
|
const filters = computed(() => generateFilterInfo(mergedFilterStates.value));
|
|
198
197
|
const onFilterChange = (filters, filterStates) => {
|
|
199
198
|
triggerOnChange({
|
|
@@ -340,12 +339,18 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
340
339
|
if (typeof expandable.indentSize !== "number") expandable.indentSize = typeof props.indentSize === "number" ? props.indentSize : 15;
|
|
341
340
|
return expandable;
|
|
342
341
|
})();
|
|
343
|
-
const renderPagination = (placement = "end") =>
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
342
|
+
const renderPagination = (placement = "end") => {
|
|
343
|
+
const paginationProps = mergedPagination.value;
|
|
344
|
+
const paginationSize = getPaginationSize(paginationProps.size, mergedSize.value);
|
|
345
|
+
const paginationClasses = (info) => mergeClassNames({}, mergedClassNames.value.pagination, resolveStyleOrClass(paginationProps.classes, info));
|
|
346
|
+
const paginationStyles = (info) => mergeStyles(resolveStyleOrClass(paginationProps.styles, info), mergedStyles.value.pagination);
|
|
347
|
+
return createVNode(pagination_default, mergeProps(paginationProps, {
|
|
348
|
+
"classes": paginationClasses,
|
|
349
|
+
"styles": paginationStyles,
|
|
350
|
+
"class": clsx(`${prefixCls.value}-pagination`, `${prefixCls.value}-pagination-${placement}`),
|
|
351
|
+
"size": paginationSize
|
|
352
|
+
}), null);
|
|
353
|
+
};
|
|
349
354
|
const paginationNodes = (() => {
|
|
350
355
|
if (props.pagination === false || !mergedPagination.value.total) return {
|
|
351
356
|
top: null,
|
|
@@ -406,7 +411,7 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
406
411
|
"styles": mergedStyles.value,
|
|
407
412
|
"expandable": mergedExpandableConfig,
|
|
408
413
|
"prefixCls": prefixCls.value,
|
|
409
|
-
"direction":
|
|
414
|
+
"direction": direction.value,
|
|
410
415
|
"headerCell": slots.headerCell || contextHeaderCell.value || props.headerCell ? renderHeaderCell : void 0,
|
|
411
416
|
"bodyCell": slots.bodyCell || props.bodyCell || contextBodyCell.value || configCtx.value?.transformCellText ? renderBodyCell : void 0,
|
|
412
417
|
"className": tableClassName,
|
|
@@ -419,7 +424,8 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
419
424
|
"title": title,
|
|
420
425
|
"footer": footer,
|
|
421
426
|
"summary": summary,
|
|
422
|
-
"onUpdate:expandedRowKeys": (keys) => emit("update:expandedRowKeys", keys)
|
|
427
|
+
"onUpdate:expandedRowKeys": (keys) => emit("update:expandedRowKeys", keys),
|
|
428
|
+
"onResizeColumn": (width, column, columnKey) => emit("resizeColumn", width, column, columnKey)
|
|
423
429
|
}), null),
|
|
424
430
|
paginationNodes.bottom
|
|
425
431
|
] })]);
|
|
@@ -512,9 +518,12 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
512
518
|
required: false
|
|
513
519
|
},
|
|
514
520
|
rowKey: {
|
|
515
|
-
type: [
|
|
516
|
-
|
|
517
|
-
|
|
521
|
+
type: [
|
|
522
|
+
String,
|
|
523
|
+
Number,
|
|
524
|
+
Function
|
|
525
|
+
],
|
|
526
|
+
required: false
|
|
518
527
|
},
|
|
519
528
|
tableLayout: {
|
|
520
529
|
type: String,
|
|
@@ -651,7 +660,8 @@ const InternalTable = /* @__PURE__ */ defineComponent((props, { slots, emit, att
|
|
|
651
660
|
emits: [
|
|
652
661
|
"change",
|
|
653
662
|
"update:expandedRowKeys",
|
|
654
|
-
"scroll"
|
|
663
|
+
"scroll",
|
|
664
|
+
"resizeColumn"
|
|
655
665
|
],
|
|
656
666
|
name: "AInternalTable",
|
|
657
667
|
inheritAttrs: false
|
package/dist/table/Table.js
CHANGED
|
@@ -16,13 +16,20 @@ const ForwardTable = /* @__PURE__ */ defineComponent((props, { slots, attrs, exp
|
|
|
16
16
|
return tableRef.value?.nativeElement;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
return () => createVNode(InternalTable, mergeProps(omit(props, [
|
|
19
|
+
return () => createVNode(InternalTable, mergeProps(omit(props, [
|
|
20
|
+
"onUpdate:expandedRowKeys",
|
|
21
|
+
"onChange",
|
|
22
|
+
"onResizeColumn"
|
|
23
|
+
]), attrs, {
|
|
20
24
|
"onChange": (pagination, filters, sorter, extra) => {
|
|
21
25
|
emit("change", pagination, filters, sorter, extra);
|
|
22
26
|
},
|
|
23
27
|
"onUpdate:expandedRowKeys": (keys) => {
|
|
24
28
|
emit("update:expandedRowKeys", keys);
|
|
25
29
|
},
|
|
30
|
+
"onResizeColumn": (width, column, columnKey) => {
|
|
31
|
+
emit("resizeColumn", width, column, columnKey);
|
|
32
|
+
},
|
|
26
33
|
"_renderTimes": renderTimesRef.value,
|
|
27
34
|
"ref": tableRef
|
|
28
35
|
}), slots);
|
|
@@ -110,9 +117,12 @@ const ForwardTable = /* @__PURE__ */ defineComponent((props, { slots, attrs, exp
|
|
|
110
117
|
required: false
|
|
111
118
|
},
|
|
112
119
|
rowKey: {
|
|
113
|
-
type: [
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
type: [
|
|
121
|
+
String,
|
|
122
|
+
Number,
|
|
123
|
+
Function
|
|
124
|
+
],
|
|
125
|
+
required: false
|
|
116
126
|
},
|
|
117
127
|
tableLayout: {
|
|
118
128
|
type: String,
|
|
@@ -249,7 +259,8 @@ const ForwardTable = /* @__PURE__ */ defineComponent((props, { slots, attrs, exp
|
|
|
249
259
|
emits: [
|
|
250
260
|
"change",
|
|
251
261
|
"update:expandedRowKeys",
|
|
252
|
-
"scroll"
|
|
262
|
+
"scroll",
|
|
263
|
+
"resizeColumn"
|
|
253
264
|
],
|
|
254
265
|
name: "ATable",
|
|
255
266
|
inheritAttrs: false
|
|
@@ -87,10 +87,10 @@ const FilterDropdown = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
87
87
|
const filterState = props.filterState;
|
|
88
88
|
return !!(filterState && (filterState.filteredKeys?.length || filterState.forceFiltered));
|
|
89
89
|
});
|
|
90
|
-
const
|
|
91
|
-
visible.value =
|
|
92
|
-
filterDropdownProps.value.onOpenChange?.(
|
|
93
|
-
column.value.onFilterDropdownOpenChange?.(
|
|
90
|
+
const triggerOpen = (nextOpen) => {
|
|
91
|
+
visible.value = nextOpen;
|
|
92
|
+
filterDropdownProps.value.onOpenChange?.(nextOpen);
|
|
93
|
+
column.value.onFilterDropdownOpenChange?.(nextOpen);
|
|
94
94
|
};
|
|
95
95
|
if (isDev) {
|
|
96
96
|
const warning = devUseWarning("Table");
|
|
@@ -110,7 +110,7 @@ const FilterDropdown = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
110
110
|
};
|
|
111
111
|
const onCheck = (keys, info) => {
|
|
112
112
|
const { node, checked } = info;
|
|
113
|
-
if (!props.filterMultiple) onSelectKeys({ selectedKeys: checked
|
|
113
|
+
if (!props.filterMultiple) onSelectKeys({ selectedKeys: checked ? [node.key] : [] });
|
|
114
114
|
else onSelectKeys({ selectedKeys: keys });
|
|
115
115
|
};
|
|
116
116
|
watch([propFilteredKeys, mergedVisible], ([nextKeys, nextVisible]) => {
|
|
@@ -142,7 +142,7 @@ const FilterDropdown = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
142
142
|
});
|
|
143
143
|
};
|
|
144
144
|
const onConfirm = () => {
|
|
145
|
-
|
|
145
|
+
triggerOpen(false);
|
|
146
146
|
internalTriggerFilter(filteredKeysSync.value);
|
|
147
147
|
};
|
|
148
148
|
const onReset = ({ confirm, closeDropdown } = {
|
|
@@ -150,21 +150,21 @@ const FilterDropdown = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
150
150
|
closeDropdown: false
|
|
151
151
|
}) => {
|
|
152
152
|
if (confirm) internalTriggerFilter([]);
|
|
153
|
-
if (closeDropdown)
|
|
153
|
+
if (closeDropdown) triggerOpen(false);
|
|
154
154
|
searchValue.value = "";
|
|
155
155
|
if (column.value.filterResetToDefaultFilteredValue) setFilteredKeysSync((column.value.defaultFilteredValue || []).map((key) => String(key)));
|
|
156
156
|
else setFilteredKeysSync([]);
|
|
157
157
|
};
|
|
158
158
|
const doFilter = ({ closeDropdown } = { closeDropdown: true }) => {
|
|
159
|
-
if (closeDropdown)
|
|
159
|
+
if (closeDropdown) triggerOpen(false);
|
|
160
160
|
internalTriggerFilter(filteredKeysSync.value);
|
|
161
161
|
};
|
|
162
162
|
const filterDropdownDefined = computed(() => props.filterDropdownRender !== void 0 || column.value?.filterDropdown !== void 0);
|
|
163
|
-
const
|
|
163
|
+
const onDropdownOpenChange = (nextOpen, info) => {
|
|
164
164
|
if (info?.source === "trigger") {
|
|
165
|
-
if (
|
|
166
|
-
if (!
|
|
167
|
-
else
|
|
165
|
+
if (nextOpen && propFilteredKeys.value !== void 0) setFilteredKeysSync(wrapStringListType(propFilteredKeys.value));
|
|
166
|
+
if (!nextOpen && !hasPropDropdownRender && !column.value.filterDropdown && props.filterOnClose) onConfirm();
|
|
167
|
+
else triggerOpen(nextOpen);
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
const dropdownMenuClass = computed(() => clsx({ [`${props.dropdownPrefixCls}-menu-without-submenu`]: !hasSubMenu(column?.value?.filters || []) }));
|
|
@@ -218,7 +218,7 @@ const FilterDropdown = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
218
218
|
filters: column.value.filters,
|
|
219
219
|
visible: mergedVisible.value,
|
|
220
220
|
close: () => {
|
|
221
|
-
|
|
221
|
+
triggerOpen(false);
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
let filterNode = null;
|
|
@@ -357,7 +357,7 @@ const FilterDropdown = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
|
357
357
|
}, {
|
|
358
358
|
...filterDropdownProps.value,
|
|
359
359
|
open: mergedVisible.value,
|
|
360
|
-
onOpenChange:
|
|
360
|
+
onOpenChange: onDropdownOpenChange,
|
|
361
361
|
popupRender: () => {
|
|
362
362
|
if (typeof filterDropdownProps.value.popupRender === "function") return filterDropdownProps.value.popupRender(dropdownContent);
|
|
363
363
|
if (typeof filterDropdownProps.value.dropdownRender === "function") return filterDropdownProps.value.dropdownRender(dropdownContent);
|
|
@@ -30,7 +30,9 @@ interface FilterConfig<RecordType = AnyObject> {
|
|
|
30
30
|
getPopupContainer?: GetPopupContainer;
|
|
31
31
|
rootClassName?: string;
|
|
32
32
|
}
|
|
33
|
-
declare function getMergedFilterStates<RecordType extends AnyObject = AnyObject>(rawMergedColumns: ColumnsType<RecordType>, filterStates: FilterState<RecordType>[], warning?: ReturnType<typeof devUseWarning
|
|
33
|
+
declare function getMergedFilterStates<RecordType extends AnyObject = AnyObject>(rawMergedColumns: ColumnsType<RecordType>, filterStates: FilterState<RecordType>[], warning?: ReturnType<typeof devUseWarning>,
|
|
34
|
+
/** Columns before applying the responsive filter. */
|
|
35
|
+
baseColumns?: ColumnsType<RecordType>): FilterState<RecordType>[];
|
|
34
36
|
declare function useFilter<RecordType extends AnyObject = AnyObject>(props: FilterConfig<RecordType>): readonly [TransformColumns<RecordType>, FilterState<RecordType>[], Record<string, FilterValue | null>];
|
|
35
37
|
//#endregion
|
|
36
38
|
export { FilterConfig, FilterState, collectFilterStates, useFilter as default, flattenKeys, generateFilterInfo, getFilterData, getMergedFilterStates };
|
|
@@ -112,8 +112,8 @@ function getMergedColumns(rawMergedColumns) {
|
|
|
112
112
|
return [column];
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
function getMergedFilterStates(rawMergedColumns, filterStates, warning) {
|
|
116
|
-
const mergedColumns = getMergedColumns(rawMergedColumns
|
|
115
|
+
function getMergedFilterStates(rawMergedColumns, filterStates, warning, baseColumns) {
|
|
116
|
+
const mergedColumns = getMergedColumns(baseColumns ?? rawMergedColumns ?? []);
|
|
117
117
|
const collectedStates = collectFilterStates(mergedColumns, false);
|
|
118
118
|
if (collectedStates.length === 0) return collectedStates;
|
|
119
119
|
let filteredKeysIsAllNotControlled = true;
|
|
@@ -55,14 +55,18 @@ function useSelection(config, rowSelection) {
|
|
|
55
55
|
keys.forEach((key) => {
|
|
56
56
|
let record = getRecordByKey(key);
|
|
57
57
|
if (!record && preserveRecordsRef.value.has(key)) record = preserveRecordsRef.value.get(key);
|
|
58
|
-
newCache.set(key, record);
|
|
58
|
+
if (record !== void 0) newCache.set(key, record);
|
|
59
59
|
});
|
|
60
60
|
preserveRecordsRef.value = newCache;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
watch(
|
|
63
|
+
watch([
|
|
64
|
+
mergedSelectedKeys,
|
|
65
|
+
data,
|
|
66
|
+
preserveSelectedRowKeys
|
|
67
|
+
], ([nextKeys]) => {
|
|
64
68
|
updatePreserveRecordsCache(nextKeys);
|
|
65
|
-
});
|
|
69
|
+
}, { immediate: true });
|
|
66
70
|
const flattedData = computed(() => flattenData(childrenColumnName.value, pageData.value));
|
|
67
71
|
const keyEntities = computed(() => {
|
|
68
72
|
if (checkStrictly.value) return { keyEntities: null };
|