@svgrid/enterprise 3.1.21 → 3.1.23

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 (89) hide show
  1. package/dist/SvGridBoard.svelte +39 -0
  2. package/dist/SvGridGallery.svelte +23 -0
  3. package/dist/SvGridRowCount.svelte +23 -0
  4. package/dist/SvGridRowCount.svelte.d.ts +6 -0
  5. package/dist/SvGridScheduler.svelte +25 -7
  6. package/dist/cdn/svgrid-enterprise.svelte-external.js +13838 -13554
  7. package/dist/designer/assets/GridFooter-DKMfZpL4.js +2 -0
  8. package/dist/designer/assets/GridMenus-DWDghydL.js +6 -0
  9. package/dist/designer/assets/{PinSplitter-C5AwA1xV.js → PinSplitter-BfIjd7pi.js} +1 -1
  10. package/dist/designer/assets/grid-extension.svelte-G1ng0xd2.js +1 -0
  11. package/dist/designer/assets/index-CHx3F4Ij.css +1 -0
  12. package/dist/designer/assets/{index-DLJjuVA4.js → index-CIxqRzKJ.js} +324 -324
  13. package/dist/designer/assets/merges-Bg-KqPEl.js +1 -0
  14. package/dist/designer/index.html +3 -3
  15. package/dist/expressions/compile.js +11 -7
  16. package/dist/expressions/evaluate.js +4 -0
  17. package/dist/expressions/expression-columns.d.ts +4 -1
  18. package/dist/expressions/expression-columns.js +12 -3
  19. package/dist/expressions/parse.js +19 -7
  20. package/dist/fields/RecordView.svelte +5 -2
  21. package/dist/fields/activity.svelte.d.ts +5 -2
  22. package/dist/fields/activity.svelte.js +4 -3
  23. package/dist/fields/grid-access.d.ts +1 -1
  24. package/dist/fields/grid-access.js +13 -3
  25. package/dist/fields/index.d.ts +18 -0
  26. package/dist/fields/index.js +31 -0
  27. package/dist/filter-labels.d.ts +16 -0
  28. package/dist/filter-labels.js +83 -0
  29. package/dist/index.d.ts +4 -0
  30. package/dist/index.js +7 -0
  31. package/dist/install.js +8 -0
  32. package/dist/node/studio.js +12 -5
  33. package/dist/relative-date-core.d.ts +40 -0
  34. package/dist/relative-date-core.js +85 -0
  35. package/dist/relative-dates.d.ts +28 -0
  36. package/dist/relative-dates.js +61 -0
  37. package/dist/review/GhostCell.svelte +60 -0
  38. package/dist/review/GhostCell.svelte.d.ts +14 -0
  39. package/dist/review/RichCellMark.svelte +72 -0
  40. package/dist/review/RichCellMark.svelte.d.ts +8 -0
  41. package/dist/review/SvReviewPanel.svelte +759 -0
  42. package/dist/review/SvReviewPanel.svelte.d.ts +16 -0
  43. package/dist/review/adapters.d.ts +79 -0
  44. package/dist/review/adapters.js +119 -0
  45. package/dist/review/agent.d.ts +52 -0
  46. package/dist/review/agent.js +232 -0
  47. package/dist/review/card-marks.svelte.d.ts +42 -0
  48. package/dist/review/card-marks.svelte.js +51 -0
  49. package/dist/review/cluster.d.ts +26 -0
  50. package/dist/review/cluster.js +377 -0
  51. package/dist/review/equal.d.ts +9 -0
  52. package/dist/review/equal.js +35 -0
  53. package/dist/review/formats.d.ts +31 -0
  54. package/dist/review/formats.js +37 -0
  55. package/dist/review/ghost.d.ts +17 -0
  56. package/dist/review/ghost.js +104 -0
  57. package/dist/review/index.d.ts +42 -0
  58. package/dist/review/index.js +36 -0
  59. package/dist/review/messages.d.ts +113 -0
  60. package/dist/review/messages.js +135 -0
  61. package/dist/review/model.svelte.d.ts +262 -0
  62. package/dist/review/model.svelte.js +883 -0
  63. package/dist/review/pending-filter.d.ts +26 -0
  64. package/dist/review/pending-filter.js +71 -0
  65. package/dist/review/rich-cells.d.ts +1 -0
  66. package/dist/review/rich-cells.js +36 -0
  67. package/dist/review/types.d.ts +83 -0
  68. package/dist/review/types.js +7 -0
  69. package/dist/row-count.d.ts +28 -0
  70. package/dist/row-count.js +39 -0
  71. package/dist/sort-blanks.d.ts +8 -0
  72. package/dist/sort-blanks.js +47 -0
  73. package/dist/studio/ui-components.generated.js +1 -1
  74. package/dist/upgrade-prompt.d.ts +1 -1
  75. package/dist/version.d.ts +2 -2
  76. package/dist/version.js +2 -2
  77. package/dist/wc/GridFooter-CKC4L36O.js +162 -0
  78. package/dist/wc/{GridMenus-DVGuqp2l.js → GridMenus-h7RsvcmI.js} +320 -303
  79. package/dist/wc/{PinSplitter-Btco0txr.js → PinSplitter-BN6ybmjs.js} +1 -1
  80. package/dist/wc/grid-extension.svelte-CDf5EUyz.js +27 -0
  81. package/dist/wc/merges-DQTOlMWM.js +109 -0
  82. package/dist/wc/sv-sheet-element.js +6753 -6792
  83. package/package.json +9 -3
  84. package/dist/designer/assets/GridFooter-CKBVItAU.js +0 -2
  85. package/dist/designer/assets/GridMenus-Dzwu7M9r.js +0 -6
  86. package/dist/designer/assets/grid-extension.svelte-BZ7AqyJI.js +0 -1
  87. package/dist/designer/assets/index-WCxj6WfJ.css +0 -1
  88. package/dist/wc/GridFooter-BgoA77TJ.js +0 -145
  89. package/dist/wc/grid-extension.svelte-CucBS4FL.js +0 -20
@@ -0,0 +1,26 @@
1
+ /**
2
+ * "Only rows with changes": a condition kind of the expression language
3
+ * (`registerPredicateKind`) that matches rows with a pending or conflicting
4
+ * proposal, ANDed onto the user's own advanced filter and taken back off
5
+ * without touching the rest of it.
6
+ *
7
+ * The advanced filter hands its predicate the grid's rows, whose `id` is the
8
+ * grid's row id, which is what proposals are keyed by.
9
+ */
10
+ import type { GridPredicateExpr } from '@svgrid/grid';
11
+ export declare const PENDING_KIND = "reviewPending";
12
+ type Source = {
13
+ hasPendingRow(rowId: string): boolean;
14
+ };
15
+ /** Make a review's rows filterable; returns the token its filter node names. */
16
+ export declare function trackPendingSource(token: string, source: Source): void;
17
+ /** The user's expression without any of our nodes; null when nothing is left. */
18
+ export declare function stripPending(expr: GridPredicateExpr | null): GridPredicateExpr | null;
19
+ /**
20
+ * The user's expression with our node ANDed on. `nonce` changes the node, so
21
+ * the grid filters again after proposals were decided.
22
+ */
23
+ export declare function withPending(expr: GridPredicateExpr | null, token: string, nonce: number): GridPredicateExpr;
24
+ /** Whether an expression holds our node. */
25
+ export declare function hasPending(expr: GridPredicateExpr | null): boolean;
26
+ export {};
@@ -0,0 +1,71 @@
1
+ import { enableAdvancedFilter } from '../advanced-filter-enable.js';
2
+ import { registerPredicateKind } from '../expressions/kinds.js';
3
+ export const PENDING_KIND = 'reviewPending';
4
+ // Weak: the review holds its source; once the review is gone, so is the entry's target.
5
+ const sources = new Map();
6
+ let registered = false;
7
+ function register() {
8
+ if (registered)
9
+ return;
10
+ registered = true;
11
+ registerPredicateKind(PENDING_KIND, {
12
+ compile: (payload) => {
13
+ const token = payload?.token ?? '';
14
+ const source = sources.get(token)?.deref();
15
+ if (!source) {
16
+ sources.delete(token);
17
+ return null;
18
+ }
19
+ return (row) => {
20
+ const id = row?.id;
21
+ return id != null && source.hasPendingRow(String(id));
22
+ };
23
+ },
24
+ describe: () => 'Has a proposed change',
25
+ });
26
+ }
27
+ /** Make a review's rows filterable; returns the token its filter node names. */
28
+ export function trackPendingSource(token, source) {
29
+ register();
30
+ enableAdvancedFilter();
31
+ sources.set(token, new WeakRef(source));
32
+ }
33
+ /** The user's expression without any of our nodes; null when nothing is left. */
34
+ export function stripPending(expr) {
35
+ if (!expr)
36
+ return null;
37
+ if (expr.kind === 'ext' && expr.type === PENDING_KIND)
38
+ return null;
39
+ if (expr.kind === 'and' || expr.kind === 'or') {
40
+ const parts = expr.parts.map(stripPending).filter((p) => p !== null);
41
+ if (!parts.length)
42
+ return null;
43
+ return parts.length === 1 && expr.kind === 'and' ? parts[0] : { ...expr, parts };
44
+ }
45
+ if (expr.kind === 'not') {
46
+ const inner = stripPending(expr.expr);
47
+ return inner ? { kind: 'not', expr: inner } : null;
48
+ }
49
+ return expr;
50
+ }
51
+ /**
52
+ * The user's expression with our node ANDed on. `nonce` changes the node, so
53
+ * the grid filters again after proposals were decided.
54
+ */
55
+ export function withPending(expr, token, nonce) {
56
+ const node = { kind: 'ext', type: PENDING_KIND, payload: { token, nonce } };
57
+ const rest = stripPending(expr);
58
+ return rest ? { kind: 'and', parts: [rest, node] } : node;
59
+ }
60
+ /** Whether an expression holds our node. */
61
+ export function hasPending(expr) {
62
+ if (!expr)
63
+ return false;
64
+ if (expr.kind === 'ext')
65
+ return expr.type === PENDING_KIND;
66
+ if (expr.kind === 'and' || expr.kind === 'or')
67
+ return expr.parts.some(hasPending);
68
+ if (expr.kind === 'not')
69
+ return hasPending(expr.expr);
70
+ return false;
71
+ }
@@ -0,0 +1 @@
1
+ export declare function registerRichCellMarks(): void;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The proposed value beside a cell the in-cell wrapper (`ghost.ts`) cannot
3
+ * take: a select, a rating, a person, a checkbox, a field type with a cell of
4
+ * its own. The grid's `cellDecor` slot draws a mark after the cell's own
5
+ * content, so the cell stays as it is and "-> Closed" follows it.
6
+ *
7
+ * Registered once, by the first review: `cellDecor` takes every cell off the
8
+ * grid's plain-text fast path, which an app without a review should not pay.
9
+ */
10
+ import { getGridExtension, registerGridExtension } from '@svgrid/grid';
11
+ import { cellProposalFor } from './card-marks.svelte.js';
12
+ import { canGhost } from './ghost.js';
13
+ import RichCellMark from './RichCellMark.svelte';
14
+ let registered = false;
15
+ export function registerRichCellMarks() {
16
+ if (registered)
17
+ return;
18
+ registered = true;
19
+ const before = getGridExtension()?.cellDecor;
20
+ registerGridExtension({
21
+ cellDecor: (ctrl, row, column) => {
22
+ const own = before?.(ctrl, row, column);
23
+ if (own)
24
+ return own;
25
+ const def = column?.columnDef;
26
+ if (!def?.field || !row || row.original === undefined)
27
+ return null;
28
+ // Cheap lookups first: this runs for every cell of every grid.
29
+ const p = cellProposalFor(ctrl?.props?.getRowId, row.original, String(row.id), def.field);
30
+ if (!p)
31
+ return null;
32
+ // The wrapper draws the proposal in cells it can wrap.
33
+ return canGhost(def, row.original?.[def.field]) ? null : RichCellMark;
34
+ },
35
+ });
36
+ }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Change review types. A proposal is a write nobody typed (an AI result, an
3
+ * agent edit, an import, a sync) held apart from the data until a person
4
+ * accepts it. Pure types, so the clustering and the adapters stay free of
5
+ * Svelte and testable on their own.
6
+ */
7
+ /** What produced a proposal. `id` keeps two runs of the same kind apart. */
8
+ export type ProposalSource = {
9
+ kind: 'agent' | 'ai' | 'import' | 'bulk' | 'sync' | 'rule' | 'user';
10
+ id: string;
11
+ label: string;
12
+ };
13
+ export type ProposalStatus = 'pending' | 'accepted' | 'rejected' | 'stale' | 'conflict';
14
+ export type Proposal = {
15
+ id: string;
16
+ /** Only `update` in this release; inserts and deletes come later. */
17
+ op: 'update';
18
+ /** The grid's row id (its `getRowId`), never a row index. */
19
+ rowId: string;
20
+ /** The field on the row object the value is written to. */
21
+ field: string;
22
+ /** The value when the proposal was made, which is what staleness compares with. */
23
+ before: unknown;
24
+ after: unknown;
25
+ source: ProposalSource;
26
+ /** Why, in the producer's words (an AI rationale, an import file name). */
27
+ reason?: string;
28
+ /** 0..1, when the producer has one. */
29
+ confidence?: number;
30
+ createdAt: number;
31
+ status: ProposalStatus;
32
+ /** Why a proposal is stale, skipped or in conflict, for the panel. */
33
+ note?: string;
34
+ decidedBy?: string;
35
+ decidedAt?: number;
36
+ };
37
+ /** What a producer hands over: a proposal without the fields the review fills in. */
38
+ export type ProposalInput = Omit<Proposal, 'id' | 'op' | 'source' | 'createdAt' | 'status' | 'note' | 'decidedBy' | 'decidedAt'> & {
39
+ id?: string;
40
+ confidence?: number;
41
+ };
42
+ /** One batch from one producer. */
43
+ export type ChangeSet = {
44
+ id: string;
45
+ title: string;
46
+ source: ProposalSource;
47
+ createdAt: number;
48
+ proposals: Proposal[];
49
+ };
50
+ /**
51
+ * How a group's members relate. The first four are rule groups: every member
52
+ * is proven to follow the rule. The rest are judgment groups, where a person
53
+ * has to look.
54
+ */
55
+ export type GroupKind = 'whitespace' | 'case' | 'format' | 'scale' | 'same-mapping' | 'fill-empty' | 'constant-target' | 'unpatterned';
56
+ export type ProposalGroup = {
57
+ /** Stable while the group's members do not change: source, field, kind and param. */
58
+ key: string;
59
+ kind: GroupKind;
60
+ /** True for the four rule kinds. */
61
+ rule: boolean;
62
+ /** What the members share, in the detector's terms ('upper', '100', a value...). */
63
+ param: string;
64
+ label: string;
65
+ field: string;
66
+ sourceId: string;
67
+ ids: string[];
68
+ count: number;
69
+ /** Lowest and mean confidence over the members that have one; undefined when none do. */
70
+ minConfidence?: number;
71
+ avgConfidence?: number;
72
+ /** Up to five ids to look at first: the least confident, then spread across the group. */
73
+ sample: string[];
74
+ /**
75
+ * For `constant-target` and `same-mapping`: the five most common `before`
76
+ * values and how many of each, then one `other` entry for the rest.
77
+ */
78
+ beforeDistribution?: Array<{
79
+ value: unknown;
80
+ count: number;
81
+ other?: true;
82
+ }>;
83
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Change review types. A proposal is a write nobody typed (an AI result, an
3
+ * agent edit, an import, a sync) held apart from the data until a person
4
+ * accepts it. Pure types, so the clustering and the adapters stay free of
5
+ * Svelte and testable on their own.
6
+ */
7
+ export {};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Row count - "250 rows", or "12 of 250 rows" while filters hide some, at the
3
+ * start of the grid's status bar, and the same two numbers from code.
4
+ *
5
+ * ```ts
6
+ * import { enableRowCount, getRowCounts } from '@svgrid/enterprise'
7
+ * enableRowCount()
8
+ * // <SvGrid {data} {columns} statusBar={{ rows: true, aggregates: [] }} />
9
+ * const { total, filtered } = getRowCounts(api)
10
+ * ```
11
+ */
12
+ import { type RowData, type SvGridApi, type TableFeatures } from '@svgrid/grid';
13
+ /**
14
+ * Draw the row count in every grid whose `statusBar` sets `rows: true`.
15
+ * Idempotent; also invoked by {@link installEnterprise}.
16
+ */
17
+ export declare function enableRowCount(): void;
18
+ /**
19
+ * How many rows the grid holds (`total`) and how many pass the current
20
+ * filters (`filtered`), for an "X of Y" of your own. Pagination changes
21
+ * neither. With grouping on, `filtered` counts the group rows too. Under
22
+ * `externalPagination` both come from the `rowCount` you pass.
23
+ */
24
+ export declare function getRowCounts<TFeatures extends TableFeatures, TData extends RowData>(api: SvGridApi<TFeatures, TData>): {
25
+ total: number;
26
+ filtered: number;
27
+ };
28
+ export { default as SvGridRowCount } from './SvGridRowCount.svelte';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Row count - "250 rows", or "12 of 250 rows" while filters hide some, at the
3
+ * start of the grid's status bar, and the same two numbers from code.
4
+ *
5
+ * ```ts
6
+ * import { enableRowCount, getRowCounts } from '@svgrid/enterprise'
7
+ * enableRowCount()
8
+ * // <SvGrid {data} {columns} statusBar={{ rows: true, aggregates: [] }} />
9
+ * const { total, filtered } = getRowCounts(api)
10
+ * ```
11
+ */
12
+ import { registerGridExtension } from '@svgrid/grid';
13
+ import { hasValidLicense } from './license.js';
14
+ import { emitUnlicensedNudge } from './watermark.js';
15
+ import SvGridRowCount from './SvGridRowCount.svelte';
16
+ let enabled = false;
17
+ /**
18
+ * Draw the row count in every grid whose `statusBar` sets `rows: true`.
19
+ * Idempotent; also invoked by {@link installEnterprise}.
20
+ */
21
+ export function enableRowCount() {
22
+ if (enabled)
23
+ return;
24
+ enabled = true;
25
+ registerGridExtension({ statusBarRows: () => SvGridRowCount });
26
+ if (!hasValidLicense())
27
+ emitUnlicensedNudge();
28
+ }
29
+ /**
30
+ * How many rows the grid holds (`total`) and how many pass the current
31
+ * filters (`filtered`), for an "X of Y" of your own. Pagination changes
32
+ * neither. With grouping on, `filtered` counts the group rows too. Under
33
+ * `externalPagination` both come from the `rowCount` you pass.
34
+ */
35
+ export function getRowCounts(api) {
36
+ const filtered = api.getPageInfo().total;
37
+ return { total: api.getOption('externalPagination') ? filtered : api.getData().length, filtered };
38
+ }
39
+ export { default as SvGridRowCount } from './SvGridRowCount.svelte';
@@ -0,0 +1,8 @@
1
+ /** How the non-blank values compare: as the grid compares that data type. */
2
+ export type BlanksSortType = 'auto' | 'number' | 'date';
3
+ type ColumnComparator = (a: unknown, b: unknown, desc: boolean) => number;
4
+ /** Sort blank cells last in both directions. Pass as a column's `sortComparator`. */
5
+ export declare function blanksLast(type?: BlanksSortType): ColumnComparator;
6
+ /** Sort blank cells first in both directions. Pass as a column's `sortComparator`. */
7
+ export declare function blanksFirst(type?: BlanksSortType): ColumnComparator;
8
+ export {};
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Blanks at one end - column comparators that hold blank cells (null,
3
+ * undefined, '') at the bottom or the top whichever way the column sorts. The
4
+ * grid's own order puts blanks first ascending and last descending, so rows
5
+ * with no due date jump to the top when the dates run up.
6
+ *
7
+ * ```ts
8
+ * import { blanksLast } from '@svgrid/enterprise'
9
+ * const columns = [
10
+ * { field: 'due', header: 'Due', cellDataType: 'dateString', sortComparator: blanksLast('date') },
11
+ * ]
12
+ * ```
13
+ *
14
+ * The values themselves sort as the grid sorts them (`sortFns`). The grid's
15
+ * `sortComparator` hands the direction over; a column with `sortValue` keeps
16
+ * using that instead.
17
+ */
18
+ import { sortFns } from '@svgrid/grid/core';
19
+ import { hasValidLicense } from './license.js';
20
+ import { emitUnlicensedNudge } from './watermark.js';
21
+ const isBlank = (v) => v == null || v === '';
22
+ function holdBlanks(end, type) {
23
+ if (!hasValidLicense())
24
+ emitUnlicensedNudge();
25
+ const compare = sortFns[type];
26
+ return (a, b, desc) => {
27
+ const aBlank = isBlank(a);
28
+ const bBlank = isBlank(b);
29
+ if (aBlank || bBlank) {
30
+ if (aBlank === bBlank)
31
+ return 0;
32
+ // The grid reverses the result for a descending sort; answer for blanks
33
+ // before that happens, so they stay put.
34
+ const side = aBlank ? end : -end;
35
+ return desc ? -side : side;
36
+ }
37
+ return compare(a, b);
38
+ };
39
+ }
40
+ /** Sort blank cells last in both directions. Pass as a column's `sortComparator`. */
41
+ export function blanksLast(type = 'auto') {
42
+ return holdBlanks(1, type);
43
+ }
44
+ /** Sort blank cells first in both directions. Pass as a column's `sortComparator`. */
45
+ export function blanksFirst(type = 'auto') {
46
+ return holdBlanks(-1, type);
47
+ }
@@ -7172,7 +7172,7 @@ export const GENERATED_UI_SURFACE = {
7172
7172
  "key": "statusBar",
7173
7173
  "label": "Status Bar",
7174
7174
  "type": "boolean",
7175
- "description": "Excel-style status bar under the grid showing live aggregates of the selected cell range (count, numeric count, sum, average, min, max). `true` shows the default set; pass `{ aggregates: [...] }` to choose which. Requires `enableCellSelection`.",
7175
+ "description": "Excel-style status bar under the grid showing live aggregates of the selected cell range (count, numeric count, sum, average, min, max). `true` shows the default set; pass `{ aggregates: [...] }` to choose which. The aggregates need `enableCellSelection`. `rows: true` adds a row count that is always shown, \"250 rows\" or \"12 of 250 rows\" while filters hide some, once `@svgrid/enterprise`'s `enableRowCount()` has run. `{ rows: true, aggregates: [] }` shows the count alone.",
7176
7176
  "group": "common"
7177
7177
  },
7178
7178
  {
@@ -1,5 +1,5 @@
1
1
  /** Human-readable labels for the Enterprise surfaces that gate behind a license. */
2
- export type EnterpriseFeatureLabel = 'Export' | 'Import' | 'Print' | 'AI assistant' | 'Pivot' | 'Server-side row model' | 'Spreadsheet' | 'SvGrid Base' | 'Studio';
2
+ export type EnterpriseFeatureLabel = 'Export' | 'Import' | 'Print' | 'AI assistant' | 'Pivot' | 'Server-side row model' | 'Spreadsheet' | 'SvGrid Base' | 'Studio' | 'Change review';
3
3
  /**
4
4
  * Show the contextual upgrade prompt for `feature`. No-ops if one has already
5
5
  * been shown this session, a card is already up, or we're on the server. Safe
package/dist/version.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * `version.test.ts` asserts this matches `package.json`, so the two cannot drift.
12
12
  */
13
- export declare const SVGRID_VERSION = "3.1.21";
13
+ export declare const SVGRID_VERSION = "3.1.23";
14
14
  /**
15
15
  * The version of `@svgrid/grid`, which releases on its own line: enterprise is
16
16
  * on 3.1.x while the grid is on 3.0.x.
@@ -23,4 +23,4 @@ export declare const SVGRID_VERSION = "3.1.21";
23
23
  *
24
24
  * `version.test.ts` asserts this matches packages/grid/package.json.
25
25
  */
26
- export declare const GRID_VERSION = "3.0.20";
26
+ export declare const GRID_VERSION = "3.0.22";
package/dist/version.js CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * `version.test.ts` asserts this matches `package.json`, so the two cannot drift.
12
12
  */
13
- export const SVGRID_VERSION = '3.1.21';
13
+ export const SVGRID_VERSION = '3.1.23';
14
14
  /**
15
15
  * The version of `@svgrid/grid`, which releases on its own line: enterprise is
16
16
  * on 3.1.x while the grid is on 3.0.x.
@@ -23,4 +23,4 @@ export const SVGRID_VERSION = '3.1.21';
23
23
  *
24
24
  * `version.test.ts` asserts this matches packages/grid/package.json.
25
25
  */
26
- export const GRID_VERSION = '3.0.20';
26
+ export const GRID_VERSION = '3.0.22';
@@ -0,0 +1,162 @@
1
+ import { D as e, G as t, H as n, I as r, L as i, M as a, O as o, P as s, R as c, S as l, U as u, Y as d, at as f, ct as p, dt as m, ft as h, ht as g, j as _, m as v, n as y, nt as b, ot as x, rt as S, tt as C } from "./client-GWAV79ON.js";
2
+ import { s as w } from "./SvGrid.helpers-tk7gWxcT.js";
3
+ import { r as T } from "./grid-extension.svelte-CDf5EUyz.js";
4
+ import "./sv-sheet-element.js";
5
+ //#region ../grid/dist/GridFooter.svelte
6
+ var ee = c("<span class=\"sv-grid-status-item\"><span class=\"sv-grid-status-label\"> </span> </span>"), E = c("<span class=\"sv-grid-status-item\"><span class=\"sv-grid-status-label\">Numeric</span> </span>"), D = c("<span class=\"sv-grid-status-item\"><span class=\"sv-grid-status-label\"> </span> </span>"), O = c("<span class=\"sv-grid-status-item\"><span class=\"sv-grid-status-label\"> </span> </span>"), k = c("<span class=\"sv-grid-status-item\"><span class=\"sv-grid-status-label\"> </span> </span>"), te = c("<span class=\"sv-grid-status-item\"><span class=\"sv-grid-status-label\"> </span> </span>"), A = c("<span class=\"sv-grid-status-aggregates\" role=\"status\" aria-live=\"polite\"></span>"), j = c("<div class=\"sv-grid-status-bar\"><!> <!></div>"), ne = c("<div class=\"sv-grid-dropdown\"><button type=\"button\" class=\"sv-grid-dropdown-trigger\" aria-haspopup=\"listbox\" aria-expanded=\"false\"><span class=\"sv-grid-dropdown-label\"> </span> <span class=\"sv-grid-dropdown-caret\" aria-hidden=\"true\"><!></span></button></div>"), re = c("<div role=\"navigation\" aria-label=\"Pagination\"><div class=\"sv-grid-pagination-pagesize\"><span> </span> <div class=\"sv-grid-pagination-pagesize-dd\"><!></div></div> <span class=\"sv-grid-pagination-range\"><strong> </strong> to <strong> </strong> of <strong> </strong></span> <div class=\"sv-grid-pagination-nav\"><button type=\"button\" class=\"sv-grid-pagination-btn\"><!></button> <button type=\"button\" class=\"sv-grid-pagination-btn\"><!></button> <span class=\"sv-grid-pagination-label\"> <strong> </strong> <strong> </strong></span> <button type=\"button\" class=\"sv-grid-pagination-btn\"><!></button> <button type=\"button\" class=\"sv-grid-pagination-btn\"><!></button></div></div>"), M = c("<!> <!>", 1);
7
+ function N(n, c) {
8
+ h(c, !0);
9
+ let N = y(c, "pager", 3, !0), P = y(c, "showStatus", 3, !0), ie = y(c, "top", 3, !1), F = x(null), I = x(!1);
10
+ async function ae() {
11
+ if (!(t(F) || t(I))) {
12
+ f(I, !0);
13
+ try {
14
+ f(F, (await import("./SvGridDropdown-BVnpNU_I.js")).default, !0);
15
+ } finally {
16
+ f(I, !1);
17
+ }
18
+ }
19
+ }
20
+ let L = p(() => c.ctrl.paginationEnabled), R = p(() => c.ctrl.statusBarEnabled), oe = p(() => c.ctrl.statusBarAggregates), z = p(() => typeof c.ctrl.props.statusBar == "object" && c.ctrl.props.statusBar.rows ? T()?.statusBarRows?.(c.ctrl) ?? null : null), B = p(() => c.ctrl.statusBarStats), V = p(() => c.ctrl.changePage), H = p(() => c.ctrl.goToPage), se = p(() => c.ctrl.setPageSize), U = p(() => c.ctrl.messages);
21
+ var W = M(), G = b(W), K = (n) => {
22
+ var a = j(), l = C(a), u = (n) => {
23
+ var a = i(), o = b(a);
24
+ e(o, () => t(z), (e, t) => {
25
+ t(e, { get ctrl() {
26
+ return c.ctrl;
27
+ } });
28
+ }), r(n, a);
29
+ };
30
+ _(l, (e) => {
31
+ t(z) && e(u);
32
+ });
33
+ var f = S(l, 2), m = (e) => {
34
+ let n = p(() => t(B));
35
+ var a = A();
36
+ o(a, 20, () => t(oe), (e) => e, (e, a) => {
37
+ var o = i(), c = b(o), l = (e) => {
38
+ var i = ee(), a = C(i), o = C(a, !0);
39
+ g(a);
40
+ var c = S(a, 1, !0);
41
+ g(i), d((e) => {
42
+ s(o, t(U).statCount), s(c, e);
43
+ }, [() => w(t(n).count)]), r(e, i);
44
+ }, u = (e) => {
45
+ var i = E(), a = S(C(i), 1, !0);
46
+ g(i), d((e) => s(a, e), [() => w(t(n).numericCount)]), r(e, i);
47
+ }, f = (e) => {
48
+ var i = D(), a = C(i), o = C(a, !0);
49
+ g(a);
50
+ var c = S(a, 1, !0);
51
+ g(i), d((e) => {
52
+ s(o, t(U).statSum), s(c, e);
53
+ }, [() => w(t(n).sum)]), r(e, i);
54
+ }, p = (e) => {
55
+ var i = O(), a = C(i), o = C(a, !0);
56
+ g(a);
57
+ var c = S(a, 1, !0);
58
+ g(i), d((e) => {
59
+ s(o, t(U).statAvg), s(c, e);
60
+ }, [() => w(t(n).avg)]), r(e, i);
61
+ }, m = (e) => {
62
+ var i = k(), a = C(i), o = C(a, !0);
63
+ g(a);
64
+ var c = S(a, 1, !0);
65
+ g(i), d((e) => {
66
+ s(o, t(U).statMin), s(c, e);
67
+ }, [() => w(t(n).min)]), r(e, i);
68
+ }, h = (e) => {
69
+ var i = te(), a = C(i), o = C(a, !0);
70
+ g(a);
71
+ var c = S(a, 1, !0);
72
+ g(i), d((e) => {
73
+ s(o, t(U).statMax), s(c, e);
74
+ }, [() => w(t(n).max)]), r(e, i);
75
+ };
76
+ _(c, (e) => {
77
+ a === "count" ? e(l) : a === "numericCount" ? e(u, 1) : t(n).numericCount > 0 && a === "sum" ? e(f, 2) : t(n).numericCount > 0 && a === "avg" ? e(p, 3) : t(n).numericCount > 0 && a === "min" ? e(m, 4) : t(n).numericCount > 0 && a === "max" && e(h, 5);
78
+ }), r(e, o);
79
+ }), g(a), r(e, a);
80
+ };
81
+ _(f, (e) => {
82
+ t(B) && e(m);
83
+ }), g(a), r(n, a);
84
+ };
85
+ _(G, (e) => {
86
+ P() && t(R) && (t(B) || t(z)) && e(K);
87
+ });
88
+ var q = S(G, 2), J = (n) => {
89
+ let o = p(() => c.ctrl.paginationTotalRows), f = p(() => c.ctrl.paginationPageSize), m = p(() => Math.max(1, Math.ceil(t(o) / t(f)))), h = p(() => Math.min(c.ctrl.paginationPageIndex + 1, t(m))), y = p(() => t(o) === 0 ? 0 : (t(h) - 1) * t(f) + 1), x = p(() => Math.min(t(o), t(h) * t(f))), w = p(() => t(h) <= 1), T = p(() => t(h) >= t(m)), ee = p(() => c.pageSizeOptions && c.pageSizeOptions.length ? c.pageSizeOptions : [
90
+ 10,
91
+ 25,
92
+ 50,
93
+ 100
94
+ ]);
95
+ var E = re();
96
+ let D;
97
+ var O = C(E), k = C(O), te = C(k, !0);
98
+ g(k);
99
+ var A = S(k, 2), j = C(A), M = (n) => {
100
+ var a = i(), o = b(a);
101
+ {
102
+ let n = p(() => t(ee).map((e) => ({
103
+ value: e,
104
+ label: String(e)
105
+ })));
106
+ e(o, () => t(F), (e, r) => {
107
+ r(e, {
108
+ get options() {
109
+ return t(n);
110
+ },
111
+ get value() {
112
+ return t(f);
113
+ },
114
+ autoOpen: !0,
115
+ onChange: (e) => t(se)(Number(e))
116
+ });
117
+ });
118
+ }
119
+ r(n, a);
120
+ }, N = (e) => {
121
+ var n = ne(), i = C(n), o = C(i), l = C(o, !0);
122
+ g(o);
123
+ var p = S(o, 2), m = C(p);
124
+ a(m, () => c.icon, () => "page-size-caret"), g(p), g(i), g(n), d(() => s(l, t(f))), u("click", i, ae), r(e, n);
125
+ };
126
+ _(j, (e) => {
127
+ t(F) ? e(M) : e(N, -1);
128
+ }), g(A), g(O);
129
+ var P = S(O, 2), I = C(P), L = C(I, !0);
130
+ g(I);
131
+ var R = S(I, 2), oe = C(R, !0);
132
+ g(R);
133
+ var z = S(R, 2), B = C(z, !0);
134
+ g(z), g(P);
135
+ var W = S(P, 2), G = C(W), K = C(G);
136
+ a(K, () => c.icon, () => "page-first"), g(G);
137
+ var q = S(G, 2), J = C(q);
138
+ a(J, () => c.icon, () => "page-prev"), g(q);
139
+ var Y = S(q, 2), X = C(Y), Z = S(X), ce = C(Z, !0);
140
+ g(Z);
141
+ var le = S(Z), ue = S(le), de = C(ue, !0);
142
+ g(ue), g(Y);
143
+ var Q = S(Y, 2), fe = C(Q);
144
+ a(fe, () => c.icon, () => "page-next"), g(Q);
145
+ var $ = S(Q, 2), pe = C($);
146
+ a(pe, () => c.icon, () => "page-last"), g($), g(W), g(E), d((e, n, r, i, a) => {
147
+ D = l(E, 1, "sv-grid-pagination", null, D, { "sv-grid-pagination-top": ie() }), s(te, t(U).pageSize), s(L, e), s(oe, n), s(B, r), G.disabled = t(w), v(G, "aria-label", t(U).firstPage), q.disabled = t(w), v(q, "aria-label", t(U).prevPage), s(X, `${t(U).page ?? ""} `), s(ce, i), s(le, ` ${t(U).of ?? ""} `), s(de, a), Q.disabled = t(T), v(Q, "aria-label", t(U).nextPage), $.disabled = t(T), v($, "aria-label", t(U).lastPage);
148
+ }, [
149
+ () => t(y).toLocaleString(),
150
+ () => t(x).toLocaleString(),
151
+ () => t(o).toLocaleString(),
152
+ () => t(h).toLocaleString(),
153
+ () => t(m).toLocaleString()
154
+ ]), u("click", G, () => t(H)(0)), u("click", q, () => t(V)(-1)), u("click", Q, () => t(V)(1)), u("click", $, () => t(H)(t(m) - 1)), r(n, E);
155
+ };
156
+ _(q, (e) => {
157
+ N() && t(L) && e(J);
158
+ }), r(n, W), m();
159
+ }
160
+ n(["click"]);
161
+ //#endregion
162
+ export { N as default };