-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccount.view.ts
49 lines (37 loc) · 1.01 KB
/
account.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
namespace $.$$ {
export class $aspirity_account extends $.$aspirity_account {
signed() {
return !!this.$.$aspirity_account_transport.token()
}
@ $mol_mem_key
invoice( id: string ) {
return this.domain().invoice().Item( id )
}
invoice_arg() {
return this.$.$mol_state_arg.value( 'invoice' )
}
filter_enabled() {
return this.$.$mol_state_arg.value( 'filter' ) !== null
}
new_arg() {
return this.$.$mol_state_arg.value( 'new' ) !== null
}
contractor_arg() {
return this.$.$mol_state_arg.value( 'contractor' ) !== null
}
contact_arg() {
return this.$.$mol_state_arg.value( 'contact' ) !== null
}
@ $mol_mem
pages() {
if ( !this.signed() ) return [ this.Sign_in() ]
return [
this.Browse(),
... this.new_arg() ? [ this.New() ] : [],
... this.invoice_arg() && !this.new_arg() ? [ this.Invoice( this.invoice_arg() ) ] : [],
... this.contractor_arg() ? [ this.Contractor() ] : [],
... this.contact_arg() ? [ this.Contact() ] : [],
]
}
}
}