@lavalogic/scoria 0.37.55 → 0.38.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 (49) hide show
  1. package/dist/Components/Table/ARCHITECTURE.md +22 -22
  2. package/dist/Components/Table/Misc/ColumnPanel.svelte +1 -61
  3. package/dist/Components/Table/Misc/ColumnPanel.svelte.d.ts +2 -24
  4. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +3 -92
  5. package/dist/Components/Table/Misc/ColumnPanelModal.svelte.d.ts +2 -24
  6. package/dist/Components/Table/Misc/ColumnPanelModalProps.d.ts +2 -2
  7. package/dist/Components/Table/Misc/TableConfigurationModal.svelte +644 -0
  8. package/dist/Components/Table/Misc/TableConfigurationModal.svelte.d.ts +26 -0
  9. package/dist/Components/Table/Misc/TableConfigurationModalProps.d.ts +13 -0
  10. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +27 -0
  11. package/dist/Components/Table/Misc/TableSidebar.svelte +45 -2
  12. package/dist/Components/Table/Misc/TableViewDropdown.svelte +175 -0
  13. package/dist/Components/Table/Misc/TableViewDropdown.svelte.d.ts +25 -0
  14. package/dist/Components/Table/SubApis.svelte.js +0 -41
  15. package/dist/Components/Table/Types/Columns/JSONTableLayout.d.ts +5 -5
  16. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.d.ts +5 -5
  17. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.js +5 -5
  18. package/dist/Components/Table/Types/Context/PreferencesState.svelte.d.ts +106 -147
  19. package/dist/Components/Table/Types/Context/PreferencesState.svelte.js +156 -203
  20. package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +323 -44
  21. package/dist/Components/Table/Types/Context/TableContext.svelte.js +687 -187
  22. package/dist/Components/Table/Types/Context/TableInitOptions.d.ts +9 -0
  23. package/dist/Components/Table/Types/Context/ViewState.svelte.d.ts +152 -0
  24. package/dist/Components/Table/Types/Context/ViewState.svelte.js +223 -0
  25. package/dist/Components/Table/Types/ExpandedPanel.d.ts +9 -5
  26. package/dist/Components/Table/Types/ExpandedPanel.js +9 -5
  27. package/dist/Components/Table/Types/Persistence/DatatableView.d.ts +95 -0
  28. package/dist/Components/Table/Types/Persistence/DatatableViewEnvelope.d.ts +21 -0
  29. package/dist/Components/Table/Types/Persistence/DatatableViewEnvelope.js +1 -0
  30. package/dist/Components/Table/Types/Persistence/DatatableViewKind.d.ts +10 -0
  31. package/dist/Components/Table/Types/Persistence/DatatableViewKind.js +1 -0
  32. package/dist/Components/Table/Types/Persistence/JSONActiveView.d.ts +58 -0
  33. package/dist/Components/Table/Types/Persistence/JSONActiveView.js +41 -0
  34. package/dist/Components/Table/Types/Persistence/JSONTableFilter.d.ts +53 -0
  35. package/dist/Components/Table/Types/Persistence/JSONTableFilter.js +42 -0
  36. package/dist/Components/Table/Types/Persistence/RemoteTableLayoutAdapter.d.ts +47 -0
  37. package/dist/Components/Table/Types/Persistence/RemoteTableLayoutAdapter.js +1 -0
  38. package/dist/Components/Table/Types/Public/CreateTableOptions.d.ts +10 -0
  39. package/dist/Components/Table/Types/Public/TablePersistence.d.ts +1 -4
  40. package/dist/Components/Table/Types/Public/TableSubApis.d.ts +0 -18
  41. package/dist/Components/Table/Types/Public/index.d.ts +1 -1
  42. package/dist/Components/Table/createTable.svelte.js +2 -0
  43. package/dist/index.d.ts +8 -1
  44. package/dist/index.js +9 -0
  45. package/package.json +1 -1
  46. package/dist/Components/Table/Types/Columns/Definitions/ColumnDefSet.d.ts +0 -20
  47. package/dist/Components/Table/Types/Columns/Definitions/JSONColumnDefSet.d.ts +0 -25
  48. /package/dist/Components/Table/{Types/Columns/Definitions/ColumnDefSet.js → Misc/TableConfigurationModalProps.js} +0 -0
  49. /package/dist/Components/Table/Types/{Columns/Definitions/JSONColumnDefSet.js → Persistence/DatatableView.js} +0 -0
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Schema version for the persisted `JSONActiveView` envelope. Bump when
3
+ * the shape or field semantics change in a backwards-incompatible way;
4
+ * `readVersionedJSON` silently drops envelopes written under a different
5
+ * version.
6
+ */
7
+ export const TABLE_ACTIVE_VIEW_SCHEMA_VERSION = 1;
8
+ /**
9
+ * Conservative typeguard for a persisted `JSONActiveView`. localStorage is
10
+ * same-origin-writable so the decoded value is untrusted; this checks the
11
+ * envelope shape, the `active` discriminated union, and every field's
12
+ * primitive type.
13
+ *
14
+ * The `id` referenced by a `kind: 'saved'` slot is *not* verified against
15
+ * the live saved-view list here - `TableContext` reconciles the persisted
16
+ * ref against the fetched views once they load.
17
+ */
18
+ export function isJSONActiveView(raw) {
19
+ if (typeof raw !== 'object' || raw === null) {
20
+ return false;
21
+ }
22
+ const candidate = raw;
23
+ if (typeof candidate.dirty !== 'boolean') {
24
+ return false;
25
+ }
26
+ return isActiveViewRef(candidate.active);
27
+ }
28
+ /** Validates the `ActiveViewRef` discriminated union. */
29
+ function isActiveViewRef(raw) {
30
+ if (typeof raw !== 'object' || raw === null) {
31
+ return false;
32
+ }
33
+ const candidate = raw;
34
+ if (candidate.kind === 'default') {
35
+ return true;
36
+ }
37
+ if (candidate.kind === 'saved') {
38
+ return typeof candidate.id === 'string' && typeof candidate.name === 'string';
39
+ }
40
+ return false;
41
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Serialisable snapshot of a table's *filter* state - the per-column
3
+ * filter values and per-column filter modes a user builds up in the
4
+ * quick-filter row or advanced filter panel.
5
+ *
6
+ * This is the filter counterpart of `JSONTableLayout` (column order /
7
+ * visibility / pinning / width). It is the JSON body persisted inside a
8
+ * saved `DatatableView` of `kind: 'filter'`, and is deliberately narrow:
9
+ * sort order and pagination are *not* part of a saved filter and are
10
+ * excluded by design.
11
+ *
12
+ * Both fields are plain JSON-survivable shapes - `filters` is an array of
13
+ * `{ id, value }` records and `modes` is a flat string map - because a
14
+ * `Map` does not survive `JSON.stringify`.
15
+ */
16
+ export interface JSONTableFilter {
17
+ /**
18
+ * Serialised per-column filter values, one entry per filtered column.
19
+ * `id` is the column id; `value` is the filter value as produced by
20
+ * the column's filter input and is `unknown` here because each column
21
+ * defines its own value shape (a later step narrows it per column).
22
+ */
23
+ filters: Array<{
24
+ id: string;
25
+ value: unknown;
26
+ }>;
27
+ /**
28
+ * Per-column filter mode, as a flat `columnId -> mode` string map.
29
+ * A `Map` does not survive `JSON.stringify`, so a plain record is
30
+ * used. The mode strings are an open set (the union of every column
31
+ * filter-mode enum); they are intentionally not validated against a
32
+ * fixed list here - a later step drops any mode it no longer knows.
33
+ */
34
+ modes: Record<string, string>;
35
+ }
36
+ /**
37
+ * Schema version for the persisted `JSONTableFilter` envelope. Bump when
38
+ * the shape or field semantics change in a backwards-incompatible way;
39
+ * `readVersionedJSON` silently drops envelopes written under a different
40
+ * version.
41
+ */
42
+ export declare const TABLE_FILTER_SCHEMA_VERSION = 1;
43
+ /**
44
+ * Conservative typeguard for a persisted `JSONTableFilter`. A saved
45
+ * filter can arrive from localStorage (same-origin-writable) or from a
46
+ * backend, so the decoded value is untrusted; this checks the envelope
47
+ * shape and every field's primitive type.
48
+ *
49
+ * It deliberately does *not* validate the mode strings against a fixed
50
+ * set - mode literals are an open set and a later step is responsible
51
+ * for dropping any mode it no longer recognises.
52
+ */
53
+ export declare function isJSONTableFilter(raw: unknown): raw is JSONTableFilter;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Schema version for the persisted `JSONTableFilter` envelope. Bump when
3
+ * the shape or field semantics change in a backwards-incompatible way;
4
+ * `readVersionedJSON` silently drops envelopes written under a different
5
+ * version.
6
+ */
7
+ export const TABLE_FILTER_SCHEMA_VERSION = 1;
8
+ /**
9
+ * Conservative typeguard for a persisted `JSONTableFilter`. A saved
10
+ * filter can arrive from localStorage (same-origin-writable) or from a
11
+ * backend, so the decoded value is untrusted; this checks the envelope
12
+ * shape and every field's primitive type.
13
+ *
14
+ * It deliberately does *not* validate the mode strings against a fixed
15
+ * set - mode literals are an open set and a later step is responsible
16
+ * for dropping any mode it no longer recognises.
17
+ */
18
+ export function isJSONTableFilter(raw) {
19
+ if (typeof raw !== 'object' || raw === null) {
20
+ return false;
21
+ }
22
+ const candidate = raw;
23
+ if (!Array.isArray(candidate.filters) || !candidate.filters.every(isFilterEntry)) {
24
+ return false;
25
+ }
26
+ return isStringRecord(candidate.modes);
27
+ }
28
+ /** Validates one `{ id: string; value: unknown }` filter entry. */
29
+ function isFilterEntry(raw) {
30
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
31
+ return false;
32
+ }
33
+ const candidate = raw;
34
+ return typeof candidate.id === 'string';
35
+ }
36
+ /** Validates a plain (non-array) object whose values are all strings. */
37
+ function isStringRecord(raw) {
38
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
39
+ return false;
40
+ }
41
+ return Object.values(raw).every((value) => typeof value === 'string');
42
+ }
@@ -0,0 +1,47 @@
1
+ import type { CreateDatatableViewRequest, DatatableView, UpdateDatatableViewRequest } from './DatatableView.js';
2
+ /**
3
+ * Injected backend adapter for saved datatable layouts and filters.
4
+ *
5
+ * scoria stays backend-agnostic: it defines this interface but never
6
+ * implements it. The host app supplies an implementation (over HTTP, a
7
+ * local store, a mock, etc.) via the `remoteLayouts` `createTable`
8
+ * option, and scoria calls it to list / create / update / delete saved
9
+ * views and to manage subscribers.
10
+ *
11
+ * Failure contract: every method is async and *rejects* on failure -
12
+ * implementations must never return error sentinels (no `null`, no
13
+ * `{ ok: false }`). The one documented exception is a backend
14
+ * "not found": `listViews` treats it as an empty list rather than a
15
+ * rejection.
16
+ */
17
+ export interface RemoteTableLayoutAdapter {
18
+ /** All views (layouts AND filters) visible to the current user for one
19
+ * datatable: owned + subscribed. The implementer treats a backend
20
+ * "not found" as an empty list. */
21
+ listViews(datatableUuid: string): Promise<ReadonlyArray<DatatableView>>;
22
+ /**
23
+ * The *public* views (layouts AND filters) for one datatable that the
24
+ * current user could subscribe to but does not already own or
25
+ * subscribe to - i.e. the candidates for the modal's "Subscribe to
26
+ * Additional..." picker. Implementations should exclude anything
27
+ * already returned by `listViews` so the two lists never overlap. As
28
+ * with `listViews`, a backend "not found" is treated as an empty
29
+ * list rather than a rejection.
30
+ *
31
+ * Added in A4a: the Table Configuration modal needs a discovery
32
+ * surface for subscribable views. The backend's `GET
33
+ * /datatable-state` already returns `publicLayouts` / `publicFilters`,
34
+ * so a host can implement this directly.
35
+ */
36
+ listPublicViews(datatableUuid: string): Promise<ReadonlyArray<DatatableView>>;
37
+ /** Persist a brand-new view; returns the server-assigned record. */
38
+ createView(request: CreateDatatableViewRequest): Promise<DatatableView>;
39
+ /** Update an existing view's name and/or body. */
40
+ updateView(request: UpdateDatatableViewRequest): Promise<DatatableView>;
41
+ /** Delete a view the current user owns. */
42
+ deleteView(viewId: string): Promise<void>;
43
+ /** v1 sharing: add the given user as a subscriber. */
44
+ addSubscriber(viewId: string, userId: string): Promise<void>;
45
+ /** Remove a subscriber. */
46
+ removeSubscriber(viewId: string, userId: string): Promise<void>;
47
+ }
@@ -4,6 +4,7 @@ import type { ColumnFactory } from './ColumnFactory.js';
4
4
  import type { ColumnSpec } from './ColumnSpec.js';
5
5
  import type { LiteralRowIdKey } from './KeyConstraints.js';
6
6
  import type { CustomRemoteFilters } from '../Filtering/CustomRemoteFilters.js';
7
+ import type { RemoteTableLayoutAdapter } from '../Persistence/RemoteTableLayoutAdapter.js';
7
8
  import type { RowSource } from './RowSource.js';
8
9
  import type { SelectionOptions } from './SelectionOptions.js';
9
10
  import type { TableInitialState } from './TableInitialState.js';
@@ -89,6 +90,15 @@ export interface CreateTableOptions<TRow extends object, TRowId extends Primitiv
89
90
  * per-column callback resolves. A per-column callback that throws or
90
91
  * rejects suppresses the corresponding `onAnyEdit`. */
91
92
  onAnyEdit?: (event: AnyEditEvent<TRow>) => void | Promise<void>;
93
+ /** Stable per-table identifier (a hard-coded constant supplied by the
94
+ * host app). Identifies which datatable saved views belong to. Omit to
95
+ * disable remote views - the table then behaves exactly as before
96
+ * (localStorage working copy only). */
97
+ datatableUuid?: string;
98
+ /** Injected backend adapter for saved layouts/filters. Omit to disable
99
+ * remote views. scoria stays backend-agnostic; the host app supplies
100
+ * this. */
101
+ remoteLayouts?: RemoteTableLayoutAdapter;
92
102
  /** Identity for storage namespacing and remote-request authentication.
93
103
  * Defaults to `() => undefined`, which namespaces persisted state under
94
104
  * the literal segment `'anon'`. */
@@ -13,9 +13,6 @@ export type TablePersistence = boolean | TablePersistenceObject;
13
13
  /** Object form of `TablePersistence`. Use when enabling some layers and
14
14
  * disabling others; the boolean form is the all-or-nothing shortcut. */
15
15
  export interface TablePersistenceObject {
16
- /** Saved column presets (visibility / pinning / sizing snapshots). Default
17
- * true. */
18
- presets?: boolean;
19
16
  /** User-controlled table settings (compact mode, alternate row colours,
20
17
  * single-click editing, etc.). Default true. */
21
18
  settings?: boolean;
@@ -25,7 +22,7 @@ export interface TablePersistenceObject {
25
22
  * columns). Default true. */
26
23
  activeExpand?: boolean;
27
24
  /** Custom storage backend. Useful for tests; defaults to `localStorage`
28
- * for presets and settings, `sessionStorage` for active state. */
25
+ * for settings, `sessionStorage` for active state. */
29
26
  storage?: TableStorageAdapter;
30
27
  }
31
28
  /** Storage backend hook for tests and custom persistence. Mirrors the subset
@@ -126,25 +126,7 @@ export interface FocusApi<TRow extends object> {
126
126
  * flows from `Table<TRow, ...>` into focus callbacks. Never read. */
127
127
  readonly _row?: TRow;
128
128
  }
129
- /** Stored preset shape. Mirrors the existing internal `JSONColumnDefSet`. */
130
- export interface SavedPreset {
131
- readonly name: string;
132
- readonly savedAt: string;
133
- readonly columns: ReadonlyArray<{
134
- readonly id: string;
135
- readonly visible: boolean;
136
- readonly width: number;
137
- readonly pinned: 'left' | 'right' | 'none';
138
- }>;
139
- }
140
129
  export interface PreferencesApi<TRow extends object> {
141
- /** Saved column presets. Reactive. */
142
- readonly presets: ReadonlyArray<SavedPreset>;
143
- /** Currently-applied preset, or `undefined`. */
144
- readonly selectedPreset: SavedPreset | undefined;
145
- savePreset(name: string): void;
146
- applyPreset(preset: SavedPreset): void;
147
- deletePreset(name: string): void;
148
130
  /** Live table settings (compact mode, etc). Reading via `.settings.x`
149
131
  * is reactive; writing via the per-field setters below persists. */
150
132
  readonly settings: Readonly<TableSettings>;
@@ -15,4 +15,4 @@ export type { SelectionOptions } from './SelectionOptions.js';
15
15
  export type { Table } from './Table.js';
16
16
  export type { TableInitialState } from './TableInitialState.js';
17
17
  export type { TablePersistence, TablePersistenceObject, TableStorageAdapter, } from './TablePersistence.js';
18
- export type { ClipboardApi, ColumnsApi, FilteringApi, FocusApi, ModalApi, PaginationApi, PreferencesApi, SavedPreset, SelectionApi, SortingApi, } from './TableSubApis.js';
18
+ export type { ClipboardApi, ColumnsApi, FilteringApi, FocusApi, ModalApi, PaginationApi, PreferencesApi, SelectionApi, SortingApi, } from './TableSubApis.js';
@@ -77,6 +77,8 @@ export function createTable(options) {
77
77
  toolbar: translateToolbar(options.toolbar),
78
78
  displayFooter: options.showFooter,
79
79
  onEditCell,
80
+ datatableUuid: options.datatableUuid,
81
+ remoteLayouts: options.remoteLayouts,
80
82
  debug: options.debug,
81
83
  };
82
84
  const ctx = TableContext.init(defsWrapper, options.name, repository, initOptions);
package/dist/index.d.ts CHANGED
@@ -103,11 +103,18 @@ export { type SwitchProps } from './Components/SwitchProps.js';
103
103
  export type { TabGroupButtonProps } from './Components/TabGroupButtonProps.js';
104
104
  export { default as Table, type TableProps } from './Components/Table/Table.svelte';
105
105
  export { createTable, customRows, localRows, remoteRows, } from './Components/Table/createTable.svelte.js';
106
- export type { ActionsColumnOptions, AnyEditEvent, BaseColumnOptions, BooleanKeyOf, BubbleColumnOptions, CheckboxColumnOptions, ClipboardApi, ColumnFactory as TableColumnFactory, ColumnKind, ColumnSpec, ColumnsApi, CreateTableOptions, CustomRowSource, DateColumnOptions, DateKeyOf, DisplayColumnOptions, DisplayModalProps, ExpandColumnOptions, ExpandInnerTableOptions, FilterOnlyColumnOptions, FilteringApi, FocusApi, LiteralRowIdKey, LocalRowSource, ModalApi, NumberColumnOptions, NumberKeyOf, PaginationApi, PreferencesApi, ProgressColumnOptions, QueryColumnOptions, RemoteRowSource, RowAction, RowFetchRequest, RowFetchResponse, RowSelectionColumnOptions, RowSource, SavedPreset, SelectColumnOptions, SelectionApi, SelectionOptions, SortingApi, StringKeyOf, Table as TableInstance, TableInitialState, TablePersistence, TablePersistenceObject, TableStorageAdapter, TextColumnOptions, ValidityColumnOptions, } from './Components/Table/Types/Public/index.js';
106
+ export type { ActionsColumnOptions, AnyEditEvent, BaseColumnOptions, BooleanKeyOf, BubbleColumnOptions, CheckboxColumnOptions, ClipboardApi, ColumnFactory as TableColumnFactory, ColumnKind, ColumnSpec, ColumnsApi, CreateTableOptions, CustomRowSource, DateColumnOptions, DateKeyOf, DisplayColumnOptions, DisplayModalProps, ExpandColumnOptions, ExpandInnerTableOptions, FilterOnlyColumnOptions, FilteringApi, FocusApi, LiteralRowIdKey, LocalRowSource, ModalApi, NumberColumnOptions, NumberKeyOf, PaginationApi, PreferencesApi, ProgressColumnOptions, QueryColumnOptions, RemoteRowSource, RowAction, RowFetchRequest, RowFetchResponse, RowSelectionColumnOptions, RowSource, SelectColumnOptions, SelectionApi, SelectionOptions, SortingApi, StringKeyOf, Table as TableInstance, TableInitialState, TablePersistence, TablePersistenceObject, TableStorageAdapter, TextColumnOptions, ValidityColumnOptions, } from './Components/Table/Types/Public/index.js';
107
107
  export { type CellCoordinates } from './Components/Table/Types/Coordinates/CellCoordinates.js';
108
108
  export { type ColumnPinningState } from './Components/Table/Types/Columns/ColumnPinningState.js';
109
109
  export { type ColumnSizingState } from './Components/Table/Types/Columns/ColumnSizingState.js';
110
110
  export { type VisibilityState } from './Components/Table/Types/Columns/VisibilityState.js';
111
+ export { type JSONTableLayout, TABLE_LAYOUT_SCHEMA_VERSION, isJSONTableLayout, } from './Components/Table/Types/Columns/JSONTableLayout.js';
112
+ export { type JSONTableFilter, TABLE_FILTER_SCHEMA_VERSION, isJSONTableFilter, } from './Components/Table/Types/Persistence/JSONTableFilter.js';
113
+ export { type DatatableViewKind } from './Components/Table/Types/Persistence/DatatableViewKind.js';
114
+ export { type DatatableViewBody } from './Components/Table/Types/Persistence/DatatableViewEnvelope.js';
115
+ export type { CreateDatatableViewRequest, DatatableView, DatatableViewSubscriber, DatatableViewSubscription, UpdateDatatableViewRequest, } from './Components/Table/Types/Persistence/DatatableView.js';
116
+ export { type RemoteTableLayoutAdapter } from './Components/Table/Types/Persistence/RemoteTableLayoutAdapter.js';
117
+ export { type ActiveViewRef, type JSONActiveView, TABLE_ACTIVE_VIEW_SCHEMA_VERSION, isJSONActiveView, } from './Components/Table/Types/Persistence/JSONActiveView.js';
111
118
  export { type ValidationFn } from './Components/Table/Types/Columns/Definitions/ValidationFn.js';
112
119
  export { type TableSettings } from './Components/Table/Types/Context/TableSettings.js';
113
120
  export { type ColumnFilter, type ColumnFiltersState, } from './Components/Table/Types/Filtering/ColumnFiltersState.js';
package/dist/index.js CHANGED
@@ -86,6 +86,15 @@ export {} from './Components/Table/Types/Coordinates/CellCoordinates.js';
86
86
  export {} from './Components/Table/Types/Columns/ColumnPinningState.js';
87
87
  export {} from './Components/Table/Types/Columns/ColumnSizingState.js';
88
88
  export {} from './Components/Table/Types/Columns/VisibilityState.js';
89
+ export { TABLE_LAYOUT_SCHEMA_VERSION, isJSONTableLayout, } from './Components/Table/Types/Columns/JSONTableLayout.js';
90
+ // ─── Datatable saved views (FPM 403): layout/filter persistence DTOs ───
91
+ // The frozen contract the consuming host app codes its `RemoteTableLayoutAdapter`
92
+ // implementation against. Inert in scoria until later steps wire them.
93
+ export { TABLE_FILTER_SCHEMA_VERSION, isJSONTableFilter, } from './Components/Table/Types/Persistence/JSONTableFilter.js';
94
+ export {} from './Components/Table/Types/Persistence/DatatableViewKind.js';
95
+ export {} from './Components/Table/Types/Persistence/DatatableViewEnvelope.js';
96
+ export {} from './Components/Table/Types/Persistence/RemoteTableLayoutAdapter.js';
97
+ export { TABLE_ACTIVE_VIEW_SCHEMA_VERSION, isJSONActiveView, } from './Components/Table/Types/Persistence/JSONActiveView.js';
89
98
  export {} from './Components/Table/Types/Columns/Definitions/ValidationFn.js';
90
99
  export {} from './Components/Table/Types/Context/TableSettings.js';
91
100
  export {} from './Components/Table/Types/Filtering/ColumnFiltersState.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.37.55",
4
+ "version": "0.38.0",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
@@ -1,20 +0,0 @@
1
- import type { SortingState } from '../../DataRepository/SortingState.js';
2
- import type { ColumnPinningState } from '../ColumnPinningState.js';
3
- import type { VisibilityState } from '../VisibilityState.js';
4
- import type { ColumnDef } from './ColumnDef.svelte.js';
5
- /**
6
- * A named runtime preset: a snapshot of the column-defs array plus the
7
- * sort / visibility / pinning state to apply when the preset is loaded.
8
- * Used by the column-preset dropdown for save/load.
9
- *
10
- * The serialised mirror is `JSONColumnDefSet` (substitutes
11
- * `JSONColumnPinningState` for `ColumnPinningState` and
12
- * `Array<ColumnJSONRepresentation>` for `Array<ColumnDef<T>>`).
13
- */
14
- export interface ColumnDefSet<T extends object> {
15
- name: string;
16
- sortingState: SortingState;
17
- visibilityState: VisibilityState;
18
- columnPinningState: ColumnPinningState;
19
- columnDefs: Array<ColumnDef<T>>;
20
- }
@@ -1,25 +0,0 @@
1
- import type { SortingState } from '../../DataRepository/SortingState.js';
2
- import type { JSONColumnPinningState } from '../JSONColumnPinningState.js';
3
- import type { VisibilityState } from '../VisibilityState.js';
4
- import type { ColumnJSONRepresentation } from './ColumnDef.svelte.js';
5
- /**
6
- * Persisted-to-localStorage projection of `ColumnDefSet`. Differs from the
7
- * runtime form in that:
8
- *
9
- * - `columnPinningState` is `JSONColumnPinningState` (`Array<[id, width]>`)
10
- * instead of `ReadonlyMap`-based for `JSON.stringify` round-tripping.
11
- * - `columnDefs` carries the JSON representation of each `ColumnDef`
12
- * (a `ColumnJSONRepresentation` produced by `toJSON()` on each def) rather
13
- * than the live class instances.
14
- *
15
- * Security note: `JSONColumnDefSet` is read back from localStorage and must
16
- * pass schema validation before being trusted. The validator helper is
17
- * tracked under the StoragePresetSchemaValidation cross-cutting workorder.
18
- */
19
- export interface JSONColumnDefSet {
20
- name: string;
21
- sortingState: SortingState;
22
- visibilityState: VisibilityState;
23
- columnPinningState: JSONColumnPinningState;
24
- columnDefs: Array<ColumnJSONRepresentation>;
25
- }