@king-design/intact 3.0.0-beta.1 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/button/demos/basic.md +1 -1
- package/components/button/demos/disabled.md +2 -1
- package/components/button/demos/group.md +2 -2
- package/components/button/demos/icon.md +7 -7
- package/components/button/demos/loading.md +4 -4
- package/components/button/demos/size.md +4 -4
- package/components/button/styles.ts +19 -13
- package/components/carousel/index.vdt +2 -2
- package/components/cascader/index.vdt +1 -1
- package/components/checkbox/demos/basic.md +1 -1
- package/components/checkbox/demos/group.md +1 -1
- package/components/checkbox/demos/indeterminate.md +1 -1
- package/components/checkbox/demos/value.md +1 -1
- package/components/collapse/item.vdt +1 -1
- package/components/copy/index.vdt +1 -1
- package/components/datepicker/calendar.vdt +6 -6
- package/components/datepicker/demos/datetime.md +5 -4
- package/components/datepicker/index.spec.ts +11 -1
- package/components/datepicker/styles.ts +6 -1
- package/components/datepicker/useValue.ts +35 -10
- package/components/dialog/styles.ts +1 -1
- package/components/dropdown/demos/basic.md +1 -1
- package/components/dropdown/demos/checkbox.md +1 -1
- package/components/dropdown/demos/disabled.md +2 -2
- package/components/dropdown/demos/nested.md +6 -6
- package/components/dropdown/demos/position.md +3 -3
- package/components/dropdown/demos/trigger.md +2 -2
- package/components/form/demos/basic.md +2 -2
- package/components/form/demos/custom.md +2 -4
- package/components/form/styles.ts +2 -2
- package/components/icon/demos/icons.md +130 -97
- package/components/icon/styles.ts +6 -2
- package/components/input/demos/blocks.md +7 -2
- package/components/input/demos/clearable.md +2 -2
- package/components/input/demos/showCount.md +18 -0
- package/components/input/demos/size.md +6 -4
- package/components/input/index.md +1 -0
- package/components/input/index.ts +5 -0
- package/components/input/index.vdt +22 -14
- package/components/input/search.vdt +2 -5
- package/components/input/styles.ts +81 -77
- package/components/input/useFocus.ts +17 -0
- package/components/menu/item.vdt +1 -1
- package/components/pagination/index.vdt +2 -2
- package/components/progress/index.vdt +1 -1
- package/components/radio/demos/basic.md +1 -1
- package/components/radio/demos/group.md +1 -1
- package/components/radio/demos/value.md +1 -1
- package/components/select/base.vdt +19 -17
- package/components/select/demos/customMenu.md +2 -2
- package/components/select/index.spec.ts +4 -1
- package/components/select/menu.vdt +2 -2
- package/components/select/option.vdt +1 -0
- package/components/select/styles.ts +5 -1
- package/components/spinner/index.vdt +4 -4
- package/components/spinner/styles.ts +9 -6
- package/components/steps/step.vdt +2 -2
- package/components/steps/styles.ts +5 -1
- package/components/table/cell.vdt +1 -1
- package/components/table/column.vdt +27 -16
- package/components/table/demos/group.md +4 -3
- package/components/table/demos/title.md +3 -5
- package/components/table/index.spec.ts +18 -1
- package/components/table/styles.ts +21 -28
- package/components/table/useGroup.ts +41 -23
- package/components/tabs/index.vdt +3 -2
- package/components/tag/index.md +31 -0
- package/components/tag/styles.ts +6 -6
- package/components/tag/tags.vdt +1 -0
- package/components/tag/useNowrap.ts +1 -1
- package/components/transfer/index.vdt +4 -3
- package/components/types.ts +1 -0
- package/components/upload/index.vdt +4 -4
- package/es/components/button/styles.d.ts +1 -1
- package/es/components/button/styles.js +3 -5
- package/es/components/carousel/index.vdt.js +2 -2
- package/es/components/cascader/index.vdt.js +1 -1
- package/es/components/collapse/item.vdt.js +1 -1
- package/es/components/copy/index.vdt.js +1 -1
- package/es/components/datepicker/calendar.vdt.js +6 -6
- package/es/components/datepicker/index.spec.js +170 -152
- package/es/components/datepicker/styles.js +1 -1
- package/es/components/datepicker/useValue.d.ts +3 -3
- package/es/components/datepicker/useValue.js +38 -9
- package/es/components/dialog/styles.js +1 -1
- package/es/components/form/styles.js +1 -1
- package/es/components/icon/styles.js +1 -1
- package/es/components/input/index.d.ts +3 -1
- package/es/components/input/index.js +4 -1
- package/es/components/input/index.vdt.js +21 -10
- package/es/components/input/search.vdt.js +2 -4
- package/es/components/input/styles.js +13 -6
- package/es/components/input/useFocus.d.ts +4 -0
- package/es/components/input/useFocus.js +21 -0
- package/es/components/menu/item.vdt.js +4 -1
- package/es/components/pagination/index.vdt.js +2 -2
- package/es/components/progress/index.vdt.js +1 -1
- package/es/components/select/base.vdt.js +36 -19
- package/es/components/select/index.spec.js +23 -11
- package/es/components/select/menu.vdt.js +5 -5
- package/es/components/select/option.vdt.js +2 -1
- package/es/components/select/styles.js +1 -1
- package/es/components/spinner/index.vdt.js +4 -4
- package/es/components/spinner/styles.js +2 -2
- package/es/components/steps/step.vdt.js +2 -2
- package/es/components/steps/styles.js +6 -2
- package/es/components/table/cell.vdt.js +1 -1
- package/es/components/table/column.vdt.js +40 -24
- package/es/components/table/index.spec.js +37 -6
- package/es/components/table/styles.js +15 -8
- package/es/components/table/useGroup.d.ts +9 -3
- package/es/components/table/useGroup.js +45 -37
- package/es/components/tabs/index.vdt.js +7 -2
- package/es/components/tag/styles.js +1 -1
- package/es/components/tag/tags.vdt.js +14 -2
- package/es/components/tag/useNowrap.js +1 -1
- package/es/components/transfer/index.vdt.js +14 -3
- package/es/components/types.d.ts +1 -0
- package/es/components/upload/index.vdt.js +4 -4
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/button/demos/disabled/react.js +5 -2
- package/es/site/data/components/button/demos/group/react.js +2 -2
- package/es/site/data/components/button/demos/icon/react.js +7 -7
- package/es/site/data/components/button/demos/loading/react.js +4 -4
- package/es/site/data/components/button/demos/size/react.js +4 -4
- package/es/site/data/components/datepicker/demos/datetime/index.d.ts +1 -0
- package/es/site/data/components/datepicker/demos/datetime/index.js +1 -0
- package/es/site/data/components/dropdown/demos/basic/react.js +1 -1
- package/es/site/data/components/dropdown/demos/checkbox/react.js +1 -1
- package/es/site/data/components/dropdown/demos/disabled/react.js +2 -2
- package/es/site/data/components/dropdown/demos/nested/react.js +9 -9
- package/es/site/data/components/dropdown/demos/position/react.js +3 -3
- package/es/site/data/components/dropdown/demos/trigger/react.js +2 -2
- package/es/site/data/components/form/demos/basic/react.js +1 -1
- package/es/site/data/components/icon/demos/icons/index.d.ts +8 -4
- package/es/site/data/components/icon/demos/icons/index.js +35 -1
- package/es/site/data/components/icon/demos/icons/react.d.ts +9 -4
- package/es/site/data/components/icon/demos/icons/react.js +51 -9
- package/es/site/data/components/input/demos/blocks/react.js +7 -7
- package/es/site/data/components/input/demos/clearable/react.js +2 -2
- package/es/site/data/components/input/demos/showCount/index.d.ts +5 -0
- package/es/site/data/components/input/demos/showCount/index.js +17 -0
- package/es/site/data/components/input/demos/showCount/react.d.ts +4 -0
- package/es/site/data/components/input/demos/showCount/react.js +33 -0
- package/es/site/data/components/input/demos/size/react.js +8 -8
- package/es/site/data/components/select/demos/customMenu/react.js +5 -5
- package/es/site/data/components/table/demos/title/react.js +4 -4
- package/es/site/src/pages/styles.js +1 -1
- package/es/site/src/router/index.js +1 -1
- package/es/styles/fonts/iconfont.eot +0 -0
- package/es/styles/fonts/iconfont.js +1 -1
- package/es/styles/fonts/iconfont.svg +35 -35
- package/es/styles/fonts/iconfont.ttf +0 -0
- package/es/styles/fonts/iconfont.woff +0 -0
- package/es/styles/global.js +1 -1
- package/index.ts +2 -2
- package/package.json +2 -2
- package/styles/fonts/demo.css +277 -108
- package/styles/fonts/demo_index.html +2169 -0
- package/styles/fonts/iconfont.css +52 -50
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +1 -0
- package/styles/fonts/iconfont.json +611 -0
- package/styles/fonts/iconfont.svg +35 -35
- package/styles/fonts/iconfont.ts +123 -124
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/iconfont.woff2 +0 -0
- package/styles/global.ts +4 -4
- package/components/select/useNowrap.ts +0 -24
- package/es/components/select/useNowrap.d.ts +0 -3
- package/es/components/select/useNowrap.js +0 -19
|
@@ -45,6 +45,11 @@ const defaults = deepDefaults(
|
|
|
45
45
|
flat: {
|
|
46
46
|
get color() { return theme.color.lightBlack },
|
|
47
47
|
get bgColor() { return theme.color.bg },
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
// count
|
|
51
|
+
count: {
|
|
52
|
+
get color() { return theme.color.placeholder },
|
|
48
53
|
}
|
|
49
54
|
},
|
|
50
55
|
sizes.reduce((memo, size) => {
|
|
@@ -68,30 +73,35 @@ export function makeStyles() {
|
|
|
68
73
|
return css`
|
|
69
74
|
display: inline-block;
|
|
70
75
|
width: ${input.width};
|
|
76
|
+
color: ${input.color};
|
|
71
77
|
vertical-align: middle;
|
|
72
78
|
.k-input-wrapper {
|
|
73
|
-
display: inline-
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
align-items: center;
|
|
74
81
|
width: 100%;
|
|
75
82
|
position: relative;
|
|
76
|
-
}
|
|
77
|
-
.k-input-inner {
|
|
78
|
-
display: inline-block;
|
|
79
|
-
width: 100%;
|
|
80
83
|
border: ${input.border};
|
|
81
84
|
background-color: ${input.bgColor};
|
|
82
85
|
transition: border ${input.transition}, background ${input.transition}, box-shadow ${input.transition};
|
|
83
86
|
border-radius: ${input.borderRadius};
|
|
84
|
-
outline: none;
|
|
85
|
-
position: relative;
|
|
86
|
-
color: ${input.color};
|
|
87
87
|
&:hover {
|
|
88
88
|
border: ${input.hoverBorder};
|
|
89
89
|
z-index: 1;
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
}
|
|
92
|
+
&.k-focus .k-input-wrapper {
|
|
93
|
+
border: ${input.focusBorder};
|
|
94
|
+
z-index: 1;
|
|
95
|
+
}
|
|
96
|
+
.k-input-inner {
|
|
97
|
+
flex: 1;
|
|
98
|
+
outline: none;
|
|
99
|
+
color: inherit;
|
|
100
|
+
font-size: inherit;
|
|
101
|
+
border: none;
|
|
102
|
+
background: transparent;
|
|
103
|
+
padding: 0;
|
|
104
|
+
width: 0; // must set width to 0, otherwise it has min width
|
|
95
105
|
&::placeholder {
|
|
96
106
|
color: ${input.placeholderColor};
|
|
97
107
|
}
|
|
@@ -105,12 +115,17 @@ export function makeStyles() {
|
|
|
105
115
|
// prefix & suffix
|
|
106
116
|
.k-input-prefix,
|
|
107
117
|
.k-input-suffix {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
z-index: 2;
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: ${input.clearIconGap};
|
|
112
121
|
color: ${theme.color.lightBlack};
|
|
113
|
-
|
|
122
|
+
position: relative;
|
|
123
|
+
}
|
|
124
|
+
.k-input-prefix {
|
|
125
|
+
margin-right: ${input.clearIconGap};
|
|
126
|
+
}
|
|
127
|
+
.k-input-suffix {
|
|
128
|
+
margin-left: ${input.clearIconGap};
|
|
114
129
|
}
|
|
115
130
|
|
|
116
131
|
// clearable
|
|
@@ -119,9 +134,6 @@ export function makeStyles() {
|
|
|
119
134
|
transition: opacity ${input.transition};
|
|
120
135
|
pointer-events: none;
|
|
121
136
|
color: ${input.clearIconColor};
|
|
122
|
-
+ * {
|
|
123
|
-
margin-left: ${input.clearIconGap};
|
|
124
|
-
}
|
|
125
137
|
}
|
|
126
138
|
&:hover .k-input-clear.k-input-show {
|
|
127
139
|
opacity: 1;
|
|
@@ -139,12 +151,12 @@ export function makeStyles() {
|
|
|
139
151
|
position: absolute;
|
|
140
152
|
z-index: 1;
|
|
141
153
|
right: 0;
|
|
142
|
-
&.k-input-show +
|
|
154
|
+
&.k-input-show + * {
|
|
143
155
|
transition: opacity ${input.transition};
|
|
144
156
|
}
|
|
145
157
|
}
|
|
146
158
|
&:hover {
|
|
147
|
-
.k-input-clear.k-input-show +
|
|
159
|
+
.k-input-clear.k-input-show + * {
|
|
148
160
|
opacity: 0;
|
|
149
161
|
}
|
|
150
162
|
}
|
|
@@ -152,29 +164,23 @@ export function makeStyles() {
|
|
|
152
164
|
|
|
153
165
|
// group
|
|
154
166
|
&.k-group {
|
|
155
|
-
display:
|
|
156
|
-
.k-input-
|
|
167
|
+
display: inline-flex;
|
|
168
|
+
.k-input-wrapper {
|
|
157
169
|
border-radius: 0;
|
|
158
170
|
}
|
|
159
171
|
.k-input-wrapper:first-child {
|
|
160
|
-
|
|
161
|
-
border-radius: ${input.borderRadius} 0 0 ${input.borderRadius};
|
|
162
|
-
}
|
|
172
|
+
border-radius: ${input.borderRadius} 0 0 ${input.borderRadius};
|
|
163
173
|
}
|
|
164
174
|
.k-input-wrapper:last-child {
|
|
165
|
-
|
|
166
|
-
border-radius: 0 ${input.borderRadius} ${input.borderRadius} 0;
|
|
167
|
-
}
|
|
175
|
+
border-radius: 0 ${input.borderRadius} ${input.borderRadius} 0;
|
|
168
176
|
}
|
|
169
177
|
}
|
|
170
178
|
.k-input-prepend,
|
|
171
179
|
.k-input-append {
|
|
172
|
-
display:
|
|
173
|
-
|
|
174
|
-
vertical-align: middle;
|
|
180
|
+
display: inline-flex;
|
|
181
|
+
align-items: center;
|
|
175
182
|
background-color: ${input.groupBgColor};
|
|
176
183
|
border: ${input.border};
|
|
177
|
-
text-align: center;
|
|
178
184
|
white-space: nowrap;
|
|
179
185
|
.k-btn {
|
|
180
186
|
margin: -1px;
|
|
@@ -216,10 +222,10 @@ export function makeStyles() {
|
|
|
216
222
|
|
|
217
223
|
// flat
|
|
218
224
|
&.k-flat {
|
|
219
|
-
|
|
225
|
+
color: ${input.flat.color};
|
|
226
|
+
.k-input-wrapper {
|
|
220
227
|
border: none;
|
|
221
228
|
background: ${input.flat.bgColor};
|
|
222
|
-
color: ${input.flat.color};
|
|
223
229
|
}
|
|
224
230
|
}
|
|
225
231
|
|
|
@@ -227,10 +233,11 @@ export function makeStyles() {
|
|
|
227
233
|
&.k-disabled {
|
|
228
234
|
color: ${input.disabledColor};
|
|
229
235
|
cursor: not-allowed;
|
|
230
|
-
.k-input-
|
|
231
|
-
color: ${input.disabledColor};
|
|
236
|
+
.k-input-wrapper {
|
|
232
237
|
border-color: ${input.disabledBorderColor};
|
|
233
238
|
background: ${input.disabledBgColor};
|
|
239
|
+
}
|
|
240
|
+
.k-input-inner {
|
|
234
241
|
cursor: not-allowed;
|
|
235
242
|
}
|
|
236
243
|
}
|
|
@@ -240,34 +247,10 @@ export function makeStyles() {
|
|
|
240
247
|
const styles = input[size];
|
|
241
248
|
const sizeClassName = css`
|
|
242
249
|
font-size: ${styles.fontSize};
|
|
243
|
-
.k-input-
|
|
250
|
+
.k-input-wrapper {
|
|
244
251
|
height: ${styles.height};
|
|
245
|
-
line-height: ${styles.height};
|
|
246
|
-
font-size: ${styles.fontSize};
|
|
247
252
|
padding: 0 ${styles.paddingGap};
|
|
248
253
|
}
|
|
249
|
-
.k-input-prefix {
|
|
250
|
-
left: ${styles.paddingGap};
|
|
251
|
-
}
|
|
252
|
-
.k-input-suffix {
|
|
253
|
-
right: ${styles.paddingGap};
|
|
254
|
-
}
|
|
255
|
-
&.k-with-prefix {
|
|
256
|
-
.k-input-inner {
|
|
257
|
-
padding-left: calc(${styles.paddingGap} + 1rem + ${input.clearIconGap});
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
&.k-with-suffix,
|
|
261
|
-
&.k-clearable {
|
|
262
|
-
.k-input-inner {
|
|
263
|
-
padding-right: calc(${styles.paddingGap} + 1rem + ${input.clearIconGap});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
&:not(.k-stack-clear).k-with-suffix.k-clearable {
|
|
267
|
-
.k-input-inner {
|
|
268
|
-
padding-right: calc(${styles.paddingGap} + 2rem + ${input.clearIconGap} * 2);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
254
|
`;
|
|
272
255
|
|
|
273
256
|
if (size === 'default') return sizeClassName;
|
|
@@ -280,9 +263,8 @@ export function makeStyles() {
|
|
|
280
263
|
|
|
281
264
|
// inline
|
|
282
265
|
&.k-inline {
|
|
283
|
-
.k-input-
|
|
266
|
+
.k-input-wrapper {
|
|
284
267
|
height: auto;
|
|
285
|
-
line-height: inherit;
|
|
286
268
|
border: none;
|
|
287
269
|
border-radius: 0;
|
|
288
270
|
padding: 0;
|
|
@@ -290,11 +272,22 @@ export function makeStyles() {
|
|
|
290
272
|
}
|
|
291
273
|
|
|
292
274
|
// textarea
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
275
|
+
&.k-type-textarea {
|
|
276
|
+
.k-input-wrapper {
|
|
277
|
+
display: inline-block;
|
|
278
|
+
padding: 0;
|
|
279
|
+
height: auto;
|
|
280
|
+
}
|
|
281
|
+
.k-textarea {
|
|
282
|
+
width: 100%;
|
|
283
|
+
padding: ${input.textareaPadding};
|
|
284
|
+
line-height: 1.5;
|
|
285
|
+
vertical-align: top;
|
|
286
|
+
}
|
|
287
|
+
.k-input-suffix {
|
|
288
|
+
margin: 0;
|
|
289
|
+
justify-content: flex-end;
|
|
290
|
+
}
|
|
298
291
|
}
|
|
299
292
|
${(Input.typeDefs.resize as string[]).map(type => {
|
|
300
293
|
return css`
|
|
@@ -308,18 +301,23 @@ export function makeStyles() {
|
|
|
308
301
|
|
|
309
302
|
// fake dom for get value's width
|
|
310
303
|
.k-input-fake {
|
|
304
|
+
left: 0;
|
|
305
|
+
top: 0;
|
|
306
|
+
right: 0;
|
|
311
307
|
position: absolute;
|
|
308
|
+
overflow: hidden;
|
|
309
|
+
width: 100%;
|
|
312
310
|
visibility: hidden;
|
|
313
|
-
top: 0;
|
|
314
311
|
white-space: nowrap;
|
|
315
312
|
}
|
|
316
313
|
&.k-auto-width {
|
|
317
314
|
width: auto;
|
|
318
315
|
max-width: 100%;
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// count
|
|
319
|
+
.k-input-count {
|
|
320
|
+
color: ${input.count.color};
|
|
323
321
|
}
|
|
324
322
|
`
|
|
325
323
|
}
|
|
@@ -337,6 +335,9 @@ export function makeSearchStyles() {
|
|
|
337
335
|
right: 0;
|
|
338
336
|
z-index: 1;
|
|
339
337
|
}
|
|
338
|
+
&.k-default .k-btn:hover {
|
|
339
|
+
background: transparent;
|
|
340
|
+
}
|
|
340
341
|
.k-input-suffix {
|
|
341
342
|
margin-right: ${input.search.suffixMarginRight};
|
|
342
343
|
}
|
|
@@ -361,13 +362,16 @@ export function makeSearchStyles() {
|
|
|
361
362
|
|
|
362
363
|
// line
|
|
363
364
|
&.k-line {
|
|
364
|
-
.k-input-
|
|
365
|
+
.k-input-wrapper {
|
|
365
366
|
border-width: 0;
|
|
366
367
|
}
|
|
367
368
|
&.k-open {
|
|
368
|
-
.k-input-
|
|
369
|
+
.k-input-wrapper {
|
|
369
370
|
border-bottom-width: 1px;
|
|
370
371
|
}
|
|
372
|
+
.k-btn:hover {
|
|
373
|
+
background: transparent;
|
|
374
|
+
}
|
|
371
375
|
}
|
|
372
376
|
}
|
|
373
377
|
`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {useInstance, createRef, onMounted, nextTick} from 'intact';
|
|
2
|
+
import type {Input} from './';
|
|
3
|
+
import {useState} from '../../hooks/useState';
|
|
4
|
+
|
|
5
|
+
export function useFocus() {
|
|
6
|
+
const instance = useInstance() as Input;
|
|
7
|
+
const isFocus = useState(false);
|
|
8
|
+
|
|
9
|
+
instance.on('focus', () => isFocus.set(true));
|
|
10
|
+
instance.on('blur', () => isFocus.set(false));
|
|
11
|
+
|
|
12
|
+
function focusInputOnClick(e: MouseEvent) {
|
|
13
|
+
instance.focus();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return { isFocus, focusInputOnClick };
|
|
17
|
+
}
|
package/components/menu/item.vdt
CHANGED
|
@@ -35,7 +35,7 @@ const title = (children) => (
|
|
|
35
35
|
>
|
|
36
36
|
<Icon class="k-menu-dot ion-record" v-if={showDot} />
|
|
37
37
|
<div class="k-menu-name">{children}</div>
|
|
38
|
-
<
|
|
38
|
+
<Icon class="k-menu-arrow k-icon-down" v-if={subMenuVNode} />
|
|
39
39
|
</div>
|
|
40
40
|
);
|
|
41
41
|
|
|
@@ -121,13 +121,13 @@ let nextPage = value + 1;
|
|
|
121
121
|
type="none"
|
|
122
122
|
disabled={value <= 1 || !!(disablePage && disablePage(value - 1, limit))}
|
|
123
123
|
ev-click={this.prev}
|
|
124
|
-
><Icon class="k-icon-
|
|
124
|
+
><Icon class="k-icon-left" /></Button>
|
|
125
125
|
<template>{paginationItems}</template>
|
|
126
126
|
<Button icon size={size}
|
|
127
127
|
type="none"
|
|
128
128
|
disabled={value >= totalPages || !!(disablePage && disablePage(value + 1, limit))}
|
|
129
129
|
ev-click={this.next}
|
|
130
|
-
><Icon class="k-icon-
|
|
130
|
+
><Icon class="k-icon-right" /></Button>
|
|
131
131
|
</ButtonGroup>
|
|
132
132
|
|
|
133
133
|
<template v-if={!simple}>
|
|
@@ -38,6 +38,21 @@ const label = this.getLabel();
|
|
|
38
38
|
const hasValue = this.hasValue();
|
|
39
39
|
const {onInput, inputRef, keywords: {value: keywords}} = this.input;
|
|
40
40
|
const {onFocusout, triggerRef} = this.focusout;
|
|
41
|
+
const filterInput = <Input v-if={filterable}
|
|
42
|
+
class="k-select-input"
|
|
43
|
+
value={keywords}
|
|
44
|
+
ev-$change:value={onInput}
|
|
45
|
+
disabled={disabled}
|
|
46
|
+
placeholder={!hasValue ? placeholder : ''}
|
|
47
|
+
ref={inputRef}
|
|
48
|
+
autoWidth
|
|
49
|
+
inline
|
|
50
|
+
size={size}
|
|
51
|
+
key="filter"
|
|
52
|
+
readonly={!show}
|
|
53
|
+
waveDisabled={true}
|
|
54
|
+
flat={flat}
|
|
55
|
+
/>
|
|
41
56
|
|
|
42
57
|
<ErrorContext.Consumer defaultValue={false}>
|
|
43
58
|
{isInvalid => {
|
|
@@ -90,7 +105,7 @@ const {onFocusout, triggerRef} = this.focusout;
|
|
|
90
105
|
</div>
|
|
91
106
|
<div v-else key="values" class="k-select-values">
|
|
92
107
|
<b:values params={[value, label]}>
|
|
93
|
-
<Tags v-if={label && label.length}
|
|
108
|
+
<Tags v-if={label && label.length || filterable}
|
|
94
109
|
nowrap={nowrap}
|
|
95
110
|
size={size}
|
|
96
111
|
draggable={draggable}
|
|
@@ -117,23 +132,10 @@ const {onFocusout, triggerRef} = this.focusout;
|
|
|
117
132
|
</b:value>
|
|
118
133
|
</template>
|
|
119
134
|
</Tag>
|
|
135
|
+
<b:append>{filterInput}</b:append>
|
|
120
136
|
</Tags>
|
|
121
137
|
</b:values>
|
|
122
|
-
<
|
|
123
|
-
class="k-select-input"
|
|
124
|
-
value={keywords}
|
|
125
|
-
ev-$change:value={onInput}
|
|
126
|
-
disabled={disabled}
|
|
127
|
-
placeholder={!hasValue ? placeholder : ''}
|
|
128
|
-
ref={inputRef}
|
|
129
|
-
autoWidth
|
|
130
|
-
inline
|
|
131
|
-
size={size}
|
|
132
|
-
key="filter"
|
|
133
|
-
readonly={!show}
|
|
134
|
-
waveDisabled={true}
|
|
135
|
-
flat={flat}
|
|
136
|
-
/>
|
|
138
|
+
<template v-if={$blocks && $blocks.values}>{filterInput}</template>
|
|
137
139
|
</div>
|
|
138
140
|
</TransitionGroup>
|
|
139
141
|
</div>
|
|
@@ -147,7 +149,7 @@ const {onFocusout, triggerRef} = this.focusout;
|
|
|
147
149
|
<b:suffix>
|
|
148
150
|
<Icon class="ion-load-c" rotate v-if={loading} />
|
|
149
151
|
<Icon v-else-if={!hideIcon}
|
|
150
|
-
class="k-select-arrow
|
|
152
|
+
class="k-select-arrow k-icon-down"
|
|
151
153
|
disabled={$props.isDisableArrow}
|
|
152
154
|
/>
|
|
153
155
|
</b:suffix>
|
|
@@ -14,7 +14,7 @@ import {Select, Table, TableColumn, Input, Button, Icon} from 'kpc';
|
|
|
14
14
|
>
|
|
15
15
|
<b:menu>
|
|
16
16
|
<Input placeholder="请输入关键字" size="small" fluid v-model="keywords" waveDisabled={true}>
|
|
17
|
-
<b:suffix><Icon class="
|
|
17
|
+
<b:suffix><Icon class="k-icon-search" /></b:suffix>
|
|
18
18
|
</Input>
|
|
19
19
|
<Table data={this.filter()}
|
|
20
20
|
type="border"
|
|
@@ -27,8 +27,8 @@ import {Select, Table, TableColumn, Input, Button, Icon} from 'kpc';
|
|
|
27
27
|
<TableColumn title="Domain" key="domain" />
|
|
28
28
|
</Table>
|
|
29
29
|
<div class="footer">
|
|
30
|
-
<Button type="primary" size="small" ev-click={this.confirm}>确定</Button>
|
|
31
30
|
<Button size="small" ev-click={this.hide}>取消</Button>
|
|
31
|
+
<Button type="primary" size="small" ev-click={this.confirm}>确定</Button>
|
|
32
32
|
</div>
|
|
33
33
|
</b:menu>
|
|
34
34
|
</Select>
|
|
@@ -256,11 +256,12 @@ describe('Select', () => {
|
|
|
256
256
|
await wait();
|
|
257
257
|
const dropdown = getElement('.k-select-menu')!;
|
|
258
258
|
const [selectAll, toggleSelect, unselectAll] = dropdown.querySelectorAll<HTMLElement>('.k-select-op .k-btn');
|
|
259
|
-
const [
|
|
259
|
+
const [cancel, confirm] = dropdown.querySelectorAll<HTMLElement>('.k-select-footer .k-btn');
|
|
260
260
|
|
|
261
261
|
// select all
|
|
262
262
|
selectAll.click();
|
|
263
263
|
confirm.click();
|
|
264
|
+
await wait();
|
|
264
265
|
expect(instance.get('days')).have.length(7);
|
|
265
266
|
|
|
266
267
|
// unselect all
|
|
@@ -268,6 +269,7 @@ describe('Select', () => {
|
|
|
268
269
|
await wait();
|
|
269
270
|
unselectAll.click();
|
|
270
271
|
confirm.click();
|
|
272
|
+
await wait();
|
|
271
273
|
expect(instance.get('days')).have.length(0);
|
|
272
274
|
|
|
273
275
|
// toggle select
|
|
@@ -281,6 +283,7 @@ describe('Select', () => {
|
|
|
281
283
|
await wait();
|
|
282
284
|
toggleSelect.click();
|
|
283
285
|
confirm.click();
|
|
286
|
+
await wait();
|
|
284
287
|
expect(instance.get('days')).have.length(5);
|
|
285
288
|
expect(instance.get('days')).include('Monday')
|
|
286
289
|
});
|
|
@@ -61,7 +61,7 @@ if (searchable) {
|
|
|
61
61
|
clearable
|
|
62
62
|
waveDisabled={true}
|
|
63
63
|
>
|
|
64
|
-
<b:suffix><Icon class="
|
|
64
|
+
<b:suffix><Icon class="k-icon-search" /></b:suffix>
|
|
65
65
|
</Input>
|
|
66
66
|
<div class="k-select-op" v-if={multiple}>
|
|
67
67
|
<Button type="link" size="small"
|
|
@@ -79,8 +79,8 @@ if (searchable) {
|
|
|
79
79
|
{children}
|
|
80
80
|
</div>
|
|
81
81
|
<div class="k-select-footer" v-if={multiple}>
|
|
82
|
-
<Button type="primary" size="small" ev-click={confirm}>{_$('确定')}</Button>
|
|
83
82
|
<Button size="small" ev-click={this.select.hide}>{_$('取消')}</Button>
|
|
83
|
+
<Button type="primary" size="small" ev-click={confirm}>{_$('确定')}</Button>
|
|
84
84
|
</div>
|
|
85
85
|
</Provider>
|
|
86
86
|
);
|
|
@@ -133,6 +133,8 @@ export default function makeStyles() {
|
|
|
133
133
|
}
|
|
134
134
|
.k-select-prefix,
|
|
135
135
|
.k-select-suffix {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
136
138
|
position: relative;
|
|
137
139
|
}
|
|
138
140
|
.k-select-suffix {
|
|
@@ -176,7 +178,8 @@ export default function makeStyles() {
|
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
.k-select-suffix-icon {
|
|
179
|
-
display: inline-
|
|
181
|
+
display: inline-flex;
|
|
182
|
+
align-items: center;
|
|
180
183
|
transition: opacity ${select.transition};
|
|
181
184
|
}
|
|
182
185
|
|
|
@@ -204,6 +207,7 @@ export default function makeStyles() {
|
|
|
204
207
|
.k-tag {
|
|
205
208
|
word-break: break-word;
|
|
206
209
|
height: auto;
|
|
210
|
+
max-width: calc(100% - ${getRight(select.tag.margin)} - 1px);
|
|
207
211
|
}
|
|
208
212
|
|
|
209
213
|
// size
|
|
@@ -24,8 +24,8 @@ const {showValue, onInput} = this.value;
|
|
|
24
24
|
type="none"
|
|
25
25
|
tabindex="-1"
|
|
26
26
|
>
|
|
27
|
-
<Icon v-if={!vertical} class="k-spinner-icon k-icon-minus
|
|
28
|
-
<Icon v-else class="k-spinner-icon k-icon-
|
|
27
|
+
<Icon v-if={!vertical} class="k-spinner-icon k-icon-minus" />
|
|
28
|
+
<Icon v-else class="k-spinner-icon k-icon-down" />
|
|
29
29
|
</Button>
|
|
30
30
|
<Input
|
|
31
31
|
class="k-spinner-input"
|
|
@@ -44,7 +44,7 @@ const {showValue, onInput} = this.value;
|
|
|
44
44
|
type="none"
|
|
45
45
|
tabindex="-1"
|
|
46
46
|
>
|
|
47
|
-
<Icon v-if={!vertical} class="k-spinner-icon k-icon-add
|
|
48
|
-
<Icon v-else class="k-spinner-icon k-icon-
|
|
47
|
+
<Icon v-if={!vertical} class="k-spinner-icon k-icon-add" />
|
|
48
|
+
<Icon v-else class="k-spinner-icon k-icon-up" />
|
|
49
49
|
</Button>
|
|
50
50
|
</div>
|
|
@@ -71,15 +71,19 @@ export function makeStyles() {
|
|
|
71
71
|
}
|
|
72
72
|
.k-spinner-input {
|
|
73
73
|
width: ${spinner.default.inputWidth};
|
|
74
|
-
.k-input-
|
|
75
|
-
text-align: center;
|
|
74
|
+
.k-input-wrapper {
|
|
76
75
|
border:none;
|
|
77
76
|
border-radius: 0;
|
|
78
|
-
&:hover
|
|
79
|
-
&:focus {
|
|
77
|
+
&:hover{
|
|
80
78
|
border: none
|
|
81
79
|
}
|
|
82
80
|
}
|
|
81
|
+
&.k-focus .k-input-wrapper {
|
|
82
|
+
border: none;
|
|
83
|
+
}
|
|
84
|
+
.k-input-inner {
|
|
85
|
+
text-align: center;
|
|
86
|
+
}
|
|
83
87
|
}
|
|
84
88
|
.k-spinner-icon {
|
|
85
89
|
font-size: ${spinner.default.iconFontSize};
|
|
@@ -106,8 +110,7 @@ export function makeStyles() {
|
|
|
106
110
|
border-radius: 0 ${spinner.borderRadius} 0 0;
|
|
107
111
|
}
|
|
108
112
|
.k-spinner-input {
|
|
109
|
-
|
|
110
|
-
.k-input-inner {
|
|
113
|
+
.k-input-wrapper {
|
|
111
114
|
border-radius: ${spinner.borderRadius} 0 0 ${spinner.borderRadius};
|
|
112
115
|
}
|
|
113
116
|
}
|
|
@@ -26,9 +26,9 @@ const {children, title, index, className, style} = this.get();
|
|
|
26
26
|
ev-click={linkEvent(index, onChange)}
|
|
27
27
|
>
|
|
28
28
|
<div class="k-step-mark">
|
|
29
|
-
<Icon v-if={error && type !== 'simple'} class="k-icon-close-
|
|
29
|
+
<Icon v-if={error && type !== 'simple'} class="k-icon-close-bold" color="danger" />
|
|
30
30
|
<Icon v-else-if={done && (type === 'line' || type === 'line-compact')}
|
|
31
|
-
class="k-icon-check"
|
|
31
|
+
class="k-icon-check-bold"
|
|
32
32
|
color="primary"
|
|
33
33
|
/>
|
|
34
34
|
<span v-else-if={type !== 'simple'}>{index + 1}</span>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {css, cx} from '@emotion/css';
|
|
2
2
|
import {theme, setDefault} from '../../styles/theme';
|
|
3
|
-
import {deepDefaults} from '../../styles/utils';
|
|
3
|
+
import {deepDefaults, palette} from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
5
|
|
|
6
6
|
const defaults = {
|
|
@@ -22,6 +22,7 @@ const defaults = {
|
|
|
22
22
|
done: {
|
|
23
23
|
get markColor() { return theme.color.primary },
|
|
24
24
|
get markBorderColor() { return theme.color.primary },
|
|
25
|
+
get markHoverBgColor() { return palette(theme.color.primary, -4) },
|
|
25
26
|
markBgColor: '#fff',
|
|
26
27
|
get mainColor() { return theme.color.primary },
|
|
27
28
|
},
|
|
@@ -109,6 +110,9 @@ export function makeStepsStyles() {
|
|
|
109
110
|
&.k-clickable {
|
|
110
111
|
.k-done {
|
|
111
112
|
cursor: pointer;
|
|
113
|
+
.k-step-wrapper:hover .k-step-mark {
|
|
114
|
+
background: ${steps.done.markHoverBgColor};
|
|
115
|
+
}
|
|
112
116
|
}
|
|
113
117
|
}
|
|
114
118
|
|