@can2421/ui-components 1.0.55 → 1.0.57
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/button/button.types.d.ts +23 -2
- package/dist/button/button.vue.d.ts +15 -2
- package/dist/styles/button.css +92 -49
- package/dist/styles/button.scss +110 -58
- package/dist/styles/index.css +97 -49
- package/dist/styles/var.css +5 -0
- package/dist/styles/var.scss +10 -0
- package/dist/ui-components.mjs +54 -32
- package/dist/ui-components.umd.js +2 -2
- package/package.json +1 -1
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
export type ButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
2
|
+
export type ButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | '';
|
|
3
|
+
export type ButtonSize = 'large' | 'small' | '';
|
|
3
4
|
export declare const buttonProps: {
|
|
4
5
|
readonly type: {
|
|
5
6
|
readonly type: PropType<ButtonType>;
|
|
6
7
|
readonly default: "";
|
|
7
8
|
};
|
|
8
|
-
readonly size:
|
|
9
|
+
readonly size: {
|
|
10
|
+
readonly type: PropType<ButtonSize>;
|
|
11
|
+
readonly default: "";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* 是否禁用
|
|
15
|
+
*/
|
|
9
16
|
readonly disabled: BooleanConstructor;
|
|
17
|
+
/**
|
|
18
|
+
* 原始按钮
|
|
19
|
+
*/
|
|
10
20
|
readonly plain: BooleanConstructor;
|
|
21
|
+
/**
|
|
22
|
+
* 圆角按钮
|
|
23
|
+
*/
|
|
11
24
|
readonly round: BooleanConstructor;
|
|
25
|
+
/**
|
|
26
|
+
* 原型按钮
|
|
27
|
+
*/
|
|
28
|
+
readonly circle: BooleanConstructor;
|
|
29
|
+
/**
|
|
30
|
+
* 链接按钮
|
|
31
|
+
*/
|
|
32
|
+
readonly link: BooleanConstructor;
|
|
12
33
|
};
|
|
13
34
|
export type ButtonProps = ExtractPropTypes<typeof buttonProps>;
|
|
@@ -12,24 +12,37 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
12
12
|
readonly type: import('vue').PropType<import('./button.types').ButtonType>;
|
|
13
13
|
readonly default: "";
|
|
14
14
|
};
|
|
15
|
-
readonly size:
|
|
15
|
+
readonly size: {
|
|
16
|
+
readonly type: import('vue').PropType<import('./button.types').ButtonSize>;
|
|
17
|
+
readonly default: "";
|
|
18
|
+
};
|
|
16
19
|
readonly disabled: BooleanConstructor;
|
|
17
20
|
readonly plain: BooleanConstructor;
|
|
18
21
|
readonly round: BooleanConstructor;
|
|
22
|
+
readonly circle: BooleanConstructor;
|
|
23
|
+
readonly link: BooleanConstructor;
|
|
19
24
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
25
|
readonly type: {
|
|
21
26
|
readonly type: import('vue').PropType<import('./button.types').ButtonType>;
|
|
22
27
|
readonly default: "";
|
|
23
28
|
};
|
|
24
|
-
readonly size:
|
|
29
|
+
readonly size: {
|
|
30
|
+
readonly type: import('vue').PropType<import('./button.types').ButtonSize>;
|
|
31
|
+
readonly default: "";
|
|
32
|
+
};
|
|
25
33
|
readonly disabled: BooleanConstructor;
|
|
26
34
|
readonly plain: BooleanConstructor;
|
|
27
35
|
readonly round: BooleanConstructor;
|
|
36
|
+
readonly circle: BooleanConstructor;
|
|
37
|
+
readonly link: BooleanConstructor;
|
|
28
38
|
}>> & Readonly<{}>, {
|
|
29
39
|
readonly type: import('./button.types').ButtonType;
|
|
40
|
+
readonly size: import('./button.types').ButtonSize;
|
|
30
41
|
readonly disabled: boolean;
|
|
31
42
|
readonly plain: boolean;
|
|
32
43
|
readonly round: boolean;
|
|
44
|
+
readonly circle: boolean;
|
|
45
|
+
readonly link: boolean;
|
|
33
46
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
|
|
34
47
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
35
48
|
export default _default;
|
package/dist/styles/button.css
CHANGED
|
@@ -1,125 +1,168 @@
|
|
|
1
1
|
.c-button {
|
|
2
|
-
|
|
2
|
+
--c-button-size: 32px;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
3
6
|
padding: 5px 15px;
|
|
7
|
+
height: var(--c-button-size);
|
|
8
|
+
line-height: 1;
|
|
4
9
|
border-radius: 4px;
|
|
5
10
|
background: #fff;
|
|
6
11
|
outline: none;
|
|
7
12
|
color: #606266;
|
|
8
13
|
font-size: 14px;
|
|
9
14
|
border: 1px solid #dcdfe6;
|
|
15
|
+
white-space: nowrap;
|
|
10
16
|
cursor: pointer;
|
|
11
17
|
user-select: none;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
transition: transform 0.1s;
|
|
12
20
|
}
|
|
13
21
|
.c-button ~ .c-button {
|
|
14
|
-
margin-left:
|
|
22
|
+
margin-left: 12px;
|
|
15
23
|
}
|
|
16
|
-
.c-button
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
color: var(--c-color-primary);
|
|
24
|
+
.c-button.is-disabled {
|
|
25
|
+
opacity: 0.5;
|
|
26
|
+
cursor: not-allowed;
|
|
20
27
|
}
|
|
21
|
-
.c-button
|
|
28
|
+
.c-button:not(.is-disabled):hover {
|
|
22
29
|
opacity: 0.8;
|
|
23
30
|
}
|
|
24
|
-
.c-button:
|
|
31
|
+
.c-button:not(.is-disabled):active {
|
|
25
32
|
transform: scale(0.95);
|
|
26
33
|
}
|
|
27
|
-
.c-button
|
|
28
|
-
opacity: 0.5;
|
|
29
|
-
cursor: not-allowed;
|
|
30
|
-
}
|
|
31
|
-
.c-button--round {
|
|
34
|
+
.c-button.is-round {
|
|
32
35
|
border-radius: 20px;
|
|
33
36
|
}
|
|
34
|
-
.c-button
|
|
37
|
+
.c-button.is-plain {
|
|
35
38
|
background: #fff;
|
|
36
39
|
border: 1px solid #dcdfe6;
|
|
37
40
|
color: #606266;
|
|
38
41
|
}
|
|
39
|
-
.c-button
|
|
42
|
+
.c-button.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
40
43
|
border-color: var(--c-color-primary);
|
|
41
44
|
color: var(--c-color-primary);
|
|
42
45
|
}
|
|
46
|
+
.c-button:not(.c-button--primary):not(.c-button--danger):not(.c-button--warning):not(.c-button--info):not(.c-button--success):not(.is-link):not(.is-plain):not(.is-disabled):hover {
|
|
47
|
+
border-color: #57abff;
|
|
48
|
+
background: #ecf5ff;
|
|
49
|
+
color: var(--c-color-primary);
|
|
50
|
+
}
|
|
43
51
|
.c-button--primary {
|
|
44
52
|
background: var(--c-color-primary);
|
|
45
53
|
border-color: var(--c-color-primary);
|
|
46
54
|
color: #fff;
|
|
47
55
|
}
|
|
48
|
-
.c-button--primary.
|
|
56
|
+
.c-button--primary.is-plain {
|
|
49
57
|
background: #ecf5ff;
|
|
50
58
|
border: 1px solid var(--c-color-primary);
|
|
51
59
|
color: var(--c-color-primary);
|
|
52
60
|
}
|
|
53
|
-
.c-button--primary.
|
|
61
|
+
.c-button--primary.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
54
62
|
background: var(--c-color-primary);
|
|
55
63
|
border-color: var(--c-color-primary);
|
|
56
64
|
color: #fff;
|
|
57
65
|
}
|
|
58
66
|
.c-button--success {
|
|
59
|
-
background:
|
|
60
|
-
border-color:
|
|
67
|
+
background: var(--c-color-success);
|
|
68
|
+
border-color: var(--c-color-success);
|
|
61
69
|
color: #fff;
|
|
62
70
|
}
|
|
63
|
-
.c-button--success.
|
|
71
|
+
.c-button--success.is-plain {
|
|
64
72
|
background: #f0f9eb;
|
|
65
|
-
border: 1px solid
|
|
66
|
-
color:
|
|
73
|
+
border: 1px solid var(--c-color-success);
|
|
74
|
+
color: var(--c-color-success);
|
|
67
75
|
}
|
|
68
|
-
.c-button--success.
|
|
69
|
-
background:
|
|
70
|
-
border-color:
|
|
76
|
+
.c-button--success.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
77
|
+
background: var(--c-color-success);
|
|
78
|
+
border-color: var(--c-color-success);
|
|
71
79
|
color: #fff;
|
|
72
80
|
}
|
|
73
81
|
.c-button--warning {
|
|
74
|
-
background:
|
|
75
|
-
border-color:
|
|
82
|
+
background: var(--c-color-warning);
|
|
83
|
+
border-color: var(--c-color-warning);
|
|
76
84
|
color: #fff;
|
|
77
85
|
}
|
|
78
|
-
.c-button--warning.
|
|
86
|
+
.c-button--warning.is-plain {
|
|
79
87
|
background: #fdf6ec;
|
|
80
|
-
border: 1px solid
|
|
81
|
-
color:
|
|
88
|
+
border: 1px solid var(--c-color-warning);
|
|
89
|
+
color: var(--c-color-warning);
|
|
82
90
|
}
|
|
83
|
-
.c-button--warning.
|
|
84
|
-
background:
|
|
85
|
-
border-color:
|
|
91
|
+
.c-button--warning.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
92
|
+
background: var(--c-color-warning);
|
|
93
|
+
border-color: var(--c-color-warning);
|
|
86
94
|
color: #fff;
|
|
87
95
|
}
|
|
88
96
|
.c-button--info {
|
|
89
|
-
background:
|
|
90
|
-
border-color:
|
|
97
|
+
background: var(--c-color-info);
|
|
98
|
+
border-color: var(--c-color-info);
|
|
91
99
|
color: #fff;
|
|
92
100
|
}
|
|
93
|
-
.c-button--info.
|
|
101
|
+
.c-button--info.is-plain {
|
|
94
102
|
background: #f4f4f5;
|
|
95
|
-
border: 1px solid
|
|
96
|
-
color:
|
|
103
|
+
border: 1px solid var(--c-color-info);
|
|
104
|
+
color: var(--c-color-info);
|
|
97
105
|
}
|
|
98
|
-
.c-button--info.
|
|
99
|
-
background:
|
|
100
|
-
border-color:
|
|
106
|
+
.c-button--info.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
107
|
+
background: var(--c-color-info);
|
|
108
|
+
border-color: var(--c-color-info);
|
|
101
109
|
color: #fff;
|
|
102
110
|
}
|
|
103
111
|
.c-button--danger {
|
|
104
|
-
background:
|
|
105
|
-
border-color:
|
|
112
|
+
background: var(--c-color-danger);
|
|
113
|
+
border-color: var(--c-color-danger);
|
|
106
114
|
color: #fff;
|
|
107
115
|
}
|
|
108
|
-
.c-button--danger.
|
|
116
|
+
.c-button--danger.is-plain {
|
|
109
117
|
background: #fef0f0;
|
|
110
|
-
border: 1px solid
|
|
111
|
-
color:
|
|
118
|
+
border: 1px solid var(--c-color-danger);
|
|
119
|
+
color: var(--c-color-danger);
|
|
112
120
|
}
|
|
113
|
-
.c-button--danger.
|
|
114
|
-
background:
|
|
115
|
-
border-color:
|
|
121
|
+
.c-button--danger.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
122
|
+
background: var(--c-color-danger);
|
|
123
|
+
border-color: var(--c-color-danger);
|
|
116
124
|
color: #fff;
|
|
117
125
|
}
|
|
126
|
+
.c-button.is-circle:not(.is-link) {
|
|
127
|
+
padding: 8px;
|
|
128
|
+
width: var(--c-button-size);
|
|
129
|
+
border-radius: 50%;
|
|
130
|
+
aspect-ratio: 1;
|
|
131
|
+
}
|
|
118
132
|
.c-button--small {
|
|
133
|
+
--c-button-size: 24px;
|
|
119
134
|
padding: 2px 7px;
|
|
120
135
|
font-size: 12px;
|
|
121
136
|
}
|
|
137
|
+
.c-button--small.is-circle {
|
|
138
|
+
padding: 4px;
|
|
139
|
+
}
|
|
122
140
|
.c-button--large {
|
|
141
|
+
--c-button-size: 40px;
|
|
123
142
|
padding: 8px 19px;
|
|
124
143
|
font-size: 14px;
|
|
144
|
+
}
|
|
145
|
+
.c-button--large.is-circle {
|
|
146
|
+
padding: 12px;
|
|
147
|
+
}
|
|
148
|
+
.c-button.is-link {
|
|
149
|
+
padding: 2px;
|
|
150
|
+
height: auto;
|
|
151
|
+
background-color: transparent;
|
|
152
|
+
border-color: transparent;
|
|
153
|
+
}
|
|
154
|
+
.c-button.is-link.c-button--primary {
|
|
155
|
+
color: var(--c-color-primary);
|
|
156
|
+
}
|
|
157
|
+
.c-button.is-link.c-button--danger {
|
|
158
|
+
color: var(--c-color-danger);
|
|
159
|
+
}
|
|
160
|
+
.c-button.is-link.c-button--info {
|
|
161
|
+
color: var(--c-color-info);
|
|
162
|
+
}
|
|
163
|
+
.c-button.is-link.c-button--warning {
|
|
164
|
+
color: var(--c-color-warning);
|
|
165
|
+
}
|
|
166
|
+
.c-button.is-link.c-button--success {
|
|
167
|
+
color: var(--c-color-success);
|
|
125
168
|
}
|
package/dist/styles/button.scss
CHANGED
|
@@ -3,56 +3,54 @@
|
|
|
3
3
|
@use './mixins.scss' as *;
|
|
4
4
|
|
|
5
5
|
@include b(button) {
|
|
6
|
-
|
|
6
|
+
--#{$namespace}-button-size: 32px;
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
7
10
|
padding: 5px 15px;
|
|
11
|
+
height: var(--#{$namespace}-button-size);
|
|
12
|
+
line-height: 1;
|
|
8
13
|
border-radius: 4px;
|
|
9
14
|
background: #fff;
|
|
10
15
|
outline: none;
|
|
11
16
|
color: #606266;
|
|
12
17
|
font-size: 14px;
|
|
13
18
|
border: 1px solid #dcdfe6;
|
|
19
|
+
white-space: nowrap;
|
|
14
20
|
cursor: pointer;
|
|
15
21
|
user-select: none;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
transition: transform 0.1s;
|
|
16
24
|
|
|
17
25
|
& ~ & {
|
|
18
|
-
margin-left:
|
|
26
|
+
margin-left: 12px;
|
|
19
27
|
}
|
|
20
28
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
background: #ecf5ff;
|
|
25
|
-
color: getCssVar('color', 'primary');
|
|
26
|
-
}
|
|
29
|
+
&.is-disabled {
|
|
30
|
+
opacity: 0.5;
|
|
31
|
+
cursor: not-allowed;
|
|
27
32
|
}
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
&:
|
|
31
|
-
|
|
32
|
-
opacity: 0.8;
|
|
33
|
-
}
|
|
34
|
+
&:not(.is-disabled) {
|
|
35
|
+
&:hover {
|
|
36
|
+
opacity: 0.8;
|
|
34
37
|
}
|
|
35
|
-
}
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
&--disabled {
|
|
42
|
-
opacity: 0.5;
|
|
43
|
-
cursor: not-allowed;
|
|
39
|
+
&:active {
|
|
40
|
+
transform: scale(0.95);
|
|
41
|
+
}
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
|
|
44
|
+
&.is-round {
|
|
47
45
|
border-radius: 20px;
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
&.is-plain {
|
|
51
49
|
background: #fff;
|
|
52
50
|
border: 1px solid #dcdfe6;
|
|
53
51
|
color: #606266;
|
|
54
52
|
|
|
55
|
-
&:not(
|
|
53
|
+
&:not(.is-disabled):not(.is-link) {
|
|
56
54
|
&:hover {
|
|
57
55
|
border-color: getCssVar('color', 'primary');
|
|
58
56
|
color: getCssVar('color', 'primary');
|
|
@@ -60,17 +58,25 @@
|
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
60
|
|
|
61
|
+
&:not(&--primary):not(&--danger):not(&--warning):not(&--info):not(&--success):not(.is-link):not(.is-plain):not(.is-disabled) {
|
|
62
|
+
&:hover {
|
|
63
|
+
border-color: #57abff;
|
|
64
|
+
background: #ecf5ff;
|
|
65
|
+
color: getCssVar('color', 'primary');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
63
69
|
&--primary {
|
|
64
70
|
background: getCssVar('color', 'primary');
|
|
65
71
|
border-color: getCssVar('color', 'primary');
|
|
66
72
|
color: #fff;
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
&.is-plain {
|
|
69
75
|
background: #ecf5ff;
|
|
70
76
|
border: 1px solid getCssVar('color', 'primary');
|
|
71
77
|
color: getCssVar('color', 'primary');
|
|
72
78
|
|
|
73
|
-
&:not(
|
|
79
|
+
&:not(.is-disabled):not(.is-link) {
|
|
74
80
|
&:hover {
|
|
75
81
|
background: getCssVar('color', 'primary');
|
|
76
82
|
border-color: getCssVar('color', 'primary');
|
|
@@ -81,19 +87,19 @@
|
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
&--success {
|
|
84
|
-
background:
|
|
85
|
-
border-color:
|
|
90
|
+
background: getCssVar('color', 'success');
|
|
91
|
+
border-color: getCssVar('color', 'success');
|
|
86
92
|
color: #fff;
|
|
87
93
|
|
|
88
|
-
|
|
94
|
+
&.is-plain {
|
|
89
95
|
background: #f0f9eb;
|
|
90
|
-
border: 1px solid
|
|
91
|
-
color:
|
|
96
|
+
border: 1px solid getCssVar('color', 'success');
|
|
97
|
+
color: getCssVar('color', 'success');
|
|
92
98
|
|
|
93
|
-
&:not(
|
|
99
|
+
&:not(.is-disabled):not(.is-link) {
|
|
94
100
|
&:hover {
|
|
95
|
-
background:
|
|
96
|
-
border-color:
|
|
101
|
+
background: getCssVar('color', 'success');
|
|
102
|
+
border-color: getCssVar('color', 'success');
|
|
97
103
|
color: #fff;
|
|
98
104
|
}
|
|
99
105
|
}
|
|
@@ -101,19 +107,19 @@
|
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
&--warning {
|
|
104
|
-
background:
|
|
105
|
-
border-color:
|
|
110
|
+
background: getCssVar('color', 'warning');
|
|
111
|
+
border-color: getCssVar('color', 'warning');
|
|
106
112
|
color: #fff;
|
|
107
113
|
|
|
108
|
-
|
|
114
|
+
&.is-plain {
|
|
109
115
|
background: #fdf6ec;
|
|
110
|
-
border: 1px solid
|
|
111
|
-
color:
|
|
116
|
+
border: 1px solid getCssVar('color', 'warning');
|
|
117
|
+
color: getCssVar('color', 'warning');
|
|
112
118
|
|
|
113
|
-
&:not(
|
|
119
|
+
&:not(.is-disabled):not(.is-link) {
|
|
114
120
|
&:hover {
|
|
115
|
-
background:
|
|
116
|
-
border-color:
|
|
121
|
+
background: getCssVar('color', 'warning');
|
|
122
|
+
border-color: getCssVar('color', 'warning');
|
|
117
123
|
color: #fff;
|
|
118
124
|
}
|
|
119
125
|
}
|
|
@@ -121,19 +127,19 @@
|
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
&--info {
|
|
124
|
-
background:
|
|
125
|
-
border-color:
|
|
130
|
+
background: getCssVar('color', 'info');
|
|
131
|
+
border-color: getCssVar('color', 'info');
|
|
126
132
|
color: #fff;
|
|
127
133
|
|
|
128
|
-
|
|
134
|
+
&.is-plain {
|
|
129
135
|
background: #f4f4f5;
|
|
130
|
-
border: 1px solid
|
|
131
|
-
color:
|
|
136
|
+
border: 1px solid getCssVar('color', 'info');
|
|
137
|
+
color: getCssVar('color', 'info');
|
|
132
138
|
|
|
133
|
-
&:not(
|
|
139
|
+
&:not(.is-disabled):not(.is-link) {
|
|
134
140
|
&:hover {
|
|
135
|
-
background:
|
|
136
|
-
border-color:
|
|
141
|
+
background: getCssVar('color', 'info');
|
|
142
|
+
border-color: getCssVar('color', 'info');
|
|
137
143
|
color: #fff;
|
|
138
144
|
}
|
|
139
145
|
}
|
|
@@ -141,32 +147,78 @@
|
|
|
141
147
|
}
|
|
142
148
|
|
|
143
149
|
&--danger {
|
|
144
|
-
background:
|
|
145
|
-
border-color:
|
|
150
|
+
background: getCssVar('color', 'danger');
|
|
151
|
+
border-color: getCssVar('color', 'danger');
|
|
146
152
|
color: #fff;
|
|
147
153
|
|
|
148
|
-
|
|
154
|
+
&.is-plain {
|
|
149
155
|
background: #fef0f0;
|
|
150
|
-
border: 1px solid
|
|
151
|
-
color:
|
|
156
|
+
border: 1px solid getCssVar('color', 'danger');
|
|
157
|
+
color: getCssVar('color', 'danger');
|
|
152
158
|
|
|
153
|
-
&:not(
|
|
159
|
+
&:not(.is-disabled):not(.is-link) {
|
|
154
160
|
&:hover {
|
|
155
|
-
background:
|
|
156
|
-
border-color:
|
|
161
|
+
background: getCssVar('color', 'danger');
|
|
162
|
+
border-color: getCssVar('color', 'danger');
|
|
157
163
|
color: #fff;
|
|
158
164
|
}
|
|
159
165
|
}
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
|
|
169
|
+
&.is-circle {
|
|
170
|
+
&:not(.is-link) {
|
|
171
|
+
padding: 8px;
|
|
172
|
+
width: var(--#{$namespace}-button-size);
|
|
173
|
+
border-radius: 50%;
|
|
174
|
+
aspect-ratio: 1;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
163
178
|
&--small {
|
|
179
|
+
--#{$namespace}-button-size: 24px;
|
|
164
180
|
padding: 2px 7px;
|
|
165
181
|
font-size: 12px;
|
|
182
|
+
|
|
183
|
+
&.is-circle {
|
|
184
|
+
padding: 4px;
|
|
185
|
+
}
|
|
166
186
|
}
|
|
167
187
|
|
|
168
188
|
&--large {
|
|
189
|
+
--#{$namespace}-button-size: 40px;
|
|
169
190
|
padding: 8px 19px;
|
|
170
191
|
font-size: 14px;
|
|
192
|
+
|
|
193
|
+
&.is-circle {
|
|
194
|
+
padding: 12px;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&.is-link {
|
|
199
|
+
padding: 2px;
|
|
200
|
+
height: auto;
|
|
201
|
+
background-color: transparent;
|
|
202
|
+
border-color: transparent;
|
|
203
|
+
|
|
204
|
+
&.#{$namespace}-button--primary {
|
|
205
|
+
color: getCssVar('color', 'primary');
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&.#{$namespace}-button--danger {
|
|
209
|
+
color: getCssVar('color', 'danger');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&.#{$namespace}-button--info {
|
|
213
|
+
color: getCssVar('color', 'info');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&.#{$namespace}-button--warning {
|
|
217
|
+
color: getCssVar('color', 'warning');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&.#{$namespace}-button--success {
|
|
221
|
+
color: getCssVar('color', 'success');
|
|
222
|
+
}
|
|
171
223
|
}
|
|
172
224
|
}
|
package/dist/styles/index.css
CHANGED
|
@@ -1,129 +1,177 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--c-color-primary: #409eff;
|
|
3
|
+
--c-color-warning: #e6a23c;
|
|
4
|
+
--c-color-danger: #f56c6c;
|
|
5
|
+
--c-color-error: #f56c6c;
|
|
6
|
+
--c-color-info: #909399;
|
|
7
|
+
--c-color-success: #67c23a;
|
|
3
8
|
}
|
|
4
9
|
|
|
5
10
|
.c-button {
|
|
6
|
-
|
|
11
|
+
--c-button-size: 32px;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
7
15
|
padding: 5px 15px;
|
|
16
|
+
height: var(--c-button-size);
|
|
17
|
+
line-height: 1;
|
|
8
18
|
border-radius: 4px;
|
|
9
19
|
background: #fff;
|
|
10
20
|
outline: none;
|
|
11
21
|
color: #606266;
|
|
12
22
|
font-size: 14px;
|
|
13
23
|
border: 1px solid #dcdfe6;
|
|
24
|
+
white-space: nowrap;
|
|
14
25
|
cursor: pointer;
|
|
15
26
|
user-select: none;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
transition: transform 0.1s;
|
|
16
29
|
}
|
|
17
30
|
.c-button ~ .c-button {
|
|
18
|
-
margin-left:
|
|
31
|
+
margin-left: 12px;
|
|
19
32
|
}
|
|
20
|
-
.c-button
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
color: var(--c-color-primary);
|
|
33
|
+
.c-button.is-disabled {
|
|
34
|
+
opacity: 0.5;
|
|
35
|
+
cursor: not-allowed;
|
|
24
36
|
}
|
|
25
|
-
.c-button
|
|
37
|
+
.c-button:not(.is-disabled):hover {
|
|
26
38
|
opacity: 0.8;
|
|
27
39
|
}
|
|
28
|
-
.c-button:
|
|
40
|
+
.c-button:not(.is-disabled):active {
|
|
29
41
|
transform: scale(0.95);
|
|
30
42
|
}
|
|
31
|
-
.c-button
|
|
32
|
-
opacity: 0.5;
|
|
33
|
-
cursor: not-allowed;
|
|
34
|
-
}
|
|
35
|
-
.c-button--round {
|
|
43
|
+
.c-button.is-round {
|
|
36
44
|
border-radius: 20px;
|
|
37
45
|
}
|
|
38
|
-
.c-button
|
|
46
|
+
.c-button.is-plain {
|
|
39
47
|
background: #fff;
|
|
40
48
|
border: 1px solid #dcdfe6;
|
|
41
49
|
color: #606266;
|
|
42
50
|
}
|
|
43
|
-
.c-button
|
|
51
|
+
.c-button.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
44
52
|
border-color: var(--c-color-primary);
|
|
45
53
|
color: var(--c-color-primary);
|
|
46
54
|
}
|
|
55
|
+
.c-button:not(.c-button--primary):not(.c-button--danger):not(.c-button--warning):not(.c-button--info):not(.c-button--success):not(.is-link):not(.is-plain):not(.is-disabled):hover {
|
|
56
|
+
border-color: #57abff;
|
|
57
|
+
background: #ecf5ff;
|
|
58
|
+
color: var(--c-color-primary);
|
|
59
|
+
}
|
|
47
60
|
.c-button--primary {
|
|
48
61
|
background: var(--c-color-primary);
|
|
49
62
|
border-color: var(--c-color-primary);
|
|
50
63
|
color: #fff;
|
|
51
64
|
}
|
|
52
|
-
.c-button--primary.
|
|
65
|
+
.c-button--primary.is-plain {
|
|
53
66
|
background: #ecf5ff;
|
|
54
67
|
border: 1px solid var(--c-color-primary);
|
|
55
68
|
color: var(--c-color-primary);
|
|
56
69
|
}
|
|
57
|
-
.c-button--primary.
|
|
70
|
+
.c-button--primary.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
58
71
|
background: var(--c-color-primary);
|
|
59
72
|
border-color: var(--c-color-primary);
|
|
60
73
|
color: #fff;
|
|
61
74
|
}
|
|
62
75
|
.c-button--success {
|
|
63
|
-
background:
|
|
64
|
-
border-color:
|
|
76
|
+
background: var(--c-color-success);
|
|
77
|
+
border-color: var(--c-color-success);
|
|
65
78
|
color: #fff;
|
|
66
79
|
}
|
|
67
|
-
.c-button--success.
|
|
80
|
+
.c-button--success.is-plain {
|
|
68
81
|
background: #f0f9eb;
|
|
69
|
-
border: 1px solid
|
|
70
|
-
color:
|
|
82
|
+
border: 1px solid var(--c-color-success);
|
|
83
|
+
color: var(--c-color-success);
|
|
71
84
|
}
|
|
72
|
-
.c-button--success.
|
|
73
|
-
background:
|
|
74
|
-
border-color:
|
|
85
|
+
.c-button--success.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
86
|
+
background: var(--c-color-success);
|
|
87
|
+
border-color: var(--c-color-success);
|
|
75
88
|
color: #fff;
|
|
76
89
|
}
|
|
77
90
|
.c-button--warning {
|
|
78
|
-
background:
|
|
79
|
-
border-color:
|
|
91
|
+
background: var(--c-color-warning);
|
|
92
|
+
border-color: var(--c-color-warning);
|
|
80
93
|
color: #fff;
|
|
81
94
|
}
|
|
82
|
-
.c-button--warning.
|
|
95
|
+
.c-button--warning.is-plain {
|
|
83
96
|
background: #fdf6ec;
|
|
84
|
-
border: 1px solid
|
|
85
|
-
color:
|
|
97
|
+
border: 1px solid var(--c-color-warning);
|
|
98
|
+
color: var(--c-color-warning);
|
|
86
99
|
}
|
|
87
|
-
.c-button--warning.
|
|
88
|
-
background:
|
|
89
|
-
border-color:
|
|
100
|
+
.c-button--warning.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
101
|
+
background: var(--c-color-warning);
|
|
102
|
+
border-color: var(--c-color-warning);
|
|
90
103
|
color: #fff;
|
|
91
104
|
}
|
|
92
105
|
.c-button--info {
|
|
93
|
-
background:
|
|
94
|
-
border-color:
|
|
106
|
+
background: var(--c-color-info);
|
|
107
|
+
border-color: var(--c-color-info);
|
|
95
108
|
color: #fff;
|
|
96
109
|
}
|
|
97
|
-
.c-button--info.
|
|
110
|
+
.c-button--info.is-plain {
|
|
98
111
|
background: #f4f4f5;
|
|
99
|
-
border: 1px solid
|
|
100
|
-
color:
|
|
112
|
+
border: 1px solid var(--c-color-info);
|
|
113
|
+
color: var(--c-color-info);
|
|
101
114
|
}
|
|
102
|
-
.c-button--info.
|
|
103
|
-
background:
|
|
104
|
-
border-color:
|
|
115
|
+
.c-button--info.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
116
|
+
background: var(--c-color-info);
|
|
117
|
+
border-color: var(--c-color-info);
|
|
105
118
|
color: #fff;
|
|
106
119
|
}
|
|
107
120
|
.c-button--danger {
|
|
108
|
-
background:
|
|
109
|
-
border-color:
|
|
121
|
+
background: var(--c-color-danger);
|
|
122
|
+
border-color: var(--c-color-danger);
|
|
110
123
|
color: #fff;
|
|
111
124
|
}
|
|
112
|
-
.c-button--danger.
|
|
125
|
+
.c-button--danger.is-plain {
|
|
113
126
|
background: #fef0f0;
|
|
114
|
-
border: 1px solid
|
|
115
|
-
color:
|
|
127
|
+
border: 1px solid var(--c-color-danger);
|
|
128
|
+
color: var(--c-color-danger);
|
|
116
129
|
}
|
|
117
|
-
.c-button--danger.
|
|
118
|
-
background:
|
|
119
|
-
border-color:
|
|
130
|
+
.c-button--danger.is-plain:not(.is-disabled):not(.is-link):hover {
|
|
131
|
+
background: var(--c-color-danger);
|
|
132
|
+
border-color: var(--c-color-danger);
|
|
120
133
|
color: #fff;
|
|
121
134
|
}
|
|
135
|
+
.c-button.is-circle:not(.is-link) {
|
|
136
|
+
padding: 8px;
|
|
137
|
+
width: var(--c-button-size);
|
|
138
|
+
border-radius: 50%;
|
|
139
|
+
aspect-ratio: 1;
|
|
140
|
+
}
|
|
122
141
|
.c-button--small {
|
|
142
|
+
--c-button-size: 24px;
|
|
123
143
|
padding: 2px 7px;
|
|
124
144
|
font-size: 12px;
|
|
125
145
|
}
|
|
146
|
+
.c-button--small.is-circle {
|
|
147
|
+
padding: 4px;
|
|
148
|
+
}
|
|
126
149
|
.c-button--large {
|
|
150
|
+
--c-button-size: 40px;
|
|
127
151
|
padding: 8px 19px;
|
|
128
152
|
font-size: 14px;
|
|
153
|
+
}
|
|
154
|
+
.c-button--large.is-circle {
|
|
155
|
+
padding: 12px;
|
|
156
|
+
}
|
|
157
|
+
.c-button.is-link {
|
|
158
|
+
padding: 2px;
|
|
159
|
+
height: auto;
|
|
160
|
+
background-color: transparent;
|
|
161
|
+
border-color: transparent;
|
|
162
|
+
}
|
|
163
|
+
.c-button.is-link.c-button--primary {
|
|
164
|
+
color: var(--c-color-primary);
|
|
165
|
+
}
|
|
166
|
+
.c-button.is-link.c-button--danger {
|
|
167
|
+
color: var(--c-color-danger);
|
|
168
|
+
}
|
|
169
|
+
.c-button.is-link.c-button--info {
|
|
170
|
+
color: var(--c-color-info);
|
|
171
|
+
}
|
|
172
|
+
.c-button.is-link.c-button--warning {
|
|
173
|
+
color: var(--c-color-warning);
|
|
174
|
+
}
|
|
175
|
+
.c-button.is-link.c-button--success {
|
|
176
|
+
color: var(--c-color-success);
|
|
129
177
|
}
|
package/dist/styles/var.css
CHANGED
package/dist/styles/var.scss
CHANGED
|
@@ -29,7 +29,17 @@ $colors: map.deep-merge(
|
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
$color-primary: map.get($colors, 'primary', 'base');
|
|
32
|
+
$color-warning: map.get($colors, 'warning', 'base');
|
|
33
|
+
$color-danger: map.get($colors, 'danger', 'base');
|
|
34
|
+
$color-error: map.get($colors, 'error', 'base');
|
|
35
|
+
$color-info: map.get($colors, 'info', 'base');
|
|
36
|
+
$color-success: map.get($colors, 'success', 'base');
|
|
32
37
|
|
|
33
38
|
:root {
|
|
34
39
|
@include set-css-var-value('color-primary', $color-primary);
|
|
40
|
+
@include set-css-var-value('color-warning', $color-warning);
|
|
41
|
+
@include set-css-var-value('color-danger', $color-danger);
|
|
42
|
+
@include set-css-var-value('color-error', $color-error);
|
|
43
|
+
@include set-css-var-value('color-info', $color-info);
|
|
44
|
+
@include set-css-var-value('color-success', $color-success);
|
|
35
45
|
}
|
package/dist/ui-components.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".c-button[data-v-
|
|
2
|
-
import { ref as p, getCurrentInstance as d, inject as _, computed as f, unref as
|
|
3
|
-
const
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".c-button[data-v-32b3f96e]{--c-button-size: 32px;display:inline-flex;align-items:center;justify-content:center;padding:5px 15px;height:var(--c-button-size);line-height:1;border-radius:4px;background:#fff;outline:none;color:#606266;font-size:14px;border:1px solid #dcdfe6;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;transition:transform .1s}.c-button~.c-button[data-v-32b3f96e]{margin-left:12px}.c-button.is-disabled[data-v-32b3f96e]{opacity:.5;cursor:not-allowed}.c-button[data-v-32b3f96e]:not(.is-disabled):hover{opacity:.8}.c-button[data-v-32b3f96e]:not(.is-disabled):active{transform:scale(.95)}.c-button.is-round[data-v-32b3f96e]{border-radius:20px}.c-button.is-plain[data-v-32b3f96e]{background:#fff;border:1px solid #dcdfe6;color:#606266}.c-button.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{border-color:var(--c-color-primary);color:var(--c-color-primary)}.c-button[data-v-32b3f96e]:not(.c-button--primary):not(.c-button--danger):not(.c-button--warning):not(.c-button--info):not(.c-button--success):not(.is-link):not(.is-plain):not(.is-disabled):hover{border-color:#57abff;background:#ecf5ff;color:var(--c-color-primary)}.c-button--primary[data-v-32b3f96e]{background:var(--c-color-primary);border-color:var(--c-color-primary);color:#fff}.c-button--primary.is-plain[data-v-32b3f96e]{background:#ecf5ff;border:1px solid var(--c-color-primary);color:var(--c-color-primary)}.c-button--primary.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-primary);border-color:var(--c-color-primary);color:#fff}.c-button--success[data-v-32b3f96e]{background:var(--c-color-success);border-color:var(--c-color-success);color:#fff}.c-button--success.is-plain[data-v-32b3f96e]{background:#f0f9eb;border:1px solid var(--c-color-success);color:var(--c-color-success)}.c-button--success.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-success);border-color:var(--c-color-success);color:#fff}.c-button--warning[data-v-32b3f96e]{background:var(--c-color-warning);border-color:var(--c-color-warning);color:#fff}.c-button--warning.is-plain[data-v-32b3f96e]{background:#fdf6ec;border:1px solid var(--c-color-warning);color:var(--c-color-warning)}.c-button--warning.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-warning);border-color:var(--c-color-warning);color:#fff}.c-button--info[data-v-32b3f96e]{background:var(--c-color-info);border-color:var(--c-color-info);color:#fff}.c-button--info.is-plain[data-v-32b3f96e]{background:#f4f4f5;border:1px solid var(--c-color-info);color:var(--c-color-info)}.c-button--info.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-info);border-color:var(--c-color-info);color:#fff}.c-button--danger[data-v-32b3f96e]{background:var(--c-color-danger);border-color:var(--c-color-danger);color:#fff}.c-button--danger.is-plain[data-v-32b3f96e]{background:#fef0f0;border:1px solid var(--c-color-danger);color:var(--c-color-danger)}.c-button--danger.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-danger);border-color:var(--c-color-danger);color:#fff}.c-button.is-circle[data-v-32b3f96e]:not(.is-link){padding:8px;width:var(--c-button-size);border-radius:50%;aspect-ratio:1}.c-button--small[data-v-32b3f96e]{--c-button-size: 24px;padding:2px 7px;font-size:12px}.c-button--small.is-circle[data-v-32b3f96e]{padding:4px}.c-button--large[data-v-32b3f96e]{--c-button-size: 40px;padding:8px 19px;font-size:14px}.c-button--large.is-circle[data-v-32b3f96e]{padding:12px}.c-button.is-link[data-v-32b3f96e]{padding:2px;height:auto;background-color:transparent;border-color:transparent}.c-button.is-link.c-button--primary[data-v-32b3f96e]{color:var(--c-color-primary)}.c-button.is-link.c-button--danger[data-v-32b3f96e]{color:var(--c-color-danger)}.c-button.is-link.c-button--info[data-v-32b3f96e]{color:var(--c-color-info)}.c-button.is-link.c-button--warning[data-v-32b3f96e]{color:var(--c-color-warning)}.c-button.is-link.c-button--success[data-v-32b3f96e]{color:var(--c-color-success)}")),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
import { ref as p, getCurrentInstance as d, inject as _, computed as f, unref as s, provide as v, defineComponent as m, createElementBlock as B, openBlock as k, normalizeClass as y, renderSlot as g, watch as $ } from "vue";
|
|
3
|
+
const C = Symbol("c"), l = "c", u = p({
|
|
4
4
|
namespace: "c"
|
|
5
5
|
});
|
|
6
6
|
function x(n, e = void 0) {
|
|
7
|
-
const c = d() ? _(
|
|
7
|
+
const c = d() ? _(C, u) : u;
|
|
8
8
|
return f(() => {
|
|
9
9
|
var o;
|
|
10
10
|
return ((o = c.value) == null ? void 0 : o[n]) ?? e;
|
|
@@ -16,21 +16,41 @@ function S(n, e) {
|
|
|
16
16
|
console.warn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const t = f(() =>
|
|
20
|
-
return o(
|
|
19
|
+
const t = f(() => s(n));
|
|
20
|
+
return o(C, t), t;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return `${x("namespace",
|
|
22
|
+
function r(n) {
|
|
23
|
+
return `${x("namespace", l).value}-${n}`;
|
|
24
24
|
}
|
|
25
25
|
const h = {
|
|
26
26
|
type: {
|
|
27
27
|
type: String,
|
|
28
28
|
default: ""
|
|
29
29
|
},
|
|
30
|
-
size:
|
|
30
|
+
size: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* 是否禁用
|
|
36
|
+
*/
|
|
31
37
|
disabled: Boolean,
|
|
38
|
+
/**
|
|
39
|
+
* 原始按钮
|
|
40
|
+
*/
|
|
32
41
|
plain: Boolean,
|
|
33
|
-
|
|
42
|
+
/**
|
|
43
|
+
* 圆角按钮
|
|
44
|
+
*/
|
|
45
|
+
round: Boolean,
|
|
46
|
+
/**
|
|
47
|
+
* 原型按钮
|
|
48
|
+
*/
|
|
49
|
+
circle: Boolean,
|
|
50
|
+
/**
|
|
51
|
+
* 链接按钮
|
|
52
|
+
*/
|
|
53
|
+
link: Boolean
|
|
34
54
|
}, P = ["disabled"], z = /* @__PURE__ */ m({
|
|
35
55
|
name: "CButton",
|
|
36
56
|
__name: "button",
|
|
@@ -40,19 +60,21 @@ const h = {
|
|
|
40
60
|
function c() {
|
|
41
61
|
console.log("click");
|
|
42
62
|
}
|
|
43
|
-
return (o, t) => (
|
|
44
|
-
class:
|
|
45
|
-
|
|
46
|
-
e.type &&
|
|
47
|
-
e.size &&
|
|
48
|
-
e.disabled &&
|
|
49
|
-
e.plain &&
|
|
50
|
-
e.round &&
|
|
63
|
+
return (o, t) => (k(), B("button", {
|
|
64
|
+
class: y([
|
|
65
|
+
s(r)("button"),
|
|
66
|
+
e.type && s(r)(`button--${e.type}`),
|
|
67
|
+
e.size && s(r)(`button--${e.size}`),
|
|
68
|
+
e.disabled && "is-disabled",
|
|
69
|
+
e.plain && "is-plain",
|
|
70
|
+
e.round && "is-round",
|
|
71
|
+
e.circle && "is-circle",
|
|
72
|
+
e.link && "is-link"
|
|
51
73
|
]),
|
|
52
74
|
disabled: e.disabled,
|
|
53
75
|
onClick: c
|
|
54
76
|
}, [
|
|
55
|
-
|
|
77
|
+
g(o.$slots, "default", {}, void 0, !0)
|
|
56
78
|
], 10, P));
|
|
57
79
|
}
|
|
58
80
|
}), G = (n, e) => {
|
|
@@ -60,21 +82,21 @@ const h = {
|
|
|
60
82
|
for (const [o, t] of e)
|
|
61
83
|
c[o] = t;
|
|
62
84
|
return c;
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
n.component(
|
|
85
|
+
}, a = /* @__PURE__ */ G(z, [["__scopeId", "data-v-32b3f96e"]]);
|
|
86
|
+
a.install = (n) => {
|
|
87
|
+
n.component(a.name, a);
|
|
66
88
|
};
|
|
67
|
-
const
|
|
89
|
+
const i = /* @__PURE__ */ m({
|
|
68
90
|
name: "CConfigProvider",
|
|
69
91
|
__name: "index",
|
|
70
92
|
props: {
|
|
71
|
-
namespace: { default:
|
|
93
|
+
namespace: { default: l }
|
|
72
94
|
},
|
|
73
95
|
setup(n) {
|
|
74
96
|
const e = n, c = p({
|
|
75
|
-
namespace:
|
|
97
|
+
namespace: l
|
|
76
98
|
}), o = S(c);
|
|
77
|
-
return
|
|
99
|
+
return $(
|
|
78
100
|
() => e,
|
|
79
101
|
(t) => {
|
|
80
102
|
c.value.namespace = t == null ? void 0 : t.namespace;
|
|
@@ -83,19 +105,19 @@ const r = /* @__PURE__ */ m({
|
|
|
83
105
|
immediate: !0,
|
|
84
106
|
deep: !0
|
|
85
107
|
}
|
|
86
|
-
), (t,
|
|
108
|
+
), (t, b) => g(t.$slots, "default", { config: s(o) });
|
|
87
109
|
}
|
|
88
110
|
});
|
|
89
|
-
|
|
90
|
-
n.component(
|
|
111
|
+
i.install = (n) => {
|
|
112
|
+
n.component(i.name, i);
|
|
91
113
|
};
|
|
92
114
|
function w(n) {
|
|
93
|
-
n.component(
|
|
115
|
+
n.component(a.name || "CButton", a), n.component(i.name || "CConfigProvider", i);
|
|
94
116
|
}
|
|
95
117
|
const N = { install: w };
|
|
96
118
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
119
|
+
a as CButton,
|
|
120
|
+
i as CConfigProvider,
|
|
99
121
|
h as buttonProps,
|
|
100
122
|
N as default,
|
|
101
123
|
w as install
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".c-button[data-v-
|
|
2
|
-
(function(
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".c-button[data-v-32b3f96e]{--c-button-size: 32px;display:inline-flex;align-items:center;justify-content:center;padding:5px 15px;height:var(--c-button-size);line-height:1;border-radius:4px;background:#fff;outline:none;color:#606266;font-size:14px;border:1px solid #dcdfe6;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;transition:transform .1s}.c-button~.c-button[data-v-32b3f96e]{margin-left:12px}.c-button.is-disabled[data-v-32b3f96e]{opacity:.5;cursor:not-allowed}.c-button[data-v-32b3f96e]:not(.is-disabled):hover{opacity:.8}.c-button[data-v-32b3f96e]:not(.is-disabled):active{transform:scale(.95)}.c-button.is-round[data-v-32b3f96e]{border-radius:20px}.c-button.is-plain[data-v-32b3f96e]{background:#fff;border:1px solid #dcdfe6;color:#606266}.c-button.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{border-color:var(--c-color-primary);color:var(--c-color-primary)}.c-button[data-v-32b3f96e]:not(.c-button--primary):not(.c-button--danger):not(.c-button--warning):not(.c-button--info):not(.c-button--success):not(.is-link):not(.is-plain):not(.is-disabled):hover{border-color:#57abff;background:#ecf5ff;color:var(--c-color-primary)}.c-button--primary[data-v-32b3f96e]{background:var(--c-color-primary);border-color:var(--c-color-primary);color:#fff}.c-button--primary.is-plain[data-v-32b3f96e]{background:#ecf5ff;border:1px solid var(--c-color-primary);color:var(--c-color-primary)}.c-button--primary.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-primary);border-color:var(--c-color-primary);color:#fff}.c-button--success[data-v-32b3f96e]{background:var(--c-color-success);border-color:var(--c-color-success);color:#fff}.c-button--success.is-plain[data-v-32b3f96e]{background:#f0f9eb;border:1px solid var(--c-color-success);color:var(--c-color-success)}.c-button--success.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-success);border-color:var(--c-color-success);color:#fff}.c-button--warning[data-v-32b3f96e]{background:var(--c-color-warning);border-color:var(--c-color-warning);color:#fff}.c-button--warning.is-plain[data-v-32b3f96e]{background:#fdf6ec;border:1px solid var(--c-color-warning);color:var(--c-color-warning)}.c-button--warning.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-warning);border-color:var(--c-color-warning);color:#fff}.c-button--info[data-v-32b3f96e]{background:var(--c-color-info);border-color:var(--c-color-info);color:#fff}.c-button--info.is-plain[data-v-32b3f96e]{background:#f4f4f5;border:1px solid var(--c-color-info);color:var(--c-color-info)}.c-button--info.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-info);border-color:var(--c-color-info);color:#fff}.c-button--danger[data-v-32b3f96e]{background:var(--c-color-danger);border-color:var(--c-color-danger);color:#fff}.c-button--danger.is-plain[data-v-32b3f96e]{background:#fef0f0;border:1px solid var(--c-color-danger);color:var(--c-color-danger)}.c-button--danger.is-plain[data-v-32b3f96e]:not(.is-disabled):not(.is-link):hover{background:var(--c-color-danger);border-color:var(--c-color-danger);color:#fff}.c-button.is-circle[data-v-32b3f96e]:not(.is-link){padding:8px;width:var(--c-button-size);border-radius:50%;aspect-ratio:1}.c-button--small[data-v-32b3f96e]{--c-button-size: 24px;padding:2px 7px;font-size:12px}.c-button--small.is-circle[data-v-32b3f96e]{padding:4px}.c-button--large[data-v-32b3f96e]{--c-button-size: 40px;padding:8px 19px;font-size:14px}.c-button--large.is-circle[data-v-32b3f96e]{padding:12px}.c-button.is-link[data-v-32b3f96e]{padding:2px;height:auto;background-color:transparent;border-color:transparent}.c-button.is-link.c-button--primary[data-v-32b3f96e]{color:var(--c-color-primary)}.c-button.is-link.c-button--danger[data-v-32b3f96e]{color:var(--c-color-danger)}.c-button.is-link.c-button--info[data-v-32b3f96e]{color:var(--c-color-info)}.c-button.is-link.c-button--warning[data-v-32b3f96e]{color:var(--c-color-warning)}.c-button.is-link.c-button--success[data-v-32b3f96e]{color:var(--c-color-success)}")),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
(function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t.CanUICpmonents={},t.Vue))})(this,(function(t,n){"use strict";const f=Symbol("c"),l="c",p=n.ref({namespace:"c"});function C(e,o=void 0){const s=n.getCurrentInstance()?n.inject(f,p):p;return n.computed(()=>{var i;return((i=s.value)==null?void 0:i[e])??o})}function _(e,o){const i=!!n.getCurrentInstance()?n.provide:void 0;if(!i){console.warn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const c=n.computed(()=>n.unref(e));return i(f,c),c}function d(e){return`${C("namespace",l).value}-${e}`}const u={type:{type:String,default:""},size:{type:String,default:""},disabled:Boolean,plain:Boolean,round:Boolean,circle:Boolean,link:Boolean},b=["disabled"],a=((e,o)=>{const s=e.__vccOpts||e;for(const[i,c]of o)s[i]=c;return s})(n.defineComponent({name:"CButton",__name:"button",props:u,setup(e){const o=e;function s(){console.log("click")}return(i,c)=>(n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass([n.unref(d)("button"),o.type&&n.unref(d)(`button--${o.type}`),o.size&&n.unref(d)(`button--${o.size}`),o.disabled&&"is-disabled",o.plain&&"is-plain",o.round&&"is-round",o.circle&&"is-circle",o.link&&"is-link"]),disabled:o.disabled,onClick:s},[n.renderSlot(i.$slots,"default",{},void 0,!0)],10,b))}}),[["__scopeId","data-v-32b3f96e"]]);a.install=e=>{e.component(a.name,a)};const r=n.defineComponent({name:"CConfigProvider",__name:"index",props:{namespace:{default:l}},setup(e){const o=e,s=n.ref({namespace:l}),i=_(s);return n.watch(()=>o,c=>{s.value.namespace=c==null?void 0:c.namespace},{immediate:!0,deep:!0}),(c,y)=>n.renderSlot(c.$slots,"default",{config:n.unref(i)})}});r.install=e=>{e.component(r.name,r)};function m(e){e.component(a.name||"CButton",a),e.component(r.name||"CConfigProvider",r)}const g={install:m};t.CButton=a,t.CConfigProvider=r,t.buttonProps=u,t.default=g,t.install=m,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|