antdv-next 1.4.2 → 1.4.4
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/statusUtils.d.ts +1 -1
- package/dist/_util/wave/index.js +1 -1
- package/dist/antd-with-locales.esm.js +10362 -10320
- package/dist/antd-with-locales.js +78 -78
- package/dist/antd.css +1 -1
- package/dist/antd.esm.js +9259 -9217
- package/dist/antd.js +53 -53
- package/dist/border-beam/style/index.js +2 -2
- package/dist/checkbox/style/index.js +3 -3
- package/dist/collapse/style/index.js +1 -1
- package/dist/descriptions/hooks/useItems.d.ts +8 -8
- package/dist/form/Form.js +23 -6
- package/dist/form/FormItem/index.js +25 -2
- package/dist/form/context.d.ts +3 -1
- package/dist/form/hooks/useVariant.d.ts +1 -1
- package/dist/form/util.d.ts +7 -1
- package/dist/form/util.js +9 -1
- package/dist/grid/col.js +2 -2
- package/dist/image/hooks/usePreviewConfig.d.ts +2 -2
- package/dist/input/Search.js +19 -13
- package/dist/layout/style/sider.js +1 -1
- package/dist/package.js +1 -1
- package/dist/radio/style/index.js +1 -5
- package/dist/segmented/style/index.js +2 -7
- package/dist/splitter/SplitBar.js +1 -12
- package/dist/splitter/Splitter.js +6 -4
- package/dist/style/motion/index.d.ts +2 -2
- package/dist/style/motion/index.js +2 -2
- package/dist/style/motion/util.d.ts +8 -1
- package/dist/style/motion/util.js +13 -1
- package/dist/switch/style/index.js +2 -2
- package/dist/tabs/index.d.ts +33 -10
- package/dist/tabs/index.js +3 -2
- package/dist/tag/hooks/useColor.d.ts +1 -1
- package/dist/tag/index.js +1 -0
- package/dist/timeline/Timeline.d.ts +6 -6
- package/dist/timeline/Timeline.js +21 -4
- package/dist/timeline/useItems.d.ts +7 -2
- package/dist/timeline/useItems.js +14 -4
- package/dist/tour/panelRender.js +2 -8
- package/dist/tree/DirectoryTree.js +4 -4
- package/dist/tree/Tree.d.ts +3 -1
- package/dist/tree/Tree.js +10 -7
- package/dist/tree/style/index.js +4 -4
- package/dist/typography/style/mixins.js +3 -3
- package/package.json +3 -3
- package/web-tags.json +1420 -1416
- package/web-types.json +4335 -4321
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { genCssVar, genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
2
|
-
import {
|
|
2
|
+
import { genNoMotionRawStyle } from "../../style/motion/util.js";
|
|
3
3
|
import "../util.js";
|
|
4
4
|
import { Keyframes } from "@antdv-next/cssinjs";
|
|
5
5
|
//#region src/border-beam/style/index.ts
|
|
@@ -28,7 +28,7 @@ const genBorderBeamStyle = (token) => {
|
|
|
28
28
|
"@supports (offset-path: rect(0 auto auto 0 round 1px))": {
|
|
29
29
|
display: "block",
|
|
30
30
|
"&::before": {
|
|
31
|
-
...
|
|
31
|
+
...genNoMotionRawStyle(),
|
|
32
32
|
content: "\"\"",
|
|
33
33
|
position: "absolute",
|
|
34
34
|
top: 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { genFocusOutline, resetComponent } from "../../style/index.js";
|
|
2
2
|
import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
3
3
|
import { mergeToken } from "../../theme/internal.js";
|
|
4
|
-
import { genNoMotionStyle } from "../../style/motion/util.js";
|
|
4
|
+
import { genNoMotionRawStyle, genNoMotionStyle } from "../../style/motion/util.js";
|
|
5
5
|
import { unit } from "@antdv-next/cssinjs";
|
|
6
6
|
//#region src/checkbox/style/index.ts
|
|
7
7
|
const genCheckboxStyle = (token) => {
|
|
@@ -68,7 +68,7 @@ const genCheckboxStyle = (token) => {
|
|
|
68
68
|
opacity: 0,
|
|
69
69
|
content: "\"\"",
|
|
70
70
|
transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`,
|
|
71
|
-
...
|
|
71
|
+
...genNoMotionRawStyle()
|
|
72
72
|
},
|
|
73
73
|
[`${checkboxCls}-input`]: {
|
|
74
74
|
position: "absolute",
|
|
@@ -102,7 +102,7 @@ const genCheckboxStyle = (token) => {
|
|
|
102
102
|
opacity: 1,
|
|
103
103
|
transform: "rotate(45deg) scale(1) translate(-50%,-50%)",
|
|
104
104
|
transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`,
|
|
105
|
-
...
|
|
105
|
+
...genNoMotionRawStyle()
|
|
106
106
|
},
|
|
107
107
|
[hoverMediaQuery]: { [`&:not(${checkboxCls}-disabled):hover`]: {
|
|
108
108
|
backgroundColor: token.colorPrimaryHover,
|
|
@@ -114,7 +114,7 @@ const genBorderlessStyle = (token) => {
|
|
|
114
114
|
return { [`${componentCls}-borderless`]: {
|
|
115
115
|
backgroundColor: headerBg,
|
|
116
116
|
border: 0,
|
|
117
|
-
[`> ${componentCls}-item`]: { borderBottom:
|
|
117
|
+
[`> ${componentCls}-item`]: { borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${colorBorder}` },
|
|
118
118
|
[`
|
|
119
119
|
> ${componentCls}-item:last-child,
|
|
120
120
|
> ${componentCls}-item:last-child ${componentCls}-header
|
|
@@ -9,22 +9,22 @@ declare function useItems(screens: Ref<ScreenMap>, items: Ref<DescriptionsItemTy
|
|
|
9
9
|
filled: boolean;
|
|
10
10
|
_$index: number;
|
|
11
11
|
key?: import("@v-c/util/dist/type").Key;
|
|
12
|
-
classes?: CellSemanticClassNames | undefined;
|
|
13
|
-
styles?: CellSemanticStyles | undefined;
|
|
14
|
-
style?: import("vue").CSSProperties | undefined;
|
|
15
|
-
rootClass?: string | undefined;
|
|
16
12
|
label?: VueNode;
|
|
13
|
+
rootClass?: string | undefined;
|
|
14
|
+
style?: import("vue").CSSProperties | undefined;
|
|
15
|
+
styles?: CellSemanticStyles | undefined;
|
|
17
16
|
class?: string | undefined;
|
|
17
|
+
classes?: CellSemanticClassNames | undefined;
|
|
18
18
|
content?: VueNode;
|
|
19
19
|
} | {
|
|
20
20
|
span: number | undefined;
|
|
21
21
|
key?: import("@v-c/util/dist/type").Key;
|
|
22
|
-
classes?: CellSemanticClassNames | undefined;
|
|
23
|
-
styles?: CellSemanticStyles | undefined;
|
|
24
|
-
style?: import("vue").CSSProperties | undefined;
|
|
25
|
-
rootClass?: string | undefined;
|
|
26
22
|
label?: VueNode;
|
|
23
|
+
rootClass?: string | undefined;
|
|
24
|
+
style?: import("vue").CSSProperties | undefined;
|
|
25
|
+
styles?: CellSemanticStyles | undefined;
|
|
27
26
|
class?: string | undefined;
|
|
27
|
+
classes?: CellSemanticClassNames | undefined;
|
|
28
28
|
content?: VueNode;
|
|
29
29
|
_$index: number;
|
|
30
30
|
})[]>;
|
package/dist/form/Form.js
CHANGED
|
@@ -8,7 +8,7 @@ import useCSSVarCls from "../config-provider/hooks/useCSSVarCls.js";
|
|
|
8
8
|
import { useDisabledContext, useDisabledContextProvider } from "../config-provider/DisabledContext.js";
|
|
9
9
|
import useLocale from "../locale/useLocale.js";
|
|
10
10
|
import { NoFormStyle, useFormContextProvider, useVariantContextProvider } from "./context.js";
|
|
11
|
-
import { getFieldId, toArray } from "./util.js";
|
|
11
|
+
import { getFieldId, toArray, toNamePathStr } from "./util.js";
|
|
12
12
|
import { FormHookRegistryKey, FormInstanceContextKey } from "./hooks/useForm.js";
|
|
13
13
|
import style_default from "./style/index.js";
|
|
14
14
|
import { allPromiseFinish } from "./utils/asyncUtil.js";
|
|
@@ -19,6 +19,7 @@ import { computed, createVNode, defineComponent, getCurrentInstance, inject, mer
|
|
|
19
19
|
import { clsx, get, set } from "@v-c/util";
|
|
20
20
|
import { pick } from "es-toolkit";
|
|
21
21
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
22
|
+
import { getDOM } from "@v-c/util/dist/Dom/findDOMNode";
|
|
22
23
|
//#region src/form/Form.tsx
|
|
23
24
|
const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, emit, attrs }) => {
|
|
24
25
|
const contextDisabled = useDisabledContext();
|
|
@@ -81,6 +82,16 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
|
|
|
81
82
|
const removeField = (eventKey) => {
|
|
82
83
|
delete fields.value[eventKey];
|
|
83
84
|
};
|
|
85
|
+
const items = /* @__PURE__ */ new Map();
|
|
86
|
+
const addItem = (namePathStr, instance) => {
|
|
87
|
+
items.set(namePathStr, instance);
|
|
88
|
+
};
|
|
89
|
+
const removeItem = (namePathStr) => {
|
|
90
|
+
items.delete(namePathStr);
|
|
91
|
+
};
|
|
92
|
+
const getFieldInstance = (name) => {
|
|
93
|
+
return items.get(toNamePathStr(getNamePath(name)));
|
|
94
|
+
};
|
|
84
95
|
const getFieldsByNameList = (namePathList, partialMatch = false) => {
|
|
85
96
|
const mergedNamePathList = namePathList?.length ? namePathList : void 0;
|
|
86
97
|
const fieldList = Object.values(fields.value);
|
|
@@ -201,6 +212,8 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
|
|
|
201
212
|
feedbackIcons: feedbackIcons.value,
|
|
202
213
|
addField,
|
|
203
214
|
removeField,
|
|
215
|
+
addItem,
|
|
216
|
+
removeItem,
|
|
204
217
|
onValidate,
|
|
205
218
|
triggerValuesChange,
|
|
206
219
|
triggerFieldsChange,
|
|
@@ -327,16 +340,20 @@ const InternalForm = /* @__PURE__ */ defineComponent((props, { slots, expose, em
|
|
|
327
340
|
scrollToField(getNamePath(name), options);
|
|
328
341
|
},
|
|
329
342
|
focusField: (name) => {
|
|
343
|
+
const instance = getFieldInstance(name);
|
|
344
|
+
if (typeof instance?.focus === "function") {
|
|
345
|
+
try {
|
|
346
|
+
instance.focus();
|
|
347
|
+
} finally {}
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
330
350
|
const targetId = getFieldId(getNamePath(name), props.name);
|
|
331
|
-
const node = targetId ? document.getElementById(targetId) : null;
|
|
351
|
+
const node = getDOM(instance) ?? (targetId ? document.getElementById(targetId) : null);
|
|
332
352
|
if (node) try {
|
|
333
353
|
node.focus?.();
|
|
334
354
|
} finally {}
|
|
335
355
|
},
|
|
336
|
-
getFieldInstance
|
|
337
|
-
const targetId = getFieldId(getNamePath(name), props.name);
|
|
338
|
-
if (targetId) return fields.value?.[targetId];
|
|
339
|
-
}
|
|
356
|
+
getFieldInstance
|
|
340
357
|
};
|
|
341
358
|
expose(formInstance);
|
|
342
359
|
provide(FormInstanceContextKey, formInstance);
|
|
@@ -3,7 +3,7 @@ import { getSlotPropsFnRun } from "../../_util/tools.js";
|
|
|
3
3
|
import useCSSVarCls from "../../config-provider/hooks/useCSSVarCls.js";
|
|
4
4
|
import { checkRenderNode } from "../../_util/vueNode.js";
|
|
5
5
|
import { useFormContext, useFormItemProvider, useNoStyleItemContext } from "../context.js";
|
|
6
|
-
import { getFieldId, initialValueFormat, toArray } from "../util.js";
|
|
6
|
+
import { getFieldId, initialValueFormat, toArray, toNamePathStr } from "../util.js";
|
|
7
7
|
import style_default from "../style/index.js";
|
|
8
8
|
import { getNamePath, getValue, setValue } from "../utils/valueUtil.js";
|
|
9
9
|
import { validateRules } from "../utils/validateUtil.js";
|
|
@@ -250,6 +250,24 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
250
250
|
});
|
|
251
251
|
const rootClassName = computed(() => clsx(cssVarCls.value, rootCls.value, hashId.value, props.rootClass));
|
|
252
252
|
const eventKey = computed(() => `form-item-${fieldId.value || namePath.value.join("-") || Math.random().toString(36).slice(2)}`);
|
|
253
|
+
let itemInstanceKey;
|
|
254
|
+
let itemInstance = null;
|
|
255
|
+
const setItemInstance = (instance) => {
|
|
256
|
+
itemInstance = instance;
|
|
257
|
+
if (!hasName.value) return;
|
|
258
|
+
const nextKey = toNamePathStr(namePath.value);
|
|
259
|
+
if (itemInstanceKey && itemInstanceKey !== nextKey) formContext.value?.removeItem?.(itemInstanceKey);
|
|
260
|
+
itemInstanceKey = nextKey;
|
|
261
|
+
if (instance) formContext.value?.addItem?.(nextKey, instance);
|
|
262
|
+
else formContext.value?.removeItem?.(nextKey);
|
|
263
|
+
};
|
|
264
|
+
watch([namePath, hasName], () => {
|
|
265
|
+
if (itemInstanceKey) {
|
|
266
|
+
formContext.value?.removeItem?.(itemInstanceKey);
|
|
267
|
+
itemInstanceKey = void 0;
|
|
268
|
+
}
|
|
269
|
+
if (itemInstance) setItemInstance(itemInstance);
|
|
270
|
+
}, { flush: "post" });
|
|
253
271
|
watch(hasName, (val, _, onCleanup) => {
|
|
254
272
|
if (val && formContext.value?.addField) {
|
|
255
273
|
formContext.value.addField(eventKey.value, {
|
|
@@ -284,6 +302,10 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
284
302
|
destroy: true
|
|
285
303
|
}, meta.value.name);
|
|
286
304
|
formContext.value?.removeField?.(eventKey.value);
|
|
305
|
+
if (itemInstanceKey) {
|
|
306
|
+
formContext.value?.removeItem?.(itemInstanceKey);
|
|
307
|
+
itemInstanceKey = void 0;
|
|
308
|
+
}
|
|
287
309
|
});
|
|
288
310
|
useFormItemProvider({
|
|
289
311
|
fieldId,
|
|
@@ -318,7 +340,8 @@ const InternalFormItem = /* @__PURE__ */ defineComponent((props, { slots, attrs
|
|
|
318
340
|
if (typeof fn === "function") fn(...args);
|
|
319
341
|
});
|
|
320
342
|
else _onFocus?.(...args);
|
|
321
|
-
}
|
|
343
|
+
},
|
|
344
|
+
ref: setItemInstance
|
|
322
345
|
});
|
|
323
346
|
}
|
|
324
347
|
if (props.noStyle && !props.hidden) return createVNode(StatusProvider, {
|
package/dist/form/context.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ interface FormContextProps {
|
|
|
45
45
|
clearOnDestroy?: boolean;
|
|
46
46
|
addField?: (eventKey: string, field: FormFieldRegister) => void;
|
|
47
47
|
removeField?: (eventKey: string) => void;
|
|
48
|
+
addItem?: (namePathStr: string, instance: any) => void;
|
|
49
|
+
removeItem?: (namePathStr: string) => void;
|
|
48
50
|
onValidate?: (name: InternalNamePath, status: boolean, errors: any[] | null) => void;
|
|
49
51
|
triggerValuesChange?: (namePath: InternalNamePath, value: any) => void;
|
|
50
52
|
triggerFieldsChange?: (namePathList?: InternalNamePath[]) => void;
|
|
@@ -69,7 +71,7 @@ declare function useFormItemPrefixContext(): Ref<{
|
|
|
69
71
|
prefixCls: string;
|
|
70
72
|
}>;
|
|
71
73
|
declare function useVariantContextProvider(variant: Ref<Variant | undefined>): void;
|
|
72
|
-
declare function useVariantContext(): Ref<"
|
|
74
|
+
declare function useVariantContext(): Ref<"filled" | "outlined" | "borderless" | "underlined" | undefined, "filled" | "outlined" | "borderless" | "underlined" | undefined>;
|
|
73
75
|
interface FormItemStatusContextProps {
|
|
74
76
|
isFormItemInput?: boolean;
|
|
75
77
|
status?: ValidateStatus;
|
|
@@ -4,7 +4,7 @@ import { Ref } from "vue";
|
|
|
4
4
|
|
|
5
5
|
//#region src/form/hooks/useVariant.d.ts
|
|
6
6
|
type VariantComponents = keyof Pick<ConfigProviderProps, 'input' | 'inputNumber' | 'textArea' | 'mentions' | 'select' | 'cascader' | 'treeSelect' | 'datePicker' | 'timePicker' | 'rangePicker' | 'card'>;
|
|
7
|
-
declare function useVariant(component: VariantComponents, variant?: Ref<Variant | undefined>, legacyBordered?: Ref<boolean | undefined> | boolean): readonly [import("vue").ComputedRef<"
|
|
7
|
+
declare function useVariant(component: VariantComponents, variant?: Ref<Variant | undefined>, legacyBordered?: Ref<boolean | undefined> | boolean): readonly [import("vue").ComputedRef<"filled" | "outlined" | "borderless" | "underlined">, import("vue").ComputedRef<boolean>];
|
|
8
8
|
declare const useVariants: typeof useVariant;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { useVariant as default, useVariants };
|
package/dist/form/util.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ import { ValidateStatus } from "./FormItem/index.js";
|
|
|
3
3
|
|
|
4
4
|
//#region src/form/util.d.ts
|
|
5
5
|
declare function toArray<T>(candidate?: T | T[] | false): T[];
|
|
6
|
+
/**
|
|
7
|
+
* Key used to track the rendered control instance of a Form.Item.
|
|
8
|
+
* Unlike `getFieldId`, this is not prefixed with the form name, so it stays
|
|
9
|
+
* stable no matter whether the Form declares a `name`.
|
|
10
|
+
*/
|
|
11
|
+
declare function toNamePathStr(namePath: InternalNamePath): string;
|
|
6
12
|
declare function getFieldId(namePath: InternalNamePath, formName?: string): string | undefined;
|
|
7
13
|
/**
|
|
8
14
|
* Get merged status by meta or passed `validateStatus`.
|
|
@@ -10,4 +16,4 @@ declare function getFieldId(namePath: InternalNamePath, formName?: string): stri
|
|
|
10
16
|
declare function getStatus<DefaultValue>(errors: any[], warnings: any[], meta: Meta, defaultValidateStatus: ValidateStatus | DefaultValue, hasFeedback?: boolean, validateStatus?: ValidateStatus): ValidateStatus | DefaultValue;
|
|
11
17
|
declare function initialValueFormat(value: any): any;
|
|
12
18
|
//#endregion
|
|
13
|
-
export { getFieldId, getStatus, initialValueFormat, toArray };
|
|
19
|
+
export { getFieldId, getStatus, initialValueFormat, toArray, toNamePathStr };
|
package/dist/form/util.js
CHANGED
|
@@ -10,6 +10,14 @@ function toArray(candidate) {
|
|
|
10
10
|
if (candidate === void 0 || candidate === false) return [];
|
|
11
11
|
return Array.isArray(candidate) ? candidate : [candidate];
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Key used to track the rendered control instance of a Form.Item.
|
|
15
|
+
* Unlike `getFieldId`, this is not prefixed with the form name, so it stays
|
|
16
|
+
* stable no matter whether the Form declares a `name`.
|
|
17
|
+
*/
|
|
18
|
+
function toNamePathStr(namePath) {
|
|
19
|
+
return namePath.join("_");
|
|
20
|
+
}
|
|
13
21
|
function getFieldId(namePath, formName) {
|
|
14
22
|
if (!namePath.length) return;
|
|
15
23
|
const mergedId = namePath.join("_");
|
|
@@ -34,4 +42,4 @@ function initialValueFormat(value) {
|
|
|
34
42
|
return value;
|
|
35
43
|
}
|
|
36
44
|
//#endregion
|
|
37
|
-
export { getFieldId, getStatus, initialValueFormat, toArray };
|
|
45
|
+
export { getFieldId, getStatus, initialValueFormat, toArray, toNamePathStr };
|
package/dist/grid/col.js
CHANGED
|
@@ -40,7 +40,7 @@ const Col = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
40
40
|
[`${prefixCls.value}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,
|
|
41
41
|
[`${prefixCls.value}-rtl`]: configCtx.value.direction === "rtl"
|
|
42
42
|
};
|
|
43
|
-
if (sizeProps.flex) {
|
|
43
|
+
if (sizeProps.flex || sizeProps.flex === 0) {
|
|
44
44
|
sizeClassObj[`${prefixCls.value}-${size}-flex`] = true;
|
|
45
45
|
sizeStyle[varName(`${size}-flex`)] = parseFlex(sizeProps.flex);
|
|
46
46
|
}
|
|
@@ -58,7 +58,7 @@ const Col = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
58
58
|
mergedStyle.paddingLeft = `${horizontalGutter}px`;
|
|
59
59
|
mergedStyle.paddingRight = `${horizontalGutter}px`;
|
|
60
60
|
}
|
|
61
|
-
if (flex) {
|
|
61
|
+
if (flex || flex === 0) {
|
|
62
62
|
mergedStyle.flex = parseFlex(flex);
|
|
63
63
|
if (wrap?.value === false && !mergedStyle.minWidth) mergedStyle.minWidth = 0;
|
|
64
64
|
}
|
|
@@ -37,12 +37,12 @@ declare function usePreviewConfig<T extends PreviewConfig | GroupPreviewConfig>(
|
|
|
37
37
|
image: import("@v-c/image").ImgInfo;
|
|
38
38
|
}) => import("@v-c/util").VueNode;
|
|
39
39
|
readonly onChange?: (current: number, prevCurrent: number) => void;
|
|
40
|
+
readonly zIndex?: number;
|
|
41
|
+
readonly closeIcon?: import("@v-c/util").VueNode | boolean | null;
|
|
40
42
|
readonly focusTrap?: boolean;
|
|
41
43
|
readonly afterOpenChange?: (open: boolean) => void;
|
|
42
44
|
readonly maskClosable?: boolean;
|
|
43
|
-
readonly zIndex?: number;
|
|
44
45
|
readonly getContainer?: import("@v-c/portal/dist/Portal.js").PortalProps["getContainer"];
|
|
45
|
-
readonly closeIcon?: import("@v-c/util").VueNode | boolean | null;
|
|
46
46
|
readonly motionName?: string;
|
|
47
47
|
readonly src?: string;
|
|
48
48
|
readonly alt?: string;
|
package/dist/input/Search.js
CHANGED
|
@@ -3,6 +3,7 @@ import { useSize } from "../config-provider/hooks/useSize.js";
|
|
|
3
3
|
import { useCompactItemContext } from "../space/Compact.js";
|
|
4
4
|
import { getAttrStyleAndClass, useMergeSemantic, useToArr, useToProps } from "../_util/hooks/useMergeSemantic.js";
|
|
5
5
|
import { getSlotPropsFnRun, toPropsRefs } from "../_util/tools.js";
|
|
6
|
+
import { useDisabledContext } from "../config-provider/DisabledContext.js";
|
|
6
7
|
import button_default from "../button/index.js";
|
|
7
8
|
import { SpaceCompact } from "../space/index.js";
|
|
8
9
|
import InternalInput from "./Input.js";
|
|
@@ -32,6 +33,8 @@ const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
32
33
|
const { prefixCls, direction, class: contextClassName, style: contextStyle, classes: contextClassNames, styles: contextStyles, getPrefixCls } = useComponentBaseConfig("inputSearch", props, void 0, "input-search");
|
|
33
34
|
const inputPrefixCls = computed(() => getPrefixCls("input", props.inputPrefixCls));
|
|
34
35
|
const { classes, styles, size: customizeSize, disabled: customDisabled, variant } = toPropsRefs(props, "classes", "styles", "size", "disabled", "variant");
|
|
36
|
+
const contextDisabled = useDisabledContext();
|
|
37
|
+
const mergedDisabled = computed(() => customDisabled.value ?? contextDisabled.value);
|
|
35
38
|
const [hashId, cssVarCls] = search_default(prefixCls);
|
|
36
39
|
const { compactSize } = useCompactItemContext(prefixCls, direction);
|
|
37
40
|
const mergedSize = useSize((ctx) => customizeSize.value ?? compactSize.value ?? ctx);
|
|
@@ -101,19 +104,22 @@ const InternalSearch = /* @__PURE__ */ defineComponent((props, { slots, attrs, e
|
|
|
101
104
|
const isButtonVNode = isVNode(enterButtonNode);
|
|
102
105
|
const isAntdButton = isButtonVNode && Boolean(enterButtonNode.type?.__ANT_BUTTON);
|
|
103
106
|
const isNativeButton = isButtonVNode && enterButtonNode.type === "button";
|
|
104
|
-
if (isAntdButton || isNativeButton)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
if (isAntdButton || isNativeButton) {
|
|
108
|
+
const enterButtonProps = enterButtonNode?.props ?? {};
|
|
109
|
+
buttonNode = cloneVNode(enterButtonNode, {
|
|
110
|
+
disabled: mergedDisabled.value || enterButtonProps.disabled || !isAntdButton && props.loading,
|
|
111
|
+
onMousedown: onMouseDown,
|
|
112
|
+
onClick: (e) => {
|
|
113
|
+
enterButtonProps.onClick?.(e);
|
|
114
|
+
onSearchClick(e);
|
|
115
|
+
},
|
|
116
|
+
class: clsx(enterButtonProps.class, btnClassName),
|
|
117
|
+
...isAntdButton ? {
|
|
118
|
+
loading: props.loading || enterButtonProps.loading,
|
|
119
|
+
size: mergedSize.value
|
|
120
|
+
} : {}
|
|
121
|
+
});
|
|
122
|
+
} else buttonNode = createVNode(button_default, {
|
|
117
123
|
"classes": mergedClassNames.value.button,
|
|
118
124
|
"styles": mergedStyles.value.button,
|
|
119
125
|
"class": btnClassName,
|
|
@@ -68,7 +68,7 @@ const genSiderStyle = (token) => {
|
|
|
68
68
|
[`${componentCls}-zero-width-trigger`]: {
|
|
69
69
|
color: lightTriggerColor,
|
|
70
70
|
background: lightTriggerBg,
|
|
71
|
-
border:
|
|
71
|
+
border: `${unit(token.lineWidth)} ${token.lineType} ${bodyBg}`,
|
|
72
72
|
borderInlineStart: 0
|
|
73
73
|
}
|
|
74
74
|
}
|
package/dist/package.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { genFocusOutline, resetComponent } from "../../style/index.js";
|
|
2
2
|
import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
3
3
|
import { mergeToken } from "../../theme/internal.js";
|
|
4
|
-
import { genNoMotionStyle } from "../../style/motion/util.js";
|
|
5
4
|
import { unit } from "@antdv-next/cssinjs";
|
|
6
5
|
//#region src/radio/style/index.ts
|
|
7
6
|
const getGroupRadioStyle = (token) => {
|
|
@@ -90,7 +89,6 @@ const getRadioBasicStyle = (token) => {
|
|
|
90
89
|
border: `${unit(lineWidth)} ${lineType} ${colorBorder}`,
|
|
91
90
|
borderRadius: "50%",
|
|
92
91
|
transition: `all ${motionDurationMid}`,
|
|
93
|
-
...genNoMotionStyle(),
|
|
94
92
|
"&:after": {
|
|
95
93
|
content: "\"\"",
|
|
96
94
|
position: "absolute",
|
|
@@ -103,8 +101,7 @@ const getRadioBasicStyle = (token) => {
|
|
|
103
101
|
borderRadius: "50%",
|
|
104
102
|
transformOrigin: "50% 50%",
|
|
105
103
|
opacity: 0,
|
|
106
|
-
transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}
|
|
107
|
-
...genNoMotionStyle()
|
|
104
|
+
transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`
|
|
108
105
|
},
|
|
109
106
|
[`${componentCls}-input`]: {
|
|
110
107
|
position: "absolute",
|
|
@@ -170,7 +167,6 @@ const getRadioButtonStyle = (token) => {
|
|
|
170
167
|
`background-color`,
|
|
171
168
|
`box-shadow`
|
|
172
169
|
].map((prop) => `${prop} ${motionDurationMid}`).join(","),
|
|
173
|
-
...genNoMotionStyle(),
|
|
174
170
|
a: { color: buttonColor },
|
|
175
171
|
[`> ${componentCls}-button`]: {
|
|
176
172
|
position: "absolute",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { genFocusOutline, genFocusStyle, resetComponent, textEllipsis } from "../../style/index.js";
|
|
2
2
|
import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
3
3
|
import { mergeToken } from "../../theme/internal.js";
|
|
4
|
-
import { genNoMotionStyle } from "../../style/motion/util.js";
|
|
5
4
|
import { unit } from "@antdv-next/cssinjs";
|
|
6
5
|
//#region src/segmented/style/index.ts
|
|
7
6
|
function getItemDisabledStyle(cls, token) {
|
|
@@ -33,7 +32,6 @@ const genSegmentedStyle = (token) => {
|
|
|
33
32
|
background: token.trackBg,
|
|
34
33
|
borderRadius: token.borderRadius,
|
|
35
34
|
transition: `all ${motionDurationMid}`,
|
|
36
|
-
...genNoMotionStyle(),
|
|
37
35
|
...genFocusStyle(token),
|
|
38
36
|
[`${componentCls}-group`]: {
|
|
39
37
|
position: "relative",
|
|
@@ -62,7 +60,6 @@ const genSegmentedStyle = (token) => {
|
|
|
62
60
|
textAlign: "center",
|
|
63
61
|
cursor: "pointer",
|
|
64
62
|
transition: `color ${motionDurationMid}`,
|
|
65
|
-
...genNoMotionStyle(),
|
|
66
63
|
borderRadius: token.borderRadiusSM,
|
|
67
64
|
transform: "translateZ(0)",
|
|
68
65
|
"&-selected": {
|
|
@@ -81,8 +78,7 @@ const genSegmentedStyle = (token) => {
|
|
|
81
78
|
borderRadius: "inherit",
|
|
82
79
|
opacity: 0,
|
|
83
80
|
pointerEvents: "none",
|
|
84
|
-
transition: ["opacity", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", ")
|
|
85
|
-
...genNoMotionStyle()
|
|
81
|
+
transition: ["opacity", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", ")
|
|
86
82
|
},
|
|
87
83
|
[`&:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)`]: {
|
|
88
84
|
"&:hover, &:active": { color: token.itemHoverColor },
|
|
@@ -146,8 +142,7 @@ const genSegmentedStyle = (token) => {
|
|
|
146
142
|
...getItemDisabledStyle(`${componentCls}-item-disabled`, token),
|
|
147
143
|
[`${componentCls}-thumb-motion-appear`]: {
|
|
148
144
|
willChange: "transform, width",
|
|
149
|
-
transition: [`transform`, `width`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(", ")
|
|
150
|
-
...genNoMotionStyle()
|
|
145
|
+
transition: [`transform`, `width`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(", ")
|
|
151
146
|
},
|
|
152
147
|
[`&${componentCls}-shape-round`]: {
|
|
153
148
|
borderRadius: 9999,
|
|
@@ -215,18 +215,7 @@ const SplitBar = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
215
215
|
type: Boolean,
|
|
216
216
|
required: true
|
|
217
217
|
},
|
|
218
|
-
draggerIcon: {
|
|
219
|
-
type: [
|
|
220
|
-
Function,
|
|
221
|
-
String,
|
|
222
|
-
Number,
|
|
223
|
-
null,
|
|
224
|
-
Object,
|
|
225
|
-
Boolean
|
|
226
|
-
],
|
|
227
|
-
required: false,
|
|
228
|
-
default: void 0
|
|
229
|
-
},
|
|
218
|
+
draggerIcon: { required: false },
|
|
230
219
|
collapsibleIcon: {
|
|
231
220
|
type: Object,
|
|
232
221
|
required: false
|
|
@@ -112,10 +112,12 @@ const Splitter = /* @__PURE__ */ defineComponent((props, { slots, attrs }) => {
|
|
|
112
112
|
let splitBar = null;
|
|
113
113
|
const resizableInfo = resizableInfos.value[idx];
|
|
114
114
|
if (resizableInfo) {
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
const
|
|
115
|
+
const prevStackSize = Number.isFinite(stackSizes.value[idx - 1]) ? stackSizes.value[idx - 1] : 0;
|
|
116
|
+
const nextStackSize = Number.isFinite(stackSizes.value[idx + 1]) ? stackSizes.value[idx + 1] : 1;
|
|
117
|
+
const ariaMinStart = prevStackSize + itemPtgMinSizes.value[idx];
|
|
118
|
+
const ariaMinEnd = nextStackSize - itemPtgMaxSizes.value[idx + 1];
|
|
119
|
+
const ariaMaxStart = prevStackSize + itemPtgMaxSizes.value[idx];
|
|
120
|
+
const ariaMaxEnd = nextStackSize - itemPtgMinSizes.value[idx + 1];
|
|
119
121
|
splitBar = createVNode(SplitBar, {
|
|
120
122
|
"lazy": lazy,
|
|
121
123
|
"index": idx,
|
|
@@ -2,6 +2,6 @@ import genCollapseMotion from "./collapse.js";
|
|
|
2
2
|
import { fadeIn, fadeOut, initFadeMotion } from "./fade.js";
|
|
3
3
|
import { initMoveMotion, moveDownIn, moveDownOut, moveLeftIn, moveLeftOut, moveRightIn, moveRightOut, moveUpIn, moveUpOut } from "./move.js";
|
|
4
4
|
import { initSlideMotion, slideDownIn, slideDownOut, slideLeftIn, slideLeftOut, slideRightIn, slideRightOut, slideUpIn, slideUpOut } from "./slide.js";
|
|
5
|
-
import { genNoMotionStyle } from "./util.js";
|
|
5
|
+
import { genNoMotionRawStyle, genNoMotionStyle } from "./util.js";
|
|
6
6
|
import { initZoomMotion, zoomBigIn, zoomBigOut, zoomDownIn, zoomDownOut, zoomIn, zoomLeftIn, zoomLeftOut, zoomOut, zoomRightIn, zoomRightOut, zoomUpIn, zoomUpOut } from "./zoom.js";
|
|
7
|
-
export { fadeIn, fadeOut, genCollapseMotion, genNoMotionStyle, initFadeMotion, initMoveMotion, initSlideMotion, initZoomMotion, moveDownIn, moveDownOut, moveLeftIn, moveLeftOut, moveRightIn, moveRightOut, moveUpIn, moveUpOut, slideDownIn, slideDownOut, slideLeftIn, slideLeftOut, slideRightIn, slideRightOut, slideUpIn, slideUpOut, zoomBigIn, zoomBigOut, zoomDownIn, zoomDownOut, zoomIn, zoomLeftIn, zoomLeftOut, zoomOut, zoomRightIn, zoomRightOut, zoomUpIn, zoomUpOut };
|
|
7
|
+
export { fadeIn, fadeOut, genCollapseMotion, genNoMotionRawStyle, genNoMotionStyle, initFadeMotion, initMoveMotion, initSlideMotion, initZoomMotion, moveDownIn, moveDownOut, moveLeftIn, moveLeftOut, moveRightIn, moveRightOut, moveUpIn, moveUpOut, slideDownIn, slideDownOut, slideLeftIn, slideLeftOut, slideRightIn, slideRightOut, slideUpIn, slideUpOut, zoomBigIn, zoomBigOut, zoomDownIn, zoomDownOut, zoomIn, zoomLeftIn, zoomLeftOut, zoomOut, zoomRightIn, zoomRightOut, zoomUpIn, zoomUpOut };
|
|
@@ -2,6 +2,6 @@ import genCollapseMotion from "./collapse.js";
|
|
|
2
2
|
import { fadeIn, fadeOut, initFadeMotion } from "./fade.js";
|
|
3
3
|
import { initMoveMotion, moveDownIn, moveDownOut, moveLeftIn, moveLeftOut, moveRightIn, moveRightOut, moveUpIn, moveUpOut } from "./move.js";
|
|
4
4
|
import { initSlideMotion, slideDownIn, slideDownOut, slideLeftIn, slideLeftOut, slideRightIn, slideRightOut, slideUpIn, slideUpOut } from "./slide.js";
|
|
5
|
-
import { genNoMotionStyle } from "./util.js";
|
|
5
|
+
import { genNoMotionRawStyle, genNoMotionStyle } from "./util.js";
|
|
6
6
|
import { initZoomMotion, zoomBigIn, zoomBigOut, zoomDownIn, zoomDownOut, zoomIn, zoomLeftIn, zoomLeftOut, zoomOut, zoomRightIn, zoomRightOut, zoomUpIn, zoomUpOut } from "./zoom.js";
|
|
7
|
-
export { fadeIn, fadeOut, genCollapseMotion, genNoMotionStyle, initFadeMotion, initMoveMotion, initSlideMotion, initZoomMotion, moveDownIn, moveDownOut, moveLeftIn, moveLeftOut, moveRightIn, moveRightOut, moveUpIn, moveUpOut, slideDownIn, slideDownOut, slideLeftIn, slideLeftOut, slideRightIn, slideRightOut, slideUpIn, slideUpOut, zoomBigIn, zoomBigOut, zoomDownIn, zoomDownOut, zoomIn, zoomLeftIn, zoomLeftOut, zoomOut, zoomRightIn, zoomRightOut, zoomUpIn, zoomUpOut };
|
|
7
|
+
export { fadeIn, fadeOut, genCollapseMotion, genNoMotionRawStyle, genNoMotionStyle, initFadeMotion, initMoveMotion, initSlideMotion, initZoomMotion, moveDownIn, moveDownOut, moveLeftIn, moveLeftOut, moveRightIn, moveRightOut, moveUpIn, moveUpOut, slideDownIn, slideDownOut, slideLeftIn, slideLeftOut, slideRightIn, slideRightOut, slideUpIn, slideUpOut, zoomBigIn, zoomBigOut, zoomDownIn, zoomDownOut, zoomIn, zoomLeftIn, zoomLeftOut, zoomOut, zoomRightIn, zoomRightOut, zoomUpIn, zoomUpOut };
|
|
@@ -2,5 +2,12 @@ import { CSSObject } from "@antdv-next/cssinjs";
|
|
|
2
2
|
|
|
3
3
|
//#region src/style/motion/util.d.ts
|
|
4
4
|
declare function genNoMotionStyle(): CSSObject;
|
|
5
|
+
/**
|
|
6
|
+
* Flat variant for call sites already nested inside a pseudo-element
|
|
7
|
+
* selector, where the `&::before` expansion of `genNoMotionStyle` would
|
|
8
|
+
* emit invalid selectors like `.foo::before::before` (rejected by
|
|
9
|
+
* lightningcss during the docs build).
|
|
10
|
+
*/
|
|
11
|
+
declare function genNoMotionRawStyle(): CSSObject;
|
|
5
12
|
//#endregion
|
|
6
|
-
export { genNoMotionStyle };
|
|
13
|
+
export { genNoMotionRawStyle, genNoMotionStyle };
|
|
@@ -5,5 +5,17 @@ function genNoMotionStyle() {
|
|
|
5
5
|
animation: "none"
|
|
6
6
|
} } };
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Flat variant for call sites already nested inside a pseudo-element
|
|
10
|
+
* selector, where the `&::before` expansion of `genNoMotionStyle` would
|
|
11
|
+
* emit invalid selectors like `.foo::before::before` (rejected by
|
|
12
|
+
* lightningcss during the docs build).
|
|
13
|
+
*/
|
|
14
|
+
function genNoMotionRawStyle() {
|
|
15
|
+
return { "@media (prefers-reduced-motion: reduce)": {
|
|
16
|
+
transition: "none",
|
|
17
|
+
animation: "none"
|
|
18
|
+
} };
|
|
19
|
+
}
|
|
8
20
|
//#endregion
|
|
9
|
-
export { genNoMotionStyle };
|
|
21
|
+
export { genNoMotionRawStyle, genNoMotionStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { genFocusStyle, resetComponent } from "../../style/index.js";
|
|
2
2
|
import { genStyleHooks } from "../../theme/util/genStyleUtils.js";
|
|
3
3
|
import { mergeToken } from "../../theme/internal.js";
|
|
4
|
-
import { genNoMotionStyle } from "../../style/motion/util.js";
|
|
4
|
+
import { genNoMotionRawStyle, genNoMotionStyle } from "../../style/motion/util.js";
|
|
5
5
|
import { unit } from "@antdv-next/cssinjs";
|
|
6
6
|
import { FastColor } from "@ant-design/fast-color";
|
|
7
7
|
//#region src/switch/style/index.ts
|
|
@@ -98,7 +98,7 @@ const genSwitchHandleStyle = (token) => {
|
|
|
98
98
|
boxShadow: handleShadow,
|
|
99
99
|
transition: `all ${token.switchDuration} ease-in-out`,
|
|
100
100
|
content: "\"\"",
|
|
101
|
-
...
|
|
101
|
+
...genNoMotionRawStyle()
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
[`&${componentCls}-checked ${switchHandleCls}`]: { insetInlineStart: `calc(100% - ${unit(calc(handleSize).add(trackPadding).equal())})` },
|