@tarojs/components-advanced 4.1.1 → 4.1.2-alpha.1

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.
@@ -8,16 +8,18 @@ function getRenderExpandNodes({ direction, id: sid, innerElement, renderExpand,
8
8
  const props = {
9
9
  key: id,
10
10
  id,
11
- };
12
- if (!renderExpand) {
13
- props.style = {
11
+ style: {
14
12
  visibility: 'hidden',
15
13
  height: 100,
16
14
  marginTop: -100,
17
15
  zIndex: -1,
18
- };
16
+ }
17
+ };
18
+ const expands = [renderExpand && React.createElement(renderExpand), React.createElement(innerElement, props)];
19
+ if (direction === 'top') {
20
+ expands.reverse();
19
21
  }
20
- return React.createElement(renderExpand || innerElement, props);
22
+ return expands;
21
23
  }
22
24
  const outerWrapper = React.forwardRef(function OuterWrapper(props, ref) {
23
25
  const _a = props, { id, className, style, children, outerElementType, innerElementType, onScroll, onScrollNative, renderTop, renderBottom } = _a, rest = __rest(_a, ["id", "className", "style", "children", "outerElementType", "innerElementType", "onScroll", "onScrollNative", "renderTop", "renderBottom"]);
@@ -1 +1 @@
1
- {"version":3,"file":"wrapper.js","sources":["../../../../src/components/virtual-waterfall/react/wrapper.ts"],"sourcesContent":["import React, { PropsWithChildren } from 'react'\n\nimport { convertPX2Int } from '../../../utils'\n\nimport type { BaseEventOrig } from '@tarojs/components'\nimport type { VirtualWaterfallProps } from '..'\nimport type { IProps } from '../preset'\n\nfunction getRenderExpandNodes ({\n direction,\n id: sid,\n innerElement,\n renderExpand,\n}: {\n direction: 'top' | 'bottom'\n id: string\n innerElement: VirtualWaterfallProps['innerElementType']\n renderExpand?: VirtualWaterfallProps['renderTop'] | VirtualWaterfallProps['renderBottom']\n}) {\n const id = `${sid}-${direction}`\n const props: any = {\n key: id,\n id,\n }\n if (!renderExpand) {\n props.style = {\n visibility: 'hidden',\n height: 100,\n marginTop: -100,\n zIndex: -1,\n }\n }\n return React.createElement(\n renderExpand || innerElement,\n props,\n )\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 ...rest\n } = props as PropsWithChildren<IProps>\n const handleScroll = (event: BaseEventOrig<VirtualWaterfallProps.IVirtualWaterfallEventDetail>) => {\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\n return React.createElement<any>(outerElementType, {\n ref,\n id,\n className,\n style,\n scrollY: true,\n onScroll: handleScroll,\n ...rest\n }, [\n getRenderExpandNodes({\n direction: 'top',\n id,\n innerElement: innerElementType,\n renderExpand: renderTop,\n }),\n children,\n getRenderExpandNodes({\n direction: 'bottom',\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,EAAE,EAAE,GAAG,EACP,YAAY,EACZ,YAAY,GAMb,EAAA;AACC,IAAA,MAAM,EAAE,GAAG,CAAA,EAAG,GAAG,CAAI,CAAA,EAAA,SAAS,EAAE;AAChC,IAAA,MAAM,KAAK,GAAQ;AACjB,QAAA,GAAG,EAAE,EAAE;QACP,EAAE;KACH;IACD,IAAI,CAAC,YAAY,EAAE;QACjB,KAAK,CAAC,KAAK,GAAG;AACZ,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,CAAC,GAAG;YACf,MAAM,EAAE,CAAC,CAAC;SACX;;IAEH,OAAO,KAAK,CAAC,aAAa,CACxB,YAAY,IAAI,YAAY,EAC5B,KAAK,CACN;AACH;AAEM,MAAA,YAAY,GAAG,KAAK,CAAC,UAAU,CACnC,SAAS,YAAY,CAAE,KAAK,EAAE,GAAG,EAAA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nB,EAAE;AACF,YAAA,YAAY,EAAE,gBAAgB;AAC9B,YAAA,YAAY,EAAE,YAAY;SAC3B,CAAC;AACH,KAAA,CAAC;AACJ,CAAC;;;;"}
1
+ {"version":3,"file":"wrapper.js","sources":["../../../../src/components/virtual-waterfall/react/wrapper.ts"],"sourcesContent":["import React, { PropsWithChildren } from 'react'\n\nimport { convertPX2Int } from '../../../utils'\n\nimport type { BaseEventOrig } from '@tarojs/components'\nimport type { VirtualWaterfallProps } from '..'\nimport type { IProps } from '../preset'\n\nfunction getRenderExpandNodes ({\n direction,\n id: sid,\n innerElement,\n renderExpand,\n}: {\n direction: 'top' | 'bottom'\n id: string\n innerElement: VirtualWaterfallProps['innerElementType']\n renderExpand?: VirtualWaterfallProps['renderTop'] | VirtualWaterfallProps['renderBottom']\n}) {\n const id = `${sid}-${direction}`\n const props: any = {\n key: id,\n id,\n style: {\n visibility: 'hidden',\n height: 100,\n marginTop: -100,\n zIndex: -1,\n }\n }\n const expands = [renderExpand && React.createElement(renderExpand), React.createElement(innerElement!, props)]\n if (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 ...rest\n } = props as PropsWithChildren<IProps>\n const handleScroll = (event: BaseEventOrig<VirtualWaterfallProps.IVirtualWaterfallEventDetail>) => {\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\n return React.createElement<any>(outerElementType, {\n ref,\n id,\n className,\n style,\n scrollY: true,\n onScroll: handleScroll,\n ...rest\n }, [\n getRenderExpandNodes({\n direction: 'top',\n id,\n innerElement: innerElementType,\n renderExpand: renderTop,\n }),\n children,\n getRenderExpandNodes({\n direction: 'bottom',\n id,\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I;AAChG,QAAA,QAAQ,KAAR,IAAA,IAAA,QAAQ,KAAR,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,QAAQ,iCACH,KAAY,CAAA,EAAA,EACf,aAAa,EAAE,MACV,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,CAAC,MAAM,KACf,WAAW,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,EACvC,YAAY,EAAE,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,EAAA,CACnC,IACR;AAEF,QAAA,IAAI,OAAO,cAAc,KAAK,UAAU,EAAE;YACxC,cAAc,CAAC,KAAK,CAAC;;AAEzB,KAAC;AAED,IAAA,OAAO,KAAK,CAAC,aAAa,CAAM,gBAAgB,kBAC9C,GAAG;QACH,EAAE;QACF,SAAS;QACT,KAAK,EACL,OAAO,EAAE,IAAI,EACb,QAAQ,EAAE,YAAY,EACnB,EAAA,IAAI,CACN,EAAA;AACD,QAAA,oBAAoB,CAAC;AACnB,YAAA,SAAS,EAAE,KAAK;YAChB,EAAE;AACF,YAAA,YAAY,EAAE,gBAAgB;AAC9B,YAAA,YAAY,EAAE,SAAS;SACxB,CAAC;QACF,QAAQ;AACR,QAAA,oBAAoB,CAAC;AACnB,YAAA,SAAS,EAAE,QAAQ;YACnB,EAAE;AACF,YAAA,YAAY,EAAE,gBAAgB;AAC9B,YAAA,YAAY,EAAE,YAAY;SAC3B,CAAC;AACH,KAAA,CAAC;AACJ,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/components-advanced",
3
- "version": "4.1.1",
3
+ "version": "4.1.2-alpha.1",
4
4
  "description": "",
5
5
  "author": "O2Team",
6
6
  "license": "MIT",
@@ -20,21 +20,21 @@
20
20
  "csstype": "^3.1.1",
21
21
  "memoize-one": "^6.0.0",
22
22
  "tslib": "^2.6.2",
23
- "@tarojs/components": "4.1.1"
23
+ "@tarojs/components": "4.1.2-alpha.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "react": "^18.2.0",
27
27
  "react-dom": "^18.2.0",
28
28
  "vue": "3.2.47",
29
- "@tarojs/runtime": "4.1.1",
30
- "@tarojs/taro": "4.1.1",
31
- "@tarojs/shared": "4.1.1"
29
+ "@tarojs/runtime": "4.1.2-alpha.1",
30
+ "@tarojs/taro": "4.1.2-alpha.1",
31
+ "@tarojs/shared": "4.1.2-alpha.1"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=17",
35
- "@tarojs/runtime": "~4.1.1",
36
- "@tarojs/shared": "~4.1.1",
37
- "@tarojs/taro": "~4.1.1"
35
+ "@tarojs/runtime": "~4.1.2-alpha.1",
36
+ "@tarojs/taro": "~4.1.2-alpha.1",
37
+ "@tarojs/shared": "~4.1.2-alpha.1"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "react": {