@dataloop-ai/components 0.16.38 → 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.38",
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>
@@ -617,6 +618,7 @@ export default defineComponent({
617
618
  'row-reorder',
618
619
  'col-reorder',
619
620
  'row-click',
621
+ 'th-click',
620
622
  'row-dblclick',
621
623
  'row-contextmenu',
622
624
  ...useTableRowExpandEmits,
@@ -1120,6 +1122,10 @@ export default defineComponent({
1120
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