Skip to content

Commit

Permalink
🐞 fix: removed default value
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangechen committed Oct 22, 2024
1 parent 6abd363 commit 71d9be4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/chili-core/src/foundation/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export class Observable implements IPropertyChanged {
while (proto !== null) {
if (proto.hasOwnProperty(pubKey)) {
Object.defineProperty(proto, privateKey, {
value: newValue,
writable: true,
enumerable: false,
configurable: true,
});
proto[privateKey] = newValue;
break;
}
proto = Object.getPrototypeOf(proto);
Expand Down
14 changes: 11 additions & 3 deletions packages/chili-ui/src/property/propertyView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
INode,
IView,
Node,
NodeLinkedList,
ParameterShapeNode,
Property,
PubSub,
Expand Down Expand Up @@ -56,10 +57,17 @@ export class PropertyView extends HTMLElement {

private addModel(document: IDocument, nodes: INode[]) {
if (nodes.length === 0) return;

let properties = div({ className: style.rootProperties });
Property.getOwnProperties(Node.prototype).forEach((x) => {
appendProperty(properties, document, nodes, x);
});
if (nodes[0] instanceof NodeLinkedList) {
Property.getProperties(Object.getPrototypeOf(nodes[0])).forEach((x) => {
appendProperty(properties, document, nodes, x);
});
} else if (nodes[0] instanceof Node) {
Property.getOwnProperties(Node.prototype).forEach((x) => {
appendProperty(properties, document, nodes, x);
});
}

this.panel.append(properties);
}
Expand Down

0 comments on commit 71d9be4

Please sign in to comment.