@dataloop-ai/components 0.19.211 → 0.19.213

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.19.211",
3
+ "version": "0.19.213",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -58,7 +58,7 @@ body {
58
58
  }
59
59
  }
60
60
 
61
- /* Inserting a collapsed row between two flex items will make
61
+ /* Inserting a collapsed row between two flex items will make
62
62
  * the flex item that comes after it break to a new row */
63
63
  .break {
64
64
  flex-basis: 100%;
@@ -73,6 +73,19 @@ body {
73
73
 
74
74
  .scroll {
75
75
  overflow: auto;
76
+ scrollbar-color: transparent transparent; /* For Firefox */
77
+ }
78
+
79
+ .scroll::-webkit-scrollbar-thumb {
80
+ background-color: transparent;
81
+ }
82
+
83
+ .scroll:hover {
84
+ scrollbar-color: var(--dl-color-lighter);
85
+ }
86
+
87
+ .scroll:hover::-webkit-scrollbar-thumb {
88
+ background-color: var(--dl-color-lighter);
76
89
  }
77
90
 
78
91
  .scroll,
@@ -196,7 +196,7 @@ export default defineComponent({
196
196
  vertical-align: middle;
197
197
  font-size: var(--dl-font-size-body);
198
198
  line-height: 12px;
199
- border-radius: 2px;
199
+ border-radius: 2px !important;
200
200
  padding: var(--dl-chip-padding);
201
201
  outline: 0;
202
202
  min-width: 18px;
@@ -17,7 +17,7 @@
17
17
  ? defaultIconColor
18
18
  : statusIconColor || defaultIconColor
19
19
  "
20
- size="16px"
20
+ size="12px"
21
21
  :inline="false"
22
22
  />
23
23
  </div>
@@ -52,25 +52,24 @@
52
52
  </div>
53
53
  <dl-tooltip
54
54
  v-if="!focused"
55
- :style="`
56
- background-color: var(--dl-color-panel-background);
57
- border: 1px solid var(--dl-color-separator);
58
- color: var(--dl-color-darker);
59
- padding: 16px;
60
- `"
55
+ border="1px solid var(--dl-color-separator)"
56
+ background-color="dl-color-panel-background"
57
+ color="dl-color-darker"
61
58
  max-width="340px"
62
59
  anchor="bottom left"
63
60
  self="top left"
64
61
  >
65
- <div class="tooltip-title">
66
- <dl-icon :icon="defaultIcon" />
67
- Smart Search Query
68
- </div>
69
- <div class="tooltip-subtitle">
70
- A powerful and flexible search. Allows users to
71
- construct queries based on specific field selection
72
- following schema rules. Does not enable free text
73
- search.
62
+ <div style="padding: 10px">
63
+ <div class="tooltip-title">
64
+ <dl-icon :icon="defaultIcon" />
65
+ Smart Search Query
66
+ </div>
67
+ <div class="tooltip-subtitle">
68
+ A powerful and flexible search. Allows users to
69
+ construct queries based on specific field selection
70
+ following schema rules. Does not enable free text
71
+ search.
72
+ </div>
74
73
  </div>
75
74
  </dl-tooltip>
76
75
  </div>
@@ -1161,8 +1160,8 @@ export default defineComponent({
1161
1160
  &__status-icon-wrapper {
1162
1161
  display: flex;
1163
1162
  line-height: 15px;
1164
- margin: 6px 8px 0px 0px;
1165
- align-items: flex-start;
1163
+ margin: 3px 8px 0px 0px;
1164
+ align-items: center;
1166
1165
  div:first-child {
1167
1166
  display: flex;
1168
1167
  align-items: center;
@@ -49,7 +49,10 @@
49
49
  @virtual-scroll="onVScroll"
50
50
  >
51
51
  <template #before>
52
- <thead :colspan="colspanWithExpandableRow">
52
+ <thead
53
+ :colspan="colspanWithExpandableRow"
54
+ style="position: relative; z-index: 100"
55
+ >
53
56
  <slot
54
57
  v-if="!hideHeader"
55
58
  name="header"
@@ -117,6 +120,7 @@
117
120
  :props="getHeaderScope({ col })"
118
121
  :col-index="colIndex"
119
122
  :pagination="computedPagination"
123
+ :padding="`0 ${columnSpacing}`"
120
124
  @click="onThClick($event, col.name)"
121
125
  >
122
126
  <span
@@ -337,6 +341,7 @@
337
341
  :style="col.tdStyle(props.item)"
338
342
  :no-hover="noHover"
339
343
  :col-index="colIndex"
344
+ :padding="`0 ${columnSpacing}`"
340
345
  >
341
346
  <slot
342
347
  v-bind="
@@ -379,7 +384,9 @@
379
384
  ? `body-cell-row-actions`
380
385
  : 'body-cell'
381
386
  "
382
- />
387
+ >
388
+ <div style="width: 15px"></div>
389
+ </slot>
383
390
  </DlTd>
384
391
  </DlTr>
385
392
  <tr
@@ -426,7 +433,10 @@
426
433
 
427
434
  <div v-else ref="tableScroll" class="dl-table__middle scroll">
428
435
  <table ref="tableRef" class="dl-table" :class="additionalClasses">
429
- <thead :colspan="colspanWithExpandableRow">
436
+ <thead
437
+ :colspan="colspanWithExpandableRow"
438
+ style="position: relative; z-index: 100"
439
+ >
430
440
  <slot
431
441
  v-if="!hideHeader"
432
442
  name="header"
@@ -494,7 +504,9 @@
494
504
  :props="getHeaderScope({ col })"
495
505
  :col-index="colIndex"
496
506
  :pagination="computedPagination"
497
- :padding="isTreeTable ? '0' : '0 10px'"
507
+ :padding="
508
+ isTreeTable ? '0' : `0 ${columnSpacing}`
509
+ "
498
510
  @click="onThClick($event, col.name)"
499
511
  >
500
512
  <span
@@ -516,7 +528,9 @@
516
528
  v-if="showRowActions"
517
529
  key="visibleColumnsSlot"
518
530
  no-tooltip
519
- :padding="isTreeTable ? '0' : '0 10px'"
531
+ :padding="
532
+ isTreeTable ? '0' : `0 ${columnSpacing}`
533
+ "
520
534
  >
521
535
  <slot
522
536
  name="header-cell-visible-columns-button"
@@ -617,6 +631,7 @@
617
631
  ref="tbody"
618
632
  tag="tbody"
619
633
  class="nested-table dl-virtual-scroll__content"
634
+ style="position: relative; z-index: 90"
620
635
  v-bind="{
621
636
  onEnd: handleSortableEvent
622
637
  }"
@@ -732,6 +747,7 @@
732
747
  :style="col.tdStyle(row)"
733
748
  :col-index="colIndex"
734
749
  :no-tooltip="col.ignoreTooltip"
750
+ :padding="`0 ${columnSpacing}`"
735
751
  >
736
752
  <slot
737
753
  v-bind="
@@ -758,6 +774,7 @@
758
774
  key="visibleColumnsSlot"
759
775
  class="visible-columns-justify-end"
760
776
  no-tooltip
777
+ :padding="`0 ${columnSpacing}`"
761
778
  >
762
779
  <slot
763
780
  v-bind="
@@ -774,7 +791,9 @@
774
791
  ? `body-cell-row-actions`
775
792
  : 'body-cell'
776
793
  "
777
- />
794
+ >
795
+ <div style="width: 15px"></div>
796
+ </slot>
778
797
  </DlTd>
779
798
  </DlTr>
780
799
  <tr
@@ -1180,6 +1199,14 @@ export default defineComponent({
1180
1199
  type: Array as PropType<DlTableColumn[]>,
1181
1200
  default: (): [] => []
1182
1201
  },
1202
+ /**
1203
+ * Padding of TD and TH elements
1204
+ */
1205
+ columnSpacing: {
1206
+ type: String,
1207
+ default: '10px',
1208
+ required: false
1209
+ },
1183
1210
  /**
1184
1211
  * Props for the empty state component
1185
1212
  */
@@ -1397,13 +1424,18 @@ export default defineComponent({
1397
1424
  tableRef.value ||
1398
1425
  virtScrollRef.value.rootRef.querySelector('table') ||
1399
1426
  (document.querySelector('table.dl-table') as HTMLTableElement)
1400
-
1427
+ const cols = getVisibleColumnsState()
1428
+ ? props.columns.filter((col: any) =>
1429
+ getVisibleColumnsState().includes(col.name)
1430
+ )
1431
+ : props.columns
1401
1432
  nextTick(() => {
1402
1433
  setAllColumnWidths(
1403
1434
  tableEl,
1404
- columns.value as DlTableColumn[],
1435
+ cols as DlTableColumn[],
1405
1436
  props.stickyColumns,
1406
- props.fitAllColumns
1437
+ props.fitAllColumns,
1438
+ !!props.visibleColumns
1407
1439
  )
1408
1440
  })
1409
1441
  return tableEl
@@ -1415,7 +1447,6 @@ export default defineComponent({
1415
1447
  'virtual-scroll-content-update',
1416
1448
  updateTableSizing
1417
1449
  )
1418
- if (visibleColumns.value) return
1419
1450
  if (resizable.value) {
1420
1451
  applyResizableColumns(tableEl, vm)
1421
1452
  }
@@ -1443,16 +1474,20 @@ export default defineComponent({
1443
1474
  (document.querySelector(
1444
1475
  'table.dl-table'
1445
1476
  ) as HTMLTableElement)
1446
-
1477
+ const cols = getVisibleColumnsState()
1478
+ ? props.columns.filter((col: any) =>
1479
+ getVisibleColumnsState().includes(col.name)
1480
+ )
1481
+ : props.columns
1447
1482
  nextTick(() => {
1448
1483
  setAllColumnWidths(
1449
1484
  tableEl,
1450
- props.columns as DlTableColumn[],
1485
+ cols as DlTableColumn[],
1451
1486
  props.stickyColumns,
1452
- props.fitAllColumns
1487
+ props.fitAllColumns,
1488
+ !!props.visibleColumns
1453
1489
  )
1454
1490
  })
1455
- if (visibleColumns.value) return
1456
1491
 
1457
1492
  if (resizable.value) {
1458
1493
  applyResizableColumns(tableEl, vm)
@@ -1471,7 +1506,6 @@ export default defineComponent({
1471
1506
  )
1472
1507
 
1473
1508
  watch(resizable, () => {
1474
- if (visibleColumns.value) return
1475
1509
  applyResizableColumns(tableEl, vm)
1476
1510
  })
1477
1511
 
@@ -71,7 +71,12 @@ export default defineComponent({
71
71
 
72
72
  if (props.bgColor) {
73
73
  styles = styles.concat(
74
- `background: ${getColor(props.bgColor, '')}`
74
+ `background: ${getColor(props.bgColor, '')};`
75
+ )
76
+ }
77
+ if (vm.vnode.key === 'visibleColumnsSlot') {
78
+ styles = styles.concat(
79
+ 'position: sticky; right: 0; z-index: 101;'
75
80
  )
76
81
  }
77
82
  return styles
@@ -136,8 +136,11 @@ export default defineComponent({
136
136
 
137
137
  if (!column.value || colIndex.value === -1) {
138
138
  return {
139
- headerStyle: '',
140
- thClasses: '',
139
+ headerStyle:
140
+ vm.vnode.key === 'visibleColumnsSlot'
141
+ ? [{ position: 'sticky', right: 0, zIndex: 101 }]
142
+ : null,
143
+ thClasses: null,
141
144
  isSortable: false,
142
145
  hasEllipsis: false,
143
146
  onClick: onClickFn,
@@ -199,6 +199,7 @@
199
199
  }
200
200
 
201
201
  .dl-td {
202
+ background-color: var(--dl-color-panel-background);
202
203
  &--no-hover {
203
204
  &:hover {
204
205
  background-color: none !important;
@@ -211,7 +212,7 @@
211
212
  }
212
213
 
213
214
  tbody {
214
- tr.selected {
215
+ tr.selected td {
215
216
  background-color: var(--dl-color-fill);
216
217
  }
217
218
 
@@ -336,6 +337,7 @@
336
337
 
337
338
  &__bottom--nodata {
338
339
  color: var(--dl-color-lighter);
340
+ padding: 25px;
339
341
 
340
342
  .dl-table__control {
341
343
  justify-content: center;
@@ -1,12 +1,6 @@
1
1
  <template>
2
- <dl-teleport
3
- v-if="portalIsActive"
4
- :to="portalEl"
5
- >
6
- <transition
7
- name="fade"
8
- appear
9
- >
2
+ <dl-teleport v-if="portalIsActive" :to="portalEl">
3
+ <transition name="fade" appear>
10
4
  <div
11
5
  v-if="showing"
12
6
  :id="uuid"
@@ -141,6 +135,10 @@ export default defineComponent({
141
135
  triggerPercentage: {
142
136
  type: Number,
143
137
  default: 1
138
+ },
139
+ border: {
140
+ type: String,
141
+ default: null
144
142
  }
145
143
  },
146
144
  setup(props, { emit, attrs }) {
@@ -360,7 +358,7 @@ export default defineComponent({
360
358
 
361
359
  function configureScrollTarget() {
362
360
  if (anchorEl.value !== null || props.scrollTarget) {
363
- (localScrollTarget as Ref<any>).value = getScrollTarget(
361
+ ;(localScrollTarget as Ref<any>).value = getScrollTarget(
364
362
  anchorEl.value as HTMLElement,
365
363
  props.scrollTarget as Element
366
364
  )
@@ -414,7 +412,8 @@ export default defineComponent({
414
412
  '--dl-tooltip-text-align': props.textAlignment,
415
413
  '--dl-tooltip-text-transform': props.capitalized
416
414
  ? 'capitalize'
417
- : 'none'
415
+ : 'none',
416
+ '--dl-tooltip-border': props.border
418
417
  }
419
418
  ] as any
420
419
  }
@@ -435,6 +434,7 @@ export default defineComponent({
435
434
  line-height: 16px;
436
435
  color: var(--dl-tooltip-color);
437
436
  background: var(--dl-tooltip-background);
437
+ border: var(--dl-tooltip-border);
438
438
  border-radius: 2px;
439
439
  text-transform: none;
440
440
  font-family: 'Roboto', sans-serif;
@@ -7,6 +7,8 @@
7
7
  &__content {
8
8
  outline: none;
9
9
  contain: content;
10
+ position: relative;
11
+ z-index: 90;
10
12
 
11
13
  & > * {
12
14
  overflow-anchor: none;
@@ -126,23 +126,29 @@ function addStickyPosition(
126
126
  element: HTMLElement,
127
127
  position: TableStickyPosition,
128
128
  index: number,
129
- totalElements: number
129
+ totalElements: number,
130
+ hasEditableColumns?: boolean
130
131
  ) {
131
132
  if (position === 'both')
132
133
  position =
133
134
  index === 0 ? 'first' : index === totalElements - 1 ? 'last' : ''
134
135
  element.style.left = position === 'first' ? '0' : ''
135
- element.style.right = position === 'last' ? '0' : ''
136
+ if (position === 'last') {
137
+ if (hasEditableColumns) {
138
+ element.style.right = '20px'
139
+ } else {
140
+ element.style.right = '0'
141
+ }
142
+ }
136
143
  }
137
144
 
138
145
  export function setAllColumnWidths(
139
146
  table: HTMLElement,
140
147
  columns: DlTableColumn[],
141
148
  stickyColumns: TableStickyPosition,
142
- fitAllColumns: boolean
149
+ fitAllColumns: boolean,
150
+ hasEditableColumns?: boolean
143
151
  ) {
144
- const hasWidth = columns.some((col) => col.hasOwnProperty('width'))
145
- if (!hasWidth) return
146
152
  columns.forEach((col, i) => {
147
153
  browseNestedNodes(
148
154
  table,
@@ -153,12 +159,11 @@ export function setAllColumnWidths(
153
159
  if (!fitAllColumns && targetEl.tagName === 'TH') {
154
160
  // Calculate the width for the column
155
161
  const width =
156
- (col.width ??
157
- targetEl.querySelector('.inner-th').scrollWidth) +
162
+ targetEl.querySelector('.inner-th').scrollWidth +
158
163
  getIconWidth(targetEl) +
159
164
  35
160
165
  // Set the width of the column
161
- targetEl.style.width =
166
+ targetEl.style.minWidth =
162
167
  typeof col.width === 'number' || !col.width
163
168
  ? `${width}px`
164
169
  : col.width
@@ -177,7 +182,8 @@ export function setAllColumnWidths(
177
182
  targetEl,
178
183
  stickyColumns,
179
184
  i,
180
- columns.length
185
+ columns.length,
186
+ hasEditableColumns
181
187
  )
182
188
  }
183
189
  }