@lavalogic/scoria 0.12.2 → 0.12.3
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/Base/ContextWrapper.svelte +16 -1
- package/dist/Components/Base/ContextWrapper.svelte.d.ts +13 -0
- package/dist/Components/TabGroupButtonProps.d.ts +1 -1
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +3 -3
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte.d.ts +12 -12
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponentProps.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte.d.ts +11 -11
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +3 -3
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte.d.ts +12 -12
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte.d.ts +11 -11
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +3 -3
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte.d.ts +12 -12
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCellProps.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +3 -2
- package/dist/Components/Table/Body/Rows/Columns/RowSelectionColumn.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/RowSelectionColumn.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/RowSelectionTableCell.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/RowSelectionTableCell.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +3 -2
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte.d.ts +2 -1
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +12 -6
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte.d.ts +14 -14
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +2 -1
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +3 -2
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte.d.ts +2 -1
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +2 -1
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +4 -3
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte.d.ts +2 -1
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +2 -1
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +3 -3
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte.d.ts +12 -12
- package/dist/Components/Table/Body/Rows/Columns/TableTextInputProps.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +4 -4
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte.d.ts +12 -12
- package/dist/Components/Table/Body/Rows/Columns/ValidityCellProps.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/TableRow.svelte +1 -1
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.d.ts +1 -1
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +14 -0
- package/dist/Components/Table/Types/Columns/Column.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +6 -6
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +3 -3
- package/dist/Components/Table/Types/Columns/DefsWrapper.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/ProgressBarTableCell.d.ts +2 -1
- package/dist/Components/Table/Types/Columns/TableCell.d.ts +2 -2
- package/dist/Components/Table/Types/Filtering/CustomFilterFn.d.ts +1 -1
- package/dist/Components/Table/Types/Filtering/FilterFn.d.ts +1 -1
- package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.d.ts +5 -4
- package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.js +7 -1
- package/dist/Components/VerticalTabGroupButton.svelte +1 -1
- package/dist/Components/VerticalTabGroupButton.svelte.d.ts +5 -5
- package/dist/Components/VerticalTabGroupProps.d.ts +2 -2
- package/dist/Contexts/ToastContext.svelte.d.ts +3 -1
- package/dist/Contexts/ToastContext.svelte.js +2 -2
- package/dist/Helpers/Helpers.svelte.d.ts +1 -2
- package/dist/Types/Examples/ExampleModal.svelte +2 -2
- package/dist/Types/Examples/ExampleModal.svelte.d.ts +23 -2
- package/dist/Types/Internal/TabOption.d.ts +1 -1
- package/package.json +15 -15
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import QuerySelect from '../../../../QuerySelect.svelte';
|
|
6
6
|
import type { QueryDef } from '../../../Types/Columns/Definitions/Accessors/QueryDef.svelte.js';
|
|
7
7
|
import { TableContext } from '../../../Types/Context/TableContext.svelte.js';
|
|
8
|
+
import type { SelectFilterValueType } from '../../../Types/Filtering/FilterFn.js';
|
|
8
9
|
import { TableFocusDetails } from '../../../Types/Focus/TableFocusDetails.svelte.js';
|
|
9
10
|
import { ToastContext } from '../../../../../Contexts/ToastContext.svelte.js';
|
|
10
11
|
import { devCatch } from '../../../../../Helpers/Helpers.svelte.js';
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
});
|
|
103
104
|
});
|
|
104
105
|
|
|
105
|
-
const focusDetails: TableFocusDetails<T
|
|
106
|
+
const focusDetails: TableFocusDetails<T, SelectFilterValueType<T>> = $derived(
|
|
106
107
|
new TableFocusDetails(cell, tableContext, toast)
|
|
107
108
|
);
|
|
108
109
|
|
|
@@ -4,25 +4,26 @@
|
|
|
4
4
|
import type { RowSelectionDef } from '../../../Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js';
|
|
5
5
|
import type { TableCell } from '../../../Types/Columns/TableCell.js';
|
|
6
6
|
import { TableContext } from '../../../Types/Context/TableContext.svelte.js';
|
|
7
|
+
import type { BoolFilterValueType } from '../../../Types/Filtering/FilterFn.js';
|
|
7
8
|
import { TableFocusDetails } from '../../../Types/Focus/TableFocusDetails.svelte.js';
|
|
8
9
|
import { ToastContext } from '../../../../../Contexts/ToastContext.svelte.js';
|
|
9
10
|
import { getContext } from 'svelte';
|
|
10
11
|
import type { ChangeEventHandler } from 'svelte/elements';
|
|
11
12
|
|
|
12
13
|
export interface TableCheckboxProps<T extends object> {
|
|
13
|
-
cell: TableCell<T>;
|
|
14
|
+
cell: TableCell<T, BoolFilterValueType>;
|
|
14
15
|
|
|
15
16
|
onchange?: ChangeEventHandler<HTMLInputElement>;
|
|
16
17
|
}
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
|
-
<script lang="ts" generics="T extends object">
|
|
20
|
+
<script lang="ts" generics="T extends object,">
|
|
20
21
|
const { cell, onchange: parentOnchange }: TableCheckboxProps<T> = $props();
|
|
21
22
|
|
|
22
23
|
const tableContext = getContext<TableContext<T>>(TableContext.identifier);
|
|
23
24
|
const toastContext = getContext<ToastContext>(ToastContext.identifier);
|
|
24
25
|
|
|
25
|
-
const focusDetails: TableFocusDetails<T> = $derived(
|
|
26
|
+
const focusDetails: TableFocusDetails<T, BoolFilterValueType> = $derived(
|
|
26
27
|
new TableFocusDetails(cell, tableContext, toastContext.toast)
|
|
27
28
|
);
|
|
28
29
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { TableCell } from '../../../Types/Columns/TableCell.js';
|
|
2
|
+
import type { BoolFilterValueType } from '../../../Types/Filtering/FilterFn.js';
|
|
2
3
|
import type { ChangeEventHandler } from 'svelte/elements';
|
|
3
4
|
export interface TableCheckboxProps<T extends object> {
|
|
4
|
-
cell: TableCell<T>;
|
|
5
|
+
cell: TableCell<T, BoolFilterValueType>;
|
|
5
6
|
onchange?: ChangeEventHandler<HTMLInputElement>;
|
|
6
7
|
}
|
|
7
8
|
declare function $$render<T extends object>(): {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { dev } from '$app/environment';
|
|
5
5
|
import SingleSelect from '../../../../SingleSelect.svelte';
|
|
6
6
|
import { TableContext } from '../../../Types/Context/TableContext.svelte.js';
|
|
7
|
+
import type { SelectFilterValueType } from '../../../Types/Filtering/FilterFn.js';
|
|
7
8
|
import { TableFocusDetails } from '../../../Types/Focus/TableFocusDetails.svelte.js';
|
|
8
9
|
import { ToastContext } from '../../../../../Contexts/ToastContext.svelte.js';
|
|
9
10
|
import { devCatch } from '../../../../../Helpers/Helpers.svelte.js';
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
})().catch(devCatch);
|
|
59
60
|
});
|
|
60
61
|
|
|
61
|
-
const focusDetails: TableFocusDetails<T> = $derived(
|
|
62
|
+
const focusDetails: TableFocusDetails<T, SelectFilterValueType<T> | undefined> = $derived(
|
|
62
63
|
new TableFocusDetails(cell, tableContext, toast)
|
|
63
64
|
);
|
|
64
65
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script lang="ts" generics="T extends object">
|
|
3
|
+
<script lang="ts" generics="T extends object,FilterValueType">
|
|
4
4
|
import { dev } from '$app/environment';
|
|
5
5
|
|
|
6
6
|
import { TableContext } from '../../../Types/Context/TableContext.svelte.js';
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { getContext, tick, untrack } from 'svelte';
|
|
14
14
|
import type { TableTextInputProps } from './TableTextInputProps.js';
|
|
15
15
|
|
|
16
|
-
const { cell }: TableTextInputProps<T> = $props();
|
|
16
|
+
const { cell }: TableTextInputProps<T, FilterValueType> = $props();
|
|
17
17
|
|
|
18
18
|
// const columnDef: ITextInputColumnAccessorDef<T> = $derived(
|
|
19
19
|
// getNumberColumnDefOrError(cell.column.columnDef)
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
const tableContext = getContext<TableContext<T>>(TableContext.identifier);
|
|
60
60
|
const toastContext = getContext<ToastContext>(ToastContext.identifier);
|
|
61
61
|
|
|
62
|
-
const focusDetails: TableFocusDetails<T> = $derived(
|
|
62
|
+
const focusDetails: TableFocusDetails<T, never> = $derived(
|
|
63
63
|
new TableFocusDetails(cell, tableContext, toastContext.toast)
|
|
64
64
|
);
|
|
65
65
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type { TableTextInputProps } from './TableTextInputProps.js';
|
|
2
|
-
declare function $$render<T extends object>(): {
|
|
3
|
-
props: TableTextInputProps<T>;
|
|
2
|
+
declare function $$render<T extends object, FilterValueType>(): {
|
|
3
|
+
props: TableTextInputProps<T, FilterValueType>;
|
|
4
4
|
exports: {};
|
|
5
5
|
bindings: "";
|
|
6
6
|
slots: {};
|
|
7
7
|
events: {};
|
|
8
8
|
};
|
|
9
|
-
declare class __sveltets_Render<T extends object> {
|
|
10
|
-
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
-
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
-
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
9
|
+
declare class __sveltets_Render<T extends object, FilterValueType> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T, FilterValueType>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T, FilterValueType>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T, FilterValueType>>['slots'];
|
|
13
13
|
bindings(): "";
|
|
14
14
|
exports(): {};
|
|
15
15
|
}
|
|
16
16
|
interface $$IsomorphicComponent {
|
|
17
|
-
new <T extends object>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
18
|
-
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
-
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
-
<T extends object>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
-
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
17
|
+
new <T extends object, FilterValueType>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T, FilterValueType>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T, FilterValueType>['props']>, ReturnType<__sveltets_Render<T, FilterValueType>['events']>, ReturnType<__sveltets_Render<T, FilterValueType>['slots']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T, FilterValueType>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T, FilterValueType>['exports']>;
|
|
20
|
+
<T extends object, FilterValueType>(internal: unknown, props: ReturnType<__sveltets_Render<T, FilterValueType>['props']> & {}): ReturnType<__sveltets_Render<T, FilterValueType>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
|
|
22
22
|
}
|
|
23
23
|
declare const TableTextInput: $$IsomorphicComponent;
|
|
24
|
-
type TableTextInput<T extends object> = InstanceType<typeof TableTextInput<T>>;
|
|
24
|
+
type TableTextInput<T extends object, FilterValueType> = InstanceType<typeof TableTextInput<T, FilterValueType>>;
|
|
25
25
|
export default TableTextInput;
|
|
@@ -36,18 +36,18 @@
|
|
|
36
36
|
let previousFocusElement: HTMLElement | undefined = $state();
|
|
37
37
|
</script>
|
|
38
38
|
|
|
39
|
-
<script lang="ts" generics="T extends object">
|
|
39
|
+
<script lang="ts" generics="T extends object, FilterValueType">
|
|
40
40
|
import { getContext, tick, untrack } from 'svelte';
|
|
41
41
|
import type { ValidityCellProps } from './ValidityCellProps.js';
|
|
42
42
|
|
|
43
|
-
const { cell }: ValidityCellProps<T> = $props();
|
|
43
|
+
const { cell }: ValidityCellProps<T, FilterValueType> = $props();
|
|
44
44
|
|
|
45
45
|
const tableContext = getContext<TableContext<T>>(TableContext.identifier);
|
|
46
46
|
const { toast } = getContext<ToastContext>(ToastContext.identifier);
|
|
47
47
|
|
|
48
|
-
const ColumnDef = $derived(cell.column.columnDef as AbstractDisplayDef<T>);
|
|
48
|
+
const ColumnDef = $derived(cell.column.columnDef as AbstractDisplayDef<T, FilterValueType>);
|
|
49
49
|
|
|
50
|
-
const focusDetails: TableFocusDetails<T> = $derived(
|
|
50
|
+
const focusDetails: TableFocusDetails<T, FilterValueType> = $derived(
|
|
51
51
|
new TableFocusDetails(cell, tableContext, toast)
|
|
52
52
|
);
|
|
53
53
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type { ValidityCellProps } from './ValidityCellProps.js';
|
|
2
|
-
declare function $$render<T extends object>(): {
|
|
3
|
-
props: ValidityCellProps<T>;
|
|
2
|
+
declare function $$render<T extends object, FilterValueType>(): {
|
|
3
|
+
props: ValidityCellProps<T, FilterValueType>;
|
|
4
4
|
exports: {};
|
|
5
5
|
bindings: "";
|
|
6
6
|
slots: {};
|
|
7
7
|
events: {};
|
|
8
8
|
};
|
|
9
|
-
declare class __sveltets_Render<T extends object> {
|
|
10
|
-
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
-
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
-
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
9
|
+
declare class __sveltets_Render<T extends object, FilterValueType> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T, FilterValueType>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T, FilterValueType>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T, FilterValueType>>['slots'];
|
|
13
13
|
bindings(): "";
|
|
14
14
|
exports(): {};
|
|
15
15
|
}
|
|
16
16
|
interface $$IsomorphicComponent {
|
|
17
|
-
new <T extends object>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
18
|
-
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
-
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
-
<T extends object>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
-
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
17
|
+
new <T extends object, FilterValueType>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T, FilterValueType>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T, FilterValueType>['props']>, ReturnType<__sveltets_Render<T, FilterValueType>['events']>, ReturnType<__sveltets_Render<T, FilterValueType>['slots']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T, FilterValueType>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T, FilterValueType>['exports']>;
|
|
20
|
+
<T extends object, FilterValueType>(internal: unknown, props: ReturnType<__sveltets_Render<T, FilterValueType>['props']> & {}): ReturnType<__sveltets_Render<T, FilterValueType>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
|
|
22
22
|
}
|
|
23
23
|
declare const ValidityCell: $$IsomorphicComponent;
|
|
24
|
-
type ValidityCell<T extends object> = InstanceType<typeof ValidityCell<T>>;
|
|
24
|
+
type ValidityCell<T extends object, FilterValueType> = InstanceType<typeof ValidityCell<T, FilterValueType>>;
|
|
25
25
|
export default ValidityCell;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
const hoverable = $derived(tableContext.changeColourOnHover);
|
|
20
20
|
|
|
21
21
|
//HACK converted this from derived to state+deffect because otherwise this throws an unsafe mutation error deeper down the stack
|
|
22
|
-
const cells: Array<TableCell<T>> = $derived(
|
|
22
|
+
const cells: Array<TableCell<T, never>> = $derived(
|
|
23
23
|
side === 'left'
|
|
24
24
|
? row.getLeftVisibleCells()
|
|
25
25
|
: side === 'right'
|
|
@@ -2,4 +2,4 @@ import type { ExampleItem } from '../../../Types/Examples/ExampleItem.js';
|
|
|
2
2
|
import { type Component } from 'svelte';
|
|
3
3
|
import type { DisplayDefModalProps } from '../Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js';
|
|
4
4
|
import type { DefsWrapper } from '../Types/Columns/DefsWrapper.js';
|
|
5
|
-
export declare function generateExampleItemColumnDefs(modal: Component<DisplayDefModalProps<ExampleItem>, object, ''>): DefsWrapper<ExampleItem>;
|
|
5
|
+
export declare function generateExampleItemColumnDefs(modal: Component<DisplayDefModalProps<ExampleItem, never>, object, ''>): DefsWrapper<ExampleItem>;
|
|
@@ -13,8 +13,22 @@ import { BubbleDef } from '../Types/Columns/Definitions/Display/BubbleDef.svelte
|
|
|
13
13
|
import { DisplayDef } from '../Types/Columns/Definitions/Display/DisplayDef.svelte.js';
|
|
14
14
|
import { ProgressBarDef } from '../Types/Columns/Definitions/Display/ProgressBarDef.svelte.js';
|
|
15
15
|
import { ValidityDef } from '../Types/Columns/Definitions/Display/ValidityDef.svelte.js';
|
|
16
|
+
import { ExpandDef } from '../Types/Columns/Definitions/Expand/ExpandDef.svelte.js';
|
|
16
17
|
export function generateExampleItemColumnDefs(modal) {
|
|
17
18
|
let defs = $state([
|
|
19
|
+
new ExpandDef({
|
|
20
|
+
accessorFn: (it) => [it],
|
|
21
|
+
getInnerColumnDefs: () => generateExampleItemColumnDefs(modal),
|
|
22
|
+
header: 'Expand Cell',
|
|
23
|
+
id: 'expand',
|
|
24
|
+
headerIcon: 'access-token',
|
|
25
|
+
innerTableName: 'expand-inner',
|
|
26
|
+
innerTableOptions: {
|
|
27
|
+
selectionExtractor: (item) => item.id,
|
|
28
|
+
getUserId: () => '1'
|
|
29
|
+
},
|
|
30
|
+
isEnabled: () => true
|
|
31
|
+
}),
|
|
18
32
|
new ValidityDef({
|
|
19
33
|
header: 'Valid',
|
|
20
34
|
id: 'valid',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ColumnDef } from './Definitions/ColumnDef.svelte.js';
|
|
2
|
-
export interface Column<T extends object> {
|
|
2
|
+
export interface Column<T extends object, in FilterFnType = undefined> {
|
|
3
3
|
id: string;
|
|
4
|
-
columnDef: ColumnDef<T,
|
|
4
|
+
columnDef: ColumnDef<T, FilterFnType>;
|
|
5
5
|
getCanSort: () => boolean;
|
|
6
6
|
getToggleSortingHandler: () => ((e: MouseEvent) => void) | undefined;
|
|
7
7
|
getIsSorted: () => 'asc' | 'desc' | 'none';
|
|
@@ -7,7 +7,7 @@ import type { FilterValueType } from '../../Filtering/FilterValueType.js';
|
|
|
7
7
|
import { ColumnType } from '../ColumnType.js';
|
|
8
8
|
import type { AccessorFn } from './AccessorFn.js';
|
|
9
9
|
import type { ValidationFn } from './ValidationFn.js';
|
|
10
|
-
export interface ColumnDefProps<T extends object, FilterFnType = undefined> {
|
|
10
|
+
export interface ColumnDefProps<T extends object, in FilterFnType = undefined> {
|
|
11
11
|
id: string;
|
|
12
12
|
header: string | Snippet;
|
|
13
13
|
debug?: boolean;
|
|
@@ -26,7 +26,7 @@ export interface ColumnDefProps<T extends object, FilterFnType = undefined> {
|
|
|
26
26
|
accessorFn?: AccessorFn<T>;
|
|
27
27
|
getDisplayValue?: (item: T, index: number) => string | null | Promise<string | null>;
|
|
28
28
|
}
|
|
29
|
-
export declare abstract class ColumnDef<T extends object, FilterFnType = undefined> {
|
|
29
|
+
export declare abstract class ColumnDef<T extends object, in FilterFnType = undefined> {
|
|
30
30
|
protected constructor(props: ColumnDefProps<T, FilterFnType>);
|
|
31
31
|
readonly id: string;
|
|
32
32
|
debug: boolean;
|
package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts
CHANGED
|
@@ -2,17 +2,17 @@ import type { Component } from 'svelte';
|
|
|
2
2
|
import type { DisplayType } from '../../DisplayType.js';
|
|
3
3
|
import type { TableCell } from '../../TableCell.js';
|
|
4
4
|
import { ColumnDef, type ColumnDefProps } from '../ColumnDef.svelte.js';
|
|
5
|
-
export interface DisplayDefModalProps<T extends object> {
|
|
6
|
-
cell: TableCell<T>;
|
|
5
|
+
export interface DisplayDefModalProps<T extends object, in FilterValueType> {
|
|
6
|
+
cell: TableCell<T, FilterValueType>;
|
|
7
7
|
onclose: () => void;
|
|
8
8
|
onsubmit: () => void;
|
|
9
9
|
}
|
|
10
|
-
export interface AbstractDisplayDefProps<T extends object, FilterFnType
|
|
10
|
+
export interface AbstractDisplayDefProps<T extends object, FilterFnType> extends ColumnDefProps<T, FilterFnType> {
|
|
11
11
|
modal?: Component<any, any, any>;
|
|
12
12
|
}
|
|
13
|
-
export declare abstract class AbstractDisplayDef<T extends object,
|
|
13
|
+
export declare abstract class AbstractDisplayDef<T extends object, FilterValueType> extends ColumnDef<T, FilterValueType> {
|
|
14
14
|
abstract readonly displayType: DisplayType;
|
|
15
|
-
constructor(props: AbstractDisplayDefProps<T,
|
|
15
|
+
constructor(props: AbstractDisplayDefProps<T, FilterValueType>);
|
|
16
16
|
readonly columnType: "Display";
|
|
17
|
-
readonly modal: Component<DisplayDefModalProps<T>, any, any> | undefined;
|
|
17
|
+
readonly modal: Component<DisplayDefModalProps<T, FilterValueType>, any, any> | undefined;
|
|
18
18
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ValidationFn } from '../ValidationFn.js';
|
|
2
2
|
import { AbstractDisplayDef, type AbstractDisplayDefProps } from './AbstractDisplayDef.svelte.js';
|
|
3
|
-
export interface ValidityDefProps<T extends object> extends AbstractDisplayDefProps<T> {
|
|
3
|
+
export interface ValidityDefProps<T extends object, FilterValueType> extends AbstractDisplayDefProps<T, FilterValueType> {
|
|
4
4
|
isValid: ValidationFn<T>;
|
|
5
5
|
}
|
|
6
|
-
export declare class ValidityDef<T extends object> extends AbstractDisplayDef<T> {
|
|
6
|
+
export declare class ValidityDef<T extends object, FilterValueType> extends AbstractDisplayDef<T, FilterValueType> {
|
|
7
7
|
readonly displayType: "Validity";
|
|
8
|
-
constructor(props: ValidityDefProps<T>);
|
|
8
|
+
constructor(props: ValidityDefProps<T, FilterValueType>);
|
|
9
9
|
readonly filterFn: undefined;
|
|
10
10
|
readonly isValid: ValidationFn<T>;
|
|
11
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CustomRemoteFilters } from '../Filtering/CustomRemoteFilters.js';
|
|
2
2
|
import type { ColumnDef } from './Definitions/ColumnDef.svelte.js';
|
|
3
|
-
export interface DefsWrapper<T extends object> {
|
|
4
|
-
defs: Array<ColumnDef<T>>;
|
|
3
|
+
export interface DefsWrapper<T extends object, in FilterValueType = undefined> {
|
|
4
|
+
defs: Array<ColumnDef<T, FilterValueType>>;
|
|
5
5
|
remoteFilters?: CustomRemoteFilters;
|
|
6
6
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Row } from '../Context/Row.js';
|
|
2
|
+
import type { NumberFilterValueType } from '../Filtering/FilterFn.js';
|
|
2
3
|
import type { ProgressBarColumn } from './ProgressBarColumn.js';
|
|
3
4
|
import type { TableCell } from './TableCell.js';
|
|
4
|
-
export interface ProgressBarTableCell<T extends object> extends TableCell<T> {
|
|
5
|
+
export interface ProgressBarTableCell<T extends object> extends TableCell<T, NumberFilterValueType> {
|
|
5
6
|
column: ProgressBarColumn<T>;
|
|
6
7
|
row: Row<T>;
|
|
7
8
|
id: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Row } from '../Context/Row.js';
|
|
2
2
|
import type { Column } from './Column.js';
|
|
3
|
-
export interface TableCell<T extends object> {
|
|
4
|
-
column: Column<T>;
|
|
3
|
+
export interface TableCell<T extends object, in FilterValueType = never> {
|
|
4
|
+
column: Column<T, FilterValueType>;
|
|
5
5
|
row: Row<T>;
|
|
6
6
|
id: string;
|
|
7
7
|
getValue: () => unknown | Promise<unknown>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { FilterMode } from './FilterMode.js';
|
|
2
|
-
export type CustomFilterFn = (mode: FilterMode, value: unknown) => Promise<boolean>;
|
|
2
|
+
export type CustomFilterFn = (mode: FilterMode, value: unknown) => boolean | Promise<boolean>;
|
|
@@ -6,4 +6,4 @@ export type SelectFilterValueType<T, columnType = T[keyof T]> = string | Array<u
|
|
|
6
6
|
} | undefined;
|
|
7
7
|
export type BoolFilterValueType = boolean | null;
|
|
8
8
|
export type StringFilterValueType = string | null;
|
|
9
|
-
export type FilterFn<T extends object, FilterValueType> = (row: Row<T>, columnId: string, filterValue: FilterValueType) => Promise<boolean>;
|
|
9
|
+
export type FilterFn<T extends object, FilterValueType> = (row: Row<T>, columnId: string, filterValue: FilterValueType) => boolean | Promise<boolean>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { ToastContext } from '../../../../Contexts/ToastContext.svelte.js';
|
|
1
2
|
import { Validity } from '../../../../Types/Internal/Validity.js';
|
|
2
3
|
import type { TableCell } from '../Columns/TableCell.js';
|
|
3
4
|
import type { TableContext } from '../Context/TableContext.svelte.js';
|
|
4
5
|
import type { CellCoordinates } from '../Coordinates/CellCoordinates.js';
|
|
5
|
-
export declare class TableFocusDetails<T extends object> {
|
|
6
|
+
export declare class TableFocusDetails<T extends object, in FilterValueType> {
|
|
6
7
|
private toastCallback;
|
|
7
|
-
constructor(cell: TableCell<T>, tableContext: TableContext<T>, toastCallback:
|
|
8
|
+
constructor(cell: TableCell<T, FilterValueType>, tableContext: TableContext<T>, toastCallback: ToastContext['toast']);
|
|
8
9
|
private _cell;
|
|
9
|
-
get cell(): TableCell<T>;
|
|
10
|
-
set cell(v: TableCell<T>);
|
|
10
|
+
get cell(): TableCell<T, FilterValueType>;
|
|
11
|
+
set cell(v: TableCell<T, FilterValueType>);
|
|
11
12
|
private _tableContext;
|
|
12
13
|
get tableContext(): TableContext<T>;
|
|
13
14
|
set tableContext(v: TableContext<T>);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { devCatch, isErrorResponse } from '../../../../Helpers/Helpers.svelte.js';
|
|
1
2
|
import { Colour } from '../../../../scss/colours.js';
|
|
2
3
|
import { Validity } from '../../../../Types/Internal/Validity.js';
|
|
3
4
|
import { tick } from 'svelte';
|
|
@@ -130,7 +131,12 @@ export class TableFocusDetails {
|
|
|
130
131
|
catch (e) {
|
|
131
132
|
console.warn('validity error:', e);
|
|
132
133
|
return tick().then(() => {
|
|
133
|
-
|
|
134
|
+
if (isErrorResponse(e)) {
|
|
135
|
+
this.toastCallback(e);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
devCatch(e);
|
|
139
|
+
}
|
|
134
140
|
return [Validity.Valid, undefined];
|
|
135
141
|
});
|
|
136
142
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script lang="ts" generics="Args
|
|
3
|
+
<script lang="ts" generics="Args">
|
|
4
4
|
import { devCatch } from '../Helpers/Helpers.svelte.js';
|
|
5
5
|
import { Colour } from '../scss/colours.js';
|
|
6
6
|
import { Size } from '../Types/Internal/Size.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { TabGroupButtonProps } from './TabGroupButtonProps.js';
|
|
2
|
-
declare function $$render<Args
|
|
2
|
+
declare function $$render<Args>(): {
|
|
3
3
|
props: TabGroupButtonProps<Args>;
|
|
4
4
|
exports: {};
|
|
5
5
|
bindings: "";
|
|
6
6
|
slots: {};
|
|
7
7
|
events: {};
|
|
8
8
|
};
|
|
9
|
-
declare class __sveltets_Render<Args
|
|
9
|
+
declare class __sveltets_Render<Args> {
|
|
10
10
|
props(): ReturnType<typeof $$render<Args>>['props'];
|
|
11
11
|
events(): ReturnType<typeof $$render<Args>>['events'];
|
|
12
12
|
slots(): ReturnType<typeof $$render<Args>>['slots'];
|
|
@@ -14,12 +14,12 @@ declare class __sveltets_Render<Args extends object | undefined> {
|
|
|
14
14
|
exports(): {};
|
|
15
15
|
}
|
|
16
16
|
interface $$IsomorphicComponent {
|
|
17
|
-
new <Args
|
|
17
|
+
new <Args>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Args>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Args>['props']>, ReturnType<__sveltets_Render<Args>['events']>, ReturnType<__sveltets_Render<Args>['slots']>> & {
|
|
18
18
|
$$bindings?: ReturnType<__sveltets_Render<Args>['bindings']>;
|
|
19
19
|
} & ReturnType<__sveltets_Render<Args>['exports']>;
|
|
20
|
-
<Args
|
|
20
|
+
<Args>(internal: unknown, props: ReturnType<__sveltets_Render<Args>['props']> & {}): ReturnType<__sveltets_Render<Args>['exports']>;
|
|
21
21
|
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
22
|
}
|
|
23
23
|
declare const VerticalTabGroupButton: $$IsomorphicComponent;
|
|
24
|
-
type VerticalTabGroupButton<Args
|
|
24
|
+
type VerticalTabGroupButton<Args> = InstanceType<typeof VerticalTabGroupButton<Args>>;
|
|
25
25
|
export default VerticalTabGroupButton;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { TabOption } from '../Types/Internal/TabOption.js';
|
|
2
2
|
export interface VerticalTabGroupProps {
|
|
3
3
|
name?: string;
|
|
4
|
-
tabs: Array<TabOption<
|
|
5
|
-
selected?: TabOption<
|
|
4
|
+
tabs: Array<TabOption<unknown>>;
|
|
5
|
+
selected?: TabOption<unknown>;
|
|
6
6
|
style?: string;
|
|
7
7
|
noscroll?: boolean;
|
|
8
8
|
noTabMessage?: string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { type IErrorResponse } from '../Helpers/Helpers.svelte.js';
|
|
1
2
|
import type { IdentifiableToastMessage } from '../Types/Internal/IdentifiableToastMessage.js';
|
|
3
|
+
import type { ToastMessage } from '../Types/Internal/ToastMessage.js';
|
|
2
4
|
export declare class ToastContext {
|
|
3
5
|
static readonly identifier: unique symbol;
|
|
4
6
|
private _toasts;
|
|
5
7
|
get toasts(): Array<IdentifiableToastMessage>;
|
|
6
8
|
private set toasts(value);
|
|
7
|
-
readonly toast: (message: unknown) => void;
|
|
9
|
+
readonly toast: (message: Array<unknown> | string | ToastMessage | IErrorResponse) => void;
|
|
8
10
|
private dismiss;
|
|
9
11
|
}
|
|
@@ -27,7 +27,7 @@ export class ToastContext {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
if (typeof message === 'string') {
|
|
31
31
|
return {
|
|
32
32
|
result: Validity.Info,
|
|
33
33
|
closeable,
|
|
@@ -39,7 +39,7 @@ export class ToastContext {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
if (
|
|
42
|
+
if (typeof message == 'object' && isToastMessage(message)) {
|
|
43
43
|
return {
|
|
44
44
|
closeable,
|
|
45
45
|
timeout,
|
|
@@ -13,7 +13,7 @@ export declare function SQLFriendlyWithLocalTime(date: InputDate | InputDateWith
|
|
|
13
13
|
export declare const localTimeFormat: Intl.DateTimeFormat;
|
|
14
14
|
export declare function passthrough(e: KeyboardEvent): void;
|
|
15
15
|
export declare function getCanvasContext(): CanvasRenderingContext2D | null;
|
|
16
|
-
interface IErrorResponse {
|
|
16
|
+
export interface IErrorResponse {
|
|
17
17
|
readonly errors: ReadonlyArray<{
|
|
18
18
|
code: string;
|
|
19
19
|
message: string;
|
|
@@ -41,4 +41,3 @@ export declare function devCatch(e: unknown): void;
|
|
|
41
41
|
export declare function hasQuery(customFilter: CustomFilter | undefined): customFilter is CustomFilter & Required<Pick<CustomFilter, 'query'>>;
|
|
42
42
|
export declare function isDateTuple(value: unknown): value is [Date | null, Date | null];
|
|
43
43
|
export declare function isNumberTuple(value: unknown): value is [number | null, number | null];
|
|
44
|
-
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script lang="ts">
|
|
3
|
+
<script lang="ts" generics="FilterValueType">
|
|
4
4
|
import DesktopModal from '../../Components/DesktopModal.svelte';
|
|
5
5
|
import Switch from '../../Components/Switch.svelte';
|
|
6
6
|
import type { DisplayDefModalProps } from '../../Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js';
|
|
7
7
|
import type { ExampleItem } from './ExampleItem.js';
|
|
8
8
|
|
|
9
|
-
const { cell, onclose, onsubmit }: DisplayDefModalProps<ExampleItem> = $props();
|
|
9
|
+
const { cell, onclose, onsubmit }: DisplayDefModalProps<ExampleItem, FilterValueType> = $props();
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<DesktopModal
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import type { DisplayDefModalProps } from '../../Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js';
|
|
2
2
|
import type { ExampleItem } from './ExampleItem.js';
|
|
3
|
-
declare
|
|
4
|
-
|
|
3
|
+
declare function $$render<FilterValueType>(): {
|
|
4
|
+
props: DisplayDefModalProps<ExampleItem, FilterValueType>;
|
|
5
|
+
exports: {};
|
|
6
|
+
bindings: "";
|
|
7
|
+
slots: {};
|
|
8
|
+
events: {};
|
|
9
|
+
};
|
|
10
|
+
declare class __sveltets_Render<FilterValueType> {
|
|
11
|
+
props(): ReturnType<typeof $$render<FilterValueType>>['props'];
|
|
12
|
+
events(): ReturnType<typeof $$render<FilterValueType>>['events'];
|
|
13
|
+
slots(): ReturnType<typeof $$render<FilterValueType>>['slots'];
|
|
14
|
+
bindings(): "";
|
|
15
|
+
exports(): {};
|
|
16
|
+
}
|
|
17
|
+
interface $$IsomorphicComponent {
|
|
18
|
+
new <FilterValueType>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<FilterValueType>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<FilterValueType>['props']>, ReturnType<__sveltets_Render<FilterValueType>['events']>, ReturnType<__sveltets_Render<FilterValueType>['slots']>> & {
|
|
19
|
+
$$bindings?: ReturnType<__sveltets_Render<FilterValueType>['bindings']>;
|
|
20
|
+
} & ReturnType<__sveltets_Render<FilterValueType>['exports']>;
|
|
21
|
+
<FilterValueType>(internal: unknown, props: ReturnType<__sveltets_Render<FilterValueType>['props']> & {}): ReturnType<__sveltets_Render<FilterValueType>['exports']>;
|
|
22
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
23
|
+
}
|
|
24
|
+
declare const ExampleModal: $$IsomorphicComponent;
|
|
25
|
+
type ExampleModal<FilterValueType> = InstanceType<typeof ExampleModal<FilterValueType>>;
|
|
5
26
|
export default ExampleModal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IconProps } from '../../Components/IconProps.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
export interface TabOption<Args
|
|
3
|
+
export interface TabOption<Args> {
|
|
4
4
|
label: string;
|
|
5
5
|
content: Snippet<[Args]>;
|
|
6
6
|
onclick: () => void;
|