@lavalogic/scoria 0.40.13 → 0.40.15
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 +35 -46
- package/dist/Components/AccordionGroupButton.svelte +68 -76
- package/dist/Components/Action.svelte +103 -135
- package/dist/Components/AlertModal.svelte +171 -190
- package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +614 -697
- package/dist/Components/Base/BaseModal.svelte +90 -116
- package/dist/Components/Base/ContextWrapper.svelte +67 -72
- package/dist/Components/Base/Pagination.svelte +173 -196
- package/dist/Components/Base/Snippets.svelte +34 -36
- package/dist/Components/BigRadioSet.svelte +36 -38
- package/dist/Components/Bubble.svelte +78 -101
- package/dist/Components/Button.svelte +175 -208
- package/dist/Components/Checkbox.svelte +75 -86
- package/dist/Components/CollapsibleCard.svelte +72 -87
- package/dist/Components/CollapsibleMenuGroup.svelte +53 -57
- package/dist/Components/ConditionBuilder/ConditionBuilder.svelte +39 -64
- package/dist/Components/Contexts/ContextMenu.svelte +141 -156
- package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
- package/dist/Components/Contexts/ContextMenuOption.svelte +53 -60
- package/dist/Components/Contexts/Toast.svelte +81 -86
- package/dist/Components/Contexts/ToastContainer.svelte +58 -62
- package/dist/Components/Contexts/Tooltip.svelte +36 -37
- package/dist/Components/DataMatrixIcon.svelte +95 -108
- package/dist/Components/DateInput.svelte +118 -146
- package/dist/Components/DatePicker.svelte +255 -294
- package/dist/Components/DesktopModal.svelte +70 -90
- package/dist/Components/Dial.svelte +167 -197
- package/dist/Components/DimensionInput.svelte +124 -169
- package/dist/Components/DragMenu/DragMenuHolder.svelte +98 -114
- package/dist/Components/DragMenu/DraggableCard.svelte +64 -76
- package/dist/Components/FileCard.svelte +21 -24
- package/dist/Components/FileUpload.svelte +190 -225
- package/dist/Components/GridInput.svelte +159 -196
- package/dist/Components/GridInputSet.svelte +24 -29
- package/dist/Components/HorizontalTabGroup.svelte +73 -89
- package/dist/Components/HorizontalTabGroupButton.svelte +40 -44
- package/dist/Components/Icon.svelte +99 -128
- package/dist/Components/Icons.js +357 -357
- package/dist/Components/InfoAlert.svelte +35 -38
- package/dist/Components/LoadingAnimation.svelte +691 -755
- package/dist/Components/LoadingModal.svelte +36 -44
- package/dist/Components/LoadingOverlay.svelte +22 -26
- package/dist/Components/Modal.svelte +204 -254
- package/dist/Components/MultiSelect.svelte +186 -216
- package/dist/Components/Nav/Nav.svelte +94 -110
- package/dist/Components/Nav/NavServiceMenuList.svelte +57 -61
- package/dist/Components/Nav/NavTab.svelte +58 -62
- package/dist/Components/Nav/ServiceMenuItem.svelte +103 -111
- package/dist/Components/Nav/ServicesNav.svelte +72 -79
- package/dist/Components/NumberInput.svelte +121 -155
- package/dist/Components/OptionCards.svelte +62 -73
- package/dist/Components/PageHeading.svelte +23 -25
- package/dist/Components/PasswordInput.svelte +69 -88
- package/dist/Components/PopoverButton.svelte +151 -0
- package/dist/Components/PopoverButton.svelte.d.ts +9 -0
- package/dist/Components/PopoverButtonProps.d.ts +21 -0
- package/dist/Components/PopoverButtonProps.js +1 -0
- package/dist/Components/Portal.svelte +29 -35
- package/dist/Components/ProgressBubble.svelte +91 -106
- package/dist/Components/QuerySelect.svelte +260 -346
- package/dist/Components/SidebarPanel.svelte +34 -36
- package/dist/Components/SingleSelect.svelte +196 -244
- package/dist/Components/StepButton.svelte +65 -70
- package/dist/Components/StepForm.svelte +115 -135
- package/dist/Components/Switch.svelte +57 -69
- package/dist/Components/Table/ARCHITECTURE.md +298 -298
- package/dist/Components/Table/Body/QuickSearchCell.svelte +578 -655
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +42 -51
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +42 -58
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +403 -442
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +51 -78
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +165 -184
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +110 -123
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +134 -160
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +190 -231
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +82 -104
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +52 -87
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +122 -150
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +132 -159
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +190 -236
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +173 -211
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +204 -244
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +140 -177
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +188 -217
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +173 -193
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +166 -187
- package/dist/Components/Table/Body/Rows/TableRow.svelte +245 -288
- package/dist/Components/Table/Body/TableBody.svelte +141 -154
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +35 -41
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +24 -30
- package/dist/Components/Table/Headers/TableHead.svelte +348 -402
- package/dist/Components/Table/Misc/ColumnPanel.svelte +37 -39
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +35 -39
- package/dist/Components/Table/Misc/FilterInput.svelte +556 -619
- package/dist/Components/Table/Misc/FilterPanel.svelte +170 -183
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +25 -31
- package/dist/Components/Table/Misc/ShareViewModal.svelte +252 -281
- package/dist/Components/Table/Misc/SidePanel.svelte +32 -35
- package/dist/Components/Table/Misc/TableConfigurationModal.svelte +574 -629
- package/dist/Components/Table/Misc/TableFooter.svelte +326 -332
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +134 -140
- package/dist/Components/Table/Misc/TableSidebar.svelte +183 -198
- package/dist/Components/Table/Misc/TableViewDropdown.svelte +83 -103
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +83 -100
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +88 -107
- package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +163 -190
- package/dist/Components/Table/NestedTable.svelte +102 -128
- package/dist/Components/Table/Table.svelte +531 -663
- package/dist/Components/Test/TestContextConsumer.svelte +11 -13
- package/dist/Components/TextArea.svelte +95 -130
- package/dist/Components/TextInput.svelte +125 -176
- package/dist/Components/ThreeStateRadio.svelte +111 -130
- package/dist/Components/Touch/BoolCard.svelte +33 -45
- package/dist/Components/Touch/DateModal.svelte +164 -204
- package/dist/Components/Touch/EditCard.svelte +48 -59
- package/dist/Components/Touch/InfoCard.svelte +28 -31
- package/dist/Components/Touch/InfoTextCard.svelte +26 -28
- package/dist/Components/Touch/ModalExplanation.svelte +15 -17
- package/dist/Components/Touch/NumberKeyboard.svelte +181 -218
- package/dist/Components/Touch/NumberModal.svelte +59 -79
- package/dist/Components/Touch/PlusMinusCard.svelte +43 -46
- package/dist/Components/Touch/SelectModal.svelte +111 -126
- package/dist/Components/Touch/SummaryCard.svelte +80 -93
- package/dist/Components/Touch/TextAreaModal.svelte +72 -94
- package/dist/Components/Touch/TextModal.svelte +77 -105
- package/dist/Components/Touch/TouchCard.svelte +31 -33
- package/dist/Components/Touch/TouchModal.svelte +214 -270
- package/dist/Components/Touch/UtilityButton.svelte +88 -109
- package/dist/Components/VerticalTabGroup.svelte +60 -78
- package/dist/Components/VerticalTabGroupButton.svelte +54 -58
- package/dist/Helpers/Datamatrix.d.ts +19 -19
- package/dist/Helpers/Datamatrix.js +291 -291
- package/dist/Types/Examples/ExampleModal.svelte +31 -35
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/scss/_basics.scss +12 -12
- package/dist/scss/_colours.scss +134 -134
- package/dist/scss/_mixins.scss +3392 -3392
- package/dist/scss/_motion.scss +57 -57
- package/dist/scss/_sizing.scss +85 -85
- package/dist/scss/_transitions.scss +8 -8
- package/package.json +1 -1
|
@@ -1,111 +1,90 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
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
|
-
{:else}
|
|
89
|
-
{#if notifications}
|
|
90
|
-
<span class="notification">{notifications}</span>
|
|
91
|
-
{/if}
|
|
92
|
-
|
|
93
|
-
<Icon
|
|
94
|
-
{...icon}
|
|
95
|
-
{size}
|
|
96
|
-
/>
|
|
97
|
-
{/if}
|
|
98
|
-
</div>
|
|
99
|
-
{/if}
|
|
100
|
-
<span class="utility-label">
|
|
101
|
-
{#if notifications && icon instanceof SVGSVGElement}
|
|
102
|
-
<span class="notification-on-text">{notifications}</span>
|
|
103
|
-
{/if}<span bind:this={slotSpan}
|
|
104
|
-
>{#if children}{@render children()}{/if}</span
|
|
105
|
-
>
|
|
106
|
-
</span>
|
|
107
|
-
</button>
|
|
108
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">import { passthrough } from "../../Helpers/Helpers.svelte.js";
|
|
4
|
+
import { ColourSet } from "../../scss/colours.js";
|
|
5
|
+
import { Side } from "../../Types/Internal/Side.js";
|
|
6
|
+
import { Size } from "../../Types/Internal/Size.js";
|
|
7
|
+
import { onMount } from "svelte";
|
|
8
|
+
import DataMatrixIcon from "../DataMatrixIcon.svelte";
|
|
9
|
+
import Icon from "../Icon.svelte";
|
|
10
|
+
let { type = "button", colourSet = ColourSet.Secondary, icon, side = Side.Top, size: explicitSize, notifications, ref = $bindable(), disabled = false, label, onEditBarcode, onclick, onfocus, onblur, children } = $props();
|
|
11
|
+
let isMounted = $state(false);
|
|
12
|
+
onMount(() => {
|
|
13
|
+
isMounted = true;
|
|
14
|
+
});
|
|
15
|
+
const size = $derived.by(() => {
|
|
16
|
+
if (!isMounted) {
|
|
17
|
+
return Size.DoubleXLarge;
|
|
18
|
+
}
|
|
19
|
+
if (explicitSize !== undefined) {
|
|
20
|
+
return explicitSize;
|
|
21
|
+
}
|
|
22
|
+
if (icon instanceof SVGSVGElement) {
|
|
23
|
+
return Size.DoubleXLarge;
|
|
24
|
+
}
|
|
25
|
+
return icon?.size ?? Size.DoubleXLarge;
|
|
26
|
+
});
|
|
27
|
+
let slotSpan = $state();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<button
|
|
31
|
+
{type}
|
|
32
|
+
class:call-to-action={colourSet === ColourSet.Primary || colourSet === ColourSet.CallToAction}
|
|
33
|
+
{disabled}
|
|
34
|
+
class:left={side == Side.Left}
|
|
35
|
+
class:right={side == Side.Right}
|
|
36
|
+
class:top={side == Side.Top}
|
|
37
|
+
class:bottom={side == Side.Bottom}
|
|
38
|
+
bind:this={ref}
|
|
39
|
+
aria-label={label}
|
|
40
|
+
{onclick}
|
|
41
|
+
{onfocus}
|
|
42
|
+
{onblur}
|
|
43
|
+
oncontextmenu={(e) => {
|
|
44
|
+
if (onEditBarcode) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
onEditBarcode();
|
|
47
|
+
}
|
|
48
|
+
}}
|
|
49
|
+
onkeydown={passthrough}
|
|
50
|
+
>
|
|
51
|
+
{#if isMounted && icon}
|
|
52
|
+
<div
|
|
53
|
+
class="expand"
|
|
54
|
+
class:left={side == Side.Left}
|
|
55
|
+
class:right={side == Side.Right}
|
|
56
|
+
class:top={side == Side.Top}
|
|
57
|
+
class:bottom={side == Side.Bottom}
|
|
58
|
+
>
|
|
59
|
+
{#if icon instanceof SVGSVGElement}
|
|
60
|
+
<!-- SECURITY: UtilityButton accepts a generic SVGSVGElement here for backwards
|
|
61
|
+
compatibility. The cast to DataMatrixSvg trusts the caller; DataMatrixIcon
|
|
62
|
+
additionally sanitises the cloned subtree before mounting. -->
|
|
63
|
+
<DataMatrixIcon
|
|
64
|
+
title={slotSpan?.textContent ?? '{unknown}'}
|
|
65
|
+
icon={{ kind: 'svg', svg: icon as DataMatrixSvg }}
|
|
66
|
+
/>
|
|
67
|
+
{:else}
|
|
68
|
+
{#if notifications}
|
|
69
|
+
<span class="notification">{notifications}</span>
|
|
70
|
+
{/if}
|
|
71
|
+
|
|
72
|
+
<Icon
|
|
73
|
+
{...icon}
|
|
74
|
+
{size}
|
|
75
|
+
/>
|
|
76
|
+
{/if}
|
|
77
|
+
</div>
|
|
78
|
+
{/if}
|
|
79
|
+
<span class="utility-label">
|
|
80
|
+
{#if notifications && icon instanceof SVGSVGElement}
|
|
81
|
+
<span class="notification-on-text">{notifications}</span>
|
|
82
|
+
{/if}<span bind:this={slotSpan}
|
|
83
|
+
>{#if children}{@render children()}{/if}</span
|
|
84
|
+
>
|
|
85
|
+
</span>
|
|
86
|
+
</button>
|
|
87
|
+
|
|
109
88
|
<style>button {
|
|
110
89
|
background-color: #f4f7f9;
|
|
111
90
|
box-sizing: border-box;
|
|
@@ -194,4 +173,4 @@ button:not([disabled]).call-to-action:not([disabled]):focus, button:not([disable
|
|
|
194
173
|
}
|
|
195
174
|
button:not([disabled]).call-to-action:not([disabled]):focus {
|
|
196
175
|
outline-offset: -2px;
|
|
197
|
-
}</style>
|
|
176
|
+
}</style>
|
|
@@ -1,81 +1,63 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
generics="CommonDenominator"
|
|
6
|
-
>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
noTabMessage,
|
|
18
|
-
nohistory = false,
|
|
19
|
-
dense = false,
|
|
20
|
-
}: VerticalTabGroupProps<CommonDenominator> = $props();
|
|
21
|
-
|
|
22
|
-
const isNonEmptyString = (raw: unknown): raw is string =>
|
|
23
|
-
typeof raw === 'string' && raw.length > 0;
|
|
24
|
-
|
|
25
|
-
const storageKey = (key: string): string => `scoria-vertical-tab-group:${key}:active-tab`;
|
|
26
|
-
|
|
27
|
-
onMount(() => {
|
|
28
|
-
if (name && !nohistory) {
|
|
29
|
-
const tabName = readJSON(sessionStorage, storageKey(name), isNonEmptyString, '');
|
|
30
|
-
if (tabName) {
|
|
31
|
-
tabs.find((it) => it.label === tabName)?.onclick();
|
|
32
|
-
}
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="CommonDenominator"
|
|
6
|
+
>import { readJSON } from "../Helpers/Storage.js";
|
|
7
|
+
import { onMount, untrack } from "svelte";
|
|
8
|
+
import VerticalTabGroupButton from "./VerticalTabGroupButton.svelte";
|
|
9
|
+
const { name, tabs, selected, style, noscroll, noTabMessage, nohistory = false, dense = false } = $props();
|
|
10
|
+
const isNonEmptyString = (raw) => typeof raw === "string" && raw.length > 0;
|
|
11
|
+
const storageKey = (key) => `scoria-vertical-tab-group:${key}:active-tab`;
|
|
12
|
+
onMount(() => {
|
|
13
|
+
if (name && !nohistory) {
|
|
14
|
+
const tabName = readJSON(sessionStorage, storageKey(name), isNonEmptyString, "");
|
|
15
|
+
if (tabName) {
|
|
16
|
+
tabs.find((it) => it.label === tabName)?.onclick();
|
|
33
17
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
class
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</div>
|
|
78
|
-
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
$effect(() => {
|
|
21
|
+
if (name && selected) {
|
|
22
|
+
untrack(() => {
|
|
23
|
+
try {
|
|
24
|
+
sessionStorage.setItem(storageKey(name), JSON.stringify(selected.label));
|
|
25
|
+
} catch {}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
class="wrapper"
|
|
33
|
+
class:noscroll
|
|
34
|
+
class:dense
|
|
35
|
+
{style}
|
|
36
|
+
>
|
|
37
|
+
<div class="tabs">
|
|
38
|
+
{#each tabs as option (option.label)}
|
|
39
|
+
<VerticalTabGroupButton
|
|
40
|
+
{option}
|
|
41
|
+
selected={selected?.label === option.label}
|
|
42
|
+
/>
|
|
43
|
+
{/each}
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div
|
|
47
|
+
class="content"
|
|
48
|
+
class:noscroll
|
|
49
|
+
class:dense
|
|
50
|
+
>
|
|
51
|
+
{#if selected}
|
|
52
|
+
{@render selected.content(selected.args)}
|
|
53
|
+
{:else}
|
|
54
|
+
<div class="wrapper bg">
|
|
55
|
+
<span class="red">{noTabMessage ?? 'No Tab Selected'}</span>
|
|
56
|
+
</div>
|
|
57
|
+
{/if}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
79
61
|
<style>.bg {
|
|
80
62
|
padding: 1.5rem;
|
|
81
63
|
background-color: #f9e9e9;
|
|
@@ -124,4 +106,4 @@
|
|
|
124
106
|
.wrapper .content.dense {
|
|
125
107
|
flex-grow: 0;
|
|
126
108
|
overflow: visible;
|
|
127
|
-
}</style>
|
|
109
|
+
}</style>
|
|
@@ -1,60 +1,56 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
generics="Args"
|
|
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
|
-
{/if}
|
|
55
|
-
</div>
|
|
56
|
-
</button>
|
|
57
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="Args"
|
|
6
|
+
>import { useAsyncFlag } from "../Helpers/AsyncFlag.svelte.js";
|
|
7
|
+
import { Colour } from "../scss/colours.js";
|
|
8
|
+
import { Size } from "../Types/Internal/Size.js";
|
|
9
|
+
import Icon from "./Icon.svelte";
|
|
10
|
+
const { option, selected } = $props();
|
|
11
|
+
const isValid = useAsyncFlag(() => option.isValid, true);
|
|
12
|
+
const disabled = useAsyncFlag(() => option.disabled, false);
|
|
13
|
+
const visible = useAsyncFlag(() => option.visible, true);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<button
|
|
17
|
+
class:selected
|
|
18
|
+
disabled={disabled.value}
|
|
19
|
+
onclick={() => {
|
|
20
|
+
option.onclick();
|
|
21
|
+
}}
|
|
22
|
+
type="button"
|
|
23
|
+
class="tab"
|
|
24
|
+
class:invalid={!isValid.value}
|
|
25
|
+
class:hidden={!visible.value}
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
class="bordered"
|
|
29
|
+
class:invalid={!isValid.value}
|
|
30
|
+
>
|
|
31
|
+
{#if option.iconLeft}
|
|
32
|
+
<Icon
|
|
33
|
+
{...option.iconLeft}
|
|
34
|
+
colour={Colour['$brand-primary']}
|
|
35
|
+
/>
|
|
36
|
+
{/if}
|
|
37
|
+
{option.label}
|
|
38
|
+
{#if !isValid.value}
|
|
39
|
+
<Icon
|
|
40
|
+
name="error"
|
|
41
|
+
colour={Colour['$error-border']}
|
|
42
|
+
size={Size.Small}
|
|
43
|
+
/>
|
|
44
|
+
{:else if option.iconRight}
|
|
45
|
+
<Icon
|
|
46
|
+
colour={Colour['$brand-primary']}
|
|
47
|
+
size={Size.Small}
|
|
48
|
+
{...option.iconRight}
|
|
49
|
+
/>
|
|
50
|
+
{/if}
|
|
51
|
+
</div>
|
|
52
|
+
</button>
|
|
53
|
+
|
|
58
54
|
<style>button.tab.hidden {
|
|
59
55
|
display: none !important;
|
|
60
56
|
}
|
|
@@ -101,4 +97,4 @@
|
|
|
101
97
|
}
|
|
102
98
|
.tab.selected.invalid {
|
|
103
99
|
border-bottom-color: #aa1414;
|
|
104
|
-
}</style>
|
|
100
|
+
}</style>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { DataMatrixSvg } from '../Components/DataMatrixIconProps.js';
|
|
2
|
-
|
|
3
|
-
export interface IDatamatrixOptions {
|
|
4
|
-
msg: string;
|
|
5
|
-
dim?: number;
|
|
6
|
-
rct?: number;
|
|
7
|
-
pad?: number;
|
|
8
|
-
pal?: [string, string];
|
|
9
|
-
vrb?: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Build a DATAMatrix barcode SVG. The returned element is branded as
|
|
14
|
-
* {@link DataMatrixSvg} so it can be passed directly to
|
|
15
|
-
* `DataMatrixIcon` without further casting. The underlying JS
|
|
16
|
-
* implementation produces a vanilla `SVGSVGElement`; the brand is a
|
|
17
|
-
* compile-time discipline only.
|
|
18
|
-
*/
|
|
19
|
-
export declare function DATAMatrix(value: IDatamatrixOptions | string): DataMatrixSvg;
|
|
1
|
+
import type { DataMatrixSvg } from '../Components/DataMatrixIconProps.js';
|
|
2
|
+
|
|
3
|
+
export interface IDatamatrixOptions {
|
|
4
|
+
msg: string;
|
|
5
|
+
dim?: number;
|
|
6
|
+
rct?: number;
|
|
7
|
+
pad?: number;
|
|
8
|
+
pal?: [string, string];
|
|
9
|
+
vrb?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Build a DATAMatrix barcode SVG. The returned element is branded as
|
|
14
|
+
* {@link DataMatrixSvg} so it can be passed directly to
|
|
15
|
+
* `DataMatrixIcon` without further casting. The underlying JS
|
|
16
|
+
* implementation produces a vanilla `SVGSVGElement`; the brand is a
|
|
17
|
+
* compile-time discipline only.
|
|
18
|
+
*/
|
|
19
|
+
export declare function DATAMatrix(value: IDatamatrixOptions | string): DataMatrixSvg;
|