ep-craft 0.1.28 → 0.1.30
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/components/config-provider/index.d.ts +246 -3
- package/dist/components/config-provider/index.js +17 -3
- package/dist/components/config-provider/src/config-provider-props.d.ts +103 -0
- package/dist/components/config-provider/src/config-provider-props.js +91 -0
- package/dist/components/config-provider/src/config-provider.d.ts +150 -0
- package/dist/components/config-provider/src/config-provider.js +22 -0
- package/dist/components/config-provider/src/hooks/use-global-config.js +55 -13
- package/dist/components/form/src/hooks/use-form-common-props.js +15 -13
- package/dist/components/input-number/EpInputNumber.vue.d.ts +51 -0
- package/dist/components/input-number/EpInputNumber.vue.js +310 -0
- package/dist/components/input-number/EpInputNumber2.vue.js +4 -0
- package/dist/components/input-number/index.d.ts +5 -2
- package/dist/components/input-number/index.js +9 -4
- package/dist/components/input-number/input-number.d.ts +169 -0
- package/dist/components/input-number/input-number.js +165 -0
- package/dist/components/input-number/instance.d.ts +2 -0
- package/dist/ep-craft.js +142 -131
- package/dist/index.css +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +2 -0
- package/package.json +2 -1
- package/theme-chalk/src/input-number.scss +118 -0
|
@@ -1,4 +1,247 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import ConfigProvider, { messageConfig } from './src/config-provider';
|
|
2
|
+
import { configProviderProps } from './src/config-provider-props';
|
|
3
|
+
import { configProviderContextKey } from './src/constants';
|
|
4
|
+
import { provideGlobalConfig, useGlobalComponentSettings, useGlobalConfig } from './src/hooks/use-global-config';
|
|
5
|
+
import type { SFCWithInstall } from '@element-plus/utils';
|
|
6
|
+
/**
|
|
7
|
+
* 与上游一致的接线出口。
|
|
8
|
+
*
|
|
9
|
+
* 关键点:本体(`./src/config-provider`)内部的 `provideGlobalConfig` 来自**本地**
|
|
10
|
+
* `./src/hooks/use-global-config`,其 provide 的注入键与已源码化组件 inject 的
|
|
11
|
+
* 注入键同源(`@element-plus/hooks` → `src/hooks`),是同一 `Symbol` 实例。
|
|
12
|
+
* 此前本文件接的是 element-plus 侧 `ElConfigProvider`,provide 的是 element-plus
|
|
13
|
+
* 侧的注入键,导致 `locale`/`size`/`zIndex`/`namespace`/`emptyValues`
|
|
14
|
+
* 对已源码化组件**全部静默失效**。
|
|
15
|
+
*
|
|
16
|
+
* `ElConfigProvider` 沿用 `@element-plus/utils` 的 `withInstall`(与 icon/tooltip/
|
|
17
|
+
* popper 的 `El*` 出口一致):本体内部名与上游相同,即 `ElConfigProvider`。
|
|
18
|
+
* 但 `install` 由下方 `withEpInstall(..., 'ep-config-provider')` 覆盖(二者是同一对象),
|
|
19
|
+
* 故 `app.use(ElConfigProvider)` 与 `app.use(EpConfigProvider)` 均注册为
|
|
20
|
+
* `ep-config-provider` —— 这是本仓库 `El*`/`Ep*` 出口的既有约定,非上游行为。
|
|
21
|
+
*/
|
|
22
|
+
export declare const ElConfigProvider: SFCWithInstall<typeof ConfigProvider>;
|
|
23
|
+
/**
|
|
24
|
+
* ep-craft 对外出口,注册名为 `ep-config-provider`。
|
|
25
|
+
*/
|
|
26
|
+
export declare const EpConfigProvider: {
|
|
27
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
emptyValues: ArrayConstructor;
|
|
29
|
+
valueOnClear: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
30
|
+
a11y: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
31
|
+
locale: {
|
|
32
|
+
readonly type: import("vue").PropType<import("../../locale").Language>;
|
|
33
|
+
readonly required: false;
|
|
34
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
35
|
+
__epPropKey: true;
|
|
36
|
+
};
|
|
37
|
+
size: {
|
|
38
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
39
|
+
readonly required: false;
|
|
40
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
41
|
+
__epPropKey: true;
|
|
42
|
+
};
|
|
43
|
+
button: {
|
|
44
|
+
readonly type: import("vue").PropType<import("./src/config-provider-props").ButtonConfigContext>;
|
|
45
|
+
readonly required: false;
|
|
46
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
47
|
+
__epPropKey: true;
|
|
48
|
+
};
|
|
49
|
+
card: {
|
|
50
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
51
|
+
readonly required: false;
|
|
52
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
53
|
+
__epPropKey: true;
|
|
54
|
+
};
|
|
55
|
+
dialog: {
|
|
56
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
57
|
+
readonly required: false;
|
|
58
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
59
|
+
__epPropKey: true;
|
|
60
|
+
};
|
|
61
|
+
link: {
|
|
62
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
63
|
+
readonly required: false;
|
|
64
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
65
|
+
__epPropKey: true;
|
|
66
|
+
};
|
|
67
|
+
experimentalFeatures: {
|
|
68
|
+
readonly type: import("vue").PropType<import(".").ExperimentalFeatures>;
|
|
69
|
+
readonly required: false;
|
|
70
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
71
|
+
__epPropKey: true;
|
|
72
|
+
};
|
|
73
|
+
keyboardNavigation: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
74
|
+
message: {
|
|
75
|
+
readonly type: import("vue").PropType<import("./src/config-provider-props").MessageConfigContext>;
|
|
76
|
+
readonly required: false;
|
|
77
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
78
|
+
__epPropKey: true;
|
|
79
|
+
};
|
|
80
|
+
zIndex: NumberConstructor;
|
|
81
|
+
namespace: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
82
|
+
table: {
|
|
83
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
84
|
+
readonly required: false;
|
|
85
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
86
|
+
__epPropKey: true;
|
|
87
|
+
};
|
|
88
|
+
}>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
89
|
+
[key: string]: any;
|
|
90
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
91
|
+
valueOnClear: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown>;
|
|
92
|
+
namespace: string;
|
|
93
|
+
a11y: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
94
|
+
keyboardNavigation: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
95
|
+
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
96
|
+
P: {};
|
|
97
|
+
B: {};
|
|
98
|
+
D: {};
|
|
99
|
+
C: {};
|
|
100
|
+
M: {};
|
|
101
|
+
Defaults: {};
|
|
102
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
103
|
+
emptyValues: ArrayConstructor;
|
|
104
|
+
valueOnClear: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
105
|
+
a11y: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
106
|
+
locale: {
|
|
107
|
+
readonly type: import("vue").PropType<import("../../locale").Language>;
|
|
108
|
+
readonly required: false;
|
|
109
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
110
|
+
__epPropKey: true;
|
|
111
|
+
};
|
|
112
|
+
size: {
|
|
113
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
114
|
+
readonly required: false;
|
|
115
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
116
|
+
__epPropKey: true;
|
|
117
|
+
};
|
|
118
|
+
button: {
|
|
119
|
+
readonly type: import("vue").PropType<import("./src/config-provider-props").ButtonConfigContext>;
|
|
120
|
+
readonly required: false;
|
|
121
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
122
|
+
__epPropKey: true;
|
|
123
|
+
};
|
|
124
|
+
card: {
|
|
125
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
126
|
+
readonly required: false;
|
|
127
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
128
|
+
__epPropKey: true;
|
|
129
|
+
};
|
|
130
|
+
dialog: {
|
|
131
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
132
|
+
readonly required: false;
|
|
133
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
134
|
+
__epPropKey: true;
|
|
135
|
+
};
|
|
136
|
+
link: {
|
|
137
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
138
|
+
readonly required: false;
|
|
139
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
140
|
+
__epPropKey: true;
|
|
141
|
+
};
|
|
142
|
+
experimentalFeatures: {
|
|
143
|
+
readonly type: import("vue").PropType<import(".").ExperimentalFeatures>;
|
|
144
|
+
readonly required: false;
|
|
145
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
146
|
+
__epPropKey: true;
|
|
147
|
+
};
|
|
148
|
+
keyboardNavigation: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
149
|
+
message: {
|
|
150
|
+
readonly type: import("vue").PropType<import("./src/config-provider-props").MessageConfigContext>;
|
|
151
|
+
readonly required: false;
|
|
152
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
153
|
+
__epPropKey: true;
|
|
154
|
+
};
|
|
155
|
+
zIndex: NumberConstructor;
|
|
156
|
+
namespace: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
157
|
+
table: {
|
|
158
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
159
|
+
readonly required: false;
|
|
160
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
161
|
+
__epPropKey: true;
|
|
162
|
+
};
|
|
163
|
+
}>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
164
|
+
[key: string]: any;
|
|
165
|
+
}>, {}, {}, {}, {
|
|
166
|
+
valueOnClear: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown>;
|
|
167
|
+
namespace: string;
|
|
168
|
+
a11y: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
169
|
+
keyboardNavigation: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
170
|
+
}>;
|
|
171
|
+
__isFragment?: never;
|
|
172
|
+
__isTeleport?: never;
|
|
173
|
+
__isSuspense?: never;
|
|
174
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
175
|
+
emptyValues: ArrayConstructor;
|
|
176
|
+
valueOnClear: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
177
|
+
a11y: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
178
|
+
locale: {
|
|
179
|
+
readonly type: import("vue").PropType<import("../../locale").Language>;
|
|
180
|
+
readonly required: false;
|
|
181
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
182
|
+
__epPropKey: true;
|
|
183
|
+
};
|
|
184
|
+
size: {
|
|
185
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
186
|
+
readonly required: false;
|
|
187
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
188
|
+
__epPropKey: true;
|
|
189
|
+
};
|
|
190
|
+
button: {
|
|
191
|
+
readonly type: import("vue").PropType<import("./src/config-provider-props").ButtonConfigContext>;
|
|
192
|
+
readonly required: false;
|
|
193
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
194
|
+
__epPropKey: true;
|
|
195
|
+
};
|
|
196
|
+
card: {
|
|
197
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
198
|
+
readonly required: false;
|
|
199
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
200
|
+
__epPropKey: true;
|
|
201
|
+
};
|
|
202
|
+
dialog: {
|
|
203
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
204
|
+
readonly required: false;
|
|
205
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
206
|
+
__epPropKey: true;
|
|
207
|
+
};
|
|
208
|
+
link: {
|
|
209
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
210
|
+
readonly required: false;
|
|
211
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
212
|
+
__epPropKey: true;
|
|
213
|
+
};
|
|
214
|
+
experimentalFeatures: {
|
|
215
|
+
readonly type: import("vue").PropType<import(".").ExperimentalFeatures>;
|
|
216
|
+
readonly required: false;
|
|
217
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
218
|
+
__epPropKey: true;
|
|
219
|
+
};
|
|
220
|
+
keyboardNavigation: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
221
|
+
message: {
|
|
222
|
+
readonly type: import("vue").PropType<import("./src/config-provider-props").MessageConfigContext>;
|
|
223
|
+
readonly required: false;
|
|
224
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
225
|
+
__epPropKey: true;
|
|
226
|
+
};
|
|
227
|
+
zIndex: NumberConstructor;
|
|
228
|
+
namespace: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
229
|
+
table: {
|
|
230
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
231
|
+
readonly required: false;
|
|
232
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
233
|
+
__epPropKey: true;
|
|
234
|
+
};
|
|
235
|
+
}>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
236
|
+
[key: string]: any;
|
|
237
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
238
|
+
valueOnClear: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown>;
|
|
239
|
+
namespace: string;
|
|
240
|
+
a11y: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
241
|
+
keyboardNavigation: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
242
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
|
|
4
243
|
export default EpConfigProvider;
|
|
244
|
+
export { configProviderContextKey, configProviderProps, messageConfig, provideGlobalConfig, useGlobalComponentSettings, useGlobalConfig, };
|
|
245
|
+
export type { ConfigProviderContext } from './src/constants';
|
|
246
|
+
export type { ConfigProviderProps, ConfigProviderPropsPublic, ExperimentalFeatures, } from './src/config-provider-props';
|
|
247
|
+
export type { ConfigProviderInstance } from './src/config-provider';
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import { ElConfigProvider as o } from "element-plus";
|
|
2
1
|
import { withInstall as r } from "../../utils/with-install.js";
|
|
3
|
-
|
|
2
|
+
import "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import "vue";
|
|
7
|
+
import { withInstall as i } from "../../utils/vue/install.js";
|
|
8
|
+
import o from "./src/config-provider.js";
|
|
9
|
+
import { messageConfig as v } from "./src/config-provider.js";
|
|
10
|
+
import { configProviderProps as x } from "./src/config-provider-props.js";
|
|
11
|
+
import { provideGlobalConfig as c, useGlobalConfig as h } from "./src/hooks/use-global-config.js";
|
|
12
|
+
i(o);
|
|
13
|
+
const g = r(o, "ep-config-provider");
|
|
4
14
|
export {
|
|
5
|
-
|
|
15
|
+
g as EpConfigProvider,
|
|
16
|
+
x as configProviderProps,
|
|
17
|
+
v as messageConfig,
|
|
18
|
+
c as provideGlobalConfig,
|
|
19
|
+
h as useGlobalConfig
|
|
6
20
|
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { ExtractPropTypes, ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type { Language } from '@element-plus/locale';
|
|
3
|
+
import type { ButtonProps } from '../../button/button';
|
|
4
|
+
/**
|
|
5
|
+
* 按钮全局配置的类型子集(对齐 element-plus 的 `ButtonConfigContext`)。
|
|
6
|
+
* button 已 vendor,可精确类型化;仅取 config-provider 需要下传的字段。
|
|
7
|
+
*/
|
|
8
|
+
export interface ButtonConfigContext {
|
|
9
|
+
type?: ButtonProps['type'];
|
|
10
|
+
plain?: ButtonProps['plain'];
|
|
11
|
+
text?: ButtonProps['text'];
|
|
12
|
+
round?: ButtonProps['round'];
|
|
13
|
+
dashed?: ButtonProps['dashed'];
|
|
14
|
+
autoInsertSpace?: ButtonProps['autoInsertSpace'];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 实验性特性开关的占位类型(对齐上游 `ExperimentalFeatures = {}`)。
|
|
18
|
+
* 上游尚未定义任何字段,此处保持一致,待上游补全后再精确化。
|
|
19
|
+
*/
|
|
20
|
+
export type ExperimentalFeatures = {};
|
|
21
|
+
/**
|
|
22
|
+
* 消息(Message)全局配置的最小结构类型占位。
|
|
23
|
+
*
|
|
24
|
+
* message 尚未 vendor,精确类型化需从 element-plus 导入 `MessageConfigContext`
|
|
25
|
+
* (违反 6.7)或先 vendor message 的类型层(越界到 vendor-remaining-components)。
|
|
26
|
+
* 待 message 对应组件 vendor 时精确化。
|
|
27
|
+
*/
|
|
28
|
+
export type MessageConfigContext = Record<string, unknown>;
|
|
29
|
+
/**
|
|
30
|
+
* ConfigProvider 的 props 定义。
|
|
31
|
+
*
|
|
32
|
+
* 键集合与语义必须与 element-plus `config-provider-props` 对齐(Requirement 6.1、6.7),
|
|
33
|
+
* 以保证使用方切换实现时无需改动调用方。
|
|
34
|
+
*
|
|
35
|
+
* 类型来源约定(见 design.md Props Contract 决策段):
|
|
36
|
+
* - 可自持精确类型化的键:`locale`(`src/locale`)、`size`(`src/hooks/use-size`)、
|
|
37
|
+
* `emptyValues`/`valueOnClear`(`src/hooks/use-empty-values`)、`button`(`src/components/button`)。
|
|
38
|
+
* - 其余 `card`/`dialog`/`link`/`table`/`message` 采用最小结构类型占位,理由见各键注释。
|
|
39
|
+
*/
|
|
40
|
+
export declare const configProviderProps: {
|
|
41
|
+
emptyValues: ArrayConstructor;
|
|
42
|
+
valueOnClear: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
43
|
+
a11y: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
44
|
+
locale: {
|
|
45
|
+
readonly type: import("vue").PropType<Language>;
|
|
46
|
+
readonly required: false;
|
|
47
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
48
|
+
__epPropKey: true;
|
|
49
|
+
};
|
|
50
|
+
size: {
|
|
51
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
52
|
+
readonly required: false;
|
|
53
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
54
|
+
__epPropKey: true;
|
|
55
|
+
};
|
|
56
|
+
button: {
|
|
57
|
+
readonly type: import("vue").PropType<ButtonConfigContext>;
|
|
58
|
+
readonly required: false;
|
|
59
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
60
|
+
__epPropKey: true;
|
|
61
|
+
};
|
|
62
|
+
card: {
|
|
63
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
64
|
+
readonly required: false;
|
|
65
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
66
|
+
__epPropKey: true;
|
|
67
|
+
};
|
|
68
|
+
dialog: {
|
|
69
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
70
|
+
readonly required: false;
|
|
71
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
72
|
+
__epPropKey: true;
|
|
73
|
+
};
|
|
74
|
+
link: {
|
|
75
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
76
|
+
readonly required: false;
|
|
77
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
78
|
+
__epPropKey: true;
|
|
79
|
+
};
|
|
80
|
+
experimentalFeatures: {
|
|
81
|
+
readonly type: import("vue").PropType<ExperimentalFeatures>;
|
|
82
|
+
readonly required: false;
|
|
83
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
84
|
+
__epPropKey: true;
|
|
85
|
+
};
|
|
86
|
+
keyboardNavigation: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
87
|
+
message: {
|
|
88
|
+
readonly type: import("vue").PropType<MessageConfigContext>;
|
|
89
|
+
readonly required: false;
|
|
90
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
91
|
+
__epPropKey: true;
|
|
92
|
+
};
|
|
93
|
+
zIndex: NumberConstructor;
|
|
94
|
+
namespace: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
95
|
+
table: {
|
|
96
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
97
|
+
readonly required: false;
|
|
98
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
99
|
+
__epPropKey: true;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export type ConfigProviderProps = ExtractPropTypes<typeof configProviderProps>;
|
|
103
|
+
export type ConfigProviderPropsPublic = ExtractPublicPropTypes<typeof configProviderProps>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "@element-plus/icons-vue";
|
|
5
|
+
import { buildProps as t, definePropType as e } from "../../../utils/vue/props/runtime.js";
|
|
6
|
+
import "vue";
|
|
7
|
+
import { useSizeProp as o } from "../../../hooks/use-size/index.js";
|
|
8
|
+
import "@popperjs/core";
|
|
9
|
+
import "../../../hooks/use-z-index/index.js";
|
|
10
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
11
|
+
import "../../../hooks/use-aria/index.js";
|
|
12
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
13
|
+
import { useEmptyValuesProps as p } from "../../../hooks/use-empty-values/index.js";
|
|
14
|
+
const j = t({
|
|
15
|
+
/**
|
|
16
|
+
* @description 是否启用无障碍(a11y)相关特性
|
|
17
|
+
*/
|
|
18
|
+
a11y: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !0
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* @description 语言包对象,影响其下已源码化组件的文案渲染
|
|
24
|
+
*/
|
|
25
|
+
locale: { type: e(Object) },
|
|
26
|
+
/**
|
|
27
|
+
* @description 全局组件尺寸
|
|
28
|
+
*/
|
|
29
|
+
size: o,
|
|
30
|
+
/**
|
|
31
|
+
* @description 按钮相关全局配置
|
|
32
|
+
*/
|
|
33
|
+
button: { type: e(Object) },
|
|
34
|
+
/**
|
|
35
|
+
* @description 卡片相关全局配置
|
|
36
|
+
* 占位类型:card 尚未 vendor,精确类型化需从 element-plus 导入
|
|
37
|
+
* `CardConfigContext`(违反 6.7)或先 vendor card 的类型层(越界到
|
|
38
|
+
* vendor-remaining-components)。待 card 对应组件 vendor 时精确化。
|
|
39
|
+
*/
|
|
40
|
+
card: { type: e(Object) },
|
|
41
|
+
/**
|
|
42
|
+
* @description 对话框相关全局配置
|
|
43
|
+
* 占位类型:dialog 尚未 vendor,理由同 `card`。
|
|
44
|
+
* 待 dialog 对应组件 vendor 时精确化。
|
|
45
|
+
*/
|
|
46
|
+
dialog: { type: e(Object) },
|
|
47
|
+
/**
|
|
48
|
+
* @description 链接相关全局配置
|
|
49
|
+
* 占位类型:link 尚未 vendor,理由同 `card`。
|
|
50
|
+
* 待 link 对应组件 vendor 时精确化。
|
|
51
|
+
*/
|
|
52
|
+
link: { type: e(Object) },
|
|
53
|
+
/**
|
|
54
|
+
* @description 实验性特性开关
|
|
55
|
+
*/
|
|
56
|
+
experimentalFeatures: { type: e(Object) },
|
|
57
|
+
/**
|
|
58
|
+
* @description 是否处理键盘导航
|
|
59
|
+
*/
|
|
60
|
+
keyboardNavigation: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !0
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* @description 消息(Message)相关全局配置
|
|
66
|
+
* 占位类型见 `MessageConfigContext`。
|
|
67
|
+
*/
|
|
68
|
+
message: { type: e(Object) },
|
|
69
|
+
/**
|
|
70
|
+
* @description 全局初始 zIndex
|
|
71
|
+
*/
|
|
72
|
+
zIndex: Number,
|
|
73
|
+
/**
|
|
74
|
+
* @description 全局组件类名前缀(与 theme-chalk 的 $namespace 配合使用)
|
|
75
|
+
*/
|
|
76
|
+
namespace: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: "el"
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* @description 表格相关全局配置
|
|
82
|
+
* 占位类型:table 尚未 vendor,理由同 `card`。
|
|
83
|
+
* 待 table 对应组件 vendor 时精确化。
|
|
84
|
+
*/
|
|
85
|
+
table: { type: e(Object) },
|
|
86
|
+
// 与上游一致:useEmptyValuesProps 最后展开
|
|
87
|
+
...p
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
j as configProviderProps
|
|
91
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { MessageConfigContext } from './config-provider-props';
|
|
2
|
+
/**
|
|
3
|
+
* 服务类 API(Message/Notification/MessageBox)在组件树之外读取的默认消息配置。
|
|
4
|
+
*
|
|
5
|
+
* 这些 API 不处于 `<ep-config-provider>` 的子树中,无法通过 inject 取得配置,
|
|
6
|
+
* 故沿用上游机制:由本组件在 `message` 变化时同步到该模块级对象。
|
|
7
|
+
*/
|
|
8
|
+
export declare const messageConfig: MessageConfigContext;
|
|
9
|
+
/**
|
|
10
|
+
* ConfigProvider 组件本体。
|
|
11
|
+
*
|
|
12
|
+
* 唯一职责:把 `configProviderProps` 交给**本地** `provideGlobalConfig`,并渲染默认插槽。
|
|
13
|
+
* 本地化要点:`provideGlobalConfig` 与已源码化组件 inject 的注入键同源于本地
|
|
14
|
+
* `src/hooks` / `./constants`,两侧共享同一 `Symbol` 实例,配置才能实际下传;
|
|
15
|
+
* 若改用 element-plus 侧的 `provideGlobalConfig`,注入键失配会导致静默失效。
|
|
16
|
+
*
|
|
17
|
+
* 内部名保持 `ElConfigProvider`(与上游一致,供跨组件引用),不改写为 `Ep` 前缀。
|
|
18
|
+
*/
|
|
19
|
+
declare const ConfigProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
20
|
+
emptyValues: ArrayConstructor;
|
|
21
|
+
valueOnClear: import("../../../utils").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
22
|
+
a11y: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
23
|
+
locale: {
|
|
24
|
+
readonly type: import("vue").PropType<import("../../../locale").Language>;
|
|
25
|
+
readonly required: false;
|
|
26
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
27
|
+
__epPropKey: true;
|
|
28
|
+
};
|
|
29
|
+
size: {
|
|
30
|
+
readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
31
|
+
readonly required: false;
|
|
32
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
33
|
+
__epPropKey: true;
|
|
34
|
+
};
|
|
35
|
+
button: {
|
|
36
|
+
readonly type: import("vue").PropType<import("./config-provider-props").ButtonConfigContext>;
|
|
37
|
+
readonly required: false;
|
|
38
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
39
|
+
__epPropKey: true;
|
|
40
|
+
};
|
|
41
|
+
card: {
|
|
42
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
43
|
+
readonly required: false;
|
|
44
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
45
|
+
__epPropKey: true;
|
|
46
|
+
};
|
|
47
|
+
dialog: {
|
|
48
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
49
|
+
readonly required: false;
|
|
50
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
51
|
+
__epPropKey: true;
|
|
52
|
+
};
|
|
53
|
+
link: {
|
|
54
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
55
|
+
readonly required: false;
|
|
56
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
57
|
+
__epPropKey: true;
|
|
58
|
+
};
|
|
59
|
+
experimentalFeatures: {
|
|
60
|
+
readonly type: import("vue").PropType<import("./config-provider-props").ExperimentalFeatures>;
|
|
61
|
+
readonly required: false;
|
|
62
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
63
|
+
__epPropKey: true;
|
|
64
|
+
};
|
|
65
|
+
keyboardNavigation: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
66
|
+
message: {
|
|
67
|
+
readonly type: import("vue").PropType<MessageConfigContext>;
|
|
68
|
+
readonly required: false;
|
|
69
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
70
|
+
__epPropKey: true;
|
|
71
|
+
};
|
|
72
|
+
zIndex: NumberConstructor;
|
|
73
|
+
namespace: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
74
|
+
table: {
|
|
75
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
76
|
+
readonly required: false;
|
|
77
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
78
|
+
__epPropKey: true;
|
|
79
|
+
};
|
|
80
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
83
|
+
emptyValues: ArrayConstructor;
|
|
84
|
+
valueOnClear: import("../../../utils").EpPropFinalized<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown, undefined, boolean>;
|
|
85
|
+
a11y: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
86
|
+
locale: {
|
|
87
|
+
readonly type: import("vue").PropType<import("../../../locale").Language>;
|
|
88
|
+
readonly required: false;
|
|
89
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
90
|
+
__epPropKey: true;
|
|
91
|
+
};
|
|
92
|
+
size: {
|
|
93
|
+
readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
94
|
+
readonly required: false;
|
|
95
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
96
|
+
__epPropKey: true;
|
|
97
|
+
};
|
|
98
|
+
button: {
|
|
99
|
+
readonly type: import("vue").PropType<import("./config-provider-props").ButtonConfigContext>;
|
|
100
|
+
readonly required: false;
|
|
101
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
102
|
+
__epPropKey: true;
|
|
103
|
+
};
|
|
104
|
+
card: {
|
|
105
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
106
|
+
readonly required: false;
|
|
107
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
108
|
+
__epPropKey: true;
|
|
109
|
+
};
|
|
110
|
+
dialog: {
|
|
111
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
112
|
+
readonly required: false;
|
|
113
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
114
|
+
__epPropKey: true;
|
|
115
|
+
};
|
|
116
|
+
link: {
|
|
117
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
118
|
+
readonly required: false;
|
|
119
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
120
|
+
__epPropKey: true;
|
|
121
|
+
};
|
|
122
|
+
experimentalFeatures: {
|
|
123
|
+
readonly type: import("vue").PropType<import("./config-provider-props").ExperimentalFeatures>;
|
|
124
|
+
readonly required: false;
|
|
125
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
126
|
+
__epPropKey: true;
|
|
127
|
+
};
|
|
128
|
+
keyboardNavigation: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
129
|
+
message: {
|
|
130
|
+
readonly type: import("vue").PropType<MessageConfigContext>;
|
|
131
|
+
readonly required: false;
|
|
132
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
133
|
+
__epPropKey: true;
|
|
134
|
+
};
|
|
135
|
+
zIndex: NumberConstructor;
|
|
136
|
+
namespace: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
137
|
+
table: {
|
|
138
|
+
readonly type: import("vue").PropType<Record<string, unknown>>;
|
|
139
|
+
readonly required: false;
|
|
140
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
141
|
+
__epPropKey: true;
|
|
142
|
+
};
|
|
143
|
+
}>> & Readonly<{}>, {
|
|
144
|
+
valueOnClear: import("../../../utils").EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | (((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null)) | null)[], unknown, unknown>;
|
|
145
|
+
namespace: string;
|
|
146
|
+
a11y: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
147
|
+
keyboardNavigation: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
148
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
149
|
+
export default ConfigProvider;
|
|
150
|
+
export type ConfigProviderInstance = InstanceType<typeof ConfigProvider> & unknown;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineComponent as i, watch as m, renderSlot as n } from "vue";
|
|
2
|
+
import { configProviderProps as s } from "./config-provider-props.js";
|
|
3
|
+
import { provideGlobalConfig as p } from "./hooks/use-global-config.js";
|
|
4
|
+
const d = { placement: "top" }, g = i({
|
|
5
|
+
name: "ElConfigProvider",
|
|
6
|
+
props: s,
|
|
7
|
+
setup(o, { slots: t }) {
|
|
8
|
+
const e = p(o);
|
|
9
|
+
return m(
|
|
10
|
+
() => o.message,
|
|
11
|
+
(a) => {
|
|
12
|
+
var r;
|
|
13
|
+
Object.assign(d, ((r = e == null ? void 0 : e.value) == null ? void 0 : r.message) ?? {}, a ?? {});
|
|
14
|
+
},
|
|
15
|
+
{ immediate: !0, deep: !0 }
|
|
16
|
+
), () => n(t, "default", { config: e == null ? void 0 : e.value });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
g as default,
|
|
21
|
+
d as messageConfig
|
|
22
|
+
};
|