@vxe-ui/core 0.0.1 → 0.1.1
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/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/es/index.esm.js +4 -6
- package/es/src/commands.js +3 -3
- package/es/src/core.js +49 -14
- package/es/src/event.js +38 -19
- package/es/src/formats.js +3 -3
- package/es/src/globalStore.js +2 -3
- package/es/src/i18n.js +3 -5
- package/es/src/i18nStore.js +4 -0
- package/es/src/iconStore.js +1 -2
- package/es/src/interceptor.js +2 -2
- package/es/src/log.js +8 -8
- package/es/src/menus.js +3 -3
- package/es/src/renderer.js +2 -2
- package/es/src/resize.js +9 -7
- package/es/src/store.js +2 -2
- package/es/src/themeStore.js +3 -0
- package/lib/index.common.js +2 -4
- package/lib/index.umd.js +326 -99
- package/lib/index.umd.min.js +1 -1
- package/lib/src/commands.js +2 -2
- package/lib/src/commands.min.js +1 -1
- package/lib/src/core.js +105 -22
- package/lib/src/core.min.js +1 -1
- package/lib/src/event.js +41 -23
- package/lib/src/event.min.js +1 -1
- package/lib/src/formats.js +2 -2
- package/lib/src/formats.min.js +1 -1
- package/lib/src/globalStore.js +4 -5
- package/lib/src/globalStore.min.js +1 -1
- package/lib/src/i18n.js +3 -5
- package/lib/src/i18n.min.js +1 -1
- package/lib/src/i18nStore.js +10 -0
- package/lib/src/i18nStore.min.js +1 -0
- package/lib/src/iconStore.js +2 -3
- package/lib/src/iconStore.min.js +1 -1
- package/lib/src/interceptor.js +1 -1
- package/lib/src/interceptor.min.js +1 -1
- package/lib/src/log.js +9 -11
- package/lib/src/log.min.js +1 -1
- package/lib/src/menus.js +2 -2
- package/lib/src/menus.min.js +1 -1
- package/lib/src/renderer.js +1 -1
- package/lib/src/renderer.min.js +1 -1
- package/lib/src/resize.js +10 -10
- package/lib/src/resize.min.js +1 -1
- package/lib/src/store.js +1 -1
- package/lib/src/store.min.js +1 -1
- package/lib/src/themeStore.js +9 -0
- package/lib/src/themeStore.min.js +1 -0
- package/package.json +2 -2
- package/packages/index.ts +4 -6
- package/packages/src/commands.ts +6 -6
- package/packages/src/core.ts +61 -18
- package/packages/src/event.ts +40 -23
- package/packages/src/formats.ts +6 -6
- package/packages/src/globalStore.ts +2 -4
- package/packages/src/i18n.ts +3 -5
- package/packages/src/i18nStore.ts +9 -0
- package/packages/src/iconStore.ts +1 -3
- package/packages/src/interceptor.ts +3 -3
- package/packages/src/log.ts +9 -8
- package/packages/src/menus.ts +6 -6
- package/packages/src/renderer.ts +5 -5
- package/packages/src/resize.ts +10 -6
- package/packages/src/store.ts +3 -3
- package/packages/src/themeStore.ts +7 -0
- package/packages/src/validators.ts +1 -1
- package/types/core/global-config.d.ts +3 -3
- package/types/core/global-event.d.ts +28 -0
- package/types/core/global-icon.d.ts +3 -1
- package/types/core/global-lang.d.ts +1 -0
- package/types/core/global-resize.d.ts +3 -0
- package/types/core/global-theme.d.ts +1 -0
- package/types/core/index.d.ts +63 -10
- package/types/core/log.d.ts +8 -0
- package/types/core/renderer.d.ts +5 -16
- package/types/index.d.ts +2 -2
- package/types/tool/common.d.ts +18 -8
- package/es/src/theme.js +0 -10
- package/lib/src/theme.js +0 -17
- package/lib/src/theme.min.js +0 -1
- package/packages/src/theme.ts +0 -13
package/packages/src/menus.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
-
import {
|
|
2
|
+
import { log } from './log'
|
|
3
3
|
|
|
4
4
|
import { VxeGlobalMenus } from '../../types'
|
|
5
5
|
|
|
@@ -25,8 +25,8 @@ class VXEMenusStore {
|
|
|
25
25
|
const conf = this.store[name]
|
|
26
26
|
// 兼容
|
|
27
27
|
if (XEUtils.isFunction(render)) {
|
|
28
|
-
if (process.env.
|
|
29
|
-
|
|
28
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
29
|
+
log.warn('vxe.error.delProp', ['menus -> callback', 'menuMethod'])
|
|
30
30
|
}
|
|
31
31
|
render = {
|
|
32
32
|
menuMethod: render
|
|
@@ -34,11 +34,11 @@ class VXEMenusStore {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// 检测是否覆盖
|
|
37
|
-
if (process.env.
|
|
37
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
38
38
|
const confKeys = XEUtils.keys(conf)
|
|
39
39
|
XEUtils.each(render, (item, key) => {
|
|
40
40
|
if (confKeys.includes(key)) {
|
|
41
|
-
|
|
41
|
+
log.warn('vxe.error.coverProp', [name, key])
|
|
42
42
|
}
|
|
43
43
|
})
|
|
44
44
|
}
|
|
@@ -57,6 +57,6 @@ class VXEMenusStore {
|
|
|
57
57
|
|
|
58
58
|
export const menus = new VXEMenusStore() as VxeGlobalMenus
|
|
59
59
|
|
|
60
|
-
if (process.env.
|
|
60
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
61
61
|
Object.assign(menus, { _name: 'Menus' })
|
|
62
62
|
}
|
package/packages/src/renderer.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
-
import {
|
|
2
|
+
import { log } from './log'
|
|
3
3
|
|
|
4
|
-
import { VxeGlobalRenderer,
|
|
4
|
+
import { VxeGlobalRenderer, VxeGlobalRendererOptions } from '../../types'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 内置的组件渲染
|
|
8
8
|
*/
|
|
9
|
-
const renderMap: Record<string,
|
|
9
|
+
const renderMap: Record<string, VxeGlobalRendererOptions> = {}
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* 全局渲染器
|
|
@@ -24,10 +24,10 @@ export const renderer: VxeGlobalRenderer = {
|
|
|
24
24
|
const renders: any = renderMap[name]
|
|
25
25
|
if (renders) {
|
|
26
26
|
// 检测是否覆盖
|
|
27
|
-
if (process.env.
|
|
27
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
28
28
|
XEUtils.each(options, (val, key) => {
|
|
29
29
|
if (!XEUtils.eqNull(renders[key]) && renders[key] !== val) {
|
|
30
|
-
|
|
30
|
+
log.warn('vxe.error.coverProp', [`Renderer.${name}`, key])
|
|
31
31
|
}
|
|
32
32
|
})
|
|
33
33
|
}
|
package/packages/src/resize.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
-
import globalConfigStore from './globalStore'
|
|
2
|
+
import { globalConfigStore } from './globalStore'
|
|
3
|
+
|
|
4
|
+
import { VxeGlobalResize } from '../../types'
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* 监听 resize 事件
|
|
@@ -36,7 +38,7 @@ function eventListener () {
|
|
|
36
38
|
resizeTimeout = setTimeout(eventHandle, globalConfigStore.resizeInterval || defaultInterval)
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
class XEResizeObserver {
|
|
40
42
|
tarList: {
|
|
41
43
|
target: Element;
|
|
42
44
|
width: number;
|
|
@@ -77,9 +79,11 @@ export class XEResizeObserver {
|
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
export
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
export const globalResize: VxeGlobalResize = {
|
|
83
|
+
create (callback: (...args: any[]) => void) {
|
|
84
|
+
if (window.ResizeObserver) {
|
|
85
|
+
return new window.ResizeObserver(callback)
|
|
86
|
+
}
|
|
87
|
+
return new XEResizeObserver(callback)
|
|
83
88
|
}
|
|
84
|
-
return new XEResizeObserver(callback)
|
|
85
89
|
}
|
package/packages/src/store.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { log } from './log'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -25,11 +25,11 @@ export class Store {
|
|
|
25
25
|
add (name: string, options: any): Store {
|
|
26
26
|
const conf = this.store[name]
|
|
27
27
|
// 检测是否覆盖
|
|
28
|
-
if (process.env.
|
|
28
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
29
29
|
const confKeys = XEUtils.keys(conf)
|
|
30
30
|
XEUtils.each(options, (item, key) => {
|
|
31
31
|
if (confKeys.includes(key)) {
|
|
32
|
-
|
|
32
|
+
log.warn('vxe.error.coverProp', [name, key])
|
|
33
33
|
}
|
|
34
34
|
})
|
|
35
35
|
}
|
|
@@ -4,6 +4,6 @@ import { VxeGlobalValidators } from '../../types'
|
|
|
4
4
|
|
|
5
5
|
export const validators = new VXEStore() as VxeGlobalValidators
|
|
6
6
|
|
|
7
|
-
if (process.env.
|
|
7
|
+
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
8
8
|
Object.assign(validators, { _name: 'Validators' })
|
|
9
9
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VxeComponentSizeType } from '../tool'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 全局参数对象
|
|
5
5
|
*/
|
|
6
6
|
export interface VxeGlobalConfig {
|
|
7
|
+
authId?: string
|
|
7
8
|
zIndex?: number
|
|
8
|
-
size?:
|
|
9
|
+
size?: VxeComponentSizeType
|
|
9
10
|
version?: string | number
|
|
10
|
-
theme?: null | '' | 'default' | 'dark'
|
|
11
11
|
resizeInterval?: number
|
|
12
12
|
|
|
13
13
|
i18n?(key: string, args?: any): string
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { VxeComponentBaseOptions, VxeComponentEvent } from '../tool'
|
|
2
|
+
|
|
3
|
+
export type VxeGlobalEventType = 'copy' | 'cut' | 'paste' | 'keydown' | 'contextmenu' | 'mousedown' | 'blur' | 'resize' | 'mousewheel'
|
|
4
|
+
|
|
5
|
+
export const GLOBAL_EVENT_KEYS: {
|
|
6
|
+
F2: 'F2',
|
|
7
|
+
ESCAPE: 'Escape',
|
|
8
|
+
ENTER: 'Enter',
|
|
9
|
+
TAB: 'Tab',
|
|
10
|
+
DELETE: 'Delete',
|
|
11
|
+
BACKSPACE: 'Backspace',
|
|
12
|
+
SPACEBAR: ' ',
|
|
13
|
+
CONTEXT_MENU: 'ContextMenu',
|
|
14
|
+
ARROW_UP: 'ArrowUp',
|
|
15
|
+
ARROW_DOWN: 'ArrowDown',
|
|
16
|
+
ARROW_LEFT: 'ArrowLeft',
|
|
17
|
+
ARROW_RIGHT: 'ArrowRight',
|
|
18
|
+
PAGE_UP: 'PageUp',
|
|
19
|
+
PAGE_DOWN: 'PageDown'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function createEvent<E, T, D = { [key: string]: any }>(evnt: E, params1: T, params2?: D): T & D & VxeComponentEvent<E>
|
|
23
|
+
|
|
24
|
+
export interface VxeGlobalEvents {
|
|
25
|
+
on (comp: VxeComponentBaseOptions, type: VxeGlobalEventType, cb: (evnt: any) => void): void
|
|
26
|
+
off (comp: VxeComponentBaseOptions, type: VxeGlobalEventType): void
|
|
27
|
+
hasKey(evnt: KeyboardEvent, targetKey: string): boolean
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type VxeGlobalI18nLocale= '' | 'zh-CN' | 'zh-TC' | 'zh-HK' | 'zh-MO' | 'zh-TW' | 'en-US' | 'ja-JP' | 'es-ES' | 'pt-BR'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type VxeGlobalThemeName = null | '' | 'default' | 'dark'
|
package/types/core/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { VxeGlobalConfig } from './global-config'
|
|
2
2
|
import { VxeGlobalIcon } from './global-icon'
|
|
3
|
+
import { VxeGlobalThemeName } from './global-theme'
|
|
4
|
+
import { VxeGlobalI18nLocale } from './global-lang'
|
|
5
|
+
import { VxeGlobalEvents } from './global-event'
|
|
6
|
+
import { VxeGlobalResize } from './global-resize'
|
|
3
7
|
import { VxeGlobalRenderer } from './renderer'
|
|
4
8
|
import { VxeGlobalValidators } from './validators'
|
|
5
9
|
import { VxeGlobalMenus } from './menus'
|
|
@@ -8,20 +12,27 @@ import { VxeGlobalCommands } from './commands'
|
|
|
8
12
|
import { VxeGlobalInterceptor } from './interceptor'
|
|
9
13
|
import { VxeGlobalClipboard } from './clipboard'
|
|
10
14
|
import { VxeGlobalHooks } from './hooks'
|
|
15
|
+
import { VxeGlobalLog } from './log'
|
|
11
16
|
|
|
12
17
|
/* eslint-disable no-use-before-define */
|
|
13
18
|
|
|
14
|
-
export function
|
|
19
|
+
export function setTheme(name: VxeGlobalThemeName): VxeUIExport
|
|
15
20
|
|
|
16
|
-
export function
|
|
21
|
+
export function getTheme(): VxeGlobalThemeName
|
|
17
22
|
|
|
18
|
-
export function
|
|
23
|
+
export function setConfig(options?: VxeGlobalConfig): VxeUIExport
|
|
24
|
+
export function getConfig(): Required<VxeGlobalConfig>
|
|
25
|
+
export function getConfig(key: keyof VxeGlobalConfig, defaultValue?: any): any
|
|
19
26
|
|
|
20
|
-
export function
|
|
27
|
+
export function setIcon(options?: VxeGlobalIcon): VxeUIExport
|
|
28
|
+
export function getIcon(): Required<VxeGlobalIcon>
|
|
29
|
+
export function getIcon(key: keyof VxeGlobalIcon): any
|
|
21
30
|
|
|
31
|
+
export function setLanguage(locale: VxeGlobalI18nLocale): VxeUIExport
|
|
32
|
+
export function setI18n(locale: VxeGlobalI18nLocale, data: Record<string, any>): VxeUIExport
|
|
22
33
|
export function getI18n(key: string, args?: any): string
|
|
23
34
|
|
|
24
|
-
export const
|
|
35
|
+
export const coreVersion: string
|
|
25
36
|
|
|
26
37
|
export const renderer: VxeGlobalRenderer
|
|
27
38
|
|
|
@@ -37,13 +48,27 @@ export const interceptor: VxeGlobalInterceptor
|
|
|
37
48
|
|
|
38
49
|
export const clipboard: VxeGlobalClipboard
|
|
39
50
|
|
|
51
|
+
export const globalEvents: VxeGlobalEvents
|
|
52
|
+
|
|
53
|
+
export const globalResize: VxeGlobalResize
|
|
54
|
+
|
|
55
|
+
export const log: VxeGlobalLog
|
|
56
|
+
|
|
40
57
|
export const hooks: VxeGlobalHooks
|
|
41
58
|
|
|
42
|
-
export interface
|
|
59
|
+
export interface VxeUIExport {
|
|
43
60
|
/**
|
|
44
61
|
* 版本号
|
|
45
62
|
*/
|
|
46
|
-
|
|
63
|
+
coreVersion: string
|
|
64
|
+
/**
|
|
65
|
+
* 设置全局主题
|
|
66
|
+
*/
|
|
67
|
+
setTheme: typeof setTheme
|
|
68
|
+
/**
|
|
69
|
+
* 获取全局主题
|
|
70
|
+
*/
|
|
71
|
+
getTheme: typeof getTheme
|
|
47
72
|
/**
|
|
48
73
|
* 设置全局参数
|
|
49
74
|
*/
|
|
@@ -57,9 +82,18 @@ export interface VxeCoreExport {
|
|
|
57
82
|
*/
|
|
58
83
|
setIcon: typeof setIcon
|
|
59
84
|
/**
|
|
60
|
-
*
|
|
85
|
+
* 设置组件当前语言
|
|
86
|
+
*/
|
|
87
|
+
setLanguage: typeof setLanguage
|
|
88
|
+
/**
|
|
89
|
+
* 设置组件语言数据
|
|
90
|
+
*/
|
|
91
|
+
setI18n: typeof setI18n
|
|
92
|
+
/**
|
|
93
|
+
* 获取组件语言值
|
|
61
94
|
*/
|
|
62
95
|
getI18n: typeof getI18n
|
|
96
|
+
|
|
63
97
|
/**
|
|
64
98
|
* 获取全局图标
|
|
65
99
|
*/
|
|
@@ -93,15 +127,33 @@ export interface VxeCoreExport {
|
|
|
93
127
|
* 全局剪贴板
|
|
94
128
|
*/
|
|
95
129
|
clipboard: VxeGlobalClipboard
|
|
130
|
+
/**
|
|
131
|
+
* 全局事件管理
|
|
132
|
+
*/
|
|
133
|
+
globalEvents: VxeGlobalEvents
|
|
134
|
+
/**
|
|
135
|
+
* 全局观察者事件
|
|
136
|
+
*/
|
|
137
|
+
globalResize: VxeGlobalResize
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 全局日志
|
|
141
|
+
*/
|
|
142
|
+
log: VxeGlobalLog
|
|
96
143
|
|
|
97
144
|
// 扩展插件
|
|
98
145
|
hooks: VxeGlobalHooks
|
|
99
146
|
}
|
|
100
147
|
|
|
101
|
-
export
|
|
148
|
+
export const VxeUI: VxeUIExport
|
|
102
149
|
|
|
103
150
|
export * from './global-config'
|
|
104
151
|
export * from './global-icon'
|
|
152
|
+
export * from './global-theme'
|
|
153
|
+
export * from './global-lang'
|
|
154
|
+
export * from './global-event'
|
|
155
|
+
export * from './global-resize'
|
|
156
|
+
|
|
105
157
|
export * from './renderer'
|
|
106
158
|
export * from './validators'
|
|
107
159
|
export * from './menus'
|
|
@@ -109,7 +161,8 @@ export * from './formats'
|
|
|
109
161
|
export * from './commands'
|
|
110
162
|
export * from './interceptor'
|
|
111
163
|
export * from './clipboard'
|
|
164
|
+
export * from './log'
|
|
112
165
|
|
|
113
166
|
export * from './hooks'
|
|
114
167
|
|
|
115
|
-
export default
|
|
168
|
+
export default VxeUI
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function warnLog(): string
|
|
2
|
+
export function errLog(): string
|
|
3
|
+
|
|
4
|
+
export interface VxeGlobalLog {
|
|
5
|
+
create (type: 'log' | 'warn' | 'error', name?: string): ((key: string, args?: any) => string)
|
|
6
|
+
warn(key: string, args?: any): string
|
|
7
|
+
err(key: string, args?: any): string
|
|
8
|
+
}
|
package/types/core/renderer.d.ts
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable no-use-before-define */
|
|
4
|
-
|
|
5
|
-
type RendererOptions = DefineRendererOption<VxeGlobalRendererHandles.RenderResult>
|
|
6
|
-
|
|
7
|
-
export interface DefineRendererOption<T> {}
|
|
1
|
+
export interface VxeGlobalRendererOptions {}
|
|
8
2
|
|
|
9
3
|
export namespace VxeGlobalRendererHandles {
|
|
10
|
-
export type RenderResult = VxeComponentSlot | VxeComponentSlot[]
|
|
11
4
|
}
|
|
12
5
|
|
|
13
6
|
/**
|
|
14
7
|
* 渲染器
|
|
15
8
|
*/
|
|
16
9
|
export interface VxeGlobalRenderer {
|
|
17
|
-
mixin(options:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
add(name: string, options: RendererOptions): VxeGlobalRenderer
|
|
22
|
-
forEach(callback: (item: DefineRendererOption<VxeGlobalRendererHandles.RenderResult>, name: string, renderMap: {
|
|
23
|
-
[name: string]: RendererOptions
|
|
24
|
-
}) => void): VxeGlobalRenderer
|
|
10
|
+
mixin(options: Record<string, VxeGlobalRendererOptions>): VxeGlobalRenderer
|
|
11
|
+
get(name: string | null | undefined): VxeGlobalRendererOptions
|
|
12
|
+
add(name: string, options: VxeGlobalRendererOptions): VxeGlobalRenderer
|
|
13
|
+
forEach(callback: (item: VxeGlobalRendererOptions, name: string, renderMap: Record<string, VxeGlobalRendererOptions>) => void): VxeGlobalRenderer
|
|
25
14
|
delete(name: string): void
|
|
26
15
|
}
|
package/types/index.d.ts
CHANGED
package/types/tool/common.d.ts
CHANGED
|
@@ -19,43 +19,53 @@ export type defineVxeComponent<
|
|
|
19
19
|
/**
|
|
20
20
|
* 组件通用的基础参数
|
|
21
21
|
*/
|
|
22
|
-
export interface
|
|
22
|
+
export interface VxeComponentBaseOptions {
|
|
23
23
|
xID: string
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* 组件事件参数
|
|
28
28
|
*/
|
|
29
|
-
export interface
|
|
29
|
+
export interface VxeComponentEventParams {
|
|
30
30
|
$event: Event
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* 全局事件默认参数
|
|
35
|
+
*/
|
|
36
|
+
export interface VxeComponentEvent<E = Event> {
|
|
37
|
+
$event: E
|
|
38
|
+
stopPropagation(): void
|
|
39
|
+
preventDefault(): void
|
|
40
|
+
target: any
|
|
41
|
+
}
|
|
42
|
+
|
|
33
43
|
/**
|
|
34
44
|
* 组件尺寸类型
|
|
35
45
|
*/
|
|
36
|
-
export type
|
|
46
|
+
export type VxeComponentSizeType = null | '' | 'medium' | 'small' | 'mini'
|
|
37
47
|
|
|
38
48
|
/**
|
|
39
49
|
* 组件对齐方式
|
|
40
50
|
*/
|
|
41
|
-
export type
|
|
51
|
+
export type VxeComponentAlignType = null | '' | 'left' | 'right' | 'center'
|
|
42
52
|
|
|
43
53
|
/**
|
|
44
54
|
* 组件状态
|
|
45
55
|
*/
|
|
46
|
-
export type
|
|
56
|
+
export type VxeComponentStatusType = null | '' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'error'
|
|
47
57
|
|
|
48
58
|
/**
|
|
49
59
|
* 组件样式类型
|
|
50
60
|
*/
|
|
51
|
-
export type
|
|
61
|
+
export type VxeComponentStyleType = Record<string, string | number>
|
|
52
62
|
|
|
53
63
|
/**
|
|
54
64
|
* 组件 className 类型
|
|
55
65
|
*/
|
|
56
|
-
export type
|
|
66
|
+
export type VxeComponentClassNameType = Record<string, boolean>
|
|
57
67
|
|
|
58
68
|
/**
|
|
59
69
|
* 组件插槽类型
|
|
60
70
|
*/
|
|
61
|
-
export type
|
|
71
|
+
export type VxeComponentSlotType = VNode | string | number
|
package/es/src/theme.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import globalConfigStore from './globalStore';
|
|
2
|
-
export default function setTheme(options) {
|
|
3
|
-
const theme = (options ? options.theme : null) || globalConfigStore.theme || 'default';
|
|
4
|
-
if (typeof document !== 'undefined') {
|
|
5
|
-
const documentElement = document.documentElement;
|
|
6
|
-
if (documentElement) {
|
|
7
|
-
documentElement.setAttribute('data-vxe-theme', theme);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
package/lib/src/theme.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = setTheme;
|
|
7
|
-
var _globalStore = _interopRequireDefault(require("./globalStore"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
function setTheme(options) {
|
|
10
|
-
const theme = (options ? options.theme : null) || _globalStore.default.theme || 'default';
|
|
11
|
-
if (typeof document !== 'undefined') {
|
|
12
|
-
const documentElement = document.documentElement;
|
|
13
|
-
if (documentElement) {
|
|
14
|
-
documentElement.setAttribute('data-vxe-theme', theme);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
package/lib/src/theme.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=setTheme;var _globalStore=_interopRequireDefault(require("./globalStore"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function setTheme(e){var t,e=(e?e.theme:null)||_globalStore.default.theme||"default";"undefined"!=typeof document&&(t=document.documentElement)&&t.setAttribute("data-vxe-theme",e)}
|
package/packages/src/theme.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import globalConfigStore from './globalStore'
|
|
2
|
-
|
|
3
|
-
import { VxeGlobalConfig } from '../../types'
|
|
4
|
-
|
|
5
|
-
export default function setTheme (options?: VxeGlobalConfig) {
|
|
6
|
-
const theme = (options ? options.theme : null) || globalConfigStore.theme || 'default'
|
|
7
|
-
if (typeof document !== 'undefined') {
|
|
8
|
-
const documentElement = document.documentElement
|
|
9
|
-
if (documentElement) {
|
|
10
|
-
documentElement.setAttribute('data-vxe-theme', theme)
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|