@vue-jsx-vapor/runtime 3.2.10 → 3.2.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/dist/index.cjs +2 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/props.cjs +3 -5
- package/dist/props.d.cts +2 -2
- package/dist/props.js +4 -6
- package/dist/raw.cjs +3 -3
- package/dist/raw.js +3 -3
- package/dist/vapor.cjs +15 -1
- package/dist/vapor.d.cts +16 -6
- package/dist/vapor.d.ts +16 -6
- package/dist/vapor.js +16 -3
- package/dist/vdom.cjs +8 -0
- package/dist/vdom.d.cts +17 -1
- package/dist/vdom.d.ts +17 -1
- package/dist/vdom.js +9 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7,6 +7,8 @@ const require_ssr = require('./ssr.cjs');
|
|
|
7
7
|
const require_vdom = require('./vdom.cjs');
|
|
8
8
|
let vue = require("vue");
|
|
9
9
|
|
|
10
|
+
exports.For = require_vdom.For;
|
|
11
|
+
exports.VaporFor = require_vapor.VaporFor;
|
|
10
12
|
exports.createComponent = require_vapor.createComponent;
|
|
11
13
|
exports.createNodes = require_vapor.createNodes;
|
|
12
14
|
exports.createProxyComponent = require_vapor.createProxyComponent;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./types-BKjMGTxH.cjs";
|
|
2
|
-
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.cjs";
|
|
1
|
+
import { i as SlotsToProps } from "./types-BKjMGTxH.cjs";
|
|
2
|
+
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.cjs";
|
|
3
3
|
import { h } from "./h.cjs";
|
|
4
4
|
import { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler } from "./jsx.cjs";
|
|
5
5
|
import { getCurrentInstance, useFullProps, useProps } from "./props.cjs";
|
|
6
6
|
import { ssrRegisterHelper } from "./ssr.cjs";
|
|
7
|
-
import { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.cjs";
|
|
7
|
+
import { DefineComponent, DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.cjs";
|
|
8
8
|
import { shallowRef as useRef } from "vue";
|
|
9
|
-
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
9
|
+
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, For, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, type SlotsToProps, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VaporFor, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./types-CqAkLSQ8.js";
|
|
2
|
-
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
1
|
+
import { i as SlotsToProps } from "./types-CqAkLSQ8.js";
|
|
2
|
+
import { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
3
3
|
import { h } from "./h.js";
|
|
4
4
|
import { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler } from "./jsx.js";
|
|
5
5
|
import { getCurrentInstance, useFullProps, useProps } from "./props.js";
|
|
6
6
|
import { ssrRegisterHelper } from "./ssr.js";
|
|
7
|
-
import { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
7
|
+
import { DefineComponent, DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
8
8
|
import { shallowRef as useRef } from "vue";
|
|
9
|
-
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
9
|
+
export { AbstractView, AnchorHTMLAttributes, AnimationEvent, AnimationEventHandler, AreaHTMLAttributes, AriaAttributes, AudioHTMLAttributes, BaseEventHandler, BaseHTMLAttributes, BaseSyntheticEvent, BlockquoteHTMLAttributes, ButtonHTMLAttributes, CSSProperties, CanvasHTMLAttributes, ChangeEvent, ChangeEventHandler, ClipboardEvent, ClipboardEventHandler, ColHTMLAttributes, ColgroupHTMLAttributes, CompositionEvent, CompositionEventHandler, DataHTMLAttributes, DefineComponent, DefineSetupFnComponent, DefineVaporComponent, DefineVaporSetupFnComponent, DelHTMLAttributes, DetailsHTMLAttributes, DialogHTMLAttributes, DragEvent, DragEventHandler, EmbedHTMLAttributes, EventHandler, EventHandlers, Events, FieldsetHTMLAttributes, FocusEvent, FocusEventHandler, For, FormEvent, FormEventHandler, FormHTMLAttributes, HTMLAttributes, HtmlHTMLAttributes, IframeHTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, InputTypeHTMLAttribute, InsHTMLAttributes, IntrinsicElementAttributes, KeyboardEvent, KeyboardEventHandler, KeygenHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, LinkHTMLAttributes, MapHTMLAttributes, MediaHTMLAttributes, MenuHTMLAttributes, MetaHTMLAttributes, MeterHTMLAttributes, ModifierKey, MouseEvent, MouseEventHandler, NativeElements, NodeArrayChildren, NodeChild, ObjectHTMLAttributes, OlHTMLAttributes, OptgroupHTMLAttributes, OptionHTMLAttributes, OutputHTMLAttributes, ParamHTMLAttributes, ProgressHTMLAttributes, QuoteHTMLAttributes, SVGAttributes, ScriptHTMLAttributes, SelectHTMLAttributes, type SlotsToProps, SourceHTMLAttributes, StyleHTMLAttributes, StyleValue, SyntheticEvent, TableHTMLAttributes, TdHTMLAttributes, TextareaHTMLAttributes, ThHTMLAttributes, TimeHTMLAttributes, TrackHTMLAttributes, TransitionEvent, TransitionEventHandler, UIEvent, UIEventHandler, VaporFor, VideoHTMLAttributes, WebViewHTMLAttributes, WheelEvent, WheelEventHandler, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
1
|
+
import { VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes } from "./vapor.js";
|
|
2
2
|
import { h } from "./h.js";
|
|
3
3
|
import "./jsx.js";
|
|
4
4
|
import { getCurrentInstance, useFullProps, useProps } from "./props.js";
|
|
5
5
|
import { ssrRegisterHelper } from "./ssr.js";
|
|
6
|
-
import { createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
6
|
+
import { For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode } from "./vdom.js";
|
|
7
7
|
import { shallowRef as useRef } from "vue";
|
|
8
8
|
|
|
9
|
-
export { createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
|
9
|
+
export { For, VaporFor, createComponent, createNodes, createProxyComponent, createVNodeCache, defineComponent, defineVaporComponent, defineVaporSSRComponent, getCurrentInstance, h, isBlock, normalizeNode, normalizeSlot, normalizeVNode, setNodes, ssrRegisterHelper, useFullProps, useProps, useRef };
|
package/dist/props.cjs
CHANGED
|
@@ -46,12 +46,10 @@ function useFullProps() {
|
|
|
46
46
|
}));
|
|
47
47
|
return new Proxy({}, {
|
|
48
48
|
get(_, p, receiver) {
|
|
49
|
-
return
|
|
49
|
+
return Reflect.get(fullProps.value, p, receiver);
|
|
50
50
|
},
|
|
51
|
-
set(_, p,
|
|
52
|
-
|
|
53
|
-
else fullProps.value[p] = value;
|
|
54
|
-
return true;
|
|
51
|
+
set(_, p, v, r) {
|
|
52
|
+
return Reflect.set(fullProps.value, p, v, r);
|
|
55
53
|
},
|
|
56
54
|
deleteProperty(_, p) {
|
|
57
55
|
return Reflect.deleteProperty(fullProps.value, p);
|
package/dist/props.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue3 from "vue";
|
|
2
2
|
|
|
3
3
|
//#region src/props.d.ts
|
|
4
|
-
declare function getCurrentInstance():
|
|
4
|
+
declare function getCurrentInstance(): vue3.GenericComponentInstance | null;
|
|
5
5
|
/**
|
|
6
6
|
* Returns the props of the current component instance.
|
|
7
7
|
*
|
package/dist/props.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
|
-
import { computed,
|
|
2
|
+
import { computed, useAttrs } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/props.ts
|
|
5
5
|
/* @__NO_SIDE_EFFECTS__ */
|
|
@@ -45,12 +45,10 @@ function useFullProps() {
|
|
|
45
45
|
}));
|
|
46
46
|
return new Proxy({}, {
|
|
47
47
|
get(_, p, receiver) {
|
|
48
|
-
return
|
|
48
|
+
return Reflect.get(fullProps.value, p, receiver);
|
|
49
49
|
},
|
|
50
|
-
set(_, p,
|
|
51
|
-
|
|
52
|
-
else fullProps.value[p] = value;
|
|
53
|
-
return true;
|
|
50
|
+
set(_, p, v, r) {
|
|
51
|
+
return Reflect.set(fullProps.value, p, v, r);
|
|
54
52
|
},
|
|
55
53
|
deleteProperty(_, p) {
|
|
56
54
|
return Reflect.deleteProperty(fullProps.value, p);
|
package/dist/raw.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
//#region src/props.ts?raw
|
|
3
|
-
var props_default = "import { computed,
|
|
3
|
+
var props_default = "import { computed, useAttrs } from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function getCurrentInstance() {\n return Vue.currentInstance || Vue.getCurrentInstance();\n}\n// @__NO_SIDE_EFFECTS__\nexport function useProps() {\n const i = /* @__PURE__ */ getCurrentInstance();\n return i.props;\n}\n// @__NO_SIDE_EFFECTS__\nexport function useFullProps() {\n const attrs = useAttrs();\n const i = /* @__PURE__ */ getCurrentInstance();\n if (!i.type.props) {\n return attrs;\n }\n const props = /* @__PURE__ */ useProps();\n const fullProps = computed(() => ({ ...props, ...attrs }));\n return new Proxy(\n {},\n {\n get(_, p, receiver) {\n return Reflect.get(fullProps.value, p, receiver);\n },\n set(_, p, v, r) {\n return Reflect.set(fullProps.value, p, v, r);\n },\n deleteProperty(_, p) {\n return Reflect.deleteProperty(fullProps.value, p);\n },\n has(_, p) {\n return Reflect.has(fullProps.value, p);\n },\n ownKeys() {\n return Object.keys(fullProps.value);\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n }\n }\n );\n}\n";
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/ssr.ts?raw
|
|
@@ -8,11 +8,11 @@ var ssr_default = "import { useSSRContext } from \"vue\";\nexport function ssrRe
|
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/vapor.ts?raw
|
|
11
|
-
var vapor_default = "import {\n
|
|
11
|
+
var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance\n} from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporSSRComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup(props, ctx) {\n const result = comp(props, ctx);\n return () => result;\n },\n __vapor: true\n });\n }\n const setup = comp.setup;\n if (setup) {\n comp.setup = (props, ctx) => {\n const result = setup(props, ctx);\n return () => result;\n };\n }\n comp.__vapor = true;\n return comp;\n}\nexport const createComponent = (type, ...args) => {\n if (type === Fragment) {\n const slots = args[1];\n return slots && typeof slots.default === \"function\" ? slots.default() : [];\n }\n return Vue.createComponentWithFallback(\n createProxyComponent(Vue.resolveDynamicComponent(type)),\n ...args\n );\n};\nconst proxyCache = /* @__PURE__ */ new WeakMap();\nexport function createProxyComponent(type, normalizeNode2) {\n if (typeof type === \"function\") {\n const existing = proxyCache.get(type);\n if (existing) return existing;\n const i = Vue.currentInstance || getCurrentInstance();\n const proxy = new Proxy(type, {\n apply(target, ctx, args) {\n if (typeof target.__setup === \"function\") {\n target.__setup.apply(ctx, args);\n }\n const node = Reflect.apply(target, ctx, args);\n return normalizeNode2 ? normalizeNode2(node) : node;\n },\n get(target, p, receiver) {\n if (i && i.appContext.vapor && p === \"__vapor\") {\n return true;\n }\n return Reflect.get(target, p, receiver);\n }\n });\n proxyCache.set(type, proxy);\n return proxy;\n }\n return type;\n}\nexport function normalizeNode(node) {\n if (node == null || typeof node === \"boolean\") {\n return document.createComment(\"\");\n } else if (Array.isArray(node) && node.length) {\n return node.map(normalizeNode);\n } else if (isBlock(node)) {\n return node;\n } else if (typeof node === \"function\") {\n return resolveValues([node], void 0, true)[0];\n } else {\n return document.createTextNode(String(node));\n }\n}\nexport function isBlock(val) {\n return val instanceof Node || Array.isArray(val) || Vue.isVaporComponent(val) || Vue.isFragment(val);\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new Vue.VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeBlock(node, anchor, processFunction = false) {\n if (node instanceof Node || Vue.isFragment(node)) {\n return node;\n } else if (Vue.isVaporComponent(node)) {\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n return createFragment(\n node.map((i) => normalizeBlock(i, void 0, processFunction)),\n anchor\n );\n } else if (processFunction && typeof node === \"function\") {\n return resolveValues([node], anchor, true)[0];\n } else {\n const result = node == null || typeof node === \"boolean\" ? \"\" : String(node);\n if (anchor) {\n anchor.textContent = result;\n return anchor;\n } else {\n return document.createTextNode(result);\n }\n }\n}\nfunction resolveValue(current, value, anchor, processFunction = false) {\n anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0);\n const node = normalizeBlock(value, anchor, processFunction);\n if (current) {\n if (Vue.isFragment(current)) {\n if (current.anchor && current.anchor.parentNode) {\n Vue.remove(current.nodes, current.anchor.parentNode);\n Vue.insert(node, current.anchor.parentNode, current.anchor);\n if (!anchor) current.anchor.parentNode.removeChild(current.anchor);\n if (current.scope) current.scope.stop();\n }\n } else if (current instanceof Node) {\n if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) {\n current.textContent = \"\";\n }\n if (Vue.isFragment(node) && current.parentNode) {\n Vue.insert(node, current.parentNode, current);\n if (!anchor || current.nodeType !== 3) {\n current.parentNode.removeChild(current);\n }\n } else if (node instanceof Node) {\n if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else if (current.parentNode) {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = [], _anchor, processFunction = false) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n const anchor = index === values.length - 1 ? _anchor : void 0;\n if (typeof value === \"function\") {\n Vue.renderEffect(() => {\n if (scopes[index]) scopes[index].stop();\n scopes[index] = new EffectScope();\n nodes[index] = scopes[index].run(\n () => resolveValue(nodes[index], value(), anchor, processFunction)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor, processFunction);\n }\n }\n return nodes;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n if (anchor.parentNode) Vue.insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup: comp,\n __vapor: true\n });\n }\n comp.__vapor = true;\n return comp;\n}\nexport const VaporFor = /* @__PURE__ */ defineVaporComponent(\n (props, {\n slots\n }) => {\n return Vue.createFor(\n () => props.in,\n (item, key, index) => {\n return slots.default ? slots.default(\n // @ts-ignore\n props.getKey === void 0 ? item.value : item,\n key,\n index\n ) : [];\n },\n props.getKey === void 0 ? (item) => item : props.getKey\n );\n },\n { props: [\"in\", \"getKey\"] }\n);\n";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/vdom.ts?raw
|
|
15
|
-
var vdom_default = "import {\n defineComponent as __defineComponent,\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\nexport const defineComponent = __defineComponent;\n";
|
|
15
|
+
var vdom_default = "import {\n defineComponent as __defineComponent,\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n renderList,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\nexport const defineComponent = __defineComponent;\nexport const For = defineComponent(\n (props, {\n slots\n }) => {\n const defaultSlot = slots.default;\n return () => (openBlock(true), createElementBlock(\n Fragment,\n null,\n renderList(props.in, (item, key, index) => {\n const result = defaultSlot(item, key, index);\n return Array.isArray(result) ? result.length === 1 ? result[0] : normalizeVNode(result) : result;\n }),\n 128\n ));\n },\n { props: [\"in\"] }\n);\n";
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/raw.ts
|
package/dist/raw.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/props.ts?raw
|
|
2
|
-
var props_default = "import { computed,
|
|
2
|
+
var props_default = "import { computed, useAttrs } from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function getCurrentInstance() {\n return Vue.currentInstance || Vue.getCurrentInstance();\n}\n// @__NO_SIDE_EFFECTS__\nexport function useProps() {\n const i = /* @__PURE__ */ getCurrentInstance();\n return i.props;\n}\n// @__NO_SIDE_EFFECTS__\nexport function useFullProps() {\n const attrs = useAttrs();\n const i = /* @__PURE__ */ getCurrentInstance();\n if (!i.type.props) {\n return attrs;\n }\n const props = /* @__PURE__ */ useProps();\n const fullProps = computed(() => ({ ...props, ...attrs }));\n return new Proxy(\n {},\n {\n get(_, p, receiver) {\n return Reflect.get(fullProps.value, p, receiver);\n },\n set(_, p, v, r) {\n return Reflect.set(fullProps.value, p, v, r);\n },\n deleteProperty(_, p) {\n return Reflect.deleteProperty(fullProps.value, p);\n },\n has(_, p) {\n return Reflect.has(fullProps.value, p);\n },\n ownKeys() {\n return Object.keys(fullProps.value);\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n }\n }\n );\n}\n";
|
|
3
3
|
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region src/ssr.ts?raw
|
|
@@ -7,11 +7,11 @@ var ssr_default = "import { useSSRContext } from \"vue\";\nexport function ssrRe
|
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/vapor.ts?raw
|
|
10
|
-
var vapor_default = "import {\n
|
|
10
|
+
var vapor_default = "import {\n EffectScope,\n Fragment,\n getCurrentInstance\n} from \"vue\";\nimport * as Vue from \"vue\";\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporSSRComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup(props, ctx) {\n const result = comp(props, ctx);\n return () => result;\n },\n __vapor: true\n });\n }\n const setup = comp.setup;\n if (setup) {\n comp.setup = (props, ctx) => {\n const result = setup(props, ctx);\n return () => result;\n };\n }\n comp.__vapor = true;\n return comp;\n}\nexport const createComponent = (type, ...args) => {\n if (type === Fragment) {\n const slots = args[1];\n return slots && typeof slots.default === \"function\" ? slots.default() : [];\n }\n return Vue.createComponentWithFallback(\n createProxyComponent(Vue.resolveDynamicComponent(type)),\n ...args\n );\n};\nconst proxyCache = /* @__PURE__ */ new WeakMap();\nexport function createProxyComponent(type, normalizeNode2) {\n if (typeof type === \"function\") {\n const existing = proxyCache.get(type);\n if (existing) return existing;\n const i = Vue.currentInstance || getCurrentInstance();\n const proxy = new Proxy(type, {\n apply(target, ctx, args) {\n if (typeof target.__setup === \"function\") {\n target.__setup.apply(ctx, args);\n }\n const node = Reflect.apply(target, ctx, args);\n return normalizeNode2 ? normalizeNode2(node) : node;\n },\n get(target, p, receiver) {\n if (i && i.appContext.vapor && p === \"__vapor\") {\n return true;\n }\n return Reflect.get(target, p, receiver);\n }\n });\n proxyCache.set(type, proxy);\n return proxy;\n }\n return type;\n}\nexport function normalizeNode(node) {\n if (node == null || typeof node === \"boolean\") {\n return document.createComment(\"\");\n } else if (Array.isArray(node) && node.length) {\n return node.map(normalizeNode);\n } else if (isBlock(node)) {\n return node;\n } else if (typeof node === \"function\") {\n return resolveValues([node], void 0, true)[0];\n } else {\n return document.createTextNode(String(node));\n }\n}\nexport function isBlock(val) {\n return val instanceof Node || Array.isArray(val) || Vue.isVaporComponent(val) || Vue.isFragment(val);\n}\nfunction createFragment(nodes, anchor = document.createTextNode(\"\")) {\n const frag = new Vue.VaporFragment(nodes);\n frag.anchor = anchor;\n return frag;\n}\nfunction normalizeBlock(node, anchor, processFunction = false) {\n if (node instanceof Node || Vue.isFragment(node)) {\n return node;\n } else if (Vue.isVaporComponent(node)) {\n return createFragment(node, anchor);\n } else if (Array.isArray(node)) {\n return createFragment(\n node.map((i) => normalizeBlock(i, void 0, processFunction)),\n anchor\n );\n } else if (processFunction && typeof node === \"function\") {\n return resolveValues([node], anchor, true)[0];\n } else {\n const result = node == null || typeof node === \"boolean\" ? \"\" : String(node);\n if (anchor) {\n anchor.textContent = result;\n return anchor;\n } else {\n return document.createTextNode(result);\n }\n }\n}\nfunction resolveValue(current, value, anchor, processFunction = false) {\n anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0);\n const node = normalizeBlock(value, anchor, processFunction);\n if (current) {\n if (Vue.isFragment(current)) {\n if (current.anchor && current.anchor.parentNode) {\n Vue.remove(current.nodes, current.anchor.parentNode);\n Vue.insert(node, current.anchor.parentNode, current.anchor);\n if (!anchor) current.anchor.parentNode.removeChild(current.anchor);\n if (current.scope) current.scope.stop();\n }\n } else if (current instanceof Node) {\n if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) {\n current.textContent = \"\";\n }\n if (Vue.isFragment(node) && current.parentNode) {\n Vue.insert(node, current.parentNode, current);\n if (!anchor || current.nodeType !== 3) {\n current.parentNode.removeChild(current);\n }\n } else if (node instanceof Node) {\n if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else if (current.parentNode) {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = [], _anchor, processFunction = false) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n const anchor = index === values.length - 1 ? _anchor : void 0;\n if (typeof value === \"function\") {\n Vue.renderEffect(() => {\n if (scopes[index]) scopes[index].stop();\n scopes[index] = new EffectScope();\n nodes[index] = scopes[index].run(\n () => resolveValue(nodes[index], value(), anchor, processFunction)\n );\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value, anchor, processFunction);\n }\n }\n return nodes;\n}\nexport function setNodes(anchor, ...values) {\n const resolvedValues = resolveValues(values, anchor);\n if (anchor.parentNode) Vue.insert(resolvedValues, anchor.parentNode, anchor);\n}\nexport function createNodes(...values) {\n return resolveValues(values);\n}\n// @__NO_SIDE_EFFECTS__\nexport function defineVaporComponent(comp, extraOptions) {\n if (typeof comp === \"function\") {\n return Object.assign({ name: comp.name }, extraOptions, {\n setup: comp,\n __vapor: true\n });\n }\n comp.__vapor = true;\n return comp;\n}\nexport const VaporFor = /* @__PURE__ */ defineVaporComponent(\n (props, {\n slots\n }) => {\n return Vue.createFor(\n () => props.in,\n (item, key, index) => {\n return slots.default ? slots.default(\n // @ts-ignore\n props.getKey === void 0 ? item.value : item,\n key,\n index\n ) : [];\n },\n props.getKey === void 0 ? (item) => item : props.getKey\n );\n },\n { props: [\"in\", \"getKey\"] }\n);\n";
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/vdom.ts?raw
|
|
14
|
-
var vdom_default = "import {\n defineComponent as __defineComponent,\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\nexport const defineComponent = __defineComponent;\n";
|
|
14
|
+
var vdom_default = "import {\n defineComponent as __defineComponent,\n cloneVNode,\n Comment,\n createBlock,\n createElementBlock,\n createElementVNode,\n createVNode,\n Fragment,\n getCurrentInstance,\n isVNode,\n openBlock,\n renderList,\n Text,\n withCtx\n} from \"vue\";\nconst cacheMap = /* @__PURE__ */ new WeakMap();\nexport function createVNodeCache(key) {\n const i = getCurrentInstance();\n if (i) {\n if (!cacheMap.has(i)) cacheMap.set(i, {});\n const caches = cacheMap.get(i);\n return caches[key] || (caches[key] = []);\n } else {\n return [];\n }\n}\nexport function normalizeVNode(value, flag = 1) {\n let create = createVNode;\n let isBlock = false;\n if (typeof value === \"function\") {\n isBlock = true;\n openBlock();\n create = createBlock;\n value = value();\n }\n return isVNode(value) ? isBlock ? createBlock(cloneIfMounted(value)) : cloneIfMounted(value) : Array.isArray(value) ? isBlock ? createElementBlock(\n Fragment,\n null,\n value.map((n) => normalizeVNode(() => n)),\n -2\n ) : createElementVNode(Fragment, null, value.slice()) : value == null || typeof value === \"boolean\" ? create(Comment) : create(Text, null, String(value), flag);\n}\nfunction cloneIfMounted(child) {\n return child.el === null && child.patchFlag !== -1 || // @ts-ignore\n child.memo ? child : cloneVNode(child);\n}\nconst normalizeSlotValue = (value) => Array.isArray(value) ? value.map((n) => normalizeVNode(n)) : [normalizeVNode(value)];\nexport const normalizeSlot = (rawSlot) => {\n if (rawSlot._n) {\n return rawSlot;\n }\n return withCtx((...args) => {\n return normalizeSlotValue(rawSlot(...args));\n });\n};\nexport const defineComponent = __defineComponent;\nexport const For = defineComponent(\n (props, {\n slots\n }) => {\n const defaultSlot = slots.default;\n return () => (openBlock(true), createElementBlock(\n Fragment,\n null,\n renderList(props.in, (item, key, index) => {\n const result = defaultSlot(item, key, index);\n return Array.isArray(result) ? result.length === 1 ? result[0] : normalizeVNode(result) : result;\n }),\n 128\n ));\n },\n { props: [\"in\"] }\n);\n";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/raw.ts
|
package/dist/vapor.cjs
CHANGED
|
@@ -124,9 +124,23 @@ function setNodes(anchor, ...values) {
|
|
|
124
124
|
function createNodes(...values) {
|
|
125
125
|
return resolveValues(values);
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
128
|
+
function defineVaporComponent(comp, extraOptions) {
|
|
129
|
+
if (typeof comp === "function") return Object.assign({ name: comp.name }, extraOptions, {
|
|
130
|
+
setup: comp,
|
|
131
|
+
__vapor: true
|
|
132
|
+
});
|
|
133
|
+
comp.__vapor = true;
|
|
134
|
+
return comp;
|
|
135
|
+
}
|
|
136
|
+
const VaporFor = /* @__PURE__ */ defineVaporComponent((props, { slots }) => {
|
|
137
|
+
return vue.createFor(() => props.in, (item, key, index) => {
|
|
138
|
+
return slots.default ? slots.default(props.getKey === void 0 ? item.value : item, key, index) : [];
|
|
139
|
+
}, props.getKey === void 0 ? (item) => item : props.getKey);
|
|
140
|
+
}, { props: ["in", "getKey"] });
|
|
128
141
|
|
|
129
142
|
//#endregion
|
|
143
|
+
exports.VaporFor = VaporFor;
|
|
130
144
|
exports.createComponent = createComponent;
|
|
131
145
|
exports.createNodes = createNodes;
|
|
132
146
|
exports.createProxyComponent = createProxyComponent;
|
package/dist/vapor.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify } from "./types-BKjMGTxH.cjs";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
|
-
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
3
|
+
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, ShallowRef, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/vapor.d.ts
|
|
6
6
|
declare function defineVaporSSRComponent(comp: VaporComponent, extraOptions: VaporComponent): VaporComponent;
|
|
@@ -16,19 +16,19 @@ declare function setNodes(anchor: Node, ...values: any[]): void;
|
|
|
16
16
|
declare function createNodes(...values: any[]): Block[];
|
|
17
17
|
type DefineVaporComponent<RuntimePropsOptions = {}, RuntimePropsKeys extends string = string, InferredProps = (string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, unknown> = {}, MakeDefaultsOptional extends boolean = true, PublicProps = VaporPublicProps, ResolvedProps = ToResolvedProps<InferredProps, Emits>, Defaults = ExtractDefaultPropTypes<RuntimePropsOptions>> = VaporComponentInstanceConstructor<VaporComponentInstance<(MakeDefaultsOptional extends true ? keyof Defaults extends never ? Prettify<ResolvedProps> & PublicProps : Partial<Defaults> & Omit<Prettify<ResolvedProps> & PublicProps, keyof Defaults> : Prettify<ResolvedProps> & PublicProps) & SlotsToProps<Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock, TypeRefs>> & VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
18
18
|
type DefineVaporSetupFnComponent<Props extends Record<string, any> = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, ResolvedProps extends Record<string, any> = ToResolvedProps<Props & VaporPublicProps, Emits>> = new () => VaporComponentInstance<ResolvedProps & SlotsToProps<Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock>;
|
|
19
|
-
declare function
|
|
19
|
+
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(setup: (this: void, props: Props, ctx: {
|
|
20
20
|
emit: EmitFn<Emits>;
|
|
21
21
|
slots: Slots;
|
|
22
22
|
attrs: Record<string, any>;
|
|
23
23
|
expose: (exposed?: Exposed) => void;
|
|
24
24
|
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
25
|
-
declare function
|
|
25
|
+
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(this: void, setup: (props: Props, ctx: {
|
|
26
26
|
emit: EmitFn<Emits>;
|
|
27
27
|
slots: Slots;
|
|
28
28
|
attrs: Record<string, any>;
|
|
29
29
|
expose: (exposed?: Exposed) => void;
|
|
30
30
|
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
31
|
-
declare function
|
|
31
|
+
declare function defineVaporComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, ResolvedEmits extends EmitsOptions = ({} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions), InferredProps = (IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
32
32
|
[key: string]: any;
|
|
33
33
|
/**
|
|
34
34
|
* @private
|
|
@@ -47,6 +47,16 @@ declare function _defineVaporComponent<TypeProps, RuntimePropsOptions extends Co
|
|
|
47
47
|
*/
|
|
48
48
|
__typeEl?: TypeBlock;
|
|
49
49
|
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
50
|
-
|
|
50
|
+
type ResolveItem<Item, GetKey> = GetKey extends undefined ? Item : ShallowRef<Item>;
|
|
51
|
+
declare const VaporFor: new <T extends any[] | Record<any, any> | number | string | Set<any> | Map<any, any>, Item = (T extends number ? number : T extends string ? string : T extends any[] ? T[number] : T extends Iterable<infer T1> ? T1 : Record<any, any>), GetKeyDetault = (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any, GetKey extends GetKeyDetault | null | undefined = undefined>() => VaporComponentInstance<Readonly<{
|
|
52
|
+
in: T;
|
|
53
|
+
getKey?: GetKey extends undefined ? GetKeyDetault : GetKey;
|
|
54
|
+
} & Vue.ReservedProps & Vue.AllowedComponentProps & Vue.ComponentCustomProps> & Readonly<{}> & {
|
|
55
|
+
'v-slots'?: {
|
|
56
|
+
default: (...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any;
|
|
57
|
+
} | ((...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any) | NoInfer<NodeChild<undefined>> | undefined;
|
|
58
|
+
}, {}, {
|
|
59
|
+
default: (...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any;
|
|
60
|
+
}, Record<string, any>, Vue.ForFragment, Record<string, any>>;
|
|
51
61
|
//#endregion
|
|
52
|
-
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
|
62
|
+
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
package/dist/vapor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues, r as Prettify } from "./types-CqAkLSQ8.js";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
|
-
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
3
|
+
import { Block, ComponentObjectPropsOptions, ComponentTypeEmits, EmitFn, EmitsOptions, ExtractDefaultPropTypes, ExtractPropTypes, Fragment, ShallowRef, StaticSlots, TypeEmitsToOptions, VNode, VaporComponent, VaporComponentInstance, VaporComponentInstanceConstructor, VaporComponentOptions, VaporPublicProps, VaporRenderResult } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/vapor.d.ts
|
|
6
6
|
declare function defineVaporSSRComponent(comp: VaporComponent, extraOptions: VaporComponent): VaporComponent;
|
|
@@ -16,19 +16,19 @@ declare function setNodes(anchor: Node, ...values: any[]): void;
|
|
|
16
16
|
declare function createNodes(...values: any[]): Block[];
|
|
17
17
|
type DefineVaporComponent<RuntimePropsOptions = {}, RuntimePropsKeys extends string = string, InferredProps = (string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, unknown> = {}, MakeDefaultsOptional extends boolean = true, PublicProps = VaporPublicProps, ResolvedProps = ToResolvedProps<InferredProps, Emits>, Defaults = ExtractDefaultPropTypes<RuntimePropsOptions>> = VaporComponentInstanceConstructor<VaporComponentInstance<(MakeDefaultsOptional extends true ? keyof Defaults extends never ? Prettify<ResolvedProps> & PublicProps : Partial<Defaults> & Omit<Prettify<ResolvedProps> & PublicProps, keyof Defaults> : Prettify<ResolvedProps> & PublicProps) & SlotsToProps<Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock, TypeRefs>> & VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
18
18
|
type DefineVaporSetupFnComponent<Props extends Record<string, any> = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, ResolvedProps extends Record<string, any> = ToResolvedProps<Props & VaporPublicProps, Emits>> = new () => VaporComponentInstance<ResolvedProps & SlotsToProps<Slots, NodeChild>, Emits, Slots, Exposed, TypeBlock>;
|
|
19
|
-
declare function
|
|
19
|
+
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(setup: (this: void, props: Props, ctx: {
|
|
20
20
|
emit: EmitFn<Emits>;
|
|
21
21
|
slots: Slots;
|
|
22
22
|
attrs: Record<string, any>;
|
|
23
23
|
expose: (exposed?: Exposed) => void;
|
|
24
24
|
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
25
|
-
declare function
|
|
25
|
+
declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(this: void, setup: (props: Props, ctx: {
|
|
26
26
|
emit: EmitFn<Emits>;
|
|
27
27
|
slots: Slots;
|
|
28
28
|
attrs: Record<string, any>;
|
|
29
29
|
expose: (exposed?: Exposed) => void;
|
|
30
30
|
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
31
|
-
declare function
|
|
31
|
+
declare function defineVaporComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, ResolvedEmits extends EmitsOptions = ({} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions), InferredProps = (IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
32
32
|
[key: string]: any;
|
|
33
33
|
/**
|
|
34
34
|
* @private
|
|
@@ -47,6 +47,16 @@ declare function _defineVaporComponent<TypeProps, RuntimePropsOptions extends Co
|
|
|
47
47
|
*/
|
|
48
48
|
__typeEl?: TypeBlock;
|
|
49
49
|
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
50
|
-
|
|
50
|
+
type ResolveItem<Item, GetKey> = GetKey extends undefined ? Item : ShallowRef<Item>;
|
|
51
|
+
declare const VaporFor: new <T extends any[] | Record<any, any> | number | string | Set<any> | Map<any, any>, Item = (T extends number ? number : T extends string ? string : T extends any[] ? T[number] : T extends Iterable<infer T1> ? T1 : Record<any, any>), GetKeyDetault = (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any, GetKey extends GetKeyDetault | null | undefined = undefined>() => VaporComponentInstance<Readonly<{
|
|
52
|
+
in: T;
|
|
53
|
+
getKey?: GetKey extends undefined ? GetKeyDetault : GetKey;
|
|
54
|
+
} & Vue.ReservedProps & Vue.AllowedComponentProps & Vue.ComponentCustomProps> & Readonly<{}> & {
|
|
55
|
+
'v-slots'?: {
|
|
56
|
+
default: (...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any;
|
|
57
|
+
} | ((...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any) | NoInfer<NodeChild<undefined>> | undefined;
|
|
58
|
+
}, {}, {
|
|
59
|
+
default: (...args: string extends keyof Item ? [item: ResolveItem<T[keyof T], GetKey>, key: ShallowRef<keyof T>, index: ShallowRef<number>] : [item: ResolveItem<Item, GetKey>, index: ShallowRef<number>]) => any;
|
|
60
|
+
}, Record<string, any>, Vue.ForFragment, Record<string, any>>;
|
|
51
61
|
//#endregion
|
|
52
|
-
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
|
62
|
+
export { DefineVaporComponent, DefineVaporSetupFnComponent, NodeArrayChildren, NodeChild, VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
package/dist/vapor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
|
-
import { EffectScope, Fragment,
|
|
2
|
+
import { EffectScope, Fragment, getCurrentInstance } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/vapor.ts
|
|
5
5
|
/* @__NO_SIDE_EFFECTS__ */
|
|
@@ -123,7 +123,20 @@ function setNodes(anchor, ...values) {
|
|
|
123
123
|
function createNodes(...values) {
|
|
124
124
|
return resolveValues(values);
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
127
|
+
function defineVaporComponent(comp, extraOptions) {
|
|
128
|
+
if (typeof comp === "function") return Object.assign({ name: comp.name }, extraOptions, {
|
|
129
|
+
setup: comp,
|
|
130
|
+
__vapor: true
|
|
131
|
+
});
|
|
132
|
+
comp.__vapor = true;
|
|
133
|
+
return comp;
|
|
134
|
+
}
|
|
135
|
+
const VaporFor = /* @__PURE__ */ defineVaporComponent((props, { slots }) => {
|
|
136
|
+
return Vue.createFor(() => props.in, (item, key, index) => {
|
|
137
|
+
return slots.default ? slots.default(props.getKey === void 0 ? item.value : item, key, index) : [];
|
|
138
|
+
}, props.getKey === void 0 ? (item) => item : props.getKey);
|
|
139
|
+
}, { props: ["in", "getKey"] });
|
|
127
140
|
|
|
128
141
|
//#endregion
|
|
129
|
-
export { createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
|
142
|
+
export { VaporFor, createComponent, createNodes, createProxyComponent, defineVaporComponent, defineVaporSSRComponent, isBlock, normalizeNode, setNodes };
|
package/dist/vdom.cjs
CHANGED
|
@@ -33,8 +33,16 @@ const normalizeSlot = (rawSlot) => {
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
const defineComponent = vue.defineComponent;
|
|
36
|
+
const For = defineComponent((props, { slots }) => {
|
|
37
|
+
const defaultSlot = slots.default;
|
|
38
|
+
return () => ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(props.in, (item, key, index) => {
|
|
39
|
+
const result = defaultSlot(item, key, index);
|
|
40
|
+
return Array.isArray(result) ? result.length === 1 ? result[0] : normalizeVNode(result) : result;
|
|
41
|
+
}), 128));
|
|
42
|
+
}, { props: ["in"] });
|
|
36
43
|
|
|
37
44
|
//#endregion
|
|
45
|
+
exports.For = For;
|
|
38
46
|
exports.createVNodeCache = createVNodeCache;
|
|
39
47
|
exports.defineComponent = defineComponent;
|
|
40
48
|
exports.normalizeSlot = normalizeSlot;
|
package/dist/vdom.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues } from "./types-BKjMGTxH.cjs";
|
|
2
|
+
import * as vue0 from "vue";
|
|
2
3
|
import { Component, ComponentInjectOptions, ComponentObjectPropsOptions, ComponentOptions, ComponentOptionsBase, ComponentOptionsMixin, ComponentPropsOptions, ComponentProvideOptions, ComponentPublicInstance, ComponentTypeEmits, ComputedOptions, CreateComponentPublicInstanceWithMixins, Directive, EmitFn, EmitsOptions, EmitsToProps, ExtractDefaultPropTypes, ExtractPropTypes, GlobalComponents, GlobalDirectives, MethodOptions, PublicProps, Slot, SlotsType, TypeEmitsToOptions, VNode, VNodeChild } from "vue";
|
|
3
4
|
|
|
4
5
|
//#region src/vdom.d.ts
|
|
@@ -56,5 +57,20 @@ declare function _defineComponent<TypeProps, RuntimePropsOptions extends Compone
|
|
|
56
57
|
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
57
58
|
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, string>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
58
59
|
declare const defineComponent: typeof _defineComponent;
|
|
60
|
+
declare const For: new <T extends any[] | Record<any, any> | number | string | Set<any> | Map<any, any>, Item = (T extends number ? number : T extends string ? string : T extends any[] ? T[number] : T extends Iterable<infer T1> ? T1 : Record<any, any>)>(props: {
|
|
61
|
+
in: T;
|
|
62
|
+
} & {} & {
|
|
63
|
+
'v-slots'?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any) | Readonly<{
|
|
64
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
65
|
+
}> | NoInfer<VNodeChild> | undefined;
|
|
66
|
+
} & vue0.VNodeProps & vue0.AllowedComponentProps & vue0.ComponentCustomProps) => CreateComponentPublicInstanceWithMixins<{
|
|
67
|
+
in: T;
|
|
68
|
+
} & {} & {
|
|
69
|
+
'v-slots'?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any) | Readonly<{
|
|
70
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
71
|
+
}> | NoInfer<VNodeChild> | undefined;
|
|
72
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, SlotsType<{
|
|
73
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
74
|
+
}>, {}, {}, never>;
|
|
59
75
|
//#endregion
|
|
60
|
-
export { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
|
76
|
+
export { DefineComponent, DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
package/dist/vdom.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as ToResolvedProps, i as SlotsToProps, n as IsKeyValues } from "./types-CqAkLSQ8.js";
|
|
2
|
+
import * as vue1 from "vue";
|
|
2
3
|
import { Component, ComponentInjectOptions, ComponentObjectPropsOptions, ComponentOptions, ComponentOptionsBase, ComponentOptionsMixin, ComponentPropsOptions, ComponentProvideOptions, ComponentPublicInstance, ComponentTypeEmits, ComputedOptions, CreateComponentPublicInstanceWithMixins, Directive, EmitFn, EmitsOptions, EmitsToProps, ExtractDefaultPropTypes, ExtractPropTypes, GlobalComponents, GlobalDirectives, MethodOptions, PublicProps, Slot, SlotsType, TypeEmitsToOptions, VNode, VNodeChild } from "vue";
|
|
3
4
|
|
|
4
5
|
//#region src/vdom.d.ts
|
|
@@ -56,5 +57,20 @@ declare function _defineComponent<TypeProps, RuntimePropsOptions extends Compone
|
|
|
56
57
|
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
57
58
|
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, string>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
58
59
|
declare const defineComponent: typeof _defineComponent;
|
|
60
|
+
declare const For: new <T extends any[] | Record<any, any> | number | string | Set<any> | Map<any, any>, Item = (T extends number ? number : T extends string ? string : T extends any[] ? T[number] : T extends Iterable<infer T1> ? T1 : Record<any, any>)>(props: {
|
|
61
|
+
in: T;
|
|
62
|
+
} & {} & {
|
|
63
|
+
'v-slots'?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any) | Readonly<{
|
|
64
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
65
|
+
}> | NoInfer<VNodeChild> | undefined;
|
|
66
|
+
} & vue1.VNodeProps & vue1.AllowedComponentProps & vue1.ComponentCustomProps) => CreateComponentPublicInstanceWithMixins<{
|
|
67
|
+
in: T;
|
|
68
|
+
} & {} & {
|
|
69
|
+
'v-slots'?: ((...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any) | Readonly<{
|
|
70
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
71
|
+
}> | NoInfer<VNodeChild> | undefined;
|
|
72
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, false, {}, SlotsType<{
|
|
73
|
+
default: (...args: string extends keyof Item ? [item: T[keyof T], key: keyof T, index: number] : [item: Item, index: number]) => any;
|
|
74
|
+
}>, {}, {}, never>;
|
|
59
75
|
//#endregion
|
|
60
|
-
export { DefineComponent, DefineSetupFnComponent, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
|
76
|
+
export { DefineComponent, DefineSetupFnComponent, For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
package/dist/vdom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Comment, Fragment, Text, cloneVNode, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent as defineComponent$1, getCurrentInstance, isVNode, openBlock, withCtx } from "vue";
|
|
1
|
+
import { Comment, Fragment, Text, cloneVNode, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent as defineComponent$1, getCurrentInstance, isVNode, openBlock, renderList, withCtx } from "vue";
|
|
2
2
|
|
|
3
3
|
//#region src/vdom.ts
|
|
4
4
|
const cacheMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -32,6 +32,13 @@ const normalizeSlot = (rawSlot) => {
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
const defineComponent = defineComponent$1;
|
|
35
|
+
const For = defineComponent((props, { slots }) => {
|
|
36
|
+
const defaultSlot = slots.default;
|
|
37
|
+
return () => (openBlock(true), createElementBlock(Fragment, null, renderList(props.in, (item, key, index) => {
|
|
38
|
+
const result = defaultSlot(item, key, index);
|
|
39
|
+
return Array.isArray(result) ? result.length === 1 ? result[0] : normalizeVNode(result) : result;
|
|
40
|
+
}), 128));
|
|
41
|
+
}, { props: ["in"] });
|
|
35
42
|
|
|
36
43
|
//#endregion
|
|
37
|
-
export { createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|
|
44
|
+
export { For, createVNodeCache, defineComponent, normalizeSlot, normalizeVNode };
|