@headless-adminapp/app 0.0.17-alpha.42 → 0.0.17-alpha.45
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/dataform/hooks/index.js
CHANGED
|
@@ -26,3 +26,4 @@ __exportStar(require("./useRecordId"), exports);
|
|
|
26
26
|
__exportStar(require("./useRecordTitle"), exports);
|
|
27
27
|
__exportStar(require("./useSelectedForm"), exports);
|
|
28
28
|
__exportStar(require("./useLoadFormGridPage"), exports);
|
|
29
|
+
__exportStar(require("./useProcessFlowSteps"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useProcessFlowSteps(): import("@headless-adminapp/core/experience/form/ProcessFlowInfo").ProcessFlowStep[] | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useProcessFlowSteps = useProcessFlowSteps;
|
|
4
|
+
const command_1 = require("@headless-adminapp/app/command");
|
|
5
|
+
const context_1 = require("../../mutable/context");
|
|
6
|
+
const context_2 = require("../context");
|
|
7
|
+
const useFormInstance_1 = require("./useFormInstance");
|
|
8
|
+
const useFormIsReadonly_1 = require("./useFormIsReadonly");
|
|
9
|
+
const useFormRecord_1 = require("./useFormRecord");
|
|
10
|
+
const useFormSchema_1 = require("./useFormSchema");
|
|
11
|
+
const useRecordId_1 = require("./useRecordId");
|
|
12
|
+
const useSelectedForm_1 = require("./useSelectedForm");
|
|
13
|
+
function useFormControlContext() {
|
|
14
|
+
var _a;
|
|
15
|
+
const schema = (0, useFormSchema_1.useDataFormSchema)();
|
|
16
|
+
const form = (0, context_1.useContextSelector)(context_2.DataFormContext, (state) => state.form);
|
|
17
|
+
const originalData = (0, useFormRecord_1.useFormRecord)();
|
|
18
|
+
const recordId = (0, useRecordId_1.useRecordId)();
|
|
19
|
+
const formInstance = (0, useFormInstance_1.useFormInstance)();
|
|
20
|
+
const readonly = (_a = (0, useFormIsReadonly_1.useFormIsReadonly)()) !== null && _a !== void 0 ? _a : false;
|
|
21
|
+
const data = formInstance.watch();
|
|
22
|
+
return {
|
|
23
|
+
data,
|
|
24
|
+
logicalName: schema.logicalName,
|
|
25
|
+
schema,
|
|
26
|
+
form,
|
|
27
|
+
formId: form.id,
|
|
28
|
+
originalData: originalData !== null && originalData !== void 0 ? originalData : null,
|
|
29
|
+
recordId,
|
|
30
|
+
readonly,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function useProcessFlowInfoContext() {
|
|
34
|
+
const primaryControl = useFormControlContext();
|
|
35
|
+
const baseHandlerContext = (0, command_1.useBaseCommandHandlerContext)();
|
|
36
|
+
return Object.assign(Object.assign({}, baseHandlerContext), { primaryControl });
|
|
37
|
+
}
|
|
38
|
+
function useProcessFlowSteps() {
|
|
39
|
+
var _a;
|
|
40
|
+
const formConfig = (0, useSelectedForm_1.useSelectedForm)();
|
|
41
|
+
const context = useProcessFlowInfoContext();
|
|
42
|
+
const steps = (_a = formConfig.experience.processFlow) === null || _a === void 0 ? void 0 : _a.getSteps(context);
|
|
43
|
+
return steps;
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/app",
|
|
3
|
-
"version": "0.0.17-alpha.
|
|
3
|
+
"version": "0.0.17-alpha.45",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"react-hook-form": "7.52.2",
|
|
40
40
|
"yup": "^1.4.0"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "7538074665d8fa6f67ca2a91e62ea32d09570a31"
|
|
43
43
|
}
|
|
@@ -11,7 +11,7 @@ interface UseRetriveRecordProps<S extends SchemaAttributes = SchemaAttributes> {
|
|
|
11
11
|
expand?: Partial<Record<string, string[]>>;
|
|
12
12
|
maxRecords: number;
|
|
13
13
|
}
|
|
14
|
-
export declare function useRetrieveRecordsKey<S extends SchemaAttributes = SchemaAttributes>({ schema, search, filter, sorting, columns, expand, maxRecords, }: UseRetriveRecordProps<S>): (string | number |
|
|
14
|
+
export declare function useRetrieveRecordsKey<S extends SchemaAttributes = SchemaAttributes>({ schema, search, filter, sorting, columns, expand, maxRecords, }: UseRetriveRecordProps<S>): (string | number | string[] | Filter | Partial<Record<string, string[]>> | SortingState<S> | null | undefined)[];
|
|
15
15
|
export declare function useClearDataExceptFirstPage(queryKey: QueryKey): void;
|
|
16
16
|
export declare function useRetriveRecords<S extends SchemaAttributes = SchemaAttributes>(queryKey: QueryKey, { columns, expand, filter, maxRecords, schema, search, sorting, }: UseRetriveRecordProps): {
|
|
17
17
|
data: {
|