Skip to content

Commit

Permalink
fix(VBtn): remove negative prepend/append margin with slim prop
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider authored and webdevnerdstuff committed May 20, 2024
1 parent 8ed8731 commit fc6cd16
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/vuetify/src/components/VBtn/VBtn.sass
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,16 @@
grid-area: prepend
margin-inline: $button-margin-start $button-margin-end

.v-btn--slim &
margin-inline-start: 0

.v-btn__append
grid-area: append
margin-inline: $button-margin-end $button-margin-start

.v-btn--slim &
margin-inline-end: 0

.v-btn__content
grid-area: content
justify-content: center
Expand Down
3 changes: 3 additions & 0 deletions packages/vuetify/src/components/VDataTable/VDataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export const VDataTable = genericComponent<new <T extends readonly any[], V>(
noDataText: toRef(props, 'noDataText'),
loading: toRef(props, 'loading'),
loadingText: toRef(props, 'loadingText'),
mobile: toRef(props, 'mobile'),
},
})

Expand Down Expand Up @@ -258,6 +259,8 @@ export const VDataTable = genericComponent<new <T extends readonly any[], V>(
{ ...attrs }
{ ...dataTableRowsProps }
items={ paginatedItems.value }
mobile={ props.mobile }
mobileBreakpoint={ props.mobileBreakpoint }
v-slots={ slots }
/>
)}
Expand Down
3 changes: 3 additions & 0 deletions packages/vuetify/src/components/VDataTable/VDataTableRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const VDataTableRows = genericComponent<new <T>(
props: makeVDataTableRowsProps(),

setup (props, { attrs, slots }) {
console.log('VDataTableROWSSSSSSSSSS', props)
const { columns } = useHeaders()
const { expandOnClick, toggleExpand, isExpanded } = useExpanded()
const { isSelected, toggleSelect } = useSelection()
Expand Down Expand Up @@ -164,6 +165,8 @@ export const VDataTableRows = genericComponent<new <T>(
{ slots.item ? slots.item(itemSlotProps) : (
<VDataTableRow
{ ...itemSlotProps.props }
mobile={ props.mobile }
mobileBreakpoint={ props.mobileBreakpoint }
v-slots={ slots }
/>
)}
Expand Down
5 changes: 3 additions & 2 deletions packages/vuetify/src/composables/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,15 @@ export function useDisplay (
if (!display) throw new Error('Could not find Vuetify display injection')

const mobile = computed(() => {
if (props.mobile != null) return props.mobile
if (typeof props.mobile === 'boolean' && !props.mobileBreakpoint) return props.mobile

if (!props.mobileBreakpoint) return display.mobile.value

const breakpointValue = typeof props.mobileBreakpoint === 'number'
? props.mobileBreakpoint
: display.thresholds.value[props.mobileBreakpoint]

return display.width.value < breakpointValue
return props.mobile && display.width.value < breakpointValue
})

const displayClasses = computed(() => {
Expand Down

0 comments on commit fc6cd16

Please sign in to comment.