@lavalogic/scoria 0.33.0 → 0.35.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 +44 -63
- package/dist/Components/AccordionGroup.svelte.d.ts +2 -25
- package/dist/Components/AccordionGroupButton.svelte +106 -114
- package/dist/Components/AccordionGroupButton.svelte.d.ts +2 -2
- package/dist/Components/AccordionGroupButtonProps.d.ts +21 -0
- package/dist/Components/AccordionGroupButtonProps.js +1 -0
- 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.js +6 -4
- package/dist/Types/Examples/ExampleModal.svelte +34 -34
- package/dist/index.d.ts +1 -0
- 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 +2 -2
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { passthrough } from '../../Helpers/Helpers.svelte.js';
|
|
5
|
-
import NumberKeyboard from './NumberKeyboard.svelte';
|
|
6
|
-
import type { NumberModalProps } from './NumberModalProps.js';
|
|
7
|
-
import TouchModal from './TouchModal.svelte';
|
|
8
|
-
let {
|
|
9
|
-
coerceValue = false,
|
|
10
|
-
header,
|
|
11
|
-
value,
|
|
12
|
-
label,
|
|
13
|
-
placeholder,
|
|
14
|
-
min,
|
|
15
|
-
max,
|
|
16
|
-
cancelEditing,
|
|
17
|
-
confirm,
|
|
18
|
-
decimal,
|
|
19
|
-
isValid = () => true,
|
|
20
|
-
explanation
|
|
21
|
-
}: NumberModalProps = $props();
|
|
22
|
-
|
|
23
|
-
let tempValue = $derived(value);
|
|
24
|
-
|
|
25
|
-
const isAcceptableValue = $derived(tempValue != null && isValid(tempValue));
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<TouchModal
|
|
29
|
-
onclose={() => {
|
|
30
|
-
cancelEditing();
|
|
31
|
-
}}
|
|
32
|
-
{header}
|
|
33
|
-
mandatory
|
|
34
|
-
onsubmit={(e: SubmitEvent) => {
|
|
35
|
-
e.preventDefault();
|
|
36
|
-
if (tempValue == null) {
|
|
37
|
-
console.warn(`number modal value was null`);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
confirm(tempValue);
|
|
41
|
-
}}
|
|
42
|
-
{explanation}
|
|
43
|
-
>
|
|
44
|
-
<div class="number-input-wrapper">
|
|
45
|
-
<NumberKeyboard
|
|
46
|
-
{coerceValue}
|
|
47
|
-
{min}
|
|
48
|
-
{max}
|
|
49
|
-
{label}
|
|
50
|
-
{placeholder}
|
|
51
|
-
bind:value={tempValue}
|
|
52
|
-
{decimal}
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
{#snippet footer()}
|
|
56
|
-
<div class="modal-footer">
|
|
57
|
-
<button onkeydown={passthrough} type="submit" disabled={!isAcceptableValue}>Confirm</button>
|
|
58
|
-
<button
|
|
59
|
-
onkeydown={passthrough}
|
|
60
|
-
type="button"
|
|
61
|
-
onclick={() => {
|
|
62
|
-
cancelEditing();
|
|
63
|
-
}}>Cancel</button
|
|
64
|
-
>
|
|
65
|
-
</div>
|
|
66
|
-
{/snippet}
|
|
67
|
-
</TouchModal>
|
|
68
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { passthrough } from '../../Helpers/Helpers.svelte.js';
|
|
5
|
+
import NumberKeyboard from './NumberKeyboard.svelte';
|
|
6
|
+
import type { NumberModalProps } from './NumberModalProps.js';
|
|
7
|
+
import TouchModal from './TouchModal.svelte';
|
|
8
|
+
let {
|
|
9
|
+
coerceValue = false,
|
|
10
|
+
header,
|
|
11
|
+
value,
|
|
12
|
+
label,
|
|
13
|
+
placeholder,
|
|
14
|
+
min,
|
|
15
|
+
max,
|
|
16
|
+
cancelEditing,
|
|
17
|
+
confirm,
|
|
18
|
+
decimal,
|
|
19
|
+
isValid = () => true,
|
|
20
|
+
explanation
|
|
21
|
+
}: NumberModalProps = $props();
|
|
22
|
+
|
|
23
|
+
let tempValue = $derived(value);
|
|
24
|
+
|
|
25
|
+
const isAcceptableValue = $derived(tempValue != null && isValid(tempValue));
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<TouchModal
|
|
29
|
+
onclose={() => {
|
|
30
|
+
cancelEditing();
|
|
31
|
+
}}
|
|
32
|
+
{header}
|
|
33
|
+
mandatory
|
|
34
|
+
onsubmit={(e: SubmitEvent) => {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
if (tempValue == null) {
|
|
37
|
+
console.warn(`number modal value was null`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
confirm(tempValue);
|
|
41
|
+
}}
|
|
42
|
+
{explanation}
|
|
43
|
+
>
|
|
44
|
+
<div class="number-input-wrapper">
|
|
45
|
+
<NumberKeyboard
|
|
46
|
+
{coerceValue}
|
|
47
|
+
{min}
|
|
48
|
+
{max}
|
|
49
|
+
{label}
|
|
50
|
+
{placeholder}
|
|
51
|
+
bind:value={tempValue}
|
|
52
|
+
{decimal}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
{#snippet footer()}
|
|
56
|
+
<div class="modal-footer">
|
|
57
|
+
<button onkeydown={passthrough} type="submit" disabled={!isAcceptableValue}>Confirm</button>
|
|
58
|
+
<button
|
|
59
|
+
onkeydown={passthrough}
|
|
60
|
+
type="button"
|
|
61
|
+
onclick={() => {
|
|
62
|
+
cancelEditing();
|
|
63
|
+
}}>Cancel</button
|
|
64
|
+
>
|
|
65
|
+
</div>
|
|
66
|
+
{/snippet}
|
|
67
|
+
</TouchModal>
|
|
68
|
+
|
|
69
69
|
<style>dialog {
|
|
70
70
|
overflow: clip;
|
|
71
71
|
background-color: #e9ecf1;
|
|
@@ -326,4 +326,4 @@ button {
|
|
|
326
326
|
}
|
|
327
327
|
.modal-footer button[type=submit]:not([disabled]):focus {
|
|
328
328
|
outline-offset: -2px;
|
|
329
|
-
}</style>
|
|
329
|
+
}</style>
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts" module>
|
|
4
|
-
import { Size } from '../../Types/Internal/Size.js';
|
|
5
|
-
import type { Snippet } from 'svelte';
|
|
6
|
-
import Action from '../Action.svelte';
|
|
7
|
-
export interface PlusMinusCardProps {
|
|
8
|
-
callback: (diff: number) => void;
|
|
9
|
-
children: Snippet;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<script lang="ts">
|
|
15
|
-
let { callback, disabled = false, children }: PlusMinusCardProps = $props();
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<div class="card pad-right" class:disabled>
|
|
19
|
-
<div class="icon-left">
|
|
20
|
-
<Action
|
|
21
|
-
{disabled}
|
|
22
|
-
label="decrement"
|
|
23
|
-
onclick={() => {
|
|
24
|
-
callback(-1);
|
|
25
|
-
}}
|
|
26
|
-
icon={{
|
|
27
|
-
name: 'circle-minus',
|
|
28
|
-
size: Size.DoubleXLarge
|
|
29
|
-
}}
|
|
30
|
-
size={Size.DoubleXLarge}
|
|
31
|
-
/>
|
|
32
|
-
</div>
|
|
33
|
-
<span class="value">{@render children()}</span>
|
|
34
|
-
<div class="icon-right">
|
|
35
|
-
<Action
|
|
36
|
-
{disabled}
|
|
37
|
-
label="increment"
|
|
38
|
-
onclick={() => {
|
|
39
|
-
callback(1);
|
|
40
|
-
}}
|
|
41
|
-
icon={{
|
|
42
|
-
name: 'circle-plus',
|
|
43
|
-
size: Size.DoubleXLarge
|
|
44
|
-
}}
|
|
45
|
-
size={Size.DoubleXLarge}
|
|
46
|
-
/>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts" module>
|
|
4
|
+
import { Size } from '../../Types/Internal/Size.js';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
|
+
import Action from '../Action.svelte';
|
|
7
|
+
export interface PlusMinusCardProps {
|
|
8
|
+
callback: (diff: number) => void;
|
|
9
|
+
children: Snippet;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
let { callback, disabled = false, children }: PlusMinusCardProps = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div class="card pad-right" class:disabled>
|
|
19
|
+
<div class="icon-left">
|
|
20
|
+
<Action
|
|
21
|
+
{disabled}
|
|
22
|
+
label="decrement"
|
|
23
|
+
onclick={() => {
|
|
24
|
+
callback(-1);
|
|
25
|
+
}}
|
|
26
|
+
icon={{
|
|
27
|
+
name: 'circle-minus',
|
|
28
|
+
size: Size.DoubleXLarge
|
|
29
|
+
}}
|
|
30
|
+
size={Size.DoubleXLarge}
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
<span class="value">{@render children()}</span>
|
|
34
|
+
<div class="icon-right">
|
|
35
|
+
<Action
|
|
36
|
+
{disabled}
|
|
37
|
+
label="increment"
|
|
38
|
+
onclick={() => {
|
|
39
|
+
callback(1);
|
|
40
|
+
}}
|
|
41
|
+
icon={{
|
|
42
|
+
name: 'circle-plus',
|
|
43
|
+
size: Size.DoubleXLarge
|
|
44
|
+
}}
|
|
45
|
+
size={Size.DoubleXLarge}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
50
|
<style>.card {
|
|
51
51
|
color: #3a4952;
|
|
52
52
|
fill: #3a4952;
|
|
@@ -95,4 +95,4 @@
|
|
|
95
95
|
.card.disabled {
|
|
96
96
|
background-color: #f4f7f9;
|
|
97
97
|
color: #8096a5;
|
|
98
|
-
}</style>
|
|
98
|
+
}</style>
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { devCatch, passthrough } from '../../Helpers/Helpers.svelte.js';
|
|
5
|
-
import { InputVariant } from '../../Types/Internal/InputVariant.js';
|
|
6
|
-
import { onMount, tick } from 'svelte';
|
|
7
|
-
import TextInput from '../TextInput.svelte';
|
|
8
|
-
import type { SelectModalProps } from './SelectModalProps.js';
|
|
9
|
-
import TouchModal from './TouchModal.svelte';
|
|
10
|
-
const {
|
|
11
|
-
header,
|
|
12
|
-
searchbar = false,
|
|
13
|
-
choices,
|
|
14
|
-
cancelEditing,
|
|
15
|
-
selected
|
|
16
|
-
}: SelectModalProps = $props();
|
|
17
|
-
|
|
18
|
-
let selectedRef: HTMLButtonElement | undefined = $state();
|
|
19
|
-
let searchValue = $state('');
|
|
20
|
-
|
|
21
|
-
const filteredChoices = $derived(
|
|
22
|
-
searchbar
|
|
23
|
-
? choices.filter((it) =>
|
|
24
|
-
it.label.toLocaleUpperCase().includes(searchValue.toLocaleUpperCase())
|
|
25
|
-
)
|
|
26
|
-
: choices
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
onMount(() => {
|
|
30
|
-
tick()
|
|
31
|
-
.then(() => {
|
|
32
|
-
if (selected) {
|
|
33
|
-
selectedRef?.scrollIntoView({ block: 'center', inline: 'center' });
|
|
34
|
-
if (!searchbar) {
|
|
35
|
-
selectedRef?.focus();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
.catch(devCatch);
|
|
40
|
-
});
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<TouchModal
|
|
44
|
-
onclose={() => {
|
|
45
|
-
cancelEditing();
|
|
46
|
-
}}
|
|
47
|
-
{header}
|
|
48
|
-
mandatory
|
|
49
|
-
staticHeight
|
|
50
|
-
onsubmit={(e: SubmitEvent) => {
|
|
51
|
-
e.preventDefault();
|
|
52
|
-
if (searchbar) {
|
|
53
|
-
filteredChoices[0]?.callback?.()?.catch(devCatch);
|
|
54
|
-
}
|
|
55
|
-
}}
|
|
56
|
-
>
|
|
57
|
-
<div class="select-container" class:with-top-padding={!searchbar}>
|
|
58
|
-
{#if filteredChoices.length === 0}
|
|
59
|
-
<span>No Results</span>
|
|
60
|
-
{/if}
|
|
61
|
-
{#each filteredChoices as choice (choice)}
|
|
62
|
-
{#if selected === choice.label}
|
|
63
|
-
{#if choice.callback}
|
|
64
|
-
<button
|
|
65
|
-
onkeydown={passthrough}
|
|
66
|
-
bind:this={selectedRef}
|
|
67
|
-
type="button"
|
|
68
|
-
onclick={() => choice.callback?.()}>{choice.label}</button
|
|
69
|
-
>
|
|
70
|
-
{:else}
|
|
71
|
-
<button onkeydown={passthrough} bind:this={selectedRef} type={choice.type}
|
|
72
|
-
>{choice.label}</button
|
|
73
|
-
>
|
|
74
|
-
{/if}
|
|
75
|
-
{:else if choice.callback}
|
|
76
|
-
<button onkeydown={passthrough} type="button" onclick={() => choice.callback?.()}
|
|
77
|
-
>{choice.label}</button
|
|
78
|
-
>
|
|
79
|
-
{:else}
|
|
80
|
-
<button onkeydown={passthrough} type={choice.type}>{choice.label}</button>
|
|
81
|
-
{/if}
|
|
82
|
-
{/each}
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<!-- TODO move this snippet above once the plugin bug is fixed -->
|
|
86
|
-
{#snippet headerExtra()}
|
|
87
|
-
<div class:visible={searchbar} class="header-extra">
|
|
88
|
-
<TextInput labelTop="Search" bind:value={searchValue} variant={InputVariant.Modal} />
|
|
89
|
-
</div>
|
|
90
|
-
{/snippet}
|
|
91
|
-
|
|
92
|
-
{#snippet footer()}
|
|
93
|
-
<div class="cancel-container">
|
|
94
|
-
<button
|
|
95
|
-
onkeydown={passthrough}
|
|
96
|
-
type="button"
|
|
97
|
-
onclick={() => {
|
|
98
|
-
cancelEditing();
|
|
99
|
-
}}>Cancel</button
|
|
100
|
-
>
|
|
101
|
-
</div>
|
|
102
|
-
{/snippet}
|
|
103
|
-
</TouchModal>
|
|
104
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { devCatch, passthrough } from '../../Helpers/Helpers.svelte.js';
|
|
5
|
+
import { InputVariant } from '../../Types/Internal/InputVariant.js';
|
|
6
|
+
import { onMount, tick } from 'svelte';
|
|
7
|
+
import TextInput from '../TextInput.svelte';
|
|
8
|
+
import type { SelectModalProps } from './SelectModalProps.js';
|
|
9
|
+
import TouchModal from './TouchModal.svelte';
|
|
10
|
+
const {
|
|
11
|
+
header,
|
|
12
|
+
searchbar = false,
|
|
13
|
+
choices,
|
|
14
|
+
cancelEditing,
|
|
15
|
+
selected
|
|
16
|
+
}: SelectModalProps = $props();
|
|
17
|
+
|
|
18
|
+
let selectedRef: HTMLButtonElement | undefined = $state();
|
|
19
|
+
let searchValue = $state('');
|
|
20
|
+
|
|
21
|
+
const filteredChoices = $derived(
|
|
22
|
+
searchbar
|
|
23
|
+
? choices.filter((it) =>
|
|
24
|
+
it.label.toLocaleUpperCase().includes(searchValue.toLocaleUpperCase())
|
|
25
|
+
)
|
|
26
|
+
: choices
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
onMount(() => {
|
|
30
|
+
tick()
|
|
31
|
+
.then(() => {
|
|
32
|
+
if (selected) {
|
|
33
|
+
selectedRef?.scrollIntoView({ block: 'center', inline: 'center' });
|
|
34
|
+
if (!searchbar) {
|
|
35
|
+
selectedRef?.focus();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
.catch(devCatch);
|
|
40
|
+
});
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<TouchModal
|
|
44
|
+
onclose={() => {
|
|
45
|
+
cancelEditing();
|
|
46
|
+
}}
|
|
47
|
+
{header}
|
|
48
|
+
mandatory
|
|
49
|
+
staticHeight
|
|
50
|
+
onsubmit={(e: SubmitEvent) => {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
if (searchbar) {
|
|
53
|
+
filteredChoices[0]?.callback?.()?.catch(devCatch);
|
|
54
|
+
}
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<div class="select-container" class:with-top-padding={!searchbar}>
|
|
58
|
+
{#if filteredChoices.length === 0}
|
|
59
|
+
<span>No Results</span>
|
|
60
|
+
{/if}
|
|
61
|
+
{#each filteredChoices as choice (choice)}
|
|
62
|
+
{#if selected === choice.label}
|
|
63
|
+
{#if choice.callback}
|
|
64
|
+
<button
|
|
65
|
+
onkeydown={passthrough}
|
|
66
|
+
bind:this={selectedRef}
|
|
67
|
+
type="button"
|
|
68
|
+
onclick={() => choice.callback?.()}>{choice.label}</button
|
|
69
|
+
>
|
|
70
|
+
{:else}
|
|
71
|
+
<button onkeydown={passthrough} bind:this={selectedRef} type={choice.type}
|
|
72
|
+
>{choice.label}</button
|
|
73
|
+
>
|
|
74
|
+
{/if}
|
|
75
|
+
{:else if choice.callback}
|
|
76
|
+
<button onkeydown={passthrough} type="button" onclick={() => choice.callback?.()}
|
|
77
|
+
>{choice.label}</button
|
|
78
|
+
>
|
|
79
|
+
{:else}
|
|
80
|
+
<button onkeydown={passthrough} type={choice.type}>{choice.label}</button>
|
|
81
|
+
{/if}
|
|
82
|
+
{/each}
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<!-- TODO move this snippet above once the plugin bug is fixed -->
|
|
86
|
+
{#snippet headerExtra()}
|
|
87
|
+
<div class:visible={searchbar} class="header-extra">
|
|
88
|
+
<TextInput labelTop="Search" bind:value={searchValue} variant={InputVariant.Modal} />
|
|
89
|
+
</div>
|
|
90
|
+
{/snippet}
|
|
91
|
+
|
|
92
|
+
{#snippet footer()}
|
|
93
|
+
<div class="cancel-container">
|
|
94
|
+
<button
|
|
95
|
+
onkeydown={passthrough}
|
|
96
|
+
type="button"
|
|
97
|
+
onclick={() => {
|
|
98
|
+
cancelEditing();
|
|
99
|
+
}}>Cancel</button
|
|
100
|
+
>
|
|
101
|
+
</div>
|
|
102
|
+
{/snippet}
|
|
103
|
+
</TouchModal>
|
|
104
|
+
|
|
105
105
|
<style>dialog {
|
|
106
106
|
overflow: clip;
|
|
107
107
|
background-color: #e9ecf1;
|
|
@@ -347,4 +347,4 @@ button {
|
|
|
347
347
|
|
|
348
348
|
button {
|
|
349
349
|
align-items: center;
|
|
350
|
-
}</style>
|
|
350
|
+
}</style>
|
|
@@ -1,67 +1,67 @@
|
|
|
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 { SummaryCardProps } from './SummaryCardProps.js';
|
|
8
|
-
const {
|
|
9
|
-
bubbles,
|
|
10
|
-
desktop = false,
|
|
11
|
-
heading,
|
|
12
|
-
icon,
|
|
13
|
-
keyValues,
|
|
14
|
-
editable = false,
|
|
15
|
-
error = false,
|
|
16
|
-
onclick
|
|
17
|
-
}: SummaryCardProps = $props();
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
{#snippet _heading()}
|
|
21
|
-
{#if desktop}
|
|
22
|
-
<span class="desktop-heading" class:invalid={error}>{heading}</span>
|
|
23
|
-
<span class="desktop-heading-border" class:invalid={error}>{heading}</span>
|
|
24
|
-
{:else}
|
|
25
|
-
{#if bubbles}
|
|
26
|
-
<!-- these are just plain strings -->
|
|
27
|
-
<!-- eslint-disable-next-line svelte/require-each-key -->
|
|
28
|
-
{#each bubbles as bubble}
|
|
29
|
-
<div class="card-detail">{bubble}</div>
|
|
30
|
-
{/each}
|
|
31
|
-
{/if}
|
|
32
|
-
|
|
33
|
-
<div class="card-row heading">
|
|
34
|
-
<h3>{heading}</h3>
|
|
35
|
-
{#if editable}
|
|
36
|
-
<Icon name="edit" size={Size.DoubleXLarge} />
|
|
37
|
-
{/if}
|
|
38
|
-
</div>
|
|
39
|
-
{/if}
|
|
40
|
-
{/snippet}
|
|
41
|
-
|
|
42
|
-
<button class:desktop onkeydown={passthrough} {onclick} class="summary-card" class:error>
|
|
43
|
-
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
44
|
-
{@render _heading()}
|
|
45
|
-
<div class="columns">
|
|
46
|
-
<div class="left">
|
|
47
|
-
{#each keyValues as { key, value } (key)}
|
|
48
|
-
<div class="card-row detail">
|
|
49
|
-
<span>{key}</span>
|
|
50
|
-
<span class="ellipsis"
|
|
51
|
-
>............................................................................................................</span
|
|
52
|
-
>
|
|
53
|
-
<span class="value">{value}</span>
|
|
54
|
-
</div>
|
|
55
|
-
{/each}
|
|
56
|
-
</div>
|
|
57
|
-
{#if icon}
|
|
58
|
-
<div class="right">
|
|
59
|
-
<Icon name={icon} size={Size.Medium} />
|
|
60
|
-
</div>
|
|
61
|
-
{/if}
|
|
62
|
-
</div>
|
|
63
|
-
</button>
|
|
64
|
-
|
|
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 { SummaryCardProps } from './SummaryCardProps.js';
|
|
8
|
+
const {
|
|
9
|
+
bubbles,
|
|
10
|
+
desktop = false,
|
|
11
|
+
heading,
|
|
12
|
+
icon,
|
|
13
|
+
keyValues,
|
|
14
|
+
editable = false,
|
|
15
|
+
error = false,
|
|
16
|
+
onclick
|
|
17
|
+
}: SummaryCardProps = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
{#snippet _heading()}
|
|
21
|
+
{#if desktop}
|
|
22
|
+
<span class="desktop-heading" class:invalid={error}>{heading}</span>
|
|
23
|
+
<span class="desktop-heading-border" class:invalid={error}>{heading}</span>
|
|
24
|
+
{:else}
|
|
25
|
+
{#if bubbles}
|
|
26
|
+
<!-- these are just plain strings -->
|
|
27
|
+
<!-- eslint-disable-next-line svelte/require-each-key -->
|
|
28
|
+
{#each bubbles as bubble}
|
|
29
|
+
<div class="card-detail">{bubble}</div>
|
|
30
|
+
{/each}
|
|
31
|
+
{/if}
|
|
32
|
+
|
|
33
|
+
<div class="card-row heading">
|
|
34
|
+
<h3>{heading}</h3>
|
|
35
|
+
{#if editable}
|
|
36
|
+
<Icon name="edit" size={Size.DoubleXLarge} />
|
|
37
|
+
{/if}
|
|
38
|
+
</div>
|
|
39
|
+
{/if}
|
|
40
|
+
{/snippet}
|
|
41
|
+
|
|
42
|
+
<button class:desktop onkeydown={passthrough} {onclick} class="summary-card" class:error>
|
|
43
|
+
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
44
|
+
{@render _heading()}
|
|
45
|
+
<div class="columns">
|
|
46
|
+
<div class="left">
|
|
47
|
+
{#each keyValues as { key, value } (key)}
|
|
48
|
+
<div class="card-row detail">
|
|
49
|
+
<span>{key}</span>
|
|
50
|
+
<span class="ellipsis"
|
|
51
|
+
>............................................................................................................</span
|
|
52
|
+
>
|
|
53
|
+
<span class="value">{value}</span>
|
|
54
|
+
</div>
|
|
55
|
+
{/each}
|
|
56
|
+
</div>
|
|
57
|
+
{#if icon}
|
|
58
|
+
<div class="right">
|
|
59
|
+
<Icon name={icon} size={Size.Medium} />
|
|
60
|
+
</div>
|
|
61
|
+
{/if}
|
|
62
|
+
</div>
|
|
63
|
+
</button>
|
|
64
|
+
|
|
65
65
|
<style>ul {
|
|
66
66
|
list-style: none;
|
|
67
67
|
display: flex;
|
|
@@ -328,4 +328,4 @@ button.summary-card h3 {
|
|
|
328
328
|
}
|
|
329
329
|
.card-detail.optional:not(.entered) {
|
|
330
330
|
background-color: #f9e9e9;
|
|
331
|
-
}</style>
|
|
331
|
+
}</style>
|