@tarojs/components-advanced 3.7.0-alpha.2 → 3.7.0-alpha.22
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/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/virtual-list/index.d.ts +49 -30
- package/dist/components/virtual-list/index.js.map +1 -1
- package/dist/components/virtual-list/list-set.d.ts +5 -1
- package/dist/components/virtual-list/list-set.js +24 -59
- package/dist/components/virtual-list/list-set.js.map +1 -1
- package/dist/components/virtual-list/preset.d.ts +25 -10
- package/dist/components/virtual-list/preset.js +116 -60
- package/dist/components/virtual-list/preset.js.map +1 -1
- package/dist/components/virtual-list/react/index.d.ts +2 -2
- package/dist/components/virtual-list/react/index.js +8 -16
- package/dist/components/virtual-list/react/index.js.map +1 -1
- package/dist/components/virtual-list/react/list.d.ts +8 -7
- package/dist/components/virtual-list/react/list.js +141 -127
- package/dist/components/virtual-list/react/list.js.map +1 -1
- package/dist/components/virtual-list/react/validate.d.ts +3 -3
- package/dist/components/virtual-list/react/validate.js +8 -14
- package/dist/components/virtual-list/react/validate.js.map +1 -1
- package/dist/components/virtual-list/react/wrapper.d.ts +3 -0
- package/dist/components/virtual-list/react/wrapper.js +58 -0
- package/dist/components/virtual-list/react/wrapper.js.map +1 -0
- package/dist/components/virtual-list/utils.d.ts +1 -4
- package/dist/components/virtual-list/utils.js +1 -28
- package/dist/components/virtual-list/utils.js.map +1 -1
- package/dist/components/virtual-list/vue/index.d.ts +1 -1
- package/dist/components/virtual-list/vue/list.d.ts +407 -51
- package/dist/components/virtual-list/vue/list.js +198 -169
- package/dist/components/virtual-list/vue/list.js.map +1 -1
- package/dist/components/virtual-waterfall/constants.d.ts +2 -0
- package/dist/components/virtual-waterfall/constants.js +4 -0
- package/dist/components/virtual-waterfall/constants.js.map +1 -0
- package/dist/components/virtual-waterfall/index.d.ts +249 -0
- package/dist/components/virtual-waterfall/index.js +6 -0
- package/dist/components/virtual-waterfall/index.js.map +1 -0
- package/dist/components/virtual-waterfall/list-map.d.ts +50 -0
- package/dist/components/virtual-waterfall/list-map.js +280 -0
- package/dist/components/virtual-waterfall/list-map.js.map +1 -0
- package/dist/components/virtual-waterfall/preset.d.ts +60 -0
- package/dist/components/virtual-waterfall/preset.js +170 -0
- package/dist/components/virtual-waterfall/preset.js.map +1 -0
- package/dist/components/virtual-waterfall/react/index.d.ts +4 -0
- package/dist/components/virtual-waterfall/react/index.js +26 -0
- package/dist/components/virtual-waterfall/react/index.js.map +1 -0
- package/dist/components/virtual-waterfall/react/waterfall.d.ts +42 -0
- package/dist/components/virtual-waterfall/react/waterfall.js +316 -0
- package/dist/components/virtual-waterfall/react/waterfall.js.map +1 -0
- package/dist/components/virtual-waterfall/react/wrapper.d.ts +3 -0
- package/dist/components/virtual-waterfall/react/wrapper.js +50 -0
- package/dist/components/virtual-waterfall/react/wrapper.js.map +1 -0
- package/dist/components/virtual-waterfall/vue/index.d.ts +17 -0
- package/dist/components/virtual-waterfall/vue/index.js +12 -0
- package/dist/components/virtual-waterfall/vue/index.js.map +1 -0
- package/dist/components/virtual-waterfall/vue/waterfall.d.ts +443 -0
- package/dist/components/virtual-waterfall/vue/waterfall.js +410 -0
- package/dist/components/virtual-waterfall/vue/waterfall.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/convert.d.ts +2 -2
- package/dist/utils/convert.js.map +1 -1
- package/dist/utils/dom.d.ts +7 -0
- package/dist/utils/dom.js +45 -0
- package/dist/utils/dom.js.map +1 -0
- package/dist/utils/helper.d.ts +10 -0
- package/dist/utils/helper.js +51 -0
- package/dist/utils/helper.js.map +1 -0
- package/dist/utils/index.d.ts +6 -4
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/lodash.d.ts +3 -1
- package/dist/utils/lodash.js +30 -1
- package/dist/utils/lodash.js.map +1 -1
- package/dist/utils/math.js.map +1 -1
- package/dist/utils/vue-render.d.ts +4 -0
- package/dist/{components/virtual-list/vue/render.js → utils/vue-render.js} +2 -2
- package/dist/utils/vue-render.js.map +1 -0
- package/package.json +8 -6
- package/dist/components/virtual-list/vue/render.d.ts +0 -4
- package/dist/components/virtual-list/vue/render.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sources":["../../../../src/components/virtual-list/react/validate.ts"],"sourcesContent":["import type { IProps } from '../preset'\nimport type { IState } from './list'\n\nlet devWarningsDirection = null\nlet devWarningsTagName = null\n\nif (process.env.NODE_ENV !== 'production') {\n if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {\n devWarningsDirection
|
|
1
|
+
{"version":3,"file":"validate.js","sources":["../../../../src/components/virtual-list/react/validate.ts"],"sourcesContent":["import type { IProps } from '../preset'\nimport type { IState } from './list'\n\nlet devWarningsDirection = null\nlet devWarningsTagName = null\n\nif (process.env.NODE_ENV !== 'production') {\n if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {\n devWarningsDirection = /* #__PURE__ */ new WeakSet()\n devWarningsTagName = /* #__PURE__ */ new WeakSet()\n }\n}\n\nexport const validateListProps = ({\n item,\n direction,\n layout,\n itemTagName,\n innerTagName,\n outerTagName,\n itemSize\n}: IProps, {\n instance,\n}: IState) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!['number', 'function'].includes(typeof itemSize)) {\n throw Error('An invalid \"itemSize\" prop has been specified. ' + 'Value should be a number or function. ' + `\"${itemSize === null ? 'null' : typeof itemSize}\" was specified.`)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (innerTagName != null || outerTagName != null || itemTagName != null) {\n if (devWarningsTagName && !devWarningsTagName.has(instance)) {\n devWarningsTagName.add(instance)\n console.warn('The itemTagName、innerTagName and outerTagName props have been deprecated. ' + 'Please use the itemElementType、innerElementType and outerElementType props instead.')\n }\n }\n\n switch (direction as string) {\n case 'horizontal':\n case 'vertical':\n if (devWarningsDirection && !devWarningsDirection.has(instance)) {\n devWarningsDirection.add(instance)\n console.warn('The direction prop should be either \"ltr\" (default) or \"rtl\". ' + 'Please use the layout prop to specify \"vertical\" (default) or \"horizontal\" orientation.')\n }\n\n break\n\n case 'ltr':\n case 'rtl':\n // Valid values\n break\n\n default:\n throw Error('An invalid \"direction\" prop has been specified. ' + 'Value should be either \"ltr\" or \"rtl\". ' + `\"${direction}\" was specified.`)\n }\n\n switch (layout) {\n case 'horizontal':\n case 'vertical':\n // Valid values\n break\n\n default:\n throw Error('An invalid \"layout\" prop has been specified. ' + 'Value should be either \"horizontal\" or \"vertical\". ' + `\"${layout}\" was specified.`)\n }\n\n if (item == null) {\n throw Error('An invalid \"item\" prop has been specified. ' + 'Value should be a React component. ' + `\"${item === null ? 'null' : typeof item}\" was specified.`)\n }\n\n // if (isHorizontal && typeof width !== 'number') {\n // throw Error('An invalid \"width\" prop has been specified. ' + 'Horizontal lists must specify a number for width. ' + `\"${width === null ? 'null' : typeof width}\" was specified.`)\n // } else if (!isHorizontal && typeof height !== 'number') {\n // throw Error('An invalid \"height\" prop has been specified. ' + 'Vertical lists must specify a number for height. ' + `\"${height === null ? 'null' : typeof height}\" was specified.`)\n // }\n }\n\n return null\n}\n"],"names":[],"mappings":"AAGA,IAAI,oBAAoB,GAAG,IAAI,CAAA;AAC/B,IAAI,kBAAkB,GAAG,IAAI,CAAA;AAE7B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,WAAW,EAAE;AAC1E,QAAA,oBAAoB,mBAAmB,IAAI,OAAO,EAAE,CAAA;AACpD,QAAA,kBAAkB,mBAAmB,IAAI,OAAO,EAAE,CAAA;AACnD,KAAA;AACF,CAAA;AAEY,MAAA,iBAAiB,GAAG,CAAC,EAChC,IAAI,EACJ,SAAS,EACT,MAAM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AkD,GAAG,yCAAyC,GAAG,CAAI,CAAA,EAAA,SAAS,CAAkB,gBAAA,CAAA,CAAC,CAAA;AAChJ,SAAA;AAED,QAAA,QAAQ,MAAM;AACZ,YAAA,KAAK,YAAY,CAAC;AAClB,YAAA,KAAK,UAAU;;gBAEb,MAAK;AAEP,YAAA;gBACE,MAAM,KAAK,CAAC,+CAA+C,GAAG,qDAAqD,GAAG,CAAI,CAAA,EAAA,MAAM,CAAkB,gBAAA,CAAA,CAAC,CAAA;AACtJ,SAAA;QAED,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,MAAM,KAAK,CAAC,6CAA6C,GAAG,qCAAqC,GAAG,CAAA,CAAA,EAAI,IAAI,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,IAAI,CAAkB,gBAAA,CAAA,CAAC,CAAA;AAChK,SAAA;;;;;;AAOF,KAAA;AAED,IAAA,OAAO,IAAI,CAAA;AACb;;;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __rest } from '../../../node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import '../../../utils/index.js';
|
|
4
|
+
import { convertPX2Int } from '../../../utils/convert.js';
|
|
5
|
+
|
|
6
|
+
function getRenderExpandNodes({ direction, isHorizontal, isRtl, id: sid, innerElement, renderExpand, }) {
|
|
7
|
+
const props = {
|
|
8
|
+
id: `${sid}-${direction}`,
|
|
9
|
+
style: {
|
|
10
|
+
visibility: 'hidden',
|
|
11
|
+
height: isHorizontal ? '100%' : 100,
|
|
12
|
+
width: isHorizontal ? 100 : '100%',
|
|
13
|
+
[isHorizontal ? isRtl ? 'marginRight' : 'marginLeft' : 'marginTop']: -100,
|
|
14
|
+
zIndex: -1,
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const expands = [renderExpand, React.createElement(innerElement, props)];
|
|
18
|
+
if (isHorizontal ? isRtl ? direction === 'right' : direction === 'left' : direction === 'top') {
|
|
19
|
+
expands.reverse();
|
|
20
|
+
}
|
|
21
|
+
return expands;
|
|
22
|
+
}
|
|
23
|
+
const outerWrapper = React.forwardRef(function OuterWrapper(props, ref) {
|
|
24
|
+
const _a = props, { id = '', className, style = {}, children, outerElementType, innerElementType, onScroll, onScrollNative, renderTop, renderBottom, layout, direction } = _a, rest = __rest(_a, ["id", "className", "style", "children", "outerElementType", "innerElementType", "onScroll", "onScrollNative", "renderTop", "renderBottom", "layout", "direction"]);
|
|
25
|
+
const handleScroll = (event) => {
|
|
26
|
+
onScroll === null || onScroll === void 0 ? void 0 : onScroll(Object.assign(Object.assign({}, event), { currentTarget: Object.assign(Object.assign({}, event.detail), { clientWidth: convertPX2Int(style.width), clientHeight: convertPX2Int(style.height) }) }));
|
|
27
|
+
if (typeof onScrollNative === 'function') {
|
|
28
|
+
onScrollNative(event);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const isHorizontal = layout === 'horizontal';
|
|
32
|
+
const isRtl = direction === 'rtl';
|
|
33
|
+
return React.createElement(outerElementType, Object.assign({ ref,
|
|
34
|
+
id,
|
|
35
|
+
className,
|
|
36
|
+
style, scrollY: !isHorizontal, scrollX: isHorizontal, onScroll: handleScroll }, rest), [
|
|
37
|
+
getRenderExpandNodes({
|
|
38
|
+
direction: isHorizontal ? isRtl ? 'right' : 'left' : 'top',
|
|
39
|
+
isHorizontal,
|
|
40
|
+
isRtl,
|
|
41
|
+
id,
|
|
42
|
+
innerElement: innerElementType,
|
|
43
|
+
renderExpand: renderTop,
|
|
44
|
+
}),
|
|
45
|
+
children,
|
|
46
|
+
getRenderExpandNodes({
|
|
47
|
+
direction: isHorizontal ? isRtl ? 'left' : 'right' : 'bottom',
|
|
48
|
+
isHorizontal,
|
|
49
|
+
isRtl,
|
|
50
|
+
id,
|
|
51
|
+
innerElement: innerElementType,
|
|
52
|
+
renderExpand: renderBottom,
|
|
53
|
+
}),
|
|
54
|
+
]);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export { outerWrapper as default };
|
|
58
|
+
//# sourceMappingURL=wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapper.js","sources":["../../../../src/components/virtual-list/react/wrapper.ts"],"sourcesContent":["import React, { PropsWithChildren } from 'react'\n\nimport { convertPX2Int } from '../../../utils'\n\nimport type { BaseEventOrig } from '@tarojs/components'\nimport type { VirtualListProps } from '..'\nimport type { IProps } from '../preset'\n\nfunction getRenderExpandNodes ({\n direction,\n isHorizontal,\n isRtl,\n id: sid,\n innerElement,\n renderExpand,\n}: {\n direction: 'top' | 'bottom' | 'left' | 'right'\n isHorizontal: boolean\n isRtl: boolean\n id: string\n innerElement: VirtualListProps['innerElementType']\n renderExpand?: VirtualListProps['renderTop'] | VirtualListProps['renderBottom']\n}) {\n const props: any = {\n id: `${sid}-${direction}`,\n style: {\n visibility: 'hidden',\n height: isHorizontal ? '100%' : 100,\n width: isHorizontal ? 100 : '100%',\n [isHorizontal ? isRtl ? 'marginRight' : 'marginLeft': 'marginTop']: -100,\n zIndex: -1,\n }\n }\n const expands = [renderExpand, React.createElement(\n innerElement!,\n props,\n )]\n if (isHorizontal ? isRtl ? direction === 'right' : direction === 'left' : direction === 'top') {\n expands.reverse()\n }\n return expands\n}\n\nconst outerWrapper = React.forwardRef(\n function OuterWrapper (props, ref) {\n const {\n id = '', className, style = {}, children,\n outerElementType, innerElementType,\n onScroll, onScrollNative,\n renderTop, renderBottom,\n layout, direction,\n ...rest\n } = props as PropsWithChildren<IProps>\n const handleScroll = (event: BaseEventOrig<VirtualListProps.IVirtualListEventDetail>) => {\n onScroll?.({\n ...event as any,\n currentTarget: {\n ...event.detail,\n clientWidth: convertPX2Int(style.width),\n clientHeight: convertPX2Int(style.height)\n } as any\n })\n\n if (typeof onScrollNative === 'function') {\n onScrollNative(event)\n }\n }\n const isHorizontal = layout === 'horizontal'\n const isRtl = direction === 'rtl'\n\n return React.createElement<any>(outerElementType!, {\n ref,\n id,\n className,\n style,\n scrollY: !isHorizontal,\n scrollX: isHorizontal,\n onScroll: handleScroll,\n ...rest\n }, [\n getRenderExpandNodes({\n direction: isHorizontal ? isRtl ? 'right' : 'left': 'top',\n isHorizontal,\n isRtl,\n id,\n innerElement: innerElementType,\n renderExpand: renderTop,\n }),\n children,\n getRenderExpandNodes({\n direction: isHorizontal ? isRtl ? 'left' : 'right' : 'bottom',\n isHorizontal,\n isRtl,\n id,\n innerElement: innerElementType,\n renderExpand: renderBottom,\n }),\n ])\n }\n)\n\nexport default outerWrapper\n"],"names":[],"mappings":";;;;;AAQA,SAAS,oBAAoB,CAAE,EAC7B,SAAS,EACT,YAAY,EACZ,KAAK,EACL,EAAE,EAAE,GAAG,EACP,YAAY,EACZ,YAAY,GAQb,EAAA;AACC,IAAA,MAAM,KAAK,GAAQ;AACjB,QAAA,EAAE,EAAE,CAAA,EAAG,GAAG,CAAA,CAAA,EAAI,SAAS,CAAE,CAAA;AACzB,QAAA,KAAK,EAAE;AACL,YAAA,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,GAAG;YACnC,KAAK,EAAE,YAAY,GAAG,GAAG,GAAG,MAAM;YAClC,CAAC,YAAY,GAAG,KAAK,GAAG,aAAa,GAAG,YAAY,GAAE,WAAW,GAAG,CAAC,GAAG;YACxE,MAAM,EAAE,CAAC,CAAC;AACX,SAAA;KACF,CAAA;AACD,IAAA,MAAM,OAAO,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,aAAa,CAChD,YAAa,EACb,KAAK,CACN,CAAC,CAAA;IACF,IAAI,YAAY,GAAG,KAAK,GAAG,SAAS,KAAK,OAAO,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,KAAK,KAAK,EAAE;QAC7F,OAAO,CAAC,OAAO,EAAE,CAAA;AAClB,KAAA;AACD,IAAA,OAAO,OAAO,CAAA;AAChB,CAAC;AAEK,MAAA,YAAY,GAAG,KAAK,CAAC,UAAU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YAAY,EACtB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,YAAY,EAAA,EACnB,IAAI,CACN,EAAA;AACD,QAAA,oBAAoB,CAAC;AACnB,YAAA,SAAS,EAAE,YAAY,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAE,KAAK;YACzD,YAAY;YACZ,KAAK;YACL,EAAE;AACF,YAAA,YAAY,EAAE,gBAAgB;AAC9B,YAAA,YAAY,EAAE,SAAS;SACxB,CAAC;QACF,QAAQ;AACR,QAAA,oBAAoB,CAAC;AACnB,YAAA,SAAS,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ;YAC7D,YAAY;YACZ,KAAK;YACL,EAAE;AACF,YAAA,YAAY,EAAE,gBAAgB;AAC9B,YAAA,YAAY,EAAE,YAAY;SAC3B,CAAC;AACH,KAAA,CAAC,CAAA;AACJ,CAAC;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
declare const defaultItemKey: (index: number, _itemData?: unknown) => number;
|
|
2
1
|
interface IHorizontal {
|
|
3
2
|
direction?: string;
|
|
4
3
|
layout?: string;
|
|
@@ -8,6 +7,4 @@ interface IRrl {
|
|
|
8
7
|
direction?: string;
|
|
9
8
|
}
|
|
10
9
|
declare function isRtlFunc({ direction }: IRrl): boolean;
|
|
11
|
-
|
|
12
|
-
declare function getScrollViewContextNode(id: string): Promise<unknown>;
|
|
13
|
-
export { defaultItemKey, isHorizontalFunc, isRtlFunc, getRectSize, getScrollViewContextNode };
|
|
10
|
+
export { isHorizontalFunc, isRtlFunc };
|
|
@@ -1,36 +1,9 @@
|
|
|
1
|
-
import { createSelectorQuery } from '@tarojs/taro';
|
|
2
|
-
|
|
3
|
-
// In DEV mode, this Set helps us only log a warning once per component instance.
|
|
4
|
-
// This avoids spamming the console every time a render happens.
|
|
5
|
-
const defaultItemKey = (index, _itemData) => index;
|
|
6
1
|
function isHorizontalFunc({ direction, layout }) {
|
|
7
2
|
return direction === 'horizontal' || layout === 'horizontal';
|
|
8
3
|
}
|
|
9
4
|
function isRtlFunc({ direction }) {
|
|
10
5
|
return direction === 'rtl';
|
|
11
6
|
}
|
|
12
|
-
function getRectSize(id, success, fail, retryMs = 500) {
|
|
13
|
-
const query = createSelectorQuery();
|
|
14
|
-
try {
|
|
15
|
-
query.select(id).boundingClientRect((res) => {
|
|
16
|
-
if (res) {
|
|
17
|
-
success === null || success === void 0 ? void 0 : success(res);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
fail === null || fail === void 0 ? void 0 : fail();
|
|
21
|
-
}
|
|
22
|
-
}).exec();
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
getRectSize(id, success, fail, retryMs);
|
|
27
|
-
}, retryMs);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
async function getScrollViewContextNode(id) {
|
|
31
|
-
const query = createSelectorQuery();
|
|
32
|
-
return new Promise((resolve) => query.select(id).node(({ node }) => resolve(node)).exec());
|
|
33
|
-
}
|
|
34
7
|
|
|
35
|
-
export {
|
|
8
|
+
export { isHorizontalFunc, isRtlFunc };
|
|
36
9
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/virtual-list/utils.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/virtual-list/utils.ts"],"sourcesContent":["interface IHorizontal {\n direction?: string\n layout?: string\n}\nexport function isHorizontalFunc ({ direction, layout }: IHorizontal) {\n return direction === 'horizontal' || layout === 'horizontal'\n}\ninterface IRrl {\n direction?: string\n}\nexport function isRtlFunc ({ direction }: IRrl) {\n return direction === 'rtl'\n}\n"],"names":[],"mappings":"SAIgB,gBAAgB,CAAE,EAAE,SAAS,EAAE,MAAM,EAAe,EAAA;AAClE,IAAA,OAAO,SAAS,KAAK,YAAY,IAAI,MAAM,KAAK,YAAY,CAAA;AAC9D,CAAC;AAIe,SAAA,SAAS,CAAE,EAAE,SAAS,EAAQ,EAAA;IAC5C,OAAO,SAAS,KAAK,KAAK,CAAA;AAC5B;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementAttrs, TransformReact2VueType } from '@tarojs/components/types/index.vue3';
|
|
2
2
|
import { App } from 'vue';
|
|
3
|
-
import { VirtualListProps } from "../index";
|
|
3
|
+
import { VirtualListProps } from "../index.js";
|
|
4
4
|
type VueVirtualListProps = Omit<VirtualListProps, 'renderTop' | 'renderBottom'>;
|
|
5
5
|
declare global {
|
|
6
6
|
namespace JSX {
|