Skip to content

Commit 5c7f029

Browse files
committed
Merge branch 'master' into dev
2 parents e6a1710 + 02880f9 commit 5c7f029

File tree

17 files changed

+123
-87
lines changed

17 files changed

+123
-87
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
},
1515
"npmClient": "pnpm",
1616
"version": "3.9.0-beta.0"
17-
}
17+
}

packages/docs/auto-imports.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ declare global {
169169
// for type re-export
170170
declare global {
171171
// @ts-ignore
172-
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
172+
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
173173
import('vue')
174174
// @ts-ignore
175175
export type { Category } from './src/stores/app'

packages/docs/src/components/PageFeatures.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
</page-feature-chip>
9191

9292
<div
93-
v-if="isClipboardSupported"
93+
v-if="isClipboardSupported && !isGeneratedPage"
9494
class="d-inline-block"
9595
v-tooltip:top="{
9696
disabled: one.isSubscriber,

packages/docs/src/composables/markdown.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
import octokit from '@/plugins/octokit'
2+
13
export function useMarkdown () {
24
const one = useOneStore()
35
const route = useRoute()
46
const frontmatter = useFrontmatter()
57
const copied = shallowRef(false)
68
const isClipboardSupported = !!navigator.clipboard
79

10+
const branch = getBranch()
11+
812
async function copyPageAsMarkdown () {
913
if (!isClipboardSupported) {
1014
console.error('Native Clipboard API is not supported.')
@@ -20,22 +24,29 @@ export function useMarkdown () {
2024
markdownContent += `Source: ${window.location.origin}${route.path}\\n\\n`
2125

2226
try {
23-
const mdPath = `/src/pages${route.path.replace(/\/$/, '')}.md`
24-
const response = await fetch(mdPath)
25-
if (response.ok) {
26-
const rawMd = await response.text()
27+
const path = `packages/docs/src/pages${route.path.replace(/\/$/, '')}.md`
28+
29+
const response = await octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
30+
owner: 'vuetifyjs',
31+
repo: 'vuetify',
32+
path,
33+
ref: branch,
34+
})
35+
36+
if (response.data && 'content' in response.data) {
37+
const rawMd = atob(response.data.content)
2738
const contentWithoutFrontmatter = rawMd.replace(/---[\\s\\S]*?---/, '').trim()
2839
markdownContent += contentWithoutFrontmatter
2940
} else {
3041
markdownContent += 'Could not fetch page content.'
3142
}
3243
} catch (error) {
33-
console.error('Error fetching page content:', error)
44+
console.error('Error fetching page content from GitHub:', error)
3445
markdownContent += 'Error fetching page content.'
3546
}
3647

3748
try {
38-
await navigator.clipboard.writeText(markdownContent)
49+
navigator.clipboard.writeText(markdownContent)
3950
copied.value = true
4051
setTimeout(() => (copied.value = false), 2000)
4152
} catch (err) {

packages/docs/src/examples/v-combobox/misc-advanced.vue

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
</template>
7373

7474
<script setup>
75-
import { onMounted, ref, watch } from 'vue'
75+
import { ref, watch } from 'vue'
7676
7777
const colors = ['green', 'purple', 'indigo', 'cyan', 'teal', 'orange']
7878
const editingItem = ref(null)
@@ -81,31 +81,34 @@
8181
{ title: 'Foo', color: 'blue' },
8282
{ title: 'Bar', color: 'red' },
8383
])
84-
const nonce = ref(1)
85-
const model = ref([])
84+
const model = ref([
85+
{ title: 'Foo', color: 'blue' },
86+
])
8687
const search = ref(null)
8788
88-
onMounted(() => {
89-
model.value.push(items.value[1])
90-
})
91-
92-
watch(model, (val, prev) => {
93-
if (val.length === prev.length) return
94-
95-
model.value = val.map(v => {
89+
let nonce = 1
90+
watch(model, val => {
91+
const newValue = []
92+
let changed = false
93+
for (const v of val) {
9694
if (typeof v === 'string') {
97-
v = {
95+
changed = true
96+
const item = {
9897
title: v,
99-
color: colors[nonce.value - 1],
98+
color: colors[nonce],
10099
}
101100
102-
items.value.push(v)
101+
newValue.push(item)
102+
items.value.push(item)
103103
104-
nonce.value++
104+
nonce = (nonce + 1) % colors.length
105+
} else {
106+
newValue.push(v)
105107
}
106-
107-
return v
108-
})
108+
}
109+
if (changed) {
110+
model.value = newValue
111+
}
109112
})
110113
111114
function edit (item) {
@@ -155,35 +158,38 @@
155158
},
156159
],
157160
nonce: 1,
158-
model: [],
161+
model: [
162+
{ title: 'Foo', color: 'blue' },
163+
],
159164
search: null,
160165
}),
161166
162167
watch: {
163-
model (val, prev) {
164-
if (val.length === prev.length) return
165-
166-
this.model = val.map(v => {
168+
model (val) {
169+
const newValue = []
170+
let changed = false
171+
for (const v of val) {
167172
if (typeof v === 'string') {
168-
v = {
173+
changed = true
174+
const item = {
169175
title: v,
170-
color: this.colors[this.nonce - 1],
176+
color: this.colors[this.nonce],
171177
}
172178
173-
this.items.push(v)
179+
newValue.push(item)
180+
this.items.push(item)
174181
175-
this.nonce++
182+
this.nonce = (this.nonce + 1) % this.colors.length
183+
} else {
184+
newValue.push(v)
176185
}
177-
178-
return v
179-
})
186+
}
187+
if (changed) {
188+
this.model = newValue
189+
}
180190
},
181191
},
182192
183-
mounted () {
184-
this.model = [this.items[1]]
185-
},
186-
187193
methods: {
188194
edit (item) {
189195
if (!this.editingItem) {

packages/docs/src/pages/en/getting-started/contributing.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ All api descriptions are managed via the api-generator package. This package mus
135135
- Put keys in alphabetical order.
136136
- Descriptions utilize a hierarchy of `generic.json` < `Source.json` < `Component.json` to reduce duplication. Source can be viewed using the **Developer Mode** in docs settings.
137137

138+
#### Adding API Documentation
139+
140+
When creating a new component (or composable, though this is typically done by the Vuetify team), you need to add a corresponding JSON file named `ComponentName.json` in `packages/api-generator/src/locale/en/`. This file should contain descriptions for props, slots, events, and exposed methods. After adding or updating JSON files, run `pnpm build api` to regenerate the dist language files. Keep in mind:
141+
142+
- Changes to Vuetify require a rebuild before building the API
143+
- The API must be built before running the documentation server
144+
145+
Enabling **developer mode** in the documentation settings will allow you to see the source of truth on API description pages.
146+
138147
### Submitting Changes / Pull Requests
139148

140149
First you should create a fork of the vuetify repository to push your changes to. Information on forking repositories can be found in the [GitHub documentation](https://help.github.com/en/github/getting-started-with-github/fork-a-repo).

packages/vuetify/src/components/VBtn/VBtn.sass

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@use 'sass:math'
22
@use 'sass:map'
3+
@use 'sass:meta'
34
@use '../../styles/settings'
45
@use '../../styles/tools'
56
@use './mixins' as *
@@ -30,7 +31,8 @@
3031
flex-shrink: 0
3132

3233
.v-locale--is-rtl &
33-
text-indent: -1 * $button-text-letter-spacing
34+
@if meta.type-of($button-text-letter-spacing) == 'number'
35+
text-indent: -1 * $button-text-letter-spacing
3436

3537
@at-root
3638
@include button-sizes()

packages/vuetify/src/components/VCarousel/VCarousel.sass

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
// Element
4444
.v-carousel__progress
4545
margin: 0
46-
position: absolute
4746
bottom: 0
4847
left: 0
4948
right: 0

packages/vuetify/src/components/VCarousel/VCarousel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export const VCarousel = genericComponent<new <T>(
172172

173173
{ props.progress && (
174174
<VProgressLinear
175+
absolute
175176
class="v-carousel__progress"
176177
color={ typeof props.progress === 'string' ? props.progress : undefined }
177178
modelValue={ (group.getItemIndex(model.value) + 1) / group.items.value.length * 100 }

packages/vuetify/src/components/VDatePicker/VDatePickerMonth.sass

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,18 @@
1010
--v-date-picker-month-day-diff: 4px
1111

1212
.v-date-picker-month__weeks
13-
display: grid
14-
grid-template-rows: min-content min-content min-content min-content min-content min-content min-content
13+
display: flex
14+
flex-direction: column
1515
column-gap: $date-picker-month-column-gap
1616
font-size: $date-picker-month-font-size
1717

18-
+ .v-date-picker-month__days
19-
grid-row-gap: 0
20-
2118
.v-date-picker-month__weekday
2219
font-size: $date-picker-month-font-size
2320

2421
.v-date-picker-month__days
2522
display: grid
26-
grid-template-columns: min-content min-content min-content min-content min-content min-content min-content
23+
grid-template-columns: repeat(var(--v-date-picker-days-in-week), min-content)
2724
column-gap: $date-picker-month-column-gap
28-
flex: 1 1
29-
justify-content: space-around
3025

3126
.v-date-picker-month__day
3227
align-items: center

0 commit comments

Comments
 (0)