@antelopejs/dms 0.23.0 → 0.23.1-next.1029.g63c44fb
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/dist/implementations/dms/page/payloads.js.map +1 -1
- package/dist/implementations/dms-builder/engine/analysis-relations.js +9 -6
- package/dist/implementations/dms-builder/engine/analysis-relations.js.map +1 -1
- package/dist/implementations/dms-builder/engine/analysis.js +11 -8
- package/dist/implementations/dms-builder/engine/analysis.js.map +1 -1
- package/dist/implementations/dms-builder/engine/block-tree.js +3 -4
- package/dist/implementations/dms-builder/engine/block-tree.js.map +1 -1
- package/dist/implementations/dms-builder/engine/chain.d.ts +5 -1
- package/dist/implementations/dms-builder/engine/chain.js +3 -2
- package/dist/implementations/dms-builder/engine/chain.js.map +1 -1
- package/dist/implementations/dms-builder/engine/map-resources-batch.js +4 -1
- package/dist/implementations/dms-builder/engine/map-resources-batch.js.map +1 -1
- package/dist/implementations/dms-builder/engine/mapped-choices.js +10 -5
- package/dist/implementations/dms-builder/engine/mapped-choices.js.map +1 -1
- package/dist/implementations/dms-builder/engine/page-draft.js +10 -10
- package/dist/implementations/dms-builder/engine/page-draft.js.map +1 -1
- package/dist/implementations/dms-builder/engine/relabel-columns.js +7 -2
- package/dist/implementations/dms-builder/engine/relabel-columns.js.map +1 -1
- package/dist/implementations/dms-builder/engine/source-options.d.ts +3 -3
- package/dist/implementations/dms-builder/engine/source-options.js +6 -2
- package/dist/implementations/dms-builder/engine/source-options.js.map +1 -1
- package/frontend-vue/layers/dms-core/app/build/composables/user/tablePreferences.ts +96 -107
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +31 -11
- package/frontend-vue/layers/dms-core/app/composables/realtime/useSseStream.ts +1 -1
- package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +5 -3
- package/frontend-vue/layers/dms-core/app/composables/user/usePreferences.ts +1 -0
- package/frontend-vue/layers/dms-core/app/types/page.ts +2 -2
- package/frontend-vue/layers/dms-core/app/types/watch.ts +3 -2
- package/frontend-vue/layers/dms-core/app/utils/query-validation.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/sortable/SortableList.vue +1 -0
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuImport.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuRoot.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexRawOptions.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/form/repeaterTable.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useFormModel.ts +38 -24
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableConfigClipboard.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewArrival.ts +3 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplays.ts +1 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewFilters.ts +2 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewPersistence.ts +20 -20
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSorting.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewTabs.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewTypes.ts +0 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewViews.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/usePersistedPagination.ts +3 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTablePreferences.ts +57 -25
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViews.ts +2 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/linkedArrival.ts +11 -6
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputRepeater.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/components/form/components/KeyValue.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/composables/form/types/props.ts +3 -7
- package/frontend-vue/layers/dms-ui/app/composables/form/types/value.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/entries/composables/form/useFormModel.ts +1 -0
- package/frontend-vue/package.json +0 -1
- package/package.json +5 -6
|
@@ -108,9 +108,9 @@ const decodeConfig = (code: string): SerializedTableConfig => {
|
|
|
108
108
|
return parsed;
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
export const useTableConfigClipboard =
|
|
111
|
+
export const useTableConfigClipboard = () => {
|
|
112
112
|
const tableSharedData =
|
|
113
|
-
injectLocal<ShallowRef<TableSharedData<
|
|
113
|
+
injectLocal<ShallowRef<TableSharedData<Data>>>("tableSharedData");
|
|
114
114
|
const toast = useToast();
|
|
115
115
|
const { t } = useI18n();
|
|
116
116
|
const presenter = useApiErrorPresenter();
|
|
@@ -33,12 +33,9 @@ export function useTableViewArrival<T extends Data>(
|
|
|
33
33
|
urlScope,
|
|
34
34
|
queryParamFilters,
|
|
35
35
|
isVisit: pageArrivalKind() === "visit",
|
|
36
|
-
rememberedTab: keptPreferences.get
|
|
37
|
-
keptLinkScope: keptPreferences.get
|
|
38
|
-
|
|
39
|
-
undefined,
|
|
40
|
-
),
|
|
41
|
-
shownLink: keptPreferences.get<string | undefined>("shownLink", undefined),
|
|
36
|
+
rememberedTab: keptPreferences.get("activeTab", ALL_TAB_ID),
|
|
37
|
+
keptLinkScope: keptPreferences.get("linkScope", undefined),
|
|
38
|
+
shownLink: keptPreferences.get("shownLink", undefined),
|
|
42
39
|
});
|
|
43
40
|
const tablePreferences = linkFollowingPreferences(
|
|
44
41
|
isLinked ? linkedArrivalPreferences(keptPreferences) : keptPreferences,
|
|
@@ -47,10 +47,7 @@ export function useTableViewDisplayOptions<T extends Data>(
|
|
|
47
47
|
? declaredGroupedOptions
|
|
48
48
|
: undefined;
|
|
49
49
|
|
|
50
|
-
const persistedDisplay = tablePreferences.get
|
|
51
|
-
"viewMode",
|
|
52
|
-
defaultDisplay,
|
|
53
|
-
);
|
|
50
|
+
const persistedDisplay = tablePreferences.get("viewMode", defaultDisplay);
|
|
54
51
|
|
|
55
52
|
const isDefaultDisplayStandalone =
|
|
56
53
|
resolvedDisplay(defaultDisplay)?.capabilities?.header === false;
|
|
@@ -86,7 +86,7 @@ export function useTableViewPinnedFilters<T extends Data>(
|
|
|
86
86
|
) {
|
|
87
87
|
const { tablePreferences } = scope.arrival;
|
|
88
88
|
const { defaultFilters } = scope.configuration;
|
|
89
|
-
const savedFilters = tablePreferences.get
|
|
89
|
+
const savedFilters = tablePreferences.get("columnFilters", []);
|
|
90
90
|
|
|
91
91
|
const buildPinnedFilters = (): TableFilter[] =>
|
|
92
92
|
(defaultFilters || []).map((def) => {
|
|
@@ -136,10 +136,7 @@ export function useTableViewFilterState<T extends Data>(
|
|
|
136
136
|
const { offeredDisplayIds, fallbackDisplayId } = scope.displayOptions;
|
|
137
137
|
const columnFilters = ref<TableFilter[]>(initialFilters);
|
|
138
138
|
const columnVisibility = ref<VisibilityState>(
|
|
139
|
-
tablePreferences.get
|
|
140
|
-
"columnVisibility",
|
|
141
|
-
initialVisibility,
|
|
142
|
-
),
|
|
139
|
+
tablePreferences.get("columnVisibility", initialVisibility),
|
|
143
140
|
);
|
|
144
141
|
const columnSizing = ref<ColumnSizingState>({});
|
|
145
142
|
tablePreferences.restore("columnSizing", columnSizing);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { watchDebounced } from "@vueuse/core";
|
|
2
|
-
import type {
|
|
2
|
+
import type { MaybeRef, Ref } from "vue";
|
|
3
|
+
import type { TableField } from "#dms-core/app/entries/composables/user/tablePreferences";
|
|
4
|
+
import type { TablePreferenceValues } from "./useTablePreferences";
|
|
3
5
|
import type { TableViewScope } from "./tableViewScope";
|
|
4
6
|
|
|
5
7
|
export function useTableViewStatePersistence<T extends Data>(
|
|
@@ -33,24 +35,11 @@ export function useTableViewStatePersistence<T extends Data>(
|
|
|
33
35
|
const { kanbanGroupBy, defaultKanbanGroupBy, density, defaultDensity } =
|
|
34
36
|
scope.displayPreferences;
|
|
35
37
|
const { groupedGroupBy, defaultGroupedGroupBy } = scope.groupingOptions;
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
]),
|
|
42
|
-
["columnFilters", columnFilters, []],
|
|
43
|
-
["columnVisibility", columnVisibility, initialVisibility],
|
|
44
|
-
["filtersOpen", filtersRowOpen, hasEmptyDefaultFilter],
|
|
45
|
-
["activeTab", activeTabId, ALL_TAB_ID],
|
|
46
|
-
["viewMode", activeDisplayId, displayDefault],
|
|
47
|
-
["columnOrder", columnOrder, []],
|
|
48
|
-
["kanbanGroupBy", kanbanGroupBy, defaultKanbanGroupBy],
|
|
49
|
-
["groupedGroupBy", groupedGroupBy, defaultGroupedGroupBy],
|
|
50
|
-
["density", density, defaultDensity],
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
tableStatePreferences.forEach(([field, state, defaultValue]) => {
|
|
38
|
+
const persist = <F extends TableField>(
|
|
39
|
+
field: F,
|
|
40
|
+
state: Ref<TablePreferenceValues[F]>,
|
|
41
|
+
defaultValue: MaybeRef<TablePreferenceValues[F]>,
|
|
42
|
+
) => {
|
|
54
43
|
watch(
|
|
55
44
|
state,
|
|
56
45
|
(newValue) => {
|
|
@@ -58,7 +47,18 @@ export function useTableViewStatePersistence<T extends Data>(
|
|
|
58
47
|
},
|
|
59
48
|
{ deep: true },
|
|
60
49
|
);
|
|
61
|
-
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
if (!reorderConfig) persist("sorting", sorting, defaultSortState);
|
|
53
|
+
persist("columnFilters", columnFilters, []);
|
|
54
|
+
persist("columnVisibility", columnVisibility, initialVisibility);
|
|
55
|
+
persist("filtersOpen", filtersRowOpen, hasEmptyDefaultFilter);
|
|
56
|
+
persist("activeTab", activeTabId, ALL_TAB_ID);
|
|
57
|
+
persist("viewMode", activeDisplayId, displayDefault);
|
|
58
|
+
persist("columnOrder", columnOrder, []);
|
|
59
|
+
persist("kanbanGroupBy", kanbanGroupBy, defaultKanbanGroupBy);
|
|
60
|
+
persist("groupedGroupBy", groupedGroupBy, defaultGroupedGroupBy);
|
|
61
|
+
persist("density", density, defaultDensity);
|
|
62
62
|
return {};
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -115,7 +115,7 @@ export function useTableViewDefaultSorting<T extends Data>(
|
|
|
115
115
|
reorderConfig
|
|
116
116
|
? defaultSortState
|
|
117
117
|
: sortingOrDefault(
|
|
118
|
-
tablePreferences.get
|
|
118
|
+
tablePreferences.get("sorting", defaultSortState),
|
|
119
119
|
declaredSortableIds,
|
|
120
120
|
defaultSortState,
|
|
121
121
|
),
|
|
@@ -34,7 +34,7 @@ export function useTableViewTabs<T extends Data>(
|
|
|
34
34
|
|
|
35
35
|
const activeTabId = ref<string>(
|
|
36
36
|
readTableUrlTab(route.query, urlScope) ??
|
|
37
|
-
tablePreferences.get
|
|
37
|
+
tablePreferences.get("activeTab", ALL_TAB_ID),
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
const hasConfiguredAllTab = (tabs ?? []).some((tab) => tab.id === ALL_TAB_ID);
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { TableViewConfig } from "../../../composables/table-view/types";
|
|
2
|
-
import { type Ref } from "vue";
|
|
3
|
-
import type { TableField } from "#dms-core/app/entries/composables/user/tablePreferences";
|
|
4
2
|
import type { TableViewLiveHoldOptions } from "#dms-core/app/types/live";
|
|
5
3
|
export interface RealtimePresenceActor {
|
|
6
4
|
id: string;
|
|
@@ -10,7 +8,6 @@ export interface RealtimePresenceActor {
|
|
|
10
8
|
since?: number;
|
|
11
9
|
}
|
|
12
10
|
export type RealtimePresenceMap = Record<string, RealtimePresenceActor[]>;
|
|
13
|
-
export type TableStatePreference = [TableField, Ref<unknown>, unknown];
|
|
14
11
|
export type TableViewSetupProps<T extends Data> = TableViewConfig<T> & {
|
|
15
12
|
realtimeTopic?: string | string[];
|
|
16
13
|
liveHold?: boolean | TableViewLiveHoldOptions;
|
|
@@ -107,8 +107,7 @@ export function useTableViewMobileDisplay<T extends Data>(
|
|
|
107
107
|
activeView,
|
|
108
108
|
isDisplayChosen: () =>
|
|
109
109
|
isDefaultDisplayStandalone ||
|
|
110
|
-
tablePreferences.get
|
|
111
|
-
undefined,
|
|
110
|
+
tablePreferences.get("viewMode", undefined) !== undefined,
|
|
112
111
|
});
|
|
113
112
|
return {};
|
|
114
113
|
}
|
package/frontend-vue/layers/dms-ui/app/build/composables/table-view/usePersistedPagination.ts
CHANGED
|
@@ -36,12 +36,9 @@ export function usePersistedPagination(
|
|
|
36
36
|
const scopeKey = computed(() =>
|
|
37
37
|
hashText(JSON.stringify(options.scope() ?? null)),
|
|
38
38
|
);
|
|
39
|
-
const stored = preferences.get
|
|
39
|
+
const stored = preferences.get("pagination", defaults);
|
|
40
40
|
|
|
41
|
-
const storedScope = preferences.get
|
|
42
|
-
"paginationScope",
|
|
43
|
-
scopeKey.value,
|
|
44
|
-
);
|
|
41
|
+
const storedScope = preferences.get("paginationScope", scopeKey.value);
|
|
45
42
|
const pagination = ref<PaginationState>(
|
|
46
43
|
storedScope === scopeKey.value ? stored : firstPage(stored),
|
|
47
44
|
);
|
|
@@ -59,7 +56,7 @@ export function usePersistedPagination(
|
|
|
59
56
|
([value, scope]) => {
|
|
60
57
|
preferences.set("pagination", value, defaults);
|
|
61
58
|
const isFirstPage = value.pageIndex === FIRST_PAGE_INDEX;
|
|
62
|
-
preferences.set
|
|
59
|
+
preferences.set(
|
|
63
60
|
"paginationScope",
|
|
64
61
|
isFirstPage ? undefined : scope,
|
|
65
62
|
undefined,
|
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import { getCurrentInstance, onMounted, type Ref } from "vue";
|
|
2
|
+
import type { ColumnSizingState } from "@tanstack/vue-table";
|
|
2
3
|
import {
|
|
3
4
|
type CompactTableEntry,
|
|
4
5
|
decodeServerField,
|
|
5
6
|
encodeServerField,
|
|
6
7
|
isDefaultValue,
|
|
7
|
-
isServerTableField,
|
|
8
8
|
type LocalTableField,
|
|
9
9
|
readLocalTableEntry,
|
|
10
10
|
SERVER_TABLE_FIELDS,
|
|
11
|
-
type
|
|
11
|
+
type ServerFieldCodec,
|
|
12
|
+
type ServerTableValues,
|
|
12
13
|
type TableField,
|
|
13
14
|
TABLES_PREFERENCE_KEY,
|
|
14
15
|
tablePreferenceId,
|
|
15
16
|
writeLocalTableEntry,
|
|
16
17
|
} from "#dms-core/app/entries/composables/user/tablePreferences";
|
|
18
|
+
import type { TableDensity } from "../../components/table/Table.types";
|
|
19
|
+
import type { UserTableView } from "./utils/views";
|
|
20
|
+
|
|
21
|
+
/** The state of a table view that only the browser draws, by field. */
|
|
22
|
+
export interface LocalTableValues extends Record<LocalTableField, unknown> {
|
|
23
|
+
columnOrder: string[];
|
|
24
|
+
columnSizing: ColumnSizingState;
|
|
25
|
+
density: TableDensity;
|
|
26
|
+
filtersOpen: boolean;
|
|
27
|
+
kanbanGroupBy: string;
|
|
28
|
+
groupedGroupBy: string;
|
|
29
|
+
userViews: UserTableView[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The type of the value each preference field keeps. */
|
|
33
|
+
export type TablePreferenceValues = ServerTableValues & LocalTableValues;
|
|
17
34
|
|
|
18
35
|
/**
|
|
19
36
|
* The preferences of one table view. A field the server render needs
|
|
@@ -23,21 +40,33 @@ import {
|
|
|
23
40
|
*/
|
|
24
41
|
export interface TablePreferences {
|
|
25
42
|
/** A server field's stored value, else `defaultValue`; a local field's default. */
|
|
26
|
-
get: <
|
|
43
|
+
get: <F extends TableField, D extends TablePreferenceValues[F] | undefined>(
|
|
44
|
+
field: F,
|
|
45
|
+
defaultValue: D,
|
|
46
|
+
) => TablePreferenceValues[F] | D;
|
|
27
47
|
/** Stores `value`, or forgets the field when `value` is its default. */
|
|
28
|
-
set: <
|
|
48
|
+
set: <F extends TableField>(
|
|
49
|
+
field: F,
|
|
50
|
+
value: TablePreferenceValues[F] | undefined,
|
|
51
|
+
defaultValue: TablePreferenceValues[F] | undefined,
|
|
52
|
+
) => void;
|
|
29
53
|
/**
|
|
30
54
|
* Sets `state` to the local field's stored value once the table is
|
|
31
55
|
* mounted, unless `isValid` refuses it or `state` already holds it: the
|
|
32
56
|
* server and the hydrating client render the default, so no mismatch.
|
|
33
57
|
*/
|
|
34
|
-
restore: <
|
|
35
|
-
field:
|
|
36
|
-
state: Ref<
|
|
37
|
-
isValid?: (value:
|
|
58
|
+
restore: <F extends LocalTableField>(
|
|
59
|
+
field: F,
|
|
60
|
+
state: Ref<TablePreferenceValues[F]>,
|
|
61
|
+
isValid?: (value: TablePreferenceValues[F]) => boolean,
|
|
38
62
|
) => void;
|
|
39
63
|
}
|
|
40
64
|
|
|
65
|
+
/** The codec of each server field; a local field has none. */
|
|
66
|
+
const SERVER_CODECS: {
|
|
67
|
+
[F in TableField]?: ServerFieldCodec<TablePreferenceValues[F]>;
|
|
68
|
+
} = SERVER_TABLE_FIELDS;
|
|
69
|
+
|
|
41
70
|
type StoredValue = ReturnType<typeof readLocalTableEntry>[string];
|
|
42
71
|
|
|
43
72
|
/** A table state `restore` fills, with the check its caller gave it. */
|
|
@@ -74,14 +103,14 @@ function useServerTableEntry(id: string) {
|
|
|
74
103
|
removePreference(isLastEntry ? TABLES_PREFERENCE_KEY : path);
|
|
75
104
|
};
|
|
76
105
|
|
|
77
|
-
const set = (
|
|
78
|
-
|
|
79
|
-
value:
|
|
80
|
-
defaultValue:
|
|
106
|
+
const set = <V>(
|
|
107
|
+
codec: ServerFieldCodec<V>,
|
|
108
|
+
value: V | undefined,
|
|
109
|
+
defaultValue: V | undefined,
|
|
81
110
|
) => {
|
|
82
|
-
const { key } =
|
|
111
|
+
const { key } = codec;
|
|
83
112
|
const next = { ...entry() };
|
|
84
|
-
const encoded = encodeServerField(
|
|
113
|
+
const encoded = encodeServerField(codec, value, defaultValue);
|
|
85
114
|
if (JSON.stringify(next[key]) === JSON.stringify(encoded)) return;
|
|
86
115
|
if (encoded === undefined) Reflect.deleteProperty(next, key);
|
|
87
116
|
else next[key] = encoded;
|
|
@@ -101,9 +130,9 @@ function useServerTableEntry(id: string) {
|
|
|
101
130
|
|
|
102
131
|
const setLocalField = (
|
|
103
132
|
id: string,
|
|
104
|
-
field:
|
|
105
|
-
value:
|
|
106
|
-
defaultValue:
|
|
133
|
+
field: TableField,
|
|
134
|
+
value: TablePreferenceValues[TableField] | undefined,
|
|
135
|
+
defaultValue: TablePreferenceValues[TableField] | undefined,
|
|
107
136
|
) => {
|
|
108
137
|
const entry = readLocalTableEntry(id);
|
|
109
138
|
if (isDefaultValue(value, defaultValue)) {
|
|
@@ -142,14 +171,17 @@ export function useTablePreferences(
|
|
|
142
171
|
}
|
|
143
172
|
|
|
144
173
|
return {
|
|
145
|
-
get: (field, defaultValue) =>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
174
|
+
get: (field, defaultValue) => {
|
|
175
|
+
const codec = SERVER_CODECS[field];
|
|
176
|
+
return codec
|
|
177
|
+
? decodeServerField(codec, server.entry(), defaultValue)
|
|
178
|
+
: defaultValue;
|
|
179
|
+
},
|
|
180
|
+
set: (field, value, defaultValue) => {
|
|
181
|
+
const codec = SERVER_CODECS[field];
|
|
182
|
+
if (codec) server.set(codec, value, defaultValue);
|
|
183
|
+
else setLocalField(id, field, value, defaultValue);
|
|
184
|
+
},
|
|
153
185
|
restore: (field, state, isValid) => {
|
|
154
186
|
const target: RestoreTarget = { state, isValid };
|
|
155
187
|
pending.push({ field, apply: (value) => restoreInto(target, value) });
|
|
@@ -214,10 +214,7 @@ function arriveTableViews(context: ReturnType<typeof createTableViewState>) {
|
|
|
214
214
|
} = context;
|
|
215
215
|
|
|
216
216
|
const urlView = readTableUrlKey(route.query, urlScope, VIEW_URL_KEY);
|
|
217
|
-
const persistedViewId = preferences.get
|
|
218
|
-
"activeView",
|
|
219
|
-
undefined,
|
|
220
|
-
);
|
|
217
|
+
const persistedViewId = preferences.get("activeView", undefined);
|
|
221
218
|
let isUrlViewUnavailable = false;
|
|
222
219
|
let isUrlViewPending = false;
|
|
223
220
|
let isOpenedOnArrival = false;
|
|
@@ -255,11 +252,7 @@ function arriveTableViews(context: ReturnType<typeof createTableViewState>) {
|
|
|
255
252
|
};
|
|
256
253
|
|
|
257
254
|
const keepActiveView = () =>
|
|
258
|
-
preferences.set
|
|
259
|
-
"activeView",
|
|
260
|
-
keptViewId(activeViewId.value),
|
|
261
|
-
undefined,
|
|
262
|
-
);
|
|
255
|
+
preferences.set("activeView", keptViewId(activeViewId.value), undefined);
|
|
263
256
|
|
|
264
257
|
onMounted(() => {
|
|
265
258
|
arriveOnceMounted();
|
|
@@ -5,7 +5,10 @@ import {
|
|
|
5
5
|
type TableField,
|
|
6
6
|
} from "#dms-core/app/entries/composables/user/tablePreferences";
|
|
7
7
|
import type { QueryParamFilters } from "../../../../composables/table-view/types/config";
|
|
8
|
-
import type {
|
|
8
|
+
import type {
|
|
9
|
+
TablePreferences,
|
|
10
|
+
TablePreferenceValues,
|
|
11
|
+
} from "../useTablePreferences";
|
|
9
12
|
import { RECORD_URL_KEY } from "./recordLink";
|
|
10
13
|
import { readTableUrlKey, type TableUrlScope, writeTableUrlKey } from "./views";
|
|
11
14
|
|
|
@@ -214,11 +217,13 @@ export function isLinkedVisit(visit: TableLinkVisit): boolean {
|
|
|
214
217
|
}
|
|
215
218
|
|
|
216
219
|
/** A kept field of the listing state, with its value shown and default. */
|
|
217
|
-
export type KeptListingField =
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
]
|
|
220
|
+
export type KeptListingField = {
|
|
221
|
+
[F in TableField]: [
|
|
222
|
+
field: F,
|
|
223
|
+
value: TablePreferenceValues[F] | undefined,
|
|
224
|
+
defaultValue: TablePreferenceValues[F] | undefined,
|
|
225
|
+
];
|
|
226
|
+
}[TableField];
|
|
222
227
|
|
|
223
228
|
/** What `linkFollowingPreferences` reads the table's link state from. */
|
|
224
229
|
export interface LinkFollowingOptions {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ComponentInfo } from "#dms-core/app/types/page";
|
|
3
|
+
import type { ComponentOptionsData } from "#dms-core/app/types/component";
|
|
3
4
|
import { EYEBROW_CLASS } from "../../../build/utils/eyebrow";
|
|
4
5
|
import {
|
|
5
6
|
formBusInjectionKey,
|
|
@@ -20,7 +21,7 @@ interface RepeaterColumn {
|
|
|
20
21
|
id: string;
|
|
21
22
|
label?: string;
|
|
22
23
|
type?: string;
|
|
23
|
-
component: ComponentInfo
|
|
24
|
+
component: ComponentInfo<ComponentOptionsData>;
|
|
24
25
|
required?: boolean;
|
|
25
26
|
/** The cell's value in a row added or created to reach `min`. */
|
|
26
27
|
defaultValue?: FormFieldValue;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ComponentInfo } from "#dms-core/app/types/page";
|
|
3
|
+
import type { ComponentOptionsData } from "#dms-core/app/types/component";
|
|
3
4
|
import { useControlError } from "../../../composables/form/useControlError";
|
|
4
5
|
import {
|
|
5
6
|
type KeyValueRow,
|
|
@@ -11,7 +12,7 @@ import DmsInputRepeater from "./InputRepeater.vue";
|
|
|
11
12
|
|
|
12
13
|
interface KeyValueColumn {
|
|
13
14
|
type?: string;
|
|
14
|
-
component: ComponentInfo
|
|
15
|
+
component: ComponentInfo<ComponentOptionsData>;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
interface KeyValueProps {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { z } from "zod";
|
|
2
2
|
import type { FormFieldOrGroup, FormSection, FormSectionNav } from "./field";
|
|
3
3
|
import type { FormSubmitResponse } from "./api";
|
|
4
4
|
import type { FormData } from "./value";
|
|
5
|
-
import type { validateFormState } from "../../../build/composables/form/formValidation";
|
|
6
5
|
import type {
|
|
7
6
|
FormKind,
|
|
8
7
|
FormSaveMode,
|
|
@@ -54,14 +53,11 @@ export interface FormProps extends FormComponentProps {
|
|
|
54
53
|
backTo?: string;
|
|
55
54
|
successMessage?: string;
|
|
56
55
|
errorMessage?: string;
|
|
57
|
-
schema?:
|
|
56
|
+
schema?: z.core.JSONSchema.BaseSchema;
|
|
58
57
|
watchActions?: WatchAction[];
|
|
59
58
|
onSuccessCallback?: (response?: FormSubmitResponse, data?: FormData) => void;
|
|
60
59
|
fieldsOrientation?: "horizontal" | "vertical";
|
|
61
|
-
submitDefaults?:
|
|
62
|
-
string,
|
|
63
|
-
Parameters<typeof validateFormState>[1][string]
|
|
64
|
-
>;
|
|
60
|
+
submitDefaults?: FormData;
|
|
65
61
|
containerId?: string;
|
|
66
62
|
redirectOnSuccess?: string;
|
|
67
63
|
/** Field of the loaded row a page form names in the breadcrumb. */
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
collectSubmitData,
|
|
23
23
|
computeResetState,
|
|
24
24
|
processBeforeStateMappers,
|
|
25
|
+
type FormStateValues,
|
|
25
26
|
resolveFormFieldErrors,
|
|
26
27
|
resolveSubmitTarget,
|
|
27
28
|
snapshotFormState,
|
|
@@ -257,7 +258,7 @@ function createSavedForm(context: ReturnType<typeof createFormNotices>) {
|
|
|
257
258
|
};
|
|
258
259
|
|
|
259
260
|
/** Applies the saved record without clearing the saved flag in the watcher. */
|
|
260
|
-
const applyStoredRecord = async (stored:
|
|
261
|
+
const applyStoredRecord = async (stored: FormStateValues): Promise<void> => {
|
|
261
262
|
lifecycle.isApplyingSavedRecord = true;
|
|
262
263
|
Object.assign(state.value, stored);
|
|
263
264
|
options.onSaved?.();
|
|
@@ -267,7 +268,7 @@ function createSavedForm(context: ReturnType<typeof createFormNotices>) {
|
|
|
267
268
|
|
|
268
269
|
/** Re-reads a saved record, keeping intervening edits or failed-read values. */
|
|
269
270
|
const refreshSavedRecord = async (): Promise<void> => {
|
|
270
|
-
let stored:
|
|
271
|
+
let stored: FormStateValues | undefined;
|
|
271
272
|
try {
|
|
272
273
|
stored = await loadRecord();
|
|
273
274
|
} catch {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../build/composables/form/useFormModel";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.1-next.1029.g63c44fb",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, MySQL, MariaDB, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"frontend-vue",
|
|
49
49
|
"!frontend-vue/tests",
|
|
50
50
|
"!frontend-vue/jsconfig.json",
|
|
51
|
-
"!frontend-vue/.oxlint-pending",
|
|
52
51
|
"!frontend-vue/scripts/eslint-globals.mjs",
|
|
53
52
|
"!frontend-vue/scripts/layer-auto-imports.mjs",
|
|
54
53
|
"!frontend-vue/vitest.config.ts",
|
|
@@ -89,6 +88,8 @@
|
|
|
89
88
|
"@antelopejs/interface-data-api": ">=0.8.0 <0.9.0",
|
|
90
89
|
"@antelopejs/interface-database": ">=0.4.0 <0.5.0",
|
|
91
90
|
"@antelopejs/interface-database-decorators": ">=0.5.2 <0.6.0",
|
|
91
|
+
"@antelopejs/interface-dms": "^0.16.0",
|
|
92
|
+
"@antelopejs/interface-dms-builder": "^0.6.2",
|
|
92
93
|
"@antelopejs/interface-email": ">=0.2.1 <0.3.0",
|
|
93
94
|
"@antelopejs/interface-file-storage": ">=0.1.4 <0.2.0",
|
|
94
95
|
"@csstools/css-tokenizer": "4.0.0",
|
|
@@ -110,9 +111,7 @@
|
|
|
110
111
|
"striptags": "^3.2.0",
|
|
111
112
|
"ts-morph": "^28.0.0",
|
|
112
113
|
"ua-parser-js": "^2.0.9",
|
|
113
|
-
"zod": "^4.5.0"
|
|
114
|
-
"@antelopejs/interface-dms": "^0.16.0",
|
|
115
|
-
"@antelopejs/interface-dms-builder": "^0.6.2"
|
|
114
|
+
"zod": "^4.5.0"
|
|
116
115
|
},
|
|
117
116
|
"devDependencies": {
|
|
118
117
|
"@antelopejs/api": "~1.7.8",
|
|
@@ -212,7 +211,7 @@
|
|
|
212
211
|
"optional": true
|
|
213
212
|
}
|
|
214
213
|
},
|
|
215
|
-
"gitHead": "
|
|
214
|
+
"gitHead": "63c44fbc74f3caf2c7156ee13f07454781f6c222",
|
|
216
215
|
"scripts": {
|
|
217
216
|
"build": "pnpm --filter @antelopejs/interface-dms --filter @antelopejs/interface-dms-builder build && rimraf dist && antelopejs-tsc && tsc-alias && tsc -p e2e/tsconfig.types.json",
|
|
218
217
|
"dev": "ajs project run --inspect -w -p playground",
|