kui-vue 3.6.8 → 3.6.10
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 +1 -1
- package/components/alert/demo/basic.md +2 -2
- package/components/alert/demo/close.md +2 -2
- package/components/alert/demo/customIcon.md +2 -2
- package/components/alert/styles/index.less +0 -1
- package/components/backtop/backtop.jsx +1 -1
- package/components/button/button.jsx +1 -1
- package/components/carousel/carousel.jsx +1 -1
- package/components/checkbox/checkbox.jsx +1 -1
- package/components/checkbox/styles/index.less +3 -0
- package/components/collapse/collapsePanel.jsx +1 -1
- package/components/colorPicker/presets.jsx +1 -1
- package/components/components.js +1 -2
- package/components/datePicker/datepicker.jsx +1 -1
- package/components/drawer/drawer.jsx +1 -1
- package/components/dropdown/dropdownButton.jsx +1 -1
- package/components/empty/empty.jsx +1 -1
- package/components/form/demo/valid.md +8 -7
- package/components/image/demo/group.md +1 -1
- package/components/image/group.jsx +10 -4
- package/components/image/image.jsx +48 -100
- package/components/image/preview.jsx +132 -117
- package/components/image/styles/index.less +211 -224
- package/components/image/utils.js +31 -0
- package/components/index.js +16 -35
- package/components/input/demo/event.md +0 -1
- package/components/input/input.jsx +1 -1
- package/components/inputNumber/inputNumber.jsx +1 -1
- package/components/inputNumber/styles/index.less +2 -2
- package/components/layout/demo/layout5.md +0 -1
- package/components/loading/loading.jsx +5 -27
- package/components/message/index.js +0 -6
- package/components/message/inner.jsx +1 -1
- package/components/modal/index.js +4 -7
- package/components/modal/modal.jsx +2 -3
- package/components/modal/styles/index.less +1 -0
- package/components/modal/toast.jsx +1 -1
- package/components/notice/index.js +0 -6
- package/components/page/demo/basic.md +3 -3
- package/components/page/demo/size.md +4 -4
- package/components/page/demo/sizer-elevator.md +6 -6
- package/components/page/index.md +1 -1
- package/components/page/page.jsx +9 -9
- package/components/popconfirm/popconfirm.jsx +1 -1
- package/components/progress/progress.jsx +1 -1
- package/components/radio/styles/index.less +3 -0
- package/components/rate/star.jsx +1 -1
- package/components/select/demo/theme.md +2 -1
- package/components/select/option.jsx +1 -1
- package/components/select/select.jsx +2 -2
- package/components/slider/demo/formatter.md +8 -9
- package/components/slider/slider.jsx +3 -4
- package/components/slider/thumb.jsx +4 -3
- package/components/space/demo/compact.md +9 -9
- package/components/statCard/statNumber.jsx +2 -2
- package/components/statCard/{countup.jsx → statup/countup.jsx} +1 -1
- package/components/styles/less-var.less +1 -1
- package/components/switch/switch.jsx +1 -1
- package/components/table/table.jsx +1 -1
- package/components/tabs/styles/index.less +2 -2
- package/components/tabs/tabs.jsx +1 -1
- package/components/tag/tag.jsx +1 -1
- package/components/tree/tree.jsx +1 -1
- package/components/treeselect/treeselect.jsx +1 -1
- package/components/upload/fileList.jsx +1 -1
- package/components/upload/selector.jsx +1 -1
- package/components/utils/theme.js +0 -10
- package/components/utils/vue.js +8 -0
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +332 -331
- package/dist/k-ui.esm.js +2 -2
- package/dist/k-ui.umd.js +2 -2
- package/dist/locale/de.js +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/zh-CN.js +1 -1
- package/dist/locale/zh-TW.js +1 -1
- package/package.json +13 -14
- package/types/index.d.ts +34 -34
- package/types/page/Page.d.ts +1 -1
- package/types/slider/Slider.d.ts +1 -0
- package/components/utils/i18n.js +0 -32
- /package/components/statCard/{countup.js → statup/countup.js} +0 -0
- /package/components/statCard/{rollup.jsx → statup/rollup.jsx} +0 -0
|
@@ -39,29 +39,8 @@
|
|
|
39
39
|
background-color: var(--kui-color-bg-component);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.k-image-preview-mask {
|
|
43
|
-
opacity: 0;
|
|
44
|
-
display: flex;
|
|
45
|
-
align-items: center;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
position: absolute;
|
|
48
|
-
width: 100%;
|
|
49
|
-
height: 100%;
|
|
50
|
-
left: 0;
|
|
51
|
-
top: 0;
|
|
52
|
-
font-size: 14px;
|
|
53
|
-
background-color: var(--kui-color-mask);
|
|
54
|
-
gap: 10px;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
transition: opacity 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
57
|
-
color: #fff;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
42
|
&:hover {
|
|
61
|
-
|
|
62
|
-
opacity: 1;
|
|
63
|
-
cursor: zoom-in;
|
|
64
|
-
}
|
|
43
|
+
cursor: zoom-in;
|
|
65
44
|
}
|
|
66
45
|
}
|
|
67
46
|
|
|
@@ -73,216 +52,225 @@
|
|
|
73
52
|
left: 0;
|
|
74
53
|
z-index: 1001;
|
|
75
54
|
display: flex;
|
|
55
|
+
}
|
|
76
56
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
57
|
+
.k-image-preview-mask {
|
|
58
|
+
position: fixed;
|
|
59
|
+
top: 0;
|
|
60
|
+
right: 0;
|
|
61
|
+
bottom: 0;
|
|
62
|
+
left: 0;
|
|
63
|
+
z-index: 1001;
|
|
64
|
+
height: 100%;
|
|
65
|
+
background-color: var(--kui-color-mask);
|
|
66
|
+
}
|
|
87
67
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.k-image-preview-control {
|
|
102
|
-
position: absolute;
|
|
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
|
-
|
|
107
|
-
display: flex;
|
|
108
|
-
padding: 10px;
|
|
109
|
-
position: absolute;
|
|
110
|
-
left: 50%;
|
|
111
|
-
transform: translate(-50%);
|
|
112
|
-
bottom: 20px;
|
|
113
|
-
pointer-events: auto;
|
|
114
|
-
z-index: 1;
|
|
115
|
-
flex-direction: row-reverse;
|
|
116
|
-
list-style: none;
|
|
117
|
-
align-items: center;
|
|
118
|
-
justify-content: center;
|
|
119
|
-
margin: 0;
|
|
120
|
-
gap: 5px 10px;
|
|
121
|
-
border-radius: 12px;
|
|
122
|
-
line-height: 1;
|
|
123
|
-
.k-image-preview-action {
|
|
124
|
-
line-height: 1;
|
|
125
|
-
display: flex;
|
|
126
|
-
font-size: 20px;
|
|
127
|
-
color: var(--kui-color-text);
|
|
128
|
-
padding: 5px;
|
|
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
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
path {
|
|
141
|
-
stroke-width: 40px !important;
|
|
142
|
-
}
|
|
143
|
-
.k-image-preview-action-scale {
|
|
144
|
-
width: 150px;
|
|
145
|
-
padding: 0;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.k-image-preview-action-divider {
|
|
149
|
-
width: 1px;
|
|
150
|
-
height: 0.9em;
|
|
151
|
-
vertical-align: middle;
|
|
152
|
-
border-width: 1px 0 0;
|
|
153
|
-
background-color: var(--kui-color-border);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.k-image-preview-action-rotate-left .k-icon {
|
|
157
|
-
transform: rotateY(-180deg) rotate(45deg);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.k-image-preview-action-rotate-right .k-icon {
|
|
161
|
-
transform: rotate(45deg);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.k-image-preview-action-disabled {
|
|
165
|
-
opacity: 0.6;
|
|
166
|
-
cursor: not-allowed;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
68
|
+
.k-image-preview-wrap {
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 0;
|
|
71
|
+
right: 0;
|
|
72
|
+
bottom: 0;
|
|
73
|
+
left: 0;
|
|
74
|
+
flex: 1;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
outline: 0;
|
|
77
|
+
z-index: 1002;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
transition: all 0.3s;
|
|
80
|
+
}
|
|
169
81
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
color: var(--kui-color-text);
|
|
176
|
-
font-size: 25px;
|
|
177
|
-
border-radius: 50%;
|
|
178
|
-
background-color: var(--kui-color-bg);
|
|
179
|
-
display: flex;
|
|
180
|
-
align-items: center;
|
|
181
|
-
justify-content: center;
|
|
182
|
-
z-index: 1;
|
|
183
|
-
top: 50%;
|
|
184
|
-
pointer-events: auto;
|
|
185
|
-
cursor: pointer;
|
|
186
|
-
}
|
|
82
|
+
.k-image-preview-control {
|
|
83
|
+
position: absolute;
|
|
84
|
+
background-color: var(--kui-color-bg-pop);
|
|
85
|
+
border: 1px solid var(--kui-color-pop-border);
|
|
86
|
+
box-shadow: var(--kui-pop-shadow);
|
|
187
87
|
|
|
188
|
-
|
|
189
|
-
|
|
88
|
+
display: flex;
|
|
89
|
+
padding: 10px;
|
|
90
|
+
position: absolute;
|
|
91
|
+
left: 50%;
|
|
92
|
+
transform: translate(-50%);
|
|
93
|
+
bottom: 20px;
|
|
94
|
+
pointer-events: auto;
|
|
95
|
+
z-index: 1;
|
|
96
|
+
flex-direction: row;
|
|
97
|
+
list-style: none;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
margin: 0;
|
|
101
|
+
gap: 5px 10px;
|
|
102
|
+
border-radius: 12px;
|
|
103
|
+
line-height: 1;
|
|
104
|
+
path {
|
|
105
|
+
stroke-width: 40px !important;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
.k-image-preview-action {
|
|
109
|
+
line-height: 1;
|
|
110
|
+
display: flex;
|
|
111
|
+
font-size: 20px;
|
|
112
|
+
color: var(--kui-color-text);
|
|
113
|
+
padding: 5px;
|
|
114
|
+
&:not(.k-image-preview-action-disabled, .k-image-preview-action-scale) {
|
|
115
|
+
&:hover {
|
|
116
|
+
color: var(--kui-color-primary);
|
|
117
|
+
background-color: var(--kui-color-bg-component-hover);
|
|
118
|
+
border-radius: 5px;
|
|
190
119
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
right: 10px;
|
|
120
|
+
&:active {
|
|
121
|
+
background-color: var(--kui-color-bg-component-active);
|
|
194
122
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
.k-image-preview-action-nav {
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 5px;
|
|
129
|
+
.k-btn {
|
|
130
|
+
width: 20px;
|
|
131
|
+
.k-icon {
|
|
132
|
+
font-size: 20px;
|
|
199
133
|
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
200
136
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
137
|
+
.k-image-preview-action-scale {
|
|
138
|
+
width: 150px;
|
|
139
|
+
padding: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.k-image-preview-action-divider {
|
|
143
|
+
width: 1px;
|
|
144
|
+
height: 0.9em;
|
|
145
|
+
vertical-align: middle;
|
|
146
|
+
border-width: 1px 0 0;
|
|
147
|
+
background-color: var(--kui-color-border);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.k-image-preview-action-disabled {
|
|
151
|
+
opacity: 0.6;
|
|
152
|
+
cursor: not-allowed;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.k-image-preview-switch-left,
|
|
156
|
+
.k-image-preview-switch-right {
|
|
157
|
+
position: absolute;
|
|
158
|
+
width: 44px;
|
|
159
|
+
height: 44px;
|
|
160
|
+
color: var(--kui-color-text);
|
|
161
|
+
font-size: 25px;
|
|
162
|
+
border-radius: 50%;
|
|
163
|
+
background-color: var(--kui-color-bg);
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
z-index: 1;
|
|
168
|
+
top: 50%;
|
|
169
|
+
pointer-events: auto;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.k-image-preview-switch-left {
|
|
174
|
+
left: 10px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.k-image-preview-switch-right {
|
|
178
|
+
right: 10px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.k-image-preview-switch-disabled {
|
|
182
|
+
cursor: not-allowed;
|
|
183
|
+
opacity: 0.6;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.k-image-preview-img-wrap {
|
|
187
|
+
position: absolute;
|
|
188
|
+
top: 0;
|
|
189
|
+
right: 0;
|
|
190
|
+
bottom: 0;
|
|
191
|
+
left: 0;
|
|
192
|
+
transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
|
|
193
|
+
text-align: center;
|
|
194
|
+
pointer-events: none;
|
|
195
|
+
|
|
196
|
+
&::before {
|
|
197
|
+
display: inline-block;
|
|
198
|
+
width: 0;
|
|
199
|
+
height: 50%;
|
|
200
|
+
content: "";
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.k-image-preview-img {
|
|
204
|
+
vertical-align: middle;
|
|
205
|
+
-webkit-user-select: none;
|
|
206
|
+
user-select: none;
|
|
207
|
+
pointer-events: auto;
|
|
208
|
+
cursor: grab;
|
|
209
|
+
transition: transform 0.3s ease-in-out;
|
|
210
|
+
max-width: 100%;
|
|
211
|
+
max-height: 100%;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
video.k-image-preview-img {
|
|
215
|
+
max-height: calc(100vh - 130px);
|
|
250
216
|
}
|
|
251
217
|
|
|
252
|
-
.k-image-preview-
|
|
253
|
-
|
|
218
|
+
.k-image-preview-img-error {
|
|
219
|
+
pointer-events: auto;
|
|
220
|
+
width: 60%;
|
|
221
|
+
height: 50%;
|
|
254
222
|
position: absolute;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
.k-image-preview-panel-action {
|
|
267
|
-
position: absolute;
|
|
268
|
-
left: 0;
|
|
269
|
-
top: 50%;
|
|
270
|
-
background-color: var(--kui-color-mask);
|
|
271
|
-
border-radius: 0 5px 5px 0;
|
|
272
|
-
padding: 15px 0;
|
|
273
|
-
color: #fff;
|
|
274
|
-
cursor: pointer;
|
|
275
|
-
|
|
276
|
-
.k-icon {
|
|
277
|
-
transform: rotate(90deg);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
223
|
+
top: 50%;
|
|
224
|
+
left: 50%;
|
|
225
|
+
transform: translateX(-50%) translateY(-50%);
|
|
226
|
+
color: var(--kui-color-text-disabled);
|
|
227
|
+
font-size: 50px;
|
|
228
|
+
text-align: center;
|
|
229
|
+
display: flex;
|
|
230
|
+
justify-content: center;
|
|
231
|
+
border-radius: var(--kui-border-radius);
|
|
232
|
+
align-items: center;
|
|
280
233
|
}
|
|
234
|
+
}
|
|
281
235
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
236
|
+
.k-image-preview-panel {
|
|
237
|
+
background-color: var(--kui-color-bg-layout);
|
|
238
|
+
position: absolute;
|
|
239
|
+
max-width: 512px;
|
|
240
|
+
top: 0;
|
|
241
|
+
right: 0;
|
|
242
|
+
bottom: 0;
|
|
243
|
+
padding: 20px;
|
|
244
|
+
z-index: 1002;
|
|
245
|
+
transform: translateX(0);
|
|
246
|
+
opacity: 1;
|
|
247
|
+
transition: all 0.3s;
|
|
248
|
+
color: var(--kui-color-text);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.k-image-preview-panel-action {
|
|
252
|
+
position: absolute;
|
|
253
|
+
left: 0;
|
|
254
|
+
top: 50%;
|
|
255
|
+
background-color: var(--kui-color-bg-component);
|
|
256
|
+
border-radius: 0 5px 5px 0;
|
|
257
|
+
padding: 15px 0;
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
&:hover {
|
|
260
|
+
background-color: var(--kui-color-bg-component-hover);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&:active {
|
|
264
|
+
background-color: var(--kui-color-bg-component-active);
|
|
285
265
|
}
|
|
266
|
+
.k-icon {
|
|
267
|
+
transform: rotate(90deg);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.k-image-preview-panel-hidden {
|
|
272
|
+
transform: translateX(100%);
|
|
273
|
+
opacity: 0;
|
|
286
274
|
}
|
|
287
275
|
|
|
288
276
|
.k-image-panel-enter-active,
|
|
@@ -296,10 +284,9 @@
|
|
|
296
284
|
flex-wrap: wrap;
|
|
297
285
|
}
|
|
298
286
|
|
|
299
|
-
@keyframes k-image-
|
|
287
|
+
@keyframes k-image-fade {
|
|
300
288
|
from {
|
|
301
289
|
opacity: 0;
|
|
302
|
-
transform: scale3d(0.3, 0.3, 0) translateZ(0);
|
|
303
290
|
}
|
|
304
291
|
|
|
305
292
|
to {
|
|
@@ -307,12 +294,12 @@
|
|
|
307
294
|
}
|
|
308
295
|
}
|
|
309
296
|
|
|
310
|
-
.k-image-
|
|
311
|
-
animation: k-image-
|
|
297
|
+
.k-image-fade-enter-active {
|
|
298
|
+
animation: k-image-fade 0.4s linear;
|
|
312
299
|
}
|
|
313
300
|
|
|
314
|
-
.k-image-
|
|
315
|
-
animation: k-image-
|
|
301
|
+
.k-image-fade-leave-active {
|
|
302
|
+
animation: k-image-fade 0.4s linear reverse;
|
|
316
303
|
}
|
|
317
304
|
|
|
318
305
|
.k-image-preview-loading {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const loadImage = (src, callback, err) => {
|
|
2
|
+
if (!src) return;
|
|
3
|
+
|
|
4
|
+
let image = new Image();
|
|
5
|
+
let isCompleted = false;
|
|
6
|
+
|
|
7
|
+
const cleanup = () => {
|
|
8
|
+
if (isCompleted) return;
|
|
9
|
+
isCompleted = true;
|
|
10
|
+
image.onload = null;
|
|
11
|
+
image.onerror = null;
|
|
12
|
+
image = null;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
image.onload = () => {
|
|
16
|
+
if (!isCompleted) {
|
|
17
|
+
const { width, height } = image;
|
|
18
|
+
callback && callback({ width, height });
|
|
19
|
+
}
|
|
20
|
+
cleanup();
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
image.onerror = () => {
|
|
24
|
+
if (!isCompleted) {
|
|
25
|
+
err && err();
|
|
26
|
+
}
|
|
27
|
+
cleanup();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
image.src = src;
|
|
31
|
+
};
|
package/components/index.js
CHANGED
|
@@ -1,49 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import locale from "./utils/i18n";
|
|
3
|
-
|
|
1
|
+
import { version } from "../package.json";
|
|
4
2
|
import * as components from "./components";
|
|
5
|
-
import "./
|
|
6
|
-
|
|
3
|
+
import { globalComponents, installGlobal } from "./utils/vue";
|
|
7
4
|
export * from "./components";
|
|
5
|
+
import "./styles/index.less";
|
|
8
6
|
|
|
9
7
|
const UI = {
|
|
10
|
-
version:
|
|
11
|
-
locale: locale.use,
|
|
12
|
-
i18n: locale.i18n,
|
|
8
|
+
version: version,
|
|
13
9
|
lang: {},
|
|
14
|
-
install: function (app
|
|
15
|
-
if (opts.locale) {
|
|
16
|
-
locale.use(opts.locale);
|
|
17
|
-
}
|
|
18
|
-
if (opts.i18n) {
|
|
19
|
-
locale.setI18n(opts.i18n);
|
|
20
|
-
}
|
|
21
|
-
|
|
10
|
+
install: function (app) {
|
|
22
11
|
Object.keys(components).forEach((key) => {
|
|
23
12
|
const component = components[key];
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
if (globalComponents.includes(key)) {
|
|
14
|
+
installGlobal(app, component);
|
|
15
|
+
} else if (!key.startsWith("K")) {
|
|
16
|
+
const name = key
|
|
17
|
+
.replace(/([A-Z])/g, "-$1")
|
|
18
|
+
.replace(/^-/, "")
|
|
19
|
+
.toLowerCase();
|
|
20
|
+
const kebabName = `k-${name}`;
|
|
31
21
|
app.component(kebabName, component);
|
|
22
|
+
app.component(key, component);
|
|
23
|
+
} else {
|
|
24
|
+
app.component(key, component);
|
|
32
25
|
}
|
|
33
|
-
app.component(key, component);
|
|
34
26
|
});
|
|
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
27
|
},
|
|
42
28
|
};
|
|
43
29
|
|
|
44
|
-
// auto install
|
|
45
|
-
// if (typeof window !== 'undefined' && window.Vue) {
|
|
46
|
-
// UI.install(window.Vue);
|
|
47
|
-
// }
|
|
48
|
-
|
|
49
30
|
export default UI;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Icon from "../icon";
|
|
2
2
|
import { isEmpty } from "../utils/number";
|
|
3
|
-
import { Search, CloseCircle, EyeOutline, EyeOffOutline } from "kui-icons";
|
|
3
|
+
import { Search, CloseCircle, EyeOutline, EyeOffOutline } from "kui-icons/dist/icons";
|
|
4
4
|
import InputGroup from "./inputGroup.jsx";
|
|
5
5
|
import { defineComponent, ref, nextTick, watch, inject, provide } from "vue";
|
|
6
6
|
import { withInstall } from "../utils/vue";
|
|
@@ -3,7 +3,7 @@ import Big from "big.js";
|
|
|
3
3
|
import Input from "../input/input";
|
|
4
4
|
import Icon from "../icon";
|
|
5
5
|
import { withInstall } from "../utils/vue";
|
|
6
|
-
import { ChevronUp, ChevronDown } from "kui-icons";
|
|
6
|
+
import { ChevronUp, ChevronDown } from "kui-icons/dist/icons";
|
|
7
7
|
import { sizeMap, filterSize } from "../utils/size";
|
|
8
8
|
import { normalize, isValidBig } from "../utils/number";
|
|
9
9
|
const InputNumber = defineComponent({
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
&:first-child {
|
|
73
|
-
border-top-right-radius: var(--kui-border-radius);
|
|
73
|
+
// border-top-right-radius: var(--kui-border-radius);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
&:last-child {
|
|
77
77
|
border-top: 1px solid var(--kui-color-border);
|
|
78
|
-
border-bottom-right-radius: var(--kui-border-radius);
|
|
78
|
+
// border-bottom-right-radius: var(--kui-border-radius);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -92,11 +92,12 @@ const loading = defineComponent({
|
|
|
92
92
|
},
|
|
93
93
|
});
|
|
94
94
|
const createInstance = (props = {}, context) => {
|
|
95
|
-
const container = document.createElement("div");
|
|
96
|
-
|
|
95
|
+
// const container = document.createElement("div");
|
|
96
|
+
// container.id = `k-loading-box`;
|
|
97
|
+
// document.body.appendChild(container);
|
|
97
98
|
|
|
98
99
|
const vm = createVNode(loading, props, context);
|
|
99
|
-
render(vm,
|
|
100
|
+
render(vm, document.body);
|
|
100
101
|
return vm;
|
|
101
102
|
// return vm.component?.exposed; //for 3
|
|
102
103
|
};
|
|
@@ -125,32 +126,9 @@ let Loading = {
|
|
|
125
126
|
destroy() {
|
|
126
127
|
if (loadInstance) {
|
|
127
128
|
loadInstance.destroy();
|
|
129
|
+
document.body.removeChild(loadInstance.$el);
|
|
128
130
|
loadInstance = null;
|
|
129
|
-
document.body.removeChild(
|
|
130
|
-
document.querySelector(".k-loading-wrap")?.parentNode
|
|
131
|
-
);
|
|
132
131
|
}
|
|
133
132
|
},
|
|
134
|
-
install(app) {
|
|
135
|
-
// app.provide("loading", Loading);
|
|
136
|
-
// 可选:同时挂到 globalProperties 兼容 this.$loading
|
|
137
|
-
// app.config.globalProperties.$loading = Loading; //for 3
|
|
138
|
-
app.prototype.$loading = Loading;
|
|
139
|
-
},
|
|
140
|
-
useLoading() {
|
|
141
|
-
const instance = getCurrentInstance();
|
|
142
|
-
const proxy = instance ? instance.proxy : null;
|
|
143
|
-
const loadingWrapper = {};
|
|
144
|
-
|
|
145
|
-
["start", "finish", "error", "update"].forEach((type) => {
|
|
146
|
-
loadingWrapper[type] = (props = {}) => {
|
|
147
|
-
return getInstance(null, proxy);
|
|
148
|
-
};
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
loadingWrapper.destroy = Loading.destroy;
|
|
152
|
-
|
|
153
|
-
return loadingWrapper;
|
|
154
|
-
},
|
|
155
133
|
};
|
|
156
134
|
export default withInstall(Loading);
|
|
@@ -20,12 +20,6 @@ let Message = {
|
|
|
20
20
|
messageInstance = null;
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
install(app) {
|
|
24
|
-
// app.provide("message", Message);
|
|
25
|
-
// 可选:同时挂到 globalProperties 兼容 this.$message
|
|
26
|
-
// app.config.globalProperties.$message = Message; //for 3
|
|
27
|
-
app.prototype.$message = Message;
|
|
28
|
-
},
|
|
29
23
|
};
|
|
30
24
|
["info", "success", "warning", "error"].forEach((type) => {
|
|
31
25
|
Message[type] = (content, duration, onClose) => {
|