antdv-next 1.8.1 → 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/PurePanel.js +1 -1
- package/dist/_util/hooks/index.js +1 -1
- package/dist/_util/hooks/useClosable.d.ts +3 -3
- package/dist/_util/hooks/useClosable.js +9 -9
- package/dist/_util/hooks/useZIndex.js +14 -15
- package/dist/_util/vueNode.d.ts +6 -2
- package/dist/affix/index.js +27 -12
- package/dist/alert/Alert.d.ts +2 -2
- package/dist/alert/Alert.js +3 -3
- package/dist/alert/style/index.js +14 -8
- package/dist/anchor/Anchor.js +3 -1
- package/dist/antd-with-locales.esm.js +19634 -19203
- package/dist/antd-with-locales.js +112 -112
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +17697 -17268
- package/dist/antd.js +113 -113
- package/dist/app/App.js +2 -2
- package/dist/auto-complete/index.js +2 -2
- package/dist/avatar/Avatar.js +2 -2
- package/dist/avatar/AvatarGroup.js +1 -1
- package/dist/badge/Ribbon.js +1 -1
- package/dist/badge/index.d.ts +4 -1
- package/dist/badge/index.js +6 -6
- package/dist/border-beam/BorderBeam.js +1 -1
- package/dist/breadcrumb/Breadcrumb.js +2 -2
- package/dist/button/Button.js +1 -1
- package/dist/button/style/index.js +8 -2
- package/dist/calendar/generateCalendar.js +3 -3
- package/dist/card/Card.js +2 -2
- package/dist/card/CardGrid.js +1 -1
- package/dist/card/CardMeta.js +1 -1
- package/dist/card/style/index.js +2 -2
- package/dist/carousel/index.js +2 -2
- package/dist/cascader/Panel.js +1 -1
- package/dist/cascader/index.js +4 -4
- package/dist/checkbox/Checkbox.js +3 -2
- package/dist/checkbox/Group.js +1 -1
- package/dist/collapse/Collapse.js +2 -2
- package/dist/color-picker/ColorPicker.js +6 -2
- 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 +5 -3
- package/dist/config-provider/context.js +3 -3
- package/dist/config-provider/define.d.ts +5 -1
- package/dist/config-provider/index.js +38 -4
- package/dist/date-picker/generatePicker/generateRangePicker.js +3 -3
- package/dist/date-picker/generatePicker/generateSinglePicker.js +3 -3
- package/dist/date-picker/hooks/useMergedPickerSemantic.js +1 -1
- package/dist/date-picker/style/panel.js +3 -5
- package/dist/descriptions/hooks/useItems.d.ts +2 -2
- package/dist/descriptions/hooks/useRow.js +1 -1
- package/dist/descriptions/index.js +2 -2
- package/dist/divider/index.js +1 -1
- package/dist/drawer/DrawerPanel.js +1 -1
- package/dist/drawer/index.js +3 -3
- package/dist/dropdown/dropdown.js +3 -3
- package/dist/empty/index.js +2 -1
- package/dist/float-button/BackTop.js +2 -2
- package/dist/float-button/FloatButton.js +1 -1
- package/dist/float-button/FloatButtonGroup.js +2 -2
- package/dist/float-button/PurePanel.js +1 -1
- package/dist/form/ErrorList.js +1 -1
- package/dist/form/Form.d.ts +17 -44
- package/dist/form/Form.js +56 -7
- package/dist/form/FormItem/ItemHolder.js +3 -3
- package/dist/form/FormItem/index.d.ts +3 -3
- package/dist/form/FormItem/index.js +1 -1
- package/dist/form/FormItemLabel.js +1 -1
- package/dist/form/context.d.ts +3 -3
- package/dist/form/hooks/useForm.d.ts +4 -5
- package/dist/form/hooks/useVariant.js +1 -1
- 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/grid/col.js +1 -1
- package/dist/grid/row.js +1 -1
- package/dist/image/PreviewGroup.js +2 -2
- package/dist/image/index.d.ts +5 -5
- package/dist/image/index.js +9 -5
- package/dist/index.d.ts +14 -7
- package/dist/index.js +2 -2
- package/dist/input/Group.js +2 -2
- package/dist/input/Input.js +2 -2
- package/dist/input/OTP/OTPInput.js +1 -1
- package/dist/input/OTP/index.js +2 -2
- package/dist/input/Password.js +1 -1
- package/dist/input/Search.js +2 -2
- package/dist/input/TextArea.js +2 -2
- package/dist/input-number/index.js +3 -3
- package/dist/input-number/style/index.js +3 -2
- package/dist/layout/Sider.js +2 -2
- package/dist/layout/layout.js +2 -3
- package/dist/listy/index.js +1 -1
- package/dist/locale/id_ID.js +8 -6
- package/dist/locale/uz_UZ.js +12 -12
- package/dist/masonry/Masonry.js +1 -1
- package/dist/mentions/index.js +5 -4
- package/dist/menu/MenuDivider.js +1 -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 +42 -18
- package/dist/message/PurePanel.js +2 -2
- package/dist/message/index.js +11 -9
- package/dist/message/useMessage.js +2 -2
- package/dist/modal/ConfirmDialog.js +2 -2
- package/dist/modal/Modal.js +4 -4
- package/dist/modal/PurePanel.js +1 -1
- package/dist/modal/confirm.js +6 -8
- 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/PurePanel.js +2 -2
- package/dist/notification/index.js +8 -13
- package/dist/notification/useNotification.js +2 -2
- package/dist/package.js +1 -1
- package/dist/package.json.d.ts +1 -0
- package/dist/pagination/Pagination.js +4 -4
- package/dist/popconfirm/index.js +2 -2
- package/dist/popover/PurePanel.js +2 -2
- package/dist/popover/index.js +1 -1
- package/dist/progress/progress.js +3 -3
- package/dist/qrcode/index.js +3 -3
- package/dist/radio/group.js +2 -2
- package/dist/radio/radio.js +2 -2
- package/dist/rate/index.js +2 -2
- package/dist/result/index.js +1 -1
- package/dist/segmented/index.js +1 -1
- package/dist/segmented/style/index.js +3 -2
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +5 -5
- package/dist/skeleton/Avatar.js +1 -1
- package/dist/skeleton/Button.js +1 -1
- package/dist/skeleton/Element.js +1 -1
- package/dist/skeleton/Input.js +1 -1
- package/dist/skeleton/Node.js +1 -1
- package/dist/skeleton/Skeleton.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 +5 -1
- package/dist/space/Addon.js +1 -1
- package/dist/space/index.js +1 -1
- package/dist/spin/index.js +2 -2
- package/dist/splitter/Splitter.js +2 -2
- package/dist/statistic/Statistic.js +1 -1
- package/dist/statistic/Timer.d.ts +2 -2
- package/dist/statistic/Timer.js +1 -1
- package/dist/steps/index.js +5 -4
- package/dist/switch/index.js +2 -2
- package/dist/table/InternalTable.js +10 -4
- package/dist/table/hooks/useFilter/FilterDropdown.js +2 -2
- package/dist/table/hooks/usePagination.d.ts +1 -2
- package/dist/table/hooks/usePagination.js +1 -3
- package/dist/table/hooks/useSelection.js +1 -1
- package/dist/table/hooks/useSorter.js +26 -19
- 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/index.js +3 -3
- package/dist/tabs/style/index.js +5 -1
- package/dist/tag/CheckableTag.js +1 -1
- package/dist/tag/CheckableTagGroup.d.ts +0 -1
- package/dist/tag/CheckableTagGroup.js +0 -4
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/tag/index.js +1 -1
- package/dist/theme/themes/dark/index.js +1 -1
- package/dist/theme/useToken.js +2 -2
- package/dist/timeline/Timeline.js +1 -1
- package/dist/timeline/useItems.js +1 -1
- package/dist/tooltip/PurePanel.js +1 -1
- package/dist/tooltip/index.js +2 -2
- package/dist/tour/index.js +5 -2
- package/dist/transfer/Section.js +1 -1
- package/dist/transfer/Transfer.js +3 -3
- package/dist/transfer/hooks/useSelection.js +2 -1
- package/dist/tree/DirectoryTree.js +6 -5
- package/dist/tree/Tree.js +4 -4
- package/dist/tree/utils/dictUtil.js +5 -8
- package/dist/tree-select/index.js +4 -4
- package/dist/typography/Base/index.js +5 -3
- package/dist/typography/Base/util.js +2 -1
- package/dist/typography/Editable.js +6 -2
- package/dist/typography/Typography.js +1 -1
- package/dist/upload/Upload.js +25 -16
- package/dist/upload/UploadList/ListItem.js +5 -1
- package/dist/upload/UploadList/index.js +19 -12
- package/dist/version/token.json +1 -1
- package/dist/watermark/index.d.ts +13 -4
- package/dist/watermark/index.js +11 -7
- package/dist/watermark/useRafDebounce.js +1 -2
- package/dist/watermark/utils.js +1 -1
- package/package.json +42 -41
- package/web-tags.json +22 -14
- package/web-types.json +46 -23
|
@@ -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;
|
|
@@ -191,24 +187,30 @@ function useSorter(props) {
|
|
|
191
187
|
const showSorterTooltip = computed(() => unref(rawShowSorterTooltip));
|
|
192
188
|
const globalLocale = computed(() => unref(rawGlobalLocale));
|
|
193
189
|
const sortStates = shallowRef(collectSortStates(collectColumns.value, true));
|
|
194
|
-
const
|
|
195
|
-
const newKeys = [];
|
|
190
|
+
const getColumnMap = (columns, pos, columnMap = /* @__PURE__ */ new Map()) => {
|
|
196
191
|
columns.forEach((item, index) => {
|
|
197
192
|
const columnPos = getColumnPos(index, pos);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
newKeys.push(...childKeys);
|
|
193
|
+
if (item.sorter) {
|
|
194
|
+
const key = getColumnKey(item, columnPos);
|
|
195
|
+
if (!columnMap.has(key)) columnMap.set(key, item);
|
|
202
196
|
}
|
|
197
|
+
if (item.children) getColumnMap(item.children, columnPos, columnMap);
|
|
203
198
|
});
|
|
204
|
-
return
|
|
199
|
+
return columnMap;
|
|
205
200
|
};
|
|
206
201
|
const mergedSorterStates = computed(() => {
|
|
207
202
|
let validate = true;
|
|
208
|
-
|
|
203
|
+
let collectedStates = collectSortStates(collectColumns.value, false);
|
|
209
204
|
if (!collectedStates.length) {
|
|
210
|
-
const
|
|
211
|
-
|
|
205
|
+
const columnMap = getColumnMap(collectColumns.value);
|
|
206
|
+
collectedStates = sortStates.value.flatMap((state) => {
|
|
207
|
+
const column = columnMap.get(state.key);
|
|
208
|
+
return column?.sorter ? [{
|
|
209
|
+
...state,
|
|
210
|
+
column,
|
|
211
|
+
multiplePriority: getMultiplePriority(column)
|
|
212
|
+
}] : [];
|
|
213
|
+
});
|
|
212
214
|
}
|
|
213
215
|
const validateStates = [];
|
|
214
216
|
function patchStates(state) {
|
|
@@ -220,6 +222,10 @@ function useSorter(props) {
|
|
|
220
222
|
}
|
|
221
223
|
let multipleMode = null;
|
|
222
224
|
collectedStates.forEach((state) => {
|
|
225
|
+
if (!state.sortOrder) {
|
|
226
|
+
patchStates(state);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
223
229
|
if (multipleMode === null) {
|
|
224
230
|
patchStates(state);
|
|
225
231
|
if (state.sortOrder) if (state.multiplePriority === false) validate = false;
|
|
@@ -245,7 +251,8 @@ function useSorter(props) {
|
|
|
245
251
|
});
|
|
246
252
|
const triggerSorter = (sortState) => {
|
|
247
253
|
let newSorterStates;
|
|
248
|
-
|
|
254
|
+
const activeSorterState = mergedSorterStates.value.find(({ sortOrder }) => sortOrder);
|
|
255
|
+
if (sortState.multiplePriority === false || !activeSorterState || activeSorterState.multiplePriority === false) newSorterStates = [sortState];
|
|
249
256
|
else newSorterStates = [...mergedSorterStates.value.filter(({ key }) => key !== sortState.key), sortState];
|
|
250
257
|
sortStates.value = newSorterStates;
|
|
251
258
|
onSorterChange(generateSorterInfo(newSorterStates), newSorterStates);
|
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/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } 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 { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
|
-
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
5
5
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
6
6
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
7
7
|
import useAnimateConfig from "./hooks/useAnimateConfig.js";
|
|
@@ -10,8 +10,8 @@ import useLegacyItems from "./hooks/useLegacyItems.js";
|
|
|
10
10
|
import style_default from "./style/index.js";
|
|
11
11
|
import { computed, createVNode, defineComponent, mergeProps, shallowRef, toRef } from "vue";
|
|
12
12
|
import { clsx } from "@v-c/util";
|
|
13
|
-
import { CloseOutlined, EllipsisOutlined, PlusOutlined } from "@antdv-next/icons";
|
|
14
13
|
import { omit as omit$1 } from "es-toolkit";
|
|
14
|
+
import { CloseOutlined, EllipsisOutlined, PlusOutlined } from "@antdv-next/icons";
|
|
15
15
|
import VcTabs from "@v-c/tabs";
|
|
16
16
|
//#region src/tabs/index.tsx
|
|
17
17
|
const InternalTabs = /* @__PURE__ */ defineComponent((props, { attrs, slots, emit, expose }) => {
|
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,
|
package/dist/tag/CheckableTag.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
2
1
|
import { pureAttrs } from "../_util/hooks/useMergeSemantic.js";
|
|
2
|
+
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
3
3
|
import { clsx, getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
4
4
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
5
5
|
import style_default from "./style/index.js";
|
|
@@ -29,7 +29,6 @@ type CheckableTagGroupProps<CheckableTagValue = CheckableTagDefaultValue> = Comp
|
|
|
29
29
|
styles?: SemanticStyles<SemanticName>;
|
|
30
30
|
options?: (CheckableTagOption<CheckableTagValue> | CheckableTagValue)[];
|
|
31
31
|
id?: string;
|
|
32
|
-
role?: string;
|
|
33
32
|
disabled?: boolean;
|
|
34
33
|
} & (CheckableTagGroupSingleProps<CheckableTagValue> | CheckableTagGroupMultipleProps<CheckableTagValue>);
|
|
35
34
|
interface CheckableTagGroupRef {
|
|
@@ -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/tag/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
2
1
|
import { normalizeStyle as normalizeStyle$1 } from "../_util/styleUtils.js";
|
|
3
2
|
import { pureAttrs, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
3
|
+
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
4
4
|
import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
5
5
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
6
6
|
import useVariant from "../form/hooks/useVariant.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defaultPresetColors } from "../seed.js";
|
|
2
1
|
import { PresetColors } from "../../interface/presetColors.js";
|
|
2
|
+
import { defaultPresetColors } from "../seed.js";
|
|
3
3
|
import genColorMapToken from "../shared/genColorMapToken.js";
|
|
4
4
|
import derivative$1 from "../default/index.js";
|
|
5
5
|
import { generateColorPalettes, generateNeutralColorPalettes } from "./colors.js";
|
package/dist/theme/useToken.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { useConfig } from "../config-provider/context.js";
|
|
2
|
+
import version_default from "../version/index.js";
|
|
1
3
|
import seedToken from "./themes/seed.js";
|
|
2
4
|
import defaultTheme from "./themes/default/theme.js";
|
|
3
5
|
import { useDesignToken } from "./context.js";
|
|
4
|
-
import { useConfig } from "../config-provider/context.js";
|
|
5
|
-
import version_default from "../version/index.js";
|
|
6
6
|
import formatToken from "./util/alias.js";
|
|
7
7
|
import { computed, effectScope } from "vue";
|
|
8
8
|
import { createCacheToken, useGlobalCacheEntry, useStyleContext } from "@antdv-next/cssinjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
1
2
|
import { useBaseConfig, useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
3
|
import { genCssVar } from "../theme/util/genStyleUtils.js";
|
|
3
|
-
import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
4
4
|
import { toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
5
5
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
6
6
|
import useVariant from "../form/hooks/useVariant.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { genCssVar } from "../theme/util/genStyleUtils.js";
|
|
2
1
|
import { normalizeStyle as normalizeStyle$1 } from "../_util/styleUtils.js";
|
|
2
|
+
import { genCssVar } from "../theme/util/genStyleUtils.js";
|
|
3
3
|
import { computed, createVNode } from "vue";
|
|
4
4
|
import { classNames } from "@v-c/util";
|
|
5
5
|
import { LoadingOutlined } from "@antdv-next/icons";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
1
|
import { useMergeSemantic, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
2
|
+
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
3
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
4
4
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
5
5
|
import style_default from "./style/index.js";
|
package/dist/tooltip/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
1
2
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
3
|
import useToken from "../theme/useToken.js";
|
|
3
|
-
import { ContextIsolator } from "../_util/ContextIsolator.js";
|
|
4
|
-
import { useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
5
4
|
import { ZIndexProvider } from "../_util/zindexContext.js";
|
|
6
5
|
import { useZIndex } from "../_util/hooks/useZIndex.js";
|
|
6
|
+
import { ContextIsolator } from "../_util/ContextIsolator.js";
|
|
7
7
|
import getPlacements from "../_util/placements.js";
|
|
8
8
|
import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
9
9
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
package/dist/tour/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { pureAttrs, resolveStyleOrClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
1
2
|
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
3
|
import useToken from "../theme/useToken.js";
|
|
3
|
-
import { pureAttrs, resolveStyleOrClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
4
4
|
import { ZIndexProvider } from "../_util/zindexContext.js";
|
|
5
5
|
import { useZIndex } from "../_util/hooks/useZIndex.js";
|
|
6
6
|
import getPlacements from "../_util/placements.js";
|
|
@@ -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,
|
package/dist/transfer/Section.js
CHANGED
|
@@ -9,8 +9,8 @@ import TransferListBody from "./ListBody.js";
|
|
|
9
9
|
import { Fragment, computed, createVNode, defineComponent, isVNode, mergeProps, ref } from "vue";
|
|
10
10
|
import { clsx } from "@v-c/util";
|
|
11
11
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
12
|
-
import { DownOutlined } from "@antdv-next/icons";
|
|
13
12
|
import { omit as omit$1 } from "es-toolkit";
|
|
13
|
+
import { DownOutlined } from "@antdv-next/icons";
|
|
14
14
|
//#region src/transfer/Section.tsx
|
|
15
15
|
const defaultRender = () => null;
|
|
16
16
|
function isRenderResultPlainObject(result) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
-
import { useFormItemInputContext } from "../form/context.js";
|
|
3
|
-
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
4
1
|
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
5
2
|
import { useMultipleSelect } from "../_util/hooks/useMultipleSelect.js";
|
|
3
|
+
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
4
|
+
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
5
|
+
import { useFormItemInputContext } from "../form/context.js";
|
|
6
6
|
import { getSlotPropsFnRun, toPropsRefs as toPropsRefs$1 } from "../_util/tools.js";
|
|
7
7
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
8
8
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
@@ -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) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
1
|
import { getAttrStyleAndClass } from "../_util/hooks/useMergeSemantic.js";
|
|
2
|
+
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
3
|
import Tree from "./Tree.js";
|
|
4
4
|
import { calcRangeKeys, convertDirectoryKeysToNodes } from "./utils/dictUtil.js";
|
|
5
5
|
import { computed, createVNode, defineComponent, mergeProps, shallowRef, watch } from "vue";
|
|
6
6
|
import { clsx } from "@v-c/util";
|
|
7
7
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
8
|
-
import { FileOutlined, FolderOpenOutlined, FolderOutlined } from "@antdv-next/icons";
|
|
9
8
|
import { omit as omit$1 } from "es-toolkit";
|
|
9
|
+
import { FileOutlined, FolderOpenOutlined, FolderOutlined } from "@antdv-next/icons";
|
|
10
10
|
import { conductExpandParent, convertDataToEntities, convertTreeToData } from "@v-c/tree";
|
|
11
11
|
//#region src/tree/DirectoryTree.tsx
|
|
12
12
|
function getIcon(props) {
|
|
@@ -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);
|
package/dist/tree/Tree.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
-
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
|
-
import useToken from "../theme/useToken.js";
|
|
4
1
|
import { normalizeStyle as normalizeStyle$1 } from "../_util/styleUtils.js";
|
|
5
2
|
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
3
|
+
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
4
|
+
import useToken from "../theme/useToken.js";
|
|
5
|
+
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
6
6
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
7
7
|
import initCollapseMotion from "../_util/motion.js";
|
|
8
8
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
@@ -11,8 +11,8 @@ import dropIndicatorRender from "./utils/dropIndicator.js";
|
|
|
11
11
|
import SwitcherIconCom from "./utils/iconUtil.js";
|
|
12
12
|
import { computed, createVNode, defineComponent, mergeDefaults, mergeProps, shallowRef } from "vue";
|
|
13
13
|
import { clsx } from "@v-c/util";
|
|
14
|
-
import { HolderOutlined } from "@antdv-next/icons";
|
|
15
14
|
import { omit as omit$1 } from "es-toolkit";
|
|
15
|
+
import { HolderOutlined } from "@antdv-next/icons";
|
|
16
16
|
import VcTree from "@v-c/tree";
|
|
17
17
|
//#region src/tree/Tree.tsx
|
|
18
18
|
const Tree = /* @__PURE__ */ defineComponent((props, { slots, emit, expose, attrs }) => {
|
|
@@ -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
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
2
|
+
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
3
|
+
import useToken from "../theme/useToken.js";
|
|
1
4
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
5
|
+
import { useZIndex } from "../_util/hooks/useZIndex.js";
|
|
2
6
|
import { useFormItemInputContext } from "../form/context.js";
|
|
3
|
-
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
4
7
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
5
|
-
import useToken from "../theme/useToken.js";
|
|
6
8
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
7
|
-
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
8
|
-
import { useZIndex } from "../_util/hooks/useZIndex.js";
|
|
9
9
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
10
10
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
11
11
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../../_util/hooks/useMergeSemantic.js";
|
|
1
2
|
import { useComponentBaseConfig } from "../../config-provider/context.js";
|
|
2
3
|
import { genCssVar } from "../../theme/util/genStyleUtils.js";
|
|
3
|
-
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../../_util/hooks/useMergeSemantic.js";
|
|
4
4
|
import { toPropsRefs as toPropsRefs$1 } from "../../_util/tools.js";
|
|
5
5
|
import InternalTooltip from "../../tooltip/index.js";
|
|
6
6
|
import useLocale from "../../locale/useLocale.js";
|
|
@@ -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);
|
|
@@ -354,7 +356,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
354
356
|
"aria-busy": enableShimmer.value ? !props.disabled : void 0,
|
|
355
357
|
"aria-disabled": enableShimmer.value && props.disabled ? true : void 0,
|
|
356
358
|
"rootClass": props.rootClass
|
|
357
|
-
}, restAttrs), { default: () => [createVNode(Ellipsis, mergeProps({
|
|
359
|
+
}, { id: props.id }, restAttrs), { default: () => [createVNode(Ellipsis, mergeProps({
|
|
358
360
|
"enableMeasure": mergedEnableEllipsis.value && !cssEllipsis.value,
|
|
359
361
|
"text": children,
|
|
360
362
|
"rows": rows.value,
|
|
@@ -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
|
|
@@ -3,7 +3,7 @@ import { toPropsRefs } from "../_util/tools.js";
|
|
|
3
3
|
import { cloneElement } from "../_util/vueNode.js";
|
|
4
4
|
import InternalTextArea from "../input/TextArea.js";
|
|
5
5
|
import style_default from "./style/index.js";
|
|
6
|
-
import { createVNode, defineComponent, mergeDefaults, onMounted, shallowRef, watch } from "vue";
|
|
6
|
+
import { createVNode, defineComponent, mergeDefaults, onBeforeUnmount, onMounted, shallowRef, watch } from "vue";
|
|
7
7
|
import { clsx } from "@v-c/util";
|
|
8
8
|
import { EnterOutlined } from "@antdv-next/icons";
|
|
9
9
|
import KeyCode from "@v-c/util/dist/KeyCode";
|
|
@@ -11,6 +11,10 @@ import KeyCode from "@v-c/util/dist/KeyCode";
|
|
|
11
11
|
const Editable = /* @__PURE__ */ defineComponent((props) => {
|
|
12
12
|
const { prefixCls, direction, maxLength, autoSize } = toPropsRefs(props, "prefixCls", "direction", "maxLength", "autoSize");
|
|
13
13
|
const ref = shallowRef();
|
|
14
|
+
let isUnmounting = false;
|
|
15
|
+
onBeforeUnmount(() => {
|
|
16
|
+
isUnmounting = true;
|
|
17
|
+
});
|
|
14
18
|
const inComposition = shallowRef(false);
|
|
15
19
|
const lastKeyCode = shallowRef(null);
|
|
16
20
|
const current = shallowRef(props.value);
|
|
@@ -49,7 +53,7 @@ const Editable = /* @__PURE__ */ defineComponent((props) => {
|
|
|
49
53
|
} else if (keyCode === KeyCode.ESC) props?.onCancel?.();
|
|
50
54
|
};
|
|
51
55
|
const onBlur = () => {
|
|
52
|
-
confirmChange();
|
|
56
|
+
if (!isUnmounting) confirmChange();
|
|
53
57
|
};
|
|
54
58
|
const [hashId, cssVarCls] = style_default(prefixCls);
|
|
55
59
|
const icon = props.enterIcon === void 0 ? createVNode(EnterOutlined, null, null) : props.enterIcon;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
2
1
|
import { getAttrStyleAndClass } from "../_util/hooks/useMergeSemantic.js";
|
|
2
|
+
import { useComponentBaseConfig } from "../config-provider/context.js";
|
|
3
3
|
import { toPropsRefs } from "../_util/tools.js";
|
|
4
4
|
import style_default from "./style/index.js";
|
|
5
5
|
import { createVNode, defineComponent, mergeProps, resolveDynamicComponent, shallowRef } from "vue";
|