-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.svelte
163 lines (117 loc) · 5.34 KB
/
main.svelte
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<script>
export let SNPCollectDetailItem;
export let SNPCollectDetailDispatchBack;
export let SNPCollectDetailDispatchUpdate;
export let SNPCollectDetailDispatchClone;
export let SNPCollectDetailDispatchDiscard;
export let SNPCollectDetailDispatchDisableEscape;
export let _DebugLauncher = false;
export const modPublic = {
SNPCollectDetailRecipes () {
return mod.DataCollectDetailRecipes();
},
};
import { OLSKLocalized } from 'OLSKInternational';
import { OLSK_SPEC_UI } from 'OLSKSpec';
const mod = {
__HOTFIX_ITEM_IDS: [],
// DATA
DataCollectDetailRecipes () {
const outputData = [{
LCHRecipeSignature: 'SNPDetailLauncherItemDebug',
LCHRecipeName: OLSKLocalized('OLSKWordingDebugObjectText'),
LCHRecipeCallback: function SNPDetailLauncherItemDebug () {
const url = 'https://inspektor.5apps.com/inspect?path=' + encodeURIComponent('sharesnip/snp_documents/') + SNPCollectDetailItem.SNPDocumentID;
if (OLSK_SPEC_UI()) {
window.FakeWindowOpen = url;
return;
}
window.open(url);
},
}];
if (OLSK_SPEC_UI()) {
outputData.push({
LCHRecipeName: 'SNPCollectDetailLauncherFakeItemProxy',
LCHRecipeCallback: function SNPCollectDetailLauncherFakeItemProxy () {},
});
}
return outputData;
},
// INTERFACE
InterfaceEditButtonDidClick () {
mod._SNPFormBaseModal.modPublic.OLSKModalViewShow();
SNPCollectDetailDispatchDisableEscape(true);
},
// MESSAGE
SNPFormNotValid () {},
SNPFormValid () {},
SNPFormDidFill () {},
SNPFormDidSubmit (inputData) {
mod._SNPFormBaseModal.modPublic.OLSKModalViewClose();
SNPCollectDetailDispatchUpdate(inputData);
SNPCollectDetailItem = inputData;
},
OLSKModalViewDidClose () {
setTimeout(function () {
SNPCollectDetailDispatchDisableEscape(false);
}, 50);
},
// REACT
ReactItem (inputData) {
if (mod.__HOTFIX_ITEM_IDS.includes(inputData)) {
return;
}
mod.__HOTFIX_ITEM_IDS = [];
setTimeout(function () {
mod.__HOTFIX_ITEM_IDS = [inputData];
})
},
};
$: {
mod.ReactItem(SNPCollectDetailItem.SNPDocumentID)
}
import OLSKUIAssets from 'OLSKUIAssets';
import OLSKModalView from 'OLSKModalView';
import SNPFormBase from '../sub-base/main.svelte';
import SNPCode from '../sub-code/main.svelte';
</script>
<div class="SNPCollectDetail ROCOStandardView">
<header class="SNPCollectDetailToolbar OLSKToolbar OLSKToolbarJustify OLSKMobileViewHeader OLSKCommonEdgeBottom ROCOStandardViewHead">
<div class="OLSKToolbarElementGroup">
<button class="SNPCollectDetailToolbarBackButton OLSKDecorButtonNoStyle OLSKDecorTappable OLSKToolbarButton OLSKVisibilityMobile OLSKVisibilityDesktopScreenreader" title={ OLSKLocalized('SNPCollectDetailToolbarBackButtonText') } on:click={ SNPCollectDetailDispatchBack }>
<div class="SNPCollectDetailToolbarBackButtonImage">{@html OLSKUIAssets._OLSKSharedBack }</div>
</button>
</div>
<div class="OLSKToolbarElementGroup">
<button class="SNPCollectDetailToolbarCloneButton OLSKDecorButtonNoStyle OLSKDecorTappable OLSKToolbarButton" title={ OLSKLocalized('SNPCollectDetailToolbarCloneButtonText') } on:click={ SNPCollectDetailDispatchClone }>
<div class="SNPCollectDetailToolbarCloneButtonImage">{@html OLSKUIAssets._OLSKSharedClone }</div>
</button>
<button class="SNPCollectDetailToolbarDiscardButton OLSKDecorButtonNoStyle OLSKDecorTappable OLSKToolbarButton" title={ OLSKLocalized('SNPCollectDetailToolbarDiscardButtonText') } on:click={ () => window.confirm(OLSKLocalized('OLSKWordingConfirmText')) && SNPCollectDetailDispatchDiscard() }>
<div class="SNPCollectDetailToolbarDiscardButtonImage">{@html OLSKUIAssets._OLSKSharedDiscard }</div>
</button>
</div>
</header>
<div class="ROCOStandardViewBody">
<div class="SNPCollectDetailForm OLSKDecor OLSKDecorBigForm">
<p>
<input class="SNPCollectDetailFormNameField" placeholder={ OLSKLocalized('SNPCollectDetailFormNameFieldText') } type="text" bind:value={ SNPCollectDetailItem.SNPDocumentName } on:input={ SNPCollectDetailDispatchUpdate } disabled={ SNPCollectDetailItem.$SNPDocumentIsInbox ? true : null } />
</p>
<p class="SNPCollectDetailData">
<input class="SNPCollectDetailDataField" placeholder={ OLSKLocalized('SNPCollectDetailDataFieldText') } type="text" disabled bind:value={ SNPCollectDetailItem.SNPDocumentData } />
{#if SNPCollectDetailItem.SNPDocumentType === 'TYPE_SITE' }
<a class="SNPCollectDetailDataOpenButton OLSKDecorPress" href={ SNPCollectDetailItem.SNPDocumentData } target="_blank">{ OLSKLocalized('SNPCollectDetailDataOpenButtonText') }</a>
{/if}
</p>
<SNPCode SNPCodeObject={ SNPCollectDetailItem } />
<p>
<button class="SNPCollectDetailEditButton" on:click={ mod.InterfaceEditButtonDidClick }>{ OLSKLocalized('OLSKWordingEditText') }</button>
</p>
</div>
</div>
</div>
<OLSKModalView OLSKModalViewTitleText={ OLSKLocalized('OLSKWordingEditText') } OLSKModalViewCloseText={ OLSKLocalized('OLSKWordingCancelText') } OLSKModalViewDidClose={ mod.OLSKModalViewDidClose } bind:this={ mod._SNPFormBaseModal }>
<SNPFormBase SNPFormBaseObject={ SNPCollectDetailItem } SNPFormNotValid={ mod.SNPFormNotValid } SNPFormValid={ mod.SNPFormValid } SNPFormDidFill={ mod.SNPFormDidFill } SNPFormDidSubmit={ mod.SNPFormDidSubmit } />
</OLSKModalView>
{#if _DebugLauncher && OLSK_SPEC_UI() }
<button class="OLSKAppToolbarLauncherButton" on:click={ () => window.Launchlet.LCHSingletonCreate({ LCHOptionRecipes: mod.DataCollectDetailRecipes() }) }></button>
{/if}