openxiangda 1.0.154 → 1.0.155
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/openxiangda-skills/SKILL.md +1 -0
- package/openxiangda-skills/references/component-guide.md +2 -0
- package/openxiangda-skills/references/pages/page-sdk.md +19 -0
- package/openxiangda-skills/references/troubleshooting.md +5 -5
- package/openxiangda-skills/skills/openxiangda-form/SKILL.md +1 -0
- package/openxiangda-skills/skills/openxiangda-page/SKILL.md +1 -0
- package/package.json +1 -1
- package/packages/sdk/dist/runtime/index.cjs +806 -795
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.d.mts +1 -1
- package/packages/sdk/dist/runtime/index.d.ts +1 -1
- package/packages/sdk/dist/runtime/index.mjs +192 -181
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +234 -223
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +10 -2
- package/packages/sdk/dist/runtime/react.d.ts +10 -2
- package/packages/sdk/dist/runtime/react.mjs +106 -95
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
- package/templates/openxiangda-react-spa/AGENTS.md +1 -0
|
@@ -2941,9 +2941,8 @@ var usePageRoute = () => {
|
|
|
2941
2941
|
return usePageContext().route;
|
|
2942
2942
|
};
|
|
2943
2943
|
|
|
2944
|
-
// packages/sdk/src/runtime/react/
|
|
2945
|
-
import
|
|
2946
|
-
import { Empty as Empty3 } from "antd";
|
|
2944
|
+
// packages/sdk/src/runtime/react/formRuntime.ts
|
|
2945
|
+
import { useMemo as useMemo4 } from "react";
|
|
2947
2946
|
|
|
2948
2947
|
// packages/sdk/src/components/core/imageCompression.ts
|
|
2949
2948
|
var DEFAULT_THUMB = {
|
|
@@ -3796,6 +3795,73 @@ function createFormRuntimeApi(config) {
|
|
|
3796
3795
|
return { ...defaults, ...overrides, request };
|
|
3797
3796
|
}
|
|
3798
3797
|
|
|
3798
|
+
// packages/sdk/src/runtime/react/formRuntime.ts
|
|
3799
|
+
var normalizeMethod2 = (method) => {
|
|
3800
|
+
const value = String(method || "get").toLowerCase();
|
|
3801
|
+
return ["get", "post", "put", "delete", "patch"].includes(value) ? value : "get";
|
|
3802
|
+
};
|
|
3803
|
+
var normalizeHeaders = (headers) => {
|
|
3804
|
+
if (!headers) return void 0;
|
|
3805
|
+
return Object.fromEntries(new Headers(headers).entries());
|
|
3806
|
+
};
|
|
3807
|
+
var toPageRequest = (config) => ({
|
|
3808
|
+
path: config.url,
|
|
3809
|
+
method: normalizeMethod2(config.method),
|
|
3810
|
+
query: config.params,
|
|
3811
|
+
body: config.data,
|
|
3812
|
+
headers: normalizeHeaders(config.headers)
|
|
3813
|
+
});
|
|
3814
|
+
var toRuntimeResponse = (response) => {
|
|
3815
|
+
if (response.raw && typeof response.raw === "object") {
|
|
3816
|
+
return response.raw;
|
|
3817
|
+
}
|
|
3818
|
+
return {
|
|
3819
|
+
code: Number(response.code) || 200,
|
|
3820
|
+
success: response.success,
|
|
3821
|
+
message: response.message,
|
|
3822
|
+
data: response.result,
|
|
3823
|
+
result: response.result
|
|
3824
|
+
};
|
|
3825
|
+
};
|
|
3826
|
+
var unwrapPageResult = (response) => response.result ?? response.data ?? null;
|
|
3827
|
+
var createPageFormRuntimeApi = (sdk) => {
|
|
3828
|
+
const request = async (config) => {
|
|
3829
|
+
const options = toPageRequest(config);
|
|
3830
|
+
if (config.responseType === "blob") {
|
|
3831
|
+
const response = await sdk.transport.download(options);
|
|
3832
|
+
return response.blob;
|
|
3833
|
+
}
|
|
3834
|
+
return toRuntimeResponse(await sdk.transport.request(options));
|
|
3835
|
+
};
|
|
3836
|
+
return createFormRuntimeApi({
|
|
3837
|
+
request,
|
|
3838
|
+
createFileAccessTicket: async (bucketName, objectName, fileName, purpose = "preview", options = {}) => unwrapPageResult(
|
|
3839
|
+
await sdk.createFileAccessTicket(
|
|
3840
|
+
bucketName,
|
|
3841
|
+
objectName,
|
|
3842
|
+
fileName,
|
|
3843
|
+
purpose,
|
|
3844
|
+
options
|
|
3845
|
+
)
|
|
3846
|
+
),
|
|
3847
|
+
createDownloadTicket: async (bucketName, objectName, fileName) => unwrapPageResult(
|
|
3848
|
+
await sdk.request({
|
|
3849
|
+
path: "/file/download-ticket",
|
|
3850
|
+
method: "post",
|
|
3851
|
+
body: { bucketName, objectName, fileName }
|
|
3852
|
+
})
|
|
3853
|
+
)
|
|
3854
|
+
});
|
|
3855
|
+
};
|
|
3856
|
+
var usePageFormRuntimeApi = () => {
|
|
3857
|
+
const sdk = usePageSdk();
|
|
3858
|
+
return useMemo4(() => createPageFormRuntimeApi(sdk), [sdk]);
|
|
3859
|
+
};
|
|
3860
|
+
|
|
3861
|
+
// packages/sdk/src/runtime/react/filePreview.tsx
|
|
3862
|
+
import React6, { useMemo as useMemo7, useState as useState6 } from "react";
|
|
3863
|
+
import { Empty as Empty3 } from "antd";
|
|
3864
|
+
|
|
3799
3865
|
// packages/sdk/src/components/fields/shared/fieldFormat.ts
|
|
3800
3866
|
function createUid(prefix = "field") {
|
|
3801
3867
|
return `${prefix}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
@@ -4327,7 +4393,7 @@ var convertHeicPreview = async (request, url) => {
|
|
|
4327
4393
|
};
|
|
4328
4394
|
|
|
4329
4395
|
// packages/sdk/src/components/file-preview/FilePreviewContent.tsx
|
|
4330
|
-
import { useEffect as useEffect3, useMemo as
|
|
4396
|
+
import { useEffect as useEffect3, useMemo as useMemo5, useRef as useRef2, useState as useState3 } from "react";
|
|
4331
4397
|
import { Alert, Button, Empty, Image as Image2, Spin, Table, Tabs, Typography } from "antd";
|
|
4332
4398
|
import { DownloadOutlined, FileOutlined, ReloadOutlined } from "@ant-design/icons";
|
|
4333
4399
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
@@ -4772,7 +4838,7 @@ var OnlyOfficePreview = ({
|
|
|
4772
4838
|
configUrl,
|
|
4773
4839
|
ticket
|
|
4774
4840
|
}) => {
|
|
4775
|
-
const editorId =
|
|
4841
|
+
const editorId = useMemo5(
|
|
4776
4842
|
() => `openxiangda-onlyoffice-${String(ticket || "editor").replace(/[^a-zA-Z0-9_-]/g, "")}`,
|
|
4777
4843
|
[ticket]
|
|
4778
4844
|
);
|
|
@@ -5148,7 +5214,7 @@ var FilePreviewPage = ({
|
|
|
5148
5214
|
};
|
|
5149
5215
|
|
|
5150
5216
|
// packages/sdk/src/components/file-preview/useFilePreview.tsx
|
|
5151
|
-
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as
|
|
5217
|
+
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo6, useState as useState5 } from "react";
|
|
5152
5218
|
import { Alert as Alert3, Button as Button3, Image as Image3, Modal, Spin as Spin3, Typography as Typography3 } from "antd";
|
|
5153
5219
|
import { CloseOutlined, DownloadOutlined as DownloadOutlined3 } from "@ant-design/icons";
|
|
5154
5220
|
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -5177,7 +5243,7 @@ var useFilePreviewController = ({
|
|
|
5177
5243
|
enabled = true,
|
|
5178
5244
|
requireServerCapability = true
|
|
5179
5245
|
}) => {
|
|
5180
|
-
const itemSignature =
|
|
5246
|
+
const itemSignature = useMemo6(
|
|
5181
5247
|
() => items.map(
|
|
5182
5248
|
(item, index) => [
|
|
5183
5249
|
getPreviewItemKey(item, index),
|
|
@@ -5540,63 +5606,6 @@ function FileStatusText({
|
|
|
5540
5606
|
// packages/sdk/src/runtime/react/filePreview.tsx
|
|
5541
5607
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
5542
5608
|
var EMPTY_ITEMS = [];
|
|
5543
|
-
var normalizeMethod2 = (method) => {
|
|
5544
|
-
const value = String(method || "get").toLowerCase();
|
|
5545
|
-
return ["get", "post", "put", "delete", "patch"].includes(value) ? value : "get";
|
|
5546
|
-
};
|
|
5547
|
-
var normalizeHeaders = (headers) => {
|
|
5548
|
-
if (!headers) return void 0;
|
|
5549
|
-
return Object.fromEntries(new Headers(headers).entries());
|
|
5550
|
-
};
|
|
5551
|
-
var toPageRequest = (config) => ({
|
|
5552
|
-
path: config.url,
|
|
5553
|
-
method: normalizeMethod2(config.method),
|
|
5554
|
-
query: config.params,
|
|
5555
|
-
body: config.data,
|
|
5556
|
-
headers: normalizeHeaders(config.headers)
|
|
5557
|
-
});
|
|
5558
|
-
var toRuntimeResponse = (response) => {
|
|
5559
|
-
if (response.raw && typeof response.raw === "object") {
|
|
5560
|
-
return response.raw;
|
|
5561
|
-
}
|
|
5562
|
-
return {
|
|
5563
|
-
code: Number(response.code) || 200,
|
|
5564
|
-
success: response.success,
|
|
5565
|
-
message: response.message,
|
|
5566
|
-
data: response.result,
|
|
5567
|
-
result: response.result
|
|
5568
|
-
};
|
|
5569
|
-
};
|
|
5570
|
-
var unwrapPageResult = (response) => response.result ?? response.data ?? null;
|
|
5571
|
-
var createPageFileRuntimeApi = (sdk) => {
|
|
5572
|
-
const request = async (config) => {
|
|
5573
|
-
const options = toPageRequest(config);
|
|
5574
|
-
if (config.responseType === "blob") {
|
|
5575
|
-
const response = await sdk.transport.download(options);
|
|
5576
|
-
return response.blob;
|
|
5577
|
-
}
|
|
5578
|
-
return toRuntimeResponse(await sdk.transport.request(options));
|
|
5579
|
-
};
|
|
5580
|
-
return createFormRuntimeApi({
|
|
5581
|
-
request,
|
|
5582
|
-
createFileAccessTicket: async (bucketName, objectName, fileName, purpose = "preview", options = {}) => unwrapPageResult(
|
|
5583
|
-
await sdk.createFileAccessTicket(
|
|
5584
|
-
bucketName,
|
|
5585
|
-
objectName,
|
|
5586
|
-
fileName,
|
|
5587
|
-
purpose,
|
|
5588
|
-
options
|
|
5589
|
-
)
|
|
5590
|
-
),
|
|
5591
|
-
createDownloadTicket: async (bucketName, objectName, fileName) => unwrapPageResult(
|
|
5592
|
-
await sdk.request({
|
|
5593
|
-
path: "/file/download-ticket",
|
|
5594
|
-
method: "post",
|
|
5595
|
-
body: { bucketName, objectName, fileName }
|
|
5596
|
-
})
|
|
5597
|
-
)
|
|
5598
|
-
});
|
|
5599
|
-
};
|
|
5600
5609
|
var useFilePreview = ({
|
|
5601
5610
|
items = EMPTY_ITEMS,
|
|
5602
5611
|
appType,
|
|
@@ -5605,7 +5614,7 @@ var useFilePreview = ({
|
|
|
5605
5614
|
requireServerCapability = true
|
|
5606
5615
|
}) => {
|
|
5607
5616
|
const sdk = usePageSdk();
|
|
5608
|
-
const api =
|
|
5617
|
+
const api = useMemo7(() => createPageFormRuntimeApi(sdk), [sdk]);
|
|
5609
5618
|
const preview = useFilePreviewController({
|
|
5610
5619
|
items,
|
|
5611
5620
|
api,
|
|
@@ -5793,7 +5802,7 @@ var ImagePreviewGrid = ({
|
|
|
5793
5802
|
};
|
|
5794
5803
|
|
|
5795
5804
|
// packages/sdk/src/runtime/react/workflow.tsx
|
|
5796
|
-
import { useCallback as useCallback8, useEffect as useEffect10, useMemo as
|
|
5805
|
+
import { useCallback as useCallback8, useEffect as useEffect10, useMemo as useMemo13, useRef as useRef5, useState as useState11 } from "react";
|
|
5797
5806
|
import { Form, Input as Input2, Modal as Modal5, Select as Select2 } from "antd";
|
|
5798
5807
|
import {
|
|
5799
5808
|
CheckOutlined,
|
|
@@ -5805,7 +5814,7 @@ import {
|
|
|
5805
5814
|
} from "@ant-design/icons";
|
|
5806
5815
|
|
|
5807
5816
|
// packages/sdk/src/components/modules/StickyActionBar.tsx
|
|
5808
|
-
import { useEffect as useEffect6, useMemo as
|
|
5817
|
+
import { useEffect as useEffect6, useMemo as useMemo8, useState as useState7 } from "react";
|
|
5809
5818
|
import { Button as Button4, Dropdown, Tooltip as Tooltip2 } from "antd";
|
|
5810
5819
|
import { MoreOutlined } from "@ant-design/icons";
|
|
5811
5820
|
|
|
@@ -5848,7 +5857,7 @@ var StickyActionBar = ({
|
|
|
5848
5857
|
window.addEventListener("resize", update);
|
|
5849
5858
|
return () => window.removeEventListener("resize", update);
|
|
5850
5859
|
}, []);
|
|
5851
|
-
const visibleActions =
|
|
5860
|
+
const visibleActions = useMemo8(
|
|
5852
5861
|
() => actions.filter((action) => action.visible !== false).sort((left, right) => getActionPriority(left) - getActionPriority(right)),
|
|
5853
5862
|
[actions]
|
|
5854
5863
|
);
|
|
@@ -5917,7 +5926,7 @@ var StickyActionBar = ({
|
|
|
5917
5926
|
};
|
|
5918
5927
|
|
|
5919
5928
|
// packages/sdk/src/components/modules/ApprovalTimeline.tsx
|
|
5920
|
-
import { useMemo as
|
|
5929
|
+
import { useMemo as useMemo9 } from "react";
|
|
5921
5930
|
import {
|
|
5922
5931
|
ApiOutlined,
|
|
5923
5932
|
CheckCircleFilled,
|
|
@@ -6095,8 +6104,8 @@ var ApprovalTimeline = ({
|
|
|
6095
6104
|
compactMode = false,
|
|
6096
6105
|
showApproverInfo = true
|
|
6097
6106
|
}) => {
|
|
6098
|
-
const taskList =
|
|
6099
|
-
const groups =
|
|
6107
|
+
const taskList = useMemo9(() => Array.isArray(tasks) ? tasks : [], [tasks]);
|
|
6108
|
+
const groups = useMemo9(() => groupTasks(taskList), [taskList]);
|
|
6100
6109
|
if (taskList.length === 0) {
|
|
6101
6110
|
return /* @__PURE__ */ jsx9(
|
|
6102
6111
|
"div",
|
|
@@ -6242,7 +6251,7 @@ var ProcessPreview = ({
|
|
|
6242
6251
|
};
|
|
6243
6252
|
|
|
6244
6253
|
// packages/sdk/src/components/modules/InitiatorApproverSelector.tsx
|
|
6245
|
-
import { useCallback as useCallback7, useEffect as useEffect9, useMemo as
|
|
6254
|
+
import { useCallback as useCallback7, useEffect as useEffect9, useMemo as useMemo12, useRef as useRef4, useState as useState10 } from "react";
|
|
6246
6255
|
import { Button as Button7, Empty as Empty5, Modal as Modal4, Select, Space as Space2, Tag as Tag3, Typography as Typography4, message as message2 } from "antd";
|
|
6247
6256
|
|
|
6248
6257
|
// packages/sdk/src/components/core/processApi.ts
|
|
@@ -6606,7 +6615,7 @@ async function getViewPermission(request, params) {
|
|
|
6606
6615
|
}
|
|
6607
6616
|
|
|
6608
6617
|
// packages/sdk/src/components/fields/shared/UserPicker.tsx
|
|
6609
|
-
import { useCallback as useCallback6, useEffect as useEffect8, useMemo as
|
|
6618
|
+
import { useCallback as useCallback6, useEffect as useEffect8, useMemo as useMemo11, useState as useState9 } from "react";
|
|
6610
6619
|
import {
|
|
6611
6620
|
Avatar,
|
|
6612
6621
|
Button as Button6,
|
|
@@ -6625,7 +6634,7 @@ import { SearchOutlined, TeamOutlined, UserOutlined as UserOutlined3 } from "@an
|
|
|
6625
6634
|
import * as MobileAntd from "antd-mobile";
|
|
6626
6635
|
|
|
6627
6636
|
// packages/sdk/src/components/fields/shared/useLazyDepartmentTree.ts
|
|
6628
|
-
import { useCallback as useCallback5, useEffect as useEffect7, useMemo as
|
|
6637
|
+
import { useCallback as useCallback5, useEffect as useEffect7, useMemo as useMemo10, useRef as useRef3, useState as useState8 } from "react";
|
|
6629
6638
|
var toLazyNode = (node) => {
|
|
6630
6639
|
const normalized = normalizeDepartmentNode(node);
|
|
6631
6640
|
const id = getDepartmentId(normalized);
|
|
@@ -6735,7 +6744,7 @@ function useLazyDepartmentTree(api, configuredTreeData) {
|
|
|
6735
6744
|
},
|
|
6736
6745
|
[api, setTreeData]
|
|
6737
6746
|
);
|
|
6738
|
-
const indexes =
|
|
6747
|
+
const indexes = useMemo10(() => buildIndexes(treeData), [treeData]);
|
|
6739
6748
|
useEffect7(() => {
|
|
6740
6749
|
void loadRootDepartments();
|
|
6741
6750
|
}, [loadRootDepartments]);
|
|
@@ -6796,7 +6805,7 @@ function UserPickerPanel({
|
|
|
6796
6805
|
const selectedIds = selected.map(getUserId);
|
|
6797
6806
|
const MobileSearchBar = getMobileComponent("SearchBar");
|
|
6798
6807
|
const activeMemberKeyword = (mobile ? mobileKeyword : memberKeyword).trim();
|
|
6799
|
-
const staticUsers =
|
|
6808
|
+
const staticUsers = useMemo11(() => normalizeUsers(dataSource), [dataSource]);
|
|
6800
6809
|
const hasStaticUserSource = staticUsers.length > 0;
|
|
6801
6810
|
useEffect8(() => {
|
|
6802
6811
|
if (mobile) return;
|
|
@@ -6889,7 +6898,7 @@ function UserPickerPanel({
|
|
|
6889
6898
|
memberReloadKey,
|
|
6890
6899
|
staticUsers
|
|
6891
6900
|
]);
|
|
6892
|
-
const currentPath =
|
|
6901
|
+
const currentPath = useMemo11(() => {
|
|
6893
6902
|
if (!currentDeptId) return [];
|
|
6894
6903
|
const path = [];
|
|
6895
6904
|
let cursor = currentDeptId;
|
|
@@ -6901,7 +6910,7 @@ function UserPickerPanel({
|
|
|
6901
6910
|
}
|
|
6902
6911
|
return path;
|
|
6903
6912
|
}, [currentDeptId, nodeMap, parentMap]);
|
|
6904
|
-
const mobileDepartments =
|
|
6913
|
+
const mobileDepartments = useMemo11(() => {
|
|
6905
6914
|
const keyword = mobileKeyword.trim().toLowerCase();
|
|
6906
6915
|
if (keyword) {
|
|
6907
6916
|
return flatNodes.filter((item) => item.name.toLowerCase().includes(keyword)).map((item) => item.node);
|
|
@@ -7166,7 +7175,7 @@ var RequirementSelect = ({
|
|
|
7166
7175
|
onChange
|
|
7167
7176
|
}) => {
|
|
7168
7177
|
const [pickerOpen, setPickerOpen] = useState10(false);
|
|
7169
|
-
const initialCandidates =
|
|
7178
|
+
const initialCandidates = useMemo12(
|
|
7170
7179
|
() => (requirement.candidateUsers || []).map(normalizeCandidate).filter(Boolean),
|
|
7171
7180
|
[requirement.candidateUsers]
|
|
7172
7181
|
);
|
|
@@ -7220,7 +7229,7 @@ var RequirementSelect = ({
|
|
|
7220
7229
|
void loadCandidates();
|
|
7221
7230
|
}
|
|
7222
7231
|
}, [appType, formUuid, loadCandidates, open, requirement.nodeId, requirement.scope]);
|
|
7223
|
-
const options =
|
|
7232
|
+
const options = useMemo12(
|
|
7224
7233
|
() => optionsSource.map((user) => ({
|
|
7225
7234
|
value: user.id,
|
|
7226
7235
|
label: getUserLabel(user)
|
|
@@ -7658,7 +7667,7 @@ var ProcessActionBar = ({
|
|
|
7658
7667
|
}
|
|
7659
7668
|
void actions.executeOperation(operation);
|
|
7660
7669
|
};
|
|
7661
|
-
const actionConfigs =
|
|
7670
|
+
const actionConfigs = useMemo13(
|
|
7662
7671
|
() => operations.map((operation) => ({
|
|
7663
7672
|
key: operation.key,
|
|
7664
7673
|
label: operation.label || operation.key,
|
|
@@ -7777,7 +7786,7 @@ import {
|
|
|
7777
7786
|
useCallback as useCallback10,
|
|
7778
7787
|
useContext as useContext2,
|
|
7779
7788
|
useEffect as useEffect12,
|
|
7780
|
-
useMemo as
|
|
7789
|
+
useMemo as useMemo15,
|
|
7781
7790
|
useRef as useRef6,
|
|
7782
7791
|
useState as useState13
|
|
7783
7792
|
} from "react";
|
|
@@ -8172,7 +8181,7 @@ var mountBrowserPageRuntime = async (options) => {
|
|
|
8172
8181
|
import {
|
|
8173
8182
|
useCallback as useCallback9,
|
|
8174
8183
|
useEffect as useEffect11,
|
|
8175
|
-
useMemo as
|
|
8184
|
+
useMemo as useMemo14,
|
|
8176
8185
|
useState as useState12
|
|
8177
8186
|
} from "react";
|
|
8178
8187
|
import {
|
|
@@ -8196,7 +8205,7 @@ import {
|
|
|
8196
8205
|
import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
8197
8206
|
var useAuth = (options = {}) => {
|
|
8198
8207
|
const runtime = useOpenXiangda();
|
|
8199
|
-
const client =
|
|
8208
|
+
const client = useMemo14(
|
|
8200
8209
|
() => createAuthClient({
|
|
8201
8210
|
appType: options.appType || runtime.appType,
|
|
8202
8211
|
servicePrefix: options.servicePrefix || runtime.servicePrefix,
|
|
@@ -8211,7 +8220,7 @@ var useAuth = (options = {}) => {
|
|
|
8211
8220
|
runtime.servicePrefix
|
|
8212
8221
|
]
|
|
8213
8222
|
);
|
|
8214
|
-
return
|
|
8223
|
+
return useMemo14(
|
|
8215
8224
|
() => ({
|
|
8216
8225
|
client,
|
|
8217
8226
|
getMethods: client.getMethods,
|
|
@@ -8311,7 +8320,7 @@ var LoginPage = ({
|
|
|
8311
8320
|
const ssoMethod = findMethod(methods, "sso");
|
|
8312
8321
|
const guestMethod = findMethod(methods, "guest");
|
|
8313
8322
|
const allowRegister = methodsState.data?.registration?.mode !== "reject";
|
|
8314
|
-
const tabItems =
|
|
8323
|
+
const tabItems = useMemo14(() => {
|
|
8315
8324
|
const items = [];
|
|
8316
8325
|
if (passwordMethod) {
|
|
8317
8326
|
items.push({
|
|
@@ -8777,8 +8786,8 @@ var OpenXiangdaProvider = ({
|
|
|
8777
8786
|
fetchImpl,
|
|
8778
8787
|
children
|
|
8779
8788
|
}) => {
|
|
8780
|
-
const resolvedFetch =
|
|
8781
|
-
const resolvedAppType =
|
|
8789
|
+
const resolvedFetch = useMemo15(() => createBoundFetch(fetchImpl), [fetchImpl]);
|
|
8790
|
+
const resolvedAppType = useMemo15(
|
|
8782
8791
|
() => appType || resolveAppTypeFromLocation(),
|
|
8783
8792
|
[appType]
|
|
8784
8793
|
);
|
|
@@ -8892,7 +8901,7 @@ var OpenXiangdaProvider = ({
|
|
|
8892
8901
|
}
|
|
8893
8902
|
return refreshRequestRef.current;
|
|
8894
8903
|
}, [applyAccessToken, resolvedAppType, resolvedFetch, servicePrefix]);
|
|
8895
|
-
const authorizedFetch =
|
|
8904
|
+
const authorizedFetch = useMemo15(
|
|
8896
8905
|
() => createAuthorizedFetch({
|
|
8897
8906
|
appType: resolvedAppType,
|
|
8898
8907
|
baseFetch: resolvedFetch,
|
|
@@ -8980,7 +8989,7 @@ var OpenXiangdaProvider = ({
|
|
|
8980
8989
|
useEffect12(() => {
|
|
8981
8990
|
void reload();
|
|
8982
8991
|
}, [reload]);
|
|
8983
|
-
const value =
|
|
8992
|
+
const value = useMemo15(
|
|
8984
8993
|
() => ({
|
|
8985
8994
|
...state,
|
|
8986
8995
|
appType: resolvedAppType,
|
|
@@ -9023,7 +9032,7 @@ var OpenXiangdaPageProvider = ({
|
|
|
9023
9032
|
navigation
|
|
9024
9033
|
}) => {
|
|
9025
9034
|
const runtime = useOpenXiangda();
|
|
9026
|
-
const context =
|
|
9035
|
+
const context = useMemo15(() => {
|
|
9027
9036
|
const bootstrap = runtime.data;
|
|
9028
9037
|
const app = toRuntimeRecord(bootstrap?.app);
|
|
9029
9038
|
const user = toRuntimeRecord(bootstrap?.user);
|
|
@@ -9349,7 +9358,7 @@ var useRuntimeAuth = () => {
|
|
|
9349
9358
|
},
|
|
9350
9359
|
[logout, redirectToLogin]
|
|
9351
9360
|
);
|
|
9352
|
-
return
|
|
9361
|
+
return useMemo15(
|
|
9353
9362
|
() => ({
|
|
9354
9363
|
logout,
|
|
9355
9364
|
logoutAndRedirect,
|
|
@@ -9719,7 +9728,7 @@ var resolveAppTypeFromLocation = () => {
|
|
|
9719
9728
|
};
|
|
9720
9729
|
|
|
9721
9730
|
// packages/sdk/src/runtime/react/publicAccess.tsx
|
|
9722
|
-
import { useCallback as useCallback11, useEffect as useEffect13, useMemo as
|
|
9731
|
+
import { useCallback as useCallback11, useEffect as useEffect13, useMemo as useMemo16, useRef as useRef7, useState as useState14 } from "react";
|
|
9723
9732
|
import { Fragment as Fragment7, jsx as jsx16 } from "react/jsx-runtime";
|
|
9724
9733
|
var usePublicAccess = (options = {}) => {
|
|
9725
9734
|
const runtime = useOpenXiangda();
|
|
@@ -9743,8 +9752,8 @@ var usePublicAccess = (options = {}) => {
|
|
|
9743
9752
|
const activeSessionRef = useRef7(null);
|
|
9744
9753
|
const mountedRef = useRef7(true);
|
|
9745
9754
|
const sessionInputKey = JSON.stringify(sessionInput);
|
|
9746
|
-
const stableSessionInput =
|
|
9747
|
-
const client =
|
|
9755
|
+
const stableSessionInput = useMemo16(() => sessionInput, [sessionInputKey]);
|
|
9756
|
+
const client = useMemo16(
|
|
9748
9757
|
() => createPublicAccessClient({
|
|
9749
9758
|
appType,
|
|
9750
9759
|
servicePrefix,
|
|
@@ -9844,11 +9853,11 @@ var readTicketFromLocation = () => {
|
|
|
9844
9853
|
var readPathFromLocation = () => typeof window === "undefined" ? void 0 : window.location.pathname;
|
|
9845
9854
|
|
|
9846
9855
|
// packages/sdk/src/runtime/host/builtinRouteRenderer.tsx
|
|
9847
|
-
import { useCallback as useCallback29, useEffect as useEffect54, useMemo as
|
|
9856
|
+
import { useCallback as useCallback29, useEffect as useEffect54, useMemo as useMemo41, useState as useState46 } from "react";
|
|
9848
9857
|
import { Alert as Alert7, Button as Button19, Card as Card2, Empty as Empty11, Spin as Spin9, Typography as Typography6 } from "antd";
|
|
9849
9858
|
|
|
9850
9859
|
// packages/sdk/src/components/modules/DataManagementList.tsx
|
|
9851
|
-
import { useCallback as useCallback28, useEffect as useEffect53, useMemo as
|
|
9860
|
+
import { useCallback as useCallback28, useEffect as useEffect53, useMemo as useMemo40, useRef as useRef24, useState as useState45 } from "react";
|
|
9852
9861
|
import {
|
|
9853
9862
|
Alert as Alert6,
|
|
9854
9863
|
Button as Button18,
|
|
@@ -9887,14 +9896,14 @@ import {
|
|
|
9887
9896
|
} from "@ant-design/icons";
|
|
9888
9897
|
|
|
9889
9898
|
// packages/sdk/src/components/templates/StandardFormPage.tsx
|
|
9890
|
-
import { useMemo as
|
|
9899
|
+
import { useMemo as useMemo39 } from "react";
|
|
9891
9900
|
|
|
9892
9901
|
// packages/sdk/src/components/templates/FormDetailTemplate.tsx
|
|
9893
|
-
import { useCallback as useCallback20, useMemo as
|
|
9902
|
+
import { useCallback as useCallback20, useMemo as useMemo34, useRef as useRef18, useState as useState37 } from "react";
|
|
9894
9903
|
import dayjs10 from "dayjs";
|
|
9895
9904
|
|
|
9896
9905
|
// packages/sdk/src/components/core/FormProvider.tsx
|
|
9897
|
-
import React58, { useCallback as useCallback17, useEffect as useEffect44, useRef as useRef15, useState as useState30, useMemo as
|
|
9906
|
+
import React58, { useCallback as useCallback17, useEffect as useEffect44, useRef as useRef15, useState as useState30, useMemo as useMemo32 } from "react";
|
|
9898
9907
|
|
|
9899
9908
|
// packages/sdk/src/components/core/FormContext.ts
|
|
9900
9909
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
@@ -10665,7 +10674,7 @@ function TextAreaField(props) {
|
|
|
10665
10674
|
import { useEffect as useEffect19 } from "react";
|
|
10666
10675
|
|
|
10667
10676
|
// packages/sdk/src/components/fields/SelectField/SelectFieldPC.tsx
|
|
10668
|
-
import { useMemo as
|
|
10677
|
+
import { useMemo as useMemo18 } from "react";
|
|
10669
10678
|
import { Select as Select3 } from "antd";
|
|
10670
10679
|
|
|
10671
10680
|
// packages/sdk/src/components/fields/shared/optionDisplay.tsx
|
|
@@ -10740,7 +10749,7 @@ function renderReadonlyOptions(options, coloredOptions, tagWhenPlain = false) {
|
|
|
10740
10749
|
}
|
|
10741
10750
|
|
|
10742
10751
|
// packages/sdk/src/components/fields/SelectField/useLinkedFormRemoteOptions.ts
|
|
10743
|
-
import { useCallback as useCallback12, useEffect as useEffect17, useMemo as
|
|
10752
|
+
import { useCallback as useCallback12, useEffect as useEffect17, useMemo as useMemo17, useRef as useRef8, useState as useState15 } from "react";
|
|
10744
10753
|
|
|
10745
10754
|
// packages/sdk/src/components/core/optionSource.ts
|
|
10746
10755
|
var DEFAULT_OPTION_PAGE_SIZE = 200;
|
|
@@ -11003,7 +11012,7 @@ function useLinkedFormRemoteOptions(optionSource, baseOptions, selectedOptions)
|
|
|
11003
11012
|
},
|
|
11004
11013
|
[]
|
|
11005
11014
|
);
|
|
11006
|
-
const options =
|
|
11015
|
+
const options = useMemo17(
|
|
11007
11016
|
() => mergeOptionItems(remoteOptions ?? baseOptions, selectedOptions),
|
|
11008
11017
|
[baseOptions, remoteOptions, selectedOptions]
|
|
11009
11018
|
);
|
|
@@ -11051,7 +11060,7 @@ function SelectFieldPC({
|
|
|
11051
11060
|
const { formData, setFieldValue } = useFormContext();
|
|
11052
11061
|
const value = controlledValue !== void 0 ? controlledValue : formData[fieldId];
|
|
11053
11062
|
const disabled = behavior === "DISABLED";
|
|
11054
|
-
const selectedOptions =
|
|
11063
|
+
const selectedOptions = useMemo18(() => value ? [value] : [], [value]);
|
|
11055
11064
|
const remote = useLinkedFormRemoteOptions(optionSource, options, selectedOptions);
|
|
11056
11065
|
const displayOptions = remote.options;
|
|
11057
11066
|
const handleChange = (val) => {
|
|
@@ -11092,7 +11101,7 @@ function SelectFieldPC({
|
|
|
11092
11101
|
}
|
|
11093
11102
|
|
|
11094
11103
|
// packages/sdk/src/components/fields/SelectField/SelectFieldMobile.tsx
|
|
11095
|
-
import { useEffect as useEffect18, useMemo as
|
|
11104
|
+
import { useEffect as useEffect18, useMemo as useMemo19, useState as useState16 } from "react";
|
|
11096
11105
|
|
|
11097
11106
|
// packages/sdk/src/components/fields/shared/MobileField.tsx
|
|
11098
11107
|
import { Popup } from "antd-mobile";
|
|
@@ -11276,7 +11285,7 @@ function SelectFieldMobile({
|
|
|
11276
11285
|
const [visible, setVisible] = useState16(false);
|
|
11277
11286
|
const [search, setSearch] = useState16("");
|
|
11278
11287
|
const [tempValue, setTempValue] = useState16(value ?? null);
|
|
11279
|
-
const selectedOptions =
|
|
11288
|
+
const selectedOptions = useMemo19(() => value ? [value] : tempValue ? [tempValue] : [], [
|
|
11280
11289
|
tempValue,
|
|
11281
11290
|
value
|
|
11282
11291
|
]);
|
|
@@ -11287,7 +11296,7 @@ function SelectFieldMobile({
|
|
|
11287
11296
|
reset: resetRemoteOptions,
|
|
11288
11297
|
search: searchRemoteOptions
|
|
11289
11298
|
} = useLinkedFormRemoteOptions(optionSource, options, selectedOptions);
|
|
11290
|
-
const filteredOptions =
|
|
11299
|
+
const filteredOptions = useMemo19(() => {
|
|
11291
11300
|
if (remoteEnabled) return remoteOptions;
|
|
11292
11301
|
const keyword = search.trim().toLowerCase();
|
|
11293
11302
|
if (!keyword) return options;
|
|
@@ -11492,7 +11501,7 @@ function MultiSelectFieldPC({
|
|
|
11492
11501
|
}
|
|
11493
11502
|
|
|
11494
11503
|
// packages/sdk/src/components/fields/MultiSelectField/MultiSelectFieldMobile.tsx
|
|
11495
|
-
import { useMemo as
|
|
11504
|
+
import { useMemo as useMemo20, useState as useState17 } from "react";
|
|
11496
11505
|
import { jsx as jsx37, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11497
11506
|
function MultiSelectFieldMobile({
|
|
11498
11507
|
fieldId,
|
|
@@ -11512,14 +11521,14 @@ function MultiSelectFieldMobile({
|
|
|
11512
11521
|
const [visible, setVisible] = useState17(false);
|
|
11513
11522
|
const [search, setSearch] = useState17("");
|
|
11514
11523
|
const [tempValues, setTempValues] = useState17(value);
|
|
11515
|
-
const filteredOptions =
|
|
11524
|
+
const filteredOptions = useMemo20(() => {
|
|
11516
11525
|
const keyword = search.trim().toLowerCase();
|
|
11517
11526
|
if (!keyword) return options;
|
|
11518
11527
|
return options.filter(
|
|
11519
11528
|
(option) => String(option.label ?? option.value).toLowerCase().includes(keyword)
|
|
11520
11529
|
);
|
|
11521
11530
|
}, [options, search]);
|
|
11522
|
-
const tempValueSet =
|
|
11531
|
+
const tempValueSet = useMemo20(
|
|
11523
11532
|
() => new Set(tempValues.map((option) => option.value)),
|
|
11524
11533
|
[tempValues]
|
|
11525
11534
|
);
|
|
@@ -14333,7 +14342,7 @@ function ImageField(props) {
|
|
|
14333
14342
|
import { useEffect as useEffect27 } from "react";
|
|
14334
14343
|
|
|
14335
14344
|
// packages/sdk/src/components/fields/SubFormField/SubFormCell.tsx
|
|
14336
|
-
import { useMemo as
|
|
14345
|
+
import { useMemo as useMemo21 } from "react";
|
|
14337
14346
|
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
14338
14347
|
var stringifyFallbackValue = (value) => {
|
|
14339
14348
|
if (value === void 0 || value === null) return "";
|
|
@@ -14354,7 +14363,7 @@ function SubFormCell({
|
|
|
14354
14363
|
const scopedFieldId = `${parentFieldId}.${rowIndex}.${column.fieldId}`;
|
|
14355
14364
|
const cellValue = row[column.fieldId];
|
|
14356
14365
|
const resolvedBehavior = behavior === "DISABLED" || behavior === "READONLY" ? behavior : column.behavior ?? behavior ?? "NORMAL";
|
|
14357
|
-
const childContext =
|
|
14366
|
+
const childContext = useMemo21(
|
|
14358
14367
|
() => ({
|
|
14359
14368
|
...parentContext,
|
|
14360
14369
|
formData: {
|
|
@@ -14676,7 +14685,7 @@ function SubFormField(props) {
|
|
|
14676
14685
|
import { useEffect as useEffect31 } from "react";
|
|
14677
14686
|
|
|
14678
14687
|
// packages/sdk/src/components/fields/UserSelectField/UserSelectFieldPC.tsx
|
|
14679
|
-
import { useEffect as useEffect28, useMemo as
|
|
14688
|
+
import { useEffect as useEffect28, useMemo as useMemo22, useState as useState20 } from "react";
|
|
14680
14689
|
import { Select as Select5 } from "antd";
|
|
14681
14690
|
import { jsx as jsx71, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
14682
14691
|
function UserSelectFieldPC({
|
|
@@ -14696,7 +14705,7 @@ function UserSelectFieldPC({
|
|
|
14696
14705
|
}) {
|
|
14697
14706
|
const { formData, setFieldValue, api } = useFormContext();
|
|
14698
14707
|
const rawValue = formData[fieldId];
|
|
14699
|
-
const value =
|
|
14708
|
+
const value = useMemo22(() => normalizeUserArray(rawValue), [rawValue]);
|
|
14700
14709
|
const disabled = behavior === "DISABLED";
|
|
14701
14710
|
const [optionsSource, setOptionsSource] = useState20(
|
|
14702
14711
|
() => dataSource.map(normalizeUser)
|
|
@@ -14790,7 +14799,7 @@ function UserSelectFieldPC({
|
|
|
14790
14799
|
setFieldValue(fieldId, normalized);
|
|
14791
14800
|
onChange?.(normalized);
|
|
14792
14801
|
};
|
|
14793
|
-
const options =
|
|
14802
|
+
const options = useMemo22(
|
|
14794
14803
|
() => optionsSource.map((u) => ({
|
|
14795
14804
|
value: getUserId(u),
|
|
14796
14805
|
label: formatUserDisplay(u, displayFormat)
|
|
@@ -14854,7 +14863,7 @@ function getUserNameLikeId(user) {
|
|
|
14854
14863
|
}
|
|
14855
14864
|
|
|
14856
14865
|
// packages/sdk/src/components/fields/UserSelectField/UserSelectFieldMobile.tsx
|
|
14857
|
-
import { useEffect as useEffect29, useMemo as
|
|
14866
|
+
import { useEffect as useEffect29, useMemo as useMemo23, useState as useState21 } from "react";
|
|
14858
14867
|
import * as MobileAntd2 from "antd-mobile";
|
|
14859
14868
|
import { jsx as jsx72, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
14860
14869
|
var getMobilePopup = () => {
|
|
@@ -14879,7 +14888,7 @@ function UserSelectFieldMobile({
|
|
|
14879
14888
|
}) {
|
|
14880
14889
|
const { formData, setFieldValue, api } = useFormContext();
|
|
14881
14890
|
const rawValue = formData[fieldId];
|
|
14882
|
-
const value =
|
|
14891
|
+
const value = useMemo23(() => normalizeUserArray(rawValue), [rawValue]);
|
|
14883
14892
|
const disabled = behavior === "DISABLED";
|
|
14884
14893
|
const [showPicker, setShowPicker] = useState21(false);
|
|
14885
14894
|
const [optionsSource, setOptionsSource] = useState21(
|
|
@@ -14987,7 +14996,7 @@ function UserSelectFieldMobile({
|
|
|
14987
14996
|
}
|
|
14988
14997
|
|
|
14989
14998
|
// packages/sdk/src/components/fields/UserSelectField/UserSelectFieldReadonly.tsx
|
|
14990
|
-
import { useEffect as useEffect30, useMemo as
|
|
14999
|
+
import { useEffect as useEffect30, useMemo as useMemo24 } from "react";
|
|
14991
15000
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
14992
15001
|
function UserSelectFieldReadonly({
|
|
14993
15002
|
fieldId,
|
|
@@ -14996,7 +15005,7 @@ function UserSelectFieldReadonly({
|
|
|
14996
15005
|
}) {
|
|
14997
15006
|
const { formData, setFieldValue, api } = useFormContext();
|
|
14998
15007
|
const rawValue = formData[fieldId];
|
|
14999
|
-
const value =
|
|
15008
|
+
const value = useMemo24(() => normalizeUserArray(rawValue), [rawValue]);
|
|
15000
15009
|
useEffect30(() => {
|
|
15001
15010
|
const missing = value.filter((item) => getUserNameLikeId2(item));
|
|
15002
15011
|
if (missing.length === 0) return;
|
|
@@ -15077,7 +15086,7 @@ function UserSelectField(props) {
|
|
|
15077
15086
|
import { useEffect as useEffect35 } from "react";
|
|
15078
15087
|
|
|
15079
15088
|
// packages/sdk/src/components/fields/DepartmentSelectField/DepartmentSelectFieldPC.tsx
|
|
15080
|
-
import { useEffect as useEffect33, useMemo as
|
|
15089
|
+
import { useEffect as useEffect33, useMemo as useMemo26, useRef as useRef10, useState as useState23 } from "react";
|
|
15081
15090
|
import { TreeSelect } from "antd";
|
|
15082
15091
|
|
|
15083
15092
|
// packages/sdk/src/components/fields/shared/departmentSearch.ts
|
|
@@ -15096,7 +15105,7 @@ function getDepartmentPathText(department, separator = "/") {
|
|
|
15096
15105
|
}
|
|
15097
15106
|
|
|
15098
15107
|
// packages/sdk/src/components/fields/shared/DepartmentPicker.tsx
|
|
15099
|
-
import { useEffect as useEffect32, useMemo as
|
|
15108
|
+
import { useEffect as useEffect32, useMemo as useMemo25, useRef as useRef9, useState as useState22 } from "react";
|
|
15100
15109
|
import { Button as Button9, Checkbox as Checkbox3, Empty as Empty7, Input as Input8, List as List2, Modal as Modal6, Space as Space4, Spin as Spin5, Tag as Tag5, Tree as Tree2 } from "antd";
|
|
15101
15110
|
import { ApartmentOutlined, SearchOutlined as SearchOutlined3 } from "@ant-design/icons";
|
|
15102
15111
|
import * as MobileAntd3 from "antd-mobile";
|
|
@@ -15197,11 +15206,11 @@ function DepartmentPickerPanel({
|
|
|
15197
15206
|
window.clearTimeout(timer);
|
|
15198
15207
|
};
|
|
15199
15208
|
}, [api, canRemoteSearch, searchDebounceMs, trimmedKeyword]);
|
|
15200
|
-
const filteredTreeData =
|
|
15209
|
+
const filteredTreeData = useMemo25(
|
|
15201
15210
|
() => showSearch ? matchSearch(loadedTreeData, trimmedKeyword) : loadedTreeData,
|
|
15202
15211
|
[loadedTreeData, showSearch, trimmedKeyword]
|
|
15203
15212
|
);
|
|
15204
|
-
const currentPath =
|
|
15213
|
+
const currentPath = useMemo25(() => {
|
|
15205
15214
|
if (!currentDeptId) return [];
|
|
15206
15215
|
const path = [];
|
|
15207
15216
|
let cursor = currentDeptId;
|
|
@@ -15213,7 +15222,7 @@ function DepartmentPickerPanel({
|
|
|
15213
15222
|
}
|
|
15214
15223
|
return path;
|
|
15215
15224
|
}, [currentDeptId, nodeMap, parentMap]);
|
|
15216
|
-
const mobileList =
|
|
15225
|
+
const mobileList = useMemo25(() => {
|
|
15217
15226
|
if (canRemoteSearch) {
|
|
15218
15227
|
return remoteSearchResults;
|
|
15219
15228
|
}
|
|
@@ -15531,7 +15540,7 @@ function DepartmentSelectFieldPC({
|
|
|
15531
15540
|
}) {
|
|
15532
15541
|
const { formData, setFieldValue, api } = useFormContext();
|
|
15533
15542
|
const rawValue = formData[fieldId];
|
|
15534
|
-
const value =
|
|
15543
|
+
const value = useMemo26(() => normalizeDepartmentArray(rawValue), [rawValue]);
|
|
15535
15544
|
const disabled = behavior === "DISABLED";
|
|
15536
15545
|
const configuredTreeData = treeData ?? EMPTY_TREE_DATA;
|
|
15537
15546
|
const remoteLoadedRef = useRef10(false);
|
|
@@ -15589,7 +15598,7 @@ function DepartmentSelectFieldPC({
|
|
|
15589
15598
|
}, [api, canRemoteSearch, searchDebounceMs, trimmedSearchKeyword]);
|
|
15590
15599
|
const scopedTreeData = filterTreeByScope(loadedTreeData, scopeType, specifiedDepts);
|
|
15591
15600
|
const allDepts = flattenDepartments(scopedTreeData);
|
|
15592
|
-
const scopedRemoteSearchResults =
|
|
15601
|
+
const scopedRemoteSearchResults = useMemo26(() => {
|
|
15593
15602
|
if (scopeType !== "specified" || !specifiedDepts?.length) {
|
|
15594
15603
|
return remoteSearchResults;
|
|
15595
15604
|
}
|
|
@@ -15600,7 +15609,7 @@ function DepartmentSelectFieldPC({
|
|
|
15600
15609
|
return node.path?.some((item) => specifiedSet.has(item.id));
|
|
15601
15610
|
});
|
|
15602
15611
|
}, [remoteSearchResults, scopeType, specifiedDepts]);
|
|
15603
|
-
const remoteDeptMap =
|
|
15612
|
+
const remoteDeptMap = useMemo26(() => {
|
|
15604
15613
|
const map = /* @__PURE__ */ new Map();
|
|
15605
15614
|
scopedRemoteSearchResults.forEach((node) => map.set(getDepartmentId(node), node));
|
|
15606
15615
|
return map;
|
|
@@ -15729,7 +15738,7 @@ function DepartmentSelectFieldPC({
|
|
|
15729
15738
|
}
|
|
15730
15739
|
|
|
15731
15740
|
// packages/sdk/src/components/fields/DepartmentSelectField/DepartmentSelectFieldMobile.tsx
|
|
15732
|
-
import { useEffect as useEffect34, useMemo as
|
|
15741
|
+
import { useEffect as useEffect34, useMemo as useMemo27, useRef as useRef11, useState as useState24 } from "react";
|
|
15733
15742
|
import * as MobileAntd4 from "antd-mobile";
|
|
15734
15743
|
import { jsx as jsx77, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
15735
15744
|
var EMPTY_TREE_DATA2 = [];
|
|
@@ -15764,7 +15773,7 @@ function DepartmentSelectFieldMobile({
|
|
|
15764
15773
|
}) {
|
|
15765
15774
|
const { formData, setFieldValue, api } = useFormContext();
|
|
15766
15775
|
const rawValue = formData[fieldId];
|
|
15767
|
-
const value =
|
|
15776
|
+
const value = useMemo27(() => normalizeDepartmentArray(rawValue), [rawValue]);
|
|
15768
15777
|
const disabled = behavior === "DISABLED";
|
|
15769
15778
|
const [showPicker, setShowPicker] = useState24(false);
|
|
15770
15779
|
const configuredTreeData = treeData ?? EMPTY_TREE_DATA2;
|
|
@@ -15869,7 +15878,7 @@ function DepartmentSelectFieldMobile({
|
|
|
15869
15878
|
}
|
|
15870
15879
|
|
|
15871
15880
|
// packages/sdk/src/components/fields/DepartmentSelectField/DepartmentSelectFieldReadonly.tsx
|
|
15872
|
-
import { useMemo as
|
|
15881
|
+
import { useMemo as useMemo28 } from "react";
|
|
15873
15882
|
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
15874
15883
|
function DepartmentSelectFieldReadonly({
|
|
15875
15884
|
fieldId,
|
|
@@ -15879,7 +15888,7 @@ function DepartmentSelectFieldReadonly({
|
|
|
15879
15888
|
}) {
|
|
15880
15889
|
const { formData } = useFormContext();
|
|
15881
15890
|
const rawValue = formData[fieldId];
|
|
15882
|
-
const value =
|
|
15891
|
+
const value = useMemo28(() => normalizeDepartmentArray(rawValue), [rawValue]);
|
|
15883
15892
|
const display = value.length > 0 ? value.map(
|
|
15884
15893
|
(d) => showFullPath ? getDepartmentFullPath(getDepartmentId(d), treeData) || getDepartmentName(d) : getDepartmentName(d)
|
|
15885
15894
|
).join(", ") : "--";
|
|
@@ -16027,7 +16036,7 @@ function CascadeSelectField(props) {
|
|
|
16027
16036
|
}
|
|
16028
16037
|
|
|
16029
16038
|
// packages/sdk/src/components/fields/AddressField/index.tsx
|
|
16030
|
-
import { useCallback as useCallback13, useEffect as useEffect37, useMemo as
|
|
16039
|
+
import { useCallback as useCallback13, useEffect as useEffect37, useMemo as useMemo29, useState as useState25 } from "react";
|
|
16031
16040
|
import { Button as Button10, Cascader as Cascader2, Input as Input9, Space as Space5, Spin as Spin6 } from "antd";
|
|
16032
16041
|
import * as MobileAntd5 from "antd-mobile";
|
|
16033
16042
|
import { jsx as jsx81, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
@@ -16173,7 +16182,7 @@ function AddressField(props) {
|
|
|
16173
16182
|
const { isMobile } = useDeviceDetect();
|
|
16174
16183
|
const behavior = propBehavior ?? fieldBehaviors[fieldId] ?? "NORMAL";
|
|
16175
16184
|
const rawValue = formData[fieldId];
|
|
16176
|
-
const value =
|
|
16185
|
+
const value = useMemo29(() => normalizeAddressValue(rawValue), [rawValue]);
|
|
16177
16186
|
const [options, setOptions] = useState25([]);
|
|
16178
16187
|
const [loadingRoots, setLoadingRoots] = useState25(false);
|
|
16179
16188
|
const [mobileOpen, setMobileOpen] = useState25(false);
|
|
@@ -16182,9 +16191,9 @@ function AddressField(props) {
|
|
|
16182
16191
|
const [mobileLoading, setMobileLoading] = useState25(false);
|
|
16183
16192
|
const [tempValue, setTempValue] = useState25();
|
|
16184
16193
|
const depth = modeDepth(mode);
|
|
16185
|
-
const levels =
|
|
16186
|
-
const valuePath =
|
|
16187
|
-
const displayOptions =
|
|
16194
|
+
const levels = useMemo29(() => activeLevels(mode), [mode]);
|
|
16195
|
+
const valuePath = useMemo29(() => valueToPath(value, levels), [levels, value]);
|
|
16196
|
+
const displayOptions = useMemo29(
|
|
16188
16197
|
() => mergeValuePathIntoOptions(options, value, levels, depth),
|
|
16189
16198
|
[depth, levels, options, value]
|
|
16190
16199
|
);
|
|
@@ -16435,7 +16444,7 @@ function AddressField(props) {
|
|
|
16435
16444
|
}
|
|
16436
16445
|
|
|
16437
16446
|
// packages/sdk/src/components/fields/AssociationFormField/index.tsx
|
|
16438
|
-
import { useCallback as useCallback14, useEffect as useEffect38, useMemo as
|
|
16447
|
+
import { useCallback as useCallback14, useEffect as useEffect38, useMemo as useMemo30, useRef as useRef12, useState as useState26 } from "react";
|
|
16439
16448
|
import { Button as Button11, Drawer, Input as Input10, Modal as Modal7, Select as Select6, Space as Space6, Spin as Spin7, Table as Table2, Tag as Tag6 } from "antd";
|
|
16440
16449
|
import { jsx as jsx82, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
16441
16450
|
var DEFAULT_PAGE_SIZE = 10;
|
|
@@ -16498,7 +16507,7 @@ function AssociationFormField(props) {
|
|
|
16498
16507
|
const { isMobile } = useDeviceDetect();
|
|
16499
16508
|
const behavior = propBehavior ?? fieldBehaviors[fieldId] ?? "NORMAL";
|
|
16500
16509
|
const rawValue = formData[fieldId];
|
|
16501
|
-
const value =
|
|
16510
|
+
const value = useMemo30(() => normalizeValues(rawValue), [rawValue]);
|
|
16502
16511
|
const disabled = behavior === "DISABLED";
|
|
16503
16512
|
const [options, setOptions] = useState26([]);
|
|
16504
16513
|
const [selectLoading, setSelectLoading] = useState26(false);
|
|
@@ -16532,11 +16541,11 @@ function AssociationFormField(props) {
|
|
|
16532
16541
|
const associationFormUuid = associationForm?.formUuid;
|
|
16533
16542
|
const associationMainFieldId = associationForm?.mainFieldId;
|
|
16534
16543
|
const canQuery = Boolean(associationAppType && associationFormUuid);
|
|
16535
|
-
const filterRulesKey =
|
|
16544
|
+
const filterRulesKey = useMemo30(
|
|
16536
16545
|
() => stableSerialize(associationForm?.dataFilterRules || []),
|
|
16537
16546
|
[associationForm?.dataFilterRules]
|
|
16538
16547
|
);
|
|
16539
|
-
const currentFieldFilterKey =
|
|
16548
|
+
const currentFieldFilterKey = useMemo30(() => {
|
|
16540
16549
|
const rules = associationForm?.dataFilterRules || [];
|
|
16541
16550
|
return stableSerialize(
|
|
16542
16551
|
rules.map((rule) => {
|
|
@@ -16545,7 +16554,7 @@ function AssociationFormField(props) {
|
|
|
16545
16554
|
})
|
|
16546
16555
|
);
|
|
16547
16556
|
}, [formData, associationForm?.dataFilterRules]);
|
|
16548
|
-
const filterDependencyKey =
|
|
16557
|
+
const filterDependencyKey = useMemo30(
|
|
16549
16558
|
() => `${filterRulesKey}:${currentFieldFilterKey}`,
|
|
16550
16559
|
[currentFieldFilterKey, filterRulesKey]
|
|
16551
16560
|
);
|
|
@@ -16674,7 +16683,7 @@ function AssociationFormField(props) {
|
|
|
16674
16683
|
},
|
|
16675
16684
|
[applyDataFilling, fieldId, multiple, onChange, setFieldValue]
|
|
16676
16685
|
);
|
|
16677
|
-
const selectorColumns =
|
|
16686
|
+
const selectorColumns = useMemo30(() => {
|
|
16678
16687
|
const configured = associationForm?.selectorColumns || [];
|
|
16679
16688
|
if (configured.length) {
|
|
16680
16689
|
return configured.map((column) => {
|
|
@@ -16709,7 +16718,7 @@ function AssociationFormField(props) {
|
|
|
16709
16718
|
}
|
|
16710
16719
|
];
|
|
16711
16720
|
}, [associationForm?.mainFieldId, associationForm?.selectorColumns]);
|
|
16712
|
-
const selectOptions =
|
|
16721
|
+
const selectOptions = useMemo30(
|
|
16713
16722
|
() => [...options, ...value].filter(
|
|
16714
16723
|
(item, index, list) => list.findIndex((candidate) => candidate.value === item.value) === index
|
|
16715
16724
|
).map((item) => ({ label: item.label, value: item.value })),
|
|
@@ -16917,7 +16926,7 @@ function AssociationFormField(props) {
|
|
|
16917
16926
|
}
|
|
16918
16927
|
|
|
16919
16928
|
// packages/sdk/src/components/fields/EditorField/index.tsx
|
|
16920
|
-
import { useCallback as useCallback15, useEffect as useEffect39, useMemo as
|
|
16929
|
+
import { useCallback as useCallback15, useEffect as useEffect39, useMemo as useMemo31, useRef as useRef13, useState as useState27 } from "react";
|
|
16921
16930
|
import { Extension } from "@tiptap/core";
|
|
16922
16931
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
16923
16932
|
import StarterKit from "@tiptap/starter-kit";
|
|
@@ -17590,9 +17599,9 @@ function RichTextEditorCore({
|
|
|
17590
17599
|
useEffect39(() => {
|
|
17591
17600
|
onChangeRef.current = onChange;
|
|
17592
17601
|
}, [onChange]);
|
|
17593
|
-
const actions =
|
|
17602
|
+
const actions = useMemo31(() => normalizeToolbarConfig(toolbarConfig), [toolbarConfig]);
|
|
17594
17603
|
const visibleActions = mobile ? [] : actions;
|
|
17595
|
-
const extensions =
|
|
17604
|
+
const extensions = useMemo31(
|
|
17596
17605
|
() => [
|
|
17597
17606
|
StarterKit.configure({
|
|
17598
17607
|
heading: { levels: [1, 2, 3] },
|
|
@@ -19034,9 +19043,9 @@ function FormProvider({
|
|
|
19034
19043
|
runtime,
|
|
19035
19044
|
children
|
|
19036
19045
|
}) {
|
|
19037
|
-
const api =
|
|
19046
|
+
const api = useMemo32(() => createFormRuntimeApi(config.api), [config.api]);
|
|
19038
19047
|
const [runtimeDefaults, setRuntimeDefaults] = useState30({});
|
|
19039
|
-
const effects =
|
|
19048
|
+
const effects = useMemo32(
|
|
19040
19049
|
() => [
|
|
19041
19050
|
...schema.rules ?? [],
|
|
19042
19051
|
...schema.fields.flatMap((field) => field.optionEffects ?? []),
|
|
@@ -19044,18 +19053,18 @@ function FormProvider({
|
|
|
19044
19053
|
],
|
|
19045
19054
|
[schema.rules, schema.fields, config.effects]
|
|
19046
19055
|
);
|
|
19047
|
-
const defaultRuntime =
|
|
19056
|
+
const defaultRuntime = useMemo32(
|
|
19048
19057
|
() => ({
|
|
19049
19058
|
appType: config.appType,
|
|
19050
19059
|
fetchFormData: (params) => fetchRuntimeFormData(api, config.appType, params)
|
|
19051
19060
|
}),
|
|
19052
19061
|
[api, config.appType]
|
|
19053
19062
|
);
|
|
19054
|
-
const mergedRuntime =
|
|
19063
|
+
const mergedRuntime = useMemo32(
|
|
19055
19064
|
() => ({ ...defaultRuntime, ...schema.runtime, ...runtimeDefaults, ...runtime }),
|
|
19056
19065
|
[defaultRuntime, schema.runtime, runtimeDefaults, runtime]
|
|
19057
19066
|
);
|
|
19058
|
-
const computedInitialValues =
|
|
19067
|
+
const computedInitialValues = useMemo32(() => {
|
|
19059
19068
|
const values = {};
|
|
19060
19069
|
for (const field of schema.fields) {
|
|
19061
19070
|
const defaultValue = resolveDefaultValue(field, mergedRuntime);
|
|
@@ -19107,7 +19116,7 @@ function FormProvider({
|
|
|
19107
19116
|
return changed ? next : prev;
|
|
19108
19117
|
});
|
|
19109
19118
|
}, [mergedRuntime, schema.fields]);
|
|
19110
|
-
const fieldBehaviors =
|
|
19119
|
+
const fieldBehaviors = useMemo32(() => {
|
|
19111
19120
|
const baseBehaviors = {};
|
|
19112
19121
|
for (const field of schema.fields) {
|
|
19113
19122
|
baseBehaviors[field.fieldId] = field.behavior || "NORMAL";
|
|
@@ -19130,11 +19139,11 @@ function FormProvider({
|
|
|
19130
19139
|
}
|
|
19131
19140
|
return computed;
|
|
19132
19141
|
}, [schema, effects, config.permissions, config.mode, formData]);
|
|
19133
|
-
const fieldOverrides =
|
|
19142
|
+
const fieldOverrides = useMemo32(
|
|
19134
19143
|
() => evaluateFieldOverrides(effects, formData),
|
|
19135
19144
|
[effects, formData]
|
|
19136
19145
|
);
|
|
19137
|
-
const layoutBehaviors =
|
|
19146
|
+
const layoutBehaviors = useMemo32(
|
|
19138
19147
|
() => evaluateLayoutBehaviors(effects, formData),
|
|
19139
19148
|
[effects, formData]
|
|
19140
19149
|
);
|
|
@@ -19358,7 +19367,7 @@ function FormProvider({
|
|
|
19358
19367
|
window.clearTimeout(timer);
|
|
19359
19368
|
};
|
|
19360
19369
|
}, [schema.fields, mergedRuntime, formData]);
|
|
19361
|
-
const contextValue =
|
|
19370
|
+
const contextValue = useMemo32(
|
|
19362
19371
|
() => ({
|
|
19363
19372
|
mode: config.mode,
|
|
19364
19373
|
schema,
|
|
@@ -20078,7 +20087,7 @@ function isLayoutVisible(visibleWhen, formData) {
|
|
|
20078
20087
|
}
|
|
20079
20088
|
|
|
20080
20089
|
// packages/sdk/src/components/core/FormShell.tsx
|
|
20081
|
-
import { useEffect as useEffect45, useMemo as
|
|
20090
|
+
import { useEffect as useEffect45, useMemo as useMemo33 } from "react";
|
|
20082
20091
|
import * as Antd2 from "antd";
|
|
20083
20092
|
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
20084
20093
|
function normalizeMaxWidth(maxWidth) {
|
|
@@ -20111,7 +20120,7 @@ function FormShell({ children, appearance, className }) {
|
|
|
20111
20120
|
useEffect45(() => {
|
|
20112
20121
|
form?.setFieldsValue?.(formData);
|
|
20113
20122
|
}, [form, formData]);
|
|
20114
|
-
const style =
|
|
20123
|
+
const style = useMemo33(() => {
|
|
20115
20124
|
if (!maxWidth) return void 0;
|
|
20116
20125
|
return {
|
|
20117
20126
|
maxWidth,
|
|
@@ -20976,7 +20985,7 @@ var InnerDetailContent = ({
|
|
|
20976
20985
|
const formDataRef = useRef18(void 0);
|
|
20977
20986
|
const validateRef = useRef18(void 0);
|
|
20978
20987
|
const [accessDenied, setAccessDenied] = useState37(false);
|
|
20979
|
-
const fieldIds =
|
|
20988
|
+
const fieldIds = useMemo34(() => schema.fields.map((field) => field.fieldId), [schema.fields]);
|
|
20980
20989
|
const {
|
|
20981
20990
|
loading,
|
|
20982
20991
|
mode,
|
|
@@ -22084,15 +22093,15 @@ var FormSubmitTemplate = ({
|
|
|
22084
22093
|
};
|
|
22085
22094
|
|
|
22086
22095
|
// packages/sdk/src/components/templates/ProcessDetailTemplate.tsx
|
|
22087
|
-
import { useCallback as useCallback27, useMemo as
|
|
22096
|
+
import { useCallback as useCallback27, useMemo as useMemo38, useRef as useRef23, useState as useState44 } from "react";
|
|
22088
22097
|
import dayjs11 from "dayjs";
|
|
22089
22098
|
import { Form as AntForm, Input as Input14, Modal as Modal12, message as message5 } from "antd";
|
|
22090
22099
|
|
|
22091
22100
|
// packages/sdk/src/components/hooks/useProcessDetail.ts
|
|
22092
|
-
import { useState as useState41, useEffect as useEffect51, useCallback as useCallback25, useRef as useRef21, useMemo as
|
|
22101
|
+
import { useState as useState41, useEffect as useEffect51, useCallback as useCallback25, useRef as useRef21, useMemo as useMemo36 } from "react";
|
|
22093
22102
|
|
|
22094
22103
|
// packages/sdk/src/components/hooks/useFieldPermission.ts
|
|
22095
|
-
import { useMemo as
|
|
22104
|
+
import { useMemo as useMemo35, useCallback as useCallback24 } from "react";
|
|
22096
22105
|
var normalizeBehavior = (value) => {
|
|
22097
22106
|
if (value === "EDITABLE") return "NORMAL";
|
|
22098
22107
|
if (value === "READ_ONLY") return "READONLY";
|
|
@@ -22170,7 +22179,7 @@ function useFieldPermission(options) {
|
|
|
22170
22179
|
}
|
|
22171
22180
|
return behaviors;
|
|
22172
22181
|
}, [viewPermissions, processDefinition, currentTask, isApprover, mode]);
|
|
22173
|
-
const fieldBehaviors =
|
|
22182
|
+
const fieldBehaviors = useMemo35(() => computeBehaviors(), [computeBehaviors]);
|
|
22174
22183
|
return { fieldBehaviors, computeBehaviors };
|
|
22175
22184
|
}
|
|
22176
22185
|
|
|
@@ -22224,7 +22233,7 @@ function useProcessDetail(options) {
|
|
|
22224
22233
|
mountedRef.current = false;
|
|
22225
22234
|
};
|
|
22226
22235
|
}, []);
|
|
22227
|
-
const currentTask =
|
|
22236
|
+
const currentTask = useMemo36(
|
|
22228
22237
|
() => mergeCurrentTask(processInfo?.currentTask, approvalTasks[0]),
|
|
22229
22238
|
[processInfo?.currentTask, approvalTasks]
|
|
22230
22239
|
);
|
|
@@ -22244,7 +22253,7 @@ function useProcessDetail(options) {
|
|
|
22244
22253
|
isApprover: isProcessFinal ? false : isApprover,
|
|
22245
22254
|
mode
|
|
22246
22255
|
});
|
|
22247
|
-
const activeActions =
|
|
22256
|
+
const activeActions = useMemo36(() => {
|
|
22248
22257
|
if (!isApprover || isProcessFinal) return [];
|
|
22249
22258
|
const actions = currentTask?.actions && currentTask.actions.length > 0 ? [...currentTask.actions] : [...DEFAULT_APPROVAL_ACTIONS];
|
|
22250
22259
|
if (canWithdraw && !actions.some((action) => action.action === "withdraw")) {
|
|
@@ -22659,7 +22668,7 @@ function useApprovalActions(options) {
|
|
|
22659
22668
|
}
|
|
22660
22669
|
|
|
22661
22670
|
// packages/sdk/src/components/modules/ApprovalActionBar.tsx
|
|
22662
|
-
import React67, { useMemo as
|
|
22671
|
+
import React67, { useMemo as useMemo37, useState as useState43 } from "react";
|
|
22663
22672
|
import { Form as Form5, Input as Input13, Modal as Modal11, Select as Select9 } from "antd";
|
|
22664
22673
|
import {
|
|
22665
22674
|
CheckOutlined as CheckOutlined2,
|
|
@@ -22720,7 +22729,7 @@ function DefaultTransferSelector({
|
|
|
22720
22729
|
}) {
|
|
22721
22730
|
const formContext = React67.useContext(FormContext);
|
|
22722
22731
|
const { isMobile } = useDeviceDetect();
|
|
22723
|
-
const fallbackApi =
|
|
22732
|
+
const fallbackApi = useMemo37(() => createFormRuntimeApi(), []);
|
|
22724
22733
|
const api = formContext?.api ?? fallbackApi;
|
|
22725
22734
|
const [open, setOpen] = useState43(false);
|
|
22726
22735
|
const [selectedUsers, setSelectedUsers] = useState43([]);
|
|
@@ -22781,7 +22790,7 @@ var ApprovalActionBar = ({
|
|
|
22781
22790
|
const [modalAction, setModalAction] = useState43(null);
|
|
22782
22791
|
const [activeAction, setActiveAction] = useState43(null);
|
|
22783
22792
|
const [loading, setLoading] = useState43(false);
|
|
22784
|
-
const visibleActions =
|
|
22793
|
+
const visibleActions = useMemo37(
|
|
22785
22794
|
() => actions.filter((action) => !action.hidden).sort((a, b) => (actionPriority2[a.action] ?? 50) - (actionPriority2[b.action] ?? 50)),
|
|
22786
22795
|
[actions]
|
|
22787
22796
|
);
|
|
@@ -23058,7 +23067,7 @@ var InnerProcessContent = ({
|
|
|
23058
23067
|
const [initiatorApproverOpen, setInitiatorApproverOpen] = useState44(false);
|
|
23059
23068
|
const [initiatorApproverRequirements, setInitiatorApproverRequirements] = useState44([]);
|
|
23060
23069
|
const [pendingResubmitComments, setPendingResubmitComments] = useState44();
|
|
23061
|
-
const fieldIds =
|
|
23070
|
+
const fieldIds = useMemo38(() => schema.fields.map((field) => field.fieldId), [schema.fields]);
|
|
23062
23071
|
const { api } = useFormContext();
|
|
23063
23072
|
const {
|
|
23064
23073
|
loading,
|
|
@@ -23257,7 +23266,7 @@ var InnerProcessContent = ({
|
|
|
23257
23266
|
setWithdrawOpen(false);
|
|
23258
23267
|
withdrawForm.resetFields();
|
|
23259
23268
|
}, [withdrawForm]);
|
|
23260
|
-
const bottomActions =
|
|
23269
|
+
const bottomActions = useMemo38(() => {
|
|
23261
23270
|
if (isApprover && !isOriginatorReturn && activeActions.length > 0) return [];
|
|
23262
23271
|
if (isProcessCompleted) {
|
|
23263
23272
|
if (mode === "readonly") {
|
|
@@ -23607,7 +23616,7 @@ var StandardFormPage = ({
|
|
|
23607
23616
|
const formType = normalizeStandardFormType(
|
|
23608
23617
|
schema.template?.formType || (resolvedMode === "process" ? "process" : "form")
|
|
23609
23618
|
);
|
|
23610
|
-
const submitApi =
|
|
23619
|
+
const submitApi = useMemo39(() => {
|
|
23611
23620
|
if (!onSubmit) return void 0;
|
|
23612
23621
|
return {
|
|
23613
23622
|
submitFormData: async (payload) => onSubmit(
|
|
@@ -23621,7 +23630,7 @@ var StandardFormPage = ({
|
|
|
23621
23630
|
startProcessFromExistingInstance: async (payload) => onSubmit(payload)
|
|
23622
23631
|
};
|
|
23623
23632
|
}, [formType, onSubmit]);
|
|
23624
|
-
const api =
|
|
23633
|
+
const api = useMemo39(() => {
|
|
23625
23634
|
if (!externalApi && !submitApi) return void 0;
|
|
23626
23635
|
return {
|
|
23627
23636
|
...externalApi ?? {},
|
|
@@ -25110,7 +25119,7 @@ var DataManagementList = ({
|
|
|
25110
25119
|
actionOverrides
|
|
25111
25120
|
}) => {
|
|
25112
25121
|
const rootRef = useRef24(null);
|
|
25113
|
-
const api =
|
|
25122
|
+
const api = useMemo40(() => {
|
|
25114
25123
|
if (typeof requestOverride === "function") {
|
|
25115
25124
|
return createFormRuntimeApi({ request: requestOverride });
|
|
25116
25125
|
}
|
|
@@ -25203,7 +25212,7 @@ var DataManagementList = ({
|
|
|
25203
25212
|
mounted = false;
|
|
25204
25213
|
};
|
|
25205
25214
|
}, [appType, formUuid, permissionMode, request]);
|
|
25206
|
-
const baseActionCan =
|
|
25215
|
+
const baseActionCan = useMemo40(() => {
|
|
25207
25216
|
if (permissionMode === "auto") {
|
|
25208
25217
|
return FORM_ACTION_PERMISSIONS.reduce((result, action) => {
|
|
25209
25218
|
result[action] = Boolean(actionSummary?.can?.[action]);
|
|
@@ -25237,15 +25246,15 @@ var DataManagementList = ({
|
|
|
25237
25246
|
const canExport = canAction("export");
|
|
25238
25247
|
const canImport = canAction("import");
|
|
25239
25248
|
const canWorkflow = canAction("workflow");
|
|
25240
|
-
const visibleFields =
|
|
25249
|
+
const visibleFields = useMemo40(
|
|
25241
25250
|
() => showFields.map((fieldId) => fields.find((field) => field.fieldId === fieldId)).filter(Boolean),
|
|
25242
25251
|
[fields, showFields]
|
|
25243
25252
|
);
|
|
25244
|
-
const forcedShowFieldIds =
|
|
25253
|
+
const forcedShowFieldIds = useMemo40(
|
|
25245
25254
|
() => new Set(forcedConfig?.showFields || []),
|
|
25246
25255
|
[forcedConfig?.showFields]
|
|
25247
25256
|
);
|
|
25248
|
-
const forcedLockFieldIds =
|
|
25257
|
+
const forcedLockFieldIds = useMemo40(
|
|
25249
25258
|
() => new Set(forcedConfig?.lockFieldIds || []),
|
|
25250
25259
|
[forcedConfig?.lockFieldIds]
|
|
25251
25260
|
);
|
|
@@ -25639,7 +25648,7 @@ var DataManagementList = ({
|
|
|
25639
25648
|
ACTION_COLUMN_MIN_WIDTH,
|
|
25640
25649
|
Math.min(rowActionCount, visibleRowActionLimit) * ACTION_BUTTON_ESTIMATED_WIDTH + (rowActionCount > visibleRowActionLimit ? ACTION_MORE_BUTTON_WIDTH : 0) + ACTION_COLUMN_HORIZONTAL_PADDING
|
|
25641
25650
|
);
|
|
25642
|
-
const columns =
|
|
25651
|
+
const columns = useMemo40(() => {
|
|
25643
25652
|
const baseColumns = visibleFields.map((field) => {
|
|
25644
25653
|
const columnWidth = widths[field.fieldId] || field.width || 160;
|
|
25645
25654
|
return {
|
|
@@ -25771,7 +25780,7 @@ var DataManagementList = ({
|
|
|
25771
25780
|
actionColumnWidth
|
|
25772
25781
|
)
|
|
25773
25782
|
);
|
|
25774
|
-
const importPreviewColumns =
|
|
25783
|
+
const importPreviewColumns = useMemo40(() => {
|
|
25775
25784
|
const keys = Array.from(
|
|
25776
25785
|
new Set(importPreview.flatMap((record) => Object.keys(record || {})))
|
|
25777
25786
|
).slice(0, 16);
|
|
@@ -26534,12 +26543,12 @@ function BuiltinRouteRenderer({
|
|
|
26534
26543
|
const [error, setError] = useState46("");
|
|
26535
26544
|
const [reloadKey, setReloadKey] = useState46(0);
|
|
26536
26545
|
const requestConfig = requestOverride && typeof requestOverride === "object" ? requestOverride : void 0;
|
|
26537
|
-
const request =
|
|
26546
|
+
const request = useMemo41(() => {
|
|
26538
26547
|
if (typeof requestOverride === "function") return requestOverride;
|
|
26539
26548
|
if (requestConfig?.request) return requestConfig.request;
|
|
26540
26549
|
return createBuiltinRouteRequest(requestConfig?.baseUrl || normalizedServicePrefix, fetchImpl);
|
|
26541
26550
|
}, [fetchImpl, normalizedServicePrefix, requestConfig, requestOverride]);
|
|
26542
|
-
const api =
|
|
26551
|
+
const api = useMemo41(
|
|
26543
26552
|
() => createFormRuntimeApi({
|
|
26544
26553
|
baseUrl: normalizedServicePrefix,
|
|
26545
26554
|
...requestConfig || {},
|
|
@@ -26550,7 +26559,7 @@ function BuiltinRouteRenderer({
|
|
|
26550
26559
|
const appType = appTypeProp || route?.appType || "";
|
|
26551
26560
|
const formUuid = route ? pickRouteValue(route, "formUuid", "menuFormUuid") : "";
|
|
26552
26561
|
const formInstId = route ? pickRouteValue(route, "formInstId", "formInstanceId") : "";
|
|
26553
|
-
const routeConfig =
|
|
26562
|
+
const routeConfig = useMemo41(
|
|
26554
26563
|
() => route ? resolveRouteConfig(route, config) : {},
|
|
26555
26564
|
[config, route]
|
|
26556
26565
|
);
|
|
@@ -26728,6 +26737,7 @@ export {
|
|
|
26728
26737
|
createBrowserPageBridge,
|
|
26729
26738
|
createBrowserPageContext,
|
|
26730
26739
|
createBuiltinRouteRequest,
|
|
26740
|
+
createPageFormRuntimeApi,
|
|
26731
26741
|
createPageSdk,
|
|
26732
26742
|
createPublicAccessClient,
|
|
26733
26743
|
createReactPage,
|
|
@@ -26757,6 +26767,7 @@ export {
|
|
|
26757
26767
|
useNavigation,
|
|
26758
26768
|
useOpenXiangda,
|
|
26759
26769
|
usePageContext,
|
|
26770
|
+
usePageFormRuntimeApi,
|
|
26760
26771
|
usePageProps,
|
|
26761
26772
|
usePageRoute,
|
|
26762
26773
|
usePageSdk,
|