xianniu-ui 0.3.33 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/style/basic.css +1 -1
- package/lib/style/theme/theme.scss +11 -4
- package/lib/style/theme/variables.scss +1 -4
- package/lib/xianniu-ui.common.js +67965 -4948
- package/lib/xianniu-ui.umd.js +67929 -4912
- package/lib/xianniu-ui.umd.min.js +18 -3
- package/package.json +1 -1
- package/packages/dialog/main.vue +1 -1
- package/packages/style/src/basic.scss +8 -0
- package/packages/style/src/index.scss +1 -0
- package/packages/style/src/tag.scss +35 -0
- package/packages/style/src/theme/theme.scss +11 -4
- package/packages/style/src/theme/variables.scss +1 -4
- package/packages/tag/index.js +7 -0
- package/packages/tag/main.vue +102 -0
- package/src/index.js +3 -1
package/package.json
CHANGED
package/packages/dialog/main.vue
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<slot />
|
|
14
14
|
<span slot="footer">
|
|
15
15
|
<slot name="footer">
|
|
16
|
-
<el-button @click="onClose">取消</el-button>
|
|
16
|
+
<el-button @click="onClose" v-if="$attrs['show-cancel'] !== false">取消</el-button>
|
|
17
17
|
<el-button
|
|
18
18
|
v-if="$attrs['show-confirm'] !== false"
|
|
19
19
|
type="primary"
|
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
.text-danger{color: $--color-danger!important;}
|
|
5
5
|
.text-warning{color: $--color-warning!important;}
|
|
6
6
|
|
|
7
|
+
.text-blue{color: $blue !important;}
|
|
8
|
+
.text-red{color: $red !important;}
|
|
9
|
+
.text-yellow{color: $yellow !important;}
|
|
10
|
+
.text-green{color: $green !important;}
|
|
11
|
+
.text-grey{color: $grey !important;}
|
|
12
|
+
.text-orange{color: $orange !important;}
|
|
13
|
+
|
|
14
|
+
|
|
7
15
|
.fw-1{font-weight: 100 !important;}
|
|
8
16
|
.fw-2{font-weight: 200 !important;}
|
|
9
17
|
.fw-3{font-weight: 300 !important;}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@import "xn-ui/packages/style/src/theme/element-variables.scss";
|
|
2
|
+
.xn-tag {
|
|
3
|
+
&--color {
|
|
4
|
+
&__blue {
|
|
5
|
+
color: $blue;
|
|
6
|
+
border: 1px solid $blue;
|
|
7
|
+
background-color: rgba($color: $blue, $alpha: 0.2);
|
|
8
|
+
}
|
|
9
|
+
&__grey {
|
|
10
|
+
color: $grey;
|
|
11
|
+
border: 1px solid $grey;
|
|
12
|
+
background-color: rgba($color: $grey, $alpha: 0.2);
|
|
13
|
+
}
|
|
14
|
+
&__green {
|
|
15
|
+
color: $green;
|
|
16
|
+
border: 1px solid $green;
|
|
17
|
+
background-color: rgba($color: $green, $alpha: 0.2);
|
|
18
|
+
}
|
|
19
|
+
&__red {
|
|
20
|
+
color: $red;
|
|
21
|
+
border: 1px solid $red;
|
|
22
|
+
background-color: rgba($color: $red, $alpha: 0.2);
|
|
23
|
+
}
|
|
24
|
+
&__orange {
|
|
25
|
+
color: $orange;
|
|
26
|
+
border: 1px solid $orange;
|
|
27
|
+
background-color: rgba($color: $orange, $alpha: 0.2);
|
|
28
|
+
}
|
|
29
|
+
&__yellow {
|
|
30
|
+
color: $yellow;
|
|
31
|
+
border: 1px solid $yellow;
|
|
32
|
+
background-color: rgba($color: $yellow, $alpha: 0.2);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
$--color-primary: #
|
|
2
|
-
$--color-success: #
|
|
3
|
-
$--color-warning: #
|
|
4
|
-
$--color-danger: #
|
|
1
|
+
$--color-primary: #ff745c;
|
|
2
|
+
$--color-success: #52c41a;
|
|
3
|
+
$--color-warning: #faad14;
|
|
4
|
+
$--color-danger: #ff4d4f;
|
|
5
|
+
|
|
6
|
+
$grey: #c1c1c9;
|
|
7
|
+
$blue: #5e9dff;
|
|
8
|
+
$red: #ff4d4f;
|
|
9
|
+
$green: #52c41a;
|
|
10
|
+
$yellow: #ffb500;
|
|
11
|
+
$orange: #ff8c00;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { Tag } from "element-ui";
|
|
3
|
+
export default {
|
|
4
|
+
name: "XnTag",
|
|
5
|
+
extends: Tag,
|
|
6
|
+
props: {
|
|
7
|
+
...Tag.props,
|
|
8
|
+
icon: { type: String },
|
|
9
|
+
className: { type: String },
|
|
10
|
+
defaultColor: {
|
|
11
|
+
type: String,
|
|
12
|
+
validator: (val) => {
|
|
13
|
+
return (
|
|
14
|
+
["grey", "blue", "green", "red", "yellow", "orange"].indexOf(val) !==
|
|
15
|
+
-1
|
|
16
|
+
);
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
computed: {
|
|
21
|
+
getColor() {
|
|
22
|
+
return function (hex, opacity) {
|
|
23
|
+
if (!hex) hex = "#ededed";
|
|
24
|
+
|
|
25
|
+
if (hex.length === 4) {
|
|
26
|
+
var sColorNew = "#";
|
|
27
|
+
for (var i = 1; i < 4; i += 1) {
|
|
28
|
+
sColorNew += hex.slice(i, i + 1).concat(hex.slice(i, i + 1));
|
|
29
|
+
}
|
|
30
|
+
hex = sColorNew;
|
|
31
|
+
}
|
|
32
|
+
let rgba =
|
|
33
|
+
"rgba(" +
|
|
34
|
+
parseInt("0x" + hex.slice(1, 3)) +
|
|
35
|
+
"," +
|
|
36
|
+
parseInt("0x" + hex.slice(3, 5)) +
|
|
37
|
+
"," +
|
|
38
|
+
parseInt("0x" + hex.slice(5, 7)) +
|
|
39
|
+
"," +
|
|
40
|
+
(opacity || "1") +
|
|
41
|
+
")";
|
|
42
|
+
return rgba;
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
render() {
|
|
47
|
+
const { tagSize, hit, effect, icon, className, color, type, defaultColor } =
|
|
48
|
+
this;
|
|
49
|
+
const classes = [
|
|
50
|
+
"el-tag",
|
|
51
|
+
"xn-tag",
|
|
52
|
+
defaultColor ? `xn-tag--color__${defaultColor}` : "",
|
|
53
|
+
type && !color ? `el-tag--${type}` : "",
|
|
54
|
+
tagSize ? `el-tag--${tagSize}` : "",
|
|
55
|
+
effect ? `el-tag--${effect}` : "",
|
|
56
|
+
hit && "is-hit",
|
|
57
|
+
className,
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const _color = (color, effect) => {
|
|
61
|
+
let c = {};
|
|
62
|
+
if (!color) return null;
|
|
63
|
+
switch (effect) {
|
|
64
|
+
case "dark":
|
|
65
|
+
c = {
|
|
66
|
+
border: `1px solid ${color}`,
|
|
67
|
+
backgroundColor: `${color}`,
|
|
68
|
+
};
|
|
69
|
+
break;
|
|
70
|
+
case "light":
|
|
71
|
+
c = {
|
|
72
|
+
border: `1px solid ${color}`,
|
|
73
|
+
color,
|
|
74
|
+
backgroundColor: `${this.getColor(color, 0.2)}`,
|
|
75
|
+
};
|
|
76
|
+
break;
|
|
77
|
+
case "plain":
|
|
78
|
+
c = {
|
|
79
|
+
border: `1px solid ${color}`,
|
|
80
|
+
color,
|
|
81
|
+
backgroundColor: `none`,
|
|
82
|
+
};
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
return c;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const isIcon = this.$slots.icon || (icon && <i class={icon}></i>);
|
|
89
|
+
const tagEl = (
|
|
90
|
+
<span style={{ ..._color(color, effect) }} class={classes}>
|
|
91
|
+
{isIcon} {this.$slots.default}
|
|
92
|
+
</span>
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
return tagEl;
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<style lang="scss" scoped>
|
|
101
|
+
|
|
102
|
+
</style>
|
package/src/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import XnImport from '../packages/import/index'
|
|
|
13
13
|
import XnExport from '../packages/export/index'
|
|
14
14
|
import XnFooter from '../packages/footer/index'
|
|
15
15
|
import XnEmpty from '../packages/empty/index'
|
|
16
|
+
import XnTag from '../packages/tag/index'
|
|
16
17
|
|
|
17
18
|
import Utils from 'xn-ui/src/utils/index'
|
|
18
19
|
const doc = 'http://lzwr.gitee.io/xn-ui/#/'
|
|
@@ -30,7 +31,8 @@ const components = [
|
|
|
30
31
|
XnImport,
|
|
31
32
|
XnExport,
|
|
32
33
|
XnFooter,
|
|
33
|
-
XnEmpty
|
|
34
|
+
XnEmpty,
|
|
35
|
+
XnTag
|
|
34
36
|
]
|
|
35
37
|
const version = require('../package.json').version
|
|
36
38
|
const install = function (Vue) {
|