openxiangda 1.0.249 → 1.0.251
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/package.json +2 -1
- package/packages/sdk/dist/runtime/index.cjs +29 -5
- 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 +29 -5
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +29 -5
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +4 -1
- package/packages/sdk/dist/runtime/react.d.ts +4 -1
- package/packages/sdk/dist/runtime/react.mjs +29 -5
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
- package/packages/sdk/source/admin-list/AdminList.tsx +28 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openxiangda",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.251",
|
|
4
4
|
"description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"bin": {
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"test:sdk-admin-list": "vitest run packages/sdk/src/runtime/react/admin-list/AdminList.state.test.tsx packages/sdk/src/runtime/react/admin-list/AdminList.selection.test.tsx",
|
|
96
96
|
"test:sdk-bundle": "node scripts/sdk-browser-bundle-smoke.mjs",
|
|
97
97
|
"test:sdk-list-response": "vitest run packages/sdk/src/runtime/react/admin-list/dataSources.test.ts packages/sdk/src/components/core/dataManagementApi.test.ts",
|
|
98
|
+
"test:sdk-runtime-cache": "vitest run packages/sdk/src/runtime/runtime-cache.test.ts",
|
|
98
99
|
"test:api-contract": "node scripts/openxiangda-api-contract-smoke.mjs",
|
|
99
100
|
"test:help-no-side-effects": "node scripts/help-no-side-effects-smoke.mjs",
|
|
100
101
|
"test:app-function-fallback": "node scripts/app-function-source-fallback-smoke.mjs",
|
|
@@ -34105,6 +34105,11 @@ var isRecord = (value) => typeof value === "object" && value !== null && !Array.
|
|
|
34105
34105
|
var isSearchRuleLike = (value) => isRecord(value) && typeof value.key === "string" && (value.componentName === void 0 || typeof value.componentName === "string");
|
|
34106
34106
|
var isBlobLike = (value) => typeof Blob !== "undefined" && value instanceof Blob;
|
|
34107
34107
|
var nowMs = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
34108
|
+
var dynamicReadSequence = 0;
|
|
34109
|
+
var nextDynamicReadNonce = () => {
|
|
34110
|
+
dynamicReadSequence = (dynamicReadSequence + 1) % Number.MAX_SAFE_INTEGER;
|
|
34111
|
+
return `${Date.now().toString(36)}-${dynamicReadSequence.toString(36)}`;
|
|
34112
|
+
};
|
|
34108
34113
|
var normalizeMethod = (value) => {
|
|
34109
34114
|
const method = String(value || "get").toLowerCase();
|
|
34110
34115
|
if (method === "get" || method === "post" || method === "put" || method === "delete" || method === "patch") {
|
|
@@ -34710,7 +34715,8 @@ var createPageSdk = (context) => {
|
|
|
34710
34715
|
method: normalizeMethod(options.method),
|
|
34711
34716
|
query: serializeQuery(options.query),
|
|
34712
34717
|
body: options.body,
|
|
34713
|
-
headers: options.headers
|
|
34718
|
+
headers: options.headers,
|
|
34719
|
+
...options.cache ? { cache: options.cache } : {}
|
|
34714
34720
|
};
|
|
34715
34721
|
const traceEnabled = isRequestTracingEnabled(context, options);
|
|
34716
34722
|
const traceLabel = options.traceLabel || `${payload.method.toUpperCase()} ${payload.path}`;
|
|
@@ -35008,6 +35014,8 @@ var createPageSdk = (context) => {
|
|
|
35008
35014
|
"/v1/form/advancedSearch.json"
|
|
35009
35015
|
),
|
|
35010
35016
|
method: "get",
|
|
35017
|
+
cache: "no-store",
|
|
35018
|
+
dedupe: false,
|
|
35011
35019
|
query: {
|
|
35012
35020
|
formUuid: params.formUuid,
|
|
35013
35021
|
filters: serializeSearchExpression(params.filters),
|
|
@@ -35016,7 +35024,8 @@ var createPageSdk = (context) => {
|
|
|
35016
35024
|
currentPage: params.currentPage,
|
|
35017
35025
|
pageSize: params.pageSize,
|
|
35018
35026
|
order: normalizeAdvancedOrder(params.order),
|
|
35019
|
-
instanceStatus: params.instanceStatus
|
|
35027
|
+
instanceStatus: params.instanceStatus,
|
|
35028
|
+
_oxCacheBust: nextDynamicReadNonce()
|
|
35020
35029
|
}
|
|
35021
35030
|
}),
|
|
35022
35031
|
advancedExport: (params) => download({
|
|
@@ -38220,7 +38229,8 @@ var createBrowserPageBridge = (options = {}) => {
|
|
|
38220
38229
|
method: normalizeMethod2(payload.method),
|
|
38221
38230
|
headers,
|
|
38222
38231
|
body,
|
|
38223
|
-
credentials: "include"
|
|
38232
|
+
credentials: "include",
|
|
38233
|
+
cache: payload.cache
|
|
38224
38234
|
}, {
|
|
38225
38235
|
enabled: shouldRetryTransportRequest(payload)
|
|
38226
38236
|
});
|
|
@@ -44385,6 +44395,19 @@ var queryFingerprint = (query, sourceKey) => JSON.stringify({
|
|
|
44385
44395
|
fixedFilters: query.fixedFilters,
|
|
44386
44396
|
sorts: query.sorts
|
|
44387
44397
|
});
|
|
44398
|
+
var positiveInteger = (value, fallback) => {
|
|
44399
|
+
const numberValue = Number(value);
|
|
44400
|
+
return Number.isFinite(numberValue) && numberValue > 0 ? Math.floor(numberValue) : fallback;
|
|
44401
|
+
};
|
|
44402
|
+
var reconcileResultTotal = (result, query, rows) => {
|
|
44403
|
+
const reportedTotal = Number(result.total);
|
|
44404
|
+
const normalizedReportedTotal = Number.isFinite(reportedTotal) ? Math.max(0, reportedTotal) : 0;
|
|
44405
|
+
if (!rows.length) return normalizedReportedTotal;
|
|
44406
|
+
const currentPage = positiveInteger(result.currentPage, query.currentPage);
|
|
44407
|
+
const pageSize = positiveInteger(result.pageSize, query.pageSize);
|
|
44408
|
+
const visibleRowsLowerBound = (currentPage - 1) * pageSize + rows.length;
|
|
44409
|
+
return Math.max(normalizedReportedTotal, visibleRowsLowerBound);
|
|
44410
|
+
};
|
|
44388
44411
|
var getRowKey = (rowKey, row) => {
|
|
44389
44412
|
if (typeof rowKey === "function") return rowKey(row);
|
|
44390
44413
|
return row[rowKey];
|
|
@@ -44701,8 +44724,9 @@ function AdminList(props) {
|
|
|
44701
44724
|
try {
|
|
44702
44725
|
const result = await requestedDataSource.query(query);
|
|
44703
44726
|
if (!isCurrentRequest()) return;
|
|
44704
|
-
|
|
44705
|
-
|
|
44727
|
+
const resultRows = Array.isArray(result.rows) ? result.rows : [];
|
|
44728
|
+
setRows(resultRows);
|
|
44729
|
+
setTotal(reconcileResultTotal(result, query, resultRows));
|
|
44706
44730
|
setAllowedColumnKeys(result.allowedColumnKeys);
|
|
44707
44731
|
setHiddenFieldsCount(Math.max(0, Number(result.hiddenFieldsCount || 0)));
|
|
44708
44732
|
} catch (requestError) {
|