Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VListGroup): support return-object #20595

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
3 changes: 2 additions & 1 deletion packages/api-generator/src/locale/en/VDataTableHeaders.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"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."
"sticky": "Deprecated, use `fixed-header` instead.",
"fixedHeader": "Sticks the header to the top of the table."
},
"slots": {
"[`column.${string}`]": "Slot for custom rendering of a column.",
Expand Down
1 change: 1 addition & 0 deletions packages/api-generator/src/locale/en/VListGroup.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"group": "Assign a route namespace. Accepts a string or regexp for determining active state.",
"noAction": "Removes left padding assigned for action icons from group items.",
"prependIcon": "Prepends an icon to the component, uses the same syntax as `v-icon`.",
"rawId": "Defines the root element's id attribute in the component. If it is provided, the id attribute will be dynamically generated in the format: \"v-list-group--id-[rawId]\".",
"subgroup": "Designate the component as nested list group.",
"value": "Expands / Collapse the list-group.",
"fluid": "Removes the left padding assigned for action icons from group items."
Expand Down
9 changes: 0 additions & 9 deletions packages/docs/src/components/about/TeamMember.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,6 @@
const links = computed(() => {
const links = []

if (props.member.twitter) {
links.push({
color: '#212121',
href: `https://x.com/${props.member.twitter}`,
icon: '$x',
tooltip: 'Xitter',
})
}

if (props.member.github) {
links.push({
color: '#24292E',
Expand Down
5 changes: 0 additions & 5 deletions packages/docs/src/components/app/bar/EcosystemMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
const { t } = useI18n()
const items = computed(() => ([
{ subheader: t('social') },
{
title: 'X',
href: 'https://x.com/vuetifyjs',
appendIcon: '$x',
},
{
title: 'Discord',
href: 'https://community.vuetifyjs.com/',
Expand Down
5 changes: 0 additions & 5 deletions packages/docs/src/components/home/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@
href: 'https://github.com/vuetifyjs/vuetify',
title: 'github',
},
{
icon: '$x',
href: 'https://x.com/vuetifyjs',
title: 'x',
},
{
icon: 'mdi-discord',
href: 'https://community.vuetifyjs.com',
Expand Down
7 changes: 0 additions & 7 deletions packages/docs/src/data/team.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"location": "Keller, TX, USA",
"name": "John Leider",
"team": "company",
"twitter": "zeroskillz",
"work": "Engineer @ Vuetify",
"joined": "Jun 2016"
},
Expand All @@ -31,7 +30,6 @@
"location": "Keller, TX, USA",
"name": "Heather Leider",
"team": "company",
"twitter": "grneyedgrl01",
"work": "COO @ Vuetify",
"joined": "Nov 2019"
},
Expand Down Expand Up @@ -83,7 +81,6 @@
"location": "Rochester, NY, USA",
"name": "Andrew Henry",
"team": "core",
"twitter": "SeeMWhyK",
"joined": "Dec 2018"
},
"blalan05": {
Expand Down Expand Up @@ -127,7 +124,6 @@
],
"location": "Madrid, Spain",
"name": "Joaquín Sánchez",
"twitter": "userquin",
"team": "core",
"joined": "Mar 2024"
},
Expand All @@ -148,7 +144,6 @@
"location": "California, US",
"name": "Ken Kieu",
"team": "core",
"twitter": "kieuminhcanh",
"joined": "April 2024"
},
"MatthewAry": {
Expand All @@ -161,7 +156,6 @@
],
"location": "Spokane, WA, USA",
"name": "Matthew Ary",
"twitter": "MatthewAry",
"linkedin": "matthewary",
"work": "Director of Product Development at Symplsoft Inc.",
"team": "core",
Expand Down Expand Up @@ -244,7 +238,6 @@
"English",
"Persian"
],
"twitter": "yooneskh",
"linkedin": "yooneskh ",
"location": "Iran",
"name": "Yoones Khoshghadam",
Expand Down
1 change: 0 additions & 1 deletion packages/docs/src/examples/v-rating/slot-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<v-icon
:color="props.isFilled ? colors[props.index] : 'grey-lighten-1'"
size="large"
@click="props.onClick"
>
{{ props.isFilled ? 'mdi-star-circle' : 'mdi-star-circle-outline' }}
</v-icon>
Expand Down
4 changes: 1 addition & 3 deletions packages/docs/src/i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@
"translations": "Translations",
"type": "Type | Types",
"types": "Types",
"twitter": "Twitter",
"ui-components": "UI Components",
"ui-kits": "UI Kits",
"ui": "UI",
Expand All @@ -358,6 +357,5 @@
"view-in-github": "View on GitHub",
"view-source": "View source",
"viewport": "Viewport",
"vuetify": "Vuetify",
"x": "Xitter"
"vuetify": "Vuetify"
}
2 changes: 1 addition & 1 deletion packages/docs/src/pages/en/features/dates.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Within your application, import the **useDate** function and use it to access th
const date = useDate()
console.log(date.getMonth(new Date('March 1, 2021'))) // 3
console.log(date.getMonth(new Date('March 1, 2021'))) // 2
</script>
```

Expand Down
1 change: 0 additions & 1 deletion packages/docs/src/stores/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export type Member = {
avatar?: string
github?: string
team: string
twitter?: string
joined?: string
}

Expand Down
1 change: 1 addition & 0 deletions packages/vuetify/src/components/VDataTable/VDataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ export const VDataTable = genericComponent<new <T extends readonly any[], V>(
]}
style={ props.style }
{ ...tableProps }
fixedHeader={ props.fixedHeader || props.sticky }
>
{{
top: () => slots.top?.(slotProps.value),
Expand Down
11 changes: 7 additions & 4 deletions packages/vuetify/src/components/VDataTable/VDataTableHeaders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export type VDataTableHeadersSlots = {

export const makeVDataTableHeadersProps = propsFactory({
color: String,
sticky: Boolean,
disableSort: Boolean,
fixedHeader: Boolean,
multiSort: Boolean,
sortAscIcon: {
type: IconValue,
Expand All @@ -74,6 +74,9 @@ export const makeVDataTableHeadersProps = propsFactory({
type: Object as PropType<Record<string, any>>,
},

/** @deprecated */
sticky: Boolean,

...makeDisplayProps(),
...makeLoaderProps(),
}, 'VDataTableHeaders')
Expand All @@ -91,12 +94,12 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
const { loaderClasses } = useLoader(props)

function getFixedStyles (column: InternalDataTableHeader, y: number): CSSProperties | undefined {
if (!props.sticky && !column.fixed) return undefined
if (!(props.sticky || props.fixedHeader) && !column.fixed) return undefined

return {
position: 'sticky',
left: column.fixed ? convertToUnit(column.fixedOffset) : undefined,
top: props.sticky ? `calc(var(--v-table-header-height) * ${y})` : undefined,
top: (props.sticky || props.fixedHeader) ? `calc(var(--v-table-header-height) * ${y})` : undefined,
}
}

Expand Down Expand Up @@ -127,7 +130,7 @@ export const VDataTableHeaders = genericComponent<VDataTableHeadersSlots>()({
const headerCellClasses = computed(() => ([
'v-data-table__th',
{
'v-data-table__th--sticky': props.sticky,
'v-data-table__th--sticky': (props.sticky || props.fixedHeader),
},
displayClasses.value,
loaderClasses.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export const VDataTableServer = genericComponent<new <T extends readonly any[],
]}
style={ props.style }
{ ...tableProps }
fixedHeader={ props.fixedHeader || props.sticky }
>
{{
top: () => slots.top?.(slotProps.value),
Expand All @@ -170,7 +171,6 @@ export const VDataTableServer = genericComponent<new <T extends readonly any[],
<thead key="thead" class="v-data-table__thead" role="rowgroup">
<VDataTableHeaders
{ ...dataTableHeadersProps }
sticky={ props.fixedHeader }
v-slots={ slots }
/>
</thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export const VDataTableVirtual = genericComponent<new <T extends readonly any[],
]}
style={ props.style }
{ ...tableProps }
fixedHeader={ props.fixedHeader || props.sticky }
>
{{
top: () => slots.top?.(slotProps.value),
Expand All @@ -208,7 +209,6 @@ export const VDataTableVirtual = genericComponent<new <T extends readonly any[],
<thead key="thead">
<VDataTableHeaders
{ ...dataTableHeadersProps }
sticky={ props.fixedHeader }
v-slots={ slots }
/>
</thead>
Expand Down
3 changes: 2 additions & 1 deletion packages/vuetify/src/components/VList/VListChildren.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ export const VListChildren = genericComponent<new <T extends InternalListItem>(

return children ? (
<VListGroup
value={ itemProps?.value }
{ ...listGroupProps }
value={ props.returnObject ? item : itemProps?.value }
rawId={ itemProps?.value }
>
{{
activator: ({ props: activatorProps }) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/vuetify/src/components/VList/VListGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const makeVListGroupProps = propsFactory({
type: IconValue,
default: '$expand',
},
rawId: [String, Number],
prependIcon: IconValue,
appendIcon: IconValue,
fluid: Boolean,
Expand All @@ -61,7 +62,7 @@ export const VListGroup = genericComponent<VListGroupSlots>()({

setup (props, { slots }) {
const { isOpen, open, id: _id } = useNestedItem(toRef(props, 'value'), true)
const id = computed(() => `v-list-group--id-${String(_id.value)}`)
const id = computed(() => `v-list-group--id-${String(props.rawId ?? _id.value)}`)
const list = useList()
const { isBooted } = useSsrBoot()

Expand Down
Loading