kui-vue 3.6.4 → 3.6.7
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/components/alert/alert.jsx +26 -7
- package/components/alert/demo/basic.md +4 -4
- package/components/alert/demo/icon.md +15 -6
- package/components/alert/styles/index.less +42 -14
- package/components/avatar/styles/index.less +4 -4
- package/components/backtop/styles/index.less +10 -14
- package/components/badge/styles/index.less +7 -13
- package/components/breadcrumb/index.md +7 -6
- package/components/breadcrumb/styles/index.less +7 -21
- package/components/button/demo/color.md +0 -1
- package/components/button/demo/disabled.md +6 -0
- package/components/button/demo/light.md +1 -1
- package/components/button/styles/index.less +165 -111
- package/components/card/card.jsx +1 -1
- package/components/card/demo/basic.md +1 -1
- package/components/card/demo/border.md +1 -1
- package/components/card/demo/notitle.md +1 -1
- package/components/card/styles/index.less +5 -4
- package/components/carousel/carousel.jsx +186 -175
- package/components/carousel/styles/index.less +11 -16
- package/components/checkbox/checkbox.jsx +2 -2
- package/components/checkbox/styles/index.less +21 -29
- package/components/collapse/styles/index.less +7 -11
- package/components/colorPicker/styles/index.less +83 -71
- package/components/config/context.js +21 -0
- package/components/config/index.js +10 -2
- package/components/datePicker/datepicker.jsx +6 -2
- package/components/datePicker/styles/index.less +54 -57
- package/components/descriptions/styles/index.less +8 -17
- package/components/divider/styles/index.less +20 -18
- package/components/drawer/demo/target.md +1 -0
- package/components/drawer/styles/animal.less +0 -1
- package/components/drawer/styles/index.less +8 -11
- package/components/dropdown/demo/cascading.md +30 -16
- package/components/dropdown/styles/index.less +26 -34
- package/components/empty/index.md +3 -2
- package/components/empty/styles/index.less +2 -2
- package/components/flex/demo/align.md +1 -1
- package/components/flex/demo/basic.md +1 -2
- package/components/flex/index.md +1 -1
- package/components/form/demo/dynamicvalid.md +1 -3
- package/components/form/demo/info.md +22 -12
- package/components/form/demo/valid.md +6 -6
- package/components/form/demo/withmodal.md +6 -6
- package/components/form/styles/index.less +10 -11
- package/components/grid/index.md +4 -1
- package/components/grid/styles/index.less +1 -1
- package/components/icon/demo/search.vue +44 -21
- package/components/icon/index.md +1 -1
- package/components/icon/styles/index.less +7 -8
- package/components/image/index.md +7 -1
- package/components/image/preview.jsx +17 -4
- package/components/image/styles/index.less +36 -42
- package/components/index.js +9 -9
- package/components/input/demo/icon.md +0 -1
- package/components/input/demo/suffix.md +2 -7
- package/components/input/input.jsx +31 -29
- package/components/input/inputBox.jsx +13 -0
- package/components/input/inputGroup.jsx +2 -0
- package/components/input/styles/index.less +47 -53
- package/components/input/textarea.jsx +1 -1
- package/components/inputNumber/demo/basic.md +3 -3
- package/components/inputNumber/demo/ffix.md +2 -2
- package/components/inputNumber/inputNumber.jsx +2 -2
- package/components/inputNumber/styles/index.less +36 -42
- package/components/layout/demo/basic.md +5 -5
- package/components/layout/demo/info.md +1 -34
- package/components/layout/demo/layout1.md +7 -7
- package/components/layout/demo/layout2.md +32 -20
- package/components/layout/demo/layout3.md +20 -13
- package/components/layout/demo/layout4.md +12 -8
- package/components/layout/demo/layout5.md +6 -2
- package/components/layout/styles/index.less +1 -18
- package/components/loading/demo/info.md +3 -3
- package/components/loading/styles/index.less +31 -31
- package/components/menu/demo/accordion.md +44 -22
- package/components/menu/demo/basic.md +35 -20
- package/components/menu/demo/collapsed.md +37 -19
- package/components/menu/demo/inline.md +44 -23
- package/components/menu/demo/mode.md +42 -26
- package/components/menu/demo/theme.md +34 -18
- package/components/menu/demo/vertical.md +34 -18
- package/components/menu/index.md +14 -3
- package/components/menu/menu.jsx +9 -3
- package/components/menu/menuitem.jsx +4 -4
- package/components/menu/recursiveMenu.jsx +40 -0
- package/components/menu/styles/index.less +46 -58
- package/components/message/demo/basic.md +0 -7
- package/components/message/index.js +0 -4
- package/components/message/index.md +0 -1
- package/components/message/inner.jsx +15 -2
- package/components/message/styles/index.less +12 -17
- package/components/modal/demo/confirm.md +6 -6
- package/components/modal/demo/global.md +0 -15
- package/components/modal/demo/info.md +0 -1
- package/components/modal/index.js +5 -34
- package/components/modal/index.md +1 -2
- package/components/modal/modal.jsx +2 -1
- package/components/modal/styles/index.less +14 -21
- package/components/notice/demo/basic.md +0 -9
- package/components/notice/demo/close.md +4 -0
- package/components/notice/demo/types.md +1 -2
- package/components/notice/index.js +1 -19
- package/components/notice/styles/index.less +16 -22
- package/components/page/page.jsx +5 -4
- package/components/page/styles/index.less +49 -50
- package/components/popconfirm/demo/basic.md +11 -18
- package/components/popconfirm/demo/info.md +3 -1
- package/components/popconfirm/demo/local.md +14 -20
- package/components/popconfirm/demo/placement.md +3 -9
- package/components/popconfirm/index.md +3 -2
- package/components/popconfirm/styles/index.less +9 -15
- package/components/poptip/styles/index.less +44 -49
- package/components/progress/styles/index.less +13 -13
- package/components/radio/index.md +7 -7
- package/components/radio/radio.jsx +5 -1
- package/components/radio/styles/index.less +26 -32
- package/components/rate/index.md +11 -11
- package/components/rate/styles/index.less +4 -7
- package/components/select/select.jsx +2 -2
- package/components/select/styles/index.less +37 -50
- package/components/skeleton/index.md +5 -1
- package/components/skeleton/styles/index.less +21 -19
- package/components/slider/slider.jsx +25 -13
- package/components/slider/styles/index.less +13 -12
- package/components/space/space.jsx +2 -1
- package/components/spin/styles/index.less +25 -40
- package/components/statCard/demo/card.md +18 -4
- package/components/statCard/index.md +5 -5
- package/components/statCard/statCard.jsx +4 -1
- package/components/statCard/styles/index.less +9 -6
- package/components/styles/less-css-var.less +305 -0
- package/components/styles/less-var.less +296 -0
- package/components/styles/sys.less +19 -15
- package/components/switch/styles/index.less +9 -24
- package/components/table/index.md +1 -1
- package/components/table/styles/index.less +63 -59
- package/components/table/table.jsx +1 -1
- package/components/tabs/styles/index.less +22 -24
- package/components/tag/demo/basic.md +0 -8
- package/components/tag/index.md +2 -1
- package/components/tag/styles/index.less +40 -41
- package/components/tag/tag.jsx +2 -2
- package/components/timeline/styles/index.less +8 -14
- package/components/tooltip/styles/index.less +35 -40
- package/components/tree/index.md +15 -15
- package/components/tree/styles/index.less +36 -56
- package/components/tree/tree.jsx +1 -0
- package/components/treeselect/index.md +1 -1
- package/components/treeselect/styles/index.less +26 -32
- package/components/treeselect/treeselect.jsx +3 -3
- package/components/upload/demo/forms.md +0 -1
- package/components/upload/fileList.jsx +6 -3
- package/components/upload/styles/index.less +33 -29
- package/components/upload/upload.jsx +5 -1
- package/components/utils/vue.js +4 -2
- package/dist/k-ui.cjs.js +3 -2
- package/dist/k-ui.css +4 -3
- package/dist/k-ui.d.ts +71 -54
- package/dist/k-ui.esm.js +3 -2
- package/dist/k-ui.umd.js +3 -2
- package/dist/locale/de.js +2 -1
- package/dist/locale/el.js +2 -1
- package/dist/locale/en.js +2 -1
- package/dist/locale/fr.js +2 -1
- package/dist/locale/it.js +2 -1
- package/dist/locale/ja.js +2 -1
- package/dist/locale/ko.js +2 -1
- package/dist/locale/ru.js +2 -1
- package/dist/locale/th.js +2 -1
- package/dist/locale/uk.js +2 -1
- package/dist/locale/vi.js +2 -1
- package/dist/locale/zh-CN.js +2 -1
- package/dist/locale/zh-TW.js +2 -1
- package/package.json +14 -16
- package/types/alert/Alert.d.ts +2 -0
- package/types/card/Card.d.ts +1 -1
- package/types/checkbox/Checkbox.d.ts +1 -0
- package/types/datePicker/DatePicker.d.ts +1 -0
- package/types/index.d.ts +6 -6
- package/types/input/Input.d.ts +1 -0
- package/types/input/InputGroup.d.ts +2 -0
- package/types/input/TextArea.d.ts +1 -0
- package/types/inputNumber/InputNumber.d.ts +1 -0
- package/types/menu/Menu.d.ts +1 -0
- package/types/page/Page.d.ts +1 -0
- package/types/select/Select.d.ts +1 -0
- package/types/statCard/StatCard.d.ts +2 -0
- package/types/table/Table.d.ts +1 -1
- package/types/tag/Tag.d.ts +1 -0
- package/types/treeselect/TreeSelect.d.ts +1 -0
- package/components/dropdown/demo/custom.md +0 -31
- package/components/icon/lib/dist.json +0 -1
- package/components/icon/lib/kui-icons.js +0 -1
- package/components/icon/lib/sprite.svg +0 -1
- package/components/styles/color.less +0 -209
- package/components/styles/var.less +0 -207
|
@@ -16,11 +16,15 @@ import {
|
|
|
16
16
|
Close,
|
|
17
17
|
ArrowDown,
|
|
18
18
|
IconImage,
|
|
19
|
+
ArrowBack,
|
|
20
|
+
ArrowForward,
|
|
21
|
+
Add,Remove,
|
|
19
22
|
ChevronUp,
|
|
20
23
|
Loading,
|
|
21
24
|
AddCircleOutline,
|
|
22
25
|
RemoveCircleOutline,
|
|
23
26
|
} from "kui-icons";
|
|
27
|
+
import Slider from "../slider";
|
|
24
28
|
|
|
25
29
|
const ImagePreview = defineComponent({
|
|
26
30
|
name: "ImagePreview",
|
|
@@ -407,7 +411,16 @@ const ImagePreview = defineComponent({
|
|
|
407
411
|
]}
|
|
408
412
|
onClick={() => setScale(1)}
|
|
409
413
|
>
|
|
410
|
-
<Icon type={
|
|
414
|
+
<Icon type={Add} />
|
|
415
|
+
</li>
|
|
416
|
+
<li class="k-image-preview-action k-image-preview-action-scale">
|
|
417
|
+
<Slider
|
|
418
|
+
value={state.scale}
|
|
419
|
+
min={1}
|
|
420
|
+
max={5}
|
|
421
|
+
size="small"
|
|
422
|
+
onChange={(val) => (state.scale = val)}
|
|
423
|
+
/>
|
|
411
424
|
</li>
|
|
412
425
|
<li
|
|
413
426
|
class={[
|
|
@@ -416,7 +429,7 @@ const ImagePreview = defineComponent({
|
|
|
416
429
|
]}
|
|
417
430
|
onClick={() => setScale(0)}
|
|
418
431
|
>
|
|
419
|
-
<Icon type={
|
|
432
|
+
<Icon type={Remove} />
|
|
420
433
|
</li>
|
|
421
434
|
<li
|
|
422
435
|
class="k-image-preview-action k-image-preview-action-rotate-right"
|
|
@@ -454,7 +467,7 @@ const ImagePreview = defineComponent({
|
|
|
454
467
|
]}
|
|
455
468
|
onClick={() => switchImage(1)}
|
|
456
469
|
>
|
|
457
|
-
<Icon type={
|
|
470
|
+
<Icon type={ArrowBack} />
|
|
458
471
|
</div>,
|
|
459
472
|
<div
|
|
460
473
|
class={[
|
|
@@ -466,7 +479,7 @@ const ImagePreview = defineComponent({
|
|
|
466
479
|
]}
|
|
467
480
|
onClick={() => switchImage()}
|
|
468
481
|
>
|
|
469
|
-
<Icon type={
|
|
482
|
+
<Icon type={ArrowForward} />
|
|
470
483
|
</div>,
|
|
471
484
|
]
|
|
472
485
|
: null}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "../../styles/var.less";
|
|
1
|
+
@import "../../styles/less-css-var.less";
|
|
2
2
|
|
|
3
3
|
.k-image {
|
|
4
4
|
position: relative;
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
justify-content: center;
|
|
8
8
|
line-height: 1;
|
|
9
9
|
overflow: hidden;
|
|
10
|
-
|
|
10
|
+
border-radius: var(--kui-border-radius);
|
|
11
11
|
.k-image-img {
|
|
12
12
|
width: 100%;
|
|
13
13
|
height: auto;
|
|
14
|
-
// max-height: 100%;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
.k-image-loading {
|
|
@@ -22,7 +21,7 @@
|
|
|
22
21
|
right: 0;
|
|
23
22
|
background-color: var(--kui-color-mask);
|
|
24
23
|
display: flex;
|
|
25
|
-
color: var(--kui-color-
|
|
24
|
+
color: var(--kui-color-primary);
|
|
26
25
|
align-items: center;
|
|
27
26
|
justify-content: center;
|
|
28
27
|
font-size: 20px;
|
|
@@ -31,13 +30,13 @@
|
|
|
31
30
|
.k-image-error {
|
|
32
31
|
font-size: 50px;
|
|
33
32
|
opacity: 0.3;
|
|
34
|
-
color: var(--kui-color-
|
|
33
|
+
color: var(--kui-color-text-placeholder);
|
|
35
34
|
width: 100%;
|
|
36
35
|
height: 100%;
|
|
37
36
|
display: flex;
|
|
38
37
|
align-items: center;
|
|
39
38
|
justify-content: center;
|
|
40
|
-
background-color: var(--kui-color-
|
|
39
|
+
background-color: var(--kui-color-bg-component);
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
.k-image-preview-mask {
|
|
@@ -51,22 +50,22 @@
|
|
|
51
50
|
left: 0;
|
|
52
51
|
top: 0;
|
|
53
52
|
font-size: 14px;
|
|
54
|
-
color: #fff;
|
|
55
53
|
background-color: var(--kui-color-mask);
|
|
56
54
|
gap: 10px;
|
|
57
55
|
cursor: pointer;
|
|
58
56
|
transition: opacity 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
57
|
+
color: #fff;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
&:hover {
|
|
62
61
|
.k-image-preview-mask {
|
|
63
62
|
opacity: 1;
|
|
63
|
+
cursor: zoom-in;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.k-image-preview {
|
|
69
|
-
// transition: all .25s ease-in-out;
|
|
70
69
|
position: fixed;
|
|
71
70
|
top: 0;
|
|
72
71
|
right: 0;
|
|
@@ -95,14 +94,16 @@
|
|
|
95
94
|
flex: 1;
|
|
96
95
|
overflow: hidden;
|
|
97
96
|
outline: 0;
|
|
98
|
-
-webkit-overflow-scrolling: touch;
|
|
99
97
|
z-index: 1002;
|
|
100
98
|
pointer-events: none;
|
|
101
99
|
transition: all 0.3s;
|
|
102
100
|
|
|
103
101
|
.k-image-preview-control {
|
|
104
102
|
position: absolute;
|
|
105
|
-
background-color:
|
|
103
|
+
background-color: var(--kui-color-bg-pop);
|
|
104
|
+
border: 1px solid var(--kui-color-pop-border);
|
|
105
|
+
box-shadow: var(--kui-pop-shadow);
|
|
106
|
+
|
|
106
107
|
display: flex;
|
|
107
108
|
padding: 10px;
|
|
108
109
|
position: absolute;
|
|
@@ -118,23 +119,31 @@
|
|
|
118
119
|
margin: 0;
|
|
119
120
|
gap: 5px 10px;
|
|
120
121
|
border-radius: 12px;
|
|
121
|
-
// backdrop-filter: blur(10px);
|
|
122
122
|
line-height: 1;
|
|
123
123
|
.k-image-preview-action {
|
|
124
124
|
line-height: 1;
|
|
125
125
|
display: flex;
|
|
126
126
|
font-size: 20px;
|
|
127
|
-
color:
|
|
127
|
+
color: var(--kui-color-text);
|
|
128
128
|
padding: 5px;
|
|
129
|
-
&:not(.k-image-preview-action-disabled)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
&:not(.k-image-preview-action-disabled, .k-image-preview-action-scale) {
|
|
130
|
+
&:hover {
|
|
131
|
+
color: var(--kui-color-primary);
|
|
132
|
+
background-color: var(--kui-color-bg-component-hover);
|
|
133
|
+
border-radius: 5px;
|
|
134
|
+
}
|
|
135
|
+
&:active {
|
|
136
|
+
background-color: var(--kui-color-bg-component-active);
|
|
137
|
+
}
|
|
133
138
|
}
|
|
134
139
|
}
|
|
135
140
|
path {
|
|
136
141
|
stroke-width: 40px !important;
|
|
137
142
|
}
|
|
143
|
+
.k-image-preview-action-scale {
|
|
144
|
+
width: 150px;
|
|
145
|
+
padding: 0;
|
|
146
|
+
}
|
|
138
147
|
|
|
139
148
|
.k-image-preview-action-divider {
|
|
140
149
|
width: 1px;
|
|
@@ -163,10 +172,10 @@
|
|
|
163
172
|
position: absolute;
|
|
164
173
|
width: 44px;
|
|
165
174
|
height: 44px;
|
|
166
|
-
color:
|
|
175
|
+
color: var(--kui-color-text);
|
|
167
176
|
font-size: 25px;
|
|
168
177
|
border-radius: 50%;
|
|
169
|
-
background-color: var(--kui-color-
|
|
178
|
+
background-color: var(--kui-color-bg);
|
|
170
179
|
display: flex;
|
|
171
180
|
align-items: center;
|
|
172
181
|
justify-content: center;
|
|
@@ -174,34 +183,19 @@
|
|
|
174
183
|
top: 50%;
|
|
175
184
|
pointer-events: auto;
|
|
176
185
|
cursor: pointer;
|
|
177
|
-
|
|
178
|
-
&:hover {
|
|
179
|
-
background-color: var(--kui-color-main);
|
|
180
|
-
color: #fff;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
&:active {
|
|
184
|
-
background-color: var(--kui-color-main-active);
|
|
185
|
-
}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
.k-image-preview-switch-left {
|
|
189
189
|
left: 10px;
|
|
190
|
-
transform: rotate(-90deg);
|
|
191
190
|
}
|
|
192
191
|
|
|
193
192
|
.k-image-preview-switch-right {
|
|
194
193
|
right: 10px;
|
|
195
|
-
transform: rotate(90deg);
|
|
196
194
|
}
|
|
197
195
|
|
|
198
196
|
.k-image-preview-switch-disabled {
|
|
199
197
|
cursor: not-allowed;
|
|
200
198
|
opacity: 0.6;
|
|
201
|
-
|
|
202
|
-
&:hover {
|
|
203
|
-
background-color: var(--kui-color-mask-30);
|
|
204
|
-
}
|
|
205
199
|
}
|
|
206
200
|
|
|
207
201
|
.k-image-preview-img-wrap {
|
|
@@ -212,7 +206,6 @@
|
|
|
212
206
|
left: 0;
|
|
213
207
|
transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
|
|
214
208
|
text-align: center;
|
|
215
|
-
// overflow: hidden;
|
|
216
209
|
pointer-events: none;
|
|
217
210
|
|
|
218
211
|
&::before {
|
|
@@ -224,6 +217,7 @@
|
|
|
224
217
|
|
|
225
218
|
.k-image-preview-img {
|
|
226
219
|
vertical-align: middle;
|
|
220
|
+
-webkit-user-select: none;
|
|
227
221
|
user-select: none;
|
|
228
222
|
pointer-events: auto;
|
|
229
223
|
cursor: grab;
|
|
@@ -240,13 +234,11 @@
|
|
|
240
234
|
pointer-events: auto;
|
|
241
235
|
width: 60%;
|
|
242
236
|
height: 50%;
|
|
243
|
-
background-color: var(--kui-color-mask-30);
|
|
244
237
|
position: absolute;
|
|
245
238
|
top: 50%;
|
|
246
239
|
left: 50%;
|
|
247
240
|
transform: translateX(-50%) translateY(-50%);
|
|
248
|
-
color: var(--kui-color-disabled);
|
|
249
|
-
// filter: blur(1px);
|
|
241
|
+
color: var(--kui-color-text-disabled);
|
|
250
242
|
font-size: 50px;
|
|
251
243
|
text-align: center;
|
|
252
244
|
display: flex;
|
|
@@ -258,7 +250,7 @@
|
|
|
258
250
|
}
|
|
259
251
|
|
|
260
252
|
.k-image-preview-panel {
|
|
261
|
-
background-color: var(--kui-color-
|
|
253
|
+
background-color: var(--kui-color-bg-layout);
|
|
262
254
|
position: absolute;
|
|
263
255
|
max-width: 512px;
|
|
264
256
|
top: 0;
|
|
@@ -269,7 +261,7 @@
|
|
|
269
261
|
transform: translateX(0);
|
|
270
262
|
opacity: 1;
|
|
271
263
|
transition: all 0.3s;
|
|
272
|
-
color:
|
|
264
|
+
color: var(--kui-color-text);
|
|
273
265
|
|
|
274
266
|
.k-image-preview-panel-action {
|
|
275
267
|
position: absolute;
|
|
@@ -299,7 +291,9 @@
|
|
|
299
291
|
}
|
|
300
292
|
|
|
301
293
|
.k-image-group {
|
|
302
|
-
display: inline-
|
|
294
|
+
display: inline-flex;
|
|
295
|
+
gap: 8px;
|
|
296
|
+
flex-wrap: wrap;
|
|
303
297
|
}
|
|
304
298
|
|
|
305
299
|
@keyframes k-image-zoom {
|
|
@@ -322,7 +316,7 @@
|
|
|
322
316
|
}
|
|
323
317
|
|
|
324
318
|
.k-image-preview-loading {
|
|
325
|
-
color: var(--kui-color-
|
|
319
|
+
color: var(--kui-color-primary);
|
|
326
320
|
position: absolute;
|
|
327
321
|
left: 50%;
|
|
328
322
|
top: 50%;
|
|
@@ -331,7 +325,7 @@
|
|
|
331
325
|
font-size: 20px;
|
|
332
326
|
height: 50px;
|
|
333
327
|
border-radius: 10px;
|
|
334
|
-
background: var(--kui-color-mask
|
|
328
|
+
background: var(--kui-color-mask);
|
|
335
329
|
display: flex;
|
|
336
330
|
align-items: center;
|
|
337
331
|
justify-content: center;
|
package/components/index.js
CHANGED
|
@@ -11,7 +11,7 @@ const UI = {
|
|
|
11
11
|
locale: locale.use,
|
|
12
12
|
i18n: locale.i18n,
|
|
13
13
|
lang: {},
|
|
14
|
-
install: function (
|
|
14
|
+
install: function (app, opts = {}) {
|
|
15
15
|
if (opts.locale) {
|
|
16
16
|
locale.use(opts.locale);
|
|
17
17
|
}
|
|
@@ -28,16 +28,16 @@ const UI = {
|
|
|
28
28
|
.replace(/([A-Z])/g, "-$1")
|
|
29
29
|
.replace(/^-/, "")
|
|
30
30
|
.toLowerCase();
|
|
31
|
-
|
|
31
|
+
app.component(kebabName, component);
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
app.component(key, component);
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
app.prototype.$message = components.message;
|
|
36
|
+
app.prototype.$notice = components.notice;
|
|
37
|
+
app.prototype.$modal = components.modal;
|
|
38
|
+
app.prototype.$loading = components.loading;
|
|
39
|
+
app.prototype.$image = components.KImage;
|
|
40
|
+
app.prototype.$theme = components.theme;
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
43
|
|
|
@@ -9,12 +9,7 @@ suffix,prefix 扩展
|
|
|
9
9
|
<Input placeholder="请输入用户名" :icon="PersonOutline" />
|
|
10
10
|
<Input placeholder="请输入验证码" :maxlength="8">
|
|
11
11
|
<template #suffix>
|
|
12
|
-
<Button
|
|
13
|
-
:disabled="time < 60"
|
|
14
|
-
style="width:100px;"
|
|
15
|
-
@click="sendCode"
|
|
16
|
-
theme="outline"
|
|
17
|
-
>
|
|
12
|
+
<Button :disabled="time < 60" style="width:100px;" @click="sendCode">
|
|
18
13
|
{{ time == 60 ? "获取验证码" : time + "(s)" }}
|
|
19
14
|
</Button>
|
|
20
15
|
</template>
|
|
@@ -22,7 +17,7 @@ suffix,prefix 扩展
|
|
|
22
17
|
<Input placeholder="请填写你要喝的Coffee" :icon="Gift">
|
|
23
18
|
<template #suffix>
|
|
24
19
|
<Tooltip title="请咨询管理员">
|
|
25
|
-
<
|
|
20
|
+
<Button :icon="InformationCircleOutline" />
|
|
26
21
|
</Tooltip>
|
|
27
22
|
</template>
|
|
28
23
|
</Input>
|
|
@@ -9,6 +9,7 @@ import { sizeMap, filterSize } from "../utils/size";
|
|
|
9
9
|
import { getChildren } from "../utils/vnode";
|
|
10
10
|
|
|
11
11
|
const Input = defineComponent({
|
|
12
|
+
inheritAttrs: false,
|
|
12
13
|
name: "Input",
|
|
13
14
|
props: {
|
|
14
15
|
clearable: { type: Boolean, default: true },
|
|
@@ -41,7 +42,7 @@ const Input = defineComponent({
|
|
|
41
42
|
icon: [String, Array],
|
|
42
43
|
suffix: String,
|
|
43
44
|
prefix: String,
|
|
44
|
-
theme: String,
|
|
45
|
+
theme: { type: String, default: "light" },
|
|
45
46
|
shape: String,
|
|
46
47
|
formatter: Function,
|
|
47
48
|
parser: Function,
|
|
@@ -60,7 +61,7 @@ const Input = defineComponent({
|
|
|
60
61
|
() => ps.value,
|
|
61
62
|
(v) => {
|
|
62
63
|
currentValue.value = v;
|
|
63
|
-
}
|
|
64
|
+
},
|
|
64
65
|
);
|
|
65
66
|
|
|
66
67
|
const focus = () => {
|
|
@@ -97,27 +98,29 @@ const Input = defineComponent({
|
|
|
97
98
|
};
|
|
98
99
|
const getSuffix = () => {
|
|
99
100
|
let { suffix, visiblePasswordIcon, type, inputType } = ps;
|
|
100
|
-
const SearchNode =
|
|
101
|
-
"search" in listeners ? (
|
|
102
|
-
<Icon
|
|
103
|
-
type={Search}
|
|
104
|
-
class="k-input-search-icon"
|
|
105
|
-
onClick={searchEvent}
|
|
106
|
-
/>
|
|
107
|
-
) : null;
|
|
108
101
|
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
if (type == "password" && visiblePasswordIcon) {
|
|
103
|
+
return (
|
|
111
104
|
<Icon
|
|
112
105
|
class="k-input-password-icon"
|
|
113
106
|
type={!showPassword.value ? EyeOutline : EyeOffOutline}
|
|
114
107
|
onClick={togglePassword}
|
|
115
108
|
/>
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
109
|
+
);
|
|
110
|
+
} else if ("search" in listeners) {
|
|
111
|
+
return (
|
|
112
|
+
<Icon
|
|
113
|
+
type={Search}
|
|
114
|
+
class="k-input-search-icon"
|
|
115
|
+
onClick={searchEvent}
|
|
116
|
+
/>
|
|
117
|
+
);
|
|
118
|
+
} else {
|
|
119
|
+
return (
|
|
120
|
+
slots.suffix?.() ||
|
|
121
|
+
(suffix ? <div class="k-input-suffix">{suffix}</div> : null)
|
|
122
|
+
);
|
|
123
|
+
}
|
|
121
124
|
};
|
|
122
125
|
|
|
123
126
|
return () => {
|
|
@@ -149,8 +152,8 @@ const Input = defineComponent({
|
|
|
149
152
|
slotControls.length > 0) &&
|
|
150
153
|
type !== "hidden";
|
|
151
154
|
const inputProps = {
|
|
152
|
-
attrs: { ...attrs },
|
|
153
155
|
props: {
|
|
156
|
+
htmlAttrs: { ...attrs },
|
|
154
157
|
disabled,
|
|
155
158
|
multiple,
|
|
156
159
|
size,
|
|
@@ -205,7 +208,7 @@ const Input = defineComponent({
|
|
|
205
208
|
const preChildren = [];
|
|
206
209
|
if (slotPrefix.length)
|
|
207
210
|
preChildren.push(
|
|
208
|
-
<div class="k-input-group-prefix">{slotPrefix}</div
|
|
211
|
+
<div class="k-input-group-prefix">{slotPrefix}</div>,
|
|
209
212
|
);
|
|
210
213
|
const innerChildren = [];
|
|
211
214
|
if (icon)
|
|
@@ -214,11 +217,11 @@ const Input = defineComponent({
|
|
|
214
217
|
type={icon}
|
|
215
218
|
class={`k-${inputType}-icon`}
|
|
216
219
|
onClick={iconClick}
|
|
217
|
-
|
|
220
|
+
/>,
|
|
218
221
|
);
|
|
219
222
|
if (prefix)
|
|
220
223
|
innerChildren.push(
|
|
221
|
-
<div class={`k-${inputType}-prefix`}>{prefix}</div
|
|
224
|
+
<div class={`k-${inputType}-prefix`}>{prefix}</div>,
|
|
222
225
|
);
|
|
223
226
|
innerChildren.push(textInput);
|
|
224
227
|
if (clearable)
|
|
@@ -230,19 +233,19 @@ const Input = defineComponent({
|
|
|
230
233
|
{ [`k-${inputType}-clearable-hidden`]: !clearableShow },
|
|
231
234
|
]}
|
|
232
235
|
onClick={clear}
|
|
233
|
-
|
|
236
|
+
/>,
|
|
234
237
|
);
|
|
235
238
|
const sufChildren = [];
|
|
236
239
|
if (slotSuffix.length)
|
|
237
240
|
sufChildren.push(
|
|
238
|
-
<div class="k-input-group-suffix">{slotSuffix}</div
|
|
241
|
+
<div class="k-input-group-suffix">{slotSuffix}</div>,
|
|
239
242
|
);
|
|
240
243
|
|
|
241
244
|
if (slotControls.length) innerChildren.push(slotControls);
|
|
242
245
|
return (
|
|
243
|
-
<InputGroup size={size}>
|
|
246
|
+
<InputGroup size={size} theme={theme}>
|
|
244
247
|
{preChildren}
|
|
245
|
-
<div {...props}
|
|
248
|
+
<div {...props} multiple>
|
|
246
249
|
{innerChildren}
|
|
247
250
|
</div>
|
|
248
251
|
{sufChildren}
|
|
@@ -257,7 +260,7 @@ const Input = defineComponent({
|
|
|
257
260
|
type={icon}
|
|
258
261
|
class={`k-${inputType}-icon`}
|
|
259
262
|
onClick={iconClick}
|
|
260
|
-
|
|
263
|
+
/>,
|
|
261
264
|
);
|
|
262
265
|
if (prefix)
|
|
263
266
|
children.push(<div class={`k-${inputType}-prefix`}>{prefix}</div>);
|
|
@@ -271,13 +274,12 @@ const Input = defineComponent({
|
|
|
271
274
|
{ [`k-${inputType}-clearable-hidden`]: !clearableShow },
|
|
272
275
|
]}
|
|
273
276
|
onClick={clear}
|
|
274
|
-
|
|
277
|
+
/>,
|
|
275
278
|
);
|
|
276
279
|
if (suffixNode) children.push(suffixNode);
|
|
277
280
|
if (slotControls.length) children.push(slotControls);
|
|
278
|
-
|
|
279
281
|
return (
|
|
280
|
-
<div {...props}
|
|
282
|
+
<div {...props} multiple>
|
|
281
283
|
{...children}
|
|
282
284
|
</div>
|
|
283
285
|
);
|
|
@@ -13,6 +13,7 @@ export default defineComponent({
|
|
|
13
13
|
value: [String, Number, Object],
|
|
14
14
|
showPassword: Boolean,
|
|
15
15
|
inputRef: Object,
|
|
16
|
+
htmlAttrs: Object,
|
|
16
17
|
},
|
|
17
18
|
setup(ps, { emit, slots, attrs, listeners }) {
|
|
18
19
|
const handleInput = (e) => {
|
|
@@ -44,6 +45,8 @@ export default defineComponent({
|
|
|
44
45
|
],
|
|
45
46
|
attrs: {
|
|
46
47
|
...attrs,
|
|
48
|
+
...ps.htmlAttrs,
|
|
49
|
+
|
|
47
50
|
disabled,
|
|
48
51
|
type,
|
|
49
52
|
},
|
|
@@ -60,6 +63,16 @@ export default defineComponent({
|
|
|
60
63
|
// onBlur: handleBlur,
|
|
61
64
|
// onInput: handleInput,
|
|
62
65
|
};
|
|
66
|
+
|
|
67
|
+
if (ps.autoComplete != "off") {
|
|
68
|
+
props.attrs = {
|
|
69
|
+
...props.attrs,
|
|
70
|
+
"data-1p-ignore": true,
|
|
71
|
+
"data-lpignore": true,
|
|
72
|
+
"data-dashlane-ignore": "true",
|
|
73
|
+
autoComplete: "new-password",
|
|
74
|
+
};
|
|
75
|
+
}
|
|
63
76
|
if (ps.showPassword === true && type == "password") {
|
|
64
77
|
props.attrs.type = "text";
|
|
65
78
|
}
|
|
@@ -10,6 +10,7 @@ const InputGroup = defineComponent({
|
|
|
10
10
|
type: Boolean,
|
|
11
11
|
default: true,
|
|
12
12
|
},
|
|
13
|
+
theme: { type: String, default: "light" },
|
|
13
14
|
size: {
|
|
14
15
|
type: String,
|
|
15
16
|
validator(value) {
|
|
@@ -31,6 +32,7 @@ const InputGroup = defineComponent({
|
|
|
31
32
|
{
|
|
32
33
|
[`k-input-group-compact`]: compact,
|
|
33
34
|
[`k-input-group-block`]: block,
|
|
35
|
+
[`k-input-group-light`]: ps.theme === "light",
|
|
34
36
|
[`k-input-group-lg`]: size == "large",
|
|
35
37
|
[`k-input-group-sm`]: size == "small",
|
|
36
38
|
},
|