@vuetify/nightly 3.6.8-master.2024-06-07 → 3.6.8-master.2024-06-11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/json/importMap-labs.json +16 -16
- package/dist/json/importMap.json +132 -132
- package/dist/json/web-types.json +1 -1
- package/dist/vuetify-labs.css +5772 -5772
- package/dist/vuetify-labs.d.ts +143 -144
- package/dist/vuetify-labs.esm.js +3 -3
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +3 -3
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +1041 -1041
- package/dist/vuetify.d.ts +185 -186
- package/dist/vuetify.esm.js +3 -3
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +3 -3
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +3 -3
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.mts +58 -56
- package/lib/blueprints/md1.d.mts +58 -56
- package/lib/blueprints/md2.d.mts +58 -56
- package/lib/blueprints/md3.d.mts +58 -56
- package/lib/composables/goto.mjs.map +1 -1
- package/lib/composables/icons.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +151 -152
- package/lib/labs/VStepperVertical/index.d.mts +3 -3
- package/package.json +1 -1
@@ -1,5 +1,37 @@
|
|
1
1
|
import { Ref, ComponentPublicInstance, JSXComponent, PropType } from 'vue';
|
2
2
|
|
3
|
+
interface LocaleMessages {
|
4
|
+
[key: string]: LocaleMessages | string;
|
5
|
+
}
|
6
|
+
interface LocaleOptions {
|
7
|
+
messages?: LocaleMessages;
|
8
|
+
locale?: string;
|
9
|
+
fallback?: string;
|
10
|
+
adapter?: LocaleInstance;
|
11
|
+
}
|
12
|
+
interface LocaleInstance {
|
13
|
+
name: string;
|
14
|
+
messages: Ref<LocaleMessages>;
|
15
|
+
current: Ref<string>;
|
16
|
+
fallback: Ref<string>;
|
17
|
+
t: (key: string, ...params: unknown[]) => string;
|
18
|
+
n: (value: number) => string;
|
19
|
+
provide: (props: LocaleOptions) => LocaleInstance;
|
20
|
+
}
|
21
|
+
interface RtlOptions {
|
22
|
+
rtl?: Record<string, boolean>;
|
23
|
+
}
|
24
|
+
|
25
|
+
interface InternalGoToOptions {
|
26
|
+
container: ComponentPublicInstance | HTMLElement | string;
|
27
|
+
duration: number;
|
28
|
+
layout: boolean;
|
29
|
+
offset: number;
|
30
|
+
easing: string | ((t: number) => number);
|
31
|
+
patterns: Record<string, (t: number) => number>;
|
32
|
+
}
|
33
|
+
type GoToOptions = Partial<InternalGoToOptions>;
|
34
|
+
|
3
35
|
interface DateAdapter<T = unknown> {
|
4
36
|
date(value?: any): T | null;
|
5
37
|
format(date: T, formatString: string): string;
|
@@ -45,28 +77,6 @@ interface DateAdapter<T = unknown> {
|
|
45
77
|
setMinutes(date: T, minutes: number): T;
|
46
78
|
}
|
47
79
|
|
48
|
-
interface LocaleMessages {
|
49
|
-
[key: string]: LocaleMessages | string;
|
50
|
-
}
|
51
|
-
interface LocaleOptions {
|
52
|
-
messages?: LocaleMessages;
|
53
|
-
locale?: string;
|
54
|
-
fallback?: string;
|
55
|
-
adapter?: LocaleInstance;
|
56
|
-
}
|
57
|
-
interface LocaleInstance {
|
58
|
-
name: string;
|
59
|
-
messages: Ref<LocaleMessages>;
|
60
|
-
current: Ref<string>;
|
61
|
-
fallback: Ref<string>;
|
62
|
-
t: (key: string, ...params: unknown[]) => string;
|
63
|
-
n: (value: number) => string;
|
64
|
-
provide: (props: LocaleOptions) => LocaleInstance;
|
65
|
-
}
|
66
|
-
interface RtlOptions {
|
67
|
-
rtl?: Record<string, boolean>;
|
68
|
-
}
|
69
|
-
|
70
80
|
interface DateInstance extends DateModule.InternalAdapter {
|
71
81
|
locale?: any;
|
72
82
|
}
|
@@ -131,36 +141,6 @@ interface OnColors {
|
|
131
141
|
'on-info': string;
|
132
142
|
}
|
133
143
|
|
134
|
-
declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
135
|
-
type Breakpoint = typeof breakpoints[number];
|
136
|
-
type DisplayBreakpoint = 'xs' | Breakpoint;
|
137
|
-
type DisplayThresholds = {
|
138
|
-
[key in DisplayBreakpoint]: number;
|
139
|
-
};
|
140
|
-
interface DisplayOptions {
|
141
|
-
mobileBreakpoint?: number | DisplayBreakpoint;
|
142
|
-
thresholds?: Partial<DisplayThresholds>;
|
143
|
-
}
|
144
|
-
type SSROptions = boolean | {
|
145
|
-
clientWidth: number;
|
146
|
-
clientHeight?: number;
|
147
|
-
};
|
148
|
-
|
149
|
-
type DefaultsInstance = undefined | {
|
150
|
-
[key: string]: undefined | Record<string, unknown>;
|
151
|
-
global?: Record<string, unknown>;
|
152
|
-
};
|
153
|
-
type DefaultsOptions = Partial<DefaultsInstance>;
|
154
|
-
|
155
|
-
interface GoToOptions {
|
156
|
-
container: ComponentPublicInstance | HTMLElement | string;
|
157
|
-
duration: number;
|
158
|
-
layout: boolean;
|
159
|
-
offset: number;
|
160
|
-
easing: string | ((t: number) => number);
|
161
|
-
patterns: Record<string, (t: number) => number>;
|
162
|
-
}
|
163
|
-
|
164
144
|
type IconValue = string | (string | [path: string, opacity: number])[] | JSXComponent;
|
165
145
|
declare const IconValue: PropType<IconValue>;
|
166
146
|
interface IconAliases {
|
@@ -210,11 +190,33 @@ type IconComponent = JSXComponent<IconProps>;
|
|
210
190
|
interface IconSet {
|
211
191
|
component: IconComponent;
|
212
192
|
}
|
213
|
-
type
|
214
|
-
defaultSet
|
215
|
-
aliases
|
216
|
-
sets
|
193
|
+
type InternalIconOptions = {
|
194
|
+
defaultSet: string;
|
195
|
+
aliases: Partial<IconAliases>;
|
196
|
+
sets: Record<string, IconSet>;
|
217
197
|
};
|
198
|
+
type IconOptions = Partial<InternalIconOptions>;
|
199
|
+
|
200
|
+
declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
201
|
+
type Breakpoint = typeof breakpoints[number];
|
202
|
+
type DisplayBreakpoint = 'xs' | Breakpoint;
|
203
|
+
type DisplayThresholds = {
|
204
|
+
[key in DisplayBreakpoint]: number;
|
205
|
+
};
|
206
|
+
interface DisplayOptions {
|
207
|
+
mobileBreakpoint?: number | DisplayBreakpoint;
|
208
|
+
thresholds?: Partial<DisplayThresholds>;
|
209
|
+
}
|
210
|
+
type SSROptions = boolean | {
|
211
|
+
clientWidth: number;
|
212
|
+
clientHeight?: number;
|
213
|
+
};
|
214
|
+
|
215
|
+
type DefaultsInstance = undefined | {
|
216
|
+
[key: string]: undefined | Record<string, unknown>;
|
217
|
+
global?: Record<string, unknown>;
|
218
|
+
};
|
219
|
+
type DefaultsOptions = Partial<DefaultsInstance>;
|
218
220
|
|
219
221
|
interface VuetifyOptions {
|
220
222
|
aliases?: Record<string, any>;
|
package/lib/blueprints/md1.d.mts
CHANGED
@@ -1,5 +1,37 @@
|
|
1
1
|
import { Ref, ComponentPublicInstance, JSXComponent, PropType } from 'vue';
|
2
2
|
|
3
|
+
interface LocaleMessages {
|
4
|
+
[key: string]: LocaleMessages | string;
|
5
|
+
}
|
6
|
+
interface LocaleOptions {
|
7
|
+
messages?: LocaleMessages;
|
8
|
+
locale?: string;
|
9
|
+
fallback?: string;
|
10
|
+
adapter?: LocaleInstance;
|
11
|
+
}
|
12
|
+
interface LocaleInstance {
|
13
|
+
name: string;
|
14
|
+
messages: Ref<LocaleMessages>;
|
15
|
+
current: Ref<string>;
|
16
|
+
fallback: Ref<string>;
|
17
|
+
t: (key: string, ...params: unknown[]) => string;
|
18
|
+
n: (value: number) => string;
|
19
|
+
provide: (props: LocaleOptions) => LocaleInstance;
|
20
|
+
}
|
21
|
+
interface RtlOptions {
|
22
|
+
rtl?: Record<string, boolean>;
|
23
|
+
}
|
24
|
+
|
25
|
+
interface InternalGoToOptions {
|
26
|
+
container: ComponentPublicInstance | HTMLElement | string;
|
27
|
+
duration: number;
|
28
|
+
layout: boolean;
|
29
|
+
offset: number;
|
30
|
+
easing: string | ((t: number) => number);
|
31
|
+
patterns: Record<string, (t: number) => number>;
|
32
|
+
}
|
33
|
+
type GoToOptions = Partial<InternalGoToOptions>;
|
34
|
+
|
3
35
|
interface DateAdapter<T = unknown> {
|
4
36
|
date(value?: any): T | null;
|
5
37
|
format(date: T, formatString: string): string;
|
@@ -45,28 +77,6 @@ interface DateAdapter<T = unknown> {
|
|
45
77
|
setMinutes(date: T, minutes: number): T;
|
46
78
|
}
|
47
79
|
|
48
|
-
interface LocaleMessages {
|
49
|
-
[key: string]: LocaleMessages | string;
|
50
|
-
}
|
51
|
-
interface LocaleOptions {
|
52
|
-
messages?: LocaleMessages;
|
53
|
-
locale?: string;
|
54
|
-
fallback?: string;
|
55
|
-
adapter?: LocaleInstance;
|
56
|
-
}
|
57
|
-
interface LocaleInstance {
|
58
|
-
name: string;
|
59
|
-
messages: Ref<LocaleMessages>;
|
60
|
-
current: Ref<string>;
|
61
|
-
fallback: Ref<string>;
|
62
|
-
t: (key: string, ...params: unknown[]) => string;
|
63
|
-
n: (value: number) => string;
|
64
|
-
provide: (props: LocaleOptions) => LocaleInstance;
|
65
|
-
}
|
66
|
-
interface RtlOptions {
|
67
|
-
rtl?: Record<string, boolean>;
|
68
|
-
}
|
69
|
-
|
70
80
|
interface DateInstance extends DateModule.InternalAdapter {
|
71
81
|
locale?: any;
|
72
82
|
}
|
@@ -131,36 +141,6 @@ interface OnColors {
|
|
131
141
|
'on-info': string;
|
132
142
|
}
|
133
143
|
|
134
|
-
declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
135
|
-
type Breakpoint = typeof breakpoints[number];
|
136
|
-
type DisplayBreakpoint = 'xs' | Breakpoint;
|
137
|
-
type DisplayThresholds = {
|
138
|
-
[key in DisplayBreakpoint]: number;
|
139
|
-
};
|
140
|
-
interface DisplayOptions {
|
141
|
-
mobileBreakpoint?: number | DisplayBreakpoint;
|
142
|
-
thresholds?: Partial<DisplayThresholds>;
|
143
|
-
}
|
144
|
-
type SSROptions = boolean | {
|
145
|
-
clientWidth: number;
|
146
|
-
clientHeight?: number;
|
147
|
-
};
|
148
|
-
|
149
|
-
type DefaultsInstance = undefined | {
|
150
|
-
[key: string]: undefined | Record<string, unknown>;
|
151
|
-
global?: Record<string, unknown>;
|
152
|
-
};
|
153
|
-
type DefaultsOptions = Partial<DefaultsInstance>;
|
154
|
-
|
155
|
-
interface GoToOptions {
|
156
|
-
container: ComponentPublicInstance | HTMLElement | string;
|
157
|
-
duration: number;
|
158
|
-
layout: boolean;
|
159
|
-
offset: number;
|
160
|
-
easing: string | ((t: number) => number);
|
161
|
-
patterns: Record<string, (t: number) => number>;
|
162
|
-
}
|
163
|
-
|
164
144
|
type IconValue = string | (string | [path: string, opacity: number])[] | JSXComponent;
|
165
145
|
declare const IconValue: PropType<IconValue>;
|
166
146
|
interface IconAliases {
|
@@ -210,11 +190,33 @@ type IconComponent = JSXComponent<IconProps>;
|
|
210
190
|
interface IconSet {
|
211
191
|
component: IconComponent;
|
212
192
|
}
|
213
|
-
type
|
214
|
-
defaultSet
|
215
|
-
aliases
|
216
|
-
sets
|
193
|
+
type InternalIconOptions = {
|
194
|
+
defaultSet: string;
|
195
|
+
aliases: Partial<IconAliases>;
|
196
|
+
sets: Record<string, IconSet>;
|
217
197
|
};
|
198
|
+
type IconOptions = Partial<InternalIconOptions>;
|
199
|
+
|
200
|
+
declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
201
|
+
type Breakpoint = typeof breakpoints[number];
|
202
|
+
type DisplayBreakpoint = 'xs' | Breakpoint;
|
203
|
+
type DisplayThresholds = {
|
204
|
+
[key in DisplayBreakpoint]: number;
|
205
|
+
};
|
206
|
+
interface DisplayOptions {
|
207
|
+
mobileBreakpoint?: number | DisplayBreakpoint;
|
208
|
+
thresholds?: Partial<DisplayThresholds>;
|
209
|
+
}
|
210
|
+
type SSROptions = boolean | {
|
211
|
+
clientWidth: number;
|
212
|
+
clientHeight?: number;
|
213
|
+
};
|
214
|
+
|
215
|
+
type DefaultsInstance = undefined | {
|
216
|
+
[key: string]: undefined | Record<string, unknown>;
|
217
|
+
global?: Record<string, unknown>;
|
218
|
+
};
|
219
|
+
type DefaultsOptions = Partial<DefaultsInstance>;
|
218
220
|
|
219
221
|
interface VuetifyOptions {
|
220
222
|
aliases?: Record<string, any>;
|
package/lib/blueprints/md2.d.mts
CHANGED
@@ -1,5 +1,37 @@
|
|
1
1
|
import { Ref, ComponentPublicInstance, JSXComponent, PropType } from 'vue';
|
2
2
|
|
3
|
+
interface LocaleMessages {
|
4
|
+
[key: string]: LocaleMessages | string;
|
5
|
+
}
|
6
|
+
interface LocaleOptions {
|
7
|
+
messages?: LocaleMessages;
|
8
|
+
locale?: string;
|
9
|
+
fallback?: string;
|
10
|
+
adapter?: LocaleInstance;
|
11
|
+
}
|
12
|
+
interface LocaleInstance {
|
13
|
+
name: string;
|
14
|
+
messages: Ref<LocaleMessages>;
|
15
|
+
current: Ref<string>;
|
16
|
+
fallback: Ref<string>;
|
17
|
+
t: (key: string, ...params: unknown[]) => string;
|
18
|
+
n: (value: number) => string;
|
19
|
+
provide: (props: LocaleOptions) => LocaleInstance;
|
20
|
+
}
|
21
|
+
interface RtlOptions {
|
22
|
+
rtl?: Record<string, boolean>;
|
23
|
+
}
|
24
|
+
|
25
|
+
interface InternalGoToOptions {
|
26
|
+
container: ComponentPublicInstance | HTMLElement | string;
|
27
|
+
duration: number;
|
28
|
+
layout: boolean;
|
29
|
+
offset: number;
|
30
|
+
easing: string | ((t: number) => number);
|
31
|
+
patterns: Record<string, (t: number) => number>;
|
32
|
+
}
|
33
|
+
type GoToOptions = Partial<InternalGoToOptions>;
|
34
|
+
|
3
35
|
interface DateAdapter<T = unknown> {
|
4
36
|
date(value?: any): T | null;
|
5
37
|
format(date: T, formatString: string): string;
|
@@ -45,28 +77,6 @@ interface DateAdapter<T = unknown> {
|
|
45
77
|
setMinutes(date: T, minutes: number): T;
|
46
78
|
}
|
47
79
|
|
48
|
-
interface LocaleMessages {
|
49
|
-
[key: string]: LocaleMessages | string;
|
50
|
-
}
|
51
|
-
interface LocaleOptions {
|
52
|
-
messages?: LocaleMessages;
|
53
|
-
locale?: string;
|
54
|
-
fallback?: string;
|
55
|
-
adapter?: LocaleInstance;
|
56
|
-
}
|
57
|
-
interface LocaleInstance {
|
58
|
-
name: string;
|
59
|
-
messages: Ref<LocaleMessages>;
|
60
|
-
current: Ref<string>;
|
61
|
-
fallback: Ref<string>;
|
62
|
-
t: (key: string, ...params: unknown[]) => string;
|
63
|
-
n: (value: number) => string;
|
64
|
-
provide: (props: LocaleOptions) => LocaleInstance;
|
65
|
-
}
|
66
|
-
interface RtlOptions {
|
67
|
-
rtl?: Record<string, boolean>;
|
68
|
-
}
|
69
|
-
|
70
80
|
interface DateInstance extends DateModule.InternalAdapter {
|
71
81
|
locale?: any;
|
72
82
|
}
|
@@ -131,36 +141,6 @@ interface OnColors {
|
|
131
141
|
'on-info': string;
|
132
142
|
}
|
133
143
|
|
134
|
-
declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
135
|
-
type Breakpoint = typeof breakpoints[number];
|
136
|
-
type DisplayBreakpoint = 'xs' | Breakpoint;
|
137
|
-
type DisplayThresholds = {
|
138
|
-
[key in DisplayBreakpoint]: number;
|
139
|
-
};
|
140
|
-
interface DisplayOptions {
|
141
|
-
mobileBreakpoint?: number | DisplayBreakpoint;
|
142
|
-
thresholds?: Partial<DisplayThresholds>;
|
143
|
-
}
|
144
|
-
type SSROptions = boolean | {
|
145
|
-
clientWidth: number;
|
146
|
-
clientHeight?: number;
|
147
|
-
};
|
148
|
-
|
149
|
-
type DefaultsInstance = undefined | {
|
150
|
-
[key: string]: undefined | Record<string, unknown>;
|
151
|
-
global?: Record<string, unknown>;
|
152
|
-
};
|
153
|
-
type DefaultsOptions = Partial<DefaultsInstance>;
|
154
|
-
|
155
|
-
interface GoToOptions {
|
156
|
-
container: ComponentPublicInstance | HTMLElement | string;
|
157
|
-
duration: number;
|
158
|
-
layout: boolean;
|
159
|
-
offset: number;
|
160
|
-
easing: string | ((t: number) => number);
|
161
|
-
patterns: Record<string, (t: number) => number>;
|
162
|
-
}
|
163
|
-
|
164
144
|
type IconValue = string | (string | [path: string, opacity: number])[] | JSXComponent;
|
165
145
|
declare const IconValue: PropType<IconValue>;
|
166
146
|
interface IconAliases {
|
@@ -210,11 +190,33 @@ type IconComponent = JSXComponent<IconProps>;
|
|
210
190
|
interface IconSet {
|
211
191
|
component: IconComponent;
|
212
192
|
}
|
213
|
-
type
|
214
|
-
defaultSet
|
215
|
-
aliases
|
216
|
-
sets
|
193
|
+
type InternalIconOptions = {
|
194
|
+
defaultSet: string;
|
195
|
+
aliases: Partial<IconAliases>;
|
196
|
+
sets: Record<string, IconSet>;
|
217
197
|
};
|
198
|
+
type IconOptions = Partial<InternalIconOptions>;
|
199
|
+
|
200
|
+
declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
201
|
+
type Breakpoint = typeof breakpoints[number];
|
202
|
+
type DisplayBreakpoint = 'xs' | Breakpoint;
|
203
|
+
type DisplayThresholds = {
|
204
|
+
[key in DisplayBreakpoint]: number;
|
205
|
+
};
|
206
|
+
interface DisplayOptions {
|
207
|
+
mobileBreakpoint?: number | DisplayBreakpoint;
|
208
|
+
thresholds?: Partial<DisplayThresholds>;
|
209
|
+
}
|
210
|
+
type SSROptions = boolean | {
|
211
|
+
clientWidth: number;
|
212
|
+
clientHeight?: number;
|
213
|
+
};
|
214
|
+
|
215
|
+
type DefaultsInstance = undefined | {
|
216
|
+
[key: string]: undefined | Record<string, unknown>;
|
217
|
+
global?: Record<string, unknown>;
|
218
|
+
};
|
219
|
+
type DefaultsOptions = Partial<DefaultsInstance>;
|
218
220
|
|
219
221
|
interface VuetifyOptions {
|
220
222
|
aliases?: Record<string, any>;
|
package/lib/blueprints/md3.d.mts
CHANGED
@@ -1,5 +1,37 @@
|
|
1
1
|
import { Ref, ComponentPublicInstance, JSXComponent, PropType } from 'vue';
|
2
2
|
|
3
|
+
interface LocaleMessages {
|
4
|
+
[key: string]: LocaleMessages | string;
|
5
|
+
}
|
6
|
+
interface LocaleOptions {
|
7
|
+
messages?: LocaleMessages;
|
8
|
+
locale?: string;
|
9
|
+
fallback?: string;
|
10
|
+
adapter?: LocaleInstance;
|
11
|
+
}
|
12
|
+
interface LocaleInstance {
|
13
|
+
name: string;
|
14
|
+
messages: Ref<LocaleMessages>;
|
15
|
+
current: Ref<string>;
|
16
|
+
fallback: Ref<string>;
|
17
|
+
t: (key: string, ...params: unknown[]) => string;
|
18
|
+
n: (value: number) => string;
|
19
|
+
provide: (props: LocaleOptions) => LocaleInstance;
|
20
|
+
}
|
21
|
+
interface RtlOptions {
|
22
|
+
rtl?: Record<string, boolean>;
|
23
|
+
}
|
24
|
+
|
25
|
+
interface InternalGoToOptions {
|
26
|
+
container: ComponentPublicInstance | HTMLElement | string;
|
27
|
+
duration: number;
|
28
|
+
layout: boolean;
|
29
|
+
offset: number;
|
30
|
+
easing: string | ((t: number) => number);
|
31
|
+
patterns: Record<string, (t: number) => number>;
|
32
|
+
}
|
33
|
+
type GoToOptions = Partial<InternalGoToOptions>;
|
34
|
+
|
3
35
|
interface DateAdapter<T = unknown> {
|
4
36
|
date(value?: any): T | null;
|
5
37
|
format(date: T, formatString: string): string;
|
@@ -45,28 +77,6 @@ interface DateAdapter<T = unknown> {
|
|
45
77
|
setMinutes(date: T, minutes: number): T;
|
46
78
|
}
|
47
79
|
|
48
|
-
interface LocaleMessages {
|
49
|
-
[key: string]: LocaleMessages | string;
|
50
|
-
}
|
51
|
-
interface LocaleOptions {
|
52
|
-
messages?: LocaleMessages;
|
53
|
-
locale?: string;
|
54
|
-
fallback?: string;
|
55
|
-
adapter?: LocaleInstance;
|
56
|
-
}
|
57
|
-
interface LocaleInstance {
|
58
|
-
name: string;
|
59
|
-
messages: Ref<LocaleMessages>;
|
60
|
-
current: Ref<string>;
|
61
|
-
fallback: Ref<string>;
|
62
|
-
t: (key: string, ...params: unknown[]) => string;
|
63
|
-
n: (value: number) => string;
|
64
|
-
provide: (props: LocaleOptions) => LocaleInstance;
|
65
|
-
}
|
66
|
-
interface RtlOptions {
|
67
|
-
rtl?: Record<string, boolean>;
|
68
|
-
}
|
69
|
-
|
70
80
|
interface DateInstance extends DateModule.InternalAdapter {
|
71
81
|
locale?: any;
|
72
82
|
}
|
@@ -131,36 +141,6 @@ interface OnColors {
|
|
131
141
|
'on-info': string;
|
132
142
|
}
|
133
143
|
|
134
|
-
declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
135
|
-
type Breakpoint = typeof breakpoints[number];
|
136
|
-
type DisplayBreakpoint = 'xs' | Breakpoint;
|
137
|
-
type DisplayThresholds = {
|
138
|
-
[key in DisplayBreakpoint]: number;
|
139
|
-
};
|
140
|
-
interface DisplayOptions {
|
141
|
-
mobileBreakpoint?: number | DisplayBreakpoint;
|
142
|
-
thresholds?: Partial<DisplayThresholds>;
|
143
|
-
}
|
144
|
-
type SSROptions = boolean | {
|
145
|
-
clientWidth: number;
|
146
|
-
clientHeight?: number;
|
147
|
-
};
|
148
|
-
|
149
|
-
type DefaultsInstance = undefined | {
|
150
|
-
[key: string]: undefined | Record<string, unknown>;
|
151
|
-
global?: Record<string, unknown>;
|
152
|
-
};
|
153
|
-
type DefaultsOptions = Partial<DefaultsInstance>;
|
154
|
-
|
155
|
-
interface GoToOptions {
|
156
|
-
container: ComponentPublicInstance | HTMLElement | string;
|
157
|
-
duration: number;
|
158
|
-
layout: boolean;
|
159
|
-
offset: number;
|
160
|
-
easing: string | ((t: number) => number);
|
161
|
-
patterns: Record<string, (t: number) => number>;
|
162
|
-
}
|
163
|
-
|
164
144
|
type IconValue = string | (string | [path: string, opacity: number])[] | JSXComponent;
|
165
145
|
declare const IconValue: PropType<IconValue>;
|
166
146
|
interface IconAliases {
|
@@ -210,11 +190,33 @@ type IconComponent = JSXComponent<IconProps>;
|
|
210
190
|
interface IconSet {
|
211
191
|
component: IconComponent;
|
212
192
|
}
|
213
|
-
type
|
214
|
-
defaultSet
|
215
|
-
aliases
|
216
|
-
sets
|
193
|
+
type InternalIconOptions = {
|
194
|
+
defaultSet: string;
|
195
|
+
aliases: Partial<IconAliases>;
|
196
|
+
sets: Record<string, IconSet>;
|
217
197
|
};
|
198
|
+
type IconOptions = Partial<InternalIconOptions>;
|
199
|
+
|
200
|
+
declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
201
|
+
type Breakpoint = typeof breakpoints[number];
|
202
|
+
type DisplayBreakpoint = 'xs' | Breakpoint;
|
203
|
+
type DisplayThresholds = {
|
204
|
+
[key in DisplayBreakpoint]: number;
|
205
|
+
};
|
206
|
+
interface DisplayOptions {
|
207
|
+
mobileBreakpoint?: number | DisplayBreakpoint;
|
208
|
+
thresholds?: Partial<DisplayThresholds>;
|
209
|
+
}
|
210
|
+
type SSROptions = boolean | {
|
211
|
+
clientWidth: number;
|
212
|
+
clientHeight?: number;
|
213
|
+
};
|
214
|
+
|
215
|
+
type DefaultsInstance = undefined | {
|
216
|
+
[key: string]: undefined | Record<string, unknown>;
|
217
|
+
global?: Record<string, unknown>;
|
218
|
+
};
|
219
|
+
type DefaultsOptions = Partial<DefaultsInstance>;
|
218
220
|
|
219
221
|
interface VuetifyOptions {
|
220
222
|
aliases?: Record<string, any>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"goto.mjs","names":["computed","inject","useRtl","clamp","consoleWarn","mergeDeep","refElement","GoToSymbol","Symbol","for","genDefaults","container","undefined","duration","layout","offset","easing","patterns","linear","t","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","getContainer","el","getTarget","document","scrollingElement","body","querySelector","getOffset","target","horizontal","rtl","totalOffset","offsetLeft","offsetTop","offsetParent","createGoTo","options","locale","isRtl","scrollTo","_target","_options","goTo","property","value","HTMLElement","parentElement","ease","TypeError","targetLocation","styles","window","getComputedStyle","layoutOffset","getPropertyValue","parseInt","clampTarget","startLocation","Promise","resolve","startTime","performance","now","requestAnimationFrame","step","currentTime","timeElapsed","progress","location","Math","floor","abs","useGoTo","arguments","length","goToInstance","Error","go","scrollWidth","scrollHeight","containerWidth","containerHeight","innerWidth","innerHeight","offsetWidth","offsetHeight","min","max"],"sources":["../../src/composables/goto.ts"],"sourcesContent":["// Utilities\nimport { computed, inject } from 'vue'\nimport { useRtl } from './locale'\nimport { clamp, consoleWarn, mergeDeep, refElement } from '@/util'\n\n// Types\nimport type { ComponentPublicInstance, InjectionKey, Ref } from 'vue'\nimport type { LocaleInstance, RtlInstance } from './locale'\n\nexport interface GoToInstance {\n rtl: Ref<boolean>\n options: GoToOptions\n}\n\nexport interface GoToOptions {\n container: ComponentPublicInstance | HTMLElement | string\n duration: number\n layout: boolean\n offset: number\n easing: string | ((t: number) => number)\n patterns: Record<string, (t: number) => number>\n}\n\nexport const GoToSymbol: InjectionKey<GoToInstance> = Symbol.for('vuetify:goto')\n\nfunction genDefaults () {\n return {\n container: undefined,\n duration: 300,\n layout: false,\n offset: 0,\n easing: 'easeInOutCubic',\n patterns: {\n linear: (t: number) => t,\n easeInQuad: (t: number) => t ** 2,\n easeOutQuad: (t: number) => t * (2 - t),\n easeInOutQuad: (t: number) => (t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t),\n easeInCubic: (t: number) => t ** 3,\n easeOutCubic: (t: number) => --t ** 3 + 1,\n easeInOutCubic: (t: number) => t < 0.5 ? 4 * t ** 3 : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1,\n easeInQuart: (t: number) => t ** 4,\n easeOutQuart: (t: number) => 1 - --t ** 4,\n easeInOutQuart: (t: number) => (t < 0.5 ? 8 * t ** 4 : 1 - 8 * --t ** 4),\n easeInQuint: (t: number) => t ** 5,\n easeOutQuint: (t: number) => 1 + --t ** 5,\n easeInOutQuint: (t: number) => t < 0.5 ? 16 * t ** 5 : 1 + 16 * --t ** 5,\n },\n }\n}\n\nfunction getContainer (el?: ComponentPublicInstance | HTMLElement | string) {\n return getTarget(el) ?? (document.scrollingElement || document.body) as HTMLElement\n}\n\nfunction getTarget (el: ComponentPublicInstance | HTMLElement | string | undefined) {\n return (typeof el === 'string') ? document.querySelector<HTMLElement>(el) : refElement(el)\n}\n\nfunction getOffset (target: any, horizontal?: boolean, rtl?: boolean): number {\n if (typeof target === 'number') return horizontal && rtl ? -target : target\n\n let el = getTarget(target)\n let totalOffset = 0\n while (el) {\n totalOffset += horizontal ? el.offsetLeft : el.offsetTop\n el = el.offsetParent as HTMLElement\n }\n\n return totalOffset\n}\n\nexport function createGoTo (options: Partial<GoToOptions> | undefined, locale: LocaleInstance & RtlInstance) {\n return {\n rtl: locale.isRtl,\n options: mergeDeep(genDefaults(), options),\n }\n}\n\nexport async function scrollTo (\n _target: ComponentPublicInstance | HTMLElement | number | string,\n _options: Partial<GoToOptions>,\n horizontal?: boolean,\n goTo?: GoToInstance,\n) {\n const property = horizontal ? 'scrollLeft' : 'scrollTop'\n const options = mergeDeep(goTo?.options ?? genDefaults(), _options)\n const rtl = goTo?.rtl.value\n const target = (typeof _target === 'number' ? _target : getTarget(_target)) ?? 0\n const container = options.container === 'parent' && target instanceof HTMLElement\n ? target.parentElement!\n : getContainer(options.container)\n const ease = typeof options.easing === 'function' ? options.easing : options.patterns[options.easing]\n\n if (!ease) throw new TypeError(`Easing function \"${options.easing}\" not found.`)\n\n let targetLocation: number\n if (typeof target === 'number') {\n targetLocation = getOffset(target, horizontal, rtl)\n } else {\n targetLocation = getOffset(target, horizontal, rtl) - getOffset(container, horizontal, rtl)\n\n if (options.layout) {\n const styles = window.getComputedStyle(target)\n const layoutOffset = styles.getPropertyValue('--v-layout-top')\n\n if (layoutOffset) targetLocation -= parseInt(layoutOffset, 10)\n }\n }\n\n targetLocation += options.offset\n targetLocation = clampTarget(container, targetLocation, !!rtl, !!horizontal)\n\n const startLocation = container[property] ?? 0\n\n if (targetLocation === startLocation) return Promise.resolve(targetLocation)\n\n const startTime = performance.now()\n\n return new Promise(resolve => requestAnimationFrame(function step (currentTime: number) {\n const timeElapsed = currentTime - startTime\n const progress = timeElapsed / options.duration\n const location = Math.floor(\n startLocation +\n (targetLocation - startLocation) *\n ease(clamp(progress, 0, 1))\n )\n\n container[property] = location\n\n // Allow for some jitter if target time has elapsed\n if (progress >= 1 && Math.abs(location - container[property]) < 10) {\n return resolve(targetLocation)\n } else if (progress > 2) {\n // The target might not be reachable\n consoleWarn('Scroll target is not reachable')\n return resolve(container[property])\n }\n\n requestAnimationFrame(step)\n }))\n}\n\nexport function useGoTo (_options: Partial<GoToOptions> = {}) {\n const goToInstance = inject(GoToSymbol)\n const { isRtl } = useRtl()\n\n if (!goToInstance) throw new Error('[Vuetify] Could not find injected goto instance')\n\n const goTo = {\n ...goToInstance,\n // can be set via VLocaleProvider\n rtl: computed(() => goToInstance.rtl.value || isRtl.value),\n }\n\n async function go (\n target: ComponentPublicInstance | HTMLElement | string | number,\n options?: Partial<GoToOptions>,\n ) {\n return scrollTo(target, mergeDeep(_options, options), false, goTo)\n }\n\n go.horizontal = async (\n target: ComponentPublicInstance | HTMLElement | string | number,\n options?: Partial<GoToOptions>,\n ) => {\n return scrollTo(target, mergeDeep(_options, options), true, goTo)\n }\n\n return go\n}\n\n/**\n * Clamp target value to achieve a smooth scroll animation\n * when the value goes outside the scroll container size\n */\nfunction clampTarget (\n container: HTMLElement,\n value: number,\n rtl: boolean,\n horizontal: boolean,\n) {\n const { scrollWidth, scrollHeight } = container\n const [containerWidth, containerHeight] = container === document.scrollingElement\n ? [window.innerWidth, window.innerHeight]\n : [container.offsetWidth, container.offsetHeight]\n\n let min: number\n let max: number\n\n if (horizontal) {\n if (rtl) {\n min = -(scrollWidth - containerWidth)\n max = 0\n } else {\n min = 0\n max = scrollWidth - containerWidth\n }\n } else {\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,WAAWA,CAClBzD,SAAsB,EACtB6C,KAAa,EACbd,GAAY,EACZD,UAAmB,EACnB;EACA,MAAM;IAAEiD,WAAW;IAAEC;EAAa,CAAC,GAAGhF,SAAS;EAC/C,MAAM,CAACiF,cAAc,EAAEC,eAAe,CAAC,GAAGlF,SAAS,KAAKwB,QAAQ,CAACC,gBAAgB,GAC7E,CAAC2B,MAAM,CAAC+B,UAAU,EAAE/B,MAAM,CAACgC,WAAW,CAAC,GACvC,CAACpF,SAAS,CAACqF,WAAW,EAAErF,SAAS,CAACsF,YAAY,CAAC;EAEnD,IAAIC,GAAW;EACf,IAAIC,GAAW;EAEf,IAAI1D,UAAU,EAAE;IACd,IAAIC,GAAG,EAAE;MACPwD,GAAG,GAAG,EAAER,WAAW,GAAGE,cAAc,CAAC;MACrCO,GAAG,GAAG,CAAC;IACT,CAAC,MAAM;MACLD,GAAG,GAAG,CAAC;MACPC,GAAG,GAAGT,WAAW,GAAGE,cAAc;IACpC;EACF,CAAC,MAAM;IACLM,GAAG,GAAG,CAAC;IACPC,GAAG,GAAGR,YAAY,GAAG,CAACE,eAAe;EACvC;EAEA,OAAOZ,IAAI,CAACkB,GAAG,CAAClB,IAAI,CAACiB,GAAG,CAAC1C,KAAK,EAAE2C,GAAG,CAAC,EAAED,GAAG,CAAC;AAC5C","ignoreList":[]}
|
1
|
+
{"version":3,"file":"goto.mjs","names":["computed","inject","useRtl","clamp","consoleWarn","mergeDeep","refElement","GoToSymbol","Symbol","for","genDefaults","container","undefined","duration","layout","offset","easing","patterns","linear","t","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","getContainer","el","getTarget","document","scrollingElement","body","querySelector","getOffset","target","horizontal","rtl","totalOffset","offsetLeft","offsetTop","offsetParent","createGoTo","options","locale","isRtl","scrollTo","_target","_options","goTo","property","value","HTMLElement","parentElement","ease","TypeError","targetLocation","styles","window","getComputedStyle","layoutOffset","getPropertyValue","parseInt","clampTarget","startLocation","Promise","resolve","startTime","performance","now","requestAnimationFrame","step","currentTime","timeElapsed","progress","location","Math","floor","abs","useGoTo","arguments","length","goToInstance","Error","go","scrollWidth","scrollHeight","containerWidth","containerHeight","innerWidth","innerHeight","offsetWidth","offsetHeight","min","max"],"sources":["../../src/composables/goto.ts"],"sourcesContent":["// Utilities\nimport { computed, inject } from 'vue'\nimport { useRtl } from './locale'\nimport { clamp, consoleWarn, mergeDeep, refElement } from '@/util'\n\n// Types\nimport type { ComponentPublicInstance, InjectionKey, Ref } from 'vue'\nimport type { LocaleInstance, RtlInstance } from './locale'\n\nexport interface GoToInstance {\n rtl: Ref<boolean>\n options: InternalGoToOptions\n}\n\nexport interface InternalGoToOptions {\n container: ComponentPublicInstance | HTMLElement | string\n duration: number\n layout: boolean\n offset: number\n easing: string | ((t: number) => number)\n patterns: Record<string, (t: number) => number>\n}\n\nexport type GoToOptions = Partial<InternalGoToOptions>\n\nexport const GoToSymbol: InjectionKey<GoToInstance> = Symbol.for('vuetify:goto')\n\nfunction genDefaults () {\n return {\n container: undefined,\n duration: 300,\n layout: false,\n offset: 0,\n easing: 'easeInOutCubic',\n patterns: {\n linear: (t: number) => t,\n easeInQuad: (t: number) => t ** 2,\n easeOutQuad: (t: number) => t * (2 - t),\n easeInOutQuad: (t: number) => (t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t),\n easeInCubic: (t: number) => t ** 3,\n easeOutCubic: (t: number) => --t ** 3 + 1,\n easeInOutCubic: (t: number) => t < 0.5 ? 4 * t ** 3 : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1,\n easeInQuart: (t: number) => t ** 4,\n easeOutQuart: (t: number) => 1 - --t ** 4,\n easeInOutQuart: (t: number) => (t < 0.5 ? 8 * t ** 4 : 1 - 8 * --t ** 4),\n easeInQuint: (t: number) => t ** 5,\n easeOutQuint: (t: number) => 1 + --t ** 5,\n easeInOutQuint: (t: number) => t < 0.5 ? 16 * t ** 5 : 1 + 16 * --t ** 5,\n },\n }\n}\n\nfunction getContainer (el?: ComponentPublicInstance | HTMLElement | string) {\n return getTarget(el) ?? (document.scrollingElement || document.body) as HTMLElement\n}\n\nfunction getTarget (el: ComponentPublicInstance | HTMLElement | string | undefined) {\n return (typeof el === 'string') ? document.querySelector<HTMLElement>(el) : refElement(el)\n}\n\nfunction getOffset (target: any, horizontal?: boolean, rtl?: boolean): number {\n if (typeof target === 'number') return horizontal && rtl ? -target : target\n\n let el = getTarget(target)\n let totalOffset = 0\n while (el) {\n totalOffset += horizontal ? el.offsetLeft : el.offsetTop\n el = el.offsetParent as HTMLElement\n }\n\n return totalOffset\n}\n\nexport function createGoTo (\n options: GoToOptions| undefined,\n locale: LocaleInstance & RtlInstance\n): GoToInstance {\n return {\n rtl: locale.isRtl,\n options: mergeDeep(genDefaults(), options) as InternalGoToOptions,\n }\n}\n\nexport async function scrollTo (\n _target: ComponentPublicInstance | HTMLElement | number | string,\n _options: GoToOptions,\n horizontal?: boolean,\n goTo?: GoToInstance,\n) {\n const property = horizontal ? 'scrollLeft' : 'scrollTop'\n const options = mergeDeep(goTo?.options ?? genDefaults(), _options)\n const rtl = goTo?.rtl.value\n const target = (typeof _target === 'number' ? _target : getTarget(_target)) ?? 0\n const container = options.container === 'parent' && target instanceof HTMLElement\n ? target.parentElement!\n : getContainer(options.container)\n const ease = typeof options.easing === 'function' ? options.easing : options.patterns[options.easing]\n\n if (!ease) throw new TypeError(`Easing function \"${options.easing}\" not found.`)\n\n let targetLocation: number\n if (typeof target === 'number') {\n targetLocation = getOffset(target, horizontal, rtl)\n } else {\n targetLocation = getOffset(target, horizontal, rtl) - getOffset(container, horizontal, rtl)\n\n if (options.layout) {\n const styles = window.getComputedStyle(target)\n const layoutOffset = styles.getPropertyValue('--v-layout-top')\n\n if (layoutOffset) targetLocation -= parseInt(layoutOffset, 10)\n }\n }\n\n targetLocation += options.offset\n targetLocation = clampTarget(container, targetLocation, !!rtl, !!horizontal)\n\n const startLocation = container[property] ?? 0\n\n if (targetLocation === startLocation) return Promise.resolve(targetLocation)\n\n const startTime = performance.now()\n\n return new Promise(resolve => requestAnimationFrame(function step (currentTime: number) {\n const timeElapsed = currentTime - startTime\n const progress = timeElapsed / options.duration\n const location = Math.floor(\n startLocation +\n (targetLocation - startLocation) *\n ease(clamp(progress, 0, 1))\n )\n\n container[property] = location\n\n // Allow for some jitter if target time has elapsed\n if (progress >= 1 && Math.abs(location - container[property]) < 10) {\n return resolve(targetLocation)\n } else if (progress > 2) {\n // The target might not be reachable\n consoleWarn('Scroll target is not reachable')\n return resolve(container[property])\n }\n\n requestAnimationFrame(step)\n }))\n}\n\nexport function useGoTo (_options: GoToOptions = {}) {\n const goToInstance = inject(GoToSymbol)\n const { isRtl } = useRtl()\n\n if (!goToInstance) throw new Error('[Vuetify] Could not find injected goto instance')\n\n const goTo = {\n ...goToInstance,\n // can be set via VLocaleProvider\n rtl: computed(() => goToInstance.rtl.value || isRtl.value),\n }\n\n async function go (\n target: ComponentPublicInstance | HTMLElement | string | number,\n options?: Partial<GoToOptions>,\n ) {\n return scrollTo(target, mergeDeep(_options, options), false, goTo)\n }\n\n go.horizontal = async (\n target: ComponentPublicInstance | HTMLElement | string | number,\n options?: Partial<GoToOptions>,\n ) => {\n return scrollTo(target, mergeDeep(_options, options), true, goTo)\n }\n\n return go\n}\n\n/**\n * Clamp target value to achieve a smooth scroll animation\n * when the value goes outside the scroll container size\n */\nfunction clampTarget (\n container: HTMLElement,\n value: number,\n rtl: boolean,\n horizontal: boolean,\n) {\n const { scrollWidth, scrollHeight } = container\n const [containerWidth, containerHeight] = container === document.scrollingElement\n ? [window.innerWidth, window.innerHeight]\n : [container.offsetWidth, container.offsetHeight]\n\n let min: number\n let max: number\n\n if (horizontal) {\n if (rtl) {\n min = -(scrollWidth - containerWidth)\n max = 0\n } else {\n min = 0\n max = scrollWidth - containerWidth\n }\n } else {\n min = 0\n max = scrollHeight + -containerHeight\n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