@easy-editor/react-renderer 0.0.3 → 0.0.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/index.development.js +680 -108
- package/dist/cjs/index.development.js.map +1 -1
- package/dist/cjs/index.js +680 -108
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.production.js +680 -108
- package/dist/cjs/index.production.js.map +1 -1
- package/dist/esm/index.development.js +672 -100
- package/dist/esm/index.development.js.map +1 -1
- package/dist/esm/index.js +672 -100
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.production.js +672 -100
- package/dist/esm/index.production.js.map +1 -1
- package/dist/index.js +672 -100
- package/package.json +8 -7
|
@@ -3,17 +3,7 @@
|
|
|
3
3
|
var mobxReact = require('mobx-react');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var core = require('@easy-editor/core');
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
function _extends() {
|
|
9
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
10
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
11
|
-
var t = arguments[e];
|
|
12
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
13
|
-
}
|
|
14
|
-
return n;
|
|
15
|
-
}, _extends.apply(null, arguments);
|
|
16
|
-
}
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
17
7
|
|
|
18
8
|
const SettingRendererContext = /*#__PURE__*/react.createContext({});
|
|
19
9
|
const useSettingRendererContext = () => {
|
|
@@ -101,8 +91,7 @@ const SettingSetter = mobxReact.observer(({
|
|
|
101
91
|
component: SetterComponent,
|
|
102
92
|
props: mixedSetterProps
|
|
103
93
|
} = setterManager.createSetterContent(setterType, setterProps);
|
|
104
|
-
return /*#__PURE__*/
|
|
105
|
-
key: field.id,
|
|
94
|
+
return /*#__PURE__*/jsxRuntime.jsx(SetterComponent, {
|
|
106
95
|
field: field,
|
|
107
96
|
selected: field.top?.getNode(),
|
|
108
97
|
initialValue: initialValue,
|
|
@@ -122,8 +111,10 @@ const SettingSetter = mobxReact.observer(({
|
|
|
122
111
|
if (field.name) {
|
|
123
112
|
field.parent.clearPropValue(field.name);
|
|
124
113
|
}
|
|
125
|
-
}
|
|
126
|
-
|
|
114
|
+
},
|
|
115
|
+
...mixedSetterProps,
|
|
116
|
+
children: children
|
|
117
|
+
}, field.id);
|
|
127
118
|
});
|
|
128
119
|
|
|
129
120
|
const SettingFieldItem = mobxReact.observer(({
|
|
@@ -133,18 +124,20 @@ const SettingFieldItem = mobxReact.observer(({
|
|
|
133
124
|
customFieldItem
|
|
134
125
|
} = useSettingRendererContext();
|
|
135
126
|
if (customFieldItem) {
|
|
136
|
-
return customFieldItem(field, /*#__PURE__*/
|
|
127
|
+
return customFieldItem(field, /*#__PURE__*/jsxRuntime.jsx(SettingSetter, {
|
|
137
128
|
field: field
|
|
138
129
|
}));
|
|
139
130
|
}
|
|
140
|
-
return /*#__PURE__*/
|
|
141
|
-
className: "space-y-2"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
131
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
132
|
+
className: "space-y-2",
|
|
133
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("label", {
|
|
134
|
+
htmlFor: field.id,
|
|
135
|
+
className: "block text-sm font-medium text-gray-700",
|
|
136
|
+
children: field.title
|
|
137
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SettingSetter, {
|
|
138
|
+
field: field
|
|
139
|
+
})]
|
|
140
|
+
});
|
|
148
141
|
});
|
|
149
142
|
const SettingFieldGroup = mobxReact.observer(({
|
|
150
143
|
field
|
|
@@ -153,33 +146,31 @@ const SettingFieldGroup = mobxReact.observer(({
|
|
|
153
146
|
customFieldGroup
|
|
154
147
|
} = useSettingRendererContext();
|
|
155
148
|
if (customFieldGroup) {
|
|
156
|
-
return customFieldGroup(field, /*#__PURE__*/
|
|
157
|
-
field: field
|
|
158
|
-
|
|
159
|
-
|
|
149
|
+
return customFieldGroup(field, /*#__PURE__*/jsxRuntime.jsx(SettingSetter, {
|
|
150
|
+
field: field,
|
|
151
|
+
children: field.items?.map(item => /*#__PURE__*/jsxRuntime.jsx(SettingFieldView, {
|
|
152
|
+
field: item
|
|
153
|
+
}, item.id))
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
return /*#__PURE__*/jsxRuntime.jsx(SettingSetter, {
|
|
157
|
+
field: field,
|
|
158
|
+
children: field.items?.map(item => /*#__PURE__*/jsxRuntime.jsx(SettingFieldView, {
|
|
160
159
|
field: item
|
|
161
|
-
}))
|
|
162
|
-
}
|
|
163
|
-
return /*#__PURE__*/React.createElement(SettingSetter, {
|
|
164
|
-
field: field
|
|
165
|
-
}, field.items?.map(item => /*#__PURE__*/React.createElement(SettingFieldView, {
|
|
166
|
-
key: item.id,
|
|
167
|
-
field: item
|
|
168
|
-
})));
|
|
160
|
+
}, item.id))
|
|
161
|
+
});
|
|
169
162
|
});
|
|
170
163
|
const SettingFieldView = ({
|
|
171
164
|
field
|
|
172
165
|
}) => {
|
|
173
166
|
if (field.isGroup) {
|
|
174
|
-
return /*#__PURE__*/
|
|
175
|
-
field: field
|
|
176
|
-
|
|
177
|
-
});
|
|
167
|
+
return /*#__PURE__*/jsxRuntime.jsx(SettingFieldGroup, {
|
|
168
|
+
field: field
|
|
169
|
+
}, field.id);
|
|
178
170
|
} else {
|
|
179
|
-
return /*#__PURE__*/
|
|
180
|
-
field: field
|
|
181
|
-
|
|
182
|
-
});
|
|
171
|
+
return /*#__PURE__*/jsxRuntime.jsx(SettingFieldItem, {
|
|
172
|
+
field: field
|
|
173
|
+
}, field.id);
|
|
183
174
|
}
|
|
184
175
|
};
|
|
185
176
|
const SettingRender = mobxReact.observer(props => {
|
|
@@ -207,42 +198,58 @@ const SettingRender = mobxReact.observer(props => {
|
|
|
207
198
|
}, [setterManager, settingsManager, customFieldItem, customFieldGroup]);
|
|
208
199
|
if (!settings) {
|
|
209
200
|
// 未选中节点,提示选中 或者 显示根节点设置
|
|
210
|
-
return /*#__PURE__*/
|
|
211
|
-
className: "lc-settings-main"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
201
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
202
|
+
className: "lc-settings-main",
|
|
203
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
204
|
+
className: "lc-settings-notice",
|
|
205
|
+
children: /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
206
|
+
children: "Please select a node in canvas"
|
|
207
|
+
})
|
|
208
|
+
})
|
|
209
|
+
});
|
|
215
210
|
}
|
|
216
211
|
|
|
217
212
|
// 当节点被锁定,且未开启锁定后容器可设置属性
|
|
218
213
|
if (settings.isLocked) {
|
|
219
|
-
return /*#__PURE__*/
|
|
220
|
-
className: "lc-settings-main"
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
214
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
215
|
+
className: "lc-settings-main",
|
|
216
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
217
|
+
className: "lc-settings-notice",
|
|
218
|
+
children: /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
219
|
+
children: "Current node is locked"
|
|
220
|
+
})
|
|
221
|
+
})
|
|
222
|
+
});
|
|
224
223
|
}
|
|
225
224
|
if (Array.isArray(settings.items) && settings.items.length === 0) {
|
|
226
|
-
return /*#__PURE__*/
|
|
227
|
-
className: "lc-settings-main"
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
225
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
226
|
+
className: "lc-settings-main",
|
|
227
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
228
|
+
className: "lc-settings-notice",
|
|
229
|
+
children: /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
230
|
+
children: "No config found for this type of component"
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
});
|
|
231
234
|
}
|
|
232
235
|
if (!settings.isSameComponent) {
|
|
233
236
|
// TODO: future support 获取设置项交集编辑
|
|
234
|
-
return /*#__PURE__*/
|
|
235
|
-
className: "lc-settings-main"
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
237
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
238
|
+
className: "lc-settings-main",
|
|
239
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
240
|
+
className: "lc-settings-notice",
|
|
241
|
+
children: /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
242
|
+
children: "Please select same kind of components"
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
return /*#__PURE__*/jsxRuntime.jsx(SettingRendererContext.Provider, {
|
|
248
|
+
value: ctx,
|
|
249
|
+
children: items?.map(item => /*#__PURE__*/jsxRuntime.jsx(SettingFieldView, {
|
|
250
|
+
field: item
|
|
251
|
+
}, item.id))
|
|
252
|
+
});
|
|
246
253
|
});
|
|
247
254
|
|
|
248
255
|
class Adapter {
|
|
@@ -265,6 +272,566 @@ class Adapter {
|
|
|
265
272
|
}
|
|
266
273
|
const adapter = new Adapter();
|
|
267
274
|
|
|
275
|
+
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
276
|
+
|
|
277
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
278
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
279
|
+
|
|
280
|
+
var Symbol = root.Symbol;
|
|
281
|
+
|
|
282
|
+
var objectProto$7 = Object.prototype;
|
|
283
|
+
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
|
284
|
+
var nativeObjectToString$1 = objectProto$7.toString;
|
|
285
|
+
var symToStringTag$1 = Symbol ? Symbol.toStringTag : undefined;
|
|
286
|
+
function getRawTag(value) {
|
|
287
|
+
var isOwn = hasOwnProperty$5.call(value, symToStringTag$1),
|
|
288
|
+
tag = value[symToStringTag$1];
|
|
289
|
+
try {
|
|
290
|
+
value[symToStringTag$1] = undefined;
|
|
291
|
+
var unmasked = true;
|
|
292
|
+
} catch (e) {}
|
|
293
|
+
var result = nativeObjectToString$1.call(value);
|
|
294
|
+
if (unmasked) {
|
|
295
|
+
if (isOwn) {
|
|
296
|
+
value[symToStringTag$1] = tag;
|
|
297
|
+
} else {
|
|
298
|
+
delete value[symToStringTag$1];
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return result;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
var objectProto$6 = Object.prototype;
|
|
305
|
+
var nativeObjectToString = objectProto$6.toString;
|
|
306
|
+
function objectToString(value) {
|
|
307
|
+
return nativeObjectToString.call(value);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
var nullTag = '[object Null]',
|
|
311
|
+
undefinedTag = '[object Undefined]';
|
|
312
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
313
|
+
function baseGetTag(value) {
|
|
314
|
+
if (value == null) {
|
|
315
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
316
|
+
}
|
|
317
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function isObjectLike(value) {
|
|
321
|
+
return value != null && typeof value == 'object';
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
var symbolTag = '[object Symbol]';
|
|
325
|
+
function isSymbol(value) {
|
|
326
|
+
return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
var isArray = Array.isArray;
|
|
330
|
+
|
|
331
|
+
var reWhitespace = /\s/;
|
|
332
|
+
function trimmedEndIndex(string) {
|
|
333
|
+
var index = string.length;
|
|
334
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {}
|
|
335
|
+
return index;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
var reTrimStart = /^\s+/;
|
|
339
|
+
function baseTrim(string) {
|
|
340
|
+
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function isObject(value) {
|
|
344
|
+
var type = typeof value;
|
|
345
|
+
return value != null && (type == 'object' || type == 'function');
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
var NAN = 0 / 0;
|
|
349
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
350
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
351
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
352
|
+
var freeParseInt = parseInt;
|
|
353
|
+
function toNumber(value) {
|
|
354
|
+
if (typeof value == 'number') {
|
|
355
|
+
return value;
|
|
356
|
+
}
|
|
357
|
+
if (isSymbol(value)) {
|
|
358
|
+
return NAN;
|
|
359
|
+
}
|
|
360
|
+
if (isObject(value)) {
|
|
361
|
+
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
362
|
+
value = isObject(other) ? other + '' : other;
|
|
363
|
+
}
|
|
364
|
+
if (typeof value != 'string') {
|
|
365
|
+
return value === 0 ? value : +value;
|
|
366
|
+
}
|
|
367
|
+
value = baseTrim(value);
|
|
368
|
+
var isBinary = reIsBinary.test(value);
|
|
369
|
+
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function identity(value) {
|
|
373
|
+
return value;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
var asyncTag = '[object AsyncFunction]',
|
|
377
|
+
funcTag$1 = '[object Function]',
|
|
378
|
+
genTag = '[object GeneratorFunction]',
|
|
379
|
+
proxyTag = '[object Proxy]';
|
|
380
|
+
function isFunction(value) {
|
|
381
|
+
if (!isObject(value)) {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
var tag = baseGetTag(value);
|
|
385
|
+
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
var coreJsData = root['__core-js_shared__'];
|
|
389
|
+
|
|
390
|
+
var maskSrcKey = function () {
|
|
391
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
392
|
+
return uid ? 'Symbol(src)_1.' + uid : '';
|
|
393
|
+
}();
|
|
394
|
+
function isMasked(func) {
|
|
395
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
var funcProto$1 = Function.prototype;
|
|
399
|
+
var funcToString$1 = funcProto$1.toString;
|
|
400
|
+
function toSource(func) {
|
|
401
|
+
if (func != null) {
|
|
402
|
+
try {
|
|
403
|
+
return funcToString$1.call(func);
|
|
404
|
+
} catch (e) {}
|
|
405
|
+
try {
|
|
406
|
+
return func + '';
|
|
407
|
+
} catch (e) {}
|
|
408
|
+
}
|
|
409
|
+
return '';
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
413
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
414
|
+
var funcProto = Function.prototype,
|
|
415
|
+
objectProto$5 = Object.prototype;
|
|
416
|
+
var funcToString = funcProto.toString;
|
|
417
|
+
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
418
|
+
var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$4).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
|
419
|
+
function baseIsNative(value) {
|
|
420
|
+
if (!isObject(value) || isMasked(value)) {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
424
|
+
return pattern.test(toSource(value));
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
function getValue$1(object, key) {
|
|
428
|
+
return object == null ? undefined : object[key];
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
function getNative(object, key) {
|
|
432
|
+
var value = getValue$1(object, key);
|
|
433
|
+
return baseIsNative(value) ? value : undefined;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
var WeakMap = getNative(root, 'WeakMap');
|
|
437
|
+
|
|
438
|
+
function arrayEach(array, iteratee) {
|
|
439
|
+
var index = -1,
|
|
440
|
+
length = array == null ? 0 : array.length;
|
|
441
|
+
while (++index < length) {
|
|
442
|
+
if (iteratee(array[index], index, array) === false) {
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return array;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
450
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
451
|
+
function isIndex(value, length) {
|
|
452
|
+
var type = typeof value;
|
|
453
|
+
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
454
|
+
return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
458
|
+
function isLength(value) {
|
|
459
|
+
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
function isArrayLike(value) {
|
|
463
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
var objectProto$4 = Object.prototype;
|
|
467
|
+
function isPrototype(value) {
|
|
468
|
+
var Ctor = value && value.constructor,
|
|
469
|
+
proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$4;
|
|
470
|
+
return value === proto;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function baseTimes(n, iteratee) {
|
|
474
|
+
var index = -1,
|
|
475
|
+
result = Array(n);
|
|
476
|
+
while (++index < n) {
|
|
477
|
+
result[index] = iteratee(index);
|
|
478
|
+
}
|
|
479
|
+
return result;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
var argsTag$1 = '[object Arguments]';
|
|
483
|
+
function baseIsArguments(value) {
|
|
484
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag$1;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
var objectProto$3 = Object.prototype;
|
|
488
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
489
|
+
var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
|
|
490
|
+
var isArguments = baseIsArguments(function () {
|
|
491
|
+
return arguments;
|
|
492
|
+
}()) ? baseIsArguments : function (value) {
|
|
493
|
+
return isObjectLike(value) && hasOwnProperty$3.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
function stubFalse() {
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
|
501
|
+
var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
|
|
502
|
+
var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
|
503
|
+
var Buffer = moduleExports$1 ? root.Buffer : undefined;
|
|
504
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
505
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
506
|
+
|
|
507
|
+
var argsTag = '[object Arguments]',
|
|
508
|
+
arrayTag = '[object Array]',
|
|
509
|
+
boolTag = '[object Boolean]',
|
|
510
|
+
dateTag = '[object Date]',
|
|
511
|
+
errorTag = '[object Error]',
|
|
512
|
+
funcTag = '[object Function]',
|
|
513
|
+
mapTag$2 = '[object Map]',
|
|
514
|
+
numberTag = '[object Number]',
|
|
515
|
+
objectTag$1 = '[object Object]',
|
|
516
|
+
regexpTag = '[object RegExp]',
|
|
517
|
+
setTag$2 = '[object Set]',
|
|
518
|
+
stringTag = '[object String]',
|
|
519
|
+
weakMapTag$1 = '[object WeakMap]';
|
|
520
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
521
|
+
dataViewTag$1 = '[object DataView]',
|
|
522
|
+
float32Tag = '[object Float32Array]',
|
|
523
|
+
float64Tag = '[object Float64Array]',
|
|
524
|
+
int8Tag = '[object Int8Array]',
|
|
525
|
+
int16Tag = '[object Int16Array]',
|
|
526
|
+
int32Tag = '[object Int32Array]',
|
|
527
|
+
uint8Tag = '[object Uint8Array]',
|
|
528
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
529
|
+
uint16Tag = '[object Uint16Array]',
|
|
530
|
+
uint32Tag = '[object Uint32Array]';
|
|
531
|
+
var typedArrayTags = {};
|
|
532
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
533
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag] = typedArrayTags[objectTag$1] = typedArrayTags[regexpTag] = typedArrayTags[setTag$2] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag$1] = false;
|
|
534
|
+
function baseIsTypedArray(value) {
|
|
535
|
+
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
function baseUnary(func) {
|
|
539
|
+
return function (value) {
|
|
540
|
+
return func(value);
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
|
545
|
+
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
|
546
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
547
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
548
|
+
var nodeUtil = function () {
|
|
549
|
+
try {
|
|
550
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
551
|
+
if (types) {
|
|
552
|
+
return types;
|
|
553
|
+
}
|
|
554
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
555
|
+
} catch (e) {}
|
|
556
|
+
}();
|
|
557
|
+
|
|
558
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
559
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
560
|
+
|
|
561
|
+
var objectProto$2 = Object.prototype;
|
|
562
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
563
|
+
function arrayLikeKeys(value, inherited) {
|
|
564
|
+
var isArr = isArray(value),
|
|
565
|
+
isArg = !isArr && isArguments(value),
|
|
566
|
+
isBuff = !isArr && !isArg && isBuffer(value),
|
|
567
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
|
568
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
|
569
|
+
result = skipIndexes ? baseTimes(value.length, String) : [],
|
|
570
|
+
length = result.length;
|
|
571
|
+
for (var key in value) {
|
|
572
|
+
if ((hasOwnProperty$2.call(value, key)) && !(skipIndexes && (
|
|
573
|
+
key == 'length' ||
|
|
574
|
+
isBuff && (key == 'offset' || key == 'parent') ||
|
|
575
|
+
isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') ||
|
|
576
|
+
isIndex(key, length)))) {
|
|
577
|
+
result.push(key);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return result;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function overArg(func, transform) {
|
|
584
|
+
return function (arg) {
|
|
585
|
+
return func(transform(arg));
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
var nativeKeys = overArg(Object.keys, Object);
|
|
590
|
+
|
|
591
|
+
var objectProto$1 = Object.prototype;
|
|
592
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
593
|
+
function baseKeys(object) {
|
|
594
|
+
if (!isPrototype(object)) {
|
|
595
|
+
return nativeKeys(object);
|
|
596
|
+
}
|
|
597
|
+
var result = [];
|
|
598
|
+
for (var key in Object(object)) {
|
|
599
|
+
if (hasOwnProperty$1.call(object, key) && key != 'constructor') {
|
|
600
|
+
result.push(key);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
return result;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
function keys(object) {
|
|
607
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
var Map$1 = getNative(root, 'Map');
|
|
611
|
+
|
|
612
|
+
var DataView = getNative(root, 'DataView');
|
|
613
|
+
|
|
614
|
+
var Promise$1 = getNative(root, 'Promise');
|
|
615
|
+
|
|
616
|
+
var Set = getNative(root, 'Set');
|
|
617
|
+
|
|
618
|
+
var mapTag$1 = '[object Map]',
|
|
619
|
+
objectTag = '[object Object]',
|
|
620
|
+
promiseTag = '[object Promise]',
|
|
621
|
+
setTag$1 = '[object Set]',
|
|
622
|
+
weakMapTag = '[object WeakMap]';
|
|
623
|
+
var dataViewTag = '[object DataView]';
|
|
624
|
+
var dataViewCtorString = toSource(DataView),
|
|
625
|
+
mapCtorString = toSource(Map$1),
|
|
626
|
+
promiseCtorString = toSource(Promise$1),
|
|
627
|
+
setCtorString = toSource(Set),
|
|
628
|
+
weakMapCtorString = toSource(WeakMap);
|
|
629
|
+
var getTag = baseGetTag;
|
|
630
|
+
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag(new Map$1()) != mapTag$1 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set && getTag(new Set()) != setTag$1 || WeakMap && getTag(new WeakMap()) != weakMapTag) {
|
|
631
|
+
getTag = function (value) {
|
|
632
|
+
var result = baseGetTag(value),
|
|
633
|
+
Ctor = result == objectTag ? value.constructor : undefined,
|
|
634
|
+
ctorString = Ctor ? toSource(Ctor) : '';
|
|
635
|
+
if (ctorString) {
|
|
636
|
+
switch (ctorString) {
|
|
637
|
+
case dataViewCtorString:
|
|
638
|
+
return dataViewTag;
|
|
639
|
+
case mapCtorString:
|
|
640
|
+
return mapTag$1;
|
|
641
|
+
case promiseCtorString:
|
|
642
|
+
return promiseTag;
|
|
643
|
+
case setCtorString:
|
|
644
|
+
return setTag$1;
|
|
645
|
+
case weakMapCtorString:
|
|
646
|
+
return weakMapTag;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
return result;
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
function createBaseFor(fromRight) {
|
|
654
|
+
return function (object, iteratee, keysFunc) {
|
|
655
|
+
var index = -1,
|
|
656
|
+
iterable = Object(object),
|
|
657
|
+
props = keysFunc(object),
|
|
658
|
+
length = props.length;
|
|
659
|
+
while (length--) {
|
|
660
|
+
var key = props[++index];
|
|
661
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
662
|
+
break;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return object;
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
var baseFor = createBaseFor();
|
|
670
|
+
|
|
671
|
+
function baseForOwn(object, iteratee) {
|
|
672
|
+
return object && baseFor(object, iteratee, keys);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
function createBaseEach(eachFunc, fromRight) {
|
|
676
|
+
return function (collection, iteratee) {
|
|
677
|
+
if (collection == null) {
|
|
678
|
+
return collection;
|
|
679
|
+
}
|
|
680
|
+
if (!isArrayLike(collection)) {
|
|
681
|
+
return eachFunc(collection, iteratee);
|
|
682
|
+
}
|
|
683
|
+
var length = collection.length,
|
|
684
|
+
index = -1,
|
|
685
|
+
iterable = Object(collection);
|
|
686
|
+
while (++index < length) {
|
|
687
|
+
if (iteratee(iterable[index], index, iterable) === false) {
|
|
688
|
+
break;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
return collection;
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
var baseEach = createBaseEach(baseForOwn);
|
|
696
|
+
|
|
697
|
+
var now = function () {
|
|
698
|
+
return root.Date.now();
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
702
|
+
var nativeMax = Math.max,
|
|
703
|
+
nativeMin = Math.min;
|
|
704
|
+
function debounce(func, wait, options) {
|
|
705
|
+
var lastArgs,
|
|
706
|
+
lastThis,
|
|
707
|
+
maxWait,
|
|
708
|
+
result,
|
|
709
|
+
timerId,
|
|
710
|
+
lastCallTime,
|
|
711
|
+
lastInvokeTime = 0,
|
|
712
|
+
leading = false,
|
|
713
|
+
maxing = false,
|
|
714
|
+
trailing = true;
|
|
715
|
+
if (typeof func != 'function') {
|
|
716
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
717
|
+
}
|
|
718
|
+
wait = toNumber(wait) || 0;
|
|
719
|
+
if (isObject(options)) {
|
|
720
|
+
leading = !!options.leading;
|
|
721
|
+
maxing = 'maxWait' in options;
|
|
722
|
+
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
723
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
724
|
+
}
|
|
725
|
+
function invokeFunc(time) {
|
|
726
|
+
var args = lastArgs,
|
|
727
|
+
thisArg = lastThis;
|
|
728
|
+
lastArgs = lastThis = undefined;
|
|
729
|
+
lastInvokeTime = time;
|
|
730
|
+
result = func.apply(thisArg, args);
|
|
731
|
+
return result;
|
|
732
|
+
}
|
|
733
|
+
function leadingEdge(time) {
|
|
734
|
+
lastInvokeTime = time;
|
|
735
|
+
timerId = setTimeout(timerExpired, wait);
|
|
736
|
+
return leading ? invokeFunc(time) : result;
|
|
737
|
+
}
|
|
738
|
+
function remainingWait(time) {
|
|
739
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
740
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
|
741
|
+
timeWaiting = wait - timeSinceLastCall;
|
|
742
|
+
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
743
|
+
}
|
|
744
|
+
function shouldInvoke(time) {
|
|
745
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
746
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
|
747
|
+
return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
748
|
+
}
|
|
749
|
+
function timerExpired() {
|
|
750
|
+
var time = now();
|
|
751
|
+
if (shouldInvoke(time)) {
|
|
752
|
+
return trailingEdge(time);
|
|
753
|
+
}
|
|
754
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
755
|
+
}
|
|
756
|
+
function trailingEdge(time) {
|
|
757
|
+
timerId = undefined;
|
|
758
|
+
if (trailing && lastArgs) {
|
|
759
|
+
return invokeFunc(time);
|
|
760
|
+
}
|
|
761
|
+
lastArgs = lastThis = undefined;
|
|
762
|
+
return result;
|
|
763
|
+
}
|
|
764
|
+
function cancel() {
|
|
765
|
+
if (timerId !== undefined) {
|
|
766
|
+
clearTimeout(timerId);
|
|
767
|
+
}
|
|
768
|
+
lastInvokeTime = 0;
|
|
769
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
770
|
+
}
|
|
771
|
+
function flush() {
|
|
772
|
+
return timerId === undefined ? result : trailingEdge(now());
|
|
773
|
+
}
|
|
774
|
+
function debounced() {
|
|
775
|
+
var time = now(),
|
|
776
|
+
isInvoking = shouldInvoke(time);
|
|
777
|
+
lastArgs = arguments;
|
|
778
|
+
lastThis = this;
|
|
779
|
+
lastCallTime = time;
|
|
780
|
+
if (isInvoking) {
|
|
781
|
+
if (timerId === undefined) {
|
|
782
|
+
return leadingEdge(lastCallTime);
|
|
783
|
+
}
|
|
784
|
+
if (maxing) {
|
|
785
|
+
clearTimeout(timerId);
|
|
786
|
+
timerId = setTimeout(timerExpired, wait);
|
|
787
|
+
return invokeFunc(lastCallTime);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if (timerId === undefined) {
|
|
791
|
+
timerId = setTimeout(timerExpired, wait);
|
|
792
|
+
}
|
|
793
|
+
return result;
|
|
794
|
+
}
|
|
795
|
+
debounced.cancel = cancel;
|
|
796
|
+
debounced.flush = flush;
|
|
797
|
+
return debounced;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
function castFunction(value) {
|
|
801
|
+
return typeof value == 'function' ? value : identity;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
function forEach(collection, iteratee) {
|
|
805
|
+
var func = isArray(collection) ? arrayEach : baseEach;
|
|
806
|
+
return func(collection, castFunction(iteratee));
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
var mapTag = '[object Map]',
|
|
810
|
+
setTag = '[object Set]';
|
|
811
|
+
var objectProto = Object.prototype;
|
|
812
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
813
|
+
function isEmpty(value) {
|
|
814
|
+
if (value == null) {
|
|
815
|
+
return true;
|
|
816
|
+
}
|
|
817
|
+
if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
|
818
|
+
return !value.length;
|
|
819
|
+
}
|
|
820
|
+
var tag = getTag(value);
|
|
821
|
+
if (tag == mapTag || tag == setTag) {
|
|
822
|
+
return !value.size;
|
|
823
|
+
}
|
|
824
|
+
if (isPrototype(value)) {
|
|
825
|
+
return !baseKeys(value).length;
|
|
826
|
+
}
|
|
827
|
+
for (var key in value) {
|
|
828
|
+
if (hasOwnProperty.call(value, key)) {
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
return true;
|
|
833
|
+
}
|
|
834
|
+
|
|
268
835
|
const RendererContext = /*#__PURE__*/react.createContext({});
|
|
269
836
|
const useRendererContext = () => {
|
|
270
837
|
try {
|
|
@@ -605,7 +1172,7 @@ const initRerenderEvent = ({
|
|
|
605
1172
|
return;
|
|
606
1173
|
}
|
|
607
1174
|
cache.event.get(schema.id)?.dispose.forEach(disposeFn => disposeFn && disposeFn());
|
|
608
|
-
const debounceRerender =
|
|
1175
|
+
const debounceRerender = debounce(() => {
|
|
609
1176
|
container.rerender();
|
|
610
1177
|
}, 20);
|
|
611
1178
|
cache.event.set(schema.id, {
|
|
@@ -696,7 +1263,7 @@ const leafWrapper = (Comp, {
|
|
|
696
1263
|
renderUnitInfo;
|
|
697
1264
|
|
|
698
1265
|
// 最小渲染单元做防抖处理
|
|
699
|
-
makeUnitRenderDebounced =
|
|
1266
|
+
makeUnitRenderDebounced = debounce(() => {
|
|
700
1267
|
this.beforeRender(RerenderType.MinimalRenderUnit);
|
|
701
1268
|
const schema = this.leaf?.export?.(core.TRANSFORM_STAGE.RENDER);
|
|
702
1269
|
if (!schema) {
|
|
@@ -866,7 +1433,7 @@ const leafWrapper = (Comp, {
|
|
|
866
1433
|
/** 监听参数变化 */
|
|
867
1434
|
initOnPropsChangeEvent(leaf = this.leaf) {
|
|
868
1435
|
// const handlePropsChange = debounce((propChangeInfo: PropChangeInfo) => {
|
|
869
|
-
const handlePropsChange =
|
|
1436
|
+
const handlePropsChange = debounce(propChangeInfo => {
|
|
870
1437
|
const {
|
|
871
1438
|
key,
|
|
872
1439
|
newValue = null
|
|
@@ -1035,9 +1602,6 @@ const leafWrapper = (Comp, {
|
|
|
1035
1602
|
return LeafWrapper;
|
|
1036
1603
|
};
|
|
1037
1604
|
|
|
1038
|
-
/**
|
|
1039
|
-
* execute method in schema.lifeCycles with context
|
|
1040
|
-
*/
|
|
1041
1605
|
function executeLifeCycleMethod(context, schema, method, args) {
|
|
1042
1606
|
if (!context || !isSchema(schema) || !method) {
|
|
1043
1607
|
return;
|
|
@@ -1162,7 +1726,7 @@ function baseRendererFactory() {
|
|
|
1162
1726
|
return resolve({});
|
|
1163
1727
|
}
|
|
1164
1728
|
this.__dataHelper.getInitData().then(res => {
|
|
1165
|
-
if (
|
|
1729
|
+
if (isEmpty(res)) {
|
|
1166
1730
|
this.forceUpdate();
|
|
1167
1731
|
return resolve({});
|
|
1168
1732
|
}
|
|
@@ -1215,7 +1779,7 @@ function baseRendererFactory() {
|
|
|
1215
1779
|
}
|
|
1216
1780
|
});
|
|
1217
1781
|
this.__customMethodsList = customMethodsList;
|
|
1218
|
-
|
|
1782
|
+
forEach(__schema.methods, (val, key) => {
|
|
1219
1783
|
let value = val;
|
|
1220
1784
|
if (core.isJSExpression(value) || core.isJSFunction(value)) {
|
|
1221
1785
|
value = this.__parseExpression(value, this);
|
|
@@ -1237,7 +1801,7 @@ function baseRendererFactory() {
|
|
|
1237
1801
|
component: compContext,
|
|
1238
1802
|
...ctx
|
|
1239
1803
|
};
|
|
1240
|
-
|
|
1804
|
+
forEach(obj, (val, key) => {
|
|
1241
1805
|
this[key] = val;
|
|
1242
1806
|
});
|
|
1243
1807
|
};
|
|
@@ -1669,7 +2233,7 @@ function baseRendererFactory() {
|
|
|
1669
2233
|
return checkPropTypes(value, path, propType, componentInfo.name) ? value : undefined;
|
|
1670
2234
|
};
|
|
1671
2235
|
const parseReactNode = (data, params) => {
|
|
1672
|
-
if (
|
|
2236
|
+
if (isEmpty(params)) {
|
|
1673
2237
|
const virtualDom = this.__createVirtualDom(data, scope, {
|
|
1674
2238
|
schema,
|
|
1675
2239
|
Comp
|
|
@@ -1728,7 +2292,7 @@ function baseRendererFactory() {
|
|
|
1728
2292
|
return checkProps(props);
|
|
1729
2293
|
}
|
|
1730
2294
|
const res = {};
|
|
1731
|
-
|
|
2295
|
+
forEach(props, (val, key) => {
|
|
1732
2296
|
if (key.startsWith('__')) {
|
|
1733
2297
|
res[key] = val;
|
|
1734
2298
|
return;
|
|
@@ -1750,16 +2314,19 @@ function baseRendererFactory() {
|
|
|
1750
2314
|
return this.__instanceMap[id];
|
|
1751
2315
|
}
|
|
1752
2316
|
__renderContextProvider = (customProps, children) => {
|
|
1753
|
-
return /*#__PURE__*/
|
|
2317
|
+
return /*#__PURE__*/jsxRuntime.jsx(RendererContext.Provider, {
|
|
1754
2318
|
value: {
|
|
1755
2319
|
...this.context,
|
|
1756
2320
|
blockContext: this,
|
|
1757
2321
|
...(customProps || {})
|
|
1758
|
-
}
|
|
1759
|
-
|
|
2322
|
+
},
|
|
2323
|
+
children: children || this.__createDom()
|
|
2324
|
+
});
|
|
1760
2325
|
};
|
|
1761
2326
|
__renderContextConsumer = children => {
|
|
1762
|
-
return /*#__PURE__*/
|
|
2327
|
+
return /*#__PURE__*/jsxRuntime.jsx(RendererContext.Consumer, {
|
|
2328
|
+
children: children
|
|
2329
|
+
});
|
|
1763
2330
|
};
|
|
1764
2331
|
__getHOCWrappedComponent(OriginalComp, info) {
|
|
1765
2332
|
let Comp = OriginalComp;
|
|
@@ -1823,12 +2390,13 @@ function baseRendererFactory() {
|
|
|
1823
2390
|
...(typeof this.props.style === 'object' ? this.props.style : {})
|
|
1824
2391
|
};
|
|
1825
2392
|
const id = this.props.id || parsedProps.id;
|
|
1826
|
-
return /*#__PURE__*/
|
|
2393
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1827
2394
|
ref: this.__getRef,
|
|
1828
2395
|
className: className,
|
|
1829
2396
|
id: id,
|
|
1830
|
-
style: style
|
|
1831
|
-
|
|
2397
|
+
style: style,
|
|
2398
|
+
children: children
|
|
2399
|
+
});
|
|
1832
2400
|
}
|
|
1833
2401
|
__checkSchema = (schema, originalExtraComponents = []) => {
|
|
1834
2402
|
let extraComponents = originalExtraComponents;
|
|
@@ -1964,7 +2532,7 @@ const FaultComponent = ({
|
|
|
1964
2532
|
error
|
|
1965
2533
|
}) => {
|
|
1966
2534
|
logger.error(`${componentName} 组件渲染异常, 异常原因: ${error?.message || error || '未知'}`);
|
|
1967
|
-
return /*#__PURE__*/
|
|
2535
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1968
2536
|
role: "alert",
|
|
1969
2537
|
"aria-label": `${componentName} 组件渲染异常`,
|
|
1970
2538
|
style: {
|
|
@@ -1975,8 +2543,9 @@ const FaultComponent = ({
|
|
|
1975
2543
|
fontSize: '15px',
|
|
1976
2544
|
color: '#ef4444',
|
|
1977
2545
|
border: '2px solid #ef4444'
|
|
1978
|
-
}
|
|
1979
|
-
|
|
2546
|
+
},
|
|
2547
|
+
children: [componentName, " \u7EC4\u4EF6\u6E32\u67D3\u5F02\u5E38\uFF0C\u8BF7\u67E5\u770B\u63A7\u5236\u53F0\u65E5\u5FD7"]
|
|
2548
|
+
});
|
|
1980
2549
|
};
|
|
1981
2550
|
|
|
1982
2551
|
const NotFoundComponent = ({
|
|
@@ -1986,9 +2555,11 @@ const NotFoundComponent = ({
|
|
|
1986
2555
|
}) => {
|
|
1987
2556
|
logger.warn(`Component ${componentName} not found`);
|
|
1988
2557
|
if (enableStrictNotFoundMode) {
|
|
1989
|
-
return /*#__PURE__*/
|
|
2558
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
2559
|
+
children: `${componentName} Component Not Found`
|
|
2560
|
+
});
|
|
1990
2561
|
}
|
|
1991
|
-
return /*#__PURE__*/
|
|
2562
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1992
2563
|
role: "alert",
|
|
1993
2564
|
"aria-label": `${componentName} component not found`,
|
|
1994
2565
|
style: {
|
|
@@ -1999,8 +2570,9 @@ const NotFoundComponent = ({
|
|
|
1999
2570
|
fontSize: '15px',
|
|
2000
2571
|
color: '#eab308',
|
|
2001
2572
|
border: '2px solid #eab308'
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2573
|
+
},
|
|
2574
|
+
children: `${componentName} Component Not Found`
|
|
2575
|
+
});
|
|
2004
2576
|
};
|
|
2005
2577
|
|
|
2006
2578
|
function rendererFactory() {
|
|
@@ -2064,7 +2636,7 @@ function rendererFactory() {
|
|
|
2064
2636
|
appHelper,
|
|
2065
2637
|
components
|
|
2066
2638
|
} = this.props;
|
|
2067
|
-
if (
|
|
2639
|
+
if (isEmpty(schema)) {
|
|
2068
2640
|
return null;
|
|
2069
2641
|
}
|
|
2070
2642
|
if (!isSchema(schema)) {
|
|
@@ -2087,21 +2659,21 @@ function rendererFactory() {
|
|
|
2087
2659
|
if (!Comp) {
|
|
2088
2660
|
return null;
|
|
2089
2661
|
}
|
|
2090
|
-
return /*#__PURE__*/
|
|
2662
|
+
return /*#__PURE__*/jsxRuntime.jsx(RendererContext.Provider, {
|
|
2091
2663
|
value: {
|
|
2092
2664
|
appHelper,
|
|
2093
2665
|
components: allComponents,
|
|
2094
2666
|
engine: this
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
}
|
|
2667
|
+
},
|
|
2668
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Comp, {
|
|
2669
|
+
// ref={this.__getRef}
|
|
2670
|
+
__appHelper: appHelper,
|
|
2671
|
+
__components: allComponents,
|
|
2672
|
+
__schema: schema,
|
|
2673
|
+
__designMode: designMode,
|
|
2674
|
+
...this.props
|
|
2675
|
+
}, schema.__ctx && `${schema.__ctx.lceKey}_${schema.__ctx.idx || '0'}`)
|
|
2676
|
+
});
|
|
2105
2677
|
}
|
|
2106
2678
|
};
|
|
2107
2679
|
}
|