-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
ghost.view.ts
57 lines (42 loc) · 970 Bytes
/
ghost.view.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
namespace $.$$ {
/**
* Mixin view logic to DOM node of another component.
*/
export class $mol_ghost extends $.$mol_ghost {
override dom_node_external( next?: Element ) {
return this.Sub().dom_node( next )
}
@ $mol_mem
dom_node_actual() {
this.dom_node()
const node = this.Sub().dom_node_actual()
const attr = this.attr()
const style = this.style()
const fields = this.field()
$mol_dom_render_attributes( node , attr )
$mol_dom_render_styles( node , style )
$mol_dom_render_fields( node , fields )
return node
}
dom_tree() {
const Sub = this.Sub()
const node = Sub.dom_tree()
try {
this.dom_node_actual()
this.auto()
} catch( error: unknown ) {
$mol_fail_log( error )
}
return node
}
title() {
return this.Sub().title()
}
minimal_width() {
return this.Sub().minimal_width()
}
minimal_height() {
return this.Sub().minimal_height()
}
}
}