webcake-ui-kit 1.2.18 → 1.3.0
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/package.json
CHANGED
|
@@ -68,7 +68,8 @@ export default {
|
|
|
68
68
|
},
|
|
69
69
|
error: { type: Boolean, default: false },
|
|
70
70
|
centered: { type: Boolean, default: false },
|
|
71
|
-
draggable: { type: Boolean, default: false }
|
|
71
|
+
draggable: { type: Boolean, default: false },
|
|
72
|
+
shiftStep: { type: Number, default: 10 }
|
|
72
73
|
},
|
|
73
74
|
emits: ['input', 'update:modelValue', 'change', 'focus', 'blur', 'pressEnter'],
|
|
74
75
|
data() {
|
|
@@ -77,13 +78,18 @@ export default {
|
|
|
77
78
|
inputText: '',
|
|
78
79
|
dragActive: false,
|
|
79
80
|
dragStartX: 0,
|
|
80
|
-
dragStartValue: 0
|
|
81
|
+
dragStartValue: 0,
|
|
82
|
+
dragShiftHeld: false,
|
|
81
83
|
}
|
|
82
84
|
},
|
|
83
85
|
computed: {
|
|
84
86
|
currentValue() {
|
|
85
87
|
return this.modelValue !== undefined ? this.modelValue : this.value
|
|
86
88
|
},
|
|
89
|
+
effectiveStep() {
|
|
90
|
+
if (this.shiftStep !== null && this.dragShiftHeld) return this.shiftStep
|
|
91
|
+
return this.step
|
|
92
|
+
},
|
|
87
93
|
hasPrefix() {
|
|
88
94
|
return !!((this.$scopedSlots && this.$scopedSlots['prefix']) || this.$slots['prefix'])
|
|
89
95
|
},
|
|
@@ -195,6 +201,7 @@ export default {
|
|
|
195
201
|
this.dragStartValue =
|
|
196
202
|
this.currentValue !== null && this.currentValue !== undefined ? Number(this.currentValue) : 0
|
|
197
203
|
this.dragActive = false
|
|
204
|
+
this.dragShiftHeld = e.shiftKey
|
|
198
205
|
document.addEventListener('mousemove', this.onDragMove)
|
|
199
206
|
document.addEventListener('mouseup', this.onDragEnd)
|
|
200
207
|
},
|
|
@@ -206,20 +213,23 @@ export default {
|
|
|
206
213
|
document.body.style.cursor = 'ew-resize'
|
|
207
214
|
if (this.$refs.input) this.$refs.input.blur()
|
|
208
215
|
}
|
|
209
|
-
|
|
216
|
+
this.dragShiftHeld = e.shiftKey
|
|
217
|
+
const newVal = this.clamp(this.toPrecision(this.dragStartValue + delta * this.effectiveStep))
|
|
210
218
|
this.$emit('input', newVal)
|
|
211
219
|
this.$emit('update:modelValue', newVal)
|
|
220
|
+
this.$emit('change', newVal)
|
|
212
221
|
},
|
|
213
222
|
onDragEnd(e) {
|
|
214
223
|
document.removeEventListener('mousemove', this.onDragMove)
|
|
215
224
|
document.removeEventListener('mouseup', this.onDragEnd)
|
|
216
225
|
if (this.dragActive) {
|
|
217
226
|
const delta = e.clientX - this.dragStartX
|
|
218
|
-
const newVal = this.clamp(this.toPrecision(this.dragStartValue + delta * this.
|
|
227
|
+
const newVal = this.clamp(this.toPrecision(this.dragStartValue + delta * this.effectiveStep))
|
|
219
228
|
this.$emit('change', newVal)
|
|
220
229
|
document.body.style.cursor = ''
|
|
221
230
|
}
|
|
222
231
|
this.dragActive = false
|
|
232
|
+
this.dragShiftHeld = false
|
|
223
233
|
},
|
|
224
234
|
onKeydown(e) {
|
|
225
235
|
if (e.key === 'ArrowUp') {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<Menu
|
|
3
3
|
:open="isOpen"
|
|
4
4
|
:disabled="disabled || loading"
|
|
5
|
-
placement="
|
|
5
|
+
:placement="placement"
|
|
6
6
|
:offset="4"
|
|
7
7
|
:anchor-width="dropdownMatchSelectWidth"
|
|
8
8
|
:close-on-select="false"
|
|
@@ -220,7 +220,11 @@ export default {
|
|
|
220
220
|
overlayClassName: { type: [String, Array, Object], default: null },
|
|
221
221
|
overlayStyle: { type: [Object, Array], default: null },
|
|
222
222
|
dropdownMatchSelectWidth: { type: Boolean, default: true },
|
|
223
|
-
overlayWidth: { type: [String, Number], default: null }
|
|
223
|
+
overlayWidth: { type: [String, Number], default: null },
|
|
224
|
+
placement: {
|
|
225
|
+
type: String,
|
|
226
|
+
default: 'bottom-start'
|
|
227
|
+
}
|
|
224
228
|
},
|
|
225
229
|
|
|
226
230
|
emits: ['change', 'update:modelValue'],
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<template v-if="isEmpty">
|
|
10
10
|
<tr class="ui-table__row">
|
|
11
|
-
<td colspan="100">
|
|
11
|
+
<td colspan="100" :style="{ borderBottom: 'none' }">
|
|
12
12
|
<div class="ui-table__row-empty ui-table__empty" :style="emptyStyle">
|
|
13
13
|
<slot name="empty">
|
|
14
14
|
<div class="wrapper-img">
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
import Sortable from 'sortablejs'
|
|
42
42
|
import TableRow from './TableRow.vue'
|
|
43
43
|
import MeasureCell from './MeasureCell.vue'
|
|
44
|
+
import { toCssSize } from '../../../utils/common'
|
|
44
45
|
|
|
45
46
|
export default {
|
|
46
47
|
name: 'TableBody',
|
|
@@ -73,10 +74,14 @@ export default {
|
|
|
73
74
|
emptyText() {
|
|
74
75
|
return this.tableContext.data.emptyText || 'Không có dữ liệu'
|
|
75
76
|
},
|
|
77
|
+
|
|
78
|
+
minHeight: function () {
|
|
79
|
+
return this.tableContext.layout.height
|
|
80
|
+
},
|
|
81
|
+
|
|
76
82
|
emptyStyle() {
|
|
77
|
-
const {
|
|
78
|
-
|
|
79
|
-
return { minHeight: `calc(${height}px - ${rowHeight}px)` }
|
|
83
|
+
const { rowHeight } = this.tableContext.layout
|
|
84
|
+
return { minHeight: `calc(${toCssSize(this.minHeight)} - ${toCssSize(rowHeight)})` }
|
|
80
85
|
}
|
|
81
86
|
},
|
|
82
87
|
beforeUnmount: function () {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
@focus="onFocus"
|
|
26
26
|
@blur="onBlur"
|
|
27
27
|
></textarea>
|
|
28
|
-
<span v-if="
|
|
28
|
+
<span v-if="showCount" class="ui-textarea__counter"
|
|
29
29
|
>{{ charCount }}<template v-if="maxLength !== undefined"> / {{ maxLength }}</template></span
|
|
30
30
|
>
|
|
31
31
|
</span>
|