vue 2.7.1 → 2.7.4

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.
Files changed (42) hide show
  1. package/dist/vue.common.dev.js +133 -61
  2. package/dist/vue.common.prod.js +3 -3
  3. package/dist/vue.esm.browser.js +133 -62
  4. package/dist/vue.esm.browser.min.js +3 -3
  5. package/dist/vue.esm.js +135 -62
  6. package/dist/vue.js +135 -61
  7. package/dist/vue.min.js +3 -3
  8. package/dist/vue.runtime.common.dev.js +133 -61
  9. package/dist/vue.runtime.common.prod.js +3 -3
  10. package/dist/vue.runtime.esm.js +135 -62
  11. package/dist/vue.runtime.js +135 -61
  12. package/dist/vue.runtime.min.js +3 -3
  13. package/dist/vue.runtime.mjs +72 -8604
  14. package/package.json +2 -2
  15. package/packages/compiler-sfc/dist/compiler-sfc.js +56 -55
  16. package/packages/compiler-sfc/package.json +1 -1
  17. package/packages/compiler-sfc/src/parseComponent.ts +9 -1
  18. package/packages/compiler-sfc/test/parseComponent.spec.ts +6 -7
  19. package/src/core/instance/render-helpers/render-static.ts +1 -1
  20. package/src/core/observer/index.ts +54 -55
  21. package/src/core/util/next-tick.ts +2 -1
  22. package/src/core/vdom/modules/directives.ts +2 -2
  23. package/src/shared/constants.ts +3 -1
  24. package/src/v3/apiAsyncComponent.ts +117 -0
  25. package/src/v3/apiWatch.ts +2 -2
  26. package/src/v3/index.ts +6 -0
  27. package/src/v3/reactivity/reactive.ts +13 -2
  28. package/src/v3/reactivity/ref.ts +6 -2
  29. package/types/common.d.ts +6 -0
  30. package/types/index.d.ts +7 -4
  31. package/types/jsx.d.ts +16 -2
  32. package/types/options.d.ts +8 -2
  33. package/types/v3-component-options.d.ts +162 -33
  34. package/types/v3-component-props.d.ts +19 -20
  35. package/types/v3-component-public-instance.d.ts +234 -0
  36. package/types/v3-define-async-component.d.ts +26 -0
  37. package/types/v3-define-component.d.ts +94 -12
  38. package/types/v3-generated.d.ts +26 -1
  39. package/types/v3-setup-context.d.ts +0 -6
  40. package/types/vnode.d.ts +15 -0
  41. package/types/vue.d.ts +17 -10
  42. package/types/v3-component-proxy.d.ts +0 -189
@@ -1,189 +0,0 @@
1
- import { ExtractDefaultPropTypes, ExtractPropTypes } from './v3-component-props'
2
- import {
3
- nextTick,
4
- ShallowUnwrapRef,
5
- UnwrapNestedRefs,
6
- WatchOptions,
7
- WatchStopHandle
8
- } from './v3-generated'
9
- import { Data } from './common'
10
-
11
- import { Vue, VueConstructor } from './vue'
12
- import { ComponentOptions as Vue2ComponentOptions } from './options'
13
- import {
14
- ComputedOptions,
15
- MethodOptions,
16
- ExtractComputedReturns
17
- } from './v3-component-options'
18
- import {
19
- ComponentRenderEmitFn,
20
- EmitFn,
21
- EmitsOptions,
22
- ObjectEmitsOptions,
23
- Slots
24
- } from './v3-setup-context'
25
-
26
- type EmitsToProps<T extends EmitsOptions> = T extends string[]
27
- ? {
28
- [K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any
29
- }
30
- : T extends ObjectEmitsOptions
31
- ? {
32
- [K in string &
33
- `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}`
34
- ? T[Uncapitalize<C>] extends null
35
- ? (...args: any[]) => any
36
- : (
37
- ...args: T[Uncapitalize<C>] extends (...args: infer P) => any
38
- ? P
39
- : never
40
- ) => any
41
- : never
42
- }
43
- : {}
44
-
45
- export type ComponentInstance = InstanceType<VueConstructor>
46
-
47
- // public properties exposed on the proxy, which is used as the render context
48
- // in templates (as `this` in the render option)
49
- export type ComponentRenderProxy<
50
- P = {}, // props type extracted from props option
51
- B = {}, // raw bindings returned from setup()
52
- D = {}, // return from data()
53
- C extends ComputedOptions = {},
54
- M extends MethodOptions = {},
55
- Mixin = {},
56
- Extends = {},
57
- Emits extends EmitsOptions = {},
58
- PublicProps = P,
59
- Defaults = {},
60
- MakeDefaultsOptional extends boolean = false
61
- > = {
62
- $data: D
63
- $props: Readonly<
64
- MakeDefaultsOptional extends true
65
- ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults>
66
- : P & PublicProps
67
- >
68
- $attrs: Record<string, string>
69
- $emit: ComponentRenderEmitFn<
70
- Emits,
71
- keyof Emits,
72
- ComponentRenderProxy<
73
- P,
74
- B,
75
- D,
76
- C,
77
- M,
78
- Mixin,
79
- Extends,
80
- Emits,
81
- PublicProps,
82
- Defaults,
83
- MakeDefaultsOptional
84
- >
85
- >
86
- } & Readonly<P> &
87
- ShallowUnwrapRef<B> &
88
- D &
89
- M &
90
- ExtractComputedReturns<C> &
91
- Omit<Vue, '$data' | '$props' | '$attrs' | '$emit'>
92
-
93
- // for Vetur and TSX support
94
- type VueConstructorProxy<
95
- PropsOptions,
96
- RawBindings,
97
- Data,
98
- Computed extends ComputedOptions,
99
- Methods extends MethodOptions,
100
- Mixin = {},
101
- Extends = {},
102
- Emits extends EmitsOptions = {},
103
- Props = ExtractPropTypes<PropsOptions> &
104
- ({} extends Emits ? {} : EmitsToProps<Emits>)
105
- > = Omit<VueConstructor, never> & {
106
- new (...args: any[]): ComponentRenderProxy<
107
- Props,
108
- ShallowUnwrapRef<RawBindings>,
109
- Data,
110
- Computed,
111
- Methods,
112
- Mixin,
113
- Extends,
114
- Emits,
115
- Props,
116
- ExtractDefaultPropTypes<PropsOptions>,
117
- true
118
- >
119
- }
120
-
121
- type DefaultData<V> = object | ((this: V) => object)
122
- type DefaultMethods<V> = { [key: string]: (this: V, ...args: any[]) => any }
123
- type DefaultComputed = { [key: string]: any }
124
-
125
- export type VueProxy<
126
- PropsOptions,
127
- RawBindings,
128
- Data = DefaultData<Vue>,
129
- Computed extends ComputedOptions = DefaultComputed,
130
- Methods extends MethodOptions = DefaultMethods<Vue>,
131
- Mixin = {},
132
- Extends = {},
133
- Emits extends EmitsOptions = {}
134
- > = Vue2ComponentOptions<
135
- Vue,
136
- ShallowUnwrapRef<RawBindings> & Data,
137
- Methods,
138
- Computed,
139
- PropsOptions,
140
- ExtractPropTypes<PropsOptions>
141
- > &
142
- VueConstructorProxy<
143
- PropsOptions,
144
- RawBindings,
145
- Data,
146
- Computed,
147
- Methods,
148
- Mixin,
149
- Extends,
150
- Emits
151
- >
152
-
153
- // public properties exposed on the proxy, which is used as the render context
154
- // in templates (as `this` in the render option)
155
- export type ComponentPublicInstance<
156
- P = {}, // props type extracted from props option
157
- B = {}, // raw bindings returned from setup()
158
- D = {}, // return from data()
159
- C extends ComputedOptions = {},
160
- M extends MethodOptions = {},
161
- E extends EmitsOptions = {},
162
- PublicProps = P,
163
- Defaults = {},
164
- MakeDefaultsOptional extends boolean = false
165
- > = {
166
- $data: D
167
- $props: MakeDefaultsOptional extends true
168
- ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults>
169
- : P & PublicProps
170
- $attrs: Data
171
- $refs: Data
172
- $slots: Slots
173
- $root: ComponentPublicInstance | null
174
- $parent: ComponentPublicInstance | null
175
- $emit: EmitFn<E>
176
- $el: any
177
- // $options: Options & MergedComponentOptionsOverride
178
- $forceUpdate: () => void
179
- $nextTick: typeof nextTick
180
- $watch(
181
- source: string | Function,
182
- cb: Function,
183
- options?: WatchOptions
184
- ): WatchStopHandle
185
- } & P &
186
- ShallowUnwrapRef<B> &
187
- UnwrapNestedRefs<D> &
188
- ExtractComputedReturns<C> &
189
- M