@pisell/materials 1.0.508 → 1.0.509
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +8 -7
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +1 -6
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, useRef
|
|
1
|
+
import React, { useMemo, useRef } from 'react';
|
|
2
2
|
import { isArr, isString, isUndefined } from '@pisell/utils';
|
|
3
3
|
import { useMemoizedFn } from 'ahooks';
|
|
4
4
|
import VariablesContext from "./VariablesContext";
|
|
@@ -18,14 +18,15 @@ var VariablesProvider = function VariablesProvider(props) {
|
|
|
18
18
|
variables = props.variables;
|
|
19
19
|
|
|
20
20
|
// 变量存储
|
|
21
|
-
var variablesRef = useRef({});
|
|
21
|
+
var variablesRef = useRef(variables || {});
|
|
22
22
|
// 添加变量变化监听器存储
|
|
23
23
|
var listenersRef = useRef(new Set());
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
24
|
+
|
|
25
|
+
// useEffect(() => {
|
|
26
|
+
// if (variables) {
|
|
27
|
+
// variablesRef.current = variables;
|
|
28
|
+
// }
|
|
29
|
+
// }, [variables]);
|
|
29
30
|
|
|
30
31
|
// 注册变量
|
|
31
32
|
var registerVariable = useMemoizedFn(function (value) {
|
|
@@ -47,13 +47,8 @@ var defaultCustomizer = (objValue, srcValue) => {
|
|
|
47
47
|
var VARIABLE_PATTERN = /{{([^}]+)}}/g;
|
|
48
48
|
var VariablesProvider = (props) => {
|
|
49
49
|
const { children, variables } = props;
|
|
50
|
-
const variablesRef = (0, import_react.useRef)({});
|
|
50
|
+
const variablesRef = (0, import_react.useRef)(variables || {});
|
|
51
51
|
const listenersRef = (0, import_react.useRef)(/* @__PURE__ */ new Set());
|
|
52
|
-
(0, import_react.useEffect)(() => {
|
|
53
|
-
if (variables) {
|
|
54
|
-
variablesRef.current = variables;
|
|
55
|
-
}
|
|
56
|
-
}, [variables]);
|
|
57
52
|
const registerVariable = (0, import_ahooks.useMemoizedFn)((value2) => {
|
|
58
53
|
variablesRef.current = (0, import_utils3.mergeWith)(
|
|
59
54
|
variablesRef.current,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.509",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"styled-components": "^6.0.0-rc.3",
|
|
69
69
|
"libphonenumber-js": "^1.11.17",
|
|
70
70
|
"swiper": "^8.4.7",
|
|
71
|
-
"@pisell/
|
|
71
|
+
"@pisell/icon": "0.0.10",
|
|
72
72
|
"@pisell/utils": "1.0.43",
|
|
73
|
-
"@pisell/
|
|
73
|
+
"@pisell/date-picker": "1.0.114"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"react": "^18.0.0",
|