opt: superview's subviews must be marked also
This commit is contained in:
parent
92b106d11f
commit
c574f87b94
@ -593,11 +593,11 @@ var Superview = /** @class */ (function (_super) {
|
|||||||
_super.prototype.clean.call(this);
|
_super.prototype.clean.call(this);
|
||||||
};
|
};
|
||||||
Superview.prototype.toModel = function () {
|
Superview.prototype.toModel = function () {
|
||||||
var e_4, _a;
|
var e_4, _a, e_5, _b;
|
||||||
var subviews = [];
|
var subviews = [];
|
||||||
try {
|
try {
|
||||||
for (var _b = __values$5(this.allSubviews()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
for (var _c = __values$5(this.allSubviews()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
||||||
var v = _c.value;
|
var v = _d.value;
|
||||||
if (v != undefined) {
|
if (v != undefined) {
|
||||||
if (v.superview && v.superview !== this) {
|
if (v.superview && v.superview !== this) {
|
||||||
//It had been added to another view, need to be marked totally
|
//It had been added to another view, need to be marked totally
|
||||||
@ -605,6 +605,24 @@ var Superview = /** @class */ (function (_super) {
|
|||||||
if (key.startsWith("__prop__")) {
|
if (key.startsWith("__prop__")) {
|
||||||
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
}
|
}
|
||||||
|
if (v instanceof Superview) {
|
||||||
|
try {
|
||||||
|
for (var _e = (e_5 = void 0, __values$5(v.allSubviews())), _f = _e.next(); !_f.done; _f = _e.next()) {
|
||||||
|
var subview = _f.value;
|
||||||
|
subview.superview = {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
||||||
|
finally {
|
||||||
|
try {
|
||||||
|
if (_f && !_f.done && (_b = _e.return)) { _b.call(_e); }
|
||||||
|
}
|
||||||
|
finally { if (e_5) { throw e_5.error; } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v instanceof Group) {
|
||||||
|
v.dirtyProps.children = v.children.map(function (e) { return e.viewId; });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
@ -617,7 +635,7 @@ var Superview = /** @class */ (function (_super) {
|
|||||||
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
||||||
finally {
|
finally {
|
||||||
try {
|
try {
|
||||||
if (_c && !_c.done && (_a = _b.return)) { _a.call(_b); }
|
if (_d && !_d.done && (_a = _c.return)) { _a.call(_c); }
|
||||||
}
|
}
|
||||||
finally { if (e_4) { throw e_4.error; } }
|
finally { if (e_4) { throw e_4.error; } }
|
||||||
}
|
}
|
||||||
|
@ -492,6 +492,14 @@ class Superview extends View {
|
|||||||
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
}
|
}
|
||||||
|
if (v instanceof Superview) {
|
||||||
|
for (const subview of v.allSubviews()) {
|
||||||
|
subview.superview = {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v instanceof Group) {
|
||||||
|
v.dirtyProps.children = v.children.map(e => e.viewId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
|
@ -2013,6 +2013,14 @@ class Superview extends View {
|
|||||||
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
}
|
}
|
||||||
|
if (v instanceof Superview) {
|
||||||
|
for (const subview of v.allSubviews()) {
|
||||||
|
subview.superview = {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v instanceof Group) {
|
||||||
|
v.dirtyProps.children = v.children.map(e => e.viewId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
|
@ -374,6 +374,14 @@ export class Superview extends View {
|
|||||||
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
}
|
}
|
||||||
|
if (v instanceof Superview) {
|
||||||
|
for (const subview of v.allSubviews()) {
|
||||||
|
subview.superview = {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v instanceof Group) {
|
||||||
|
v.dirtyProps.children = v.children.map(e => e.viewId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
|
@ -414,6 +414,14 @@ export abstract class Superview extends View {
|
|||||||
if (key.startsWith("__prop__")) {
|
if (key.startsWith("__prop__")) {
|
||||||
v.onPropertyChanged(key, undefined, Reflect.get(v, key))
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key))
|
||||||
}
|
}
|
||||||
|
if (v instanceof Superview) {
|
||||||
|
for (const subview of v.allSubviews()) {
|
||||||
|
subview.superview = {} as Superview
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v instanceof Group) {
|
||||||
|
v.dirtyProps.children = v.children.map(e => e.viewId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v.superview = this
|
v.superview = this
|
||||||
|
@ -382,7 +382,6 @@ export abstract class View implements Modeling {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export abstract class Superview extends View {
|
export abstract class Superview extends View {
|
||||||
subviewById(id: string): View | undefined {
|
subviewById(id: string): View | undefined {
|
||||||
for (let v of this.allSubviews()) {
|
for (let v of this.allSubviews()) {
|
||||||
@ -440,6 +439,14 @@ export abstract class Superview extends View {
|
|||||||
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
v.onPropertyChanged(key, undefined, Reflect.get(v, key))
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key))
|
||||||
}
|
}
|
||||||
|
if (v instanceof Superview) {
|
||||||
|
for (const subview of v.allSubviews()) {
|
||||||
|
subview.superview = {} as Superview
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v instanceof Group) {
|
||||||
|
v.dirtyProps.children = v.children.map(e => e.viewId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v.superview = this
|
v.superview = this
|
||||||
|
8
doric-web/dist/index.js
vendored
8
doric-web/dist/index.js
vendored
@ -2067,6 +2067,14 @@ class Superview extends View {
|
|||||||
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
if (Reflect.getMetadata(key, v) === PROP_CONSIST || Reflect.getMetadata(key, v) === PROP_INCONSIST) {
|
||||||
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
v.onPropertyChanged(key, undefined, Reflect.get(v, key));
|
||||||
}
|
}
|
||||||
|
if (v instanceof Superview) {
|
||||||
|
for (const subview of v.allSubviews()) {
|
||||||
|
subview.superview = {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v instanceof Group) {
|
||||||
|
v.dirtyProps.children = v.children.map(e => e.viewId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v.superview = this;
|
v.superview = this;
|
||||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user