yy-vue-easytable 2.27.2
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/LICENSE +22 -0
- package/README.md +187 -0
- package/libs/font/demo.css +539 -0
- package/libs/font/demo_index.html +400 -0
- package/libs/font/iconfont.css +57 -0
- package/libs/font/iconfont.eot +0 -0
- package/libs/font/iconfont.js +1 -0
- package/libs/font/iconfont.json +79 -0
- package/libs/font/iconfont.svg +56 -0
- package/libs/font/iconfont.ttf +0 -0
- package/libs/font/iconfont.woff +0 -0
- package/libs/font/iconfont.woff2 +0 -0
- package/libs/locale/lang/af-ZA.js +48 -0
- package/libs/locale/lang/en-US.js +48 -0
- package/libs/locale/lang/fr-FR.js +48 -0
- package/libs/locale/lang/ko-KR.js +48 -0
- package/libs/locale/lang/pt-BR.js +48 -0
- package/libs/locale/lang/ru-RU.js +48 -0
- package/libs/locale/lang/zh-CN.js +48 -0
- package/libs/locale/lang/zh-TW.js +48 -0
- package/libs/locale/lang/zu-ZA.js +48 -0
- package/libs/main.js +1 -0
- package/libs/theme-dark/base.css +1 -0
- package/libs/theme-dark/index.css +1253 -0
- package/libs/theme-dark/var.css +7 -0
- package/libs/theme-dark/ve-checkbox.css +150 -0
- package/libs/theme-dark/ve-contextmenu.css +71 -0
- package/libs/theme-dark/ve-dropdown.css +177 -0
- package/libs/theme-dark/ve-icon.css +10 -0
- package/libs/theme-dark/ve-loading.css +218 -0
- package/libs/theme-dark/ve-pagination.css +136 -0
- package/libs/theme-dark/ve-radio.css +111 -0
- package/libs/theme-dark/ve-select.css +50 -0
- package/libs/theme-dark/ve-table.css +385 -0
- package/libs/theme-default/base.css +1 -0
- package/libs/theme-default/index.css +1253 -0
- package/libs/theme-default/var.css +7 -0
- package/libs/theme-default/ve-checkbox.css +150 -0
- package/libs/theme-default/ve-contextmenu.css +71 -0
- package/libs/theme-default/ve-dropdown.css +177 -0
- package/libs/theme-default/ve-icon.css +10 -0
- package/libs/theme-default/ve-loading.css +218 -0
- package/libs/theme-default/ve-pagination.css +136 -0
- package/libs/theme-default/ve-radio.css +111 -0
- package/libs/theme-default/ve-select.css +50 -0
- package/libs/theme-default/ve-table.css +385 -0
- package/libs/umd/index.js +9 -0
- package/libs/ve-checkbox-group.js +1 -0
- package/libs/ve-checkbox.js +1 -0
- package/libs/ve-contextmenu.js +1 -0
- package/libs/ve-dropdown.js +1 -0
- package/libs/ve-icon.js +1 -0
- package/libs/ve-loading.js +1 -0
- package/libs/ve-locale.js +1 -0
- package/libs/ve-pagination.js +1 -0
- package/libs/ve-radio.js +1 -0
- package/libs/ve-select.js +1 -0
- package/libs/ve-table.js +1 -0
- package/package.json +142 -0
- package/packages/font/demo.css +539 -0
- package/packages/font/demo_index.html +400 -0
- package/packages/font/iconfont.css +57 -0
- package/packages/font/iconfont.eot +0 -0
- package/packages/font/iconfont.js +1 -0
- package/packages/font/iconfont.json +79 -0
- package/packages/font/iconfont.svg +56 -0
- package/packages/font/iconfont.ttf +0 -0
- package/packages/font/iconfont.woff +0 -0
- package/packages/font/iconfont.woff2 +0 -0
- package/packages/index.js +75 -0
- package/packages/src/comps/resize-observer/index.js +2 -0
- package/packages/src/comps/resize-observer/src/index.jsx +38 -0
- package/packages/src/directives/clickoutside.js +31 -0
- package/packages/src/directives/events-outside.js +79 -0
- package/packages/src/directives/focus.js +28 -0
- package/packages/src/locale/index.js +27 -0
- package/packages/src/locale/lang/af-ZA.js +29 -0
- package/packages/src/locale/lang/en-US.js +30 -0
- package/packages/src/locale/lang/fr-FR.js +29 -0
- package/packages/src/locale/lang/ko-KR.js +29 -0
- package/packages/src/locale/lang/pt-BR.js +29 -0
- package/packages/src/locale/lang/ru-RU.js +29 -0
- package/packages/src/locale/lang/zh-CN.js +30 -0
- package/packages/src/locale/lang/zh-TW.js +29 -0
- package/packages/src/locale/lang/zu-ZA.js +29 -0
- package/packages/src/mixins/emitter.js +39 -0
- package/packages/src/utils/animation-frame.js +39 -0
- package/packages/src/utils/auto-resize.js +179 -0
- package/packages/src/utils/constant.js +42 -0
- package/packages/src/utils/dom.js +239 -0
- package/packages/src/utils/event-key-codes.js +53 -0
- package/packages/src/utils/hooks-manager.js +76 -0
- package/packages/src/utils/index.js +161 -0
- package/packages/src/utils/mouse-event.js +24 -0
- package/packages/src/utils/random.js +6 -0
- package/packages/src/utils/request-animation-timeout.js +36 -0
- package/packages/src/utils/resize-event.js +40 -0
- package/packages/src/utils/scroll-bar.js +27 -0
- package/packages/style/ve-checkbox.less +179 -0
- package/packages/style/ve-contextmenu.less +76 -0
- package/packages/style/ve-dropdown.less +204 -0
- package/packages/style/ve-icon.less +3 -0
- package/packages/style/ve-loading.less +242 -0
- package/packages/style/ve-pagination.less +153 -0
- package/packages/style/ve-radio.less +126 -0
- package/packages/style/ve-select.less +48 -0
- package/packages/style/ve-table.less +539 -0
- package/packages/theme-dark/base.less +1 -0
- package/packages/theme-dark/index.less +12 -0
- package/packages/theme-dark/var.less +111 -0
- package/packages/theme-dark/ve-checkbox.less +2 -0
- package/packages/theme-dark/ve-contextmenu.less +2 -0
- package/packages/theme-dark/ve-dropdown.less +2 -0
- package/packages/theme-dark/ve-icon.less +2 -0
- package/packages/theme-dark/ve-loading.less +2 -0
- package/packages/theme-dark/ve-pagination.less +2 -0
- package/packages/theme-dark/ve-radio.less +2 -0
- package/packages/theme-dark/ve-select.less +2 -0
- package/packages/theme-dark/ve-table.less +2 -0
- package/packages/theme-default/base.less +1 -0
- package/packages/theme-default/index.less +12 -0
- package/packages/theme-default/var.less +111 -0
- package/packages/theme-default/ve-checkbox.less +2 -0
- package/packages/theme-default/ve-contextmenu.less +2 -0
- package/packages/theme-default/ve-dropdown.less +2 -0
- package/packages/theme-default/ve-icon.less +2 -0
- package/packages/theme-default/ve-loading.less +2 -0
- package/packages/theme-default/ve-pagination.less +2 -0
- package/packages/theme-default/ve-radio.less +2 -0
- package/packages/theme-default/ve-select.less +2 -0
- package/packages/theme-default/ve-table.less +2 -0
- package/packages/ve-checkbox/index.js +7 -0
- package/packages/ve-checkbox/src/index.jsx +175 -0
- package/packages/ve-checkbox/src/util/constant.js +14 -0
- package/packages/ve-checkbox/src/util/index.js +10 -0
- package/packages/ve-checkbox-group/index.js +7 -0
- package/packages/ve-checkbox-group/src/index.jsx +53 -0
- package/packages/ve-checkbox-group/src/util/constant.js +14 -0
- package/packages/ve-checkbox-group/src/util/index.js +10 -0
- package/packages/ve-contextmenu/index.js +7 -0
- package/packages/ve-contextmenu/src/index.jsx +731 -0
- package/packages/ve-contextmenu/src/util/constant.js +29 -0
- package/packages/ve-contextmenu/src/util/index.js +10 -0
- package/packages/ve-dropdown/index.js +7 -0
- package/packages/ve-dropdown/src/index.jsx +720 -0
- package/packages/ve-dropdown/src/util/constant.js +15 -0
- package/packages/ve-dropdown/src/util/index.js +10 -0
- package/packages/ve-icon/index.js +7 -0
- package/packages/ve-icon/src/index.jsx +52 -0
- package/packages/ve-icon/src/util/constant.js +10 -0
- package/packages/ve-icon/src/util/index.js +10 -0
- package/packages/ve-loading/index.js +8 -0
- package/packages/ve-loading/src/bounce.jsx +50 -0
- package/packages/ve-loading/src/flow.jsx +51 -0
- package/packages/ve-loading/src/grid.jsx +57 -0
- package/packages/ve-loading/src/index.js +106 -0
- package/packages/ve-loading/src/loading.jsx +63 -0
- package/packages/ve-loading/src/plane.jsx +38 -0
- package/packages/ve-loading/src/pulse.jsx +38 -0
- package/packages/ve-loading/src/util/constant.js +31 -0
- package/packages/ve-loading/src/util/index.js +10 -0
- package/packages/ve-loading/src/wave.jsx +53 -0
- package/packages/ve-locale/index.js +28 -0
- package/packages/ve-pagination/index.js +7 -0
- package/packages/ve-pagination/src/index.jsx +304 -0
- package/packages/ve-pagination/src/pager.jsx +166 -0
- package/packages/ve-pagination/src/util/constant.js +16 -0
- package/packages/ve-pagination/src/util/index.js +10 -0
- package/packages/ve-radio/index.js +7 -0
- package/packages/ve-radio/src/index.jsx +121 -0
- package/packages/ve-radio/src/util/constant.js +13 -0
- package/packages/ve-radio/src/util/index.js +10 -0
- package/packages/ve-select/index.js +7 -0
- package/packages/ve-select/src/index.jsx +193 -0
- package/packages/ve-select/src/util/constant.js +13 -0
- package/packages/ve-select/src/util/index.js +10 -0
- package/packages/ve-table/index.js +7 -0
- package/packages/ve-table/src/body/body-checkbox-content.jsx +126 -0
- package/packages/ve-table/src/body/body-radio-content.jsx +113 -0
- package/packages/ve-table/src/body/body-td.jsx +671 -0
- package/packages/ve-table/src/body/body-tr-scrolling.jsx +38 -0
- package/packages/ve-table/src/body/body-tr.jsx +383 -0
- package/packages/ve-table/src/body/expand-tr-icon.jsx +80 -0
- package/packages/ve-table/src/body/expand-tr.jsx +147 -0
- package/packages/ve-table/src/body/index.jsx +943 -0
- package/packages/ve-table/src/colgroup/index.jsx +48 -0
- package/packages/ve-table/src/column-resizer/index.jsx +318 -0
- package/packages/ve-table/src/editor/constant.js +5 -0
- package/packages/ve-table/src/editor/index.jsx +533 -0
- package/packages/ve-table/src/footer/footer-td.jsx +396 -0
- package/packages/ve-table/src/footer/footer-tr.jsx +249 -0
- package/packages/ve-table/src/footer/index.jsx +108 -0
- package/packages/ve-table/src/header/header-checkbox-content.jsx +69 -0
- package/packages/ve-table/src/header/header-filter-content.jsx +100 -0
- package/packages/ve-table/src/header/header-filter-custom-content.jsx +110 -0
- package/packages/ve-table/src/header/header-th.jsx +664 -0
- package/packages/ve-table/src/header/header-tr.jsx +255 -0
- package/packages/ve-table/src/header/index.jsx +195 -0
- package/packages/ve-table/src/index.jsx +4196 -0
- package/packages/ve-table/src/selection/constant.js +5 -0
- package/packages/ve-table/src/selection/index.jsx +1643 -0
- package/packages/ve-table/src/util/clipboard.js +428 -0
- package/packages/ve-table/src/util/constant.js +269 -0
- package/packages/ve-table/src/util/index.js +1585 -0
- package/packages/ve-table/src/util/store.js +14 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// prefix
|
|
2
|
+
export const PREFIX_CLS = "ve-dropdown-";
|
|
3
|
+
|
|
4
|
+
// emit events
|
|
5
|
+
export const EMIT_EVENTS = {
|
|
6
|
+
FILTER_RESET: "on-filter-reset",
|
|
7
|
+
FILTER_CONFIRM: "on-filter-confirm",
|
|
8
|
+
VISIBLE_CHANGE: "on-dropdown-visible-change",
|
|
9
|
+
ITEM_SELECT_CHANGE: "on-item-select-change",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// comps name
|
|
13
|
+
export const COMPS_NAME = {
|
|
14
|
+
VE_DROPDOWN: "VeDropdown",
|
|
15
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ICON_NAMES } from "../../src/utils/constant";
|
|
2
|
+
import { COMPS_NAME } from "./util/constant";
|
|
3
|
+
import { getValByUnit } from "../../src/utils/index.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: COMPS_NAME.VE_ICON,
|
|
7
|
+
|
|
8
|
+
props: {
|
|
9
|
+
// icon name
|
|
10
|
+
name: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
color: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: null,
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
type: [Number, String],
|
|
20
|
+
default: "",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
computed: {
|
|
25
|
+
// icon style
|
|
26
|
+
iconStyle() {
|
|
27
|
+
const { color, size } = this;
|
|
28
|
+
|
|
29
|
+
let result = {
|
|
30
|
+
color,
|
|
31
|
+
"font-size": getValByUnit(size),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return result;
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
// icon name
|
|
38
|
+
iconClass() {
|
|
39
|
+
const { name } = this;
|
|
40
|
+
|
|
41
|
+
if (!Object.values(ICON_NAMES).includes(name)) {
|
|
42
|
+
console.error(`${name} is not found in ${COMPS_NAME.VE_ICON}.`);
|
|
43
|
+
}
|
|
44
|
+
return `iconfont-vet icon-vet-${name}`;
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
render() {
|
|
49
|
+
const { iconStyle, iconClass } = this;
|
|
50
|
+
return <i style={iconStyle} class={["ve-icon", iconClass]} />;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { clsName } from "./util";
|
|
2
|
+
import { COMPS_NAME } from "./util/constant";
|
|
3
|
+
import { getValByUnit } from "../../src/utils/index.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: COMPS_NAME.VE_LOADING_BOUNCE,
|
|
7
|
+
props: {
|
|
8
|
+
color: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
width: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
height: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
// spin style
|
|
23
|
+
spinStyle() {
|
|
24
|
+
const { width, height } = this;
|
|
25
|
+
|
|
26
|
+
let result = {
|
|
27
|
+
width: getValByUnit(width),
|
|
28
|
+
height: getValByUnit(height),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return result;
|
|
32
|
+
},
|
|
33
|
+
itemStyle() {
|
|
34
|
+
const { color } = this;
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
"background-color": color,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
render() {
|
|
42
|
+
const { spinStyle, itemStyle } = this;
|
|
43
|
+
return (
|
|
44
|
+
<div style={spinStyle} class={clsName("bounce")}>
|
|
45
|
+
<div style={itemStyle} class={clsName("bounce-dot")}></div>
|
|
46
|
+
<div style={itemStyle} class={clsName("bounce-dot")}></div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { clsName } from "./util";
|
|
2
|
+
import { COMPS_NAME } from "./util/constant";
|
|
3
|
+
import { getValByUnit } from "../../src/utils/index.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: COMPS_NAME.VE_LOADING_FLOW,
|
|
7
|
+
props: {
|
|
8
|
+
color: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
width: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
height: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
// spin style
|
|
23
|
+
spinStyle() {
|
|
24
|
+
const { width, height } = this;
|
|
25
|
+
|
|
26
|
+
let result = {
|
|
27
|
+
width: getValByUnit(width),
|
|
28
|
+
height: getValByUnit(height),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return result;
|
|
32
|
+
},
|
|
33
|
+
itemStyle() {
|
|
34
|
+
const { color } = this;
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
"background-color": color,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
render() {
|
|
42
|
+
const { spinStyle, itemStyle } = this;
|
|
43
|
+
return (
|
|
44
|
+
<div style={spinStyle} class={clsName("flow")}>
|
|
45
|
+
<div style={itemStyle} class={clsName("flow-dot")}></div>
|
|
46
|
+
<div style={itemStyle} class={clsName("flow-dot")}></div>
|
|
47
|
+
<div style={itemStyle} class={clsName("flow-dot")}></div>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { clsName } from "./util";
|
|
2
|
+
import { COMPS_NAME } from "./util/constant";
|
|
3
|
+
import { getValByUnit } from "../../src/utils/index.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: COMPS_NAME.VE_LOADING_GRID,
|
|
7
|
+
props: {
|
|
8
|
+
color: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
width: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
height: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
// spin style
|
|
23
|
+
spinStyle() {
|
|
24
|
+
const { width, height } = this;
|
|
25
|
+
|
|
26
|
+
let result = {
|
|
27
|
+
width: getValByUnit(width),
|
|
28
|
+
height: getValByUnit(height),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return result;
|
|
32
|
+
},
|
|
33
|
+
itemStyle() {
|
|
34
|
+
const { color } = this;
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
"background-color": color,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
render() {
|
|
42
|
+
const { spinStyle, itemStyle } = this;
|
|
43
|
+
return (
|
|
44
|
+
<div style={spinStyle} class={clsName("grid")}>
|
|
45
|
+
<div style={itemStyle} class={clsName("grid-cube")}></div>
|
|
46
|
+
<div style={itemStyle} class={clsName("grid-cube")}></div>
|
|
47
|
+
<div style={itemStyle} class={clsName("grid-cube")}></div>
|
|
48
|
+
<div style={itemStyle} class={clsName("grid-cube")}></div>
|
|
49
|
+
<div style={itemStyle} class={clsName("grid-cube")}></div>
|
|
50
|
+
<div style={itemStyle} class={clsName("grid-cube")}></div>
|
|
51
|
+
<div style={itemStyle} class={clsName("grid-cube")}></div>
|
|
52
|
+
<div style={itemStyle} class={clsName("grid-cube")}></div>
|
|
53
|
+
<div style={itemStyle} class={clsName("grid-cube")}></div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import Vue from "vue";
|
|
2
|
+
import VeLoading from "./loading.jsx";
|
|
3
|
+
import { addClass, removeClass } from "../../src/utils/dom";
|
|
4
|
+
import { clsName } from "./util";
|
|
5
|
+
import { SPIN_NAMES, COMPS_NAME } from "../src/util/constant";
|
|
6
|
+
|
|
7
|
+
// default options
|
|
8
|
+
const defaultOptions = {
|
|
9
|
+
name: "plane",
|
|
10
|
+
visible: false,
|
|
11
|
+
color: "#1890ff",
|
|
12
|
+
overlayBackgroundColor: "rgba(255, 255, 255, 0.5)",
|
|
13
|
+
width: 40,
|
|
14
|
+
height: 40,
|
|
15
|
+
tip: "",
|
|
16
|
+
fullscreen: false,
|
|
17
|
+
target: "",
|
|
18
|
+
lock: false,
|
|
19
|
+
// parent “__parent__”会被忽略
|
|
20
|
+
parent__: null,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// parent relative class
|
|
24
|
+
const PARENT_RELATIVE_CLASS = clsName("parent-relative");
|
|
25
|
+
// parent lock class
|
|
26
|
+
const PARENT_LOCK_CLASS = clsName("parent-lock");
|
|
27
|
+
|
|
28
|
+
const LoadingConstructor = Vue.extend(VeLoading);
|
|
29
|
+
|
|
30
|
+
// show
|
|
31
|
+
LoadingConstructor.prototype.show = function () {
|
|
32
|
+
Vue.nextTick(() => {
|
|
33
|
+
if (this.lock) {
|
|
34
|
+
addClass(this.parent__, PARENT_LOCK_CLASS);
|
|
35
|
+
}
|
|
36
|
+
this.visible = true;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// close
|
|
41
|
+
LoadingConstructor.prototype.close = function () {
|
|
42
|
+
Vue.nextTick(() => {
|
|
43
|
+
if (this.lock) {
|
|
44
|
+
removeClass(this.parent__, PARENT_LOCK_CLASS);
|
|
45
|
+
}
|
|
46
|
+
this.visible = false;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// destroy
|
|
51
|
+
LoadingConstructor.prototype.destroy = function () {
|
|
52
|
+
removeClass(this.parent__, PARENT_RELATIVE_CLASS);
|
|
53
|
+
removeClass(this.parent__, PARENT_LOCK_CLASS);
|
|
54
|
+
|
|
55
|
+
if (this.$el && this.$el.parentNode) {
|
|
56
|
+
this.$el.parentNode.removeChild(this.$el);
|
|
57
|
+
}
|
|
58
|
+
this.$destroy();
|
|
59
|
+
this.visible = false;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// create instance
|
|
63
|
+
function createInstance(options = {}) {
|
|
64
|
+
return new LoadingConstructor({
|
|
65
|
+
el: document.createElement("div"),
|
|
66
|
+
data: options,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// check spin name
|
|
71
|
+
function checkSpinName(name) {
|
|
72
|
+
if (!Object.values(SPIN_NAMES).includes(name)) {
|
|
73
|
+
console.error(`${name} is not found in ${COMPS_NAME.VE_LOADING}.`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Loading instance
|
|
78
|
+
function Loading(options = {}) {
|
|
79
|
+
options = Object.assign({}, defaultOptions, options);
|
|
80
|
+
|
|
81
|
+
if (typeof options.target === "string" && options.target.length > 0) {
|
|
82
|
+
options.target = document.querySelector(options.target);
|
|
83
|
+
}
|
|
84
|
+
options.target = options.target || document.body;
|
|
85
|
+
|
|
86
|
+
checkSpinName(options.name);
|
|
87
|
+
|
|
88
|
+
if (options.target !== document.body) {
|
|
89
|
+
options.fullscreen = false;
|
|
90
|
+
} else {
|
|
91
|
+
options.fullscreen = true;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let loadingInstance = createInstance(options);
|
|
95
|
+
|
|
96
|
+
// set parent
|
|
97
|
+
options.parent__ = options.fullscreen ? document.body : options.target;
|
|
98
|
+
|
|
99
|
+
addClass(options.parent__, PARENT_RELATIVE_CLASS);
|
|
100
|
+
|
|
101
|
+
options.parent__.appendChild(loadingInstance.$el);
|
|
102
|
+
|
|
103
|
+
return loadingInstance;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export default Loading;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* thanks for https://github.com/tobiasahlin/SpinKit*/
|
|
2
|
+
|
|
3
|
+
import { clsName } from "./util";
|
|
4
|
+
import { COMPS_NAME } from "../src/util/constant";
|
|
5
|
+
import Plane from "./plane";
|
|
6
|
+
import Bounce from "./bounce";
|
|
7
|
+
import Wave from "./wave";
|
|
8
|
+
import Pulse from "./pulse";
|
|
9
|
+
import Flow from "./flow";
|
|
10
|
+
import Grid from "./grid";
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: COMPS_NAME.VE_LOADING,
|
|
14
|
+
components: { Plane, Bounce, Wave, Pulse, Flow, Grid },
|
|
15
|
+
computed: {
|
|
16
|
+
// loading class
|
|
17
|
+
loadingClass() {
|
|
18
|
+
const { visible, fullscreen } = this;
|
|
19
|
+
return {
|
|
20
|
+
[clsName("overlay")]: true,
|
|
21
|
+
[clsName("fixed")]: fullscreen,
|
|
22
|
+
[clsName("hide")]: !visible,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
// loading style
|
|
27
|
+
loadingStyle() {
|
|
28
|
+
const { overlayBackgroundColor } = this;
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
"background-color": overlayBackgroundColor,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
render() {
|
|
37
|
+
const { width, height, color } = this;
|
|
38
|
+
|
|
39
|
+
const spinProps = {
|
|
40
|
+
props: {
|
|
41
|
+
width,
|
|
42
|
+
height,
|
|
43
|
+
color,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div
|
|
49
|
+
style={this.loadingStyle}
|
|
50
|
+
class={["ve-loading", this.loadingClass]}
|
|
51
|
+
>
|
|
52
|
+
<div class={clsName("spin-container")}>
|
|
53
|
+
<div class={clsName("spin")}>
|
|
54
|
+
<this.name {...spinProps}></this.name>
|
|
55
|
+
</div>
|
|
56
|
+
<div style={{ color: color }} class={clsName("spin-tip")}>
|
|
57
|
+
{this.tip}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { clsName } from "./util";
|
|
2
|
+
import { COMPS_NAME } from "./util/constant";
|
|
3
|
+
import { getValByUnit } from "../../src/utils/index.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: COMPS_NAME.VE_LOADING_PLANE,
|
|
7
|
+
props: {
|
|
8
|
+
color: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
width: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
height: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
// spin style
|
|
23
|
+
spinStyle() {
|
|
24
|
+
const { color, width, height } = this;
|
|
25
|
+
|
|
26
|
+
let result = {
|
|
27
|
+
width: getValByUnit(width),
|
|
28
|
+
height: getValByUnit(height),
|
|
29
|
+
"background-color": color,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return result;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
render() {
|
|
36
|
+
return <div style={this.spinStyle} class={clsName("plane")} />;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { clsName } from "./util";
|
|
2
|
+
import { COMPS_NAME } from "./util/constant";
|
|
3
|
+
import { getValByUnit } from "../../src/utils/index.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: COMPS_NAME.VE_LOADING_PULSE,
|
|
7
|
+
props: {
|
|
8
|
+
color: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
width: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
height: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
// spin style
|
|
23
|
+
spinStyle() {
|
|
24
|
+
const { color, width, height } = this;
|
|
25
|
+
|
|
26
|
+
let result = {
|
|
27
|
+
width: getValByUnit(width),
|
|
28
|
+
height: getValByUnit(height),
|
|
29
|
+
"background-color": color,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return result;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
render() {
|
|
36
|
+
return <div style={this.spinStyle} class={clsName("pulse")} />;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// prefix
|
|
2
|
+
export const PREFIX_CLS = "ve-loading-";
|
|
3
|
+
|
|
4
|
+
// emit events
|
|
5
|
+
export const EMIT_EVENTS = {};
|
|
6
|
+
|
|
7
|
+
// comps name
|
|
8
|
+
export const COMPS_NAME = {
|
|
9
|
+
VE_LOADING: "VeLoading",
|
|
10
|
+
VE_LOADING_PLANE: "VeLoadingPlane",
|
|
11
|
+
/* VE_LOADING_CHASE: "VeLoadingChase", */
|
|
12
|
+
VE_LOADING_BOUNCE: "VeLoadingBounce",
|
|
13
|
+
VE_LOADING_WAVE: "VeLoadingWave",
|
|
14
|
+
VE_LOADING_PULSE: "VeLoadingPulse",
|
|
15
|
+
VE_LOADING_FLOW: "VeLoadingFlow",
|
|
16
|
+
/* VE_LOADING_SWING: "VeLoadingSwing", */
|
|
17
|
+
/* VE_LOADING_CIRCLE: "VeLoadingCircle",
|
|
18
|
+
VE_LOADING_CIRCLE_FADE: "VeLoadingCircleFade", */
|
|
19
|
+
VE_LOADING_GRID: "VeLoadingGrid",
|
|
20
|
+
VE_LOADING_FOLD: "VeLoadingFold",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// spin name
|
|
24
|
+
export const SPIN_NAMES = {
|
|
25
|
+
PLANE: "plane",
|
|
26
|
+
GRID: "grid",
|
|
27
|
+
WAVE: "wave",
|
|
28
|
+
FLOW: "flow",
|
|
29
|
+
BOUNCE: "bounce",
|
|
30
|
+
PULSE: "pulse",
|
|
31
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { clsName } from "./util";
|
|
2
|
+
import { COMPS_NAME } from "./util/constant";
|
|
3
|
+
import { getValByUnit } from "../../src/utils/index.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: COMPS_NAME.VE_LOADING_WAVE,
|
|
7
|
+
props: {
|
|
8
|
+
color: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
width: {
|
|
13
|
+
type: [Number, String],
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
height: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
computed: {
|
|
22
|
+
// spin style
|
|
23
|
+
spinStyle() {
|
|
24
|
+
const { width, height } = this;
|
|
25
|
+
|
|
26
|
+
let result = {
|
|
27
|
+
width: getValByUnit(width),
|
|
28
|
+
height: getValByUnit(height),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return result;
|
|
32
|
+
},
|
|
33
|
+
itemStyle() {
|
|
34
|
+
const { color } = this;
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
"background-color": color,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
render() {
|
|
42
|
+
const { spinStyle, itemStyle } = this;
|
|
43
|
+
return (
|
|
44
|
+
<div style={spinStyle} class={clsName("wave")}>
|
|
45
|
+
<div style={itemStyle} class={clsName("wave-rect")}></div>
|
|
46
|
+
<div style={itemStyle} class={clsName("wave-rect")}></div>
|
|
47
|
+
<div style={itemStyle} class={clsName("wave-rect")}></div>
|
|
48
|
+
<div style={itemStyle} class={clsName("wave-rect")}></div>
|
|
49
|
+
<div style={itemStyle} class={clsName("wave-rect")}></div>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Vue from "vue";
|
|
2
|
+
import { merge, cloneDeep } from "lodash";
|
|
3
|
+
import defaultLang from "vue-easytable/packages/src/locale/lang/en-US";
|
|
4
|
+
|
|
5
|
+
const { defineReactive } = Vue.util;
|
|
6
|
+
const proto = Vue.prototype;
|
|
7
|
+
|
|
8
|
+
proto.$veTableMessages = proto.$veTableMessages || {};
|
|
9
|
+
|
|
10
|
+
defineReactive(
|
|
11
|
+
proto,
|
|
12
|
+
"$veTableMessages",
|
|
13
|
+
cloneDeep({
|
|
14
|
+
lang: defaultLang,
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
getMessage() {
|
|
20
|
+
return proto.$veTableMessages.lang;
|
|
21
|
+
},
|
|
22
|
+
use(lang) {
|
|
23
|
+
this.update(lang);
|
|
24
|
+
},
|
|
25
|
+
update(lang = {}) {
|
|
26
|
+
merge(proto.$veTableMessages.lang, lang);
|
|
27
|
+
},
|
|
28
|
+
};
|