@fishawack/lab-velocity 0.3.0 → 0.3.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/basic/Button.vue +99 -0
- package/basic/link.vue +51 -0
- package/form/input.vue +8 -2
- package/package.json +3 -2
package/basic/Button.vue
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-button
|
|
3
|
+
:class="[`button ${baseClass}__button`]"
|
|
4
|
+
:name="name"
|
|
5
|
+
:id="name"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
:round="round"
|
|
8
|
+
:circle="circle"
|
|
9
|
+
:size="size"
|
|
10
|
+
:text="text"
|
|
11
|
+
:tag="tag"
|
|
12
|
+
:autofocus="autofocus"
|
|
13
|
+
:native-type="nativeType"
|
|
14
|
+
:type="type"
|
|
15
|
+
:link="link"
|
|
16
|
+
:plain="plain"
|
|
17
|
+
:loading="loading"
|
|
18
|
+
:customIcon="customIcon"
|
|
19
|
+
:href="href"
|
|
20
|
+
:target="target"
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
<slot />
|
|
24
|
+
|
|
25
|
+
</el-button>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import { ElButton } from "element-plus";
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
props: {
|
|
33
|
+
baseClass: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "vel-button",
|
|
36
|
+
},
|
|
37
|
+
type: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: null,
|
|
40
|
+
},
|
|
41
|
+
nativeType: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "button",
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "default",
|
|
48
|
+
},
|
|
49
|
+
round: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
53
|
+
circle: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
text: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
link: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false,
|
|
64
|
+
},
|
|
65
|
+
plain: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false,
|
|
68
|
+
},
|
|
69
|
+
tag: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: "button",
|
|
72
|
+
},
|
|
73
|
+
loading: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false,
|
|
76
|
+
},
|
|
77
|
+
customIcon: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: null,
|
|
80
|
+
},
|
|
81
|
+
iconClasses: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: "",
|
|
84
|
+
},
|
|
85
|
+
href: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: null,
|
|
88
|
+
},
|
|
89
|
+
target: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: null,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
components: {
|
|
96
|
+
ElButton
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
</script>
|
package/basic/link.vue
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-link
|
|
3
|
+
:class="[`link ${baseClass} vel-link--${size} ${ underline ? 'vel-link--underline' : ''}`]"
|
|
4
|
+
:name="name"
|
|
5
|
+
:underline="true"
|
|
6
|
+
:id="name"
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
:href="href"
|
|
9
|
+
:target="target"
|
|
10
|
+
>
|
|
11
|
+
<slot />
|
|
12
|
+
|
|
13
|
+
</el-link>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import { ElLink } from "element-plus";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
props: {
|
|
21
|
+
baseClass: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "vel-link",
|
|
24
|
+
},
|
|
25
|
+
type: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
underline: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
href: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: null,
|
|
36
|
+
},
|
|
37
|
+
target: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: null,
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "default",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
components: {
|
|
48
|
+
ElLink,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
</script>
|
package/form/input.vue
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
<slot />
|
|
11
11
|
|
|
12
|
-
<div v-if="
|
|
13
|
-
<small v-
|
|
12
|
+
<div v-if="hasError()" class="form__error" :class="{ [baseClass + '__error']: baseClass }">
|
|
13
|
+
<small v-html="hasError()" />
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
@@ -47,5 +47,11 @@ export default {
|
|
|
47
47
|
default: "text",
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
|
+
|
|
51
|
+
methods: {
|
|
52
|
+
hasError() {
|
|
53
|
+
return ((this.$props.error && typeof this.$props.error === 'object' && this.$props.error?.[this.$props.name]?.[0]) || (typeof this.$props.error === 'string' && this.$props.error));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
50
56
|
};
|
|
51
57
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishawack/lab-velocity",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Avalere Health branded style system",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"setup": "npm ci || npm i && npm run content",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"form",
|
|
50
50
|
"components",
|
|
51
51
|
"layout",
|
|
52
|
-
"navigation"
|
|
52
|
+
"navigation",
|
|
53
|
+
"basic"
|
|
53
54
|
],
|
|
54
55
|
"main": "index.js",
|
|
55
56
|
"release": {
|