@lavalogic/scoria 0.40.32 → 0.40.33
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 +28 -28
- package/dist/Components/AccordionGroupButton.svelte +60 -60
- package/dist/Components/Action.svelte +48 -48
- package/dist/Components/AlertModal.svelte +102 -102
- package/dist/Components/Base/ContextWrapper.svelte +45 -45
- package/dist/Components/Base/Pagination.svelte +135 -135
- package/dist/Components/Base/Snippets.svelte +25 -25
- package/dist/Components/BigRadioSet.svelte +34 -34
- package/dist/Components/Bubble.svelte +38 -38
- package/dist/Components/Button.svelte +83 -83
- package/dist/Components/Checkbox.svelte +71 -71
- package/dist/Components/CollapsibleCard.svelte +59 -59
- package/dist/Components/CollapsibleMenuGroup.svelte +43 -43
- package/dist/Components/ConditionBuilder/ConditionBuilder.svelte +101 -101
- package/dist/Components/Contexts/ContextMenu.svelte +76 -76
- package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
- package/dist/Components/Contexts/ContextMenuOption.svelte +38 -38
- package/dist/Components/Contexts/Toast.svelte +71 -71
- package/dist/Components/Contexts/ToastContainer.svelte +34 -34
- package/dist/Components/Contexts/Tooltip.svelte +32 -32
- package/dist/Components/DataMatrixIcon.svelte +37 -37
- package/dist/Components/DateInput.svelte +80 -80
- package/dist/Components/DatePicker.svelte +86 -86
- package/dist/Components/DesktopModal.svelte +65 -65
- package/dist/Components/Dial.svelte +35 -35
- package/dist/Components/DimensionInput.svelte +95 -95
- package/dist/Components/DragMenu/DragMenuHolder.svelte +53 -53
- package/dist/Components/DragMenu/DraggableCard.svelte +49 -49
- package/dist/Components/FileCard.svelte +18 -18
- package/dist/Components/FileUpload.svelte +115 -115
- package/dist/Components/GridInput.svelte +123 -123
- package/dist/Components/GridInputSet.svelte +21 -21
- package/dist/Components/HorizontalTabGroup.svelte +54 -54
- package/dist/Components/HorizontalTabGroupButton.svelte +32 -32
- package/dist/Components/Icon.svelte +68 -68
- package/dist/Components/InfoAlert.svelte +32 -32
- package/dist/Components/LoadingAnimation.svelte +228 -227
- package/dist/Components/LoadingModal.svelte +19 -19
- package/dist/Components/LoadingOverlay.svelte +20 -20
- package/dist/Components/Modal.svelte +127 -127
- package/dist/Components/MultiSelect.svelte +126 -126
- package/dist/Components/Nav/Nav.svelte +71 -71
- package/dist/Components/Nav/NavServiceMenuList.svelte +37 -37
- package/dist/Components/Nav/NavTab.svelte +46 -46
- package/dist/Components/Nav/ServiceMenuItem.svelte +62 -62
- package/dist/Components/Nav/ServicesNav.svelte +50 -50
- package/dist/Components/NumberInput.svelte +98 -98
- package/dist/Components/OptionCards.svelte +58 -58
- package/dist/Components/PageHeading.svelte +21 -21
- package/dist/Components/PasswordInput.svelte +61 -61
- package/dist/Components/PopoverButton.svelte +53 -53
- package/dist/Components/Portal.svelte +7 -7
- package/dist/Components/ProgressBubble.svelte +42 -42
- package/dist/Components/QuerySelect.svelte +102 -102
- package/dist/Components/ResourceCalendar/ResourceCalendar.svelte +241 -241
- package/dist/Components/SidebarPanel.svelte +32 -32
- package/dist/Components/SingleSelect.svelte +122 -122
- package/dist/Components/StepButton.svelte +48 -48
- package/dist/Components/StepForm.svelte +58 -58
- package/dist/Components/Switch.svelte +43 -43
- package/dist/Components/Table/ARCHITECTURE.md +298 -298
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +30 -30
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +24 -24
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +165 -165
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +13 -13
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +120 -120
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +81 -81
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +92 -92
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +110 -110
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +54 -54
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +35 -35
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +64 -64
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +82 -82
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +88 -88
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +90 -90
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +96 -96
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +71 -71
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +124 -124
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +91 -91
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +88 -88
- package/dist/Components/Table/Body/Rows/TableRow.svelte +127 -127
- package/dist/Components/Table/Body/TableBody.svelte +92 -92
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +25 -25
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +20 -20
- package/dist/Components/Table/Headers/TableHead.svelte +175 -175
- package/dist/Components/Table/Misc/ColumnPanel.svelte +32 -32
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +29 -29
- package/dist/Components/Table/Misc/FilterInput.svelte +326 -326
- package/dist/Components/Table/Misc/FilterPanel.svelte +79 -79
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +21 -21
- package/dist/Components/Table/Misc/ShareViewModal.svelte +118 -118
- package/dist/Components/Table/Misc/SidePanel.svelte +24 -24
- package/dist/Components/Table/Misc/TableConfigurationModal.svelte +318 -318
- package/dist/Components/Table/Misc/TableFooter.svelte +201 -201
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +112 -112
- package/dist/Components/Table/Misc/TableSidebar.svelte +116 -116
- package/dist/Components/Table/Misc/TableViewDropdown.svelte +25 -25
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +60 -60
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +63 -63
- package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +101 -101
- package/dist/Components/Table/NestedTable.svelte +29 -29
- package/dist/Components/Table/Table.svelte +140 -140
- package/dist/Components/Test/TestContextConsumer.svelte +8 -8
- package/dist/Components/TextArea.svelte +92 -90
- package/dist/Components/TextInput.svelte +128 -117
- package/dist/Components/ThreeStateRadio.svelte +101 -101
- package/dist/Components/Touch/BoolCard.svelte +27 -27
- package/dist/Components/Touch/DateModal.svelte +98 -98
- package/dist/Components/Touch/EditCard.svelte +44 -44
- package/dist/Components/Touch/InfoCard.svelte +25 -25
- package/dist/Components/Touch/InfoTextCard.svelte +22 -22
- package/dist/Components/Touch/ModalExplanation.svelte +13 -13
- package/dist/Components/Touch/NumberKeyboard.svelte +81 -81
- package/dist/Components/Touch/NumberModal.svelte +49 -49
- package/dist/Components/Touch/PlusMinusCard.svelte +40 -40
- package/dist/Components/Touch/SelectModal.svelte +86 -86
- package/dist/Components/Touch/SummaryCard.svelte +74 -74
- package/dist/Components/Touch/TextAreaModal.svelte +53 -53
- package/dist/Components/Touch/TextModal.svelte +56 -56
- package/dist/Components/Touch/TouchCard.svelte +28 -28
- package/dist/Components/Touch/TouchModal.svelte +141 -141
- package/dist/Components/Touch/UtilityButton.svelte +63 -63
- package/dist/Components/VerticalTabGroup.svelte +38 -38
- package/dist/Components/VerticalTabGroupButton.svelte +46 -46
- package/dist/Helpers/Datamatrix.d.ts +19 -19
- package/dist/Helpers/Datamatrix.js +291 -291
- package/dist/Types/Examples/ExampleModal.svelte +27 -27
- package/dist/paraglide/README.md +1 -1
- package/dist/scss/_basics.scss +12 -12
- package/dist/scss/_colours.scss +140 -140
- 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,72 +1,72 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
3
|
<script lang="ts">import { ColourSet } from "../scss/colours.js";
|
|
4
4
|
import Button from "./Button.svelte";
|
|
5
5
|
import LoadingOverlay from "./LoadingOverlay.svelte";
|
|
6
6
|
import Modal from "./Modal.svelte";
|
|
7
7
|
const { onclose, onsubmit, noscroll, headerLabel, headerSubtitle, buttons, children, isLoading, mandatory, loadingMessage, staticHeight, staticWidth, minWidth, minHeight, width, height } = $props();
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<Modal
|
|
11
|
-
{onclose}
|
|
12
|
-
mandatory={mandatory || isLoading}
|
|
13
|
-
{staticHeight}
|
|
14
|
-
{staticWidth}
|
|
15
|
-
{minWidth}
|
|
16
|
-
{minHeight}
|
|
17
|
-
{width}
|
|
18
|
-
{height}
|
|
19
|
-
{noscroll}
|
|
20
|
-
{onsubmit}
|
|
21
|
-
>
|
|
22
|
-
{#snippet header()}
|
|
23
|
-
<div class="outer">
|
|
24
|
-
<div class="column">
|
|
25
|
-
{#if typeof headerLabel === 'string'}
|
|
26
|
-
<h1>{headerLabel}</h1>
|
|
27
|
-
{:else}
|
|
28
|
-
{@render headerLabel()}
|
|
29
|
-
{/if}
|
|
30
|
-
{#if headerSubtitle}
|
|
31
|
-
<div class="one-line">
|
|
32
|
-
<span>{headerSubtitle}</span>
|
|
33
|
-
</div>
|
|
34
|
-
{/if}
|
|
35
|
-
</div>
|
|
36
|
-
<div class="spacer"></div>
|
|
37
|
-
</div>
|
|
38
|
-
{/snippet}
|
|
39
|
-
|
|
40
|
-
{#snippet footer()}
|
|
41
|
-
<div class="footer">
|
|
42
|
-
{#if buttons.length}
|
|
43
|
-
{#each buttons as button (button.label)}
|
|
44
|
-
<div class:left={button.left}>
|
|
45
|
-
<Button
|
|
46
|
-
type={button.type}
|
|
47
|
-
disabled={button.disabled}
|
|
48
|
-
onclick={button.callback}
|
|
49
|
-
colourSet={button.colourSet ??
|
|
50
|
-
(button.type === 'submit' ? ColourSet.Primary : undefined)}>{button.label}</Button
|
|
51
|
-
>
|
|
52
|
-
</div>
|
|
53
|
-
{/each}
|
|
54
|
-
{/if}
|
|
55
|
-
</div>
|
|
56
|
-
{/snippet}
|
|
57
|
-
|
|
58
|
-
<div class="body-outer">
|
|
59
|
-
{@render children()}
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
{#if isLoading}
|
|
63
|
-
<LoadingOverlay
|
|
64
|
-
absolute
|
|
65
|
-
message={loadingMessage}
|
|
66
|
-
/>
|
|
67
|
-
{/if}
|
|
68
|
-
</Modal>
|
|
69
|
-
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<Modal
|
|
11
|
+
{onclose}
|
|
12
|
+
mandatory={mandatory || isLoading}
|
|
13
|
+
{staticHeight}
|
|
14
|
+
{staticWidth}
|
|
15
|
+
{minWidth}
|
|
16
|
+
{minHeight}
|
|
17
|
+
{width}
|
|
18
|
+
{height}
|
|
19
|
+
{noscroll}
|
|
20
|
+
{onsubmit}
|
|
21
|
+
>
|
|
22
|
+
{#snippet header()}
|
|
23
|
+
<div class="outer">
|
|
24
|
+
<div class="column">
|
|
25
|
+
{#if typeof headerLabel === 'string'}
|
|
26
|
+
<h1>{headerLabel}</h1>
|
|
27
|
+
{:else}
|
|
28
|
+
{@render headerLabel()}
|
|
29
|
+
{/if}
|
|
30
|
+
{#if headerSubtitle}
|
|
31
|
+
<div class="one-line">
|
|
32
|
+
<span>{headerSubtitle}</span>
|
|
33
|
+
</div>
|
|
34
|
+
{/if}
|
|
35
|
+
</div>
|
|
36
|
+
<div class="spacer"></div>
|
|
37
|
+
</div>
|
|
38
|
+
{/snippet}
|
|
39
|
+
|
|
40
|
+
{#snippet footer()}
|
|
41
|
+
<div class="footer">
|
|
42
|
+
{#if buttons.length}
|
|
43
|
+
{#each buttons as button (button.label)}
|
|
44
|
+
<div class:left={button.left}>
|
|
45
|
+
<Button
|
|
46
|
+
type={button.type}
|
|
47
|
+
disabled={button.disabled}
|
|
48
|
+
onclick={button.callback}
|
|
49
|
+
colourSet={button.colourSet ??
|
|
50
|
+
(button.type === 'submit' ? ColourSet.Primary : undefined)}>{button.label}</Button
|
|
51
|
+
>
|
|
52
|
+
</div>
|
|
53
|
+
{/each}
|
|
54
|
+
{/if}
|
|
55
|
+
</div>
|
|
56
|
+
{/snippet}
|
|
57
|
+
|
|
58
|
+
<div class="body-outer">
|
|
59
|
+
{@render children()}
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
{#if isLoading}
|
|
63
|
+
<LoadingOverlay
|
|
64
|
+
absolute
|
|
65
|
+
message={loadingMessage}
|
|
66
|
+
/>
|
|
67
|
+
{/if}
|
|
68
|
+
</Modal>
|
|
69
|
+
|
|
70
70
|
<style>.outer {
|
|
71
71
|
padding: 1.5rem;
|
|
72
72
|
display: flex;
|
|
@@ -164,4 +164,4 @@ const { onclose, onsubmit, noscroll, headerLabel, headerSubtitle, buttons, child
|
|
|
164
164
|
}
|
|
165
165
|
.outer .spacer {
|
|
166
166
|
flex-grow: 1;
|
|
167
|
-
}</style>
|
|
167
|
+
}</style>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
module
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
module
|
|
6
6
|
>import { Sizing } from "../scss/sizing.js";
|
|
7
7
|
// Pixel height of each dial option. Sourced from `sizing.ts` so the
|
|
8
8
|
// SCSS partial and TS constant stay in sync (see comment at the top
|
|
9
9
|
// of `sizing.ts`).
|
|
10
10
|
const OPTION_HEIGHT = Sizing["$dial-option-height"];
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<script
|
|
14
|
-
lang="ts"
|
|
15
|
-
generics="T"
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script
|
|
14
|
+
lang="ts"
|
|
15
|
+
generics="T"
|
|
16
16
|
>import { onMount } from "svelte";
|
|
17
17
|
let { selected, entries, type, ref = $bindable(), onsubmit, onPrevious, onNext, onchange } = $props();
|
|
18
18
|
// `position`, `offset`, `dragging` must all be `$state` so that the
|
|
@@ -147,30 +147,30 @@ function onkeydown(e) {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
</script>
|
|
151
|
-
|
|
152
|
-
<div
|
|
153
|
-
class="select-wrapper"
|
|
154
|
-
role="listbox"
|
|
155
|
-
tabindex="0"
|
|
156
|
-
bind:this={ref}
|
|
157
|
-
{onmousedown}
|
|
158
|
-
ontouchstart={onmousedown}
|
|
159
|
-
{onwheel}
|
|
160
|
-
{onkeydown}
|
|
161
|
-
>
|
|
162
|
-
<div class="selected-wrapper">
|
|
163
|
-
<ul
|
|
164
|
-
bind:this={itemWrapper}
|
|
165
|
-
class="touch-date-container"
|
|
166
|
-
>
|
|
167
|
-
{#each entries as entry (entry.value)}
|
|
168
|
-
<li>{entry.label}</li>
|
|
169
|
-
{/each}
|
|
170
|
-
</ul>
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<div
|
|
153
|
+
class="select-wrapper"
|
|
154
|
+
role="listbox"
|
|
155
|
+
tabindex="0"
|
|
156
|
+
bind:this={ref}
|
|
157
|
+
{onmousedown}
|
|
158
|
+
ontouchstart={onmousedown}
|
|
159
|
+
{onwheel}
|
|
160
|
+
{onkeydown}
|
|
161
|
+
>
|
|
162
|
+
<div class="selected-wrapper">
|
|
163
|
+
<ul
|
|
164
|
+
bind:this={itemWrapper}
|
|
165
|
+
class="touch-date-container"
|
|
166
|
+
>
|
|
167
|
+
{#each entries as entry (entry.value)}
|
|
168
|
+
<li>{entry.label}</li>
|
|
169
|
+
{/each}
|
|
170
|
+
</ul>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
174
|
<style>.select-wrapper {
|
|
175
175
|
--option-height: 50px;
|
|
176
176
|
height: calc(var(--option-height));
|
|
@@ -232,4 +232,4 @@ function onkeydown(e) {
|
|
|
232
232
|
width: 80px;
|
|
233
233
|
height: var(--option-height);
|
|
234
234
|
user-select: none;
|
|
235
|
-
}</style>
|
|
235
|
+
}</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
3
|
<script lang="ts">import { m as i18n } from "../paraglide/messages.js";
|
|
4
4
|
import { InputVariant } from "../Types/Internal/InputVariant.js";
|
|
5
5
|
const min = 0;
|
|
@@ -31,98 +31,98 @@ const isInvalid = $derived(showErrorColours && (required && (x == null || x.toSt
|
|
|
31
31
|
const xId = $derived(id ? `${id}-x` : undefined);
|
|
32
32
|
const yId = $derived(id ? `${id}-y` : undefined);
|
|
33
33
|
const zId = $derived(id ? `${id}-z` : undefined);
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<div
|
|
37
|
-
class="error-wrapper"
|
|
38
|
-
class:for-modal={variant == InputVariant.Modal}
|
|
39
|
-
class:for-table={variant == InputVariant.Table}
|
|
40
|
-
>
|
|
41
|
-
<span
|
|
42
|
-
class="top-label"
|
|
43
|
-
class:for-default={variant === InputVariant.Default}
|
|
44
|
-
class:invalid={isInvalid}
|
|
45
|
-
>{labelTop}{#if optional}
|
|
46
|
-
- <span class="optional">{i18n['scoria.label.optional']()}</span>{/if}</span
|
|
47
|
-
>
|
|
48
|
-
{#if variant === InputVariant.Default}
|
|
49
|
-
<span class="border"
|
|
50
|
-
>{labelTop}{#if optional}
|
|
51
|
-
- <span class="optional">{i18n['scoria.label.optional']()}</span>{/if}</span
|
|
52
|
-
>
|
|
53
|
-
{/if}
|
|
54
|
-
<div
|
|
55
|
-
class="icon-container"
|
|
56
|
-
class:for-modal={variant == InputVariant.Modal}
|
|
57
|
-
>
|
|
58
|
-
<input
|
|
59
|
-
id={xId}
|
|
60
|
-
class:for-default={variant === InputVariant.Default}
|
|
61
|
-
data-type={dataType}
|
|
62
|
-
class:left-pad={leftIcon != undefined}
|
|
63
|
-
class:for-modal={variant == InputVariant.Modal}
|
|
64
|
-
type="number"
|
|
65
|
-
value={x ?? ''}
|
|
66
|
-
oninput={handleInput('x')}
|
|
67
|
-
{onblur}
|
|
68
|
-
{onfocus}
|
|
69
|
-
{onkeydown}
|
|
70
|
-
bind:this={inputRefs.x}
|
|
71
|
-
{placeholder}
|
|
72
|
-
{required}
|
|
73
|
-
{disabled}
|
|
74
|
-
{min}
|
|
75
|
-
{max}
|
|
76
|
-
step={decimal ? 0.01 : 1}
|
|
77
|
-
/>
|
|
78
|
-
<input
|
|
79
|
-
id={yId}
|
|
80
|
-
class:for-default={variant === InputVariant.Default}
|
|
81
|
-
data-type={dataType}
|
|
82
|
-
class:left-pad={leftIcon != undefined}
|
|
83
|
-
class:for-modal={variant == InputVariant.Modal}
|
|
84
|
-
type="number"
|
|
85
|
-
value={y ?? ''}
|
|
86
|
-
oninput={handleInput('y')}
|
|
87
|
-
{onblur}
|
|
88
|
-
{onfocus}
|
|
89
|
-
{onkeydown}
|
|
90
|
-
bind:this={inputRefs.y}
|
|
91
|
-
{placeholder}
|
|
92
|
-
{required}
|
|
93
|
-
{disabled}
|
|
94
|
-
{min}
|
|
95
|
-
{max}
|
|
96
|
-
step={decimal ? 0.01 : 1}
|
|
97
|
-
/>
|
|
98
|
-
<input
|
|
99
|
-
id={zId}
|
|
100
|
-
class:for-default={variant === InputVariant.Default}
|
|
101
|
-
data-type={dataType}
|
|
102
|
-
class:left-pad={leftIcon != undefined}
|
|
103
|
-
class:for-modal={variant == InputVariant.Modal}
|
|
104
|
-
type="number"
|
|
105
|
-
value={z ?? ''}
|
|
106
|
-
oninput={handleInput('z')}
|
|
107
|
-
{onblur}
|
|
108
|
-
{onfocus}
|
|
109
|
-
{onkeydown}
|
|
110
|
-
bind:this={inputRefs.z}
|
|
111
|
-
{placeholder}
|
|
112
|
-
{required}
|
|
113
|
-
{disabled}
|
|
114
|
-
{min}
|
|
115
|
-
{max}
|
|
116
|
-
step={decimal ? 0.01 : 1}
|
|
117
|
-
/>
|
|
118
|
-
<div class="spacer"></div>
|
|
119
|
-
<span
|
|
120
|
-
class="right-label inset"
|
|
121
|
-
class:for-modal={variant == InputVariant.Modal}>cm</span
|
|
122
|
-
>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
class="error-wrapper"
|
|
38
|
+
class:for-modal={variant == InputVariant.Modal}
|
|
39
|
+
class:for-table={variant == InputVariant.Table}
|
|
40
|
+
>
|
|
41
|
+
<span
|
|
42
|
+
class="top-label"
|
|
43
|
+
class:for-default={variant === InputVariant.Default}
|
|
44
|
+
class:invalid={isInvalid}
|
|
45
|
+
>{labelTop}{#if optional}
|
|
46
|
+
- <span class="optional">{i18n['scoria.label.optional']()}</span>{/if}</span
|
|
47
|
+
>
|
|
48
|
+
{#if variant === InputVariant.Default}
|
|
49
|
+
<span class="border"
|
|
50
|
+
>{labelTop}{#if optional}
|
|
51
|
+
- <span class="optional">{i18n['scoria.label.optional']()}</span>{/if}</span
|
|
52
|
+
>
|
|
53
|
+
{/if}
|
|
54
|
+
<div
|
|
55
|
+
class="icon-container"
|
|
56
|
+
class:for-modal={variant == InputVariant.Modal}
|
|
57
|
+
>
|
|
58
|
+
<input
|
|
59
|
+
id={xId}
|
|
60
|
+
class:for-default={variant === InputVariant.Default}
|
|
61
|
+
data-type={dataType}
|
|
62
|
+
class:left-pad={leftIcon != undefined}
|
|
63
|
+
class:for-modal={variant == InputVariant.Modal}
|
|
64
|
+
type="number"
|
|
65
|
+
value={x ?? ''}
|
|
66
|
+
oninput={handleInput('x')}
|
|
67
|
+
{onblur}
|
|
68
|
+
{onfocus}
|
|
69
|
+
{onkeydown}
|
|
70
|
+
bind:this={inputRefs.x}
|
|
71
|
+
{placeholder}
|
|
72
|
+
{required}
|
|
73
|
+
{disabled}
|
|
74
|
+
{min}
|
|
75
|
+
{max}
|
|
76
|
+
step={decimal ? 0.01 : 1}
|
|
77
|
+
/>
|
|
78
|
+
<input
|
|
79
|
+
id={yId}
|
|
80
|
+
class:for-default={variant === InputVariant.Default}
|
|
81
|
+
data-type={dataType}
|
|
82
|
+
class:left-pad={leftIcon != undefined}
|
|
83
|
+
class:for-modal={variant == InputVariant.Modal}
|
|
84
|
+
type="number"
|
|
85
|
+
value={y ?? ''}
|
|
86
|
+
oninput={handleInput('y')}
|
|
87
|
+
{onblur}
|
|
88
|
+
{onfocus}
|
|
89
|
+
{onkeydown}
|
|
90
|
+
bind:this={inputRefs.y}
|
|
91
|
+
{placeholder}
|
|
92
|
+
{required}
|
|
93
|
+
{disabled}
|
|
94
|
+
{min}
|
|
95
|
+
{max}
|
|
96
|
+
step={decimal ? 0.01 : 1}
|
|
97
|
+
/>
|
|
98
|
+
<input
|
|
99
|
+
id={zId}
|
|
100
|
+
class:for-default={variant === InputVariant.Default}
|
|
101
|
+
data-type={dataType}
|
|
102
|
+
class:left-pad={leftIcon != undefined}
|
|
103
|
+
class:for-modal={variant == InputVariant.Modal}
|
|
104
|
+
type="number"
|
|
105
|
+
value={z ?? ''}
|
|
106
|
+
oninput={handleInput('z')}
|
|
107
|
+
{onblur}
|
|
108
|
+
{onfocus}
|
|
109
|
+
{onkeydown}
|
|
110
|
+
bind:this={inputRefs.z}
|
|
111
|
+
{placeholder}
|
|
112
|
+
{required}
|
|
113
|
+
{disabled}
|
|
114
|
+
{min}
|
|
115
|
+
{max}
|
|
116
|
+
step={decimal ? 0.01 : 1}
|
|
117
|
+
/>
|
|
118
|
+
<div class="spacer"></div>
|
|
119
|
+
<span
|
|
120
|
+
class="right-label inset"
|
|
121
|
+
class:for-modal={variant == InputVariant.Modal}>cm</span
|
|
122
|
+
>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
126
|
<style>input {
|
|
127
127
|
box-sizing: border-box;
|
|
128
128
|
height: 100%;
|
|
@@ -399,4 +399,4 @@ div.spacer {
|
|
|
399
399
|
.icon-container input:last-of-type {
|
|
400
400
|
border-radius: 0;
|
|
401
401
|
border-inline-start-color: transparent;
|
|
402
|
-
}</style>
|
|
402
|
+
}</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
generics="T"
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T"
|
|
6
6
|
>import { dndzone } from "svelte-dnd-action";
|
|
7
7
|
import { flip } from "svelte/animate";
|
|
8
8
|
import DraggableCard from "./DraggableCard.svelte";
|
|
@@ -53,53 +53,53 @@ $effect.pre(() => {
|
|
|
53
53
|
items = next;
|
|
54
54
|
});
|
|
55
55
|
const snippet = $derived(customSnippet ?? draggableWithSelect);
|
|
56
|
-
</script>
|
|
57
|
-
|
|
58
|
-
{#snippet draggableWithSelect<T>(item: Draggable<T>, index: number)}
|
|
59
|
-
<DraggableCard
|
|
60
|
-
title={item.title}
|
|
61
|
-
subtitle={item.subtitle}
|
|
62
|
-
{index}
|
|
63
|
-
selectable
|
|
64
|
-
selected={item.selected}
|
|
65
|
-
/>
|
|
66
|
-
{/snippet}
|
|
67
|
-
|
|
68
|
-
<div class="wrapper">
|
|
69
|
-
{#if label}
|
|
70
|
-
<span class="top-label">{label}</span>
|
|
71
|
-
<span class="top-label-border">{label}</span>
|
|
72
|
-
{/if}
|
|
73
|
-
<div
|
|
74
|
-
class="dnd"
|
|
75
|
-
use:dndzone={{ items, flipDurationMs: flipDurationMS, delayTouchStart: 30 }}
|
|
76
|
-
onconsider={(e: CustomEvent<DndEvent<Draggable<T>>>) => {
|
|
77
|
-
consider(e.detail.items);
|
|
78
|
-
}}
|
|
79
|
-
onfinalize={(e: CustomEvent<DndEvent<Draggable<T>>>) => {
|
|
80
|
-
finalise(e.detail.items);
|
|
81
|
-
}}
|
|
82
|
-
>
|
|
83
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
84
|
-
{#each items as item, index (item.id)}
|
|
85
|
-
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
86
|
-
<div
|
|
87
|
-
class="contents"
|
|
88
|
-
onclick={(e) => {
|
|
89
|
-
if (item.toggleSelected) {
|
|
90
|
-
e.stopPropagation();
|
|
91
|
-
item.toggleSelected();
|
|
92
|
-
}
|
|
93
|
-
}}
|
|
94
|
-
animate:flip={{ duration: flipDurationMS }}
|
|
95
|
-
>
|
|
96
|
-
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
97
|
-
{@render snippet(item, index)}
|
|
98
|
-
</div>
|
|
99
|
-
{/each}
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
{#snippet draggableWithSelect<T>(item: Draggable<T>, index: number)}
|
|
59
|
+
<DraggableCard
|
|
60
|
+
title={item.title}
|
|
61
|
+
subtitle={item.subtitle}
|
|
62
|
+
{index}
|
|
63
|
+
selectable
|
|
64
|
+
selected={item.selected}
|
|
65
|
+
/>
|
|
66
|
+
{/snippet}
|
|
67
|
+
|
|
68
|
+
<div class="wrapper">
|
|
69
|
+
{#if label}
|
|
70
|
+
<span class="top-label">{label}</span>
|
|
71
|
+
<span class="top-label-border">{label}</span>
|
|
72
|
+
{/if}
|
|
73
|
+
<div
|
|
74
|
+
class="dnd"
|
|
75
|
+
use:dndzone={{ items, flipDurationMs: flipDurationMS, delayTouchStart: 30 }}
|
|
76
|
+
onconsider={(e: CustomEvent<DndEvent<Draggable<T>>>) => {
|
|
77
|
+
consider(e.detail.items);
|
|
78
|
+
}}
|
|
79
|
+
onfinalize={(e: CustomEvent<DndEvent<Draggable<T>>>) => {
|
|
80
|
+
finalise(e.detail.items);
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
84
|
+
{#each items as item, index (item.id)}
|
|
85
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
86
|
+
<div
|
|
87
|
+
class="contents"
|
|
88
|
+
onclick={(e) => {
|
|
89
|
+
if (item.toggleSelected) {
|
|
90
|
+
e.stopPropagation();
|
|
91
|
+
item.toggleSelected();
|
|
92
|
+
}
|
|
93
|
+
}}
|
|
94
|
+
animate:flip={{ duration: flipDurationMS }}
|
|
95
|
+
>
|
|
96
|
+
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
97
|
+
{@render snippet(item, index)}
|
|
98
|
+
</div>
|
|
99
|
+
{/each}
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
103
|
<style>.top-label {
|
|
104
104
|
position: absolute;
|
|
105
105
|
inset-inline-start: 0.5rem;
|
|
@@ -154,4 +154,4 @@ div.dnd {
|
|
|
154
154
|
flex: 1;
|
|
155
155
|
gap: 0.5rem;
|
|
156
156
|
padding: 0.5rem;
|
|
157
|
-
}</style>
|
|
157
|
+
}</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
3
|
<script lang="ts">import { devCatch } from "../../Helpers/Helpers.svelte.js";
|
|
4
4
|
import Checkbox from "../Checkbox.svelte";
|
|
5
5
|
// `selected` must remain `let` because it is `$bindable`; the rest
|
|
@@ -16,52 +16,52 @@ function fireToggle() {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<div
|
|
22
|
-
class="card"
|
|
23
|
-
class:touch
|
|
24
|
-
role={selectable ? 'checkbox' : 'listitem'}
|
|
25
|
-
aria-checked={selectable ? selected : undefined}
|
|
26
|
-
aria-label={title}
|
|
27
|
-
>
|
|
28
|
-
{#if selectable}
|
|
29
|
-
<div
|
|
30
|
-
class="limit-size"
|
|
31
|
-
class:touch
|
|
32
|
-
>
|
|
33
|
-
<Checkbox
|
|
34
|
-
value={selected}
|
|
35
|
-
onchange={(
|
|
36
|
-
e: Event & {
|
|
37
|
-
currentTarget: EventTarget & HTMLInputElement;
|
|
38
|
-
}
|
|
39
|
-
) => {
|
|
40
|
-
e.stopPropagation();
|
|
41
|
-
fireToggle();
|
|
42
|
-
}}
|
|
43
|
-
/>
|
|
44
|
-
</div>
|
|
45
|
-
{/if}
|
|
46
|
-
<div
|
|
47
|
-
class="text"
|
|
48
|
-
class:touch
|
|
49
|
-
>
|
|
50
|
-
<span
|
|
51
|
-
class="title"
|
|
52
|
-
class:touch>{title}</span
|
|
53
|
-
>
|
|
54
|
-
<span
|
|
55
|
-
class="subtitle"
|
|
56
|
-
class:touch>{subtitle}</span
|
|
57
|
-
>
|
|
58
|
-
</div>
|
|
59
|
-
<span
|
|
60
|
-
class="row"
|
|
61
|
-
class:touch>{index + 1}</span
|
|
62
|
-
>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
class="card"
|
|
23
|
+
class:touch
|
|
24
|
+
role={selectable ? 'checkbox' : 'listitem'}
|
|
25
|
+
aria-checked={selectable ? selected : undefined}
|
|
26
|
+
aria-label={title}
|
|
27
|
+
>
|
|
28
|
+
{#if selectable}
|
|
29
|
+
<div
|
|
30
|
+
class="limit-size"
|
|
31
|
+
class:touch
|
|
32
|
+
>
|
|
33
|
+
<Checkbox
|
|
34
|
+
value={selected}
|
|
35
|
+
onchange={(
|
|
36
|
+
e: Event & {
|
|
37
|
+
currentTarget: EventTarget & HTMLInputElement;
|
|
38
|
+
}
|
|
39
|
+
) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
fireToggle();
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
{/if}
|
|
46
|
+
<div
|
|
47
|
+
class="text"
|
|
48
|
+
class:touch
|
|
49
|
+
>
|
|
50
|
+
<span
|
|
51
|
+
class="title"
|
|
52
|
+
class:touch>{title}</span
|
|
53
|
+
>
|
|
54
|
+
<span
|
|
55
|
+
class="subtitle"
|
|
56
|
+
class:touch>{subtitle}</span
|
|
57
|
+
>
|
|
58
|
+
</div>
|
|
59
|
+
<span
|
|
60
|
+
class="row"
|
|
61
|
+
class:touch>{index + 1}</span
|
|
62
|
+
>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
65
|
<style>.limit-size:not(.touch) {
|
|
66
66
|
width: 1.5rem;
|
|
67
67
|
}
|
|
@@ -158,4 +158,4 @@ function fireToggle() {
|
|
|
158
158
|
height: 1.75rem;
|
|
159
159
|
width: 1.75rem;
|
|
160
160
|
margin-inline-end: 1rem;
|
|
161
|
-
}</style>
|
|
161
|
+
}</style>
|