@dataloop-ai/components 0.20.56 → 0.20.58

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.20.56",
3
+ "version": "0.20.58",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -23,7 +23,7 @@
23
23
  "check-only": "if grep -E -H -r --exclude-dir=.git --exclude-dir=node_modules --exclude=*.json --exclude=*.yml '^(describe|it).only' .; then echo 'Found only in test files' && exit 1; fi"
24
24
  },
25
25
  "dependencies": {
26
- "@dataloop-ai/icons": "^3.0.158",
26
+ "@dataloop-ai/icons": "^3.0.160",
27
27
  "@types/flat": "^5.0.2",
28
28
  "@types/lodash": "^4.14.184",
29
29
  "@types/sortablejs": "^1.15.7",
@@ -10,16 +10,17 @@
10
10
  @mouseenter="handleMouseEnter"
11
11
  @mouseleave="handleMouseLeave"
12
12
  >
13
- <div ref="panel" class="inner-container" style="height: 100%">
13
+ <div ref="panel" :style="innerContainerStyles" class="inner-container">
14
14
  <div v-if="collapsed" class="inner-container-overlay" />
15
15
  <div v-if="collapsable === true">
16
16
  <div
17
17
  v-if="
18
18
  direction === 'right' &&
19
- isFullWidth === true &&
20
- hideCollapseButton === false
19
+ isFullWidth === true &&
20
+ hideCollapseButton === false
21
21
  "
22
22
  class="collapse-icon collapse-icon--right"
23
+ :style="collapseIconStyle"
23
24
  @click="handleCollapseButtonClick"
24
25
  >
25
26
  <dl-tooltip>Hide</dl-tooltip>
@@ -32,6 +33,7 @@
32
33
  <div
33
34
  v-else-if="direction === 'right' && isFullWidth === false"
34
35
  class="collapse-icon collapse-icon--right"
36
+ :style="collapseIconStyle"
35
37
  @click="handleCollapseButtonClick"
36
38
  >
37
39
  <dl-tooltip>Show</dl-tooltip>
@@ -44,11 +46,14 @@
44
46
  <div
45
47
  v-else-if="
46
48
  direction === 'left' &&
47
- isFullWidth === true &&
48
- hideCollapseButton === false
49
+ isFullWidth === true &&
50
+ hideCollapseButton === false
49
51
  "
50
52
  class="collapse-icon collapse-icon--left"
53
+ :style="[collapseIconStyle, leftCollapseIconStyle]"
51
54
  @click="handleCollapseButtonClick"
55
+ @mouseleave="collapseButtonMouseLeave"
56
+ @mouseenter="collapseButtonMouseEnter"
52
57
  >
53
58
  <dl-tooltip>Hide</dl-tooltip>
54
59
  <dl-icon
@@ -60,7 +65,10 @@
60
65
  <div
61
66
  v-else-if="direction === 'left' && isFullWidth === false"
62
67
  class="collapse-icon collapse-icon--left--collapsed"
68
+ :style="[collapseIconStyle, leftClosedCollapseIconStyle]"
63
69
  @click="handleCollapseButtonClick"
70
+ @mouseleave="collapseButtonMouseLeave"
71
+ @mouseenter="collapseButtonMouseEnter"
64
72
  >
65
73
  <dl-tooltip>Show</dl-tooltip>
66
74
  <dl-icon
@@ -77,6 +85,7 @@
77
85
  :style="separatorStyles"
78
86
  >
79
87
  <div
88
+ v-if="showDragHandle"
80
89
  v-show="resizable === true"
81
90
  class="gutter"
82
91
  :style="glutterStyles"
@@ -155,6 +164,11 @@ export default defineComponent({
155
164
  default: 360,
156
165
  validator: (val: number) => val >= 0
157
166
  },
167
+ minStretchableWidth: {
168
+ type: Number,
169
+ default: 36,
170
+ validator: (val: number) => val >= 0
171
+ },
158
172
  direction: {
159
173
  type: String,
160
174
  default: 'right',
@@ -185,6 +199,14 @@ export default defineComponent({
185
199
  showCollapseOnHover: {
186
200
  type: Boolean,
187
201
  default: false
202
+ },
203
+ layoutMode: {
204
+ type: String,
205
+ default: 'regular'
206
+ },
207
+ showDragHandle: {
208
+ type: Boolean,
209
+ default: true
188
210
  }
189
211
  },
190
212
  emits: ['update:model-value', 'panel-width'],
@@ -196,10 +218,15 @@ export default defineComponent({
196
218
  isFullWidth: true,
197
219
  avoidUserSelect: false,
198
220
  collapsed: false,
199
- hideCollapseButton: false
221
+ hideCollapseButton: false,
222
+ collapseBorder:
223
+ '1px solid var(--dl-color-separator, rgba(255, 255, 255, 0.15))'
200
224
  }
201
225
  },
202
226
  computed: {
227
+ isStudioMode() {
228
+ return this.layoutMode === 'studio'
229
+ },
203
230
  minW(): number {
204
231
  if (this.minWidth <= 0) {
205
232
  return 0
@@ -268,6 +295,56 @@ export default defineComponent({
268
295
  return {
269
296
  [this.position]: '0px'
270
297
  }
298
+ },
299
+ innerContainerStyles(): Record<string, string> {
300
+ return {
301
+ textAlign: 'left',
302
+ fontSize: 'var(--dl-font-size-body)',
303
+ position: 'relative',
304
+ height: '100%',
305
+ boxSizing: 'border-box',
306
+ color: 'var(--dl-color-darker)',
307
+ backgroundColor: 'var(--dl-color-panel-background)',
308
+ zIndex: 'var(--dl-z-index-panel)',
309
+ width: this.isStudioMode
310
+ ? 'calc(var(--dl-panel-container-width) - 10px)'
311
+ : this.width + 'px',
312
+ padding: this.isStudioMode ? '0px' : '0px 10px'
313
+ }
314
+ },
315
+ collapseIconStyle(): Record<string, string> {
316
+ return {
317
+ zIndex: 'var(--dl-z-index-panel-container-elements)',
318
+ width: '20px',
319
+ height: '20px',
320
+ backgroundColor: 'var(--dl-color-fill)',
321
+ position: 'absolute',
322
+ top: this.isStudioMode ? '40px' : '8px',
323
+ display: 'flex',
324
+ justifyContent: 'center',
325
+ alignItems: 'center',
326
+ borderRadius: '2px',
327
+ border: this.collapseBorder,
328
+ background: 'var(--dl-color-component, #30363D)',
329
+ boxShadow:
330
+ '0px 4px 4px 0px var(--dl-color-shadow, rgba(27, 30, 34, 0.24))'
331
+ }
332
+ },
333
+ leftCollapseIconStyle(): Record<string, string> {
334
+ return {
335
+ right: this.isStudioMode ? '-10px' : '0px',
336
+ marginLeft: '15px',
337
+ borderTopLeftRadius: '2px',
338
+ borderBottomLeftRadius: '2px'
339
+ }
340
+ },
341
+ leftClosedCollapseIconStyle(): Record<string, string> {
342
+ return {
343
+ left: this.isStudioMode ? '10px' : '0px',
344
+ marginRight: '15px',
345
+ borderTopRightRadius: '2px',
346
+ borderBottomRightRadius: '2px'
347
+ }
271
348
  }
272
349
  },
273
350
  watch: {
@@ -313,6 +390,13 @@ export default defineComponent({
313
390
  this.hideCollapseButton = true
314
391
  }
315
392
  },
393
+ collapseButtonMouseEnter() {
394
+ this.collapseBorder = '1px solid var(--dl-color-hover)'
395
+ },
396
+ collapseButtonMouseLeave() {
397
+ this.collapseBorder =
398
+ '1px solid var(--dl-color-separator, rgba(255, 255, 255, 0.15))'
399
+ },
316
400
  reset() {
317
401
  const element = this.$refs['panel'] as HTMLDivElement
318
402
  element.style.width = this.w + 'px'
@@ -358,17 +442,24 @@ export default defineComponent({
358
442
  this.collapsed = false
359
443
  }
360
444
  } else {
361
- if (e.pageX > this.left + this.maxStretchableWidth) {
362
- element.style.width = this.maxStretchableWidth + 'px'
445
+ const newWidth = e.pageX - this.left
363
446
 
447
+ if (newWidth > this.maxStretchableWidth) {
448
+ element.style.width = this.maxStretchableWidth + 'px'
364
449
  this.collapsed = false
365
- } else if (e.pageX < this.left + this.minW) {
366
- element.style.width = this.minW + 'px'
367
-
368
- this.collapsed = true
450
+ } else if (newWidth < this.minW) {
451
+ const widthToSet = Math.max(
452
+ this.minStretchableWidth,
453
+ this.minW
454
+ )
455
+ element.style.width = widthToSet + 'px'
456
+ this.collapsed = widthToSet === this.minW
369
457
  } else {
370
- element.style.width = offset + 'px'
371
-
458
+ const widthToSet = Math.max(
459
+ newWidth,
460
+ this.minStretchableWidth
461
+ )
462
+ element.style.width = widthToSet + 'px'
372
463
  this.collapsed = false
373
464
  }
374
465
  }
@@ -376,19 +467,11 @@ export default defineComponent({
376
467
  },
377
468
  mouseup(e: MouseEvent) {
378
469
  if (this.direction === 'right') {
379
- if (e.pageX < this.left) {
380
- this.isFullWidth = true
381
- } else {
382
- this.isFullWidth = false
383
- }
470
+ this.isFullWidth = e.pageX < this.left
384
471
  } else {
385
- if (e.pageX > this.left + this.w) {
386
- this.isFullWidth = true
387
- } else {
388
- this.isFullWidth = false
389
- }
472
+ this.isFullWidth =
473
+ this.isStudioMode || e.pageX > this.left + this.w
390
474
  }
391
-
392
475
  document.removeEventListener('mousemove', this.mousemove)
393
476
  document.removeEventListener('mouseup', this.mouseup)
394
477
 
@@ -442,46 +525,15 @@ export default defineComponent({
442
525
  max-height: var(--dl-panel-container-height);
443
526
 
444
527
  .inner-container {
445
- text-align: left;
446
- font-size: var(--dl-font-size-body);
447
-
448
- position: relative;
449
- padding: 0px 10px;
450
- box-sizing: border-box;
451
- color: var(--dl-color-darker);
452
- background-color: var(--dl-color-panel-background);
453
- z-index: var(--dl-z-index-panel);
454
-
455
528
  .collapse-icon {
456
- z-index: var(--dl-z-index-panel-container-elements);
457
- width: 20px;
458
- height: 20px;
459
- background-color: var(--dl-color-fill);
460
- position: absolute;
461
- top: 8px;
462
- display: flex;
463
- justify-content: center;
464
- align-items: center;
465
-
466
529
  &--right {
467
530
  border-top-left-radius: 2px;
468
531
  border-bottom-left-radius: 2px;
469
532
  right: 0px;
470
533
  margin-left: 15px;
471
534
  }
472
-
473
- &--left {
474
- right: 0px;
475
- margin-left: 15px;
476
- border-top-left-radius: 2px;
477
- border-bottom-left-radius: 2px;
478
-
479
- &--collapsed {
480
- left: 0px;
481
- margin-right: 15px;
482
- border-top-right-radius: 2px;
483
- border-bottom-right-radius: 2px;
484
- }
535
+ &:hover {
536
+ border: 1px solid var(--dl-color-hover);
485
537
  }
486
538
  }
487
539
 
@@ -518,7 +570,6 @@ export default defineComponent({
518
570
 
519
571
  & .content {
520
572
  overflow-x: hidden;
521
- overflow-y: scroll;
522
573
  max-height: calc(
523
574
  var(--dl-panel-container-height) - var(--dl-header-height, 0) -
524
575
  var(--dl-footer-height, 0)