@dataloop-ai/components 0.19.239 → 0.19.241
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
|
@@ -351,6 +351,7 @@
|
|
|
351
351
|
:style="col.tdStyle(props.item)"
|
|
352
352
|
:no-hover="noHover"
|
|
353
353
|
:col-index="colIndex"
|
|
354
|
+
:no-tooltip="col.ignoreTooltip"
|
|
354
355
|
:padding="`0 ${columnSpacing}`"
|
|
355
356
|
>
|
|
356
357
|
<slot
|
|
@@ -1358,11 +1359,15 @@ export default defineComponent({
|
|
|
1358
1359
|
)
|
|
1359
1360
|
|
|
1360
1361
|
const isResizing = ref(false)
|
|
1362
|
+
const isResizingInProgress = ref(false)
|
|
1361
1363
|
const isDragging = ref(false)
|
|
1362
1364
|
const setIsResizing = (val: boolean) => (isResizing.value = val)
|
|
1365
|
+
const setResizingInProgress = (val: boolean) =>
|
|
1366
|
+
(isResizingInProgress.value = val)
|
|
1363
1367
|
const setIsDragging = (val: boolean) => (isDragging.value = val)
|
|
1364
1368
|
const getIsDragging = () => isDragging.value
|
|
1365
1369
|
const getIsResizing = () => isResizing.value
|
|
1370
|
+
const getResizingInProgress = () => isResizingInProgress.value
|
|
1366
1371
|
const getVisibleColumnsState = () => visibleColumnsState.value
|
|
1367
1372
|
|
|
1368
1373
|
// table slots
|
|
@@ -1814,6 +1819,10 @@ export default defineComponent({
|
|
|
1814
1819
|
)
|
|
1815
1820
|
}
|
|
1816
1821
|
|
|
1822
|
+
if (resizable.value) {
|
|
1823
|
+
injectProp(data, 'isResizingInProgress', getResizingInProgress)
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1817
1826
|
return data
|
|
1818
1827
|
}
|
|
1819
1828
|
|
|
@@ -2036,8 +2045,10 @@ export default defineComponent({
|
|
|
2036
2045
|
updateColumns,
|
|
2037
2046
|
reorderColumns,
|
|
2038
2047
|
setIsResizing,
|
|
2048
|
+
setResizingInProgress,
|
|
2039
2049
|
setIsDragging,
|
|
2040
2050
|
getIsResizing,
|
|
2051
|
+
getResizingInProgress,
|
|
2041
2052
|
getIsDragging,
|
|
2042
2053
|
getVisibleColumnsState,
|
|
2043
2054
|
getTableKey
|
|
@@ -118,6 +118,10 @@ export default defineComponent({
|
|
|
118
118
|
return !!props.props?.dense || !!props.props?.col?.dense
|
|
119
119
|
})
|
|
120
120
|
|
|
121
|
+
const isResizingInProgress = computed(() => {
|
|
122
|
+
return !!props.props?.isResizingInProgress
|
|
123
|
+
})
|
|
124
|
+
|
|
121
125
|
const column = computed(() => {
|
|
122
126
|
let col: any
|
|
123
127
|
const name = vm.vnode.key as string
|
|
@@ -164,6 +168,9 @@ export default defineComponent({
|
|
|
164
168
|
})
|
|
165
169
|
|
|
166
170
|
const handleClick = (evt: Event) => {
|
|
171
|
+
if (isResizingInProgress.value) {
|
|
172
|
+
return
|
|
173
|
+
}
|
|
167
174
|
if (column.value.sortable) {
|
|
168
175
|
const sort = props.props?.sort as Function
|
|
169
176
|
sort(column.value)
|
|
@@ -176,6 +183,7 @@ export default defineComponent({
|
|
|
176
183
|
return {
|
|
177
184
|
hasHint,
|
|
178
185
|
isDense,
|
|
186
|
+
isResizingInProgress,
|
|
179
187
|
isSortable: !hasOptionalProps.value
|
|
180
188
|
? false
|
|
181
189
|
: column?.value?.sortable ?? false,
|
|
@@ -475,11 +475,14 @@ const getError = (
|
|
|
475
475
|
return (acc = errors.FORBIDDEN_KEY(field))
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
const valid =
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
const valid =
|
|
479
|
+
operator === operators.$exists ||
|
|
480
|
+
operator === operators.$doesnt_exist_dummy ||
|
|
481
|
+
isValidByDataType(
|
|
482
|
+
validateBracketValues(value),
|
|
483
|
+
getDataType(schema, aliases, fieldKey),
|
|
484
|
+
operator
|
|
485
|
+
)
|
|
483
486
|
|
|
484
487
|
if (!valid) {
|
|
485
488
|
arr.splice(1)
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
setColumnVerticalBorder
|
|
10
10
|
} from './table-columns'
|
|
11
11
|
|
|
12
|
-
const MIN_CELL_WIDTH =
|
|
13
|
-
const RESIZE_SENSITIVITY_OFFSET =
|
|
12
|
+
const MIN_CELL_WIDTH = 64
|
|
13
|
+
const RESIZE_SENSITIVITY_OFFSET = 5
|
|
14
14
|
|
|
15
15
|
export function applyResizableColumns(table: HTMLTableElement, vm: any) {
|
|
16
16
|
let mousePosition: 'start' | 'end' | 'default' = 'default'
|
|
@@ -91,10 +91,14 @@ export function applyResizableColumns(table: HTMLTableElement, vm: any) {
|
|
|
91
91
|
removeTableVerticalBorders(table)
|
|
92
92
|
const newColumns = getColumnsWithUpdatedWidth(table, vm.props.columns)
|
|
93
93
|
vm.proxy.updateColumns(newColumns)
|
|
94
|
+
setTimeout(() => {
|
|
95
|
+
vm.proxy.setResizingInProgress(false)
|
|
96
|
+
}, 200)
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
function resizeColumn(event: MouseEvent) {
|
|
97
100
|
if (targetIndex < 0) return
|
|
101
|
+
vm.proxy.setResizingInProgress(true)
|
|
98
102
|
const firstRow = table.rows[0]
|
|
99
103
|
const { x } = firstRow.children[targetIndex].getBoundingClientRect()
|
|
100
104
|
const fromStartToMouse = event.clientX - x
|
|
@@ -102,11 +106,13 @@ export function applyResizableColumns(table: HTMLTableElement, vm: any) {
|
|
|
102
106
|
table,
|
|
103
107
|
(el) =>
|
|
104
108
|
(el.tagName === 'TH' || el.tagName === 'TD') &&
|
|
105
|
-
targetIndex &&
|
|
109
|
+
targetIndex >= 0 &&
|
|
106
110
|
getColIndex(el) === targetIndex &&
|
|
107
111
|
fromStartToMouse >= MIN_CELL_WIDTH, // if
|
|
108
112
|
(el) => {
|
|
109
|
-
el.style.width = `${fromStartToMouse}px`
|
|
113
|
+
el.style.width = `${fromStartToMouse}px`
|
|
114
|
+
el.style.maxWidth = `${fromStartToMouse}px`
|
|
115
|
+
el.style.minWidth = `${fromStartToMouse}px` // then
|
|
110
116
|
}
|
|
111
117
|
)
|
|
112
118
|
}
|