@antelopejs/dms 0.20.8-next.943.g59ea329 → 0.20.8-next.945.ge4702b6

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 (98) hide show
  1. package/frontend-vue/eslint-globals.generated.mjs +25 -25
  2. package/frontend-vue/layers/dms-core/app/build/composables/user/tablePreferences.ts +37 -54
  3. package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +11 -23
  4. package/frontend-vue/layers/dms-core/app/composables/realtime/useSseStream.ts +2 -2
  5. package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +2 -4
  6. package/frontend-vue/layers/dms-core/app/composables/user/usePreferences.ts +4 -8
  7. package/frontend-vue/layers/dms-core/app/types/confirm-dialog.ts +2 -2
  8. package/frontend-vue/layers/dms-core/app/types/data-type.ts +0 -31
  9. package/frontend-vue/layers/dms-core/app/types/live.ts +3 -3
  10. package/frontend-vue/layers/dms-core/app/types/page.ts +6 -12
  11. package/frontend-vue/layers/dms-core/app/types/watch.ts +1 -10
  12. package/frontend-vue/layers/dms-core/app/utils/query-validation.ts +1 -3
  13. package/frontend-vue/layers/dms-core/app/utils/url-interpolation.ts +4 -3
  14. package/frontend-vue/layers/dms-layout/app/custom-pages/modules.vue +5 -1
  15. package/frontend-vue/layers/dms-ui/app/build/components/form/FormFieldControl.vue +1 -2
  16. package/frontend-vue/layers/dms-ui/app/build/components/form/FormFieldNotes.vue +1 -2
  17. package/frontend-vue/layers/dms-ui/app/build/components/sortable/SortableList.vue +12 -7
  18. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuImport.vue +3 -2
  19. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuRoot.vue +1 -1
  20. package/frontend-vue/layers/dms-ui/app/build/components/table/Table.types.ts +2 -3
  21. package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardRowActions.vue +2 -3
  22. package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardsDisplay.vue +2 -3
  23. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRequests.ts +1 -2
  24. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRows.ts +4 -7
  25. package/frontend-vue/layers/dms-ui/app/build/composables/actions/bulkSelection.ts +1 -2
  26. package/frontend-vue/layers/dms-ui/app/build/composables/actions/rowComponentOptions.ts +5 -3
  27. package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexRawOptions.ts +6 -76
  28. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/cellHelpers.ts +14 -15
  29. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDateCells.ts +2 -3
  30. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +1 -1
  31. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultLinkTypes.ts +1 -2
  32. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultMediaTypes.ts +4 -10
  33. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +19 -27
  34. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultRelationTypes.ts +2 -3
  35. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/metricCells.ts +2 -3
  36. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/numberSuffix.ts +8 -6
  37. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/registerFieldTypes.ts +1 -2
  38. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationBadges.ts +5 -9
  39. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationFilter.ts +6 -7
  40. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationRows.ts +1 -3
  41. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationValue.ts +15 -18
  42. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/twoLineCell.ts +3 -4
  43. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +5 -6
  44. package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldSaved.ts +4 -2
  45. package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldValueRule.ts +13 -18
  46. package/frontend-vue/layers/dms-ui/app/build/composables/form/formEntryContext.ts +3 -2
  47. package/frontend-vue/layers/dms-ui/app/build/composables/form/keyValueRows.ts +12 -15
  48. package/frontend-vue/layers/dms-ui/app/build/composables/form/repeaterTable.ts +5 -6
  49. package/frontend-vue/layers/dms-ui/app/build/composables/form/useFormModel.ts +58 -36
  50. package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +18 -17
  51. package/frontend-vue/layers/dms-ui/app/build/composables/instant-save/useInstantSave.ts +5 -8
  52. package/frontend-vue/layers/dms-ui/app/build/composables/period/usePeriodLocation.ts +3 -1
  53. package/frontend-vue/layers/dms-ui/app/build/composables/table/useRelationFilterLabels.ts +2 -4
  54. package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableConfigClipboard.ts +2 -2
  55. package/frontend-vue/layers/dms-ui/app/build/composables/table/utils/formatFilterValue.ts +5 -6
  56. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewArrival.ts +6 -3
  57. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplays.ts +4 -1
  58. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewFilters.ts +5 -2
  59. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewRealtime.ts +1 -2
  60. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSorting.ts +1 -1
  61. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewTabs.ts +1 -1
  62. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewViews.ts +2 -1
  63. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +3 -3
  64. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/usePersistedPagination.ts +5 -2
  65. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableListData.ts +7 -6
  66. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTablePreferences.ts +9 -19
  67. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +11 -12
  68. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViews.ts +4 -1
  69. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/card.ts +2 -4
  70. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/compareValues.ts +5 -9
  71. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +6 -13
  72. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/pinnedRows.ts +2 -3
  73. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/quickFilters.ts +6 -7
  74. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +1 -2
  75. package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/formValue.ts +0 -14
  76. package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +67 -7
  77. package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +4 -12
  78. package/frontend-vue/layers/dms-ui/app/components/form/components/DisplayValue.vue +2 -17
  79. package/frontend-vue/layers/dms-ui/app/components/form/components/InputRelation.vue +3 -6
  80. package/frontend-vue/layers/dms-ui/app/components/form/components/InputRepeater.vue +1 -2
  81. package/frontend-vue/layers/dms-ui/app/components/form/components/KeyValue.vue +4 -4
  82. package/frontend-vue/layers/dms-ui/app/components/table-view/CascaderPath.vue +2 -3
  83. package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanBoard.vue +1 -4
  84. package/frontend-vue/layers/dms-ui/app/composables/chart/apexAnnotations.ts +2 -2
  85. package/frontend-vue/layers/dms-ui/app/composables/chart/apexPlotOptions.ts +2 -1
  86. package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +1 -1
  87. package/frontend-vue/layers/dms-ui/app/composables/form/types/field-saved.ts +5 -2
  88. package/frontend-vue/layers/dms-ui/app/composables/form/types/field.ts +1 -2
  89. package/frontend-vue/layers/dms-ui/app/composables/form/types/props.ts +5 -1
  90. package/frontend-vue/layers/dms-ui/app/composables/form/types/value.ts +9 -6
  91. package/frontend-vue/layers/dms-ui/app/composables/table-view/kanban.ts +3 -5
  92. package/frontend-vue/layers/dms-ui/app/composables/unsaved-changes/useFormDirty.ts +2 -6
  93. package/frontend-vue/layers/dms-ui/app/entries/components/sortable/SortableList.ts +0 -1
  94. package/frontend-vue/layers/dms-ui/app/utils/cascader.ts +1 -2
  95. package/package.json +3 -3
  96. package/frontend-vue/layers/dms-core/app/build/utils/dataTypeValue.ts +0 -49
  97. package/frontend-vue/layers/dms-core/app/entries/utils/dataTypeValue.ts +0 -1
  98. package/frontend-vue/layers/dms-ui/app/build/components/sortable/sortableGroup.ts +0 -24
@@ -29,8 +29,8 @@ ColorModePreference ColorValue CommandPaletteAssistant
29
29
  CommandPaletteAssistantAnswerProps CommandPaletteAssistantSuggestion
30
30
  CommandPaletteSource ComparisonContext ComparisonStyle ComponentChild
31
31
  ComponentEventData ComponentId ComponentInfo ComponentOptionsData
32
- ComponentOrNoInput ComponentShortcuts ComponentWatchState ComposableText
33
- ComposedText ComposedTextContext ComposedTextCountParam ComposedTextDateFormat
32
+ ComponentOrNoInput ComponentShortcuts ComposableText ComposedText
33
+ ComposedTextContext ComposedTextCountParam ComposedTextDateFormat
34
34
  ComposedTextDateParam ComposedTextMoneyParam ComposedTextNumberFormat
35
35
  ComposedTextNumberParam ComposedTextParam ComposedTextParamType
36
36
  ComposedTextRelativeDateParam ComposedTextTranslate ComposedTextTypedParam
@@ -45,29 +45,29 @@ CustomButton CustomButtonVariant CustomRowAction CustomRowActionBulk
45
45
  CustomRowActionBulkOptions DEFAULT_CASCADER_KEY_MAPPING DEFAULT_COMPARISONS
46
46
  DEFAULT_KEYBOARD_PLATFORM DEFAULT_PAGE_HEADER_ACTIONS_ORDER DEFAULT_PAGE_ICON
47
47
  DEFAULT_PRESETS DEFAULT_TABLE_SEARCH_SHORTCUT Data DataType DataTypeConfig
48
- DataTypeFilterEditorValue DataTypeFormatter DataTypeList DataTypeOptions
49
- DataTypeRow DataTypeSelectSource DataTypeValue DataTypeValueComparer
50
- DateFormatPreference DatetimeBuckets DefaultComponentProps DevReload
51
- DmsMenuItem DonutRecord DownloadActionTarget DrawerDirection DrawerInstance
52
- DrawerOptions DrawerPatch DrawerRowHeader DrawerTargetOptions
53
- DurationFormatOptions DurationPrecision ENDPOINT_MODULES_LISTING
54
- ENDPOINT_STORE_LISTING END_OF_DAY_HOURS END_OF_DAY_MINUTES END_OF_DAY_MS
55
- END_OF_DAY_SECONDS EnclosingForm EventError Events ExportJobStatusResponse
56
- ExportJobTicket FIELD_KEY FIELD_OPERATORS FORM_CONTENT_LANGUAGE_KEY
57
- FORM_FIELD_LOADING_KEY FORM_FIELD_SAVED_KEY FORM_VALIDATOR_KEY
58
- FROM_ACCOUNTS_QUERY FavoritePage FavoritePageMetadata FavoritePageSource
59
- FavoriteRouteResolver FeedCounts FieldCondition FieldControl FieldEqualsRule
60
- FieldErrorAria FieldErrorCode FieldErrorResolution FieldGroup FieldInRule
61
- FieldNotEqualsRule FieldNotInRule FieldOperatorKey FieldRule
62
- FieldValueComparer FileConstraintViolation FileFieldConstraints FoldedCrumbs
63
- FooterLink FormData FormEvents FormFetchResponse FormField FormFieldBadge
64
- FormFieldLink FormFieldOrGroup FormFieldReadonly FormFieldValue FormFunctions
65
- FormProps FormSection FormSectionNav FormServerFieldError FormSubmitResponse
66
- FormValidator FormattedValueParts FrontendBreak FrontendRequirement
67
- FrontendVersionSource GROUPED_DISPLAY_ID HTTP_BAD_REQUEST HTTP_FORBIDDEN
68
- HTTP_INTERNAL_SERVER_ERROR HTTP_NOT_FOUND HTTP_PRECONDITION_FAILED
69
- HTTP_UNAUTHORIZED HandleApiErrorOptions HeaderAction HttpMethod I18nTranslate
70
- INVALID_REQUEST ImageItemValue ImageResizeBounds InputNumberAdjustment
48
+ DataTypeFilterEditorValue DataTypeFormatter DataTypeSelectSource
49
+ DataTypeValueComparer DateFormatPreference DatetimeBuckets
50
+ DefaultComponentProps DevReload DmsMenuItem DonutRecord DownloadActionTarget
51
+ DrawerDirection DrawerInstance DrawerOptions DrawerPatch DrawerRowHeader
52
+ DrawerTargetOptions DurationFormatOptions DurationPrecision
53
+ ENDPOINT_MODULES_LISTING ENDPOINT_STORE_LISTING END_OF_DAY_HOURS
54
+ END_OF_DAY_MINUTES END_OF_DAY_MS END_OF_DAY_SECONDS EnclosingForm EventError
55
+ Events ExportJobStatusResponse ExportJobTicket FIELD_KEY FIELD_OPERATORS
56
+ FORM_CONTENT_LANGUAGE_KEY FORM_FIELD_LOADING_KEY FORM_FIELD_SAVED_KEY
57
+ FORM_VALIDATOR_KEY FROM_ACCOUNTS_QUERY FavoritePage FavoritePageMetadata
58
+ FavoritePageSource FavoriteRouteResolver FeedCounts FieldCondition
59
+ FieldControl FieldEqualsRule FieldErrorAria FieldErrorCode
60
+ FieldErrorResolution FieldGroup FieldInRule FieldNotEqualsRule FieldNotInRule
61
+ FieldOperatorKey FieldRule FieldValueComparer FileConstraintViolation
62
+ FileFieldConstraints FoldedCrumbs FooterLink FormData FormEvents
63
+ FormFetchResponse FormField FormFieldBadge FormFieldLink FormFieldOrGroup
64
+ FormFieldReadonly FormFieldValue FormFunctions FormProps FormSection
65
+ FormSectionNav FormServerFieldError FormSubmitResponse FormValidator
66
+ FormattedValueParts FrontendBreak FrontendRequirement FrontendVersionSource
67
+ GROUPED_DISPLAY_ID HTTP_BAD_REQUEST HTTP_FORBIDDEN HTTP_INTERNAL_SERVER_ERROR
68
+ HTTP_NOT_FOUND HTTP_PRECONDITION_FAILED HTTP_UNAUTHORIZED
69
+ HandleApiErrorOptions HeaderAction HttpMethod I18nTranslate INVALID_REQUEST
70
+ ImageItemValue ImageResizeBounds InputNumberAdjustment
71
71
  InputNumberAdjustmentReason InterfaceImplementation InterfaceScale
72
72
  JsonPrimitive JsonValue KANBAN_DISPLAY_BRIDGE_KEY KANBAN_DISPLAY_ID
73
73
  KEYBOARD_KEY_LABELS KEYBOARD_PLATFORM_COOKIE KanbanColumnDef KanbanConfig
@@ -1,29 +1,23 @@
1
1
  import { isRecord } from "../../utils/record";
2
2
  import { isBranch, type PreferencesTree } from "./preferencesCookie";
3
3
  import { isNumber, isString } from "../../../utils/type-check";
4
- import { isJsonValue } from "../../utils/json";
5
- import type { DataTypeValue } from "../../../types/data-type";
6
4
 
7
5
  /**
8
6
  * @internal
9
7
  * The state of a table view that the server render reads to list and draw
10
- * the right rows, as it reads back from the preferences cookie.
8
+ * the right rows: kept in the preferences cookie, compactly.
11
9
  */
12
- export interface ServerTableFieldValues {
13
- sorting: SortEntry[];
14
- columnFilters: FilterEntry[];
15
- columnVisibility: Record<string, boolean>;
16
- pagination: PaginationEntry;
17
- paginationScope: string;
18
- activeTab: string;
19
- viewMode: string;
20
- activeView: string;
21
- linkScope: string;
22
- shownLink: string;
23
- }
24
-
25
- /** @internal A server field, kept in the preferences cookie, compactly. */
26
- export type ServerTableField = keyof ServerTableFieldValues;
10
+ export type ServerTableField =
11
+ | "sorting"
12
+ | "columnFilters"
13
+ | "columnVisibility"
14
+ | "pagination"
15
+ | "paginationScope"
16
+ | "activeTab"
17
+ | "viewMode"
18
+ | "activeView"
19
+ | "linkScope"
20
+ | "shownLink";
27
21
 
28
22
  /**
29
23
  * @internal
@@ -105,10 +99,10 @@ interface SortEntry {
105
99
 
106
100
  interface FilterEntry {
107
101
  accessorKey: string;
108
- value?: DataTypeValue;
102
+ value?: unknown;
109
103
  mode: string;
110
104
  pinned?: boolean;
111
- initialValue?: DataTypeValue;
105
+ initialValue?: unknown;
112
106
  }
113
107
 
114
108
  interface PaginationEntry {
@@ -122,14 +116,16 @@ interface PaginationEntry {
122
116
  * form. `encode` gets the field's default so that it can keep only what
123
117
  * differs from it; a value whose form equals the default's is not written.
124
118
  */
125
- export interface ServerFieldCodec<V = PreferencesTree[string]> {
119
+ export interface ServerFieldCodec {
126
120
  key: string;
127
121
  encode: (
128
122
  value: PreferencesTree[string],
129
123
  defaultValue: PreferencesTree[string],
130
124
  ) => PreferencesTree[string];
131
- /** Throws on a stored form it cannot read, which then reads as the default. */
132
- decode: (stored: PreferencesTree[string], defaultValue: V | undefined) => V;
125
+ decode: (
126
+ stored: PreferencesTree[string],
127
+ defaultValue: PreferencesTree[string],
128
+ ) => PreferencesTree[string];
133
129
  }
134
130
 
135
131
  const encodeSorting: ServerFieldCodec["encode"] = (value) => {
@@ -174,7 +170,7 @@ const decodeFilters = (
174
170
  if (!Array.isArray(stored)) throw new TypeError("columnFilters");
175
171
  return stored.map(([accessorKey, value, mode]: unknown[]) => ({
176
172
  accessorKey: String(accessorKey),
177
- value: isJsonValue(value) ? value : undefined,
173
+ value,
178
174
  mode: isString(mode) ? mode : DEFAULT_FILTER_MODE,
179
175
  }));
180
176
  };
@@ -192,15 +188,13 @@ const encodeVisibility: ServerFieldCodec["encode"] = (value, defaultValue) => {
192
188
  );
193
189
  };
194
190
 
195
- const decodeVisibility: ServerFieldCodec<
196
- ServerTableFieldValues["columnVisibility"]
197
- >["decode"] = (stored, defaultValue) => {
191
+ const decodeVisibility: ServerFieldCodec["decode"] = (stored, defaultValue) => {
198
192
  if (!Array.isArray(stored)) throw new TypeError("columnVisibility");
199
- const changes = stored.map((token: string): [string, boolean] => [
193
+ const changes = stored.map((token: string) => [
200
194
  token.slice(1),
201
195
  token.startsWith(SHOWN_PREFIX),
202
196
  ]);
203
- return { ...defaultValue, ...Object.fromEntries(changes) };
197
+ return { ...visibilityOf(defaultValue), ...Object.fromEntries(changes) };
204
198
  };
205
199
 
206
200
  const isPaginationEntry = (value: unknown): value is PaginationEntry =>
@@ -225,27 +219,19 @@ const decodePagination = (
225
219
  return { pageIndex, pageSize };
226
220
  };
227
221
 
228
- const textField = (key: string): ServerFieldCodec<string> => ({
222
+ const plainField = (key: string): ServerFieldCodec => ({
229
223
  key,
230
224
  encode: (value) => value,
231
- decode: (stored) => {
232
- if (!isString(stored)) throw new TypeError(key);
233
- return stored;
234
- },
225
+ decode: (stored) => stored,
235
226
  });
236
227
 
237
- /** @internal The codec of each server field, reading back its own value. */
238
- export type ServerTableFieldCodecs = {
239
- [F in ServerTableField]: ServerFieldCodec<ServerTableFieldValues[F]>;
240
- };
241
-
242
228
  /**
243
229
  * @internal
244
230
  * The server fields, each with its one-letter key and compact form: a sort is
245
231
  * `"-name"`, a filter `["status", "open"]`, a hidden column `"-email"`, a
246
232
  * page size `50`.
247
233
  */
248
- export const SERVER_TABLE_FIELDS: ServerTableFieldCodecs = {
234
+ export const SERVER_TABLE_FIELDS: Record<ServerTableField, ServerFieldCodec> = {
249
235
  sorting: { key: "s", encode: encodeSorting, decode: decodeSorting },
250
236
  columnFilters: { key: "f", encode: encodeFilters, decode: decodeFilters },
251
237
  columnVisibility: {
@@ -254,12 +240,12 @@ export const SERVER_TABLE_FIELDS: ServerTableFieldCodecs = {
254
240
  decode: decodeVisibility,
255
241
  },
256
242
  pagination: { key: "p", encode: encodePagination, decode: decodePagination },
257
- paginationScope: textField("q"),
258
- activeTab: textField("t"),
259
- viewMode: textField("d"),
260
- activeView: textField("w"),
261
- linkScope: textField("l"),
262
- shownLink: textField("k"),
243
+ paginationScope: plainField("q"),
244
+ activeTab: plainField("t"),
245
+ viewMode: plainField("d"),
246
+ activeView: plainField("w"),
247
+ linkScope: plainField("l"),
248
+ shownLink: plainField("k"),
263
249
  };
264
250
 
265
251
  /** @internal Whether `field` is kept in the cookie. */
@@ -288,19 +274,16 @@ export const encodeServerField = (
288
274
  };
289
275
 
290
276
  /** @internal The value `entry` keeps for `field`, else `defaultValue`. */
291
- export const decodeServerField = <
292
- F extends ServerTableField,
293
- D extends ServerTableFieldValues[F] | undefined,
294
- >(
295
- field: F,
277
+ export const decodeServerField = <T>(
278
+ field: ServerTableField,
296
279
  entry: CompactTableEntry | undefined,
297
- defaultValue: D,
298
- ): ServerTableFieldValues[F] | D => {
280
+ defaultValue: T,
281
+ ): T => {
299
282
  const codec = SERVER_TABLE_FIELDS[field];
300
283
  const stored = entry?.[codec.key];
301
284
  if (stored === undefined) return defaultValue;
302
285
  try {
303
- return codec.decode(stored, defaultValue);
286
+ return codec.decode(stored, defaultValue) as T;
304
287
  } catch {
305
288
  return defaultValue;
306
289
  }
@@ -1,15 +1,9 @@
1
- import type { Component, VNodeChild } from "vue";
2
- import type {
3
- DataTypeOptions,
4
- DataTypeRow,
5
- DataTypeValue,
6
- } from "../../types/data-type";
1
+ import type { Component } from "vue";
7
2
 
8
3
  export type RecordWithDefault<T> = Record<string, T> & { default: T };
9
4
 
10
5
  /**
11
- * Turns a value into its display, or returns a value that needs none, drawn
12
- * as its text. `row` is the whole listed row when the value
6
+ * Turns a value into its display. `row` is the whole listed row when the value
13
7
  * is drawn in a table (cell, detail band), so a formatter can compose sibling
14
8
  * fields; it is absent elsewhere (forms, filters) and must be optional.
15
9
  *
@@ -18,21 +12,18 @@ export type RecordWithDefault<T> = Record<string, T> & { default: T };
18
12
  * null/undefined value), and one per compare mode for filter chips.
19
13
  */
20
14
  export type DataTypeFormatter = (
21
- value: DataTypeValue,
15
+ value: unknown,
22
16
  locale: string,
23
- options?: DataTypeOptions,
24
- row?: DataTypeRow,
25
- ) => VNodeChild | DataTypeValue;
17
+ options?: unknown,
18
+ row?: Record<string, unknown>,
19
+ ) => unknown;
26
20
 
27
21
  /**
28
22
  * Reshapes a server value into its form-state representation.
29
23
  * Must be idempotent: form reset re-applies the mapper to values that
30
24
  * may already be mapped (e.g. restored from a submit-success snapshot).
31
25
  */
32
- export type BeforeStateMapper = (
33
- value: DataTypeValue,
34
- options?: DataTypeOptions,
35
- ) => DataTypeValue;
26
+ export type BeforeStateMapper = (value: unknown, options?: unknown) => unknown;
36
27
 
37
28
  /**
38
29
  * Whether two values of a data type are the same value, whatever shape each
@@ -40,9 +31,9 @@ export type BeforeStateMapper = (
40
31
  * its control holds through it, to tell an edited field from an untouched one.
41
32
  */
42
33
  export type DataTypeValueComparer = (
43
- left: DataTypeValue,
44
- right: DataTypeValue,
45
- options?: DataTypeOptions,
34
+ left: unknown,
35
+ right: unknown,
36
+ options?: unknown,
46
37
  ) => boolean;
47
38
 
48
39
  /**
@@ -51,10 +42,7 @@ export type DataTypeValueComparer = (
51
42
  * input refuses `"0"`, a date range wants its two days. The filter itself
52
43
  * keeps its text, so the query is unchanged.
53
44
  */
54
- export type DataTypeFilterEditorValue = (
55
- text: string,
56
- mode: string,
57
- ) => DataTypeValue;
45
+ export type DataTypeFilterEditorValue = (text: string, mode: string) => unknown;
58
46
 
59
47
  /**
60
48
  * Where the rows a value names are read: the `select` route of the table a
@@ -9,7 +9,7 @@ import type { JsonValue } from "../../types/json";
9
9
  */
10
10
  export type SseEventHandler = (
11
11
  eventName: string,
12
- data: JsonValue,
12
+ data: unknown,
13
13
  id: string | null,
14
14
  ) => void;
15
15
 
@@ -95,7 +95,7 @@ function parseFrame(frame: string): ParsedFrame | null {
95
95
  };
96
96
  }
97
97
 
98
- function decodeData(data: string): Parameters<SseEventHandler>[1] {
98
+ function decodeData(data: string): JsonValue {
99
99
  try {
100
100
  const parsed: unknown = JSON.parse(data);
101
101
  return isJsonValue(parsed) ? parsed : data;
@@ -160,16 +160,14 @@ const isSnapshotEntry = (
160
160
  const isSnapshotEvent = (
161
161
  eventName: string,
162
162
  data: RealtimeFrameData,
163
- ): data is RealtimeFrameData & RealtimeSnapshotEvent =>
163
+ ): data is RealtimeSnapshotEvent =>
164
164
  eventName === SNAPSHOT_EVENT &&
165
165
  isRecord(data) &&
166
166
  isString(data.topic) &&
167
167
  Array.isArray(data.entries) &&
168
168
  data.entries.every(isSnapshotEntry);
169
169
 
170
- const isRealtimeEvent = (
171
- data: RealtimeFrameData,
172
- ): data is RealtimeFrameData & RealtimeEvent =>
170
+ const isRealtimeEvent = (data: RealtimeFrameData): data is RealtimeEvent =>
173
171
  !!data &&
174
172
  isObject(data) &&
175
173
  isString(data.topic) &&
@@ -11,7 +11,7 @@ import {
11
11
  } from "../../build/composables/user/preferencesCookie";
12
12
  import { clearLocalTableEntries } from "../../build/composables/user/tablePreferences";
13
13
  import { isString } from "../../utils/type-check";
14
- import { isJsonObject, isJsonValue } from "../../build/utils/json";
14
+ import { isJsonObject } from "../../build/utils/json";
15
15
  import type { JsonValue } from "../../types/json";
16
16
 
17
17
  export interface UserPreferences extends PreferencesTree {}
@@ -67,13 +67,9 @@ export const usePreferences = () => {
67
67
  return true;
68
68
  };
69
69
 
70
- /**
71
- * The JSON kept at `keyPath`, `undefined` when there is none. The cookie is
72
- * the browser's to change, so parse the value into the shape you keep.
73
- */
74
- const getPreference = (keyPath: string): JsonValue | undefined => {
70
+ const getPreference = <T = unknown>(keyPath: string, defaultValue?: T): T => {
75
71
  const value = readAt(tree.value, keyPath.split("."));
76
- return isJsonValue(value) ? value : undefined;
72
+ return (value === undefined ? defaultValue : value) as T;
77
73
  };
78
74
 
79
75
  const setPreference = (
@@ -102,7 +98,7 @@ export const usePreferences = () => {
102
98
  keyPath: string,
103
99
  value: Partial<T>,
104
100
  ): void => {
105
- const current = getPreference(keyPath);
101
+ const current = getPreference<JsonValue | undefined>(keyPath);
106
102
  const merged = isJsonObject(current)
107
103
  ? { ...current, ...value }
108
104
  : { ...value };
@@ -1,4 +1,4 @@
1
- import type { DataTypeRow } from "./data-type";
1
+ import type { I18nTranslate } from "../composables/translation/useTranslation";
2
2
 
3
3
  /** One dependent a confirmed action affects, listed in its dialog. */
4
4
  export interface ConfirmDialogImpact {
@@ -73,7 +73,7 @@ export interface ConfirmDialogSecondaryAction {
73
73
  export interface ConfirmDialog {
74
74
  title: string;
75
75
  description?: string;
76
- params?: DataTypeRow;
76
+ params?: Parameters<I18nTranslate>[1];
77
77
  icon?: string;
78
78
  color?: ConfirmDialogColor;
79
79
  confirmLabel?: string;
@@ -1,34 +1,3 @@
1
- import type { JsonPrimitive, JsonValue } from "./json";
2
-
3
- /**
4
- * A value of a field, as a row, a form or a filter holds it: JSON as the
5
- * server sends it, a date a control writes, `undefined` when unset. A
6
- * relation holds its row.
7
- */
8
- export type DataTypeValue =
9
- | JsonPrimitive
10
- | Date
11
- | undefined
12
- | DataTypeList
13
- | DataTypeRow;
14
-
15
- /** A list of values, as a multiple field holds them. */
16
- export interface DataTypeList extends Array<DataTypeValue> {}
17
-
18
- /** A row of a table, or any record of field values, by field id. */
19
- export interface DataTypeRow {
20
- [field: string]: DataTypeValue;
21
- }
22
-
23
- /**
24
- * The options a data type reads: its control's component options as the page
25
- * declares them, or the ones a caller composes, an option left unset when
26
- * absent.
27
- */
28
- export interface DataTypeOptions {
29
- readonly [option: string]: JsonValue | undefined;
30
- }
31
-
32
1
  export type ComponentOrNoInput =
33
2
  | ComponentInfo<ComponentOptionsData>
34
3
  | "noInput";
@@ -1,5 +1,3 @@
1
- import type { DataTypeRow } from "./data-type";
2
-
3
1
  /**
4
2
  * Mirror of `PageLivePeriod` from `@antelopejs/interface-dms/page`: whole
5
3
  * minutes, hours or days (`"30m"`, `"24h"`, `"7d"`).
@@ -36,7 +34,9 @@ export type PageLiveNoteTone = "neutral" | "warning" | "error";
36
34
  */
37
35
  export interface PageLiveNote {
38
36
  text: string;
39
- params?: DataTypeRow;
37
+ params?: Parameters<
38
+ import("#dms-core/app/composables/translation/useTranslation").I18nTranslate
39
+ >[1];
40
40
  tone?: PageLiveNoteTone;
41
41
  }
42
42
 
@@ -189,18 +189,11 @@ export interface QuickActionsPayload {
189
189
  actions: Record<string, QuickActionInfo>;
190
190
  }
191
191
 
192
- /**
193
- * The metadata a child carries in its parent's layout, which its parent's
194
- * block type declares: the columns it spans in a `GridRow`.
195
- */
196
- interface ComponentChildPlacement {
197
- slot?: string;
198
- colSpan?: number;
199
- }
200
-
201
- export interface ComponentChild<T = object> extends ComponentChildPlacement {
192
+ export interface ComponentChild<T = object> {
202
193
  id: string;
203
194
  component: ComponentInfo<T>;
195
+ slot?: string;
196
+ [key: string]: unknown;
204
197
  }
205
198
 
206
199
  export interface ComponentInfo<T = object> {
@@ -209,13 +202,14 @@ export interface ComponentInfo<T = object> {
209
202
  children?: ComponentChild<T>[];
210
203
  }
211
204
 
212
- export interface ResolvedComponentInfo<T = object>
213
- extends ComponentChildPlacement {
205
+ export interface ResolvedComponentInfo<T = object> {
214
206
  id: string;
215
207
  options?: T;
216
208
  component: unknown;
217
209
  componentName?: string;
218
210
  children: ResolvedComponentInfo[];
211
+ slot?: string;
212
+ [key: string]: ComponentChild<T>[string];
219
213
  }
220
214
 
221
215
  export interface PageLayout {
@@ -1,23 +1,14 @@
1
1
  import type { Ref } from "vue";
2
2
  import type { ComponentEventData } from "./component";
3
- import type { DataTypeValue } from "./data-type";
4
3
 
5
4
  export const ComponentId = {
6
5
  SELF: "$component:self",
7
6
  } as const;
8
7
 
9
- /**
10
- * What a component's watch actions write into its state: a field's value, or
11
- * a set of field ids (the fields a form disables, hides or requires).
12
- */
13
- export interface ComponentWatchState {
14
- [key: string]: DataTypeValue | Set<string>;
15
- }
16
-
17
8
  export type WatchActionFunction = (
18
9
  action: WatchAction,
19
10
  eventData: ComponentEventData,
20
- componentState: Ref<ComponentWatchState>,
11
+ componentState: Ref<Record<string, unknown>>,
21
12
  ) => void;
22
13
 
23
14
  export interface WatchActionCondition {
@@ -1,5 +1,3 @@
1
- import type { LocationQuery } from "#dms/frontend-module";
2
-
3
1
  export function validateRequiredQueryParams(
4
2
  requiredParams: string[] | undefined,
5
3
  queryParams: ValidationRouteContext["query"],
@@ -15,7 +13,7 @@ export function validateRequiredQueryParams(
15
13
  }
16
14
 
17
15
  export interface ValidationRouteContext {
18
- query: LocationQuery;
16
+ query: Record<string, unknown>;
19
17
  params: ValidationRouteContext["query"];
20
18
  }
21
19
 
@@ -1,5 +1,6 @@
1
1
  import type { DataTypeFormatter } from "../composables/data-types/useDataType";
2
- import { readFieldPath, textOf } from "../build/utils/dataTypeValue";
2
+
3
+ import { get } from "@nuxt/ui/runtime/utils/index.js";
3
4
 
4
5
  const ROW_TOKEN = /\{\{\s*row\.([^{}\s]+)\s*\}\}/g;
5
6
 
@@ -28,9 +29,9 @@ const rowValue = (
28
29
  data: NonNullable<Parameters<DataTypeFormatter>[3]>,
29
30
  key: string,
30
31
  ): string => {
31
- const field = readFieldPath(data, key);
32
+ const field: unknown = get(data, key);
32
33
  const value = Array.isArray(field) ? field.map(scalarOf) : scalarOf(field);
33
- return value === undefined || value === null ? "" : textOf(value);
34
+ return value === undefined || value === null ? "" : String(value);
34
35
  };
35
36
 
36
37
  const ENCODED_COLON = /%3A/gi;
@@ -8,6 +8,7 @@ import DmsSegmentedControl from "#dms-ui/app/components/segmented/SegmentedContr
8
8
  import DmsStatGroup, {
9
9
  type StatGroupItem,
10
10
  } from "#dms-ui/app/components/stat-group/StatGroup.vue";
11
+ import type { JsonValue } from "#dms-core/app/types/json";
11
12
  import type { Tone } from "#dms-core/app/types/tone";
12
13
  import { useKeyboardPlatform } from "#dms-ui/app/composables/global/keyboardPlatform";
13
14
  import DmsChipGroup from "#dms-ui/app/entries/components/form/ChipGroup";
@@ -144,7 +145,10 @@ const category = ref<string>(MODULE_CATEGORY_ALL);
144
145
  const SORT_MODE_PREFERENCE_KEY = "modulesPage.sort";
145
146
  const { getPreference, setPreference } = usePreferences();
146
147
  const sortMode = computed<ModuleSortMode>({
147
- get: () => parseModuleSortMode(getPreference(SORT_MODE_PREFERENCE_KEY)),
148
+ get: () =>
149
+ parseModuleSortMode(
150
+ getPreference<JsonValue | undefined>(SORT_MODE_PREFERENCE_KEY),
151
+ ),
148
152
  set: (mode) => setPreference(SORT_MODE_PREFERENCE_KEY, mode),
149
153
  });
150
154
 
@@ -13,7 +13,6 @@ import { formErrorsInjectionKey } from "@nuxt/ui/composables/useFormField";
13
13
  import DmsFormErrorText from "./FormErrorText.vue";
14
14
  import DmsFormFieldNotes from "./FormFieldNotes.vue";
15
15
  import { readonlyFieldValue } from "../../composables/form/readonlyValue";
16
- import { fieldValueOf } from "../../composables/unsaved-changes/formValue";
17
16
  import { useDeclaredFieldProps } from "../../composables/form/fieldComponentProps";
18
17
 
19
18
  interface FormFieldControlProps {
@@ -59,7 +58,7 @@ const hasError = computed(() => {
59
58
  const { getDataType } = useDataTypes();
60
59
  const readonlyValue = computed(() =>
61
60
  readonlyFieldValue(
62
- fieldValueOf(state.value, props.field.id),
61
+ state.value[props.field.id],
63
62
  initialValues.value?.[props.field.id],
64
63
  props.field.type ? getDataType(props.field.type) : undefined,
65
64
  props.field.component.options,
@@ -4,7 +4,6 @@ import { isString, isNumber } from "#dms-core/app/utils/type-check";
4
4
  import type { DataTypeFormatter } from "#dms-core/app/composables/data-types/useDataType";
5
5
  import type { FormField } from "../../../composables/form/types/field";
6
6
  import {
7
- fieldValueOf,
8
7
  isEmptyFormValue,
9
8
  sameFormValue,
10
9
  } from "../../composables/unsaved-changes/formValue";
@@ -19,7 +18,7 @@ const context = inject(FORM_ENTRY_CONTEXT_KEY)!;
19
18
  const { t, locale } = useI18n();
20
19
  const { getDataType } = useDataTypes();
21
20
 
22
- const value = computed(() => fieldValueOf(context.state.value, props.field.id));
21
+ const value = computed(() => context.state.value[props.field.id]);
23
22
  const baseline = computed(() => context.baselineValue(props.field.id));
24
23
  const defaultValue = computed(() => props.field.defaultValue);
25
24