@headless-adminapp/app 0.0.17-alpha.53 → 0.0.17-alpha.55
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.js +24 -32
- package/app/AuthWrapper.js +13 -9
- package/app/LayoutProvider.js +34 -39
- package/app/context.js +5 -2
- package/app/hooks/index.js +17 -1
- package/app/hooks/useAppContext.js +7 -4
- package/app/index.js +11 -4
- package/auth/AuthProvider.js +27 -36
- package/auth/context.d.ts +1 -1
- package/auth/context.js +5 -2
- package/auth/hooks/index.js +18 -2
- package/auth/hooks/useAuthSession.js +7 -4
- package/auth/hooks/useIsSkipAuthCheck.js +7 -4
- package/auth/hooks/useLogout.js +11 -8
- package/auth/index.js +23 -4
- package/auth/types.js +2 -1
- package/board/BoardColumnDataResolver.js +23 -20
- package/board/BoardColumnProvider.js +14 -10
- package/board/context.d.ts +2 -2
- package/board/context.js +6 -3
- package/board/hooks/index.js +15 -6
- package/board/hooks/useBoardColumnConfig.js +7 -4
- package/board/hooks/useBoardColumnData.d.ts +3 -1
- package/board/hooks/useBoardColumnData.js +7 -4
- package/board/hooks/useBoardColumnDataState.js +7 -4
- package/board/hooks/useBoardConfig.js +7 -4
- package/board/hooks/useBoardSchema.js +6 -3
- package/board/hooks/useSearchText.js +10 -7
- package/board/types.js +2 -1
- package/board/utils.js +4 -1
- package/builders/CommandBuilder/CommandBuilder.js +13 -10
- package/builders/CommandBuilder/DefaultCommandBuilder.js +30 -23
- package/builders/CommandBuilder/FormCommandBuilder.js +29 -38
- package/builders/CommandBuilder/SubgridCommandBuilder.js +27 -36
- package/builders/CommandBuilder/ViewCommandBuilder.js +29 -38
- package/builders/CommandBuilder/index.js +5 -1
- package/builders/CommandBuilder/utils.js +7 -3
- package/builders/SchemaExperienceBuilder.js +55 -31
- package/builders/index.js +7 -2
- package/builders/utils.js +59 -44
- package/command/hooks/index.js +18 -2
- package/command/hooks/useBaseCommandHandlerContext.js +29 -25
- package/command/hooks/useCommands.js +9 -6
- package/command/index.js +18 -2
- package/command/types.js +2 -1
- package/command/utils/index.js +41 -13
- package/components/ScrollView/index.d.ts +1 -1
- package/components/ScrollView/index.js +11 -4
- package/components/ScrollbarWithMoreDataRequest/index.js +14 -11
- package/dataform/DataFormProvider/DataResolver.js +81 -89
- package/dataform/DataFormProvider/InitialValueResolver.js +22 -20
- package/dataform/DataFormProvider/ReadonlyInfoResolver.js +14 -12
- package/dataform/DataFormProvider/index.js +26 -32
- package/dataform/context.js +5 -2
- package/dataform/hooks/index.js +29 -13
- package/dataform/hooks/useFormInstance.js +6 -3
- package/dataform/hooks/useFormIsDirty.js +6 -3
- package/dataform/hooks/useFormIsReadonly.js +7 -4
- package/dataform/hooks/useFormNotifications.js +12 -9
- package/dataform/hooks/useFormRecord.js +7 -4
- package/dataform/hooks/useFormSave.js +40 -46
- package/dataform/hooks/useFormSchema.js +7 -4
- package/dataform/hooks/useLoadFormGridPage.js +19 -25
- package/dataform/hooks/useMainFormCommands.js +37 -30
- package/dataform/hooks/useProcessFlowSteps.js +27 -23
- package/dataform/hooks/useRecordId.js +7 -4
- package/dataform/hooks/useRecordTitle.js +12 -9
- package/dataform/hooks/useSelectedForm.js +7 -4
- package/dataform/index.js +23 -4
- package/dataform/utils/defaultParameters.js +16 -6
- package/dataform/utils/index.js +90 -56
- package/dataform/utils/saveRecord.js +99 -104
- package/datagrid/DataGridProvider/DataResolver.js +36 -34
- package/datagrid/DataGridProvider/index.js +31 -32
- package/datagrid/DataGridProvider/transformViewColumns.js +17 -6
- package/datagrid/DataGridProvider/utils.js +13 -5
- package/datagrid/column-filter/constants.js +5 -2
- package/datagrid/column-filter/index.js +7 -2
- package/datagrid/column-filter/types.js +2 -1
- package/datagrid/column-filter/utils.js +13 -3
- package/datagrid/context.d.ts +1 -1
- package/datagrid/context.js +5 -2
- package/datagrid/hooks/index.js +36 -20
- package/datagrid/hooks/useChangeView.js +10 -7
- package/datagrid/hooks/useGridColumnFilter.js +14 -8
- package/datagrid/hooks/useGridColumns.js +7 -4
- package/datagrid/hooks/useGridCommands.js +7 -4
- package/datagrid/hooks/useGridData.js +7 -4
- package/datagrid/hooks/useGridDataState.js +7 -4
- package/datagrid/hooks/useGridExtraFilter.js +7 -4
- package/datagrid/hooks/useGridOptions.js +4 -1
- package/datagrid/hooks/useGridPagination.js +4 -1
- package/datagrid/hooks/useGridRefresh.js +10 -7
- package/datagrid/hooks/useGridSchema.js +7 -4
- package/datagrid/hooks/useGridSelection.js +10 -7
- package/datagrid/hooks/useGridSorting.js +10 -7
- package/datagrid/hooks/useGridViewLookupData.js +7 -4
- package/datagrid/hooks/useLoadMainGridPage.js +12 -9
- package/datagrid/hooks/useMainGridCommands.js +62 -54
- package/datagrid/hooks/useMaxRecords.js +7 -4
- package/datagrid/hooks/useOpenRecord.js +20 -17
- package/datagrid/hooks/useSearchText.js +10 -7
- package/datagrid/hooks/useSelectedView.js +7 -4
- package/datagrid/hooks/useSubGridCommands.js +34 -23
- package/datagrid/index.js +27 -5
- package/defaults.js +5 -2
- package/dialog/DialogProvider.js +10 -6
- package/dialog/context.d.ts +1 -1
- package/dialog/context.js +5 -2
- package/dialog/hooks/index.js +24 -8
- package/dialog/hooks/useCloseDialog.js +10 -7
- package/dialog/hooks/useDialogItem.d.ts +1 -1
- package/dialog/hooks/useDialogItem.js +7 -4
- package/dialog/hooks/useDialogItems.d.ts +1 -1
- package/dialog/hooks/useDialogItems.js +7 -4
- package/dialog/hooks/useOpenAlertDialog.js +16 -8
- package/dialog/hooks/useOpenConfirmDialog.js +18 -9
- package/dialog/hooks/useOpenDialog.js +18 -11
- package/dialog/hooks/useOpenErrorDialog.js +16 -8
- package/dialog/hooks/useOpenPromptDialog.js +18 -9
- package/dialog/index.js +22 -3
- package/form/FormValidationStringContext.js +9 -5
- package/form/index.js +7 -1
- package/hooks/index.js +24 -6
- package/hooks/useDebouncedValue.js +11 -8
- package/hooks/useElementLayout.js +7 -4
- package/hooks/useIsMobile.js +12 -6
- package/hooks/useItemsWithKey.js +8 -5
- package/hooks/useStorageState.js +7 -5
- package/hooks/useSystemColorScheme.js +7 -4
- package/insights/InsightsProvider.js +13 -10
- package/insights/context.d.ts +1 -1
- package/insights/context.js +5 -2
- package/insights/hooks/index.js +7 -4
- package/insights/index.js +20 -2
- package/locale/LocaleProvider.js +12 -8
- package/locale/context.js +5 -2
- package/locale/index.js +23 -4
- package/locale/useCurrencySymbol.js +10 -8
- package/locale/useLocale.js +7 -4
- package/locale/utils.js +8 -3
- package/metadata/MetadataProvider.js +21 -17
- package/metadata/context.d.ts +1 -1
- package/metadata/context.js +5 -2
- package/metadata/hooks/index.js +24 -8
- package/metadata/hooks/useAppStore.js +7 -4
- package/metadata/hooks/useExperienceStore.js +7 -4
- package/metadata/hooks/useExperienceView.js +11 -17
- package/metadata/hooks/useExperienceViewCommands.js +14 -20
- package/metadata/hooks/useExperienceViewLookup.js +10 -16
- package/metadata/hooks/useExperienceViewSubgridCommands.js +14 -20
- package/metadata/hooks/useMetadata.js +11 -8
- package/metadata/hooks/useSchema.js +6 -3
- package/metadata/index.js +22 -3
- package/mutable/context.js +25 -17
- package/mutable/index.js +27 -3
- package/mutable/state.js +10 -6
- package/mutable/type.js +2 -1
- package/mutable/utils.js +12 -8
- package/navigation/hooks/index.js +17 -1
- package/navigation/hooks/useOpenForm.js +14 -11
- package/navigation/index.js +17 -1
- package/package.json +4 -12
- package/progress-indicator/ProgressIndicatorProvider.js +16 -12
- package/progress-indicator/context.js +5 -2
- package/progress-indicator/hooks/index.js +17 -1
- package/progress-indicator/hooks/useProgressIndicator.d.ts +1 -1
- package/progress-indicator/hooks/useProgressIndicator.js +7 -4
- package/progress-indicator/index.js +22 -3
- package/providers/PageEntityFormProvider/index.js +7 -4
- package/providers/PageEntityViewProvider/index.js +7 -4
- package/recordset/RecordSetProvider.js +16 -12
- package/recordset/context.d.ts +1 -1
- package/recordset/context.js +5 -2
- package/recordset/hooks/index.js +19 -3
- package/recordset/hooks/useRecordSetResult.js +22 -29
- package/recordset/hooks/useRecordSetSetter.js +9 -6
- package/recordset/hooks/useRecordSetVisibility.js +10 -7
- package/recordset/index.js +22 -3
- package/route/RouteProvider.js +18 -14
- package/route/context.js +9 -6
- package/route/hooks/index.js +22 -6
- package/route/hooks/useBasePath.js +7 -4
- package/route/hooks/useIsRouteActive.js +7 -4
- package/route/hooks/usePathname.js +7 -4
- package/route/hooks/useRouteResolver.js +7 -4
- package/route/hooks/useRouter.js +7 -4
- package/route/hooks/useSearchParams.js +7 -4
- package/route/index.js +20 -2
- package/route/types.js +2 -1
- package/store/ClientAppStore.js +12 -21
- package/store/ComponentStore.js +6 -4
- package/store/EventManager.js +20 -32
- package/store/SchemaExperienceStore.js +186 -217
- package/store/index.js +20 -4
- package/toast-notification/ToastNotificationProvider.js +10 -6
- package/toast-notification/context.d.ts +1 -1
- package/toast-notification/context.js +5 -2
- package/toast-notification/hooks/index.js +19 -3
- package/toast-notification/hooks/useCloseToastNotification.js +10 -7
- package/toast-notification/hooks/useOpenToastNotification.js +18 -11
- package/toast-notification/hooks/useToastNotificationItems.d.ts +1 -1
- package/toast-notification/hooks/useToastNotificationItems.js +7 -4
- package/toast-notification/index.js +22 -3
- package/transport/InMemoryDataService/index.js +59 -78
- package/transport/RestDataService/index.d.ts +2 -2
- package/transport/RestDataService/index.js +72 -91
- package/transport/context.js +9 -15
- package/transport/hooks/index.js +18 -2
- package/transport/hooks/useDataService.js +7 -4
- package/transport/hooks/useFileService.js +7 -4
- package/transport/hooks/useRetriveRecords.d.ts +1 -1
- package/transport/hooks/useRetriveRecords.js +25 -31
- package/transport/index.js +20 -2
- package/utils/calculateColumnWidths.js +5 -2
- package/utils/color.js +4 -1
- package/utils/getAttributeFormattedValue.js +38 -40
- package/utils/index.js +18 -2
- package/widget/context.js +5 -2
- package/widget/hooks/index.js +7 -4
- package/widget/index.js +5 -1
package/metadata/context.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetadataContext = void 0;
|
|
4
|
+
const context_1 = require("../mutable/context");
|
|
5
|
+
exports.MetadataContext = (0, context_1.createContext)();
|
package/metadata/hooks/index.js
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useAppStore"), exports);
|
|
18
|
+
__exportStar(require("./useExperienceStore"), exports);
|
|
19
|
+
__exportStar(require("./useExperienceView"), exports);
|
|
20
|
+
__exportStar(require("./useExperienceViewCommands"), exports);
|
|
21
|
+
__exportStar(require("./useExperienceViewLookup"), exports);
|
|
22
|
+
__exportStar(require("./useExperienceViewSubgridCommands"), exports);
|
|
23
|
+
__exportStar(require("./useMetadata"), exports);
|
|
24
|
+
__exportStar(require("./useSchema"), exports);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAppStore = useAppStore;
|
|
4
|
+
const context_1 = require("../../mutable/context");
|
|
5
|
+
const context_2 = require("../context");
|
|
6
|
+
function useAppStore() {
|
|
7
|
+
return (0, context_1.useContextSelector)(context_2.MetadataContext, (state) => state.appStore);
|
|
5
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExperienceStore = useExperienceStore;
|
|
4
|
+
const context_1 = require("../../mutable/context");
|
|
5
|
+
const context_2 = require("../context");
|
|
6
|
+
function useExperienceStore() {
|
|
7
|
+
return (0, context_1.useContextSelector)(context_2.MetadataContext, (state) => state.experienceStore);
|
|
5
8
|
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})
|
|
9
|
-
};
|
|
10
|
-
import { keepPreviousData, useQuery } from '@tanstack/react-query';
|
|
11
|
-
import { useExperienceStore } from './useExperienceStore';
|
|
12
|
-
export function useExperienceView(logicalName, viewId, associated, viewIds) {
|
|
13
|
-
const experienceStore = useExperienceStore();
|
|
14
|
-
const { data, isPending } = useQuery({
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExperienceView = useExperienceView;
|
|
4
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
const useExperienceStore_1 = require("./useExperienceStore");
|
|
6
|
+
function useExperienceView(logicalName, viewId, associated, viewIds) {
|
|
7
|
+
const experienceStore = (0, useExperienceStore_1.useExperienceStore)();
|
|
8
|
+
const { data, isPending } = (0, react_query_1.useQuery)({
|
|
15
9
|
queryKey: [
|
|
16
10
|
'experience-schema-view',
|
|
17
11
|
logicalName,
|
|
@@ -19,13 +13,13 @@ export function useExperienceView(logicalName, viewId, associated, viewIds) {
|
|
|
19
13
|
associated,
|
|
20
14
|
viewIds,
|
|
21
15
|
],
|
|
22
|
-
queryFn: () =>
|
|
16
|
+
queryFn: async () => {
|
|
23
17
|
if (associated) {
|
|
24
18
|
return experienceStore.getAssociatedView(logicalName, viewId, viewIds);
|
|
25
19
|
}
|
|
26
20
|
return experienceStore.getPublicView(logicalName, viewId, viewIds);
|
|
27
|
-
}
|
|
28
|
-
placeholderData: keepPreviousData,
|
|
21
|
+
},
|
|
22
|
+
placeholderData: react_query_1.keepPreviousData,
|
|
29
23
|
});
|
|
30
24
|
return {
|
|
31
25
|
view: data,
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { useAppContext } from '@headless-adminapp/app/app';
|
|
11
|
-
import { useQuery } from '@tanstack/react-query';
|
|
12
|
-
import { useExperienceStore } from './useExperienceStore';
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExperienceViewCommands = useExperienceViewCommands;
|
|
4
|
+
const app_1 = require("@headless-adminapp/app/app");
|
|
5
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
6
|
+
const useExperienceStore_1 = require("./useExperienceStore");
|
|
13
7
|
/** @todo move in different dir */
|
|
14
|
-
|
|
15
|
-
const experienceStore = useExperienceStore();
|
|
16
|
-
const { app: { viewCommands }, } = useAppContext();
|
|
17
|
-
const { data: commands } = useQuery({
|
|
8
|
+
function useExperienceViewCommands(logicalName) {
|
|
9
|
+
const experienceStore = (0, useExperienceStore_1.useExperienceStore)();
|
|
10
|
+
const { app: { viewCommands }, } = (0, app_1.useAppContext)();
|
|
11
|
+
const { data: commands } = (0, react_query_1.useQuery)({
|
|
18
12
|
queryKey: ['experience-schema-view-commands', logicalName],
|
|
19
|
-
queryFn: () =>
|
|
20
|
-
let commands =
|
|
13
|
+
queryFn: async () => {
|
|
14
|
+
let commands = await experienceStore.getViewCommands(logicalName);
|
|
21
15
|
if (!commands) {
|
|
22
16
|
commands = viewCommands;
|
|
23
17
|
}
|
|
24
|
-
return commands
|
|
25
|
-
}
|
|
18
|
+
return commands ?? [];
|
|
19
|
+
},
|
|
26
20
|
initialData: [],
|
|
27
21
|
});
|
|
28
22
|
return {
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { useQuery } from '@tanstack/react-query';
|
|
11
|
-
import { useExperienceStore } from './useExperienceStore';
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExperienceViewLookup = useExperienceViewLookup;
|
|
4
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
const useExperienceStore_1 = require("./useExperienceStore");
|
|
12
6
|
/** @todo move in different dir */
|
|
13
|
-
|
|
14
|
-
const experienceStore = useExperienceStore();
|
|
15
|
-
const { data: viewLookup } = useQuery({
|
|
7
|
+
function useExperienceViewLookup(logicalName, associated, viewIds) {
|
|
8
|
+
const experienceStore = (0, useExperienceStore_1.useExperienceStore)();
|
|
9
|
+
const { data: viewLookup } = (0, react_query_1.useQuery)({
|
|
16
10
|
queryKey: [
|
|
17
11
|
'experience-schema-view-lookup',
|
|
18
12
|
logicalName,
|
|
19
13
|
associated,
|
|
20
14
|
viewIds,
|
|
21
15
|
],
|
|
22
|
-
queryFn: () =>
|
|
16
|
+
queryFn: async () => {
|
|
23
17
|
if (associated) {
|
|
24
18
|
return experienceStore.getAssociatedViewLookup(logicalName, viewIds);
|
|
25
19
|
}
|
|
26
20
|
return experienceStore.getPublicViewLookup(logicalName, viewIds);
|
|
27
|
-
}
|
|
21
|
+
},
|
|
28
22
|
initialData: [],
|
|
29
23
|
});
|
|
30
24
|
return {
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { useAppContext } from '@headless-adminapp/app/app';
|
|
11
|
-
import { useQuery } from '@tanstack/react-query';
|
|
12
|
-
import { useExperienceStore } from './useExperienceStore';
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExperienceViewSubgridCommands = useExperienceViewSubgridCommands;
|
|
4
|
+
const app_1 = require("@headless-adminapp/app/app");
|
|
5
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
6
|
+
const useExperienceStore_1 = require("./useExperienceStore");
|
|
13
7
|
/** @todo move in different dir */
|
|
14
|
-
|
|
15
|
-
const experienceStore = useExperienceStore();
|
|
16
|
-
const { app: { subgridCommands }, } = useAppContext();
|
|
17
|
-
const { data: commands } = useQuery({
|
|
8
|
+
function useExperienceViewSubgridCommands(logicalName) {
|
|
9
|
+
const experienceStore = (0, useExperienceStore_1.useExperienceStore)();
|
|
10
|
+
const { app: { subgridCommands }, } = (0, app_1.useAppContext)();
|
|
11
|
+
const { data: commands } = (0, react_query_1.useQuery)({
|
|
18
12
|
queryKey: ['experience-schema-view-subgrid-commands', logicalName],
|
|
19
|
-
queryFn: () =>
|
|
20
|
-
let commands =
|
|
13
|
+
queryFn: async () => {
|
|
14
|
+
let commands = await experienceStore.getSubgridCommands(logicalName);
|
|
21
15
|
if (!commands) {
|
|
22
16
|
commands = subgridCommands;
|
|
23
17
|
}
|
|
24
|
-
return commands
|
|
25
|
-
}
|
|
18
|
+
return commands ?? [];
|
|
19
|
+
},
|
|
26
20
|
initialData: [],
|
|
27
21
|
});
|
|
28
22
|
return {
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMetadata = useMetadata;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const context_1 = require("../../mutable/context");
|
|
6
|
+
const context_2 = require("../context");
|
|
7
|
+
function useMetadata() {
|
|
8
|
+
const schemaStore = (0, context_1.useContextSelector)(context_2.MetadataContext, (state) => state.schemaStore);
|
|
9
|
+
const appStore = (0, context_1.useContextSelector)(context_2.MetadataContext, (state) => state.appStore);
|
|
10
|
+
const experienceStore = (0, context_1.useContextSelector)(context_2.MetadataContext, (state) => state.experienceStore);
|
|
8
11
|
// const schemaLoading = useContextSelector(
|
|
9
12
|
// MetadataContext,
|
|
10
13
|
// (state) => state.schemaLoading
|
|
11
14
|
// );
|
|
12
15
|
const schemaLoading = false;
|
|
13
16
|
const schemas = schemaStore.getAllSchema();
|
|
14
|
-
return useMemo(() => ({
|
|
17
|
+
return (0, react_1.useMemo)(() => ({
|
|
15
18
|
schemas,
|
|
16
19
|
schemaLoading,
|
|
17
20
|
schemaStore,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSchema = useSchema;
|
|
4
|
+
const useMetadata_1 = require("./useMetadata");
|
|
5
|
+
function useSchema(logicalName) {
|
|
6
|
+
const { schemaStore } = (0, useMetadata_1.useMetadata)();
|
|
4
7
|
if (!schemaStore.hasSchema(logicalName)) {
|
|
5
8
|
return null;
|
|
6
9
|
}
|
package/metadata/index.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.MetadataContext = exports.MetadataProvider = void 0;
|
|
18
|
+
var MetadataProvider_1 = require("./MetadataProvider");
|
|
19
|
+
Object.defineProperty(exports, "MetadataProvider", { enumerable: true, get: function () { return MetadataProvider_1.MetadataProvider; } });
|
|
20
|
+
var context_1 = require("./context");
|
|
21
|
+
Object.defineProperty(exports, "MetadataContext", { enumerable: true, get: function () { return context_1.MetadataContext; } });
|
|
22
|
+
__exportStar(require("./hooks"), exports);
|
package/mutable/context.js
CHANGED
|
@@ -1,37 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useContextSelectorInternal = void 0;
|
|
4
|
+
exports.createContext = createContext;
|
|
5
|
+
exports.useCreateContextStore = useCreateContextStore;
|
|
6
|
+
exports.useContextSelector = useContextSelector;
|
|
7
|
+
exports.useContextSetValue = useContextSetValue;
|
|
8
|
+
exports.useContextValueSetter = useContextValueSetter;
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
const createContextValue = utils_1.createMutableValue;
|
|
12
|
+
exports.useContextSelectorInternal = utils_1.useMutableValueSelector;
|
|
13
|
+
function createContext() {
|
|
14
|
+
const context = (0, react_1.createContext)(null);
|
|
7
15
|
return context;
|
|
8
16
|
}
|
|
9
|
-
|
|
10
|
-
const [state] = useState(() => createContextValue(initialValue));
|
|
17
|
+
function useCreateContextStore(initialValue) {
|
|
18
|
+
const [state] = (0, react_1.useState)(() => createContextValue(initialValue));
|
|
11
19
|
return state;
|
|
12
20
|
}
|
|
13
|
-
|
|
14
|
-
const contextValue = useContext(context);
|
|
21
|
+
function useContextSelector(context, selector) {
|
|
22
|
+
const contextValue = (0, react_1.useContext)(context);
|
|
15
23
|
if (!contextValue) {
|
|
16
24
|
throw new Error('useContextSelector must be used within a Provider');
|
|
17
25
|
}
|
|
18
|
-
return useContextSelectorInternal(contextValue, selector);
|
|
26
|
+
return (0, exports.useContextSelectorInternal)(contextValue, selector);
|
|
19
27
|
}
|
|
20
|
-
|
|
21
|
-
const contextValue = useContext(context);
|
|
28
|
+
function useContextSetValue(context) {
|
|
29
|
+
const contextValue = (0, react_1.useContext)(context);
|
|
22
30
|
if (!contextValue) {
|
|
23
31
|
throw new Error('useContextSetValue must be used within a Provider');
|
|
24
32
|
}
|
|
25
33
|
return contextValue.setValue;
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
const contextValue = useContext(context);
|
|
35
|
+
function useContextValueSetter(context, setter) {
|
|
36
|
+
const contextValue = (0, react_1.useContext)(context);
|
|
29
37
|
if (!contextValue) {
|
|
30
38
|
throw new Error('useContextValueSetter must be used within a Provider');
|
|
31
39
|
}
|
|
32
|
-
const setterRef = useRef(setter);
|
|
40
|
+
const setterRef = (0, react_1.useRef)(setter);
|
|
33
41
|
setterRef.current = setter;
|
|
34
|
-
const setterWrapper = useCallback((...args) => {
|
|
42
|
+
const setterWrapper = (0, react_1.useCallback)((...args) => {
|
|
35
43
|
return setterRef.current(contextValue.setValue)(...args);
|
|
36
44
|
}, [contextValue.setValue]);
|
|
37
45
|
return setterWrapper;
|
package/mutable/index.js
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.useMutableStateSelector = exports.useMutableState = exports.useContextValueSetter = exports.useCreateContextStore = exports.useContextSetValue = exports.useContextSelector = exports.createContext = void 0;
|
|
18
|
+
var context_1 = require("./context");
|
|
19
|
+
Object.defineProperty(exports, "createContext", { enumerable: true, get: function () { return context_1.createContext; } });
|
|
20
|
+
Object.defineProperty(exports, "useContextSelector", { enumerable: true, get: function () { return context_1.useContextSelector; } });
|
|
21
|
+
Object.defineProperty(exports, "useContextSetValue", { enumerable: true, get: function () { return context_1.useContextSetValue; } });
|
|
22
|
+
Object.defineProperty(exports, "useCreateContextStore", { enumerable: true, get: function () { return context_1.useCreateContextStore; } });
|
|
23
|
+
Object.defineProperty(exports, "useContextValueSetter", { enumerable: true, get: function () { return context_1.useContextValueSetter; } });
|
|
24
|
+
var state_1 = require("./state");
|
|
25
|
+
Object.defineProperty(exports, "useMutableState", { enumerable: true, get: function () { return state_1.useMutableState; } });
|
|
26
|
+
Object.defineProperty(exports, "useMutableStateSelector", { enumerable: true, get: function () { return state_1.useMutableStateSelector; } });
|
|
27
|
+
__exportStar(require("./type"), exports);
|
package/mutable/state.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMutableStateSelector = exports.createMutableState = void 0;
|
|
4
|
+
exports.useMutableState = useMutableState;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
exports.createMutableState = utils_1.createMutableValue;
|
|
8
|
+
exports.useMutableStateSelector = utils_1.useMutableValueSelector;
|
|
9
|
+
function useMutableState(initialValue, isArray) {
|
|
10
|
+
const [state] = (0, react_1.useState)(() => (0, exports.createMutableState)(initialValue, isArray));
|
|
7
11
|
return state;
|
|
8
12
|
}
|
package/mutable/type.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/mutable/utils.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMutableValue = createMutableValue;
|
|
4
|
+
exports.useMutableValueSelector = useMutableValueSelector;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
function createMutableValue(initialValue, isArray) {
|
|
3
7
|
let storeValue = {
|
|
4
8
|
current: initialValue,
|
|
5
9
|
};
|
|
@@ -14,7 +18,7 @@ export function createMutableValue(initialValue, isArray) {
|
|
|
14
18
|
storeValue.current = value;
|
|
15
19
|
}
|
|
16
20
|
else {
|
|
17
|
-
storeValue.current =
|
|
21
|
+
storeValue.current = { ...storeValue.current, ...value };
|
|
18
22
|
}
|
|
19
23
|
listeners.forEach((listener) => listener(storeValue.current));
|
|
20
24
|
},
|
|
@@ -23,15 +27,15 @@ export function createMutableValue(initialValue, isArray) {
|
|
|
23
27
|
removeListener: (listener) => listeners.delete(listener),
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
const selectorRef = useRef(selector);
|
|
30
|
+
function useMutableValueSelector(mutableValue, selector) {
|
|
31
|
+
const selectorRef = (0, react_1.useRef)(selector);
|
|
28
32
|
selectorRef.current = selector;
|
|
29
|
-
const [value, setValue] = useState({
|
|
33
|
+
const [value, setValue] = (0, react_1.useState)({
|
|
30
34
|
innerValue: selectorRef.current(mutableValue.value.current),
|
|
31
35
|
});
|
|
32
|
-
const valueRef = useRef(value);
|
|
36
|
+
const valueRef = (0, react_1.useRef)(value);
|
|
33
37
|
valueRef.current = value;
|
|
34
|
-
useEffect(() => {
|
|
38
|
+
(0, react_1.useEffect)(() => {
|
|
35
39
|
const listener = (state) => {
|
|
36
40
|
const newValue = selectorRef.current(state);
|
|
37
41
|
if (newValue !== valueRef.current.innerValue) {
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useOpenForm"), exports);
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOpenForm = useOpenForm;
|
|
4
|
+
const defaultParameters_1 = require("@headless-adminapp/app/dataform/utils/defaultParameters");
|
|
5
|
+
const app_1 = require("@headless-adminapp/core/experience/app");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const hooks_1 = require("../../route/hooks/");
|
|
8
|
+
const useRouteResolver_1 = require("../../route/hooks/useRouteResolver");
|
|
9
|
+
function useOpenForm() {
|
|
10
|
+
const routeResolver = (0, useRouteResolver_1.useRouteResolver)();
|
|
11
|
+
const router = (0, hooks_1.useRouter)();
|
|
12
|
+
return (0, react_1.useCallback)((options) => {
|
|
10
13
|
const path = routeResolver({
|
|
11
14
|
logicalName: options.logicalName,
|
|
12
|
-
type: PageType.EntityForm,
|
|
15
|
+
type: app_1.PageType.EntityForm,
|
|
13
16
|
id: options.id,
|
|
14
17
|
});
|
|
15
18
|
if (options.parameters) {
|
|
16
|
-
setFormDefaultParameters(options.logicalName, options.parameters);
|
|
19
|
+
(0, defaultParameters_1.setFormDefaultParameters)(options.logicalName, options.parameters);
|
|
17
20
|
}
|
|
18
21
|
if (options.replace) {
|
|
19
22
|
router.replace(path);
|
package/navigation/index.js
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hooks"), exports);
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/app",
|
|
3
|
-
"version": "0.0.17-alpha.
|
|
3
|
+
"version": "0.0.17-alpha.55",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
7
|
"publishConfig": {
|
|
9
8
|
"access": "public",
|
|
10
9
|
"directory": "dist"
|
|
@@ -17,14 +16,7 @@
|
|
|
17
16
|
"bugs": {
|
|
18
17
|
"url": "https://github.com/headless-adminapp/adminapp/issues"
|
|
19
18
|
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "tsc",
|
|
22
|
-
"clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo",
|
|
23
|
-
"ts-check": "tsc --noEmit",
|
|
24
|
-
"copy-files": "cp package.json dist && cp src/index.css dist",
|
|
25
|
-
"prepublishOnly": "pnpm run build && pnpm run copy-files",
|
|
26
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
27
|
-
},
|
|
19
|
+
"scripts": {},
|
|
28
20
|
"keywords": [],
|
|
29
21
|
"author": "",
|
|
30
22
|
"license": "ISC",
|
|
@@ -41,5 +33,5 @@
|
|
|
41
33
|
"uuid": "11.0.3",
|
|
42
34
|
"yup": "^1.4.0"
|
|
43
35
|
},
|
|
44
|
-
"gitHead": "
|
|
45
|
-
}
|
|
36
|
+
"gitHead": "e598a5eebfc2f9927b0cd3a699a023537a0d12a9"
|
|
37
|
+
}
|