@lavalogic/scoria 0.22.3 → 0.22.4
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/dist/Components/FileUpload.svelte +13 -5
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +4 -3
- package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +4 -3
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +2 -2
- package/dist/Components/Table/Types/Coordinates/CellCoordinates.d.ts +2 -1
- package/dist/Components/Table/Types/Coordinates/ColumnIndices.d.ts +8 -0
- package/dist/Components/Table/Types/Coordinates/ColumnIndices.js +1 -0
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
inputRef = $bindable(),
|
|
35
35
|
onblur,
|
|
36
|
-
onfocus
|
|
36
|
+
onfocus,
|
|
37
37
|
}: FileUploadProps = $props();
|
|
38
38
|
|
|
39
39
|
function onchange(e: Event & { currentTarget: EventTarget & HTMLInputElement }) {
|
|
@@ -90,7 +90,9 @@
|
|
|
90
90
|
<!-- HACK removed label for modals for now because I couldn't think of a decent style that doesn't interfere with scrolling -->
|
|
91
91
|
{#if labelTop && variant !== InputVariant.Modal}
|
|
92
92
|
<!-- <span class="top-label" class:invalid={isInvalid}>{labelTop}{#if optional}<i> - optional</i>{/if}</span> -->
|
|
93
|
-
<span
|
|
93
|
+
<span
|
|
94
|
+
class="top-label"
|
|
95
|
+
class:for-default={variant === InputVariant.Default}
|
|
94
96
|
>{labelTop}{#if optional}<i> - optional</i>{/if}</span
|
|
95
97
|
>
|
|
96
98
|
{#if variant === InputVariant.Default}
|
|
@@ -100,7 +102,10 @@
|
|
|
100
102
|
{/if}
|
|
101
103
|
{/if}
|
|
102
104
|
<!-- style="--background-colour: {leftIcon?.backgroundColour ?? rightIcon?.backgroundColour};" -->
|
|
103
|
-
<div
|
|
105
|
+
<div
|
|
106
|
+
class="icon-container"
|
|
107
|
+
class:for-modal={variant == InputVariant.Modal}
|
|
108
|
+
>
|
|
104
109
|
{#if leftIcon}
|
|
105
110
|
<Icon
|
|
106
111
|
name={leftIcon.name}
|
|
@@ -157,7 +162,7 @@
|
|
|
157
162
|
colourSet={ColourSet.Secondary}
|
|
158
163
|
backgroundColour="transparent"
|
|
159
164
|
icon={{ name: 'upload' }}
|
|
160
|
-
label="
|
|
165
|
+
label="Upload"
|
|
161
166
|
size={Size.Medium}
|
|
162
167
|
onclick={() => {
|
|
163
168
|
a();
|
|
@@ -180,7 +185,10 @@
|
|
|
180
185
|
/>
|
|
181
186
|
{/if}
|
|
182
187
|
{#if labelRight}
|
|
183
|
-
<span
|
|
188
|
+
<span
|
|
189
|
+
class="right-label"
|
|
190
|
+
class:for-modal={variant == InputVariant.Modal}>{labelRight}</span
|
|
191
|
+
>
|
|
184
192
|
{/if}
|
|
185
193
|
</div>
|
|
186
194
|
</label>
|
|
@@ -6,11 +6,12 @@ import type { FilterValueType } from '../../Filtering/FilterValueType.js';
|
|
|
6
6
|
import { ColumnType } from '../ColumnType.js';
|
|
7
7
|
import type { AccessorFn } from './AccessorFn.js';
|
|
8
8
|
import type { ValidationFn } from './ValidationFn.js';
|
|
9
|
+
import type { MemoryColumnIndex } from '../../Coordinates/ColumnIndices.js';
|
|
9
10
|
export interface ColumnDefProps<T extends object, in FilterFnType, out OptionsType> {
|
|
10
11
|
id: string;
|
|
11
12
|
header: string | Snippet;
|
|
12
13
|
debug?: boolean;
|
|
13
|
-
index?:
|
|
14
|
+
index?: MemoryColumnIndex;
|
|
14
15
|
allowFiltering?: boolean;
|
|
15
16
|
allowSorting?: boolean;
|
|
16
17
|
defaultHidden?: boolean;
|
|
@@ -30,8 +31,8 @@ export declare abstract class ColumnDef<T extends object, in FilterFnType = neve
|
|
|
30
31
|
readonly id: string;
|
|
31
32
|
debug: boolean;
|
|
32
33
|
private _index;
|
|
33
|
-
get index():
|
|
34
|
-
set index(v:
|
|
34
|
+
get index(): MemoryColumnIndex;
|
|
35
|
+
set index(v: MemoryColumnIndex);
|
|
35
36
|
abstract readonly columnType: ColumnType;
|
|
36
37
|
readonly defaultHidden: boolean;
|
|
37
38
|
readonly allowSorting: boolean;
|
|
@@ -8,6 +8,7 @@ import type { DefsWrapper } from '../Columns/DefsWrapper.js';
|
|
|
8
8
|
import type { VisibilityState } from '../Columns/VisibilityState.js';
|
|
9
9
|
import type { CellCoordinates } from '../Coordinates/CellCoordinates.js';
|
|
10
10
|
import type { CellCoordinatesWithoutColumn } from '../Coordinates/CellCoordinatesWithoutColumn.js';
|
|
11
|
+
import type { VisualColumnIndex } from '../Coordinates/ColumnIndices.js';
|
|
11
12
|
import type { IDataRepository } from '../DataRepository/IDataRepository.js';
|
|
12
13
|
import type { ColumnFiltersState } from '../Filtering/ColumnFiltersState.js';
|
|
13
14
|
import type { CustomRemoteFilters } from '../Filtering/CustomRemoteFilters.js';
|
|
@@ -231,9 +232,9 @@ export declare class TableContext<T extends object, RowIdType extends Primitive>
|
|
|
231
232
|
*/
|
|
232
233
|
private get _visualColumns();
|
|
233
234
|
/** Returns the visual index of the column with the given id, or -1 if not found. */
|
|
234
|
-
columnVisualIndex(id: string):
|
|
235
|
-
get focusStartVisualColumn():
|
|
236
|
-
get focusEndVisualColumn():
|
|
235
|
+
columnVisualIndex(id: string): VisualColumnIndex;
|
|
236
|
+
get focusStartVisualColumn(): VisualColumnIndex;
|
|
237
|
+
get focusEndVisualColumn(): VisualColumnIndex;
|
|
237
238
|
private _moveFocusEndRow;
|
|
238
239
|
private _moveFocusRow;
|
|
239
240
|
private getHighlightedRowData;
|
|
@@ -1572,8 +1572,8 @@ export class TableContext {
|
|
|
1572
1572
|
// newColumns[i].index += 1;
|
|
1573
1573
|
// }
|
|
1574
1574
|
if (originalIndex > dropTargetIndex && !targetIsLI(dropTarget)) {
|
|
1575
|
-
newDefs[dropTargetIndex].index
|
|
1576
|
-
this.dragTarget.index = newDefs[dropTargetIndex].index - 1;
|
|
1575
|
+
newDefs[dropTargetIndex].index = (newDefs[dropTargetIndex].index + 1);
|
|
1576
|
+
this.dragTarget.index = (newDefs[dropTargetIndex].index - 1);
|
|
1577
1577
|
newDefs.push(this.dragTarget);
|
|
1578
1578
|
}
|
|
1579
1579
|
else {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Position of a column in the `columnDefs` array (memory order). */
|
|
2
|
+
export type MemoryColumnIndex = number & {
|
|
3
|
+
readonly __brand: 'MemoryColumnIndex';
|
|
4
|
+
};
|
|
5
|
+
/** Position of a column in the visual display order (pinned-left → center → pinned-right). */
|
|
6
|
+
export type VisualColumnIndex = number & {
|
|
7
|
+
readonly __brand: 'VisualColumnIndex';
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|