@headless-adminapp/app 1.4.53 → 1.5.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.
- package/app/AppProvider.d.ts +1 -1
- package/app/AuthWrapper.d.ts +2 -2
- package/app/LayoutProvider.d.ts +7 -7
- package/app/context.d.ts +2 -2
- package/app/hooks/useAppContext.d.ts +1 -1
- package/auth/AuthProvider.d.ts +2 -2
- package/auth/context.d.ts +1 -1
- package/auth/hooks/useAuthSession.d.ts +1 -1
- package/auth/index.d.ts +1 -1
- package/auth/index.js +0 -1
- package/auth/types.d.ts +1 -1
- package/board/BoardColumnProvider.d.ts +2 -2
- package/board/context.d.ts +1 -1
- package/board/hooks/useBoardColumnConfig.d.ts +1 -1
- package/board/hooks/useBoardColumnData.d.ts +2 -2
- package/board/hooks/useBoardConfig.d.ts +2 -2
- package/board/hooks/useBoardSchema.d.ts +1 -1
- package/board/types.d.ts +7 -7
- package/board/utils.d.ts +2 -2
- package/builders/CommandBuilder/DefaultCommandBuilder.d.ts +4 -4
- package/builders/CommandBuilder/FormCommandBuilder.d.ts +3 -3
- package/builders/CommandBuilder/SubgridCommandBuilder.d.ts +3 -3
- package/builders/CommandBuilder/ViewCommandBuilder.d.ts +3 -3
- package/builders/CommandBuilder/ViewCommandBuilder.js +7 -3
- package/builders/CommandBuilder/utils.d.ts +1 -1
- package/builders/SchemaExperienceBuilder.d.ts +4 -4
- package/builders/utils.d.ts +6 -6
- package/builders/utils.js +5 -1
- package/calendar/CalendarProvider.d.ts +3 -3
- package/calendar/context.d.ts +1 -1
- package/calendar/hooks/useConfig.d.ts +2 -2
- package/calendar/hooks/useOpenDetailDialog.d.ts +1 -1
- package/calendar/types.d.ts +5 -5
- package/calendar/utils.d.ts +2 -2
- package/command/hooks/useBaseCommandHandlerContext.d.ts +2 -2
- package/command/hooks/useBaseCommandHandlerContext.js +10 -2
- package/command/hooks/useCommands.d.ts +2 -2
- package/command/index.d.ts +1 -1
- package/command/index.js +0 -1
- package/command/types.d.ts +5 -5
- package/command/utils/index.d.ts +2 -2
- package/components/ScrollView/index.d.ts +1 -1
- package/components/ScrollbarWithMoreDataRequest/index.d.ts +1 -1
- package/dataform/DataFormProvider/CalculatedField.d.ts +1 -1
- package/dataform/DataFormProvider/CalculatedField.js +1 -0
- package/dataform/DataFormProvider/DataResolver.d.ts +2 -2
- package/dataform/DataFormProvider/DataResolver.js +1 -0
- package/dataform/DataFormProvider/UnsavedChangesInfoSetter.d.ts +1 -1
- package/dataform/DataFormProvider/getRecord.d.ts +5 -5
- package/dataform/DataFormProvider/getRecord.js +1 -0
- package/dataform/DataFormProvider/index.d.ts +5 -5
- package/dataform/DataFormProvider/index.js +1 -0
- package/dataform/DataFormProvider/types.d.ts +4 -4
- package/dataform/DataFormProvider/utils.d.ts +6 -6
- package/dataform/FormManager.d.ts +7 -7
- package/dataform/context.d.ts +8 -8
- package/dataform/hooks/useFormNotifications.d.ts +5 -3
- package/dataform/hooks/useFormNotifications.js +5 -8
- package/dataform/hooks/useFormSave.d.ts +1 -1
- package/dataform/hooks/useFormSchema.d.ts +1 -1
- package/dataform/hooks/useLoadFormGridPage.d.ts +2 -2
- package/dataform/hooks/useMainFormCommands.d.ts +2 -2
- package/dataform/hooks/useMainFormCommands.js +2 -1
- package/dataform/hooks/useOnFieldValueChangeListener.js +3 -1
- package/dataform/hooks/useProcessFlowSteps.js +3 -1
- package/dataform/hooks/useSelectedForm.d.ts +2 -2
- package/dataform/utils/defaultParameters.d.ts +3 -3
- package/dataform/utils/defaultParameters.js +4 -1
- package/dataform/utils/index.d.ts +7 -7
- package/dataform/utils/index.js +31 -8
- package/dataform/utils/saveRecord.d.ts +6 -6
- package/dataform/utils/saveRecord.js +11 -2
- package/datagrid/DataGridProvider/DataResolver.d.ts +1 -1
- package/datagrid/DataGridProvider/index.d.ts +6 -6
- package/datagrid/DataGridProvider/transformViewColumns.d.ts +4 -4
- package/datagrid/DataGridProvider/useGridCellRangeResolver.d.ts +4 -4
- package/datagrid/DataGridProvider/utils.d.ts +5 -5
- package/datagrid/DataGridProvider/utils.js +3 -0
- package/datagrid/column-filter/constants.d.ts +1 -1
- package/datagrid/column-filter/utils.d.ts +1 -1
- package/datagrid/context.d.ts +5 -5
- package/datagrid/hooks/useGridColumnFilter.d.ts +1 -1
- package/datagrid/hooks/useGridColumns.d.ts +2 -2
- package/datagrid/hooks/useGridCommands.d.ts +2 -2
- package/datagrid/hooks/useGridOptions.js +1 -0
- package/datagrid/hooks/useGridPagination.js +1 -0
- package/datagrid/hooks/useGridSchema.d.ts +1 -1
- package/datagrid/hooks/useGridSorting.d.ts +2 -2
- package/datagrid/hooks/useGridSorting.js +1 -0
- package/datagrid/hooks/useLoadMainGridPage.d.ts +3 -3
- package/datagrid/hooks/useMainGridCommands.d.ts +2 -2
- package/datagrid/hooks/useMainGridCommands.js +2 -0
- package/datagrid/hooks/useSelectedView.d.ts +2 -2
- package/datagrid/hooks/useSubGridCommands.d.ts +2 -2
- package/dialog/DialogProvider.d.ts +1 -1
- package/dialog/context.d.ts +1 -1
- package/dialog/hooks/useOpenAlertDialog.d.ts +1 -1
- package/dialog/hooks/useOpenConfirmDialog.d.ts +1 -1
- package/dialog/hooks/useOpenDialog.d.ts +1 -1
- package/dialog/hooks/useOpenErrorDialog.d.ts +1 -1
- package/dialog/hooks/useOpenPromptDialog.d.ts +2 -2
- package/header/HeaderProvider.d.ts +1 -1
- package/header/components/MobileHeaderLeftContent.d.ts +1 -1
- package/header/components/MobileHeaderRightContent.d.ts +1 -1
- package/header/components/MobileHeaderTitle.d.ts +1 -1
- package/header/hooks/useHeaderValue.d.ts +1 -1
- package/header/hooks/useMobileHeaderSetValue.d.ts +1 -1
- package/historystate/provider.d.ts +1 -1
- package/hooks/useDebouncedValue.js +5 -2
- package/hooks/useElementLayout.d.ts +2 -2
- package/hooks/useItemsWithKey.d.ts +1 -1
- package/hooks/useLongPress.js +4 -2
- package/hooks/useStorageState.d.ts +1 -1
- package/insights/context.d.ts +1 -1
- package/insights/hooks/index.d.ts +2 -2
- package/insights/hooks/index.js +1 -0
- package/locale/LocaleProvider.d.ts +2 -2
- package/locale/context.d.ts +1 -1
- package/locale/utils.d.ts +1 -1
- package/metadata/MetadataProvider.d.ts +5 -5
- package/metadata/context.d.ts +2 -2
- package/metadata/hooks/useExperienceView.d.ts +1 -1
- package/metadata/hooks/useExperienceView.js +3 -1
- package/metadata/hooks/useMetadata.d.ts +1 -1
- package/metadata/hooks/useRecentItemStore.d.ts +1 -1
- package/metadata/hooks/useSchema.d.ts +1 -1
- package/mutable/context.d.ts +1 -1
- package/mutable/context.js +1 -0
- package/mutable/index.d.ts +1 -1
- package/mutable/index.js +0 -15
- package/mutable/state.d.ts +1 -1
- package/mutable/utils.d.ts +1 -1
- package/mutable/utils.js +1 -1
- package/navigation/hooks/useOpenForm.d.ts +1 -1
- package/navigation/unsaved-changes/useUnsavedChangesRouteGuard.js +1 -0
- package/package.json +3 -3
- package/progress-indicator/ProgressIndicatorProvider.d.ts +1 -1
- package/progress-indicator/ProgressIndicatorProvider.js +1 -1
- package/progress-indicator/context.js +3 -1
- package/providers/PageEntityFormProvider/index.d.ts +5 -5
- package/providers/PageEntityViewProvider/index.d.ts +4 -4
- package/quickcreate/QuickCreateProvider.d.ts +1 -1
- package/quickcreate/context.d.ts +2 -2
- package/quickcreate/hooks/useFormSave.d.ts +1 -1
- package/quickcreate/hooks/useOpenQuickCreate.d.ts +2 -2
- package/recordset/RecordSetProvider.d.ts +1 -1
- package/recordset/RecordSetProvider.js +1 -1
- package/recordset/context.d.ts +1 -1
- package/recordset/hooks/useRecordSetResult.d.ts +1 -1
- package/route/RouteProvider.d.ts +4 -4
- package/route/context.d.ts +3 -3
- package/route/context.js +8 -2
- package/store/ComponentStore.d.ts +1 -1
- package/store/EventManager.d.ts +1 -1
- package/store/EventManager.js +1 -0
- package/store/RecentItemStore.d.ts +1 -1
- package/store/SchemaExperienceStore.d.ts +6 -6
- package/store/SchemaExperienceStore.js +2 -2
- package/toast-notification/ToastNotificationProvider.d.ts +1 -1
- package/toast-notification/hooks/useOpenToastNotification.d.ts +1 -1
- package/transport/InMemoryDataService/index.d.ts +3 -3
- package/transport/InMemoryDataService/index.js +5 -0
- package/transport/RestDataService/index.d.ts +2 -2
- package/transport/context.d.ts +1 -1
- package/transport/hooks/useCustomActionQuery.d.ts +2 -1
- package/transport/hooks/useDataService.d.ts +1 -1
- package/transport/hooks/useRetriveRecords.d.ts +6 -16
- package/transport/hooks/useRetriveRecords.js +2 -1
- package/utils/getAttributeFormattedValue.d.ts +3 -3
- package/utils/getAttributeFormattedValue.js +20 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Id } from '@headless-adminapp/core/attributes';
|
|
2
|
-
import { Schema } from '@headless-adminapp/core/schema';
|
|
3
|
-
import { AggregateAttribute, CreateRecordResult, Data, IDataService, InferredAggregateQueryResult } from '@headless-adminapp/core/transport';
|
|
4
|
-
import { RetriveRecordsFnOptions, RetriveRecordsResult } from '@headless-adminapp/core/transport/operations';
|
|
2
|
+
import type { Schema } from '@headless-adminapp/core/schema';
|
|
3
|
+
import type { AggregateAttribute, CreateRecordResult, Data, IDataService, InferredAggregateQueryResult } from '@headless-adminapp/core/transport';
|
|
4
|
+
import type { RetriveRecordsFnOptions, RetriveRecordsResult } from '@headless-adminapp/core/transport/operations';
|
|
5
5
|
interface Options {
|
|
6
6
|
data: Record<string, unknown[]>;
|
|
7
7
|
schemas: Record<string, Schema>;
|
|
@@ -29,6 +29,7 @@ class InMemoryDataService {
|
|
|
29
29
|
if (!record) {
|
|
30
30
|
throw new Error(`Record with id ${id} not found`);
|
|
31
31
|
}
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
33
|
return record;
|
|
33
34
|
}
|
|
34
35
|
async retriveRecords({ logicalName, }) {
|
|
@@ -37,6 +38,7 @@ class InMemoryDataService {
|
|
|
37
38
|
logicalName,
|
|
38
39
|
records: records,
|
|
39
40
|
count: records.length,
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
async createRecord(logicalName, data) {
|
|
@@ -48,6 +50,7 @@ class InMemoryDataService {
|
|
|
48
50
|
[schema.idAttribute]: newId,
|
|
49
51
|
};
|
|
50
52
|
records.push(newRecord);
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
54
|
return { id: newId };
|
|
52
55
|
}
|
|
53
56
|
async updateRecord(logicalName, id, data) {
|
|
@@ -60,6 +63,7 @@ class InMemoryDataService {
|
|
|
60
63
|
throw new Error(`Record with id ${id} not found`);
|
|
61
64
|
}
|
|
62
65
|
Object.assign(record, data);
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
63
67
|
return { id };
|
|
64
68
|
}
|
|
65
69
|
async deleteRecord(logicalName, id) {
|
|
@@ -80,6 +84,7 @@ class InMemoryDataService {
|
|
|
80
84
|
return {};
|
|
81
85
|
}
|
|
82
86
|
async retriveAggregate() {
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
88
|
return [];
|
|
84
89
|
}
|
|
85
90
|
async customAction() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AggregateAttribute, AggregateQuery, CreateRecordResult, Data, IDataService, InferredAggregateQueryResult } from '@headless-adminapp/core/transport';
|
|
2
|
-
import { RetriveRecordsFnOptions, RetriveRecordsResult } from '@headless-adminapp/core/transport/operations';
|
|
1
|
+
import { type AggregateAttribute, type AggregateQuery, type CreateRecordResult, type Data, type IDataService, type InferredAggregateQueryResult } from '@headless-adminapp/core/transport';
|
|
2
|
+
import type { RetriveRecordsFnOptions, RetriveRecordsResult } from '@headless-adminapp/core/transport/operations';
|
|
3
3
|
interface RestDataServiceOptions {
|
|
4
4
|
endpoint: string;
|
|
5
5
|
}
|
package/transport/context.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IDataService, IFileService } from '@headless-adminapp/core/transport';
|
|
1
|
+
import type { IDataService, IFileService } from '@headless-adminapp/core/transport';
|
|
2
2
|
export declare const DataServiceContext: import("react").Context<IDataService | undefined>;
|
|
3
3
|
export declare const FileServiceContext: import("react").Context<IFileService | null>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
export declare function useCustomActionQuery<T = unknown>(actionName: string, payload: unknown): UseQueryResult<T, Error>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IDataService } from '@headless-adminapp/core/transport';
|
|
1
|
+
import type { IDataService } from '@headless-adminapp/core/transport';
|
|
2
2
|
export declare function useDataService<T extends IDataService = IDataService>(): T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SortingState } from '@headless-adminapp/core/experience/view';
|
|
2
|
-
import { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
3
|
-
import { Filter } from '@headless-adminapp/core/transport';
|
|
4
|
-
import { QueryKey } from '@tanstack/react-query';
|
|
1
|
+
import type { SortingState } from '@headless-adminapp/core/experience/view';
|
|
2
|
+
import type { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
3
|
+
import type { Filter } from '@headless-adminapp/core/transport';
|
|
4
|
+
import { type QueryKey } from '@tanstack/react-query';
|
|
5
5
|
interface UseRetriveRecordProps<S extends SchemaAttributes = SchemaAttributes> {
|
|
6
6
|
schema: Schema<S>;
|
|
7
7
|
search?: string;
|
|
@@ -22,12 +22,7 @@ export declare function useRetriveRecordsInternal<S extends SchemaAttributes = S
|
|
|
22
22
|
} | null;
|
|
23
23
|
isFetching: boolean;
|
|
24
24
|
hasNextPage: boolean;
|
|
25
|
-
fetchNextPage: (
|
|
26
|
-
params: {
|
|
27
|
-
pageIndex: number;
|
|
28
|
-
};
|
|
29
|
-
data: import("@headless-adminapp/core/transport").RetriveRecordsResult<InferredSchemaType<S>>;
|
|
30
|
-
}, unknown>, Error>>;
|
|
25
|
+
fetchNextPage: () => Promise<void>;
|
|
31
26
|
isFetchingNextPage: boolean;
|
|
32
27
|
refetch: () => void;
|
|
33
28
|
};
|
|
@@ -40,12 +35,7 @@ export declare function useRetriveRecords<S extends SchemaAttributes = SchemaAtt
|
|
|
40
35
|
} | null;
|
|
41
36
|
isFetching: boolean;
|
|
42
37
|
hasNextPage: boolean;
|
|
43
|
-
fetchNextPage: (
|
|
44
|
-
params: {
|
|
45
|
-
pageIndex: number;
|
|
46
|
-
};
|
|
47
|
-
data: import("@headless-adminapp/core/transport").RetriveRecordsResult<InferredSchemaType<S>>;
|
|
48
|
-
}, unknown>, Error>>;
|
|
38
|
+
fetchNextPage: () => Promise<void>;
|
|
49
39
|
isFetchingNextPage: boolean;
|
|
50
40
|
refetch: () => void;
|
|
51
41
|
};
|
|
@@ -77,6 +77,7 @@ function useRetriveRecordsInternal(queryKey, { columns, expand, filter, maxRecor
|
|
|
77
77
|
filter,
|
|
78
78
|
skip,
|
|
79
79
|
limit,
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
81
|
sort: sorting,
|
|
81
82
|
});
|
|
82
83
|
return {
|
|
@@ -121,7 +122,7 @@ function useRetriveRecordsInternal(queryKey, { columns, expand, filter, maxRecor
|
|
|
121
122
|
data: finalData,
|
|
122
123
|
isFetching,
|
|
123
124
|
hasNextPage,
|
|
124
|
-
fetchNextPage,
|
|
125
|
+
fetchNextPage: fetchNextPage,
|
|
125
126
|
isFetchingNextPage,
|
|
126
127
|
refetch: refech,
|
|
127
128
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Attribute, BooleanAttribute, ChoiceAttribute, DateAttribute, InferredAttributeType } from '@headless-adminapp/core/attributes';
|
|
2
|
-
import { ChoicesAttribute } from '@headless-adminapp/core/attributes/ChoiceAttribute';
|
|
3
|
-
import { Locale } from '@headless-adminapp/core/experience/locale/types';
|
|
1
|
+
import type { Attribute, BooleanAttribute, ChoiceAttribute, DateAttribute, InferredAttributeType } from '@headless-adminapp/core/attributes';
|
|
2
|
+
import type { ChoicesAttribute } from '@headless-adminapp/core/attributes/ChoiceAttribute';
|
|
3
|
+
import type { Locale } from '@headless-adminapp/core/experience/locale/types';
|
|
4
4
|
interface AttributeFormattedValueStringsSet {
|
|
5
5
|
yes: string;
|
|
6
6
|
no: string;
|
|
@@ -98,9 +98,26 @@ function getAttributeBooleanFormattedValue(attribute, value, options) {
|
|
|
98
98
|
: (attribute.falseLabel ?? strings.no);
|
|
99
99
|
}
|
|
100
100
|
function getAttributeChoiceFormattedValue(attribute, value) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
101
|
+
if (!value) {
|
|
102
|
+
return '';
|
|
103
|
+
}
|
|
104
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
105
|
+
attribute.options.find((option) => option.value === value) ?? {
|
|
106
|
+
label: '',
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
if (typeof value !== 'object') {
|
|
110
|
+
return '';
|
|
111
|
+
}
|
|
112
|
+
if ('label' in value) {
|
|
113
|
+
return value.label;
|
|
114
|
+
}
|
|
115
|
+
if ('value' in value) {
|
|
116
|
+
return (attribute.options.find((option) => option.value === value.value) ?? {
|
|
117
|
+
label: '',
|
|
118
|
+
}).label;
|
|
119
|
+
}
|
|
120
|
+
return '';
|
|
104
121
|
}
|
|
105
122
|
function getAttributeChoicesFormattedValue(attribute, value) {
|
|
106
123
|
return value
|