antdv-next 1.8.2 → 1.8.3
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/hooks/useClosable.d.ts +3 -3
- package/dist/_util/hooks/useClosable.js +9 -9
- package/dist/affix/index.js +2 -7
- package/dist/antd-with-locales.esm.js +16050 -15720
- package/dist/antd-with-locales.js +79 -79
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +13249 -12919
- package/dist/antd.js +81 -81
- package/dist/badge/index.d.ts +4 -1
- package/dist/badge/index.js +4 -4
- package/dist/button/buttonHelper.d.ts +1 -1
- package/dist/button/style/index.js +8 -2
- package/dist/calendar/generateCalendar.js +1 -1
- package/dist/checkbox/Checkbox.js +1 -0
- package/dist/color-picker/ColorPicker.js +4 -0
- package/dist/color-picker/ColorPickerPanel.js +4 -0
- package/dist/color-picker/components/ColorSlider.js +12 -4
- package/dist/color-picker/components/PanelPicker/GradientColorBar.js +2 -0
- package/dist/components.d.ts +12 -8
- package/dist/components.js +3 -3
- package/dist/config-provider/context.d.ts +3 -3
- package/dist/config-provider/context.js +3 -3
- package/dist/descriptions/hooks/useItems.d.ts +6 -6
- package/dist/descriptions/hooks/useRow.js +1 -1
- package/dist/form/Form.d.ts +17 -44
- package/dist/form/Form.js +54 -5
- package/dist/form/FormItem/index.d.ts +3 -3
- package/dist/form/context.d.ts +3 -3
- package/dist/form/hooks/useForm.d.ts +4 -5
- package/dist/form/index.d.ts +29 -3
- package/dist/form/index.js +6 -6
- package/dist/form/types.d.ts +15 -7
- package/dist/image/hooks/usePreviewConfig.d.ts +4 -4
- package/dist/image/index.d.ts +5 -5
- package/dist/index.d.ts +14 -7
- package/dist/index.js +2 -2
- package/dist/input-number/style/index.js +3 -2
- package/dist/layout/layout.js +2 -3
- package/dist/mentions/index.js +2 -1
- package/dist/menu/MenuItem.js +1 -1
- package/dist/menu/index.d.ts +2 -1
- package/dist/menu/index.js +29 -5
- package/dist/menu/menu.js +39 -15
- package/dist/message/index.js +11 -9
- package/dist/modal/confirm.js +2 -3
- package/dist/modal/index.d.ts +2 -2
- package/dist/modal/interface.d.ts +1 -1
- package/dist/modal/useModal/index.js +9 -4
- package/dist/notification/index.js +3 -7
- package/dist/package.js +1 -1
- package/dist/package.json.d.ts +1 -0
- package/dist/segmented/style/index.js +3 -2
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +1 -1
- package/dist/skeleton/style/index.js +9 -13
- package/dist/slider/SliderTooltip.js +0 -1
- package/dist/slider/index.d.ts +2 -0
- package/dist/slider/index.js +4 -0
- package/dist/statistic/Timer.d.ts +2 -2
- package/dist/steps/index.js +2 -1
- package/dist/table/hooks/useFilter/FilterDropdown.js +1 -1
- package/dist/table/hooks/usePagination.d.ts +1 -2
- package/dist/table/hooks/usePagination.js +1 -3
- package/dist/table/hooks/useSorter.js +4 -8
- package/dist/table/style/index.js +1 -0
- package/dist/table/style/size.js +1 -0
- package/dist/table/util.d.ts +1 -1
- package/dist/tabs/style/index.js +5 -1
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/tour/index.js +4 -1
- package/dist/transfer/hooks/useSelection.js +2 -1
- package/dist/tree/DirectoryTree.js +4 -3
- package/dist/tree/utils/dictUtil.js +5 -8
- package/dist/typography/Base/index.js +3 -1
- package/dist/typography/Base/util.js +2 -1
- package/dist/upload/Upload.js +14 -10
- package/dist/upload/UploadList/ListItem.js +4 -0
- package/dist/version/token.json +1 -1
- package/dist/watermark/utils.js +1 -1
- package/package.json +40 -39
- package/web-tags.json +16 -12
- package/web-types.json +32 -18
package/dist/message/index.js
CHANGED
|
@@ -5,11 +5,8 @@ import PurePanel from "./PurePanel.js";
|
|
|
5
5
|
import PureList from "./PureList.js";
|
|
6
6
|
import { wrapPromiseFn } from "./util.js";
|
|
7
7
|
import useMessage, { useInternalMessage } from "./useMessage.js";
|
|
8
|
-
import { computed, createVNode, defineComponent, getCurrentInstance,
|
|
8
|
+
import { computed, createVNode, defineComponent, getCurrentInstance, onMounted, render, shallowRef, watch } from "vue";
|
|
9
9
|
//#region src/message/index.tsx
|
|
10
|
-
function _isSlot(s) {
|
|
11
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
12
|
-
}
|
|
13
10
|
let message = null;
|
|
14
11
|
let taskQueue = [];
|
|
15
12
|
let defaultGlobalConfig = {};
|
|
@@ -95,12 +92,11 @@ const GlobalHolderWrapper = /* @__PURE__ */ defineComponent((props) => {
|
|
|
95
92
|
"sync": sync,
|
|
96
93
|
"messageConfig": messageConfig.value
|
|
97
94
|
}, null);
|
|
98
|
-
|
|
95
|
+
return createVNode(ConfigProvider, {
|
|
99
96
|
"prefixCls": global.getRootPrefixCls(),
|
|
100
97
|
"iconPrefixCls": global.getIconPrefixCls(),
|
|
101
98
|
"theme": global.theme.value
|
|
102
|
-
},
|
|
103
|
-
return global.holderRender ? global.holderRender(configHolderNode) : configHolderNode;
|
|
99
|
+
}, { default: () => [global.holderRender ? global.holderRender(holderNode) : holderNode] });
|
|
104
100
|
};
|
|
105
101
|
}, { props: { onReady: {
|
|
106
102
|
type: Function,
|
|
@@ -181,7 +177,10 @@ function open(config) {
|
|
|
181
177
|
if (closeFn) act(() => {
|
|
182
178
|
closeFn?.();
|
|
183
179
|
});
|
|
184
|
-
else
|
|
180
|
+
else {
|
|
181
|
+
task.skipped = true;
|
|
182
|
+
resolve();
|
|
183
|
+
}
|
|
185
184
|
};
|
|
186
185
|
});
|
|
187
186
|
flushMessageQueue();
|
|
@@ -203,7 +202,10 @@ function typeOpen(type, args) {
|
|
|
203
202
|
if (closeFn) act(() => {
|
|
204
203
|
closeFn?.();
|
|
205
204
|
});
|
|
206
|
-
else
|
|
205
|
+
else {
|
|
206
|
+
task.skipped = true;
|
|
207
|
+
resolve();
|
|
208
|
+
}
|
|
207
209
|
};
|
|
208
210
|
});
|
|
209
211
|
flushMessageQueue();
|
package/dist/modal/confirm.js
CHANGED
|
@@ -341,13 +341,12 @@ function confirm(config) {
|
|
|
341
341
|
iconPrefixCls,
|
|
342
342
|
theme
|
|
343
343
|
});
|
|
344
|
-
const
|
|
344
|
+
const nextVnode = createVNode(ConfigProvider, {
|
|
345
345
|
prefixCls: rootPrefixCls,
|
|
346
346
|
iconPrefixCls,
|
|
347
347
|
theme,
|
|
348
348
|
locale: global.locale
|
|
349
|
-
}, { default: () => holderNode });
|
|
350
|
-
const nextVnode = global.holderRender ? global.holderRender(configHolderNode) : configHolderNode;
|
|
349
|
+
}, { default: () => global.holderRender ? global.holderRender(holderNode) : holderNode });
|
|
351
350
|
nextVnode.appContext = appContext;
|
|
352
351
|
render(nextVnode, container);
|
|
353
352
|
}
|
package/dist/modal/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModalEmits, ModalSlots } from "./interface.js";
|
|
1
|
+
import { ModalEmits, ModalFuncProps, ModalLocale, ModalSlots } from "./interface.js";
|
|
2
2
|
import confirm, { modalGlobalConfig } from "./confirm.js";
|
|
3
3
|
import useModal from "./useModal/index.js";
|
|
4
4
|
import Modal, { InternalModalProps } from "./Modal.js";
|
|
@@ -17,4 +17,4 @@ interface StaticModal {
|
|
|
17
17
|
type ModalProps = InternalModalProps;
|
|
18
18
|
declare const _default: typeof Modal & StaticModal;
|
|
19
19
|
//#endregion
|
|
20
|
-
export { type ModalEmits, ModalProps, type ModalSlots, _default as default, useModal };
|
|
20
|
+
export { type ModalEmits, type ModalFuncProps, type ModalLocale, ModalProps, type ModalSlots, _default as default, useModal };
|
|
@@ -42,7 +42,7 @@ interface ModalSemanticStyles {
|
|
|
42
42
|
}
|
|
43
43
|
type ModalClassNamesType = SemanticClassNamesType<ModalProps, ModalSemanticClassNames>;
|
|
44
44
|
type ModalStylesType = SemanticStylesType<ModalProps, ModalSemanticStyles>;
|
|
45
|
-
interface ModalCommonProps extends Omit<DialogProps, 'footer' | 'width' | 'onClose' | 'animation' | 'maskAnimation' | 'transitionName' | 'maskTransitionName' | 'mask' | 'classNames' | 'styles' | 'modalRender' | 'rootStyle' | 'style' | OmitFocusType> {
|
|
45
|
+
interface ModalCommonProps extends Omit<DialogProps, 'footer' | 'width' | 'onClose' | 'animation' | 'maskAnimation' | 'transitionName' | 'maskTransitionName' | 'mask' | 'classNames' | 'styles' | 'modalRender' | 'rootStyle' | 'style' | 'closable' | OmitFocusType> {
|
|
46
46
|
footer?: VueNode | ((params: {
|
|
47
47
|
originNode: VueNode;
|
|
48
48
|
extra: {
|
|
@@ -23,7 +23,10 @@ function useModal() {
|
|
|
23
23
|
[...actionQueue.value].forEach((action) => action());
|
|
24
24
|
actionQueue.value = [];
|
|
25
25
|
}
|
|
26
|
-
}, {
|
|
26
|
+
}, {
|
|
27
|
+
immediate: true,
|
|
28
|
+
flush: "post"
|
|
29
|
+
});
|
|
27
30
|
const getConfirmFunc = (withFunc) => function hookConfirm(config) {
|
|
28
31
|
uuid += 1;
|
|
29
32
|
const modalRef = shallowRef();
|
|
@@ -58,9 +61,11 @@ function useModal() {
|
|
|
58
61
|
if (closePatch) destroyFns.push(closeFunc);
|
|
59
62
|
return {
|
|
60
63
|
destroy: () => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
if (modalRef.value) modalRef.value.destroy();
|
|
65
|
+
else {
|
|
66
|
+
closeFunc();
|
|
67
|
+
withFunc(config).afterClose?.();
|
|
68
|
+
}
|
|
64
69
|
},
|
|
65
70
|
update: (newConfig) => {
|
|
66
71
|
const updateAction = () => modalRef.value?.update(newConfig);
|
|
@@ -4,11 +4,8 @@ import { useAppConfig } from "../app/context.js";
|
|
|
4
4
|
import PurePanel from "./PurePanel.js";
|
|
5
5
|
import PureList from "./PureList.js";
|
|
6
6
|
import useNotification, { useInternalNotification } from "./useNotification.js";
|
|
7
|
-
import { computed, createVNode, defineComponent, getCurrentInstance,
|
|
7
|
+
import { computed, createVNode, defineComponent, getCurrentInstance, onMounted, render, shallowRef, watch } from "vue";
|
|
8
8
|
//#region src/notification/index.tsx
|
|
9
|
-
function _isSlot(s) {
|
|
10
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
11
|
-
}
|
|
12
9
|
let notification = null;
|
|
13
10
|
let taskQueue = [];
|
|
14
11
|
let defaultGlobalConfig = {};
|
|
@@ -92,13 +89,12 @@ const GlobalHolderWrapper = /* @__PURE__ */ defineComponent((props) => {
|
|
|
92
89
|
"sync": sync,
|
|
93
90
|
"notificationConfig": notificationConfig.value
|
|
94
91
|
}, null);
|
|
95
|
-
|
|
92
|
+
return createVNode(ConfigProvider, {
|
|
96
93
|
"prefixCls": global.getRootPrefixCls(),
|
|
97
94
|
"iconPrefixCls": global.getIconPrefixCls(),
|
|
98
95
|
"theme": global.theme.value,
|
|
99
96
|
"locale": globalConfig().locale
|
|
100
|
-
},
|
|
101
|
-
return global.holderRender ? global.holderRender(configHolderNode) : configHolderNode;
|
|
97
|
+
}, { default: () => [global.holderRender ? global.holderRender(holderNode) : holderNode] });
|
|
102
98
|
};
|
|
103
99
|
}, { props: { onReady: {
|
|
104
100
|
type: Function,
|
package/dist/package.js
CHANGED
package/dist/package.json.d.ts
CHANGED
|
@@ -102,8 +102,9 @@ const genSegmentedStyle = (token) => {
|
|
|
102
102
|
...segmentedTextEllipsisCss
|
|
103
103
|
},
|
|
104
104
|
"&-icon + *": { marginInlineStart: token.calc(token.marginSM).div(2).equal() },
|
|
105
|
-
"&-icon
|
|
106
|
-
display: "inline-
|
|
105
|
+
"&-icon": {
|
|
106
|
+
display: "inline-flex",
|
|
107
|
+
alignItems: "center",
|
|
107
108
|
verticalAlign: "middle",
|
|
108
109
|
marginBlockEnd: "0.2em"
|
|
109
110
|
},
|
package/dist/select/index.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ interface SelectEmitsProps {
|
|
|
147
147
|
}
|
|
148
148
|
type OptionParams = Parameters<NonNullable<SelectProps$1['optionRender']>>;
|
|
149
149
|
interface SelectSlots {
|
|
150
|
+
default?: () => any;
|
|
150
151
|
suffix?: (info: SelectSuffixRenderInfo) => any;
|
|
151
152
|
/** @deprecated Please use `suffix` slot instead. */
|
|
152
153
|
suffixIcon?: () => any;
|
package/dist/select/index.js
CHANGED
|
@@ -297,7 +297,7 @@ const Select = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, at
|
|
|
297
297
|
"tagRender": isMultiple.value ? tagRender : void 0,
|
|
298
298
|
"popupRender": mergedPopupRender,
|
|
299
299
|
"onPopupVisibleChange": mergedOnOpenChange
|
|
300
|
-
}),
|
|
300
|
+
}), { default: slots?.default });
|
|
301
301
|
};
|
|
302
302
|
}, {
|
|
303
303
|
props: /*@__PURE__*/ mergeDefaults({
|
|
@@ -78,19 +78,15 @@ const genSkeletonElementNode = (token) => {
|
|
|
78
78
|
};
|
|
79
79
|
const genSkeletonElementImage = (token) => {
|
|
80
80
|
const { skeletonImageCls, imageSizeBase, calc } = token;
|
|
81
|
-
return {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
[`${skeletonImageCls}-svg${skeletonImageCls}-svg-circle`]: { borderRadius: "50%" }
|
|
91
|
-
},
|
|
92
|
-
[`${skeletonImageCls}${skeletonImageCls}-circle`]: { borderRadius: "50%" }
|
|
93
|
-
};
|
|
81
|
+
return { [skeletonImageCls]: {
|
|
82
|
+
...genSkeletonElementShape(token),
|
|
83
|
+
[`${skeletonImageCls}-path`]: { fill: "#bfbfbf" },
|
|
84
|
+
[`${skeletonImageCls}-svg`]: {
|
|
85
|
+
...genSkeletonElementSize(imageSizeBase),
|
|
86
|
+
maxWidth: calc(imageSizeBase).mul(4).equal(),
|
|
87
|
+
maxHeight: calc(imageSizeBase).mul(4).equal()
|
|
88
|
+
}
|
|
89
|
+
} };
|
|
94
90
|
};
|
|
95
91
|
function genSkeletonElementButtonShape(token, size, buttonCls) {
|
|
96
92
|
const { skeletonButtonCls } = token;
|
package/dist/slider/index.d.ts
CHANGED
|
@@ -75,6 +75,8 @@ interface SliderBaseProps {
|
|
|
75
75
|
}
|
|
76
76
|
interface SliderInternalProps extends SliderBaseProps, SliderEmitsProps {
|
|
77
77
|
range?: boolean | SliderRange;
|
|
78
|
+
/** The start value of the highlighted track in single mode. Defaults to `min` */
|
|
79
|
+
startPoint?: number;
|
|
78
80
|
value?: number | number[];
|
|
79
81
|
defaultValue?: number | number[];
|
|
80
82
|
/** @deprecated Please use `styles.handle` instead */
|
package/dist/slider/index.js
CHANGED
|
@@ -188,6 +188,10 @@ const Slider = /* @__PURE__ */ defineComponent((props, { attrs, emit, expose, sl
|
|
|
188
188
|
required: false,
|
|
189
189
|
default: void 0
|
|
190
190
|
},
|
|
191
|
+
startPoint: {
|
|
192
|
+
type: Number,
|
|
193
|
+
required: false
|
|
194
|
+
},
|
|
191
195
|
value: {
|
|
192
196
|
type: [Number, Array],
|
|
193
197
|
required: false
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormatConfig
|
|
1
|
+
import { FormatConfig } from "./utils.js";
|
|
2
2
|
import { StatisticProps, StatisticSlots } from "./Statistic.js";
|
|
3
3
|
import { SlotsType } from "vue";
|
|
4
4
|
//#region src/statistic/Timer.d.ts
|
|
@@ -12,7 +12,7 @@ interface StatisticTimeEmits {
|
|
|
12
12
|
* Only to be called when the type is `countdown`.
|
|
13
13
|
*/
|
|
14
14
|
finish: () => void;
|
|
15
|
-
change: (value
|
|
15
|
+
change: (value: number) => void;
|
|
16
16
|
}
|
|
17
17
|
interface InternalStatisticTimerProps extends StatisticTimerProps, StatisticTimeEmitsProps {}
|
|
18
18
|
interface StatisticTimeEmitsProps {
|
package/dist/steps/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { devUseWarning, isDev } from "../_util/warning.js";
|
|
|
5
5
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
6
6
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
7
7
|
import InternalTooltip from "../tooltip/index.js";
|
|
8
|
+
import { isRenderable } from "../_util/is.js";
|
|
8
9
|
import useVariant from "../form/hooks/useVariant.js";
|
|
9
10
|
import { TARGET_CLS } from "../_util/wave/interface.js";
|
|
10
11
|
import wave_default from "../_util/wave/index.js";
|
|
@@ -105,7 +106,7 @@ const Steps = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
105
106
|
const mappedIndex = originIndex !== void 0 && originIndex >= 0 ? mergedInitial.value + originIndex : index;
|
|
106
107
|
const { status, icon } = item;
|
|
107
108
|
let iconContent;
|
|
108
|
-
if (isDot.value || icon) iconContent = icon;
|
|
109
|
+
if (isDot.value || isRenderable(icon)) iconContent = icon;
|
|
109
110
|
else switch (status) {
|
|
110
111
|
case "finish":
|
|
111
112
|
iconContent = createVNode(CheckOutlined, { "class": `${itemIconCls.value}-finish` }, null);
|
|
@@ -62,7 +62,7 @@ function renderFilterItems(options) {
|
|
|
62
62
|
label: createVNode(Fragment, null, [createVNode(Component, { "checked": checked }, null), createVNode("span", null, [filter.text])])
|
|
63
63
|
};
|
|
64
64
|
if (normalizedSearchValue) {
|
|
65
|
-
if (typeof filterSearch === "function") return filterSearch(
|
|
65
|
+
if (typeof filterSearch === "function") return filterSearch(searchValue, filter) ? item : null;
|
|
66
66
|
return searchValueMatched(normalizedSearchValue, filter.text) ? item : null;
|
|
67
67
|
}
|
|
68
68
|
return item;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { PaginationOnChangeInfo } from "../../pagination/index.js";
|
|
2
1
|
import { TablePaginationConfig } from "../interface.js";
|
|
3
2
|
import { Ref } from "vue";
|
|
4
3
|
//#region src/table/hooks/usePagination.d.ts
|
|
5
4
|
declare const DEFAULT_PAGE_SIZE = 10;
|
|
6
5
|
declare function getPaginationParam(mergedPagination: TablePaginationConfig, pagination?: TablePaginationConfig | boolean): any;
|
|
7
6
|
type MaybeRef<T> = T | Ref<T>;
|
|
8
|
-
declare function usePagination(total: MaybeRef<number>, onChange: (current: number, pageSize: number
|
|
7
|
+
declare function usePagination(total: MaybeRef<number>, onChange: (current: number, pageSize: number) => void, pagination?: MaybeRef<TablePaginationConfig | false>): readonly [import("vue").ComputedRef<TablePaginationConfig>, (current?: number, pageSize?: number) => void];
|
|
9
8
|
//#endregion
|
|
10
9
|
export { DEFAULT_PAGE_SIZE, usePagination as default, getPaginationParam };
|
|
@@ -40,9 +40,7 @@ function usePagination(total, onChange, pagination) {
|
|
|
40
40
|
if (paginationRef.value && typeof paginationRef.value === "object") if (info) paginationRef.value.onChange?.(current, pageSize, info);
|
|
41
41
|
else paginationRef.value.onChange?.(current, pageSize);
|
|
42
42
|
refreshPagination(current, pageSize);
|
|
43
|
-
|
|
44
|
-
if (info) onChange(current, mergedPageSize, info);
|
|
45
|
-
else onChange(current, mergedPageSize);
|
|
43
|
+
onChange(current, pageSize || mergedPagination.value.pageSize || 10);
|
|
46
44
|
};
|
|
47
45
|
return [computed(() => {
|
|
48
46
|
if (paginationRef.value === false) return {};
|
|
@@ -25,27 +25,23 @@ function nextSortDirection(sortDirections, current) {
|
|
|
25
25
|
}
|
|
26
26
|
function collectSortStates(columns, init, pos) {
|
|
27
27
|
let sortStates = [];
|
|
28
|
-
const pushState = (column, columnPos) => {
|
|
28
|
+
const pushState = (column, columnPos, sortOrder = column.sortOrder) => {
|
|
29
29
|
sortStates.push({
|
|
30
30
|
column,
|
|
31
31
|
key: getColumnKey(column, columnPos),
|
|
32
32
|
multiplePriority: getMultiplePriority(column),
|
|
33
|
-
sortOrder
|
|
33
|
+
sortOrder
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
(columns || []).forEach((column, index) => {
|
|
37
37
|
const columnPos = getColumnPos(index, pos);
|
|
38
38
|
if (column.children) {
|
|
39
39
|
if ("sortOrder" in column) pushState(column, columnPos);
|
|
40
|
+
else if (init && column.sorter && column.defaultSortOrder) pushState(column, columnPos, column.defaultSortOrder);
|
|
40
41
|
sortStates = [...sortStates, ...collectSortStates(column.children, init, columnPos)];
|
|
41
42
|
} else if (column.sorter) {
|
|
42
43
|
if ("sortOrder" in column) pushState(column, columnPos);
|
|
43
|
-
else if (init && column.defaultSortOrder)
|
|
44
|
-
column,
|
|
45
|
-
key: getColumnKey(column, columnPos),
|
|
46
|
-
multiplePriority: getMultiplePriority(column),
|
|
47
|
-
sortOrder: column.defaultSortOrder
|
|
48
|
-
});
|
|
44
|
+
else if (init && column.defaultSortOrder) pushState(column, columnPos, column.defaultSortOrder);
|
|
49
45
|
}
|
|
50
46
|
});
|
|
51
47
|
return sortStates;
|
package/dist/table/style/size.js
CHANGED
|
@@ -14,6 +14,7 @@ const genSizeStyle = (token) => {
|
|
|
14
14
|
tfoot > tr > th,
|
|
15
15
|
tfoot > tr > td
|
|
16
16
|
`]: { padding: `${unit(paddingVertical)} ${unit(paddingHorizontal)}` },
|
|
17
|
+
[`${componentCls}-thead > tr > ${componentCls}-cell-scrollbar`]: { paddingInline: 0 },
|
|
17
18
|
[`${componentCls}-filter-trigger`]: { marginInlineEnd: unit(calc(paddingHorizontal).div(2).mul(-1).equal()) },
|
|
18
19
|
[`${componentCls}-expanded-row-fixed`]: { margin: `${unit(calc(paddingVertical).mul(-1).equal())} ${unit(calc(paddingHorizontal).mul(-1).equal())}` },
|
|
19
20
|
[`${componentCls}-tbody`]: { [`${componentCls}-wrapper:only-child ${componentCls}`]: {
|
package/dist/table/util.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare function renderColumnTitle<RecordType extends AnyObject = AnyObject>(tit
|
|
|
11
11
|
* Should filter [object Object]
|
|
12
12
|
*/
|
|
13
13
|
declare function safeColumnTitle<RecordType extends AnyObject = AnyObject>(title: ColumnTitle<RecordType>, props: ColumnTitleProps<RecordType>): any;
|
|
14
|
-
declare function normalizePlacement(pos: TablePaginationPlacement | TablePaginationPosition): "center" | "
|
|
14
|
+
declare function normalizePlacement(pos: TablePaginationPlacement | TablePaginationPosition): "center" | "start" | "end";
|
|
15
15
|
declare function getPaginationSize(paginationSize: SizeType, mergedSize: SizeType): SizeType;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { getColumnKey, getColumnPos, getPaginationSize, normalizePlacement, renderColumnTitle, safeColumnTitle };
|
package/dist/tabs/style/index.js
CHANGED
|
@@ -14,7 +14,11 @@ const genCardStyle = (token) => {
|
|
|
14
14
|
padding: tabsCardPadding,
|
|
15
15
|
background: cardBg,
|
|
16
16
|
border: `${unit(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
|
|
17
|
-
transition:
|
|
17
|
+
transition: [
|
|
18
|
+
"color",
|
|
19
|
+
"background-color",
|
|
20
|
+
"border-color"
|
|
21
|
+
].map((prop) => `${prop} ${token.motionDurationSlow} ${token.motionEaseInOut}`).join(", ")
|
|
18
22
|
},
|
|
19
23
|
[`${componentCls}-tab-active`]: {
|
|
20
24
|
color: itemSelectedColor,
|
|
@@ -9,6 +9,6 @@ declare function useColor(props: {
|
|
|
9
9
|
color: Ref<TagProps['color']>;
|
|
10
10
|
variant: Ref<TagProps['variant']>;
|
|
11
11
|
bordered: Ref<TagProps['bordered']>;
|
|
12
|
-
}, contextVariant?: Ref<TagProps['variant']>): readonly [import("vue").ComputedRef<"
|
|
12
|
+
}, contextVariant?: Ref<TagProps['variant']>): readonly [import("vue").ComputedRef<"solid" | "filled" | "outlined">, import("vue").ComputedRef<string | undefined>, import("vue").ComputedRef<boolean>, import("vue").ComputedRef<boolean>, import("vue").ComputedRef<CSSProperties>];
|
|
13
13
|
//#endregion
|
|
14
14
|
export { useColor as default };
|
package/dist/tour/index.js
CHANGED
|
@@ -218,7 +218,10 @@ const Tour = /* @__PURE__ */ defineComponent((props, { slots, emit, attrs }) =>
|
|
|
218
218
|
type: String,
|
|
219
219
|
required: false
|
|
220
220
|
},
|
|
221
|
-
gap: {
|
|
221
|
+
gap: {
|
|
222
|
+
type: Object,
|
|
223
|
+
required: false
|
|
224
|
+
},
|
|
222
225
|
animated: {
|
|
223
226
|
type: [Boolean, Object],
|
|
224
227
|
required: false,
|
|
@@ -17,7 +17,8 @@ function useSelection(leftDataSource, rightDataSource, selectedKeys) {
|
|
|
17
17
|
const rightKeys = computed(() => new Set(unref(rightDataSource).map((src) => src?.key)));
|
|
18
18
|
const sourceSelectedKeys = computed(() => filterKeys(mergedSelectedKeys.value, leftKeys.value));
|
|
19
19
|
const targetSelectedKeys = computed(() => filterKeys(mergedSelectedKeys.value, rightKeys.value));
|
|
20
|
-
watch(() =>
|
|
20
|
+
watch([() => flattenKeys(leftKeys.value), () => flattenKeys(rightKeys.value)], () => {
|
|
21
|
+
if (unref(selectedKeys) !== void 0) return;
|
|
21
22
|
mergedSelectedKeys.value = [...filterKeys(mergedSelectedKeys.value, leftKeys.value), ...filterKeys(mergedSelectedKeys.value, rightKeys.value)];
|
|
22
23
|
});
|
|
23
24
|
const setMergedSelectedKeys = (nextKeys) => {
|
|
@@ -35,7 +35,8 @@ const DirectoryTree = /* @__PURE__ */ defineComponent((props, { slots, emit, exp
|
|
|
35
35
|
else initExpandedKeys = props?.expandedKeys || props?.defaultExpandedKeys || [];
|
|
36
36
|
return initExpandedKeys;
|
|
37
37
|
};
|
|
38
|
-
const selectedKeys = shallowRef(props?.
|
|
38
|
+
const selectedKeys = shallowRef(props?.defaultSelectedKeys || []);
|
|
39
|
+
const mergedSelectedKeys = computed(() => props.selectedKeys !== void 0 ? props.selectedKeys : selectedKeys.value);
|
|
39
40
|
const expandedKeys = shallowRef(getInitExpandedKeys());
|
|
40
41
|
watch(() => props.selectedKeys, () => {
|
|
41
42
|
if (props.selectedKeys !== selectedKeys.value) selectedKeys.value = props?.selectedKeys || [];
|
|
@@ -85,7 +86,7 @@ const DirectoryTree = /* @__PURE__ */ defineComponent((props, { slots, emit, exp
|
|
|
85
86
|
cachedSelectedKeys.value = newSelectedKeys;
|
|
86
87
|
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
|
|
87
88
|
}
|
|
88
|
-
selectedKeys.value = newSelectedKeys;
|
|
89
|
+
if (props.selectedKeys === void 0) selectedKeys.value = newSelectedKeys;
|
|
89
90
|
emit("update:selectedKeys", newSelectedKeys);
|
|
90
91
|
emit("select", newSelectedKeys, newEvent);
|
|
91
92
|
};
|
|
@@ -168,7 +169,7 @@ const DirectoryTree = /* @__PURE__ */ defineComponent((props, { slots, emit, exp
|
|
|
168
169
|
"class": connectClassName,
|
|
169
170
|
"style": style,
|
|
170
171
|
"expandedKeys": expandedKeys.value,
|
|
171
|
-
"selectedKeys":
|
|
172
|
+
"selectedKeys": mergedSelectedKeys.value,
|
|
172
173
|
"onSelect": onSelect,
|
|
173
174
|
"onExpand": onExpand
|
|
174
175
|
}), slots);
|
|
@@ -19,6 +19,7 @@ function calcRangeKeys({ treeData, expandedKeys, startKey, endKey, fieldNames })
|
|
|
19
19
|
let record = RECORD_NONE;
|
|
20
20
|
if (!isNonNullable(startKey) || !isNonNullable(endKey)) return [];
|
|
21
21
|
if (startKey === endKey) return [startKey];
|
|
22
|
+
const expandedKeySet = new Set(expandedKeys);
|
|
22
23
|
function matchKey(key) {
|
|
23
24
|
return key === startKey || key === endKey;
|
|
24
25
|
}
|
|
@@ -32,20 +33,16 @@ function calcRangeKeys({ treeData, expandedKeys, startKey, endKey, fieldNames })
|
|
|
32
33
|
return false;
|
|
33
34
|
}
|
|
34
35
|
} else if (record === RECORD_START && !node.disabled && node.selectable !== false) keys.push(key);
|
|
35
|
-
return
|
|
36
|
+
return expandedKeySet.has(key);
|
|
36
37
|
}, fillFieldNames(fieldNames));
|
|
37
38
|
return keys;
|
|
38
39
|
}
|
|
39
40
|
function convertDirectoryKeysToNodes(treeData, keys, fieldNames) {
|
|
40
|
-
const restKeys =
|
|
41
|
+
const restKeys = new Set(keys);
|
|
41
42
|
const nodes = [];
|
|
42
43
|
traverseNodesKey(treeData, (key, node) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
nodes.push(node);
|
|
46
|
-
restKeys.splice(index, 1);
|
|
47
|
-
}
|
|
48
|
-
return !!restKeys.length;
|
|
44
|
+
if (key !== null && restKeys.delete(key)) nodes.push(node);
|
|
45
|
+
return restKeys.size > 0;
|
|
49
46
|
}, fillFieldNames(fieldNames));
|
|
50
47
|
return nodes;
|
|
51
48
|
}
|
|
@@ -57,6 +57,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
57
57
|
return val;
|
|
58
58
|
});
|
|
59
59
|
const editIconRef = shallowRef();
|
|
60
|
+
let editClickEvent = null;
|
|
60
61
|
const { prefixCls, rootPrefixCls, direction: contextDirection, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles } = useComponentBaseConfig("typography", props);
|
|
61
62
|
const mergedDirection = computed(() => props.direction ?? contextDirection.value);
|
|
62
63
|
const { classes, styles } = toPropsRefs$1(props, "classes", "styles");
|
|
@@ -87,6 +88,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
87
88
|
}, { flush: "post" });
|
|
88
89
|
const onEditClick = (e) => {
|
|
89
90
|
e?.preventDefault();
|
|
91
|
+
if (e) editClickEvent = e;
|
|
90
92
|
triggerEdit(true);
|
|
91
93
|
};
|
|
92
94
|
const onEditChange = (value) => {
|
|
@@ -296,7 +298,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
296
298
|
const children = filterEmpty(slots?.default?.());
|
|
297
299
|
childrenNodes.value = children;
|
|
298
300
|
const clickHandler = (e) => {
|
|
299
|
-
if (triggerType.value.includes("text")) onEditClick(e);
|
|
301
|
+
if (triggerType.value.includes("text") && editClickEvent !== e) onEditClick(e);
|
|
300
302
|
emit("click", e);
|
|
301
303
|
};
|
|
302
304
|
const mergedClassName = classNames(componentCls.value, attrClass);
|
|
@@ -24,7 +24,8 @@ function isEleEllipsis(ele) {
|
|
|
24
24
|
const rect = ele.getBoundingClientRect();
|
|
25
25
|
const childRect = childDiv.getBoundingClientRect();
|
|
26
26
|
ele.removeChild(childDiv);
|
|
27
|
-
|
|
27
|
+
const horizontalTolerance = .001;
|
|
28
|
+
return rect.left - childRect.left > horizontalTolerance || childRect.right - rect.right > horizontalTolerance || rect.top > childRect.top || childRect.bottom > rect.bottom;
|
|
28
29
|
}
|
|
29
30
|
const isValidText = (val) => ["string", "number"].includes(typeof val);
|
|
30
31
|
//#endregion
|
package/dist/upload/Upload.js
CHANGED
|
@@ -58,9 +58,13 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
58
58
|
exceedMaxCount = cloneList.length > maxCount;
|
|
59
59
|
cloneList = cloneList.slice(0, maxCount);
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
internalFileList.value = cloneList;
|
|
62
62
|
nextTick(() => {
|
|
63
63
|
emit("update:fileList", cloneList);
|
|
64
|
+
if (props.fileList === void 0) return;
|
|
65
|
+
nextTick(() => {
|
|
66
|
+
if (internalFileList.value === cloneList) internalFileList.value = props.fileList ?? [];
|
|
67
|
+
});
|
|
64
68
|
});
|
|
65
69
|
const changeInfo = {
|
|
66
70
|
file,
|
|
@@ -93,7 +97,7 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
93
97
|
const filteredFileInfoList = batchFileInfoList.filter((info) => !info.file[LIST_IGNORE]);
|
|
94
98
|
if (!filteredFileInfoList.length) return;
|
|
95
99
|
const objectFileList = filteredFileInfoList.map((info) => file2Obj(info.file));
|
|
96
|
-
let newFileList = [...
|
|
100
|
+
let newFileList = [...internalFileList.value];
|
|
97
101
|
objectFileList.forEach((fileObj) => {
|
|
98
102
|
newFileList = updateFileList(fileObj, newFileList);
|
|
99
103
|
});
|
|
@@ -123,43 +127,43 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
123
127
|
} catch {
|
|
124
128
|
parsedResponse = response;
|
|
125
129
|
}
|
|
126
|
-
if (!getFileItem(file,
|
|
130
|
+
if (!getFileItem(file, internalFileList.value)) return;
|
|
127
131
|
const targetItem = file2Obj(file);
|
|
128
132
|
targetItem.status = "done";
|
|
129
133
|
targetItem.percent = 100;
|
|
130
134
|
targetItem.response = parsedResponse;
|
|
131
135
|
targetItem.xhr = xhr;
|
|
132
|
-
const nextFileList = updateFileList(targetItem,
|
|
136
|
+
const nextFileList = updateFileList(targetItem, internalFileList.value);
|
|
133
137
|
onInternalChange(targetItem, nextFileList);
|
|
134
138
|
};
|
|
135
139
|
const onProgress = (e, file) => {
|
|
136
|
-
if (!getFileItem(file,
|
|
140
|
+
if (!getFileItem(file, internalFileList.value)) return;
|
|
137
141
|
const targetItem = file2Obj(file);
|
|
138
142
|
targetItem.status = "uploading";
|
|
139
143
|
targetItem.percent = e.percent;
|
|
140
|
-
const nextFileList = updateFileList(targetItem,
|
|
144
|
+
const nextFileList = updateFileList(targetItem, internalFileList.value);
|
|
141
145
|
onInternalChange(targetItem, nextFileList, e);
|
|
142
146
|
};
|
|
143
147
|
const onError = (error, response, file) => {
|
|
144
|
-
if (!getFileItem(file,
|
|
148
|
+
if (!getFileItem(file, internalFileList.value)) return;
|
|
145
149
|
const targetItem = file2Obj(file);
|
|
146
150
|
targetItem.error = error;
|
|
147
151
|
targetItem.response = response;
|
|
148
152
|
targetItem.status = "error";
|
|
149
|
-
const nextFileList = updateFileList(targetItem,
|
|
153
|
+
const nextFileList = updateFileList(targetItem, internalFileList.value);
|
|
150
154
|
onInternalChange(targetItem, nextFileList);
|
|
151
155
|
};
|
|
152
156
|
const handleRemove = (file) => {
|
|
153
157
|
let currentFile;
|
|
154
158
|
Promise.resolve(typeof props.onRemove === "function" ? props.onRemove(file) : props.onRemove).then((ret) => {
|
|
155
159
|
if (ret === false) return;
|
|
156
|
-
const removedFileList = removeFileItem(file,
|
|
160
|
+
const removedFileList = removeFileItem(file, internalFileList.value);
|
|
157
161
|
if (removedFileList) {
|
|
158
162
|
currentFile = {
|
|
159
163
|
...file,
|
|
160
164
|
status: "removed"
|
|
161
165
|
};
|
|
162
|
-
|
|
166
|
+
internalFileList.value?.forEach((item) => {
|
|
163
167
|
const matchKey = currentFile.uid !== void 0 ? "uid" : "name";
|
|
164
168
|
if (item[matchKey] === currentFile[matchKey] && !Object.isFrozen(item)) item.status = "removed";
|
|
165
169
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getAttrStyleAndClass } from "../../_util/hooks/useMergeSemantic.js";
|
|
2
2
|
import { useComponentBaseConfig } from "../../config-provider/context.js";
|
|
3
|
+
import { devUseWarning, isDev } from "../../_util/warning.js";
|
|
3
4
|
import InternalTooltip from "../../tooltip/index.js";
|
|
4
5
|
import { isRenderable } from "../../_util/is.js";
|
|
5
6
|
import progress_default from "../../progress/index.js";
|
|
@@ -46,11 +47,14 @@ const ListItem = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
46
47
|
}
|
|
47
48
|
const listItemClassName = clsx(`${prefixCls}-list-item`, `${prefixCls}-list-item-${mergedStatus.value}`, classes?.item);
|
|
48
49
|
let linkProps = file.linkProps;
|
|
50
|
+
let invalidLinkProps = false;
|
|
49
51
|
if (typeof linkProps === "string") try {
|
|
50
52
|
linkProps = JSON.parse(linkProps);
|
|
51
53
|
} catch {
|
|
52
54
|
linkProps = {};
|
|
55
|
+
invalidLinkProps = true;
|
|
53
56
|
}
|
|
57
|
+
if (isDev) devUseWarning("Upload")(!invalidLinkProps, "usage", "`linkProps` is not a valid JSON string. It will be ignored.");
|
|
54
58
|
const { onClick: linkOnClick, ...restLinkProps } = linkProps || {};
|
|
55
59
|
const removeIcon = (typeof showRemoveIcon === "function" ? showRemoveIcon(file) : showRemoveIcon) ? actionIconRender((typeof customRemoveIcon === "function" ? customRemoveIcon(file) : customRemoveIcon) || createVNode(DeleteOutlined, null, null), () => onClose(file), prefixCls, locale.removeFile, true) : null;
|
|
56
60
|
const downloadIcon = (typeof showDownloadIcon === "function" ? showDownloadIcon(file) : showDownloadIcon) && mergedStatus.value === "done" ? actionIconRender((typeof customDownloadIcon === "function" ? customDownloadIcon(file) : customDownloadIcon) || createVNode(DownloadOutlined, null, null), () => onDownload(file), prefixCls, locale.downloadFile) : null;
|