@vue/runtime-dom 3.6.0-beta.7 → 3.6.0-beta.8
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/dist/runtime-dom.cjs.js +50 -32
- package/dist/runtime-dom.cjs.prod.js +48 -32
- package/dist/runtime-dom.d.ts +122 -115
- package/dist/runtime-dom.esm-browser.js +111 -166
- package/dist/runtime-dom.esm-browser.prod.js +3 -3
- package/dist/runtime-dom.esm-bundler.js +41 -29
- package/dist/runtime-dom.global.js +472 -529
- package/dist/runtime-dom.global.prod.js +3 -3
- package/package.json +4 -4
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -98,121 +98,6 @@ export declare const vModelSelect: ModelDirective<HTMLSelectElement, "number">;
|
|
|
98
98
|
export declare const vModelDynamic: ObjectDirective<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>;
|
|
99
99
|
type VModelDirective = typeof vModelText | typeof vModelCheckbox | typeof vModelSelect | typeof vModelRadio | typeof vModelDynamic;
|
|
100
100
|
//#endregion
|
|
101
|
-
//#region temp/packages/runtime-dom/src/apiCustomElement.d.ts
|
|
102
|
-
export type VueElementConstructor<P = {}> = {
|
|
103
|
-
new (initialProps?: Record<string, any>): VueElement & P;
|
|
104
|
-
};
|
|
105
|
-
export interface CustomElementOptions {
|
|
106
|
-
styles?: string[];
|
|
107
|
-
shadowRoot?: boolean;
|
|
108
|
-
shadowRootOptions?: Omit<ShadowRootInit, "mode">;
|
|
109
|
-
nonce?: string;
|
|
110
|
-
configureApp?: (app: App) => void;
|
|
111
|
-
}
|
|
112
|
-
export declare function defineCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction, options?: Pick<ComponentOptions, "name" | "inheritAttrs" | "emits"> & CustomElementOptions & {
|
|
113
|
-
props?: (keyof Props)[];
|
|
114
|
-
}): VueElementConstructor<Props>;
|
|
115
|
-
export declare function defineCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction, options?: Pick<ComponentOptions, "name" | "inheritAttrs" | "emits"> & CustomElementOptions & {
|
|
116
|
-
props?: ComponentObjectPropsOptions<Props>;
|
|
117
|
-
}): VueElementConstructor<Props>;
|
|
118
|
-
export declare function defineCustomElement<RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, PropsKeys extends string = string, RuntimeEmitsOptions extends EmitsOptions = {}, EmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, InferredProps = (string extends PropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in PropsKeys]?: any }), ResolvedProps = InferredProps & EmitsToProps<RuntimeEmitsOptions>>(options: CustomElementOptions & {
|
|
119
|
-
props?: (RuntimePropsOptions & ThisType<void>) | PropsKeys[];
|
|
120
|
-
} & ComponentOptionsBase<ResolvedProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, EmitsKeys, {}, InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<Readonly<ResolvedProps>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, EmitsKeys, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>, extraOptions?: CustomElementOptions): VueElementConstructor<ResolvedProps>;
|
|
121
|
-
export declare function defineCustomElement<T extends {
|
|
122
|
-
new (...args: any[]): ComponentPublicInstance<any>;
|
|
123
|
-
}>(options: T, extraOptions?: CustomElementOptions): VueElementConstructor<T extends DefineComponent<infer P, any, any, any> ? P : unknown>;
|
|
124
|
-
export declare const defineSSRCustomElement: typeof defineCustomElement;
|
|
125
|
-
declare const BaseClass: typeof HTMLElement;
|
|
126
|
-
type InnerComponentDef = ConcreteComponent & CustomElementOptions;
|
|
127
|
-
export declare abstract class VueElementBase<E = Element, C = Component, Def extends CustomElementOptions & {
|
|
128
|
-
props?: any;
|
|
129
|
-
} = InnerComponentDef> extends BaseClass implements ComponentCustomElementInterface {
|
|
130
|
-
_isVueCE: boolean;
|
|
131
|
-
protected _connected: boolean;
|
|
132
|
-
protected _resolved: boolean;
|
|
133
|
-
protected _numberProps: Record<string, true> | null;
|
|
134
|
-
protected _styleChildren: WeakSet<object>;
|
|
135
|
-
protected _pendingResolve: Promise<void> | undefined;
|
|
136
|
-
protected _parent: VueElementBase | undefined;
|
|
137
|
-
protected _patching: boolean;
|
|
138
|
-
protected _dirty: boolean;
|
|
139
|
-
protected _def: Def;
|
|
140
|
-
protected _props: Record<string, any>;
|
|
141
|
-
protected _createApp: CreateAppFunction<E, C>;
|
|
142
|
-
/**
|
|
143
|
-
* dev only
|
|
144
|
-
*/
|
|
145
|
-
protected _styles?: HTMLStyleElement[];
|
|
146
|
-
/**
|
|
147
|
-
* dev only
|
|
148
|
-
*/
|
|
149
|
-
protected _childStyles?: Map<string, HTMLStyleElement[]>;
|
|
150
|
-
protected _ob?: MutationObserver | null;
|
|
151
|
-
protected _slots?: Record<string, Node[]>;
|
|
152
|
-
/**
|
|
153
|
-
* Check if this custom element needs hydration.
|
|
154
|
-
* Returns true if it has a pre-rendered declarative shadow root that
|
|
155
|
-
* needs to be hydrated.
|
|
156
|
-
*/
|
|
157
|
-
protected abstract _needsHydration(): boolean;
|
|
158
|
-
protected abstract _mount(def: Def): void;
|
|
159
|
-
protected abstract _update(): void;
|
|
160
|
-
protected abstract _unmount(): void;
|
|
161
|
-
protected abstract _updateSlotNodes(slot: Map<Node, Node[]>): void;
|
|
162
|
-
constructor(def: Def, props: Record<string, any> | undefined, createAppFn: CreateAppFunction<E, C>);
|
|
163
|
-
connectedCallback(): void;
|
|
164
|
-
disconnectedCallback(): void;
|
|
165
|
-
protected _setParent(parent?: VueElementBase | undefined): void;
|
|
166
|
-
protected _inheritParentContext(parent?: VueElementBase | undefined): void;
|
|
167
|
-
private _processMutations;
|
|
168
|
-
/**
|
|
169
|
-
* resolve inner component definition (handle possible async component)
|
|
170
|
-
*/
|
|
171
|
-
private _resolveDef;
|
|
172
|
-
private _mountComponent;
|
|
173
|
-
protected _processExposed(): void;
|
|
174
|
-
protected _processInstance(): void;
|
|
175
|
-
private _resolveProps;
|
|
176
|
-
private _setAttr;
|
|
177
|
-
protected _applyStyles(styles: string[] | undefined, owner?: ConcreteComponent): void;
|
|
178
|
-
/**
|
|
179
|
-
* Only called when shadowRoot is false
|
|
180
|
-
*/
|
|
181
|
-
private _parseSlots;
|
|
182
|
-
/**
|
|
183
|
-
* Only called when shadowRoot is false
|
|
184
|
-
*/
|
|
185
|
-
protected _renderSlots(): void;
|
|
186
|
-
}
|
|
187
|
-
export declare class VueElement extends VueElementBase<Element, Component, InnerComponentDef> {
|
|
188
|
-
constructor(def: InnerComponentDef, props?: Record<string, any> | undefined, createAppFn?: CreateAppFunction<Element, Component>);
|
|
189
|
-
protected _needsHydration(): boolean;
|
|
190
|
-
protected _mount(def: InnerComponentDef): void;
|
|
191
|
-
protected _update(): void;
|
|
192
|
-
protected _unmount(): void;
|
|
193
|
-
/**
|
|
194
|
-
* Only called when shadowRoot is false
|
|
195
|
-
*/
|
|
196
|
-
protected _updateSlotNodes(replacements: Map<Node, Node[]>): void;
|
|
197
|
-
private _createVNode;
|
|
198
|
-
}
|
|
199
|
-
export declare function useHost(caller?: string): VueElementBase | null;
|
|
200
|
-
/**
|
|
201
|
-
* Retrieve the shadowRoot of the current custom element. Only usable in setup()
|
|
202
|
-
* of a `defineCustomElement` component.
|
|
203
|
-
*/
|
|
204
|
-
export declare function useShadowRoot(): ShadowRoot | null;
|
|
205
|
-
//#endregion
|
|
206
|
-
//#region temp/packages/runtime-dom/src/helpers/useCssModule.d.ts
|
|
207
|
-
export declare function useCssModule(name?: string): Record<string, string>;
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region temp/packages/runtime-dom/src/helpers/useCssVars.d.ts
|
|
210
|
-
/**
|
|
211
|
-
* Runtime helper for SFC's CSS variable injection feature.
|
|
212
|
-
* @private
|
|
213
|
-
*/
|
|
214
|
-
export declare function useCssVars(getter: (ctx: any) => Record<string, unknown>): void;
|
|
215
|
-
//#endregion
|
|
216
101
|
//#region temp/packages/runtime-dom/src/jsx.d.ts
|
|
217
102
|
export interface CSSProperties extends CSS.Properties<string | number>, CSS.PropertiesHyphen<string | number> {
|
|
218
103
|
/**
|
|
@@ -1425,6 +1310,124 @@ export interface ReservedProps {
|
|
|
1425
1310
|
}
|
|
1426
1311
|
export type NativeElements = { [K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] & ReservedProps };
|
|
1427
1312
|
//#endregion
|
|
1313
|
+
//#region temp/packages/runtime-dom/src/apiCustomElement.d.ts
|
|
1314
|
+
export type VueElementConstructor<P = {}> = {
|
|
1315
|
+
new (initialProps?: Record<string, any>): VueElement & P;
|
|
1316
|
+
};
|
|
1317
|
+
export interface CustomElementOptions {
|
|
1318
|
+
styles?: string[];
|
|
1319
|
+
shadowRoot?: boolean;
|
|
1320
|
+
shadowRootOptions?: Omit<ShadowRootInit, "mode">;
|
|
1321
|
+
nonce?: string;
|
|
1322
|
+
configureApp?: (app: App) => void;
|
|
1323
|
+
}
|
|
1324
|
+
export declare function defineCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction, options?: Pick<ComponentOptions, "name" | "inheritAttrs" | "emits"> & CustomElementOptions & {
|
|
1325
|
+
props?: (keyof Props)[];
|
|
1326
|
+
}): VueElementConstructor<Props>;
|
|
1327
|
+
export declare function defineCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction, options?: Pick<ComponentOptions, "name" | "inheritAttrs" | "emits"> & CustomElementOptions & {
|
|
1328
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
1329
|
+
}): VueElementConstructor<Props>;
|
|
1330
|
+
export declare function defineCustomElement<RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, PropsKeys extends string = string, RuntimeEmitsOptions extends EmitsOptions = {}, EmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, InferredProps = (string extends PropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in PropsKeys]?: any }), ResolvedProps = InferredProps & EmitsToProps<RuntimeEmitsOptions>>(options: CustomElementOptions & {
|
|
1331
|
+
props?: (RuntimePropsOptions & ThisType<void>) | PropsKeys[];
|
|
1332
|
+
} & ComponentOptionsBase<ResolvedProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, EmitsKeys, {}, InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<Readonly<ResolvedProps>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, EmitsKeys, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>, extraOptions?: CustomElementOptions): VueElementConstructor<ResolvedProps>;
|
|
1333
|
+
export declare function defineCustomElement<T extends {
|
|
1334
|
+
new (...args: any[]): ComponentPublicInstance<any>;
|
|
1335
|
+
}>(options: T, extraOptions?: CustomElementOptions): VueElementConstructor<T extends DefineComponent<infer P, any, any, any> ? P : unknown>;
|
|
1336
|
+
export declare const defineSSRCustomElement: typeof defineCustomElement;
|
|
1337
|
+
declare const BaseClass: typeof HTMLElement;
|
|
1338
|
+
type InnerComponentDef = ConcreteComponent & CustomElementOptions;
|
|
1339
|
+
export declare abstract class VueElementBase<E = Element, C = Component, Def extends CustomElementOptions & {
|
|
1340
|
+
props?: any;
|
|
1341
|
+
} = InnerComponentDef> extends BaseClass implements ComponentCustomElementInterface {
|
|
1342
|
+
_isVueCE: boolean;
|
|
1343
|
+
protected _connected: boolean;
|
|
1344
|
+
protected _resolved: boolean;
|
|
1345
|
+
protected _numberProps: Record<string, true> | null;
|
|
1346
|
+
protected _styleChildren: WeakSet<object>;
|
|
1347
|
+
protected _styleAnchors: WeakMap<ConcreteComponent, HTMLStyleElement>;
|
|
1348
|
+
protected _pendingResolve: Promise<void> | undefined;
|
|
1349
|
+
protected _parent: VueElementBase | undefined;
|
|
1350
|
+
protected _patching: boolean;
|
|
1351
|
+
protected _dirty: boolean;
|
|
1352
|
+
protected _def: Def;
|
|
1353
|
+
protected _props: Record<string, any>;
|
|
1354
|
+
protected _createApp: CreateAppFunction<E, C>;
|
|
1355
|
+
/**
|
|
1356
|
+
* dev only
|
|
1357
|
+
*/
|
|
1358
|
+
protected _styles?: HTMLStyleElement[];
|
|
1359
|
+
/**
|
|
1360
|
+
* dev only
|
|
1361
|
+
*/
|
|
1362
|
+
protected _childStyles?: Map<string, HTMLStyleElement[]>;
|
|
1363
|
+
protected _ob?: MutationObserver | null;
|
|
1364
|
+
protected _slots?: Record<string, Node[]>;
|
|
1365
|
+
/**
|
|
1366
|
+
* Check if this custom element needs hydration.
|
|
1367
|
+
* Returns true if it has a pre-rendered declarative shadow root that
|
|
1368
|
+
* needs to be hydrated.
|
|
1369
|
+
*/
|
|
1370
|
+
protected abstract _needsHydration(): boolean;
|
|
1371
|
+
protected abstract _mount(def: Def): void;
|
|
1372
|
+
protected abstract _update(): void;
|
|
1373
|
+
protected abstract _unmount(): void;
|
|
1374
|
+
protected abstract _updateSlotNodes(slot: Map<Node, Node[]>): void;
|
|
1375
|
+
constructor(def: Def, props: Record<string, any> | undefined, createAppFn: CreateAppFunction<E, C>);
|
|
1376
|
+
connectedCallback(): void;
|
|
1377
|
+
disconnectedCallback(): void;
|
|
1378
|
+
protected _setParent(parent?: VueElementBase | undefined): void;
|
|
1379
|
+
protected _inheritParentContext(parent?: VueElementBase | undefined): void;
|
|
1380
|
+
private _processMutations;
|
|
1381
|
+
/**
|
|
1382
|
+
* resolve inner component definition (handle possible async component)
|
|
1383
|
+
*/
|
|
1384
|
+
private _resolveDef;
|
|
1385
|
+
private _mountComponent;
|
|
1386
|
+
protected _processExposed(): void;
|
|
1387
|
+
protected _processInstance(): void;
|
|
1388
|
+
private _resolveProps;
|
|
1389
|
+
private _setAttr;
|
|
1390
|
+
protected _applyStyles(styles: string[] | undefined, owner?: ConcreteComponent, parentComp?: ConcreteComponent): void;
|
|
1391
|
+
private _getStyleAnchor;
|
|
1392
|
+
private _getRootStyleInsertionAnchor;
|
|
1393
|
+
/**
|
|
1394
|
+
* Only called when shadowRoot is false
|
|
1395
|
+
*/
|
|
1396
|
+
private _parseSlots;
|
|
1397
|
+
/**
|
|
1398
|
+
* Only called when shadowRoot is false
|
|
1399
|
+
*/
|
|
1400
|
+
protected _renderSlots(): void;
|
|
1401
|
+
}
|
|
1402
|
+
export declare class VueElement extends VueElementBase<Element, Component, InnerComponentDef> {
|
|
1403
|
+
constructor(def: InnerComponentDef, props?: Record<string, any> | undefined, createAppFn?: CreateAppFunction<Element, Component>);
|
|
1404
|
+
protected _needsHydration(): boolean;
|
|
1405
|
+
protected _mount(def: InnerComponentDef): void;
|
|
1406
|
+
protected _update(): void;
|
|
1407
|
+
protected _unmount(): void;
|
|
1408
|
+
/**
|
|
1409
|
+
* Only called when shadowRoot is false
|
|
1410
|
+
*/
|
|
1411
|
+
protected _updateSlotNodes(replacements: Map<Node, Node[]>): void;
|
|
1412
|
+
private _createVNode;
|
|
1413
|
+
}
|
|
1414
|
+
export declare function useHost(caller?: string): VueElementBase | null;
|
|
1415
|
+
/**
|
|
1416
|
+
* Retrieve the shadowRoot of the current custom element. Only usable in setup()
|
|
1417
|
+
* of a `defineCustomElement` component.
|
|
1418
|
+
*/
|
|
1419
|
+
export declare function useShadowRoot(): ShadowRoot | null;
|
|
1420
|
+
//#endregion
|
|
1421
|
+
//#region temp/packages/runtime-dom/src/helpers/useCssModule.d.ts
|
|
1422
|
+
export declare function useCssModule(name?: string): Record<string, string>;
|
|
1423
|
+
//#endregion
|
|
1424
|
+
//#region temp/packages/runtime-dom/src/helpers/useCssVars.d.ts
|
|
1425
|
+
/**
|
|
1426
|
+
* Runtime helper for SFC's CSS variable injection feature.
|
|
1427
|
+
* @private
|
|
1428
|
+
*/
|
|
1429
|
+
export declare function useCssVars(getter: (ctx: any) => Record<string, unknown>): void;
|
|
1430
|
+
//#endregion
|
|
1428
1431
|
//#region temp/packages/runtime-dom/src/index.d.ts
|
|
1429
1432
|
/**
|
|
1430
1433
|
* This is a stub implementation to prevent the need to use dom types.
|
|
@@ -1440,6 +1443,10 @@ declare module "@vue/reactivity" {
|
|
|
1440
1443
|
}
|
|
1441
1444
|
}
|
|
1442
1445
|
declare module "@vue/runtime-core" {
|
|
1446
|
+
interface AllowedAttrs {
|
|
1447
|
+
class?: ClassValue;
|
|
1448
|
+
style?: StyleValue;
|
|
1449
|
+
}
|
|
1443
1450
|
interface GlobalComponents {
|
|
1444
1451
|
Transition: DefineComponent<TransitionProps>;
|
|
1445
1452
|
TransitionGroup: DefineComponent<TransitionGroupProps>;
|