Skip to content

Commit 5059bc8

Browse files
committed
#6937 component.Base: descriptors for align_, style_, wrapperStyle_
1 parent 2eb32fc commit 5059bc8

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

src/component/Base.mjs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@ class Component extends Base {
5454
/**
5555
* The default alignment specification to position this Component relative to some other
5656
* Component, or Element or Rectangle. Only applies in case floating = true.
57-
* @member {Object|String} align_={edgeAlign:'t-b',constrainTo:'document.body'}
57+
* @member {Object|String} align_={[isDescriptor]: true, merge: 'deep', value: {edgeAlign: 't-b',constrainTo: 'document.body'}}
5858
*/
5959
align_: {
60-
edgeAlign : 't-b',
61-
constrainTo: 'document.body'
60+
[isDescriptor]: true,
61+
merge : 'deep',
62+
value: {
63+
edgeAlign : 't-b',
64+
constrainTo: 'document.body'
65+
}
6266
},
6367
/**
6468
* The name of the App this component belongs to
@@ -327,9 +331,13 @@ class Component extends Base {
327331
stateProvider_: null,
328332
/**
329333
* Style attributes added to this vdom root. see: getVdomRoot()
330-
* @member {Object} style_=null
334+
* @member {Object} style={[isDescriptor]: true, merge: 'deep', value: null}
331335
*/
332-
style_: null,
336+
style_: {
337+
[isDescriptor]: true,
338+
merge : 'deep',
339+
value : null
340+
},
333341
/**
334342
* You can pass a used theme directly to any component,
335343
* to style specific component trees differently from your main view.
@@ -376,13 +384,13 @@ class Component extends Base {
376384
updateDepth_: 1,
377385
/**
378386
* The component vnode tree. Available after the component got rendered.
379-
* @member {Object} vnode_=null
387+
* @member {Object} vnode_=={[isDescriptor]: true, value: null, isEqual: (a, b) => a === b,}
380388
* @protected
381389
*/
382390
vnode_: {
383391
[isDescriptor]: true,
392+
isEqual : (a, b) => a === b, // vnode trees can be huge, and will get compared by the vdom worker.
384393
value : null,
385-
isEqual : (a, b) => a === b // vnode trees can be huge, and will get compared by the vdom worker.
386394
},
387395
/**
388396
* Shortcut for style.width, defaults to px
@@ -400,9 +408,13 @@ class Component extends Base {
400408
wrapperCls_: null,
401409
/**
402410
* Top level style attributes. Useful in case getVdomRoot() does not point to the top level DOM node.
403-
* @member {Object|null} wrapperStyle_=null
411+
* @member {Object|null} wrapperStyle_={[isDescriptor]: true, merge: 'deep', value: null}
404412
*/
405-
wrapperStyle_: null,
413+
wrapperStyle_: {
414+
[isDescriptor]: true,
415+
merge : 'deep',
416+
value : null
417+
},
406418
/**
407419
* The vdom markup for this component.
408420
* @member {Object} _vdom={}

0 commit comments

Comments
 (0)