Skip to content

Commit 731058e

Browse files
committed
Merge branch 'master' of into refactor-VDateInput
2 parents 1bf682c + dd0dc0f commit 731058e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+671
-1115
lines changed

eslint-local-rules.cjs

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ const path = require('node:path')
44
const glob = require('glob')
55

66
module.exports = Object.fromEntries(
7-
glob.sync('./scripts/rules/*', { cwd: __dirname, dotRelative: true }).map(name => (
8-
[path.parse(name).name, require(name).default]
9-
))
7+
glob.sync('./scripts/rules/*', { cwd: __dirname, dotRelative: true }).map(name => {
8+
const modulePath = path.resolve(__dirname, name)
9+
const module = require(modulePath)
10+
return [path.parse(name).name, module.default || module]
11+
})
1012
)

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
}
1414
},
1515
"npmClient": "pnpm",
16-
"version": "3.8.2"
16+
"version": "3.8.3"
1717
}

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"concurrently": "^9.1.2",
4545
"conventional-changelog-cli": "^5.0.0",
4646
"conventional-changelog-vuetify": "^2.0.2",
47-
"conventional-github-releaser": "^3.1.5",
47+
"@vuetify/github-releaser": "^4.0.2",
4848
"cross-spawn": "^7.0.6",
4949
"eslint": "^8.57.0",
5050
"eslint-config-standard": "^17.1.0",
@@ -83,8 +83,7 @@
8383
"pnpm": {
8484
"patchedDependencies": {
8585
86-
"@testing-library/vue": "patches/@testing-library__vue.patch",
87-
"vue-gtag-next": "patches/vue-gtag-next.patch"
86+
"@testing-library/vue": "patches/@testing-library__vue.patch"
8887
},
8988
"overrides": {
9089
"@testing-library/dom": "npm:@vuetify/[email protected]",

packages/api-generator/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@vuetify/api-generator",
33
"type": "module",
4-
"version": "3.8.2",
4+
"version": "3.8.3",
55
"private": true,
66
"description": "",
77
"scripts": {
8-
"build": "node --import tsx --no-warnings src/index.ts",
8+
"build": "node --import tsx src/index.ts",
99
"lint": "eslint --ext .ts,.json src -f codeframe --max-warnings 0",
1010
"lint:fix": "node --run lint -- --fix"
1111
},

packages/api-generator/src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { kebabCase } from './helpers/text'
77
import type { ComponentData, DirectiveData } from './types'
88
import { generateComposableDataFromTypes, generateDirectiveDataFromTypes } from './types'
99
import Piscina from 'piscina'
10-
import { addDescriptions, addDirectiveDescriptions, addPropData, stringifyProps } from './utils'
10+
import { addDescriptions, addDirectiveDescriptions, addPropData, reportMissingDescriptions, stringifyProps } from './utils'
1111
import * as os from 'os'
1212
import { mkdirp } from 'mkdirp'
1313
import { createVeturApi } from './vetur'
@@ -125,6 +125,7 @@ const run = async () => {
125125
}
126126
}
127127

128+
reportMissingDescriptions()
128129
createVeturApi(componentData)
129130
createWebTypesApi(componentData, directives)
130131
await fs.mkdir(path.resolve('../vuetify/dist/json'), { recursive: true })

packages/api-generator/src/locale/en/VDataTableVirtual.json

+3
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@
3838
"update:modelValue": "Emits when the component's model changes.",
3939
"update:options": "Emits when one of the **options** properties is updated.",
4040
"update:sortBy": "Emits when the **sort-by** property of the **options** prop is updated."
41+
},
42+
"exposed": {
43+
"calculateVisibleItems": "Trigger updating the currently rendered items based on scroll position."
4144
}
4245
}

packages/api-generator/src/locale/en/VDateInput.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"props": {
33
"hideActions": "Hide the Cancel and OK buttons, and automatically update the value when a date is selected.",
44
"displayFormat": "The format of the date that is displayed in the input. Can use any format [here](/features/dates/#format-options) or a custom function.",
5-
"location": "Specifies the date picker's location. Can combine by using a space separated string."
5+
"location": "Specifies the date picker's location. Can combine by using a space separated string.",
6+
"updateOn": "Specifies when the text input should update the model value. If empty, the text field will go into read-only state."
67
}
78
}

packages/api-generator/src/locale/en/VField.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
2727
"update:focused": "Emitted when the input is focused or blurred"
2828
},
2929
"slots": {
30-
"append-iInner": "Slot that is appended to the input.",
30+
"append-inner": "Slot that is appended to the input.",
3131
"clear": "Slot for custom clear icon (displayed when the **clearable** prop is equal to true).",
3232
"label": "The default slot of the [v-label](/api/v-label/) or [v-field-label](/api/v-field-label/) component.",
3333
"prepend-inner": "Slot that is prepended to the input."
3434
},
3535
"exposed": {
36-
"controlRef": "Reference to the control element of the field."
36+
"controlRef": "Reference to the control element of the field.",
37+
"fieldIconColor": "The color of the icon."
3738
}
3839
}

packages/api-generator/src/locale/en/VIconBtn.json

+5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
"iconColor": "Explicit color applied to the icon.",
99
"iconSize": "The specific size of the icon, can use named sizes.",
1010
"iconSizes": "An array of tuples that define the icon sizes for each named size.",
11+
"loading": "Displays circular progress bar in place of the icon.",
12+
"readonly": "Puts the button in a readonly state. Cannot be clicked or navigated to by keyboard.",
1113
"rotate": "The rotation of the icon in degrees.",
1214
"sizes": "An array of tuples that define the button sizes for each named size."
15+
},
16+
"events": {
17+
"update:active": "Event that is emitted when the active state changes."
1318
}
1419
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"props": {
33
"locationStrategy": "A function used to specifies how the component should position relative to its activator.",
4-
"offset": "A single value that offsets content away from the target based upon what side it is on."
4+
"offset": "Increases distance from the target. When passed as a pair of numbers, the second value shifts anchor along the side and away from the target."
55
}
66
}

packages/api-generator/src/utils.ts

+34
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,31 @@ async function loadLocale (componentName: string, locale: string): Promise<Recor
125125

126126
const currentBranch = execSync('git branch --show-current', { encoding: 'utf-8' }).trim()
127127

128+
type MissingDescription = {
129+
name: string
130+
section: string
131+
key: string
132+
locale: string
133+
}
134+
135+
const missingDescriptions: MissingDescription[] = []
136+
137+
export function reportMissingDescriptions () {
138+
if (!missingDescriptions.length) return
139+
140+
const red = '\x1b[31m'
141+
const reset = '\x1b[0m'
142+
const space = '\x20'
143+
144+
console.warn(`\n${red}Missing API Descriptions:${reset}`)
145+
missingDescriptions.forEach(({ name, section, key, locale }) => {
146+
console.warn(`${red}- ${name} (${locale}): [${section}]${space + key + reset}`)
147+
})
148+
149+
// Clear missing descriptions in case of multiple runs
150+
missingDescriptions.length = 0
151+
}
152+
128153
async function getSources (name: string, locale: string, sources: string[]) {
129154
const arr = await Promise.all([
130155
loadLocale(name, locale),
@@ -144,6 +169,15 @@ async function getSources (name: string, locale: string, sources: string[]) {
144169
return { text: found, source: sourcesMap[i] }
145170
}
146171
}
172+
173+
// Collect missing descriptions
174+
missingDescriptions.push({
175+
name,
176+
section,
177+
key: key || '',
178+
locale,
179+
})
180+
147181
const githubUrl = `https://github.com/vuetifyjs/vuetify/tree/${currentBranch}/packages/api-generator/src/locale/${locale}/${ogSource}.json`
148182
return { text: `MISSING DESCRIPTION ([edit in github](${githubUrl}))`, source: name }
149183
},

packages/api-generator/templates/component.d.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,15 @@ type ExtractExposed<T> = T extends ComponentOptionsBase<any, infer B, any, any,
5555

5656
type Pretty<T> = { [K in keyof T]: UnwrapRef<T[K]> }
5757

58-
export type ComponentExposed = Pretty<UnionToIntersection<ExtractExposed<__component__['$options']>>>
58+
// Filter out HTMLInputElement props from exposed
59+
type CleanHTMLInputElement<T> = {
60+
// If key is in HTMLInputElement
61+
[K in keyof T as K extends keyof HTMLInputElement
62+
? // If value is the same type in HTMLInputElement
63+
T[K] extends HTMLInputElement[K]
64+
? never
65+
: K
66+
: K]: T[K];
67+
};
68+
69+
export type ComponentExposed = Pretty<CleanHTMLInputElement<UnionToIntersection<ExtractExposed<__component__['$options']>>>>

packages/docs/auto-imports.d.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ declare global {
103103
const shallowRef: typeof import('vue')['shallowRef']
104104
const storeToRefs: typeof import('pinia')['storeToRefs']
105105
const stripLinks: typeof import('./src/utils/api')['stripLinks']
106+
const sweClick: typeof import('./src/utils/analytics')['sweClick']
106107
const toRaw: typeof import('vue')['toRaw']
107108
const toRef: typeof import('vue')['toRef']
108109
const toRefs: typeof import('vue')['toRefs']
@@ -124,7 +125,6 @@ declare global {
124125
const useDisplay: typeof import('vuetify')['useDisplay']
125126
const useFrontmatter: typeof import('./src/composables/frontmatter')['useFrontmatter']
126127
const useGoTo: typeof import('vuetify')['useGoTo']
127-
const useGtag: typeof import('vue-gtag-next')['useGtag']
128128
const useHttpStore: typeof import('@vuetify/one')['useHttpStore']
129129
const useI18n: typeof import('vue-i18n')['useI18n']
130130
const useId: typeof import('vue')['useId']
@@ -230,7 +230,6 @@ declare module 'vue' {
230230
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
231231
readonly getDistance: UnwrapRef<typeof import('./src/utils/helpers')['getDistance']>
232232
readonly getMatchMedia: UnwrapRef<typeof import('./src/utils/helpers')['getMatchMedia']>
233-
readonly gtagClick: UnwrapRef<typeof import('./src/utils/analytics')['gtagClick']>
234233
readonly h: UnwrapRef<typeof import('vue')['h']>
235234
readonly inject: UnwrapRef<typeof import('vue')['inject']>
236235
readonly insertLinks: UnwrapRef<typeof import('./src/utils/api')['insertLinks']>
@@ -285,6 +284,7 @@ declare module 'vue' {
285284
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
286285
readonly storeToRefs: UnwrapRef<typeof import('pinia')['storeToRefs']>
287286
readonly stripLinks: UnwrapRef<typeof import('./src/utils/api')['stripLinks']>
287+
readonly sweClick: UnwrapRef<typeof import('./src/utils/analytics')['sweClick']>
288288
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
289289
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
290290
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
@@ -306,7 +306,6 @@ declare module 'vue' {
306306
readonly useDisplay: UnwrapRef<typeof import('vuetify')['useDisplay']>
307307
readonly useFrontmatter: UnwrapRef<typeof import('./src/composables/frontmatter')['useFrontmatter']>
308308
readonly useGoTo: UnwrapRef<typeof import('vuetify')['useGoTo']>
309-
readonly useGtag: UnwrapRef<typeof import('vue-gtag-next')['useGtag']>
310309
readonly useHttpStore: UnwrapRef<typeof import('@vuetify/one')['useHttpStore']>
311310
readonly useI18n: UnwrapRef<typeof import('vue-i18n')['useI18n']>
312311
readonly useId: UnwrapRef<typeof import('vue')['useId']>
@@ -343,4 +342,4 @@ declare module 'vue' {
343342
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
344343
readonly wrapInArray: UnwrapRef<typeof import('./src/utils/helpers')['wrapInArray']>
345344
}
346-
}
345+
}

packages/docs/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"description": "A Vue.js project",
55
"private": true,
66
"author": "John Leider <[email protected]>",
7-
"version": "3.8.2",
7+
"version": "3.8.3",
88
"repository": {
99
"type": "git",
1010
"url": "git+https://github.com/vuetifyjs/vuetify.git",
1111
"directory": "packages/docs"
1212
},
1313
"scripts": {
14-
"dev": "vite",
14+
"dev": "vite --force",
1515
"build": "vite build",
1616
"preview": "vite preview",
1717
"preview-https": "HTTPS=true vite preview",
@@ -26,7 +26,7 @@
2626
"@vue/compiler-dom": "^3.5.13",
2727
"@vuelidate/core": "^2.0.3",
2828
"@vuelidate/validators": "^2.0.4",
29-
"@vuetify/one": "^2.1.2",
29+
"@vuetify/one": "^2.2.0",
3030
"algoliasearch": "^4.24.0",
3131
"fflate": "^0.8.2",
3232
"isomorphic-fetch": "^3.0.0",
@@ -38,7 +38,6 @@
3838
"swetrix": "^3.6.1",
3939
"vee-validate": "^4.15.0",
4040
"vue": "^3.5.13",
41-
"vue-gtag-next": "^1.14.0",
4241
"vue-i18n": "^11.1.1",
4342
"vue-instantsearch": "^4.20.6",
4443
"vue-router": "^4.5.0",

packages/docs/src/components/api/Section.vue

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
<template>
2-
<div v-if="items?.length" class="mb-4">
3-
<!-- <div class="d-flex mb-2">
4-
<AppTextField
5-
clearable
6-
icon="$mdiMagnify"
7-
label="Filter"
8-
@input="filter = $event"
9-
/>
10-
</div> -->
2+
<section v-if="items?.length" :id="section" class="mb-4">
113
<AppHeadline :path="`api-headers.${section}`" />
124
<TableComponent :items="items" :name="name" />
13-
</div>
5+
</section>
146
</template>
157

168
<script setup lang="ts">

packages/docs/src/components/api/View.vue

+30
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
const sections = ['props', 'events', 'slots', 'exposed', 'sass', 'argument', 'modifiers', 'value'] as const
99
1010
const route = useRoute()
11+
const router = useRouter()
1112
1213
const error = shallowRef(false)
1314
const name = computed(() => {
@@ -17,11 +18,40 @@
1718
else return `${name.charAt(0).toUpperCase()}${camelize(name.slice(1))}`
1819
})
1920
const component = shallowRef<any>({})
21+
22+
function generateToc () {
23+
const toc = []
24+
for (const section of sections) {
25+
if (section in component.value && Object.keys(component.value[section]).length) {
26+
toc.push({
27+
to: `#${section}`,
28+
text: section.charAt(0).toUpperCase() + section.slice(1),
29+
level: 2,
30+
})
31+
}
32+
}
33+
return toc
34+
}
35+
36+
function updateFrontmatter () {
37+
const matched = router.currentRoute.value.matched
38+
if (matched.length > 0) {
39+
const lastMatch = matched[matched.length - 1]
40+
if (lastMatch.instances.default) {
41+
(lastMatch.instances.default as any).frontmatter = {
42+
...(lastMatch.instances.default as any).frontmatter,
43+
toc: generateToc(),
44+
}
45+
}
46+
}
47+
}
48+
2049
watch(name, async () => {
2150
emit('update:name', name.value)
2251
try {
2352
component.value = await getApi(name.value)
2453
error.value = false
54+
updateFrontmatter()
2555
} catch (err) {
2656
error.value = true
2757
}

packages/docs/src/components/app/Btn.vue

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<v-btn
33
:icon="!!icon"
4+
:size="smAndUp ? 'default' : 'small'"
45
:variant="variant"
56
class="text-body-2 text-capitalize px-3 app-btn"
67
color="medium-emphasis"
@@ -29,5 +30,6 @@
2930
},
3031
})
3132
33+
const { smAndUp } = useDisplay()
3234
const { t } = useI18n()
3335
</script>

packages/docs/src/components/app/Toc.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
:href="spot.spot.href"
111111
rel="noopener noreferrer sponsored"
112112
target="_blank"
113-
@click="gtagClick('toc', 'promotion', spot.spot.sponsor)"
113+
@click="sweClick('toc', 'promotion', spot.spot.sponsor)"
114114
>
115115
<v-img :src="spot.spot.image.url" />
116116
</a>

packages/docs/src/components/app/bar/Bar.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
<AppBarJobsLink v-if="smAndUp" />
4343

44-
<AppBarLanguageMenu v-if="smAndUp" />
44+
<AppBarLanguageMenu />
4545

4646
<AppBarSettingsToggle />
4747
</template>
@@ -50,6 +50,8 @@
5050

5151
<script setup>
5252
const app = useAppStore()
53-
const { smAndUp, mdAndUp, lgAndUp, mdAndDown } = useDisplay()
53+
const { smAndUp, lgAndUp, mdAndDown, width } = useDisplay()
5454
const route = useRoute()
55+
56+
const mdAndUp = computed(() => width.value >= 1044)
5557
</script>

0 commit comments

Comments
 (0)