Skip to content

Commit

Permalink
Merge branch 'master' into fix-19840
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed May 21, 2024
2 parents 0827c76 + 4b387b5 commit b9fb0af
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 21 deletions.
1 change: 0 additions & 1 deletion packages/api-generator/src/locale/en/VDataTableHeader.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"props": {
"disableSort": "Toggles rendering of sort button.",
"everyItem": "Indicates if all items in table are selected.",
"headers": "Array of header items to display.",
"mobile": "Renders mobile view of headers.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"props": {
"disableSort": "Toggles rendering of sort button.",
"sortAscIcon": "Icon used for ascending sort button.",
"sortDescIcon": "Icon used for descending sort button.",
"sticky": "Sticks the header to the top of the table."
Expand Down
1 change: 1 addition & 0 deletions packages/api-generator/src/locale/en/VDataTableServer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"column.data-table-select": "Slot to replace the default `v-simple-checkbox` used when selecting rows.",
"dataTableGroup": "Slot for custom rendering of a group.",
"data-table-select": "Slot for custom rendering of a header cell with the select checkbox.",
"disableSort": "Disables sorting completely.",
"expanded-row": "Slot for custom rendering of an expanded row.",
"footer.prepend": "Adds content to the empty space in the footer.",
"group-header": "Slot for custom rendering of a group header.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"column.data-table-select": "Slot to replace the default `v-simple-checkbox` used when selecting rows.",
"data-table-group": "Slot for custom rendering of a group.",
"data-table-select": "Slot for custom rendering of a header cell with the select checkbox.",
"disableSort": "Disables sorting completely.",
"expanded-row": "Slot for custom rendering of an expanded row.",
"group-header": "Slot for custom rendering of a group header.",
"headers": "Slot to replace the default rendering of the `<thead>` element.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ export const VAutocomplete = genericComponent<new <
onClick={ noop }
aria-label={ t(label.value) }
title={ t(label.value) }
tabindex="-1"
/>
) : undefined }
</>
Expand Down
1 change: 1 addition & 0 deletions packages/vuetify/src/components/VCombobox/VCombobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ export const VCombobox = genericComponent<new <
onClick={ noop }
aria-label={ t(label.value) }
title={ t(label.value) }
tabindex="-1"
/>
) : undefined }
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export type VDataTableHeadersSlots = {
export const makeVDataTableHeadersProps = propsFactory({
color: String,
sticky: Boolean,
disableSort: Boolean,
multiSort: Boolean,
sortAscIcon: {
type: IconValue,
Expand Down Expand Up @@ -142,7 +143,7 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
align={ column.align }
class={[
{
'v-data-table__th--sortable': column.sortable,
'v-data-table__th--sortable': column.sortable && !props.disableSort,
'v-data-table__th--sorted': isSorted(column),
'v-data-table__th--fixed': column.fixed,
},
Expand Down Expand Up @@ -192,7 +193,7 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
return (
<div class="v-data-table-header__content">
<span>{ column.title }</span>
{ column.sortable && (
{ column.sortable && !props.disableSort && (
<VIcon
key="icon"
class="v-data-table-header__sort-icon"
Expand Down Expand Up @@ -223,7 +224,7 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
const headerProps = mergeProps(props.headerProps ?? {} ?? {})

const displayItems = computed<ItemProps['items']>(() => {
return columns.value.filter(column => column?.sortable)
return columns.value.filter(column => column?.sortable && !props.disableSort)
})

const appendIcon = computed(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ export function useSort () {
}

// TODO: abstract into project composable
export function useSortedItems <T extends InternalItem> (
props: { customKeySort: Record<string, DataTableCompareFunction> | undefined },
export function useSortedItems<T extends InternalItem> (
props: {
customKeySort: Record<string, DataTableCompareFunction> | undefined
disableSort?: Boolean
},
items: Ref<T[]>,
sortBy: Ref<readonly SortItem[]>,
options?: {
Expand All @@ -107,7 +110,7 @@ export function useSortedItems <T extends InternalItem> (
) {
const locale = useLocale()
const sortedItems = computed(() => {
if (!sortBy.value.length) return items.value
if (!sortBy.value.length || props.disableSort) return items.value

return sortItems(items.value, sortBy.value, locale.current.value, {
transform: options?.transform,
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VDivider/VDivider.sass
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
align-self: stretch
border-width: $divider-vertical-border-width
display: inline-flex
height: 100%
height: auto
margin-left: $divider-vertical-margin-left
max-height: 100%
max-width: 0px
Expand Down
4 changes: 3 additions & 1 deletion packages/vuetify/src/composables/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export function internalUseDefaults (
if (prop === 'class' || prop === 'style') {
return [componentDefaults.value?.[prop], propValue].filter(v => v != null)
} else if (typeof prop === 'string' && !propIsDefined(vm.vnode, prop)) {
return componentDefaults.value?.[prop] ?? defaults.value?.global?.[prop] ?? propValue
return componentDefaults.value?.[prop] !== undefined ? componentDefaults.value?.[prop]
: defaults.value?.global?.[prop] !== undefined ? defaults.value?.global?.[prop]
: propValue
}
return propValue
},
Expand Down
4 changes: 2 additions & 2 deletions packages/vuetify/src/labs/VCalendar/VCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const VCalendar = genericComponent<VCalendarSlots>()({
}

function onClickToday () {
model.value = [new Date()]
model.value = [adapter.date()]
}

const title = computed(() => {
Expand Down Expand Up @@ -149,7 +149,7 @@ export const VCalendar = genericComponent<VCalendarSlots>()({
!props.hideWeekNumber ? <div class="v-calendar-month__weeknumber">{ weekNumbers.value[wi] }</div> : '',
week.map(day => (
<VCalendarMonthDay
color={ adapter.isSameDay(new Date(), day.date) ? 'primary' : undefined }
color={ adapter.isSameDay(adapter.date(), day.date) ? 'primary' : undefined }
day={ day }
title={ day ? adapter.format(day.date, 'dayOfMonth') : 'NaN' }
events={ props.events?.filter(e => adapter.isSameDay(day.date, e.start) || adapter.isSameDay(day.date, e.end)) }
Expand Down
20 changes: 10 additions & 10 deletions packages/vuetify/src/locale/fa.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default {
badge: 'نشان',
open: 'Open',
open: 'باز کردن',
close: 'بستن',
dismiss: 'Dismiss',
dismiss: 'رد کردن',
confirmEdit: {
ok: 'OK',
ok: 'تایید',
cancel: 'لغو',
},
dataIterator: {
Expand Down Expand Up @@ -33,10 +33,10 @@ export default {
pageText: '{0} تا {1} از {2}',
},
dateRangeInput: {
divider: 'to',
divider: 'تا',
},
datePicker: {
itemsSelected: '{0} selected',
itemsSelected: '{0} انتخاب‌شده',
range: {
title: 'انتخاب تاریخ‌ها',
header: 'تاریخ‌ها را وارد کنید',
Expand All @@ -57,13 +57,13 @@ export default {
},
calendar: {
moreEvents: '{بیشتر {0',
today: 'Today',
today: 'امروز',
},
input: {
clear: 'Clear {0}',
clear: 'پاکسازی {0}',
prependAction: '{0} prepended action',
appendAction: '{0} appended action',
otp: 'Please enter OTP character {0}',
otp: 'لطفا کد را وارد کنید {0}',
},
fileInput: {
counter: '{0} پرونده',
Expand All @@ -72,7 +72,7 @@ export default {
timePicker: {
am: 'قبل از ظهر',
pm: 'بعد از ظهر',
title: 'Select Time',
title: 'انتخاب زمان',
},
pagination: {
ariaLabel: {
Expand All @@ -91,7 +91,7 @@ export default {
},
rating: {
ariaLabel: {
item: 'Rating {0} of {1}',
item: 'امتیاز {0} از {1}',
},
},
loading: 'در حال بارگذاری...',
Expand Down
2 changes: 2 additions & 0 deletions packages/vuetify/src/util/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ export function findChildrenWithProvide (

if (Array.isArray(vnode)) {
return vnode.map(child => findChildrenWithProvide(key, child)).flat(1)
} else if (vnode.suspense) {
return findChildrenWithProvide(key, vnode.ssContent!)
} else if (Array.isArray(vnode.children)) {
return vnode.children.map(child => findChildrenWithProvide(key, child)).flat(1)
} else if (vnode.component) {
Expand Down

0 comments on commit b9fb0af

Please sign in to comment.