@meta2d/core 1.1.2 → 1.1.4

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/src/core.d.ts CHANGED
@@ -74,7 +74,7 @@ export declare class Meta2d {
74
74
  private init;
75
75
  initEventFns(): void;
76
76
  getSendData(data: any[], cpen?: Pen): any;
77
- convertType(value: string, type: string): string | number | boolean;
77
+ convertType(value: string, type: string): any;
78
78
  getEventData(list: any, pen: Pen): any;
79
79
  message(options: MessageOptions): void;
80
80
  closeAll(): void;
package/src/core.js CHANGED
@@ -611,6 +611,16 @@ export class Meta2d {
611
611
  }
612
612
  }
613
613
  }
614
+ else if (typeof value === 'object') {
615
+ let bodyStr = JSON.stringify(value);
616
+ let keys = bodyStr.match(/\$\{([^}]+)\}/g)?.map(m => m.slice(2, -1));
617
+ if (keys?.length) {
618
+ for (let i = 0; i < keys.length; i++) {
619
+ bodyStr = bodyStr.replace(`\${${keys[i]}}`, this.getDynamicParam(keys[i]));
620
+ }
621
+ }
622
+ return JSON.parse(bodyStr);
623
+ }
614
624
  return value;
615
625
  }
616
626
  getEventData(list, pen) {
@@ -3573,12 +3583,13 @@ export class Meta2d {
3573
3583
  this.doEvent(e, eventName);
3574
3584
  break;
3575
3585
  case 'change':
3576
- e.pen && updateFormData(e.pen);
3577
3586
  if (e.pen) {
3587
+ updateFormData(e.pen);
3578
3588
  this.store.data.locked && !e.pen.disabled &&
3579
3589
  this.doEvent(e.pen, eventName);
3580
3590
  }
3581
3591
  else {
3592
+ updateFormData(e);
3582
3593
  this.store.data.locked &&
3583
3594
  e &&
3584
3595
  !e.disabled &&