@lavalogic/scoria 0.13.1 → 0.13.2
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/Table/Body/QuickSearchCell.svelte +2 -2
- package/dist/Components/Table/Body/QuickSearchCell.svelte.d.ts +12 -12
- package/dist/Components/Table/Body/QuickSearchCellProps.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +1 -1
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +2 -2
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte.d.ts +12 -12
- package/dist/Components/Table/Body/Rows/ColumnListRowProps.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +1 -1
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte.d.ts +1 -1
- package/dist/Components/Table/Body/Rows/Columns/ActionsCellProps.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ActionsColumn.d.ts +1 -1
- package/dist/Components/Table/Body/Rows/Columns/ActionsTableCell.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +5 -1
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte.d.ts +1 -1
- package/dist/Components/Table/Body/Rows/Columns/ExpandCellProps.d.ts +4 -4
- package/dist/Components/Table/Body/Rows/Columns/RowSelectionColumn.d.ts +2 -1
- package/dist/Components/Table/Body/Rows/Columns/RowSelectionTableCell.d.ts +2 -1
- package/dist/Components/Table/Body/Rows/Columns/SelectColumn.d.ts +2 -1
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +4 -4
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte.d.ts +14 -14
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +6 -4
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.d.ts +2 -1
- package/dist/Components/Table/Body/Rows/TableRow.svelte +4 -4
- package/dist/Components/Table/Body/TableBodyProps.d.ts +1 -1
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.d.ts +1 -1
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +14 -13
- package/dist/Components/Table/Headers/TableHead.svelte +3 -3
- package/dist/Components/Table/Misc/FilterInput.svelte +2 -2
- 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/FilterPanelModal.svelte +1 -1
- package/dist/Components/Table/Types/Columns/Column.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDefSet.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/JSONColumnDefSet.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +2 -1
- package/dist/Components/Table/Types/Columns/DefsWrapper.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/ExpandColumn.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/ExpandTableCell.d.ts +2 -2
- package/dist/Components/Table/Types/Context/ITable.d.ts +4 -4
- package/dist/Components/Table/Types/Context/Row.d.ts +3 -3
- package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +8 -8
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +5 -1
- package/dist/Components/Table/Types/Header.d.ts +2 -2
- package/dist/Components/Table/Types/HeaderGroup.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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
|
import Action from '../../Action.svelte';
|
|
6
6
|
import Button from '../../Button.svelte';
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
38
38
|
|
|
39
|
-
const { column, customFilters }: QuickSearchCellProps<T> = $props();
|
|
39
|
+
const { column, customFilters }: QuickSearchCellProps<T, FilterValueType> = $props();
|
|
40
40
|
|
|
41
41
|
const def = $derived(column.columnDef);
|
|
42
42
|
const customFilter = $derived(customFilters?.get(def.id));
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type { QuickSearchCellProps } from './QuickSearchCellProps.js';
|
|
2
|
-
declare function $$render<T extends object>(): {
|
|
3
|
-
props: QuickSearchCellProps<T>;
|
|
2
|
+
declare function $$render<T extends object, FilterValueType>(): {
|
|
3
|
+
props: QuickSearchCellProps<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 QuickSearchCell: $$IsomorphicComponent;
|
|
24
|
-
type QuickSearchCell<T extends object> = InstanceType<typeof QuickSearchCell<T>>;
|
|
24
|
+
type QuickSearchCell<T extends object, FilterValueType> = InstanceType<typeof QuickSearchCell<T, FilterValueType>>;
|
|
25
25
|
export default QuickSearchCell;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Column } from '../Types/Columns/Column.js';
|
|
2
2
|
import type { CustomRemoteFilters } from '../Types/Filtering/CustomRemoteFilters.js';
|
|
3
|
-
export interface QuickSearchCellProps<T extends object> {
|
|
4
|
-
column: Column<T>;
|
|
3
|
+
export interface QuickSearchCellProps<T extends object, FilterValueType> {
|
|
4
|
+
column: Column<T, FilterValueType>;
|
|
5
5
|
customFilters?: CustomRemoteFilters | undefined;
|
|
6
6
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
const { searchValue }: ColumnListProps = $props();
|
|
14
14
|
|
|
15
|
-
const visibleColumns: Array<ColumnDef<T>> = $derived.by(() => {
|
|
15
|
+
const visibleColumns: Array<ColumnDef<T, unknown>> = $derived.by(() => {
|
|
16
16
|
const lowercasedSearchValue = searchValue.toLocaleLowerCase();
|
|
17
17
|
return tableContext.columnDefs.filter(
|
|
18
18
|
(it) =>
|
|
@@ -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 Checkbox from '../../../Checkbox.svelte';
|
|
5
5
|
import Icon from '../../../Icon.svelte';
|
|
6
6
|
import { TableContext } from '../../Types/Context/TableContext.svelte.js';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type { ColumnListRowProps } from './ColumnListRowProps.js';
|
|
10
10
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
11
11
|
|
|
12
|
-
const { columnDef }: ColumnListRowProps<T> = $props();
|
|
12
|
+
const { columnDef }: ColumnListRowProps<T, FilterValueType> = $props();
|
|
13
13
|
|
|
14
14
|
const isExpandColumn = $derived(columnDef?.columnType === 'Expand');
|
|
15
15
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type { ColumnListRowProps } from './ColumnListRowProps.js';
|
|
2
|
-
declare function $$render<T extends object>(): {
|
|
3
|
-
props: ColumnListRowProps<T>;
|
|
2
|
+
declare function $$render<T extends object, FilterValueType>(): {
|
|
3
|
+
props: ColumnListRowProps<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 ColumnListRow: $$IsomorphicComponent;
|
|
24
|
-
type ColumnListRow<T extends object> = InstanceType<typeof ColumnListRow<T>>;
|
|
24
|
+
type ColumnListRow<T extends object, FilterValueType> = InstanceType<typeof ColumnListRow<T, FilterValueType>>;
|
|
25
25
|
export default ColumnListRow;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ColumnDef } from '../../Types/Columns/Definitions/ColumnDef.svelte.js';
|
|
2
|
-
export interface ColumnListRowProps<T extends object> {
|
|
3
|
-
columnDef: ColumnDef<T> | null;
|
|
2
|
+
export interface ColumnListRowProps<T extends object, FilterValueType> {
|
|
3
|
+
columnDef: ColumnDef<T, FilterValueType> | null;
|
|
4
4
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ActionsCellProps } from './ActionsCellProps.js';
|
|
2
2
|
export declare let shownPopup: import("../../../../../index.js").RefWrapper<symbol | undefined>;
|
|
3
3
|
declare function $$render<T extends object, FilterValueType>(): {
|
|
4
|
-
props: ActionsCellProps<T>;
|
|
4
|
+
props: ActionsCellProps<T, FilterValueType>;
|
|
5
5
|
exports: {};
|
|
6
6
|
bindings: "";
|
|
7
7
|
slots: {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ActionsTableCell } from './ActionsTableCell.js';
|
|
2
|
-
export interface ActionsCellProps<T extends object> {
|
|
3
|
-
cell: ActionsTableCell<T>;
|
|
2
|
+
export interface ActionsCellProps<T extends object, FilterValueType> {
|
|
3
|
+
cell: ActionsTableCell<T, FilterValueType>;
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Column } from '../../../Types/Columns/Column.js';
|
|
2
2
|
import type { ActionsDef } from '../../../Types/Columns/Definitions/Actions/ActionsDef.svelte.js';
|
|
3
|
-
export interface ActionsColumn<T extends object> extends Column<T> {
|
|
3
|
+
export interface ActionsColumn<T extends object, FilterValueType> extends Column<T, FilterValueType> {
|
|
4
4
|
columnDef: ActionsDef<T>;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TableCell } from '../../../Types/Columns/TableCell.js';
|
|
2
2
|
import type { ActionsColumn } from './ActionsColumn.js';
|
|
3
|
-
export interface ActionsTableCell<T extends object> extends TableCell<T> {
|
|
4
|
-
column: ActionsColumn<T>;
|
|
3
|
+
export interface ActionsTableCell<T extends object, FilterValueType> extends TableCell<T, FilterValueType> {
|
|
4
|
+
column: ActionsColumn<T, FilterValueType>;
|
|
5
5
|
}
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
import { getContext } from 'svelte';
|
|
15
15
|
import type { ExpandCellProps } from './ExpandCellProps.js';
|
|
16
16
|
|
|
17
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
cell,
|
|
19
|
+
expandedColumnDef,
|
|
20
|
+
onExpandChange
|
|
21
|
+
}: ExpandCellProps<T, R, IdType, FilterValueType> = $props();
|
|
18
22
|
|
|
19
23
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
20
24
|
const toastContext = getContext<ToastContext>(ToastContext.identifier);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Primitive } from '../../../Types/Context/TableInitOptions.js';
|
|
2
2
|
import type { ExpandCellProps } from './ExpandCellProps.js';
|
|
3
3
|
declare function $$render<T extends object, R extends object, FilterValueType, IdType extends Primitive>(): {
|
|
4
|
-
props: ExpandCellProps<T, R, IdType>;
|
|
4
|
+
props: ExpandCellProps<T, R, IdType, FilterValueType>;
|
|
5
5
|
exports: {};
|
|
6
6
|
bindings: "";
|
|
7
7
|
slots: {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ExpandDef } from '../../../Types/Columns/Definitions/Expand/ExpandDef.svelte.js';
|
|
2
2
|
import type { ExpandTableCell } from '../../../Types/Columns/ExpandTableCell.js';
|
|
3
3
|
import type { Primitive } from '../../../Types/Context/TableInitOptions.js';
|
|
4
|
-
export interface ExpandCellProps<T extends object, R extends object, IdType extends Primitive> {
|
|
5
|
-
cell: ExpandTableCell<T, R, IdType>;
|
|
6
|
-
expandedColumnDef: ExpandDef<T, R, IdType> | undefined;
|
|
7
|
-
onExpandChange: (def: ExpandDef<T, R, IdType>) => void;
|
|
4
|
+
export interface ExpandCellProps<T extends object, R extends object, IdType extends Primitive, FilterValueType> {
|
|
5
|
+
cell: ExpandTableCell<T, R, IdType, FilterValueType>;
|
|
6
|
+
expandedColumnDef: ExpandDef<T, R, IdType, FilterValueType> | undefined;
|
|
7
|
+
onExpandChange: (def: ExpandDef<T, R, IdType, FilterValueType>) => void;
|
|
8
8
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Column } from '../../../Types/Columns/Column.js';
|
|
2
2
|
import type { RowSelectionDef } from '../../../Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js';
|
|
3
|
-
|
|
3
|
+
import type { BoolFilterValueType } from '../../../Types/Filtering/FilterFn.js';
|
|
4
|
+
export interface RowSelectionColumn<T extends object> extends Column<T, BoolFilterValueType> {
|
|
4
5
|
columnDef: RowSelectionDef<T>;
|
|
5
6
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TableCell } from '../../../Types/Columns/TableCell.js';
|
|
2
|
+
import type { BoolFilterValueType } from '../../../Types/Filtering/FilterFn.js';
|
|
2
3
|
import type { RowSelectionColumn } from './RowSelectionColumn.js';
|
|
3
|
-
export interface RowSelectionTableCell<T extends object> extends TableCell<T> {
|
|
4
|
+
export interface RowSelectionTableCell<T extends object> extends TableCell<T, BoolFilterValueType> {
|
|
4
5
|
column: RowSelectionColumn<T>;
|
|
5
6
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Column } from '../../../Types/Columns/Column.js';
|
|
2
2
|
import type { SelectDef } from '../../../Types/Columns/Definitions/Accessors/SelectDef.svelte.js';
|
|
3
|
-
|
|
3
|
+
import type { SelectFilterValueType } from '../../../Types/Filtering/FilterFn.js';
|
|
4
|
+
export interface SelectColumn<T extends object> extends Column<T, SelectFilterValueType<T>> {
|
|
4
5
|
columnDef: SelectDef<T>;
|
|
5
6
|
}
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
import { Size } from '../../../../../Types/Internal/Size.js';
|
|
9
9
|
import type { ActionsTableCell } from './ActionsTableCell.js';
|
|
10
10
|
|
|
11
|
-
export interface TableActionProps<T extends object> {
|
|
11
|
+
export interface TableActionProps<T extends object, FilterValueType> {
|
|
12
12
|
action: TableActionButton<T>;
|
|
13
|
-
cell: ActionsTableCell<T>;
|
|
13
|
+
cell: ActionsTableCell<T, FilterValueType>;
|
|
14
14
|
}
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
|
-
<script lang="ts" generics="T extends object">
|
|
18
|
-
const { action, cell }: TableActionProps<T> = $props();
|
|
17
|
+
<script lang="ts" generics="T extends object,FilterValueType">
|
|
18
|
+
const { action, cell }: TableActionProps<T, FilterValueType> = $props();
|
|
19
19
|
|
|
20
20
|
const isEnabledPromise: boolean | Promise<boolean> = $derived.by(() => {
|
|
21
21
|
const disabled = action.isDisabled?.(cell.row.original, cell.row.originalIndex);
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import type { TableActionButton } from '../../../Types/Columns/TableActionButton.js';
|
|
2
2
|
import type { ActionsTableCell } from './ActionsTableCell.js';
|
|
3
|
-
export interface TableActionProps<T extends object> {
|
|
3
|
+
export interface TableActionProps<T extends object, FilterValueType> {
|
|
4
4
|
action: TableActionButton<T>;
|
|
5
|
-
cell: ActionsTableCell<T>;
|
|
5
|
+
cell: ActionsTableCell<T, FilterValueType>;
|
|
6
6
|
}
|
|
7
|
-
declare function $$render<T extends object>(): {
|
|
8
|
-
props: TableActionProps<T>;
|
|
7
|
+
declare function $$render<T extends object, FilterValueType>(): {
|
|
8
|
+
props: TableActionProps<T, FilterValueType>;
|
|
9
9
|
exports: {};
|
|
10
10
|
bindings: "";
|
|
11
11
|
slots: {};
|
|
12
12
|
events: {};
|
|
13
13
|
};
|
|
14
|
-
declare class __sveltets_Render<T extends object> {
|
|
15
|
-
props(): ReturnType<typeof $$render<T>>['props'];
|
|
16
|
-
events(): ReturnType<typeof $$render<T>>['events'];
|
|
17
|
-
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
14
|
+
declare class __sveltets_Render<T extends object, FilterValueType> {
|
|
15
|
+
props(): ReturnType<typeof $$render<T, FilterValueType>>['props'];
|
|
16
|
+
events(): ReturnType<typeof $$render<T, FilterValueType>>['events'];
|
|
17
|
+
slots(): ReturnType<typeof $$render<T, FilterValueType>>['slots'];
|
|
18
18
|
bindings(): "";
|
|
19
19
|
exports(): {};
|
|
20
20
|
}
|
|
21
21
|
interface $$IsomorphicComponent {
|
|
22
|
-
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']>> & {
|
|
23
|
-
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
24
|
-
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
25
|
-
<T extends object>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
26
|
-
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
|
+
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']>> & {
|
|
23
|
+
$$bindings?: ReturnType<__sveltets_Render<T, FilterValueType>['bindings']>;
|
|
24
|
+
} & ReturnType<__sveltets_Render<T, FilterValueType>['exports']>;
|
|
25
|
+
<T extends object, FilterValueType>(internal: unknown, props: ReturnType<__sveltets_Render<T, FilterValueType>['props']> & {}): ReturnType<__sveltets_Render<T, FilterValueType>['exports']>;
|
|
26
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
|
|
27
27
|
}
|
|
28
28
|
declare const TableAction: $$IsomorphicComponent;
|
|
29
|
-
type TableAction<T extends object> = InstanceType<typeof TableAction<T>>;
|
|
29
|
+
type TableAction<T extends object, FilterValueType> = InstanceType<typeof TableAction<T, FilterValueType>>;
|
|
30
30
|
export default TableAction;
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
export interface TableColumnProps<T extends object, FilterValueType> {
|
|
27
27
|
cell: TableCell<T, FilterValueType>;
|
|
28
|
-
expandedColumnDef: ExpandDef<T, object, Primitive> | undefined;
|
|
29
|
-
onExpandChange: (columnDef: ExpandDef<T, object, Primitive>) => void;
|
|
28
|
+
expandedColumnDef: ExpandDef<T, object, Primitive, FilterValueType> | undefined;
|
|
29
|
+
onExpandChange: (columnDef: ExpandDef<T, object, Primitive, FilterValueType>) => void;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function isProgressBarTableCell<T extends object>(
|
|
@@ -56,10 +56,12 @@
|
|
|
56
56
|
return typeof valueOrComponent === 'function';
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
function isActionsDef(cell: TableCell<T>): cell is ActionsTableCell<T> {
|
|
59
|
+
function isActionsDef(cell: TableCell<T>): cell is ActionsTableCell<T, FilterValueType> {
|
|
60
60
|
return cell.column.columnDef instanceof ActionsDef;
|
|
61
61
|
}
|
|
62
|
-
function isExpandTableCell(
|
|
62
|
+
function isExpandTableCell(
|
|
63
|
+
cell: TableCell<T>
|
|
64
|
+
): cell is ExpandTableCell<T, object, Primitive, FilterValueType> {
|
|
63
65
|
return cell.column.columnDef instanceof ExpandDef;
|
|
64
66
|
}
|
|
65
67
|
|
|
@@ -2,8 +2,8 @@ import { ExpandDef } from '../../../Types/Columns/Definitions/Expand/ExpandDef.s
|
|
|
2
2
|
import type { TableCell } from '../../../Types/Columns/TableCell.js';
|
|
3
3
|
export interface TableColumnProps<T extends object, FilterValueType> {
|
|
4
4
|
cell: TableCell<T, FilterValueType>;
|
|
5
|
-
expandedColumnDef: ExpandDef<T, object, Primitive> | undefined;
|
|
6
|
-
onExpandChange: (columnDef: ExpandDef<T, object, Primitive>) => void;
|
|
5
|
+
expandedColumnDef: ExpandDef<T, object, Primitive, FilterValueType> | undefined;
|
|
6
|
+
onExpandChange: (columnDef: ExpandDef<T, object, Primitive, FilterValueType>) => void;
|
|
7
7
|
}
|
|
8
8
|
import type { Primitive } from '../../../Types/Context/TableInitOptions.js';
|
|
9
9
|
declare function $$render<T extends object, FilterValueType>(): {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Column } from '../../../Types/Columns/Column.js';
|
|
2
2
|
import type { QueryDef } from '../../../Types/Columns/Definitions/Accessors/QueryDef.svelte.js';
|
|
3
|
-
|
|
3
|
+
import type { SelectFilterValueType } from '../../../Types/Filtering/FilterFn.js';
|
|
4
|
+
export interface TableQueryColumn<T extends object> extends Column<T, SelectFilterValueType<T>> {
|
|
4
5
|
columnDef: QueryDef<T>;
|
|
5
6
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
const hoverable = $derived(tableContext.changeColourOnHover);
|
|
21
21
|
|
|
22
22
|
//HACK converted this from derived to state+deffect because otherwise this throws an unsafe mutation error deeper down the stack
|
|
23
|
-
const cells: Array<TableCell<T>> = $derived(
|
|
23
|
+
const cells: Array<TableCell<T, unknown>> = $derived(
|
|
24
24
|
side === 'left'
|
|
25
25
|
? row.getLeftVisibleCells()
|
|
26
26
|
: side === 'right'
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
: row.getCenterVisibleCells()
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
let expandedColumnDef: ExpandDef<T, object, Primitive> | undefined = $state();
|
|
31
|
+
let expandedColumnDef: ExpandDef<T, object, Primitive, unknown> | undefined = $state();
|
|
32
32
|
|
|
33
33
|
$effect(() => {
|
|
34
34
|
if (cells.length) {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
let innerColumnDefs: DefsWrapper<object> = $state({ defs: [] });
|
|
46
46
|
let innerTableName: string | undefined = $state();
|
|
47
47
|
|
|
48
|
-
let prevExpandedColumnDef: ExpandDef<T, object, Primitive> | undefined = $state();
|
|
48
|
+
let prevExpandedColumnDef: ExpandDef<T, object, Primitive, unknown> | undefined = $state();
|
|
49
49
|
|
|
50
50
|
const rowIndex = $derived(cells.at(0) && cells[0].row.visibleIndex);
|
|
51
51
|
const highlighted = $derived(
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
function onExpandChange(columnDef: ExpandDef<T, object, Primitive>) {
|
|
87
|
+
function onExpandChange(columnDef: ExpandDef<T, object, Primitive, unknown>) {
|
|
88
88
|
if (expandedColumnDef?.id === columnDef.id) {
|
|
89
89
|
expandedColumnDef = undefined;
|
|
90
90
|
} else {
|
|
@@ -3,6 +3,6 @@ import type { HeightData } from './HeightData.js';
|
|
|
3
3
|
export interface TableBodyProps<T extends object> {
|
|
4
4
|
side: 'left' | 'centre' | 'right';
|
|
5
5
|
heights: Array<HeightData<T>>;
|
|
6
|
-
columns: Array<Column<T>>;
|
|
6
|
+
columns: Array<Column<T, unknown>>;
|
|
7
7
|
includeHighlight: boolean;
|
|
8
8
|
}
|
|
@@ -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,
|
|
5
|
+
export declare function generateExampleItemColumnDefs(modal: Component<DisplayDefModalProps<ExampleItem, unknown>, object, ''>): DefsWrapper<ExampleItem>;
|
|
@@ -15,20 +15,21 @@ import { ProgressBarDef } from '../Types/Columns/Definitions/Display/ProgressBar
|
|
|
15
15
|
import { ValidityDef } from '../Types/Columns/Definitions/Display/ValidityDef.svelte.js';
|
|
16
16
|
import { ExpandDef } from '../Types/Columns/Definitions/Expand/ExpandDef.svelte.js';
|
|
17
17
|
export function generateExampleItemColumnDefs(modal) {
|
|
18
|
+
const expandDef = new ExpandDef({
|
|
19
|
+
accessorFn: (it) => [it],
|
|
20
|
+
getInnerColumnDefs: () => generateExampleItemColumnDefs(modal),
|
|
21
|
+
header: 'Expand Cell',
|
|
22
|
+
id: 'expand',
|
|
23
|
+
headerIcon: 'access-token',
|
|
24
|
+
innerTableName: 'expand-inner',
|
|
25
|
+
innerTableOptions: {
|
|
26
|
+
selectionExtractor: (item) => Promise.resolve(item.id),
|
|
27
|
+
getUserId: () => '1'
|
|
28
|
+
},
|
|
29
|
+
isEnabled: () => true
|
|
30
|
+
});
|
|
18
31
|
let defs = $state([
|
|
19
|
-
|
|
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) => Promise.resolve(item.id),
|
|
28
|
-
getUserId: () => '1'
|
|
29
|
-
},
|
|
30
|
-
isEnabled: () => true
|
|
31
|
-
}),
|
|
32
|
+
expandDef,
|
|
32
33
|
new ValidityDef({
|
|
33
34
|
header: 'Valid',
|
|
34
35
|
id: 'valid',
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
currentDropTarget = target as HTMLTableCellElement | null;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
function showtooltip(e: MouseEvent, columnDef: ColumnDef<T>): void {
|
|
62
|
+
function showtooltip(e: MouseEvent, columnDef: ColumnDef<T, unknown>): void {
|
|
63
63
|
if (columnDef instanceof ExpandDef) {
|
|
64
64
|
const rect = (e.target as HTMLElement).closest('th')?.getBoundingClientRect();
|
|
65
65
|
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
function hideTooltip(columnDef: ColumnDef<T>): void {
|
|
81
|
+
function hideTooltip(columnDef: ColumnDef<T, unknown>): void {
|
|
82
82
|
if (columnDef instanceof ExpandDef) {
|
|
83
83
|
tooltipContext.hideTooltip(
|
|
84
84
|
`Show ${typeof columnDef.header === 'string' ? columnDef.header : columnDef.id}`
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
currentDropTarget = null;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
function setDragTarget(def: ColumnDef<T>) {
|
|
104
|
+
function setDragTarget(def: ColumnDef<T, unknown>) {
|
|
105
105
|
tableContext.dragTarget = def;
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -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
|
import Button from '../../Button.svelte';
|
|
6
6
|
import MultiSelect from '../../MultiSelect.svelte';
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
28
28
|
|
|
29
|
-
const { def, customFilters }: FilterInputProps<T> = $props();
|
|
29
|
+
const { def, customFilters }: FilterInputProps<T, FilterValueType> = $props();
|
|
30
30
|
|
|
31
31
|
const customFilter = $derived(customFilters?.get(def.id));
|
|
32
32
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type { FilterInputProps } from './FilterInputProps.js';
|
|
2
|
-
declare function $$render<T extends object>(): {
|
|
3
|
-
props: FilterInputProps<T>;
|
|
2
|
+
declare function $$render<T extends object, FilterValueType>(): {
|
|
3
|
+
props: FilterInputProps<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 FilterInput: $$IsomorphicComponent;
|
|
24
|
-
type FilterInput<T extends object> = InstanceType<typeof FilterInput<T>>;
|
|
24
|
+
type FilterInput<T extends object, FilterValueType> = InstanceType<typeof FilterInput<T, FilterValueType>>;
|
|
25
25
|
export default FilterInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ColumnDef } from '../Types/Columns/Definitions/ColumnDef.svelte.js';
|
|
2
2
|
import type { CustomRemoteFilters } from '../Types/Filtering/CustomRemoteFilters.js';
|
|
3
|
-
export interface FilterInputProps<T extends object> {
|
|
4
|
-
def: ColumnDef<T>;
|
|
3
|
+
export interface FilterInputProps<T extends object, FilterValueType> {
|
|
4
|
+
def: ColumnDef<T, FilterValueType>;
|
|
5
5
|
customFilters?: CustomRemoteFilters | undefined;
|
|
6
6
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
19
19
|
|
|
20
20
|
const { onclose }: FilterPanelModalProps = $props();
|
|
21
|
-
const refs: Array<FilterInput<T>> = $state([]);
|
|
21
|
+
const refs: Array<FilterInput<T, unknown>> = $state([]);
|
|
22
22
|
|
|
23
23
|
function reset() {
|
|
24
24
|
tableContext.paginationRepo?.resetFilters();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColumnDef } from './Definitions/ColumnDef.svelte.js';
|
|
2
|
-
export interface Column<T extends object, in FilterFnType
|
|
2
|
+
export interface Column<T extends object, in FilterFnType> {
|
|
3
3
|
id: string;
|
|
4
4
|
columnDef: ColumnDef<T, FilterFnType>;
|
|
5
5
|
getCanSort: () => boolean;
|
|
@@ -6,7 +6,7 @@ export interface ActionsDefProps<T extends object> {
|
|
|
6
6
|
isEnabled?: (item: T, index: number, button: TableActionButton<T>) => boolean | Promise<boolean>;
|
|
7
7
|
getColourSet?: (item: T, index: number, button: TableActionButton<T>) => ColourSet;
|
|
8
8
|
}
|
|
9
|
-
export declare class ActionsDef<T extends object> extends ColumnDef<T> {
|
|
9
|
+
export declare class ActionsDef<T extends object> extends ColumnDef<T, undefined> {
|
|
10
10
|
constructor(props: ActionsDefProps<T>);
|
|
11
11
|
readonly columnType: "Actions";
|
|
12
12
|
readonly actions: Array<TableActionButton<T>>;
|
|
@@ -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, in FilterFnType
|
|
10
|
+
export interface ColumnDefProps<T extends object, in FilterFnType> {
|
|
11
11
|
id: string;
|
|
12
12
|
header: string | Snippet;
|
|
13
13
|
debug?: boolean;
|
|
@@ -26,7 +26,7 @@ export interface ColumnDefProps<T extends object, in 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, in FilterFnType
|
|
29
|
+
export declare abstract class ColumnDef<T extends object, in FilterFnType> {
|
|
30
30
|
protected constructor(props: ColumnDefProps<T, FilterFnType>);
|
|
31
31
|
readonly id: string;
|
|
32
32
|
debug: boolean;
|
|
@@ -2,7 +2,7 @@ import type { IconProps } from '../../../../../IconProps.js';
|
|
|
2
2
|
import type { Primitive, TableInitOptions } from '../../../Context/TableInitOptions.js';
|
|
3
3
|
import type { DefsWrapper } from '../../DefsWrapper.js';
|
|
4
4
|
import { ColumnDef, type ColumnDefProps } from '../ColumnDef.svelte.js';
|
|
5
|
-
export interface ExpandDefProps<T extends object, R extends object, InnterIdType extends Primitive> extends ColumnDefProps<T> {
|
|
5
|
+
export interface ExpandDefProps<T extends object, R extends object, InnterIdType extends Primitive, FilterValueType> extends ColumnDefProps<T, FilterValueType> {
|
|
6
6
|
isEnabled: (item: T, index: number) => boolean | Promise<boolean>;
|
|
7
7
|
getInnerColumnDefs: (item: T, index: number) => DefsWrapper<R>;
|
|
8
8
|
headerIcon: IconProps['name'];
|
|
@@ -10,9 +10,9 @@ export interface ExpandDefProps<T extends object, R extends object, InnterIdType
|
|
|
10
10
|
innerTableOptions: TableInitOptions<R, InnterIdType>;
|
|
11
11
|
accessorFn: (item: T, index: number) => Array<R> | Promise<Array<R>>;
|
|
12
12
|
}
|
|
13
|
-
export declare class ExpandDef<T extends object, R extends object, InnterIdType extends Primitive> extends ColumnDef<T> {
|
|
13
|
+
export declare class ExpandDef<T extends object, R extends object, InnterIdType extends Primitive, FilterValueType> extends ColumnDef<T, FilterValueType> {
|
|
14
14
|
readonly columnType: "Expand";
|
|
15
|
-
constructor(props: ExpandDefProps<T, R, InnterIdType>);
|
|
15
|
+
constructor(props: ExpandDefProps<T, R, InnterIdType, FilterValueType>);
|
|
16
16
|
readonly accessorFn: (item: T, index: number) => Array<R> | Promise<Array<R>>;
|
|
17
17
|
readonly filterFn: undefined;
|
|
18
18
|
readonly innerTableName: string;
|
package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { BoolFilterValueType } from '../../../Filtering/FilterFn.js';
|
|
1
2
|
import { ColumnType } from '../../ColumnType.js';
|
|
2
3
|
import { ColumnDef } from '../ColumnDef.svelte.js';
|
|
3
|
-
export declare class RowSelectionDef<T extends object> extends ColumnDef<T> {
|
|
4
|
+
export declare class RowSelectionDef<T extends object> extends ColumnDef<T, BoolFilterValueType> {
|
|
4
5
|
readonly isSelectable: (item: T, index: number) => boolean | Promise<boolean>;
|
|
5
6
|
readonly columnType: ColumnType;
|
|
6
7
|
constructor(isSelectable: (item: T, index: number) => boolean | Promise<boolean>);
|
|
@@ -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> {
|
|
4
|
+
defs: Array<ColumnDef<T, unknown>>;
|
|
5
5
|
remoteFilters?: CustomRemoteFilters;
|
|
6
6
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Primitive } from '../Context/TableInitOptions.js';
|
|
2
2
|
import type { ExpandDef } from './Definitions/Expand/ExpandDef.svelte.js';
|
|
3
|
-
export interface ExpandColumn<T extends object, R extends object, IdType extends Primitive> {
|
|
3
|
+
export interface ExpandColumn<T extends object, R extends object, IdType extends Primitive, FilterValueType> {
|
|
4
4
|
id: string;
|
|
5
|
-
columnDef: ExpandDef<T, R, IdType>;
|
|
5
|
+
columnDef: ExpandDef<T, R, IdType, FilterValueType>;
|
|
6
6
|
getCanSort: () => boolean;
|
|
7
7
|
getToggleSortingHandler: () => (e: MouseEvent) => void;
|
|
8
8
|
getIsSorted: () => 'asc' | 'desc' | 'none';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Row } from '../Context/Row.js';
|
|
2
2
|
import type { Primitive } from '../Context/TableInitOptions.js';
|
|
3
3
|
import type { ExpandColumn } from './ExpandColumn.js';
|
|
4
|
-
export interface ExpandTableCell<T extends object, R extends object, IdType extends Primitive> {
|
|
5
|
-
column: ExpandColumn<T, R, IdType>;
|
|
4
|
+
export interface ExpandTableCell<T extends object, R extends object, IdType extends Primitive, FilterValueType> {
|
|
5
|
+
column: ExpandColumn<T, R, IdType, FilterValueType>;
|
|
6
6
|
row: Row<T>;
|
|
7
7
|
id: string;
|
|
8
8
|
getValue: () => unknown;
|
|
@@ -10,7 +10,7 @@ import type { OnChangeFn } from '../OnChangeFn.js';
|
|
|
10
10
|
import type { PaginationState } from '../Pagination/PaginationState.js';
|
|
11
11
|
export interface ITable<T extends object> {
|
|
12
12
|
data: Promise<Array<T>>;
|
|
13
|
-
columns: Array<ColumnDef<T>>;
|
|
13
|
+
columns: Array<ColumnDef<T, unknown>>;
|
|
14
14
|
columnSizing: ColumnSizingState;
|
|
15
15
|
columnVisibility: VisibilityState;
|
|
16
16
|
sorting: SortingState | undefined;
|
|
@@ -24,9 +24,9 @@ export interface ITable<T extends object> {
|
|
|
24
24
|
getLeftHeaderGroups: () => Array<HeaderGroup<T>>;
|
|
25
25
|
getRightHeaderGroups: () => Array<HeaderGroup<T>>;
|
|
26
26
|
getCenterHeaderGroups: () => Array<HeaderGroup<T>>;
|
|
27
|
-
getLeftVisibleLeafColumns: () => Array<Column<T>>;
|
|
28
|
-
getRightVisibleLeafColumns: () => Array<Column<T>>;
|
|
29
|
-
getCenterVisibleLeafColumns: () => Array<Column<T>>;
|
|
27
|
+
getLeftVisibleLeafColumns: () => Array<Column<T, unknown>>;
|
|
28
|
+
getRightVisibleLeafColumns: () => Array<Column<T, unknown>>;
|
|
29
|
+
getCenterVisibleLeafColumns: () => Array<Column<T, unknown>>;
|
|
30
30
|
onColumnVisibilityChange: OnChangeFn<VisibilityState>;
|
|
31
31
|
onColumnSizingChange: OnChangeFn<ColumnSizingState>;
|
|
32
32
|
onColumnFiltersChange: OnChangeFn<ColumnFiltersState> | undefined;
|
|
@@ -5,7 +5,7 @@ export interface Row<T extends object> {
|
|
|
5
5
|
visibleIndex: number;
|
|
6
6
|
originalIndex: number;
|
|
7
7
|
id: string;
|
|
8
|
-
getLeftVisibleCells: () => Array<TableCell<T>>;
|
|
9
|
-
getRightVisibleCells: () => Array<TableCell<T>>;
|
|
10
|
-
getCenterVisibleCells: () => Array<TableCell<T>>;
|
|
8
|
+
getLeftVisibleCells: () => Array<TableCell<T, unknown>>;
|
|
9
|
+
getRightVisibleCells: () => Array<TableCell<T, unknown>>;
|
|
10
|
+
getCenterVisibleCells: () => Array<TableCell<T, unknown>>;
|
|
11
11
|
}
|
|
@@ -62,11 +62,11 @@ export declare class TableContext<T extends object, RowIdType extends Primitive>
|
|
|
62
62
|
get limitFooter(): boolean;
|
|
63
63
|
set limitFooter(v: boolean);
|
|
64
64
|
private _dragTarget;
|
|
65
|
-
get dragTarget(): ColumnDef<T> | null;
|
|
66
|
-
set dragTarget(v: ColumnDef<T> | null);
|
|
65
|
+
get dragTarget(): ColumnDef<T, any> | null;
|
|
66
|
+
set dragTarget(v: ColumnDef<T, any> | null);
|
|
67
67
|
private _columnDefs;
|
|
68
|
-
get columnDefs(): Array<ColumnDef<T>>;
|
|
69
|
-
set columnDefs(v: Array<ColumnDef<T>>);
|
|
68
|
+
get columnDefs(): Array<ColumnDef<T, unknown>>;
|
|
69
|
+
set columnDefs(v: Array<ColumnDef<T, unknown>>);
|
|
70
70
|
private _columnPresets;
|
|
71
71
|
get columnPresets(): ReadonlyArray<ColumnDefSet<T>>;
|
|
72
72
|
private set columnPresets(value);
|
|
@@ -178,8 +178,8 @@ export declare class TableContext<T extends object, RowIdType extends Primitive>
|
|
|
178
178
|
updateColumnSizing: OnChangeFn<ColumnSizingState>;
|
|
179
179
|
readonly table: ITable<T>;
|
|
180
180
|
readonly lastPage: number;
|
|
181
|
-
readonly measureHeaderWidth: (columnDef: ColumnDef<T>) => number;
|
|
182
|
-
readonly autoResize: (columnDef: ColumnDef<T>) => Promise<void>;
|
|
181
|
+
readonly measureHeaderWidth: (columnDef: ColumnDef<T, unknown>) => number;
|
|
182
|
+
readonly autoResize: (columnDef: ColumnDef<T, unknown>) => Promise<void>;
|
|
183
183
|
reorderColumn: (dropTarget: HTMLLIElement | HTMLTableCellElement | null) => void;
|
|
184
184
|
copyHighlightedRowsToClipboard: () => Promise<void>;
|
|
185
185
|
copyDataToClipboard: () => Promise<void>;
|
|
@@ -231,8 +231,8 @@ export declare class TableContext<T extends object, RowIdType extends Primitive>
|
|
|
231
231
|
private setupDefaultColumnDefs;
|
|
232
232
|
private _getUserDefaults;
|
|
233
233
|
private _setNewPinningState;
|
|
234
|
-
readonly getToggleSortingHandler: (def: ColumnDef<T>) => () => void;
|
|
234
|
+
readonly getToggleSortingHandler: (def: ColumnDef<T, unknown>) => () => void;
|
|
235
235
|
private reassignDefsToPresets;
|
|
236
236
|
private filteringLoop;
|
|
237
237
|
}
|
|
238
|
-
export declare function isSearchable<T extends object, CD extends ColumnDef<T>>(def: CD): def is CD & HasCustomFilterFunction;
|
|
238
|
+
export declare function isSearchable<T extends object, CD extends ColumnDef<T, unknown>>(def: CD): def is CD & HasCustomFilterFunction;
|
|
@@ -317,6 +317,8 @@ export class TableContext {
|
|
|
317
317
|
set limitFooter(v) {
|
|
318
318
|
this._limitFooter = v;
|
|
319
319
|
}
|
|
320
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
321
|
+
// type here set to any because users of this property should not access the filter type, but typescript doesn't support that
|
|
320
322
|
_dragTarget = $state(null);
|
|
321
323
|
get dragTarget() {
|
|
322
324
|
return this._dragTarget;
|
|
@@ -324,6 +326,7 @@ export class TableContext {
|
|
|
324
326
|
set dragTarget(v) {
|
|
325
327
|
this._dragTarget = v;
|
|
326
328
|
}
|
|
329
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
327
330
|
_columnDefs = $state([]);
|
|
328
331
|
get columnDefs() {
|
|
329
332
|
return this._columnDefs;
|
|
@@ -2257,7 +2260,8 @@ function areDefsEquivalent(newColumnDefs, oldColumnDefs) {
|
|
|
2257
2260
|
const oldDef = oldColumnDefs.find((d) => d.id === newDef.id);
|
|
2258
2261
|
if (oldDef === undefined ||
|
|
2259
2262
|
newDef.header !== oldDef.header ||
|
|
2260
|
-
newDef.columnType !== oldDef.columnType
|
|
2263
|
+
newDef.columnType !== oldDef.columnType ||
|
|
2264
|
+
newDef.filterValueType !== oldDef.filterValueType
|
|
2261
2265
|
// ||
|
|
2262
2266
|
// newDef.defaultHidden !== oldDef.defaultHidden ||
|
|
2263
2267
|
// newDef.enableHiding !== oldDef.enableHiding ||
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Column } from './Columns/Column.js';
|
|
2
|
-
export interface Header<T extends object> {
|
|
2
|
+
export interface Header<T extends object, FilterValueType> {
|
|
3
3
|
id: string;
|
|
4
4
|
colSpan: number;
|
|
5
5
|
getSize: () => number;
|
|
6
|
-
column: Column<T>;
|
|
6
|
+
column: Column<T, FilterValueType>;
|
|
7
7
|
isPlaceholder: boolean;
|
|
8
8
|
getResizeHandler: () => (e: MouseEvent) => void;
|
|
9
9
|
}
|