antdv-next 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_util/ContextIsolator.js +12 -3
- package/dist/_util/hooks/useAllowClear.d.ts +22 -6
- package/dist/_util/hooks/useAllowClear.js +24 -6
- package/dist/_util/hooks/useClosable.js +1 -1
- package/dist/_util/statusUtils.d.ts +1 -1
- package/dist/_util/tools.d.ts +3 -1
- package/dist/_util/tools.js +6 -1
- package/dist/_util/vueNode.d.ts +6 -2
- package/dist/alert/Alert.js +4 -1
- package/dist/alert/style/index.d.ts +3 -3
- package/dist/alert/style/index.js +3 -3
- package/dist/antd-with-locales.esm.js +16773 -15780
- package/dist/antd-with-locales.js +78 -78
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +14353 -14003
- package/dist/antd.js +80 -80
- package/dist/auto-complete/index.js +1 -0
- package/dist/avatar/Avatar.js +2 -4
- package/dist/avatar/AvatarContext.d.ts +2 -2
- package/dist/border-beam/BorderBeam.d.ts +8 -1
- package/dist/border-beam/BorderBeam.js +28 -14
- package/dist/border-beam/index.d.ts +2 -2
- package/dist/breadcrumb/BreadcrumbItem.js +1 -1
- package/dist/card/style/index.js +2 -2
- package/dist/cascader/Panel.js +3 -3
- package/dist/cascader/index.js +12 -5
- package/dist/checkbox/Checkbox.js +6 -4
- package/dist/checkbox/Group.d.ts +19 -1
- package/dist/checkbox/Group.js +34 -5
- package/dist/checkbox/GroupContext.d.ts +3 -0
- package/dist/checkbox/index.d.ts +2 -2
- package/dist/color-picker/ColorPicker.js +1 -1
- package/dist/color-picker/style/input.js +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/date-picker/generatePicker/generateRangePicker.js +20 -2
- package/dist/date-picker/generatePicker/generateSinglePicker.js +20 -2
- package/dist/date-picker/generatePicker/interface.d.ts +4 -0
- package/dist/date-picker/style/panel.js +1 -1
- package/dist/date-picker/style/util.js +1 -1
- package/dist/date-picker/util.d.ts +2 -0
- package/dist/descriptions/hooks/useItems.d.ts +6 -6
- package/dist/descriptions/style/index.js +11 -13
- package/dist/divider/style/index.js +1 -1
- package/dist/drawer/DrawerPanel.js +1 -1
- package/dist/dropdown/dropdown.d.ts +2 -0
- package/dist/dropdown/dropdown.js +9 -2
- package/dist/dropdown/style/index.js +1 -1
- package/dist/form/ErrorList.js +1 -1
- package/dist/form/Form.js +1 -1
- package/dist/form/FormItem/ItemHolder.js +1 -1
- package/dist/form/FormItem/index.js +2 -2
- package/dist/form/FormItemInput.js +1 -1
- package/dist/form/FormItemLabel.js +1 -1
- package/dist/form/hooks/useVariant.js +1 -1
- package/dist/image/hooks/useMergedPreviewConfig.d.ts +1 -0
- package/dist/image/hooks/useMergedPreviewConfig.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/input/Group.js +1 -1
- package/dist/input/Input.d.ts +2 -1
- package/dist/input/Input.js +8 -5
- package/dist/input/OTP/OTPInput.d.ts +2 -1
- package/dist/input/OTP/OTPInput.js +12 -3
- package/dist/input/OTP/index.d.ts +3 -1
- package/dist/input/OTP/index.js +15 -6
- package/dist/input/Password.js +7 -5
- package/dist/input/Search.js +4 -2
- package/dist/input/TextArea.d.ts +3 -1
- package/dist/input/TextArea.js +13 -8
- package/dist/input/style/index.js +1 -1
- package/dist/input-number/index.d.ts +3 -6
- package/dist/input-number/index.js +8 -3
- package/dist/input-number/style/index.js +1 -5
- package/dist/listy/index.d.ts +1 -1
- package/dist/listy/index.js +9 -7
- package/dist/listy/interface.d.ts +6 -1
- package/dist/listy/style/index.js +4 -2
- package/dist/locale/ar_EG.js +9 -0
- package/dist/locale/az_AZ.js +9 -0
- package/dist/locale/bg_BG.js +9 -0
- package/dist/locale/bn_BD.js +9 -0
- package/dist/locale/by_BY.js +9 -0
- package/dist/locale/ca_ES.js +9 -0
- package/dist/locale/cs_CZ.js +9 -0
- package/dist/locale/da_DK.js +9 -0
- package/dist/locale/de_DE.js +9 -0
- package/dist/locale/el_GR.js +9 -0
- package/dist/locale/en_GB.js +11 -1
- package/dist/locale/en_US.js +11 -1
- package/dist/locale/es_ES.js +9 -0
- package/dist/locale/et_EE.js +9 -0
- package/dist/locale/eu_ES.js +9 -0
- package/dist/locale/fa_IR.js +9 -0
- package/dist/locale/fi_FI.js +10 -1
- package/dist/locale/fr_BE.js +9 -0
- package/dist/locale/fr_CA.js +9 -0
- package/dist/locale/fr_FR.js +9 -0
- package/dist/locale/ga_IE.js +9 -0
- package/dist/locale/gl_ES.js +9 -0
- package/dist/locale/he_IL.js +9 -0
- package/dist/locale/hi_IN.js +9 -0
- package/dist/locale/hr_HR.js +9 -0
- package/dist/locale/hu_HU.js +9 -0
- package/dist/locale/hy_AM.js +9 -0
- package/dist/locale/id_ID.js +9 -0
- package/dist/locale/index.d.ts +3 -0
- package/dist/locale/is_IS.js +9 -0
- package/dist/locale/it_IT.js +9 -0
- package/dist/locale/ja_JP.js +9 -0
- package/dist/locale/ka_GE.js +9 -0
- package/dist/locale/kk_KZ.js +9 -0
- package/dist/locale/km_KH.js +9 -0
- package/dist/locale/kmr_IQ.js +9 -0
- package/dist/locale/kn_IN.js +9 -0
- package/dist/locale/ko_KR.js +9 -0
- package/dist/locale/ku_IQ.js +9 -0
- package/dist/locale/lt_LT.js +9 -0
- package/dist/locale/lv_LV.js +9 -0
- package/dist/locale/mk_MK.js +9 -0
- package/dist/locale/ml_IN.js +9 -0
- package/dist/locale/mn_MN.js +9 -0
- package/dist/locale/mr_IN.js +9 -0
- package/dist/locale/ms_MY.js +9 -0
- package/dist/locale/my_MM.js +9 -0
- package/dist/locale/nb_NO.js +9 -0
- package/dist/locale/ne_NP.js +9 -0
- package/dist/locale/nl_BE.js +9 -0
- package/dist/locale/nl_NL.js +9 -0
- package/dist/locale/pl_PL.js +9 -0
- package/dist/locale/pt_BR.js +9 -0
- package/dist/locale/pt_PT.js +9 -0
- package/dist/locale/ro_RO.js +19 -10
- package/dist/locale/ru_RU.js +9 -0
- package/dist/locale/si_LK.js +9 -0
- package/dist/locale/sk_SK.js +9 -0
- package/dist/locale/sl_SI.js +9 -0
- package/dist/locale/sq_AL.js +9 -0
- package/dist/locale/sr_RS.js +9 -0
- package/dist/locale/sv_SE.js +9 -0
- package/dist/locale/ta_IN.js +10 -1
- package/dist/locale/th_TH.js +9 -0
- package/dist/locale/tk_TK.js +9 -0
- package/dist/locale/tr_TR.js +9 -0
- package/dist/locale/uk_UA.js +9 -0
- package/dist/locale/ur_PK.js +9 -0
- package/dist/locale/useLocale.d.ts +6 -1
- package/dist/locale/useLocale.js +12 -1
- package/dist/locale/uz_UZ.js +9 -0
- package/dist/locale/vi_VN.js +9 -0
- package/dist/locale/zh_CN.js +13 -3
- package/dist/locale/zh_HK.js +11 -1
- package/dist/locale/zh_TW.js +11 -1
- package/dist/masonry/Masonry.js +1 -1
- package/dist/mentions/index.d.ts +2 -3
- package/dist/mentions/index.js +9 -4
- package/dist/mentions/style/index.js +1 -1
- package/dist/menu/MenuContext.d.ts +2 -0
- package/dist/menu/MenuItem.js +23 -6
- package/dist/menu/index.js +5 -0
- package/dist/menu/menu.d.ts +3 -0
- package/dist/menu/menu.js +7 -0
- package/dist/modal/ConfirmDialog.js +14 -7
- package/dist/notification/PurePanel.js +7 -12
- package/dist/notification/interface.d.ts +8 -0
- package/dist/notification/style/index.js +1 -1
- package/dist/notification/style/placement.js +10 -7
- package/dist/notification/useNotification.js +5 -15
- package/dist/package.js +1 -1
- package/dist/pagination/Pagination.js +2 -2
- package/dist/pagination/useShowSizeChanger.d.ts +3 -0
- package/dist/pagination/useShowSizeChanger.js +1 -1
- package/dist/popconfirm/index.js +5 -5
- package/dist/popconfirm/style/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/popover/style/index.js +2 -2
- package/dist/progress/Circle.js +0 -8
- package/dist/progress/Line.js +1 -9
- package/dist/progress/Steps.js +0 -8
- package/dist/progress/progress.js +2 -14
- package/dist/qrcode/index.js +4 -4
- package/dist/radio/group.js +40 -7
- package/dist/radio/index.d.ts +2 -2
- package/dist/radio/interface.d.ts +19 -1
- package/dist/radio/radio.js +5 -3
- package/dist/result/index.js +3 -3
- package/dist/result/noFound.js +120 -140
- package/dist/result/serverError.js +132 -147
- package/dist/result/unauthorized.js +115 -129
- package/dist/segmented/index.js +1 -1
- package/dist/select/index.js +10 -3
- package/dist/select/style/dropdown.js +1 -1
- package/dist/select/style/index.js +2 -2
- package/dist/select/style/select-input-multiple.js +1 -1
- package/dist/select/usePopupRender.js +4 -1
- package/dist/slider/index.d.ts +0 -3
- package/dist/slider/index.js +2 -2
- package/dist/splitter/SplitBar.js +9 -3
- package/dist/splitter/interface.d.ts +5 -1
- package/dist/steps/style/index.js +1 -1
- package/dist/steps/style/inline.js +1 -1
- package/dist/style/motion/collapse.js +4 -10
- package/dist/table/ExpandIcon.d.ts +9 -4
- package/dist/table/ExpandIcon.js +42 -20
- package/dist/table/InternalTable.js +21 -15
- package/dist/table/hooks/useLazyKVMap.js +1 -1
- package/dist/table/hooks/useSelection.js +54 -9
- package/dist/table/interface.d.ts +8 -0
- package/dist/table/style/index.js +1 -1
- package/dist/table/style/sorter.js +2 -2
- package/dist/tabs/index.js +9 -2
- package/dist/tabs/style/index.js +1 -1
- package/dist/time-picker/index.js +34 -0
- package/dist/timeline/Timeline.js +1 -1
- package/dist/tooltip/style/index.js +1 -1
- package/dist/tour/panelRender.js +3 -2
- package/dist/transfer/Section.js +2 -1
- package/dist/transfer/Transfer.js +1 -1
- package/dist/tree/style/index.js +1 -1
- package/dist/tree-select/index.js +14 -8
- package/dist/typography/Base/index.js +23 -2
- package/dist/typography/Link.js +5 -0
- package/dist/typography/Paragraph.js +5 -0
- package/dist/typography/Text.js +5 -0
- package/dist/typography/Title.js +5 -0
- package/dist/typography/hooks/useMergedConfig.js +1 -1
- package/dist/typography/interface.d.ts +8 -1
- package/dist/typography/style/index.js +2 -1
- package/dist/typography/style/mixins.d.ts +2 -1
- package/dist/typography/style/mixins.js +26 -3
- package/dist/upload/Upload.d.ts +1 -0
- package/dist/upload/Upload.js +10 -3
- package/dist/upload/UploadList/ListItem.js +8 -3
- package/dist/upload/interface.d.ts +1 -0
- package/dist/version/token-meta.json +1 -1
- package/dist/version/token.json +1 -1
- package/dist/watermark/index.js +1 -1
- package/package.json +9 -9
- package/web-tags.json +74 -14
- package/web-types.json +186 -22
- package/dist/_util/getAllowClear.d.ts +0 -6
- package/dist/_util/getAllowClear.js +0 -11
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { devUseWarning, isDev } from "../_util/warning.js";
|
|
2
|
+
import { useFormItemInputContext } from "../form/context.js";
|
|
2
3
|
import { useComponentBaseConfig, useConfig } from "../config-provider/context.js";
|
|
3
4
|
import { useSize } from "../config-provider/hooks/useSize.js";
|
|
4
5
|
import useToken from "../theme/useToken.js";
|
|
5
6
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
6
|
-
import { getAttrStyleAndClass, useMergeSemantic, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
7
|
+
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
7
8
|
import { useZIndex } from "../_util/hooks/useZIndex.js";
|
|
8
9
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
9
10
|
import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
10
11
|
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
12
|
+
import { useLocaleGetter } from "../locale/useLocale.js";
|
|
11
13
|
import genPurePanel from "../_util/PurePanel.js";
|
|
12
14
|
import { getMergedStatus, getStatusClassNames } from "../_util/statusUtils.js";
|
|
13
15
|
import { DefaultRenderEmpty } from "../config-provider/defaultRenderEmpty.js";
|
|
14
|
-
import { useFormItemInputContext } from "../form/context.js";
|
|
15
16
|
import useVariant from "../form/hooks/useVariant.js";
|
|
16
17
|
import mergedBuiltinPlacements from "../select/mergedBuiltinPlacements.js";
|
|
17
18
|
import style_default from "../select/style/index.js";
|
|
@@ -71,7 +72,8 @@ const omitKeys = [
|
|
|
71
72
|
"classes"
|
|
72
73
|
];
|
|
73
74
|
const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expose, emit, attrs }) => {
|
|
74
|
-
const { prefixCls: treeSelectPrefixCls, getPopupContainer: getContextPopupContainer, direction, styles: contextStyles, classes: contextClassNames, switcherIcon, virtual, getPrefixCls, rootPrefixCls } = useComponentBaseConfig("treeSelect", props, ["switcherIcon"], "tree-select");
|
|
75
|
+
const { prefixCls: treeSelectPrefixCls, getPopupContainer: getContextPopupContainer, direction, class: contextClassName, style: contextStyle, styles: contextStyles, classes: contextClassNames, switcherIcon, virtual, getPrefixCls, rootPrefixCls } = useComponentBaseConfig("treeSelect", props, ["switcherIcon"], "tree-select");
|
|
76
|
+
const getGlobalLocale = useLocaleGetter("global");
|
|
75
77
|
const configCtx = useConfig();
|
|
76
78
|
const { prefixCls: customizePrefixCls, variant: customVariant, size: customizeSize, disabled: customDisabled, status: customStatus, classes, styles } = toPropsRefs(props, "prefixCls", "variant", "size", "disabled", "status", "classes", "styles");
|
|
77
79
|
const bordered = computed(() => props?.bordered ?? true);
|
|
@@ -114,7 +116,8 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
114
116
|
status: mergedStatus.value,
|
|
115
117
|
variant: variant.value
|
|
116
118
|
}));
|
|
117
|
-
const
|
|
119
|
+
const contextStyleRoot = useSemanticRootStyle(contextStyle);
|
|
120
|
+
const [mergedClassNames, mergedStyles] = useMergeSemantic(useToArr(contextClassNames, classes), useToArr(contextStyles, contextStyleRoot, styles), useToProps(mergedProps), computed(() => {
|
|
118
121
|
return { popup: { _default: "root" } };
|
|
119
122
|
}));
|
|
120
123
|
const mergedOnOpenChange = (open) => {
|
|
@@ -142,7 +145,7 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
142
145
|
const { popupClassName, dropdownClassName, rootClass, popupRender, dropdownRender, popupMatchSelectWidth, dropdownMatchSelectWidth, treeCheckable, multiple, allowClear, treeLine, listHeight, builtinPlacements, switcherIcon: customSwitcherIcon, treeIcon, getPopupContainer, choiceTransitionName, transitionName, treeExpandAction, showCheckedStrategy, treeCheckStrictly } = props;
|
|
143
146
|
const restProps = omit(props, omitKeys);
|
|
144
147
|
const treeTitleRender = slots?.treeTitleRender ?? props.treeTitleRender;
|
|
145
|
-
const mergedPopupClassName = clsx(popupClassName || dropdownClassName, `${treeSelectPrefixCls.value}-dropdown`, { [`${treeSelectPrefixCls.value}-dropdown-rtl`]: direction.value === "rtl" }, rootClass, mergedClassNames.value.
|
|
148
|
+
const mergedPopupClassName = clsx(popupClassName || dropdownClassName, `${treeSelectPrefixCls.value}-dropdown`, { [`${treeSelectPrefixCls.value}-dropdown-rtl`]: direction.value === "rtl" }, rootClass, mergedClassNames.value.popup?.root, cssVarCls.value, rootCls.value, treeSelectRootCls.value, hashId.value);
|
|
146
149
|
const { style, className, restAttrs } = getAttrStyleAndClass(attrs);
|
|
147
150
|
const mergedPopupRender = usePopupRender(popupRender || dropdownRender);
|
|
148
151
|
const customSuffixIcon = getSlotPropsFnRun(slots, props, "suffixIcon", false);
|
|
@@ -160,7 +163,11 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
160
163
|
prefixCls: prefixCls.value,
|
|
161
164
|
componentName: "TreeSelect"
|
|
162
165
|
});
|
|
163
|
-
const mergedAllowClear = allowClear
|
|
166
|
+
const mergedAllowClear = allowClear ? {
|
|
167
|
+
clearIcon,
|
|
168
|
+
label: getGlobalLocale().clear,
|
|
169
|
+
...typeof allowClear === "object" ? allowClear : {}
|
|
170
|
+
} : allowClear;
|
|
164
171
|
const notFoundContent = getSlotPropsFnRun(slots, props, "notFoundContent", false);
|
|
165
172
|
let mergedNotFound;
|
|
166
173
|
if (notFoundContent !== void 0) mergedNotFound = notFoundContent;
|
|
@@ -211,7 +218,7 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
211
218
|
[`${prefixCls.value}-rtl`]: direction.value === "rtl",
|
|
212
219
|
[`${prefixCls.value}-${variant.value}`]: enableVariantCls.value,
|
|
213
220
|
[`${prefixCls.value}-in-form-item`]: isFormItemInput
|
|
214
|
-
}, getStatusClassNames(prefixCls.value, mergedStatus.value, hasFeedback), compactItemClassnames.value, className, rootClass, mergedClassNames?.value?.root, cssVarCls.value, rootCls.value, treeSelectRootCls.value, hashId.value);
|
|
221
|
+
}, getStatusClassNames(prefixCls.value, mergedStatus.value, hasFeedback), compactItemClassnames.value, contextClassName.value, className, rootClass, mergedClassNames?.value?.root, cssVarCls.value, rootCls.value, treeSelectRootCls.value, hashId.value);
|
|
215
222
|
const mergedSwitcherIcon = slots?.switcherIcon ?? customSwitcherIcon ?? switcherIcon.value;
|
|
216
223
|
const renderSwitcherIcon = (nodeProps) => createVNode(SwitcherIconCom, {
|
|
217
224
|
"prefixCls": treePrefixCls.value,
|
|
@@ -252,7 +259,6 @@ const InternalTreeSelect = /* @__PURE__ */ defineComponent((props, { slots, expo
|
|
|
252
259
|
"treeMotion": null,
|
|
253
260
|
"popupClassName": mergedPopupClassName,
|
|
254
261
|
"popupStyle": {
|
|
255
|
-
...mergedStyles.value.root,
|
|
256
262
|
...mergedStyles.value.popup?.root,
|
|
257
263
|
zIndex: zIndex.value
|
|
258
264
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useComponentBaseConfig } from "../../config-provider/context.js";
|
|
2
|
+
import { genCssVar } from "../../theme/util/genStyleUtils.js";
|
|
2
3
|
import { getAttrStyleAndClass, useMergeSemantic, useSemanticRootStyle, useToArr, useToProps } from "../../_util/hooks/useMergeSemantic.js";
|
|
3
4
|
import { toPropsRefs as toPropsRefs$1 } from "../../_util/tools.js";
|
|
4
5
|
import InternalTooltip from "../../tooltip/index.js";
|
|
@@ -22,6 +23,8 @@ import useDelayState from "@v-c/util/dist/hooks/useDelayState";
|
|
|
22
23
|
import ResizeObserver from "@v-c/resize-observer";
|
|
23
24
|
//#region src/typography/Base/index.tsx
|
|
24
25
|
const ELLIPSIS_STR = "...";
|
|
26
|
+
const DEFAULT_SHIMMER_DURATION = 1;
|
|
27
|
+
const DEFAULT_SHIMMER_CONFIG = { duration: DEFAULT_SHIMMER_DURATION };
|
|
25
28
|
const DECORATION_PROPS = [
|
|
26
29
|
"delete",
|
|
27
30
|
"mark",
|
|
@@ -54,7 +57,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
54
57
|
return val;
|
|
55
58
|
});
|
|
56
59
|
const editIconRef = shallowRef();
|
|
57
|
-
const { prefixCls, direction: contextDirection, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles } = useComponentBaseConfig("typography", props);
|
|
60
|
+
const { prefixCls, rootPrefixCls, direction: contextDirection, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles } = useComponentBaseConfig("typography", props);
|
|
58
61
|
const mergedDirection = computed(() => props.direction ?? contextDirection.value);
|
|
59
62
|
const { classes, styles } = toPropsRefs$1(props, "classes", "styles");
|
|
60
63
|
const mergedProps = computed(() => {
|
|
@@ -97,6 +100,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
97
100
|
triggerEdit(false);
|
|
98
101
|
};
|
|
99
102
|
const [enableCopy, copyConfig] = useMergedConfig(computed(() => props.copyable));
|
|
103
|
+
const [enableShimmer, shimmerConfig] = useMergedConfig(computed(() => props.shimmer), DEFAULT_SHIMMER_CONFIG);
|
|
100
104
|
const childrenNodes = shallowRef([]);
|
|
101
105
|
const { copied, copyLoading, onClick: onCopyClick } = useCopyClick({
|
|
102
106
|
copyConfig,
|
|
@@ -240,7 +244,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
240
244
|
"aria-label": ariaLabel,
|
|
241
245
|
"tabindex": tabIndex,
|
|
242
246
|
"style": mergedStyles.value.action
|
|
243
|
-
}, [icon || createVNode(EditOutlined,
|
|
247
|
+
}, [icon || createVNode(EditOutlined, null, null)])] }) : null;
|
|
244
248
|
};
|
|
245
249
|
const renderCopy = () => {
|
|
246
250
|
if (!enableCopy.value) return null;
|
|
@@ -281,6 +285,7 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
281
285
|
const componentCls = computed(() => classNames({
|
|
282
286
|
[`${prefixCls.value}-${props.type}`]: props.type,
|
|
283
287
|
[`${prefixCls.value}-disabled`]: props.disabled,
|
|
288
|
+
[`${prefixCls.value}-shimmer`]: enableShimmer.value && !props.disabled,
|
|
284
289
|
[`${prefixCls.value}-ellipsis`]: enableEllipsis.value,
|
|
285
290
|
[`${prefixCls.value}-ellipsis-single-line`]: cssTextOverflow.value,
|
|
286
291
|
[`${prefixCls.value}-ellipsis-multiple-line`]: cssLineClamp.value,
|
|
@@ -296,6 +301,15 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
296
301
|
};
|
|
297
302
|
const mergedClassName = classNames(componentCls.value, attrClass);
|
|
298
303
|
const mergedStyle = [
|
|
304
|
+
enableShimmer.value ? (() => {
|
|
305
|
+
const [varName] = genCssVar(rootPrefixCls.value, "typography");
|
|
306
|
+
const duration = shimmerConfig.value?.duration;
|
|
307
|
+
const [motionTime = DEFAULT_SHIMMER_DURATION, waitTime = 1] = Array.isArray(duration) ? duration : [duration];
|
|
308
|
+
return {
|
|
309
|
+
[varName("shimmer-motion-time")]: motionTime,
|
|
310
|
+
[varName("shimmer-wait-time")]: waitTime
|
|
311
|
+
};
|
|
312
|
+
})() : null,
|
|
299
313
|
mergedStyles.value.root,
|
|
300
314
|
cssLineClamp.value ? { WebkitLineClamp: rows.value } : null,
|
|
301
315
|
attrStyle
|
|
@@ -337,6 +351,8 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
337
351
|
"onClick": clickHandler,
|
|
338
352
|
"title": props.title,
|
|
339
353
|
"aria-label": topAriaLabel.value,
|
|
354
|
+
"aria-busy": enableShimmer.value ? !props.disabled : void 0,
|
|
355
|
+
"aria-disabled": enableShimmer.value && props.disabled ? true : void 0,
|
|
340
356
|
"rootClass": props.rootClass
|
|
341
357
|
}, restAttrs), { default: () => [createVNode(Ellipsis, mergeProps({
|
|
342
358
|
"enableMeasure": mergedEnableEllipsis.value && !cssEllipsis.value,
|
|
@@ -396,6 +412,11 @@ const Base = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
396
412
|
required: false,
|
|
397
413
|
default: void 0
|
|
398
414
|
},
|
|
415
|
+
shimmer: {
|
|
416
|
+
type: [Boolean, Object],
|
|
417
|
+
required: false,
|
|
418
|
+
default: void 0
|
|
419
|
+
},
|
|
399
420
|
actions: {
|
|
400
421
|
type: Object,
|
|
401
422
|
required: false
|
package/dist/typography/Link.js
CHANGED
|
@@ -76,6 +76,11 @@ const Link = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
76
76
|
required: false,
|
|
77
77
|
default: void 0
|
|
78
78
|
},
|
|
79
|
+
shimmer: {
|
|
80
|
+
type: [Boolean, Object],
|
|
81
|
+
required: false,
|
|
82
|
+
default: void 0
|
|
83
|
+
},
|
|
79
84
|
actions: {
|
|
80
85
|
type: Object,
|
|
81
86
|
required: false
|
|
@@ -57,6 +57,11 @@ const Paragraph = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }
|
|
|
57
57
|
required: false,
|
|
58
58
|
default: void 0
|
|
59
59
|
},
|
|
60
|
+
shimmer: {
|
|
61
|
+
type: [Boolean, Object],
|
|
62
|
+
required: false,
|
|
63
|
+
default: void 0
|
|
64
|
+
},
|
|
60
65
|
actions: {
|
|
61
66
|
type: Object,
|
|
62
67
|
required: false
|
package/dist/typography/Text.js
CHANGED
|
@@ -73,6 +73,11 @@ const Text = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
73
73
|
required: false,
|
|
74
74
|
default: void 0
|
|
75
75
|
},
|
|
76
|
+
shimmer: {
|
|
77
|
+
type: [Boolean, Object],
|
|
78
|
+
required: false,
|
|
79
|
+
default: void 0
|
|
80
|
+
},
|
|
76
81
|
actions: {
|
|
77
82
|
type: Object,
|
|
78
83
|
required: false
|
package/dist/typography/Title.js
CHANGED
|
@@ -77,6 +77,11 @@ const Title = /* @__PURE__ */ defineComponent((props, { slots, attrs, emit }) =>
|
|
|
77
77
|
required: false,
|
|
78
78
|
default: void 0
|
|
79
79
|
},
|
|
80
|
+
shimmer: {
|
|
81
|
+
type: [Boolean, Object],
|
|
82
|
+
required: false,
|
|
83
|
+
default: void 0
|
|
84
|
+
},
|
|
80
85
|
actions: {
|
|
81
86
|
type: Object,
|
|
82
87
|
required: false
|
|
@@ -5,7 +5,7 @@ function useMergedConfig(propConfig, templateConfig) {
|
|
|
5
5
|
return [support, computed(() => {
|
|
6
6
|
const current = unref(propConfig);
|
|
7
7
|
return {
|
|
8
|
-
...templateConfig,
|
|
8
|
+
...support.value ? templateConfig : null,
|
|
9
9
|
...support.value && typeof current === "object" ? current : null
|
|
10
10
|
};
|
|
11
11
|
})];
|
|
@@ -63,6 +63,9 @@ interface TypographySemanticStyles {
|
|
|
63
63
|
}
|
|
64
64
|
type TypographyClassNamesType = SemanticClassNamesType<BlockProps, TypographySemanticClassNames>;
|
|
65
65
|
type TypographyStylesType = SemanticStylesType<BlockProps, TypographySemanticStyles>;
|
|
66
|
+
interface ShimmerConfig {
|
|
67
|
+
duration?: number | [motionTime: number, waitTime: number];
|
|
68
|
+
}
|
|
66
69
|
interface BlockProps extends ComponentBaseProps {
|
|
67
70
|
title?: string;
|
|
68
71
|
editable?: boolean | EditConfig;
|
|
@@ -70,6 +73,10 @@ interface BlockProps extends ComponentBaseProps {
|
|
|
70
73
|
type?: BaseType;
|
|
71
74
|
disabled?: boolean;
|
|
72
75
|
ellipsis?: boolean | EllipsisConfig;
|
|
76
|
+
/**
|
|
77
|
+
* @since 1.7.0
|
|
78
|
+
*/
|
|
79
|
+
shimmer?: boolean | ShimmerConfig;
|
|
73
80
|
/**
|
|
74
81
|
* @since 1.3.0
|
|
75
82
|
*/
|
|
@@ -110,4 +117,4 @@ interface TypographyBaseProps extends ComponentBaseProps {
|
|
|
110
117
|
title?: string;
|
|
111
118
|
}
|
|
112
119
|
//#endregion
|
|
113
|
-
export { ActionsConfig, BaseType, BlockProps, CopyConfig, EditConfig, EllipsisConfig, TypographyBaseEmits, TypographyBaseProps, TypographyClassNamesType, TypographySemanticClassNames, TypographySemanticStyles, TypographySlots, TypographyStylesType };
|
|
120
|
+
export { ActionsConfig, BaseType, BlockProps, CopyConfig, EditConfig, EllipsisConfig, ShimmerConfig, TypographyBaseEmits, TypographyBaseProps, TypographyClassNamesType, TypographySemanticClassNames, TypographySemanticStyles, TypographySlots, TypographyStylesType };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { operationUnit } from "../../style/index.js";
|
|
2
2
|
import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
3
|
-
import { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getTitleStyles } from "./mixins.js";
|
|
3
|
+
import { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getShimmerStyles, getTitleStyles } from "./mixins.js";
|
|
4
4
|
//#region src/typography/style/index.ts
|
|
5
5
|
const genTypographyStyle = (token) => {
|
|
6
6
|
const { componentCls, titleMarginTop } = token;
|
|
@@ -64,6 +64,7 @@ const genTypographyStyle = (token) => {
|
|
|
64
64
|
...getEditableStyles(token),
|
|
65
65
|
...getCopyableStyles(token),
|
|
66
66
|
...getEllipsisStyles(),
|
|
67
|
+
[`&${componentCls}-shimmer`]: getShimmerStyles(token),
|
|
67
68
|
"&-rtl": { direction: "rtl" }
|
|
68
69
|
} };
|
|
69
70
|
};
|
|
@@ -9,5 +9,6 @@ declare const getResetStyles: GenerateStyle<TypographyToken, CSSObject>;
|
|
|
9
9
|
declare const getEditableStyles: GenerateStyle<TypographyToken, CSSObject>;
|
|
10
10
|
declare const getCopyableStyles: GenerateStyle<TypographyToken, CSSObject>;
|
|
11
11
|
declare function getEllipsisStyles(): CSSObject;
|
|
12
|
+
declare function getShimmerStyles(token: TypographyToken): CSSObject;
|
|
12
13
|
//#endregion
|
|
13
|
-
export { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getTitleStyles };
|
|
14
|
+
export { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getShimmerStyles, getTitleStyles };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { operationUnit } from "../../style/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { genCssVar } from "../../theme/util/genStyleUtils.js";
|
|
3
|
+
import { Keyframes, unit } from "@antdv-next/cssinjs";
|
|
3
4
|
import { gold } from "@ant-design/colors";
|
|
4
5
|
//#region src/typography/style/mixins.ts
|
|
5
6
|
function getTitleStyle(fontSize, lineHeight, color, token) {
|
|
@@ -172,7 +173,7 @@ const getEditableStyles = (token) => {
|
|
|
172
173
|
insetInlineEnd: token.calc(token.marginXS).add(2).equal(),
|
|
173
174
|
insetBlockEnd: token.marginXS,
|
|
174
175
|
color: token.colorIcon,
|
|
175
|
-
fontWeight:
|
|
176
|
+
fontWeight: 400,
|
|
176
177
|
fontSize: token.fontSize,
|
|
177
178
|
fontStyle: "normal",
|
|
178
179
|
pointerEvents: "none"
|
|
@@ -227,5 +228,27 @@ function getEllipsisStyles() {
|
|
|
227
228
|
}
|
|
228
229
|
};
|
|
229
230
|
}
|
|
231
|
+
function getShimmerStyles(token) {
|
|
232
|
+
const [, varRef] = genCssVar(token.antCls, "typography");
|
|
233
|
+
const motionTime = varRef("shimmer-motion-time", "1");
|
|
234
|
+
const waitTime = varRef("shimmer-wait-time", "1");
|
|
235
|
+
const shimmerAnimation = new Keyframes("antTypographyShimmer", {
|
|
236
|
+
"0%": { backgroundPosition: "-66.6667% 100%, 0 0" },
|
|
237
|
+
"100%": { backgroundPosition: `calc(166.6667% + 233.3334% * ${waitTime} / ${motionTime}) 100%, 0 0` }
|
|
238
|
+
});
|
|
239
|
+
return {
|
|
240
|
+
backgroundClip: "text, text",
|
|
241
|
+
WebkitBackgroundClip: "text, text",
|
|
242
|
+
WebkitTextFillColor: "transparent",
|
|
243
|
+
backgroundImage: ["linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), white, rgba(255, 255, 255, 0.8), transparent)", "linear-gradient(currentColor, currentColor)"].join(", "),
|
|
244
|
+
backgroundSize: "40% 100%, 100% 100%",
|
|
245
|
+
backgroundRepeat: "no-repeat",
|
|
246
|
+
animationName: shimmerAnimation,
|
|
247
|
+
animationDuration: `calc((${motionTime} + ${waitTime}) * 1s)`,
|
|
248
|
+
animationIterationCount: "infinite",
|
|
249
|
+
animationTimingFunction: "linear",
|
|
250
|
+
animationFillMode: "forwards"
|
|
251
|
+
};
|
|
252
|
+
}
|
|
230
253
|
//#endregion
|
|
231
|
-
export { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getTitleStyles };
|
|
254
|
+
export { getCopyableStyles, getEditableStyles, getEllipsisStyles, getLinkStyles, getResetStyles, getShimmerStyles, getTitleStyles };
|
package/dist/upload/Upload.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ interface InternalUploadProps extends UploadProps$1, UploadEmitsProps {}
|
|
|
21
21
|
interface UploadEmitsProps {
|
|
22
22
|
onChange?: UploadEmits['change'];
|
|
23
23
|
onDrop?: UploadEmits['drop'];
|
|
24
|
+
onFocus?: UploadEmits['focus'];
|
|
24
25
|
'onUpdate:fileList'?: UploadEmits['update:fileList'];
|
|
25
26
|
}
|
|
26
27
|
declare const InternalUpload: import("vue").DefineSetupFnComponent<InternalUploadProps, UploadEmits<any>, SlotsType<UploadSlots<any>>, InternalUploadProps, import("vue").PublicProps>;
|
package/dist/upload/Upload.js
CHANGED
|
@@ -284,6 +284,9 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
284
284
|
delete rcUploadProps.className;
|
|
285
285
|
delete rcUploadProps.style;
|
|
286
286
|
if (!hasChildren || mergedDisabled.value) delete rcUploadProps.id;
|
|
287
|
+
const onFocus = (e) => {
|
|
288
|
+
emit("focus", e);
|
|
289
|
+
};
|
|
287
290
|
const mergedRootCls = clsx(`${prefixCls.value}-wrapper`, contextClassName.value, mergedClassNames.value.root, rootClass.value, cssVarCls.value, rootCls.value, hashId.value, {
|
|
288
291
|
[`${prefixCls.value}-rtl`]: direction.value === "rtl",
|
|
289
292
|
[`${prefixCls.value}-picture-card-wrapper`]: listType.value === "picture-card",
|
|
@@ -300,7 +303,8 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
300
303
|
return createVNode("span", mergeProps(restAttrs, {
|
|
301
304
|
"class": mergedRootCls,
|
|
302
305
|
"ref": wrapRef,
|
|
303
|
-
"style": mergedRootStyle
|
|
306
|
+
"style": mergedRootStyle,
|
|
307
|
+
"onFocusin": onFocus
|
|
304
308
|
}), [createVNode("div", {
|
|
305
309
|
"class": dragCls,
|
|
306
310
|
"style": mergedStyles.value.trigger,
|
|
@@ -322,12 +326,14 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
322
326
|
if (listType.value === "picture-card" || listType.value === "picture-circle") return createVNode("span", mergeProps(restAttrs, {
|
|
323
327
|
"class": mergedRootCls,
|
|
324
328
|
"ref": wrapRef,
|
|
325
|
-
"style": mergedRootStyle
|
|
329
|
+
"style": mergedRootStyle,
|
|
330
|
+
"onFocusin": onFocus
|
|
326
331
|
}), [renderUploadList(uploadButton, hasChildren)]);
|
|
327
332
|
return createVNode("span", mergeProps(restAttrs, {
|
|
328
333
|
"class": mergedRootCls,
|
|
329
334
|
"ref": wrapRef,
|
|
330
|
-
"style": mergedRootStyle
|
|
335
|
+
"style": mergedRootStyle,
|
|
336
|
+
"onFocusin": onFocus
|
|
331
337
|
}), [uploadButton, renderUploadList()]);
|
|
332
338
|
};
|
|
333
339
|
}, {
|
|
@@ -504,6 +510,7 @@ const InternalUpload = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
504
510
|
emits: [
|
|
505
511
|
"change",
|
|
506
512
|
"drop",
|
|
513
|
+
"focus",
|
|
507
514
|
"update:fileList"
|
|
508
515
|
],
|
|
509
516
|
name: "AUpload",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useComponentBaseConfig } from "../../config-provider/context.js";
|
|
2
2
|
import { getAttrStyleAndClass } from "../../_util/hooks/useMergeSemantic.js";
|
|
3
3
|
import InternalTooltip from "../../tooltip/index.js";
|
|
4
|
+
import { isRenderable } from "../../_util/is.js";
|
|
4
5
|
import progress_default from "../../progress/index.js";
|
|
5
6
|
import { Transition, computed, createVNode, defineComponent, isVNode, mergeProps, onMounted, shallowRef, watch } from "vue";
|
|
6
7
|
import { clsx } from "@v-c/util";
|
|
@@ -50,6 +51,7 @@ const ListItem = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
50
51
|
} catch {
|
|
51
52
|
linkProps = {};
|
|
52
53
|
}
|
|
54
|
+
const { onClick: linkOnClick, ...restLinkProps } = linkProps || {};
|
|
53
55
|
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;
|
|
54
56
|
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;
|
|
55
57
|
const downloadOrDelete = listType.value !== "picture-card" && listType.value !== "picture-circle" && createVNode("span", {
|
|
@@ -57,7 +59,7 @@ const ListItem = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
57
59
|
"class": clsx(`${prefixCls}-list-item-actions`, { picture: listType.value === "picture" })
|
|
58
60
|
}, [downloadIcon, removeIcon]);
|
|
59
61
|
const extraContent = typeof customExtra === "function" ? customExtra(file) : customExtra;
|
|
60
|
-
const extra = extraContent && createVNode("span", { "class": `${prefixCls}-list-item-extra` }, [extraContent]);
|
|
62
|
+
const extra = isRenderable(extraContent) && createVNode("span", { "class": `${prefixCls}-list-item-extra` }, [extraContent]);
|
|
61
63
|
const listItemNameClass = clsx(`${prefixCls}-list-item-name`);
|
|
62
64
|
const onPreviewKeyDown = (e) => {
|
|
63
65
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -77,9 +79,12 @@ const ListItem = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
77
79
|
"rel": "noopener noreferrer",
|
|
78
80
|
"class": listItemNameClass,
|
|
79
81
|
"title": file.name
|
|
80
|
-
},
|
|
82
|
+
}, restLinkProps, {
|
|
81
83
|
"href": file.url,
|
|
82
|
-
"onClick": (e) =>
|
|
84
|
+
"onClick": (e) => {
|
|
85
|
+
linkOnClick?.(e);
|
|
86
|
+
if (!e.defaultPrevented) onPreview(file, e);
|
|
87
|
+
}
|
|
83
88
|
}), [file.name, extra]) : createVNode("span", mergeProps({
|
|
84
89
|
"key": "view",
|
|
85
90
|
"class": listItemNameClass
|
|
@@ -130,6 +130,7 @@ interface UploadProps<T = any> {
|
|
|
130
130
|
interface UploadEmits<T = any> {
|
|
131
131
|
'change': (info: UploadChangeParam<UploadFile<T>>) => void;
|
|
132
132
|
'drop': (event: DragEvent) => void;
|
|
133
|
+
'focus': (event: FocusEvent) => void;
|
|
133
134
|
'update:fileList': (fileList: UploadFile<T>[]) => void;
|
|
134
135
|
}
|
|
135
136
|
interface UploadSlots<T = any> {
|