@dataloop-ai/components 0.20.48 → 0.20.49
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
|
@@ -140,6 +140,11 @@ export default defineComponent({
|
|
|
140
140
|
default: 36,
|
|
141
141
|
validator: (val: number) => val >= 0
|
|
142
142
|
},
|
|
143
|
+
maxStretchableWidth: {
|
|
144
|
+
type: Number,
|
|
145
|
+
default: 360,
|
|
146
|
+
validator: (val: number) => val >= 0
|
|
147
|
+
},
|
|
143
148
|
direction: {
|
|
144
149
|
type: String,
|
|
145
150
|
default: 'right',
|
|
@@ -168,7 +173,7 @@ export default defineComponent({
|
|
|
168
173
|
default: null
|
|
169
174
|
}
|
|
170
175
|
},
|
|
171
|
-
emits: ['update:model-value'],
|
|
176
|
+
emits: ['update:model-value', 'panel-width'],
|
|
172
177
|
data() {
|
|
173
178
|
return {
|
|
174
179
|
uuid: `dl-panel-container-${v4()}`,
|
|
@@ -328,8 +333,8 @@ export default defineComponent({
|
|
|
328
333
|
this.collapsed = false
|
|
329
334
|
}
|
|
330
335
|
} else {
|
|
331
|
-
if (e.pageX > this.left + this.
|
|
332
|
-
element.style.width = this.
|
|
336
|
+
if (e.pageX > this.left + this.maxStretchableWidth) {
|
|
337
|
+
element.style.width = this.maxStretchableWidth + 'px'
|
|
333
338
|
|
|
334
339
|
this.collapsed = false
|
|
335
340
|
} else if (e.pageX < this.left + this.minW) {
|
|
@@ -342,6 +347,7 @@ export default defineComponent({
|
|
|
342
347
|
this.collapsed = false
|
|
343
348
|
}
|
|
344
349
|
}
|
|
350
|
+
this.$emit('panel-width', parseInt(element.style.width))
|
|
345
351
|
},
|
|
346
352
|
mouseup(e: MouseEvent) {
|
|
347
353
|
if (this.direction === 'right') {
|
|
@@ -387,7 +393,6 @@ export default defineComponent({
|
|
|
387
393
|
if (this.isFullWidth === false) {
|
|
388
394
|
element.style.width = this.w + 'px'
|
|
389
395
|
element.style.right = this.w + 'px'
|
|
390
|
-
|
|
391
396
|
this.isFullWidth = true
|
|
392
397
|
this.collapsed = false
|
|
393
398
|
} else {
|
|
@@ -397,6 +402,7 @@ export default defineComponent({
|
|
|
397
402
|
this.isFullWidth = false
|
|
398
403
|
this.collapsed = true
|
|
399
404
|
}
|
|
405
|
+
this.$emit('panel-width', parseInt(element.style.width))
|
|
400
406
|
}
|
|
401
407
|
}
|
|
402
408
|
},
|