@juicemantics/veloiq-ui 0.2.0 → 0.2.2
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/dist/index.d.mts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +1363 -682
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1364 -684
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -8,13 +8,15 @@ var icons = require('@ant-design/icons');
|
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var reactRouterDom = require('react-router-dom');
|
|
10
10
|
var reactDom = require('react-dom');
|
|
11
|
-
var
|
|
11
|
+
var dayjs8 = require('dayjs');
|
|
12
|
+
var relativeTime = require('dayjs/plugin/relativeTime');
|
|
12
13
|
var axios = require('axios');
|
|
13
14
|
|
|
14
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
|
|
16
17
|
var React6__default = /*#__PURE__*/_interopDefault(React6);
|
|
17
|
-
var
|
|
18
|
+
var dayjs8__default = /*#__PURE__*/_interopDefault(dayjs8);
|
|
19
|
+
var relativeTime__default = /*#__PURE__*/_interopDefault(relativeTime);
|
|
18
20
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
19
21
|
|
|
20
22
|
var __typeError = (msg) => {
|
|
@@ -866,7 +868,7 @@ var LayoutWrapper = ({
|
|
|
866
868
|
label: "Confirm Password",
|
|
867
869
|
dependencies: ["new_password"],
|
|
868
870
|
rules: [{ required: true }, ({ getFieldValue }) => ({
|
|
869
|
-
validator(
|
|
871
|
+
validator(_41, value) {
|
|
870
872
|
if (!value || getFieldValue("new_password") === value) return Promise.resolve();
|
|
871
873
|
return Promise.reject(new Error("Passwords do not match"));
|
|
872
874
|
}
|
|
@@ -2606,19 +2608,19 @@ function Ut({
|
|
|
2606
2608
|
const { defaultLayoutDeferred: Y, derivedPanelConstraints: Ee, layout: ce } = j.next;
|
|
2607
2609
|
if (Y || Ee.length === 0)
|
|
2608
2610
|
return;
|
|
2609
|
-
const ut = R.panels.map(({ id:
|
|
2610
|
-
R.mutableState.layouts[ut] = ce, Ee.forEach((
|
|
2611
|
-
if (
|
|
2611
|
+
const ut = R.panels.map(({ id: _41 }) => _41).join(",");
|
|
2612
|
+
R.mutableState.layouts[ut] = ce, Ee.forEach((_41) => {
|
|
2613
|
+
if (_41.collapsible) {
|
|
2612
2614
|
const { layout: ge } = j.prev ?? {};
|
|
2613
2615
|
if (ge) {
|
|
2614
2616
|
const ft = I(
|
|
2615
|
-
|
|
2616
|
-
ce[
|
|
2617
|
+
_41.collapsedSize,
|
|
2618
|
+
ce[_41.panelId]
|
|
2617
2619
|
), dt = I(
|
|
2618
|
-
|
|
2619
|
-
ge[
|
|
2620
|
+
_41.collapsedSize,
|
|
2621
|
+
ge[_41.panelId]
|
|
2620
2622
|
);
|
|
2621
|
-
ft && !dt && (R.mutableState.expandedPanelSizes[
|
|
2623
|
+
ft && !dt && (R.mutableState.expandedPanelSizes[_41.panelId] = ge[_41.panelId]);
|
|
2622
2624
|
}
|
|
2623
2625
|
}
|
|
2624
2626
|
});
|
|
@@ -3287,7 +3289,7 @@ var getRelationLabel = (rel) => {
|
|
|
3287
3289
|
const translatedBaseKey = translateRelationKey(baseKey);
|
|
3288
3290
|
if (translatedBaseKey && translatedBaseKey !== baseKey) return translatedBaseKey;
|
|
3289
3291
|
}
|
|
3290
|
-
return asDisplayText(
|
|
3292
|
+
return asDisplayText(rel.label, asDisplayText(relationKey, "")) || relationKey;
|
|
3291
3293
|
};
|
|
3292
3294
|
var getModelLabel = (model) => {
|
|
3293
3295
|
const primary = asDisplayText(model.label, "");
|
|
@@ -3379,8 +3381,8 @@ var useViewSettings = () => {
|
|
|
3379
3381
|
}
|
|
3380
3382
|
const data = await response.json();
|
|
3381
3383
|
if (cancelled) return;
|
|
3382
|
-
const modulesColorSchema = String(data?.modulesColorSchema || "color
|
|
3383
|
-
const modelsColorSchema = String(data?.modelsColorSchema || "color
|
|
3384
|
+
const modulesColorSchema = String(data?.modulesColorSchema || "plain-color");
|
|
3385
|
+
const modelsColorSchema = String(data?.modelsColorSchema || "plain-color");
|
|
3384
3386
|
const plainColorBaseHex = String(data?.plainColorBaseHex || "");
|
|
3385
3387
|
setColorSchemas({ modulesColorSchema, modelsColorSchema, plainColorBaseHex });
|
|
3386
3388
|
setSettings({
|
|
@@ -3582,7 +3584,10 @@ var getConfigVid = (item, mode) => {
|
|
|
3582
3584
|
};
|
|
3583
3585
|
var isAttributeValueEditable = (item, mode) => {
|
|
3584
3586
|
if (!item) return true;
|
|
3585
|
-
const
|
|
3587
|
+
const raw = String(getConfigVid(item, mode) || "").trim();
|
|
3588
|
+
const fieldToken = normalizeFieldViewType(raw);
|
|
3589
|
+
if (fieldToken) return fieldToken.startsWith("editable-");
|
|
3590
|
+
const vid = raw.toLowerCase().replace(/[\s_-]/g, "");
|
|
3586
3591
|
if (vid === "readonly") return false;
|
|
3587
3592
|
return true;
|
|
3588
3593
|
};
|
|
@@ -3593,6 +3598,9 @@ var normalizeRelationViewType = (rawVid) => {
|
|
|
3593
3598
|
if (normalized === "editablelist") return "editable-list";
|
|
3594
3599
|
if (normalized === "list") return "list";
|
|
3595
3600
|
if (normalized === "csv") return "csv";
|
|
3601
|
+
if (normalized === "readandeditlist") return "read-and-edit-list";
|
|
3602
|
+
if (normalized === "readandeditcsv") return "read-and-edit-csv";
|
|
3603
|
+
if (normalized === "editablecsv") return "editable-csv";
|
|
3596
3604
|
if (normalized === "gallery" || normalized === "image") return "gallery";
|
|
3597
3605
|
if (normalized === "calendar" || normalized === "week" || normalized === "month") return "calendar";
|
|
3598
3606
|
if (normalized === "primary") return "primary";
|
|
@@ -3601,6 +3609,47 @@ var normalizeRelationViewType = (rawVid) => {
|
|
|
3601
3609
|
if (normalized === "treedetails") return "tree-details";
|
|
3602
3610
|
return "";
|
|
3603
3611
|
};
|
|
3612
|
+
var FIELD_VIEW_TYPE_TOKENS = /* @__PURE__ */ new Set([
|
|
3613
|
+
"read-only-field",
|
|
3614
|
+
"editable-field",
|
|
3615
|
+
"read-only-password",
|
|
3616
|
+
"editable-password",
|
|
3617
|
+
"read-only-textarea",
|
|
3618
|
+
"editable-textarea",
|
|
3619
|
+
"read-only-markdown",
|
|
3620
|
+
"editable-markdown",
|
|
3621
|
+
"read-only-json",
|
|
3622
|
+
"editable-json",
|
|
3623
|
+
"read-only-url",
|
|
3624
|
+
"editable-url",
|
|
3625
|
+
"read-only-email",
|
|
3626
|
+
"editable-email",
|
|
3627
|
+
"read-only-currency",
|
|
3628
|
+
"editable-currency",
|
|
3629
|
+
"read-only-percentage",
|
|
3630
|
+
"editable-percentage",
|
|
3631
|
+
"read-only-progress",
|
|
3632
|
+
"editable-progress",
|
|
3633
|
+
"read-only-rating",
|
|
3634
|
+
"editable-rating",
|
|
3635
|
+
"read-only-duration",
|
|
3636
|
+
"editable-duration",
|
|
3637
|
+
"read-only-phone",
|
|
3638
|
+
"editable-phone",
|
|
3639
|
+
"read-only-color",
|
|
3640
|
+
"editable-color",
|
|
3641
|
+
"read-only-code",
|
|
3642
|
+
"editable-code",
|
|
3643
|
+
"read-only-image-url",
|
|
3644
|
+
"editable-image-url",
|
|
3645
|
+
"read-only-qrcode",
|
|
3646
|
+
"read-only-relative",
|
|
3647
|
+
"read-only-truncated-text"
|
|
3648
|
+
]);
|
|
3649
|
+
var normalizeFieldViewType = (raw) => {
|
|
3650
|
+
const normalized = String(raw || "").trim().toLowerCase().replace(/[\s_]/g, "-").replace(/-+/g, "-");
|
|
3651
|
+
return FIELD_VIEW_TYPE_TOKENS.has(normalized) ? normalized : "";
|
|
3652
|
+
};
|
|
3604
3653
|
var applyRelationViewOverride = (rel, item, mode) => {
|
|
3605
3654
|
const rawVid = getConfigVid(item, mode);
|
|
3606
3655
|
const vid = normalizeRelationViewType(rawVid);
|
|
@@ -3997,7 +4046,7 @@ var parseInlineStyle = (styleText) => {
|
|
|
3997
4046
|
return styleText.split(";").map((chunk) => chunk.trim()).filter(Boolean).reduce((acc, rule) => {
|
|
3998
4047
|
const [rawKey, rawValue] = rule.split(":").map((part) => part.trim());
|
|
3999
4048
|
if (!rawKey || !rawValue) return acc;
|
|
4000
|
-
const camelKey = rawKey.replace(/-([a-z])/g, (
|
|
4049
|
+
const camelKey = rawKey.replace(/-([a-z])/g, (_41, char) => char.toUpperCase());
|
|
4001
4050
|
acc[camelKey] = rawValue;
|
|
4002
4051
|
return acc;
|
|
4003
4052
|
}, {});
|
|
@@ -5828,7 +5877,7 @@ body, table, th, td, input, button, select, textarea, div, span, p, li, ul, ol {
|
|
|
5828
5877
|
|
|
5829
5878
|
// src/components/DynamicResource/relations/helpers.ts
|
|
5830
5879
|
var _9 = window._ || ((text) => text);
|
|
5831
|
-
var INLINE_RELATION_VIEW_TYPES = /* @__PURE__ */ new Set(["list", "csv"]);
|
|
5880
|
+
var INLINE_RELATION_VIEW_TYPES = /* @__PURE__ */ new Set(["list", "csv", "read-and-edit-list", "read-and-edit-csv", "editable-csv"]);
|
|
5832
5881
|
var TABLE_RELATION_VIEW_TYPES = /* @__PURE__ */ new Set(["table", "totals-details"]);
|
|
5833
5882
|
var isInlineRelationViewType = (viewType) => INLINE_RELATION_VIEW_TYPES.has(viewType);
|
|
5834
5883
|
var usesTableRelationBehavior = (viewType) => TABLE_RELATION_VIEW_TYPES.has(viewType);
|
|
@@ -5843,10 +5892,10 @@ var getRelationViewType = (rel, mode, defaults) => {
|
|
|
5843
5892
|
const showFallback = defaults?.show || "totals-details";
|
|
5844
5893
|
const editFallback = defaults?.edit || "editable-table";
|
|
5845
5894
|
if (mode === "show") {
|
|
5846
|
-
if (rel.
|
|
5895
|
+
if (rel.showViewType) return rel.showViewType;
|
|
5847
5896
|
return showFallback;
|
|
5848
5897
|
}
|
|
5849
|
-
if (rel.
|
|
5898
|
+
if (rel.editViewType) return rel.editViewType;
|
|
5850
5899
|
return editFallback;
|
|
5851
5900
|
};
|
|
5852
5901
|
var getRelationTabName = (rel, mode, fallback) => {
|
|
@@ -6389,17 +6438,49 @@ var fetchPolymorphicGroups = async ({
|
|
|
6389
6438
|
});
|
|
6390
6439
|
return { groups, unresolved, labelsById };
|
|
6391
6440
|
};
|
|
6441
|
+
|
|
6442
|
+
// src/components/DynamicResource/utils/navigation.ts
|
|
6443
|
+
var getShowHref = (resource, id, allModels) => {
|
|
6444
|
+
const resourcePath = resolveResourcePath(resource, allModels);
|
|
6445
|
+
return `/${resourcePath}/show/${id}`;
|
|
6446
|
+
};
|
|
6447
|
+
var shouldHandleLinkClick = (event) => {
|
|
6448
|
+
if (event.defaultPrevented) return false;
|
|
6449
|
+
if (event.button !== 0) return false;
|
|
6450
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return false;
|
|
6451
|
+
return true;
|
|
6452
|
+
};
|
|
6392
6453
|
var ReferenceField = ({ id, resource, onLabel }) => {
|
|
6393
6454
|
const { data, isLoading } = core.useOne({ resource, id, queryOptions: { enabled: !!id } });
|
|
6394
6455
|
const record = data?.data;
|
|
6395
6456
|
const label = record?._label || record?.name || record?.description || id;
|
|
6457
|
+
const go = core.useGo();
|
|
6458
|
+
const paneNav = usePaneNavigation();
|
|
6459
|
+
const { token } = antd.theme.useToken();
|
|
6396
6460
|
React6.useEffect(() => {
|
|
6397
6461
|
if (onLabel && !isLoading && label !== void 0 && label !== null) {
|
|
6398
6462
|
onLabel(String(label));
|
|
6399
6463
|
}
|
|
6400
6464
|
}, [label, onLabel, isLoading]);
|
|
6401
6465
|
if (isLoading) return /* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Input, { active: true, size: "small", style: { width: 100 } });
|
|
6402
|
-
|
|
6466
|
+
const href = getShowHref(resource, id);
|
|
6467
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6468
|
+
"a",
|
|
6469
|
+
{
|
|
6470
|
+
href,
|
|
6471
|
+
onClick: (e) => {
|
|
6472
|
+
if (!shouldHandleLinkClick(e)) return;
|
|
6473
|
+
e.preventDefault();
|
|
6474
|
+
if (paneNav?.isInMultiPane) {
|
|
6475
|
+
paneNav.openDetail(resource, id);
|
|
6476
|
+
} else {
|
|
6477
|
+
go({ to: { resource, action: "show", id } });
|
|
6478
|
+
}
|
|
6479
|
+
},
|
|
6480
|
+
style: { color: token.colorLink, textDecoration: "none", cursor: "pointer" },
|
|
6481
|
+
children: label
|
|
6482
|
+
}
|
|
6483
|
+
);
|
|
6403
6484
|
};
|
|
6404
6485
|
var RelatedObjectPreview = ({ resource, id, model, allModels, fallbackLabel }) => {
|
|
6405
6486
|
const { data, isLoading } = core.useOne({ resource, id, queryOptions: { enabled: !!id } });
|
|
@@ -6972,8 +7053,150 @@ var renderOptionTag = (field, rawValue) => {
|
|
|
6972
7053
|
const color = colorMap[String(rawValue)] || getFallbackColor(label);
|
|
6973
7054
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Tag, { color, style: { marginInlineEnd: 0, borderRadius: 8, fontWeight: 500 }, children: label });
|
|
6974
7055
|
};
|
|
7056
|
+
dayjs8__default.default.extend(relativeTime__default.default);
|
|
6975
7057
|
var _16 = window._ || ((text) => text);
|
|
6976
|
-
var
|
|
7058
|
+
var ReactMarkdown = React6.lazy(() => import('react-markdown').then((m) => ({ default: m.default })));
|
|
7059
|
+
var QRCodeSVG = React6.lazy(() => import('qrcode.react').then((m) => ({ default: m.QRCodeSVG })));
|
|
7060
|
+
function formatDuration(totalSeconds) {
|
|
7061
|
+
const h = Math.floor(totalSeconds / 3600);
|
|
7062
|
+
const m = Math.floor(totalSeconds % 3600 / 60);
|
|
7063
|
+
const s = totalSeconds % 60;
|
|
7064
|
+
const parts = [];
|
|
7065
|
+
if (h) parts.push(`${h}h`);
|
|
7066
|
+
if (m) parts.push(`${m}m`);
|
|
7067
|
+
if (s || !parts.length) parts.push(`${s}s`);
|
|
7068
|
+
return parts.join(" ");
|
|
7069
|
+
}
|
|
7070
|
+
var TALL_VIEW_TYPE_TOKENS = /* @__PURE__ */ new Set([
|
|
7071
|
+
"read-only-markdown",
|
|
7072
|
+
"read-only-json",
|
|
7073
|
+
"read-only-code",
|
|
7074
|
+
"read-only-textarea",
|
|
7075
|
+
"read-only-image-url"
|
|
7076
|
+
]);
|
|
7077
|
+
var renderFieldViewTypeReadOnly = (token, value, inTable) => {
|
|
7078
|
+
const str = value === null || value === void 0 ? "" : String(value);
|
|
7079
|
+
const isEmpty = str === "" || str === "null" || str === "undefined";
|
|
7080
|
+
if (isEmpty && token !== "read-only-password" && token !== "read-only-progress" && token !== "read-only-rating") return "-";
|
|
7081
|
+
switch (token) {
|
|
7082
|
+
case "read-only-password":
|
|
7083
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: { letterSpacing: 2 }, children: str ? "\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF" : "-" });
|
|
7084
|
+
case "read-only-textarea":
|
|
7085
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7086
|
+
antd.Input.TextArea,
|
|
7087
|
+
{
|
|
7088
|
+
value: str,
|
|
7089
|
+
autoSize: { minRows: 2, maxRows: 12 },
|
|
7090
|
+
readOnly: true,
|
|
7091
|
+
style: { resize: "vertical", background: "transparent", border: "none", padding: 0, boxShadow: "none" }
|
|
7092
|
+
}
|
|
7093
|
+
);
|
|
7094
|
+
case "read-only-markdown":
|
|
7095
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React6.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Input, { active: true, size: "small", style: { width: 200 } }), children: /* @__PURE__ */ jsxRuntime.jsx(ReactMarkdown, { children: str }) });
|
|
7096
|
+
case "read-only-json": {
|
|
7097
|
+
let formatted = str;
|
|
7098
|
+
try {
|
|
7099
|
+
formatted = JSON.stringify(JSON.parse(str), null, 2);
|
|
7100
|
+
} catch {
|
|
7101
|
+
}
|
|
7102
|
+
return /* @__PURE__ */ jsxRuntime.jsx("pre", { style: { margin: 0, fontSize: 12, whiteSpace: "pre-wrap", wordBreak: "break-all" }, children: formatted });
|
|
7103
|
+
}
|
|
7104
|
+
case "read-only-url":
|
|
7105
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: str, target: "_blank", rel: "noopener noreferrer", children: str });
|
|
7106
|
+
case "read-only-email":
|
|
7107
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: `mailto:${str}`, children: str });
|
|
7108
|
+
case "read-only-currency": {
|
|
7109
|
+
const num = parseFloat(str);
|
|
7110
|
+
if (isNaN(num)) return str || "-";
|
|
7111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(num) });
|
|
7112
|
+
}
|
|
7113
|
+
case "read-only-percentage": {
|
|
7114
|
+
const num = parseFloat(str);
|
|
7115
|
+
if (isNaN(num)) return str || "-";
|
|
7116
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: `${num} %` });
|
|
7117
|
+
}
|
|
7118
|
+
case "read-only-progress": {
|
|
7119
|
+
const num = Math.max(0, Math.min(100, parseFloat(str) || 0));
|
|
7120
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Progress, { percent: num, size: "small", style: { marginBottom: 0 } });
|
|
7121
|
+
}
|
|
7122
|
+
case "read-only-rating": {
|
|
7123
|
+
const num = parseFloat(str) || 0;
|
|
7124
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Rate, { disabled: true, value: num });
|
|
7125
|
+
}
|
|
7126
|
+
case "read-only-duration": {
|
|
7127
|
+
const secs = parseInt(str) || 0;
|
|
7128
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: formatDuration(secs) });
|
|
7129
|
+
}
|
|
7130
|
+
case "read-only-phone":
|
|
7131
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: `tel:${str}`, children: str });
|
|
7132
|
+
case "read-only-color":
|
|
7133
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 6 }, children: [
|
|
7134
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-block", width: 16, height: 16, background: str, border: "1px solid #d9d9d9", borderRadius: 2, flexShrink: 0 } }),
|
|
7135
|
+
str
|
|
7136
|
+
] });
|
|
7137
|
+
case "read-only-code":
|
|
7138
|
+
return /* @__PURE__ */ jsxRuntime.jsx("pre", { style: { margin: 0, fontSize: 12, fontFamily: "monospace", whiteSpace: "pre-wrap", wordBreak: "break-all" }, children: str });
|
|
7139
|
+
case "read-only-image-url":
|
|
7140
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: str, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: str, alt: "", style: { maxWidth: "100%", maxHeight: 200, objectFit: "contain", borderRadius: 4, display: "block" } }) });
|
|
7141
|
+
case "read-only-qrcode":
|
|
7142
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React6.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Input, { active: true, size: "small", style: { width: 128 } }), children: /* @__PURE__ */ jsxRuntime.jsx(QRCodeSVG, { value: str, size: 128 }) });
|
|
7143
|
+
case "read-only-relative": {
|
|
7144
|
+
const parsed = dayjs8__default.default(str);
|
|
7145
|
+
if (!parsed.isValid()) return str || "-";
|
|
7146
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: parsed.fromNow() });
|
|
7147
|
+
}
|
|
7148
|
+
case "read-only-truncated-text":
|
|
7149
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: str, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", cursor: "default" }, children: str }) });
|
|
7150
|
+
default:
|
|
7151
|
+
return str || "-";
|
|
7152
|
+
}
|
|
7153
|
+
};
|
|
7154
|
+
var wrapForTable = (node) => /* @__PURE__ */ jsxRuntime.jsx("div", { style: { maxHeight: 120, overflowY: "auto", overflowX: "hidden" }, children: node });
|
|
7155
|
+
var renderFieldValue = (field, record, allModels, inTable) => {
|
|
7156
|
+
const value = record?.[field.key];
|
|
7157
|
+
const isNlSentenceField = field.key === "nl_sentence" || field.key === "nl_asks_sentence";
|
|
7158
|
+
if (isNlSentenceField) {
|
|
7159
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7160
|
+
antd.Input.TextArea,
|
|
7161
|
+
{
|
|
7162
|
+
value: value === null || value === void 0 ? "" : String(value),
|
|
7163
|
+
autoSize: { minRows: 3, maxRows: 18 },
|
|
7164
|
+
style: { resize: "vertical", background: "#f3f6f9" },
|
|
7165
|
+
placeholder: _16(field.key),
|
|
7166
|
+
readOnly: true
|
|
7167
|
+
}
|
|
7168
|
+
);
|
|
7169
|
+
}
|
|
7170
|
+
const showToken = normalizeFieldViewType(field.showViewType || "");
|
|
7171
|
+
if (showToken && showToken.startsWith("read-only-") && !(showToken === "read-only-field" && field.reference)) {
|
|
7172
|
+
const node = renderFieldViewTypeReadOnly(showToken, value);
|
|
7173
|
+
return inTable && TALL_VIEW_TYPE_TOKENS.has(showToken) ? wrapForTable(node) : node;
|
|
7174
|
+
}
|
|
7175
|
+
if (field.type === "boolean") {
|
|
7176
|
+
return value ? /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircleOutlined, { style: { color: "green", fontSize: "1.2em" } }) : /* @__PURE__ */ jsxRuntime.jsx(icons.CloseCircleOutlined, { style: { color: "red", fontSize: "1.2em" } });
|
|
7177
|
+
}
|
|
7178
|
+
if (field.reference && value && hasReferenceModel(field.reference, allModels)) {
|
|
7179
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ReferenceField, { id: value, resource: resolveResourcePath(field.referencePath || field.reference, allModels) });
|
|
7180
|
+
}
|
|
7181
|
+
if (field.type === "number") {
|
|
7182
|
+
return formatNumberValue(value) ?? "-";
|
|
7183
|
+
}
|
|
7184
|
+
if (field.type === "date") {
|
|
7185
|
+
return formatDateValue(value) ?? "-";
|
|
7186
|
+
}
|
|
7187
|
+
if (field.type === "datetime") {
|
|
7188
|
+
return formatDateTimeValue(value) ?? "-";
|
|
7189
|
+
}
|
|
7190
|
+
if (field.type === "time") {
|
|
7191
|
+
return formatTimeValue(value);
|
|
7192
|
+
}
|
|
7193
|
+
if (field.options && value !== void 0 && value !== null) {
|
|
7194
|
+
return renderOptionTag(field, value);
|
|
7195
|
+
}
|
|
7196
|
+
return value ?? "-";
|
|
7197
|
+
};
|
|
7198
|
+
var _17 = window._ || ((text) => text);
|
|
7199
|
+
var CALENDAR_WEEKDAYS = [_17("Sun"), _17("Mon"), _17("Tue"), _17("Wed"), _17("Thu"), _17("Fri"), _17("Sat")];
|
|
6977
7200
|
var CALENDAR_DATE_FOOTER_FIELDS = /* @__PURE__ */ new Set(["creation_date", "modification_date"]);
|
|
6978
7201
|
var isCalendarDateField = (field) => {
|
|
6979
7202
|
const rawType = String(field?.type || "").trim().toLowerCase();
|
|
@@ -7001,22 +7224,10 @@ var getCalendarDateFieldOptions = (fields) => {
|
|
|
7001
7224
|
var getCalendarRecordDate = (record, fieldKey) => {
|
|
7002
7225
|
const rawValue = record?.[fieldKey];
|
|
7003
7226
|
if (rawValue === void 0 || rawValue === null || rawValue === "") return null;
|
|
7004
|
-
const parsed =
|
|
7227
|
+
const parsed = dayjs8__default.default(rawValue);
|
|
7005
7228
|
if (!parsed.isValid()) return null;
|
|
7006
7229
|
return parsed.startOf("day");
|
|
7007
7230
|
};
|
|
7008
|
-
|
|
7009
|
-
// src/components/DynamicResource/utils/navigation.ts
|
|
7010
|
-
var getShowHref = (resource, id, allModels) => {
|
|
7011
|
-
const resourcePath = resolveResourcePath(resource, allModels);
|
|
7012
|
-
return `/${resourcePath}/show/${id}`;
|
|
7013
|
-
};
|
|
7014
|
-
var shouldHandleLinkClick = (event) => {
|
|
7015
|
-
if (event.defaultPrevented) return false;
|
|
7016
|
-
if (event.button !== 0) return false;
|
|
7017
|
-
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return false;
|
|
7018
|
-
return true;
|
|
7019
|
-
};
|
|
7020
7231
|
var USER_KEY = "jm_user";
|
|
7021
7232
|
function getCurrentUserRoles() {
|
|
7022
7233
|
try {
|
|
@@ -7041,7 +7252,7 @@ function useRoleFilteredModel(model) {
|
|
|
7041
7252
|
return { ...model, fields: filtered };
|
|
7042
7253
|
}, [model, userRoles]);
|
|
7043
7254
|
}
|
|
7044
|
-
var
|
|
7255
|
+
var _18 = window._ || ((text) => text);
|
|
7045
7256
|
var DynamicShow = ({ model: modelProp, allModels, idOverride, embedded }) => {
|
|
7046
7257
|
const model = useRoleFilteredModel(modelProp);
|
|
7047
7258
|
applyI18nLabelsToModel(model);
|
|
@@ -7053,7 +7264,7 @@ var DynamicShow = ({ model: modelProp, allModels, idOverride, embedded }) => {
|
|
|
7053
7264
|
const id = idOverride ?? routeId;
|
|
7054
7265
|
const { formProps, saveButtonProps, record, recordId } = useShowEditableForm(model.resource || model.name, id);
|
|
7055
7266
|
const { formProps: showFormProps, effectiveFields } = buildShowTabFormOptions(formProps, model, allModels);
|
|
7056
|
-
const pageTitle = record?._label ? asDisplayText(record._label, `${
|
|
7267
|
+
const pageTitle = record?._label ? asDisplayText(record._label, `${_18("Show")} ${modelDisplayLabel}`) : `${_18("Show")} ${modelDisplayLabel}`;
|
|
7057
7268
|
const { actionsState, headerButtons } = useShowActionsPreferences(model, allModels, record, saveButtonProps);
|
|
7058
7269
|
const [activeTabKey, setActiveTabKey] = React6.useState("details");
|
|
7059
7270
|
const items = useStandardShowTabs(
|
|
@@ -7101,7 +7312,7 @@ var DynamicShow = ({ model: modelProp, allModels, idOverride, embedded }) => {
|
|
|
7101
7312
|
title: renderWrappedPageTitle(renderModelHeading({
|
|
7102
7313
|
model,
|
|
7103
7314
|
title: pageTitle,
|
|
7104
|
-
actionLabel:
|
|
7315
|
+
actionLabel: _18("Show"),
|
|
7105
7316
|
moduleLabel: model.module ? getModuleLabel(model.module) : void 0
|
|
7106
7317
|
})),
|
|
7107
7318
|
headerButtons,
|
|
@@ -7121,7 +7332,7 @@ var DynamicShow = ({ model: modelProp, allModels, idOverride, embedded }) => {
|
|
|
7121
7332
|
)
|
|
7122
7333
|
] });
|
|
7123
7334
|
};
|
|
7124
|
-
var
|
|
7335
|
+
var _19 = window._ || ((text) => text);
|
|
7125
7336
|
var RELATION_SELECT_DEFAULT_PAGE_SIZE = 2e3;
|
|
7126
7337
|
var RelationSelect = ({ field, value, onChange, allModels, multiple, serverSearch, excludeId }) => {
|
|
7127
7338
|
const optionLabel = "_label";
|
|
@@ -7176,7 +7387,7 @@ var RelationSelect = ({ field, value, onChange, allModels, multiple, serverSearc
|
|
|
7176
7387
|
}
|
|
7177
7388
|
),
|
|
7178
7389
|
isCapped && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginTop: 4 }, children: [
|
|
7179
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", style: { fontSize: 11 }, children:
|
|
7390
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", style: { fontSize: 11 }, children: _19("Showing N of T \u2014 type to search").replace("N", formatNumberValue(loadedCount)).replace("T", formatNumberValue(serverTotal)) }),
|
|
7180
7391
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7181
7392
|
antd.Button,
|
|
7182
7393
|
{
|
|
@@ -7185,13 +7396,13 @@ var RelationSelect = ({ field, value, onChange, allModels, multiple, serverSearc
|
|
|
7185
7396
|
style: { fontSize: 11, padding: 0 },
|
|
7186
7397
|
loading: queryResult?.isLoading || queryResult?.isFetching,
|
|
7187
7398
|
onClick: () => setLoadAll(true),
|
|
7188
|
-
children:
|
|
7399
|
+
children: _19("Load all")
|
|
7189
7400
|
}
|
|
7190
7401
|
)
|
|
7191
7402
|
] })
|
|
7192
7403
|
] });
|
|
7193
7404
|
};
|
|
7194
|
-
var
|
|
7405
|
+
var _20 = window._ || ((text) => text);
|
|
7195
7406
|
var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
7196
7407
|
const form = antd.Form.useFormInstance();
|
|
7197
7408
|
const [uploading, setUploading] = React6.useState(false);
|
|
@@ -7200,7 +7411,7 @@ var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
|
7200
7411
|
const handleUpload = async (file) => {
|
|
7201
7412
|
const recordId = form.getFieldValue("eid") ?? form.getFieldValue("id");
|
|
7202
7413
|
if (!recordId) {
|
|
7203
|
-
antd.message.error(
|
|
7414
|
+
antd.message.error(_20("Save the record first before uploading a file."));
|
|
7204
7415
|
return false;
|
|
7205
7416
|
}
|
|
7206
7417
|
setUploading(true);
|
|
@@ -7224,9 +7435,9 @@ var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
|
7224
7435
|
data_hash: result.data_hash
|
|
7225
7436
|
});
|
|
7226
7437
|
setFileName(result.data_name || file.name);
|
|
7227
|
-
antd.message.success(
|
|
7438
|
+
antd.message.success(_20("File uploaded successfully."));
|
|
7228
7439
|
} catch (err) {
|
|
7229
|
-
antd.message.error(err?.message ||
|
|
7440
|
+
antd.message.error(err?.message || _20("File upload failed."));
|
|
7230
7441
|
} finally {
|
|
7231
7442
|
setUploading(false);
|
|
7232
7443
|
}
|
|
@@ -7243,9 +7454,9 @@ var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
|
7243
7454
|
style: { padding: "8px 16px" },
|
|
7244
7455
|
children: [
|
|
7245
7456
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { marginBottom: 4 }, children: uploading ? /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" }) : /* @__PURE__ */ jsxRuntime.jsx(icons.UploadOutlined, { style: { fontSize: 24, color: "#1677ff" } }) }),
|
|
7246
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: 13, margin: 0 }, children: uploading ?
|
|
7457
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: 13, margin: 0 }, children: uploading ? _20("Uploading...") : _20("Click or drag a file here to upload") }),
|
|
7247
7458
|
displayName && !uploading && /* @__PURE__ */ jsxRuntime.jsxs("p", { style: { fontSize: 11, color: "#888", margin: "4px 0 0" }, children: [
|
|
7248
|
-
|
|
7459
|
+
_20("Current"),
|
|
7249
7460
|
": ",
|
|
7250
7461
|
displayName
|
|
7251
7462
|
] })
|
|
@@ -7253,7 +7464,7 @@ var FileUploadInput = ({ value: _value, onChange: _onChange }) => {
|
|
|
7253
7464
|
}
|
|
7254
7465
|
) });
|
|
7255
7466
|
};
|
|
7256
|
-
var
|
|
7467
|
+
var _21 = window._ || ((text) => text);
|
|
7257
7468
|
var AsyncSelectInput = ({
|
|
7258
7469
|
optionsUrl,
|
|
7259
7470
|
placeholder,
|
|
@@ -7313,20 +7524,159 @@ var AsyncSelectInput = ({
|
|
|
7313
7524
|
options,
|
|
7314
7525
|
value,
|
|
7315
7526
|
onChange,
|
|
7316
|
-
placeholder: placeholder ||
|
|
7527
|
+
placeholder: placeholder || _21("Select..."),
|
|
7317
7528
|
style: { width: "100%" },
|
|
7318
7529
|
filterOption: (input, option) => String(option?.label ?? "").toLowerCase().includes(input.toLowerCase())
|
|
7319
7530
|
}
|
|
7320
7531
|
);
|
|
7321
7532
|
};
|
|
7322
|
-
var
|
|
7533
|
+
var _22 = window._ || ((text) => text);
|
|
7534
|
+
var ReactMarkdown2 = React6.lazy(() => import('react-markdown').then((m) => ({ default: m.default })));
|
|
7535
|
+
var MarkdownEditor = ({ value = "", onChange }) => {
|
|
7536
|
+
const [activeTab, setActiveTab] = React6.useState("edit");
|
|
7537
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7538
|
+
antd.Tabs,
|
|
7539
|
+
{
|
|
7540
|
+
activeKey: activeTab,
|
|
7541
|
+
onChange: setActiveTab,
|
|
7542
|
+
size: "small",
|
|
7543
|
+
style: { marginBottom: 0 },
|
|
7544
|
+
items: [
|
|
7545
|
+
{
|
|
7546
|
+
key: "edit",
|
|
7547
|
+
label: _22("Edit"),
|
|
7548
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7549
|
+
antd.Input.TextArea,
|
|
7550
|
+
{
|
|
7551
|
+
value,
|
|
7552
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
7553
|
+
autoSize: { minRows: 3, maxRows: 18 },
|
|
7554
|
+
style: { resize: "vertical" }
|
|
7555
|
+
}
|
|
7556
|
+
)
|
|
7557
|
+
},
|
|
7558
|
+
{
|
|
7559
|
+
key: "preview",
|
|
7560
|
+
label: _22("Preview"),
|
|
7561
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { minHeight: 60, padding: "4px 0" }, children: /* @__PURE__ */ jsxRuntime.jsx(React6.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Input, { active: true, size: "small", style: { width: 200 } }), children: /* @__PURE__ */ jsxRuntime.jsx(ReactMarkdown2, { children: value }) }) })
|
|
7562
|
+
}
|
|
7563
|
+
]
|
|
7564
|
+
}
|
|
7565
|
+
);
|
|
7566
|
+
};
|
|
7567
|
+
var JsonEditor = ({ value = "", onChange }) => {
|
|
7568
|
+
const [error, setError] = React6.useState(null);
|
|
7569
|
+
const handleChange = (e) => {
|
|
7570
|
+
const raw = e.target.value;
|
|
7571
|
+
onChange?.(raw);
|
|
7572
|
+
if (!raw.trim()) {
|
|
7573
|
+
setError(null);
|
|
7574
|
+
return;
|
|
7575
|
+
}
|
|
7576
|
+
try {
|
|
7577
|
+
JSON.parse(raw);
|
|
7578
|
+
setError(null);
|
|
7579
|
+
} catch (ex) {
|
|
7580
|
+
setError(ex.message);
|
|
7581
|
+
}
|
|
7582
|
+
};
|
|
7583
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
7584
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7585
|
+
antd.Input.TextArea,
|
|
7586
|
+
{
|
|
7587
|
+
value,
|
|
7588
|
+
onChange: handleChange,
|
|
7589
|
+
autoSize: { minRows: 3, maxRows: 18 },
|
|
7590
|
+
style: { resize: "vertical", fontFamily: "monospace", fontSize: 12 }
|
|
7591
|
+
}
|
|
7592
|
+
),
|
|
7593
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { type: "error", message: error, showIcon: true, style: { marginTop: 4, padding: "2px 8px", fontSize: 11 } })
|
|
7594
|
+
] });
|
|
7595
|
+
};
|
|
7596
|
+
var renderEditableFieldViewType = (token, value, onChange) => {
|
|
7597
|
+
const str = value === null || value === void 0 ? "" : String(value);
|
|
7598
|
+
switch (token) {
|
|
7599
|
+
case "editable-password":
|
|
7600
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Input.Password, { value: str, onChange: (e) => onChange?.(e.target.value) });
|
|
7601
|
+
case "editable-textarea":
|
|
7602
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Input.TextArea, { value: str, onChange: (e) => onChange?.(e.target.value), autoSize: { minRows: 3, maxRows: 18 }, style: { resize: "vertical" } });
|
|
7603
|
+
case "editable-markdown":
|
|
7604
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MarkdownEditor, { value: str, onChange });
|
|
7605
|
+
case "editable-json":
|
|
7606
|
+
return /* @__PURE__ */ jsxRuntime.jsx(JsonEditor, { value: str, onChange });
|
|
7607
|
+
case "editable-url":
|
|
7608
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
7609
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Input, { value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "https://..." }),
|
|
7610
|
+
str && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 2, fontSize: 11 }, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: str, target: "_blank", rel: "noopener noreferrer", children: str }) })
|
|
7611
|
+
] });
|
|
7612
|
+
case "editable-email":
|
|
7613
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { type: "email", value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "user@example.com" });
|
|
7614
|
+
case "editable-currency": {
|
|
7615
|
+
const num = value === null || value === void 0 ? void 0 : Number(value);
|
|
7616
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.InputNumber, { style: { width: "100%" }, value: isNaN(num) ? void 0 : num, onChange, addonBefore: "$", precision: 2, step: 0.01 });
|
|
7617
|
+
}
|
|
7618
|
+
case "editable-percentage": {
|
|
7619
|
+
const num = value === null || value === void 0 ? void 0 : Number(value);
|
|
7620
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.InputNumber, { style: { width: "100%" }, value: isNaN(num) ? void 0 : num, onChange, addonAfter: "%", step: 0.1 });
|
|
7621
|
+
}
|
|
7622
|
+
case "editable-progress": {
|
|
7623
|
+
const num = value === null || value === void 0 ? void 0 : Number(value);
|
|
7624
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.InputNumber, { style: { width: "100%" }, value: isNaN(num) ? void 0 : num, onChange, min: 0, max: 100, addonAfter: "%", precision: 0 });
|
|
7625
|
+
}
|
|
7626
|
+
case "editable-rating":
|
|
7627
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Rate, { value: Number(value) || 0, onChange });
|
|
7628
|
+
case "editable-duration": {
|
|
7629
|
+
const num = value === null || value === void 0 ? void 0 : Number(value);
|
|
7630
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.InputNumber, { style: { width: "100%" }, value: isNaN(num) ? void 0 : num, onChange, min: 0, precision: 0, addonAfter: "s" });
|
|
7631
|
+
}
|
|
7632
|
+
case "editable-phone":
|
|
7633
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { type: "tel", value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "+1 555 000 0000" });
|
|
7634
|
+
case "editable-color":
|
|
7635
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
7636
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7637
|
+
"input",
|
|
7638
|
+
{
|
|
7639
|
+
type: "color",
|
|
7640
|
+
value: str || "#000000",
|
|
7641
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
7642
|
+
style: { width: 36, height: 28, border: "1px solid #d9d9d9", borderRadius: 4, padding: 2, cursor: "pointer", flexShrink: 0 }
|
|
7643
|
+
}
|
|
7644
|
+
),
|
|
7645
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Input, { value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "#000000", style: { flex: 1 } })
|
|
7646
|
+
] });
|
|
7647
|
+
case "editable-code":
|
|
7648
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7649
|
+
antd.Input.TextArea,
|
|
7650
|
+
{
|
|
7651
|
+
value: str,
|
|
7652
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
7653
|
+
autoSize: { minRows: 3, maxRows: 18 },
|
|
7654
|
+
style: { resize: "vertical", fontFamily: "monospace", fontSize: 12 }
|
|
7655
|
+
}
|
|
7656
|
+
);
|
|
7657
|
+
case "editable-image-url":
|
|
7658
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
7659
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Input, { value: str, onChange: (e) => onChange?.(e.target.value), placeholder: "https://..." }),
|
|
7660
|
+
str && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7661
|
+
"img",
|
|
7662
|
+
{
|
|
7663
|
+
src: str,
|
|
7664
|
+
alt: "",
|
|
7665
|
+
style: { marginTop: 4, maxWidth: "100%", maxHeight: 120, objectFit: "contain", borderRadius: 4, display: "block" }
|
|
7666
|
+
}
|
|
7667
|
+
)
|
|
7668
|
+
] });
|
|
7669
|
+
default:
|
|
7670
|
+
return null;
|
|
7671
|
+
}
|
|
7672
|
+
};
|
|
7323
7673
|
var renderInput = (field, allModels, model, currentId) => {
|
|
7324
7674
|
const resolvedField = model && allModels ? applyRelationFieldOverrides(model, allModels).find((item) => item.key === field.key) || field : field;
|
|
7325
7675
|
if (resolvedField.key === "data" && isFileModel(model)) {
|
|
7326
7676
|
return /* @__PURE__ */ jsxRuntime.jsx(FileUploadInput, {});
|
|
7327
7677
|
}
|
|
7328
7678
|
const isNlSentenceField = resolvedField.key === "nl_sentence" || resolvedField.key === "nl_asks_sentence";
|
|
7329
|
-
const sentenceFieldHelper =
|
|
7679
|
+
const sentenceFieldHelper = _22(resolvedField.key);
|
|
7330
7680
|
if (isNlSentenceField) {
|
|
7331
7681
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7332
7682
|
antd.Input.TextArea,
|
|
@@ -7340,21 +7690,26 @@ var renderInput = (field, allModels, model, currentId) => {
|
|
|
7340
7690
|
if (resolvedField.readOnly) {
|
|
7341
7691
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { disabled: true });
|
|
7342
7692
|
}
|
|
7693
|
+
const editToken = normalizeFieldViewType(resolvedField.editViewType || "");
|
|
7694
|
+
if (editToken && editToken.startsWith("editable-")) {
|
|
7695
|
+
const Wrapper = ({ value, onChange }) => renderEditableFieldViewType(editToken, value, onChange);
|
|
7696
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, {});
|
|
7697
|
+
}
|
|
7343
7698
|
if (resolvedField.reference && hasReferenceModel(resolvedField.reference, allModels)) {
|
|
7344
7699
|
const refResource = resolveResourcePath(resolvedField.reference, allModels);
|
|
7345
7700
|
const modelResource = model ? resolveResourcePath(model.resource || model.name, allModels) : void 0;
|
|
7346
7701
|
const isSelfRef = refResource && modelResource && refResource === modelResource;
|
|
7347
7702
|
return /* @__PURE__ */ jsxRuntime.jsx(RelationSelect, { field: resolvedField, allModels, excludeId: isSelfRef ? currentId : void 0 });
|
|
7348
7703
|
}
|
|
7349
|
-
if (resolvedField.optionsUrl) return /* @__PURE__ */ jsxRuntime.jsx(AsyncSelectInput, { optionsUrl: resolvedField.optionsUrl, placeholder: `${
|
|
7704
|
+
if (resolvedField.optionsUrl) return /* @__PURE__ */ jsxRuntime.jsx(AsyncSelectInput, { optionsUrl: resolvedField.optionsUrl, placeholder: `${_22("Select")} ${_22(resolvedField.label)}...` });
|
|
7350
7705
|
if (resolvedField.options) return /* @__PURE__ */ jsxRuntime.jsx(antd.Select, { options: resolvedField.options, style: { width: "100%" }, placeholder: `Select ${resolvedField.label}...`, allowClear: true });
|
|
7351
7706
|
switch (resolvedField.type) {
|
|
7352
7707
|
case "boolean":
|
|
7353
7708
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Checkbox, {});
|
|
7354
7709
|
case "date":
|
|
7355
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.DatePicker, { style: { width: "100%" }, placeholder:
|
|
7710
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.DatePicker, { style: { width: "100%" }, placeholder: _22("Select date") });
|
|
7356
7711
|
case "datetime":
|
|
7357
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.DatePicker, { showTime: true, style: { width: "100%" }, placeholder:
|
|
7712
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.DatePicker, { showTime: true, style: { width: "100%" }, placeholder: _22("Select date and time") });
|
|
7358
7713
|
case "time":
|
|
7359
7714
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.TimePicker, { style: { width: "100%" } });
|
|
7360
7715
|
case "number":
|
|
@@ -7363,47 +7718,9 @@ var renderInput = (field, allModels, model, currentId) => {
|
|
|
7363
7718
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Input, {});
|
|
7364
7719
|
}
|
|
7365
7720
|
};
|
|
7366
|
-
var _22 = window._ || ((text) => text);
|
|
7367
|
-
var renderFieldValue = (field, record, allModels) => {
|
|
7368
|
-
const isNlSentenceField = field.key === "nl_sentence" || field.key === "nl_asks_sentence";
|
|
7369
|
-
if (isNlSentenceField) {
|
|
7370
|
-
const value = record?.[field.key];
|
|
7371
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7372
|
-
antd.Input.TextArea,
|
|
7373
|
-
{
|
|
7374
|
-
value: value === null || value === void 0 ? "" : String(value),
|
|
7375
|
-
autoSize: { minRows: 3, maxRows: 18 },
|
|
7376
|
-
style: { resize: "vertical", background: "#f3f6f9" },
|
|
7377
|
-
placeholder: _22(field.key),
|
|
7378
|
-
readOnly: true
|
|
7379
|
-
}
|
|
7380
|
-
);
|
|
7381
|
-
}
|
|
7382
|
-
if (field.type === "boolean") {
|
|
7383
|
-
return record?.[field.key] ? /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircleOutlined, { style: { color: "green", fontSize: "1.2em" } }) : /* @__PURE__ */ jsxRuntime.jsx(icons.CloseCircleOutlined, { style: { color: "red", fontSize: "1.2em" } });
|
|
7384
|
-
}
|
|
7385
|
-
if (field.reference && record?.[field.key] && hasReferenceModel(field.reference, allModels)) {
|
|
7386
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ReferenceField, { id: record[field.key], resource: resolveResourcePath(field.referencePath || field.reference, allModels) });
|
|
7387
|
-
}
|
|
7388
|
-
if (field.type === "number") {
|
|
7389
|
-
return formatNumberValue(record?.[field.key]) ?? "-";
|
|
7390
|
-
}
|
|
7391
|
-
if (field.type === "date") {
|
|
7392
|
-
return formatDateValue(record?.[field.key]) ?? "-";
|
|
7393
|
-
}
|
|
7394
|
-
if (field.type === "datetime") {
|
|
7395
|
-
return formatDateTimeValue(record?.[field.key]) ?? "-";
|
|
7396
|
-
}
|
|
7397
|
-
if (field.type === "time") {
|
|
7398
|
-
return formatTimeValue(record?.[field.key]);
|
|
7399
|
-
}
|
|
7400
|
-
if (field.options && record?.[field.key] !== void 0 && record?.[field.key] !== null) {
|
|
7401
|
-
return renderOptionTag(field, record[field.key]);
|
|
7402
|
-
}
|
|
7403
|
-
return record?.[field.key] ?? "-";
|
|
7404
|
-
};
|
|
7405
7721
|
var _23 = window._ || ((text) => text);
|
|
7406
7722
|
var { Title: Title2 } = antd.Typography;
|
|
7723
|
+
var requiredMark = (field) => field.required ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#ff4d4f", marginLeft: 3 }, children: "*" }) : null;
|
|
7407
7724
|
var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedValues }) => {
|
|
7408
7725
|
const model = useRoleFilteredModel(modelProp);
|
|
7409
7726
|
applyI18nLabelsToModel(model);
|
|
@@ -7659,14 +7976,17 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7659
7976
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: field.key, hidden: true, rules: field.required ? [{ required: true }] : [], children: renderInput(field, allModels, model) }, `${field.key}-${index}`);
|
|
7660
7977
|
}
|
|
7661
7978
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: showLabel ? "200px 1fr" : "1fr", alignItems: "start", columnGap: 6 }, children: [
|
|
7662
|
-
showLabel && /* @__PURE__ */ jsxRuntime.
|
|
7979
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: [
|
|
7980
|
+
field.label,
|
|
7981
|
+
requiredMark(field)
|
|
7982
|
+
] }),
|
|
7663
7983
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, background: valueBackground, borderRadius: 6, border: `1px solid ${token.colorBorder}`, maxWidth: "100%", overflowWrap: "anywhere", ...parseInlineStyle(item.html_format) }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7664
7984
|
antd.Form.Item,
|
|
7665
7985
|
{
|
|
7666
7986
|
name: field.key,
|
|
7667
7987
|
rules: field.required ? [{ required: true }] : [],
|
|
7668
7988
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
7669
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
7989
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8__default.default(val) } : field.type === "time" && val ? { value: dayjs8__default.default("1970-01-01T" + val) } : { value: val },
|
|
7670
7990
|
style: { margin: 0 },
|
|
7671
7991
|
children: renderInput(field, allModels, model)
|
|
7672
7992
|
}
|
|
@@ -7728,7 +8048,10 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7728
8048
|
...parseInlineStyle(item.html_format)
|
|
7729
8049
|
};
|
|
7730
8050
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: showLabel ? "200px 1fr" : "1fr", alignItems: "start", columnGap: 6 }, children: [
|
|
7731
|
-
showLabel && /* @__PURE__ */ jsxRuntime.
|
|
8051
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: [
|
|
8052
|
+
field.label,
|
|
8053
|
+
requiredMark(field)
|
|
8054
|
+
] }),
|
|
7732
8055
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: readonlyValueStyle, children: renderFieldValue(field, createdRecord, allModels) })
|
|
7733
8056
|
] }) }, `${field.key}-${index}`);
|
|
7734
8057
|
};
|
|
@@ -7739,7 +8062,7 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7739
8062
|
const prefix = useReadonly ? "pc" : "cr";
|
|
7740
8063
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { border: `1px solid ${token.colorBorder}`, borderRadius: 8, padding: "6px 6px", marginBottom: 6 }, children: [
|
|
7741
8064
|
/* @__PURE__ */ jsxRuntime.jsx(Title2, { level: 5, style: { margin: 0, marginBottom: 6, color: "#1677ff" }, children: _23(section) }),
|
|
7742
|
-
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
8065
|
+
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, rowIdx) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: Array.from({ length: maxCol }).map((_42, colIdx) => {
|
|
7743
8066
|
const cellItems = normalized.filter((r) => r.row === rowIdx + 1 && r.column === colIdx + 1);
|
|
7744
8067
|
return /* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "0 4px", verticalAlign: "top", width: `${100 / maxCol}%` }, children: cellItems.map(
|
|
7745
8068
|
(item, idx) => useReadonly ? renderReadonlyCell(item, idx) : renderFormCell(item, idx)
|
|
@@ -7757,8 +8080,11 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7757
8080
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: field.key, hidden: true, rules: field.required ? [{ required: true }] : [], children: renderInput(field, allModels, model) }, field.key);
|
|
7758
8081
|
}
|
|
7759
8082
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "200px 1fr", justifyContent: "start", alignItems: "start", columnGap: 6 }, children: [
|
|
7760
|
-
/* @__PURE__ */ jsxRuntime.
|
|
7761
|
-
|
|
8083
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: labelStyle, children: [
|
|
8084
|
+
field.label,
|
|
8085
|
+
requiredMark(field)
|
|
8086
|
+
] }),
|
|
8087
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, maxWidth: "100%", overflowWrap: "anywhere" }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: field.key, rules: field.required ? [{ required: true }] : [], valuePropName: field.type === "boolean" ? "checked" : void 0, getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8__default.default(val) } : field.type === "time" && val ? { value: dayjs8__default.default("1970-01-01T" + val) } : { value: val }, style: { margin: 0 }, children: renderInput(field, allModels, model) }) })
|
|
7762
8088
|
] }, field.key);
|
|
7763
8089
|
}) }) })
|
|
7764
8090
|
] }),
|
|
@@ -7892,7 +8218,10 @@ var DynamicCreate = ({ model: modelProp, allModels, journeyCallbacks, injectedVa
|
|
|
7892
8218
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: field.key, hidden: true, rules: field.required ? [{ required: true }] : [], children: isOtherKey && field.reference && hasReferenceModel(field.reference, allModels) ? /* @__PURE__ */ jsxRuntime.jsx(RelationSelect, { field, allModels, multiple: true }) : renderInput(field, allModels, model) }, field.key);
|
|
7893
8219
|
}
|
|
7894
8220
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "200px 1fr", justifyContent: "start", alignItems: "start", columnGap: 6 }, children: [
|
|
7895
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8221
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: labelStyle, children: [
|
|
8222
|
+
field.label,
|
|
8223
|
+
requiredMark(field)
|
|
8224
|
+
] }),
|
|
7896
8225
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, maxWidth: "100%", overflowWrap: "anywhere" }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: field.key, rules: field.required ? [{ required: true }] : [], style: { margin: 0 }, children: isOtherKey && field.reference && hasReferenceModel(field.reference, allModels) ? /* @__PURE__ */ jsxRuntime.jsx(RelationSelect, { field, allModels, multiple: true }) : renderInput(field, allModels, model) }) })
|
|
7897
8226
|
] }, field.key);
|
|
7898
8227
|
}) })
|
|
@@ -7988,6 +8317,7 @@ var NLSentenceBlock = ({ eid, title: titleProp, showLabel }) => {
|
|
|
7988
8317
|
};
|
|
7989
8318
|
var _24 = window._ || ((text) => text);
|
|
7990
8319
|
var { Title: Title3 } = antd.Typography;
|
|
8320
|
+
var requiredMark2 = (field) => field.required ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#ff4d4f", marginLeft: 3 }, children: "*" }) : null;
|
|
7991
8321
|
var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons, journeyCallbacks, idOverride }) => {
|
|
7992
8322
|
const model = useRoleFilteredModel(modelProp);
|
|
7993
8323
|
applyI18nLabelsToModel(model);
|
|
@@ -8310,14 +8640,17 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8310
8640
|
gap: "4px 6px"
|
|
8311
8641
|
},
|
|
8312
8642
|
children: [
|
|
8313
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8643
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { ...labelStyle, flex: "0 0 200px" }, children: [
|
|
8644
|
+
field.label,
|
|
8645
|
+
requiredMark2(field)
|
|
8646
|
+
] }),
|
|
8314
8647
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: "1 0 200px", padding: "2px 4px", lineHeight: 1.15, overflowWrap: "anywhere", background: valueBackground, borderRadius: 6 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8315
8648
|
antd.Form.Item,
|
|
8316
8649
|
{
|
|
8317
8650
|
name: field.key,
|
|
8318
8651
|
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8319
8652
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8320
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
8653
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8__default.default(val) } : field.type === "time" && val ? { value: dayjs8__default.default("1970-01-01T" + val) } : { value: val },
|
|
8321
8654
|
style: { margin: 0 },
|
|
8322
8655
|
children: field.formula ? /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { disabled: true }) : renderInput(field, allModels, model, recordId)
|
|
8323
8656
|
}
|
|
@@ -8359,7 +8692,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8359
8692
|
},
|
|
8360
8693
|
children: [
|
|
8361
8694
|
/* @__PURE__ */ jsxRuntime.jsx(Title3, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _24(section) }),
|
|
8362
|
-
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
8695
|
+
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: Array.from({ length: maxCol }).map((_42, colIndex) => {
|
|
8363
8696
|
const cellItems = normalized.filter(
|
|
8364
8697
|
(item) => item.row === rowIndex + 1 && item.column === colIndex + 1
|
|
8365
8698
|
);
|
|
@@ -8455,7 +8788,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8455
8788
|
gap: 2
|
|
8456
8789
|
},
|
|
8457
8790
|
children: [
|
|
8458
|
-
showLabel && /* @__PURE__ */ jsxRuntime.
|
|
8791
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8459
8792
|
"div",
|
|
8460
8793
|
{
|
|
8461
8794
|
style: {
|
|
@@ -8464,7 +8797,10 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8464
8797
|
padding: "2px 4px",
|
|
8465
8798
|
borderRadius: 4
|
|
8466
8799
|
},
|
|
8467
|
-
children:
|
|
8800
|
+
children: [
|
|
8801
|
+
field.label,
|
|
8802
|
+
requiredMark2(field)
|
|
8803
|
+
]
|
|
8468
8804
|
}
|
|
8469
8805
|
),
|
|
8470
8806
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: readonlyValueStyle, children: renderFieldValue(field, record, allModels) })
|
|
@@ -8481,7 +8817,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8481
8817
|
gap: 2
|
|
8482
8818
|
},
|
|
8483
8819
|
children: [
|
|
8484
|
-
showLabel && /* @__PURE__ */ jsxRuntime.
|
|
8820
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8485
8821
|
"div",
|
|
8486
8822
|
{
|
|
8487
8823
|
style: {
|
|
@@ -8490,7 +8826,10 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8490
8826
|
padding: "2px 4px",
|
|
8491
8827
|
borderRadius: 4
|
|
8492
8828
|
},
|
|
8493
|
-
children:
|
|
8829
|
+
children: [
|
|
8830
|
+
field.label,
|
|
8831
|
+
requiredMark2(field)
|
|
8832
|
+
]
|
|
8494
8833
|
}
|
|
8495
8834
|
),
|
|
8496
8835
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
@@ -8508,7 +8847,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8508
8847
|
name: field.key,
|
|
8509
8848
|
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8510
8849
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8511
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
8850
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8__default.default(val) } : field.type === "time" && val ? { value: dayjs8__default.default("1970-01-01T" + val) } : { value: val },
|
|
8512
8851
|
style: { margin: 0 },
|
|
8513
8852
|
children: field.formula ? /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { disabled: true }) : renderInput(field, allModels, model, recordId)
|
|
8514
8853
|
}
|
|
@@ -8572,7 +8911,7 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8572
8911
|
const maxCol = Math.max(1, ...normalized.map((r) => r.column));
|
|
8573
8912
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0, border: `1px solid ${token.colorBorder}`, borderRadius: 8, padding: "2px 6px" }, children: [
|
|
8574
8913
|
/* @__PURE__ */ jsxRuntime.jsx(Title3, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _24(section) }),
|
|
8575
|
-
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
8914
|
+
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, ri) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: Array.from({ length: maxCol }).map((_42, ci) => {
|
|
8576
8915
|
const cellItems = normalized.filter((item) => item.row === ri + 1 && item.column === ci + 1);
|
|
8577
8916
|
return /* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "0 4px", verticalAlign: "top", width: `${100 / maxCol}%` }, children: cellItems.map((item, idx) => {
|
|
8578
8917
|
if (item.attribute_or_relation_type === "nlsentence") {
|
|
@@ -8615,14 +8954,17 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8615
8954
|
const showLabel = item.show_label !== false;
|
|
8616
8955
|
const editable = isAttributeValueEditable(item, "edit");
|
|
8617
8956
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
8618
|
-
showLabel && /* @__PURE__ */ jsxRuntime.
|
|
8957
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...labelStyle, backgroundColor: labelBackground, padding: "2px 4px", borderRadius: 4 }, children: [
|
|
8958
|
+
field.label,
|
|
8959
|
+
requiredMark2(field)
|
|
8960
|
+
] }),
|
|
8619
8961
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "2px 4px", lineHeight: 1.15, background: valueBackground, borderRadius: 6, border: `1px solid ${token.colorBorder}`, maxWidth: "100%", overflowWrap: "anywhere", ...parseInlineStyle(item.html_format) }, children: editable ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8620
8962
|
antd.Form.Item,
|
|
8621
8963
|
{
|
|
8622
8964
|
name: field.key,
|
|
8623
8965
|
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8624
8966
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8625
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
8967
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8__default.default(val) } : field.type === "time" && val ? { value: dayjs8__default.default("1970-01-01T" + val) } : { value: val },
|
|
8626
8968
|
style: { margin: 0 },
|
|
8627
8969
|
children: field.formula ? /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { disabled: true }) : renderInput(field, allModels, model, recordId)
|
|
8628
8970
|
}
|
|
@@ -8715,7 +9057,57 @@ var DynamicEdit = ({ model: modelProp, allModels, topContent, extraHeaderButtons
|
|
|
8715
9057
|
] });
|
|
8716
9058
|
};
|
|
8717
9059
|
var _25 = window._ || ((text) => text);
|
|
9060
|
+
var ReadAndEditReference = ({ value, onChange, field, allModels, model, currentId }) => {
|
|
9061
|
+
const [editing, setEditing] = React6.useState(false);
|
|
9062
|
+
const [draft, setDraft] = React6.useState(void 0);
|
|
9063
|
+
const form = antd.Form.useFormInstance();
|
|
9064
|
+
const resource = field.referencePath ? field.referencePath : field.reference ? resolveResourcePath(field.reference, allModels) : "";
|
|
9065
|
+
const modelResource = model ? resolveResourcePath(model.resource || model.name, allModels) : void 0;
|
|
9066
|
+
const isSelfRef = resource && modelResource && resource === modelResource;
|
|
9067
|
+
const handleEdit = () => {
|
|
9068
|
+
setDraft(value);
|
|
9069
|
+
setEditing(true);
|
|
9070
|
+
};
|
|
9071
|
+
const handleConfirm = () => {
|
|
9072
|
+
onChange?.(draft);
|
|
9073
|
+
if (form) form.setFieldValue(field.key, draft);
|
|
9074
|
+
setEditing(false);
|
|
9075
|
+
};
|
|
9076
|
+
const handleCancel = () => {
|
|
9077
|
+
setDraft(void 0);
|
|
9078
|
+
setEditing(false);
|
|
9079
|
+
};
|
|
9080
|
+
const row = { display: "flex", alignItems: "center", justifyContent: "flex-start", gap: 4 };
|
|
9081
|
+
if (editing) {
|
|
9082
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: row, children: [
|
|
9083
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9084
|
+
RelationSelect,
|
|
9085
|
+
{
|
|
9086
|
+
field,
|
|
9087
|
+
value: draft,
|
|
9088
|
+
onChange: setDraft,
|
|
9089
|
+
allModels,
|
|
9090
|
+
excludeId: isSelfRef ? currentId : void 0
|
|
9091
|
+
}
|
|
9092
|
+
) }),
|
|
9093
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _25("Confirm"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "primary", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckOutlined, {}), onClick: handleConfirm }) }),
|
|
9094
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _25("Cancel"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseOutlined, {}), onClick: handleCancel }) })
|
|
9095
|
+
] });
|
|
9096
|
+
}
|
|
9097
|
+
if (!value) {
|
|
9098
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: row, children: [
|
|
9099
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "-" }),
|
|
9100
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _25("Edit"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "text", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EditOutlined, {}), onClick: handleEdit, style: { padding: "0 2px", height: "auto" } }) })
|
|
9101
|
+
] });
|
|
9102
|
+
}
|
|
9103
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: row, children: [
|
|
9104
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReferenceField, { id: value, resource }),
|
|
9105
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _25("Edit"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "text", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EditOutlined, {}), onClick: handleEdit, style: { padding: "0 2px", height: "auto" } }) })
|
|
9106
|
+
] });
|
|
9107
|
+
};
|
|
9108
|
+
var _26 = window._ || ((text) => text);
|
|
8718
9109
|
var { Title: Title4 } = antd.Typography;
|
|
9110
|
+
var requiredMark3 = (field) => field.required ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#ff4d4f", marginLeft: 3 }, children: "*" }) : null;
|
|
8719
9111
|
function coerce(v) {
|
|
8720
9112
|
if (v && typeof v === "object" && typeof v.valueOf === "function") return v.valueOf();
|
|
8721
9113
|
return v;
|
|
@@ -8809,22 +9201,44 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8809
9201
|
const renderShowEditableInput = (field, forceReadOnly) => {
|
|
8810
9202
|
const refResource = field.reference ? resolveResourcePath(field.reference, allModels) : void 0;
|
|
8811
9203
|
const isSelfRef = refResource && modelResource && refResource === modelResource;
|
|
9204
|
+
const scalarToken = field.showViewType ? normalizeFieldViewType(field.showViewType) : "";
|
|
9205
|
+
const isReadOnlyToken = scalarToken.startsWith("read-only-");
|
|
9206
|
+
const isEditableToken = scalarToken === "editable-field";
|
|
9207
|
+
if (field.formula || forceReadOnly || isReadOnlyToken) {
|
|
9208
|
+
return renderFieldValue(field, record, allModels);
|
|
9209
|
+
}
|
|
9210
|
+
if (field.reference) {
|
|
9211
|
+
if (!isEditableToken) {
|
|
9212
|
+
const fkRelViewType = normalizeRelationViewType(field.showViewType || "") || "read-and-edit-list";
|
|
9213
|
+
if (fkRelViewType === "read-and-edit-list") {
|
|
9214
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: field.key, style: { margin: 0 }, noStyle: false, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9215
|
+
ReadAndEditReference,
|
|
9216
|
+
{
|
|
9217
|
+
field,
|
|
9218
|
+
allModels,
|
|
9219
|
+
model,
|
|
9220
|
+
currentId: isSelfRef ? currentId : void 0
|
|
9221
|
+
}
|
|
9222
|
+
) });
|
|
9223
|
+
}
|
|
9224
|
+
}
|
|
9225
|
+
}
|
|
8812
9226
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8813
9227
|
antd.Form.Item,
|
|
8814
9228
|
{
|
|
8815
9229
|
name: field.key,
|
|
8816
|
-
rules: field.required && !field.formula
|
|
9230
|
+
rules: field.required && !field.formula ? [{ required: true }] : [],
|
|
8817
9231
|
valuePropName: field.type === "boolean" ? "checked" : void 0,
|
|
8818
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
9232
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8__default.default(val) } : field.type === "time" && val ? { value: dayjs8__default.default("1970-01-01T" + val) } : { value: val },
|
|
8819
9233
|
style: { margin: 0 },
|
|
8820
9234
|
noStyle: false,
|
|
8821
|
-
children:
|
|
9235
|
+
children: renderInput(field, allModels, model, isSelfRef ? currentId : void 0)
|
|
8822
9236
|
}
|
|
8823
9237
|
);
|
|
8824
9238
|
};
|
|
8825
9239
|
const detailsTab = {
|
|
8826
9240
|
key: "details",
|
|
8827
|
-
label: renderToneTabLabel(
|
|
9241
|
+
label: renderToneTabLabel(_26("Details"), modelTone),
|
|
8828
9242
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8829
9243
|
antd.Form,
|
|
8830
9244
|
{
|
|
@@ -8845,7 +9259,10 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8845
9259
|
gap: "4px 6px"
|
|
8846
9260
|
},
|
|
8847
9261
|
children: [
|
|
8848
|
-
/* @__PURE__ */ jsxRuntime.
|
|
9262
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { ...labelStyle, flex: "0 0 200px" }, children: [
|
|
9263
|
+
field.label,
|
|
9264
|
+
requiredMark3(field)
|
|
9265
|
+
] }),
|
|
8849
9266
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8850
9267
|
"div",
|
|
8851
9268
|
{
|
|
@@ -8853,8 +9270,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8853
9270
|
flex: "1 0 200px",
|
|
8854
9271
|
padding: "2px 4px",
|
|
8855
9272
|
lineHeight: 1.15,
|
|
8856
|
-
textAlign: field.type === "number" ? "right" : "left",
|
|
8857
|
-
fontVariantNumeric: field.type === "number" ? "tabular-nums" : void 0,
|
|
9273
|
+
textAlign: field.type === "number" && !field.reference ? "right" : "left",
|
|
9274
|
+
fontVariantNumeric: field.type === "number" && !field.reference ? "tabular-nums" : void 0,
|
|
8858
9275
|
overflowWrap: "anywhere",
|
|
8859
9276
|
background: valueBackground,
|
|
8860
9277
|
borderRadius: 6
|
|
@@ -8892,8 +9309,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8892
9309
|
padding: "6px 6px"
|
|
8893
9310
|
},
|
|
8894
9311
|
children: [
|
|
8895
|
-
/* @__PURE__ */ jsxRuntime.jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children:
|
|
8896
|
-
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
9312
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _26(section) }),
|
|
9313
|
+
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: Array.from({ length: maxCol }).map((_42, colIndex) => {
|
|
8897
9314
|
const cellItems = normalized.filter(
|
|
8898
9315
|
(item) => item.row === rowIndex + 1 && item.column === colIndex + 1
|
|
8899
9316
|
);
|
|
@@ -8970,8 +9387,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8970
9387
|
borderRadius: 6,
|
|
8971
9388
|
maxWidth: "100%",
|
|
8972
9389
|
overflowWrap: "anywhere",
|
|
8973
|
-
textAlign: field.type === "number" ? "right" : "left",
|
|
8974
|
-
fontVariantNumeric: field.type === "number" ? "tabular-nums" : void 0,
|
|
9390
|
+
textAlign: field.type === "number" && !field.reference ? "right" : "left",
|
|
9391
|
+
fontVariantNumeric: field.type === "number" && !field.reference ? "tabular-nums" : void 0,
|
|
8975
9392
|
...parseInlineStyle(item.html_format)
|
|
8976
9393
|
};
|
|
8977
9394
|
return /* @__PURE__ */ jsxRuntime.jsx(VisibilityGate, { condition: item.visibility_condition, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: 4 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -8983,7 +9400,7 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8983
9400
|
gap: 2
|
|
8984
9401
|
},
|
|
8985
9402
|
children: [
|
|
8986
|
-
showLabel && /* @__PURE__ */ jsxRuntime.
|
|
9403
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8987
9404
|
"div",
|
|
8988
9405
|
{
|
|
8989
9406
|
style: {
|
|
@@ -8992,7 +9409,10 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
8992
9409
|
padding: "2px 4px",
|
|
8993
9410
|
borderRadius: 4
|
|
8994
9411
|
},
|
|
8995
|
-
children:
|
|
9412
|
+
children: [
|
|
9413
|
+
field.label,
|
|
9414
|
+
requiredMark3(field)
|
|
9415
|
+
]
|
|
8996
9416
|
}
|
|
8997
9417
|
),
|
|
8998
9418
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...valueStyle, border: `1px solid ${token.colorBorder}` }, children: editable || forceReadOnly ? renderShowEditableInput(field, forceReadOnly) : renderFieldValue(field, record, allModels) })
|
|
@@ -9085,8 +9505,8 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
9085
9505
|
const maxRow = Math.max(1, ...normalized.map((r) => r.row));
|
|
9086
9506
|
const maxCol = Math.max(1, ...normalized.map((r) => r.column));
|
|
9087
9507
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0, border: `1px solid ${token.colorBorder}`, borderRadius: 8, padding: "6px 6px" }, children: [
|
|
9088
|
-
/* @__PURE__ */ jsxRuntime.jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children:
|
|
9089
|
-
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((
|
|
9508
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title4, { level: 5, style: { margin: 0, color: "#1677ff" }, children: _26(section) }),
|
|
9509
|
+
/* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%", borderCollapse: "collapse", tableLayout: "fixed" }, children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: Array.from({ length: maxRow }).map((_41, ri) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: Array.from({ length: maxCol }).map((_42, ci) => {
|
|
9090
9510
|
const cellItems = normalized.filter((item) => item.row === ri + 1 && item.column === ci + 1);
|
|
9091
9511
|
return /* @__PURE__ */ jsxRuntime.jsx("td", { style: { padding: "0 4px", verticalAlign: "top", width: `${100 / maxCol}%` }, children: cellItems.map((item) => {
|
|
9092
9512
|
if (item.attribute_or_relation_type === "nlsentence") {
|
|
@@ -9143,13 +9563,50 @@ var useStandardShowTabs = (model, record, allModels, actionsState, editForm, ove
|
|
|
9143
9563
|
}) }) });
|
|
9144
9564
|
return {
|
|
9145
9565
|
key: `custom-tab::${tabName}`,
|
|
9146
|
-
label: renderToneTabLabel(
|
|
9566
|
+
label: renderToneTabLabel(_26(tabName), { text: token.colorText, border: token.colorBorder }),
|
|
9147
9567
|
children: tabChildren
|
|
9148
9568
|
};
|
|
9149
9569
|
});
|
|
9150
9570
|
const items = [detailsTab];
|
|
9151
9571
|
items.push(...customConfigTabs);
|
|
9152
9572
|
items.push(...relationTabs);
|
|
9573
|
+
const currentResource = model.resource || model.name.toLowerCase();
|
|
9574
|
+
const namedQueryTabs = (allModels || []).filter((m) => m.isNamedQuery).flatMap((queryModel) => {
|
|
9575
|
+
if (!record) return [];
|
|
9576
|
+
getRecordId(record, model.fields);
|
|
9577
|
+
let filterKey;
|
|
9578
|
+
if (queryModel.primaryResource === currentResource) {
|
|
9579
|
+
filterKey = queryModel.pkField || "id";
|
|
9580
|
+
} else {
|
|
9581
|
+
const fkField = queryModel.fields.find((f) => f.reference === currentResource);
|
|
9582
|
+
filterKey = fkField?.key;
|
|
9583
|
+
}
|
|
9584
|
+
if (!filterKey) return [];
|
|
9585
|
+
const syntheticRel = {
|
|
9586
|
+
resource: queryModel.resource || queryModel.name,
|
|
9587
|
+
targetKey: filterKey,
|
|
9588
|
+
label: queryModel.label,
|
|
9589
|
+
showViewType: queryModel.listViewType || "table"
|
|
9590
|
+
};
|
|
9591
|
+
const relationModel = queryModel;
|
|
9592
|
+
const tone = getModelTone(queryModel.resource || queryModel.name);
|
|
9593
|
+
return [{
|
|
9594
|
+
key: `named-query::${queryModel.name || queryModel.resource}`,
|
|
9595
|
+
label: renderToneTabLabel(queryModel.label, tone),
|
|
9596
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: renderRelationBlock({
|
|
9597
|
+
rel: syntheticRel,
|
|
9598
|
+
relationModel,
|
|
9599
|
+
record,
|
|
9600
|
+
mode: "show",
|
|
9601
|
+
parentResource: model.name,
|
|
9602
|
+
allModels,
|
|
9603
|
+
showActions: false,
|
|
9604
|
+
showCreate: false,
|
|
9605
|
+
relationViewTypeDefaults
|
|
9606
|
+
}) })
|
|
9607
|
+
}];
|
|
9608
|
+
});
|
|
9609
|
+
items.push(...namedQueryTabs);
|
|
9153
9610
|
return items;
|
|
9154
9611
|
};
|
|
9155
9612
|
var INLINE_DEFAULT_PAGE_SIZE = 10;
|
|
@@ -9468,7 +9925,7 @@ var RelatedObjectsInlineValues = ({ rel, record, viewType, allowedRelatedIds, al
|
|
|
9468
9925
|
paginationProps && /* @__PURE__ */ jsxRuntime.jsx(antd.Pagination, { ...paginationProps })
|
|
9469
9926
|
] });
|
|
9470
9927
|
};
|
|
9471
|
-
var
|
|
9928
|
+
var _27 = window._ || ((text) => text);
|
|
9472
9929
|
var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
9473
9930
|
core.useGo();
|
|
9474
9931
|
const { token } = antd.theme.useToken();
|
|
@@ -9477,7 +9934,7 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9477
9934
|
const dateFieldOptions = React6.useMemo(() => getCalendarDateFieldOptions(relatedModel.fields), [relatedModel.fields]);
|
|
9478
9935
|
const [calendarMode, setCalendarMode] = React6.useState("month");
|
|
9479
9936
|
const [calendarDateField, setCalendarDateField] = React6.useState(() => dateFieldOptions[0]?.key || "");
|
|
9480
|
-
const [calendarAnchorDate, setCalendarAnchorDate] = React6.useState(() =>
|
|
9937
|
+
const [calendarAnchorDate, setCalendarAnchorDate] = React6.useState(() => dayjs8__default.default().startOf("month"));
|
|
9481
9938
|
const dateFieldKeySet = React6.useMemo(() => new Set(dateFieldOptions.map((field) => field.key)), [dateFieldOptions]);
|
|
9482
9939
|
React6.useEffect(() => {
|
|
9483
9940
|
if (calendarDateField && dateFieldKeySet.has(calendarDateField)) return;
|
|
@@ -9515,10 +9972,10 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9515
9972
|
if (initSignatureRef.current === signature) return;
|
|
9516
9973
|
initSignatureRef.current = signature;
|
|
9517
9974
|
if (earliestDateTs === null) {
|
|
9518
|
-
setCalendarAnchorDate(
|
|
9975
|
+
setCalendarAnchorDate(dayjs8__default.default().startOf(calendarMode));
|
|
9519
9976
|
return;
|
|
9520
9977
|
}
|
|
9521
|
-
setCalendarAnchorDate(
|
|
9978
|
+
setCalendarAnchorDate(dayjs8__default.default(earliestDateTs).startOf(calendarMode));
|
|
9522
9979
|
}, [calendarDateField, calendarMode, earliestDateTs]);
|
|
9523
9980
|
const entriesByDate = React6.useMemo(() => {
|
|
9524
9981
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -9551,8 +10008,8 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9551
10008
|
}, [calendarAnchorDate, calendarMode]);
|
|
9552
10009
|
if (loading) return /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" });
|
|
9553
10010
|
if (error) return /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { type: "error", message: error, showIcon: true });
|
|
9554
|
-
if (dateFieldOptions.length === 0) return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description:
|
|
9555
|
-
if (!records.length) return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description:
|
|
10011
|
+
if (dateFieldOptions.length === 0) return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: _27("No date/datetime fields available for calendar view.") });
|
|
10012
|
+
if (!records.length) return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: _27("No related records available.") });
|
|
9556
10013
|
const selectedDateField = relatedModel.fields.find((field) => field.key === calendarDateField);
|
|
9557
10014
|
const selectedLabel = selectedDateField?.label || calendarDateField;
|
|
9558
10015
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
@@ -9565,8 +10022,8 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9565
10022
|
value: calendarMode,
|
|
9566
10023
|
onChange: (value) => setCalendarMode(value),
|
|
9567
10024
|
options: [
|
|
9568
|
-
{ label:
|
|
9569
|
-
{ label:
|
|
10025
|
+
{ label: _27("Monthly"), value: "month" },
|
|
10026
|
+
{ label: _27("Weekly"), value: "week" }
|
|
9570
10027
|
],
|
|
9571
10028
|
style: { minWidth: 120 }
|
|
9572
10029
|
}
|
|
@@ -9579,35 +10036,35 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9579
10036
|
onChange: (value) => setCalendarDateField(value),
|
|
9580
10037
|
options: dateFieldOptions.map((field) => ({ label: field.label, value: field.key })),
|
|
9581
10038
|
style: { minWidth: 220 },
|
|
9582
|
-
placeholder:
|
|
10039
|
+
placeholder: _27("Date field")
|
|
9583
10040
|
}
|
|
9584
10041
|
)
|
|
9585
10042
|
] }),
|
|
9586
10043
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { size: 8, children: [
|
|
9587
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
10044
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _27("Previous"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9588
10045
|
antd.Button,
|
|
9589
10046
|
{
|
|
9590
10047
|
size: "small",
|
|
9591
10048
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeftOutlined, {}),
|
|
9592
|
-
"aria-label":
|
|
10049
|
+
"aria-label": _27("Previous"),
|
|
9593
10050
|
onClick: () => setCalendarAnchorDate((prev) => prev.subtract(1, calendarMode).startOf(calendarMode))
|
|
9594
10051
|
}
|
|
9595
10052
|
) }),
|
|
9596
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
10053
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _27("Today"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9597
10054
|
antd.Button,
|
|
9598
10055
|
{
|
|
9599
10056
|
size: "small",
|
|
9600
10057
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CalendarOutlined, {}),
|
|
9601
|
-
"aria-label":
|
|
9602
|
-
onClick: () => setCalendarAnchorDate(
|
|
10058
|
+
"aria-label": _27("Today"),
|
|
10059
|
+
onClick: () => setCalendarAnchorDate(dayjs8__default.default().startOf(calendarMode))
|
|
9603
10060
|
}
|
|
9604
10061
|
) }),
|
|
9605
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
10062
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _27("Next"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9606
10063
|
antd.Button,
|
|
9607
10064
|
{
|
|
9608
10065
|
size: "small",
|
|
9609
10066
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowRightOutlined, {}),
|
|
9610
|
-
"aria-label":
|
|
10067
|
+
"aria-label": _27("Next"),
|
|
9611
10068
|
onClick: () => setCalendarAnchorDate((prev) => prev.add(1, calendarMode).startOf(calendarMode))
|
|
9612
10069
|
}
|
|
9613
10070
|
) })
|
|
@@ -9648,7 +10105,7 @@ var RelatedObjectsCalendar = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9648
10105
|
const dayKey = day.format("YYYY-MM-DD");
|
|
9649
10106
|
const entries = entriesByDate.get(dayKey) || [];
|
|
9650
10107
|
const isOutsideCurrentMonth = calendarMode === "month" && day.month() !== calendarAnchorDate.month();
|
|
9651
|
-
const isToday = day.isSame(
|
|
10108
|
+
const isToday = day.isSame(dayjs8__default.default(), "day");
|
|
9652
10109
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9653
10110
|
"div",
|
|
9654
10111
|
{
|
|
@@ -9726,12 +10183,12 @@ var RelatedObjectPrimaryCard = ({ record, model, allModels, customPageName }) =>
|
|
|
9726
10183
|
}
|
|
9727
10184
|
);
|
|
9728
10185
|
};
|
|
9729
|
-
var
|
|
10186
|
+
var _28 = window._ || ((text) => text);
|
|
9730
10187
|
var RelatedObjectsPrimaryView = ({ rel, record, model, allModels, customPageName }) => {
|
|
9731
10188
|
const { records, loading, error } = useRelatedGalleryRecords({ rel, record, allModels });
|
|
9732
10189
|
if (loading) return /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" });
|
|
9733
10190
|
if (error) return /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { type: "error", message: error, showIcon: true });
|
|
9734
|
-
if (!records.length) return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description:
|
|
10191
|
+
if (!records.length) return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: _28("No related objects.") });
|
|
9735
10192
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "grid", gap: 8 }, children: records.map((item) => {
|
|
9736
10193
|
const id = item?.eid ?? item?.id;
|
|
9737
10194
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9746,7 +10203,7 @@ var RelatedObjectsPrimaryView = ({ rel, record, model, allModels, customPageName
|
|
|
9746
10203
|
);
|
|
9747
10204
|
}) });
|
|
9748
10205
|
};
|
|
9749
|
-
var
|
|
10206
|
+
var _29 = window._ || ((text) => text);
|
|
9750
10207
|
var RelatedObjectsGallery = ({ rel, record, relatedModel, allModels }) => {
|
|
9751
10208
|
const apiUrl = core.useApiUrl();
|
|
9752
10209
|
const go = core.useGo();
|
|
@@ -9761,7 +10218,7 @@ var RelatedObjectsGallery = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9761
10218
|
if (error) return /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { type: "error", message: error, showIcon: true });
|
|
9762
10219
|
if (!records.length) return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, color: "#bfbfbf", fontSize: 12 }, children: [
|
|
9763
10220
|
/* @__PURE__ */ jsxRuntime.jsx(icons.FileTextOutlined, { style: { fontSize: 16 } }),
|
|
9764
|
-
|
|
10221
|
+
_29("No images available")
|
|
9765
10222
|
] });
|
|
9766
10223
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 16 }, children: records.map((item) => {
|
|
9767
10224
|
const id = getGalleryItemId(item);
|
|
@@ -9785,7 +10242,7 @@ var RelatedObjectsGallery = ({ rel, record, relatedModel, allModels }) => {
|
|
|
9785
10242
|
});
|
|
9786
10243
|
}) });
|
|
9787
10244
|
};
|
|
9788
|
-
var
|
|
10245
|
+
var _30 = window._ || ((text) => text);
|
|
9789
10246
|
var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
9790
10247
|
const go = core.useGo();
|
|
9791
10248
|
const paneNav = usePaneNavigation();
|
|
@@ -9884,7 +10341,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9884
10341
|
const d = String(body.detail);
|
|
9885
10342
|
if (d.toLowerCase().includes("unique") || d.toLowerCase().includes("duplicate")) {
|
|
9886
10343
|
const optLabel = allOptions.find((o) => o.id === id)?.label ?? String(id);
|
|
9887
|
-
detail = `"${optLabel}" ${
|
|
10344
|
+
detail = `"${optLabel}" ${_30("is already linked to another record and cannot be added here.")}`;
|
|
9888
10345
|
} else {
|
|
9889
10346
|
detail = d;
|
|
9890
10347
|
}
|
|
@@ -9903,9 +10360,9 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9903
10360
|
setSelectedIds(new Set(newBaseline));
|
|
9904
10361
|
if (errors.length > 0) {
|
|
9905
10362
|
antd.message.error(errors[0], 6);
|
|
9906
|
-
if (errors.length > 1) antd.message.warning(`${errors.length - 1} ${
|
|
10363
|
+
if (errors.length > 1) antd.message.warning(`${errors.length - 1} ${_30("other error(s) occurred.")}`, 4);
|
|
9907
10364
|
} else {
|
|
9908
|
-
antd.message.success(
|
|
10365
|
+
antd.message.success(_30("Changes saved."));
|
|
9909
10366
|
setEditing(false);
|
|
9910
10367
|
setSearchText("");
|
|
9911
10368
|
}
|
|
@@ -9913,7 +10370,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9913
10370
|
const newItems = allOptions.filter((opt) => newBaseline.has(opt.id)).map((opt) => ({ id: opt.id, label: opt.label, resource: otherResource }));
|
|
9914
10371
|
setLocalItems(newItems);
|
|
9915
10372
|
} catch (err) {
|
|
9916
|
-
antd.message.error(err instanceof Error ? err.message :
|
|
10373
|
+
antd.message.error(err instanceof Error ? err.message : _30("Failed to save changes."));
|
|
9917
10374
|
} finally {
|
|
9918
10375
|
setSaving(false);
|
|
9919
10376
|
}
|
|
@@ -9933,7 +10390,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9933
10390
|
const relatedModel = findModelByName(allModels, rel.otherResource || rel.otherResourcePath);
|
|
9934
10391
|
const relatedResource = relatedModel ? resolveResourcePath(relatedModel.resource || relatedModel.name, allModels) : null;
|
|
9935
10392
|
if (!relatedResource) {
|
|
9936
|
-
antd.message.warning(
|
|
10393
|
+
antd.message.warning(_30("No create route for the related model. Opening relation create form."));
|
|
9937
10394
|
params.append(rel.targetKey, String(recordId));
|
|
9938
10395
|
const returnTo2 = `${location.pathname}${location.search}${location.hash}`;
|
|
9939
10396
|
if (returnTo2.startsWith("/")) params.append("returnTo", returnTo2);
|
|
@@ -9952,7 +10409,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9952
10409
|
if (error) return /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { type: "error", message: error, showIcon: true });
|
|
9953
10410
|
if (!editing) {
|
|
9954
10411
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minHeight: 22 }, children: [
|
|
9955
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", justifyContent: "flex-end", marginBottom: 4 }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
10412
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", justifyContent: "flex-end", marginBottom: 4 }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _30("Edit"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "text", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EditOutlined, {}), onClick: () => setEditing(true) }) }) }),
|
|
9956
10413
|
items.length === 0 && total === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontStyle: "italic" }, children: "\u2014" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9957
10414
|
/* @__PURE__ */ jsxRuntime.jsx("ul", { style: { margin: 0, paddingLeft: 16 }, children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9958
10415
|
"a",
|
|
@@ -9991,7 +10448,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
9991
10448
|
setPage(p);
|
|
9992
10449
|
}
|
|
9993
10450
|
},
|
|
9994
|
-
onShowSizeChange: (
|
|
10451
|
+
onShowSizeChange: (_41, newPageSize) => {
|
|
9995
10452
|
setPageSize(newPageSize);
|
|
9996
10453
|
setPage(1);
|
|
9997
10454
|
},
|
|
@@ -10023,7 +10480,7 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
10023
10480
|
antd.Input,
|
|
10024
10481
|
{
|
|
10025
10482
|
prefix: /* @__PURE__ */ jsxRuntime.jsx(icons.SearchOutlined, { style: { color: token.colorTextSecondary } }),
|
|
10026
|
-
placeholder:
|
|
10483
|
+
placeholder: _30("Search..."),
|
|
10027
10484
|
value: searchText,
|
|
10028
10485
|
onChange: (e) => setSearchText(e.target.value),
|
|
10029
10486
|
allowClear: true,
|
|
@@ -10031,9 +10488,9 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
10031
10488
|
style: { flex: 1 }
|
|
10032
10489
|
}
|
|
10033
10490
|
),
|
|
10034
|
-
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
10491
|
+
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _30("Create new and relate"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ShareAltOutlined, {}), onClick: handleCreateNewAndRelate }) })
|
|
10035
10492
|
] }),
|
|
10036
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { maxHeight: 280, overflowY: "auto", marginBottom: 8 }, children: optionsLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center", padding: 16 }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" }) }) : sortedOptions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { image: antd.Empty.PRESENTED_IMAGE_SIMPLE, description:
|
|
10493
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { maxHeight: 280, overflowY: "auto", marginBottom: 8 }, children: optionsLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center", padding: 16 }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" }) }) : sortedOptions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { image: antd.Empty.PRESENTED_IMAGE_SIMPLE, description: _30("No options") }) : sortedOptions.map((opt) => {
|
|
10037
10494
|
const checked = selectedIds.has(opt.id);
|
|
10038
10495
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10039
10496
|
"div",
|
|
@@ -10070,41 +10527,139 @@ var RelatedObjectsEditableList = ({ rel, record, allModels }) => {
|
|
|
10070
10527
|
);
|
|
10071
10528
|
}) }),
|
|
10072
10529
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, borderTop: `1px solid ${token.colorBorderSecondary}`, paddingTop: 8 }, children: [
|
|
10073
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: handleCancel, children:
|
|
10074
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "primary", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SaveOutlined, {}), onClick: handleSave, loading: saving, disabled: !hasChanges, children:
|
|
10530
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: handleCancel, children: _30("Cancel") }),
|
|
10531
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", type: "primary", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SaveOutlined, {}), onClick: handleSave, loading: saving, disabled: !hasChanges, children: _30("Save") })
|
|
10075
10532
|
] })
|
|
10076
10533
|
] });
|
|
10077
10534
|
};
|
|
10078
|
-
var
|
|
10079
|
-
var {
|
|
10080
|
-
var PolymorphicRelatedObjectsTable = ({ rel, record, relationModel, parentModel, allModels, showActions = false, showCreate = false, allowInlineEdit = false, layoutPreferenceType, viewVariant = "default" }) => {
|
|
10081
|
-
const recordId = record?.[parentModel?.pkField ?? "eid"] ?? record?.eid ?? record?.id;
|
|
10535
|
+
var _31 = window._ || ((text) => text);
|
|
10536
|
+
var RelatedObjectsEditableCsv = ({ rel, record, allModels }) => {
|
|
10082
10537
|
const apiUrl = core.useApiUrl();
|
|
10083
|
-
const
|
|
10084
|
-
const [
|
|
10085
|
-
const [
|
|
10086
|
-
const [
|
|
10087
|
-
const
|
|
10088
|
-
|
|
10089
|
-
[rel.otherKey, rel.otherResource, relationModel, allModels]
|
|
10090
|
-
);
|
|
10538
|
+
const { items: fetchedItems, loading, error } = useRelatedInlineItems({ rel, record, allModels });
|
|
10539
|
+
const [saving, setSaving] = React6.useState(false);
|
|
10540
|
+
const [allOptions, setAllOptions] = React6.useState([]);
|
|
10541
|
+
const [optionsLoading, setOptionsLoading] = React6.useState(false);
|
|
10542
|
+
const [selectedIds, setSelectedIds] = React6.useState([]);
|
|
10543
|
+
const [baselineIds, setBaselineIds] = React6.useState(/* @__PURE__ */ new Set());
|
|
10091
10544
|
React6.useEffect(() => {
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10545
|
+
const ids = fetchedItems.map((item) => Number(item.id));
|
|
10546
|
+
setSelectedIds(ids);
|
|
10547
|
+
setBaselineIds(new Set(ids));
|
|
10548
|
+
}, [fetchedItems]);
|
|
10549
|
+
React6.useEffect(() => {
|
|
10550
|
+
if (!rel.otherResource) return;
|
|
10551
|
+
let cancelled = false;
|
|
10552
|
+
const fetchOptions = async () => {
|
|
10553
|
+
setOptionsLoading(true);
|
|
10101
10554
|
try {
|
|
10102
|
-
const
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10555
|
+
const resource = rel.otherResourcePath || resolveResourcePath(rel.otherResource, allModels);
|
|
10556
|
+
const params = new URLSearchParams({ _start: "0", _end: "50000" });
|
|
10557
|
+
const response = await authenticatedFetch(`${apiUrl}/${resource}?${params.toString()}`);
|
|
10558
|
+
if (!response.ok) throw new Error("Failed to load options");
|
|
10559
|
+
const data = await response.json();
|
|
10560
|
+
if (!cancelled && Array.isArray(data)) {
|
|
10561
|
+
setAllOptions(data.map((item) => ({
|
|
10562
|
+
value: item.eid ?? item.id,
|
|
10563
|
+
label: getRecordDisplayLabel(item)
|
|
10564
|
+
})));
|
|
10565
|
+
}
|
|
10566
|
+
} catch {
|
|
10567
|
+
} finally {
|
|
10568
|
+
if (!cancelled) setOptionsLoading(false);
|
|
10569
|
+
}
|
|
10570
|
+
};
|
|
10571
|
+
fetchOptions();
|
|
10572
|
+
return () => {
|
|
10573
|
+
cancelled = true;
|
|
10574
|
+
};
|
|
10575
|
+
}, [apiUrl, rel.otherResource]);
|
|
10576
|
+
const handleChange = React6.useCallback(async (newIds) => {
|
|
10577
|
+
if (!rel.otherKey || !rel.targetKey) return;
|
|
10578
|
+
const recordId = record?.eid ?? record?.id;
|
|
10579
|
+
if (recordId === void 0 || recordId === null) return;
|
|
10580
|
+
const newSet = new Set(newIds);
|
|
10581
|
+
const toAdd = newIds.filter((id) => !baselineIds.has(id));
|
|
10582
|
+
const toRemove = [...baselineIds].filter((id) => !newSet.has(id));
|
|
10583
|
+
setSelectedIds(newIds);
|
|
10584
|
+
setSaving(true);
|
|
10585
|
+
const errors = [];
|
|
10586
|
+
try {
|
|
10587
|
+
const relationResource = rel.resourcePath || resolveResourcePath(rel.resource, allModels);
|
|
10588
|
+
for (const id of toRemove) {
|
|
10589
|
+
const deleteId = rel.targetKey === "eid_from" ? `${recordId}:${id}` : `${id}:${recordId}`;
|
|
10590
|
+
const resp = await authenticatedFetch(`${apiUrl}/${relationResource}/${encodeURIComponent(deleteId)}`, { method: "DELETE" });
|
|
10591
|
+
if (!resp.ok) errors.push(`Failed to remove (${resp.status})`);
|
|
10592
|
+
}
|
|
10593
|
+
for (const id of toAdd) {
|
|
10594
|
+
const payload = { [rel.targetKey]: recordId, [rel.otherKey]: id };
|
|
10595
|
+
const resp = await authenticatedFetch(`${apiUrl}/${relationResource}`, {
|
|
10596
|
+
method: "POST",
|
|
10597
|
+
headers: { "Content-Type": "application/json" },
|
|
10598
|
+
body: JSON.stringify(payload)
|
|
10599
|
+
});
|
|
10600
|
+
if (!resp.ok) errors.push(`Failed to add (${resp.status})`);
|
|
10601
|
+
}
|
|
10602
|
+
if (errors.length === 0) {
|
|
10603
|
+
setBaselineIds(newSet);
|
|
10604
|
+
} else {
|
|
10605
|
+
antd.message.error(errors.join("; "));
|
|
10606
|
+
setSelectedIds([...baselineIds]);
|
|
10607
|
+
}
|
|
10608
|
+
} finally {
|
|
10609
|
+
setSaving(false);
|
|
10610
|
+
}
|
|
10611
|
+
}, [apiUrl, rel, record, allModels, baselineIds]);
|
|
10612
|
+
if (loading) return /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" });
|
|
10613
|
+
if (error) return /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { type: "error", message: error, showIcon: true });
|
|
10614
|
+
if (!rel.otherResource || !rel.otherKey) {
|
|
10615
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { type: "warning", message: _31("editable-csv requires a many-to-many relation"), showIcon: true });
|
|
10616
|
+
}
|
|
10617
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10618
|
+
antd.Select,
|
|
10619
|
+
{
|
|
10620
|
+
mode: "multiple",
|
|
10621
|
+
value: selectedIds,
|
|
10622
|
+
onChange: handleChange,
|
|
10623
|
+
options: allOptions,
|
|
10624
|
+
loading: optionsLoading || saving,
|
|
10625
|
+
style: { width: "100%" },
|
|
10626
|
+
placeholder: `${_31("Select")} ${_31(rel.label)}...`,
|
|
10627
|
+
optionFilterProp: "label",
|
|
10628
|
+
showSearch: true,
|
|
10629
|
+
allowClear: true
|
|
10630
|
+
}
|
|
10631
|
+
);
|
|
10632
|
+
};
|
|
10633
|
+
var _32 = window._ || ((text) => text);
|
|
10634
|
+
var { Title: Title5 } = antd.Typography;
|
|
10635
|
+
var PolymorphicRelatedObjectsTable = ({ rel, record, relationModel, parentModel, allModels, showActions = false, showCreate = false, allowInlineEdit = false, layoutPreferenceType, viewVariant = "default" }) => {
|
|
10636
|
+
const recordId = record?.[parentModel?.pkField ?? "eid"] ?? record?.eid ?? record?.id;
|
|
10637
|
+
const apiUrl = core.useApiUrl();
|
|
10638
|
+
const [loading, setLoading] = React6.useState(false);
|
|
10639
|
+
const [error, setError] = React6.useState(null);
|
|
10640
|
+
const [groupedIds, setGroupedIds] = React6.useState(/* @__PURE__ */ new Map());
|
|
10641
|
+
const [unresolvedIds, setUnresolvedIds] = React6.useState([]);
|
|
10642
|
+
const polyInfo = React6.useMemo(
|
|
10643
|
+
() => getPolymorphicReferenceInfo(rel, relationModel, allModels),
|
|
10644
|
+
[rel.otherKey, rel.otherResource, relationModel, allModels]
|
|
10645
|
+
);
|
|
10646
|
+
React6.useEffect(() => {
|
|
10647
|
+
if (!recordId || !rel.otherKey || !polyInfo) {
|
|
10648
|
+
setGroupedIds(/* @__PURE__ */ new Map());
|
|
10649
|
+
setUnresolvedIds([]);
|
|
10650
|
+
return;
|
|
10651
|
+
}
|
|
10652
|
+
let isMounted = true;
|
|
10653
|
+
const fetchGroups = async () => {
|
|
10654
|
+
setLoading(true);
|
|
10655
|
+
setError(null);
|
|
10656
|
+
try {
|
|
10657
|
+
const { groups, unresolved } = await fetchPolymorphicGroups({
|
|
10658
|
+
apiUrl,
|
|
10659
|
+
rel,
|
|
10660
|
+
recordId,
|
|
10661
|
+
referenceResource: polyInfo.referenceResource,
|
|
10662
|
+
allModels
|
|
10108
10663
|
});
|
|
10109
10664
|
if (isMounted) {
|
|
10110
10665
|
setGroupedIds(groups);
|
|
@@ -10328,9 +10883,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10328
10883
|
if (failed) {
|
|
10329
10884
|
throw new Error(`Save failed (${failed.status})`);
|
|
10330
10885
|
}
|
|
10331
|
-
antd.message.success(
|
|
10886
|
+
antd.message.success(_32("Layout preferences saved."));
|
|
10332
10887
|
} catch (error2) {
|
|
10333
|
-
antd.message.error(error2 instanceof Error ? error2.message :
|
|
10888
|
+
antd.message.error(error2 instanceof Error ? error2.message : _32("Failed to save layout preferences."));
|
|
10334
10889
|
} finally {
|
|
10335
10890
|
setIsSavingLayoutPrefs(false);
|
|
10336
10891
|
}
|
|
@@ -10359,9 +10914,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10359
10914
|
if (!response.ok) {
|
|
10360
10915
|
throw new Error(`Save failed (${response.status})`);
|
|
10361
10916
|
}
|
|
10362
|
-
antd.message.success(
|
|
10917
|
+
antd.message.success(_32("Analyze preferences saved."));
|
|
10363
10918
|
} catch (error2) {
|
|
10364
|
-
antd.message.error(error2 instanceof Error ? error2.message :
|
|
10919
|
+
antd.message.error(error2 instanceof Error ? error2.message : _32("Failed to save analyze preferences."));
|
|
10365
10920
|
} finally {
|
|
10366
10921
|
setIsSavingAnalyzePrefs(false);
|
|
10367
10922
|
}
|
|
@@ -10464,11 +11019,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10464
11019
|
const viewName = normalizeViewName(saveViewName || currentViewName);
|
|
10465
11020
|
const viewExists = availableViewNames.includes(viewName);
|
|
10466
11021
|
if (saveViewAsNew && viewExists) {
|
|
10467
|
-
antd.message.error(
|
|
11022
|
+
antd.message.error(_32("View name already exists. Choose a new name."));
|
|
10468
11023
|
return;
|
|
10469
11024
|
}
|
|
10470
11025
|
if (!saveViewAsNew && viewName !== currentViewName && viewExists) {
|
|
10471
|
-
antd.message.error(
|
|
11026
|
+
antd.message.error(_32('Choose a new name or enable "Save as new view".'));
|
|
10472
11027
|
return;
|
|
10473
11028
|
}
|
|
10474
11029
|
setSaveViewModalOpen(false);
|
|
@@ -10524,7 +11079,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10524
11079
|
return;
|
|
10525
11080
|
}
|
|
10526
11081
|
if (availableViewNames.includes(newName)) {
|
|
10527
|
-
antd.message.error(
|
|
11082
|
+
antd.message.error(_32("View name already exists."));
|
|
10528
11083
|
return;
|
|
10529
11084
|
}
|
|
10530
11085
|
try {
|
|
@@ -10537,18 +11092,18 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10537
11092
|
if (!response.ok) {
|
|
10538
11093
|
throw new Error(`Rename failed (${response.status})`);
|
|
10539
11094
|
}
|
|
10540
|
-
antd.message.success(
|
|
11095
|
+
antd.message.success(_32("View renamed."));
|
|
10541
11096
|
setRenameViewModalOpen(false);
|
|
10542
11097
|
await loadViewNames();
|
|
10543
11098
|
} catch (error2) {
|
|
10544
|
-
antd.message.error(error2 instanceof Error ? error2.message :
|
|
11099
|
+
antd.message.error(error2 instanceof Error ? error2.message : _32("Failed to rename view."));
|
|
10545
11100
|
}
|
|
10546
11101
|
}, [apiUrl, availableViewNames, currentViewName, relatedModel.name, relatedModel.resource, renameViewName, allModels, loadViewNames]);
|
|
10547
11102
|
const confirmDeleteView = React6.useCallback(() => {
|
|
10548
11103
|
antd.Modal.confirm({
|
|
10549
|
-
title:
|
|
11104
|
+
title: _32(_32("Delete view")),
|
|
10550
11105
|
content: `Delete "${currentViewName}" and all its saved preferences?`,
|
|
10551
|
-
okText:
|
|
11106
|
+
okText: _32("Delete"),
|
|
10552
11107
|
okButtonProps: { danger: true },
|
|
10553
11108
|
onOk: async () => {
|
|
10554
11109
|
try {
|
|
@@ -10561,10 +11116,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10561
11116
|
if (!response.ok) {
|
|
10562
11117
|
throw new Error(`Delete failed (${response.status})`);
|
|
10563
11118
|
}
|
|
10564
|
-
antd.message.success(
|
|
11119
|
+
antd.message.success(_32("View deleted."));
|
|
10565
11120
|
await loadViewNames();
|
|
10566
11121
|
} catch (error2) {
|
|
10567
|
-
antd.message.error(error2 instanceof Error ? error2.message :
|
|
11122
|
+
antd.message.error(error2 instanceof Error ? error2.message : _32("Failed to delete view."));
|
|
10568
11123
|
}
|
|
10569
11124
|
}
|
|
10570
11125
|
});
|
|
@@ -10748,7 +11303,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10748
11303
|
const direction = value?.direction || "next";
|
|
10749
11304
|
const unit = value?.unit || "weeks";
|
|
10750
11305
|
const isQuarter = unit === "quarters";
|
|
10751
|
-
const base =
|
|
11306
|
+
const base = dayjs8__default.default();
|
|
10752
11307
|
if (asRange || direction === "current") {
|
|
10753
11308
|
const anchor = direction === "current" ? base : direction === "previous" ? isQuarter ? base.subtract(count * 3, "month") : base.subtract(count, unit) : isQuarter ? base.add(count * 3, "month") : base.add(count, unit);
|
|
10754
11309
|
if (isQuarter) {
|
|
@@ -10821,7 +11376,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10821
11376
|
return true;
|
|
10822
11377
|
}
|
|
10823
11378
|
if (field.type === "date") {
|
|
10824
|
-
const recordDate =
|
|
11379
|
+
const recordDate = dayjs8__default.default(rawValue);
|
|
10825
11380
|
if (!recordDate.isValid()) return false;
|
|
10826
11381
|
const mode = rule.value?.mode || "absolute";
|
|
10827
11382
|
const mode2 = rule.value2?.mode || "absolute";
|
|
@@ -10829,7 +11384,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10829
11384
|
if (val?.mode === "relative") {
|
|
10830
11385
|
return resolveRelativeDate(val, asRange);
|
|
10831
11386
|
}
|
|
10832
|
-
const date =
|
|
11387
|
+
const date = dayjs8__default.default(val?.date || val);
|
|
10833
11388
|
return asRange ? { start: date.startOf("day"), end: date.endOf("day") } : { date: date.startOf("day") };
|
|
10834
11389
|
};
|
|
10835
11390
|
switch (rule.operator) {
|
|
@@ -10840,13 +11395,13 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10840
11395
|
}
|
|
10841
11396
|
case "after": {
|
|
10842
11397
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
10843
|
-
if (!dateVal || !
|
|
10844
|
-
return recordDate.valueOf() >
|
|
11398
|
+
if (!dateVal || !dayjs8__default.default(dateVal).isValid()) return false;
|
|
11399
|
+
return recordDate.valueOf() > dayjs8__default.default(dateVal).endOf("day").valueOf();
|
|
10845
11400
|
}
|
|
10846
11401
|
case "before": {
|
|
10847
11402
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
10848
|
-
if (!dateVal || !
|
|
10849
|
-
return recordDate.valueOf() <
|
|
11403
|
+
if (!dateVal || !dayjs8__default.default(dateVal).isValid()) return false;
|
|
11404
|
+
return recordDate.valueOf() < dayjs8__default.default(dateVal).startOf("day").valueOf();
|
|
10850
11405
|
}
|
|
10851
11406
|
case "between": {
|
|
10852
11407
|
const startRange = mode === "relative" ? resolveRelativeDate(rule.value, true) : getDateValue(rule.value, true);
|
|
@@ -10970,9 +11525,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10970
11525
|
const deleteId = relationRow && rel.targetKey && rel.otherKey ? `${relationRow["eid_from"]}:${relationRow["eid_to"]}` : relationRow?.id ?? relationRow?.eid;
|
|
10971
11526
|
if (deleteId === void 0 || deleteId === null) return;
|
|
10972
11527
|
antd.Modal.confirm({
|
|
10973
|
-
title:
|
|
10974
|
-
content:
|
|
10975
|
-
okText:
|
|
11528
|
+
title: _32("Delete"),
|
|
11529
|
+
content: _32("Are you sure you want to delete this relation?"),
|
|
11530
|
+
okText: _32("Delete"),
|
|
10976
11531
|
okButtonProps: { danger: true },
|
|
10977
11532
|
onOk: async () => {
|
|
10978
11533
|
try {
|
|
@@ -10993,9 +11548,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
10993
11548
|
const itemDeleteId = rel.targetKey && rel.otherKey ? `${itemRelationRow[rel.targetKey]}:${itemRelationRow[rel.otherKey]}` : itemRelationRow?.id ?? itemRelationRow?.eid;
|
|
10994
11549
|
return String(itemDeleteId) !== String(deleteId);
|
|
10995
11550
|
}));
|
|
10996
|
-
antd.message.success(
|
|
11551
|
+
antd.message.success(_32("Relation deleted."));
|
|
10997
11552
|
} catch (err) {
|
|
10998
|
-
antd.message.error(err instanceof Error ? err.message :
|
|
11553
|
+
antd.message.error(err instanceof Error ? err.message : _32("Failed to delete relation."));
|
|
10999
11554
|
}
|
|
11000
11555
|
}
|
|
11001
11556
|
});
|
|
@@ -11298,7 +11853,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11298
11853
|
}
|
|
11299
11854
|
}, [numericFields, rankingFieldKey, rankingMode]);
|
|
11300
11855
|
const formatCategoryValue = React6.useCallback((field, recordRow) => {
|
|
11301
|
-
if (!field) return
|
|
11856
|
+
if (!field) return _32("All");
|
|
11302
11857
|
const raw = recordRow?.[field.key];
|
|
11303
11858
|
if (raw === void 0 || raw === null) return "-";
|
|
11304
11859
|
if (field.key === "eid" && recordRow?._label) return recordRow._label;
|
|
@@ -11309,7 +11864,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11309
11864
|
if (field.options) {
|
|
11310
11865
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
11311
11866
|
}
|
|
11312
|
-
if (field.type === "boolean") return raw ?
|
|
11867
|
+
if (field.type === "boolean") return raw ? _32("Yes") : _32("No");
|
|
11313
11868
|
if (field.type === "date") return formatDateValue(raw);
|
|
11314
11869
|
return String(raw);
|
|
11315
11870
|
}, [labelCache]);
|
|
@@ -11401,7 +11956,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11401
11956
|
const seriesLabels = numericFields.length > 0 ? numericFields.reduce((acc, field) => {
|
|
11402
11957
|
acc[field.key] = field.label;
|
|
11403
11958
|
return acc;
|
|
11404
|
-
}, { "__count__":
|
|
11959
|
+
}, { "__count__": _32("Count") }) : { "__count__": _32("Count") };
|
|
11405
11960
|
let groups = baseGroups;
|
|
11406
11961
|
if (rankingMode !== "none" && rankingFieldKey) {
|
|
11407
11962
|
const limit = Math.max(1, Math.floor(rankingN || 10));
|
|
@@ -11479,7 +12034,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11479
12034
|
if (field.options) {
|
|
11480
12035
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
11481
12036
|
}
|
|
11482
|
-
if (field.type === "boolean") return raw ?
|
|
12037
|
+
if (field.type === "boolean") return raw ? _32("Yes") : _32("No");
|
|
11483
12038
|
if (field.type === "date") return formatDateValue(raw);
|
|
11484
12039
|
return String(raw);
|
|
11485
12040
|
}, [labelCache]);
|
|
@@ -11682,7 +12237,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11682
12237
|
if (field.options) {
|
|
11683
12238
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
11684
12239
|
}
|
|
11685
|
-
if (field.type === "boolean") return raw ?
|
|
12240
|
+
if (field.type === "boolean") return raw ? _32("Yes") : _32("No");
|
|
11686
12241
|
if (field.type === "date") return formatDateValue(raw);
|
|
11687
12242
|
return String(raw);
|
|
11688
12243
|
}, [labelCache]);
|
|
@@ -11754,13 +12309,13 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11754
12309
|
const getSummaryFunctionDisplayText = (fn) => {
|
|
11755
12310
|
if (!fn) return "";
|
|
11756
12311
|
const labels = {
|
|
11757
|
-
sum:
|
|
11758
|
-
avg:
|
|
11759
|
-
count:
|
|
11760
|
-
max:
|
|
11761
|
-
min:
|
|
11762
|
-
stddev:
|
|
11763
|
-
distinct:
|
|
12312
|
+
sum: _32("Sum"),
|
|
12313
|
+
avg: _32("Average"),
|
|
12314
|
+
count: _32("Count"),
|
|
12315
|
+
max: _32("Max"),
|
|
12316
|
+
min: _32("Min"),
|
|
12317
|
+
stddev: _32("Std Dev"),
|
|
12318
|
+
distinct: _32("Distinct")
|
|
11764
12319
|
};
|
|
11765
12320
|
return labels[fn] || fn;
|
|
11766
12321
|
};
|
|
@@ -11836,12 +12391,12 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11836
12391
|
]
|
|
11837
12392
|
}
|
|
11838
12393
|
) }),
|
|
11839
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: isTotalsDetailsFlipped ?
|
|
12394
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: isTotalsDetailsFlipped ? _32("Show totals") : _32("Show details"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11840
12395
|
antd.Button,
|
|
11841
12396
|
{
|
|
11842
12397
|
size: "small",
|
|
11843
12398
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SwapOutlined, { style: { transform: "rotate(90deg)" } }),
|
|
11844
|
-
"aria-label": isTotalsDetailsFlipped ?
|
|
12399
|
+
"aria-label": isTotalsDetailsFlipped ? _32("Show totals") : _32("Show details"),
|
|
11845
12400
|
onClick: () => setIsTotalsDetailsFlipped((prev) => !prev),
|
|
11846
12401
|
style: {
|
|
11847
12402
|
flexShrink: 0,
|
|
@@ -11853,7 +12408,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11853
12408
|
) })
|
|
11854
12409
|
] }),
|
|
11855
12410
|
relationRowsCapped && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 8, display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 8, flexWrap: "wrap" }, children: [
|
|
11856
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", style: { fontSize: 12 }, children:
|
|
12411
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", style: { fontSize: 12 }, children: _32("Only the first N rows are loaded").replace("N", formatNumberValue(loadedRowsCount || relationsMaxRowsToLoad)) }),
|
|
11857
12412
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11858
12413
|
antd.Button,
|
|
11859
12414
|
{
|
|
@@ -11864,7 +12419,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11864
12419
|
setFullDataLoaded(false);
|
|
11865
12420
|
setLoadAllRelatedRequested(true);
|
|
11866
12421
|
},
|
|
11867
|
-
children:
|
|
12422
|
+
children: _32("Load all related")
|
|
11868
12423
|
}
|
|
11869
12424
|
)
|
|
11870
12425
|
] })
|
|
@@ -11875,7 +12430,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11875
12430
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, marginBottom: 8 }, children: [
|
|
11876
12431
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { minHeight: 22, display: "flex", alignItems: "center" }, children: title && /* @__PURE__ */ jsxRuntime.jsx(Title5, { level: 5, style: { color: relatedModelTone.text, margin: 0 }, children: title }) }),
|
|
11877
12432
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
11878
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: columnsSelectorOpen ?
|
|
12433
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: columnsSelectorOpen ? _32("Hide view configuration") : _32("Show view configuration"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11879
12434
|
antd.Button,
|
|
11880
12435
|
{
|
|
11881
12436
|
size: "small",
|
|
@@ -11887,11 +12442,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11887
12442
|
return next;
|
|
11888
12443
|
});
|
|
11889
12444
|
},
|
|
11890
|
-
"aria-label": columnsSelectorOpen ?
|
|
12445
|
+
"aria-label": columnsSelectorOpen ? _32("Hide view configuration") : _32("Show view configuration")
|
|
11891
12446
|
}
|
|
11892
12447
|
) }),
|
|
11893
12448
|
showCreate && recordId !== void 0 && recordId !== null && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11894
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: rel.otherResource && rel.otherKey ?
|
|
12449
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: rel.otherResource && rel.otherKey ? _32("Associate existing") : _32("Add relation"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11895
12450
|
antd.Button,
|
|
11896
12451
|
{
|
|
11897
12452
|
size: "small",
|
|
@@ -11924,7 +12479,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11924
12479
|
}
|
|
11925
12480
|
}
|
|
11926
12481
|
) }),
|
|
11927
|
-
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12482
|
+
rel.otherResource && rel.otherKey && rel.targetKey && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Create new and relate"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11928
12483
|
antd.Button,
|
|
11929
12484
|
{
|
|
11930
12485
|
size: "small",
|
|
@@ -11938,7 +12493,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11938
12493
|
const relatedModel2 = findModelByName(allModels, rel.otherResource || rel.otherResourcePath);
|
|
11939
12494
|
const relatedResource = relatedModel2 ? resolveResourcePath(relatedModel2.resource || relatedModel2.name, allModels) : null;
|
|
11940
12495
|
if (!relatedResource) {
|
|
11941
|
-
antd.message.warning(
|
|
12496
|
+
antd.message.warning(_32("No create route for the related model. Opening relation create form."));
|
|
11942
12497
|
params.append(rel.targetKey, String(recordId));
|
|
11943
12498
|
if (allowInlineEdit) params.append("inline", "1");
|
|
11944
12499
|
const returnTo2 = `${location.pathname}${location.search}${location.hash}`;
|
|
@@ -11957,7 +12512,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11957
12512
|
}
|
|
11958
12513
|
) })
|
|
11959
12514
|
] }),
|
|
11960
|
-
allowInlineEdit && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12515
|
+
allowInlineEdit && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Save"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11961
12516
|
antd.Button,
|
|
11962
12517
|
{
|
|
11963
12518
|
size: "small",
|
|
@@ -11965,10 +12520,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11965
12520
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SaveOutlined, {}),
|
|
11966
12521
|
onClick: saveAllEdits,
|
|
11967
12522
|
loading: savingAll,
|
|
11968
|
-
"aria-label":
|
|
12523
|
+
"aria-label": _32("Save")
|
|
11969
12524
|
}
|
|
11970
12525
|
) }),
|
|
11971
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12526
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Export CSV"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11972
12527
|
antd.Button,
|
|
11973
12528
|
{
|
|
11974
12529
|
size: "small",
|
|
@@ -11983,20 +12538,20 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
11983
12538
|
antd.Modal,
|
|
11984
12539
|
{
|
|
11985
12540
|
open: saveViewModalOpen,
|
|
11986
|
-
title:
|
|
12541
|
+
title: _32("Save view"),
|
|
11987
12542
|
onCancel: () => {
|
|
11988
12543
|
setSaveViewModalOpen(false);
|
|
11989
12544
|
setPendingSaveTarget(null);
|
|
11990
12545
|
},
|
|
11991
12546
|
onOk: handleConfirmSaveView,
|
|
11992
|
-
okText: pendingSaveTarget === "layout" ?
|
|
12547
|
+
okText: pendingSaveTarget === "layout" ? _32("Save layout") : _32("Save analyze"),
|
|
11993
12548
|
okButtonProps: { disabled: !pendingSaveTarget },
|
|
11994
12549
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
11995
12550
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11996
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
12551
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("View name") }),
|
|
11997
12552
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Input, { value: saveViewName, onChange: (event) => setSaveViewName(event.target.value) })
|
|
11998
12553
|
] }),
|
|
11999
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children:
|
|
12554
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children: _32("Save as new view") })
|
|
12000
12555
|
] })
|
|
12001
12556
|
}
|
|
12002
12557
|
),
|
|
@@ -12004,10 +12559,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12004
12559
|
antd.Modal,
|
|
12005
12560
|
{
|
|
12006
12561
|
open: renameViewModalOpen,
|
|
12007
|
-
title:
|
|
12562
|
+
title: _32("Rename view"),
|
|
12008
12563
|
onCancel: () => setRenameViewModalOpen(false),
|
|
12009
12564
|
onOk: handleRenameView,
|
|
12010
|
-
okText:
|
|
12565
|
+
okText: _32("Rename"),
|
|
12011
12566
|
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { value: renameViewName, onChange: (event) => setRenameViewName(event.target.value) })
|
|
12012
12567
|
}
|
|
12013
12568
|
),
|
|
@@ -12017,11 +12572,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12017
12572
|
{
|
|
12018
12573
|
size: "small",
|
|
12019
12574
|
title: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, flexWrap: "wrap" }, children: [
|
|
12020
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
12575
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _32("Filters") }),
|
|
12021
12576
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12022
12577
|
antd.Input,
|
|
12023
12578
|
{
|
|
12024
|
-
placeholder:
|
|
12579
|
+
placeholder: _32("Search all fields..."),
|
|
12025
12580
|
prefix: /* @__PURE__ */ jsxRuntime.jsx(icons.SearchOutlined, {}),
|
|
12026
12581
|
allowClear: true,
|
|
12027
12582
|
value: localSearch,
|
|
@@ -12039,31 +12594,31 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12039
12594
|
antd.Card,
|
|
12040
12595
|
{
|
|
12041
12596
|
size: "small",
|
|
12042
|
-
title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
12597
|
+
title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _32("View configuration") }),
|
|
12043
12598
|
style: { marginBottom: 16 },
|
|
12044
12599
|
styles: { body: { display: "grid", gap: 12 } },
|
|
12045
12600
|
children: [
|
|
12046
12601
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
12047
12602
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
12048
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
12049
|
-
filterRules.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children:
|
|
12603
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _32("Advanced filters") }),
|
|
12604
|
+
filterRules.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children: _32("No filters yet.") }) : filterRules.map((rule) => {
|
|
12050
12605
|
const field = relatedModel.fields.find((f) => f.key === rule.fieldKey);
|
|
12051
12606
|
const type = field?.type || "string";
|
|
12052
12607
|
const operatorOptions = type === "number" ? [
|
|
12053
|
-
{ label:
|
|
12054
|
-
{ label:
|
|
12055
|
-
{ label:
|
|
12056
|
-
{ label:
|
|
12057
|
-
{ label:
|
|
12058
|
-
{ label:
|
|
12608
|
+
{ label: _32("="), value: "eq" },
|
|
12609
|
+
{ label: _32(">"), value: "gt" },
|
|
12610
|
+
{ label: _32(">="), value: "gte" },
|
|
12611
|
+
{ label: _32("<"), value: "lt" },
|
|
12612
|
+
{ label: _32("<="), value: "lte" },
|
|
12613
|
+
{ label: _32("Between"), value: "between" }
|
|
12059
12614
|
] : type === "date" ? [
|
|
12060
|
-
{ label:
|
|
12061
|
-
{ label:
|
|
12062
|
-
{ label:
|
|
12063
|
-
{ label:
|
|
12064
|
-
] : type === "boolean" ? [{ label:
|
|
12065
|
-
{ label:
|
|
12066
|
-
{ label:
|
|
12615
|
+
{ label: _32("On"), value: "on" },
|
|
12616
|
+
{ label: _32("After"), value: "after" },
|
|
12617
|
+
{ label: _32("Before"), value: "before" },
|
|
12618
|
+
{ label: _32("Between"), value: "between" }
|
|
12619
|
+
] : type === "boolean" ? [{ label: _32("Is"), value: "is" }] : [
|
|
12620
|
+
{ label: _32("Contains"), value: "contains" },
|
|
12621
|
+
{ label: _32("Equals"), value: "equals" }
|
|
12067
12622
|
];
|
|
12068
12623
|
const renderDateInput = (value, onChange) => {
|
|
12069
12624
|
const mode = value?.mode || "absolute";
|
|
@@ -12076,9 +12631,9 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12076
12631
|
value: value?.direction || "next",
|
|
12077
12632
|
onChange: (val) => onChange({ ...value, mode: "relative", direction: val }),
|
|
12078
12633
|
options: [
|
|
12079
|
-
{ label:
|
|
12080
|
-
{ label:
|
|
12081
|
-
{ label:
|
|
12634
|
+
{ label: _32("Previous"), value: "previous" },
|
|
12635
|
+
{ label: _32("Current"), value: "current" },
|
|
12636
|
+
{ label: _32("Next"), value: "next" }
|
|
12082
12637
|
]
|
|
12083
12638
|
}
|
|
12084
12639
|
),
|
|
@@ -12088,11 +12643,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12088
12643
|
value: value?.unit || "weeks",
|
|
12089
12644
|
onChange: (val) => onChange({ ...value, mode: "relative", unit: val }),
|
|
12090
12645
|
options: [
|
|
12091
|
-
{ label:
|
|
12092
|
-
{ label:
|
|
12093
|
-
{ label:
|
|
12094
|
-
{ label:
|
|
12095
|
-
{ label:
|
|
12646
|
+
{ label: _32("Days"), value: "days" },
|
|
12647
|
+
{ label: _32("Weeks"), value: "weeks" },
|
|
12648
|
+
{ label: _32("Months"), value: "months" },
|
|
12649
|
+
{ label: _32("Quarters"), value: "quarters" },
|
|
12650
|
+
{ label: _32("Years"), value: "years" }
|
|
12096
12651
|
]
|
|
12097
12652
|
}
|
|
12098
12653
|
)
|
|
@@ -12101,7 +12656,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12101
12656
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12102
12657
|
antd.DatePicker,
|
|
12103
12658
|
{
|
|
12104
|
-
value: value?.date ?
|
|
12659
|
+
value: value?.date ? dayjs8__default.default(value.date) : void 0,
|
|
12105
12660
|
onChange: (val) => onChange({ mode: "absolute", date: val ? val.toISOString() : null })
|
|
12106
12661
|
}
|
|
12107
12662
|
);
|
|
@@ -12114,7 +12669,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12114
12669
|
value: rule.fieldKey,
|
|
12115
12670
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, fieldKey: value, operator: void 0, value: void 0, value2: void 0 } : item)),
|
|
12116
12671
|
options: relatedModel.fields.map((f) => ({ label: f.label, value: f.key })),
|
|
12117
|
-
placeholder:
|
|
12672
|
+
placeholder: _32("Field")
|
|
12118
12673
|
}
|
|
12119
12674
|
),
|
|
12120
12675
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12124,7 +12679,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12124
12679
|
value: rule.operator,
|
|
12125
12680
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, operator: value } : item)),
|
|
12126
12681
|
options: operatorOptions,
|
|
12127
|
-
placeholder:
|
|
12682
|
+
placeholder: _32("Operator")
|
|
12128
12683
|
}
|
|
12129
12684
|
),
|
|
12130
12685
|
type === "number" && rule.operator === "between" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -12157,10 +12712,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12157
12712
|
value: rule.value,
|
|
12158
12713
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value } : item)),
|
|
12159
12714
|
options: [
|
|
12160
|
-
{ label:
|
|
12161
|
-
{ label:
|
|
12715
|
+
{ label: _32("True"), value: true },
|
|
12716
|
+
{ label: _32("False"), value: false }
|
|
12162
12717
|
],
|
|
12163
|
-
placeholder:
|
|
12718
|
+
placeholder: _32("Value")
|
|
12164
12719
|
}
|
|
12165
12720
|
),
|
|
12166
12721
|
type === "date" && rule.operator === "between" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -12173,7 +12728,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12173
12728
|
{
|
|
12174
12729
|
value: rule.value,
|
|
12175
12730
|
onChange: (event) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: event.target.value } : item)),
|
|
12176
|
-
placeholder:
|
|
12731
|
+
placeholder: _32("Value"),
|
|
12177
12732
|
style: { minWidth: 200 }
|
|
12178
12733
|
}
|
|
12179
12734
|
),
|
|
@@ -12186,8 +12741,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12186
12741
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: { ...item.value || {}, mode: val } } : item));
|
|
12187
12742
|
},
|
|
12188
12743
|
options: [
|
|
12189
|
-
{ label:
|
|
12190
|
-
{ label:
|
|
12744
|
+
{ label: _32("Date"), value: "absolute" },
|
|
12745
|
+
{ label: _32("Relative"), value: "relative" }
|
|
12191
12746
|
]
|
|
12192
12747
|
}
|
|
12193
12748
|
),
|
|
@@ -12200,8 +12755,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12200
12755
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value2: { ...item.value2 || {}, mode: val } } : item));
|
|
12201
12756
|
},
|
|
12202
12757
|
options: [
|
|
12203
|
-
{ label:
|
|
12204
|
-
{ label:
|
|
12758
|
+
{ label: _32("Date"), value: "absolute" },
|
|
12759
|
+
{ label: _32("Relative"), value: "relative" }
|
|
12205
12760
|
]
|
|
12206
12761
|
}
|
|
12207
12762
|
),
|
|
@@ -12211,7 +12766,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12211
12766
|
size: "small",
|
|
12212
12767
|
danger: true,
|
|
12213
12768
|
onClick: () => setFilterRules((prev) => prev.filter((item) => item.id !== rule.id)),
|
|
12214
|
-
children:
|
|
12769
|
+
children: _32("Remove")
|
|
12215
12770
|
}
|
|
12216
12771
|
)
|
|
12217
12772
|
] }, rule.id);
|
|
@@ -12223,14 +12778,14 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12223
12778
|
size: "small",
|
|
12224
12779
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.FilterOutlined, {}),
|
|
12225
12780
|
onClick: () => setFilterRules((prev) => [...prev, { id: `${Date.now()}-${Math.random()}` }]),
|
|
12226
|
-
children:
|
|
12781
|
+
children: _32("Add Filter")
|
|
12227
12782
|
}
|
|
12228
12783
|
),
|
|
12229
|
-
filterRules.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: () => setFilterRules([]), children:
|
|
12784
|
+
filterRules.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: () => setFilterRules([]), children: _32("Clear filters") })
|
|
12230
12785
|
] })
|
|
12231
12786
|
] }),
|
|
12232
12787
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
12233
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
12788
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _32("Views shown") }),
|
|
12234
12789
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12235
12790
|
antd.Select,
|
|
12236
12791
|
{
|
|
@@ -12251,12 +12806,12 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12251
12806
|
),
|
|
12252
12807
|
selectedViewNames.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "grid", gap: 6 }, children: selectedViewNames.map((name, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
12253
12808
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: name }),
|
|
12254
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12255
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12809
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Move up"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowUpOutlined, {}), disabled: index === 0, onClick: () => moveSelectedView(name, "up") }) }),
|
|
12810
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Move down"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowDownOutlined, {}), disabled: index === selectedViewNames.length - 1, onClick: () => moveSelectedView(name, "down") }) })
|
|
12256
12811
|
] }, name)) })
|
|
12257
12812
|
] }),
|
|
12258
12813
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
12259
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
12814
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _32("Active view") }),
|
|
12260
12815
|
viewSelector
|
|
12261
12816
|
] }),
|
|
12262
12817
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 8 }, children: [
|
|
@@ -12268,7 +12823,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12268
12823
|
setRenameViewName(currentViewName);
|
|
12269
12824
|
setRenameViewModalOpen(true);
|
|
12270
12825
|
},
|
|
12271
|
-
children:
|
|
12826
|
+
children: _32("Rename view")
|
|
12272
12827
|
}
|
|
12273
12828
|
),
|
|
12274
12829
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12279,7 +12834,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12279
12834
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
12280
12835
|
disabled: availableViewNames.length <= 1,
|
|
12281
12836
|
onClick: confirmDeleteView,
|
|
12282
|
-
children:
|
|
12837
|
+
children: _32("Delete view")
|
|
12283
12838
|
}
|
|
12284
12839
|
),
|
|
12285
12840
|
layoutPreferenceType && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12289,7 +12844,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12289
12844
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SaveOutlined, {}),
|
|
12290
12845
|
onClick: () => openSaveViewModalFor("layout"),
|
|
12291
12846
|
loading: isSavingLayoutPrefs,
|
|
12292
|
-
children:
|
|
12847
|
+
children: _32("Save layout")
|
|
12293
12848
|
}
|
|
12294
12849
|
),
|
|
12295
12850
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12301,7 +12856,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12301
12856
|
markLayoutPrefsTouched();
|
|
12302
12857
|
setFiltersCollapsed((prev) => !prev);
|
|
12303
12858
|
},
|
|
12304
|
-
children: filtersCollapsed ?
|
|
12859
|
+
children: filtersCollapsed ? _32("Show Filters") : _32("Hide Filters")
|
|
12305
12860
|
}
|
|
12306
12861
|
),
|
|
12307
12862
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12313,7 +12868,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12313
12868
|
markLayoutPrefsTouched();
|
|
12314
12869
|
setListVisible((prev) => !prev);
|
|
12315
12870
|
},
|
|
12316
|
-
children:
|
|
12871
|
+
children: _32("View list")
|
|
12317
12872
|
}
|
|
12318
12873
|
),
|
|
12319
12874
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12327,7 +12882,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12327
12882
|
setIsStatsFlipped(false);
|
|
12328
12883
|
setAnalyzeOpen((prev) => !prev);
|
|
12329
12884
|
},
|
|
12330
|
-
children:
|
|
12885
|
+
children: _32("Analyze")
|
|
12331
12886
|
}
|
|
12332
12887
|
),
|
|
12333
12888
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12339,7 +12894,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12339
12894
|
markLayoutPrefsTouched();
|
|
12340
12895
|
setIsAnalyzeVertical((prev) => !prev);
|
|
12341
12896
|
},
|
|
12342
|
-
children:
|
|
12897
|
+
children: _32("Switch orientation")
|
|
12343
12898
|
}
|
|
12344
12899
|
),
|
|
12345
12900
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12351,21 +12906,21 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12351
12906
|
markLayoutPrefsTouched();
|
|
12352
12907
|
setIsAnalyzeFirst((prev) => !prev);
|
|
12353
12908
|
},
|
|
12354
|
-
children:
|
|
12909
|
+
children: _32("Switch positions")
|
|
12355
12910
|
}
|
|
12356
12911
|
)
|
|
12357
12912
|
] })
|
|
12358
12913
|
] }),
|
|
12359
12914
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
12360
12915
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12 }, children: [
|
|
12361
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
12916
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _32("Columns") }),
|
|
12362
12917
|
selectedColumnKeys && selectedColumnKeys.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: () => {
|
|
12363
12918
|
setSelectedColumnKeys(null);
|
|
12364
12919
|
setColumnOrder(null);
|
|
12365
|
-
}, children:
|
|
12920
|
+
}, children: _32("Reset to default") })
|
|
12366
12921
|
] }),
|
|
12367
12922
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12368
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
12923
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _32("Select columns") }),
|
|
12369
12924
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12370
12925
|
antd.Checkbox.Group,
|
|
12371
12926
|
{
|
|
@@ -12377,27 +12932,27 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12377
12932
|
(!selectedColumnKeys || selectedColumnKeys.length === 0) && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginTop: 6 }, children: "Using default columns. Select fields to customize." })
|
|
12378
12933
|
] }),
|
|
12379
12934
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12380
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
12381
|
-
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
12935
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _32("Column order") }),
|
|
12936
|
+
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _32("No custom order yet.") }) : orderedSelectedColumns.map((key, index) => {
|
|
12382
12937
|
const field = relatedModel.fields.find((item) => item.key === key);
|
|
12383
12938
|
if (!field) return null;
|
|
12384
12939
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
12385
12940
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
12386
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12387
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12941
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Move left"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeftOutlined, {}), disabled: index === 0, onClick: () => moveColumnOrder(key, "left") }) }),
|
|
12942
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Move right"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowRightOutlined, {}), disabled: index === orderedSelectedColumns.length - 1, onClick: () => moveColumnOrder(key, "right") }) })
|
|
12388
12943
|
] }, key);
|
|
12389
12944
|
})
|
|
12390
12945
|
] }),
|
|
12391
12946
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12392
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
12393
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "grid", gap: 6 }, children: totalsSummaryConfigFields.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
12947
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _32("Totals summary function") }),
|
|
12948
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "grid", gap: 6 }, children: totalsSummaryConfigFields.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _32("No numeric fields available.") }) : totalsSummaryConfigFields.map((field) => {
|
|
12394
12949
|
const options = [
|
|
12395
|
-
{ label:
|
|
12396
|
-
{ label:
|
|
12397
|
-
{ label:
|
|
12398
|
-
{ label:
|
|
12399
|
-
{ label:
|
|
12400
|
-
{ label:
|
|
12950
|
+
{ label: _32("Sum"), value: "sum" },
|
|
12951
|
+
{ label: _32("Average"), value: "avg" },
|
|
12952
|
+
{ label: _32("Count"), value: "count" },
|
|
12953
|
+
{ label: _32("Max"), value: "max" },
|
|
12954
|
+
{ label: _32("Min"), value: "min" },
|
|
12955
|
+
{ label: _32("Std Dev"), value: "stddev" }
|
|
12401
12956
|
];
|
|
12402
12957
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
12403
12958
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
@@ -12451,7 +13006,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12451
13006
|
setCurrentPage(1);
|
|
12452
13007
|
}
|
|
12453
13008
|
},
|
|
12454
|
-
onShowSizeChange: (
|
|
13009
|
+
onShowSizeChange: (_41, newPageSize) => {
|
|
12455
13010
|
if (newPageSize && newPageSize !== pageSize) {
|
|
12456
13011
|
setPageSize(newPageSize);
|
|
12457
13012
|
setCurrentPage(1);
|
|
@@ -12460,8 +13015,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12460
13015
|
},
|
|
12461
13016
|
size: "small",
|
|
12462
13017
|
rowKey: (row) => row?.__relationKey || row?.eid || row?.id || JSON.stringify(row),
|
|
12463
|
-
locale: filteredRows.length === 0 ? { emptyText: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-block", fontSize: 12, color: "#8c8c8c" }, children:
|
|
12464
|
-
onChange: (
|
|
13018
|
+
locale: filteredRows.length === 0 ? { emptyText: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-block", fontSize: 12, color: "#8c8c8c" }, children: _32("No related records") }) } : void 0,
|
|
13019
|
+
onChange: (_41, filters, sorter, extra) => {
|
|
12465
13020
|
const nextFilters = {};
|
|
12466
13021
|
Object.entries(filters || {}).forEach(([key, values]) => {
|
|
12467
13022
|
if (!values) return;
|
|
@@ -12529,7 +13084,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12529
13084
|
const recordValue = recordRow?.[field.key];
|
|
12530
13085
|
return String(recordValue) === String(value);
|
|
12531
13086
|
},
|
|
12532
|
-
align: field.type === "number" && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
13087
|
+
align: field.type === "number" && !field.reference && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
12533
13088
|
render: (value, row) => {
|
|
12534
13089
|
if (allowInlineEdit && field.key !== "eid") {
|
|
12535
13090
|
const rowId = row?.eid ?? row?.id ?? row?.__relationKey;
|
|
@@ -12539,12 +13094,16 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12539
13094
|
name: [rowId, field.key],
|
|
12540
13095
|
style: { margin: 0 },
|
|
12541
13096
|
valuePropName: field.type === "boolean" ? "checked" : "value",
|
|
12542
|
-
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value:
|
|
13097
|
+
getValueProps: (val) => (field.type === "date" || field.type === "datetime") && val ? { value: dayjs8__default.default(val) } : field.type === "time" && val ? { value: dayjs8__default.default("1970-01-01T" + val) } : { value: val },
|
|
12543
13098
|
children: renderEditableInput(field, rowId)
|
|
12544
13099
|
}
|
|
12545
13100
|
);
|
|
12546
13101
|
}
|
|
12547
13102
|
const renderValue = () => {
|
|
13103
|
+
const showToken = normalizeFieldViewType(field.showViewType || "");
|
|
13104
|
+
if (showToken && !(showToken === "read-only-field" && field.reference)) {
|
|
13105
|
+
return renderFieldValue(field, row, allModels, true);
|
|
13106
|
+
}
|
|
12548
13107
|
if (field.reference && value) {
|
|
12549
13108
|
const cacheKey = `${field.reference}:${value}`;
|
|
12550
13109
|
return labelCache[cacheKey] || value;
|
|
@@ -12586,7 +13145,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12586
13145
|
showActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12587
13146
|
antd.Table.Column,
|
|
12588
13147
|
{
|
|
12589
|
-
title:
|
|
13148
|
+
title: _32("Actions"),
|
|
12590
13149
|
width: 140,
|
|
12591
13150
|
render: (_unused, row) => {
|
|
12592
13151
|
const id = row?.eid ?? row?.id;
|
|
@@ -12594,14 +13153,14 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12594
13153
|
const deleteId = relationRow && rel.targetKey && rel.otherKey ? `${relationRow["eid_from"]}:${relationRow["eid_to"]}` : relationRow?.id ?? relationRow?.eid;
|
|
12595
13154
|
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
12596
13155
|
id && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12597
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
13156
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("View"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EyeOutlined, {}), onClick: () => {
|
|
12598
13157
|
if (paneNav?.isInMultiPane) {
|
|
12599
13158
|
paneNav.openDetail(relatedModel.name, id);
|
|
12600
13159
|
} else {
|
|
12601
13160
|
go({ to: { resource: relatedModel.name, action: "show", id } });
|
|
12602
13161
|
}
|
|
12603
13162
|
} }) }),
|
|
12604
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
13163
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Edit"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EditOutlined, {}), onClick: () => {
|
|
12605
13164
|
if (allowInlineEdit) {
|
|
12606
13165
|
const params = new URLSearchParams();
|
|
12607
13166
|
params.append("inline", "1");
|
|
@@ -12613,7 +13172,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12613
13172
|
}
|
|
12614
13173
|
} }) })
|
|
12615
13174
|
] }),
|
|
12616
|
-
deleteId && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
13175
|
+
deleteId && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Delete"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12617
13176
|
antd.Button,
|
|
12618
13177
|
{
|
|
12619
13178
|
size: "small",
|
|
@@ -12633,7 +13192,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12633
13192
|
}
|
|
12634
13193
|
),
|
|
12635
13194
|
relationRowsCapped && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 8, display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 8, flexWrap: "wrap" }, children: [
|
|
12636
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", style: { fontSize: 12 }, children:
|
|
13195
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", style: { fontSize: 12 }, children: _32("Only the first N rows are loaded").replace("N", formatNumberValue(loadedRowsCount || relationsMaxRowsToLoad)) }),
|
|
12637
13196
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12638
13197
|
antd.Button,
|
|
12639
13198
|
{
|
|
@@ -12643,7 +13202,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12643
13202
|
setFullDataLoaded(false);
|
|
12644
13203
|
setLoadAllRelatedRequested(true);
|
|
12645
13204
|
},
|
|
12646
|
-
children:
|
|
13205
|
+
children: _32("Load all related")
|
|
12647
13206
|
}
|
|
12648
13207
|
)
|
|
12649
13208
|
] })
|
|
@@ -12653,7 +13212,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12653
13212
|
antd.Card,
|
|
12654
13213
|
{
|
|
12655
13214
|
size: "small",
|
|
12656
|
-
title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: relatedModelTone.text, fontWeight: 600 }, children:
|
|
13215
|
+
title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: relatedModelTone.text, fontWeight: 600 }, children: _32("Analyze") }),
|
|
12657
13216
|
styles: {
|
|
12658
13217
|
header: {
|
|
12659
13218
|
background: `linear-gradient(135deg, ${relatedModelTone.solid}18 0%, ${relatedModelTone.solid}0a 100%)`
|
|
@@ -12682,10 +13241,10 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12682
13241
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
12683
13242
|
children: [
|
|
12684
13243
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "absolute", top: 0, right: 0, display: "flex", gap: 8 }, children: [
|
|
12685
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12686
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12687
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12688
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
13244
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Save preferences"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SaveOutlined, {}), onClick: () => openSaveViewModalFor("analyze"), loading: isSavingAnalyzePrefs }) }),
|
|
13245
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Stats"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.FileTextOutlined, {}), onClick: () => setIsStatsFlipped(true) }) }),
|
|
13246
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Export chart PDF"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.FilePdfOutlined, {}), onClick: exportChartPdf }) }),
|
|
13247
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Export chart PNG"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: exportChartImage, "aria-label": _32("Export chart") }) })
|
|
12689
13248
|
] }),
|
|
12690
13249
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12691
13250
|
AnalysisChart,
|
|
@@ -12716,11 +13275,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12716
13275
|
items: [
|
|
12717
13276
|
{
|
|
12718
13277
|
key: "configure-chart",
|
|
12719
|
-
label:
|
|
13278
|
+
label: _32("Customize chart"),
|
|
12720
13279
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
12721
13280
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 16, flexWrap: "wrap" }, children: [
|
|
12722
13281
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
12723
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13282
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Category 1") }),
|
|
12724
13283
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12725
13284
|
antd.Select,
|
|
12726
13285
|
{
|
|
@@ -12731,12 +13290,12 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12731
13290
|
},
|
|
12732
13291
|
style: { width: "100%" },
|
|
12733
13292
|
options: categoricalFields.map((field) => ({ label: field.label, value: field.key })),
|
|
12734
|
-
placeholder:
|
|
13293
|
+
placeholder: _32("Select category")
|
|
12735
13294
|
}
|
|
12736
13295
|
)
|
|
12737
13296
|
] }),
|
|
12738
13297
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
12739
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13298
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Category 2") }),
|
|
12740
13299
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12741
13300
|
antd.Select,
|
|
12742
13301
|
{
|
|
@@ -12747,14 +13306,14 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12747
13306
|
},
|
|
12748
13307
|
style: { width: "100%" },
|
|
12749
13308
|
options: [
|
|
12750
|
-
{ label:
|
|
13309
|
+
{ label: _32("None"), value: "__none__" },
|
|
12751
13310
|
...categoricalFields.filter((field) => field.key !== categoryField1).map((field) => ({ label: field.label, value: field.key }))
|
|
12752
13311
|
]
|
|
12753
13312
|
}
|
|
12754
13313
|
)
|
|
12755
13314
|
] }),
|
|
12756
13315
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 160 }, children: [
|
|
12757
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13316
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Chart Type") }),
|
|
12758
13317
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12759
13318
|
antd.Select,
|
|
12760
13319
|
{
|
|
@@ -12765,30 +13324,30 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12765
13324
|
},
|
|
12766
13325
|
style: { width: "100%" },
|
|
12767
13326
|
options: [
|
|
12768
|
-
{ label:
|
|
12769
|
-
{ label:
|
|
12770
|
-
{ label:
|
|
12771
|
-
{ label:
|
|
12772
|
-
{ label:
|
|
12773
|
-
{ label:
|
|
12774
|
-
{ label:
|
|
12775
|
-
{ label:
|
|
12776
|
-
{ label:
|
|
12777
|
-
{ label:
|
|
12778
|
-
{ label:
|
|
12779
|
-
{ label:
|
|
12780
|
-
{ label:
|
|
12781
|
-
{ label:
|
|
12782
|
-
{ label:
|
|
12783
|
-
{ label:
|
|
12784
|
-
{ label:
|
|
12785
|
-
{ label:
|
|
13327
|
+
{ label: _32("Area"), value: "area" },
|
|
13328
|
+
{ label: _32("Horizontal Area"), value: "area-horizontal" },
|
|
13329
|
+
{ label: _32("Bars"), value: "bar" },
|
|
13330
|
+
{ label: _32("Stacked Bars"), value: "stacked" },
|
|
13331
|
+
{ label: _32("Horizontal Bars"), value: "bar-horizontal" },
|
|
13332
|
+
{ label: _32("Horizontal Stacked"), value: "stacked-horizontal" },
|
|
13333
|
+
{ label: _32("Lines"), value: "line" },
|
|
13334
|
+
{ label: _32("Pie"), value: "pie" },
|
|
13335
|
+
{ label: _32("Donut"), value: "donut" },
|
|
13336
|
+
{ label: _32("Scatter"), value: "scatter" },
|
|
13337
|
+
{ label: _32("Bubble"), value: "bubble" },
|
|
13338
|
+
{ label: _32("Histogram"), value: "histogram" },
|
|
13339
|
+
{ label: _32("Box Plot"), value: "box" },
|
|
13340
|
+
{ label: _32("Waterfall"), value: "waterfall" },
|
|
13341
|
+
{ label: _32("Heatmap"), value: "heatmap" },
|
|
13342
|
+
{ label: _32("Crosstab"), value: "crosstab" },
|
|
13343
|
+
{ label: _32("Radar"), value: "radar" },
|
|
13344
|
+
{ label: _32("Combo (Bar + Line)"), value: "combo" }
|
|
12786
13345
|
]
|
|
12787
13346
|
}
|
|
12788
13347
|
)
|
|
12789
13348
|
] }),
|
|
12790
13349
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 200 }, children: [
|
|
12791
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13350
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Summary") }),
|
|
12792
13351
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12793
13352
|
antd.Select,
|
|
12794
13353
|
{
|
|
@@ -12799,18 +13358,18 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12799
13358
|
},
|
|
12800
13359
|
style: { width: "100%" },
|
|
12801
13360
|
options: [
|
|
12802
|
-
{ label:
|
|
12803
|
-
{ label:
|
|
12804
|
-
{ label:
|
|
12805
|
-
{ label:
|
|
12806
|
-
{ label:
|
|
12807
|
-
{ label:
|
|
13361
|
+
{ label: _32("Sum"), value: "sum" },
|
|
13362
|
+
{ label: _32("Average"), value: "avg" },
|
|
13363
|
+
{ label: _32("Count"), value: "count" },
|
|
13364
|
+
{ label: _32("Max"), value: "max" },
|
|
13365
|
+
{ label: _32("Min"), value: "min" },
|
|
13366
|
+
{ label: _32("Std Dev"), value: "stddev" }
|
|
12808
13367
|
]
|
|
12809
13368
|
}
|
|
12810
13369
|
)
|
|
12811
13370
|
] }),
|
|
12812
13371
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 180 }, children: [
|
|
12813
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13372
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Ranking Filter") }),
|
|
12814
13373
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12815
13374
|
antd.Select,
|
|
12816
13375
|
{
|
|
@@ -12821,15 +13380,15 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12821
13380
|
},
|
|
12822
13381
|
style: { width: "100%" },
|
|
12823
13382
|
options: [
|
|
12824
|
-
{ label:
|
|
12825
|
-
{ label:
|
|
12826
|
-
{ label:
|
|
13383
|
+
{ label: _32("None"), value: "none" },
|
|
13384
|
+
{ label: _32("Top N"), value: "top" },
|
|
13385
|
+
{ label: _32("Bottom N"), value: "bottom" }
|
|
12827
13386
|
]
|
|
12828
13387
|
}
|
|
12829
13388
|
)
|
|
12830
13389
|
] }),
|
|
12831
13390
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 220 }, children: [
|
|
12832
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13391
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("Ranking Column") }),
|
|
12833
13392
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12834
13393
|
antd.Select,
|
|
12835
13394
|
{
|
|
@@ -12840,13 +13399,13 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12840
13399
|
},
|
|
12841
13400
|
style: { width: "100%" },
|
|
12842
13401
|
options: numericFields.map((field) => ({ label: field.label, value: field.key })),
|
|
12843
|
-
placeholder:
|
|
13402
|
+
placeholder: _32("Select numeric column"),
|
|
12844
13403
|
disabled: rankingMode === "none" || numericFields.length === 0
|
|
12845
13404
|
}
|
|
12846
13405
|
)
|
|
12847
13406
|
] }),
|
|
12848
13407
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 120 }, children: [
|
|
12849
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
13408
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _32("N") }),
|
|
12850
13409
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12851
13410
|
antd.InputNumber,
|
|
12852
13411
|
{
|
|
@@ -12865,8 +13424,8 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12865
13424
|
] }),
|
|
12866
13425
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12867
13426
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, marginBottom: 6 }, children: [
|
|
12868
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
12869
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
13427
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _32("Series") }),
|
|
13428
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Unselect All"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12870
13429
|
antd.Button,
|
|
12871
13430
|
{
|
|
12872
13431
|
size: "small",
|
|
@@ -12886,7 +13445,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12886
13445
|
markAnalyzePrefsTouched();
|
|
12887
13446
|
setSelectedSeriesKeys(values);
|
|
12888
13447
|
},
|
|
12889
|
-
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label:
|
|
13448
|
+
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label: _32("Count"), value: "__count__" }]
|
|
12890
13449
|
}
|
|
12891
13450
|
)
|
|
12892
13451
|
] })
|
|
@@ -12911,11 +13470,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12911
13470
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
12912
13471
|
children: [
|
|
12913
13472
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "absolute", top: 0, right: 0, display: "flex", gap: 8 }, children: [
|
|
12914
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
12915
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
13473
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Analysis"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BarChartOutlined, {}), onClick: () => setIsStatsFlipped(false) }) }),
|
|
13474
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _32("Export stats PDF"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.FilePdfOutlined, {}), onClick: exportStatsPdf }) })
|
|
12916
13475
|
] }),
|
|
12917
13476
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
12918
|
-
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Card, { size: "small", title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsTitleStyle, children:
|
|
13477
|
+
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Card, { size: "small", title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsTitleStyle, children: _32("Numeric columns") }), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12919
13478
|
antd.Table,
|
|
12920
13479
|
{
|
|
12921
13480
|
dataSource: statsSummary.numericStats,
|
|
@@ -12926,18 +13485,18 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12926
13485
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12927
13486
|
antd.Table.Column,
|
|
12928
13487
|
{
|
|
12929
|
-
title:
|
|
13488
|
+
title: _32("Field"),
|
|
12930
13489
|
dataIndex: "label",
|
|
12931
13490
|
render: (label) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsLabelStyle, children: label }),
|
|
12932
13491
|
onHeaderCell: () => ({ style: statsHeaderStyle })
|
|
12933
13492
|
},
|
|
12934
13493
|
"label"
|
|
12935
13494
|
),
|
|
12936
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
12937
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
12938
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
12939
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
12940
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
13495
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _32("Sum"), align: "right", render: (_unused, row) => renderStatBar(row.sum, statsNumericMaxes.sum, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "sum"),
|
|
13496
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _32("Average"), align: "right", render: (_unused, row) => renderStatBar(row.avg, statsNumericMaxes.avg, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "avg"),
|
|
13497
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _32("Min"), align: "right", render: (_unused, row) => renderStatBar(row.min, statsNumericMaxes.min, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "min"),
|
|
13498
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _32("Max"), align: "right", render: (_unused, row) => renderStatBar(row.max, statsNumericMaxes.max, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "max"),
|
|
13499
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _32("Std Dev"), align: "right", render: (_unused, row) => renderStatBar(row.stddev, statsNumericMaxes.stddev, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "stddev")
|
|
12941
13500
|
]
|
|
12942
13501
|
}
|
|
12943
13502
|
) }),
|
|
@@ -12949,7 +13508,7 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12949
13508
|
items: [
|
|
12950
13509
|
{
|
|
12951
13510
|
key: "categorical-columns",
|
|
12952
|
-
label: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsTitleStyle, children:
|
|
13511
|
+
label: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsTitleStyle, children: _32("Categorical columns (distinct < 20)") }),
|
|
12953
13512
|
children: statsSummary.categoricalStats.map((field) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: 12 }, children: [
|
|
12954
13513
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontWeight: 600, marginBottom: 4 }, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsLabelStyle, children: field.label }) }),
|
|
12955
13514
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -12960,11 +13519,11 @@ var RelatedObjectsTable = ({ rel, record, relatedModel, parentModel, showActions
|
|
|
12960
13519
|
pagination: false,
|
|
12961
13520
|
rowKey: (row) => row.value,
|
|
12962
13521
|
children: [
|
|
12963
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
13522
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _32("Value"), dataIndex: "value", onHeaderCell: () => ({ style: statsHeaderStyle }) }, "value"),
|
|
12964
13523
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12965
13524
|
antd.Table.Column,
|
|
12966
13525
|
{
|
|
12967
|
-
title:
|
|
13526
|
+
title: _32("Count"),
|
|
12968
13527
|
dataIndex: "count",
|
|
12969
13528
|
align: "right",
|
|
12970
13529
|
onHeaderCell: () => ({ style: statsHeaderStyle }),
|
|
@@ -13096,7 +13655,7 @@ var RelatedObjectSingleSelect = ({ rel, record, allModels, required }) => {
|
|
|
13096
13655
|
}
|
|
13097
13656
|
);
|
|
13098
13657
|
};
|
|
13099
|
-
var
|
|
13658
|
+
var _33 = window._ || ((text) => text);
|
|
13100
13659
|
function useMillerColumnItems({
|
|
13101
13660
|
parentId,
|
|
13102
13661
|
rel,
|
|
@@ -13214,7 +13773,7 @@ function useMillerColumnItems({
|
|
|
13214
13773
|
} catch (err) {
|
|
13215
13774
|
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
13216
13775
|
if (isMounted) {
|
|
13217
|
-
setError(err instanceof Error ? err.message :
|
|
13776
|
+
setError(err instanceof Error ? err.message : _33("Failed to load items"));
|
|
13218
13777
|
}
|
|
13219
13778
|
} finally {
|
|
13220
13779
|
if (isMounted) setLoading(false);
|
|
@@ -13266,7 +13825,7 @@ var MillerColumn = ({
|
|
|
13266
13825
|
antd.Empty,
|
|
13267
13826
|
{
|
|
13268
13827
|
image: antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
13269
|
-
description:
|
|
13828
|
+
description: _33("No items"),
|
|
13270
13829
|
style: { margin: "32px 0" }
|
|
13271
13830
|
}
|
|
13272
13831
|
),
|
|
@@ -13343,12 +13902,12 @@ var DetailPaneContent = ({ node, allModels }) => {
|
|
|
13343
13902
|
const model = allModels?.find((m) => m.name === node.resource);
|
|
13344
13903
|
const showHref = getShowHref(node.resource, node.id, allModels);
|
|
13345
13904
|
if (!model) {
|
|
13346
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: `${
|
|
13905
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: `${_33("No schema for")} ${node.resource}`, style: { marginTop: 32 } });
|
|
13347
13906
|
}
|
|
13348
13907
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
13349
13908
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 12 }, children: [
|
|
13350
13909
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Title, { level: 5, style: { margin: 0, color: token.colorTextSecondary, fontWeight: 500, flex: 1, minWidth: 0 }, children: node.label }),
|
|
13351
|
-
showHref && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
13910
|
+
showHref && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _33("Open in new tab"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13352
13911
|
antd.Button,
|
|
13353
13912
|
{
|
|
13354
13913
|
size: "small",
|
|
@@ -13454,7 +14013,7 @@ var MillerBrowserLayout = ({
|
|
|
13454
14013
|
}
|
|
13455
14014
|
};
|
|
13456
14015
|
if (!rootId) {
|
|
13457
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description:
|
|
14016
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: _33("No record selected") });
|
|
13458
14017
|
}
|
|
13459
14018
|
const columnsAreaStyle = columnsWidth !== null ? { width: columnsWidth, flexShrink: 0, flexGrow: 0, minWidth: 200, overflowX: "auto", display: "flex", height: "100%" } : { width: showDetails ? "fit-content" : "100%", maxWidth: showDetails ? "50%" : "100%", flexShrink: 0, minWidth: 240, overflowX: "auto", display: "flex", height: "100%" };
|
|
13460
14019
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -13517,7 +14076,7 @@ var MillerBrowserLayout = ({
|
|
|
13517
14076
|
showDetails && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13518
14077
|
antd.Drawer,
|
|
13519
14078
|
{
|
|
13520
|
-
title: detailNode?.label ??
|
|
14079
|
+
title: detailNode?.label ?? _33("Details"),
|
|
13521
14080
|
placement: "right",
|
|
13522
14081
|
open: drawerOpen && !isDesktop,
|
|
13523
14082
|
onClose: () => setDrawerOpen(false),
|
|
@@ -13627,6 +14186,24 @@ var renderRelationBlock = ({
|
|
|
13627
14186
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: resolvedValueStyle, children: /* @__PURE__ */ jsxRuntime.jsx(RelatedObjectsInlineValues, { rel, record, viewType: "csv", allModels }) })
|
|
13628
14187
|
] }) });
|
|
13629
14188
|
}
|
|
14189
|
+
if (viewType === "editable-csv" || viewType === "read-and-edit-csv") {
|
|
14190
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: resolvedLayoutStyle, children: [
|
|
14191
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsx("div", { style: resolvedLabelStyle, children: relationLabel }),
|
|
14192
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: resolvedValueStyle, children: /* @__PURE__ */ jsxRuntime.jsx(RelatedObjectsEditableCsv, { rel, record, allModels }) })
|
|
14193
|
+
] }) });
|
|
14194
|
+
}
|
|
14195
|
+
if (viewType === "read-and-edit-list") {
|
|
14196
|
+
if (rel.otherResource && rel.otherKey) {
|
|
14197
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: 16, boxShadow: `0 8px 20px -16px ${relationTone.shadow}` }, children: [
|
|
14198
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...resolvedLabelStyle, marginBottom: 4 }, children: showLabel ? relationLabel : null }),
|
|
14199
|
+
/* @__PURE__ */ jsxRuntime.jsx(RelatedObjectsEditableList, { rel, record, allModels })
|
|
14200
|
+
] });
|
|
14201
|
+
}
|
|
14202
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: resolvedLayoutStyle, children: [
|
|
14203
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsx("div", { style: resolvedLabelStyle, children: relationLabel }),
|
|
14204
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: resolvedValueStyle, children: /* @__PURE__ */ jsxRuntime.jsx(RelatedObjectsInlineValues, { rel, record, viewType: "list", allModels }) })
|
|
14205
|
+
] }) });
|
|
14206
|
+
}
|
|
13630
14207
|
if (isInlineListView && !polymorphicInfo) {
|
|
13631
14208
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: resolvedLayoutStyle, children: [
|
|
13632
14209
|
showLabel && /* @__PURE__ */ jsxRuntime.jsx("div", { style: resolvedLabelStyle, children: relationLabel }),
|
|
@@ -13820,7 +14397,7 @@ var renderRelationBlock = ({
|
|
|
13820
14397
|
content
|
|
13821
14398
|
] }, rel.resource);
|
|
13822
14399
|
};
|
|
13823
|
-
var
|
|
14400
|
+
var _34 = window._ || ((text) => text);
|
|
13824
14401
|
var { Title: Title7 } = antd.Typography;
|
|
13825
14402
|
var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbedded = false, showActions = true, showCreate = true, layoutPreferenceType, listViewType, rowSelection, extraHeaderButtons, bulkActions, preferencesResourceOverride, defaultListVisible }) => {
|
|
13826
14403
|
const model = useRoleFilteredModel(modelProp);
|
|
@@ -13890,7 +14467,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13890
14467
|
const [galleryPage, setGalleryPage] = React6.useState(1);
|
|
13891
14468
|
const [calendarMode, setCalendarMode] = React6.useState("month");
|
|
13892
14469
|
const [calendarDateField, setCalendarDateField] = React6.useState(() => calendarDateFieldOptions[0]?.key || "");
|
|
13893
|
-
const [calendarAnchorDate, setCalendarAnchorDate] = React6.useState(() =>
|
|
14470
|
+
const [calendarAnchorDate, setCalendarAnchorDate] = React6.useState(() => dayjs8__default.default().startOf("month"));
|
|
13894
14471
|
const [isAnalyzeVertical, setIsAnalyzeVertical] = React6.useState(false);
|
|
13895
14472
|
const [isAnalyzeFirst, setIsAnalyzeFirst] = React6.useState(false);
|
|
13896
14473
|
const [filterRules, setFilterRules] = React6.useState([]);
|
|
@@ -13900,7 +14477,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13900
14477
|
const [selectedColumnKeys, setSelectedColumnKeys] = React6.useState(null);
|
|
13901
14478
|
const [columnOrder, setColumnOrder] = React6.useState(null);
|
|
13902
14479
|
const [columnFiltersSelected, setColumnFiltersSelected] = React6.useState({});
|
|
13903
|
-
const [columnSort, setColumnSort] = React6.useState(
|
|
14480
|
+
const [columnSort, setColumnSort] = React6.useState(
|
|
14481
|
+
model.defaultSort ? [{ fieldKey: model.defaultSort.field, order: model.defaultSort.order === "desc" ? "descend" : "ascend" }] : []
|
|
14482
|
+
);
|
|
13904
14483
|
const [totalsSummaryFunctions, setTotalsSummaryFunctions] = React6.useState({});
|
|
13905
14484
|
const [currentViewName, setCurrentViewName] = React6.useState(getDefaultViewName());
|
|
13906
14485
|
const [selectedViewNames, setSelectedViewNames] = React6.useState([]);
|
|
@@ -13955,6 +14534,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13955
14534
|
const layoutPrefsLoadedRef = React6.useRef(false);
|
|
13956
14535
|
const layoutPrefsResourceRef = React6.useRef(null);
|
|
13957
14536
|
const sortIntentRef = React6.useRef(null);
|
|
14537
|
+
const prevViewNameForResetRef = React6.useRef(null);
|
|
13958
14538
|
const [bulkSelectedRowKeys, setBulkSelectedRowKeys] = React6.useState([]);
|
|
13959
14539
|
const bulkSelectedRowsMapRef = React6.useRef(/* @__PURE__ */ new Map());
|
|
13960
14540
|
const [selectModeAssociating, setSelectModeAssociating] = React6.useState(false);
|
|
@@ -13983,12 +14563,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
13983
14563
|
});
|
|
13984
14564
|
}
|
|
13985
14565
|
}
|
|
13986
|
-
antd.message.success(
|
|
14566
|
+
antd.message.success(_34("Relations added."));
|
|
13987
14567
|
if (selectModeReturnTo && selectModeReturnTo.startsWith("/")) {
|
|
13988
14568
|
navigate(selectModeReturnTo);
|
|
13989
14569
|
}
|
|
13990
14570
|
} catch {
|
|
13991
|
-
antd.message.error(
|
|
14571
|
+
antd.message.error(_34("Failed to add relations."));
|
|
13992
14572
|
} finally {
|
|
13993
14573
|
setSelectModeAssociating(false);
|
|
13994
14574
|
}
|
|
@@ -14086,7 +14666,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14086
14666
|
const direction = value?.direction || "next";
|
|
14087
14667
|
const unit = value?.unit || "weeks";
|
|
14088
14668
|
const isQuarter = unit === "quarters";
|
|
14089
|
-
const base =
|
|
14669
|
+
const base = dayjs8__default.default();
|
|
14090
14670
|
if (asRange || direction === "current") {
|
|
14091
14671
|
const anchor = direction === "current" ? base : direction === "previous" ? isQuarter ? base.subtract(count * 3, "month") : base.subtract(count, unit) : isQuarter ? base.add(count * 3, "month") : base.add(count, unit);
|
|
14092
14672
|
if (isQuarter) {
|
|
@@ -14147,7 +14727,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14147
14727
|
return true;
|
|
14148
14728
|
}
|
|
14149
14729
|
if (field.type === "date" || field.type === "datetime") {
|
|
14150
|
-
const recordDate =
|
|
14730
|
+
const recordDate = dayjs8__default.default(rawValue);
|
|
14151
14731
|
if (!recordDate.isValid()) return false;
|
|
14152
14732
|
const mode = rule.value?.mode || "absolute";
|
|
14153
14733
|
const mode2 = rule.value2?.mode || "absolute";
|
|
@@ -14155,7 +14735,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14155
14735
|
if (val?.mode === "relative") {
|
|
14156
14736
|
return resolveRelativeDate(val, asRange);
|
|
14157
14737
|
}
|
|
14158
|
-
const date =
|
|
14738
|
+
const date = dayjs8__default.default(val?.date || val);
|
|
14159
14739
|
return asRange ? { start: date.startOf("day"), end: date.endOf("day") } : { date: date.startOf("day") };
|
|
14160
14740
|
};
|
|
14161
14741
|
switch (rule.operator) {
|
|
@@ -14166,13 +14746,13 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14166
14746
|
}
|
|
14167
14747
|
case "after": {
|
|
14168
14748
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
14169
|
-
if (!dateVal || !
|
|
14170
|
-
return recordDate.valueOf() >
|
|
14749
|
+
if (!dateVal || !dayjs8__default.default(dateVal).isValid()) return false;
|
|
14750
|
+
return recordDate.valueOf() > dayjs8__default.default(dateVal).endOf("day").valueOf();
|
|
14171
14751
|
}
|
|
14172
14752
|
case "before": {
|
|
14173
14753
|
const dateVal = mode === "relative" ? resolveRelativeDate(rule.value, false).date : getDateValue(rule.value, false).date;
|
|
14174
|
-
if (!dateVal || !
|
|
14175
|
-
return recordDate.valueOf() <
|
|
14754
|
+
if (!dateVal || !dayjs8__default.default(dateVal).isValid()) return false;
|
|
14755
|
+
return recordDate.valueOf() < dayjs8__default.default(dateVal).startOf("day").valueOf();
|
|
14176
14756
|
}
|
|
14177
14757
|
case "between": {
|
|
14178
14758
|
const startRange = mode === "relative" ? resolveRelativeDate(rule.value, true) : getDateValue(rule.value, true);
|
|
@@ -14494,7 +15074,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14494
15074
|
}, [numericFields, rankingFieldKey, rankingMode]);
|
|
14495
15075
|
const resetLayoutDefaults = React6.useCallback(() => {
|
|
14496
15076
|
setListVisible(defaultListVisible ?? true);
|
|
14497
|
-
setAnalyzeOpen(
|
|
15077
|
+
setAnalyzeOpen(isEmbedded);
|
|
14498
15078
|
setIsAnalyzeVertical(false);
|
|
14499
15079
|
setIsAnalyzeFirst(false);
|
|
14500
15080
|
setFiltersCollapsed(isEmbedded);
|
|
@@ -14618,7 +15198,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14618
15198
|
return;
|
|
14619
15199
|
}
|
|
14620
15200
|
if (availableViewNames.includes(newName)) {
|
|
14621
|
-
antd.message.error(
|
|
15201
|
+
antd.message.error(_34("View name already exists."));
|
|
14622
15202
|
return;
|
|
14623
15203
|
}
|
|
14624
15204
|
try {
|
|
@@ -14631,18 +15211,18 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14631
15211
|
if (!response.ok) {
|
|
14632
15212
|
throw new Error(`Rename failed (${response.status})`);
|
|
14633
15213
|
}
|
|
14634
|
-
antd.message.success(
|
|
15214
|
+
antd.message.success(_34("View renamed."));
|
|
14635
15215
|
setRenameViewModalOpen(false);
|
|
14636
15216
|
await loadViewNames();
|
|
14637
15217
|
} catch (error) {
|
|
14638
|
-
antd.message.error(error instanceof Error ? error.message :
|
|
15218
|
+
antd.message.error(error instanceof Error ? error.message : _34("Failed to rename view."));
|
|
14639
15219
|
}
|
|
14640
15220
|
}, [apiUrl, availableViewNames, currentViewName, model.name, model.resource, renameViewName, allModels, loadViewNames]);
|
|
14641
15221
|
const confirmDeleteView = React6.useCallback(() => {
|
|
14642
15222
|
antd.Modal.confirm({
|
|
14643
|
-
title:
|
|
15223
|
+
title: _34(_34("Delete view")),
|
|
14644
15224
|
content: `Delete "${currentViewName}" and all its saved preferences?`,
|
|
14645
|
-
okText:
|
|
15225
|
+
okText: _34("Delete"),
|
|
14646
15226
|
okButtonProps: { danger: true },
|
|
14647
15227
|
onOk: async () => {
|
|
14648
15228
|
try {
|
|
@@ -14655,10 +15235,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14655
15235
|
if (!response.ok) {
|
|
14656
15236
|
throw new Error(`Delete failed (${response.status})`);
|
|
14657
15237
|
}
|
|
14658
|
-
antd.message.success(
|
|
15238
|
+
antd.message.success(_34("View deleted."));
|
|
14659
15239
|
await loadViewNames();
|
|
14660
15240
|
} catch (error) {
|
|
14661
|
-
antd.message.error(error instanceof Error ? error.message :
|
|
15241
|
+
antd.message.error(error instanceof Error ? error.message : _34("Failed to delete view."));
|
|
14662
15242
|
}
|
|
14663
15243
|
}
|
|
14664
15244
|
});
|
|
@@ -14700,9 +15280,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14700
15280
|
if (failed) {
|
|
14701
15281
|
throw new Error(`Save failed (${failed.status})`);
|
|
14702
15282
|
}
|
|
14703
|
-
antd.message.success(
|
|
15283
|
+
antd.message.success(_34("Layout preferences saved."));
|
|
14704
15284
|
} catch (error) {
|
|
14705
|
-
antd.message.error(error instanceof Error ? error.message :
|
|
15285
|
+
antd.message.error(error instanceof Error ? error.message : _34("Failed to save layout preferences."));
|
|
14706
15286
|
} finally {
|
|
14707
15287
|
setIsSavingLayoutPrefs(false);
|
|
14708
15288
|
}
|
|
@@ -14731,9 +15311,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14731
15311
|
if (!response.ok) {
|
|
14732
15312
|
throw new Error(`Save failed (${response.status})`);
|
|
14733
15313
|
}
|
|
14734
|
-
antd.message.success(
|
|
15314
|
+
antd.message.success(_34("Analyze preferences saved."));
|
|
14735
15315
|
} catch (error) {
|
|
14736
|
-
antd.message.error(error instanceof Error ? error.message :
|
|
15316
|
+
antd.message.error(error instanceof Error ? error.message : _34("Failed to save analyze preferences."));
|
|
14737
15317
|
} finally {
|
|
14738
15318
|
setIsSavingAnalyzePrefs(false);
|
|
14739
15319
|
}
|
|
@@ -14743,11 +15323,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14743
15323
|
const viewName = normalizeViewName(saveViewName || currentViewName);
|
|
14744
15324
|
const viewExists = availableViewNames.includes(viewName);
|
|
14745
15325
|
if (saveViewAsNew && viewExists) {
|
|
14746
|
-
antd.message.error(
|
|
15326
|
+
antd.message.error(_34("View name already exists. Choose a new name."));
|
|
14747
15327
|
return;
|
|
14748
15328
|
}
|
|
14749
15329
|
if (!saveViewAsNew && viewName !== currentViewName && viewExists) {
|
|
14750
|
-
antd.message.error(
|
|
15330
|
+
antd.message.error(_34('Choose a new name or enable "Save as new view".'));
|
|
14751
15331
|
return;
|
|
14752
15332
|
}
|
|
14753
15333
|
setSaveViewModalOpen(false);
|
|
@@ -14770,6 +15350,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14770
15350
|
}, [loadViewNames]);
|
|
14771
15351
|
React6.useEffect(() => {
|
|
14772
15352
|
if (!viewNamesLoaded) return;
|
|
15353
|
+
const viewChanged = prevViewNameForResetRef.current !== null && prevViewNameForResetRef.current !== currentViewName;
|
|
15354
|
+
prevViewNameForResetRef.current = currentViewName;
|
|
14773
15355
|
analyzePrefsTouchedRef.current = false;
|
|
14774
15356
|
layoutPrefsTouchedRef.current = false;
|
|
14775
15357
|
analyzePrefsLoadedRef.current = false;
|
|
@@ -14777,8 +15359,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14777
15359
|
setColumnsSelectorOpen(false);
|
|
14778
15360
|
setSaveViewName(currentViewName);
|
|
14779
15361
|
setSaveViewAsNew(false);
|
|
14780
|
-
|
|
14781
|
-
|
|
15362
|
+
if (viewChanged) {
|
|
15363
|
+
analyzeTouchedRef.current = false;
|
|
15364
|
+
resetLayoutDefaults();
|
|
15365
|
+
resetAnalyzeDefaults();
|
|
15366
|
+
}
|
|
14782
15367
|
}, [currentViewName, resetAnalyzeDefaults, resetLayoutDefaults, viewNamesLoaded]);
|
|
14783
15368
|
React6.useEffect(() => {
|
|
14784
15369
|
const resourceKey = prefsKey;
|
|
@@ -14945,7 +15530,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14945
15530
|
}
|
|
14946
15531
|
setAllRowsData(allRows2);
|
|
14947
15532
|
} catch (error) {
|
|
14948
|
-
setAllRowsError(error instanceof Error ? error.message :
|
|
15533
|
+
setAllRowsError(error instanceof Error ? error.message : _34("Failed to fetch all rows"));
|
|
14949
15534
|
} finally {
|
|
14950
15535
|
setIsAllRowsLoading(false);
|
|
14951
15536
|
setAllRowsLoaded(true);
|
|
@@ -14984,7 +15569,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
14984
15569
|
if (forRange) return { start: resolved.start?.toISOString(), end: resolved.end?.toISOString() };
|
|
14985
15570
|
return { date: resolved.date?.toISOString() };
|
|
14986
15571
|
}
|
|
14987
|
-
const date =
|
|
15572
|
+
const date = dayjs8__default.default(val?.date || val);
|
|
14988
15573
|
if (!date.isValid()) return {};
|
|
14989
15574
|
if (forRange) return { start: date.startOf("day").toISOString(), end: date.endOf("day").toISOString() };
|
|
14990
15575
|
return { date: date.startOf("day").toISOString() };
|
|
@@ -15040,7 +15625,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15040
15625
|
setFilters(combined, "replace");
|
|
15041
15626
|
}, [filterRules, hasActiveFilterRules, isClientFiltering, model.fields, setFilters, tableFilters]);
|
|
15042
15627
|
const formatCategoryValue = React6.useCallback((field, record) => {
|
|
15043
|
-
if (!field) return
|
|
15628
|
+
if (!field) return _34("All");
|
|
15044
15629
|
const raw = record?.[field.key];
|
|
15045
15630
|
if (raw === void 0 || raw === null) return "-";
|
|
15046
15631
|
if (field.key === "eid" && record?._label) return record._label;
|
|
@@ -15051,7 +15636,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15051
15636
|
if (field.options) {
|
|
15052
15637
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
15053
15638
|
}
|
|
15054
|
-
if (field.type === "boolean") return raw ?
|
|
15639
|
+
if (field.type === "boolean") return raw ? _34("Yes") : _34("No");
|
|
15055
15640
|
if (field.type === "date") return formatDateValue(raw);
|
|
15056
15641
|
if (field.type === "datetime") return formatDateTimeValue(raw) ?? String(raw);
|
|
15057
15642
|
if (field.type === "time") return formatTimeValue(raw);
|
|
@@ -15136,7 +15721,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15136
15721
|
const seriesLabels = numericFields.length > 0 ? numericFields.reduce((acc, field) => {
|
|
15137
15722
|
acc[field.key] = field.label;
|
|
15138
15723
|
return acc;
|
|
15139
|
-
}, { "__count__":
|
|
15724
|
+
}, { "__count__": _34("Count") }) : { "__count__": _34("Count") };
|
|
15140
15725
|
const baseGroups = Array.from(groupMap.values());
|
|
15141
15726
|
let groups = baseGroups;
|
|
15142
15727
|
if (rankingMode !== "none" && rankingFieldKey) {
|
|
@@ -15193,7 +15778,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15193
15778
|
} else if (field.options) {
|
|
15194
15779
|
label = field.options.find((o) => o.value === raw)?.label || String(raw);
|
|
15195
15780
|
} else if (field.type === "boolean") {
|
|
15196
|
-
label = raw ?
|
|
15781
|
+
label = raw ? _34("Yes") : _34("No");
|
|
15197
15782
|
} else if (field.type === "date") {
|
|
15198
15783
|
label = formatDateValue(raw);
|
|
15199
15784
|
} else if (field.type === "datetime") {
|
|
@@ -15255,13 +15840,13 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15255
15840
|
const getSummaryFunctionDisplayText = React6.useCallback((fn) => {
|
|
15256
15841
|
if (!fn) return "";
|
|
15257
15842
|
const labels = {
|
|
15258
|
-
sum:
|
|
15259
|
-
avg:
|
|
15260
|
-
count:
|
|
15261
|
-
max:
|
|
15262
|
-
min:
|
|
15263
|
-
stddev:
|
|
15264
|
-
distinct:
|
|
15843
|
+
sum: _34("Sum"),
|
|
15844
|
+
avg: _34("Average"),
|
|
15845
|
+
count: _34("Count"),
|
|
15846
|
+
max: _34("Max"),
|
|
15847
|
+
min: _34("Min"),
|
|
15848
|
+
stddev: _34("Std Dev"),
|
|
15849
|
+
distinct: _34("Distinct")
|
|
15265
15850
|
};
|
|
15266
15851
|
return labels[fn] || fn;
|
|
15267
15852
|
}, []);
|
|
@@ -15322,12 +15907,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15322
15907
|
`td-num-${item.key}`
|
|
15323
15908
|
)) })
|
|
15324
15909
|
] }) }),
|
|
15325
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: isTdFlipped ?
|
|
15910
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: isTdFlipped ? _34("Show totals") : _34("Show details"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15326
15911
|
antd.Button,
|
|
15327
15912
|
{
|
|
15328
15913
|
size: "small",
|
|
15329
15914
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SwapOutlined, { style: { transform: "rotate(90deg)" } }),
|
|
15330
|
-
"aria-label": isTdFlipped ?
|
|
15915
|
+
"aria-label": isTdFlipped ? _34("Show totals") : _34("Show details"),
|
|
15331
15916
|
onClick: () => setIsTdFlipped((prev) => !prev),
|
|
15332
15917
|
style: {
|
|
15333
15918
|
flexShrink: 0,
|
|
@@ -15402,7 +15987,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15402
15987
|
if (field.options) {
|
|
15403
15988
|
return field.options.find((option) => option.value === raw)?.label || String(raw);
|
|
15404
15989
|
}
|
|
15405
|
-
if (field.type === "boolean") return raw ?
|
|
15990
|
+
if (field.type === "boolean") return raw ? _34("Yes") : _34("No");
|
|
15406
15991
|
if (field.type === "date") return formatDateValue(raw);
|
|
15407
15992
|
if (field.type === "datetime") return formatDateTimeValue(raw) ?? String(raw);
|
|
15408
15993
|
if (field.type === "time") return formatTimeValue(raw);
|
|
@@ -15494,7 +16079,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15494
16079
|
const exportStatsPdf = () => {
|
|
15495
16080
|
openPdfWindow(`${model.name}-stats`, buildStatsHtml(statsSummary));
|
|
15496
16081
|
};
|
|
15497
|
-
const getRowKey = (record) => {
|
|
16082
|
+
const getRowKey = (record, index) => {
|
|
16083
|
+
if (model.isNamedQuery && index !== void 0) return String(index);
|
|
15498
16084
|
if (record?.eid !== void 0 && record?.eid !== null) return record.eid;
|
|
15499
16085
|
if (record?.id !== void 0 && record?.id !== null) return record.id;
|
|
15500
16086
|
if (relationConfig?.targetKey || relationConfig?.otherKey) {
|
|
@@ -15511,7 +16097,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15511
16097
|
if (relationConfig?.otherResource && relationConfig?.otherKey && record[relationConfig.otherKey]) {
|
|
15512
16098
|
return { resource: relationConfig.otherResource, id: record[relationConfig.otherKey], isLinkRow: true };
|
|
15513
16099
|
}
|
|
15514
|
-
const resourceName = model.resource || model.name;
|
|
16100
|
+
const resourceName = model.isNamedQuery && model.primaryResource ? model.primaryResource : model.resource || model.name;
|
|
15515
16101
|
const explicitPk = model.pkField ? record[model.pkField] : void 0;
|
|
15516
16102
|
const isPkField = model.fields?.find((f) => f.isPk)?.key;
|
|
15517
16103
|
const pkValue = explicitPk ?? (isPkField ? record[isPkField] : void 0) ?? record.eid ?? record.id ?? null;
|
|
@@ -15577,7 +16163,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15577
16163
|
for (const actionKey of apiActionKeys) {
|
|
15578
16164
|
if (actionKey === "__delete__") {
|
|
15579
16165
|
const resp = await authenticatedFetch(`${apiUrl}/${resource}/${id}`, { method: "DELETE" });
|
|
15580
|
-
if (!resp.ok) throw new Error(`${
|
|
16166
|
+
if (!resp.ok) throw new Error(`${_34("Delete failed for record")} ${id}`);
|
|
15581
16167
|
} else if (actionKey === "__change_field__") {
|
|
15582
16168
|
if (!bulkChangeFieldKey) continue;
|
|
15583
16169
|
const payload = { ...record, [bulkChangeFieldKey]: bulkChangeFieldValue };
|
|
@@ -15587,7 +16173,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15587
16173
|
headers: { "Content-Type": "application/json" },
|
|
15588
16174
|
body: JSON.stringify(payload)
|
|
15589
16175
|
});
|
|
15590
|
-
if (!resp.ok) throw new Error(`${
|
|
16176
|
+
if (!resp.ok) throw new Error(`${_34("Update failed for record")} ${id}`);
|
|
15591
16177
|
} else if (actionKey === "__clone__") {
|
|
15592
16178
|
const clonePayload = { ...record };
|
|
15593
16179
|
delete clonePayload.eid;
|
|
@@ -15599,7 +16185,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15599
16185
|
headers: { "Content-Type": "application/json" },
|
|
15600
16186
|
body: JSON.stringify(clonePayload)
|
|
15601
16187
|
});
|
|
15602
|
-
if (!resp.ok) throw new Error(`${
|
|
16188
|
+
if (!resp.ok) throw new Error(`${_34("Clone failed for record")} ${id}`);
|
|
15603
16189
|
} else if (actionKey === "__pin__") {
|
|
15604
16190
|
await authenticatedFetch(`${apiUrl}/dashboard/pinned-records`, {
|
|
15605
16191
|
method: "POST",
|
|
@@ -15618,11 +16204,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15618
16204
|
}
|
|
15619
16205
|
}
|
|
15620
16206
|
antd.message.success(
|
|
15621
|
-
|
|
16207
|
+
_34("Actions applied successfully to {count} rows").replace("{count}", String(records.length))
|
|
15622
16208
|
);
|
|
15623
16209
|
} catch (e) {
|
|
15624
16210
|
errorOccurred = true;
|
|
15625
|
-
antd.message.error(e?.message ||
|
|
16211
|
+
antd.message.error(e?.message || _34("Bulk action failed"));
|
|
15626
16212
|
} finally {
|
|
15627
16213
|
setIsBulkExecuting(false);
|
|
15628
16214
|
setBulkActionModalOpen(false);
|
|
@@ -15680,7 +16266,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15680
16266
|
antd.Table.SELECTION_NONE,
|
|
15681
16267
|
{
|
|
15682
16268
|
key: "select-all-filtered",
|
|
15683
|
-
text:
|
|
16269
|
+
text: _34("Select all filtered rows"),
|
|
15684
16270
|
onSelect: handleSelectAllFiltered
|
|
15685
16271
|
}
|
|
15686
16272
|
]
|
|
@@ -15689,19 +16275,19 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15689
16275
|
const bulkActionsAvailable = React6.useMemo(() => {
|
|
15690
16276
|
const opts = [];
|
|
15691
16277
|
if (canBulkEdit) {
|
|
15692
|
-
opts.push({ label:
|
|
16278
|
+
opts.push({ label: _34("Change field value"), value: "__change_field__" });
|
|
15693
16279
|
}
|
|
15694
|
-
opts.push({ label:
|
|
16280
|
+
opts.push({ label: _34("Export selected (CSV)"), value: "__export_csv__" });
|
|
15695
16281
|
if (canBulkEdit) {
|
|
15696
|
-
opts.push({ label:
|
|
16282
|
+
opts.push({ label: _34("Clone / Duplicate selected"), value: "__clone__" });
|
|
15697
16283
|
}
|
|
15698
16284
|
if (bulkActions && bulkActions.length > 0) {
|
|
15699
|
-
bulkActions.forEach((a) => opts.push({ label:
|
|
16285
|
+
bulkActions.forEach((a) => opts.push({ label: _34(a.label), value: a.key }));
|
|
15700
16286
|
}
|
|
15701
|
-
opts.push({ label:
|
|
15702
|
-
opts.push({ label:
|
|
16287
|
+
opts.push({ label: _34("Pin selected"), value: "__pin__" });
|
|
16288
|
+
opts.push({ label: _34("Unpin selected"), value: "__unpin__" });
|
|
15703
16289
|
if (canBulkDelete) {
|
|
15704
|
-
opts.push({ label:
|
|
16290
|
+
opts.push({ label: _34("Delete selected"), value: "__delete__" });
|
|
15705
16291
|
}
|
|
15706
16292
|
return opts;
|
|
15707
16293
|
}, [bulkActions, canBulkDelete, canBulkEdit]);
|
|
@@ -15718,9 +16304,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15718
16304
|
background: token.colorWarningBg,
|
|
15719
16305
|
border: `1px solid ${token.colorWarningBorder}`
|
|
15720
16306
|
}, children: [
|
|
15721
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 500, color: token.colorWarningText }, children: bulkSelectedRowKeys.length > 0 ?
|
|
16307
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 500, color: token.colorWarningText }, children: bulkSelectedRowKeys.length > 0 ? _34("{count} rows selected").replace("{count}", String(bulkSelectedRowKeys.length)) : _34("Select rows to associate") }),
|
|
15722
16308
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
15723
|
-
selectModeReturnTo && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: () => navigate(selectModeReturnTo), children:
|
|
16309
|
+
selectModeReturnTo && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: () => navigate(selectModeReturnTo), children: _34("Cancel") }),
|
|
15724
16310
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15725
16311
|
antd.Button,
|
|
15726
16312
|
{
|
|
@@ -15729,7 +16315,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15729
16315
|
disabled: bulkSelectedRowKeys.length === 0,
|
|
15730
16316
|
loading: selectModeAssociating,
|
|
15731
16317
|
onClick: handleAssociateSelected,
|
|
15732
|
-
children:
|
|
16318
|
+
children: _34("Associate selected")
|
|
15733
16319
|
}
|
|
15734
16320
|
)
|
|
15735
16321
|
] })
|
|
@@ -15745,7 +16331,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15745
16331
|
background: token.colorInfoBg,
|
|
15746
16332
|
border: `1px solid ${token.colorInfoBorder}`
|
|
15747
16333
|
}, children: [
|
|
15748
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 500 }, children:
|
|
16334
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 500 }, children: _34("{count} rows selected").replace("{count}", String(bulkSelectedRowKeys.length)) }),
|
|
15749
16335
|
bulkSelectedRowKeys.length < filteredTotalCount && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15750
16336
|
antd.Button,
|
|
15751
16337
|
{
|
|
@@ -15754,16 +16340,16 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15754
16340
|
loading: selectAllFilteredPending && isAllRowsLoading,
|
|
15755
16341
|
onClick: handleSelectAllFiltered,
|
|
15756
16342
|
style: { padding: 0 },
|
|
15757
|
-
children:
|
|
16343
|
+
children: _34("Select all {count} filtered rows").replace("{count}", String(filteredTotalCount))
|
|
15758
16344
|
}
|
|
15759
16345
|
),
|
|
15760
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "link", size: "small", onClick: clearBulkSelection, style: { padding: 0 }, children:
|
|
16346
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "link", size: "small", onClick: clearBulkSelection, style: { padding: 0 }, children: _34("Clear selection") }),
|
|
15761
16347
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, minWidth: 180 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15762
16348
|
antd.Select,
|
|
15763
16349
|
{
|
|
15764
16350
|
mode: "multiple",
|
|
15765
16351
|
size: "small",
|
|
15766
|
-
placeholder:
|
|
16352
|
+
placeholder: _34("Actions"),
|
|
15767
16353
|
style: { width: "100%" },
|
|
15768
16354
|
value: bulkActionsToApply,
|
|
15769
16355
|
onChange: (values) => {
|
|
@@ -15781,7 +16367,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15781
16367
|
antd.Select,
|
|
15782
16368
|
{
|
|
15783
16369
|
size: "small",
|
|
15784
|
-
placeholder:
|
|
16370
|
+
placeholder: _34("Select field"),
|
|
15785
16371
|
style: { minWidth: 160 },
|
|
15786
16372
|
value: bulkChangeFieldKey ?? void 0,
|
|
15787
16373
|
onChange: (v) => {
|
|
@@ -15796,7 +16382,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15796
16382
|
antd.Select,
|
|
15797
16383
|
{
|
|
15798
16384
|
size: "small",
|
|
15799
|
-
placeholder:
|
|
16385
|
+
placeholder: _34("Select value"),
|
|
15800
16386
|
style: { minWidth: 180 },
|
|
15801
16387
|
value: bulkChangeFieldValue ?? void 0,
|
|
15802
16388
|
onChange: (v) => setBulkChangeFieldValue(v),
|
|
@@ -15807,25 +16393,25 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15807
16393
|
antd.Select,
|
|
15808
16394
|
{
|
|
15809
16395
|
size: "small",
|
|
15810
|
-
placeholder:
|
|
16396
|
+
placeholder: _34("Select value"),
|
|
15811
16397
|
style: { minWidth: 120 },
|
|
15812
16398
|
value: bulkChangeFieldValue ?? void 0,
|
|
15813
16399
|
onChange: (v) => setBulkChangeFieldValue(v),
|
|
15814
|
-
options: [{ label:
|
|
16400
|
+
options: [{ label: _34("True"), value: true }, { label: _34("False"), value: false }],
|
|
15815
16401
|
allowClear: true
|
|
15816
16402
|
}
|
|
15817
16403
|
) : bulkChangeField.type === "date" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15818
16404
|
antd.DatePicker,
|
|
15819
16405
|
{
|
|
15820
16406
|
size: "small",
|
|
15821
|
-
value: bulkChangeFieldValue ?
|
|
16407
|
+
value: bulkChangeFieldValue ? dayjs8__default.default(bulkChangeFieldValue) : null,
|
|
15822
16408
|
onChange: (v) => setBulkChangeFieldValue(v ? v.toISOString() : null)
|
|
15823
16409
|
}
|
|
15824
16410
|
) : bulkChangeField.type === "number" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
15825
16411
|
antd.InputNumber,
|
|
15826
16412
|
{
|
|
15827
16413
|
size: "small",
|
|
15828
|
-
placeholder:
|
|
16414
|
+
placeholder: _34("Value"),
|
|
15829
16415
|
value: bulkChangeFieldValue,
|
|
15830
16416
|
onChange: (v) => setBulkChangeFieldValue(v),
|
|
15831
16417
|
style: { minWidth: 120 }
|
|
@@ -15834,7 +16420,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15834
16420
|
antd.Input,
|
|
15835
16421
|
{
|
|
15836
16422
|
size: "small",
|
|
15837
|
-
placeholder:
|
|
16423
|
+
placeholder: _34("Value"),
|
|
15838
16424
|
value: bulkChangeFieldValue ?? "",
|
|
15839
16425
|
onChange: (e) => setBulkChangeFieldValue(e.target.value),
|
|
15840
16426
|
style: { minWidth: 160 }
|
|
@@ -15848,7 +16434,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15848
16434
|
size: "small",
|
|
15849
16435
|
disabled: bulkActionsToApply.length === 0,
|
|
15850
16436
|
onClick: () => setBulkActionModalOpen(true),
|
|
15851
|
-
children:
|
|
16437
|
+
children: _34("Apply")
|
|
15852
16438
|
}
|
|
15853
16439
|
)
|
|
15854
16440
|
] }) : null;
|
|
@@ -15856,16 +16442,16 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15856
16442
|
antd.Modal,
|
|
15857
16443
|
{
|
|
15858
16444
|
open: bulkActionModalOpen,
|
|
15859
|
-
title:
|
|
16445
|
+
title: _34("Confirm bulk action"),
|
|
15860
16446
|
onCancel: () => {
|
|
15861
16447
|
if (!isBulkExecuting) setBulkActionModalOpen(false);
|
|
15862
16448
|
},
|
|
15863
16449
|
footer: [
|
|
15864
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => setBulkActionModalOpen(false), disabled: isBulkExecuting, children:
|
|
15865
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", loading: isBulkExecuting, onClick: executeBulkActions, children:
|
|
16450
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => setBulkActionModalOpen(false), disabled: isBulkExecuting, children: _34("Cancel") }, "cancel"),
|
|
16451
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", loading: isBulkExecuting, onClick: executeBulkActions, children: _34("Confirm") }, "ok")
|
|
15866
16452
|
],
|
|
15867
16453
|
children: [
|
|
15868
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { children:
|
|
16454
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: _34("You are about to apply the following actions to {count} rows:").replace("{count}", String(bulkSelectedRowKeys.length)) }),
|
|
15869
16455
|
/* @__PURE__ */ jsxRuntime.jsx("ul", { style: { paddingLeft: 20, marginBottom: 8 }, children: bulkActionsToApply.map((actionKey) => {
|
|
15870
16456
|
const label = bulkActionsAvailable.find((a) => a.value === actionKey)?.label ?? actionKey;
|
|
15871
16457
|
const extra = actionKey === "__change_field__" && bulkChangeField ? ` \u2192 ${bulkChangeField.label}: ${String(bulkChangeFieldValue ?? "")}` : "";
|
|
@@ -15881,7 +16467,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15881
16467
|
const listTitle = !isEmbedded ? renderModelHeading({
|
|
15882
16468
|
model,
|
|
15883
16469
|
title: modelDisplayLabel,
|
|
15884
|
-
actionLabel:
|
|
16470
|
+
actionLabel: _34("List"),
|
|
15885
16471
|
moduleLabel: model.module ? getModuleLabel(model.module) : void 0
|
|
15886
16472
|
}) : void 0;
|
|
15887
16473
|
const numericBarColor = modelTone.soft || token.colorPrimaryBg || "rgba(22, 119, 255, 0.16)";
|
|
@@ -15905,7 +16491,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15905
16491
|
items: selectedViewNames.map((name) => ({ key: name, label: renderToneTabLabel(name, modelTone) }))
|
|
15906
16492
|
}
|
|
15907
16493
|
) : null;
|
|
15908
|
-
const listToggleButton = /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16494
|
+
const listToggleButton = /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("View list"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15909
16495
|
antd.Button,
|
|
15910
16496
|
{
|
|
15911
16497
|
size: "small",
|
|
@@ -15916,7 +16502,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15916
16502
|
}
|
|
15917
16503
|
}
|
|
15918
16504
|
) });
|
|
15919
|
-
const exportButton = !isEmbedded ? /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16505
|
+
const exportButton = !isEmbedded ? /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Export CSV"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15920
16506
|
antd.Button,
|
|
15921
16507
|
{
|
|
15922
16508
|
size: "small",
|
|
@@ -15925,7 +16511,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15925
16511
|
loading: exportRequested && isAllRowsLoading
|
|
15926
16512
|
}
|
|
15927
16513
|
) }) : null;
|
|
15928
|
-
const columnsToggleButton = /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: columnsSelectorOpen ?
|
|
16514
|
+
const columnsToggleButton = /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: columnsSelectorOpen ? _34("Hide view configuration") : _34("Show view configuration"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15929
16515
|
antd.Button,
|
|
15930
16516
|
{
|
|
15931
16517
|
size: "small",
|
|
@@ -15937,10 +16523,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15937
16523
|
return next;
|
|
15938
16524
|
});
|
|
15939
16525
|
},
|
|
15940
|
-
"aria-label": columnsSelectorOpen ?
|
|
16526
|
+
"aria-label": columnsSelectorOpen ? _34("Hide view configuration") : _34("Show view configuration")
|
|
15941
16527
|
}
|
|
15942
16528
|
) });
|
|
15943
|
-
const createRelationButton = isRelationView && showCreate ? /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16529
|
+
const createRelationButton = isRelationView && showCreate ? /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Add relation"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15944
16530
|
antd.Button,
|
|
15945
16531
|
{
|
|
15946
16532
|
size: "small",
|
|
@@ -15956,7 +16542,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15956
16542
|
}
|
|
15957
16543
|
}
|
|
15958
16544
|
) }) : null;
|
|
15959
|
-
const associateExistingFkButton = isRelationView && showCreate && filter?.field && filter?.value !== void 0 && filter?.value !== null && !relationConfig?.otherKey ? /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16545
|
+
const associateExistingFkButton = isRelationView && showCreate && filter?.field && filter?.value !== void 0 && filter?.value !== null && !relationConfig?.otherKey ? /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Associate existing"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15960
16546
|
antd.Button,
|
|
15961
16547
|
{
|
|
15962
16548
|
size: "small",
|
|
@@ -15976,7 +16562,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15976
16562
|
}
|
|
15977
16563
|
}
|
|
15978
16564
|
) }) : null;
|
|
15979
|
-
const createNewAndRelateButton = isRelationView && showCreate && relationConfig?.otherResource && relationConfig?.otherKey && (relationConfig?.targetKey || filter?.field) && filter?.value !== void 0 && filter?.value !== null ? /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16565
|
+
const createNewAndRelateButton = isRelationView && showCreate && relationConfig?.otherResource && relationConfig?.otherKey && (relationConfig?.targetKey || filter?.field) && filter?.value !== void 0 && filter?.value !== null ? /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Create new and relate"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
15980
16566
|
antd.Button,
|
|
15981
16567
|
{
|
|
15982
16568
|
size: "small",
|
|
@@ -15992,7 +16578,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
15992
16578
|
const relatedModel = findModelByName(allModels, relationConfig?.otherResource || relationConfig?.otherResourcePath);
|
|
15993
16579
|
const relatedResource = relatedModel ? resolveResourcePath(relatedModel.resource || relatedModel.name, allModels) : null;
|
|
15994
16580
|
if (!relatedResource) {
|
|
15995
|
-
antd.message.warning(
|
|
16581
|
+
antd.message.warning(_34("No create route for the related model. Opening relation create form."));
|
|
15996
16582
|
params.append(targetKey, String(targetId));
|
|
15997
16583
|
const returnTo2 = `${location.pathname}${location.search}${location.hash}`;
|
|
15998
16584
|
if (returnTo2.startsWith("/")) params.append("returnTo", returnTo2);
|
|
@@ -16012,7 +16598,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16012
16598
|
const embeddedActionBar = isEmbedded ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "flex-end", gap: 8, marginBottom: 8 }, children: [
|
|
16013
16599
|
columnsToggleButton,
|
|
16014
16600
|
listToggleButton,
|
|
16015
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16601
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Analyze"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16016
16602
|
antd.Button,
|
|
16017
16603
|
{
|
|
16018
16604
|
size: "small",
|
|
@@ -16025,7 +16611,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16025
16611
|
}
|
|
16026
16612
|
}
|
|
16027
16613
|
) }),
|
|
16028
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16614
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Switch orientation"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16029
16615
|
antd.Button,
|
|
16030
16616
|
{
|
|
16031
16617
|
size: "small",
|
|
@@ -16036,7 +16622,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16036
16622
|
}
|
|
16037
16623
|
}
|
|
16038
16624
|
) }),
|
|
16039
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16625
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Switch positions"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16040
16626
|
antd.Button,
|
|
16041
16627
|
{
|
|
16042
16628
|
size: "small",
|
|
@@ -16047,7 +16633,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16047
16633
|
}
|
|
16048
16634
|
}
|
|
16049
16635
|
) }),
|
|
16050
|
-
resolvedLayoutPreferenceType && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16636
|
+
resolvedLayoutPreferenceType && /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Save layout"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16051
16637
|
antd.Button,
|
|
16052
16638
|
{
|
|
16053
16639
|
size: "small",
|
|
@@ -16059,7 +16645,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16059
16645
|
associateExistingFkButton,
|
|
16060
16646
|
createRelationButton,
|
|
16061
16647
|
createNewAndRelateButton,
|
|
16062
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16648
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Export CSV"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16063
16649
|
antd.Button,
|
|
16064
16650
|
{
|
|
16065
16651
|
size: "small",
|
|
@@ -16215,10 +16801,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16215
16801
|
if (calendarInitSignatureRef.current === signature) return;
|
|
16216
16802
|
calendarInitSignatureRef.current = signature;
|
|
16217
16803
|
if (calendarEarliestDateTs === null) {
|
|
16218
|
-
setCalendarAnchorDate(
|
|
16804
|
+
setCalendarAnchorDate(dayjs8__default.default().startOf(calendarMode));
|
|
16219
16805
|
return;
|
|
16220
16806
|
}
|
|
16221
|
-
setCalendarAnchorDate(
|
|
16807
|
+
setCalendarAnchorDate(dayjs8__default.default(calendarEarliestDateTs).startOf(calendarMode));
|
|
16222
16808
|
}, [calendarDateField, calendarEarliestDateTs, calendarMode, isCalendarView]);
|
|
16223
16809
|
const calendarEntriesByDate = React6.useMemo(() => {
|
|
16224
16810
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -16266,7 +16852,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16266
16852
|
};
|
|
16267
16853
|
const renderCalendarView = () => {
|
|
16268
16854
|
if (calendarDateFieldOptions.length === 0) {
|
|
16269
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description:
|
|
16855
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: _34("No date/datetime fields available for calendar view.") });
|
|
16270
16856
|
}
|
|
16271
16857
|
const selectedDateField = model.fields.find((field) => field.key === calendarDateField);
|
|
16272
16858
|
const selectedLabel = selectedDateField?.label || calendarDateField;
|
|
@@ -16280,8 +16866,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16280
16866
|
value: calendarMode,
|
|
16281
16867
|
onChange: (value) => setCalendarMode(value),
|
|
16282
16868
|
options: [
|
|
16283
|
-
{ label:
|
|
16284
|
-
{ label:
|
|
16869
|
+
{ label: _34("Monthly"), value: "month" },
|
|
16870
|
+
{ label: _34("Weekly"), value: "week" }
|
|
16285
16871
|
],
|
|
16286
16872
|
style: { minWidth: 120 }
|
|
16287
16873
|
}
|
|
@@ -16294,35 +16880,35 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16294
16880
|
onChange: (value) => setCalendarDateField(value),
|
|
16295
16881
|
options: calendarDateFieldOptions.map((field) => ({ label: field.label, value: field.key })),
|
|
16296
16882
|
style: { minWidth: 220 },
|
|
16297
|
-
placeholder:
|
|
16883
|
+
placeholder: _34("Date field")
|
|
16298
16884
|
}
|
|
16299
16885
|
)
|
|
16300
16886
|
] }),
|
|
16301
16887
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { size: 8, children: [
|
|
16302
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16888
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Previous"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16303
16889
|
antd.Button,
|
|
16304
16890
|
{
|
|
16305
16891
|
size: "small",
|
|
16306
16892
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeftOutlined, {}),
|
|
16307
|
-
"aria-label":
|
|
16893
|
+
"aria-label": _34("Previous"),
|
|
16308
16894
|
onClick: () => setCalendarAnchorDate((prev) => prev.subtract(1, calendarMode).startOf(calendarMode))
|
|
16309
16895
|
}
|
|
16310
16896
|
) }),
|
|
16311
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16897
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Today"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16312
16898
|
antd.Button,
|
|
16313
16899
|
{
|
|
16314
16900
|
size: "small",
|
|
16315
16901
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CalendarOutlined, {}),
|
|
16316
|
-
"aria-label":
|
|
16317
|
-
onClick: () => setCalendarAnchorDate(
|
|
16902
|
+
"aria-label": _34("Today"),
|
|
16903
|
+
onClick: () => setCalendarAnchorDate(dayjs8__default.default().startOf(calendarMode))
|
|
16318
16904
|
}
|
|
16319
16905
|
) }),
|
|
16320
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16906
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Next"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16321
16907
|
antd.Button,
|
|
16322
16908
|
{
|
|
16323
16909
|
size: "small",
|
|
16324
16910
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowRightOutlined, {}),
|
|
16325
|
-
"aria-label":
|
|
16911
|
+
"aria-label": _34("Next"),
|
|
16326
16912
|
onClick: () => setCalendarAnchorDate((prev) => prev.add(1, calendarMode).startOf(calendarMode))
|
|
16327
16913
|
}
|
|
16328
16914
|
) })
|
|
@@ -16363,7 +16949,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16363
16949
|
const dayKey = day.format("YYYY-MM-DD");
|
|
16364
16950
|
const entries = calendarEntriesByDate.get(dayKey) || [];
|
|
16365
16951
|
const isOutsideCurrentMonth = calendarMode === "month" && day.month() !== calendarAnchorDate.month();
|
|
16366
|
-
const isToday = day.isSame(
|
|
16952
|
+
const isToday = day.isSame(dayjs8__default.default(), "day");
|
|
16367
16953
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16368
16954
|
"div",
|
|
16369
16955
|
{
|
|
@@ -16407,20 +16993,20 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16407
16993
|
antd.Modal,
|
|
16408
16994
|
{
|
|
16409
16995
|
open: saveViewModalOpen,
|
|
16410
|
-
title:
|
|
16996
|
+
title: _34("Save view"),
|
|
16411
16997
|
onCancel: () => {
|
|
16412
16998
|
setSaveViewModalOpen(false);
|
|
16413
16999
|
setPendingSaveTarget(null);
|
|
16414
17000
|
},
|
|
16415
17001
|
onOk: handleConfirmSaveView,
|
|
16416
|
-
okText: pendingSaveTarget === "layout" ?
|
|
17002
|
+
okText: pendingSaveTarget === "layout" ? _34("Save layout") : _34("Save analyze"),
|
|
16417
17003
|
okButtonProps: { disabled: !pendingSaveTarget },
|
|
16418
17004
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
16419
17005
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16420
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17006
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("View name") }),
|
|
16421
17007
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Input, { value: saveViewName, onChange: (event) => setSaveViewName(event.target.value) })
|
|
16422
17008
|
] }),
|
|
16423
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children:
|
|
17009
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Checkbox, { checked: saveViewAsNew, onChange: (event) => setSaveViewAsNew(event.target.checked), children: _34("Save as new view") })
|
|
16424
17010
|
] })
|
|
16425
17011
|
}
|
|
16426
17012
|
),
|
|
@@ -16428,10 +17014,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16428
17014
|
antd.Modal,
|
|
16429
17015
|
{
|
|
16430
17016
|
open: renameViewModalOpen,
|
|
16431
|
-
title:
|
|
17017
|
+
title: _34("Rename view"),
|
|
16432
17018
|
onCancel: () => setRenameViewModalOpen(false),
|
|
16433
17019
|
onOk: handleRenameView,
|
|
16434
|
-
okText:
|
|
17020
|
+
okText: _34("Rename"),
|
|
16435
17021
|
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { value: renameViewName, onChange: (event) => setRenameViewName(event.target.value) })
|
|
16436
17022
|
}
|
|
16437
17023
|
),
|
|
@@ -16441,7 +17027,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16441
17027
|
{
|
|
16442
17028
|
size: "small",
|
|
16443
17029
|
title: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, flexWrap: "wrap" }, children: [
|
|
16444
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
17030
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _34("Filters") }),
|
|
16445
17031
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center", gap: 8, flex: 1, justifyContent: "flex-end" }, children: !filtersCollapsed && searchField && /* @__PURE__ */ jsxRuntime.jsx(
|
|
16446
17032
|
antd.Form,
|
|
16447
17033
|
{
|
|
@@ -16455,7 +17041,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16455
17041
|
}
|
|
16456
17042
|
searchFormProps.onFinish?.(values);
|
|
16457
17043
|
},
|
|
16458
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: "q", style: { marginBottom: 0, width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { placeholder:
|
|
17044
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: "q", style: { marginBottom: 0, width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { placeholder: _34("Search all fields..."), prefix: /* @__PURE__ */ jsxRuntime.jsx(icons.SearchOutlined, {}), allowClear: true, style: { width: "100%" } }) })
|
|
16459
17045
|
}
|
|
16460
17046
|
) })
|
|
16461
17047
|
] }),
|
|
@@ -16468,31 +17054,31 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16468
17054
|
antd.Card,
|
|
16469
17055
|
{
|
|
16470
17056
|
size: "small",
|
|
16471
|
-
title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
17057
|
+
title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _34("View configuration") }),
|
|
16472
17058
|
style: { marginBottom: 16 },
|
|
16473
17059
|
styles: { body: { display: "grid", gap: 12 } },
|
|
16474
17060
|
children: [
|
|
16475
17061
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
16476
17062
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 8 }, children: [
|
|
16477
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
16478
|
-
filterRules.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children:
|
|
17063
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _34("Advanced filters") }),
|
|
17064
|
+
filterRules.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children: _34("No filters yet.") }) : filterRules.map((rule) => {
|
|
16479
17065
|
const field = model.fields.find((f) => f.key === rule.fieldKey);
|
|
16480
17066
|
const type = field?.type || "string";
|
|
16481
17067
|
const operatorOptions = type === "number" ? [
|
|
16482
|
-
{ label:
|
|
16483
|
-
{ label:
|
|
16484
|
-
{ label:
|
|
16485
|
-
{ label:
|
|
16486
|
-
{ label:
|
|
16487
|
-
{ label:
|
|
17068
|
+
{ label: _34("="), value: "eq" },
|
|
17069
|
+
{ label: _34(">"), value: "gt" },
|
|
17070
|
+
{ label: _34(">="), value: "gte" },
|
|
17071
|
+
{ label: _34("<"), value: "lt" },
|
|
17072
|
+
{ label: _34("<="), value: "lte" },
|
|
17073
|
+
{ label: _34("Between"), value: "between" }
|
|
16488
17074
|
] : type === "date" ? [
|
|
16489
|
-
{ label:
|
|
16490
|
-
{ label:
|
|
16491
|
-
{ label:
|
|
16492
|
-
{ label:
|
|
16493
|
-
] : type === "boolean" ? [{ label:
|
|
16494
|
-
{ label:
|
|
16495
|
-
{ label:
|
|
17075
|
+
{ label: _34("On"), value: "on" },
|
|
17076
|
+
{ label: _34("After"), value: "after" },
|
|
17077
|
+
{ label: _34("Before"), value: "before" },
|
|
17078
|
+
{ label: _34("Between"), value: "between" }
|
|
17079
|
+
] : type === "boolean" ? [{ label: _34("Is"), value: "is" }] : [
|
|
17080
|
+
{ label: _34("Contains"), value: "contains" },
|
|
17081
|
+
{ label: _34("Equals"), value: "equals" }
|
|
16496
17082
|
];
|
|
16497
17083
|
const renderDateInput = (value, onChange) => {
|
|
16498
17084
|
const mode = value?.mode || "absolute";
|
|
@@ -16505,9 +17091,9 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16505
17091
|
value: value?.direction || "next",
|
|
16506
17092
|
onChange: (val) => onChange({ ...value, mode: "relative", direction: val }),
|
|
16507
17093
|
options: [
|
|
16508
|
-
{ label:
|
|
16509
|
-
{ label:
|
|
16510
|
-
{ label:
|
|
17094
|
+
{ label: _34("Previous"), value: "previous" },
|
|
17095
|
+
{ label: _34("Current"), value: "current" },
|
|
17096
|
+
{ label: _34("Next"), value: "next" }
|
|
16511
17097
|
]
|
|
16512
17098
|
}
|
|
16513
17099
|
),
|
|
@@ -16517,11 +17103,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16517
17103
|
value: value?.unit || "weeks",
|
|
16518
17104
|
onChange: (val) => onChange({ ...value, mode: "relative", unit: val }),
|
|
16519
17105
|
options: [
|
|
16520
|
-
{ label:
|
|
16521
|
-
{ label:
|
|
16522
|
-
{ label:
|
|
16523
|
-
{ label:
|
|
16524
|
-
{ label:
|
|
17106
|
+
{ label: _34("Days"), value: "days" },
|
|
17107
|
+
{ label: _34("Weeks"), value: "weeks" },
|
|
17108
|
+
{ label: _34("Months"), value: "months" },
|
|
17109
|
+
{ label: _34("Quarters"), value: "quarters" },
|
|
17110
|
+
{ label: _34("Years"), value: "years" }
|
|
16525
17111
|
]
|
|
16526
17112
|
}
|
|
16527
17113
|
)
|
|
@@ -16530,7 +17116,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16530
17116
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16531
17117
|
antd.DatePicker,
|
|
16532
17118
|
{
|
|
16533
|
-
value: value?.date ?
|
|
17119
|
+
value: value?.date ? dayjs8__default.default(value.date) : void 0,
|
|
16534
17120
|
onChange: (val) => onChange({ mode: "absolute", date: val ? val.toISOString() : null })
|
|
16535
17121
|
}
|
|
16536
17122
|
);
|
|
@@ -16543,7 +17129,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16543
17129
|
value: rule.fieldKey,
|
|
16544
17130
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, fieldKey: value, operator: void 0, value: void 0, value2: void 0 } : item)),
|
|
16545
17131
|
options: model.fields.map((f) => ({ label: f.label, value: f.key })),
|
|
16546
|
-
placeholder:
|
|
17132
|
+
placeholder: _34("Field")
|
|
16547
17133
|
}
|
|
16548
17134
|
),
|
|
16549
17135
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16553,7 +17139,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16553
17139
|
value: rule.operator,
|
|
16554
17140
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, operator: value } : item)),
|
|
16555
17141
|
options: operatorOptions,
|
|
16556
|
-
placeholder:
|
|
17142
|
+
placeholder: _34("Operator")
|
|
16557
17143
|
}
|
|
16558
17144
|
),
|
|
16559
17145
|
type === "number" && rule.operator === "between" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -16586,10 +17172,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16586
17172
|
value: rule.value,
|
|
16587
17173
|
onChange: (value) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value } : item)),
|
|
16588
17174
|
options: [
|
|
16589
|
-
{ label:
|
|
16590
|
-
{ label:
|
|
17175
|
+
{ label: _34("True"), value: true },
|
|
17176
|
+
{ label: _34("False"), value: false }
|
|
16591
17177
|
],
|
|
16592
|
-
placeholder:
|
|
17178
|
+
placeholder: _34("Value")
|
|
16593
17179
|
}
|
|
16594
17180
|
),
|
|
16595
17181
|
type === "date" && rule.operator === "between" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -16602,7 +17188,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16602
17188
|
{
|
|
16603
17189
|
value: rule.value,
|
|
16604
17190
|
onChange: (event) => setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: event.target.value } : item)),
|
|
16605
|
-
placeholder:
|
|
17191
|
+
placeholder: _34("Value"),
|
|
16606
17192
|
style: { minWidth: 200 }
|
|
16607
17193
|
}
|
|
16608
17194
|
),
|
|
@@ -16615,8 +17201,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16615
17201
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value: { ...item.value || {}, mode: val } } : item));
|
|
16616
17202
|
},
|
|
16617
17203
|
options: [
|
|
16618
|
-
{ label:
|
|
16619
|
-
{ label:
|
|
17204
|
+
{ label: _34("Date"), value: "absolute" },
|
|
17205
|
+
{ label: _34("Relative"), value: "relative" }
|
|
16620
17206
|
]
|
|
16621
17207
|
}
|
|
16622
17208
|
),
|
|
@@ -16629,8 +17215,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16629
17215
|
setFilterRules((prev) => prev.map((item) => item.id === rule.id ? { ...item, value2: { ...item.value2 || {}, mode: val } } : item));
|
|
16630
17216
|
},
|
|
16631
17217
|
options: [
|
|
16632
|
-
{ label:
|
|
16633
|
-
{ label:
|
|
17218
|
+
{ label: _34("Date"), value: "absolute" },
|
|
17219
|
+
{ label: _34("Relative"), value: "relative" }
|
|
16634
17220
|
]
|
|
16635
17221
|
}
|
|
16636
17222
|
),
|
|
@@ -16640,7 +17226,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16640
17226
|
size: "small",
|
|
16641
17227
|
danger: true,
|
|
16642
17228
|
onClick: () => setFilterRules((prev) => prev.filter((item) => item.id !== rule.id)),
|
|
16643
|
-
children:
|
|
17229
|
+
children: _34("Remove")
|
|
16644
17230
|
}
|
|
16645
17231
|
)
|
|
16646
17232
|
] }, rule.id);
|
|
@@ -16652,14 +17238,14 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16652
17238
|
size: "small",
|
|
16653
17239
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.FilterOutlined, {}),
|
|
16654
17240
|
onClick: () => setFilterRules((prev) => [...prev, { id: `${Date.now()}-${Math.random()}` }]),
|
|
16655
|
-
children:
|
|
17241
|
+
children: _34("Add Filter")
|
|
16656
17242
|
}
|
|
16657
17243
|
),
|
|
16658
|
-
filterRules.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: () => setFilterRules([]), children:
|
|
17244
|
+
filterRules.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: () => setFilterRules([]), children: _34("Clear filters") })
|
|
16659
17245
|
] })
|
|
16660
17246
|
] }),
|
|
16661
17247
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
16662
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
17248
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _34("Views shown") }),
|
|
16663
17249
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16664
17250
|
antd.Select,
|
|
16665
17251
|
{
|
|
@@ -16680,12 +17266,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16680
17266
|
),
|
|
16681
17267
|
selectedViewNames.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "grid", gap: 6 }, children: selectedViewNames.map((name, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
16682
17268
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: name }),
|
|
16683
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16684
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17269
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Move up"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowUpOutlined, {}), disabled: index === 0, onClick: () => moveSelectedView(name, "up") }) }),
|
|
17270
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Move down"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowDownOutlined, {}), disabled: index === selectedViewNames.length - 1, onClick: () => moveSelectedView(name, "down") }) })
|
|
16685
17271
|
] }, name)) })
|
|
16686
17272
|
] }),
|
|
16687
17273
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 6 }, children: [
|
|
16688
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children:
|
|
17274
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, fontWeight: 600 }, children: _34("Active view") }),
|
|
16689
17275
|
viewSelector
|
|
16690
17276
|
] }),
|
|
16691
17277
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 8 }, children: [
|
|
@@ -16697,7 +17283,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16697
17283
|
setRenameViewName(currentViewName);
|
|
16698
17284
|
setRenameViewModalOpen(true);
|
|
16699
17285
|
},
|
|
16700
|
-
children:
|
|
17286
|
+
children: _34("Rename view")
|
|
16701
17287
|
}
|
|
16702
17288
|
),
|
|
16703
17289
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16708,7 +17294,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16708
17294
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
16709
17295
|
disabled: availableViewNames.length <= 1,
|
|
16710
17296
|
onClick: confirmDeleteView,
|
|
16711
|
-
children:
|
|
17297
|
+
children: _34("Delete view")
|
|
16712
17298
|
}
|
|
16713
17299
|
),
|
|
16714
17300
|
resolvedLayoutPreferenceType && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16718,7 +17304,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16718
17304
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SaveOutlined, {}),
|
|
16719
17305
|
onClick: () => openSaveViewModalFor("layout"),
|
|
16720
17306
|
loading: isSavingLayoutPrefs,
|
|
16721
|
-
children:
|
|
17307
|
+
children: _34("Save layout")
|
|
16722
17308
|
}
|
|
16723
17309
|
),
|
|
16724
17310
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16730,7 +17316,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16730
17316
|
markLayoutPrefsTouched();
|
|
16731
17317
|
setFiltersCollapsed((prev) => !prev);
|
|
16732
17318
|
},
|
|
16733
|
-
children: filtersCollapsed ?
|
|
17319
|
+
children: filtersCollapsed ? _34("Show Filters") : _34("Hide Filters")
|
|
16734
17320
|
}
|
|
16735
17321
|
),
|
|
16736
17322
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16744,7 +17330,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16744
17330
|
setIsStatsFlipped(false);
|
|
16745
17331
|
setAnalyzeOpen((prev) => !prev);
|
|
16746
17332
|
},
|
|
16747
|
-
children:
|
|
17333
|
+
children: _34("Analyze")
|
|
16748
17334
|
}
|
|
16749
17335
|
),
|
|
16750
17336
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16756,7 +17342,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16756
17342
|
markLayoutPrefsTouched();
|
|
16757
17343
|
setIsAnalyzeVertical((prev) => !prev);
|
|
16758
17344
|
},
|
|
16759
|
-
children:
|
|
17345
|
+
children: _34("Switch orientation")
|
|
16760
17346
|
}
|
|
16761
17347
|
),
|
|
16762
17348
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16768,21 +17354,21 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16768
17354
|
markLayoutPrefsTouched();
|
|
16769
17355
|
setIsAnalyzeFirst((prev) => !prev);
|
|
16770
17356
|
},
|
|
16771
|
-
children:
|
|
17357
|
+
children: _34("Switch positions")
|
|
16772
17358
|
}
|
|
16773
17359
|
)
|
|
16774
17360
|
] })
|
|
16775
17361
|
] }),
|
|
16776
17362
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 12 }, children: [
|
|
16777
17363
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12 }, children: [
|
|
16778
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children:
|
|
17364
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: token.colorTextSecondary, fontSize: 12, fontWeight: 600 }, children: _34("Columns") }),
|
|
16779
17365
|
selectedColumnKeys && selectedColumnKeys.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", onClick: () => {
|
|
16780
17366
|
setSelectedColumnKeys(null);
|
|
16781
17367
|
setColumnOrder(null);
|
|
16782
|
-
}, children:
|
|
17368
|
+
}, children: _34("Reset to default") })
|
|
16783
17369
|
] }),
|
|
16784
17370
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16785
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
17371
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _34("Select columns") }),
|
|
16786
17372
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16787
17373
|
antd.Checkbox.Group,
|
|
16788
17374
|
{
|
|
@@ -16794,27 +17380,27 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16794
17380
|
(!selectedColumnKeys || selectedColumnKeys.length === 0) && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginTop: 6 }, children: "Using default columns. Select fields to customize." })
|
|
16795
17381
|
] }),
|
|
16796
17382
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16797
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
16798
|
-
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
17383
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _34("Column order") }),
|
|
17384
|
+
orderedSelectedColumns.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _34("No custom order yet.") }) : orderedSelectedColumns.map((key, index) => {
|
|
16799
17385
|
const field = model.fields.find((item) => item.key === key);
|
|
16800
17386
|
if (!field) return null;
|
|
16801
17387
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
16802
17388
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
16803
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
16804
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17389
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Move left"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeftOutlined, {}), disabled: index === 0, onClick: () => moveColumnOrder(key, "left") }) }),
|
|
17390
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Move right"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowRightOutlined, {}), disabled: index === orderedSelectedColumns.length - 1, onClick: () => moveColumnOrder(key, "right") }) })
|
|
16805
17391
|
] }, key);
|
|
16806
17392
|
})
|
|
16807
17393
|
] }),
|
|
16808
17394
|
isTotalsDetailsView && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
16809
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children:
|
|
16810
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "grid", gap: 6 }, children: totalsSummaryConfigFields.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
17395
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 6 }, children: _34("Totals summary function") }),
|
|
17396
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "grid", gap: 6 }, children: totalsSummaryConfigFields.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _34("No numeric fields available.") }) : totalsSummaryConfigFields.map((field) => {
|
|
16811
17397
|
const options = [
|
|
16812
|
-
{ label:
|
|
16813
|
-
{ label:
|
|
16814
|
-
{ label:
|
|
16815
|
-
{ label:
|
|
16816
|
-
{ label:
|
|
16817
|
-
{ label:
|
|
17398
|
+
{ label: _34("Sum"), value: "sum" },
|
|
17399
|
+
{ label: _34("Average"), value: "avg" },
|
|
17400
|
+
{ label: _34("Count"), value: "count" },
|
|
17401
|
+
{ label: _34("Max"), value: "max" },
|
|
17402
|
+
{ label: _34("Min"), value: "min" },
|
|
17403
|
+
{ label: _34("Std Dev"), value: "stddev" }
|
|
16818
17404
|
];
|
|
16819
17405
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
16820
17406
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: field.label }),
|
|
@@ -16842,7 +17428,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16842
17428
|
listVisible && /* @__PURE__ */ jsxRuntime.jsx("div", { style: listContainerStyle, children: isCalendarView ? renderCalendarView() : isGalleryView ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16843
17429
|
galleryRows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: 6, color: "#bfbfbf", fontSize: 12 }, children: [
|
|
16844
17430
|
/* @__PURE__ */ jsxRuntime.jsx(icons.FileTextOutlined, { style: { fontSize: 16 } }),
|
|
16845
|
-
|
|
17431
|
+
_34("No images available")
|
|
16846
17432
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 16 }, children: galleryRows.map((record) => renderGalleryItem(record)) }),
|
|
16847
17433
|
galleryPaginationProps && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 12, display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Pagination, { ...galleryPaginationProps }) })
|
|
16848
17434
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -16911,7 +17497,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16911
17497
|
dataIndex: field.key,
|
|
16912
17498
|
title: field.label,
|
|
16913
17499
|
sorter: { compare: (a, b) => compareSortValues(field, a, b), multiple: getSortPriority(columnSort, field.key) },
|
|
16914
|
-
align: field.type === "number" && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
17500
|
+
align: field.type === "number" && !field.reference && !["eid", "eid_from", "eid_to"].includes(field.key) ? "right" : void 0,
|
|
16915
17501
|
filters: columnFilters.get(field.key),
|
|
16916
17502
|
filteredValue: columnFiltersSelected[field.key] || null,
|
|
16917
17503
|
sortOrder: columnSort.find((item) => item.fieldKey === field.key)?.order ?? null,
|
|
@@ -16971,6 +17557,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
16971
17557
|
render: (value, record) => {
|
|
16972
17558
|
const { resource, id } = getTargetInfo(record);
|
|
16973
17559
|
const renderValue = () => {
|
|
17560
|
+
const showToken = normalizeFieldViewType(field.showViewType || "");
|
|
17561
|
+
if (showToken && !(showToken === "read-only-field" && field.reference)) {
|
|
17562
|
+
return renderFieldValue(field, record, allModels, true);
|
|
17563
|
+
}
|
|
16974
17564
|
if (field.reference && value && hasReferenceModel(field.reference, allModels)) {
|
|
16975
17565
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16976
17566
|
ReferenceField,
|
|
@@ -17019,17 +17609,17 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17019
17609
|
showActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
17020
17610
|
antd.Table.Column,
|
|
17021
17611
|
{
|
|
17022
|
-
title:
|
|
17612
|
+
title: _34("Actions"),
|
|
17023
17613
|
width: 140,
|
|
17024
17614
|
render: (_unused, record) => {
|
|
17025
17615
|
const { resource, id, isLinkRow } = getTargetInfo(record);
|
|
17026
|
-
if (!id || !resource) return /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: `${
|
|
17616
|
+
if (!id || !resource) return /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: `${_34("Debug: Cannot find target")}. ID: ${id}, Resource: ${resource}. Keys: ${Object.keys(record).join(",")}`, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", danger: true, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BugOutlined, {}) }) });
|
|
17027
17617
|
const deleteResource = isLinkRow ? model.name : resource;
|
|
17028
17618
|
const deleteId = isLinkRow && relationConfig?.targetKey && relationConfig?.otherKey ? `${record[relationConfig.targetKey]}:${record[relationConfig.otherKey]}` : id;
|
|
17029
17619
|
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
17030
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17031
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17032
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17620
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("View"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EyeOutlined, {}), onClick: () => go({ to: { resource, action: "show", id } }) }) }),
|
|
17621
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Edit"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EditOutlined, {}), onClick: () => go({ to: { resource, action: "edit", id } }) }) }),
|
|
17622
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Delete"), children: /* @__PURE__ */ jsxRuntime.jsx(antd$1.DeleteButton, { hideText: true, size: "small", recordItemId: deleteId, resource: deleteResource }) })
|
|
17033
17623
|
] });
|
|
17034
17624
|
}
|
|
17035
17625
|
},
|
|
@@ -17043,7 +17633,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17043
17633
|
antd.Card,
|
|
17044
17634
|
{
|
|
17045
17635
|
size: "small",
|
|
17046
|
-
title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: modelTone.text, fontWeight: 600 }, children:
|
|
17636
|
+
title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: modelTone.text, fontWeight: 600 }, children: _34("Analyze") }),
|
|
17047
17637
|
styles: {
|
|
17048
17638
|
header: {
|
|
17049
17639
|
background: `linear-gradient(135deg, ${modelTone.solid}18 0%, ${modelTone.solid}0a 100%)`
|
|
@@ -17072,10 +17662,10 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17072
17662
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
17073
17663
|
children: [
|
|
17074
17664
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "absolute", top: 0, right: 0, display: "flex", gap: 8 }, children: [
|
|
17075
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17076
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17077
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17078
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17665
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Save preferences"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SaveOutlined, {}), onClick: () => openSaveViewModalFor("analyze"), loading: isSavingAnalyzePrefs }) }),
|
|
17666
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Stats"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.FileTextOutlined, {}), onClick: () => setIsStatsFlipped(true) }) }),
|
|
17667
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Export chart PDF"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.FilePdfOutlined, {}), onClick: exportChartPdf }) }),
|
|
17668
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Export chart PNG"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: exportChartImage, "aria-label": _34("Export chart") }) })
|
|
17079
17669
|
] }),
|
|
17080
17670
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17081
17671
|
AnalysisChart,
|
|
@@ -17106,11 +17696,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17106
17696
|
items: [
|
|
17107
17697
|
{
|
|
17108
17698
|
key: "configure-chart",
|
|
17109
|
-
label:
|
|
17699
|
+
label: _34("Customize chart"),
|
|
17110
17700
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
17111
17701
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 16, flexWrap: "wrap" }, children: [
|
|
17112
17702
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
17113
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17703
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Category 1") }),
|
|
17114
17704
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17115
17705
|
antd.Select,
|
|
17116
17706
|
{
|
|
@@ -17121,12 +17711,12 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17121
17711
|
},
|
|
17122
17712
|
style: { width: "100%" },
|
|
17123
17713
|
options: categoricalFields.map((field) => ({ label: field.label, value: field.key })),
|
|
17124
|
-
placeholder:
|
|
17714
|
+
placeholder: _34("Select category")
|
|
17125
17715
|
}
|
|
17126
17716
|
)
|
|
17127
17717
|
] }),
|
|
17128
17718
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 220, flex: 1 }, children: [
|
|
17129
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17719
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Category 2") }),
|
|
17130
17720
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17131
17721
|
antd.Select,
|
|
17132
17722
|
{
|
|
@@ -17137,14 +17727,14 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17137
17727
|
},
|
|
17138
17728
|
style: { width: "100%" },
|
|
17139
17729
|
options: [
|
|
17140
|
-
{ label:
|
|
17730
|
+
{ label: _34("None"), value: "__none__" },
|
|
17141
17731
|
...categoricalFields.filter((field) => field.key !== categoryField1).map((field) => ({ label: field.label, value: field.key }))
|
|
17142
17732
|
]
|
|
17143
17733
|
}
|
|
17144
17734
|
)
|
|
17145
17735
|
] }),
|
|
17146
17736
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 160 }, children: [
|
|
17147
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17737
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Chart Type") }),
|
|
17148
17738
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17149
17739
|
antd.Select,
|
|
17150
17740
|
{
|
|
@@ -17155,30 +17745,30 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17155
17745
|
},
|
|
17156
17746
|
style: { width: "100%" },
|
|
17157
17747
|
options: [
|
|
17158
|
-
{ label:
|
|
17159
|
-
{ label:
|
|
17160
|
-
{ label:
|
|
17161
|
-
{ label:
|
|
17162
|
-
{ label:
|
|
17163
|
-
{ label:
|
|
17164
|
-
{ label:
|
|
17165
|
-
{ label:
|
|
17166
|
-
{ label:
|
|
17167
|
-
{ label:
|
|
17168
|
-
{ label:
|
|
17169
|
-
{ label:
|
|
17170
|
-
{ label:
|
|
17171
|
-
{ label:
|
|
17172
|
-
{ label:
|
|
17173
|
-
{ label:
|
|
17174
|
-
{ label:
|
|
17175
|
-
{ label:
|
|
17748
|
+
{ label: _34("Area"), value: "area" },
|
|
17749
|
+
{ label: _34("Horizontal Area"), value: "area-horizontal" },
|
|
17750
|
+
{ label: _34("Bars"), value: "bar" },
|
|
17751
|
+
{ label: _34("Stacked Bars"), value: "stacked" },
|
|
17752
|
+
{ label: _34("Horizontal Bars"), value: "bar-horizontal" },
|
|
17753
|
+
{ label: _34("Horizontal Stacked"), value: "stacked-horizontal" },
|
|
17754
|
+
{ label: _34("Lines"), value: "line" },
|
|
17755
|
+
{ label: _34("Pie"), value: "pie" },
|
|
17756
|
+
{ label: _34("Donut"), value: "donut" },
|
|
17757
|
+
{ label: _34("Scatter"), value: "scatter" },
|
|
17758
|
+
{ label: _34("Bubble"), value: "bubble" },
|
|
17759
|
+
{ label: _34("Histogram"), value: "histogram" },
|
|
17760
|
+
{ label: _34("Box Plot"), value: "box" },
|
|
17761
|
+
{ label: _34("Waterfall"), value: "waterfall" },
|
|
17762
|
+
{ label: _34("Heatmap"), value: "heatmap" },
|
|
17763
|
+
{ label: _34("Crosstab"), value: "crosstab" },
|
|
17764
|
+
{ label: _34("Radar"), value: "radar" },
|
|
17765
|
+
{ label: _34("Combo (Bar + Line)"), value: "combo" }
|
|
17176
17766
|
]
|
|
17177
17767
|
}
|
|
17178
17768
|
)
|
|
17179
17769
|
] }),
|
|
17180
17770
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 200 }, children: [
|
|
17181
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17771
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Summary") }),
|
|
17182
17772
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17183
17773
|
antd.Select,
|
|
17184
17774
|
{
|
|
@@ -17189,18 +17779,18 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17189
17779
|
},
|
|
17190
17780
|
style: { width: "100%" },
|
|
17191
17781
|
options: [
|
|
17192
|
-
{ label:
|
|
17193
|
-
{ label:
|
|
17194
|
-
{ label:
|
|
17195
|
-
{ label:
|
|
17196
|
-
{ label:
|
|
17197
|
-
{ label:
|
|
17782
|
+
{ label: _34("Sum"), value: "sum" },
|
|
17783
|
+
{ label: _34("Average"), value: "avg" },
|
|
17784
|
+
{ label: _34("Count"), value: "count" },
|
|
17785
|
+
{ label: _34("Max"), value: "max" },
|
|
17786
|
+
{ label: _34("Min"), value: "min" },
|
|
17787
|
+
{ label: _34("Std Dev"), value: "stddev" }
|
|
17198
17788
|
]
|
|
17199
17789
|
}
|
|
17200
17790
|
)
|
|
17201
17791
|
] }),
|
|
17202
17792
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 180 }, children: [
|
|
17203
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17793
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Ranking Filter") }),
|
|
17204
17794
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17205
17795
|
antd.Select,
|
|
17206
17796
|
{
|
|
@@ -17211,15 +17801,15 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17211
17801
|
},
|
|
17212
17802
|
style: { width: "100%" },
|
|
17213
17803
|
options: [
|
|
17214
|
-
{ label:
|
|
17215
|
-
{ label:
|
|
17216
|
-
{ label:
|
|
17804
|
+
{ label: _34("None"), value: "none" },
|
|
17805
|
+
{ label: _34("Top N"), value: "top" },
|
|
17806
|
+
{ label: _34("Bottom N"), value: "bottom" }
|
|
17217
17807
|
]
|
|
17218
17808
|
}
|
|
17219
17809
|
)
|
|
17220
17810
|
] }),
|
|
17221
17811
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 220 }, children: [
|
|
17222
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17812
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("Ranking Column") }),
|
|
17223
17813
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17224
17814
|
antd.Select,
|
|
17225
17815
|
{
|
|
@@ -17230,13 +17820,13 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17230
17820
|
},
|
|
17231
17821
|
style: { width: "100%" },
|
|
17232
17822
|
options: numericFields.map((field) => ({ label: field.label, value: field.key })),
|
|
17233
|
-
placeholder:
|
|
17823
|
+
placeholder: _34("Select numeric column"),
|
|
17234
17824
|
disabled: rankingMode === "none" || numericFields.length === 0
|
|
17235
17825
|
}
|
|
17236
17826
|
)
|
|
17237
17827
|
] }),
|
|
17238
17828
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 120 }, children: [
|
|
17239
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children:
|
|
17829
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary, marginBottom: 4 }, children: _34("N") }),
|
|
17240
17830
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17241
17831
|
antd.InputNumber,
|
|
17242
17832
|
{
|
|
@@ -17255,8 +17845,8 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17255
17845
|
] }),
|
|
17256
17846
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
17257
17847
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12, marginBottom: 6 }, children: [
|
|
17258
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children:
|
|
17259
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17848
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: token.colorTextSecondary }, children: _34("Series") }),
|
|
17849
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Unselect All"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17260
17850
|
antd.Button,
|
|
17261
17851
|
{
|
|
17262
17852
|
size: "small",
|
|
@@ -17276,11 +17866,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17276
17866
|
markAnalyzePrefsTouched();
|
|
17277
17867
|
setSelectedSeriesKeys(values);
|
|
17278
17868
|
},
|
|
17279
|
-
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label:
|
|
17869
|
+
options: numericFields.length > 0 ? numericFields.map((field) => ({ label: field.label, value: field.key })) : [{ label: _34("Count"), value: "__count__" }]
|
|
17280
17870
|
}
|
|
17281
17871
|
)
|
|
17282
17872
|
] }),
|
|
17283
|
-
isAllRowsLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children:
|
|
17873
|
+
isAllRowsLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: token.colorTextSecondary, fontSize: 12 }, children: _34("Loading all rows for analysis...") }),
|
|
17284
17874
|
allRowsError && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: token.colorError, fontSize: 12 }, children: allRowsError })
|
|
17285
17875
|
] })
|
|
17286
17876
|
}
|
|
@@ -17303,11 +17893,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17303
17893
|
styles: { body: { display: "grid", gap: 16, position: "relative", paddingTop: 48 } },
|
|
17304
17894
|
children: [
|
|
17305
17895
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "absolute", top: 0, right: 0, display: "flex", gap: 8 }, children: [
|
|
17306
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17307
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
17896
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Analysis"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.BarChartOutlined, {}), onClick: () => setIsStatsFlipped(false) }) }),
|
|
17897
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _34("Export stats PDF"), children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.FilePdfOutlined, {}), onClick: exportStatsPdf }) })
|
|
17308
17898
|
] }),
|
|
17309
17899
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gap: 16 }, children: [
|
|
17310
|
-
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Card, { size: "small", title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsTitleStyle, children:
|
|
17900
|
+
statsSummary.numericStats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(antd.Card, { size: "small", title: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsTitleStyle, children: _34("Numeric columns") }), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17311
17901
|
antd.Table,
|
|
17312
17902
|
{
|
|
17313
17903
|
dataSource: statsSummary.numericStats,
|
|
@@ -17318,18 +17908,18 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17318
17908
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17319
17909
|
antd.Table.Column,
|
|
17320
17910
|
{
|
|
17321
|
-
title:
|
|
17911
|
+
title: _34("Field"),
|
|
17322
17912
|
dataIndex: "label",
|
|
17323
17913
|
render: (label) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsLabelStyle, children: label }),
|
|
17324
17914
|
onHeaderCell: () => ({ style: statsHeaderStyle })
|
|
17325
17915
|
},
|
|
17326
17916
|
"label"
|
|
17327
17917
|
),
|
|
17328
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
17329
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
17330
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
17331
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
17332
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
17918
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _34("Sum"), align: "right", render: (_unused, row) => renderStatBar(row.sum, statsNumericMaxes.sum, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "sum"),
|
|
17919
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _34("Average"), align: "right", render: (_unused, row) => renderStatBar(row.avg, statsNumericMaxes.avg, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "avg"),
|
|
17920
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _34("Min"), align: "right", render: (_unused, row) => renderStatBar(row.min, statsNumericMaxes.min, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "min"),
|
|
17921
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _34("Max"), align: "right", render: (_unused, row) => renderStatBar(row.max, statsNumericMaxes.max, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "max"),
|
|
17922
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _34("Std Dev"), align: "right", render: (_unused, row) => renderStatBar(row.stddev, statsNumericMaxes.stddev, formatNumberValue), onHeaderCell: () => ({ style: statsHeaderStyle }) }, "stddev")
|
|
17333
17923
|
]
|
|
17334
17924
|
}
|
|
17335
17925
|
) }),
|
|
@@ -17341,7 +17931,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17341
17931
|
items: [
|
|
17342
17932
|
{
|
|
17343
17933
|
key: "categorical-columns",
|
|
17344
|
-
label: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsTitleStyle, children:
|
|
17934
|
+
label: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsTitleStyle, children: _34("Categorical columns (distinct < 20)") }),
|
|
17345
17935
|
children: statsSummary.categoricalStats.map((field) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: 12 }, children: [
|
|
17346
17936
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontWeight: 600, marginBottom: 4 }, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: statsLabelStyle, children: field.label }) }),
|
|
17347
17937
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -17352,11 +17942,11 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17352
17942
|
pagination: false,
|
|
17353
17943
|
rowKey: (row) => row.value,
|
|
17354
17944
|
children: [
|
|
17355
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title:
|
|
17945
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Table.Column, { title: _34("Value"), dataIndex: "value", onHeaderCell: () => ({ style: statsHeaderStyle }) }, "value"),
|
|
17356
17946
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17357
17947
|
antd.Table.Column,
|
|
17358
17948
|
{
|
|
17359
|
-
title:
|
|
17949
|
+
title: _34("Count"),
|
|
17360
17950
|
dataIndex: "count",
|
|
17361
17951
|
align: "right",
|
|
17362
17952
|
onHeaderCell: () => ({ style: statsHeaderStyle }),
|
|
@@ -17397,7 +17987,7 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
|
|
|
17397
17987
|
columnsToggleButton,
|
|
17398
17988
|
listToggleButton,
|
|
17399
17989
|
exportButton,
|
|
17400
|
-
renderIconOnlyButtons(defaultButtons)
|
|
17990
|
+
!model.isNamedQuery && renderIconOnlyButtons(defaultButtons)
|
|
17401
17991
|
] });
|
|
17402
17992
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "jm-tone-scope", style: toneScopeStyle(modelTone), children: [
|
|
17403
17993
|
/* @__PURE__ */ jsxRuntime.jsx(ToneSharedStyles, {}),
|
|
@@ -17439,7 +18029,7 @@ function applyPanesToSearchParams(existing, panes) {
|
|
|
17439
18029
|
panes.forEach((p) => next.append("pane", `${p.resource}:${p.id}`));
|
|
17440
18030
|
return next;
|
|
17441
18031
|
}
|
|
17442
|
-
var
|
|
18032
|
+
var _35 = window._ || ((text) => text);
|
|
17443
18033
|
var LIST_PANEL_ID = "list-panel";
|
|
17444
18034
|
var detailPanelId = (idx) => `detail-panel-${idx}`;
|
|
17445
18035
|
var COLLAPSED_SIZE = 10;
|
|
@@ -17481,7 +18071,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17481
18071
|
minHeight: PANE_TOOLBAR_HEIGHT
|
|
17482
18072
|
},
|
|
17483
18073
|
children: [
|
|
17484
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
18074
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _35("Open in full page"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17485
18075
|
"a",
|
|
17486
18076
|
{
|
|
17487
18077
|
href,
|
|
@@ -17491,7 +18081,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17491
18081
|
children: /* @__PURE__ */ jsxRuntime.jsx(icons.LinkOutlined, { style: { fontSize: 11 } })
|
|
17492
18082
|
}
|
|
17493
18083
|
) }),
|
|
17494
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
18084
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _35("Minimize pane"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17495
18085
|
antd.Button,
|
|
17496
18086
|
{
|
|
17497
18087
|
type: "text",
|
|
@@ -17501,7 +18091,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17501
18091
|
style: { color: token.colorTextTertiary, padding: "0 4px", height: 22, minWidth: 22 }
|
|
17502
18092
|
}
|
|
17503
18093
|
) }),
|
|
17504
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
18094
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _35("Maximize pane"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17505
18095
|
antd.Button,
|
|
17506
18096
|
{
|
|
17507
18097
|
type: "text",
|
|
@@ -17511,7 +18101,7 @@ var PaneToolbar = ({ model, pane, allModels, onClose, onMinimize, onMaximize })
|
|
|
17511
18101
|
style: { color: token.colorTextTertiary, padding: "0 4px", height: 22, minWidth: 22 }
|
|
17512
18102
|
}
|
|
17513
18103
|
) }),
|
|
17514
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title:
|
|
18104
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: _35("Close pane"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17515
18105
|
antd.Button,
|
|
17516
18106
|
{
|
|
17517
18107
|
type: "text",
|
|
@@ -17676,7 +18266,7 @@ var MultiPaneLayout = ({ children }) => {
|
|
|
17676
18266
|
[openDetail]
|
|
17677
18267
|
);
|
|
17678
18268
|
const detailPaneContexts = React6.useMemo(
|
|
17679
|
-
() => panes.map((
|
|
18269
|
+
() => panes.map((_41, idx) => ({
|
|
17680
18270
|
isInMultiPane: true,
|
|
17681
18271
|
paneIndex: idx + 1,
|
|
17682
18272
|
openDetail: (resource, id) => openDetail(idx + 1, resource, id)
|
|
@@ -17737,7 +18327,7 @@ var MultiPaneLayout = ({ children }) => {
|
|
|
17737
18327
|
) });
|
|
17738
18328
|
};
|
|
17739
18329
|
var { Title: Title8 } = antd.Typography;
|
|
17740
|
-
var
|
|
18330
|
+
var _36 = window._ || ((text) => text);
|
|
17741
18331
|
var HierarchyView = ({ resource, recordId, fallback }) => {
|
|
17742
18332
|
const go = core.useGo();
|
|
17743
18333
|
const { data: ancestorsData, isLoading: ancestorsLoading, error: ancestorsError } = core.useCustom({
|
|
@@ -17790,15 +18380,15 @@ var HierarchyView = ({ resource, recordId, fallback }) => {
|
|
|
17790
18380
|
}
|
|
17791
18381
|
if (ancestorsError || descendantsError) {
|
|
17792
18382
|
if (fallback) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback });
|
|
17793
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { message:
|
|
18383
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Alert, { message: _36("Error loading hierarchy data"), type: "error" });
|
|
17794
18384
|
}
|
|
17795
18385
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
17796
18386
|
ancestorsList.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: 24 }, children: [
|
|
17797
|
-
/* @__PURE__ */ jsxRuntime.jsx(Title8, { level: 5, children:
|
|
18387
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title8, { level: 5, children: _36("Parent Hierarchy") }),
|
|
17798
18388
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Breadcrumb, { children: ancestorsList.slice().reverse().map((node) => /* @__PURE__ */ jsxRuntime.jsx(antd.Breadcrumb.Item, { children: /* @__PURE__ */ jsxRuntime.jsx("a", { onClick: () => go({ to: { resource, action: "show", id: node.cw_eid } }), children: node._label }) }, node.cw_eid)) })
|
|
17799
18389
|
] }),
|
|
17800
18390
|
treeData.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
17801
|
-
/* @__PURE__ */ jsxRuntime.jsx(Title8, { level: 5, children:
|
|
18391
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title8, { level: 5, children: _36("Sub-hierarchy") }),
|
|
17802
18392
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17803
18393
|
antd.Tree,
|
|
17804
18394
|
{
|
|
@@ -17870,7 +18460,7 @@ var TOKEN_KEY2 = "jm_access_token";
|
|
|
17870
18460
|
var USER_KEY2 = "jm_user";
|
|
17871
18461
|
var ROLE_PERMISSIONS_KEY = "jm_role_permissions";
|
|
17872
18462
|
var RESOURCE_PERMISSIONS_KEY = "jm_resource_permissions";
|
|
17873
|
-
var
|
|
18463
|
+
var _37 = window._ || ((text) => text);
|
|
17874
18464
|
var authProvider = {
|
|
17875
18465
|
/**
|
|
17876
18466
|
* Authenticate by username + password.
|
|
@@ -17888,8 +18478,8 @@ var authProvider = {
|
|
|
17888
18478
|
return {
|
|
17889
18479
|
success: false,
|
|
17890
18480
|
error: {
|
|
17891
|
-
name:
|
|
17892
|
-
message: body?.detail ||
|
|
18481
|
+
name: _37("Login failed"),
|
|
18482
|
+
message: body?.detail || _37("Invalid credentials")
|
|
17893
18483
|
}
|
|
17894
18484
|
};
|
|
17895
18485
|
}
|
|
@@ -17921,8 +18511,8 @@ var authProvider = {
|
|
|
17921
18511
|
return {
|
|
17922
18512
|
success: false,
|
|
17923
18513
|
error: {
|
|
17924
|
-
name:
|
|
17925
|
-
message: err?.message ||
|
|
18514
|
+
name: _37("Login failed"),
|
|
18515
|
+
message: err?.message || _37("Network error")
|
|
17926
18516
|
}
|
|
17927
18517
|
};
|
|
17928
18518
|
}
|
|
@@ -18003,7 +18593,7 @@ var authProvider = {
|
|
|
18003
18593
|
var USER_KEY3 = "jm_user";
|
|
18004
18594
|
var ROLE_PERMISSIONS_KEY2 = "jm_role_permissions";
|
|
18005
18595
|
var RESOURCE_PERMISSIONS_KEY2 = "jm_resource_permissions";
|
|
18006
|
-
var
|
|
18596
|
+
var _38 = window._ || ((text) => text);
|
|
18007
18597
|
var FALLBACK_ROLE_ACTIONS = {
|
|
18008
18598
|
Admin: ["list", "show", "create", "edit", "delete", "clone", "field"],
|
|
18009
18599
|
Manager: ["list", "show", "create", "edit", "clone", "field"],
|
|
@@ -18035,13 +18625,13 @@ var accessControlProvider = {
|
|
|
18035
18625
|
can: async ({ action, resource }) => {
|
|
18036
18626
|
const cached = localStorage.getItem(USER_KEY3);
|
|
18037
18627
|
if (!cached) {
|
|
18038
|
-
return { can: false, reason:
|
|
18628
|
+
return { can: false, reason: _38("Not authenticated") };
|
|
18039
18629
|
}
|
|
18040
18630
|
let user;
|
|
18041
18631
|
try {
|
|
18042
18632
|
user = JSON.parse(cached);
|
|
18043
18633
|
} catch {
|
|
18044
|
-
return { can: false, reason:
|
|
18634
|
+
return { can: false, reason: _38("Not authenticated") };
|
|
18045
18635
|
}
|
|
18046
18636
|
const roles = user?.roles ?? [];
|
|
18047
18637
|
if (roles.some((r) => r.toLowerCase() === "admin")) {
|
|
@@ -18067,7 +18657,7 @@ var accessControlProvider = {
|
|
|
18067
18657
|
}
|
|
18068
18658
|
return {
|
|
18069
18659
|
can: false,
|
|
18070
|
-
reason:
|
|
18660
|
+
reason: _38("Access denied \u2014 insufficient role for this action")
|
|
18071
18661
|
};
|
|
18072
18662
|
},
|
|
18073
18663
|
options: {
|
|
@@ -18155,7 +18745,7 @@ var ResourceContext = React6.createContext({
|
|
|
18155
18745
|
allResources: [],
|
|
18156
18746
|
allSystemModels: []
|
|
18157
18747
|
});
|
|
18158
|
-
var
|
|
18748
|
+
var _39 = window._ || ((text) => text);
|
|
18159
18749
|
var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
18160
18750
|
const { mutate: login, isLoading, error } = core.useLogin();
|
|
18161
18751
|
const [form] = antd.Form.useForm();
|
|
@@ -18184,14 +18774,14 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18184
18774
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "center" }, children: [
|
|
18185
18775
|
logo && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: 8 }, children: typeof logo === "string" ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: appTitle, style: { height: 48, width: "auto" } }) : logo }),
|
|
18186
18776
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Title, { level: 3, style: { marginBottom: 4 }, children: appTitle }),
|
|
18187
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", children:
|
|
18777
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", children: _39("Sign in to your account") })
|
|
18188
18778
|
] }),
|
|
18189
18779
|
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18190
18780
|
antd.Alert,
|
|
18191
18781
|
{
|
|
18192
18782
|
type: "error",
|
|
18193
|
-
message: error?.name ||
|
|
18194
|
-
description: error?.message ||
|
|
18783
|
+
message: error?.name || _39("Login failed"),
|
|
18784
|
+
description: error?.message || _39("Invalid credentials"),
|
|
18195
18785
|
showIcon: true
|
|
18196
18786
|
}
|
|
18197
18787
|
),
|
|
@@ -18207,13 +18797,13 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18207
18797
|
antd.Form.Item,
|
|
18208
18798
|
{
|
|
18209
18799
|
name: "username",
|
|
18210
|
-
label:
|
|
18211
|
-
rules: [{ required: true, message:
|
|
18800
|
+
label: _39("Username"),
|
|
18801
|
+
rules: [{ required: true, message: _39("Please enter your username") }],
|
|
18212
18802
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18213
18803
|
antd.Input,
|
|
18214
18804
|
{
|
|
18215
18805
|
prefix: /* @__PURE__ */ jsxRuntime.jsx(icons.UserOutlined, {}),
|
|
18216
|
-
placeholder:
|
|
18806
|
+
placeholder: _39("Username"),
|
|
18217
18807
|
size: "large"
|
|
18218
18808
|
}
|
|
18219
18809
|
)
|
|
@@ -18223,13 +18813,13 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18223
18813
|
antd.Form.Item,
|
|
18224
18814
|
{
|
|
18225
18815
|
name: "password",
|
|
18226
|
-
label:
|
|
18227
|
-
rules: [{ required: true, message:
|
|
18816
|
+
label: _39("Password"),
|
|
18817
|
+
rules: [{ required: true, message: _39("Please enter your password") }],
|
|
18228
18818
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18229
18819
|
antd.Input.Password,
|
|
18230
18820
|
{
|
|
18231
18821
|
prefix: /* @__PURE__ */ jsxRuntime.jsx(icons.LockOutlined, {}),
|
|
18232
|
-
placeholder:
|
|
18822
|
+
placeholder: _39("Password"),
|
|
18233
18823
|
size: "large"
|
|
18234
18824
|
}
|
|
18235
18825
|
)
|
|
@@ -18243,7 +18833,7 @@ var LoginPage = ({ appTitle = "VeloIQ", logo }) => {
|
|
|
18243
18833
|
loading: isLoading,
|
|
18244
18834
|
block: true,
|
|
18245
18835
|
size: "large",
|
|
18246
|
-
children:
|
|
18836
|
+
children: _39("Login")
|
|
18247
18837
|
}
|
|
18248
18838
|
) })
|
|
18249
18839
|
]
|
|
@@ -18382,6 +18972,7 @@ var CellConfigDrawer = ({ open, cell, tabId, config, onClose, onSave }) => {
|
|
|
18382
18972
|
onSave({ ...config, tabs: nextTabs });
|
|
18383
18973
|
onClose();
|
|
18384
18974
|
};
|
|
18975
|
+
const tabOptions = config.tabs.map((t) => ({ value: t.name, label: t.name }));
|
|
18385
18976
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18386
18977
|
antd.Drawer,
|
|
18387
18978
|
{
|
|
@@ -18396,7 +18987,14 @@ var CellConfigDrawer = ({ open, cell, tabId, config, onClose, onSave }) => {
|
|
|
18396
18987
|
] }),
|
|
18397
18988
|
children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Form, { form, layout: "vertical", size: "small", children: [
|
|
18398
18989
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Divider, { orientation: "left", children: "Tab" }),
|
|
18399
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: "tabName", label: "Tab name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18990
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: "tabName", label: "Tab name", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18991
|
+
antd.AutoComplete,
|
|
18992
|
+
{
|
|
18993
|
+
options: tabOptions,
|
|
18994
|
+
filterOption: false,
|
|
18995
|
+
placeholder: "Select existing or type a new name"
|
|
18996
|
+
}
|
|
18997
|
+
) }),
|
|
18400
18998
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Divider, { orientation: "left", children: "Position" }),
|
|
18401
18999
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
|
|
18402
19000
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { name: "row", label: "Row", style: { marginBottom: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(antd.InputNumber, { min: 1, style: { width: 80 } }) }),
|
|
@@ -18436,10 +19034,12 @@ var CellConfigDrawer = ({ open, cell, tabId, config, onClose, onSave }) => {
|
|
|
18436
19034
|
}
|
|
18437
19035
|
);
|
|
18438
19036
|
};
|
|
18439
|
-
var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigure, onMaximize, onMinimize }) => {
|
|
19037
|
+
var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigure, onMaximize, onMinimize, onResize }) => {
|
|
18440
19038
|
const { token } = antd.theme.useToken();
|
|
18441
19039
|
const model = findModelByName(allModels, cell.model);
|
|
19040
|
+
const cellRef = React6.useRef(null);
|
|
18442
19041
|
const cellStyle = {
|
|
19042
|
+
position: "relative",
|
|
18443
19043
|
border: `1px solid ${token.colorBorderSecondary}`,
|
|
18444
19044
|
borderRadius: token.borderRadiusLG,
|
|
18445
19045
|
overflow: "hidden",
|
|
@@ -18468,20 +19068,81 @@ var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigur
|
|
|
18468
19068
|
};
|
|
18469
19069
|
const resource = model?.resource || cell.model;
|
|
18470
19070
|
const cellTitle = model?.label || cell.model;
|
|
18471
|
-
|
|
19071
|
+
const tone = model ? getModelTone(model) : null;
|
|
19072
|
+
const startResize = React6.useCallback((e, dir) => {
|
|
19073
|
+
e.preventDefault();
|
|
19074
|
+
e.stopPropagation();
|
|
19075
|
+
const el = cellRef.current;
|
|
19076
|
+
if (!el) return;
|
|
19077
|
+
const { width: startW, height: startH } = el.getBoundingClientRect();
|
|
19078
|
+
const startX = e.clientX;
|
|
19079
|
+
const startY = e.clientY;
|
|
19080
|
+
const handle = e.currentTarget;
|
|
19081
|
+
handle.setPointerCapture(e.pointerId);
|
|
19082
|
+
const prevCursor = document.body.style.cursor;
|
|
19083
|
+
document.body.style.cursor = dir === "s" ? "ns-resize" : dir === "e" ? "ew-resize" : "nwse-resize";
|
|
19084
|
+
const onMove = (ev) => {
|
|
19085
|
+
if (dir !== "e") el.style.minHeight = `${Math.max(200, Math.round(startH + ev.clientY - startY))}px`;
|
|
19086
|
+
if (dir !== "s") el.style.minWidth = `${Math.max(200, Math.round(startW + ev.clientX - startX))}px`;
|
|
19087
|
+
};
|
|
19088
|
+
const onUp = (ev) => {
|
|
19089
|
+
handle.removeEventListener("pointermove", onMove);
|
|
19090
|
+
handle.removeEventListener("pointerup", onUp);
|
|
19091
|
+
document.body.style.cursor = prevCursor;
|
|
19092
|
+
const newH = dir !== "e" ? `${Math.max(200, Math.round(startH + ev.clientY - startY))}px` : null;
|
|
19093
|
+
const newW = dir !== "s" ? `${Math.max(200, Math.round(startW + ev.clientX - startX))}px` : null;
|
|
19094
|
+
onResize(newW, newH);
|
|
19095
|
+
};
|
|
19096
|
+
handle.addEventListener("pointermove", onMove);
|
|
19097
|
+
handle.addEventListener("pointerup", onUp);
|
|
19098
|
+
}, [onResize]);
|
|
19099
|
+
const handleBase = {
|
|
19100
|
+
position: "absolute",
|
|
19101
|
+
zIndex: 10
|
|
19102
|
+
};
|
|
19103
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: cellRef, style: cellStyle, className: "jm-dashboard-cell", children: [
|
|
18472
19104
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
18473
|
-
.jm-dashboard-cell .jm-cell-actions
|
|
18474
|
-
.jm-dashboard-cell:hover .jm-cell-actions
|
|
19105
|
+
.jm-dashboard-cell .jm-cell-actions { opacity: 0; transition: opacity 0.15s; }
|
|
19106
|
+
.jm-dashboard-cell:hover .jm-cell-actions { opacity: 1; }
|
|
19107
|
+
.jm-dashboard-cell .jm-resize-handle { opacity: 0; transition: opacity 0.15s; background: transparent; }
|
|
19108
|
+
.jm-dashboard-cell:hover .jm-resize-handle { opacity: 1; }
|
|
19109
|
+
.jm-resize-handle:hover { background: rgba(128,128,128,0.25) !important; }
|
|
19110
|
+
.jm-resize-handle:active { background: rgba(128,128,128,0.45) !important; }
|
|
18475
19111
|
` }),
|
|
19112
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19113
|
+
"div",
|
|
19114
|
+
{
|
|
19115
|
+
className: "jm-resize-handle",
|
|
19116
|
+
style: { ...handleBase, bottom: 0, left: 12, right: 12, height: 6, cursor: "ns-resize" },
|
|
19117
|
+
onPointerDown: (e) => startResize(e, "s")
|
|
19118
|
+
}
|
|
19119
|
+
),
|
|
19120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19121
|
+
"div",
|
|
19122
|
+
{
|
|
19123
|
+
className: "jm-resize-handle",
|
|
19124
|
+
style: { ...handleBase, top: 12, right: 0, bottom: 12, width: 6, cursor: "ew-resize" },
|
|
19125
|
+
onPointerDown: (e) => startResize(e, "e")
|
|
19126
|
+
}
|
|
19127
|
+
),
|
|
19128
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19129
|
+
"div",
|
|
19130
|
+
{
|
|
19131
|
+
className: "jm-resize-handle",
|
|
19132
|
+
style: { ...handleBase, bottom: 0, right: 0, width: 12, height: 12, cursor: "nwse-resize", borderRadius: `0 0 ${token.borderRadiusLG}px 0` },
|
|
19133
|
+
onPointerDown: (e) => startResize(e, "se")
|
|
19134
|
+
}
|
|
19135
|
+
),
|
|
18476
19136
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: toolbarStyle, children: [
|
|
18477
19137
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: {
|
|
18478
|
-
fontSize:
|
|
18479
|
-
fontWeight:
|
|
18480
|
-
color: token.colorText,
|
|
19138
|
+
fontSize: 14,
|
|
19139
|
+
fontWeight: 700,
|
|
19140
|
+
color: tone ? tone.solid : token.colorText,
|
|
18481
19141
|
paddingLeft: 4,
|
|
18482
19142
|
overflow: "hidden",
|
|
18483
19143
|
textOverflow: "ellipsis",
|
|
18484
|
-
whiteSpace: "nowrap"
|
|
19144
|
+
whiteSpace: "nowrap",
|
|
19145
|
+
letterSpacing: "-0.01em"
|
|
18485
19146
|
}, children: cellTitle }),
|
|
18486
19147
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "jm-cell-actions", style: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
18487
19148
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: "Configure cell", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18524,9 +19185,10 @@ var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigur
|
|
|
18524
19185
|
allModels,
|
|
18525
19186
|
isEmbedded: true,
|
|
18526
19187
|
preferencesResourceOverride: `dashboard:${resource}`,
|
|
18527
|
-
defaultListVisible:
|
|
19188
|
+
defaultListVisible: Boolean(cell.view_type),
|
|
18528
19189
|
listViewType: cell.view_type ? cell.view_type : model.listViewType
|
|
18529
|
-
}
|
|
19190
|
+
},
|
|
19191
|
+
`${resource}-${cell.view_type ?? ""}`
|
|
18530
19192
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
18531
19193
|
antd.Empty,
|
|
18532
19194
|
{
|
|
@@ -18537,7 +19199,7 @@ var DashboardGridCell = ({ cell, allModels, isMaximized, isMinimized, onConfigur
|
|
|
18537
19199
|
) })
|
|
18538
19200
|
] });
|
|
18539
19201
|
};
|
|
18540
|
-
var DashboardTabContent = ({ tab, allModels, maximizedCellId, minimizedCellIds, onMaximize, onMinimize, onConfigure }) => {
|
|
19202
|
+
var DashboardTabContent = ({ tab, allModels, maximizedCellId, minimizedCellIds, onMaximize, onMinimize, onConfigure, onResize }) => {
|
|
18541
19203
|
const cells = tab.cells;
|
|
18542
19204
|
const numCols = React6.useMemo(() => {
|
|
18543
19205
|
if (!cells.length) return 2;
|
|
@@ -18576,7 +19238,8 @@ var DashboardTabContent = ({ tab, allModels, maximizedCellId, minimizedCellIds,
|
|
|
18576
19238
|
isMinimized: minimizedCellIds.has(cell.id),
|
|
18577
19239
|
onConfigure: () => onConfigure(cell),
|
|
18578
19240
|
onMaximize: () => onMaximize(cell.id),
|
|
18579
|
-
onMinimize: () => onMinimize(cell.id)
|
|
19241
|
+
onMinimize: () => onMinimize(cell.id),
|
|
19242
|
+
onResize: (w, h) => onResize(cell.id, w, h)
|
|
18580
19243
|
}
|
|
18581
19244
|
)
|
|
18582
19245
|
},
|
|
@@ -18608,6 +19271,23 @@ var ViewsGrid = ({ config, allModels, onConfigChange }) => {
|
|
|
18608
19271
|
onConfigChange(nextConfig);
|
|
18609
19272
|
setDrawerSelection(null);
|
|
18610
19273
|
}, [onConfigChange]);
|
|
19274
|
+
const handleResizeCell = React6.useCallback((tabId, cellId, minWidth, minHeight) => {
|
|
19275
|
+
const nextTabs = config.tabs.map((tab) => {
|
|
19276
|
+
if (tab.id !== tabId) return tab;
|
|
19277
|
+
return {
|
|
19278
|
+
...tab,
|
|
19279
|
+
cells: tab.cells.map((c) => {
|
|
19280
|
+
if (c.id !== cellId) return c;
|
|
19281
|
+
return {
|
|
19282
|
+
...c,
|
|
19283
|
+
...minWidth !== null ? { min_width: minWidth } : {},
|
|
19284
|
+
...minHeight !== null ? { min_height: minHeight } : {}
|
|
19285
|
+
};
|
|
19286
|
+
})
|
|
19287
|
+
};
|
|
19288
|
+
});
|
|
19289
|
+
onConfigChange({ ...config, tabs: nextTabs });
|
|
19290
|
+
}, [config, onConfigChange]);
|
|
18611
19291
|
const tabItems = React6.useMemo(
|
|
18612
19292
|
() => config.tabs.map((tab) => ({
|
|
18613
19293
|
key: tab.id,
|
|
@@ -18621,11 +19301,12 @@ var ViewsGrid = ({ config, allModels, onConfigChange }) => {
|
|
|
18621
19301
|
minimizedCellIds,
|
|
18622
19302
|
onMaximize: handleMaximize,
|
|
18623
19303
|
onMinimize: handleMinimize,
|
|
18624
|
-
onConfigure: (cell) => handleOpenDrawer(tab.id, cell)
|
|
19304
|
+
onConfigure: (cell) => handleOpenDrawer(tab.id, cell),
|
|
19305
|
+
onResize: (cellId, w, h) => handleResizeCell(tab.id, cellId, w, h)
|
|
18625
19306
|
}
|
|
18626
19307
|
)
|
|
18627
19308
|
})),
|
|
18628
|
-
[config.tabs, allModels, maximizedCellId, minimizedCellIds, handleMaximize, handleMinimize, handleOpenDrawer]
|
|
19309
|
+
[config.tabs, allModels, maximizedCellId, minimizedCellIds, handleMaximize, handleMinimize, handleOpenDrawer, handleResizeCell]
|
|
18629
19310
|
);
|
|
18630
19311
|
if (!config.tabs.length) {
|
|
18631
19312
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "No tabs configured. Run veloiq add-dashboard to add models.", style: { padding: 48 } });
|
|
@@ -18664,7 +19345,7 @@ function parseInlineStyle3(cssText) {
|
|
|
18664
19345
|
const prop = declaration.slice(0, idx).trim();
|
|
18665
19346
|
const value = declaration.slice(idx + 1).trim();
|
|
18666
19347
|
if (!prop || !value) return;
|
|
18667
|
-
const camel = prop.replace(/-([a-z])/g, (
|
|
19348
|
+
const camel = prop.replace(/-([a-z])/g, (_41, c) => c.toUpperCase());
|
|
18668
19349
|
result[camel] = value;
|
|
18669
19350
|
});
|
|
18670
19351
|
return result;
|
|
@@ -18689,7 +19370,7 @@ function useRecentActivity(days) {
|
|
|
18689
19370
|
return { data, loading, reload: load };
|
|
18690
19371
|
}
|
|
18691
19372
|
var { Text: Text2, Title: Title9 } = antd.Typography;
|
|
18692
|
-
function
|
|
19373
|
+
function relativeTime2(iso) {
|
|
18693
19374
|
if (!iso) return "";
|
|
18694
19375
|
const diff = Date.now() - new Date(iso).getTime();
|
|
18695
19376
|
const mins = Math.floor(diff / 6e4);
|
|
@@ -18798,7 +19479,7 @@ var RecentActivityPanel = () => {
|
|
|
18798
19479
|
}
|
|
18799
19480
|
),
|
|
18800
19481
|
isNew && /* @__PURE__ */ jsxRuntime.jsx(antd.Tag, { color: "green", style: { fontSize: 10, padding: "0 4px", lineHeight: "16px" }, children: "new" }),
|
|
18801
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text2, { type: "secondary", style: { fontSize: 11, flexShrink: 0 }, children:
|
|
19482
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text2, { type: "secondary", style: { fontSize: 11, flexShrink: 0 }, children: relativeTime2(timestamp) })
|
|
18802
19483
|
] })
|
|
18803
19484
|
]
|
|
18804
19485
|
}
|
|
@@ -18964,7 +19645,7 @@ var PinnedRecordsPanel = () => {
|
|
|
18964
19645
|
] });
|
|
18965
19646
|
};
|
|
18966
19647
|
var { Text: Text3 } = antd.Typography;
|
|
18967
|
-
var
|
|
19648
|
+
var _40 = window._ || ((text) => text);
|
|
18968
19649
|
var DashboardPage = () => {
|
|
18969
19650
|
const { token } = antd.theme.useToken();
|
|
18970
19651
|
const allModels = useAllModels();
|
|
@@ -18993,7 +19674,7 @@ var DashboardPage = () => {
|
|
|
18993
19674
|
const tabs = [
|
|
18994
19675
|
{
|
|
18995
19676
|
key: "models_grid",
|
|
18996
|
-
label:
|
|
19677
|
+
label: _40("Models Grid"),
|
|
18997
19678
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "calc(100vh - 140px)", overflow: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18998
19679
|
ViewsGrid,
|
|
18999
19680
|
{
|
|
@@ -19005,12 +19686,12 @@ var DashboardPage = () => {
|
|
|
19005
19686
|
},
|
|
19006
19687
|
{
|
|
19007
19688
|
key: "recent_activity",
|
|
19008
|
-
label:
|
|
19689
|
+
label: _40("Recent Activity"),
|
|
19009
19690
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "calc(100vh - 140px)", overflow: "auto", padding: "0 12px" }, children: /* @__PURE__ */ jsxRuntime.jsx(RecentActivityPanel, {}) })
|
|
19010
19691
|
},
|
|
19011
19692
|
{
|
|
19012
19693
|
key: "pinned_records",
|
|
19013
|
-
label:
|
|
19694
|
+
label: _40("Pinned Records"),
|
|
19014
19695
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "calc(100vh - 140px)", overflow: "auto", padding: "0 12px" }, children: /* @__PURE__ */ jsxRuntime.jsx(PinnedRecordsPanel, {}) })
|
|
19015
19696
|
}
|
|
19016
19697
|
];
|