@gemologic/sheen-table 0.2.1 → 0.4.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 (71) hide show
  1. package/dist/DataTable.d.ts +58 -10
  2. package/dist/DataTable.js +1294 -1625
  3. package/dist/DataTableToolbar.js +1 -2
  4. package/dist/FilterBar.d.ts +3 -0
  5. package/dist/FilterBar.js +131 -108
  6. package/dist/QueryBuilder.js +72 -68
  7. package/dist/cell-edit.js +1 -2
  8. package/dist/client-state.d.ts +9 -3
  9. package/dist/client-state.js +36 -31
  10. package/dist/client-view.js +12 -13
  11. package/dist/column-layout.js +1 -2
  12. package/dist/columns.d.ts +5 -1
  13. package/dist/columns.js +7 -5
  14. package/dist/constrained-columns.js +1 -2
  15. package/dist/core.d.ts +5 -5
  16. package/dist/core.js +28 -28
  17. package/dist/data-table-features.d.ts +134 -0
  18. package/dist/data-table-features.js +560 -0
  19. package/dist/export.js +1 -2
  20. package/dist/facets.js +5 -7
  21. package/dist/filter-bar-state.js +14 -18
  22. package/dist/filter-client.js +1 -2
  23. package/dist/filter.js +1 -2
  24. package/dist/grouping.js +1 -2
  25. package/dist/index.d.ts +5 -3
  26. package/dist/index.js +32 -31
  27. package/dist/messages.d.ts +4 -1
  28. package/dist/messages.js +5 -3
  29. package/dist/pagination.d.ts +43 -1
  30. package/dist/pagination.js +110 -56
  31. package/dist/query-builder-state.js +1 -2
  32. package/dist/requests.d.ts +3 -3
  33. package/dist/requests.js +39 -30
  34. package/dist/row-hierarchy.js +1 -2
  35. package/dist/row-identity.js +1 -2
  36. package/dist/saved-views.d.ts +17 -14
  37. package/dist/saved-views.js +72 -70
  38. package/dist/search-controller.js +1 -2
  39. package/dist/search.js +1 -2
  40. package/dist/selection-client.js +1 -2
  41. package/dist/selection.d.ts +3 -0
  42. package/dist/selection.js +9 -2
  43. package/dist/server-export.d.ts +16 -7
  44. package/dist/server-export.js +58 -55
  45. package/dist/sorting.js +1 -2
  46. package/dist/table-state-changes.d.ts +6 -3
  47. package/dist/table-state-changes.js +45 -42
  48. package/dist/table-state.d.ts +20 -4
  49. package/dist/table-state.js +67 -42
  50. package/dist/text-normalization.js +1 -2
  51. package/dist/url-state.d.ts +12 -9
  52. package/dist/url-state.js +34 -32
  53. package/package.json +5 -5
  54. package/src/DataTable.tsx +490 -766
  55. package/src/FilterBar.tsx +19 -3
  56. package/src/QueryBuilder.tsx +5 -5
  57. package/src/client-state.ts +31 -17
  58. package/src/columns.ts +9 -3
  59. package/src/core.ts +5 -5
  60. package/src/data-table-features.tsx +592 -0
  61. package/src/index.ts +5 -3
  62. package/src/messages.ts +2 -2
  63. package/src/pagination.ts +83 -14
  64. package/src/requests.ts +22 -8
  65. package/src/saved-views.ts +33 -11
  66. package/src/selection.ts +8 -0
  67. package/src/server-export.ts +17 -11
  68. package/src/styles.css +17 -11
  69. package/src/table-state-changes.ts +22 -12
  70. package/src/table-state.ts +53 -11
  71. package/src/url-state.ts +27 -10
@@ -1,67 +1,70 @@
1
- import { changeClientViewState as e } from "./client-state.js";
2
- import { parseTableState as t } from "./table-state.js";
3
- //#region src/table-state-changes.ts
4
- function n(n, r, i) {
5
- let a = t(n, i), o = {
6
- search: a.search,
7
- filter: a.filter,
8
- sorting: a.sorting,
9
- pagination: a.pagination
1
+ import { changeQueryState as e } from "./client-state.js";
2
+ import { parseCursorPagination as t, parsePagination as n } from "./pagination.js";
3
+ import { parseTableStateWith as r, schemaPagination as i } from "./table-state.js";
4
+ // src/table-state-changes.ts
5
+ function a(e, r, a) {
6
+ return i(a) === "cursor" ? o(e, r, a, t) : o(e, r, a, n);
7
+ }
8
+ function o(t, n, i, a) {
9
+ let o = (e) => r(e, i, a), s = (t, n) => e(t, n, i, a), c = o(t), l = {
10
+ search: c.search,
11
+ filter: c.filter,
12
+ sorting: c.sorting,
13
+ pagination: c.pagination
10
14
  };
11
- switch (r.kind) {
12
- case "query": return t({
13
- ...e(o, r.change, i),
14
- columns: a.columns
15
- }, i);
15
+ switch (n.kind) {
16
+ case "query": return o({
17
+ ...s(l, n.change),
18
+ columns: c.columns
19
+ });
16
20
  case "sortCycle": {
17
- if (!i.sortColumns.some((e) => e.id === r.column)) throw Error(`Column does not support sorting: ${r.column}`);
18
- let n = a.sorting.find((e) => e.column === r.column), s = n?.direction === "desc" ? null : {
19
- column: r.column,
20
- direction: n ? "desc" : "asc"
21
- }, c;
22
- return c = r.multiple ? !n && s ? [...a.sorting, s] : a.sorting.flatMap((e) => e.column === r.column ? s ? [s] : [] : [e]) : s ? [s] : [], t({
23
- ...e(o, {
21
+ if (!i.sortColumns.some((e) => e.id === n.column)) throw Error(`Column does not support sorting: ${n.column}`);
22
+ let e = c.sorting.find((e) => e.column === n.column), t = e?.direction === "desc" ? null : {
23
+ column: n.column,
24
+ direction: e ? "desc" : "asc"
25
+ }, r;
26
+ return r = n.multiple ? !e && t ? [...c.sorting, t] : c.sorting.flatMap((e) => e.column === n.column ? t ? [t] : [] : [e]) : t ? [t] : [], o({
27
+ ...s(l, {
24
28
  kind: "sorting",
25
- value: c
26
- }, i),
27
- columns: a.columns
28
- }, i);
29
+ value: r
30
+ }),
31
+ columns: c.columns
32
+ });
29
33
  }
30
34
  case "columnOrder": {
31
- let e = new Map(a.columns.map((e) => [e.id, e]));
32
- return t({
33
- ...a,
34
- columns: Array.from(r.ids, (t) => e.get(t))
35
- }, i);
35
+ let e = new Map(c.columns.map((e) => [e.id, e]));
36
+ return o({
37
+ ...c,
38
+ columns: Array.from(n.ids, (t) => e.get(t))
39
+ });
36
40
  }
37
41
  case "columnVisibility":
38
42
  case "columnWidth":
39
43
  case "columnPin": {
40
- if (!a.columns.some((e) => e.id === r.column)) throw Error(`Unknown table column: ${r.column}`);
41
- let e = a.columns.map((e) => {
42
- if (e.id !== r.column) return e;
43
- switch (r.kind) {
44
+ if (!c.columns.some((e) => e.id === n.column)) throw Error(`Unknown table column: ${n.column}`);
45
+ let e = c.columns.map((e) => {
46
+ if (e.id !== n.column) return e;
47
+ switch (n.kind) {
44
48
  case "columnVisibility": return {
45
49
  ...e,
46
- visible: r.visible
50
+ visible: n.visible
47
51
  };
48
52
  case "columnWidth": return {
49
53
  ...e,
50
- width: r.width
54
+ width: n.width
51
55
  };
52
56
  case "columnPin": return {
53
57
  ...e,
54
- pin: r.pin
58
+ pin: n.pin
55
59
  };
56
60
  }
57
61
  });
58
- return t({
59
- ...a,
62
+ return o({
63
+ ...c,
60
64
  columns: e
61
- }, i);
65
+ });
62
66
  }
63
67
  default: throw Error("Unknown table state change");
64
68
  }
65
69
  }
66
- //#endregion
67
- export { n as changeTableState };
70
+ export { a as changeTableState, o as changeTableStateWith };
@@ -1,5 +1,5 @@
1
- import type { ClientStateSchema } from "./client-state.ts";
2
- import type { ClientViewState } from "./client-view.ts";
1
+ import type { ClientStateSchema, QueryState } from "./client-state.ts";
2
+ import type { CursorPagination, ServerPagination, TablePagination } from "./pagination.ts";
3
3
  export interface ColumnState {
4
4
  readonly id: string;
5
5
  readonly visible: boolean;
@@ -7,14 +7,30 @@ export interface ColumnState {
7
7
  readonly width: number | null;
8
8
  readonly pin: "start" | "end" | false;
9
9
  }
10
- export interface TableState extends ClientViewState {
10
+ export interface TableState<Pagination extends ServerPagination = TablePagination> extends QueryState<Pagination> {
11
11
  /** Array order is the user-defined column order. Every available column occurs once. */
12
12
  readonly columns: readonly ColumnState[];
13
13
  }
14
- export interface TableStateSchema extends ClientStateSchema {
14
+ /** Shared column and query fields; internal pagination-generic owners accept it. */
15
+ export interface TableStateSchemaFields extends ClientStateSchema {
15
16
  readonly columns: readonly string[];
16
17
  }
18
+ /** Schema for complete or numbered pagination state. */
19
+ export interface TableStateSchema extends TableStateSchemaFields {
20
+ readonly pagination?: never;
21
+ }
22
+ /** Schema for cursor pagination state. Persisted envelopes always store `cursor: null` because cursor tokens are short-lived. */
23
+ export interface CursorTableStateSchema extends TableStateSchemaFields {
24
+ readonly pagination: "cursor";
25
+ }
26
+ /** Cursor schemas read only cursor state; other schemas read complete or numbered state. Unknown schema kinds fail closed. */
27
+ export declare function schemaPagination(schema: TableStateSchema | CursorTableStateSchema): "cursor" | "page";
17
28
  /** Strictly validate before applying saved/URL state, never partially restore it. */
29
+ export declare function parseTableState(value: unknown, schema: CursorTableStateSchema): TableState<CursorPagination>;
18
30
  export declare function parseTableState(value: unknown, schema: TableStateSchema): TableState;
31
+ export declare function parseTableStateWith<Pagination extends ServerPagination>(value: unknown, schema: TableStateSchemaFields, readPagination: (value: unknown) => Pagination): TableState<Pagination>;
32
+ /** Cursor state is persisted as its first page: the live cursor token is replaced with null. */
33
+ export declare function serializeState(state: TableState<CursorPagination>, schema: CursorTableStateSchema): string;
19
34
  export declare function serializeState(state: TableState, schema: TableStateSchema): string;
35
+ export declare function deserializeState(serialized: string, schema: CursorTableStateSchema): TableState<CursorPagination>;
20
36
  export declare function deserializeState(serialized: string, schema: TableStateSchema): TableState;
@@ -1,46 +1,61 @@
1
- import { parseClientViewState as e } from "./client-state.js";
2
- //#region src/table-state.ts
3
- function t(e) {
1
+ import { parseQueryState as e } from "./client-state.js";
2
+ import { parseCursorPagination as t, parsePagination as n } from "./pagination.js";
3
+ // src/table-state.ts
4
+ function r(e) {
4
5
  return typeof e == "object" && !!e && !Array.isArray(e);
5
6
  }
6
- function n(e, t, n) {
7
+ function i(e, t, n) {
7
8
  for (let r of Object.keys(e)) if (!t.includes(r)) throw Error(`Invalid table state at ${n}: unknown field ${r}`);
8
9
  for (let r of t) if (!Object.hasOwn(e, r)) throw Error(`Invalid table state at ${n}: missing ${r}`);
9
10
  }
10
- function r(r, i) {
11
- let a = /* @__PURE__ */ new Set();
12
- for (let e of i.columns) {
13
- if (typeof e != "string" || !e.trim() || a.has(e)) throw Error("Invalid or duplicate table schema column");
14
- a.add(e);
11
+ function a(e) {
12
+ let t = e.pagination;
13
+ if (t === void 0) return "page";
14
+ if (t === "cursor") return t;
15
+ throw Error("Table state schema pagination must be omitted or cursor");
16
+ }
17
+ function o(e) {
18
+ let n = t(e);
19
+ if (n.cursor !== null) throw Error("Persisted cursor pagination must use cursor: null");
20
+ return n;
21
+ }
22
+ function s(e, r) {
23
+ return a(r) === "cursor" ? c(e, r, t) : c(e, r, n);
24
+ }
25
+ function c(t, n, a) {
26
+ let o = /* @__PURE__ */ new Set();
27
+ for (let e of n.columns) {
28
+ if (typeof e != "string" || !e.trim() || o.has(e)) throw Error("Invalid or duplicate table schema column");
29
+ o.add(e);
15
30
  }
16
- for (let e of [...i.filterColumns, ...i.sortColumns]) if (!a.has(e.id)) throw Error(`Query schema references unavailable table column: ${e.id}`);
17
- if (!t(r)) throw Error("Invalid table state: expected an object");
18
- n(r, [
31
+ for (let e of [...n.filterColumns, ...n.sortColumns]) if (!o.has(e.id)) throw Error(`Query schema references unavailable table column: ${e.id}`);
32
+ if (!r(t)) throw Error("Invalid table state: expected an object");
33
+ i(t, [
19
34
  "search",
20
35
  "filter",
21
36
  "sorting",
22
37
  "pagination",
23
38
  "columns"
24
39
  ], "$");
25
- let o = e({
26
- search: r.search,
27
- filter: r.filter,
28
- sorting: r.sorting,
29
- pagination: r.pagination
30
- }, i);
31
- if (!Array.isArray(r.columns) || r.columns.length !== a.size) throw Error("Invalid table state: expected one state entry per available column");
32
- let s = /* @__PURE__ */ new Set(), c = Array.from(r.columns, (e, r) => {
33
- let i = `$.columns[${r}]`;
34
- if (!t(e)) throw Error(`Invalid table state at ${i}: expected a column object`);
35
- if (n(e, [
40
+ let s = e({
41
+ search: t.search,
42
+ filter: t.filter,
43
+ sorting: t.sorting,
44
+ pagination: t.pagination
45
+ }, n, a);
46
+ if (!Array.isArray(t.columns) || t.columns.length !== o.size) throw Error("Invalid table state: expected one state entry per available column");
47
+ let c = /* @__PURE__ */ new Set(), l = Array.from(t.columns, (e, t) => {
48
+ let n = `$.columns[${t}]`;
49
+ if (!r(e)) throw Error(`Invalid table state at ${n}: expected a column object`);
50
+ if (i(e, [
36
51
  "id",
37
52
  "visible",
38
53
  "width",
39
54
  "pin"
40
- ], i), typeof e.id != "string" || !a.has(e.id) || s.has(e.id)) throw Error(`Invalid table state at ${i}: unknown or duplicate column`);
41
- if (s.add(e.id), typeof e.visible != "boolean") throw Error(`Invalid table state at ${i}: visible must be boolean`);
42
- if (e.width !== null && (typeof e.width != "number" || !Number.isFinite(e.width) || e.width <= 0)) throw Error(`Invalid table state at ${i}: width must be null or a positive finite pixel value`);
43
- if (e.pin !== !1 && e.pin !== "start" && e.pin !== "end") throw Error(`Invalid table state at ${i}: pin must be false, start, or end`);
55
+ ], n), typeof e.id != "string" || !o.has(e.id) || c.has(e.id)) throw Error(`Invalid table state at ${n}: unknown or duplicate column`);
56
+ if (c.add(e.id), typeof e.visible != "boolean") throw Error(`Invalid table state at ${n}: visible must be boolean`);
57
+ if (e.width !== null && (typeof e.width != "number" || !Number.isFinite(e.width) || e.width <= 0)) throw Error(`Invalid table state at ${n}: width must be null or a positive finite pixel value`);
58
+ if (e.pin !== !1 && e.pin !== "start" && e.pin !== "end") throw Error(`Invalid table state at ${n}: pin must be false, start, or end`);
44
59
  return Object.freeze({
45
60
  id: e.id,
46
61
  visible: e.visible,
@@ -49,29 +64,39 @@ function r(r, i) {
49
64
  });
50
65
  });
51
66
  return Object.freeze({
52
- ...o,
53
- columns: Object.freeze(c)
67
+ ...s,
68
+ columns: Object.freeze(l)
54
69
  });
55
70
  }
56
- function i(e, t) {
57
- let n = JSON.stringify({
71
+ function l(e) {
72
+ let t = JSON.stringify({
58
73
  version: 1,
59
- state: r(e, t)
74
+ state: e
60
75
  });
61
- if (n.length > 262144) throw Error("Serialized table state exceeds 262144 characters");
62
- return n;
76
+ if (t.length > 262144) throw Error("Serialized table state exceeds 262144 characters");
77
+ return t;
78
+ }
79
+ function u(e, r) {
80
+ if (a(r) === "page") return l(c(e, r, n));
81
+ let i = c(e, r, t);
82
+ return l(c({
83
+ ...i,
84
+ pagination: {
85
+ ...i.pagination,
86
+ cursor: null
87
+ }
88
+ }, r, o));
63
89
  }
64
- function a(e, i) {
90
+ function d(e, t) {
65
91
  if (e.length > 262144) throw Error("Serialized table state exceeds 262144 characters");
66
- let a;
92
+ let s;
67
93
  try {
68
- a = JSON.parse(e);
94
+ s = JSON.parse(e);
69
95
  } catch {
70
96
  throw Error("Invalid table state JSON");
71
97
  }
72
- if (!t(a)) throw Error("Invalid table state envelope");
73
- if (n(a, ["version", "state"], "$"), a.version !== 1) throw Error("Unsupported table state version");
74
- return r(a.state, i);
98
+ if (!r(s)) throw Error("Invalid table state envelope");
99
+ if (i(s, ["version", "state"], "$"), s.version !== 1) throw Error("Unsupported table state version");
100
+ return a(t) === "cursor" ? c(s.state, t, o) : c(s.state, t, n);
75
101
  }
76
- //#endregion
77
- export { a as deserializeState, r as parseTableState, i as serializeState };
102
+ export { d as deserializeState, s as parseTableState, c as parseTableStateWith, a as schemaPagination, u as serializeState };
@@ -1,4 +1,4 @@
1
- //#region src/text-normalization.ts
1
+ // src/text-normalization.ts
2
2
  var e = /^[\u0000-\u007f]*$/u;
3
3
  function t(t, n = !1) {
4
4
  let r = n || "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toLocaleLowerCase(t) === "abcdefghijklmnopqrstuvwxyz";
@@ -8,5 +8,4 @@ function t(t, n = !1) {
8
8
  return n ? a : a.toLocaleLowerCase(t).normalize("NFC");
9
9
  };
10
10
  }
11
- //#endregion
12
11
  export { t as createTextNormalizer };
@@ -1,4 +1,5 @@
1
- import type { TableState, TableStateSchema } from "./table-state.ts";
1
+ import type { CursorPagination, ServerPagination, TablePagination } from "./pagination.ts";
2
+ import type { CursorTableStateSchema, TableState, TableStateSchema } from "./table-state.ts";
2
3
  export interface TableUrlLocation {
3
4
  readonly pathname: string;
4
5
  readonly search: string;
@@ -11,11 +12,11 @@ export interface TableUrlRouter {
11
12
  readonly scroll?: boolean;
12
13
  }) => void;
13
14
  }
14
- export type TableUrlRead = {
15
+ export type TableUrlRead<Pagination extends ServerPagination = TablePagination> = {
15
16
  readonly kind: "absent";
16
17
  } | {
17
18
  readonly kind: "accepted";
18
- readonly state: TableState;
19
+ readonly state: TableState<Pagination>;
19
20
  } | {
20
21
  readonly kind: "invalid";
21
22
  readonly error: unknown;
@@ -27,13 +28,15 @@ export type TableUrlWrite = {
27
28
  readonly kind: "navigated";
28
29
  readonly to: string;
29
30
  };
30
- /** Pull-based URL state using the same structural adapter as AppShell. */
31
- export declare function createTableUrlState(router: TableUrlRouter, parameter: string, schema: TableStateSchema): {
32
- read: () => TableUrlRead;
33
- write: (state: TableState, options?: {
31
+ export interface TableUrlState<Pagination extends ServerPagination = TablePagination> {
32
+ readonly read: () => TableUrlRead<Pagination>;
33
+ readonly write: (state: TableState<Pagination>, options?: {
34
34
  readonly replace?: boolean;
35
35
  }) => TableUrlWrite;
36
- clear: (options?: {
36
+ readonly clear: (options?: {
37
37
  readonly replace?: boolean;
38
38
  }) => TableUrlWrite;
39
- };
39
+ }
40
+ /** Pull-based URL state using the same structural adapter as AppShell. Cursor schemas write and read only the first page. */
41
+ export declare function createTableUrlState(router: TableUrlRouter, parameter: string, schema: CursorTableStateSchema): TableUrlState<CursorPagination>;
42
+ export declare function createTableUrlState(router: TableUrlRouter, parameter: string, schema: TableStateSchema): TableUrlState;
package/dist/url-state.js CHANGED
@@ -1,10 +1,10 @@
1
- import { deserializeState as e, serializeState as t } from "./table-state.js";
2
- //#region src/url-state.ts
3
- function n(e) {
1
+ import { deserializeState as e, schemaPagination as t, serializeState as n } from "./table-state.js";
2
+ // src/url-state.ts
3
+ function r(e) {
4
4
  if (!/^[A-Za-z][A-Za-z0-9_.-]*$/.test(e)) throw Error("Table URL parameter must start with a letter and contain only letters, digits, dot, underscore, or hyphen");
5
5
  return e;
6
6
  }
7
- function r(e) {
7
+ function i(e) {
8
8
  if (!e.pathname.startsWith("/") || e.pathname.includes("?") || e.pathname.includes("#")) throw Error("Router pathname must be an absolute path without query or hash");
9
9
  if (e.hash && !e.hash.startsWith("#")) throw Error("Router hash must be empty or start with #");
10
10
  return {
@@ -13,20 +13,23 @@ function r(e) {
13
13
  hash: e.hash
14
14
  };
15
15
  }
16
- function i(e, t, n) {
16
+ function a(e, t, n) {
17
17
  let r = t.toString();
18
18
  return `${e}${r ? `?${r}` : ""}${n}`;
19
19
  }
20
- function a(a, o, s) {
21
- let c = n(o);
22
- function l() {
20
+ function o(r, i, a) {
21
+ return t(a), a.pagination, s(r, i, (e) => n(e, a), (t) => e(t, a));
22
+ }
23
+ function s(e, t, n, o) {
24
+ let s = r(t);
25
+ function c() {
23
26
  try {
24
- let { parameters: t } = r(a.location()), n = t.getAll(c);
27
+ let { parameters: t } = i(e.location()), n = t.getAll(s);
25
28
  if (n.length === 0) return Object.freeze({ kind: "absent" });
26
- if (n.length !== 1) throw Error(`Table URL parameter ${c} must occur exactly once`);
29
+ if (n.length !== 1) throw Error(`Table URL parameter ${s} must occur exactly once`);
27
30
  return Object.freeze({
28
31
  kind: "accepted",
29
- state: e(n[0] ?? "", s)
32
+ state: o(n[0] ?? "")
30
33
  });
31
34
  } catch (e) {
32
35
  return Object.freeze({
@@ -35,30 +38,30 @@ function a(a, o, s) {
35
38
  });
36
39
  }
37
40
  }
38
- function u(e, n = {}) {
39
- let o = r(a.location()), l = i(o.pathname, o.parameters, o.hash);
40
- o.parameters.set(c, t(e, s));
41
- let u = i(o.pathname, o.parameters, o.hash);
42
- return u === l ? Object.freeze({
41
+ function l(t, r = {}) {
42
+ let o = i(e.location()), c = a(o.pathname, o.parameters, o.hash);
43
+ o.parameters.set(s, n(t));
44
+ let l = a(o.pathname, o.parameters, o.hash);
45
+ return l === c ? Object.freeze({
43
46
  kind: "unchanged",
44
- to: u
45
- }) : (a.navigate(u, {
46
- replace: n.replace ?? !0,
47
+ to: l
48
+ }) : (e.navigate(l, {
49
+ replace: r.replace ?? !0,
47
50
  scroll: !1
48
51
  }), Object.freeze({
49
52
  kind: "navigated",
50
- to: u
53
+ to: l
51
54
  }));
52
55
  }
53
- function d(e = {}) {
54
- let t = r(a.location()), n = i(t.pathname, t.parameters, t.hash);
55
- t.parameters.delete(c);
56
- let o = i(t.pathname, t.parameters, t.hash);
57
- return o === n ? Object.freeze({
56
+ function u(t = {}) {
57
+ let n = i(e.location()), r = a(n.pathname, n.parameters, n.hash);
58
+ n.parameters.delete(s);
59
+ let o = a(n.pathname, n.parameters, n.hash);
60
+ return o === r ? Object.freeze({
58
61
  kind: "unchanged",
59
62
  to: o
60
- }) : (a.navigate(o, {
61
- replace: e.replace ?? !0,
63
+ }) : (e.navigate(o, {
64
+ replace: t.replace ?? !0,
62
65
  scroll: !1
63
66
  }), Object.freeze({
64
67
  kind: "navigated",
@@ -66,10 +69,9 @@ function a(a, o, s) {
66
69
  }));
67
70
  }
68
71
  return {
69
- read: l,
70
- write: u,
71
- clear: d
72
+ read: c,
73
+ write: l,
74
+ clear: u
72
75
  };
73
76
  }
74
- //#endregion
75
- export { a as createTableUrlState };
77
+ export { o as createTableUrlState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gemologic/sheen-table",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "Compact accessible data tables and query-building components for Sheen SolidJS applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -49,15 +49,15 @@
49
49
  "./styles.css": "./src/styles.css"
50
50
  },
51
51
  "peerDependencies": {
52
- "@gemologic/sheen": "0.2.1",
53
- "solid-js": "1.9.15"
52
+ "@gemologic/sheen": "0.4.0",
53
+ "solid-js": "1.9.19"
54
54
  },
55
55
  "dependencies": {
56
56
  "@tanstack/solid-virtual": "3.13.37"
57
57
  },
58
58
  "devDependencies": {
59
- "@gemologic/sheen": "0.2.1",
60
- "solid-js": "1.9.15",
59
+ "@gemologic/sheen": "0.4.0",
60
+ "solid-js": "1.9.19",
61
61
  "vite-plugin-solid": "2.11.14"
62
62
  },
63
63
  "scripts": {