@rainbow-oh/yee-c 0.14.4 → 0.14.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/cjs/Form/form-store.js +3 -3
- package/dist/cjs/style/themes.css +1 -1
- package/dist/cjs/style/variables.css +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Form/form-store.js +7 -3
- package/dist/esm/style/themes.css +1 -1
- package/dist/esm/style/variables.css +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/yee-c.min.js +1 -1
- package/package.json +1 -1
- package/src/Form/form-store.test.ts +19 -0
- package/src/Form/form-store.ts +7 -3
- package/src/version.ts +1 -1
|
@@ -105,15 +105,15 @@ var FormStore = class {
|
|
|
105
105
|
initialValues,
|
|
106
106
|
callbacks
|
|
107
107
|
}) => {
|
|
108
|
+
if (callbacks) {
|
|
109
|
+
this.setCallbacks(callbacks);
|
|
110
|
+
}
|
|
108
111
|
if (!this.initialized) {
|
|
109
112
|
this.initialized = true;
|
|
110
113
|
if (initialValues) {
|
|
111
114
|
this.store = __spreadValues(__spreadValues({}, this.store), initialValues);
|
|
112
115
|
this.initialValues = JSON.parse(JSON.stringify(initialValues));
|
|
113
116
|
}
|
|
114
|
-
if (callbacks) {
|
|
115
|
-
this.setCallbacks(callbacks);
|
|
116
|
-
}
|
|
117
117
|
this.fieldEntities.forEach((entity) => {
|
|
118
118
|
entity == null ? void 0 : entity.onStoreChange();
|
|
119
119
|
});
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -62,15 +62,19 @@ export var FormStore = /*#__PURE__*/function () {
|
|
|
62
62
|
_defineProperty(this, "initialize", function (_ref) {
|
|
63
63
|
var initialValues = _ref.initialValues,
|
|
64
64
|
callbacks = _ref.callbacks;
|
|
65
|
+
// callbacks 每次挂载重绑:form 实例可由外层 useForm 持有、跨越 <Form> 卸载/重挂载存活,
|
|
66
|
+
// 若只在此处注册一次,重挂载后 store 仍持旧挂载的 useEvent 闭包,其 ref 已随旧实例
|
|
67
|
+
// 死亡(不再更新),onValuesChange 等会以过期闭包执行。
|
|
68
|
+
if (callbacks) {
|
|
69
|
+
_this.setCallbacks(callbacks);
|
|
70
|
+
}
|
|
65
71
|
if (!_this.initialized) {
|
|
66
72
|
_this.initialized = true;
|
|
67
73
|
if (initialValues) {
|
|
68
74
|
_this.store = _objectSpread(_objectSpread({}, _this.store), initialValues);
|
|
69
75
|
_this.initialValues = JSON.parse(JSON.stringify(initialValues));
|
|
70
76
|
}
|
|
71
|
-
|
|
72
|
-
_this.setCallbacks(callbacks);
|
|
73
|
-
}
|
|
77
|
+
|
|
74
78
|
// Only refresh field entities, do not notify watchers (no value changes to watch during initialization)
|
|
75
79
|
_this.fieldEntities.forEach(function (entity) {
|
|
76
80
|
entity === null || entity === void 0 || entity.onStoreChange();
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED