@lavalogic/scoria 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -58
- package/dist/Components/AccordionGroup.svelte +42 -42
- package/dist/Components/AccordionGroupButton.svelte +99 -99
- package/dist/Components/Action.svelte +138 -138
- package/dist/Components/AlertModal.svelte +125 -125
- package/dist/Components/Base/ContextWrapper.svelte +50 -50
- package/dist/Components/Base/Pagination.svelte +190 -190
- package/dist/Components/Base/Snippets.svelte +29 -29
- package/dist/Components/BigRadioSet.svelte +29 -29
- package/dist/Components/Bubble.svelte +77 -77
- package/dist/Components/Button.svelte +197 -197
- package/dist/Components/Checkbox.svelte +68 -68
- package/dist/Components/CollapsibleCard.svelte +70 -70
- package/dist/Components/Contexts/ContextMenu.svelte +157 -157
- package/dist/Components/Contexts/ContextMenuDivider.svelte +11 -11
- package/dist/Components/Contexts/ContextMenuOption.svelte +52 -52
- package/dist/Components/Contexts/Toast.svelte +61 -61
- package/dist/Components/Contexts/ToastContainer.svelte +46 -46
- package/dist/Components/Contexts/Tooltip.svelte +26 -26
- package/dist/Components/DataMatrixIcon.svelte +41 -41
- package/dist/Components/DateInput.svelte +109 -109
- package/dist/Components/DatePicker.svelte +312 -312
- package/dist/Components/DesktopModal.svelte +106 -106
- package/dist/Components/Dial.svelte +151 -151
- package/dist/Components/DimensionInput.svelte +184 -184
- package/dist/Components/DragMenu/DragMenuHolder.svelte +106 -106
- package/dist/Components/DragMenu/DraggableCard.svelte +41 -41
- package/dist/Components/FileCard.svelte +20 -20
- package/dist/Components/FileUpload.svelte +196 -196
- package/dist/Components/GridInput.svelte +190 -190
- package/dist/Components/GridInputSet.svelte +22 -22
- package/dist/Components/HorizontalTabGroup.svelte +78 -78
- package/dist/Components/HorizontalTabGroupButton.svelte +96 -96
- package/dist/Components/Icon.svelte +97 -97
- package/dist/Components/Icons.js +357 -357
- package/dist/Components/LoadingAnimation.svelte +32 -32
- package/dist/Components/LoadingModal.svelte +47 -47
- package/dist/Components/LoadingOverlay.svelte +27 -27
- package/dist/Components/Modal.svelte +251 -251
- package/dist/Components/MultiSelect.svelte +197 -197
- package/dist/Components/Nav/Nav.svelte +97 -97
- package/dist/Components/Nav/NavServiceMenuList.svelte +34 -34
- package/dist/Components/Nav/NavTab.svelte +91 -91
- package/dist/Components/Nav/ServiceMenuItem.svelte +91 -91
- package/dist/Components/Nav/ServicesNav.svelte +53 -53
- package/dist/Components/NumberInput.svelte +144 -144
- package/dist/Components/PageHeading.svelte +36 -36
- package/dist/Components/PasswordInput.svelte +73 -73
- package/dist/Components/Portal.svelte +25 -25
- package/dist/Components/ProgressBubble.svelte +80 -80
- package/dist/Components/QuerySelect.svelte +411 -411
- package/dist/Components/SingleSelect.svelte +261 -261
- package/dist/Components/StepButton.svelte +120 -120
- package/dist/Components/StepForm.svelte +108 -108
- package/dist/Components/Switch.svelte +36 -36
- package/dist/Components/Table/Body/QuickSearchCell.svelte +632 -632
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +30 -30
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +56 -56
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +179 -179
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +49 -49
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +180 -180
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +102 -102
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +119 -119
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +114 -114
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +96 -96
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +72 -72
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +131 -131
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +144 -144
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +238 -238
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +358 -358
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +338 -338
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +183 -183
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +309 -309
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +369 -369
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +170 -170
- package/dist/Components/Table/Body/Rows/TableRow.svelte +259 -259
- package/dist/Components/Table/Body/TableBody.svelte +67 -67
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +39 -39
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +28 -28
- package/dist/Components/Table/Headers/TableHead.svelte +260 -260
- package/dist/Components/Table/Misc/ColumnPanel.svelte +78 -78
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +99 -99
- package/dist/Components/Table/Misc/FilterInput.svelte +556 -556
- package/dist/Components/Table/Misc/FilterPanel.svelte +46 -46
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +67 -67
- package/dist/Components/Table/Misc/SidePanel.svelte +32 -32
- package/dist/Components/Table/Misc/TableFooter.svelte +304 -304
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +156 -156
- package/dist/Components/Table/Misc/TableSidebar.svelte +176 -176
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +77 -77
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +91 -91
- package/dist/Components/Table/NestedTable.svelte +84 -84
- package/dist/Components/Table/Table.svelte +492 -492
- package/dist/Components/Test/TestContextConsumer.svelte +13 -13
- package/dist/Components/TextArea.svelte +108 -108
- package/dist/Components/TextInput.svelte +147 -147
- package/dist/Components/ThreeStateRadio.svelte +124 -124
- package/dist/Components/Touch/BoolCard.svelte +52 -52
- package/dist/Components/Touch/DateModal.svelte +217 -217
- package/dist/Components/Touch/EditCard.svelte +52 -52
- package/dist/Components/Touch/InfoCard.svelte +24 -24
- package/dist/Components/Touch/InfoTextCard.svelte +21 -21
- package/dist/Components/Touch/ModalExplanation.svelte +20 -20
- package/dist/Components/Touch/NumberKeyboard.svelte +268 -268
- package/dist/Components/Touch/NumberModal.svelte +69 -69
- package/dist/Components/Touch/PlusMinusCard.svelte +50 -50
- package/dist/Components/Touch/SelectModal.svelte +105 -105
- package/dist/Components/Touch/SummaryCard.svelte +65 -65
- package/dist/Components/Touch/TextAreaModal.svelte +86 -86
- package/dist/Components/Touch/TextModal.svelte +123 -123
- package/dist/Components/Touch/TouchCard.svelte +28 -28
- package/dist/Components/Touch/TouchModal.svelte +259 -259
- package/dist/Components/Touch/UtilityButton.svelte +91 -91
- package/dist/Components/VerticalTabGroup.svelte +66 -66
- package/dist/Components/VerticalTabGroupButton.svelte +97 -97
- package/dist/Helpers/Datamatrix.d.ts +10 -10
- package/dist/Helpers/Datamatrix.js +1 -1
- package/dist/Helpers/Helpers.svelte.d.ts +1 -0
- package/dist/Helpers/Helpers.svelte.js +15 -0
- package/dist/Types/Examples/ExampleModal.svelte +34 -34
- package/dist/scss/_basics.scss +12 -12
- package/dist/scss/_colours.scss +134 -134
- package/dist/scss/_mixins.scss +3016 -3016
- package/dist/scss/_sizing.scss +69 -69
- package/dist/scss/_transitions.scss +8 -8
- package/package.json +30 -30
|
@@ -1,219 +1,219 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
module
|
|
6
|
-
>
|
|
7
|
-
import { devCatch, passthrough } from '../../Helpers/Helpers.svelte.js';
|
|
8
|
-
import { ColourSet } from '../../scss/colours.js';
|
|
9
|
-
import { InputVariant } from '../../Types/Internal/InputVariant.js';
|
|
10
|
-
import { Size } from '../../Types/Internal/Size.js';
|
|
11
|
-
import { tick, type Snippet } from 'svelte';
|
|
12
|
-
import Action from '../Action.svelte';
|
|
13
|
-
import DatePicker from '../DatePicker.svelte';
|
|
14
|
-
import TextInput from '../TextInput.svelte';
|
|
15
|
-
import TouchModal from './TouchModal.svelte';
|
|
16
|
-
|
|
17
|
-
export interface DateModalProps {
|
|
18
|
-
header: string;
|
|
19
|
-
value?: Date | null;
|
|
20
|
-
cancelEditing: () => void;
|
|
21
|
-
confirm: (value: Date, overrideValue?: Date) => void;
|
|
22
|
-
namedMonths?: boolean;
|
|
23
|
-
validate?: (value: Date | undefined) => boolean;
|
|
24
|
-
showScanner?: boolean;
|
|
25
|
-
scanValue?: string;
|
|
26
|
-
overrideScanValue?: string;
|
|
27
|
-
confirmScannedValue?: (value: string, overrideValue?: string) => void;
|
|
28
|
-
inclusive?: boolean;
|
|
29
|
-
explanation?: Snippet;
|
|
30
|
-
allowOverride?: boolean;
|
|
31
|
-
showTime?: boolean;
|
|
32
|
-
}
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<script lang="ts">
|
|
36
|
-
let {
|
|
37
|
-
header,
|
|
38
|
-
value,
|
|
39
|
-
cancelEditing,
|
|
40
|
-
confirm,
|
|
41
|
-
namedMonths = false,
|
|
42
|
-
validate,
|
|
43
|
-
showScanner = false,
|
|
44
|
-
scanValue = $bindable(''),
|
|
45
|
-
overrideScanValue = $bindable(''),
|
|
46
|
-
confirmScannedValue,
|
|
47
|
-
inclusive = false,
|
|
48
|
-
explanation,
|
|
49
|
-
allowOverride = false,
|
|
50
|
-
showTime = false,
|
|
51
|
-
}: DateModalProps = $props();
|
|
52
|
-
|
|
53
|
-
let tempValue = $derived(value ?? new Date());
|
|
54
|
-
let overrideValue = $state(new Date());
|
|
55
|
-
let isBeingEdited = $state(false);
|
|
56
|
-
let inputRef: HTMLInputElement | undefined = $state();
|
|
57
|
-
let overrideInputRef: HTMLInputElement | undefined = $state();
|
|
58
|
-
const isValid = $derived(validate?.(tempValue) ?? true);
|
|
59
|
-
|
|
60
|
-
export function resetIsBeingEdited() {
|
|
61
|
-
isBeingEdited = false;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
$effect(() => {
|
|
65
|
-
void value;
|
|
66
|
-
|
|
67
|
-
isBeingEdited = false;
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
$effect(() => {
|
|
71
|
-
void isBeingEdited;
|
|
72
|
-
void allowOverride;
|
|
73
|
-
tick()
|
|
74
|
-
.then(() => {
|
|
75
|
-
if (isBeingEdited) {
|
|
76
|
-
overrideInputRef?.focus();
|
|
77
|
-
} else {
|
|
78
|
-
inputRef?.focus();
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
.catch(devCatch);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
function onsubmit(e?: SubmitEvent) {
|
|
85
|
-
e?.preventDefault();
|
|
86
|
-
|
|
87
|
-
if (isValid) {
|
|
88
|
-
if (inclusive) {
|
|
89
|
-
tempValue.setHours(23, 59, 59);
|
|
90
|
-
console.log(tempValue);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
confirm(tempValue, allowOverride && isBeingEdited ? overrideValue : undefined);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
scanValue = '';
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function submitOnEnter(e: KeyboardEvent) {
|
|
100
|
-
if (e.key === 'Enter') {
|
|
101
|
-
e.preventDefault();
|
|
102
|
-
e.stopPropagation();
|
|
103
|
-
|
|
104
|
-
if (!scanValue || (isBeingEdited && !overrideScanValue)) {
|
|
105
|
-
if (
|
|
106
|
-
allowOverride &&
|
|
107
|
-
isBeingEdited &&
|
|
108
|
-
!overrideScanValue &&
|
|
109
|
-
document.activeElement != inputRef
|
|
110
|
-
) {
|
|
111
|
-
overrideInputRef?.focus();
|
|
112
|
-
} else {
|
|
113
|
-
inputRef?.focus();
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
confirmScannedValue?.(
|
|
120
|
-
scanValue,
|
|
121
|
-
allowOverride && isBeingEdited ? overrideScanValue : undefined
|
|
122
|
-
);
|
|
123
|
-
scanValue = '';
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
</script>
|
|
127
|
-
|
|
128
|
-
<!-- mandatory -->
|
|
129
|
-
|
|
130
|
-
<TouchModal
|
|
131
|
-
onclose={() => {
|
|
132
|
-
cancelEditing();
|
|
133
|
-
}}
|
|
134
|
-
{header}
|
|
135
|
-
{onsubmit}
|
|
136
|
-
{explanation}
|
|
137
|
-
>
|
|
138
|
-
{#if showScanner}
|
|
139
|
-
<div class="inputs">
|
|
140
|
-
{#if allowOverride}
|
|
141
|
-
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
142
|
-
{@render overrideButton()}
|
|
143
|
-
{/if}
|
|
144
|
-
{#if isBeingEdited}
|
|
145
|
-
<TextInput
|
|
146
|
-
bind:inputRef={overrideInputRef}
|
|
147
|
-
bind:value={overrideScanValue}
|
|
148
|
-
variant={InputVariant.Modal}
|
|
149
|
-
labelTop="Scan Barcode to Override"
|
|
150
|
-
onkeydown={submitOnEnter}
|
|
151
|
-
/>
|
|
152
|
-
{/if}
|
|
153
|
-
<TextInput
|
|
154
|
-
bind:inputRef
|
|
155
|
-
bind:value={scanValue}
|
|
156
|
-
variant={InputVariant.Modal}
|
|
157
|
-
labelTop="Scan Barcode"
|
|
158
|
-
onkeydown={submitOnEnter}
|
|
159
|
-
/>
|
|
160
|
-
</div>
|
|
161
|
-
{:else if allowOverride}
|
|
162
|
-
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
163
|
-
{@render overrideButton()}
|
|
164
|
-
{/if}
|
|
165
|
-
|
|
166
|
-
<div class="inputs">
|
|
167
|
-
{#if allowOverride && isBeingEdited}
|
|
168
|
-
<DatePicker
|
|
169
|
-
{showTime}
|
|
170
|
-
{onsubmit}
|
|
171
|
-
{namedMonths}
|
|
172
|
-
bind:date={overrideValue}
|
|
173
|
-
/>
|
|
174
|
-
{/if}
|
|
175
|
-
<DatePicker
|
|
176
|
-
{showTime}
|
|
177
|
-
{onsubmit}
|
|
178
|
-
{namedMonths}
|
|
179
|
-
bind:date={tempValue}
|
|
180
|
-
/>
|
|
181
|
-
</div>
|
|
182
|
-
|
|
183
|
-
{#snippet footer()}
|
|
184
|
-
<div class="modal-footer">
|
|
185
|
-
<button
|
|
186
|
-
onkeydown={passthrough}
|
|
187
|
-
type="submit"
|
|
188
|
-
disabled={!isValid}>Confirm</button
|
|
189
|
-
>
|
|
190
|
-
<button
|
|
191
|
-
onkeydown={passthrough}
|
|
192
|
-
type="button"
|
|
193
|
-
onclick={() => {
|
|
194
|
-
cancelEditing();
|
|
195
|
-
}}>Cancel</button
|
|
196
|
-
>
|
|
197
|
-
</div>
|
|
198
|
-
{/snippet}
|
|
199
|
-
</TouchModal>
|
|
200
|
-
|
|
201
|
-
{#snippet overrideButton()}
|
|
202
|
-
<div>
|
|
203
|
-
<Action
|
|
204
|
-
icon={{ name: 'edit' }}
|
|
205
|
-
size={Size.DoubleXLarge}
|
|
206
|
-
colourSet={isBeingEdited ? ColourSet.Primary : ColourSet.Secondary}
|
|
207
|
-
onclick={() => {
|
|
208
|
-
if (!allowOverride) {
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
isBeingEdited = !isBeingEdited;
|
|
212
|
-
}}
|
|
213
|
-
/>
|
|
214
|
-
</div>
|
|
215
|
-
{/snippet}
|
|
216
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
module
|
|
6
|
+
>
|
|
7
|
+
import { devCatch, passthrough } from '../../Helpers/Helpers.svelte.js';
|
|
8
|
+
import { ColourSet } from '../../scss/colours.js';
|
|
9
|
+
import { InputVariant } from '../../Types/Internal/InputVariant.js';
|
|
10
|
+
import { Size } from '../../Types/Internal/Size.js';
|
|
11
|
+
import { tick, type Snippet } from 'svelte';
|
|
12
|
+
import Action from '../Action.svelte';
|
|
13
|
+
import DatePicker from '../DatePicker.svelte';
|
|
14
|
+
import TextInput from '../TextInput.svelte';
|
|
15
|
+
import TouchModal from './TouchModal.svelte';
|
|
16
|
+
|
|
17
|
+
export interface DateModalProps {
|
|
18
|
+
header: string;
|
|
19
|
+
value?: Date | null;
|
|
20
|
+
cancelEditing: () => void;
|
|
21
|
+
confirm: (value: Date, overrideValue?: Date) => void;
|
|
22
|
+
namedMonths?: boolean;
|
|
23
|
+
validate?: (value: Date | undefined) => boolean;
|
|
24
|
+
showScanner?: boolean;
|
|
25
|
+
scanValue?: string;
|
|
26
|
+
overrideScanValue?: string;
|
|
27
|
+
confirmScannedValue?: (value: string, overrideValue?: string) => void;
|
|
28
|
+
inclusive?: boolean;
|
|
29
|
+
explanation?: Snippet;
|
|
30
|
+
allowOverride?: boolean;
|
|
31
|
+
showTime?: boolean;
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<script lang="ts">
|
|
36
|
+
let {
|
|
37
|
+
header,
|
|
38
|
+
value,
|
|
39
|
+
cancelEditing,
|
|
40
|
+
confirm,
|
|
41
|
+
namedMonths = false,
|
|
42
|
+
validate,
|
|
43
|
+
showScanner = false,
|
|
44
|
+
scanValue = $bindable(''),
|
|
45
|
+
overrideScanValue = $bindable(''),
|
|
46
|
+
confirmScannedValue,
|
|
47
|
+
inclusive = false,
|
|
48
|
+
explanation,
|
|
49
|
+
allowOverride = false,
|
|
50
|
+
showTime = false,
|
|
51
|
+
}: DateModalProps = $props();
|
|
52
|
+
|
|
53
|
+
let tempValue = $derived(value ?? new Date());
|
|
54
|
+
let overrideValue = $state(new Date());
|
|
55
|
+
let isBeingEdited = $state(false);
|
|
56
|
+
let inputRef: HTMLInputElement | undefined = $state();
|
|
57
|
+
let overrideInputRef: HTMLInputElement | undefined = $state();
|
|
58
|
+
const isValid = $derived(validate?.(tempValue) ?? true);
|
|
59
|
+
|
|
60
|
+
export function resetIsBeingEdited() {
|
|
61
|
+
isBeingEdited = false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$effect(() => {
|
|
65
|
+
void value;
|
|
66
|
+
|
|
67
|
+
isBeingEdited = false;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
$effect(() => {
|
|
71
|
+
void isBeingEdited;
|
|
72
|
+
void allowOverride;
|
|
73
|
+
tick()
|
|
74
|
+
.then(() => {
|
|
75
|
+
if (isBeingEdited) {
|
|
76
|
+
overrideInputRef?.focus();
|
|
77
|
+
} else {
|
|
78
|
+
inputRef?.focus();
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
.catch(devCatch);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
function onsubmit(e?: SubmitEvent) {
|
|
85
|
+
e?.preventDefault();
|
|
86
|
+
|
|
87
|
+
if (isValid) {
|
|
88
|
+
if (inclusive) {
|
|
89
|
+
tempValue.setHours(23, 59, 59);
|
|
90
|
+
console.log(tempValue);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
confirm(tempValue, allowOverride && isBeingEdited ? overrideValue : undefined);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
scanValue = '';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function submitOnEnter(e: KeyboardEvent) {
|
|
100
|
+
if (e.key === 'Enter') {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
e.stopPropagation();
|
|
103
|
+
|
|
104
|
+
if (!scanValue || (isBeingEdited && !overrideScanValue)) {
|
|
105
|
+
if (
|
|
106
|
+
allowOverride &&
|
|
107
|
+
isBeingEdited &&
|
|
108
|
+
!overrideScanValue &&
|
|
109
|
+
document.activeElement != inputRef
|
|
110
|
+
) {
|
|
111
|
+
overrideInputRef?.focus();
|
|
112
|
+
} else {
|
|
113
|
+
inputRef?.focus();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
confirmScannedValue?.(
|
|
120
|
+
scanValue,
|
|
121
|
+
allowOverride && isBeingEdited ? overrideScanValue : undefined
|
|
122
|
+
);
|
|
123
|
+
scanValue = '';
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</script>
|
|
127
|
+
|
|
128
|
+
<!-- mandatory -->
|
|
129
|
+
|
|
130
|
+
<TouchModal
|
|
131
|
+
onclose={() => {
|
|
132
|
+
cancelEditing();
|
|
133
|
+
}}
|
|
134
|
+
{header}
|
|
135
|
+
{onsubmit}
|
|
136
|
+
{explanation}
|
|
137
|
+
>
|
|
138
|
+
{#if showScanner}
|
|
139
|
+
<div class="inputs">
|
|
140
|
+
{#if allowOverride}
|
|
141
|
+
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
142
|
+
{@render overrideButton()}
|
|
143
|
+
{/if}
|
|
144
|
+
{#if isBeingEdited}
|
|
145
|
+
<TextInput
|
|
146
|
+
bind:inputRef={overrideInputRef}
|
|
147
|
+
bind:value={overrideScanValue}
|
|
148
|
+
variant={InputVariant.Modal}
|
|
149
|
+
labelTop="Scan Barcode to Override"
|
|
150
|
+
onkeydown={submitOnEnter}
|
|
151
|
+
/>
|
|
152
|
+
{/if}
|
|
153
|
+
<TextInput
|
|
154
|
+
bind:inputRef
|
|
155
|
+
bind:value={scanValue}
|
|
156
|
+
variant={InputVariant.Modal}
|
|
157
|
+
labelTop="Scan Barcode"
|
|
158
|
+
onkeydown={submitOnEnter}
|
|
159
|
+
/>
|
|
160
|
+
</div>
|
|
161
|
+
{:else if allowOverride}
|
|
162
|
+
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
163
|
+
{@render overrideButton()}
|
|
164
|
+
{/if}
|
|
165
|
+
|
|
166
|
+
<div class="inputs">
|
|
167
|
+
{#if allowOverride && isBeingEdited}
|
|
168
|
+
<DatePicker
|
|
169
|
+
{showTime}
|
|
170
|
+
{onsubmit}
|
|
171
|
+
{namedMonths}
|
|
172
|
+
bind:date={overrideValue}
|
|
173
|
+
/>
|
|
174
|
+
{/if}
|
|
175
|
+
<DatePicker
|
|
176
|
+
{showTime}
|
|
177
|
+
{onsubmit}
|
|
178
|
+
{namedMonths}
|
|
179
|
+
bind:date={tempValue}
|
|
180
|
+
/>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
{#snippet footer()}
|
|
184
|
+
<div class="modal-footer">
|
|
185
|
+
<button
|
|
186
|
+
onkeydown={passthrough}
|
|
187
|
+
type="submit"
|
|
188
|
+
disabled={!isValid}>Confirm</button
|
|
189
|
+
>
|
|
190
|
+
<button
|
|
191
|
+
onkeydown={passthrough}
|
|
192
|
+
type="button"
|
|
193
|
+
onclick={() => {
|
|
194
|
+
cancelEditing();
|
|
195
|
+
}}>Cancel</button
|
|
196
|
+
>
|
|
197
|
+
</div>
|
|
198
|
+
{/snippet}
|
|
199
|
+
</TouchModal>
|
|
200
|
+
|
|
201
|
+
{#snippet overrideButton()}
|
|
202
|
+
<div>
|
|
203
|
+
<Action
|
|
204
|
+
icon={{ name: 'edit' }}
|
|
205
|
+
size={Size.DoubleXLarge}
|
|
206
|
+
colourSet={isBeingEdited ? ColourSet.Primary : ColourSet.Secondary}
|
|
207
|
+
onclick={() => {
|
|
208
|
+
if (!allowOverride) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
isBeingEdited = !isBeingEdited;
|
|
212
|
+
}}
|
|
213
|
+
/>
|
|
214
|
+
</div>
|
|
215
|
+
{/snippet}
|
|
216
|
+
|
|
217
217
|
<style>.modal-footer {
|
|
218
218
|
bottom: 0;
|
|
219
219
|
border-top: solid 1px #cbd4da;
|
|
@@ -272,4 +272,4 @@ div.inputs {
|
|
|
272
272
|
flex-flow: row nowrap;
|
|
273
273
|
gap: 1.5rem;
|
|
274
274
|
justify-content: space-around;
|
|
275
|
-
}</style>
|
|
275
|
+
}</style>
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { passthrough } from '../../Helpers/Helpers.svelte.js';
|
|
5
|
-
import { Size } from '../../Types/Internal/Size.js';
|
|
6
|
-
import Icon from '../Icon.svelte';
|
|
7
|
-
import type { EditCardProps } from './EditCardProps.js';
|
|
8
|
-
const {
|
|
9
|
-
noborder,
|
|
10
|
-
label,
|
|
11
|
-
desktop = false,
|
|
12
|
-
iconName = 'edit',
|
|
13
|
-
disabled = false,
|
|
14
|
-
error = false,
|
|
15
|
-
onclick,
|
|
16
|
-
children
|
|
17
|
-
}: EditCardProps = $props();
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<button
|
|
21
|
-
type="button"
|
|
22
|
-
class="card"
|
|
23
|
-
class:desktop
|
|
24
|
-
class:error
|
|
25
|
-
class:noborder
|
|
26
|
-
{disabled}
|
|
27
|
-
{onclick}
|
|
28
|
-
onkeydown={passthrough}
|
|
29
|
-
>
|
|
30
|
-
<div class="left">
|
|
31
|
-
{#if label}
|
|
32
|
-
<div class="row">
|
|
33
|
-
<span class="card-label label">{label}</span>
|
|
34
|
-
{#if desktop}
|
|
35
|
-
<span class="card-label border">{label}</span>
|
|
36
|
-
{/if}
|
|
37
|
-
</div>
|
|
38
|
-
{/if}
|
|
39
|
-
<div class="row" class:labelless={!label}>
|
|
40
|
-
{#if children}
|
|
41
|
-
<span class="value">{@render children()}</span>
|
|
42
|
-
{/if}
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
<div class="right">
|
|
46
|
-
{#if iconName}
|
|
47
|
-
<Icon name={iconName} size={desktop ? Size.Medium : Size.XLarge} />
|
|
48
|
-
{/if}
|
|
49
|
-
</div>
|
|
50
|
-
</button>
|
|
51
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { passthrough } from '../../Helpers/Helpers.svelte.js';
|
|
5
|
+
import { Size } from '../../Types/Internal/Size.js';
|
|
6
|
+
import Icon from '../Icon.svelte';
|
|
7
|
+
import type { EditCardProps } from './EditCardProps.js';
|
|
8
|
+
const {
|
|
9
|
+
noborder,
|
|
10
|
+
label,
|
|
11
|
+
desktop = false,
|
|
12
|
+
iconName = 'edit',
|
|
13
|
+
disabled = false,
|
|
14
|
+
error = false,
|
|
15
|
+
onclick,
|
|
16
|
+
children
|
|
17
|
+
}: EditCardProps = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<button
|
|
21
|
+
type="button"
|
|
22
|
+
class="card"
|
|
23
|
+
class:desktop
|
|
24
|
+
class:error
|
|
25
|
+
class:noborder
|
|
26
|
+
{disabled}
|
|
27
|
+
{onclick}
|
|
28
|
+
onkeydown={passthrough}
|
|
29
|
+
>
|
|
30
|
+
<div class="left">
|
|
31
|
+
{#if label}
|
|
32
|
+
<div class="row">
|
|
33
|
+
<span class="card-label label">{label}</span>
|
|
34
|
+
{#if desktop}
|
|
35
|
+
<span class="card-label border">{label}</span>
|
|
36
|
+
{/if}
|
|
37
|
+
</div>
|
|
38
|
+
{/if}
|
|
39
|
+
<div class="row" class:labelless={!label}>
|
|
40
|
+
{#if children}
|
|
41
|
+
<span class="value">{@render children()}</span>
|
|
42
|
+
{/if}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="right">
|
|
46
|
+
{#if iconName}
|
|
47
|
+
<Icon name={iconName} size={desktop ? Size.Medium : Size.XLarge} />
|
|
48
|
+
{/if}
|
|
49
|
+
</div>
|
|
50
|
+
</button>
|
|
51
|
+
|
|
52
52
|
<style>.card {
|
|
53
53
|
color: #3a4952;
|
|
54
54
|
fill: #3a4952;
|
|
@@ -206,4 +206,4 @@
|
|
|
206
206
|
}
|
|
207
207
|
.card .labelless {
|
|
208
208
|
padding: 0.75rem;
|
|
209
|
-
}</style>
|
|
209
|
+
}</style>
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { Size } from '../../Types/Internal/Size.js';
|
|
5
|
-
import Icon from '../Icon.svelte';
|
|
6
|
-
import type { InfoCardProps } from './InfoCardProps.js';
|
|
7
|
-
|
|
8
|
-
const { noborder, label, iconName, children }: InfoCardProps = $props(); //TODO type
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<div class="card" class:pad-vertical={!label} class:noborder>
|
|
12
|
-
{#if label}
|
|
13
|
-
<span class="card-label">{label}</span>
|
|
14
|
-
{/if}
|
|
15
|
-
|
|
16
|
-
<span class="value">{@render children()}</span>
|
|
17
|
-
{#if iconName}
|
|
18
|
-
<div class="icon">
|
|
19
|
-
<Icon name={iconName} size={Size.Large} />
|
|
20
|
-
</div>
|
|
21
|
-
{/if}
|
|
22
|
-
</div>
|
|
23
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { Size } from '../../Types/Internal/Size.js';
|
|
5
|
+
import Icon from '../Icon.svelte';
|
|
6
|
+
import type { InfoCardProps } from './InfoCardProps.js';
|
|
7
|
+
|
|
8
|
+
const { noborder, label, iconName, children }: InfoCardProps = $props(); //TODO type
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="card" class:pad-vertical={!label} class:noborder>
|
|
12
|
+
{#if label}
|
|
13
|
+
<span class="card-label">{label}</span>
|
|
14
|
+
{/if}
|
|
15
|
+
|
|
16
|
+
<span class="value">{@render children()}</span>
|
|
17
|
+
{#if iconName}
|
|
18
|
+
<div class="icon">
|
|
19
|
+
<Icon name={iconName} size={Size.Large} />
|
|
20
|
+
</div>
|
|
21
|
+
{/if}
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
24
|
<style>.card {
|
|
25
25
|
color: #3a4952;
|
|
26
26
|
fill: #3a4952;
|
|
@@ -70,4 +70,4 @@
|
|
|
70
70
|
align-items: center;
|
|
71
71
|
position: absolute;
|
|
72
72
|
right: 1rem;
|
|
73
|
-
}</style>
|
|
73
|
+
}</style>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { Colour } from '../../scss/colours.js';
|
|
5
|
-
import { Size } from '../../Types/Internal/Size.js';
|
|
6
|
-
import Icon from '../Icon.svelte';
|
|
7
|
-
import type { InfoTextCardProps } from './InfoTextCardProps.js';
|
|
8
|
-
let { label, iconName, children }: InfoTextCardProps = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<div class="card" class:pad-vertical={!label}>
|
|
12
|
-
{#if iconName}
|
|
13
|
-
<div class="icon">
|
|
14
|
-
<Icon name={iconName} size={Size.Large} colour={Colour['$brand-primary']} />
|
|
15
|
-
</div>
|
|
16
|
-
{/if}
|
|
17
|
-
|
|
18
|
-
<span class="value">{@render children()}</span>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { Colour } from '../../scss/colours.js';
|
|
5
|
+
import { Size } from '../../Types/Internal/Size.js';
|
|
6
|
+
import Icon from '../Icon.svelte';
|
|
7
|
+
import type { InfoTextCardProps } from './InfoTextCardProps.js';
|
|
8
|
+
let { label, iconName, children }: InfoTextCardProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="card" class:pad-vertical={!label}>
|
|
12
|
+
{#if iconName}
|
|
13
|
+
<div class="icon">
|
|
14
|
+
<Icon name={iconName} size={Size.Large} colour={Colour['$brand-primary']} />
|
|
15
|
+
</div>
|
|
16
|
+
{/if}
|
|
17
|
+
|
|
18
|
+
<span class="value">{@render children()}</span>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
21
|
<style>.card {
|
|
22
22
|
color: #3a4952;
|
|
23
23
|
fill: #3a4952;
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
.card .value {
|
|
44
44
|
padding: 0 0.25rem;
|
|
45
45
|
color: #3a4952;
|
|
46
|
-
}</style>
|
|
46
|
+
}</style>
|