File tree 4 files changed +18
-17
lines changed
4 files changed +18
-17
lines changed Original file line number Diff line number Diff line change 86
86
87
87
<BuilderNavbarSeparator />
88
88
89
- <BuilderNavbarActions {state } {isSigned } on:action />
89
+ <BuilderNavbarActions {state } {isSigned } readOnly ={ forceReadOnly } on:action />
90
90
91
91
<BuilderNavbarSeparator />
92
92
138
138
<BuilderNavbarActions
139
139
{state }
140
140
{isSigned }
141
+ readOnly ={forceReadOnly }
141
142
on:action ={(event ) => {
142
143
mobileMenuOpen = false ;
143
144
dispatch (" action" , event .detail );
Original file line number Diff line number Diff line change 9
9
10
10
export let state: State = " init" ;
11
11
export let isSigned = false ;
12
+ export let readOnly = false ;
12
13
</script >
13
14
14
15
<div class =" flex space-x-1 items-center" >
15
16
<button
16
17
title =" Build the GOBL document."
17
- class ={iconButtonClasses (state !== " modified" && state !== " loaded" && state !== " errored" )}
18
- disabled ={state !== " modified" && state !== " loaded" && state !== " errored" }
18
+ class ={iconButtonClasses (( state !== " modified" && state !== " loaded" && state !== " errored" ) || readOnly )}
19
+ disabled ={( state !== " modified" && state !== " loaded" && state !== " errored" ) || readOnly }
19
20
on:click ={() => {
20
21
dispatch (" action" , " build" );
21
22
}}
27
28
on:click ={() => {
28
29
dispatch (" action" , " correct" );
29
30
}}
30
- class ={iconButtonClasses (! [" loaded" , " built" ].includes (state ))}
31
- disabled ={! [" loaded" , " built" ].includes (state )}
31
+ class ={iconButtonClasses (! [" loaded" , " built" ].includes (state ) || readOnly )}
32
+ disabled ={! [" loaded" , " built" ].includes (state ) || readOnly }
32
33
>
33
34
<Icon src ={Erase } class =" w-5 h-5" />
34
35
</button >
Original file line number Diff line number Diff line change 2
2
import { createEventDispatcher } from " svelte" ;
3
3
import { Icon } from " @steeze-ui/svelte-icon" ;
4
4
import { Header , Signature } from " @invopop/ui-icons" ;
5
+ import { iconButtonClasses } from " ./ui/iconButtonClasses" ;
5
6
6
7
const dispatch = createEventDispatcher ();
7
8
17
18
>
18
19
<Icon src ={Header } class =" h-5 w-5" />
19
20
</button >
20
- {#if isSigned }
21
- <button
22
- title =" Show document signatures"
23
- class =" inline-flex items-center space-x-1.5 p-1.5 border border-gobl-300 text-sm font-medium text-white hover:text-gobl-50 hover:border-gobl-50"
24
- on:click ={() => {
25
- dispatch (" action" , " showSignatures" );
26
- }}
27
- >
28
- <Icon src ={Signature } class =" h-5 w-5" />
29
- </button >
30
- {/if }
21
+ <button
22
+ title =" Show document signatures"
23
+ class ={iconButtonClasses (! isSigned )}
24
+ disabled ={! isSigned }
25
+ on:click ={() => {
26
+ dispatch (" action" , " showSignatures" );
27
+ }}
28
+ >
29
+ <Icon src ={Signature } class =" h-5 w-5" />
30
+ </button >
Original file line number Diff line number Diff line change 149
149
}}
150
150
on:confirm ={async (event ) => {
151
151
const result = await builder .correctWithOptions (event .detail );
152
- console .log (result );
153
152
openCorrectModal = ! result ;
154
153
}}
155
154
/>
You can’t perform that action at this time.
0 commit comments