@happyvertical/smrt-ui 0.42.6 → 0.42.7
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/README.md +55 -2
- package/dist/components/data/CollectionToolbar.svelte +204 -4
- package/dist/components/data/CollectionToolbar.svelte.d.ts +7 -1
- package/dist/components/data/CollectionToolbar.svelte.d.ts.map +1 -1
- package/dist/components/data/DataTable.svelte +338 -2
- package/dist/components/data/DataTable.svelte.d.ts.map +1 -1
- package/dist/components/data/DataTableController.d.ts +2 -0
- package/dist/components/data/DataTableController.d.ts.map +1 -1
- package/dist/components/data/DataTableController.js +4 -0
- package/dist/components/data/__tests__/data-surface.test.js +75 -4
- package/dist/components/data/__tests__/mounted-data-surface.test.js +794 -0
- package/dist/components/data/data-surface.d.ts +36 -0
- package/dist/components/data/data-surface.d.ts.map +1 -1
- package/dist/components/data/data-surface.js +189 -30
- package/dist/components/data/data-table-surface.d.ts +9 -0
- package/dist/components/data/data-table-surface.d.ts.map +1 -0
- package/dist/components/data/data-table-surface.js +195 -0
- package/dist/components/data/index.d.ts +1 -0
- package/dist/components/data/index.d.ts.map +1 -1
- package/dist/components/data/index.js +1 -0
- package/dist/components/data/types.d.ts +22 -0
- package/dist/components/data/types.d.ts.map +1 -1
- package/package.json +7 -2
|
@@ -28,12 +28,40 @@ export interface DataSurfaceIdentity {
|
|
|
28
28
|
subject?: DataSurfaceSubject;
|
|
29
29
|
}
|
|
30
30
|
export type DataSurfaceColumnCapability = 'read' | 'search' | 'filter' | 'sort' | 'project';
|
|
31
|
+
/** Presentation tier emitted by policy-aware domain adapters. */
|
|
32
|
+
export type DataSurfaceColumnVisibility = 'basic' | 'advanced' | 'hidden';
|
|
33
|
+
/** A domain-neutral column role. Adapters use roles to protect structural columns. */
|
|
34
|
+
export type DataSurfaceColumnRole = 'data' | 'status' | 'computed' | 'row-key' | 'selection' | 'action';
|
|
35
|
+
/** Operator allowlists are intentionally strings: #2444 owns query semantics. */
|
|
36
|
+
export interface DataSurfaceColumnOperators {
|
|
37
|
+
search?: string[];
|
|
38
|
+
filter?: string[];
|
|
39
|
+
sort?: string[];
|
|
40
|
+
}
|
|
31
41
|
export interface DataSurfaceColumnDescriptor {
|
|
32
42
|
id: string;
|
|
33
43
|
label: string;
|
|
34
44
|
description?: string;
|
|
35
45
|
sensitivity?: DataSurfaceSensitivity;
|
|
36
46
|
capabilities: DataSurfaceColumnCapability[];
|
|
47
|
+
/** Domain field identity; never accepted as a request path. */
|
|
48
|
+
fieldName?: string;
|
|
49
|
+
/** Effective policy visibility, when a domain adapter supplies one. */
|
|
50
|
+
visibility?: DataSurfaceColumnVisibility;
|
|
51
|
+
/** Stable policy order; domain column ids remain unchanged. */
|
|
52
|
+
order?: number;
|
|
53
|
+
/** Structural columns are preserved even when field policy narrows data columns. */
|
|
54
|
+
role?: DataSurfaceColumnRole;
|
|
55
|
+
/** Responsive adapters consume this without importing DataTable types. */
|
|
56
|
+
responsivePriority?: number;
|
|
57
|
+
/** Per-operation operator allowlists, narrowed by policy adapters. */
|
|
58
|
+
operators?: DataSurfaceColumnOperators;
|
|
59
|
+
/** Explicit aliases for adapters that mirror the canonical query schema. */
|
|
60
|
+
searchOperators?: string[];
|
|
61
|
+
filterOperators?: string[];
|
|
62
|
+
sortOperators?: string[];
|
|
63
|
+
/** Explicit readability is useful when read capability is policy-gated. */
|
|
64
|
+
readable?: boolean;
|
|
37
65
|
}
|
|
38
66
|
/** #2444 owns the canonical query language; this declares only its bounds. */
|
|
39
67
|
export type DataSurfaceQueryMode = 'rows' | 'count' | 'facets';
|
|
@@ -41,6 +69,10 @@ export interface DataSurfaceQueryCapabilities {
|
|
|
41
69
|
modes: DataSurfaceQueryMode[];
|
|
42
70
|
/** Explicit allowlist; field paths are not accepted in requests. */
|
|
43
71
|
projectableColumnIds: string[];
|
|
72
|
+
/** Explicit allowlists for non-projection query operations. */
|
|
73
|
+
searchableColumnIds?: string[];
|
|
74
|
+
filterableColumnIds?: string[];
|
|
75
|
+
sortableColumnIds?: string[];
|
|
44
76
|
}
|
|
45
77
|
export interface DataSurfaceVisibleControl {
|
|
46
78
|
/** Stable command name accepted by the mounted surface. */
|
|
@@ -56,6 +88,8 @@ export interface DataSurfaceActionDescriptor {
|
|
|
56
88
|
sensitivity?: DataSurfaceSensitivity;
|
|
57
89
|
selectionScopes: DataSurfaceSelectionScope[];
|
|
58
90
|
requiresConfirmation?: boolean;
|
|
91
|
+
/** Optional column dependencies used by field-policy adapters. */
|
|
92
|
+
columnIds?: string[];
|
|
59
93
|
}
|
|
60
94
|
/** Per-surface limits; generic envelopes use DATA_SURFACE_MAX_REQUEST_BYTES. */
|
|
61
95
|
export interface DataSurfaceLimits {
|
|
@@ -233,6 +267,8 @@ export interface DataSurfaceRegistry {
|
|
|
233
267
|
}
|
|
234
268
|
/** Generic browser-transport ceiling for normalized command/action envelopes. */
|
|
235
269
|
export declare const DATA_SURFACE_MAX_REQUEST_BYTES = 100000;
|
|
270
|
+
/** Maximum length shared by every DataSurface protocol identifier. */
|
|
271
|
+
export declare const DATA_SURFACE_IDENTIFIER_MAX_LENGTH = 256;
|
|
236
272
|
/** Per-surface LRU capacity for command acknowledgement replay. */
|
|
237
273
|
export declare const DATA_SURFACE_MAX_REPLAY_ENTRIES = 100;
|
|
238
274
|
export declare function normalizeDataSurfaceDescriptor(value: DataSurfaceDescriptor): DataSurfaceDescriptor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-surface.d.ts","sourceRoot":"","sources":["../../../src/components/data/data-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAC5B,wBAAwB,GACxB,oBAAoB,EAAE,GACtB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAA;CAAE,CAAC;AAC5C,MAAM,MAAM,qB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YTES = 100_000;
|
|
11
|
+
/** Maximum length shared by every DataSurface protocol identifier. */
|
|
12
|
+
export const DATA_SURFACE_IDENTIFIER_MAX_LENGTH = 256;
|
|
11
13
|
/** Per-surface LRU capacity for command acknowledgement replay. */
|
|
12
14
|
export const DATA_SURFACE_MAX_REPLAY_ENTRIES = 100;
|
|
13
15
|
const MAX_QUERY_LIMIT = 1_000;
|
|
14
|
-
const MAX_REQUEST_ID_LENGTH = 256;
|
|
15
16
|
const MAX_CURSOR_LENGTH = 2_048;
|
|
16
17
|
const MAX_JSON_DEPTH = 16;
|
|
17
18
|
const MAX_JSON_CONTAINER_ITEMS = 1_000;
|
|
@@ -45,6 +46,19 @@ const SELECTION_SCOPES = new Set([
|
|
|
45
46
|
'explicit-ids',
|
|
46
47
|
'all-matching',
|
|
47
48
|
]);
|
|
49
|
+
const COLUMN_VISIBILITIES = new Set([
|
|
50
|
+
'basic',
|
|
51
|
+
'advanced',
|
|
52
|
+
'hidden',
|
|
53
|
+
]);
|
|
54
|
+
const COLUMN_ROLES = new Set([
|
|
55
|
+
'data',
|
|
56
|
+
'status',
|
|
57
|
+
'computed',
|
|
58
|
+
'row-key',
|
|
59
|
+
'selection',
|
|
60
|
+
'action',
|
|
61
|
+
]);
|
|
48
62
|
const FORBIDDEN_BOUNDARY_KEYS = new Set([
|
|
49
63
|
'tenant',
|
|
50
64
|
'tenantid',
|
|
@@ -94,11 +108,26 @@ function stringValue(value, label) {
|
|
|
94
108
|
}
|
|
95
109
|
return value;
|
|
96
110
|
}
|
|
111
|
+
function identifierValue(value, label) {
|
|
112
|
+
const result = stringValue(value, label);
|
|
113
|
+
if (result.length > DATA_SURFACE_IDENTIFIER_MAX_LENGTH) {
|
|
114
|
+
throw new TypeError(`${label} cannot exceed ${DATA_SURFACE_IDENTIFIER_MAX_LENGTH} characters`);
|
|
115
|
+
}
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
97
118
|
function optionalString(value, label) {
|
|
98
119
|
if (value === undefined)
|
|
99
120
|
return undefined;
|
|
100
121
|
return stringValue(value, label);
|
|
101
122
|
}
|
|
123
|
+
function optionalFiniteNumber(value, label) {
|
|
124
|
+
if (value === undefined)
|
|
125
|
+
return undefined;
|
|
126
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
127
|
+
throw new TypeError(`${label} must be a finite number`);
|
|
128
|
+
}
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
102
131
|
function positiveInteger(value, label) {
|
|
103
132
|
if (typeof value !== 'number' || !Number.isSafeInteger(value) || value <= 0) {
|
|
104
133
|
throw new TypeError(`${label} must be a positive safe integer`);
|
|
@@ -319,13 +348,13 @@ function normalizeIdentity(value) {
|
|
|
319
348
|
exactKeys(source, ['type', 'id', 'label'], 'DataSurface subject');
|
|
320
349
|
const label = optionalString(source.label, 'DataSurface subject label');
|
|
321
350
|
subject = {
|
|
322
|
-
type:
|
|
323
|
-
id:
|
|
351
|
+
type: identifierValue(source.type, 'DataSurface subject type'),
|
|
352
|
+
id: identifierValue(source.id, 'DataSurface subject id'),
|
|
324
353
|
...(label ? { label } : {}),
|
|
325
354
|
};
|
|
326
355
|
}
|
|
327
356
|
return {
|
|
328
|
-
surfaceId:
|
|
357
|
+
surfaceId: identifierValue(object.surfaceId, 'DataSurface surface id'),
|
|
329
358
|
kind,
|
|
330
359
|
...(subject ? { subject } : {}),
|
|
331
360
|
};
|
|
@@ -352,6 +381,9 @@ function normalizeStringArray(value, label, options = {}) {
|
|
|
352
381
|
}
|
|
353
382
|
return options.sort ? values.sort() : values;
|
|
354
383
|
}
|
|
384
|
+
function normalizeIdentifierArray(value, label, options = {}) {
|
|
385
|
+
return normalizeStringArray(value, label, options).map((entry) => identifierValue(entry, label));
|
|
386
|
+
}
|
|
355
387
|
function normalizeCapabilityArray(value, label) {
|
|
356
388
|
const capabilities = normalizeStringArray(value, label, { sort: true });
|
|
357
389
|
for (const capability of capabilities) {
|
|
@@ -370,6 +402,83 @@ function normalizeSensitivity(value, label) {
|
|
|
370
402
|
}
|
|
371
403
|
return sensitivity;
|
|
372
404
|
}
|
|
405
|
+
function normalizeColumnOperators(value, label) {
|
|
406
|
+
if (value === undefined)
|
|
407
|
+
return undefined;
|
|
408
|
+
const operators = plainObject(value, label);
|
|
409
|
+
exactKeys(operators, ['search', 'filter', 'sort'], label);
|
|
410
|
+
const search = operators.search === undefined
|
|
411
|
+
? undefined
|
|
412
|
+
: normalizeStringArray(operators.search, `${label} search operators`, {
|
|
413
|
+
sort: true,
|
|
414
|
+
});
|
|
415
|
+
const filter = operators.filter === undefined
|
|
416
|
+
? undefined
|
|
417
|
+
: normalizeStringArray(operators.filter, `${label} filter operators`, {
|
|
418
|
+
sort: true,
|
|
419
|
+
});
|
|
420
|
+
const sort = operators.sort === undefined
|
|
421
|
+
? undefined
|
|
422
|
+
: normalizeStringArray(operators.sort, `${label} sort operators`, {
|
|
423
|
+
sort: true,
|
|
424
|
+
});
|
|
425
|
+
if (!search && !filter && !sort)
|
|
426
|
+
return {};
|
|
427
|
+
return {
|
|
428
|
+
...(search ? { search } : {}),
|
|
429
|
+
...(filter ? { filter } : {}),
|
|
430
|
+
...(sort ? { sort } : {}),
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function normalizeColumnDescriptorMetadata(column) {
|
|
434
|
+
const fieldName = optionalString(column.fieldName, 'DataSurface column field name');
|
|
435
|
+
const rawVisibility = optionalString(column.visibility, 'DataSurface column visibility');
|
|
436
|
+
if (rawVisibility &&
|
|
437
|
+
!COLUMN_VISIBILITIES.has(rawVisibility)) {
|
|
438
|
+
throw new TypeError(`Unsupported DataSurface column visibility: ${rawVisibility}`);
|
|
439
|
+
}
|
|
440
|
+
const rawRole = optionalString(column.role, 'DataSurface column role');
|
|
441
|
+
if (rawRole && !COLUMN_ROLES.has(rawRole)) {
|
|
442
|
+
throw new TypeError(`Unsupported DataSurface column role: ${rawRole}`);
|
|
443
|
+
}
|
|
444
|
+
if (column.readable !== undefined && typeof column.readable !== 'boolean') {
|
|
445
|
+
throw new TypeError('DataSurface column readable must be boolean');
|
|
446
|
+
}
|
|
447
|
+
const normalizeAliasOperators = (key) => column[key] === undefined
|
|
448
|
+
? undefined
|
|
449
|
+
: normalizeStringArray(column[key], `DataSurface column ${key}`, {
|
|
450
|
+
sort: true,
|
|
451
|
+
});
|
|
452
|
+
const searchOperators = normalizeAliasOperators('searchOperators');
|
|
453
|
+
const filterOperators = normalizeAliasOperators('filterOperators');
|
|
454
|
+
const sortOperators = normalizeAliasOperators('sortOperators');
|
|
455
|
+
return {
|
|
456
|
+
...(fieldName ? { fieldName } : {}),
|
|
457
|
+
...(rawVisibility
|
|
458
|
+
? { visibility: rawVisibility }
|
|
459
|
+
: {}),
|
|
460
|
+
...(column.order === undefined
|
|
461
|
+
? {}
|
|
462
|
+
: {
|
|
463
|
+
order: optionalFiniteNumber(column.order, 'DataSurface column order'),
|
|
464
|
+
}),
|
|
465
|
+
...(rawRole ? { role: rawRole } : {}),
|
|
466
|
+
...(column.responsivePriority === undefined
|
|
467
|
+
? {}
|
|
468
|
+
: {
|
|
469
|
+
responsivePriority: optionalFiniteNumber(column.responsivePriority, 'DataSurface column responsive priority'),
|
|
470
|
+
}),
|
|
471
|
+
...(column.operators === undefined
|
|
472
|
+
? {}
|
|
473
|
+
: {
|
|
474
|
+
operators: normalizeColumnOperators(column.operators, 'DataSurface column operators'),
|
|
475
|
+
}),
|
|
476
|
+
...(searchOperators ? { searchOperators } : {}),
|
|
477
|
+
...(filterOperators ? { filterOperators } : {}),
|
|
478
|
+
...(sortOperators ? { sortOperators } : {}),
|
|
479
|
+
...(column.readable === undefined ? {} : { readable: column.readable }),
|
|
480
|
+
};
|
|
481
|
+
}
|
|
373
482
|
function normalizeSelection(value) {
|
|
374
483
|
const object = plainObject(value, 'DataSurface selection');
|
|
375
484
|
const scope = stringValue(object.scope, 'DataSurface selection scope');
|
|
@@ -394,7 +503,11 @@ function normalizeSelection(value) {
|
|
|
394
503
|
(typeof rowId !== 'number' || !Number.isFinite(rowId))) {
|
|
395
504
|
throw new TypeError('DataSurface row ids must be finite strings or numbers');
|
|
396
505
|
}
|
|
397
|
-
const normalized = typeof rowId === '
|
|
506
|
+
const normalized = typeof rowId === 'string'
|
|
507
|
+
? identifierValue(rowId, 'DataSurface row id')
|
|
508
|
+
: rowId === 0
|
|
509
|
+
? 0
|
|
510
|
+
: rowId;
|
|
398
511
|
rowIds.set(`${typeof normalized}:${String(normalized)}`, normalized);
|
|
399
512
|
}
|
|
400
513
|
return {
|
|
@@ -411,7 +524,7 @@ function normalizeSelection(value) {
|
|
|
411
524
|
exactKeys(object, ['scope', 'queryFingerprint'], 'DataSurface all-matching selection');
|
|
412
525
|
return {
|
|
413
526
|
scope,
|
|
414
|
-
queryFingerprint:
|
|
527
|
+
queryFingerprint: identifierValue(object.queryFingerprint, 'DataSurface query fingerprint'),
|
|
415
528
|
};
|
|
416
529
|
}
|
|
417
530
|
export function normalizeDataSurfaceDescriptor(value) {
|
|
@@ -437,22 +550,46 @@ export function normalizeDataSurfaceDescriptor(value) {
|
|
|
437
550
|
}
|
|
438
551
|
const columns = object.columns.map((value) => {
|
|
439
552
|
const column = plainObject(value, 'DataSurface column');
|
|
440
|
-
exactKeys(column, [
|
|
553
|
+
exactKeys(column, [
|
|
554
|
+
'id',
|
|
555
|
+
'label',
|
|
556
|
+
'description',
|
|
557
|
+
'sensitivity',
|
|
558
|
+
'capabilities',
|
|
559
|
+
'fieldName',
|
|
560
|
+
'visibility',
|
|
561
|
+
'order',
|
|
562
|
+
'role',
|
|
563
|
+
'responsivePriority',
|
|
564
|
+
'operators',
|
|
565
|
+
'searchOperators',
|
|
566
|
+
'filterOperators',
|
|
567
|
+
'sortOperators',
|
|
568
|
+
'readable',
|
|
569
|
+
], 'DataSurface column');
|
|
441
570
|
const sensitivity = normalizeSensitivity(column.sensitivity, 'DataSurface column sensitivity');
|
|
442
571
|
const description = optionalString(column.description, 'DataSurface column description');
|
|
572
|
+
const metadata = normalizeColumnDescriptorMetadata(column);
|
|
443
573
|
return {
|
|
444
|
-
id:
|
|
574
|
+
id: identifierValue(column.id, 'DataSurface column id'),
|
|
445
575
|
label: stringValue(column.label, 'DataSurface column label'),
|
|
446
576
|
...(description ? { description } : {}),
|
|
447
577
|
...(sensitivity ? { sensitivity } : {}),
|
|
448
578
|
capabilities: normalizeCapabilityArray(column.capabilities, 'DataSurface column capabilities'),
|
|
579
|
+
...metadata,
|
|
449
580
|
};
|
|
450
581
|
});
|
|
451
582
|
if (new Set(columns.map((column) => column.id)).size !== columns.length) {
|
|
452
583
|
throw new TypeError('DataSurface descriptor column ids must be unique');
|
|
453
584
|
}
|
|
454
585
|
const query = plainObject(object.query, 'DataSurface query capabilities');
|
|
455
|
-
exactKeys(query, [
|
|
586
|
+
exactKeys(query, [
|
|
587
|
+
'modes',
|
|
588
|
+
'projectableColumnIds',
|
|
589
|
+
'searchableColumnIds',
|
|
590
|
+
'filterableColumnIds',
|
|
591
|
+
'sortableColumnIds',
|
|
592
|
+
], 'DataSurface query capabilities');
|
|
456
593
|
const modes = normalizeStringArray(query.modes, 'DataSurface query modes', {
|
|
457
594
|
sort: true,
|
|
458
595
|
});
|
|
@@ -461,13 +598,27 @@ export function normalizeDataSurfaceDescriptor(value) {
|
|
|
461
598
|
throw new TypeError(`Unsupported DataSurface query mode: ${mode}`);
|
|
462
599
|
}
|
|
463
600
|
}
|
|
464
|
-
const projectableColumnIds =
|
|
601
|
+
const projectableColumnIds = normalizeIdentifierArray(query.projectableColumnIds, 'DataSurface projectable column ids', { sort: true });
|
|
465
602
|
const knownColumns = new Set(columns.map((column) => column.id));
|
|
466
603
|
for (const columnId of projectableColumnIds) {
|
|
467
604
|
if (!knownColumns.has(columnId)) {
|
|
468
605
|
throw new TypeError(`Unknown projectable DataSurface column: ${columnId}`);
|
|
469
606
|
}
|
|
470
607
|
}
|
|
608
|
+
const queryColumnAllowlist = (value, label) => {
|
|
609
|
+
if (value === undefined)
|
|
610
|
+
return undefined;
|
|
611
|
+
const ids = normalizeStringArray(value, label, { sort: true });
|
|
612
|
+
for (const columnId of ids) {
|
|
613
|
+
if (!knownColumns.has(columnId)) {
|
|
614
|
+
throw new TypeError(`Unknown ${label}: ${columnId}`);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return ids;
|
|
618
|
+
};
|
|
619
|
+
const searchableColumnIds = queryColumnAllowlist(query.searchableColumnIds, 'searchable DataSurface column');
|
|
620
|
+
const filterableColumnIds = queryColumnAllowlist(query.filterableColumnIds, 'filterable DataSurface column');
|
|
621
|
+
const sortableColumnIds = queryColumnAllowlist(query.sortableColumnIds, 'sortable DataSurface column');
|
|
471
622
|
if (!Array.isArray(object.controls)) {
|
|
472
623
|
throw new TypeError('DataSurface controls must be an array');
|
|
473
624
|
}
|
|
@@ -476,7 +627,7 @@ export function normalizeDataSurfaceDescriptor(value) {
|
|
|
476
627
|
exactKeys(control, ['id', 'label', 'description'], 'DataSurface control');
|
|
477
628
|
const description = optionalString(control.description, 'DataSurface control description');
|
|
478
629
|
return {
|
|
479
|
-
id:
|
|
630
|
+
id: identifierValue(control.id, 'DataSurface control id'),
|
|
480
631
|
label: stringValue(control.label, 'DataSurface control label'),
|
|
481
632
|
...(description ? { description } : {}),
|
|
482
633
|
};
|
|
@@ -496,6 +647,7 @@ export function normalizeDataSurfaceDescriptor(value) {
|
|
|
496
647
|
'sensitivity',
|
|
497
648
|
'selectionScopes',
|
|
498
649
|
'requiresConfirmation',
|
|
650
|
+
'columnIds',
|
|
499
651
|
], 'DataSurface action');
|
|
500
652
|
if (action.requiresConfirmation !== undefined &&
|
|
501
653
|
typeof action.requiresConfirmation !== 'boolean') {
|
|
@@ -509,8 +661,17 @@ export function normalizeDataSurfaceDescriptor(value) {
|
|
|
509
661
|
}
|
|
510
662
|
const sensitivity = normalizeSensitivity(action.sensitivity, 'DataSurface action sensitivity');
|
|
511
663
|
const description = optionalString(action.description, 'DataSurface action description');
|
|
664
|
+
const columnIds = action.columnIds === undefined
|
|
665
|
+
? undefined
|
|
666
|
+
: normalizeStringArray(action.columnIds, 'DataSurface action column ids', {
|
|
667
|
+
sort: true,
|
|
668
|
+
});
|
|
669
|
+
if (columnIds?.some((columnId) => !knownColumns.has(columnId))) {
|
|
670
|
+
const unknownColumnId = columnIds.find((columnId) => !knownColumns.has(columnId));
|
|
671
|
+
throw new TypeError(`Unknown DataSurface action column id: ${unknownColumnId}`);
|
|
672
|
+
}
|
|
512
673
|
return {
|
|
513
|
-
id:
|
|
674
|
+
id: identifierValue(action.id, 'DataSurface action id'),
|
|
514
675
|
label: stringValue(action.label, 'DataSurface action label'),
|
|
515
676
|
...(description ? { description } : {}),
|
|
516
677
|
...(sensitivity ? { sensitivity } : {}),
|
|
@@ -518,6 +679,7 @@ export function normalizeDataSurfaceDescriptor(value) {
|
|
|
518
679
|
...(action.requiresConfirmation === undefined
|
|
519
680
|
? {}
|
|
520
681
|
: { requiresConfirmation: action.requiresConfirmation }),
|
|
682
|
+
...(columnIds ? { columnIds } : {}),
|
|
521
683
|
};
|
|
522
684
|
});
|
|
523
685
|
if (new Set(actions.map((action) => action.id)).size !== actions.length) {
|
|
@@ -529,7 +691,7 @@ export function normalizeDataSurfaceDescriptor(value) {
|
|
|
529
691
|
if (maxQueryRows > MAX_QUERY_LIMIT) {
|
|
530
692
|
throw new TypeError(`DataSurface maxQueryRows cannot exceed ${MAX_QUERY_LIMIT}`);
|
|
531
693
|
}
|
|
532
|
-
const rowKey =
|
|
694
|
+
const rowKey = identifierValue(object.rowKey, 'DataSurface row key');
|
|
533
695
|
if (!knownColumns.has(rowKey)) {
|
|
534
696
|
throw new TypeError('DataSurface rowKey must name a declared column');
|
|
535
697
|
}
|
|
@@ -542,7 +704,13 @@ export function normalizeDataSurfaceDescriptor(value) {
|
|
|
542
704
|
...(description ? { description } : {}),
|
|
543
705
|
rowKey,
|
|
544
706
|
columns,
|
|
545
|
-
query: {
|
|
707
|
+
query: {
|
|
708
|
+
modes,
|
|
709
|
+
projectableColumnIds,
|
|
710
|
+
...(searchableColumnIds ? { searchableColumnIds } : {}),
|
|
711
|
+
...(filterableColumnIds ? { filterableColumnIds } : {}),
|
|
712
|
+
...(sortableColumnIds ? { sortableColumnIds } : {}),
|
|
713
|
+
},
|
|
546
714
|
controls,
|
|
547
715
|
actions,
|
|
548
716
|
limits: {
|
|
@@ -581,13 +749,10 @@ export function normalizeDataSurfaceVisibleCommand(value) {
|
|
|
581
749
|
if (object.version !== 1) {
|
|
582
750
|
throw new TypeError('Unsupported DataSurface visible command version');
|
|
583
751
|
}
|
|
584
|
-
const commandId =
|
|
585
|
-
if (commandId.length > MAX_REQUEST_ID_LENGTH) {
|
|
586
|
-
throw new TypeError('DataSurface command id is too long');
|
|
587
|
-
}
|
|
752
|
+
const commandId = identifierValue(object.commandId, 'DataSurface command id');
|
|
588
753
|
const commandIdentity = normalizeIdentity(object.identity);
|
|
589
754
|
const expectedRevision = revisionNumber(object.expectedRevision);
|
|
590
|
-
const controlId =
|
|
755
|
+
const controlId = identifierValue(object.controlId, 'DataSurface control id');
|
|
591
756
|
assertRequestByteLimit(value, 'DataSurface visible command');
|
|
592
757
|
const normalized = {
|
|
593
758
|
version: 1,
|
|
@@ -610,10 +775,7 @@ export function normalizeDataSurfaceQueryRequest(value) {
|
|
|
610
775
|
if (object.version !== 1) {
|
|
611
776
|
throw new TypeError('Unsupported DataSurface query request version');
|
|
612
777
|
}
|
|
613
|
-
const requestId =
|
|
614
|
-
if (requestId.length > MAX_REQUEST_ID_LENGTH) {
|
|
615
|
-
throw new TypeError('DataSurface query request id is too long');
|
|
616
|
-
}
|
|
778
|
+
const requestId = identifierValue(object.requestId, 'DataSurface query request id');
|
|
617
779
|
const identity = normalizeIdentity(object.identity);
|
|
618
780
|
if (kind === 'rows') {
|
|
619
781
|
exactKeys(object, [
|
|
@@ -644,7 +806,7 @@ export function normalizeDataSurfaceQueryRequest(value) {
|
|
|
644
806
|
...(object.projection === undefined
|
|
645
807
|
? {}
|
|
646
808
|
: {
|
|
647
|
-
projection:
|
|
809
|
+
projection: normalizeIdentifierArray(object.projection, 'DataSurface query projection', { sort: true }),
|
|
648
810
|
}),
|
|
649
811
|
};
|
|
650
812
|
}
|
|
@@ -665,7 +827,7 @@ export function normalizeDataSurfaceQueryRequest(value) {
|
|
|
665
827
|
requestId,
|
|
666
828
|
identity,
|
|
667
829
|
kind,
|
|
668
|
-
columnId:
|
|
830
|
+
columnId: identifierValue(object.columnId, 'DataSurface facets query column id'),
|
|
669
831
|
limit,
|
|
670
832
|
};
|
|
671
833
|
}
|
|
@@ -686,17 +848,14 @@ export function normalizeDataSurfaceActionRequest(value) {
|
|
|
686
848
|
if (object.version !== 1) {
|
|
687
849
|
throw new TypeError('Unsupported DataSurface action request version');
|
|
688
850
|
}
|
|
689
|
-
const requestId =
|
|
690
|
-
if (requestId.length > MAX_REQUEST_ID_LENGTH) {
|
|
691
|
-
throw new TypeError('DataSurface action request id is too long');
|
|
692
|
-
}
|
|
851
|
+
const requestId = identifierValue(object.requestId, 'DataSurface action request id');
|
|
693
852
|
const phase = stringValue(object.phase, 'DataSurface action phase');
|
|
694
853
|
if (phase !== 'preview' && phase !== 'apply') {
|
|
695
854
|
throw new TypeError(`Unsupported DataSurface action phase: ${phase}`);
|
|
696
855
|
}
|
|
697
856
|
const confirmationToken = optionalString(object.confirmationToken, 'DataSurface confirmation token');
|
|
698
857
|
const actionIdentity = normalizeIdentity(object.identity);
|
|
699
|
-
const actionId =
|
|
858
|
+
const actionId = identifierValue(object.actionId, 'DataSurface action id');
|
|
700
859
|
const selection = normalizeSelection(object.selection);
|
|
701
860
|
assertRequestByteLimit(value, 'DataSurface action request');
|
|
702
861
|
const normalized = {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Maps declared DataSurface controls onto the existing DataTable command model. */
|
|
2
|
+
import type { DataTableCommand } from './DataTableController.js';
|
|
3
|
+
import type { DataSurfaceVisibleCommand } from './data-surface.js';
|
|
4
|
+
/**
|
|
5
|
+
* Returns `null` for a component-local control (focus, reveal, refresh, …) or
|
|
6
|
+
* an invalid table command. The mounted component owns those local controls.
|
|
7
|
+
*/
|
|
8
|
+
export declare function dataTableCommandFromDataSurfaceCommand(command: DataSurfaceVisibleCommand): DataTableCommand | null;
|
|
9
|
+
//# sourceMappingURL=data-table-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-surface.d.ts","sourceRoot":"","sources":["../../../src/components/data/data-table-surface.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAEpF,OAAO,KAAK,EAEV,gBAAgB,EAKjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAqJ3B;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,yBAAyB,GACjC,gBAAgB,GAAG,IAAI,CA8EzB"}
|