kui-vue 3.4.6 → 3.4.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/_tool/clone.js +1 -0
- package/components/avatar/demo/base.md +13 -15
- package/components/avatar/demo/change.md +2 -2
- package/components/avatar/demo/index.vue +1 -8
- package/components/avatar/demo/types.md +2 -2
- package/components/badge/badge.jsx +1 -0
- package/components/badge/demo/base.md +5 -5
- package/components/badge/demo/dot.md +1 -12
- package/components/badge/demo/dynamic.md +0 -11
- package/components/badge/demo/index.vue +14 -2
- package/components/badge/demo/mark.md +3 -3
- package/components/badge/demo/max.md +0 -12
- package/components/badge/demo/status.md +0 -5
- package/components/badge/styles/index.less +29 -2
- package/components/base/input.jsx +53 -27
- package/components/button/styles/index.less +4 -1
- package/components/checkbox/checkbox.jsx +1 -1
- package/components/checkbox/styles/index.less +13 -1
- package/components/colorPicker/colorpicker.jsx +59 -35
- package/components/colorPicker/demo/shape.md +1 -0
- package/components/colorPicker/index.md +1 -0
- package/components/colorPicker/styles/index.less +68 -56
- package/components/datePicker/datepicker.jsx +2 -1
- package/components/datePicker/demo/base.md +0 -3
- package/components/drawer/drawer.jsx +1 -1
- package/components/form/demo/base.md +19 -2
- package/components/form/demo/length.md +1 -1
- package/components/form/demo/valid.md +21 -6
- package/components/form/form.jsx +4 -2
- package/components/form/formitem.jsx +3 -1
- package/components/form/styles/index.less +4 -2
- package/components/index.js +2 -0
- package/components/input/demo/base.md +2 -2
- package/components/input/demo/event.md +2 -2
- package/components/input/demo/group.md +20 -3
- package/components/input/demo/icon.md +8 -2
- package/components/input/demo/index.vue +1 -15
- package/components/input/demo/size.md +2 -2
- package/components/input/demo/suffix.md +63 -29
- package/components/input/demo/textarea.md +2 -2
- package/components/input/demo/theme.md +2 -4
- package/components/input/index.md +20 -10
- package/components/input/input.jsx +3 -0
- package/components/input/inputGroup.jsx +7 -4
- package/components/input/styles/index.less +104 -2
- package/components/input/textarea.jsx +1 -0
- package/components/inputNumber/demo/base.md +6 -12
- package/components/inputNumber/demo/ffix.md +3 -9
- package/components/inputNumber/inputNumber.jsx +9 -5
- package/components/inputNumber/styles/index.less +34 -20
- package/components/menu/styles/index.less +1 -1
- package/components/message/demo/index.vue +1 -10
- package/components/message/demo/types.md +3 -3
- package/components/modal/demo/base.md +2 -2
- package/components/modal/demo/confrim.md +2 -2
- package/components/modal/demo/custom.md +2 -2
- package/components/modal/demo/global.md +2 -2
- package/components/modal/demo/index.vue +1 -10
- package/components/modal/demo/more.md +2 -2
- package/components/notice/demo/close.md +2 -2
- package/components/notice/demo/icon.md +2 -2
- package/components/notice/demo/index.vue +1 -10
- package/components/notice/demo/types.md +4 -4
- package/components/popconfirm/demo/index.vue +1 -10
- package/components/popconfirm/demo/local.md +17 -15
- package/components/popconfirm/demo/placement.md +50 -46
- package/components/poptip/demo/base.md +16 -14
- package/components/poptip/demo/index.vue +1 -10
- package/components/poptip/demo/placement.md +99 -94
- package/components/poptip/demo/trigger.md +16 -14
- package/components/rate/demo/base.md +2 -5
- package/components/rate/demo/character.md +2 -4
- package/components/rate/demo/clear.md +2 -3
- package/components/rate/demo/custom.md +3 -5
- package/components/rate/demo/disabled.md +4 -8
- package/components/rate/demo/tips.md +2 -2
- package/components/select/styles/index.less +5 -1
- package/components/space/demo/compact.md +23 -6
- package/components/space/space.jsx +21 -24
- package/components/space/styles/index.less +5 -0
- package/components/styles/index.less +1 -0
- package/components/tooltip/demo/index.vue +1 -14
- package/components/tooltip/demo/placement.md +50 -46
- package/components/tree/demo/checkable.md +5 -1
- package/components/tree/demo/directory.md +27 -31
- package/components/tree/index.md +22 -15
- package/components/tree/node.jsx +43 -23
- package/components/tree/styles/index.less +257 -215
- package/components/tree/tree.jsx +39 -6
- package/components/treeselect/demo/base.md +59 -0
- package/components/treeselect/demo/checkable.md +59 -0
- package/components/treeselect/demo/index.vue +30 -0
- package/components/treeselect/demo/info.md +7 -0
- package/components/treeselect/demo/multiple.md +59 -0
- package/components/treeselect/demo/sync.md +38 -0
- package/components/treeselect/index.md +38 -0
- package/components/treeselect/styles/index.less +579 -27
- package/components/treeselect/treeselect.jsx +508 -0
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.js +2 -2
- package/package.json +2 -1
- package/components/treeselect/treeselect.vue +0 -200
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { canvasHelper, limit, hslToRgb, rgbToHsl, parseColor, rgbToHex, cssColorToRgba } from './canvasHelper'
|
|
2
2
|
import { Input } from '../input'
|
|
3
|
+
// import InputNumber from '../inputNumber'
|
|
3
4
|
import { Button } from '../button'
|
|
4
5
|
import Icon from '../icon'
|
|
5
6
|
import Drop from '../base/drop'
|
|
@@ -13,6 +14,7 @@ export default {
|
|
|
13
14
|
transfer: { type: Boolean, default: true },
|
|
14
15
|
showMode: Boolean,
|
|
15
16
|
disabled: Boolean,
|
|
17
|
+
noAlpha: Boolean,
|
|
16
18
|
size: {
|
|
17
19
|
default: 'default',
|
|
18
20
|
validator(value) {
|
|
@@ -74,12 +76,12 @@ export default {
|
|
|
74
76
|
updatePostion() {
|
|
75
77
|
//alpha
|
|
76
78
|
{
|
|
77
|
-
const x =
|
|
79
|
+
const x = 190 * this.A;
|
|
78
80
|
this.alphaPointer.x = (x - 7);
|
|
79
81
|
}
|
|
80
82
|
//updaet hue pointer
|
|
81
83
|
{
|
|
82
|
-
const x =
|
|
84
|
+
const x = 190 * this.H / 360;
|
|
83
85
|
this.huePointer.x = (x - 7);
|
|
84
86
|
}
|
|
85
87
|
//paint
|
|
@@ -87,8 +89,8 @@ export default {
|
|
|
87
89
|
const [r, g, b] = hslToRgb(this.H, this.S, this.L);
|
|
88
90
|
const [x, y] = this.paintHelper.findColor(r, g, b);
|
|
89
91
|
if (x >= 0) {
|
|
90
|
-
this.paintPointer.x = (x - 7);
|
|
91
|
-
this.paintPointer.y = (y - 7);
|
|
92
|
+
this.paintPointer.x = (x - 7 + 10);
|
|
93
|
+
this.paintPointer.y = (y - 7 + 10);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
|
|
@@ -106,6 +108,7 @@ export default {
|
|
|
106
108
|
break;
|
|
107
109
|
case 'HUE':
|
|
108
110
|
this.H = value;
|
|
111
|
+
// console.log(this.H);
|
|
109
112
|
[this.R, this.G, this.B] = hslToRgb(this.H, this.S, this.L);
|
|
110
113
|
if (this.paintHelper) {
|
|
111
114
|
this.paintHelper.setHue(value);
|
|
@@ -133,14 +136,19 @@ export default {
|
|
|
133
136
|
} else {
|
|
134
137
|
this.HEX = rgbToHex(this.R, this.G, this.B);
|
|
135
138
|
}
|
|
136
|
-
|
|
139
|
+
|
|
140
|
+
// this.currentColor = this.HEX
|
|
141
|
+
// this.$emit('input', this.currentColor)
|
|
142
|
+
// this.$emit('change', this.currentColor)
|
|
143
|
+
|
|
144
|
+
this.updateValue()
|
|
137
145
|
},
|
|
138
146
|
updateValue() {
|
|
139
147
|
let { currentMode, R, G, B, A, H, S, L, } = this, value = null;
|
|
140
148
|
if (currentMode == 'hex') {
|
|
141
149
|
value = this.HEX
|
|
142
150
|
} else if (currentMode == 'rgba') {
|
|
143
|
-
value = `rgba(${R},${G},${B},${A})`
|
|
151
|
+
value = A < 1 ? `rgba(${R},${G},${B},${A})` : `rgba(${R},${G},${B})`
|
|
144
152
|
} else {
|
|
145
153
|
value = A < 1 ? `hsla(${H},${S}%,${L}%,${A})` : `hsl(${H},${S}%,${L}%)`
|
|
146
154
|
}
|
|
@@ -148,12 +156,13 @@ export default {
|
|
|
148
156
|
this.currentColor = value
|
|
149
157
|
this.$emit('input', value)
|
|
150
158
|
this.$emit('change', value)
|
|
151
|
-
this.opened = false
|
|
159
|
+
// this.opened = false
|
|
152
160
|
},
|
|
153
161
|
setMode() {
|
|
154
162
|
let i = modes.indexOf(this.currentMode) + 1
|
|
155
163
|
i = i > 2 ? 0 : i
|
|
156
164
|
this.currentMode = modes[i]
|
|
165
|
+
this.updateValue()
|
|
157
166
|
},
|
|
158
167
|
initHueCanvas(canvas) {
|
|
159
168
|
const ctx = canvas.getContext('2d', { willReadFrequently: true }),
|
|
@@ -192,6 +201,7 @@ export default {
|
|
|
192
201
|
})
|
|
193
202
|
},
|
|
194
203
|
alphaCanvsSetHue(canvas) {
|
|
204
|
+
if (this.noAlpha || !canvas) return;
|
|
195
205
|
const ctx = canvas.getContext('2d', { willReadFrequently: true }),
|
|
196
206
|
{ width, height } = canvas,
|
|
197
207
|
gradient = ctx.createLinearGradient(0, 0, width - 1, 0);
|
|
@@ -239,8 +249,8 @@ export default {
|
|
|
239
249
|
y = limit(e.clientY - canvas.getBoundingClientRect().top, 0, height - 1),
|
|
240
250
|
color = this.paintHelper.grabColor(x, y)
|
|
241
251
|
|
|
242
|
-
this.paintPointer.x = x - 7
|
|
243
|
-
this.paintPointer.y = y - 7
|
|
252
|
+
this.paintPointer.x = x - 7 + 10
|
|
253
|
+
this.paintPointer.y = y - 7 + 10
|
|
244
254
|
this.valueChange('RGB', color)
|
|
245
255
|
|
|
246
256
|
}
|
|
@@ -265,7 +275,7 @@ export default {
|
|
|
265
275
|
renderPaint() {
|
|
266
276
|
let prop = {
|
|
267
277
|
class: 'k-color-picker-paint',
|
|
268
|
-
attrs: { width:
|
|
278
|
+
attrs: { width: 234, height: 136 },
|
|
269
279
|
ref: 'paint'
|
|
270
280
|
}
|
|
271
281
|
return <canvas {...prop} />
|
|
@@ -273,15 +283,15 @@ export default {
|
|
|
273
283
|
renderAlpha() {
|
|
274
284
|
let prop = {
|
|
275
285
|
class: 'k-color-picker-alpha',
|
|
276
|
-
attrs: { width:
|
|
286
|
+
attrs: { width: 190, height: 8 },
|
|
277
287
|
ref: 'alpha'
|
|
278
288
|
}
|
|
279
|
-
return <canvas {...prop} />
|
|
289
|
+
return !this.noAlpha ? <canvas {...prop} /> : null
|
|
280
290
|
},
|
|
281
291
|
renderHue() {
|
|
282
292
|
let prop = {
|
|
283
293
|
class: 'k-color-picker-hue',
|
|
284
|
-
attrs: { width:
|
|
294
|
+
attrs: { width: 190, height: 8 },
|
|
285
295
|
ref: 'hue'
|
|
286
296
|
}
|
|
287
297
|
return <canvas {...prop} />
|
|
@@ -329,21 +339,26 @@ export default {
|
|
|
329
339
|
renderValue() {
|
|
330
340
|
if (this.showMode) {
|
|
331
341
|
let { currentMode, renderValueInput } = this, node = []
|
|
342
|
+
let mode = "RGB"
|
|
343
|
+
let alpha = <Input v-model={this.A} size="small" class="k-color-picker-alpha-input" />
|
|
332
344
|
if (currentMode == 'rgba') {
|
|
333
|
-
let keys = ['R', 'G', 'B'
|
|
334
|
-
let v = <div class="k-color-picker-val">{keys.map(k => renderValueInput(k))}</div>
|
|
335
|
-
let k = <div class="k-color-picker-key">{keys.map(k => <span>{k}</span>)}</div>
|
|
336
|
-
node.push(v
|
|
345
|
+
let keys = ['R', 'G', 'B']
|
|
346
|
+
let v = <div class="k-color-picker-val">{keys.map(k => renderValueInput(k))}{alpha}</div>
|
|
347
|
+
// let k = <div class="k-color-picker-key">{keys.map(k => <span>{k}</span>)}</div>
|
|
348
|
+
node.push(v)
|
|
337
349
|
} else if (currentMode == 'hsla') {
|
|
338
|
-
|
|
339
|
-
let
|
|
340
|
-
let
|
|
341
|
-
|
|
350
|
+
mode = 'HSB'
|
|
351
|
+
let keys = ['H', 'S', 'L']
|
|
352
|
+
let v = <div class="k-color-picker-val">{keys.map(k => renderValueInput(k))}{alpha}</div>
|
|
353
|
+
// let k = <div class="k-color-picker-key">{keys.map(k => <span>{k}</span>)}</div>
|
|
354
|
+
node.push(v)
|
|
342
355
|
} else { //hex
|
|
343
|
-
|
|
344
|
-
let
|
|
345
|
-
|
|
356
|
+
mode = 'HEX'
|
|
357
|
+
let v = <div class="k-color-picker-val">{renderValueInput('HEX')}{alpha}</div>
|
|
358
|
+
// let k = <div class="k-color-picker-key"><span>HEX</span></div>
|
|
359
|
+
node.push(v)
|
|
346
360
|
}
|
|
361
|
+
node.unshift(<span class="k-color-picker-mode-label">{mode}:</span>)
|
|
347
362
|
let btn = <Button size="small" theme="normal" icon={CaretHor} onClick={this.setMode} />
|
|
348
363
|
node.push(btn)
|
|
349
364
|
return <div class={`k-color-picker-mode k-color-picker-${currentMode}`}>{node}</div>
|
|
@@ -351,8 +366,8 @@ export default {
|
|
|
351
366
|
},
|
|
352
367
|
renderDefaultColor() {
|
|
353
368
|
let color = this.defalutColors.map(c => <span style={"background-color:" + c} onClick={e => this.valueChange('COLOR', c)}></span>)
|
|
354
|
-
let okBtn = <Button circle onClick={this.updateValue}>OK</Button>
|
|
355
|
-
return <div class="k-coclor-picker-defaults">{[color
|
|
369
|
+
// let okBtn = <Button circle onClick={this.updateValue}>OK</Button>
|
|
370
|
+
return <div class="k-coclor-picker-defaults">{[color]}</div>
|
|
356
371
|
},
|
|
357
372
|
renderDrop() {
|
|
358
373
|
let paint = this.renderPaint()
|
|
@@ -378,20 +393,21 @@ export default {
|
|
|
378
393
|
},
|
|
379
394
|
hide: () => {
|
|
380
395
|
this.opened = false
|
|
381
|
-
this.currentColor = this.value || '#000'
|
|
396
|
+
// this.currentColor = this.value || '#000'
|
|
382
397
|
},
|
|
383
398
|
render: () => {
|
|
384
399
|
this.$nextTick(() => {
|
|
385
400
|
let { paint, hue, alpha } = this.$refs
|
|
386
|
-
this.paintHelper = canvasHelper(paint)
|
|
387
|
-
this.initHueCanvas(hue)
|
|
388
|
-
this.initAlphaCanvas(alpha)
|
|
401
|
+
this.paintHelper = canvasHelper(paint);
|
|
402
|
+
this.initHueCanvas(hue);
|
|
403
|
+
(!this.noAlpha && this.initAlphaCanvas(alpha));
|
|
389
404
|
this.initPaintCanvas(paint)
|
|
390
405
|
this.valueChange('COLOR', this.value)
|
|
391
406
|
})
|
|
392
407
|
},
|
|
393
408
|
}
|
|
394
409
|
}
|
|
410
|
+
let [r, g, b] = hslToRgb(this.H, this.S, this.L);
|
|
395
411
|
return (<Drop {...props}>
|
|
396
412
|
{paint}
|
|
397
413
|
< span class="k-color-picker-paint-dot" style={'left:' + this.paintPointer.x + 'px;top:' + this.paintPointer.y + 'px'} ></span >
|
|
@@ -401,20 +417,20 @@ export default {
|
|
|
401
417
|
</div>
|
|
402
418
|
<div class="k-color-picker-bar-box">
|
|
403
419
|
{[hue, alpha]}
|
|
404
|
-
<span class="k-color-picker-hue-dot" style={'left:
|
|
405
|
-
<span class="k-color-picker-alpha-dot" style={'left:
|
|
420
|
+
<span class="k-color-picker-hue-dot" style={{ 'left': this.huePointer.x + 'px', backgroundColor: `rgba(${r},${g},${b},1` }}></span>
|
|
421
|
+
{!this.noAlpha ? <span class="k-color-picker-alpha-dot" style={{ 'left': this.alphaPointer.x + 'px', backgroundColor: `rgba(${r},${g},${b},${this.A}` }} ></span> : null}
|
|
406
422
|
</div>
|
|
407
423
|
</div>
|
|
408
424
|
{valueNode}
|
|
409
425
|
{this.renderDefaultColor()}
|
|
410
|
-
</Drop>
|
|
426
|
+
</Drop >
|
|
411
427
|
)
|
|
412
428
|
}
|
|
413
429
|
},
|
|
414
430
|
|
|
415
431
|
render() {
|
|
416
432
|
let drop = this.renderDrop()
|
|
417
|
-
let { showArrow, icon } = this
|
|
433
|
+
let { showArrow, icon, currentMode } = this
|
|
418
434
|
let style = [
|
|
419
435
|
'k-color-picker',
|
|
420
436
|
{
|
|
@@ -425,12 +441,20 @@ export default {
|
|
|
425
441
|
'k-color-picker-lg': this.size == 'large'
|
|
426
442
|
},
|
|
427
443
|
]
|
|
444
|
+
// let triggerText = ""
|
|
445
|
+
// if (currentMode == 'hex') {
|
|
446
|
+
// triggerText = this.currentColor
|
|
447
|
+
// } else {
|
|
448
|
+
// triggerText = this.currentColor.substr(0, 7)
|
|
449
|
+
// }
|
|
450
|
+
|
|
428
451
|
|
|
429
|
-
return (<div class={style}>
|
|
452
|
+
return (<div class={style} >
|
|
430
453
|
<div class="k-color-picker-selection" onClick={this.toggleDrop}>
|
|
431
454
|
<div class="k-color-picker-color">
|
|
432
455
|
<div class="k-color-picker-color-inner" style={`background-color:${this.currentColor}`}></div>
|
|
433
456
|
</div>
|
|
457
|
+
{/* <div class="k-color-picker-trigger-text">{triggerText}</div> */}
|
|
434
458
|
{showArrow && <Icon class="k-color-picker-arrow" type={icon || ChevronDown} />}
|
|
435
459
|
</div>
|
|
436
460
|
{drop}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
| default-colors | 自定义颜色盘,最多20种 | Array | [...] |
|
|
7
7
|
| show-mode | 是否展示颜色模式 | Boolean | false |
|
|
8
8
|
| show-arrow | 是否展示下拉箭头 | Boolean | true |
|
|
9
|
+
| noAlpha | 是否禁用透明 | Boolean | false |
|
|
9
10
|
| icon | 自定义下拉箭头 | Boolean | true |
|
|
10
11
|
| shape | shape='circle' 呈现圆形 | String | - |
|
|
11
12
|
| change | 颜色值改变的时候触发,返回颜色的值 | Function | - |
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
display: inline-flex;
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
align-items: center;
|
|
12
|
-
padding: 0
|
|
12
|
+
padding: 0 3px;
|
|
13
13
|
|
|
14
14
|
&:hover,
|
|
15
15
|
&:focus {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.k-color-picker-color {
|
|
32
|
-
height:
|
|
33
|
-
width:
|
|
34
|
-
border-radius:
|
|
32
|
+
height: 24px;
|
|
33
|
+
width: 24px;
|
|
34
|
+
border-radius: 12%;
|
|
35
35
|
// margin: 2px;
|
|
36
36
|
overflow: hidden;
|
|
37
37
|
background-image: linear-gradient(-45deg, #cdcdcd 25%, transparent 0), linear-gradient(45deg, #cdcdcd 25%, transparent 0), linear-gradient(-45deg, transparent 75%, #cdcdcd 0), linear-gradient(45deg, transparent 75%, #cdcdcd 0);
|
|
@@ -87,10 +87,11 @@
|
|
|
87
87
|
.k-color-picker-lg {
|
|
88
88
|
// width: 70px;
|
|
89
89
|
height: 40px;
|
|
90
|
+
padding: 0 4px;
|
|
90
91
|
|
|
91
92
|
.k-color-picker-color {
|
|
92
|
-
width:
|
|
93
|
-
height:
|
|
93
|
+
width: 32px;
|
|
94
|
+
height: 32px;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
.k-color-picker-arrow {
|
|
@@ -105,11 +106,13 @@
|
|
|
105
106
|
.k-color-picker-color {
|
|
106
107
|
width: 16px;
|
|
107
108
|
height: 16px;
|
|
109
|
+
border-radius: 24%;
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
.k-color-picker-arrow {
|
|
111
113
|
font-size: 14px;
|
|
112
114
|
}
|
|
115
|
+
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
.k-color-picker-dropdown {
|
|
@@ -119,16 +122,21 @@
|
|
|
119
122
|
position: absolute;
|
|
120
123
|
border-radius: var(--kui-border-radius);
|
|
121
124
|
background: var(--kui-color-back);
|
|
125
|
+
border: 1px solid var(--kui-color-gray-80);
|
|
122
126
|
z-index: 1001;
|
|
127
|
+
padding: 10px;
|
|
128
|
+
box-sizing: border-box;
|
|
123
129
|
|
|
124
130
|
.k-color-picker-paint-dot {
|
|
125
131
|
width: 15px;
|
|
126
132
|
height: 15px;
|
|
127
133
|
display: block;
|
|
128
134
|
position: absolute;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
box-sizing: border-box;
|
|
136
|
+
// background: var(--kui-color-back);
|
|
137
|
+
// border: 2px solid #fff;
|
|
138
|
+
border: 2px solid var(--kui-color-back);
|
|
139
|
+
box-shadow: 0 0 0 px rgba(0, 0, 0, 0.2);
|
|
132
140
|
border-radius: 50%;
|
|
133
141
|
top: 10px;
|
|
134
142
|
left: 10px;
|
|
@@ -136,83 +144,85 @@
|
|
|
136
144
|
}
|
|
137
145
|
|
|
138
146
|
.k-color-picker-paint {
|
|
139
|
-
width:
|
|
147
|
+
width: 234px;
|
|
140
148
|
height: 136px;
|
|
149
|
+
border-radius: @radius;
|
|
141
150
|
}
|
|
142
151
|
|
|
143
152
|
.k-color-picker-bar {
|
|
144
|
-
padding:
|
|
145
|
-
display:
|
|
153
|
+
padding: 10px 0 0 0;
|
|
154
|
+
display: flex;
|
|
146
155
|
}
|
|
147
156
|
|
|
148
157
|
.k-color-picker-avatar {
|
|
149
|
-
width:
|
|
150
|
-
height:
|
|
151
|
-
border-radius:
|
|
158
|
+
width: 28px;
|
|
159
|
+
height: 28px;
|
|
160
|
+
border-radius: 6px;
|
|
152
161
|
float: left;
|
|
153
162
|
background-image: linear-gradient(-45deg, #cdcdcd 25%, transparent 0), linear-gradient(45deg, #cdcdcd 25%, transparent 0), linear-gradient(-45deg, transparent 75%, #cdcdcd 0), linear-gradient(45deg, transparent 75%, #cdcdcd 0);
|
|
154
163
|
background-size: 11px 11px;
|
|
155
164
|
background-position: 0 0, 0 -5.5px, -5.5px 5.5px, 5.5px 0;
|
|
156
165
|
|
|
157
166
|
.k-color-picker-avatar-inner {
|
|
158
|
-
border-radius:
|
|
167
|
+
border-radius: 6px;
|
|
159
168
|
width: 100%;
|
|
160
169
|
height: 100%;
|
|
170
|
+
border: 1px solid var(--kui-color-border);
|
|
171
|
+
box-sizing: border-box;
|
|
161
172
|
}
|
|
162
173
|
}
|
|
163
174
|
|
|
164
175
|
.k-color-picker-bar-box {
|
|
165
|
-
margin-left:
|
|
166
|
-
|
|
167
|
-
float: right;
|
|
176
|
+
margin-left: 14px;
|
|
177
|
+
flex: 1;
|
|
168
178
|
position: relative;
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
justify-content: space-between;
|
|
169
182
|
|
|
170
183
|
canvas {
|
|
171
|
-
height:
|
|
172
|
-
width:
|
|
173
|
-
border-radius:
|
|
184
|
+
height: 8px;
|
|
185
|
+
width: 190px;
|
|
186
|
+
border-radius: 4px;
|
|
174
187
|
}
|
|
175
188
|
|
|
176
189
|
.k-color-picker-alpha {
|
|
177
|
-
margin-top: 10px;
|
|
178
190
|
background-image: linear-gradient(-45deg, #cdcdcd 25%, transparent 0), linear-gradient(45deg, #cdcdcd 25%, transparent 0), linear-gradient(-45deg, transparent 75%, #cdcdcd 0), linear-gradient(45deg, transparent 75%, #cdcdcd 0);
|
|
179
|
-
background-size:
|
|
180
|
-
background-position: 0 0, 0 -
|
|
191
|
+
background-size: 8px 8px;
|
|
192
|
+
background-position: 0 0, 0 -4px, -4px 4px, 4px 0;
|
|
193
|
+
border: 1px solid #a1a1a1;
|
|
194
|
+
box-sizing: border-box;
|
|
181
195
|
}
|
|
182
196
|
|
|
183
197
|
span {
|
|
184
|
-
width:
|
|
185
|
-
height:
|
|
198
|
+
width: 12px;
|
|
199
|
+
height: 12px;
|
|
186
200
|
display: block;
|
|
187
201
|
position: absolute;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
|
|
202
|
+
border: 2px solid var(--kui-color-back);
|
|
203
|
+
box-shadow: 0 0 0 1px rgb(0 0 0 / 7%);
|
|
191
204
|
border-radius: 50%;
|
|
192
205
|
pointer-events: none;
|
|
206
|
+
box-sizing: border-box;
|
|
193
207
|
}
|
|
194
208
|
|
|
195
209
|
.k-color-picker-hue-dot {
|
|
196
|
-
top: -
|
|
210
|
+
top: -2px;
|
|
197
211
|
}
|
|
198
212
|
|
|
199
213
|
.k-color-picker-alpha-dot {
|
|
200
|
-
top:
|
|
214
|
+
top: 18px;
|
|
201
215
|
}
|
|
202
216
|
}
|
|
203
217
|
|
|
204
218
|
.k-color-picker-mode {
|
|
205
219
|
position: relative;
|
|
206
|
-
margin-left: 16px;
|
|
207
220
|
margin-top: 16px;
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
gap: 4px;
|
|
208
224
|
|
|
209
225
|
.k-btn {
|
|
210
|
-
position: absolute;
|
|
211
|
-
z-index: 1;
|
|
212
|
-
right: 10px;
|
|
213
|
-
top: 10px;
|
|
214
|
-
cursor: pointer;
|
|
215
|
-
|
|
216
226
|
&:hover {
|
|
217
227
|
color: @main;
|
|
218
228
|
}
|
|
@@ -233,50 +243,52 @@
|
|
|
233
243
|
.k-color-picker-rgba,
|
|
234
244
|
.k-color-picker-hsla {
|
|
235
245
|
.k-input {
|
|
236
|
-
width: 44px;
|
|
237
|
-
margin-right: 4px;
|
|
246
|
+
// width: 44px;
|
|
238
247
|
}
|
|
248
|
+
}
|
|
239
249
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
width: 44px;
|
|
243
|
-
display: inline-block;
|
|
244
|
-
margin-right: 4px;
|
|
245
|
-
color: #8b8b8b;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
250
|
+
.k-color-picker-mode-label {
|
|
251
|
+
font-size: 12px;
|
|
248
252
|
}
|
|
249
253
|
|
|
250
254
|
.k-color-picker-hex {
|
|
251
255
|
.k-input {
|
|
252
|
-
width: 188px;
|
|
256
|
+
// width: 188px;
|
|
253
257
|
}
|
|
254
258
|
}
|
|
255
259
|
|
|
260
|
+
|
|
261
|
+
|
|
256
262
|
.k-color-picker-val {
|
|
257
|
-
|
|
263
|
+
display: flex;
|
|
264
|
+
gap: 4px;
|
|
265
|
+
flex: 1;
|
|
258
266
|
|
|
259
267
|
input {
|
|
260
268
|
transition: none;
|
|
269
|
+
flex: 1;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.k-color-picker-alpha-input {
|
|
273
|
+
max-width: 48px;
|
|
261
274
|
}
|
|
262
275
|
}
|
|
263
276
|
|
|
264
277
|
.k-coclor-picker-defaults {
|
|
265
278
|
position: relative;
|
|
266
279
|
box-sizing: border-box;
|
|
267
|
-
padding:
|
|
268
|
-
margin-top:
|
|
269
|
-
min-height: 62px;
|
|
280
|
+
padding: 10px 0 0 0px;
|
|
281
|
+
margin-top: 10px;
|
|
270
282
|
border-top: 1px solid var(--kui-color-border);
|
|
271
283
|
display: flex;
|
|
272
284
|
flex-wrap: wrap;
|
|
285
|
+
gap: 6px;
|
|
273
286
|
|
|
274
287
|
>span {
|
|
275
288
|
display: inline-block;
|
|
276
289
|
width: 13px;
|
|
277
290
|
height: 13px;
|
|
278
291
|
border-radius: 2px;
|
|
279
|
-
margin: 0 6px 6px 0;
|
|
280
292
|
cursor: pointer;
|
|
281
293
|
|
|
282
294
|
&:hover {
|
|
@@ -287,7 +299,7 @@
|
|
|
287
299
|
.k-btn {
|
|
288
300
|
position: absolute;
|
|
289
301
|
top: 14px;
|
|
290
|
-
right:
|
|
302
|
+
right: 0;
|
|
291
303
|
width: 32px;
|
|
292
304
|
padding: 0;
|
|
293
305
|
}
|
|
@@ -89,8 +89,9 @@ export default {
|
|
|
89
89
|
watch: {
|
|
90
90
|
value(v) {
|
|
91
91
|
if (this.v != this.currentValue) {
|
|
92
|
+
console.log(v)
|
|
92
93
|
if (!this.isRange) {
|
|
93
|
-
this.currentValue = dayjs(v)
|
|
94
|
+
this.currentValue = v ? dayjs(v) : ''
|
|
94
95
|
} else {
|
|
95
96
|
let [a, b] = v || []
|
|
96
97
|
this.currentValue = [a ? dayjs(a) : null, b ? dayjs(b) : null]
|
|
@@ -5,14 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<div>
|
|
9
8
|
<DatePicker />
|
|
10
9
|
<DatePicker placeholder="小尺寸/Small" picker-size="small" />
|
|
11
10
|
<br />
|
|
12
11
|
<DatePicker mode="month" placeholder="请选择月份" />
|
|
13
|
-
<br />
|
|
14
12
|
<DatePicker mode="dateRange" />
|
|
15
13
|
<DatePicker mode="dateTimeRange" picker-size="small" />
|
|
16
|
-
</div>
|
|
17
14
|
</template>
|
|
18
15
|
```
|
|
@@ -95,7 +95,7 @@ export default {
|
|
|
95
95
|
let hasBar = el.scrollHeight > el.clientHeight || el.offsetHeight > el.clientHeight
|
|
96
96
|
if (barWidth && hasBar) {
|
|
97
97
|
target.style.width = `calc(100% - ${barWidth}px)`
|
|
98
|
-
target.style.
|
|
98
|
+
target.style.overflowY = `hidden`
|
|
99
99
|
}
|
|
100
100
|
} else {
|
|
101
101
|
setTimeout(() => {
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div style="width:512px;">
|
|
9
|
-
|
|
9
|
+
<Space>
|
|
10
|
+
<Checkbox v-model="disabled" label="Form disabled" />
|
|
11
|
+
</Space>
|
|
12
|
+
<Form :labelCol="{span:5}" :disabled="disabled" :wrapperCol="{span:16}" :size="size" :theme="theme?'light':''" :shape="checked?'circle':''">
|
|
10
13
|
<FormItem label="主题">
|
|
11
14
|
<Checkbox v-model="theme" label="Light" style="margin-right:8px;"/>
|
|
12
15
|
<Checkbox v-model="checked" label="Circle"/>
|
|
@@ -31,6 +34,10 @@
|
|
|
31
34
|
<Option value="2" label="Orange" />
|
|
32
35
|
</Select>
|
|
33
36
|
</FormItem>
|
|
37
|
+
<FormItem label="TreeSelect">
|
|
38
|
+
<TreeSelect style="width:100%;" :tree-data="treeData">
|
|
39
|
+
</TreeSelect>
|
|
40
|
+
</FormItem>
|
|
34
41
|
<FormItem label="Slider">
|
|
35
42
|
<Slider />
|
|
36
43
|
</FormItem>
|
|
@@ -68,10 +75,20 @@
|
|
|
68
75
|
export default{
|
|
69
76
|
data() {
|
|
70
77
|
return {
|
|
78
|
+
disabled:true,
|
|
71
79
|
size:'default',
|
|
72
80
|
theme:false,
|
|
73
81
|
checked:false,
|
|
74
|
-
shape:''
|
|
82
|
+
shape:'',
|
|
83
|
+
treeData: [
|
|
84
|
+
{
|
|
85
|
+
title:'food',
|
|
86
|
+
key:'0',
|
|
87
|
+
children :[
|
|
88
|
+
{ title:'apple' ,key:'0-1' },
|
|
89
|
+
{ title:'orange' ,key:'0-2' },
|
|
90
|
+
]}
|
|
91
|
+
]
|
|
75
92
|
}
|
|
76
93
|
}
|
|
77
94
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div style="width:600px">
|
|
9
|
-
<Form name="rules"
|
|
9
|
+
<Form name="rules" :rules="rules" :model="form" @submit="submit" :wrapperCol="wrapperCol" :labelCol="labelCol">
|
|
10
10
|
<FormItem label="Number" prop="number">
|
|
11
11
|
<Input clearable placeholder="校验数字" />
|
|
12
12
|
</FormItem>
|