@zzdadelu/schema-builder 1.0.0-alpha.127 → 1.0.0-alpha.129
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/index.js +15 -8
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/main.js +15 -8
- package/lib/main.js +15 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4136,21 +4136,27 @@
|
|
|
4136
4136
|
});
|
|
4137
4137
|
|
|
4138
4138
|
var _excluded = ["widgets", "settings"];
|
|
4139
|
-
|
|
4139
|
+
if (typeof window !== 'undefined') {
|
|
4140
|
+
console.log('设置全局方法 getFormRenderMaterial', window);
|
|
4141
|
+
window.getFormRenderMaterial = function () {
|
|
4142
|
+
return defaultSetting;
|
|
4143
|
+
};
|
|
4144
|
+
}
|
|
4140
4145
|
var Design = function Design(props, ref) {
|
|
4141
4146
|
var widgets = props.widgets,
|
|
4142
4147
|
settings = props.settings,
|
|
4143
4148
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
4144
4149
|
var containerRef = React.useRef();
|
|
4150
|
+
var iframeRef = React.useRef(null);
|
|
4145
4151
|
React.useImperativeHandle(ref, function () {
|
|
4146
4152
|
return {
|
|
4147
4153
|
getValue: function getValue() {
|
|
4148
|
-
var
|
|
4149
|
-
return (
|
|
4154
|
+
var _iframeRef$current, _iframeRef$current$co, _iframeRef$current$co2, _iframeRef$current$co3;
|
|
4155
|
+
return (_iframeRef$current = iframeRef.current) === null || _iframeRef$current === void 0 ? void 0 : (_iframeRef$current$co = _iframeRef$current.contentWindow) === null || _iframeRef$current$co === void 0 ? void 0 : (_iframeRef$current$co2 = _iframeRef$current$co.__FR_ENGINE__) === null || _iframeRef$current$co2 === void 0 ? void 0 : (_iframeRef$current$co3 = _iframeRef$current$co2.exportSchema) === null || _iframeRef$current$co3 === void 0 ? void 0 : _iframeRef$current$co3.call(_iframeRef$current$co2);
|
|
4150
4156
|
},
|
|
4151
4157
|
setValue: function setValue(schema) {
|
|
4152
|
-
var
|
|
4153
|
-
return (
|
|
4158
|
+
var _iframeRef$current2, _iframeRef$current2$c, _iframeRef$current2$c2, _iframeRef$current2$c3;
|
|
4159
|
+
return (_iframeRef$current2 = iframeRef.current) === null || _iframeRef$current2 === void 0 ? void 0 : (_iframeRef$current2$c = _iframeRef$current2.contentWindow) === null || _iframeRef$current2$c === void 0 ? void 0 : (_iframeRef$current2$c2 = _iframeRef$current2$c.__FR_ENGINE__) === null || _iframeRef$current2$c2 === void 0 ? void 0 : (_iframeRef$current2$c3 = _iframeRef$current2$c2.importSchema) === null || _iframeRef$current2$c3 === void 0 ? void 0 : _iframeRef$current2$c3.call(_iframeRef$current2$c2, schema);
|
|
4154
4160
|
}
|
|
4155
4161
|
};
|
|
4156
4162
|
});
|
|
@@ -4162,15 +4168,16 @@
|
|
|
4162
4168
|
};
|
|
4163
4169
|
}, []);
|
|
4164
4170
|
var initIframe = function initIframe() {
|
|
4165
|
-
iframe = createIframe();
|
|
4171
|
+
var iframe = createIframe();
|
|
4172
|
+
iframeRef.current = iframe;
|
|
4166
4173
|
containerRef.current.appendChild(iframe);
|
|
4167
4174
|
};
|
|
4168
4175
|
var engineOnLoad = function engineOnLoad(event) {
|
|
4169
|
-
var
|
|
4176
|
+
var _iframeRef$current3, _iframeRef$current3$c, _iframeRef$current3$c2;
|
|
4170
4177
|
if (event.data.type !== 'engine-load') {
|
|
4171
4178
|
return;
|
|
4172
4179
|
}
|
|
4173
|
-
(
|
|
4180
|
+
(_iframeRef$current3 = iframeRef.current) === null || _iframeRef$current3 === void 0 ? void 0 : (_iframeRef$current3$c = _iframeRef$current3.contentWindow) === null || _iframeRef$current3$c === void 0 ? void 0 : (_iframeRef$current3$c2 = _iframeRef$current3$c.__FR_ENGINE__) === null || _iframeRef$current3$c2 === void 0 ? void 0 : _iframeRef$current3$c2.init(_objectSpread2({
|
|
4174
4181
|
settings: _objectSpread2(_objectSpread2({}, defaultSetting), settings),
|
|
4175
4182
|
widgets: widgets,
|
|
4176
4183
|
// recordEnable: true,
|