openxiangda 1.0.154 → 1.0.156
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 +17 -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/components/index.cjs +2 -1
- package/packages/sdk/dist/components/index.cjs.map +1 -1
- package/packages/sdk/dist/components/index.mjs +2 -1
- package/packages/sdk/dist/components/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/index.cjs +846 -796
- 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 +232 -182
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +274 -224
- 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 +146 -96
- 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,111 @@ 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 FILE_URL_KEYS = [
|
|
3828
|
+
"url",
|
|
3829
|
+
"downloadUrl",
|
|
3830
|
+
"publicUrl",
|
|
3831
|
+
"relayUrl",
|
|
3832
|
+
"previewUrl",
|
|
3833
|
+
"metadataUrl",
|
|
3834
|
+
"officeTextPreviewUrl"
|
|
3835
|
+
];
|
|
3836
|
+
var resolveServicePrefix = (sdk) => {
|
|
3837
|
+
const value = sdk.context?.env?.servicePrefix;
|
|
3838
|
+
return typeof value === "string" && value.trim() ? value.trim().replace(/\/+$/, "") : "/service";
|
|
3839
|
+
};
|
|
3840
|
+
var normalizeServiceFileUrl = (value, servicePrefix) => {
|
|
3841
|
+
if (typeof value !== "string" || !value) return value;
|
|
3842
|
+
if (/^(https?:)?\/\//i.test(value) || /^(blob|data):/i.test(value)) return value;
|
|
3843
|
+
if (value === servicePrefix || value.startsWith(`${servicePrefix}/`)) return value;
|
|
3844
|
+
return value.startsWith("/file/") ? `${servicePrefix}${value}` : value;
|
|
3845
|
+
};
|
|
3846
|
+
var normalizeFileTicketResult2 = (payload, servicePrefix) => {
|
|
3847
|
+
if (typeof payload === "string") {
|
|
3848
|
+
return normalizeServiceFileUrl(payload, servicePrefix);
|
|
3849
|
+
}
|
|
3850
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) return payload;
|
|
3851
|
+
const normalized = { ...payload };
|
|
3852
|
+
FILE_URL_KEYS.forEach((key) => {
|
|
3853
|
+
normalized[key] = normalizeServiceFileUrl(normalized[key], servicePrefix);
|
|
3854
|
+
});
|
|
3855
|
+
return normalized;
|
|
3856
|
+
};
|
|
3857
|
+
var createPageFormRuntimeApi = (sdk) => {
|
|
3858
|
+
const servicePrefix = resolveServicePrefix(sdk);
|
|
3859
|
+
const request = async (config) => {
|
|
3860
|
+
const options = toPageRequest(config);
|
|
3861
|
+
if (config.responseType === "blob") {
|
|
3862
|
+
const response = await sdk.transport.download(options);
|
|
3863
|
+
return response.blob;
|
|
3864
|
+
}
|
|
3865
|
+
return toRuntimeResponse(await sdk.transport.request(options));
|
|
3866
|
+
};
|
|
3867
|
+
return createFormRuntimeApi({
|
|
3868
|
+
baseUrl: servicePrefix,
|
|
3869
|
+
request,
|
|
3870
|
+
createFileAccessTicket: async (bucketName, objectName, fileName, purpose = "preview", options = {}) => normalizeFileTicketResult2(
|
|
3871
|
+
unwrapPageResult(
|
|
3872
|
+
await sdk.createFileAccessTicket(
|
|
3873
|
+
bucketName,
|
|
3874
|
+
objectName,
|
|
3875
|
+
fileName,
|
|
3876
|
+
purpose,
|
|
3877
|
+
options
|
|
3878
|
+
)
|
|
3879
|
+
),
|
|
3880
|
+
servicePrefix
|
|
3881
|
+
),
|
|
3882
|
+
createDownloadTicket: async (bucketName, objectName, fileName) => normalizeFileTicketResult2(
|
|
3883
|
+
unwrapPageResult(
|
|
3884
|
+
await sdk.request({
|
|
3885
|
+
path: "/file/download-ticket",
|
|
3886
|
+
method: "post",
|
|
3887
|
+
body: { bucketName, objectName, fileName }
|
|
3888
|
+
})
|
|
3889
|
+
),
|
|
3890
|
+
servicePrefix
|
|
3891
|
+
)
|
|
3892
|
+
});
|
|
3893
|
+
};
|
|
3894
|
+
var usePageFormRuntimeApi = () => {
|
|
3895
|
+
const sdk = usePageSdk();
|
|
3896
|
+
return useMemo4(() => createPageFormRuntimeApi(sdk), [sdk]);
|
|
3897
|
+
};
|
|
3898
|
+
|
|
3899
|
+
// packages/sdk/src/runtime/react/filePreview.tsx
|
|
3900
|
+
import React6, { useMemo as useMemo7, useState as useState6 } from "react";
|
|
3901
|
+
import { Empty as Empty3 } from "antd";
|
|
3902
|
+
|
|
3799
3903
|
// packages/sdk/src/components/fields/shared/fieldFormat.ts
|
|
3800
3904
|
function createUid(prefix = "field") {
|
|
3801
3905
|
return `${prefix}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
@@ -4327,7 +4431,7 @@ var convertHeicPreview = async (request, url) => {
|
|
|
4327
4431
|
};
|
|
4328
4432
|
|
|
4329
4433
|
// packages/sdk/src/components/file-preview/FilePreviewContent.tsx
|
|
4330
|
-
import { useEffect as useEffect3, useMemo as
|
|
4434
|
+
import { useEffect as useEffect3, useMemo as useMemo5, useRef as useRef2, useState as useState3 } from "react";
|
|
4331
4435
|
import { Alert, Button, Empty, Image as Image2, Spin, Table, Tabs, Typography } from "antd";
|
|
4332
4436
|
import { DownloadOutlined, FileOutlined, ReloadOutlined } from "@ant-design/icons";
|
|
4333
4437
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
@@ -4772,7 +4876,7 @@ var OnlyOfficePreview = ({
|
|
|
4772
4876
|
configUrl,
|
|
4773
4877
|
ticket
|
|
4774
4878
|
}) => {
|
|
4775
|
-
const editorId =
|
|
4879
|
+
const editorId = useMemo5(
|
|
4776
4880
|
() => `openxiangda-onlyoffice-${String(ticket || "editor").replace(/[^a-zA-Z0-9_-]/g, "")}`,
|
|
4777
4881
|
[ticket]
|
|
4778
4882
|
);
|
|
@@ -5148,7 +5252,7 @@ var FilePreviewPage = ({
|
|
|
5148
5252
|
};
|
|
5149
5253
|
|
|
5150
5254
|
// packages/sdk/src/components/file-preview/useFilePreview.tsx
|
|
5151
|
-
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as
|
|
5255
|
+
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo6, useState as useState5 } from "react";
|
|
5152
5256
|
import { Alert as Alert3, Button as Button3, Image as Image3, Modal, Spin as Spin3, Typography as Typography3 } from "antd";
|
|
5153
5257
|
import { CloseOutlined, DownloadOutlined as DownloadOutlined3 } from "@ant-design/icons";
|
|
5154
5258
|
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -5177,7 +5281,7 @@ var useFilePreviewController = ({
|
|
|
5177
5281
|
enabled = true,
|
|
5178
5282
|
requireServerCapability = true
|
|
5179
5283
|
}) => {
|
|
5180
|
-
const itemSignature =
|
|
5284
|
+
const itemSignature = useMemo6(
|
|
5181
5285
|
() => items.map(
|
|
5182
5286
|
(item, index) => [
|
|
5183
5287
|
getPreviewItemKey(item, index),
|
|
@@ -5369,7 +5473,8 @@ var useFilePreviewController = ({
|
|
|
5369
5473
|
);
|
|
5370
5474
|
url = typeof ticket === "string" ? ticket : ticket?.downloadUrl || ticket?.relayUrl || ticket?.url || url;
|
|
5371
5475
|
}
|
|
5372
|
-
|
|
5476
|
+
const resolvedUrl = resolvePreviewServiceUrl(url);
|
|
5477
|
+
if (resolvedUrl && typeof window !== "undefined") window.location.assign(resolvedUrl);
|
|
5373
5478
|
},
|
|
5374
5479
|
[api, bucketName]
|
|
5375
5480
|
);
|
|
@@ -5540,63 +5645,6 @@ function FileStatusText({
|
|
|
5540
5645
|
// packages/sdk/src/runtime/react/filePreview.tsx
|
|
5541
5646
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
5542
5647
|
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
5648
|
var useFilePreview = ({
|
|
5601
5649
|
items = EMPTY_ITEMS,
|
|
5602
5650
|
appType,
|
|
@@ -5605,7 +5653,7 @@ var useFilePreview = ({
|
|
|
5605
5653
|
requireServerCapability = true
|
|
5606
5654
|
}) => {
|
|
5607
5655
|
const sdk = usePageSdk();
|
|
5608
|
-
const api =
|
|
5656
|
+
const api = useMemo7(() => createPageFormRuntimeApi(sdk), [sdk]);
|
|
5609
5657
|
const preview = useFilePreviewController({
|
|
5610
5658
|
items,
|
|
5611
5659
|
api,
|
|
@@ -5793,7 +5841,7 @@ var ImagePreviewGrid = ({
|
|
|
5793
5841
|
};
|
|
5794
5842
|
|
|
5795
5843
|
// packages/sdk/src/runtime/react/workflow.tsx
|
|
5796
|
-
import { useCallback as useCallback8, useEffect as useEffect10, useMemo as
|
|
5844
|
+
import { useCallback as useCallback8, useEffect as useEffect10, useMemo as useMemo13, useRef as useRef5, useState as useState11 } from "react";
|
|
5797
5845
|
import { Form, Input as Input2, Modal as Modal5, Select as Select2 } from "antd";
|
|
5798
5846
|
import {
|
|
5799
5847
|
CheckOutlined,
|
|
@@ -5805,7 +5853,7 @@ import {
|
|
|
5805
5853
|
} from "@ant-design/icons";
|
|
5806
5854
|
|
|
5807
5855
|
// packages/sdk/src/components/modules/StickyActionBar.tsx
|
|
5808
|
-
import { useEffect as useEffect6, useMemo as
|
|
5856
|
+
import { useEffect as useEffect6, useMemo as useMemo8, useState as useState7 } from "react";
|
|
5809
5857
|
import { Button as Button4, Dropdown, Tooltip as Tooltip2 } from "antd";
|
|
5810
5858
|
import { MoreOutlined } from "@ant-design/icons";
|
|
5811
5859
|
|
|
@@ -5848,7 +5896,7 @@ var StickyActionBar = ({
|
|
|
5848
5896
|
window.addEventListener("resize", update);
|
|
5849
5897
|
return () => window.removeEventListener("resize", update);
|
|
5850
5898
|
}, []);
|
|
5851
|
-
const visibleActions =
|
|
5899
|
+
const visibleActions = useMemo8(
|
|
5852
5900
|
() => actions.filter((action) => action.visible !== false).sort((left, right) => getActionPriority(left) - getActionPriority(right)),
|
|
5853
5901
|
[actions]
|
|
5854
5902
|
);
|
|
@@ -5917,7 +5965,7 @@ var StickyActionBar = ({
|
|
|
5917
5965
|
};
|
|
5918
5966
|
|
|
5919
5967
|
// packages/sdk/src/components/modules/ApprovalTimeline.tsx
|
|
5920
|
-
import { useMemo as
|
|
5968
|
+
import { useMemo as useMemo9 } from "react";
|
|
5921
5969
|
import {
|
|
5922
5970
|
ApiOutlined,
|
|
5923
5971
|
CheckCircleFilled,
|
|
@@ -6095,8 +6143,8 @@ var ApprovalTimeline = ({
|
|
|
6095
6143
|
compactMode = false,
|
|
6096
6144
|
showApproverInfo = true
|
|
6097
6145
|
}) => {
|
|
6098
|
-
const taskList =
|
|
6099
|
-
const groups =
|
|
6146
|
+
const taskList = useMemo9(() => Array.isArray(tasks) ? tasks : [], [tasks]);
|
|
6147
|
+
const groups = useMemo9(() => groupTasks(taskList), [taskList]);
|
|
6100
6148
|
if (taskList.length === 0) {
|
|
6101
6149
|
return /* @__PURE__ */ jsx9(
|
|
6102
6150
|
"div",
|
|
@@ -6242,7 +6290,7 @@ var ProcessPreview = ({
|
|
|
6242
6290
|
};
|
|
6243
6291
|
|
|
6244
6292
|
// packages/sdk/src/components/modules/InitiatorApproverSelector.tsx
|
|
6245
|
-
import { useCallback as useCallback7, useEffect as useEffect9, useMemo as
|
|
6293
|
+
import { useCallback as useCallback7, useEffect as useEffect9, useMemo as useMemo12, useRef as useRef4, useState as useState10 } from "react";
|
|
6246
6294
|
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
6295
|
|
|
6248
6296
|
// packages/sdk/src/components/core/processApi.ts
|
|
@@ -6606,7 +6654,7 @@ async function getViewPermission(request, params) {
|
|
|
6606
6654
|
}
|
|
6607
6655
|
|
|
6608
6656
|
// packages/sdk/src/components/fields/shared/UserPicker.tsx
|
|
6609
|
-
import { useCallback as useCallback6, useEffect as useEffect8, useMemo as
|
|
6657
|
+
import { useCallback as useCallback6, useEffect as useEffect8, useMemo as useMemo11, useState as useState9 } from "react";
|
|
6610
6658
|
import {
|
|
6611
6659
|
Avatar,
|
|
6612
6660
|
Button as Button6,
|
|
@@ -6625,7 +6673,7 @@ import { SearchOutlined, TeamOutlined, UserOutlined as UserOutlined3 } from "@an
|
|
|
6625
6673
|
import * as MobileAntd from "antd-mobile";
|
|
6626
6674
|
|
|
6627
6675
|
// packages/sdk/src/components/fields/shared/useLazyDepartmentTree.ts
|
|
6628
|
-
import { useCallback as useCallback5, useEffect as useEffect7, useMemo as
|
|
6676
|
+
import { useCallback as useCallback5, useEffect as useEffect7, useMemo as useMemo10, useRef as useRef3, useState as useState8 } from "react";
|
|
6629
6677
|
var toLazyNode = (node) => {
|
|
6630
6678
|
const normalized = normalizeDepartmentNode(node);
|
|
6631
6679
|
const id = getDepartmentId(normalized);
|
|
@@ -6735,7 +6783,7 @@ function useLazyDepartmentTree(api, configuredTreeData) {
|
|
|
6735
6783
|
},
|
|
6736
6784
|
[api, setTreeData]
|
|
6737
6785
|
);
|
|
6738
|
-
const indexes =
|
|
6786
|
+
const indexes = useMemo10(() => buildIndexes(treeData), [treeData]);
|
|
6739
6787
|
useEffect7(() => {
|
|
6740
6788
|
void loadRootDepartments();
|
|
6741
6789
|
}, [loadRootDepartments]);
|
|
@@ -6796,7 +6844,7 @@ function UserPickerPanel({
|
|
|
6796
6844
|
const selectedIds = selected.map(getUserId);
|
|
6797
6845
|
const MobileSearchBar = getMobileComponent("SearchBar");
|
|
6798
6846
|
const activeMemberKeyword = (mobile ? mobileKeyword : memberKeyword).trim();
|
|
6799
|
-
const staticUsers =
|
|
6847
|
+
const staticUsers = useMemo11(() => normalizeUsers(dataSource), [dataSource]);
|
|
6800
6848
|
const hasStaticUserSource = staticUsers.length > 0;
|
|
6801
6849
|
useEffect8(() => {
|
|
6802
6850
|
if (mobile) return;
|
|
@@ -6889,7 +6937,7 @@ function UserPickerPanel({
|
|
|
6889
6937
|
memberReloadKey,
|
|
6890
6938
|
staticUsers
|
|
6891
6939
|
]);
|
|
6892
|
-
const currentPath =
|
|
6940
|
+
const currentPath = useMemo11(() => {
|
|
6893
6941
|
if (!currentDeptId) return [];
|
|
6894
6942
|
const path = [];
|
|
6895
6943
|
let cursor = currentDeptId;
|
|
@@ -6901,7 +6949,7 @@ function UserPickerPanel({
|
|
|
6901
6949
|
}
|
|
6902
6950
|
return path;
|
|
6903
6951
|
}, [currentDeptId, nodeMap, parentMap]);
|
|
6904
|
-
const mobileDepartments =
|
|
6952
|
+
const mobileDepartments = useMemo11(() => {
|
|
6905
6953
|
const keyword = mobileKeyword.trim().toLowerCase();
|
|
6906
6954
|
if (keyword) {
|
|
6907
6955
|
return flatNodes.filter((item) => item.name.toLowerCase().includes(keyword)).map((item) => item.node);
|
|
@@ -7166,7 +7214,7 @@ var RequirementSelect = ({
|
|
|
7166
7214
|
onChange
|
|
7167
7215
|
}) => {
|
|
7168
7216
|
const [pickerOpen, setPickerOpen] = useState10(false);
|
|
7169
|
-
const initialCandidates =
|
|
7217
|
+
const initialCandidates = useMemo12(
|
|
7170
7218
|
() => (requirement.candidateUsers || []).map(normalizeCandidate).filter(Boolean),
|
|
7171
7219
|
[requirement.candidateUsers]
|
|
7172
7220
|
);
|
|
@@ -7220,7 +7268,7 @@ var RequirementSelect = ({
|
|
|
7220
7268
|
void loadCandidates();
|
|
7221
7269
|
}
|
|
7222
7270
|
}, [appType, formUuid, loadCandidates, open, requirement.nodeId, requirement.scope]);
|
|
7223
|
-
const options =
|
|
7271
|
+
const options = useMemo12(
|
|
7224
7272
|
() => optionsSource.map((user) => ({
|
|
7225
7273
|
value: user.id,
|
|
7226
7274
|
label: getUserLabel(user)
|
|
@@ -7658,7 +7706,7 @@ var ProcessActionBar = ({
|
|
|
7658
7706
|
}
|
|
7659
7707
|
void actions.executeOperation(operation);
|
|
7660
7708
|
};
|
|
7661
|
-
const actionConfigs =
|
|
7709
|
+
const actionConfigs = useMemo13(
|
|
7662
7710
|
() => operations.map((operation) => ({
|
|
7663
7711
|
key: operation.key,
|
|
7664
7712
|
label: operation.label || operation.key,
|
|
@@ -7777,7 +7825,7 @@ import {
|
|
|
7777
7825
|
useCallback as useCallback10,
|
|
7778
7826
|
useContext as useContext2,
|
|
7779
7827
|
useEffect as useEffect12,
|
|
7780
|
-
useMemo as
|
|
7828
|
+
useMemo as useMemo15,
|
|
7781
7829
|
useRef as useRef6,
|
|
7782
7830
|
useState as useState13
|
|
7783
7831
|
} from "react";
|
|
@@ -8172,7 +8220,7 @@ var mountBrowserPageRuntime = async (options) => {
|
|
|
8172
8220
|
import {
|
|
8173
8221
|
useCallback as useCallback9,
|
|
8174
8222
|
useEffect as useEffect11,
|
|
8175
|
-
useMemo as
|
|
8223
|
+
useMemo as useMemo14,
|
|
8176
8224
|
useState as useState12
|
|
8177
8225
|
} from "react";
|
|
8178
8226
|
import {
|
|
@@ -8196,7 +8244,7 @@ import {
|
|
|
8196
8244
|
import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
8197
8245
|
var useAuth = (options = {}) => {
|
|
8198
8246
|
const runtime = useOpenXiangda();
|
|
8199
|
-
const client =
|
|
8247
|
+
const client = useMemo14(
|
|
8200
8248
|
() => createAuthClient({
|
|
8201
8249
|
appType: options.appType || runtime.appType,
|
|
8202
8250
|
servicePrefix: options.servicePrefix || runtime.servicePrefix,
|
|
@@ -8211,7 +8259,7 @@ var useAuth = (options = {}) => {
|
|
|
8211
8259
|
runtime.servicePrefix
|
|
8212
8260
|
]
|
|
8213
8261
|
);
|
|
8214
|
-
return
|
|
8262
|
+
return useMemo14(
|
|
8215
8263
|
() => ({
|
|
8216
8264
|
client,
|
|
8217
8265
|
getMethods: client.getMethods,
|
|
@@ -8311,7 +8359,7 @@ var LoginPage = ({
|
|
|
8311
8359
|
const ssoMethod = findMethod(methods, "sso");
|
|
8312
8360
|
const guestMethod = findMethod(methods, "guest");
|
|
8313
8361
|
const allowRegister = methodsState.data?.registration?.mode !== "reject";
|
|
8314
|
-
const tabItems =
|
|
8362
|
+
const tabItems = useMemo14(() => {
|
|
8315
8363
|
const items = [];
|
|
8316
8364
|
if (passwordMethod) {
|
|
8317
8365
|
items.push({
|
|
@@ -8777,8 +8825,8 @@ var OpenXiangdaProvider = ({
|
|
|
8777
8825
|
fetchImpl,
|
|
8778
8826
|
children
|
|
8779
8827
|
}) => {
|
|
8780
|
-
const resolvedFetch =
|
|
8781
|
-
const resolvedAppType =
|
|
8828
|
+
const resolvedFetch = useMemo15(() => createBoundFetch(fetchImpl), [fetchImpl]);
|
|
8829
|
+
const resolvedAppType = useMemo15(
|
|
8782
8830
|
() => appType || resolveAppTypeFromLocation(),
|
|
8783
8831
|
[appType]
|
|
8784
8832
|
);
|
|
@@ -8892,7 +8940,7 @@ var OpenXiangdaProvider = ({
|
|
|
8892
8940
|
}
|
|
8893
8941
|
return refreshRequestRef.current;
|
|
8894
8942
|
}, [applyAccessToken, resolvedAppType, resolvedFetch, servicePrefix]);
|
|
8895
|
-
const authorizedFetch =
|
|
8943
|
+
const authorizedFetch = useMemo15(
|
|
8896
8944
|
() => createAuthorizedFetch({
|
|
8897
8945
|
appType: resolvedAppType,
|
|
8898
8946
|
baseFetch: resolvedFetch,
|
|
@@ -8980,7 +9028,7 @@ var OpenXiangdaProvider = ({
|
|
|
8980
9028
|
useEffect12(() => {
|
|
8981
9029
|
void reload();
|
|
8982
9030
|
}, [reload]);
|
|
8983
|
-
const value =
|
|
9031
|
+
const value = useMemo15(
|
|
8984
9032
|
() => ({
|
|
8985
9033
|
...state,
|
|
8986
9034
|
appType: resolvedAppType,
|
|
@@ -9023,7 +9071,7 @@ var OpenXiangdaPageProvider = ({
|
|
|
9023
9071
|
navigation
|
|
9024
9072
|
}) => {
|
|
9025
9073
|
const runtime = useOpenXiangda();
|
|
9026
|
-
const context =
|
|
9074
|
+
const context = useMemo15(() => {
|
|
9027
9075
|
const bootstrap = runtime.data;
|
|
9028
9076
|
const app = toRuntimeRecord(bootstrap?.app);
|
|
9029
9077
|
const user = toRuntimeRecord(bootstrap?.user);
|
|
@@ -9349,7 +9397,7 @@ var useRuntimeAuth = () => {
|
|
|
9349
9397
|
},
|
|
9350
9398
|
[logout, redirectToLogin]
|
|
9351
9399
|
);
|
|
9352
|
-
return
|
|
9400
|
+
return useMemo15(
|
|
9353
9401
|
() => ({
|
|
9354
9402
|
logout,
|
|
9355
9403
|
logoutAndRedirect,
|
|
@@ -9719,7 +9767,7 @@ var resolveAppTypeFromLocation = () => {
|
|
|
9719
9767
|
};
|
|
9720
9768
|
|
|
9721
9769
|
// packages/sdk/src/runtime/react/publicAccess.tsx
|
|
9722
|
-
import { useCallback as useCallback11, useEffect as useEffect13, useMemo as
|
|
9770
|
+
import { useCallback as useCallback11, useEffect as useEffect13, useMemo as useMemo16, useRef as useRef7, useState as useState14 } from "react";
|
|
9723
9771
|
import { Fragment as Fragment7, jsx as jsx16 } from "react/jsx-runtime";
|
|
9724
9772
|
var usePublicAccess = (options = {}) => {
|
|
9725
9773
|
const runtime = useOpenXiangda();
|
|
@@ -9743,8 +9791,8 @@ var usePublicAccess = (options = {}) => {
|
|
|
9743
9791
|
const activeSessionRef = useRef7(null);
|
|
9744
9792
|
const mountedRef = useRef7(true);
|
|
9745
9793
|
const sessionInputKey = JSON.stringify(sessionInput);
|
|
9746
|
-
const stableSessionInput =
|
|
9747
|
-
const client =
|
|
9794
|
+
const stableSessionInput = useMemo16(() => sessionInput, [sessionInputKey]);
|
|
9795
|
+
const client = useMemo16(
|
|
9748
9796
|
() => createPublicAccessClient({
|
|
9749
9797
|
appType,
|
|
9750
9798
|
servicePrefix,
|
|
@@ -9844,11 +9892,11 @@ var readTicketFromLocation = () => {
|
|
|
9844
9892
|
var readPathFromLocation = () => typeof window === "undefined" ? void 0 : window.location.pathname;
|
|
9845
9893
|
|
|
9846
9894
|
// packages/sdk/src/runtime/host/builtinRouteRenderer.tsx
|
|
9847
|
-
import { useCallback as useCallback29, useEffect as useEffect54, useMemo as
|
|
9895
|
+
import { useCallback as useCallback29, useEffect as useEffect54, useMemo as useMemo41, useState as useState46 } from "react";
|
|
9848
9896
|
import { Alert as Alert7, Button as Button19, Card as Card2, Empty as Empty11, Spin as Spin9, Typography as Typography6 } from "antd";
|
|
9849
9897
|
|
|
9850
9898
|
// packages/sdk/src/components/modules/DataManagementList.tsx
|
|
9851
|
-
import { useCallback as useCallback28, useEffect as useEffect53, useMemo as
|
|
9899
|
+
import { useCallback as useCallback28, useEffect as useEffect53, useMemo as useMemo40, useRef as useRef24, useState as useState45 } from "react";
|
|
9852
9900
|
import {
|
|
9853
9901
|
Alert as Alert6,
|
|
9854
9902
|
Button as Button18,
|
|
@@ -9887,14 +9935,14 @@ import {
|
|
|
9887
9935
|
} from "@ant-design/icons";
|
|
9888
9936
|
|
|
9889
9937
|
// packages/sdk/src/components/templates/StandardFormPage.tsx
|
|
9890
|
-
import { useMemo as
|
|
9938
|
+
import { useMemo as useMemo39 } from "react";
|
|
9891
9939
|
|
|
9892
9940
|
// packages/sdk/src/components/templates/FormDetailTemplate.tsx
|
|
9893
|
-
import { useCallback as useCallback20, useMemo as
|
|
9941
|
+
import { useCallback as useCallback20, useMemo as useMemo34, useRef as useRef18, useState as useState37 } from "react";
|
|
9894
9942
|
import dayjs10 from "dayjs";
|
|
9895
9943
|
|
|
9896
9944
|
// packages/sdk/src/components/core/FormProvider.tsx
|
|
9897
|
-
import React58, { useCallback as useCallback17, useEffect as useEffect44, useRef as useRef15, useState as useState30, useMemo as
|
|
9945
|
+
import React58, { useCallback as useCallback17, useEffect as useEffect44, useRef as useRef15, useState as useState30, useMemo as useMemo32 } from "react";
|
|
9898
9946
|
|
|
9899
9947
|
// packages/sdk/src/components/core/FormContext.ts
|
|
9900
9948
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
@@ -10665,7 +10713,7 @@ function TextAreaField(props) {
|
|
|
10665
10713
|
import { useEffect as useEffect19 } from "react";
|
|
10666
10714
|
|
|
10667
10715
|
// packages/sdk/src/components/fields/SelectField/SelectFieldPC.tsx
|
|
10668
|
-
import { useMemo as
|
|
10716
|
+
import { useMemo as useMemo18 } from "react";
|
|
10669
10717
|
import { Select as Select3 } from "antd";
|
|
10670
10718
|
|
|
10671
10719
|
// packages/sdk/src/components/fields/shared/optionDisplay.tsx
|
|
@@ -10740,7 +10788,7 @@ function renderReadonlyOptions(options, coloredOptions, tagWhenPlain = false) {
|
|
|
10740
10788
|
}
|
|
10741
10789
|
|
|
10742
10790
|
// packages/sdk/src/components/fields/SelectField/useLinkedFormRemoteOptions.ts
|
|
10743
|
-
import { useCallback as useCallback12, useEffect as useEffect17, useMemo as
|
|
10791
|
+
import { useCallback as useCallback12, useEffect as useEffect17, useMemo as useMemo17, useRef as useRef8, useState as useState15 } from "react";
|
|
10744
10792
|
|
|
10745
10793
|
// packages/sdk/src/components/core/optionSource.ts
|
|
10746
10794
|
var DEFAULT_OPTION_PAGE_SIZE = 200;
|
|
@@ -11003,7 +11051,7 @@ function useLinkedFormRemoteOptions(optionSource, baseOptions, selectedOptions)
|
|
|
11003
11051
|
},
|
|
11004
11052
|
[]
|
|
11005
11053
|
);
|
|
11006
|
-
const options =
|
|
11054
|
+
const options = useMemo17(
|
|
11007
11055
|
() => mergeOptionItems(remoteOptions ?? baseOptions, selectedOptions),
|
|
11008
11056
|
[baseOptions, remoteOptions, selectedOptions]
|
|
11009
11057
|
);
|
|
@@ -11051,7 +11099,7 @@ function SelectFieldPC({
|
|
|
11051
11099
|
const { formData, setFieldValue } = useFormContext();
|
|
11052
11100
|
const value = controlledValue !== void 0 ? controlledValue : formData[fieldId];
|
|
11053
11101
|
const disabled = behavior === "DISABLED";
|
|
11054
|
-
const selectedOptions =
|
|
11102
|
+
const selectedOptions = useMemo18(() => value ? [value] : [], [value]);
|
|
11055
11103
|
const remote = useLinkedFormRemoteOptions(optionSource, options, selectedOptions);
|
|
11056
11104
|
const displayOptions = remote.options;
|
|
11057
11105
|
const handleChange = (val) => {
|
|
@@ -11092,7 +11140,7 @@ function SelectFieldPC({
|
|
|
11092
11140
|
}
|
|
11093
11141
|
|
|
11094
11142
|
// packages/sdk/src/components/fields/SelectField/SelectFieldMobile.tsx
|
|
11095
|
-
import { useEffect as useEffect18, useMemo as
|
|
11143
|
+
import { useEffect as useEffect18, useMemo as useMemo19, useState as useState16 } from "react";
|
|
11096
11144
|
|
|
11097
11145
|
// packages/sdk/src/components/fields/shared/MobileField.tsx
|
|
11098
11146
|
import { Popup } from "antd-mobile";
|
|
@@ -11276,7 +11324,7 @@ function SelectFieldMobile({
|
|
|
11276
11324
|
const [visible, setVisible] = useState16(false);
|
|
11277
11325
|
const [search, setSearch] = useState16("");
|
|
11278
11326
|
const [tempValue, setTempValue] = useState16(value ?? null);
|
|
11279
|
-
const selectedOptions =
|
|
11327
|
+
const selectedOptions = useMemo19(() => value ? [value] : tempValue ? [tempValue] : [], [
|
|
11280
11328
|
tempValue,
|
|
11281
11329
|
value
|
|
11282
11330
|
]);
|
|
@@ -11287,7 +11335,7 @@ function SelectFieldMobile({
|
|
|
11287
11335
|
reset: resetRemoteOptions,
|
|
11288
11336
|
search: searchRemoteOptions
|
|
11289
11337
|
} = useLinkedFormRemoteOptions(optionSource, options, selectedOptions);
|
|
11290
|
-
const filteredOptions =
|
|
11338
|
+
const filteredOptions = useMemo19(() => {
|
|
11291
11339
|
if (remoteEnabled) return remoteOptions;
|
|
11292
11340
|
const keyword = search.trim().toLowerCase();
|
|
11293
11341
|
if (!keyword) return options;
|
|
@@ -11492,7 +11540,7 @@ function MultiSelectFieldPC({
|
|
|
11492
11540
|
}
|
|
11493
11541
|
|
|
11494
11542
|
// packages/sdk/src/components/fields/MultiSelectField/MultiSelectFieldMobile.tsx
|
|
11495
|
-
import { useMemo as
|
|
11543
|
+
import { useMemo as useMemo20, useState as useState17 } from "react";
|
|
11496
11544
|
import { jsx as jsx37, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11497
11545
|
function MultiSelectFieldMobile({
|
|
11498
11546
|
fieldId,
|
|
@@ -11512,14 +11560,14 @@ function MultiSelectFieldMobile({
|
|
|
11512
11560
|
const [visible, setVisible] = useState17(false);
|
|
11513
11561
|
const [search, setSearch] = useState17("");
|
|
11514
11562
|
const [tempValues, setTempValues] = useState17(value);
|
|
11515
|
-
const filteredOptions =
|
|
11563
|
+
const filteredOptions = useMemo20(() => {
|
|
11516
11564
|
const keyword = search.trim().toLowerCase();
|
|
11517
11565
|
if (!keyword) return options;
|
|
11518
11566
|
return options.filter(
|
|
11519
11567
|
(option) => String(option.label ?? option.value).toLowerCase().includes(keyword)
|
|
11520
11568
|
);
|
|
11521
11569
|
}, [options, search]);
|
|
11522
|
-
const tempValueSet =
|
|
11570
|
+
const tempValueSet = useMemo20(
|
|
11523
11571
|
() => new Set(tempValues.map((option) => option.value)),
|
|
11524
11572
|
[tempValues]
|
|
11525
11573
|
);
|
|
@@ -14333,7 +14381,7 @@ function ImageField(props) {
|
|
|
14333
14381
|
import { useEffect as useEffect27 } from "react";
|
|
14334
14382
|
|
|
14335
14383
|
// packages/sdk/src/components/fields/SubFormField/SubFormCell.tsx
|
|
14336
|
-
import { useMemo as
|
|
14384
|
+
import { useMemo as useMemo21 } from "react";
|
|
14337
14385
|
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
14338
14386
|
var stringifyFallbackValue = (value) => {
|
|
14339
14387
|
if (value === void 0 || value === null) return "";
|
|
@@ -14354,7 +14402,7 @@ function SubFormCell({
|
|
|
14354
14402
|
const scopedFieldId = `${parentFieldId}.${rowIndex}.${column.fieldId}`;
|
|
14355
14403
|
const cellValue = row[column.fieldId];
|
|
14356
14404
|
const resolvedBehavior = behavior === "DISABLED" || behavior === "READONLY" ? behavior : column.behavior ?? behavior ?? "NORMAL";
|
|
14357
|
-
const childContext =
|
|
14405
|
+
const childContext = useMemo21(
|
|
14358
14406
|
() => ({
|
|
14359
14407
|
...parentContext,
|
|
14360
14408
|
formData: {
|
|
@@ -14676,7 +14724,7 @@ function SubFormField(props) {
|
|
|
14676
14724
|
import { useEffect as useEffect31 } from "react";
|
|
14677
14725
|
|
|
14678
14726
|
// packages/sdk/src/components/fields/UserSelectField/UserSelectFieldPC.tsx
|
|
14679
|
-
import { useEffect as useEffect28, useMemo as
|
|
14727
|
+
import { useEffect as useEffect28, useMemo as useMemo22, useState as useState20 } from "react";
|
|
14680
14728
|
import { Select as Select5 } from "antd";
|
|
14681
14729
|
import { jsx as jsx71, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
14682
14730
|
function UserSelectFieldPC({
|
|
@@ -14696,7 +14744,7 @@ function UserSelectFieldPC({
|
|
|
14696
14744
|
}) {
|
|
14697
14745
|
const { formData, setFieldValue, api } = useFormContext();
|
|
14698
14746
|
const rawValue = formData[fieldId];
|
|
14699
|
-
const value =
|
|
14747
|
+
const value = useMemo22(() => normalizeUserArray(rawValue), [rawValue]);
|
|
14700
14748
|
const disabled = behavior === "DISABLED";
|
|
14701
14749
|
const [optionsSource, setOptionsSource] = useState20(
|
|
14702
14750
|
() => dataSource.map(normalizeUser)
|
|
@@ -14790,7 +14838,7 @@ function UserSelectFieldPC({
|
|
|
14790
14838
|
setFieldValue(fieldId, normalized);
|
|
14791
14839
|
onChange?.(normalized);
|
|
14792
14840
|
};
|
|
14793
|
-
const options =
|
|
14841
|
+
const options = useMemo22(
|
|
14794
14842
|
() => optionsSource.map((u) => ({
|
|
14795
14843
|
value: getUserId(u),
|
|
14796
14844
|
label: formatUserDisplay(u, displayFormat)
|
|
@@ -14854,7 +14902,7 @@ function getUserNameLikeId(user) {
|
|
|
14854
14902
|
}
|
|
14855
14903
|
|
|
14856
14904
|
// packages/sdk/src/components/fields/UserSelectField/UserSelectFieldMobile.tsx
|
|
14857
|
-
import { useEffect as useEffect29, useMemo as
|
|
14905
|
+
import { useEffect as useEffect29, useMemo as useMemo23, useState as useState21 } from "react";
|
|
14858
14906
|
import * as MobileAntd2 from "antd-mobile";
|
|
14859
14907
|
import { jsx as jsx72, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
14860
14908
|
var getMobilePopup = () => {
|
|
@@ -14879,7 +14927,7 @@ function UserSelectFieldMobile({
|
|
|
14879
14927
|
}) {
|
|
14880
14928
|
const { formData, setFieldValue, api } = useFormContext();
|
|
14881
14929
|
const rawValue = formData[fieldId];
|
|
14882
|
-
const value =
|
|
14930
|
+
const value = useMemo23(() => normalizeUserArray(rawValue), [rawValue]);
|
|
14883
14931
|
const disabled = behavior === "DISABLED";
|
|
14884
14932
|
const [showPicker, setShowPicker] = useState21(false);
|
|
14885
14933
|
const [optionsSource, setOptionsSource] = useState21(
|
|
@@ -14987,7 +15035,7 @@ function UserSelectFieldMobile({
|
|
|
14987
15035
|
}
|
|
14988
15036
|
|
|
14989
15037
|
// packages/sdk/src/components/fields/UserSelectField/UserSelectFieldReadonly.tsx
|
|
14990
|
-
import { useEffect as useEffect30, useMemo as
|
|
15038
|
+
import { useEffect as useEffect30, useMemo as useMemo24 } from "react";
|
|
14991
15039
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
14992
15040
|
function UserSelectFieldReadonly({
|
|
14993
15041
|
fieldId,
|
|
@@ -14996,7 +15044,7 @@ function UserSelectFieldReadonly({
|
|
|
14996
15044
|
}) {
|
|
14997
15045
|
const { formData, setFieldValue, api } = useFormContext();
|
|
14998
15046
|
const rawValue = formData[fieldId];
|
|
14999
|
-
const value =
|
|
15047
|
+
const value = useMemo24(() => normalizeUserArray(rawValue), [rawValue]);
|
|
15000
15048
|
useEffect30(() => {
|
|
15001
15049
|
const missing = value.filter((item) => getUserNameLikeId2(item));
|
|
15002
15050
|
if (missing.length === 0) return;
|
|
@@ -15077,7 +15125,7 @@ function UserSelectField(props) {
|
|
|
15077
15125
|
import { useEffect as useEffect35 } from "react";
|
|
15078
15126
|
|
|
15079
15127
|
// packages/sdk/src/components/fields/DepartmentSelectField/DepartmentSelectFieldPC.tsx
|
|
15080
|
-
import { useEffect as useEffect33, useMemo as
|
|
15128
|
+
import { useEffect as useEffect33, useMemo as useMemo26, useRef as useRef10, useState as useState23 } from "react";
|
|
15081
15129
|
import { TreeSelect } from "antd";
|
|
15082
15130
|
|
|
15083
15131
|
// packages/sdk/src/components/fields/shared/departmentSearch.ts
|
|
@@ -15096,7 +15144,7 @@ function getDepartmentPathText(department, separator = "/") {
|
|
|
15096
15144
|
}
|
|
15097
15145
|
|
|
15098
15146
|
// packages/sdk/src/components/fields/shared/DepartmentPicker.tsx
|
|
15099
|
-
import { useEffect as useEffect32, useMemo as
|
|
15147
|
+
import { useEffect as useEffect32, useMemo as useMemo25, useRef as useRef9, useState as useState22 } from "react";
|
|
15100
15148
|
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
15149
|
import { ApartmentOutlined, SearchOutlined as SearchOutlined3 } from "@ant-design/icons";
|
|
15102
15150
|
import * as MobileAntd3 from "antd-mobile";
|
|
@@ -15197,11 +15245,11 @@ function DepartmentPickerPanel({
|
|
|
15197
15245
|
window.clearTimeout(timer);
|
|
15198
15246
|
};
|
|
15199
15247
|
}, [api, canRemoteSearch, searchDebounceMs, trimmedKeyword]);
|
|
15200
|
-
const filteredTreeData =
|
|
15248
|
+
const filteredTreeData = useMemo25(
|
|
15201
15249
|
() => showSearch ? matchSearch(loadedTreeData, trimmedKeyword) : loadedTreeData,
|
|
15202
15250
|
[loadedTreeData, showSearch, trimmedKeyword]
|
|
15203
15251
|
);
|
|
15204
|
-
const currentPath =
|
|
15252
|
+
const currentPath = useMemo25(() => {
|
|
15205
15253
|
if (!currentDeptId) return [];
|
|
15206
15254
|
const path = [];
|
|
15207
15255
|
let cursor = currentDeptId;
|
|
@@ -15213,7 +15261,7 @@ function DepartmentPickerPanel({
|
|
|
15213
15261
|
}
|
|
15214
15262
|
return path;
|
|
15215
15263
|
}, [currentDeptId, nodeMap, parentMap]);
|
|
15216
|
-
const mobileList =
|
|
15264
|
+
const mobileList = useMemo25(() => {
|
|
15217
15265
|
if (canRemoteSearch) {
|
|
15218
15266
|
return remoteSearchResults;
|
|
15219
15267
|
}
|
|
@@ -15531,7 +15579,7 @@ function DepartmentSelectFieldPC({
|
|
|
15531
15579
|
}) {
|
|
15532
15580
|
const { formData, setFieldValue, api } = useFormContext();
|
|
15533
15581
|
const rawValue = formData[fieldId];
|
|
15534
|
-
const value =
|
|
15582
|
+
const value = useMemo26(() => normalizeDepartmentArray(rawValue), [rawValue]);
|
|
15535
15583
|
const disabled = behavior === "DISABLED";
|
|
15536
15584
|
const configuredTreeData = treeData ?? EMPTY_TREE_DATA;
|
|
15537
15585
|
const remoteLoadedRef = useRef10(false);
|
|
@@ -15589,7 +15637,7 @@ function DepartmentSelectFieldPC({
|
|
|
15589
15637
|
}, [api, canRemoteSearch, searchDebounceMs, trimmedSearchKeyword]);
|
|
15590
15638
|
const scopedTreeData = filterTreeByScope(loadedTreeData, scopeType, specifiedDepts);
|
|
15591
15639
|
const allDepts = flattenDepartments(scopedTreeData);
|
|
15592
|
-
const scopedRemoteSearchResults =
|
|
15640
|
+
const scopedRemoteSearchResults = useMemo26(() => {
|
|
15593
15641
|
if (scopeType !== "specified" || !specifiedDepts?.length) {
|
|
15594
15642
|
return remoteSearchResults;
|
|
15595
15643
|
}
|
|
@@ -15600,7 +15648,7 @@ function DepartmentSelectFieldPC({
|
|
|
15600
15648
|
return node.path?.some((item) => specifiedSet.has(item.id));
|
|
15601
15649
|
});
|
|
15602
15650
|
}, [remoteSearchResults, scopeType, specifiedDepts]);
|
|
15603
|
-
const remoteDeptMap =
|
|
15651
|
+
const remoteDeptMap = useMemo26(() => {
|
|
15604
15652
|
const map = /* @__PURE__ */ new Map();
|
|
15605
15653
|
scopedRemoteSearchResults.forEach((node) => map.set(getDepartmentId(node), node));
|
|
15606
15654
|
return map;
|
|
@@ -15729,7 +15777,7 @@ function DepartmentSelectFieldPC({
|
|
|
15729
15777
|
}
|
|
15730
15778
|
|
|
15731
15779
|
// packages/sdk/src/components/fields/DepartmentSelectField/DepartmentSelectFieldMobile.tsx
|
|
15732
|
-
import { useEffect as useEffect34, useMemo as
|
|
15780
|
+
import { useEffect as useEffect34, useMemo as useMemo27, useRef as useRef11, useState as useState24 } from "react";
|
|
15733
15781
|
import * as MobileAntd4 from "antd-mobile";
|
|
15734
15782
|
import { jsx as jsx77, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
15735
15783
|
var EMPTY_TREE_DATA2 = [];
|
|
@@ -15764,7 +15812,7 @@ function DepartmentSelectFieldMobile({
|
|
|
15764
15812
|
}) {
|
|
15765
15813
|
const { formData, setFieldValue, api } = useFormContext();
|
|
15766
15814
|
const rawValue = formData[fieldId];
|
|
15767
|
-
const value =
|
|
15815
|
+
const value = useMemo27(() => normalizeDepartmentArray(rawValue), [rawValue]);
|
|
15768
15816
|
const disabled = behavior === "DISABLED";
|
|
15769
15817
|
const [showPicker, setShowPicker] = useState24(false);
|
|
15770
15818
|
const configuredTreeData = treeData ?? EMPTY_TREE_DATA2;
|
|
@@ -15869,7 +15917,7 @@ function DepartmentSelectFieldMobile({
|
|
|
15869
15917
|
}
|
|
15870
15918
|
|
|
15871
15919
|
// packages/sdk/src/components/fields/DepartmentSelectField/DepartmentSelectFieldReadonly.tsx
|
|
15872
|
-
import { useMemo as
|
|
15920
|
+
import { useMemo as useMemo28 } from "react";
|
|
15873
15921
|
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
15874
15922
|
function DepartmentSelectFieldReadonly({
|
|
15875
15923
|
fieldId,
|
|
@@ -15879,7 +15927,7 @@ function DepartmentSelectFieldReadonly({
|
|
|
15879
15927
|
}) {
|
|
15880
15928
|
const { formData } = useFormContext();
|
|
15881
15929
|
const rawValue = formData[fieldId];
|
|
15882
|
-
const value =
|
|
15930
|
+
const value = useMemo28(() => normalizeDepartmentArray(rawValue), [rawValue]);
|
|
15883
15931
|
const display = value.length > 0 ? value.map(
|
|
15884
15932
|
(d) => showFullPath ? getDepartmentFullPath(getDepartmentId(d), treeData) || getDepartmentName(d) : getDepartmentName(d)
|
|
15885
15933
|
).join(", ") : "--";
|
|
@@ -16027,7 +16075,7 @@ function CascadeSelectField(props) {
|
|
|
16027
16075
|
}
|
|
16028
16076
|
|
|
16029
16077
|
// packages/sdk/src/components/fields/AddressField/index.tsx
|
|
16030
|
-
import { useCallback as useCallback13, useEffect as useEffect37, useMemo as
|
|
16078
|
+
import { useCallback as useCallback13, useEffect as useEffect37, useMemo as useMemo29, useState as useState25 } from "react";
|
|
16031
16079
|
import { Button as Button10, Cascader as Cascader2, Input as Input9, Space as Space5, Spin as Spin6 } from "antd";
|
|
16032
16080
|
import * as MobileAntd5 from "antd-mobile";
|
|
16033
16081
|
import { jsx as jsx81, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
@@ -16173,7 +16221,7 @@ function AddressField(props) {
|
|
|
16173
16221
|
const { isMobile } = useDeviceDetect();
|
|
16174
16222
|
const behavior = propBehavior ?? fieldBehaviors[fieldId] ?? "NORMAL";
|
|
16175
16223
|
const rawValue = formData[fieldId];
|
|
16176
|
-
const value =
|
|
16224
|
+
const value = useMemo29(() => normalizeAddressValue(rawValue), [rawValue]);
|
|
16177
16225
|
const [options, setOptions] = useState25([]);
|
|
16178
16226
|
const [loadingRoots, setLoadingRoots] = useState25(false);
|
|
16179
16227
|
const [mobileOpen, setMobileOpen] = useState25(false);
|
|
@@ -16182,9 +16230,9 @@ function AddressField(props) {
|
|
|
16182
16230
|
const [mobileLoading, setMobileLoading] = useState25(false);
|
|
16183
16231
|
const [tempValue, setTempValue] = useState25();
|
|
16184
16232
|
const depth = modeDepth(mode);
|
|
16185
|
-
const levels =
|
|
16186
|
-
const valuePath =
|
|
16187
|
-
const displayOptions =
|
|
16233
|
+
const levels = useMemo29(() => activeLevels(mode), [mode]);
|
|
16234
|
+
const valuePath = useMemo29(() => valueToPath(value, levels), [levels, value]);
|
|
16235
|
+
const displayOptions = useMemo29(
|
|
16188
16236
|
() => mergeValuePathIntoOptions(options, value, levels, depth),
|
|
16189
16237
|
[depth, levels, options, value]
|
|
16190
16238
|
);
|
|
@@ -16435,7 +16483,7 @@ function AddressField(props) {
|
|
|
16435
16483
|
}
|
|
16436
16484
|
|
|
16437
16485
|
// packages/sdk/src/components/fields/AssociationFormField/index.tsx
|
|
16438
|
-
import { useCallback as useCallback14, useEffect as useEffect38, useMemo as
|
|
16486
|
+
import { useCallback as useCallback14, useEffect as useEffect38, useMemo as useMemo30, useRef as useRef12, useState as useState26 } from "react";
|
|
16439
16487
|
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
16488
|
import { jsx as jsx82, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
16441
16489
|
var DEFAULT_PAGE_SIZE = 10;
|
|
@@ -16498,7 +16546,7 @@ function AssociationFormField(props) {
|
|
|
16498
16546
|
const { isMobile } = useDeviceDetect();
|
|
16499
16547
|
const behavior = propBehavior ?? fieldBehaviors[fieldId] ?? "NORMAL";
|
|
16500
16548
|
const rawValue = formData[fieldId];
|
|
16501
|
-
const value =
|
|
16549
|
+
const value = useMemo30(() => normalizeValues(rawValue), [rawValue]);
|
|
16502
16550
|
const disabled = behavior === "DISABLED";
|
|
16503
16551
|
const [options, setOptions] = useState26([]);
|
|
16504
16552
|
const [selectLoading, setSelectLoading] = useState26(false);
|
|
@@ -16532,11 +16580,11 @@ function AssociationFormField(props) {
|
|
|
16532
16580
|
const associationFormUuid = associationForm?.formUuid;
|
|
16533
16581
|
const associationMainFieldId = associationForm?.mainFieldId;
|
|
16534
16582
|
const canQuery = Boolean(associationAppType && associationFormUuid);
|
|
16535
|
-
const filterRulesKey =
|
|
16583
|
+
const filterRulesKey = useMemo30(
|
|
16536
16584
|
() => stableSerialize(associationForm?.dataFilterRules || []),
|
|
16537
16585
|
[associationForm?.dataFilterRules]
|
|
16538
16586
|
);
|
|
16539
|
-
const currentFieldFilterKey =
|
|
16587
|
+
const currentFieldFilterKey = useMemo30(() => {
|
|
16540
16588
|
const rules = associationForm?.dataFilterRules || [];
|
|
16541
16589
|
return stableSerialize(
|
|
16542
16590
|
rules.map((rule) => {
|
|
@@ -16545,7 +16593,7 @@ function AssociationFormField(props) {
|
|
|
16545
16593
|
})
|
|
16546
16594
|
);
|
|
16547
16595
|
}, [formData, associationForm?.dataFilterRules]);
|
|
16548
|
-
const filterDependencyKey =
|
|
16596
|
+
const filterDependencyKey = useMemo30(
|
|
16549
16597
|
() => `${filterRulesKey}:${currentFieldFilterKey}`,
|
|
16550
16598
|
[currentFieldFilterKey, filterRulesKey]
|
|
16551
16599
|
);
|
|
@@ -16674,7 +16722,7 @@ function AssociationFormField(props) {
|
|
|
16674
16722
|
},
|
|
16675
16723
|
[applyDataFilling, fieldId, multiple, onChange, setFieldValue]
|
|
16676
16724
|
);
|
|
16677
|
-
const selectorColumns =
|
|
16725
|
+
const selectorColumns = useMemo30(() => {
|
|
16678
16726
|
const configured = associationForm?.selectorColumns || [];
|
|
16679
16727
|
if (configured.length) {
|
|
16680
16728
|
return configured.map((column) => {
|
|
@@ -16709,7 +16757,7 @@ function AssociationFormField(props) {
|
|
|
16709
16757
|
}
|
|
16710
16758
|
];
|
|
16711
16759
|
}, [associationForm?.mainFieldId, associationForm?.selectorColumns]);
|
|
16712
|
-
const selectOptions =
|
|
16760
|
+
const selectOptions = useMemo30(
|
|
16713
16761
|
() => [...options, ...value].filter(
|
|
16714
16762
|
(item, index, list) => list.findIndex((candidate) => candidate.value === item.value) === index
|
|
16715
16763
|
).map((item) => ({ label: item.label, value: item.value })),
|
|
@@ -16917,7 +16965,7 @@ function AssociationFormField(props) {
|
|
|
16917
16965
|
}
|
|
16918
16966
|
|
|
16919
16967
|
// packages/sdk/src/components/fields/EditorField/index.tsx
|
|
16920
|
-
import { useCallback as useCallback15, useEffect as useEffect39, useMemo as
|
|
16968
|
+
import { useCallback as useCallback15, useEffect as useEffect39, useMemo as useMemo31, useRef as useRef13, useState as useState27 } from "react";
|
|
16921
16969
|
import { Extension } from "@tiptap/core";
|
|
16922
16970
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
16923
16971
|
import StarterKit from "@tiptap/starter-kit";
|
|
@@ -17590,9 +17638,9 @@ function RichTextEditorCore({
|
|
|
17590
17638
|
useEffect39(() => {
|
|
17591
17639
|
onChangeRef.current = onChange;
|
|
17592
17640
|
}, [onChange]);
|
|
17593
|
-
const actions =
|
|
17641
|
+
const actions = useMemo31(() => normalizeToolbarConfig(toolbarConfig), [toolbarConfig]);
|
|
17594
17642
|
const visibleActions = mobile ? [] : actions;
|
|
17595
|
-
const extensions =
|
|
17643
|
+
const extensions = useMemo31(
|
|
17596
17644
|
() => [
|
|
17597
17645
|
StarterKit.configure({
|
|
17598
17646
|
heading: { levels: [1, 2, 3] },
|
|
@@ -19034,9 +19082,9 @@ function FormProvider({
|
|
|
19034
19082
|
runtime,
|
|
19035
19083
|
children
|
|
19036
19084
|
}) {
|
|
19037
|
-
const api =
|
|
19085
|
+
const api = useMemo32(() => createFormRuntimeApi(config.api), [config.api]);
|
|
19038
19086
|
const [runtimeDefaults, setRuntimeDefaults] = useState30({});
|
|
19039
|
-
const effects =
|
|
19087
|
+
const effects = useMemo32(
|
|
19040
19088
|
() => [
|
|
19041
19089
|
...schema.rules ?? [],
|
|
19042
19090
|
...schema.fields.flatMap((field) => field.optionEffects ?? []),
|
|
@@ -19044,18 +19092,18 @@ function FormProvider({
|
|
|
19044
19092
|
],
|
|
19045
19093
|
[schema.rules, schema.fields, config.effects]
|
|
19046
19094
|
);
|
|
19047
|
-
const defaultRuntime =
|
|
19095
|
+
const defaultRuntime = useMemo32(
|
|
19048
19096
|
() => ({
|
|
19049
19097
|
appType: config.appType,
|
|
19050
19098
|
fetchFormData: (params) => fetchRuntimeFormData(api, config.appType, params)
|
|
19051
19099
|
}),
|
|
19052
19100
|
[api, config.appType]
|
|
19053
19101
|
);
|
|
19054
|
-
const mergedRuntime =
|
|
19102
|
+
const mergedRuntime = useMemo32(
|
|
19055
19103
|
() => ({ ...defaultRuntime, ...schema.runtime, ...runtimeDefaults, ...runtime }),
|
|
19056
19104
|
[defaultRuntime, schema.runtime, runtimeDefaults, runtime]
|
|
19057
19105
|
);
|
|
19058
|
-
const computedInitialValues =
|
|
19106
|
+
const computedInitialValues = useMemo32(() => {
|
|
19059
19107
|
const values = {};
|
|
19060
19108
|
for (const field of schema.fields) {
|
|
19061
19109
|
const defaultValue = resolveDefaultValue(field, mergedRuntime);
|
|
@@ -19107,7 +19155,7 @@ function FormProvider({
|
|
|
19107
19155
|
return changed ? next : prev;
|
|
19108
19156
|
});
|
|
19109
19157
|
}, [mergedRuntime, schema.fields]);
|
|
19110
|
-
const fieldBehaviors =
|
|
19158
|
+
const fieldBehaviors = useMemo32(() => {
|
|
19111
19159
|
const baseBehaviors = {};
|
|
19112
19160
|
for (const field of schema.fields) {
|
|
19113
19161
|
baseBehaviors[field.fieldId] = field.behavior || "NORMAL";
|
|
@@ -19130,11 +19178,11 @@ function FormProvider({
|
|
|
19130
19178
|
}
|
|
19131
19179
|
return computed;
|
|
19132
19180
|
}, [schema, effects, config.permissions, config.mode, formData]);
|
|
19133
|
-
const fieldOverrides =
|
|
19181
|
+
const fieldOverrides = useMemo32(
|
|
19134
19182
|
() => evaluateFieldOverrides(effects, formData),
|
|
19135
19183
|
[effects, formData]
|
|
19136
19184
|
);
|
|
19137
|
-
const layoutBehaviors =
|
|
19185
|
+
const layoutBehaviors = useMemo32(
|
|
19138
19186
|
() => evaluateLayoutBehaviors(effects, formData),
|
|
19139
19187
|
[effects, formData]
|
|
19140
19188
|
);
|
|
@@ -19358,7 +19406,7 @@ function FormProvider({
|
|
|
19358
19406
|
window.clearTimeout(timer);
|
|
19359
19407
|
};
|
|
19360
19408
|
}, [schema.fields, mergedRuntime, formData]);
|
|
19361
|
-
const contextValue =
|
|
19409
|
+
const contextValue = useMemo32(
|
|
19362
19410
|
() => ({
|
|
19363
19411
|
mode: config.mode,
|
|
19364
19412
|
schema,
|
|
@@ -20078,7 +20126,7 @@ function isLayoutVisible(visibleWhen, formData) {
|
|
|
20078
20126
|
}
|
|
20079
20127
|
|
|
20080
20128
|
// packages/sdk/src/components/core/FormShell.tsx
|
|
20081
|
-
import { useEffect as useEffect45, useMemo as
|
|
20129
|
+
import { useEffect as useEffect45, useMemo as useMemo33 } from "react";
|
|
20082
20130
|
import * as Antd2 from "antd";
|
|
20083
20131
|
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
20084
20132
|
function normalizeMaxWidth(maxWidth) {
|
|
@@ -20111,7 +20159,7 @@ function FormShell({ children, appearance, className }) {
|
|
|
20111
20159
|
useEffect45(() => {
|
|
20112
20160
|
form?.setFieldsValue?.(formData);
|
|
20113
20161
|
}, [form, formData]);
|
|
20114
|
-
const style =
|
|
20162
|
+
const style = useMemo33(() => {
|
|
20115
20163
|
if (!maxWidth) return void 0;
|
|
20116
20164
|
return {
|
|
20117
20165
|
maxWidth,
|
|
@@ -20976,7 +21024,7 @@ var InnerDetailContent = ({
|
|
|
20976
21024
|
const formDataRef = useRef18(void 0);
|
|
20977
21025
|
const validateRef = useRef18(void 0);
|
|
20978
21026
|
const [accessDenied, setAccessDenied] = useState37(false);
|
|
20979
|
-
const fieldIds =
|
|
21027
|
+
const fieldIds = useMemo34(() => schema.fields.map((field) => field.fieldId), [schema.fields]);
|
|
20980
21028
|
const {
|
|
20981
21029
|
loading,
|
|
20982
21030
|
mode,
|
|
@@ -22084,15 +22132,15 @@ var FormSubmitTemplate = ({
|
|
|
22084
22132
|
};
|
|
22085
22133
|
|
|
22086
22134
|
// packages/sdk/src/components/templates/ProcessDetailTemplate.tsx
|
|
22087
|
-
import { useCallback as useCallback27, useMemo as
|
|
22135
|
+
import { useCallback as useCallback27, useMemo as useMemo38, useRef as useRef23, useState as useState44 } from "react";
|
|
22088
22136
|
import dayjs11 from "dayjs";
|
|
22089
22137
|
import { Form as AntForm, Input as Input14, Modal as Modal12, message as message5 } from "antd";
|
|
22090
22138
|
|
|
22091
22139
|
// packages/sdk/src/components/hooks/useProcessDetail.ts
|
|
22092
|
-
import { useState as useState41, useEffect as useEffect51, useCallback as useCallback25, useRef as useRef21, useMemo as
|
|
22140
|
+
import { useState as useState41, useEffect as useEffect51, useCallback as useCallback25, useRef as useRef21, useMemo as useMemo36 } from "react";
|
|
22093
22141
|
|
|
22094
22142
|
// packages/sdk/src/components/hooks/useFieldPermission.ts
|
|
22095
|
-
import { useMemo as
|
|
22143
|
+
import { useMemo as useMemo35, useCallback as useCallback24 } from "react";
|
|
22096
22144
|
var normalizeBehavior = (value) => {
|
|
22097
22145
|
if (value === "EDITABLE") return "NORMAL";
|
|
22098
22146
|
if (value === "READ_ONLY") return "READONLY";
|
|
@@ -22170,7 +22218,7 @@ function useFieldPermission(options) {
|
|
|
22170
22218
|
}
|
|
22171
22219
|
return behaviors;
|
|
22172
22220
|
}, [viewPermissions, processDefinition, currentTask, isApprover, mode]);
|
|
22173
|
-
const fieldBehaviors =
|
|
22221
|
+
const fieldBehaviors = useMemo35(() => computeBehaviors(), [computeBehaviors]);
|
|
22174
22222
|
return { fieldBehaviors, computeBehaviors };
|
|
22175
22223
|
}
|
|
22176
22224
|
|
|
@@ -22224,7 +22272,7 @@ function useProcessDetail(options) {
|
|
|
22224
22272
|
mountedRef.current = false;
|
|
22225
22273
|
};
|
|
22226
22274
|
}, []);
|
|
22227
|
-
const currentTask =
|
|
22275
|
+
const currentTask = useMemo36(
|
|
22228
22276
|
() => mergeCurrentTask(processInfo?.currentTask, approvalTasks[0]),
|
|
22229
22277
|
[processInfo?.currentTask, approvalTasks]
|
|
22230
22278
|
);
|
|
@@ -22244,7 +22292,7 @@ function useProcessDetail(options) {
|
|
|
22244
22292
|
isApprover: isProcessFinal ? false : isApprover,
|
|
22245
22293
|
mode
|
|
22246
22294
|
});
|
|
22247
|
-
const activeActions =
|
|
22295
|
+
const activeActions = useMemo36(() => {
|
|
22248
22296
|
if (!isApprover || isProcessFinal) return [];
|
|
22249
22297
|
const actions = currentTask?.actions && currentTask.actions.length > 0 ? [...currentTask.actions] : [...DEFAULT_APPROVAL_ACTIONS];
|
|
22250
22298
|
if (canWithdraw && !actions.some((action) => action.action === "withdraw")) {
|
|
@@ -22659,7 +22707,7 @@ function useApprovalActions(options) {
|
|
|
22659
22707
|
}
|
|
22660
22708
|
|
|
22661
22709
|
// packages/sdk/src/components/modules/ApprovalActionBar.tsx
|
|
22662
|
-
import React67, { useMemo as
|
|
22710
|
+
import React67, { useMemo as useMemo37, useState as useState43 } from "react";
|
|
22663
22711
|
import { Form as Form5, Input as Input13, Modal as Modal11, Select as Select9 } from "antd";
|
|
22664
22712
|
import {
|
|
22665
22713
|
CheckOutlined as CheckOutlined2,
|
|
@@ -22720,7 +22768,7 @@ function DefaultTransferSelector({
|
|
|
22720
22768
|
}) {
|
|
22721
22769
|
const formContext = React67.useContext(FormContext);
|
|
22722
22770
|
const { isMobile } = useDeviceDetect();
|
|
22723
|
-
const fallbackApi =
|
|
22771
|
+
const fallbackApi = useMemo37(() => createFormRuntimeApi(), []);
|
|
22724
22772
|
const api = formContext?.api ?? fallbackApi;
|
|
22725
22773
|
const [open, setOpen] = useState43(false);
|
|
22726
22774
|
const [selectedUsers, setSelectedUsers] = useState43([]);
|
|
@@ -22781,7 +22829,7 @@ var ApprovalActionBar = ({
|
|
|
22781
22829
|
const [modalAction, setModalAction] = useState43(null);
|
|
22782
22830
|
const [activeAction, setActiveAction] = useState43(null);
|
|
22783
22831
|
const [loading, setLoading] = useState43(false);
|
|
22784
|
-
const visibleActions =
|
|
22832
|
+
const visibleActions = useMemo37(
|
|
22785
22833
|
() => actions.filter((action) => !action.hidden).sort((a, b) => (actionPriority2[a.action] ?? 50) - (actionPriority2[b.action] ?? 50)),
|
|
22786
22834
|
[actions]
|
|
22787
22835
|
);
|
|
@@ -23058,7 +23106,7 @@ var InnerProcessContent = ({
|
|
|
23058
23106
|
const [initiatorApproverOpen, setInitiatorApproverOpen] = useState44(false);
|
|
23059
23107
|
const [initiatorApproverRequirements, setInitiatorApproverRequirements] = useState44([]);
|
|
23060
23108
|
const [pendingResubmitComments, setPendingResubmitComments] = useState44();
|
|
23061
|
-
const fieldIds =
|
|
23109
|
+
const fieldIds = useMemo38(() => schema.fields.map((field) => field.fieldId), [schema.fields]);
|
|
23062
23110
|
const { api } = useFormContext();
|
|
23063
23111
|
const {
|
|
23064
23112
|
loading,
|
|
@@ -23257,7 +23305,7 @@ var InnerProcessContent = ({
|
|
|
23257
23305
|
setWithdrawOpen(false);
|
|
23258
23306
|
withdrawForm.resetFields();
|
|
23259
23307
|
}, [withdrawForm]);
|
|
23260
|
-
const bottomActions =
|
|
23308
|
+
const bottomActions = useMemo38(() => {
|
|
23261
23309
|
if (isApprover && !isOriginatorReturn && activeActions.length > 0) return [];
|
|
23262
23310
|
if (isProcessCompleted) {
|
|
23263
23311
|
if (mode === "readonly") {
|
|
@@ -23607,7 +23655,7 @@ var StandardFormPage = ({
|
|
|
23607
23655
|
const formType = normalizeStandardFormType(
|
|
23608
23656
|
schema.template?.formType || (resolvedMode === "process" ? "process" : "form")
|
|
23609
23657
|
);
|
|
23610
|
-
const submitApi =
|
|
23658
|
+
const submitApi = useMemo39(() => {
|
|
23611
23659
|
if (!onSubmit) return void 0;
|
|
23612
23660
|
return {
|
|
23613
23661
|
submitFormData: async (payload) => onSubmit(
|
|
@@ -23621,7 +23669,7 @@ var StandardFormPage = ({
|
|
|
23621
23669
|
startProcessFromExistingInstance: async (payload) => onSubmit(payload)
|
|
23622
23670
|
};
|
|
23623
23671
|
}, [formType, onSubmit]);
|
|
23624
|
-
const api =
|
|
23672
|
+
const api = useMemo39(() => {
|
|
23625
23673
|
if (!externalApi && !submitApi) return void 0;
|
|
23626
23674
|
return {
|
|
23627
23675
|
...externalApi ?? {},
|
|
@@ -25110,7 +25158,7 @@ var DataManagementList = ({
|
|
|
25110
25158
|
actionOverrides
|
|
25111
25159
|
}) => {
|
|
25112
25160
|
const rootRef = useRef24(null);
|
|
25113
|
-
const api =
|
|
25161
|
+
const api = useMemo40(() => {
|
|
25114
25162
|
if (typeof requestOverride === "function") {
|
|
25115
25163
|
return createFormRuntimeApi({ request: requestOverride });
|
|
25116
25164
|
}
|
|
@@ -25203,7 +25251,7 @@ var DataManagementList = ({
|
|
|
25203
25251
|
mounted = false;
|
|
25204
25252
|
};
|
|
25205
25253
|
}, [appType, formUuid, permissionMode, request]);
|
|
25206
|
-
const baseActionCan =
|
|
25254
|
+
const baseActionCan = useMemo40(() => {
|
|
25207
25255
|
if (permissionMode === "auto") {
|
|
25208
25256
|
return FORM_ACTION_PERMISSIONS.reduce((result, action) => {
|
|
25209
25257
|
result[action] = Boolean(actionSummary?.can?.[action]);
|
|
@@ -25237,15 +25285,15 @@ var DataManagementList = ({
|
|
|
25237
25285
|
const canExport = canAction("export");
|
|
25238
25286
|
const canImport = canAction("import");
|
|
25239
25287
|
const canWorkflow = canAction("workflow");
|
|
25240
|
-
const visibleFields =
|
|
25288
|
+
const visibleFields = useMemo40(
|
|
25241
25289
|
() => showFields.map((fieldId) => fields.find((field) => field.fieldId === fieldId)).filter(Boolean),
|
|
25242
25290
|
[fields, showFields]
|
|
25243
25291
|
);
|
|
25244
|
-
const forcedShowFieldIds =
|
|
25292
|
+
const forcedShowFieldIds = useMemo40(
|
|
25245
25293
|
() => new Set(forcedConfig?.showFields || []),
|
|
25246
25294
|
[forcedConfig?.showFields]
|
|
25247
25295
|
);
|
|
25248
|
-
const forcedLockFieldIds =
|
|
25296
|
+
const forcedLockFieldIds = useMemo40(
|
|
25249
25297
|
() => new Set(forcedConfig?.lockFieldIds || []),
|
|
25250
25298
|
[forcedConfig?.lockFieldIds]
|
|
25251
25299
|
);
|
|
@@ -25639,7 +25687,7 @@ var DataManagementList = ({
|
|
|
25639
25687
|
ACTION_COLUMN_MIN_WIDTH,
|
|
25640
25688
|
Math.min(rowActionCount, visibleRowActionLimit) * ACTION_BUTTON_ESTIMATED_WIDTH + (rowActionCount > visibleRowActionLimit ? ACTION_MORE_BUTTON_WIDTH : 0) + ACTION_COLUMN_HORIZONTAL_PADDING
|
|
25641
25689
|
);
|
|
25642
|
-
const columns =
|
|
25690
|
+
const columns = useMemo40(() => {
|
|
25643
25691
|
const baseColumns = visibleFields.map((field) => {
|
|
25644
25692
|
const columnWidth = widths[field.fieldId] || field.width || 160;
|
|
25645
25693
|
return {
|
|
@@ -25771,7 +25819,7 @@ var DataManagementList = ({
|
|
|
25771
25819
|
actionColumnWidth
|
|
25772
25820
|
)
|
|
25773
25821
|
);
|
|
25774
|
-
const importPreviewColumns =
|
|
25822
|
+
const importPreviewColumns = useMemo40(() => {
|
|
25775
25823
|
const keys = Array.from(
|
|
25776
25824
|
new Set(importPreview.flatMap((record) => Object.keys(record || {})))
|
|
25777
25825
|
).slice(0, 16);
|
|
@@ -26534,12 +26582,12 @@ function BuiltinRouteRenderer({
|
|
|
26534
26582
|
const [error, setError] = useState46("");
|
|
26535
26583
|
const [reloadKey, setReloadKey] = useState46(0);
|
|
26536
26584
|
const requestConfig = requestOverride && typeof requestOverride === "object" ? requestOverride : void 0;
|
|
26537
|
-
const request =
|
|
26585
|
+
const request = useMemo41(() => {
|
|
26538
26586
|
if (typeof requestOverride === "function") return requestOverride;
|
|
26539
26587
|
if (requestConfig?.request) return requestConfig.request;
|
|
26540
26588
|
return createBuiltinRouteRequest(requestConfig?.baseUrl || normalizedServicePrefix, fetchImpl);
|
|
26541
26589
|
}, [fetchImpl, normalizedServicePrefix, requestConfig, requestOverride]);
|
|
26542
|
-
const api =
|
|
26590
|
+
const api = useMemo41(
|
|
26543
26591
|
() => createFormRuntimeApi({
|
|
26544
26592
|
baseUrl: normalizedServicePrefix,
|
|
26545
26593
|
...requestConfig || {},
|
|
@@ -26550,7 +26598,7 @@ function BuiltinRouteRenderer({
|
|
|
26550
26598
|
const appType = appTypeProp || route?.appType || "";
|
|
26551
26599
|
const formUuid = route ? pickRouteValue(route, "formUuid", "menuFormUuid") : "";
|
|
26552
26600
|
const formInstId = route ? pickRouteValue(route, "formInstId", "formInstanceId") : "";
|
|
26553
|
-
const routeConfig =
|
|
26601
|
+
const routeConfig = useMemo41(
|
|
26554
26602
|
() => route ? resolveRouteConfig(route, config) : {},
|
|
26555
26603
|
[config, route]
|
|
26556
26604
|
);
|
|
@@ -26728,6 +26776,7 @@ export {
|
|
|
26728
26776
|
createBrowserPageBridge,
|
|
26729
26777
|
createBrowserPageContext,
|
|
26730
26778
|
createBuiltinRouteRequest,
|
|
26779
|
+
createPageFormRuntimeApi,
|
|
26731
26780
|
createPageSdk,
|
|
26732
26781
|
createPublicAccessClient,
|
|
26733
26782
|
createReactPage,
|
|
@@ -26757,6 +26806,7 @@ export {
|
|
|
26757
26806
|
useNavigation,
|
|
26758
26807
|
useOpenXiangda,
|
|
26759
26808
|
usePageContext,
|
|
26809
|
+
usePageFormRuntimeApi,
|
|
26760
26810
|
usePageProps,
|
|
26761
26811
|
usePageRoute,
|
|
26762
26812
|
usePageSdk,
|