@headless-adminapp/app 0.0.17-alpha.8 → 1.0.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 +0 -3
- package/app/AppProvider.js +10 -33
- package/app/AuthWrapper.d.ts +1 -1
- package/app/AuthWrapper.js +4 -1
- package/app/LayoutProvider.d.ts +8 -7
- package/app/LayoutProvider.js +28 -2
- package/app/context.d.ts +1 -1
- package/auth/AuthProvider.d.ts +1 -1
- package/auth/AuthProvider.js +30 -23
- package/auth/context.d.ts +2 -0
- package/auth/hooks/useIsSkipAuthCheck.d.ts +1 -0
- package/auth/hooks/useIsSkipAuthCheck.js +8 -0
- package/auth/hooks/useLogout.js +1 -1
- package/board/BoardColumnDataResolver.d.ts +1 -0
- package/board/BoardColumnDataResolver.js +64 -0
- package/board/BoardColumnProvider.d.ts +7 -0
- package/board/BoardColumnProvider.js +36 -0
- package/board/context.d.ts +19 -0
- package/board/context.js +6 -0
- package/board/hooks/index.d.ts +6 -0
- package/board/hooks/index.js +15 -0
- package/board/hooks/useBoardColumnConfig.d.ts +2 -0
- package/board/hooks/useBoardColumnConfig.js +8 -0
- package/board/hooks/useBoardColumnData.d.ts +3 -0
- package/board/hooks/useBoardColumnData.js +9 -0
- package/board/hooks/useBoardColumnDataState.d.ts +5 -0
- package/board/hooks/useBoardColumnDataState.js +9 -0
- package/board/hooks/useBoardConfig.d.ts +3 -0
- package/board/hooks/useBoardConfig.js +8 -0
- package/board/hooks/useBoardSchema.d.ts +2 -0
- package/board/hooks/useBoardSchema.js +7 -0
- package/board/hooks/useSearchText.d.ts +1 -0
- package/board/hooks/useSearchText.js +14 -0
- package/board/types.d.ts +47 -0
- package/board/utils.d.ts +3 -0
- package/board/utils.js +6 -0
- package/builders/CommandBuilder/DefaultCommandBuilder.d.ts +15 -6
- package/builders/CommandBuilder/DefaultCommandBuilder.js +42 -20
- package/builders/CommandBuilder/FormCommandBuilder.d.ts +14 -13
- package/builders/CommandBuilder/FormCommandBuilder.js +66 -52
- package/builders/CommandBuilder/SubgridCommandBuilder.d.ts +8 -27
- package/builders/CommandBuilder/SubgridCommandBuilder.js +115 -57
- package/builders/CommandBuilder/ViewCommandBuilder.js +32 -52
- package/builders/CommandBuilder/utils.js +1 -1
- package/builders/DefineFormExperience.d.ts +27 -0
- package/builders/DefineFormExperience.js +99 -0
- package/builders/DefineViewExperience.d.ts +13 -0
- package/builders/DefineViewExperience.js +33 -0
- package/builders/SchemaExperienceBuilder.d.ts +9 -7
- package/builders/SchemaExperienceBuilder.js +62 -40
- package/builders/utils.js +30 -44
- package/calendar/baseEventAttributes.d.ts +35 -0
- package/calendar/baseEventAttributes.js +38 -0
- package/calendar/context.d.ts +6 -0
- package/calendar/context.js +5 -0
- package/calendar/hooks/index.d.ts +1 -0
- package/{appearance → calendar}/hooks/index.js +1 -1
- package/calendar/hooks/useConfig.d.ts +3 -0
- package/calendar/hooks/useConfig.js +8 -0
- package/calendar/types.d.ts +41 -0
- package/calendar/types.js +2 -0
- package/calendar/utils.d.ts +3 -0
- package/calendar/utils.js +6 -0
- package/command/hooks/useBaseCommandHandlerContext.js +15 -6
- package/command/hooks/useCommands.js +1 -1
- package/command/utils/index.js +34 -9
- package/components/ScrollView/index.d.ts +1 -1
- package/components/ScrollView/index.js +2 -2
- package/components/ScrollbarWithMoreDataRequest/index.d.ts +9 -0
- package/components/ScrollbarWithMoreDataRequest/index.js +32 -0
- package/dataform/DataFormProvider/CustomHookExecuter.d.ts +5 -0
- package/dataform/DataFormProvider/CustomHookExecuter.js +14 -0
- package/dataform/DataFormProvider/DataResolver.d.ts +6 -4
- package/dataform/DataFormProvider/DataResolver.js +11 -94
- package/dataform/DataFormProvider/InitialValueResolver.js +3 -2
- package/dataform/DataFormProvider/ReadonlyInfoResolver.js +2 -3
- package/dataform/DataFormProvider/getRecord.d.ts +3 -0
- package/dataform/DataFormProvider/getRecord.js +56 -0
- package/dataform/DataFormProvider/index.d.ts +4 -0
- package/dataform/DataFormProvider/index.js +34 -12
- package/dataform/DataFormProvider/types.d.ts +13 -0
- package/dataform/DataFormProvider/types.js +2 -0
- package/dataform/DataFormProvider/utils.d.ts +23 -0
- package/dataform/DataFormProvider/utils.js +105 -0
- package/dataform/FormManager.d.ts +57 -0
- package/dataform/FormManager.js +247 -0
- package/dataform/constants.d.ts +1 -0
- package/dataform/constants.js +4 -0
- package/dataform/context.d.ts +26 -1
- package/dataform/hooks/index.d.ts +11 -0
- package/dataform/hooks/index.js +11 -0
- package/dataform/hooks/useContextKey.d.ts +1 -0
- package/dataform/hooks/useContextKey.js +8 -0
- package/dataform/hooks/useDisabledControlsManager.d.ts +6 -0
- package/dataform/hooks/useDisabledControlsManager.js +46 -0
- package/dataform/hooks/useEventManager.d.ts +1 -0
- package/dataform/hooks/useEventManager.js +8 -0
- package/dataform/hooks/useFormManager.d.ts +2 -0
- package/dataform/hooks/useFormManager.js +13 -0
- package/dataform/hooks/useFormNotifications.js +2 -2
- package/dataform/hooks/useFormSave.js +28 -31
- package/dataform/hooks/useHiddenControlsManager.d.ts +7 -0
- package/dataform/hooks/useHiddenControlsManager.js +50 -0
- package/dataform/hooks/useIsControlDisabled.d.ts +1 -0
- package/dataform/hooks/useIsControlDisabled.js +27 -0
- package/dataform/hooks/useIsControlHiddenByAttributeName.d.ts +1 -0
- package/dataform/hooks/useIsControlHiddenByAttributeName.js +17 -0
- package/dataform/hooks/useIsControlHiddenByKey.d.ts +1 -0
- package/dataform/hooks/useIsControlHiddenByKey.js +17 -0
- package/dataform/hooks/useIsFieldRequired.d.ts +1 -0
- package/dataform/hooks/useIsFieldRequired.js +25 -0
- package/dataform/hooks/useLoadFormGridPage.js +8 -17
- package/dataform/hooks/useMainFormCommands.d.ts +1 -12
- package/dataform/hooks/useMainFormCommands.js +13 -3
- package/dataform/hooks/useOnFieldValueChangeListener.d.ts +1 -0
- package/dataform/hooks/useOnFieldValueChangeListener.js +30 -0
- package/dataform/hooks/useProcessFlowSteps.d.ts +1 -0
- package/dataform/hooks/useProcessFlowSteps.js +45 -0
- package/dataform/hooks/useRecordTitle.d.ts +3 -1
- package/dataform/hooks/useRecordTitle.js +12 -5
- package/dataform/hooks/useRequiredFieldManager.d.ts +6 -0
- package/dataform/hooks/useRequiredFieldManager.js +49 -0
- package/dataform/test.d.ts +57 -0
- package/dataform/test.js +247 -0
- package/dataform/utils/defaultParameters.d.ts +6 -0
- package/dataform/utils/defaultParameters.js +54 -0
- package/dataform/utils/index.d.ts +6 -24
- package/dataform/utils/index.js +164 -190
- package/dataform/utils/saveRecord.d.ts +27 -0
- package/dataform/utils/saveRecord.js +163 -0
- package/datagrid/DataGridProvider/DataResolver.js +38 -109
- package/datagrid/DataGridProvider/index.d.ts +6 -0
- package/datagrid/DataGridProvider/index.js +18 -8
- package/datagrid/DataGridProvider/transformViewColumns.js +10 -2
- package/datagrid/DataGridProvider/utils.js +8 -8
- package/datagrid/column-filter/constants.js +38 -3
- package/datagrid/column-filter/utils.js +7 -1
- package/datagrid/context.d.ts +6 -0
- package/datagrid/hooks/useChangeView.js +1 -1
- package/datagrid/hooks/useGridColumnFilter.js +4 -1
- package/datagrid/hooks/useGridDisabled.d.ts +1 -0
- package/datagrid/hooks/useGridDisabled.js +8 -0
- package/datagrid/hooks/useLoadMainGridPage.js +1 -1
- package/datagrid/hooks/useMainGridCommands.js +23 -9
- package/datagrid/hooks/useOpenRecord.js +2 -2
- package/datagrid/hooks/useSubGridCommands.js +23 -45
- package/defaults.d.ts +2 -0
- package/defaults.js +5 -0
- package/dialog/hooks/useCloseDialog.js +17 -15
- package/dialog/hooks/useOpenAlertDialog.js +8 -3
- package/dialog/hooks/useOpenConfirmDialog.js +10 -4
- package/dialog/hooks/useOpenDialog.js +7 -5
- package/dialog/hooks/useOpenErrorDialog.js +8 -3
- package/dialog/hooks/useOpenPromptDialog.js +10 -4
- package/form/FormValidationStringContext.d.ts +1 -0
- package/form/FormValidationStringContext.js +1 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +3 -0
- package/hooks/useDebouncedValue.js +0 -1
- package/hooks/useElementLayout.js +1 -1
- package/hooks/useIsMobile.js +0 -1
- package/hooks/useItemsWithKey.d.ts +7 -0
- package/hooks/useItemsWithKey.js +13 -0
- package/hooks/useStorageState.js +1 -2
- package/hooks/useSystemColorScheme.d.ts +1 -1
- package/hooks/useSystemColorScheme.js +0 -1
- package/insights/InsightsProvider.d.ts +8 -0
- package/insights/InsightsProvider.js +27 -0
- package/locale/LocaleProvider.d.ts +2 -1
- package/locale/LocaleProvider.js +3 -3
- package/locale/index.d.ts +1 -0
- package/locale/index.js +1 -0
- package/locale/useCurrencySymbol.d.ts +1 -0
- package/locale/useCurrencySymbol.js +12 -0
- package/locale/utils.js +4 -2
- package/metadata/MetadataProvider.d.ts +8 -4
- package/metadata/MetadataProvider.js +23 -17
- package/metadata/context.d.ts +3 -2
- package/metadata/hooks/index.d.ts +1 -1
- package/metadata/hooks/index.js +1 -1
- package/metadata/hooks/useAppExperience.d.ts +1 -0
- package/metadata/hooks/useAppExperience.js +8 -0
- package/metadata/hooks/useAppStore.d.ts +1 -1
- package/metadata/hooks/useAppStore.js +3 -3
- package/metadata/hooks/useExperienceView.js +2 -11
- package/metadata/hooks/useExperienceViewCommands.d.ts +1 -1
- package/metadata/hooks/useExperienceViewCommands.js +5 -14
- package/metadata/hooks/useExperienceViewLookup.js +2 -11
- package/metadata/hooks/useExperienceViewSubgridCommands.d.ts +1 -1
- package/metadata/hooks/useExperienceViewSubgridCommands.js +5 -14
- package/metadata/hooks/useMetadata.d.ts +11 -10
- package/metadata/hooks/useMetadata.js +4 -16
- package/metadata/hooks/useSchema.d.ts +1 -1
- package/metadata/hooks/useSchema.js +3 -0
- package/mutable/context.d.ts +3 -0
- package/mutable/context.js +8 -0
- package/mutable/utils.js +5 -12
- package/navigation/hooks/useOpenForm.js +4 -0
- package/package.json +6 -10
- package/providers/PageEntityFormProvider/index.d.ts +5 -1
- package/providers/PageEntityFormProvider/index.js +2 -2
- package/recordset/hooks/useRecordSetResult.js +4 -14
- package/route/RouteProvider.d.ts +2 -2
- package/route/RouteProvider.js +4 -1
- package/store/ClientAppStore.js +7 -20
- package/store/ComponentStore.d.ts +1 -1
- package/store/ComponentStore.js +6 -12
- package/store/EventManager.d.ts +2 -2
- package/store/EventManager.js +13 -29
- package/store/SchemaExperienceStore.js +179 -215
- package/store/index.d.ts +0 -1
- package/store/index.js +0 -1
- package/toast-notification/hooks/useCloseToastNotification.js +17 -15
- package/toast-notification/hooks/useOpenToastNotification.js +7 -5
- package/transport/InMemoryDataService/index.js +54 -77
- package/transport/RestDataService/index.d.ts +3 -3
- package/transport/RestDataService/index.js +68 -91
- package/transport/context.d.ts +2 -1
- package/transport/context.js +7 -1
- package/transport/hooks/index.d.ts +1 -0
- package/transport/hooks/index.js +1 -0
- package/transport/hooks/useFileService.d.ts +1 -0
- package/transport/hooks/useFileService.js +9 -0
- package/transport/hooks/useRetriveRecords.d.ts +33 -0
- package/transport/hooks/useRetriveRecords.js +110 -0
- package/utils/calculateColumnWidths.js +1 -1
- package/utils/color.d.ts +1 -0
- package/utils/color.js +14 -0
- package/utils/getAttributeFormattedValue.d.ts +4 -1
- package/utils/getAttributeFormattedValue.js +109 -54
- package/utils/phone.d.ts +13 -0
- package/utils/phone.js +33 -0
- package/appearance/context.d.ts +0 -7
- package/appearance/context.js +0 -5
- package/appearance/hooks/index.d.ts +0 -1
- package/appearance/hooks/useAppearanceContext.d.ts +0 -1
- package/appearance/hooks/useAppearanceContext.js +0 -12
- package/appearance/index.d.ts +0 -2
- package/appearance/index.js +0 -20
- package/builders/CommandBuilder.d.ts +0 -176
- package/builders/CommandBuilder.js +0 -567
- package/locale/types.d.ts +0 -2
- /package/{locale → board}/types.js +0 -0
|
@@ -1,155 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.DataResolver = DataResolver;
|
|
13
|
-
const react_query_1 = require("@tanstack/react-query");
|
|
14
4
|
const react_1 = require("react");
|
|
15
5
|
const useDebouncedValue_1 = require("../../hooks/useDebouncedValue");
|
|
16
6
|
const useMetadata_1 = require("../../metadata/hooks/useMetadata");
|
|
17
7
|
const context_1 = require("../../mutable/context");
|
|
18
|
-
const
|
|
8
|
+
const useRetriveRecords_1 = require("../../transport/hooks/useRetriveRecords");
|
|
19
9
|
const context_2 = require("../context");
|
|
20
10
|
const hooks_1 = require("../hooks");
|
|
11
|
+
const useGridDisabled_1 = require("../hooks/useGridDisabled");
|
|
21
12
|
const utils_1 = require("./utils");
|
|
22
|
-
const ROWS_PER_PAGE = 100;
|
|
23
13
|
const MAX_RECORDS = 10000;
|
|
24
14
|
function DataResolver() {
|
|
25
|
-
var _a;
|
|
26
15
|
const schema = (0, hooks_1.useDataGridSchema)();
|
|
27
16
|
const view = (0, hooks_1.useSelectedView)();
|
|
28
|
-
const dataService = (0, transport_1.useDataService)();
|
|
29
17
|
const [sorting] = (0, hooks_1.useGridSorting)();
|
|
30
18
|
const [searchText] = (0, hooks_1.useSearchText)();
|
|
31
19
|
const extraFilter = (0, hooks_1.useGridExtraFilter)();
|
|
32
20
|
const [columnFilters] = (0, hooks_1.useGridColumnFilter)();
|
|
33
21
|
const gridColumns = (0, hooks_1.useGridColumns)();
|
|
34
|
-
const maxRecords = (
|
|
22
|
+
const maxRecords = (0, hooks_1.useMaxRecords)() ?? MAX_RECORDS;
|
|
23
|
+
const [selectedIds] = (0, hooks_1.useGridSelection)();
|
|
24
|
+
const disabled = (0, useGridDisabled_1.useGridDisabled)();
|
|
35
25
|
const { schemaStore } = (0, useMetadata_1.useMetadata)();
|
|
26
|
+
const selectedIdsRef = (0, react_1.useRef)(selectedIds);
|
|
27
|
+
selectedIdsRef.current = selectedIds;
|
|
36
28
|
const setState = (0, context_1.useContextSetValue)(context_2.GridContext);
|
|
37
29
|
const [search] = (0, useDebouncedValue_1.useDebouncedValue)(searchText, 500);
|
|
38
|
-
const columns = (0, react_1.useMemo)(() =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
const columns = (0, react_1.useMemo)(() => {
|
|
31
|
+
const set = new Set([
|
|
32
|
+
...gridColumns.filter((x) => !x.expandedKey).map((x) => x.name),
|
|
33
|
+
schema.primaryAttribute,
|
|
34
|
+
]);
|
|
35
|
+
if (schema.avatarAttribute) {
|
|
36
|
+
set.add(schema.avatarAttribute);
|
|
37
|
+
}
|
|
38
|
+
return Array.from(set);
|
|
39
|
+
}, [gridColumns, schema.avatarAttribute, schema.primaryAttribute]);
|
|
42
40
|
const expand = (0, react_1.useMemo)(() => (0, utils_1.collectExpandedKeys)(gridColumns), [gridColumns]);
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
search,
|
|
48
|
-
view.experience.filter,
|
|
49
|
-
extraFilter,
|
|
50
|
-
sorting,
|
|
51
|
-
columnFilters,
|
|
41
|
+
const filter = (0, react_1.useMemo)(() => {
|
|
42
|
+
return (0, utils_1.mergeConditions)(schema, view.experience.filter, extraFilter, columnFilters, schemaStore);
|
|
43
|
+
}, [columnFilters, extraFilter, schema, schemaStore, view.experience.filter]);
|
|
44
|
+
const queryKey = (0, useRetriveRecords_1.useRetrieveRecordsKey)({
|
|
52
45
|
columns,
|
|
53
46
|
expand,
|
|
47
|
+
filter,
|
|
54
48
|
maxRecords,
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
schema,
|
|
50
|
+
search,
|
|
51
|
+
sorting,
|
|
52
|
+
});
|
|
53
|
+
(0, useRetriveRecords_1.useClearDataExceptFirstPage)(queryKey);
|
|
54
|
+
const { fetchNextPage, data, hasNextPage, isFetching, isFetchingNextPage } = (0, useRetriveRecords_1.useRetriveRecords)(queryKey, {
|
|
57
55
|
columns,
|
|
58
56
|
expand,
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
filter,
|
|
58
|
+
maxRecords,
|
|
59
|
+
schema,
|
|
61
60
|
search,
|
|
62
61
|
sorting,
|
|
63
|
-
|
|
64
|
-
maxRecords,
|
|
65
|
-
]);
|
|
66
|
-
const queryClient = (0, react_query_1.useQueryClient)();
|
|
67
|
-
(0, react_1.useEffect)(() => {
|
|
68
|
-
return () => {
|
|
69
|
-
// Clear all pages except the first one when the component is unmounted
|
|
70
|
-
queryClient.setQueryData(queryKey, (oldData) => {
|
|
71
|
-
if (!oldData) {
|
|
72
|
-
return oldData;
|
|
73
|
-
}
|
|
74
|
-
if (!oldData.pageParams.length || !oldData.pages.length) {
|
|
75
|
-
return oldData;
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
pageParams: [oldData.pageParams[0]],
|
|
79
|
-
pages: [oldData.pages[0]],
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
}, [queryClient, queryKey]);
|
|
84
|
-
const { data, isFetching, hasNextPage, fetchNextPage, isFetchingNextPage } = (0, react_query_1.useInfiniteQuery)({
|
|
85
|
-
queryKey: queryKey,
|
|
86
|
-
queryFn: (queryContext) => __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
var _a;
|
|
88
|
-
const params = (_a = queryContext.pageParam) !== null && _a !== void 0 ? _a : {
|
|
89
|
-
pageIndex: 0,
|
|
90
|
-
};
|
|
91
|
-
const skip = params.pageIndex * ROWS_PER_PAGE;
|
|
92
|
-
const limit = Math.min(ROWS_PER_PAGE, Math.max(0, maxRecords - skip));
|
|
93
|
-
if (limit <= 0) {
|
|
94
|
-
return {
|
|
95
|
-
params: params,
|
|
96
|
-
data: {
|
|
97
|
-
logicalName: schema.logicalName,
|
|
98
|
-
count: 0,
|
|
99
|
-
records: [],
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
const result = yield dataService.retriveRecords({
|
|
104
|
-
logicalName: schema.logicalName,
|
|
105
|
-
search,
|
|
106
|
-
columns: columns,
|
|
107
|
-
expand,
|
|
108
|
-
filter: (0, utils_1.mergeConditions)(schema, view.experience.filter, extraFilter, columnFilters, schemaStore),
|
|
109
|
-
skip,
|
|
110
|
-
limit,
|
|
111
|
-
sort: sorting,
|
|
112
|
-
});
|
|
113
|
-
return {
|
|
114
|
-
params: params,
|
|
115
|
-
data: result,
|
|
116
|
-
};
|
|
117
|
-
}),
|
|
118
|
-
getNextPageParam: (lastPage) => {
|
|
119
|
-
if (lastPage.data.count <
|
|
120
|
-
ROWS_PER_PAGE * (lastPage.params.pageIndex + 1)) {
|
|
121
|
-
return undefined;
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
pageIndex: lastPage.params.pageIndex + 1,
|
|
125
|
-
};
|
|
126
|
-
},
|
|
127
|
-
initialPageParam: {
|
|
128
|
-
pageIndex: 0,
|
|
129
|
-
},
|
|
62
|
+
disabled,
|
|
130
63
|
});
|
|
131
64
|
(0, react_1.useEffect)(() => {
|
|
132
65
|
setState({
|
|
133
|
-
fetchNextPage: fetchNextPage,
|
|
66
|
+
fetchNextPage: () => fetchNextPage,
|
|
134
67
|
});
|
|
135
68
|
}, [fetchNextPage, setState]);
|
|
136
69
|
(0, react_1.useEffect)(() => {
|
|
137
|
-
|
|
138
|
-
if (!(data === null || data === void 0 ? void 0 : data.pages.length)) {
|
|
70
|
+
if (!data) {
|
|
139
71
|
setState({
|
|
140
72
|
data: null,
|
|
141
73
|
});
|
|
142
74
|
return;
|
|
143
75
|
}
|
|
144
|
-
const
|
|
145
|
-
logicalName: (_a = data === null || data === void 0 ? void 0 : data.pages) === null || _a === void 0 ? void 0 : _a[0].data.logicalName,
|
|
146
|
-
count: (_c = (_b = data === null || data === void 0 ? void 0 : data.pages) === null || _b === void 0 ? void 0 : _b[0].data.count) !== null && _c !== void 0 ? _c : 0,
|
|
147
|
-
records: (_d = data === null || data === void 0 ? void 0 : data.pages.map((x) => x.data.records).flat()) !== null && _d !== void 0 ? _d : [],
|
|
148
|
-
};
|
|
76
|
+
const selectedIds = selectedIdsRef.current.filter((x) => data.records.some((y) => y[schema.idAttribute] === x));
|
|
149
77
|
setState({
|
|
150
|
-
data
|
|
78
|
+
data,
|
|
79
|
+
selectedIds,
|
|
151
80
|
});
|
|
152
|
-
}, [data, setState]);
|
|
81
|
+
}, [data, setState, schema.idAttribute]);
|
|
153
82
|
(0, react_1.useEffect)(() => {
|
|
154
83
|
setState({
|
|
155
84
|
dataState: {
|
|
@@ -12,7 +12,13 @@ export interface DataGridProviderProps<S extends SchemaAttributes = SchemaAttrib
|
|
|
12
12
|
commands: CommandItemExperience<CommandContext>[][];
|
|
13
13
|
onChangeView?: (viewId: string) => void;
|
|
14
14
|
isSubGrid?: boolean;
|
|
15
|
+
associated?: false | {
|
|
16
|
+
logicalName: string;
|
|
17
|
+
id: string;
|
|
18
|
+
refAttributeName: string;
|
|
19
|
+
};
|
|
15
20
|
allowViewSelection?: boolean;
|
|
16
21
|
maxRecords?: number;
|
|
22
|
+
disabled?: boolean;
|
|
17
23
|
}
|
|
18
24
|
export declare function DataGridProvider<S extends SchemaAttributes = SchemaAttributes, CommandContext extends EntityMainGridCommandContext | EntitySubGridCommandContext = EntityMainGridCommandContext>(props: PropsWithChildren<DataGridProviderProps<S, CommandContext>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,14 +10,12 @@ const context_2 = require("../context");
|
|
|
10
10
|
const DataResolver_1 = require("./DataResolver");
|
|
11
11
|
const transformViewColumns_1 = require("./transformViewColumns");
|
|
12
12
|
function DataGridProvider(props) {
|
|
13
|
-
var _a, _b, _c;
|
|
14
13
|
const onChangeViewRef = (0, react_1.useRef)(props.onChangeView);
|
|
15
14
|
onChangeViewRef.current = props.onChangeView;
|
|
16
15
|
const { schemaStore } = (0, useMetadata_1.useMetadata)();
|
|
17
16
|
const { language } = (0, useLocale_1.useLocale)();
|
|
18
17
|
const handleViewChange = (0, react_1.useCallback)((viewId) => {
|
|
19
|
-
|
|
20
|
-
(_a = onChangeViewRef.current) === null || _a === void 0 ? void 0 : _a.call(onChangeViewRef, viewId);
|
|
18
|
+
onChangeViewRef.current?.(viewId);
|
|
21
19
|
}, []);
|
|
22
20
|
const contextValue = (0, context_1.useCreateContextStore)({
|
|
23
21
|
schema: props.schema,
|
|
@@ -29,7 +27,7 @@ function DataGridProvider(props) {
|
|
|
29
27
|
},
|
|
30
28
|
searchText: '',
|
|
31
29
|
selectedIds: [],
|
|
32
|
-
sorting:
|
|
30
|
+
sorting: props.view.experience.defaultSorting ?? [],
|
|
33
31
|
view: props.view,
|
|
34
32
|
commands: props.commands,
|
|
35
33
|
columns: (0, transformViewColumns_1.transformViewColumns)(props.view.logicalName, props.view.experience.grid.columns, schemaStore, language),
|
|
@@ -42,17 +40,18 @@ function DataGridProvider(props) {
|
|
|
42
40
|
},
|
|
43
41
|
fetchNextPage: () => { },
|
|
44
42
|
onChangeView: handleViewChange,
|
|
45
|
-
isSubGrid:
|
|
46
|
-
allowViewSelection:
|
|
43
|
+
isSubGrid: props.isSubGrid ?? false,
|
|
44
|
+
allowViewSelection: props.allowViewSelection ?? false,
|
|
47
45
|
maxRecords: props.maxRecords,
|
|
46
|
+
associated: props.associated,
|
|
47
|
+
disabled: props.disabled ?? false,
|
|
48
48
|
});
|
|
49
49
|
(0, react_1.useEffect)(() => {
|
|
50
|
-
var _a;
|
|
51
50
|
contextValue.setValue({
|
|
52
51
|
view: props.view,
|
|
53
52
|
searchText: '',
|
|
54
53
|
selectedIds: [],
|
|
55
|
-
sorting:
|
|
54
|
+
sorting: props.view.experience.defaultSorting ?? [],
|
|
56
55
|
columns: (0, transformViewColumns_1.transformViewColumns)(props.view.logicalName, props.view.experience.grid.columns, schemaStore, language),
|
|
57
56
|
maxRecords: props.maxRecords,
|
|
58
57
|
});
|
|
@@ -74,5 +73,16 @@ function DataGridProvider(props) {
|
|
|
74
73
|
commands: props.commands,
|
|
75
74
|
});
|
|
76
75
|
}, [props.commands, contextValue]);
|
|
76
|
+
(0, react_1.useEffect)(() => {
|
|
77
|
+
contextValue.setValue({
|
|
78
|
+
isSubGrid: props.isSubGrid ?? false,
|
|
79
|
+
associated: props.associated,
|
|
80
|
+
});
|
|
81
|
+
}, [props.isSubGrid, props.associated, contextValue]);
|
|
82
|
+
(0, react_1.useEffect)(() => {
|
|
83
|
+
contextValue.setValue({
|
|
84
|
+
disabled: props.disabled ?? false,
|
|
85
|
+
});
|
|
86
|
+
}, [props.disabled, contextValue]);
|
|
77
87
|
return ((0, jsx_runtime_1.jsxs)(context_2.GridContext.Provider, { value: contextValue, children: [(0, jsx_runtime_1.jsx)(DataResolver_1.DataResolver, {}), props.children] }));
|
|
78
88
|
}
|
|
@@ -21,9 +21,17 @@ function transformViewColumns(logicalName, columns, schemaStore, language) {
|
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
23
|
const lookupLabel = (0, utils_1.localizedLabel)(language, lookupAttribute);
|
|
24
|
-
return
|
|
24
|
+
return {
|
|
25
|
+
...column,
|
|
26
|
+
id: `${column.name}.${column.expandedKey}`,
|
|
27
|
+
label: `${lookupLabel} (${label})`,
|
|
28
|
+
};
|
|
25
29
|
}
|
|
26
|
-
return
|
|
30
|
+
return {
|
|
31
|
+
...column,
|
|
32
|
+
id: column.name,
|
|
33
|
+
label: label,
|
|
34
|
+
};
|
|
27
35
|
})
|
|
28
36
|
.filter(Boolean);
|
|
29
37
|
}
|
|
@@ -75,17 +75,17 @@ function transformColumnFilter(filter, schema, schemaStore) {
|
|
|
75
75
|
return transformedResult;
|
|
76
76
|
}
|
|
77
77
|
function mergeConditions(schema, filter, extraFilter, columnFilters, schemaStore) {
|
|
78
|
-
const
|
|
78
|
+
const filters = [];
|
|
79
79
|
if (filter) {
|
|
80
|
-
|
|
80
|
+
filters.push(filter);
|
|
81
81
|
}
|
|
82
82
|
if (extraFilter) {
|
|
83
|
-
|
|
83
|
+
filters.push(extraFilter);
|
|
84
84
|
}
|
|
85
85
|
if (columnFilters) {
|
|
86
86
|
const transformedColumnFilters = transformColumnFilter(columnFilters, schema, schemaStore);
|
|
87
87
|
if (transformedColumnFilters) {
|
|
88
|
-
|
|
88
|
+
filters.push({
|
|
89
89
|
type: 'and',
|
|
90
90
|
conditions: Object.entries(transformedColumnFilters).map(([field, condition]) => {
|
|
91
91
|
return {
|
|
@@ -98,15 +98,15 @@ function mergeConditions(schema, filter, extraFilter, columnFilters, schemaStore
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
if (
|
|
101
|
+
if (filters.length === 0) {
|
|
102
102
|
return null;
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
return
|
|
104
|
+
if (filters.length === 1) {
|
|
105
|
+
return filters[0];
|
|
106
106
|
}
|
|
107
107
|
return {
|
|
108
108
|
type: 'and',
|
|
109
|
-
|
|
109
|
+
filters: filters,
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
function collectExpandedKeys(columns) {
|
|
@@ -463,8 +463,42 @@ const booleanOperatorOptions = [
|
|
|
463
463
|
controls: [],
|
|
464
464
|
},
|
|
465
465
|
];
|
|
466
|
-
const idOperatorOptions = [
|
|
467
|
-
|
|
466
|
+
const idOperatorOptions = [
|
|
467
|
+
{
|
|
468
|
+
value: 'not-null',
|
|
469
|
+
labelKey: 'containsData',
|
|
470
|
+
controls: [],
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
value: 'null',
|
|
474
|
+
labelKey: 'doesNotContainData',
|
|
475
|
+
controls: [],
|
|
476
|
+
},
|
|
477
|
+
];
|
|
478
|
+
const attachmentOperatorOptions = [
|
|
479
|
+
{
|
|
480
|
+
value: 'not-null',
|
|
481
|
+
labelKey: 'containsData',
|
|
482
|
+
controls: [],
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
value: 'null',
|
|
486
|
+
labelKey: 'doesNotContainData',
|
|
487
|
+
controls: [],
|
|
488
|
+
},
|
|
489
|
+
];
|
|
490
|
+
const mixedOperatorOptions = [
|
|
491
|
+
{
|
|
492
|
+
value: 'not-null',
|
|
493
|
+
labelKey: 'containsData',
|
|
494
|
+
controls: [],
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
value: 'null',
|
|
498
|
+
labelKey: 'doesNotContainData',
|
|
499
|
+
controls: [],
|
|
500
|
+
},
|
|
501
|
+
];
|
|
468
502
|
exports.operatorOptions = {
|
|
469
503
|
id: idOperatorOptions,
|
|
470
504
|
boolean: booleanOperatorOptions,
|
|
@@ -476,7 +510,8 @@ exports.operatorOptions = {
|
|
|
476
510
|
number: numberOperatorOptions,
|
|
477
511
|
string: stringOperatorOptions,
|
|
478
512
|
attachment: attachmentOperatorOptions,
|
|
479
|
-
|
|
513
|
+
attachments: [],
|
|
514
|
+
mixed: mixedOperatorOptions,
|
|
480
515
|
daterange: [],
|
|
481
516
|
lookups: [],
|
|
482
517
|
};
|
|
@@ -3,6 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getLocalizedOperatorOptions = void 0;
|
|
4
4
|
const constants_1 = require("./constants");
|
|
5
5
|
const getLocalizedOperatorOptions = (strings) => {
|
|
6
|
-
return Object.entries(constants_1.operatorOptions).reduce((acc, [key, value]) => (
|
|
6
|
+
return Object.entries(constants_1.operatorOptions).reduce((acc, [key, value]) => ({
|
|
7
|
+
...acc,
|
|
8
|
+
[key]: value.map((option) => ({
|
|
9
|
+
...option,
|
|
10
|
+
label: strings[option.labelKey],
|
|
11
|
+
})),
|
|
12
|
+
}), {});
|
|
7
13
|
};
|
|
8
14
|
exports.getLocalizedOperatorOptions = getLocalizedOperatorOptions;
|
package/datagrid/context.d.ts
CHANGED
|
@@ -13,6 +13,12 @@ export interface GridContextState<S extends SchemaAttributes = SchemaAttributes,
|
|
|
13
13
|
extraFilter?: Filter;
|
|
14
14
|
commands?: CommandItemExperience<CommandContext>[][];
|
|
15
15
|
maxRecords?: number;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
associated?: false | {
|
|
18
|
+
logicalName: string;
|
|
19
|
+
id: string;
|
|
20
|
+
refAttributeName: string;
|
|
21
|
+
};
|
|
16
22
|
columns: TransformedViewColumn<S>[];
|
|
17
23
|
searchText: string;
|
|
18
24
|
columnFilters: Partial<Record<keyof S, ColumnCondition>>;
|
|
@@ -7,6 +7,6 @@ const context_2 = require("../context");
|
|
|
7
7
|
function useChangeView() {
|
|
8
8
|
const onChangeView = (0, context_1.useContextSelector)(context_2.GridContext, (state) => state.onChangeView);
|
|
9
9
|
return (0, react_1.useCallback)((viewId) => {
|
|
10
|
-
onChangeView
|
|
10
|
+
onChangeView?.(viewId);
|
|
11
11
|
}, [onChangeView]);
|
|
12
12
|
}
|
|
@@ -9,7 +9,10 @@ function useGridColumnFilter() {
|
|
|
9
9
|
const setValue = (0, context_1.useContextSetValue)(context_2.GridContext);
|
|
10
10
|
const setColumnFilter = (0, react_1.useCallback)((columnName, value) => {
|
|
11
11
|
setValue((state) => ({
|
|
12
|
-
columnFilters:
|
|
12
|
+
columnFilters: {
|
|
13
|
+
...state.columnFilters,
|
|
14
|
+
[columnName]: value,
|
|
15
|
+
},
|
|
13
16
|
}));
|
|
14
17
|
}, [setValue]);
|
|
15
18
|
return [columnFilters, setColumnFilter];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useGridDisabled(): boolean | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGridDisabled = useGridDisabled;
|
|
4
|
+
const mutable_1 = require("../../mutable");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
function useGridDisabled() {
|
|
7
|
+
return (0, mutable_1.useContextSelector)(context_1.GridContext, (state) => state.disabled);
|
|
8
|
+
}
|
|
@@ -61,10 +61,9 @@ function useGridControlContext() {
|
|
|
61
61
|
return obj;
|
|
62
62
|
}, [selectedIds]);
|
|
63
63
|
const selectedRecords = (0, react_1.useMemo)(() => {
|
|
64
|
-
|
|
65
|
-
return ((_a = data === null || data === void 0 ? void 0 : data.records) !== null && _a !== void 0 ? _a : []).filter((record) => selectedIdsObj[record[schema.idAttribute]]);
|
|
64
|
+
return (data?.records ?? []).filter((record) => selectedIdsObj[record[schema.idAttribute]]);
|
|
66
65
|
}, [data, schema, selectedIdsObj]);
|
|
67
|
-
return {
|
|
66
|
+
return (0, react_1.useMemo)(() => ({
|
|
68
67
|
data,
|
|
69
68
|
logicalName: schema.logicalName,
|
|
70
69
|
schema,
|
|
@@ -79,19 +78,34 @@ function useGridControlContext() {
|
|
|
79
78
|
openRecord,
|
|
80
79
|
gridColumns,
|
|
81
80
|
sorting,
|
|
82
|
-
}
|
|
81
|
+
}), [
|
|
82
|
+
columnFilter,
|
|
83
|
+
data,
|
|
84
|
+
extraFilter,
|
|
85
|
+
gridColumns,
|
|
86
|
+
openRecord,
|
|
87
|
+
refresh,
|
|
88
|
+
schema,
|
|
89
|
+
searchText,
|
|
90
|
+
selectedIds,
|
|
91
|
+
selectedRecords,
|
|
92
|
+
sorting,
|
|
93
|
+
view,
|
|
94
|
+
]);
|
|
83
95
|
}
|
|
84
96
|
function useMainGridCommandHandlerContext() {
|
|
85
97
|
const baseHandlerContext = (0, command_1.useBaseCommandHandlerContext)();
|
|
86
98
|
const primaryControl = useGridControlContext();
|
|
87
|
-
return
|
|
99
|
+
return (0, react_1.useMemo)(() => ({
|
|
100
|
+
...baseHandlerContext,
|
|
101
|
+
primaryControl,
|
|
102
|
+
}), [baseHandlerContext, primaryControl]);
|
|
88
103
|
}
|
|
89
104
|
const emptyCommands = [];
|
|
90
105
|
function useGridCommands() {
|
|
91
|
-
var _a;
|
|
92
106
|
const commands = (0, mutable_1.useContextSelector)(context_1.GridContext, (state) => state.commands);
|
|
93
|
-
const {
|
|
94
|
-
return
|
|
107
|
+
const { appExperience: { viewCommands: defaultCommands }, } = (0, app_1.useAppContext)();
|
|
108
|
+
return commands ?? defaultCommands ?? emptyCommands;
|
|
95
109
|
}
|
|
96
110
|
function useMainGridCommands() {
|
|
97
111
|
const commands = useGridCommands();
|
|
@@ -101,5 +115,5 @@ function useMainGridCommands() {
|
|
|
101
115
|
function useMainGridContextCommands() {
|
|
102
116
|
const commands = useGridCommands();
|
|
103
117
|
const handlerContext = useMainGridCommandHandlerContext();
|
|
104
|
-
return (0, command_1.useCommands)(commands, handlerContext, (command) =>
|
|
118
|
+
return (0, command_1.useCommands)(commands, handlerContext, (command) => ('isContextMenu' in command && command.isContextMenu) ?? false);
|
|
105
119
|
}
|
|
@@ -16,13 +16,13 @@ function useOpenRecord() {
|
|
|
16
16
|
const dataRef = (0, react_1.useRef)(data);
|
|
17
17
|
dataRef.current = data;
|
|
18
18
|
return (0, react_1.useCallback)((id) => {
|
|
19
|
-
var _a, _b;
|
|
20
19
|
const path = routeResolver({
|
|
21
20
|
logicalName: schema.logicalName,
|
|
22
21
|
type: app_1.PageType.EntityForm,
|
|
23
22
|
id,
|
|
24
23
|
});
|
|
25
|
-
recordSetSetter(schema.logicalName,
|
|
24
|
+
recordSetSetter(schema.logicalName, dataRef.current?.records.map((x) => x[schema.idAttribute]) ??
|
|
25
|
+
[]);
|
|
26
26
|
router.push(path);
|
|
27
27
|
}, [
|
|
28
28
|
recordSetSetter,
|
|
@@ -4,61 +4,39 @@ exports.useSubGridCommandHandlerContext = useSubGridCommandHandlerContext;
|
|
|
4
4
|
exports.useSubGridCommands = useSubGridCommands;
|
|
5
5
|
exports.useSubGridContextCommands = useSubGridContextCommands;
|
|
6
6
|
const app_1 = require("@headless-adminapp/app/app");
|
|
7
|
+
const dataform_1 = require("@headless-adminapp/app/dataform");
|
|
7
8
|
const mutable_1 = require("@headless-adminapp/app/mutable");
|
|
8
|
-
const react_1 = require("react");
|
|
9
9
|
const command_1 = require("../../command");
|
|
10
10
|
const useMainFormCommands_1 = require("../../dataform/hooks/useMainFormCommands");
|
|
11
11
|
const context_1 = require("../context");
|
|
12
|
-
const
|
|
13
|
-
const useGridData_1 = require("./useGridData");
|
|
14
|
-
const useGridExtraFilter_1 = require("./useGridExtraFilter");
|
|
15
|
-
const useGridRefresh_1 = require("./useGridRefresh");
|
|
16
|
-
const useGridSchema_1 = require("./useGridSchema");
|
|
17
|
-
const useGridSelection_1 = require("./useGridSelection");
|
|
18
|
-
const useSearchText_1 = require("./useSearchText");
|
|
19
|
-
const useSelectedView_1 = require("./useSelectedView");
|
|
12
|
+
const useMainGridCommands_1 = require("./useMainGridCommands");
|
|
20
13
|
function useSubGridCommandHandlerContext() {
|
|
21
14
|
const baseHandlerContext = (0, command_1.useBaseCommandHandlerContext)();
|
|
22
|
-
const data = (0, useGridData_1.useGridData)();
|
|
23
|
-
const schema = (0, useGridSchema_1.useDataGridSchema)();
|
|
24
|
-
const view = (0, useSelectedView_1.useSelectedView)();
|
|
25
|
-
const [searchText] = (0, useSearchText_1.useSearchText)();
|
|
26
|
-
const [selectedIds] = (0, useGridSelection_1.useGridSelection)();
|
|
27
|
-
const selectedIdsObj = (0, react_1.useMemo)(() => {
|
|
28
|
-
const obj = {};
|
|
29
|
-
selectedIds.forEach((id) => {
|
|
30
|
-
obj[id] = true;
|
|
31
|
-
});
|
|
32
|
-
return obj;
|
|
33
|
-
}, [selectedIds]);
|
|
34
|
-
const selectedRecords = (0, react_1.useMemo)(() => {
|
|
35
|
-
var _a;
|
|
36
|
-
return ((_a = data === null || data === void 0 ? void 0 : data.records) !== null && _a !== void 0 ? _a : []).filter((record) => selectedIdsObj[record[schema.idAttribute]]);
|
|
37
|
-
}, [data, schema, selectedIdsObj]);
|
|
38
|
-
const [columnFilter] = (0, useGridColumnFilter_1.useGridColumnFilter)();
|
|
39
|
-
const extraFilter = (0, useGridExtraFilter_1.useGridExtraFilter)();
|
|
40
|
-
const refresh = (0, useGridRefresh_1.useGridRefresh)();
|
|
41
15
|
const mainFormHandlerContext = (0, useMainFormCommands_1.useMainFormCommandHandlerContext)();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
16
|
+
const gridControl = (0, useMainGridCommands_1.useGridControlContext)();
|
|
17
|
+
const associated = (0, mutable_1.useContextSelector)(context_1.GridContext, (state) => state.associated);
|
|
18
|
+
const [recordTitle] = (0, dataform_1.useRecordTitle)();
|
|
19
|
+
return {
|
|
20
|
+
...baseHandlerContext,
|
|
21
|
+
primaryControl: mainFormHandlerContext.primaryControl,
|
|
22
|
+
secondaryControl: {
|
|
23
|
+
...gridControl,
|
|
24
|
+
associated: !associated
|
|
25
|
+
? false
|
|
26
|
+
: {
|
|
27
|
+
id: associated.id,
|
|
28
|
+
logicalName: associated.logicalName,
|
|
29
|
+
name: recordTitle,
|
|
30
|
+
refAttributeName: associated.refAttributeName,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
55
34
|
}
|
|
56
35
|
const emptyCommands = [];
|
|
57
36
|
function useGridCommands() {
|
|
58
|
-
var _a;
|
|
59
37
|
const commands = (0, mutable_1.useContextSelector)(context_1.GridContext, (state) => state.commands);
|
|
60
|
-
const {
|
|
61
|
-
return
|
|
38
|
+
const { appExperience: { subgridCommands: defaultCommands }, } = (0, app_1.useAppContext)();
|
|
39
|
+
return commands ?? defaultCommands ?? emptyCommands;
|
|
62
40
|
}
|
|
63
41
|
function useSubGridCommands() {
|
|
64
42
|
const commands = useGridCommands();
|
|
@@ -68,5 +46,5 @@ function useSubGridCommands() {
|
|
|
68
46
|
function useSubGridContextCommands() {
|
|
69
47
|
const commands = useGridCommands();
|
|
70
48
|
const handlerContext = useSubGridCommandHandlerContext();
|
|
71
|
-
return (0, command_1.useCommands)(commands, handlerContext, (command) =>
|
|
49
|
+
return (0, command_1.useCommands)(commands, handlerContext, (command) => ('isContextMenu' in command && command.isContextMenu) ?? false);
|
|
72
50
|
}
|
package/defaults.d.ts
ADDED