@dataloop-ai/components 0.16.37 → 0.16.39

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.16.37",
3
+ "version": "0.16.39",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -18,24 +18,24 @@
18
18
  <dl-tooltip
19
19
  v-if="!tooltip && overflow && isOverflowing && hasLabel"
20
20
  >
21
- {{ btnLabel }}
21
+ {{ buttonLabel }}
22
22
  </dl-tooltip>
23
- <span class="dl-btn-content dl-anchor--skip">
23
+ <span class="dl-button-content dl-anchor--skip">
24
24
  <dl-icon
25
25
  v-if="hasIcon"
26
26
  :size="iconSizePX"
27
27
  :color="iconColor || textColor"
28
- :class="{ 'dl-btn-icon': hasContent }"
28
+ :class="{ 'dl-button-icon': hasContent }"
29
29
  :icon="icon"
30
30
  :style="cssButtonVars"
31
31
  />
32
32
  <span
33
33
  v-if="hasLabel"
34
- ref="btnLabelRef"
35
- class="dl-btn-label"
34
+ ref="buttonLabelRef"
35
+ class="dl-button-label"
36
36
  :class="{ 'dl-button-no-wrap': noWrap }"
37
37
  >
38
- {{ btnLabel }}
38
+ {{ buttonLabel }}
39
39
  </span>
40
40
  <slot />
41
41
  </span>
@@ -108,12 +108,12 @@ export default defineComponent({
108
108
  },
109
109
  emits: ['click', 'mousedown'],
110
110
  setup() {
111
- const btnLabelRef = ref(null)
112
- const { hasEllipsis } = useSizeObserver(btnLabelRef)
111
+ const buttonLabelRef = ref(null)
112
+ const { hasEllipsis } = useSizeObserver(buttonLabelRef)
113
113
 
114
114
  return {
115
115
  uuid: `dl-button-${v4()}`,
116
- btnLabelRef,
116
+ buttonLabelRef,
117
117
  isOverflowing: hasEllipsis
118
118
  }
119
119
  },
@@ -134,7 +134,7 @@ export default defineComponent({
134
134
  this.label !== ''
135
135
  )
136
136
  },
137
- btnLabel(): string {
137
+ buttonLabel(): string {
138
138
  return textTransform(this.label)
139
139
  },
140
140
  hasIcon(): boolean {
@@ -232,7 +232,7 @@ export default defineComponent({
232
232
  }
233
233
 
234
234
  return {
235
- '--dl-btn-container-width': this.fluid ? '100%' : 'auto',
235
+ '--dl-button-container-width': this.fluid ? '100%' : 'auto',
236
236
  '--dl-button-padding': this.dense
237
237
  ? '0'
238
238
  : this.padding
@@ -326,13 +326,13 @@ export default defineComponent({
326
326
  color: var(--dl-button-text-color-hover);
327
327
  background-color: var(--dl-button-bg-hover);
328
328
  border-color: var(--dl-button-border-hover);
329
- & .dl-btn-label {
329
+ & .dl-button-label {
330
330
  transition: all ease-in 0.15s;
331
331
  color: var(--dl-button-color-hover);
332
332
  }
333
333
  }
334
334
  }
335
- .dl-btn-content {
335
+ .dl-button-content {
336
336
  display: flex;
337
337
  text-align: center;
338
338
  align-items: center;
@@ -346,12 +346,12 @@ export default defineComponent({
346
346
  min-width: 1.5em;
347
347
  }
348
348
 
349
- .dl-btn-icon {
350
- margin-right: 7px;
349
+ .dl-button-icon {
350
+ margin: var(--dl-button-icon-margin, '0px 7px 0px 0px');
351
351
  }
352
352
 
353
353
  .dl-button-container {
354
354
  display: inline-block;
355
- width: var(--dl-btn-container-width);
355
+ width: var(--dl-button-container-width);
356
356
  }
357
357
  </style>
@@ -91,7 +91,7 @@ export default defineComponent({
91
91
  'blur',
92
92
  'clear',
93
93
  'enter',
94
- 'search-btn',
94
+ 'search',
95
95
  'update:model-value'
96
96
  ],
97
97
  data() {
@@ -132,7 +132,7 @@ export default defineComponent({
132
132
  this.$emit('clear', value)
133
133
  },
134
134
  onSearchButtonPress(): void {
135
- this.$emit('search-btn', this.modelValue)
135
+ this.$emit('search', this.modelValue)
136
136
  }
137
137
  }
138
138
  })
@@ -269,7 +269,7 @@
269
269
 
270
270
  <slot
271
271
  v-for="col in computedCols"
272
- v-bind="getHeaderScope({ col })"
272
+ v-bind="getHeaderScope({ col, onThClick })"
273
273
  :name="
274
274
  hasSlotByName(`header-cell-${col.name}`)
275
275
  ? `header-cell-${col.name}`
@@ -279,6 +279,7 @@
279
279
  <DlTh
280
280
  :key="col.name"
281
281
  :props="getHeaderScope({ col })"
282
+ @click="onThClick($event, col.name)"
282
283
  >
283
284
  {{ col.label }}
284
285
  </DlTh>
@@ -408,19 +409,17 @@
408
409
  </div>
409
410
 
410
411
  <div
411
- v-if="hasPaginationSlot"
412
- class="dl-table__control"
413
- >
414
- <slot
415
- v-bind="marginalsScope"
416
- name="pagination"
417
- />
418
- </div>
419
-
420
- <div
421
- v-else-if="!hideBottom || hideNoData"
412
+ v-if="!hideBottom"
422
413
  :class="bottomClasses"
423
414
  >
415
+ <div class="dl-table__control">
416
+ <slot
417
+ v-if="nothingToDisplay && !hideNoData"
418
+ name="no-data"
419
+ >
420
+ {{ bottomMessage }}
421
+ </slot>
422
+ </div>
424
423
  <div class="dl-table__control">
425
424
  <slot
426
425
  name="bottom"
@@ -434,20 +433,21 @@
434
433
  {{ selectedRowsLabel(rowsSelectedNumber) }}
435
434
  </div>
436
435
  </div>
437
- <dl-pagination
438
- v-if="displayPagination"
439
- v-bind="marginalsScope.pagination"
440
- @update:rowsPerPage="
441
- (v) => setPagination({ rowsPerPage: v })
442
- "
443
- @update:modelValue="(v) => setPagination({ page: v })"
444
- />
445
436
 
446
437
  <slot
447
- v-if="nothingToDisplay && !hideNoData"
448
- name="no-data"
438
+ v-bind="marginalsScope"
439
+ name="pagination"
449
440
  >
450
- {{ bottomMessage }}
441
+ <dl-pagination
442
+ v-if="displayPagination"
443
+ v-bind="marginalsScope.pagination"
444
+ @update:rowsPerPage="
445
+ (v) => setPagination({ rowsPerPage: v })
446
+ "
447
+ @update:modelValue="
448
+ (v) => setPagination({ page: v })
449
+ "
450
+ />
451
451
  </slot>
452
452
  </slot>
453
453
  </div>
@@ -618,6 +618,7 @@ export default defineComponent({
618
618
  'row-reorder',
619
619
  'col-reorder',
620
620
  'row-click',
621
+ 'th-click',
621
622
  'row-dblclick',
622
623
  'row-contextmenu',
623
624
  ...useTableRowExpandEmits,
@@ -1118,8 +1119,13 @@ export default defineComponent({
1118
1119
  function onVScroll(info: ScrollDetails) {
1119
1120
  emit('virtual-scroll', info)
1120
1121
  }
1122
+
1121
1123
  //
1122
1124
 
1125
+ const onThClick = (evt: MouseEvent, name: string) => {
1126
+ emit('th-click', evt, computedRows.value, name)
1127
+ }
1128
+
1123
1129
  const onTrClick = (
1124
1130
  evt: MouseEvent,
1125
1131
  row: DlTableRow,
@@ -1271,6 +1277,7 @@ export default defineComponent({
1271
1277
  displayPagination,
1272
1278
  onTrClick,
1273
1279
  onTrDblClick,
1280
+ onThClick,
1274
1281
  onTrContextMenu,
1275
1282
  hasPaginationSlot
1276
1283
  }
@@ -49,8 +49,8 @@ export default defineComponent({
49
49
 
50
50
  const { hasEllipsis } = useSizeObserver(tableTh)
51
51
 
52
- const onClickFn = (event: Event) => {
53
- emit('click', event)
52
+ const onClickFn = (event: Event, name: string) => {
53
+ emit('click', event, name)
54
54
  }
55
55
 
56
56
  const hasOptionalProps = computed(() => {
@@ -98,7 +98,7 @@ export default defineComponent({
98
98
  const sort = props.props?.sort as Function
99
99
  sort(column.value)
100
100
  }
101
- onClickFn(evt)
101
+ onClickFn(evt, column.value.name)
102
102
  }
103
103
 
104
104
  const onClick = !hasOptionalProps.value ? onClickFn : handleClick
@@ -113,6 +113,7 @@
113
113
  style="height: 500px"
114
114
  :rows-per-page-options="rowsPerPageOptions"
115
115
  @row-click="log"
116
+ @th-click="log"
116
117
  @update:selected="updateSeleted"
117
118
  />
118
119
 
@@ -215,6 +216,37 @@
215
216
  />
216
217
  </div>
217
218
  </div>
219
+ <div>
220
+ <p>#no-data & #pagination declare together</p>
221
+ <DlTable
222
+ :selected="selected"
223
+ :separator="separator"
224
+ :columns="columns"
225
+ :bordered="bordered"
226
+ :draggable="draggable"
227
+ :dense="dense"
228
+ class="sticky-header"
229
+ :filter="filter"
230
+ :selection="selection"
231
+ :loading="loading"
232
+ :resizable="resizable"
233
+ row-key="name"
234
+ color="dl-color-secondary"
235
+ title="Table Title"
236
+ :virtual-scroll="vScroll"
237
+ style="height: 200px"
238
+ :rows-per-page-options="rowsPerPageOptions"
239
+ @row-click="log"
240
+ @update:selected="updateSeleted"
241
+ >
242
+ <template #pagination>
243
+ pagination slot, no-data slot should be visible too
244
+ </template>
245
+ <template #no-data>
246
+ no-data slot, pagination slot should be visible too
247
+ </template>
248
+ </DlTable>
249
+ </div>
218
250
  </div>
219
251
  </div>
220
252
  </template>