@lavalogic/scoria 0.37.44 → 0.37.45
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 +46 -46
- package/dist/Components/AccordionGroupButton.svelte +76 -76
- package/dist/Components/Action.svelte +136 -136
- package/dist/Components/ActionProps.d.ts +2 -6
- package/dist/Components/AlertModal.svelte +195 -183
- package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +702 -702
- package/dist/Components/Base/BaseModal.svelte +125 -125
- package/dist/Components/Base/ContextWrapper.svelte +72 -72
- package/dist/Components/Base/Pagination.svelte +198 -198
- package/dist/Components/Base/Snippets.svelte +36 -36
- package/dist/Components/BigRadioSet.svelte +38 -38
- package/dist/Components/Bubble.svelte +101 -101
- package/dist/Components/Button.svelte +209 -209
- package/dist/Components/ButtonProps.d.ts +2 -6
- package/dist/Components/Checkbox.svelte +86 -86
- package/dist/Components/CollapsibleCard.svelte +78 -78
- package/dist/Components/Contexts/ContextMenu.svelte +164 -164
- package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
- package/dist/Components/Contexts/ContextMenuOption.svelte +60 -60
- package/dist/Components/Contexts/Toast.svelte +83 -83
- package/dist/Components/Contexts/ToastContainer.svelte +65 -65
- package/dist/Components/Contexts/Tooltip.svelte +37 -37
- package/dist/Components/DataMatrixIcon.svelte +112 -112
- package/dist/Components/DataMatrixIconProps.d.ts +3 -13
- package/dist/Components/DateInput.svelte +148 -148
- package/dist/Components/DatePicker.svelte +300 -300
- package/dist/Components/DesktopModal.svelte +90 -90
- package/dist/Components/Dial.svelte +204 -204
- package/dist/Components/DialProps.d.ts +1 -18
- package/dist/Components/DimensionInput.svelte +170 -170
- package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -119
- package/dist/Components/DragMenu/DraggableCard.svelte +77 -77
- package/dist/Components/FileCard.svelte +24 -24
- package/dist/Components/FileUpload.svelte +236 -236
- package/dist/Components/GridInput.svelte +196 -200
- package/dist/Components/GridInputSet.svelte +29 -29
- package/dist/Components/HorizontalTabGroup.svelte +82 -82
- package/dist/Components/HorizontalTabGroupButton.svelte +44 -44
- package/dist/Components/Icon.svelte +128 -128
- package/dist/Components/IconProps.d.ts +2 -7
- package/dist/Components/Icons.js +357 -357
- package/dist/Components/LoadingAnimation.svelte +29 -29
- package/dist/Components/LoadingModal.svelte +45 -45
- package/dist/Components/LoadingOverlay.svelte +25 -25
- package/dist/Components/LoadingOverlayProps.d.ts +3 -7
- package/dist/Components/Modal.svelte +258 -258
- package/dist/Components/ModalProps.d.ts +0 -3
- package/dist/Components/MultiSelect.svelte +220 -220
- package/dist/Components/MultiSelectCommonProps.d.ts +6 -17
- package/dist/Components/Nav/Nav.svelte +99 -99
- package/dist/Components/Nav/NavProps.d.ts +4 -11
- package/dist/Components/Nav/NavServiceMenuList.svelte +43 -43
- package/dist/Components/Nav/NavTab.svelte +62 -62
- package/dist/Components/Nav/ServiceMenuItem.svelte +100 -100
- package/dist/Components/Nav/ServicesNav.svelte +80 -80
- package/dist/Components/NumberInput.svelte +157 -157
- package/dist/Components/PageHeading.svelte +25 -25
- package/dist/Components/PasswordInput.svelte +88 -88
- package/dist/Components/Portal.svelte +36 -36
- package/dist/Components/ProgressBubble.svelte +107 -108
- package/dist/Components/ProgressBubbleProps.d.ts +3 -3
- package/dist/Components/QuerySelect.svelte +366 -366
- package/dist/Components/QuerySelectProps.d.ts +4 -14
- package/dist/Components/SingleSelect.svelte +250 -250
- package/dist/Components/SingleSelectCommonProps.d.ts +3 -19
- package/dist/Components/StepButton.svelte +70 -70
- package/dist/Components/StepForm.svelte +140 -140
- package/dist/Components/Switch.svelte +69 -69
- package/dist/Components/Table/ARCHITECTURE.md +298 -0
- package/dist/Components/Table/Body/QuickSearchCell.svelte +679 -694
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +51 -51
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +59 -59
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +456 -478
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -79
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +185 -188
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +124 -124
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +120 -120
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +230 -230
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +105 -105
- package/dist/Components/Table/Body/Rows/Columns/SelectColumn.d.ts +12 -9
- package/dist/Components/Table/Body/Rows/Columns/SelectTableCell.d.ts +5 -5
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -87
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +126 -126
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -159
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +246 -246
- package/dist/Components/Table/Body/Rows/Columns/TableDatePickerProps.d.ts +4 -4
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +216 -216
- package/dist/Components/Table/Body/Rows/Columns/TableQueryCell.d.ts +6 -5
- package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.d.ts +7 -6
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +252 -257
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +179 -179
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +221 -229
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte.d.ts +11 -11
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +197 -197
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +190 -190
- package/dist/Components/Table/Body/Rows/TableRow.svelte +290 -290
- package/dist/Components/Table/Body/TableBody.svelte +155 -155
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +2 -3
- package/dist/Components/Table/ColumnFactory.svelte.d.ts +9 -11
- package/dist/Components/Table/ColumnFactory.svelte.js +101 -118
- package/dist/Components/Table/ColumnKindRegistry.d.ts +112 -0
- package/dist/Components/Table/ColumnKindRegistry.js +63 -0
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -41
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -30
- package/dist/Components/Table/Headers/TableHead.svelte +415 -413
- package/dist/Components/Table/Misc/ColumnPanel.svelte +94 -94
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +112 -112
- package/dist/Components/Table/Misc/FilterInput.svelte +620 -644
- package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +12 -12
- package/dist/Components/Table/Misc/FilterInputProps.d.ts +2 -2
- package/dist/Components/Table/Misc/FilterPanel.svelte +257 -257
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +30 -30
- package/dist/Components/Table/Misc/SidePanel.svelte +35 -35
- package/dist/Components/Table/Misc/TableFooter.svelte +311 -311
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +125 -125
- package/dist/Components/Table/Misc/TableSidebar.svelte +157 -157
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +100 -100
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -107
- package/dist/Components/Table/NestedTable.svelte +130 -133
- package/dist/Components/Table/SubApis.svelte.d.ts +1 -5
- package/dist/Components/Table/SubApis.svelte.js +33 -32
- package/dist/Components/Table/Table.svelte +692 -745
- package/dist/Components/Table/TableHelpers.svelte.d.ts +6 -19
- package/dist/Components/Table/TableHelpers.svelte.js +6 -14
- package/dist/Components/Table/Types/Columns/Column.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/DateColumn.d.ts +3 -3
- package/dist/Components/Table/Types/Columns/DateTableCell.d.ts +7 -7
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +7 -8
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.js +4 -5
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +11 -14
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.js +3 -4
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.d.ts +7 -11
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.js +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts +13 -18
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.js +4 -5
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.d.ts +15 -12
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.js +4 -5
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +8 -12
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.js +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +6 -6
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +49 -16
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +27 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +7 -7
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +4 -4
- package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +11 -19
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.js +4 -8
- package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +6 -7
- package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.js +3 -4
- package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +9 -9
- package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js +4 -4
- package/dist/Components/Table/Types/Columns/ExpandTableCell.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/ProgressBarTableCell.d.ts +6 -6
- package/dist/Components/Table/Types/Columns/TableCell.d.ts +7 -6
- package/dist/Components/Table/Types/Context/ClipboardState.svelte.d.ts +98 -0
- package/dist/Components/Table/Types/Context/ClipboardState.svelte.js +290 -0
- package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.d.ts +17 -45
- package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.js +17 -45
- package/dist/Components/Table/Types/Context/FilteringState.svelte.d.ts +9 -20
- package/dist/Components/Table/Types/Context/FilteringState.svelte.js +9 -20
- package/dist/Components/Table/Types/Context/FocusState.svelte.d.ts +23 -42
- package/dist/Components/Table/Types/Context/FocusState.svelte.js +32 -59
- package/dist/Components/Table/Types/Context/ITable.d.ts +5 -8
- package/dist/Components/Table/Types/Context/PreferencesState.svelte.d.ts +29 -56
- package/dist/Components/Table/Types/Context/PreferencesState.svelte.js +28 -55
- package/dist/Components/Table/Types/Context/QueryValuesState.svelte.d.ts +50 -0
- package/dist/Components/Table/Types/Context/QueryValuesState.svelte.js +62 -0
- package/dist/Components/Table/Types/Context/SelectionState.svelte.d.ts +17 -28
- package/dist/Components/Table/Types/Context/SelectionState.svelte.js +17 -28
- package/dist/Components/Table/Types/Context/SortingState.svelte.d.ts +15 -29
- package/dist/Components/Table/Types/Context/SortingState.svelte.js +17 -31
- package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +212 -325
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +292 -706
- package/dist/Components/Table/Types/Context/VirtualisationState.svelte.d.ts +62 -79
- package/dist/Components/Table/Types/Context/VirtualisationState.svelte.js +54 -73
- package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.d.ts +16 -27
- package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.js +16 -27
- package/dist/Components/Table/Types/DataRepository/IDataRepository.d.ts +12 -15
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.d.ts +15 -30
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +16 -28
- package/dist/Components/Table/Types/Header.d.ts +4 -4
- package/dist/Components/Table/Types/HeaderGroup.d.ts +5 -5
- package/dist/Components/Table/Types/Public/index.d.ts +2 -4
- package/dist/Components/Table/Types/Public/index.js +2 -4
- package/dist/Components/Table/clipboardEscape.d.ts +32 -0
- package/dist/Components/Table/clipboardEscape.js +45 -0
- package/dist/Components/Table/createTable.svelte.d.ts +8 -18
- package/dist/Components/Table/createTable.svelte.js +19 -47
- package/dist/Components/Test/TestContextConsumer.svelte +13 -13
- package/dist/Components/TextArea.svelte +130 -130
- package/dist/Components/TextInput.svelte +176 -176
- package/dist/Components/ThreeStateRadio.svelte +131 -131
- package/dist/Components/Touch/BoolCard.svelte +45 -45
- package/dist/Components/Touch/DateModal.svelte +209 -209
- package/dist/Components/Touch/EditCard.svelte +59 -59
- package/dist/Components/Touch/InfoCard.svelte +31 -31
- package/dist/Components/Touch/InfoTextCard.svelte +28 -28
- package/dist/Components/Touch/ModalExplanation.svelte +17 -17
- package/dist/Components/Touch/NumberKeyboard.svelte +225 -225
- package/dist/Components/Touch/NumberModal.svelte +79 -79
- package/dist/Components/Touch/PlusMinusCard.svelte +46 -46
- package/dist/Components/Touch/SelectModal.svelte +123 -123
- package/dist/Components/Touch/SummaryCard.svelte +93 -93
- package/dist/Components/Touch/TextAreaModal.svelte +95 -95
- package/dist/Components/Touch/TextModal.svelte +106 -106
- package/dist/Components/Touch/TouchCard.svelte +33 -33
- package/dist/Components/Touch/TouchModal.svelte +274 -274
- package/dist/Components/Touch/UtilityButton.svelte +109 -109
- package/dist/Components/VerticalTabGroup.svelte +79 -79
- package/dist/Components/VerticalTabGroupButton.svelte +58 -58
- package/dist/Contexts/ToastContext.svelte.js +3 -4
- package/dist/Helpers/Datamatrix.d.ts +19 -19
- package/dist/Helpers/Datamatrix.js +291 -291
- package/dist/Helpers/Helpers.svelte.d.ts +2 -4
- package/dist/Helpers/Helpers.svelte.js +2 -4
- package/dist/Helpers/dropdownPortal.d.ts +26 -41
- package/dist/Helpers/dropdownPortal.js +62 -116
- package/dist/Types/Examples/ExampleModal.svelte +35 -35
- package/dist/index.d.ts +0 -1
- package/dist/scss/_basics.scss +12 -12
- package/dist/scss/_colours.scss +134 -134
- package/dist/scss/_mixins.scss +3348 -3360
- package/dist/scss/_motion.scss +57 -57
- package/dist/scss/_sizing.scss +85 -85
- package/dist/scss/_transitions.scss +8 -8
- package/package.json +2 -1
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { cssLength } from '../Helpers/Helpers.svelte.js';
|
|
5
|
-
import { ColourSet } from '../scss/colours.js';
|
|
6
|
-
import { Size } from '../Types/Internal/Size.js';
|
|
7
|
-
import Action from './Action.svelte';
|
|
8
|
-
import Icon from './Icon.svelte';
|
|
9
|
-
import type { PasswordInputProps } from './PasswordInputProps.js';
|
|
10
|
-
let {
|
|
11
|
-
value = $bindable(''),
|
|
12
|
-
label = undefined,
|
|
13
|
-
placeholder = undefined,
|
|
14
|
-
required = false,
|
|
15
|
-
disabled = undefined,
|
|
16
|
-
showInput = $bindable(false),
|
|
17
|
-
leftIcon = undefined,
|
|
18
|
-
inputRef = $bindable(),
|
|
19
|
-
autocomplete = 'current-password',
|
|
20
|
-
onblur,
|
|
21
|
-
onfocus,
|
|
22
|
-
// No default `onkeydown` - see TextInput.svelte for the rationale.
|
|
23
|
-
// The legacy default (`passthrough`) blurred the input on every
|
|
24
|
-
// alphanumeric keystroke and made the field unusable.
|
|
25
|
-
onkeydown,
|
|
26
|
-
}: PasswordInputProps = $props();
|
|
27
|
-
|
|
28
|
-
function toggleVisibility(): void {
|
|
29
|
-
showInput = !showInput;
|
|
30
|
-
inputRef?.focus();
|
|
31
|
-
}
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<div class="error-wrapper">
|
|
35
|
-
<label>
|
|
36
|
-
{#if label}
|
|
37
|
-
<span class="for-default">{label}</span>
|
|
38
|
-
<span
|
|
39
|
-
aria-hidden="true"
|
|
40
|
-
class="border">{label}</span
|
|
41
|
-
>
|
|
42
|
-
{/if}
|
|
43
|
-
<div class="icon-container">
|
|
44
|
-
{#if leftIcon}
|
|
45
|
-
<Icon
|
|
46
|
-
name={leftIcon.name}
|
|
47
|
-
size={leftIcon.size ?? Size.Medium}
|
|
48
|
-
float
|
|
49
|
-
left={cssLength('0.75rem')}
|
|
50
|
-
top={cssLength('50%')}
|
|
51
|
-
anchorX={cssLength('0')}
|
|
52
|
-
anchorY={cssLength('-50%')}
|
|
53
|
-
/>
|
|
54
|
-
{/if}
|
|
55
|
-
<input
|
|
56
|
-
class="for-default"
|
|
57
|
-
class:left-pad={leftIcon != undefined}
|
|
58
|
-
class:right-pad={true}
|
|
59
|
-
type={showInput ? 'text' : 'password'}
|
|
60
|
-
{autocomplete}
|
|
61
|
-
autocapitalize="none"
|
|
62
|
-
autocorrect="off"
|
|
63
|
-
spellcheck="false"
|
|
64
|
-
data-form-type="password"
|
|
65
|
-
bind:value
|
|
66
|
-
bind:this={inputRef}
|
|
67
|
-
{onblur}
|
|
68
|
-
{onfocus}
|
|
69
|
-
{onkeydown}
|
|
70
|
-
{placeholder}
|
|
71
|
-
{required}
|
|
72
|
-
{disabled}
|
|
73
|
-
/>
|
|
74
|
-
|
|
75
|
-
<div class="right-icon">
|
|
76
|
-
<Action
|
|
77
|
-
label={showInput ? 'Hide password' : 'Show password'}
|
|
78
|
-
colourSet={showInput ? ColourSet.Secondary : ColourSet.Auxiliary}
|
|
79
|
-
icon={{ name: showInput ? 'visibility-off' : 'visibility' }}
|
|
80
|
-
size={Size.MediumSmall}
|
|
81
|
-
onclick={toggleVisibility}
|
|
82
|
-
/>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</label>
|
|
86
|
-
</div>
|
|
87
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { cssLength } from '../Helpers/Helpers.svelte.js';
|
|
5
|
+
import { ColourSet } from '../scss/colours.js';
|
|
6
|
+
import { Size } from '../Types/Internal/Size.js';
|
|
7
|
+
import Action from './Action.svelte';
|
|
8
|
+
import Icon from './Icon.svelte';
|
|
9
|
+
import type { PasswordInputProps } from './PasswordInputProps.js';
|
|
10
|
+
let {
|
|
11
|
+
value = $bindable(''),
|
|
12
|
+
label = undefined,
|
|
13
|
+
placeholder = undefined,
|
|
14
|
+
required = false,
|
|
15
|
+
disabled = undefined,
|
|
16
|
+
showInput = $bindable(false),
|
|
17
|
+
leftIcon = undefined,
|
|
18
|
+
inputRef = $bindable(),
|
|
19
|
+
autocomplete = 'current-password',
|
|
20
|
+
onblur,
|
|
21
|
+
onfocus,
|
|
22
|
+
// No default `onkeydown` - see TextInput.svelte for the rationale.
|
|
23
|
+
// The legacy default (`passthrough`) blurred the input on every
|
|
24
|
+
// alphanumeric keystroke and made the field unusable.
|
|
25
|
+
onkeydown,
|
|
26
|
+
}: PasswordInputProps = $props();
|
|
27
|
+
|
|
28
|
+
function toggleVisibility(): void {
|
|
29
|
+
showInput = !showInput;
|
|
30
|
+
inputRef?.focus();
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<div class="error-wrapper">
|
|
35
|
+
<label>
|
|
36
|
+
{#if label}
|
|
37
|
+
<span class="for-default">{label}</span>
|
|
38
|
+
<span
|
|
39
|
+
aria-hidden="true"
|
|
40
|
+
class="border">{label}</span
|
|
41
|
+
>
|
|
42
|
+
{/if}
|
|
43
|
+
<div class="icon-container">
|
|
44
|
+
{#if leftIcon}
|
|
45
|
+
<Icon
|
|
46
|
+
name={leftIcon.name}
|
|
47
|
+
size={leftIcon.size ?? Size.Medium}
|
|
48
|
+
float
|
|
49
|
+
left={cssLength('0.75rem')}
|
|
50
|
+
top={cssLength('50%')}
|
|
51
|
+
anchorX={cssLength('0')}
|
|
52
|
+
anchorY={cssLength('-50%')}
|
|
53
|
+
/>
|
|
54
|
+
{/if}
|
|
55
|
+
<input
|
|
56
|
+
class="for-default"
|
|
57
|
+
class:left-pad={leftIcon != undefined}
|
|
58
|
+
class:right-pad={true}
|
|
59
|
+
type={showInput ? 'text' : 'password'}
|
|
60
|
+
{autocomplete}
|
|
61
|
+
autocapitalize="none"
|
|
62
|
+
autocorrect="off"
|
|
63
|
+
spellcheck="false"
|
|
64
|
+
data-form-type="password"
|
|
65
|
+
bind:value
|
|
66
|
+
bind:this={inputRef}
|
|
67
|
+
{onblur}
|
|
68
|
+
{onfocus}
|
|
69
|
+
{onkeydown}
|
|
70
|
+
{placeholder}
|
|
71
|
+
{required}
|
|
72
|
+
{disabled}
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
<div class="right-icon">
|
|
76
|
+
<Action
|
|
77
|
+
label={showInput ? 'Hide password' : 'Show password'}
|
|
78
|
+
colourSet={showInput ? ColourSet.Secondary : ColourSet.Auxiliary}
|
|
79
|
+
icon={{ name: showInput ? 'visibility-off' : 'visibility' }}
|
|
80
|
+
size={Size.MediumSmall}
|
|
81
|
+
onclick={toggleVisibility}
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</label>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
88
|
<style>input {
|
|
89
89
|
box-sizing: border-box;
|
|
90
90
|
height: 100%;
|
|
@@ -318,4 +318,4 @@ label.for-table input {
|
|
|
318
318
|
|
|
319
319
|
td {
|
|
320
320
|
--input-border: none;
|
|
321
|
-
}</style>
|
|
321
|
+
}</style>
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { browser } from '$app/environment';
|
|
5
|
-
import type { PortalProps } from './PortalProps.js';
|
|
6
|
-
|
|
7
|
-
let { target = browser ? globalThis.document.body : undefined, children }: PortalProps = $props();
|
|
8
|
-
|
|
9
|
-
let ref: HTMLElement | undefined = $state();
|
|
10
|
-
let lastTarget: HTMLElement | undefined;
|
|
11
|
-
|
|
12
|
-
$effect(() => {
|
|
13
|
-
// Identity guard: only re-parent when `target` actually changes.
|
|
14
|
-
// `appendChild` already moves the node when called, so this avoids
|
|
15
|
-
// unnecessary detach/attach when an upstream `$state` target
|
|
16
|
-
// re-fires the effect without changing identity.
|
|
17
|
-
if (target && ref && target !== lastTarget) {
|
|
18
|
-
if (target.ownerDocument === globalThis.document) {
|
|
19
|
-
target.appendChild(ref);
|
|
20
|
-
lastTarget = target;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Cleanup is necessary, not redundant: without it, the appended
|
|
25
|
-
// node would remain inside `target` after the Portal unmounts,
|
|
26
|
-
// because `target` outlives the component.
|
|
27
|
-
return () => {
|
|
28
|
-
ref?.parentNode?.removeChild(ref);
|
|
29
|
-
lastTarget = undefined;
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<div bind:this={ref}>
|
|
35
|
-
{@render children()}
|
|
36
|
-
</div>
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { browser } from '$app/environment';
|
|
5
|
+
import type { PortalProps } from './PortalProps.js';
|
|
6
|
+
|
|
7
|
+
let { target = browser ? globalThis.document.body : undefined, children }: PortalProps = $props();
|
|
8
|
+
|
|
9
|
+
let ref: HTMLElement | undefined = $state();
|
|
10
|
+
let lastTarget: HTMLElement | undefined;
|
|
11
|
+
|
|
12
|
+
$effect(() => {
|
|
13
|
+
// Identity guard: only re-parent when `target` actually changes.
|
|
14
|
+
// `appendChild` already moves the node when called, so this avoids
|
|
15
|
+
// unnecessary detach/attach when an upstream `$state` target
|
|
16
|
+
// re-fires the effect without changing identity.
|
|
17
|
+
if (target && ref && target !== lastTarget) {
|
|
18
|
+
if (target.ownerDocument === globalThis.document) {
|
|
19
|
+
target.appendChild(ref);
|
|
20
|
+
lastTarget = target;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Cleanup is necessary, not redundant: without it, the appended
|
|
25
|
+
// node would remain inside `target` after the Portal unmounts,
|
|
26
|
+
// because `target` outlives the component.
|
|
27
|
+
return () => {
|
|
28
|
+
ref?.parentNode?.removeChild(ref);
|
|
29
|
+
lastTarget = undefined;
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<div bind:this={ref}>
|
|
35
|
+
{@render children()}
|
|
36
|
+
</div>
|
|
@@ -1,110 +1,109 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { useAsyncFlag } from '../Helpers/AsyncFlag.svelte.js';
|
|
5
|
-
import { getCanvasContext } from '../Helpers/Helpers.svelte.js';
|
|
6
|
-
import type { BubbleColour } from './BubbleColour.js';
|
|
7
|
-
import type { ProgressBubbleProps } from './ProgressBubbleProps.js';
|
|
8
|
-
|
|
9
|
-
const { value, colours }: ProgressBubbleProps = $props();
|
|
10
|
-
|
|
11
|
-
const current = $derived(value[0]);
|
|
12
|
-
const total = $derived(value[1]);
|
|
13
|
-
const progress = $derived(`${current}/${total}`);
|
|
14
|
-
|
|
15
|
-
// Clamp the percentage so callers passing `current > total` do not
|
|
16
|
-
// blow past the bar's edge.
|
|
17
|
-
const percent = $derived(Math.min((current / total) * 100, 100));
|
|
18
|
-
|
|
19
|
-
let progressBarRef: HTMLDivElement | undefined = $state();
|
|
20
|
-
|
|
21
|
-
// Observed inline-size of the filled bar. A `ResizeObserver` is used
|
|
22
|
-
// instead of `getBoundingClientRect()` inside an `$effect`: the latter
|
|
23
|
-
// forces a synchronous layout flush on every `progress` change, which
|
|
24
|
-
// is expensive inside a table with many `ProgressBubble` cells. The
|
|
25
|
-
// observer notifies us only when the bar's actual rendered size
|
|
26
|
-
// changes, and does so via a microtask scheduled by the browser so we
|
|
27
|
-
// never force layout ourselves.
|
|
28
|
-
let barWidth = $state(0);
|
|
29
|
-
$effect(() => {
|
|
30
|
-
if (!progressBarRef) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const ro = new ResizeObserver((entries) => {
|
|
34
|
-
const entry = entries[0];
|
|
35
|
-
barWidth = entry.borderBoxSize[0]?.inlineSize ?? entry.contentRect.width;
|
|
36
|
-
});
|
|
37
|
-
ro.observe(progressBarRef);
|
|
38
|
-
return () => {
|
|
39
|
-
ro.disconnect();
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// Whether the `current/total` label fits inside the filled bar.
|
|
44
|
-
// Measured via a memoised offscreen canvas so we do not trigger
|
|
45
|
-
// layout.
|
|
46
|
-
const fitsInProgressBar = $derived.by(() => {
|
|
47
|
-
const textWidth = getCanvasContext()?.measureText(`__${progress}__`).width ?? 0;
|
|
48
|
-
return barWidth > textWidth;
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// `colours` may be a bare `BubbleColour`, a Promise resolving to one,
|
|
52
|
-
// or undefined. Routed through `useAsyncFlag` which (a) cancels stale
|
|
53
|
-
// Promises via a sequence ticket so the freshest value always wins,
|
|
54
|
-
// (b) reports errors through `ToastContext` when one is mounted, and
|
|
55
|
-
// (c) falls back to `undefined` while no resolution is available.
|
|
56
|
-
const awaitedColoursFlag = useAsyncFlag<BubbleColour | undefined>(() => colours, undefined);
|
|
57
|
-
const awaitedColours = $derived(awaitedColoursFlag.value);
|
|
58
|
-
|
|
59
|
-
// Precompute the wrapper and bar style strings. Each colour comes
|
|
60
|
-
// from the trusted `Colour` registry (see `Bubble.svelte` security
|
|
61
|
-
// note) so interpolation into `style="..."` is safe.
|
|
62
|
-
const wrapperStyle = $derived(
|
|
63
|
-
awaitedColours
|
|
64
|
-
? `--bar-background-colour: ${awaitedColours.backgroundColour}; --text-colour: ${awaitedColours.colour};`
|
|
65
|
-
: ''
|
|
66
|
-
);
|
|
67
|
-
const barStyle = $derived(`width: ${percent}%;`);
|
|
68
|
-
</script>
|
|
69
|
-
|
|
70
|
-
<div
|
|
71
|
-
class="progress-wrapper"
|
|
72
|
-
style={wrapperStyle}
|
|
73
|
-
>
|
|
74
|
-
<!--
|
|
75
|
-
Native `<progress>` is kept as a fallback for assistive tech that
|
|
76
|
-
ignores ARIA progressbar roles.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
aria-
|
|
90
|
-
aria-
|
|
91
|
-
aria-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
class
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
class
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { useAsyncFlag } from '../Helpers/AsyncFlag.svelte.js';
|
|
5
|
+
import { getCanvasContext } from '../Helpers/Helpers.svelte.js';
|
|
6
|
+
import type { BubbleColour } from './BubbleColour.js';
|
|
7
|
+
import type { ProgressBubbleProps } from './ProgressBubbleProps.js';
|
|
8
|
+
|
|
9
|
+
const { value, colours }: ProgressBubbleProps = $props();
|
|
10
|
+
|
|
11
|
+
const current = $derived(value[0]);
|
|
12
|
+
const total = $derived(value[1]);
|
|
13
|
+
const progress = $derived(`${current}/${total}`);
|
|
14
|
+
|
|
15
|
+
// Clamp the percentage so callers passing `current > total` do not
|
|
16
|
+
// blow past the bar's edge.
|
|
17
|
+
const percent = $derived(Math.min((current / total) * 100, 100));
|
|
18
|
+
|
|
19
|
+
let progressBarRef: HTMLDivElement | undefined = $state();
|
|
20
|
+
|
|
21
|
+
// Observed inline-size of the filled bar. A `ResizeObserver` is used
|
|
22
|
+
// instead of `getBoundingClientRect()` inside an `$effect`: the latter
|
|
23
|
+
// forces a synchronous layout flush on every `progress` change, which
|
|
24
|
+
// is expensive inside a table with many `ProgressBubble` cells. The
|
|
25
|
+
// observer notifies us only when the bar's actual rendered size
|
|
26
|
+
// changes, and does so via a microtask scheduled by the browser so we
|
|
27
|
+
// never force layout ourselves.
|
|
28
|
+
let barWidth = $state(0);
|
|
29
|
+
$effect(() => {
|
|
30
|
+
if (!progressBarRef) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const ro = new ResizeObserver((entries) => {
|
|
34
|
+
const entry = entries[0];
|
|
35
|
+
barWidth = entry.borderBoxSize[0]?.inlineSize ?? entry.contentRect.width;
|
|
36
|
+
});
|
|
37
|
+
ro.observe(progressBarRef);
|
|
38
|
+
return () => {
|
|
39
|
+
ro.disconnect();
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Whether the `current/total` label fits inside the filled bar.
|
|
44
|
+
// Measured via a memoised offscreen canvas so we do not trigger
|
|
45
|
+
// layout.
|
|
46
|
+
const fitsInProgressBar = $derived.by(() => {
|
|
47
|
+
const textWidth = getCanvasContext()?.measureText(`__${progress}__`).width ?? 0;
|
|
48
|
+
return barWidth > textWidth;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// `colours` may be a bare `BubbleColour`, a Promise resolving to one,
|
|
52
|
+
// or undefined. Routed through `useAsyncFlag` which (a) cancels stale
|
|
53
|
+
// Promises via a sequence ticket so the freshest value always wins,
|
|
54
|
+
// (b) reports errors through `ToastContext` when one is mounted, and
|
|
55
|
+
// (c) falls back to `undefined` while no resolution is available.
|
|
56
|
+
const awaitedColoursFlag = useAsyncFlag<BubbleColour | undefined>(() => colours, undefined);
|
|
57
|
+
const awaitedColours = $derived(awaitedColoursFlag.value);
|
|
58
|
+
|
|
59
|
+
// Precompute the wrapper and bar style strings. Each colour comes
|
|
60
|
+
// from the trusted `Colour` registry (see `Bubble.svelte` security
|
|
61
|
+
// note) so interpolation into `style="..."` is safe.
|
|
62
|
+
const wrapperStyle = $derived(
|
|
63
|
+
awaitedColours
|
|
64
|
+
? `--bar-background-colour: ${awaitedColours.backgroundColour}; --text-colour: ${awaitedColours.colour};`
|
|
65
|
+
: ''
|
|
66
|
+
);
|
|
67
|
+
const barStyle = $derived(`width: ${percent}%;`);
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<div
|
|
71
|
+
class="progress-wrapper"
|
|
72
|
+
style={wrapperStyle}
|
|
73
|
+
>
|
|
74
|
+
<!--
|
|
75
|
+
Native `<progress>` is kept as a fallback for assistive tech that
|
|
76
|
+
ignores ARIA progressbar roles. Visually hidden rather than
|
|
77
|
+
`display: none` so the element stays in the accessibility tree.
|
|
78
|
+
-->
|
|
79
|
+
<progress
|
|
80
|
+
class="visually-hidden"
|
|
81
|
+
value={current}
|
|
82
|
+
max={total}>{progress}</progress
|
|
83
|
+
>
|
|
84
|
+
|
|
85
|
+
<div
|
|
86
|
+
class="progress-background"
|
|
87
|
+
role="progressbar"
|
|
88
|
+
aria-valuenow={current}
|
|
89
|
+
aria-valuemin={0}
|
|
90
|
+
aria-valuemax={total}
|
|
91
|
+
aria-valuetext={progress}
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
class:fits={fitsInProgressBar}
|
|
95
|
+
class="progress-value"
|
|
96
|
+
bind:this={progressBarRef}
|
|
97
|
+
style={barStyle}
|
|
98
|
+
>
|
|
99
|
+
<span
|
|
100
|
+
class:fits={fitsInProgressBar}
|
|
101
|
+
class="progress-text">{progress}</span
|
|
102
|
+
>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
108
107
|
<style>.progress-wrapper {
|
|
109
108
|
width: 100%;
|
|
110
109
|
height: 100%;
|
|
@@ -173,4 +172,4 @@
|
|
|
173
172
|
}
|
|
174
173
|
.progress-text.fits {
|
|
175
174
|
color: var(--text-colour, #3a4952);
|
|
176
|
-
}</style>
|
|
175
|
+
}</style>
|
|
@@ -10,9 +10,9 @@ import type { BubbleColour } from './BubbleColour.js';
|
|
|
10
10
|
export interface ProgressBubbleProps {
|
|
11
11
|
/**
|
|
12
12
|
* Labelled `[current, total]` tuple. The first slot is the amount
|
|
13
|
-
* progressed; the second is the upper bound.
|
|
14
|
-
* `[number, number]
|
|
15
|
-
*
|
|
13
|
+
* progressed; the second is the upper bound. The labelled-tuple form
|
|
14
|
+
* compiles identically to `[number, number]` but surfaces the slot
|
|
15
|
+
* names in the editor's tooltip.
|
|
16
16
|
*/
|
|
17
17
|
value: [current: number, total: number];
|
|
18
18
|
/**
|