@tarojs/components-react 4.1.4-beta.3 → 4.1.4-beta.5
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/button/index.js.map +1 -1
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/image/index.js.map +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/pull-down-refresh/index.js +14 -10
- package/dist/components/pull-down-refresh/index.js.map +1 -1
- package/dist/components/scroll-view/index.js +11 -3
- package/dist/components/scroll-view/index.js.map +1 -1
- package/dist/components/swiper/index.js +30 -27
- package/dist/components/swiper/index.js.map +1 -1
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/view/index.js.map +1 -1
- package/dist/solid/components/button/index.js.map +1 -1
- package/dist/solid/components/icon/index.js.map +1 -1
- package/dist/solid/components/image/index.js.map +1 -1
- package/dist/solid/components/scroll-view/index.js +11 -3
- package/dist/solid/components/scroll-view/index.js.map +1 -1
- package/dist/solid/components/text/index.js.map +1 -1
- package/dist/solid/components/view/index.js.map +1 -1
- package/dist/solid/utils/hooks.solid.js +10 -5
- package/dist/solid/utils/hooks.solid.js.map +1 -1
- package/dist/solid/utils/index.js +14 -4
- package/dist/solid/utils/index.js.map +1 -1
- package/dist/utils/hooks.react.js.map +1 -1
- package/dist/utils/index.js +14 -4
- package/dist/utils/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.react.js","sources":["../../src/utils/hooks.react.ts"],"sourcesContent":["import * as React from 'react'\n\nexport const useState = React.useState\n\nexport const useCallback = React.useCallback\n\nexport const useEffect = React.useEffect\n\nexport const useMemo = React.useMemo\n\nexport const useRef = React.useRef\n\nexport const createContext = React.createContext\nexport const useContext = React.useContext\nexport const memo = React.memo\nexport const forwardRef = React.forwardRef\nexport const useImperativeHandle = React.useImperativeHandle\n"],"names":["useState","React","useCallback","useEffect","useMemo","useRef","createContext","useContext","memo","forwardRef","useImperativeHandle"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"hooks.react.js","sources":["../../src/utils/hooks.react.ts"],"sourcesContent":["import * as React from 'react'\n\nexport const useState = React.useState\n\nexport const useCallback = React.useCallback\n\nexport const useEffect = React.useEffect\n\nexport const useMemo = React.useMemo\n\nexport const useRef = React.useRef\n\nexport const createContext = React.createContext\nexport const useContext = React.useContext\nexport const memo = React.memo\nexport const forwardRef = React.forwardRef\nexport const useImperativeHandle = React.useImperativeHandle\n"],"names":["useState","React","useCallback","useEffect","useMemo","useRef","createContext","useContext","memo","forwardRef","useImperativeHandle"],"mappings":";;AAEaA,MAAAA,QAAQ,GAAGC,KAAK,CAACD;AAEjBE,MAAAA,WAAW,GAAGD,KAAK,CAACC;AAEpBC,MAAAA,SAAS,GAAGF,KAAK,CAACE;AAElBC,MAAAA,OAAO,GAAGH,KAAK,CAACG;AAEhBC,MAAAA,MAAM,GAAGJ,KAAK,CAACI;AAEfC,MAAAA,aAAa,GAAGL,KAAK,CAACK;AACtBC,MAAAA,UAAU,GAAGN,KAAK,CAACM;AACnBC,MAAAA,IAAI,GAAGP,KAAK,CAACO;AACbC,MAAAA,UAAU,GAAGR,KAAK,CAACQ;AACnBC,MAAAA,mBAAmB,GAAGT,KAAK,CAACS;;;;"}
|
package/dist/utils/index.js
CHANGED
|
@@ -2,10 +2,15 @@ import { forwardRef } from './hooks.react.js';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
/* eslint-disable react/react-in-jsx-scope */
|
|
5
|
-
function throttle(fn
|
|
5
|
+
function throttle(fn) {
|
|
6
|
+
let threshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250;
|
|
7
|
+
let scope = arguments.length > 2 ? arguments[2] : undefined;
|
|
6
8
|
let lastTime = 0;
|
|
7
9
|
let deferTimer;
|
|
8
|
-
return function (
|
|
10
|
+
return function () {
|
|
11
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12
|
+
args[_key] = arguments[_key];
|
|
13
|
+
}
|
|
9
14
|
const context = scope || this;
|
|
10
15
|
const now = Date.now();
|
|
11
16
|
if (now - lastTime > threshold) {
|
|
@@ -20,9 +25,14 @@ function throttle(fn, threshold = 250, scope) {
|
|
|
20
25
|
}
|
|
21
26
|
};
|
|
22
27
|
}
|
|
23
|
-
function debounce(fn
|
|
28
|
+
function debounce(fn) {
|
|
29
|
+
let ms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250;
|
|
30
|
+
let scope = arguments.length > 2 ? arguments[2] : undefined;
|
|
24
31
|
let timer;
|
|
25
|
-
return function (
|
|
32
|
+
return function () {
|
|
33
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
34
|
+
args[_key2] = arguments[_key2];
|
|
35
|
+
}
|
|
26
36
|
const context = scope || this;
|
|
27
37
|
clearTimeout(timer);
|
|
28
38
|
timer = setTimeout(function () {
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/index.tsx"],"sourcesContent":["/* eslint-disable react/react-in-jsx-scope */\nimport { forwardRef } from './hooks'\n\nexport function throttle (fn, threshold = 250, scope?) {\n let lastTime = 0\n let deferTimer: ReturnType<typeof setTimeout>\n return function (...args) {\n const context = scope || this\n const now = Date.now()\n if (now - lastTime > threshold) {\n fn.apply(this, args)\n lastTime = now\n } else {\n clearTimeout(deferTimer)\n deferTimer = setTimeout(() => {\n lastTime = now\n fn.apply(context, args)\n }, threshold)\n }\n }\n}\n\nexport function debounce (fn, ms = 250, scope?) {\n let timer: ReturnType<typeof setTimeout>\n\n return function (...args) {\n const context = scope || this\n clearTimeout(timer)\n timer = setTimeout(function () {\n fn.apply(context, args)\n }, ms)\n }\n}\n\nexport function omit (obj, fields) {\n const shallowCopy = Object.assign({}, obj)\n for (let i = 0; i < fields.length; i += 1) {\n const key = fields[i]\n delete shallowCopy[key]\n }\n return shallowCopy\n}\n\nexport const createForwardRefComponent = (ReactComponent: any) => {\n const forwardRefComponent = (\n props,\n ref\n ) => <ReactComponent {...props} forwardedRef={ref} />\n\n return forwardRef(forwardRefComponent)\n}\n\n"],"names":["throttle","fn","threshold","scope","lastTime","deferTimer","args","context","now","Date","apply","clearTimeout","setTimeout","debounce","ms","timer","omit","obj","fields","shallowCopy","Object","assign","i","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/index.tsx"],"sourcesContent":["/* eslint-disable react/react-in-jsx-scope */\nimport { forwardRef } from './hooks'\n\nexport function throttle (fn, threshold = 250, scope?) {\n let lastTime = 0\n let deferTimer: ReturnType<typeof setTimeout>\n return function (...args) {\n const context = scope || this\n const now = Date.now()\n if (now - lastTime > threshold) {\n fn.apply(this, args)\n lastTime = now\n } else {\n clearTimeout(deferTimer)\n deferTimer = setTimeout(() => {\n lastTime = now\n fn.apply(context, args)\n }, threshold)\n }\n }\n}\n\nexport function debounce (fn, ms = 250, scope?) {\n let timer: ReturnType<typeof setTimeout>\n\n return function (...args) {\n const context = scope || this\n clearTimeout(timer)\n timer = setTimeout(function () {\n fn.apply(context, args)\n }, ms)\n }\n}\n\nexport function omit (obj, fields) {\n const shallowCopy = Object.assign({}, obj)\n for (let i = 0; i < fields.length; i += 1) {\n const key = fields[i]\n delete shallowCopy[key]\n }\n return shallowCopy\n}\n\nexport const createForwardRefComponent = (ReactComponent: any) => {\n const forwardRefComponent = (\n props,\n ref\n ) => <ReactComponent {...props} forwardedRef={ref} />\n\n return forwardRef(forwardRefComponent)\n}\n\n"],"names":["throttle","fn","threshold","arguments","length","undefined","scope","lastTime","deferTimer","_len","args","Array","_key","context","now","Date","apply","clearTimeout","setTimeout","debounce","ms","timer","_len2","_key2","omit","obj","fields","shallowCopy","Object","assign","i","key","createForwardRefComponent","ReactComponent","forwardRefComponent","props","ref","_jsx","forwardedRef","forwardRef"],"mappings":";;;AAAA;AAGM,SAAUA,Q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K;AAAEG,IAAAA,YAAY,EAAEF;AAAI,GAAA,CAAG;EAErD,OAAOG,UAAU,CAACL,mBAAmB,CAAC;AACxC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/components-react",
|
|
3
|
-
"version": "4.1.4-beta.
|
|
3
|
+
"version": "4.1.4-beta.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main:h5": "dist/index.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"classnames": "^2.2.5",
|
|
29
29
|
"swiper": "11.1.15",
|
|
30
30
|
"tslib": "^2.6.2",
|
|
31
|
-
"@tarojs/
|
|
32
|
-
"@tarojs/
|
|
33
|
-
"@tarojs/components": "4.1.4-beta.
|
|
31
|
+
"@tarojs/shared": "4.1.4-beta.5",
|
|
32
|
+
"@tarojs/taro": "4.1.4-beta.5",
|
|
33
|
+
"@tarojs/components": "4.1.4-beta.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/preset-react": "^7.24.1",
|
|
37
37
|
"babel-preset-solid": "^1.8.15",
|
|
38
38
|
"solid-js": "^1.8.16",
|
|
39
|
-
"@tarojs/
|
|
40
|
-
"@tarojs/
|
|
39
|
+
"@tarojs/helper": "4.1.4-beta.5",
|
|
40
|
+
"@tarojs/runtime": "4.1.4-beta.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "*",
|