Browse Source

cleanup

pull/6351/head
mohamedsalem401 1 year ago
parent
commit
5d99c6b7c2
  1. 6
      packages/core/src/dom_components/model/Component.ts
  2. 1
      packages/core/src/dom_components/model/DynamicValueWatcher.ts

6
packages/core/src/dom_components/model/Component.ts

@ -1307,7 +1307,9 @@ export default class Component extends StyleableModel<ComponentProperties> {
const opts = { ...this.opt };
const id = this.getId();
const cssc = em?.Css;
attr.attributes = { ...attr.attributes };
attr.attributes = {
...(attr.attributes ? this.componentDVListener.getAttributesDefsOrValues(attr.attributes) : undefined),
};
delete attr.attributes.id;
// @ts-ignore
attr.components = [];
@ -1564,8 +1566,8 @@ export default class Component extends StyleableModel<ComponentProperties> {
*/
toJSON(opts: ObjectAny = {}): ComponentDefinition {
let obj = Model.prototype.toJSON.call(this, opts);
obj.attributes = this.componentDVListener.getAttributesDefsOrValues(this.getAttributes({ noClass: true }));
obj = { ...obj, ...this.componentDVListener.getDynamicPropsDefs() };
obj.attributes = this.componentDVListener.getAttributesDefsOrValues(this.getAttributes({ noClass: true }));
delete obj.traits;
delete obj.attributes.class;
delete obj.toolbar;

1
packages/core/src/dom_components/model/DynamicValueWatcher.ts

@ -82,7 +82,6 @@ export class DynamicValueWatcher {
const key = propsKeys[index];
if (this.dynamicVariableListeners[key]) {
serializableValues[key] = this.dynamicVariableListeners[key].dynamicVariable.toJSON();
continue;
}
}

Loading…
Cancel
Save