@getaster/elements 0.3.0 → 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 (93) hide show
  1. package/NOTICE +4 -0
  2. package/README.md +13 -4
  3. package/bin/aster-theme-check.js +35 -4
  4. package/dist/base/element.d.ts +8 -1
  5. package/dist/base/element.js +7 -2
  6. package/dist/button/button.d.ts +17 -2
  7. package/dist/button/button.js +42 -8
  8. package/dist/composition/builtins.d.ts +623 -1
  9. package/dist/composition/builtins.js +232 -4
  10. package/dist/date/calendar.d.ts +3 -0
  11. package/dist/date/calendar.js +8 -2
  12. package/dist/date/date-field.d.ts +23 -3
  13. package/dist/date/date-field.js +77 -9
  14. package/dist/date/dates.d.ts +10 -2
  15. package/dist/date/dates.js +23 -3
  16. package/dist/dialog/config.d.ts +4 -0
  17. package/dist/dialog/config.js +8 -0
  18. package/dist/dialog/dialog.d.ts +34 -6
  19. package/dist/dialog/dialog.js +151 -14
  20. package/dist/field/bound-field.d.ts +17 -1
  21. package/dist/field/bound-field.js +68 -7
  22. package/dist/field/check.js +1 -0
  23. package/dist/field/field.js +1 -1
  24. package/dist/field/input.d.ts +1 -0
  25. package/dist/field/input.js +2 -2
  26. package/dist/field/number-field.js +2 -2
  27. package/dist/filter/filter-builder.d.ts +7 -1
  28. package/dist/filter/filter-builder.js +8 -1
  29. package/dist/form/controls.d.ts +40 -8
  30. package/dist/form/controls.js +58 -15
  31. package/dist/form/custom-field.d.ts +1 -0
  32. package/dist/form/custom-field.js +23 -0
  33. package/dist/form/features.d.ts +27 -0
  34. package/dist/form/features.js +52 -0
  35. package/dist/form/form.d.ts +67 -7
  36. package/dist/form/form.js +267 -24
  37. package/dist/form/policy.d.ts +29 -0
  38. package/dist/form/policy.js +16 -0
  39. package/dist/grid/appearance.d.ts +365 -0
  40. package/dist/grid/appearance.js +814 -0
  41. package/dist/grid/features.d.ts +38 -0
  42. package/dist/grid/features.js +78 -0
  43. package/dist/grid/grid.d.ts +216 -4
  44. package/dist/grid/grid.js +1853 -301
  45. package/dist/grid/policy.d.ts +58 -0
  46. package/dist/grid/policy.js +17 -0
  47. package/dist/grid/view.d.ts +32 -2
  48. package/dist/grid/view.js +89 -4
  49. package/dist/index.d.ts +14 -11
  50. package/dist/index.js +2 -1
  51. package/dist/menu/config.d.ts +7 -0
  52. package/dist/menu/config.js +44 -0
  53. package/dist/menu/menu.d.ts +23 -0
  54. package/dist/menu/menu.js +69 -17
  55. package/dist/picker/picker.js +8 -3
  56. package/dist/section/accordion.d.ts +26 -0
  57. package/dist/section/accordion.js +86 -8
  58. package/dist/section/policy.d.ts +8 -0
  59. package/dist/section/policy.js +17 -0
  60. package/dist/section/section.d.ts +30 -0
  61. package/dist/section/section.js +106 -3
  62. package/dist/select/choice-element.d.ts +12 -0
  63. package/dist/select/choice-element.js +36 -0
  64. package/dist/select/choice.d.ts +12 -2
  65. package/dist/select/choice.js +93 -28
  66. package/dist/select/select.d.ts +12 -0
  67. package/dist/select/select.js +37 -1
  68. package/dist/styles/contract.d.ts +14 -0
  69. package/dist/styles/contract.js +15 -0
  70. package/dist/switch/switch.d.ts +16 -0
  71. package/dist/switch/switch.js +56 -6
  72. package/dist/tree/navigator.d.ts +3 -0
  73. package/dist/tree/navigator.js +26 -2
  74. package/dist/window/chrome.d.ts +5 -1
  75. package/dist/window/chrome.js +4 -3
  76. package/dist/window/config.d.ts +71 -0
  77. package/dist/window/config.js +40 -0
  78. package/dist/window/window.d.ts +51 -13
  79. package/dist/window/window.js +233 -38
  80. package/dist/yaml.d.ts +19 -0
  81. package/dist/yaml.js +57 -0
  82. package/package.json +10 -4
  83. package/styles/aster-ui.css +233 -10
  84. package/styles/base.css +36 -0
  85. package/styles/contract.ts +16 -0
  86. package/styles/elements.css +197 -10
  87. package/styles/fonts/OFL-bricolage-grotesque.txt +93 -0
  88. package/styles/fonts/OFL-fraunces.txt +93 -0
  89. package/styles/fonts/bricolage-grotesque-latin-opsz-normal.woff2 +0 -0
  90. package/styles/fonts/fraunces-latin-full-normal.woff2 +0 -0
  91. package/styles/fonts.css +17 -0
  92. package/styles/theme-harbour.css +5 -0
  93. package/styles/theme-lamplight.css +5 -0
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Form-wide static edit defaults. A field's own defaults in
3
+ * [[object:FormField]] win over these, and a page rule outranks both.
4
+ */
5
+ export interface FormPolicy {
6
+ /** Every field starts read-only unless its FormField or a page rule says otherwise. */
7
+ readonly readOnly?: boolean;
8
+ /** Every field starts disabled unless its FormField or a page rule says otherwise. */
9
+ readonly disabled?: boolean;
10
+ }
11
+ /** Which presentation surfaces the form shows, and how it lays them out. */
12
+ export interface FormChrome {
13
+ /** Columns for sections without their own `columns`. Default `2`. */
14
+ readonly columns?: number;
15
+ /** Labels above their controls (`"top"`, the default) or beside them (`"start"`). */
16
+ readonly titleOrientation?: "top" | "start";
17
+ /** Draw each error under its field. Default `true`; false leaves the error summary as the only surface. */
18
+ readonly showInlineErrors?: boolean;
19
+ /** List the errors above the sections, each a button that focuses its field. Default `false`. */
20
+ readonly errorSummary?: boolean;
21
+ /** Move focus to the first invalid field when validation first finds errors. Default `false`. */
22
+ readonly autoFocus?: boolean;
23
+ }
24
+ export declare const DEFAULT_FORM_COLUMNS = 2;
25
+ export declare function formColumns(chrome: FormChrome): number;
26
+ export declare function titleOrientation(chrome: FormChrome): "top" | "start";
27
+ export declare function inlineErrorsShown(chrome: FormChrome): boolean;
28
+ export declare function errorSummaryShown(chrome: FormChrome): boolean;
29
+ export declare function autoFocusOnError(chrome: FormChrome): boolean;
@@ -0,0 +1,16 @@
1
+ export const DEFAULT_FORM_COLUMNS = 2;
2
+ export function formColumns(chrome) {
3
+ return chrome.columns ?? DEFAULT_FORM_COLUMNS;
4
+ }
5
+ export function titleOrientation(chrome) {
6
+ return chrome.titleOrientation ?? "top";
7
+ }
8
+ export function inlineErrorsShown(chrome) {
9
+ return chrome.showInlineErrors !== false;
10
+ }
11
+ export function errorSummaryShown(chrome) {
12
+ return chrome.errorSummary === true;
13
+ }
14
+ export function autoFocusOnError(chrome) {
15
+ return chrome.autoFocus === true;
16
+ }
@@ -0,0 +1,365 @@
1
+ import type { Entity, Field, KeyText, Value } from "@getaster/data";
2
+ import { type DateFormat } from "../date/dates.ts";
3
+ /** One class or several. A string may name space-separated classes. */
4
+ export type ClassNames = string | readonly string[];
5
+ /** How a column's values and header line up. */
6
+ export type ColumnAlign = "start" | "center" | "end";
7
+ /** The semantic tone a hilite or value-map entry names; CSS decides its look. */
8
+ export type PresentationTone = "neutral" | "positive" | "caution" | "negative";
9
+ /** How a plain-data match compares a record's field. */
10
+ export type ValueMatchOperator = "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "between" | "contains" | "empty" | "notEmpty";
11
+ /**
12
+ * A presentation condition on one record field. `in` takes an array and
13
+ * `between` a two-item inclusive range; `empty` and `notEmpty` take no value.
14
+ * A JS-only predicate is the `test` hook of a class rule or hilite.
15
+ */
16
+ export type ValueMatch = {
17
+ /** The record field to read. */
18
+ readonly field: string;
19
+ /** How the field's value is compared. */
20
+ readonly op: ValueMatchOperator;
21
+ /** The comparison value; an array for `in`, two values for `between`. */
22
+ readonly value?: Value | readonly Value[];
23
+ };
24
+ /** How a number is written: plain decimal (default), integer, percent or currency. */
25
+ export type NumberFormatStyle = "decimal" | "integer" | "percent" | "currency";
26
+ /**
27
+ * A declarative display format for a date or number column. It only applies
28
+ * to a matching field type; other values keep the grid's default text.
29
+ */
30
+ export type ColumnFormat = {
31
+ /** A calendar date (`Edm.Date`). */
32
+ readonly kind: "date";
33
+ /** `"medium"` (default), `"short"` or `"iso"`, as [[type:DateFormat]]. */
34
+ readonly style?: DateFormat;
35
+ } | {
36
+ /** A numeric field (integers, decimal, single and double). */
37
+ readonly kind: "number";
38
+ /** The display style; `"decimal"` (default). */
39
+ readonly style?: NumberFormatStyle;
40
+ /** ISO 4217 code for `"currency"`; defaults to `"GBP"`. */
41
+ readonly currency?: string;
42
+ /** Minimum fraction digits. */
43
+ readonly minimumFractionDigits?: number;
44
+ /** Maximum fraction digits; `"integer"` defaults it to `0`. */
45
+ readonly maximumFractionDigits?: number;
46
+ };
47
+ /** A value-map entry: display text alone, or text with a tone and classes. */
48
+ export type ValueMapValue = string | {
49
+ /** The display text for the raw value. */
50
+ readonly label: string;
51
+ /** A semantic tone for the cell. */
52
+ readonly tone?: PresentationTone;
53
+ /** Extra classes for the cell. */
54
+ readonly class?: ClassNames;
55
+ };
56
+ /**
57
+ * Per-column display overrides, keyed by the raw value written as text
58
+ * (`String(value)`). Metadata allowed values remain the base for entries the
59
+ * map omits; an unknown value keeps the grid's default display.
60
+ */
61
+ export type ColumnValueMap = Readonly<Record<string, ValueMapValue>>;
62
+ /** A value-map lookup hit: text plus the optional tone and classes. */
63
+ export type MappedValue = {
64
+ /** The display text. */
65
+ readonly label: string;
66
+ /** A semantic tone for the cell. */
67
+ readonly tone?: PresentationTone;
68
+ /** Extra classes for the cell. */
69
+ readonly class?: ClassNames;
70
+ };
71
+ /** The row a class rule or predicate sees. */
72
+ export type RowStyleContext = {
73
+ /** The record drawn in the row. */
74
+ readonly entity: Entity;
75
+ /** The record's key. */
76
+ readonly key: KeyText;
77
+ /** The row's position in the grid as rendered. */
78
+ readonly index: number;
79
+ };
80
+ /** The cell a class rule or predicate sees. */
81
+ export type CellStyleContext = RowStyleContext & {
82
+ /** The column's field name. */
83
+ readonly field: string;
84
+ /** The record's raw value for the field. */
85
+ readonly value: Value | undefined;
86
+ };
87
+ /** A plain-data row class rule, with a JS-only predicate where matching needs code. */
88
+ export type RowClassRule = {
89
+ /** A condition on a record field. */
90
+ readonly when?: ValueMatch;
91
+ /** A JS-only predicate; combined with `when` when both are present. */
92
+ readonly test?: (row: RowStyleContext) => boolean;
93
+ /** The classes the rule adds when it matches. */
94
+ readonly class: ClassNames;
95
+ };
96
+ /** A plain-data cell class rule, with a JS-only predicate where matching needs code. */
97
+ export type CellClassRule = {
98
+ /** A condition on a record field. */
99
+ readonly when?: ValueMatch;
100
+ /** A JS-only predicate; combined with `when` when both are present. */
101
+ readonly test?: (cell: CellStyleContext) => boolean;
102
+ /** The classes the rule adds when it matches. */
103
+ readonly class: ClassNames;
104
+ };
105
+ /**
106
+ * Static classes, an ordered list mixing static names, rules and JS-only
107
+ * predicates, or a JS-only predicate. Predicates are rejected by the
108
+ * composition catalog.
109
+ */
110
+ export type RowClass = ClassNames | readonly (RowClassRule | string | ((row: RowStyleContext) => ClassNames | undefined))[] | ((row: RowStyleContext) => ClassNames | undefined);
111
+ /** Static classes, an ordered list mixing names, rules and JS-only predicates, or a predicate. */
112
+ export type CellClass = ClassNames | readonly (CellClassRule | string | ((cell: CellStyleContext) => ClassNames | undefined))[] | ((cell: CellStyleContext) => ClassNames | undefined);
113
+ /**
114
+ * A status/traffic-light rule. Row-scoped rules mark the row; cell-scoped
115
+ * rules mark one column's cells. A plain-data `when` and a JS-only `test`
116
+ * combine with AND when both are present.
117
+ */
118
+ export type Hilite = {
119
+ /** Where it applies: the row (default) or one column's cells. */
120
+ readonly scope?: "row" | "cell";
121
+ /** The column a cell-scoped hilite marks; required for `scope: "cell"`. */
122
+ readonly field?: string;
123
+ /** The condition, on any record field. */
124
+ readonly when?: ValueMatch;
125
+ /** A JS-only predicate over the record and its value for the matched field. */
126
+ readonly test?: (entity: Entity, value: Value | undefined) => boolean;
127
+ /** The tone to mark; the last matching hilite with a tone wins. */
128
+ readonly tone?: PresentationTone;
129
+ /** Extra classes, in declared order. */
130
+ readonly class?: ClassNames;
131
+ };
132
+ /** Presentation overrides for one column, keyed by field name. */
133
+ export type ColumnPresentation = {
134
+ /** Header text; the metadata title by default. */
135
+ readonly title?: string;
136
+ /** Alignment for the header and cells; numeric fields default to the end. */
137
+ readonly align?: ColumnAlign;
138
+ /** Raw-value display overrides; metadata allowed values are the base. */
139
+ readonly valueMap?: ColumnValueMap;
140
+ /** A display format for date and number fields. */
141
+ readonly format?: ColumnFormat;
142
+ /** Classes for this column's cells: static, rules, or a JS-only predicate. */
143
+ readonly cellClass?: CellClass;
144
+ };
145
+ /**
146
+ * The grid's one presentation surface: per-column overrides, row and cell
147
+ * class hooks, and hilites. Every field is optional; `{}` keeps today's
148
+ * rendering. Plain data travels through the composition catalog; predicates
149
+ * are JavaScript-only.
150
+ */
151
+ export type GridPresentation = {
152
+ /** Per-column overrides, by field name. */
153
+ readonly columns?: Readonly<Record<string, ColumnPresentation>>;
154
+ /** Classes for every record row: static, rules, or a JS-only predicate. */
155
+ readonly rowClass?: RowClass;
156
+ /** Classes for every record cell: static, rules, or a JS-only predicate. */
157
+ readonly cellClass?: CellClass;
158
+ /** Status rules, applied in declared order after the class hooks. */
159
+ readonly hilites?: readonly Hilite[];
160
+ };
161
+ /** The classes and tone a row or cell received from presentation configuration. */
162
+ export type StyleDecoration = {
163
+ /** Classes in precedence order, without duplicates. */
164
+ readonly classes: readonly string[];
165
+ /** The last tone a matching hilite (or value-map entry) supplied. */
166
+ readonly tone?: PresentationTone;
167
+ };
168
+ /** The grid's overridable strings. Missing entries keep today's text; `{name}` is a placeholder. */
169
+ export declare const GRID_LABEL_DEFAULTS: {
170
+ readonly toolbarLabel: "{label} view";
171
+ readonly expandAll: "Expand all";
172
+ readonly collapseAll: "Collapse all";
173
+ readonly sort: "Sort";
174
+ readonly filters: "Filters";
175
+ readonly filtersActive: "Filters ({count})";
176
+ readonly advancedFilter: "Advanced filter";
177
+ readonly columns: "Columns";
178
+ readonly views: "Views";
179
+ readonly groupsFailed: "Couldn’t load groups.";
180
+ readonly retryGroups: "Retry groups";
181
+ readonly treeSearching: "Finding where the matches are…";
182
+ readonly treeTooBroad: "Too many matches to show where they are. Narrow the filter.";
183
+ readonly treeSearchFailed: "Couldn’t find where the matches are. Change the filter to try again.";
184
+ readonly groupedBy: "Grouped by {field}";
185
+ readonly thenBy: "Then by {field}";
186
+ readonly stopGrouping: "Stop grouping";
187
+ readonly removeGrouping: "Remove grouping {field}";
188
+ readonly moveGroupingEarlier: "Move {field} grouping earlier";
189
+ readonly moveGroupingLater: "Move {field} grouping later";
190
+ readonly groupingRefused: "Grouping is refused.";
191
+ readonly removeRefusedGrouping: "{reason} Remove it from the saved view.";
192
+ readonly filterRefused: "This page doesn’t allow filtering.";
193
+ readonly criteriaNeedsRepair: "Saved filter needs repair. No matches will be returned.";
194
+ readonly notLoaded: "Not loaded";
195
+ readonly loading: "Loading…";
196
+ readonly aboutRows: "About {count} rows";
197
+ readonly atLeastRows: "{count}+ rows";
198
+ readonly row: "1 row";
199
+ readonly rows: "{count} rows";
200
+ readonly group: "1 group";
201
+ readonly groups: "{count} groups";
202
+ readonly groupedRows: "{rows} in {groups}";
203
+ readonly pages: "Pages";
204
+ readonly firstPage: "First page";
205
+ readonly previousPage: "Previous page";
206
+ readonly nextPage: "Next page";
207
+ readonly lastPage: "Last page";
208
+ readonly page: "Page {page}";
209
+ readonly pageOf: "Page {page} of {pages}";
210
+ readonly pageRows: " · rows {first}–{last} of {total}";
211
+ readonly sortRows: "Sort rows";
212
+ readonly noSortableColumns: "This grid has no sortable columns.";
213
+ readonly sortAction: "Sort {field}";
214
+ readonly sortActionNow: "Sort {field}, now {direction}";
215
+ readonly sortReverse: "Click to reverse";
216
+ readonly sortAscending: "Click to sort ascending";
217
+ readonly sortPriority: "Sort priority {priority}.";
218
+ readonly clearFieldSorting: "Clear {field} sorting";
219
+ readonly clearSorting: "Clear sorting";
220
+ readonly moveFieldUp: "Move {field} up";
221
+ readonly moveFieldDown: "Move {field} down";
222
+ readonly resetView: "Reset to the page’s view";
223
+ readonly savedViews: "Saved views";
224
+ readonly noSavedViews: "None yet. Shape the grid, then save it here by name.";
225
+ readonly deleteView: "Delete the view {name}";
226
+ readonly viewName: "Name for this view";
227
+ readonly viewNamePlaceholder: "Name this view";
228
+ readonly save: "Save";
229
+ readonly delete: "Delete";
230
+ readonly sortBy: "Sort by {field}";
231
+ readonly addToSort: "; Shift adds it to the sort";
232
+ readonly dragToMove: "Drag to move";
233
+ readonly dragToResize: "Drag its right edge to resize";
234
+ readonly columnOptions: "{field} column options";
235
+ readonly rowColumn: "{field} column";
236
+ readonly rowMenu: "Row";
237
+ readonly notFilterable: "Not filterable";
238
+ readonly filterField: "Filter {field}";
239
+ readonly chooseFilterDate: "Choose a date to filter {field}";
240
+ readonly menuSort: "Sort";
241
+ readonly ascending: "Ascending";
242
+ readonly descending: "Descending";
243
+ readonly directionAscending: "ascending";
244
+ readonly directionDescending: "descending";
245
+ readonly notSorted: "Not sorted";
246
+ readonly addToSortMenu: "Add to the sort";
247
+ readonly groupBy: "Group by {field}";
248
+ readonly freezeUpTo: "Freeze up to {field}";
249
+ readonly menuMove: "Move";
250
+ readonly moveLeft: "Left";
251
+ readonly moveRight: "Right";
252
+ readonly moveToStart: "To the start";
253
+ readonly moveToEnd: "To the end";
254
+ readonly menuWidth: "Width";
255
+ readonly wider: "Wider";
256
+ readonly narrower: "Narrower";
257
+ readonly fitSpace: "Fit the space";
258
+ readonly hideField: "Hide {field}";
259
+ readonly columnsEllipsis: "Columns…";
260
+ readonly firstColumn: "It's the first column.";
261
+ readonly lastColumn: "It's the last column.";
262
+ readonly sortServiceRefused: "{field} can’t be sorted by this service.";
263
+ readonly sortNavigationRefused: "{field} can’t be sorted until its related record’s display field is known.";
264
+ readonly sortPolicyRefused: "Sorting by {field} isn’t allowed on this page.";
265
+ readonly filterServiceRefused: "{field} can’t be filtered by this service.";
266
+ readonly filterPolicyRefused: "Filtering by {field} isn’t allowed on this page.";
267
+ readonly filterOperatorRefused: "{field} can’t be filtered by {operator} on this page.";
268
+ readonly groupSharedRefused: "{field} can’t be grouped in a grid over shared data.";
269
+ readonly groupUnknownRefused: "{field} can’t be grouped.";
270
+ readonly groupLongRefused: "{field} is too long to group.";
271
+ readonly groupPolicyRefused: "Grouping by {field} isn’t allowed on this page.";
272
+ readonly resizePolicyRefused: "Resizing {field} isn’t allowed on this page.";
273
+ readonly movePolicyRefused: "Moving {field} isn’t allowed on this page.";
274
+ readonly hideLastRefused: "The last visible column can’t be hidden.";
275
+ readonly hidePolicyRefused: "Hiding {field} isn’t allowed on this page.";
276
+ readonly freezePolicyRefused: "Freezing {field} isn’t allowed on this page.";
277
+ readonly freezeUnknownRefused: "{field} can’t be frozen.";
278
+ readonly freezeLastRefused: "At least one column must stay unfrozen.";
279
+ readonly loadFailed: "Couldn’t load rows.";
280
+ readonly retry: "Retry";
281
+ readonly groupLoadFailed: "Couldn’t load group.";
282
+ readonly retryGroup: "Retry group {group}";
283
+ readonly summaryLoadFailed: "Couldn’t load summaries.";
284
+ readonly summaryLoading: "Loading summaries…";
285
+ readonly summariesUpdated: "Summaries updated";
286
+ readonly retrySummaries: "Retry summaries";
287
+ readonly summaryRows: "Rows";
288
+ readonly summarySum: "Sum {field}";
289
+ readonly summaryMinimum: "Minimum {field}";
290
+ readonly summaryMaximum: "Maximum {field}";
291
+ readonly summaryAverage: "Average {field}";
292
+ readonly summaryDistinct: "Distinct {field}";
293
+ readonly summaryAria: "{label} summaries";
294
+ readonly empty: "";
295
+ readonly rowLoadFailed: "Could not load that row. Move to another row or retry.";
296
+ readonly hiddenTitle: "You can't see this value";
297
+ readonly hiddenValue: "Hidden";
298
+ readonly advancedApplied: "Advanced filter applied";
299
+ readonly advancedCleared: "Advanced filter cleared";
300
+ readonly sortedBy: "Sorted by {sorts}";
301
+ readonly sortEntry: "{field}, {direction}";
302
+ readonly sortSeparator: ", then ";
303
+ readonly dragPickedUp: "Picked up {field}. Drop it on another row to move it under that row, or on Top level to move it to the top level.";
304
+ readonly dragNotMoved: "{field} not moved.";
305
+ readonly foldersLimit: "Opened {limit} folders. Narrow the tree to open more.";
306
+ readonly foldersOpened: "All folders opened.";
307
+ readonly foldersClosed: "All folders closed.";
308
+ readonly expansionLimit: "Only {limit} {noun} can be open at once. Close one first.";
309
+ readonly driftSort: "Sorted by {field}";
310
+ readonly driftFilter: "Filtered by {field}";
311
+ readonly driftCriteria: "The advanced filter uses {field}";
312
+ readonly driftGroup: "Grouped by {field}";
313
+ readonly driftHidden: "Column {field} is hidden";
314
+ readonly driftFrozen: "Column {field} is frozen";
315
+ readonly driftEntry: "{what}: {reason}";
316
+ readonly driftNote: "The saved view can’t fully apply. {entries} The view keeps these settings and uses them again when the page allows it.";
317
+ readonly driftFallbackReason: "{field} can’t be used by the saved view.";
318
+ readonly dismiss: "Dismiss";
319
+ };
320
+ /** One overridable grid string: a key of [[constant:GRID_LABEL_DEFAULTS]]. */
321
+ export type GridLabel = keyof typeof GRID_LABEL_DEFAULTS;
322
+ /**
323
+ * The grid's label bag. Every entry is optional; a missing entry keeps
324
+ * today's string. `{name}` placeholders are filled from the event the string
325
+ * describes. This is a stopgap before full i18n, not an i18n engine: it
326
+ * carries no plural rules, number locale or direction.
327
+ */
328
+ export type GridLabels = {
329
+ readonly [K in GridLabel]?: string;
330
+ };
331
+ /**
332
+ * Checks a [[type:GridPresentation]] value. With `allowFunctions` true, the
333
+ * JS-only class predicates and hilite tests are accepted; the composition
334
+ * catalog calls it without that, so plain-data shapes are all it can carry.
335
+ */
336
+ export declare function validateGridPresentation(value: unknown, allowFunctions?: boolean): asserts value is GridPresentation;
337
+ /** Checks a [[type:GridLabels]] value: known keys, string values only. */
338
+ export declare function validateGridLabels(value: unknown): asserts value is GridLabels;
339
+ /** One label, overridden or defaulted, with `{name}` placeholders filled. */
340
+ export declare function labelText(labels: GridLabels, key: GridLabel, values?: Readonly<Record<string, string | number>>): string;
341
+ /** Whether one record meets a plain-data match. */
342
+ export declare function matchValue(match: ValueMatch, entity: Entity): boolean;
343
+ /**
344
+ * Classes and tone for one record row: the row hook first, then row-scoped
345
+ * hilites in declared order. The last hilite with a tone wins.
346
+ */
347
+ export declare function styleRow(presentation: GridPresentation, context: RowStyleContext): StyleDecoration;
348
+ /**
349
+ * Classes and tone for one record cell: the grid cell hook, then the column
350
+ * hook, then a value-map entry, then cell-scoped hilites in declared order.
351
+ * The last tone wins.
352
+ */
353
+ export declare function styleCell(presentation: GridPresentation, column: ColumnPresentation | undefined, context: CellStyleContext, mapped?: MappedValue): StyleDecoration;
354
+ /**
355
+ * A value-map entry for a raw value, keyed by `String(value)`. `undefined`
356
+ * means the map has no entry: metadata allowed values and default formatting
357
+ * still apply.
358
+ */
359
+ export declare function mappedValue(column: ColumnPresentation | undefined, value: Value | undefined): MappedValue | undefined;
360
+ /**
361
+ * The text a value shows when no renderer, formatter or value-map entry
362
+ * applies. A date or number format overrides the matching type's default;
363
+ * everything else is [[staticMethod:formatValue]]'s text.
364
+ */
365
+ export declare function cellText(field: Field | undefined, value: Value | undefined, format?: ColumnFormat): string;