@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,26 +1,26 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import Action from './Action.svelte';
|
|
5
|
-
import type { FileCardProps } from './FileCardProps.js';
|
|
6
|
-
|
|
7
|
-
const { file, ondelete }: FileCardProps = $props();
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<div>
|
|
11
|
-
<span>{file.name}</span>
|
|
12
|
-
<Action
|
|
13
|
-
icon={{ name: 'circle-cross' }}
|
|
14
|
-
backgroundColour="transparent"
|
|
15
|
-
label="Delete"
|
|
16
|
-
onclick={ondelete}
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import Action from './Action.svelte';
|
|
5
|
+
import type { FileCardProps } from './FileCardProps.js';
|
|
6
|
+
|
|
7
|
+
const { file, ondelete }: FileCardProps = $props();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div>
|
|
11
|
+
<span>{file.name}</span>
|
|
12
|
+
<Action
|
|
13
|
+
icon={{ name: 'circle-cross' }}
|
|
14
|
+
backgroundColour="transparent"
|
|
15
|
+
label="Delete"
|
|
16
|
+
onclick={ondelete}
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
20
|
<style>div {
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-flow: row nowrap;
|
|
23
23
|
flex-grow: 1;
|
|
24
24
|
align-items: center;
|
|
25
25
|
gap: 0.375rem;
|
|
26
|
-
}</style>
|
|
26
|
+
}</style>
|
|
@@ -1,198 +1,198 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { ColourSet } from '../scss/colours.js';
|
|
5
|
-
import { InputVariant } from '../Types/Internal/InputVariant.js';
|
|
6
|
-
import { Size } from '../Types/Internal/Size.js';
|
|
7
|
-
import { onMount } from 'svelte';
|
|
8
|
-
import Action from './Action.svelte';
|
|
9
|
-
import FileCard from './FileCard.svelte';
|
|
10
|
-
import type { FileUploadProps } from './FileUploadProps.js';
|
|
11
|
-
import Icon from './Icon.svelte';
|
|
12
|
-
|
|
13
|
-
let _files: FileList | null | undefined = $state();
|
|
14
|
-
|
|
15
|
-
let {
|
|
16
|
-
accept,
|
|
17
|
-
files = $bindable([]),
|
|
18
|
-
multiple = false,
|
|
19
|
-
labelTop,
|
|
20
|
-
labelRight,
|
|
21
|
-
placeholder,
|
|
22
|
-
required = false,
|
|
23
|
-
variant = InputVariant.Default,
|
|
24
|
-
selectNone = false,
|
|
25
|
-
noresize = false,
|
|
26
|
-
uppercase = false,
|
|
27
|
-
disabled,
|
|
28
|
-
optional = false,
|
|
29
|
-
leftIcon,
|
|
30
|
-
rightIcon,
|
|
31
|
-
onLeftIconClick,
|
|
32
|
-
onRightIconClick,
|
|
33
|
-
|
|
34
|
-
inputRef = $bindable(),
|
|
35
|
-
onblur,
|
|
36
|
-
onfocus,
|
|
37
|
-
}: FileUploadProps = $props();
|
|
38
|
-
|
|
39
|
-
function onchange(e: Event & { currentTarget: EventTarget & HTMLInputElement }) {
|
|
40
|
-
const markedFiles = (e.target as HTMLInputElement).files ?? [];
|
|
41
|
-
for (let i = 0; i < markedFiles.length; i++) {
|
|
42
|
-
files.push(markedFiles[i]);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function a() {
|
|
47
|
-
inputRef?.showPicker();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
let dragover = $state(false);
|
|
51
|
-
|
|
52
|
-
function ondrop(e: DragEvent) {
|
|
53
|
-
e.stopPropagation();
|
|
54
|
-
e.preventDefault();
|
|
55
|
-
dragover = false;
|
|
56
|
-
|
|
57
|
-
if (!e.dataTransfer?.files) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const len = e.dataTransfer.files.length;
|
|
62
|
-
for (let i = 0; i < len; i++) {
|
|
63
|
-
files.push(e.dataTransfer.files[i]);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function ondragover(e: DragEvent) {
|
|
68
|
-
e.preventDefault();
|
|
69
|
-
|
|
70
|
-
dragover = true;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function ondragleave(e: DragEvent) {
|
|
74
|
-
e.preventDefault();
|
|
75
|
-
|
|
76
|
-
dragover = false;
|
|
77
|
-
}
|
|
78
|
-
onMount(() => {
|
|
79
|
-
console.log('Drag and drop file uploading may not work');
|
|
80
|
-
});
|
|
81
|
-
</script>
|
|
82
|
-
|
|
83
|
-
<label
|
|
84
|
-
class:dragover
|
|
85
|
-
class:for-modal={variant === InputVariant.Modal}
|
|
86
|
-
{ondrop}
|
|
87
|
-
{ondragover}
|
|
88
|
-
{ondragleave}
|
|
89
|
-
>
|
|
90
|
-
<!-- HACK removed label for modals for now because I couldn't think of a decent style that doesn't interfere with scrolling -->
|
|
91
|
-
{#if labelTop && variant !== InputVariant.Modal}
|
|
92
|
-
<!-- <span class="top-label" class:invalid={isInvalid}>{labelTop}{#if optional}<i> - optional</i>{/if}</span> -->
|
|
93
|
-
<span
|
|
94
|
-
class="top-label"
|
|
95
|
-
class:for-default={variant === InputVariant.Default}
|
|
96
|
-
>{labelTop}{#if optional}<i> - optional</i>{/if}</span
|
|
97
|
-
>
|
|
98
|
-
{#if variant === InputVariant.Default}
|
|
99
|
-
<span class="border"
|
|
100
|
-
>{labelTop}{#if optional}<i> - optional</i>{/if}</span
|
|
101
|
-
>
|
|
102
|
-
{/if}
|
|
103
|
-
{/if}
|
|
104
|
-
<!-- style="--background-colour: {leftIcon?.backgroundColour ?? rightIcon?.backgroundColour};" -->
|
|
105
|
-
<div
|
|
106
|
-
class="icon-container"
|
|
107
|
-
class:for-modal={variant == InputVariant.Modal}
|
|
108
|
-
>
|
|
109
|
-
{#if leftIcon}
|
|
110
|
-
<Icon
|
|
111
|
-
name={leftIcon.name}
|
|
112
|
-
size={leftIcon.size ?? Size.Medium}
|
|
113
|
-
colour={leftIcon.colour}
|
|
114
|
-
float
|
|
115
|
-
left="0.75rem"
|
|
116
|
-
top="50%"
|
|
117
|
-
anchorX="0"
|
|
118
|
-
anchorY="-50%"
|
|
119
|
-
clickable={!!onLeftIconClick}
|
|
120
|
-
onclick={onLeftIconClick}
|
|
121
|
-
/>
|
|
122
|
-
{/if}
|
|
123
|
-
<input
|
|
124
|
-
hidden
|
|
125
|
-
class:noresize
|
|
126
|
-
class:uppercase
|
|
127
|
-
class:select-none={selectNone}
|
|
128
|
-
class:left-pad={leftIcon != undefined}
|
|
129
|
-
class:right-pad={rightIcon != undefined}
|
|
130
|
-
class:for-modal={variant == InputVariant.Modal}
|
|
131
|
-
bind:files={_files}
|
|
132
|
-
{onblur}
|
|
133
|
-
{accept}
|
|
134
|
-
{onfocus}
|
|
135
|
-
type="file"
|
|
136
|
-
bind:this={inputRef}
|
|
137
|
-
{placeholder}
|
|
138
|
-
{required}
|
|
139
|
-
{disabled}
|
|
140
|
-
{multiple}
|
|
141
|
-
{onchange}
|
|
142
|
-
/>
|
|
143
|
-
|
|
144
|
-
<div class="file-list">
|
|
145
|
-
{#if files.length}
|
|
146
|
-
{#each files as file, index (file)}
|
|
147
|
-
<FileCard
|
|
148
|
-
{file}
|
|
149
|
-
ondelete={() => {
|
|
150
|
-
files.splice(index, 1);
|
|
151
|
-
}}
|
|
152
|
-
/>
|
|
153
|
-
{/each}
|
|
154
|
-
{:else}
|
|
155
|
-
<p>
|
|
156
|
-
Drag and Drop or Click to Upload {#if multiple}multiple documents{:else}a document{/if}
|
|
157
|
-
</p>
|
|
158
|
-
{/if}
|
|
159
|
-
</div>
|
|
160
|
-
<div class="side">
|
|
161
|
-
<Action
|
|
162
|
-
colourSet={ColourSet.Secondary}
|
|
163
|
-
backgroundColour="transparent"
|
|
164
|
-
icon={{ name: 'upload' }}
|
|
165
|
-
label="Upload"
|
|
166
|
-
size={Size.Medium}
|
|
167
|
-
onclick={() => {
|
|
168
|
-
a();
|
|
169
|
-
}}
|
|
170
|
-
/>
|
|
171
|
-
</div>
|
|
172
|
-
<!-- </div> -->
|
|
173
|
-
{#if rightIcon}
|
|
174
|
-
<Icon
|
|
175
|
-
name={rightIcon.name}
|
|
176
|
-
size={rightIcon.size ?? Size.Medium}
|
|
177
|
-
colour={rightIcon.colour}
|
|
178
|
-
float
|
|
179
|
-
right={variant == InputVariant.Modal ? '1rem' : '0.5rem'}
|
|
180
|
-
top="50%"
|
|
181
|
-
anchorX="0"
|
|
182
|
-
anchorY="-50%"
|
|
183
|
-
clickable={!!onRightIconClick}
|
|
184
|
-
onclick={onRightIconClick}
|
|
185
|
-
/>
|
|
186
|
-
{/if}
|
|
187
|
-
{#if labelRight}
|
|
188
|
-
<span
|
|
189
|
-
class="right-label"
|
|
190
|
-
class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
|
|
191
|
-
>
|
|
192
|
-
{/if}
|
|
193
|
-
</div>
|
|
194
|
-
</label>
|
|
195
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { ColourSet } from '../scss/colours.js';
|
|
5
|
+
import { InputVariant } from '../Types/Internal/InputVariant.js';
|
|
6
|
+
import { Size } from '../Types/Internal/Size.js';
|
|
7
|
+
import { onMount } from 'svelte';
|
|
8
|
+
import Action from './Action.svelte';
|
|
9
|
+
import FileCard from './FileCard.svelte';
|
|
10
|
+
import type { FileUploadProps } from './FileUploadProps.js';
|
|
11
|
+
import Icon from './Icon.svelte';
|
|
12
|
+
|
|
13
|
+
let _files: FileList | null | undefined = $state();
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
accept,
|
|
17
|
+
files = $bindable([]),
|
|
18
|
+
multiple = false,
|
|
19
|
+
labelTop,
|
|
20
|
+
labelRight,
|
|
21
|
+
placeholder,
|
|
22
|
+
required = false,
|
|
23
|
+
variant = InputVariant.Default,
|
|
24
|
+
selectNone = false,
|
|
25
|
+
noresize = false,
|
|
26
|
+
uppercase = false,
|
|
27
|
+
disabled,
|
|
28
|
+
optional = false,
|
|
29
|
+
leftIcon,
|
|
30
|
+
rightIcon,
|
|
31
|
+
onLeftIconClick,
|
|
32
|
+
onRightIconClick,
|
|
33
|
+
|
|
34
|
+
inputRef = $bindable(),
|
|
35
|
+
onblur,
|
|
36
|
+
onfocus,
|
|
37
|
+
}: FileUploadProps = $props();
|
|
38
|
+
|
|
39
|
+
function onchange(e: Event & { currentTarget: EventTarget & HTMLInputElement }) {
|
|
40
|
+
const markedFiles = (e.target as HTMLInputElement).files ?? [];
|
|
41
|
+
for (let i = 0; i < markedFiles.length; i++) {
|
|
42
|
+
files.push(markedFiles[i]);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function a() {
|
|
47
|
+
inputRef?.showPicker();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let dragover = $state(false);
|
|
51
|
+
|
|
52
|
+
function ondrop(e: DragEvent) {
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
dragover = false;
|
|
56
|
+
|
|
57
|
+
if (!e.dataTransfer?.files) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const len = e.dataTransfer.files.length;
|
|
62
|
+
for (let i = 0; i < len; i++) {
|
|
63
|
+
files.push(e.dataTransfer.files[i]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function ondragover(e: DragEvent) {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
|
|
70
|
+
dragover = true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function ondragleave(e: DragEvent) {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
|
|
76
|
+
dragover = false;
|
|
77
|
+
}
|
|
78
|
+
onMount(() => {
|
|
79
|
+
console.log('Drag and drop file uploading may not work');
|
|
80
|
+
});
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<label
|
|
84
|
+
class:dragover
|
|
85
|
+
class:for-modal={variant === InputVariant.Modal}
|
|
86
|
+
{ondrop}
|
|
87
|
+
{ondragover}
|
|
88
|
+
{ondragleave}
|
|
89
|
+
>
|
|
90
|
+
<!-- HACK removed label for modals for now because I couldn't think of a decent style that doesn't interfere with scrolling -->
|
|
91
|
+
{#if labelTop && variant !== InputVariant.Modal}
|
|
92
|
+
<!-- <span class="top-label" class:invalid={isInvalid}>{labelTop}{#if optional}<i> - optional</i>{/if}</span> -->
|
|
93
|
+
<span
|
|
94
|
+
class="top-label"
|
|
95
|
+
class:for-default={variant === InputVariant.Default}
|
|
96
|
+
>{labelTop}{#if optional}<i> - optional</i>{/if}</span
|
|
97
|
+
>
|
|
98
|
+
{#if variant === InputVariant.Default}
|
|
99
|
+
<span class="border"
|
|
100
|
+
>{labelTop}{#if optional}<i> - optional</i>{/if}</span
|
|
101
|
+
>
|
|
102
|
+
{/if}
|
|
103
|
+
{/if}
|
|
104
|
+
<!-- style="--background-colour: {leftIcon?.backgroundColour ?? rightIcon?.backgroundColour};" -->
|
|
105
|
+
<div
|
|
106
|
+
class="icon-container"
|
|
107
|
+
class:for-modal={variant == InputVariant.Modal}
|
|
108
|
+
>
|
|
109
|
+
{#if leftIcon}
|
|
110
|
+
<Icon
|
|
111
|
+
name={leftIcon.name}
|
|
112
|
+
size={leftIcon.size ?? Size.Medium}
|
|
113
|
+
colour={leftIcon.colour}
|
|
114
|
+
float
|
|
115
|
+
left="0.75rem"
|
|
116
|
+
top="50%"
|
|
117
|
+
anchorX="0"
|
|
118
|
+
anchorY="-50%"
|
|
119
|
+
clickable={!!onLeftIconClick}
|
|
120
|
+
onclick={onLeftIconClick}
|
|
121
|
+
/>
|
|
122
|
+
{/if}
|
|
123
|
+
<input
|
|
124
|
+
hidden
|
|
125
|
+
class:noresize
|
|
126
|
+
class:uppercase
|
|
127
|
+
class:select-none={selectNone}
|
|
128
|
+
class:left-pad={leftIcon != undefined}
|
|
129
|
+
class:right-pad={rightIcon != undefined}
|
|
130
|
+
class:for-modal={variant == InputVariant.Modal}
|
|
131
|
+
bind:files={_files}
|
|
132
|
+
{onblur}
|
|
133
|
+
{accept}
|
|
134
|
+
{onfocus}
|
|
135
|
+
type="file"
|
|
136
|
+
bind:this={inputRef}
|
|
137
|
+
{placeholder}
|
|
138
|
+
{required}
|
|
139
|
+
{disabled}
|
|
140
|
+
{multiple}
|
|
141
|
+
{onchange}
|
|
142
|
+
/>
|
|
143
|
+
|
|
144
|
+
<div class="file-list">
|
|
145
|
+
{#if files.length}
|
|
146
|
+
{#each files as file, index (file)}
|
|
147
|
+
<FileCard
|
|
148
|
+
{file}
|
|
149
|
+
ondelete={() => {
|
|
150
|
+
files.splice(index, 1);
|
|
151
|
+
}}
|
|
152
|
+
/>
|
|
153
|
+
{/each}
|
|
154
|
+
{:else}
|
|
155
|
+
<p>
|
|
156
|
+
Drag and Drop or Click to Upload {#if multiple}multiple documents{:else}a document{/if}
|
|
157
|
+
</p>
|
|
158
|
+
{/if}
|
|
159
|
+
</div>
|
|
160
|
+
<div class="side">
|
|
161
|
+
<Action
|
|
162
|
+
colourSet={ColourSet.Secondary}
|
|
163
|
+
backgroundColour="transparent"
|
|
164
|
+
icon={{ name: 'upload' }}
|
|
165
|
+
label="Upload"
|
|
166
|
+
size={Size.Medium}
|
|
167
|
+
onclick={() => {
|
|
168
|
+
a();
|
|
169
|
+
}}
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
<!-- </div> -->
|
|
173
|
+
{#if rightIcon}
|
|
174
|
+
<Icon
|
|
175
|
+
name={rightIcon.name}
|
|
176
|
+
size={rightIcon.size ?? Size.Medium}
|
|
177
|
+
colour={rightIcon.colour}
|
|
178
|
+
float
|
|
179
|
+
right={variant == InputVariant.Modal ? '1rem' : '0.5rem'}
|
|
180
|
+
top="50%"
|
|
181
|
+
anchorX="0"
|
|
182
|
+
anchorY="-50%"
|
|
183
|
+
clickable={!!onRightIconClick}
|
|
184
|
+
onclick={onRightIconClick}
|
|
185
|
+
/>
|
|
186
|
+
{/if}
|
|
187
|
+
{#if labelRight}
|
|
188
|
+
<span
|
|
189
|
+
class="right-label"
|
|
190
|
+
class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
|
|
191
|
+
>
|
|
192
|
+
{/if}
|
|
193
|
+
</div>
|
|
194
|
+
</label>
|
|
195
|
+
|
|
196
196
|
<style>input {
|
|
197
197
|
box-sizing: border-box;
|
|
198
198
|
height: 100%;
|
|
@@ -398,4 +398,4 @@ label {
|
|
|
398
398
|
|
|
399
399
|
.dragover {
|
|
400
400
|
background-color: rgba(31, 129, 160, 0.4);
|
|
401
|
-
}</style>
|
|
401
|
+
}</style>
|