@lavalogic/scoria 0.33.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +58 -58
  2. package/dist/Components/AccordionGroup.svelte +44 -63
  3. package/dist/Components/AccordionGroup.svelte.d.ts +2 -25
  4. package/dist/Components/AccordionGroupButton.svelte +106 -114
  5. package/dist/Components/AccordionGroupButton.svelte.d.ts +2 -2
  6. package/dist/Components/AccordionGroupButtonProps.d.ts +21 -0
  7. package/dist/Components/AccordionGroupButtonProps.js +1 -0
  8. package/dist/Components/Action.svelte +138 -138
  9. package/dist/Components/AlertModal.svelte +125 -125
  10. package/dist/Components/Base/ContextWrapper.svelte +50 -50
  11. package/dist/Components/Base/Pagination.svelte +190 -190
  12. package/dist/Components/Base/Snippets.svelte +29 -29
  13. package/dist/Components/BigRadioSet.svelte +29 -29
  14. package/dist/Components/Bubble.svelte +77 -77
  15. package/dist/Components/Button.svelte +197 -197
  16. package/dist/Components/Checkbox.svelte +68 -68
  17. package/dist/Components/CollapsibleCard.svelte +70 -70
  18. package/dist/Components/Contexts/ContextMenu.svelte +157 -157
  19. package/dist/Components/Contexts/ContextMenuDivider.svelte +11 -11
  20. package/dist/Components/Contexts/ContextMenuOption.svelte +52 -52
  21. package/dist/Components/Contexts/Toast.svelte +61 -61
  22. package/dist/Components/Contexts/ToastContainer.svelte +46 -46
  23. package/dist/Components/Contexts/Tooltip.svelte +26 -26
  24. package/dist/Components/DataMatrixIcon.svelte +41 -41
  25. package/dist/Components/DateInput.svelte +109 -109
  26. package/dist/Components/DatePicker.svelte +312 -312
  27. package/dist/Components/DesktopModal.svelte +106 -106
  28. package/dist/Components/Dial.svelte +151 -151
  29. package/dist/Components/DimensionInput.svelte +184 -184
  30. package/dist/Components/DragMenu/DragMenuHolder.svelte +106 -106
  31. package/dist/Components/DragMenu/DraggableCard.svelte +41 -41
  32. package/dist/Components/FileCard.svelte +20 -20
  33. package/dist/Components/FileUpload.svelte +196 -196
  34. package/dist/Components/GridInput.svelte +190 -190
  35. package/dist/Components/GridInputSet.svelte +22 -22
  36. package/dist/Components/HorizontalTabGroup.svelte +78 -78
  37. package/dist/Components/HorizontalTabGroupButton.svelte +96 -96
  38. package/dist/Components/Icon.svelte +97 -97
  39. package/dist/Components/Icons.js +357 -357
  40. package/dist/Components/LoadingAnimation.svelte +32 -32
  41. package/dist/Components/LoadingModal.svelte +47 -47
  42. package/dist/Components/LoadingOverlay.svelte +27 -27
  43. package/dist/Components/Modal.svelte +251 -251
  44. package/dist/Components/MultiSelect.svelte +197 -197
  45. package/dist/Components/Nav/Nav.svelte +97 -97
  46. package/dist/Components/Nav/NavServiceMenuList.svelte +34 -34
  47. package/dist/Components/Nav/NavTab.svelte +91 -91
  48. package/dist/Components/Nav/ServiceMenuItem.svelte +91 -91
  49. package/dist/Components/Nav/ServicesNav.svelte +53 -53
  50. package/dist/Components/NumberInput.svelte +144 -144
  51. package/dist/Components/PageHeading.svelte +36 -36
  52. package/dist/Components/PasswordInput.svelte +73 -73
  53. package/dist/Components/Portal.svelte +25 -25
  54. package/dist/Components/ProgressBubble.svelte +80 -80
  55. package/dist/Components/QuerySelect.svelte +411 -411
  56. package/dist/Components/SingleSelect.svelte +261 -261
  57. package/dist/Components/StepButton.svelte +120 -120
  58. package/dist/Components/StepForm.svelte +108 -108
  59. package/dist/Components/Switch.svelte +36 -36
  60. package/dist/Components/Table/Body/QuickSearchCell.svelte +632 -632
  61. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +30 -30
  62. package/dist/Components/Table/Body/Rows/ColumnList.svelte +56 -56
  63. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +179 -179
  64. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +49 -49
  65. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +180 -180
  66. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +102 -102
  67. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +119 -119
  68. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +114 -114
  69. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +96 -96
  70. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +72 -72
  71. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +131 -131
  72. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +144 -144
  73. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +238 -238
  74. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +358 -358
  75. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +338 -338
  76. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +183 -183
  77. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +309 -309
  78. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +369 -369
  79. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +170 -170
  80. package/dist/Components/Table/Body/Rows/TableRow.svelte +259 -259
  81. package/dist/Components/Table/Body/TableBody.svelte +67 -67
  82. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +39 -39
  83. package/dist/Components/Table/Headers/SelectAllHeader.svelte +28 -28
  84. package/dist/Components/Table/Headers/TableHead.svelte +260 -260
  85. package/dist/Components/Table/Misc/ColumnPanel.svelte +78 -78
  86. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +99 -99
  87. package/dist/Components/Table/Misc/FilterInput.svelte +556 -556
  88. package/dist/Components/Table/Misc/FilterPanel.svelte +46 -46
  89. package/dist/Components/Table/Misc/FilterPanelModal.svelte +67 -67
  90. package/dist/Components/Table/Misc/SidePanel.svelte +32 -32
  91. package/dist/Components/Table/Misc/TableFooter.svelte +304 -304
  92. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +156 -156
  93. package/dist/Components/Table/Misc/TableSidebar.svelte +176 -176
  94. package/dist/Components/Table/Misc/ToolboxPanel.svelte +77 -77
  95. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +91 -91
  96. package/dist/Components/Table/NestedTable.svelte +84 -84
  97. package/dist/Components/Table/Table.svelte +492 -492
  98. package/dist/Components/Test/TestContextConsumer.svelte +13 -13
  99. package/dist/Components/TextArea.svelte +108 -108
  100. package/dist/Components/TextInput.svelte +147 -147
  101. package/dist/Components/ThreeStateRadio.svelte +124 -124
  102. package/dist/Components/Touch/BoolCard.svelte +52 -52
  103. package/dist/Components/Touch/DateModal.svelte +217 -217
  104. package/dist/Components/Touch/EditCard.svelte +52 -52
  105. package/dist/Components/Touch/InfoCard.svelte +24 -24
  106. package/dist/Components/Touch/InfoTextCard.svelte +21 -21
  107. package/dist/Components/Touch/ModalExplanation.svelte +20 -20
  108. package/dist/Components/Touch/NumberKeyboard.svelte +268 -268
  109. package/dist/Components/Touch/NumberModal.svelte +69 -69
  110. package/dist/Components/Touch/PlusMinusCard.svelte +50 -50
  111. package/dist/Components/Touch/SelectModal.svelte +105 -105
  112. package/dist/Components/Touch/SummaryCard.svelte +65 -65
  113. package/dist/Components/Touch/TextAreaModal.svelte +86 -86
  114. package/dist/Components/Touch/TextModal.svelte +123 -123
  115. package/dist/Components/Touch/TouchCard.svelte +28 -28
  116. package/dist/Components/Touch/TouchModal.svelte +259 -259
  117. package/dist/Components/Touch/UtilityButton.svelte +91 -91
  118. package/dist/Components/VerticalTabGroup.svelte +66 -66
  119. package/dist/Components/VerticalTabGroupButton.svelte +97 -97
  120. package/dist/Helpers/Datamatrix.d.ts +10 -10
  121. package/dist/Helpers/Datamatrix.js +1 -1
  122. package/dist/Helpers/Helpers.svelte.js +6 -4
  123. package/dist/Types/Examples/ExampleModal.svelte +34 -34
  124. package/dist/index.d.ts +1 -0
  125. package/dist/scss/_basics.scss +12 -12
  126. package/dist/scss/_colours.scss +134 -134
  127. package/dist/scss/_mixins.scss +3016 -3016
  128. package/dist/scss/_sizing.scss +69 -69
  129. package/dist/scss/_transitions.scss +8 -8
  130. package/package.json +2 -2
@@ -1,146 +1,146 @@
1
- <svelte:options runes />
2
-
3
- <script lang="ts">
4
- import { InputVariant } from '../Types/Internal/InputVariant.js';
5
- import { Size } from '../Types/Internal/Size.js';
6
- import Icon from './Icon.svelte';
7
- import type { NumberInputProps } from './NumberInputProps.js';
8
- let {
9
- id,
10
- value = $bindable(), // FIXME why is undefined allowed here?
11
- min,
12
- max,
13
- labelTop,
14
- labelRight,
15
- placeholder,
16
- required = false,
17
- variant = InputVariant.Default,
18
- decimal = false,
19
- invalid = false,
20
- showErrorColours = true,
21
- disabled,
22
- optional,
23
- leftIcon,
24
- rightIcon,
25
- onLeftIconClick,
26
- onRightIconClick,
27
-
28
- onblur,
29
- onfocus,
30
- onkeydown,
31
- oninput,
32
-
33
- inputRef = $bindable(),
34
- 'data-type': dataType,
35
- }: NumberInputProps = $props();
36
-
37
- // NOTE cannot alter signature because it's passed by a use: directive
38
- function numberValidator(_node: HTMLInputElement, _newValue: number | null) {
39
- return {
40
- update(newValue: number) {
41
- const underMinimum = min != undefined && min > newValue;
42
- const overMaximum = max != undefined && max < newValue;
43
-
44
- value = isNaN(newValue) ? 0 : underMinimum ? min : overMaximum ? max : newValue;
45
- },
46
- };
47
- }
48
-
49
- let isInvalid = $derived(
50
- showErrorColours && ((required && (value == null || value.toString().trim() === '')) || invalid)
51
- );
52
- </script>
53
-
54
- <div
55
- class="error-wrapper"
56
- class:for-modal={variant == InputVariant.Modal}
57
- class:for-table={variant == InputVariant.Table}
58
- >
59
- <label
60
- class:for-modal={variant == InputVariant.Modal}
61
- class:for-table={variant == InputVariant.Table}
62
- >
63
- {#if labelTop}
64
- <span
65
- class="top-label"
66
- class:for-default={variant === InputVariant.Default}
67
- class:invalid={isInvalid}
68
- >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
69
- >
70
- {#if variant === InputVariant.Default}
71
- <span
72
- class="border"
73
- class:invalid={isInvalid}
74
- >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
75
- >
76
- {/if}
77
- {/if}
78
- <!-- style="--background-colour: {leftIcon?.backgroundColour ?? rightIcon?.backgroundColour};" -->
79
- <div
80
- class="icon-container"
81
- class:for-modal={variant == InputVariant.Modal}
82
- >
83
- {#if leftIcon}
84
- <Icon
85
- name={leftIcon.name}
86
- size={leftIcon.size ?? Size.Medium}
87
- colour={leftIcon.colour}
88
- float
89
- left="0.75rem"
90
- top="50%"
91
- anchorX="0"
92
- anchorY="-50%"
93
- clickable={!!onLeftIconClick}
94
- onclick={onLeftIconClick}
95
- />
96
- {/if}
97
- <input
98
- {id}
99
- class:invalid={isInvalid}
100
- class:for-default={variant === InputVariant.Default}
101
- data-type={dataType}
102
- use:numberValidator={value}
103
- class:left-pad={leftIcon != undefined}
104
- class:right-pad={rightIcon != undefined || (labelRight && variant == InputVariant.Modal)}
105
- class:for-modal={variant == InputVariant.Modal}
106
- type="number"
107
- bind:value
108
- {onblur}
109
- {onfocus}
110
- {onkeydown}
111
- {oninput}
112
- bind:this={inputRef}
113
- {placeholder}
114
- {required}
115
- {disabled}
116
- {min}
117
- {max}
118
- step={decimal ? 0.01 : 1}
119
- />
120
- {#if rightIcon}
121
- <Icon
122
- name={rightIcon.name}
123
- size={rightIcon.size ?? Size.Medium}
124
- colour={rightIcon.colour}
125
- float
126
- right={variant == InputVariant.Modal ? '1rem' : '0.5rem'}
127
- top="50%"
128
- anchorX="0"
129
- anchorY="-50%"
130
- clickable={!!onRightIconClick}
131
- onclick={onRightIconClick}
132
- />
133
- {/if}
134
- {#if labelRight}
135
- <span
136
- class="right-label inset"
137
- class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
138
- >
139
- {/if}
140
- </div>
141
- </label>
142
- </div>
143
-
1
+ <svelte:options runes />
2
+
3
+ <script lang="ts">
4
+ import { InputVariant } from '../Types/Internal/InputVariant.js';
5
+ import { Size } from '../Types/Internal/Size.js';
6
+ import Icon from './Icon.svelte';
7
+ import type { NumberInputProps } from './NumberInputProps.js';
8
+ let {
9
+ id,
10
+ value = $bindable(), // FIXME why is undefined allowed here?
11
+ min,
12
+ max,
13
+ labelTop,
14
+ labelRight,
15
+ placeholder,
16
+ required = false,
17
+ variant = InputVariant.Default,
18
+ decimal = false,
19
+ invalid = false,
20
+ showErrorColours = true,
21
+ disabled,
22
+ optional,
23
+ leftIcon,
24
+ rightIcon,
25
+ onLeftIconClick,
26
+ onRightIconClick,
27
+
28
+ onblur,
29
+ onfocus,
30
+ onkeydown,
31
+ oninput,
32
+
33
+ inputRef = $bindable(),
34
+ 'data-type': dataType,
35
+ }: NumberInputProps = $props();
36
+
37
+ // NOTE cannot alter signature because it's passed by a use: directive
38
+ function numberValidator(_node: HTMLInputElement, _newValue: number | null) {
39
+ return {
40
+ update(newValue: number) {
41
+ const underMinimum = min != undefined && min > newValue;
42
+ const overMaximum = max != undefined && max < newValue;
43
+
44
+ value = isNaN(newValue) ? 0 : underMinimum ? min : overMaximum ? max : newValue;
45
+ },
46
+ };
47
+ }
48
+
49
+ let isInvalid = $derived(
50
+ showErrorColours && ((required && (value == null || value.toString().trim() === '')) || invalid)
51
+ );
52
+ </script>
53
+
54
+ <div
55
+ class="error-wrapper"
56
+ class:for-modal={variant == InputVariant.Modal}
57
+ class:for-table={variant == InputVariant.Table}
58
+ >
59
+ <label
60
+ class:for-modal={variant == InputVariant.Modal}
61
+ class:for-table={variant == InputVariant.Table}
62
+ >
63
+ {#if labelTop}
64
+ <span
65
+ class="top-label"
66
+ class:for-default={variant === InputVariant.Default}
67
+ class:invalid={isInvalid}
68
+ >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
69
+ >
70
+ {#if variant === InputVariant.Default}
71
+ <span
72
+ class="border"
73
+ class:invalid={isInvalid}
74
+ >{labelTop}{#if optional}<i>&nbsp;- optional</i>{/if}</span
75
+ >
76
+ {/if}
77
+ {/if}
78
+ <!-- style="--background-colour: {leftIcon?.backgroundColour ?? rightIcon?.backgroundColour};" -->
79
+ <div
80
+ class="icon-container"
81
+ class:for-modal={variant == InputVariant.Modal}
82
+ >
83
+ {#if leftIcon}
84
+ <Icon
85
+ name={leftIcon.name}
86
+ size={leftIcon.size ?? Size.Medium}
87
+ colour={leftIcon.colour}
88
+ float
89
+ left="0.75rem"
90
+ top="50%"
91
+ anchorX="0"
92
+ anchorY="-50%"
93
+ clickable={!!onLeftIconClick}
94
+ onclick={onLeftIconClick}
95
+ />
96
+ {/if}
97
+ <input
98
+ {id}
99
+ class:invalid={isInvalid}
100
+ class:for-default={variant === InputVariant.Default}
101
+ data-type={dataType}
102
+ use:numberValidator={value}
103
+ class:left-pad={leftIcon != undefined}
104
+ class:right-pad={rightIcon != undefined || (labelRight && variant == InputVariant.Modal)}
105
+ class:for-modal={variant == InputVariant.Modal}
106
+ type="number"
107
+ bind:value
108
+ {onblur}
109
+ {onfocus}
110
+ {onkeydown}
111
+ {oninput}
112
+ bind:this={inputRef}
113
+ {placeholder}
114
+ {required}
115
+ {disabled}
116
+ {min}
117
+ {max}
118
+ step={decimal ? 0.01 : 1}
119
+ />
120
+ {#if rightIcon}
121
+ <Icon
122
+ name={rightIcon.name}
123
+ size={rightIcon.size ?? Size.Medium}
124
+ colour={rightIcon.colour}
125
+ float
126
+ right={variant == InputVariant.Modal ? '1rem' : '0.5rem'}
127
+ top="50%"
128
+ anchorX="0"
129
+ anchorY="-50%"
130
+ clickable={!!onRightIconClick}
131
+ onclick={onRightIconClick}
132
+ />
133
+ {/if}
134
+ {#if labelRight}
135
+ <span
136
+ class="right-label inset"
137
+ class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
138
+ >
139
+ {/if}
140
+ </div>
141
+ </label>
142
+ </div>
143
+
144
144
  <style>input {
145
145
  box-sizing: border-box;
146
146
  height: 100%;
@@ -380,4 +380,4 @@ input::-webkit-outer-spin-button,
380
380
  input::-webkit-inner-spin-button {
381
381
  -webkit-appearance: none;
382
382
  margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
383
- }</style>
383
+ }</style>
@@ -1,38 +1,38 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- lang="ts"
5
- module
6
- >
7
- import type { Snippet } from 'svelte';
8
-
9
- export interface PageHeadingProps {
10
- children: Snippet;
11
- subtitle?: Snippet | undefined;
12
- extras?: Snippet | undefined;
13
- }
14
- </script>
15
-
16
- <script lang="ts">
17
- let { children, subtitle, extras }: PageHeadingProps = $props();
18
- </script>
19
-
20
- <div class="outer">
21
- <div class="column">
22
- <h1>{@render children()}</h1>
23
- <div class="one-line">
24
- {#if subtitle}
25
- {@render subtitle()}
26
- {/if}
27
- </div>
28
- </div>
29
- {#if extras}
30
- <div class="buttons">
31
- {@render extras()}
32
- </div>
33
- {/if}
34
- </div>
35
-
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ lang="ts"
5
+ module
6
+ >
7
+ import type { Snippet } from 'svelte';
8
+
9
+ export interface PageHeadingProps {
10
+ children: Snippet;
11
+ subtitle?: Snippet | undefined;
12
+ extras?: Snippet | undefined;
13
+ }
14
+ </script>
15
+
16
+ <script lang="ts">
17
+ let { children, subtitle, extras }: PageHeadingProps = $props();
18
+ </script>
19
+
20
+ <div class="outer">
21
+ <div class="column">
22
+ <h1>{@render children()}</h1>
23
+ <div class="one-line">
24
+ {#if subtitle}
25
+ {@render subtitle()}
26
+ {/if}
27
+ </div>
28
+ </div>
29
+ {#if extras}
30
+ <div class="buttons">
31
+ {@render extras()}
32
+ </div>
33
+ {/if}
34
+ </div>
35
+
36
36
  <style>.outer {
37
37
  padding: 1.5rem;
38
38
  display: flex;
@@ -76,4 +76,4 @@
76
76
  fill: #647d8e;
77
77
  color: #647d8e;
78
78
  font-size: 0.875rem;
79
- }</style>
79
+ }</style>
@@ -1,75 +1,75 @@
1
- <svelte:options runes />
2
-
3
- <script lang="ts">
4
- import { ColourSet } from '../scss/colours.js';
5
- import { Size } from '../Types/Internal/Size.js';
6
- import Action from './Action.svelte';
7
- import Icon from './Icon.svelte';
8
- import type { InputProps } from './InputProps.js';
9
- let {
10
- value = $bindable(''),
11
- label = undefined,
12
- placeholder = undefined,
13
- required = false,
14
- disabled = undefined,
15
- showInput = $bindable(false),
16
- leftIcon = undefined,
17
- inputRef = $bindable(),
18
- ...inputEvents
19
- }: InputProps = $props();
20
-
21
- // let inputRef: HTMLInputElement | undefined = undefined;
22
-
23
- function toggleVisibility() {
24
- showInput = !showInput;
25
- inputRef?.focus();
26
- }
27
- </script>
28
-
29
- <div class="error-wrapper">
30
- <label>
31
- {#if label}
32
- <span class="for-default">{label}</span>
33
- <span class="border">{label}</span>
34
- {/if}
35
- <!-- style="--background-colour: {leftIcon?.backgroundColour};" -->
36
- <div class="icon-container">
37
- {#if leftIcon}
38
- <Icon
39
- name={leftIcon.name}
40
- size={leftIcon.size ?? Size.Medium}
41
- float
42
- left="0.75rem"
43
- top="50%"
44
- anchorX="0"
45
- anchorY="-50%"
46
- />
47
- {/if}
48
- <input
49
- class="for-default"
50
- {...inputEvents}
51
- class:left-pad={leftIcon != undefined}
52
- class:right-pad={true}
53
- {...{ type: showInput ? 'text' : 'password' }}
54
- bind:value
55
- bind:this={inputRef}
56
- {placeholder}
57
- {required}
58
- {disabled}
59
- />
60
-
61
- <div class="right-icon">
62
- <Action
63
- colourSet={showInput ? ColourSet.Secondary : ColourSet.Auxiliary}
64
- icon={{ name: 'assessment' }}
65
- size={Size.MediumSmall}
66
- onclick={toggleVisibility}
67
- />
68
- </div>
69
- </div>
70
- </label>
71
- </div>
72
-
1
+ <svelte:options runes />
2
+
3
+ <script lang="ts">
4
+ import { ColourSet } from '../scss/colours.js';
5
+ import { Size } from '../Types/Internal/Size.js';
6
+ import Action from './Action.svelte';
7
+ import Icon from './Icon.svelte';
8
+ import type { InputProps } from './InputProps.js';
9
+ let {
10
+ value = $bindable(''),
11
+ label = undefined,
12
+ placeholder = undefined,
13
+ required = false,
14
+ disabled = undefined,
15
+ showInput = $bindable(false),
16
+ leftIcon = undefined,
17
+ inputRef = $bindable(),
18
+ ...inputEvents
19
+ }: InputProps = $props();
20
+
21
+ // let inputRef: HTMLInputElement | undefined = undefined;
22
+
23
+ function toggleVisibility() {
24
+ showInput = !showInput;
25
+ inputRef?.focus();
26
+ }
27
+ </script>
28
+
29
+ <div class="error-wrapper">
30
+ <label>
31
+ {#if label}
32
+ <span class="for-default">{label}</span>
33
+ <span class="border">{label}</span>
34
+ {/if}
35
+ <!-- style="--background-colour: {leftIcon?.backgroundColour};" -->
36
+ <div class="icon-container">
37
+ {#if leftIcon}
38
+ <Icon
39
+ name={leftIcon.name}
40
+ size={leftIcon.size ?? Size.Medium}
41
+ float
42
+ left="0.75rem"
43
+ top="50%"
44
+ anchorX="0"
45
+ anchorY="-50%"
46
+ />
47
+ {/if}
48
+ <input
49
+ class="for-default"
50
+ {...inputEvents}
51
+ class:left-pad={leftIcon != undefined}
52
+ class:right-pad={true}
53
+ {...{ type: showInput ? 'text' : 'password' }}
54
+ bind:value
55
+ bind:this={inputRef}
56
+ {placeholder}
57
+ {required}
58
+ {disabled}
59
+ />
60
+
61
+ <div class="right-icon">
62
+ <Action
63
+ colourSet={showInput ? ColourSet.Secondary : ColourSet.Auxiliary}
64
+ icon={{ name: 'assessment' }}
65
+ size={Size.MediumSmall}
66
+ onclick={toggleVisibility}
67
+ />
68
+ </div>
69
+ </div>
70
+ </label>
71
+ </div>
72
+
73
73
  <style>input {
74
74
  box-sizing: border-box;
75
75
  height: 100%;
@@ -303,4 +303,4 @@ label.for-table input {
303
303
 
304
304
  td {
305
305
  --input-border: none;
306
- }</style>
306
+ }</style>
@@ -1,25 +1,25 @@
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
-
11
- $effect(() => {
12
- if (target && ref) {
13
- target.appendChild(ref);
14
- }
15
-
16
- return () => {
17
- ref?.parentNode?.removeChild(ref);
18
- };
19
- });
20
- // this block is almost needless/useless (if not totally) as, on destroy, the ref will no longer exist/be in the DOM anyways
21
- </script>
22
-
23
- <div bind:this={ref}>
24
- {@render children()}
25
- </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
+
11
+ $effect(() => {
12
+ if (target && ref) {
13
+ target.appendChild(ref);
14
+ }
15
+
16
+ return () => {
17
+ ref?.parentNode?.removeChild(ref);
18
+ };
19
+ });
20
+ // this block is almost needless/useless (if not totally) as, on destroy, the ref will no longer exist/be in the DOM anyways
21
+ </script>
22
+
23
+ <div bind:this={ref}>
24
+ {@render children()}
25
+ </div>