@dataloop-ai/components 0.18.72 → 0.18.74

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.18.72",
3
+ "version": "0.18.74",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -61,7 +61,7 @@
61
61
  ? 'var(--dl-color-disabled)'
62
62
  : outlined && !textColor
63
63
  ? 'var(--dl-color-secondary)'
64
- : textColor || 'var(--dl-color-white)'
64
+ : computedTextColor || 'var(--dl-color-white)'
65
65
  }`"
66
66
  />
67
67
  <dl-icon
@@ -174,10 +174,12 @@ import {
174
174
  onMounted,
175
175
  getCurrentInstance,
176
176
  Ref,
177
- PropType
177
+ PropType,
178
+ toRefs
178
179
  } from 'vue-demi'
179
180
  import { v4 } from 'uuid'
180
181
  import { DlTextTransformOptions } from '../../shared/types'
182
+ import { getColor } from '../../../utils'
181
183
 
182
184
  export default defineComponent({
183
185
  name: 'DlDropdownButton',
@@ -258,6 +260,7 @@ export default defineComponent({
258
260
  setup(props, { emit }) {
259
261
  const vm = getCurrentInstance()
260
262
  const proxy = vm!.proxy!
263
+ const { textColor } = toRefs(props)
261
264
 
262
265
  const showing = ref<boolean>(!!props.modelValue) as Ref<boolean>
263
266
  const menuRef = ref(null)
@@ -416,6 +419,8 @@ export default defineComponent({
416
419
  return 'dl-color-white'
417
420
  })
418
421
 
422
+ const computedTextColor = computed(() => getColor(textColor.value))
423
+
419
424
  return {
420
425
  uuid: `dl-dropdown-button-${v4()}`,
421
426
  identifierClass,
@@ -438,7 +443,8 @@ export default defineComponent({
438
443
  setHighlightedIndex,
439
444
  handleSelectedItem,
440
445
  cssVars,
441
- getIconColor
446
+ getIconColor,
447
+ computedTextColor
442
448
  }
443
449
  }
444
450
  })
@@ -433,29 +433,32 @@
433
433
  />
434
434
  </slot>
435
435
  </td>
436
- <slot
436
+ <DlTd
437
437
  v-for="col in computedCols"
438
- v-bind="
439
- getBodyCellScope({
440
- key: getRowKey(row),
441
- row,
442
- pageIndex,
443
- col
444
- })
445
- "
446
- :name="
447
- hasSlotByName(`body-cell-${col.name}`)
448
- ? `body-cell-${col.name}`
449
- : 'body-cell'
450
- "
438
+ :key="col.name"
439
+ :class="col.tdClass(row)"
440
+ :style="col.tdStyle(row)"
451
441
  >
452
- <DlTd
453
- :class="col.tdClass(row)"
454
- :style="col.tdStyle(row)"
442
+ <slot
443
+ v-bind="
444
+ getBodyCellScope({
445
+ key: getRowKey(row),
446
+ row,
447
+ pageIndex,
448
+ col
449
+ })
450
+ "
451
+ :name="
452
+ hasSlotByName(
453
+ `body-cell-${col.name}`
454
+ )
455
+ ? `body-cell-${col.name}`
456
+ : 'body-cell'
457
+ "
455
458
  >
456
459
  {{ getCellValue(col, row) }}
457
- </DlTd>
458
- </slot>
460
+ </slot>
461
+ </DlTd>
459
462
  </DlTr>
460
463
  </slot>
461
464
  </slot>
@@ -333,6 +333,29 @@
333
333
  </dl-dropdown-button>
334
334
  </div>
335
335
  </div>
336
+
337
+ <div style="margin-top: 20px; display: flex; flex-direction: column">
338
+ Button with text color with split
339
+ <dl-dropdown-button
340
+ auto-close
341
+ split
342
+ outlined
343
+ text-color="red"
344
+ :label="outlinedLabel"
345
+ @handleSelectedItem="handleOutlinedSelect"
346
+ >
347
+ <dl-list>
348
+ <dl-list-item
349
+ v-for="val in ['Photos', 'Videos', 'Articles']"
350
+ :key="val"
351
+ clickable
352
+ @click="handleOutlinedSelect(val)"
353
+ >
354
+ <dl-item-section> {{ val }} </dl-item-section>
355
+ </dl-list-item>
356
+ </dl-list>
357
+ </dl-dropdown-button>
358
+ </div>
336
359
  </div>
337
360
  </template>
338
361
 
@@ -432,6 +432,18 @@
432
432
  title="Table Title"
433
433
  />
434
434
  </div>
435
+ <div>
436
+ <p>Custom body cell</p>
437
+ <DlTable
438
+ :rows="tableRows"
439
+ :columns="tableColumns"
440
+ title="Custom Cells"
441
+ >
442
+ <template #body-cell-name="{ row }">
443
+ {{ row.name }}
444
+ </template>
445
+ </DlTable>
446
+ </div>
435
447
  </div>
436
448
  </div>
437
449
  </template>