zova-jsx 1.1.21 → 1.1.23
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 +18 -4
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { compose } from '@cabloy/compose';
|
|
2
|
-
import { celEnvBase, getProperty, evaluateExpressions, isPromise } from '@cabloy/utils';
|
|
2
|
+
import { celEnvBase, getProperty, evaluateExpressions, isEmptyObject, isNil, isPromise } from '@cabloy/utils';
|
|
3
3
|
import { toUpperCaseFirstChar } from '@cabloy/word-utils';
|
|
4
4
|
import { classes } from 'typestyle';
|
|
5
5
|
import { h, createTextVNode } from 'vue';
|
|
6
|
-
import { BeanSimple, objectAssignReactive, cast, beanFullNameFromOnionName
|
|
6
|
+
import { BeanSimple, objectAssignReactive, cast, beanFullNameFromOnionName } from 'zova-core';
|
|
7
7
|
|
|
8
8
|
const renderFieldJsxPropsSystem = ['children', 'v-slot', 'v-slot-scope', 'v-if', 'v-for', 'v-each', 'key'];
|
|
9
9
|
|
|
@@ -207,13 +207,17 @@ class ZovaJsx extends BeanSimple {
|
|
|
207
207
|
const onionOptions = beanInstance.$onionOptions;
|
|
208
208
|
// props
|
|
209
209
|
let props = this.renderJsxProps(actionChild.props, {}, celScope, renderContext);
|
|
210
|
-
if (onionOptions) {
|
|
211
|
-
|
|
210
|
+
if (!isEmptyObject(onionOptions)) {
|
|
211
|
+
// not use deepExtend, maybe: Maximum call stack size exceeded
|
|
212
|
+
props = Object.assign({}, onionOptions, props);
|
|
212
213
|
}
|
|
213
214
|
if (!renderContext) throw new Error('should provide renderContext');
|
|
214
215
|
return beanInstance.execute(props, renderContext, next);
|
|
215
216
|
}
|
|
216
217
|
render(componentOptions, props, celScope, renderContext) {
|
|
218
|
+
if (!componentOptions) {
|
|
219
|
+
throw new Error(`render component should not ${componentOptions}`);
|
|
220
|
+
}
|
|
217
221
|
props = props ?? {};
|
|
218
222
|
componentOptions = this.normalizeComponenOptions(componentOptions);
|
|
219
223
|
// vIf
|
|
@@ -372,6 +376,16 @@ class ZovaJsx extends BeanSimple {
|
|
|
372
376
|
const props = this.renderJsxProps(jsxChild.props, {}, celScope, renderContext);
|
|
373
377
|
celScope[cast(props).name] = cast(props).value;
|
|
374
378
|
child = undefined;
|
|
379
|
+
} else if (jsxChild.type === 'log') {
|
|
380
|
+
const props = this.renderJsxProps(jsxChild.props, {}, celScope, renderContext);
|
|
381
|
+
const name = cast(props).name;
|
|
382
|
+
const message = cast(props).message;
|
|
383
|
+
if (isNil(name)) {
|
|
384
|
+
console.log(message);
|
|
385
|
+
} else {
|
|
386
|
+
console.log(name, message);
|
|
387
|
+
}
|
|
388
|
+
child = undefined;
|
|
375
389
|
} else {
|
|
376
390
|
child = this.render(jsxChild, undefined, celScope, renderContext);
|
|
377
391
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-jsx",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "1.1.23",
|
|
4
|
+
"gitHead": "ee0bdf92186d7979b5f8f167c653394eba69b21c",
|
|
5
5
|
"description": "Zova JSX",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ioc",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@cabloy/compose": "^2.1.4",
|
|
44
|
-
"@cabloy/utils": "^2.1.
|
|
44
|
+
"@cabloy/utils": "^2.1.9",
|
|
45
45
|
"@cabloy/word-utils": "^2.1.8",
|
|
46
46
|
"typestyle": "^2.4.0",
|
|
47
47
|
"vue": "^3.5.32",
|
|
48
|
-
"zova-core": "^5.1.
|
|
48
|
+
"zova-core": "^5.1.21"
|
|
49
49
|
}
|
|
50
50
|
}
|