zova-jsx 1.1.35 → 1.1.37

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -4,7 +4,9 @@ import { toUpperCaseFirstChar } from '@cabloy/word-utils';
4
4
  import { h, createTextVNode } from 'vue';
5
5
  import { BeanSimple, objectAssignReactive, cast, BeanControllerIdentifier } from 'zova-core';
6
6
 
7
- const renderFieldJsxPropsSystem = ['children', 'v-slot', 'v-slot-scope', 'v-if', 'v-for', 'v-each', 'key'];
7
+ const renderFieldJsxPropsSystem = ['children', 'v-slot', 'v-slot-scope', 'v-if', 'v-for', 'v-each'
8
+ //'key', // need key
9
+ ];
8
10
 
9
11
  const __propsMapper = {
10
12
  className: 'class'
@@ -79,11 +81,13 @@ class ZovaJsx extends BeanSimple {
79
81
  // component
80
82
  if (isJsxComponent(componentJsx)) {
81
83
  const transientObject = this.transientObject;
82
- return () => {
84
+ const renderFn = () => {
83
85
  return this.setTransientObject(transientObject, () => {
84
86
  return this.render(componentJsx, props, celScope, renderContext);
85
87
  });
86
88
  };
89
+ renderFn['zova-jsx:component'] = componentJsx.type;
90
+ return renderFn;
87
91
  }
88
92
  if (isJsxEvent(componentJsx)) {
89
93
  let transientObject = this.transientObject;
@@ -163,7 +167,7 @@ class ZovaJsx extends BeanSimple {
163
167
  const vIf = this.evaluateExpression(actionChild.props?.['v-if'], celScope);
164
168
  if (vIf === false) return next(undefined);
165
169
  // action
166
- if (actionChild.type === 'ActionActions') {
170
+ if (actionChild.type === 'ZovaCommands') {
167
171
  // nested action
168
172
  eventRes[index] = [];
169
173
  return this.renderEventDirect(actionChild, objectAssignReactive({}, celScope), renderContext, eventRes[index], next);
@@ -363,7 +367,8 @@ class ZovaJsx extends BeanSimple {
363
367
  renderJsxChildrenDirect(jsxChildren, celScope, renderContext) {
364
368
  if (!Array.isArray(jsxChildren)) jsxChildren = [jsxChildren];
365
369
  const children = [];
366
- for (const jsxChild of jsxChildren) {
370
+ for (let index = 0; index < jsxChildren.length; index++) {
371
+ const jsxChild = jsxChildren[index];
367
372
  let child;
368
373
  if (isJsxComponent(jsxChild)) {
369
374
  if (jsxChild.type === 'var') {
@@ -383,7 +388,10 @@ class ZovaJsx extends BeanSimple {
383
388
  }
384
389
  child = undefined;
385
390
  } else {
386
- child = this.render(jsxChild, undefined, celScope, renderContext);
391
+ const propsInit = {
392
+ key: jsxChild.key ?? index
393
+ };
394
+ child = this.render(jsxChild, propsInit, celScope, renderContext);
387
395
  }
388
396
  } else {
389
397
  const childText = this.evaluateExpression(jsxChild, celScope);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-jsx",
3
- "version": "1.1.35",
4
- "gitHead": "106d9830a06a019121adf3af44e0ae22063aed55",
3
+ "version": "1.1.37",
4
+ "gitHead": "318e0e2e2dc324b9b8cb57a540cca890e972a3a1",
5
5
  "description": "Zova JSX",
6
6
  "keywords": [
7
7
  "ioc",
@@ -45,6 +45,6 @@
45
45
  "@cabloy/word-utils": "^2.1.9",
46
46
  "typestyle": "^2.4.0",
47
47
  "vue": "^3.5.32",
48
- "zova-core": "^5.1.30"
48
+ "zova-core": "^5.1.31"
49
49
  }
50
50
  }